summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/assembly/aarch64-pointer-auth.rs1
-rw-r--r--src/test/assembly/asm/aarch64-types.rs2
-rw-r--r--src/test/assembly/asm/arm-types.rs2
-rw-r--r--src/test/assembly/asm/avr-modifiers.rs1
-rw-r--r--src/test/assembly/asm/avr-types.rs3
-rw-r--r--src/test/assembly/asm/bpf-types.rs3
-rw-r--r--src/test/assembly/asm/global_asm.rs6
-rw-r--r--src/test/assembly/asm/hexagon-types.rs2
-rw-r--r--src/test/assembly/asm/mips-types.rs2
-rw-r--r--src/test/assembly/asm/msp430-types.rs3
-rw-r--r--src/test/assembly/asm/nvptx-types.rs2
-rw-r--r--src/test/assembly/asm/powerpc-types.rs3
-rw-r--r--src/test/assembly/asm/riscv-types.rs2
-rw-r--r--src/test/assembly/asm/s390x-types.rs2
-rw-r--r--src/test/assembly/asm/wasm-types.rs2
-rw-r--r--src/test/assembly/asm/x86-types.rs2
-rw-r--r--src/test/assembly/stack-protector/stack-protector-target-support.rs1
-rw-r--r--src/test/assembly/x86-stack-probes.rs42
-rw-r--r--src/test/assembly/x86_64-floating-point-clamp.rs25
-rw-r--r--src/test/auxiliary/rust_test_helpers.c12
-rw-r--r--src/test/codegen-units/item-collection/asm-sym.rs20
-rw-r--r--src/test/codegen-units/item-collection/generic-impl.rs6
-rw-r--r--src/test/codegen/README.md22
-rw-r--r--src/test/codegen/abi-main-signature-32bit-c-int.rs2
-rw-r--r--src/test/codegen/abi-repr-ext.rs46
-rw-r--r--src/test/codegen/asm-may_unwind.rs1
-rw-r--r--src/test/codegen/async-fn-debug-awaitee-field.rs4
-rw-r--r--src/test/codegen/async-fn-debug-msvc.rs7
-rw-r--r--src/test/codegen/atomic-operations-llvm-12.rs84
-rw-r--r--src/test/codegen/atomic-operations.rs1
-rw-r--r--src/test/codegen/avr/avr-func-addrspace.rs2
-rw-r--r--src/test/codegen/binary-search-index-no-bound-check.rs20
-rw-r--r--src/test/codegen/branch-protection.rs1
-rw-r--r--src/test/codegen/debug-vtable.rs2
-rw-r--r--src/test/codegen/deduced-param-attrs.rs60
-rw-r--r--src/test/codegen/external-no-mangle-statics.rs5
-rw-r--r--src/test/codegen/function-arguments.rs2
-rw-r--r--src/test/codegen/generator-debug-msvc.rs12
-rw-r--r--src/test/codegen/generator-debug.rs4
-rw-r--r--src/test/codegen/instrument-coverage.rs17
-rw-r--r--src/test/codegen/intrinsics/mask.rs11
-rw-r--r--src/test/codegen/issue-34634.rs2
-rw-r--r--src/test/codegen/issue-85872-multiple-reverse.rs20
-rw-r--r--src/test/codegen/issue-96274.rs17
-rw-r--r--src/test/codegen/issue-98294-get-mut-copy-from-slice-opt.rs19
-rw-r--r--src/test/codegen/layout-size-checks.rs31
-rw-r--r--src/test/codegen/mem-replace-direct-memcpy.rs13
-rw-r--r--src/test/codegen/merge-functions.rs7
-rw-r--r--src/test/codegen/mir-inlined-line-numbers.rs25
-rw-r--r--src/test/codegen/pic-relocation-model.rs7
-rw-r--r--src/test/codegen/pie-relocation-model.rs2
-rw-r--r--src/test/codegen/sanitizer_scs_attr_check.rs6
-rw-r--r--src/test/codegen/slice-iter-len-eq-zero.rs14
-rw-r--r--src/test/codegen/slice_as_from_ptr_range.rs23
-rw-r--r--src/test/codegen/some-abis-do-extend-params-to-32-bits.rs204
-rw-r--r--src/test/codegen/stack-probes-call.rs24
-rw-r--r--src/test/codegen/stack-probes-inline.rs32
-rw-r--r--src/test/codegen/stack-probes.rs22
-rw-r--r--src/test/codegen/try_question_mark_nop.rs54
-rw-r--r--src/test/codegen/unwind-abis/aapcs-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs2
-rw-r--r--src/test/codegen/unwind-abis/c-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/cdecl-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/fastcall-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs2
-rw-r--r--src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs2
-rw-r--r--src/test/codegen/unwind-abis/nounwind.rs2
-rw-r--r--src/test/codegen/unwind-abis/stdcall-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/system-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/sysv64-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/thiscall-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-abis/win64-unwind-abi.rs2
-rw-r--r--src/test/codegen/unwind-extern-exports.rs2
-rw-r--r--src/test/codegen/vec-calloc.rs19
-rw-r--r--src/test/codegen/vec-in-place.rs2
-rw-r--r--src/test/debuginfo/collapse-debuginfo-no-attr-flag.rs61
-rw-r--r--src/test/debuginfo/collapse-debuginfo-no-attr.rs60
-rw-r--r--src/test/debuginfo/collapse-debuginfo-with-attr-flag.rs63
-rw-r--r--src/test/debuginfo/collapse-debuginfo-with-attr.rs59
-rw-r--r--src/test/debuginfo/generator-objects.rs13
-rw-r--r--src/test/debuginfo/msvc-pretty-enums.rs212
-rw-r--r--src/test/debuginfo/msvc-scalarpair-params.rs8
-rw-r--r--src/test/debuginfo/mutex.rs15
-rw-r--r--src/test/debuginfo/numeric-types.rs87
-rw-r--r--src/test/debuginfo/pretty-std.rs22
-rw-r--r--src/test/debuginfo/result-types.rs11
-rw-r--r--src/test/debuginfo/type-names.rs34
-rw-r--r--src/test/incremental/hashes/enum_defs.rs8
-rw-r--r--src/test/incremental/hashes/function_interfaces.rs2
-rw-r--r--src/test/incremental/hashes/trait_defs.rs16
-rw-r--r--src/test/incremental/hygiene/load_cached_hygiene.rs2
-rw-r--r--src/test/incremental/issue-100521-change-struct-name-assocty.rs65
-rw-r--r--src/test/incremental/issue-49043.rs2
-rw-r--r--src/test/incremental/issue-61323.rs3
-rw-r--r--src/test/incremental/spans_significant_w_panic.rs1
-rw-r--r--src/test/incremental/split_debuginfo_cached.rs4
-rw-r--r--src/test/incremental/split_debuginfo_mode.rs8
-rw-r--r--src/test/incremental/thinlto/cgu_invalidated_when_export_added.rs2
-rw-r--r--src/test/incremental/thinlto/cgu_invalidated_when_export_removed.rs2
-rw-r--r--src/test/mir-opt/README.md12
-rw-r--r--src/test/mir-opt/array-index-is-temporary.rs2
-rw-r--r--src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir64
-rw-r--r--src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.32bit.mir)0
-rw-r--r--src/test/mir-opt/asm_unwind_panic_abort.rs1
-rw-r--r--src/test/mir-opt/bool_compare.rs2
-rw-r--r--src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff77
-rw-r--r--src/test/mir-opt/combine_array_len.norm2.InstCombine.diff (renamed from src/test/mir-opt/combine_array_len.norm2.InstCombine.32bit.diff)0
-rw-r--r--src/test/mir-opt/combine_array_len.rs2
-rw-r--r--src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff80
-rw-r--r--src/test/mir-opt/const_goto.rs2
-rw-r--r--src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff2
-rw-r--r--src/test/mir-opt/const_goto_storage.rs2
-rw-r--r--src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff8
-rw-r--r--src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir2
-rw-r--r--src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff8
-rw-r--r--src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/aggregate.rs1
-rw-r--r--src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff7
-rw-r--r--src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff7
-rw-r--r--src/test/mir-opt/const_prop/array_index.rs1
-rw-r--r--src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff10
-rw-r--r--src/test/mir-opt/const_prop/bad_op_div_by_zero.rs1
-rw-r--r--src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff2
-rw-r--r--src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff2
-rw-r--r--src/test/mir-opt/const_prop/boolean_identities.rs1
-rw-r--r--src/test/mir-opt/const_prop/boxes.main.ConstProp.diff13
-rw-r--r--src/test/mir-opt/const_prop/boxes.rs1
-rw-r--r--src/test/mir-opt/const_prop/cast.main.ConstProp.diff6
-rw-r--r--src/test/mir-opt/const_prop/cast.rs1
-rw-r--r--src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/checked_add.rs1
-rw-r--r--src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff8
-rw-r--r--src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs1
-rw-r--r--src/test/mir-opt/const_prop/control-flow-simplification.rs7
-rw-r--r--src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff3
-rw-r--r--src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff2
-rw-r--r--src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff2
-rw-r--r--src/test/mir-opt/const_prop/discriminant.rs1
-rw-r--r--src/test/mir-opt/const_prop/indirect.main.ConstProp.diff6
-rw-r--r--src/test/mir-opt/const_prop/indirect.rs1
-rw-r--r--src/test/mir-opt/const_prop/issue-66971.rs1
-rw-r--r--src/test/mir-opt/const_prop/issue-67019.rs1
-rw-r--r--src/test/mir-opt/const_prop/issue_66971.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/mult_by_zero.rs1
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable.rs1
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_aggregate.rs1
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs1
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs1
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_no_prop.rs1
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff5
-rw-r--r--src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs1
-rw-r--r--src/test/mir-opt/const_prop/optimizes_into_variable.rs1
-rw-r--r--src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/read_immutable_static.rs1
-rw-r--r--src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff2
-rw-r--r--src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff2
-rw-r--r--src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff4
-rw-r--r--src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff4
-rw-r--r--src/test/mir-opt/const_prop/ref_deref_project.rs1
-rw-r--r--src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff2
-rw-r--r--src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff2
-rw-r--r--src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff2
-rw-r--r--src/test/mir-opt/deaggregator_test.rs2
-rw-r--r--src/test/mir-opt/deaggregator_test_enum.rs2
-rw-r--r--src/test/mir-opt/deaggregator_test_enum_2.rs1
-rw-r--r--src/test/mir-opt/deaggregator_test_multiple.rs1
-rw-r--r--src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff89
-rw-r--r--src/test/mir-opt/deduplicate_blocks.rs2
-rw-r--r--src/test/mir-opt/derefer_complex_case.main.Derefer.diff24
-rw-r--r--src/test/mir-opt/derefer_complex_case.rs1
-rw-r--r--src/test/mir-opt/derefer_inline_test.main.Derefer.diff4
-rw-r--r--src/test/mir-opt/derefer_inline_test.rs1
-rw-r--r--src/test/mir-opt/derefer_terminator_test.main.Derefer.diff11
-rw-r--r--src/test/mir-opt/derefer_terminator_test.rs1
-rw-r--r--src/test/mir-opt/derefer_test.main.Derefer.diff4
-rw-r--r--src/test/mir-opt/derefer_test.rs1
-rw-r--r--src/test/mir-opt/derefer_test_multiple.main.Derefer.diff12
-rw-r--r--src/test/mir-opt/derefer_test_multiple.rs1
-rw-r--r--src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff4
-rw-r--r--src/test/mir-opt/dest-prop/union.rs2
-rw-r--r--src/test/mir-opt/early_otherwise_branch_68867.rs5
-rw-r--r--src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyConstCondition-final.after.diff344
-rw-r--r--src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff36
-rw-r--r--src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff8
-rw-r--r--src/test/mir-opt/enum_cast.bar.mir_map.0.mir10
-rw-r--r--src/test/mir-opt/enum_cast.boo.mir_map.0.mir10
-rw-r--r--src/test/mir-opt/enum_cast.droppy.mir_map.0.mir40
-rw-r--r--src/test/mir-opt/enum_cast.foo.mir_map.0.mir10
-rw-r--r--src/test/mir-opt/equal_true.rs2
-rw-r--r--src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir16
-rw-r--r--src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff24
-rw-r--r--src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir30
-rw-r--r--src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir62
-rw-r--r--src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir28
-rw-r--r--src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff4
-rw-r--r--src/test/mir-opt/inline/asm-unwind.rs22
-rw-r--r--src/test/mir-opt/inline/asm_unwind.main.Inline.diff45
-rw-r--r--src/test/mir-opt/inline/cycle.f.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/cycle.g.Inline.diff28
-rw-r--r--src/test/mir-opt/inline/cycle.main.Inline.diff50
-rw-r--r--src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff36
-rw-r--r--src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff16
-rw-r--r--src/test/mir-opt/inline/inline-into-box-place.rs2
-rw-r--r--src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir22
-rw-r--r--src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir8
-rw-r--r--src/test/mir-opt/inline/inline_cycle.one.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_cycle.two.Inline.diff30
-rw-r--r--src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_diverging.f.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_diverging.g.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_diverging.h.Inline.diff34
-rw-r--r--src/test/mir-opt/inline/inline_generator.main.Inline.diff92
-rw-r--r--src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff86
-rw-r--r--src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff (renamed from src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff)42
-rw-r--r--src/test/mir-opt/inline/inline_options.main.Inline.after.mir24
-rw-r--r--src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir36
-rw-r--r--src/test/mir-opt/inline/inline_shims.clone.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_specialization.main.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir2
-rw-r--r--src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir14
-rw-r--r--src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir4
-rw-r--r--src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir4
-rw-r--r--src/test/mir-opt/inline/issue_78442.bar.Inline.diff2
-rw-r--r--src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff4
-rw-r--r--src/test/mir-opt/inline/polymorphic-recursion.rs25
-rw-r--r--src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff2
-rw-r--r--src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff12
-rw-r--r--src/test/mir-opt/instrument_coverage.rs1
-rw-r--r--src/test/mir-opt/issue-101867.rs7
-rw-r--r--src/test/mir-opt/issue-101973.rs20
-rw-r--r--src/test/mir-opt/issue-41697.rs2
-rw-r--r--src/test/mir-opt/issue-72181.rs4
-rw-r--r--src/test/mir-opt/issue-73223.rs3
-rw-r--r--src/test/mir-opt/issue-91633.rs31
-rw-r--r--src/test/mir-opt/issue_101867.main.mir_map.0.mir75
-rw-r--r--src/test/mir-opt/issue_101973.inner.ConstProp.diff100
-rw-r--r--src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir20
-rw-r--r--src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir (renamed from src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir)0
-rw-r--r--src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir17
-rw-r--r--src/test/mir-opt/issue_72181.bar.mir_map.0.mir (renamed from src/test/mir-opt/issue_72181.bar.mir_map.0.32bit.mir)0
-rw-r--r--src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir27
-rw-r--r--src/test/mir-opt/issue_72181.foo.mir_map.0.mir (renamed from src/test/mir-opt/issue_72181.foo.mir_map.0.32bit.mir)0
-rw-r--r--src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir62
-rw-r--r--src/test/mir-opt/issue_72181.main.mir_map.0.mir (renamed from src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir)0
-rw-r--r--src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff117
-rw-r--r--src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff117
-rw-r--r--src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff157
-rw-r--r--src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff (renamed from src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff)18
-rw-r--r--src/test/mir-opt/issue_91633.bar.mir_map.0.mir39
-rw-r--r--src/test/mir-opt/issue_91633.foo.mir_map.0.mir57
-rw-r--r--src/test/mir-opt/issue_91633.fun.mir_map.0.mir35
-rw-r--r--src/test/mir-opt/issue_91633.hey.mir_map.0.mir35
-rw-r--r--src/test/mir-opt/issue_99325.main.mir_map.0.mir18
-rw-r--r--src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir4
-rw-r--r--src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff66
-rw-r--r--src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff70
-rw-r--r--src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff79
-rw-r--r--src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff93
-rw-r--r--src/test/mir-opt/lower_array_len.array_len.InstCombine.diff27
-rw-r--r--src/test/mir-opt/lower_array_len.array_len.SimplifyLocals.diff22
-rw-r--r--src/test/mir-opt/lower_array_len.array_len_by_value.InstCombine.diff26
-rw-r--r--src/test/mir-opt/lower_array_len.array_len_by_value.SimplifyLocals.diff22
-rw-r--r--src/test/mir-opt/lower_array_len.rs11
-rw-r--r--src/test/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir49
-rw-r--r--src/test/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir62
-rw-r--r--src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir11
-rw-r--r--src/test/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir11
-rw-r--r--src/test/mir-opt/lower_array_len_e2e.rs39
-rw-r--r--src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff2
-rw-r--r--src/test/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff26
-rw-r--r--src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff34
-rw-r--r--src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff72
-rw-r--r--src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff2
-rw-r--r--src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff2
-rw-r--r--src/test/mir-opt/lower_intrinsics.rs54
-rw-r--r--src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff2
-rw-r--r--src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff2
-rw-r--r--src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff6
-rw-r--r--src/test/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir)38
-rw-r--r--src/test/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir (renamed from src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir)34
-rw-r--r--src/test/mir-opt/lower_intrinsics_e2e.rs32
-rw-r--r--src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff2
-rw-r--r--src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir2
-rw-r--r--src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.32bit.diff88
-rw-r--r--src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.64bit.diff)4
-rw-r--r--src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff30
-rw-r--r--src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff30
-rw-r--r--src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff55
-rw-r--r--src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.32bit.mir10
-rw-r--r--src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir10
-rw-r--r--src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff42
-rw-r--r--src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff42
-rw-r--r--src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff113
-rw-r--r--src/test/mir-opt/matches_reduce_branches.rs5
-rw-r--r--src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.64bit.diff28
-rw-r--r--src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.32bit.diff)12
-rw-r--r--src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.64bit.diff28
-rw-r--r--src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff (renamed from src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.32bit.diff)12
-rw-r--r--src/test/mir-opt/matches_u8.rs4
-rw-r--r--src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir27
-rw-r--r--src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir23
-rw-r--r--src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir23
-rw-r--r--src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir2
-rw-r--r--src/test/mir-opt/not_equal_false.rs1
-rw-r--r--src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff4
-rw-r--r--src/test/mir-opt/packed-struct-drop-aligned.rs2
-rw-r--r--src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir55
-rw-r--r--src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir (renamed from src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.64bit.mir)15
-rw-r--r--src/test/mir-opt/remove-never-const.rs1
-rw-r--r--src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff50
-rw-r--r--src/test/mir-opt/remove_storage_markers.rs2
-rw-r--r--src/test/mir-opt/remove_zsts_dont_touch_unions.rs2
-rw-r--r--src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir20
-rw-r--r--src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir2
-rw-r--r--src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir8
-rw-r--r--src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir35
-rw-r--r--src/test/mir-opt/retag.rs1
-rw-r--r--src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir8
-rw-r--r--src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir8
-rw-r--r--src/test/mir-opt/separate_const_switch.identity.ConstProp.diff145
-rw-r--r--src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir127
-rw-r--r--src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff35
-rw-r--r--src/test/mir-opt/separate_const_switch.rs4
-rw-r--r--src/test/mir-opt/separate_const_switch.too_complex.ConstProp.diff95
-rw-r--r--src/test/mir-opt/separate_const_switch.too_complex.PreCodegen.after.mir69
-rw-r--r--src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff43
-rw-r--r--src/test/mir-opt/simple-match.rs2
-rw-r--r--src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir29
-rw-r--r--src/test/mir-opt/simple_match.match_bool.mir_map.0.mir (renamed from src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir)0
-rw-r--r--src/test/mir-opt/simplify-arm-identity.rs3
-rw-r--r--src/test/mir-opt/simplify-arm.rs3
-rw-r--r--src/test/mir-opt/simplify-locals-removes-unused-consts.rs1
-rw-r--r--src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs3
-rw-r--r--src/test/mir-opt/simplify-locals.rs2
-rw-r--r--src/test/mir-opt/simplify_arm.id.SimplifyArmIdentity.diff46
-rw-r--r--src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff46
-rw-r--r--src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff58
-rw-r--r--src/test/mir-opt/simplify_arm.id_result.SimplifyBranchSame.diff58
-rw-r--r--src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff12
-rw-r--r--src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff12
-rw-r--r--src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.32bit.diff61
-rw-r--r--src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.64bit.diff61
-rw-r--r--src/test/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals.diff54
-rw-r--r--src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff39
-rw-r--r--src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.diff (renamed from src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.32bit.diff)29
-rw-r--r--src/test/mir-opt/simplify_try.rs30
-rw-r--r--src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff22
-rw-r--r--src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff18
-rw-r--r--src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir18
-rw-r--r--src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir14
-rw-r--r--src/test/mir-opt/slice-drop-shim.rs2
-rw-r--r--src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.32bit.mir101
-rw-r--r--src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir (renamed from src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.64bit.mir)2
-rw-r--r--src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir2
-rw-r--r--src/test/mir-opt/storage_ranges.main.nll.0.mir11
-rw-r--r--src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir96
-rw-r--r--src/test/mir-opt/try_identity_e2e.old.PreCodegen.after.mir53
-rw-r--r--src/test/mir-opt/try_identity_e2e.rs34
-rw-r--r--src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir8
-rw-r--r--src/test/mir-opt/uninhabited_enum.process_never.SimplifyLocals.after.mir2
-rw-r--r--src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir24
-rw-r--r--src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff34
-rw-r--r--src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir28
-rw-r--r--src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff48
-rw-r--r--src/test/mir-opt/unreachable.main.UnreachablePropagation.diff9
-rw-r--r--src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff25
-rw-r--r--src/test/mir-opt/unusual-item-types.rs2
-rw-r--r--src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.64bit.mir10
-rw-r--r--src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.mir (renamed from src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.32bit.mir)0
-rw-r--r--src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir12
-rw-r--r--src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.mir (renamed from src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir)0
-rw-r--r--src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir39
-rw-r--r--src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir (renamed from src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir)2
-rw-r--r--src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir10
-rw-r--r--src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.mir (renamed from src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir)2
-rw-r--r--src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff55
-rw-r--r--src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.diff (renamed from src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff)0
-rw-r--r--src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.64bit.mir17
-rw-r--r--src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir (renamed from src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.32bit.mir)0
-rw-r--r--src/test/mir-opt/while_let_loops.rs1
-rw-r--r--src/test/pretty/gat-bounds.rs2
-rw-r--r--src/test/pretty/issue-4264.pp8
-rw-r--r--src/test/pretty/issue-85089.pp20
-rw-r--r--src/test/pretty/issue-85089.rs16
-rw-r--r--src/test/pretty/raw-str-nonexpr.rs1
-rw-r--r--src/test/pretty/tests-are-sorted.pp69
-rw-r--r--src/test/pretty/tests-are-sorted.rs13
-rw-r--r--src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile2
-rw-r--r--src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile2
-rw-r--r--src/test/run-make-fulldeps/alloc-no-rc/Makefile4
-rw-r--r--src/test/run-make-fulldeps/alloc-no-sync/Makefile4
-rw-r--r--src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile2
-rw-r--r--src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile2
-rw-r--r--src/test/run-make-fulldeps/archive-duplicate-names/Makefile2
-rw-r--r--src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile2
-rw-r--r--src/test/run-make-fulldeps/atomic-lock-free/Makefile2
-rw-r--r--src/test/run-make-fulldeps/bare-outfile/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-dynamic-dylib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-dynamic-rlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-static-dylib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-static-rlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile2
-rw-r--r--src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile2
-rw-r--r--src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile2
-rw-r--r--src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile2
-rw-r--r--src/test/run-make-fulldeps/codegen-options-parsing/Makefile2
-rw-r--r--src/test/run-make-fulldeps/compile-stdin/Makefile2
-rw-r--r--src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile2
-rw-r--r--src/test/run-make-fulldeps/compiler-lookup-paths/Makefile2
-rw-r--r--src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile2
-rw-r--r--src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile2
-rw-r--r--src/test/run-make-fulldeps/crate-data-smoke/Makefile2
-rw-r--r--src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile2
-rw-r--r--src/test/run-make-fulldeps/crate-name-priority/Makefile2
-rw-r--r--src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile2
-rw-r--r--src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile2
-rw-r--r--src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile2
-rw-r--r--src/test/run-make-fulldeps/cross-lang-lto/Makefile2
-rw-r--r--src/test/run-make-fulldeps/debug-assertions/Makefile2
-rw-r--r--src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile2
-rw-r--r--src/test/run-make-fulldeps/dep-info-spaces/Makefile2
-rw-r--r--src/test/run-make-fulldeps/dep-info/Makefile2
-rw-r--r--src/test/run-make-fulldeps/dylib-chain/Makefile2
-rw-r--r--src/test/run-make-fulldeps/emit-stack-sizes/Makefile2
-rw-r--r--src/test/run-make-fulldeps/emit/Makefile2
-rw-r--r--src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile2
-rw-r--r--src/test/run-make-fulldeps/error-writing-dependencies/Makefile2
-rw-r--r--src/test/run-make-fulldeps/exit-code/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-diff-internal-name/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-flag-fun/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-flag-pathless/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-fn-generic/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-fn-mangle/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-fn-reachable/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-fn-with-union/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-multiple-copies/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-multiple-copies2/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extern-overrides-distribution/Makefile2
-rw-r--r--src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile2
-rw-r--r--src/test/run-make-fulldeps/foreign-double-unwind/Makefile2
-rw-r--r--src/test/run-make-fulldeps/foreign-exceptions/Makefile2
-rw-r--r--src/test/run-make-fulldeps/foreign-rust-exceptions/Makefile11
-rw-r--r--src/test/run-make-fulldeps/foreign-rust-exceptions/bar.rs7
-rw-r--r--src/test/run-make-fulldeps/foreign-rust-exceptions/foo.rs13
-rw-r--r--src/test/run-make-fulldeps/fpic/Makefile2
-rw-r--r--src/test/run-make-fulldeps/glibc-staticlib-args/Makefile2
-rw-r--r--src/test/run-make-fulldeps/hir-tree/Makefile2
-rw-r--r--src/test/run-make-fulldeps/include_bytes_deps/Makefile2
-rw-r--r--src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile2
-rw-r--r--src/test/run-make-fulldeps/inline-always-many-cgu/Makefile2
-rw-r--r--src/test/run-make-fulldeps/interdependent-c-libraries/Makefile2
-rw-r--r--src/test/run-make-fulldeps/intrinsic-unreachable/Makefile3
-rw-r--r--src/test/run-make-fulldeps/invalid-library/Makefile2
-rw-r--r--src/test/run-make-fulldeps/invalid-staticlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-11908/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-14500/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-14698/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-15460/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-18943/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-19371/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-19371/foo.rs2
-rw-r--r--src/test/run-make-fulldeps/issue-20626/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-22131/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-24445/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-25581/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-26006/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-26092/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-28595/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-28766/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-30063/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-33329/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-35164/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-37839/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-37893/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-38237/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-40535/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-46239/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-47551/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs1
-rw-r--r--src/test/run-make-fulldeps/issue-51671/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-53964/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-64153/Makefile4
-rw-r--r--src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-69368/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-69368/a.rs5
-rw-r--r--src/test/run-make-fulldeps/issue-7349/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issue-97463-abi-param-passing/Makefile14
-rw-r--r--src/test/run-make-fulldeps/issue-97463-abi-param-passing/bad.c24
-rw-r--r--src/test/run-make-fulldeps/issue-97463-abi-param-passing/param_passing.rs38
-rw-r--r--src/test/run-make-fulldeps/issue64319/Makefile2
-rw-r--r--src/test/run-make-fulldeps/issues-41478-43796/Makefile2
-rw-r--r--src/test/run-make-fulldeps/libs-through-symlinks/Makefile2
-rw-r--r--src/test/run-make-fulldeps/libtest-json/Makefile2
-rw-r--r--src/test/run-make-fulldeps/link-arg/Makefile2
-rw-r--r--src/test/run-make-fulldeps/link-args-order/Makefile2
-rw-r--r--src/test/run-make-fulldeps/link-cfg/Makefile2
-rw-r--r--src/test/run-make-fulldeps/link-dedup/Makefile2
-rw-r--r--src/test/run-make-fulldeps/link-path-order/Makefile2
-rw-r--r--src/test/run-make-fulldeps/linkage-attr-on-static/Makefile2
-rw-r--r--src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile2
-rw-r--r--src/test/run-make-fulldeps/long-linker-command-lines/Makefile2
-rw-r--r--src/test/run-make-fulldeps/longjmp-across-rust/Makefile2
-rw-r--r--src/test/run-make-fulldeps/ls-metadata/Makefile2
-rw-r--r--src/test/run-make-fulldeps/lto-dylib-dep/Makefile2
-rw-r--r--src/test/run-make-fulldeps/lto-empty/Makefile2
-rw-r--r--src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/lto-readonly-lib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/lto-smoke-c/Makefile2
-rw-r--r--src/test/run-make-fulldeps/lto-smoke/Makefile2
-rw-r--r--src/test/run-make-fulldeps/manual-crate-name/Makefile2
-rw-r--r--src/test/run-make-fulldeps/manual-link/Makefile2
-rw-r--r--src/test/run-make-fulldeps/many-crates-but-no-match/Makefile2
-rw-r--r--src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile2
-rw-r--r--src/test/run-make-fulldeps/min-global-align/Makefile2
-rw-r--r--src/test/run-make-fulldeps/mismatching-target-triples/Makefile2
-rw-r--r--src/test/run-make-fulldeps/missing-crate-dependency/Makefile2
-rw-r--r--src/test/run-make-fulldeps/mixing-deps/Makefile2
-rw-r--r--src/test/run-make-fulldeps/mixing-formats/Makefile2
-rw-r--r--src/test/run-make-fulldeps/mixing-libs/Makefile2
-rw-r--r--src/test/run-make-fulldeps/msvc-opt-minsize/Makefile2
-rw-r--r--src/test/run-make-fulldeps/multiple-emits/Makefile2
-rw-r--r--src/test/run-make-fulldeps/no-builtins-lto/Makefile2
-rw-r--r--src/test/run-make-fulldeps/no-duplicate-libs/Makefile2
-rw-r--r--src/test/run-make-fulldeps/no-intermediate-extras/Makefile2
-rw-r--r--src/test/run-make-fulldeps/obey-crate-type-flag/Makefile2
-rw-r--r--src/test/run-make-fulldeps/obtain-borrowck/driver.rs12
-rw-r--r--src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile2
-rw-r--r--src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile2
-rw-r--r--src/test/run-make-fulldeps/output-type-permutations/Makefile2
-rw-r--r--src/test/run-make-fulldeps/output-with-hyphens/Makefile2
-rw-r--r--src/test/run-make-fulldeps/override-aliased-flags/Makefile2
-rw-r--r--src/test/run-make-fulldeps/panic-impl-transitive/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pgo-branch-weights/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pgo-gen-lto/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pgo-gen/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pgo-use/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile2
-rw-r--r--src/test/run-make-fulldeps/prefer-dylib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/prefer-rlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pretty-expanded/Makefile2
-rw-r--r--src/test/run-make-fulldeps/pretty-print-to-file/Makefile2
-rw-r--r--src/test/run-make-fulldeps/print-calling-conventions/Makefile4
-rw-r--r--src/test/run-make-fulldeps/print-cfg/Makefile2
-rw-r--r--src/test/run-make-fulldeps/print-target-list/Makefile2
-rw-r--r--src/test/run-make-fulldeps/profile/Makefile2
-rw-r--r--src/test/run-make-fulldeps/prune-link-args/Makefile2
-rw-r--r--src/test/run-make-fulldeps/redundant-libs/Makefile2
-rw-r--r--src/test/run-make-fulldeps/relocation-model/Makefile2
-rw-r--r--src/test/run-make-fulldeps/relro-levels/Makefile2
-rw-r--r--src/test/run-make-fulldeps/remap-path-prefix/Makefile2
-rw-r--r--src/test/run-make-fulldeps/reproducible-build-2/Makefile2
-rw-r--r--src/test/run-make-fulldeps/reproducible-build/Makefile2
-rw-r--r--src/test/run-make-fulldeps/resolve-rename/Makefile2
-rw-r--r--src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile2
-rw-r--r--src/test/run-make-fulldeps/return-non-c-like-enum/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rlib-chain/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rustdoc-determinism/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rustdoc-error-lines/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rustdoc-io-error/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rustdoc-map-file/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rustdoc-output-path/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile2
-rw-r--r--src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs8
-rw-r--r--src/test/run-make-fulldeps/rustdoc-themes/Makefile2
-rw-r--r--src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile2
-rw-r--r--src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile2
-rw-r--r--src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile2
-rw-r--r--src/test/run-make-fulldeps/save-analysis-fail/Makefile2
-rw-r--r--src/test/run-make-fulldeps/save-analysis-fail/foo.rs15
-rw-r--r--src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile2
-rw-r--r--src/test/run-make-fulldeps/save-analysis/Makefile2
-rw-r--r--src/test/run-make-fulldeps/save-analysis/foo.rs15
-rw-r--r--src/test/run-make-fulldeps/separate-link-fail/Makefile2
-rw-r--r--src/test/run-make-fulldeps/separate-link/Makefile2
-rw-r--r--src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile2
-rw-r--r--src/test/run-make-fulldeps/sepcomp-inlining/Makefile2
-rw-r--r--src/test/run-make-fulldeps/sepcomp-separate/Makefile2
-rw-r--r--src/test/run-make-fulldeps/share-generics-dylib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/simd-ffi/Makefile2
-rw-r--r--src/test/run-make-fulldeps/simple-dylib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/simple-rlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/split-debuginfo/Makefile41
-rw-r--r--src/test/run-make-fulldeps/stable-symbol-names/Makefile2
-rw-r--r--src/test/run-make-fulldeps/static-dylib-by-default/Makefile2
-rw-r--r--src/test/run-make-fulldeps/static-extern-type/Makefile2
-rw-r--r--src/test/run-make-fulldeps/static-unwinding/Makefile2
-rw-r--r--src/test/run-make-fulldeps/staticlib-blank-lib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/std-core-cycle/Makefile2
-rw-r--r--src/test/run-make-fulldeps/stdin-non-utf8/Makefile2
-rw-r--r--src/test/run-make-fulldeps/suspicious-library/Makefile2
-rw-r--r--src/test/run-make-fulldeps/symbols-include-type-name/Makefile2
-rw-r--r--src/test/run-make-fulldeps/symlinked-extern/Makefile2
-rw-r--r--src/test/run-make-fulldeps/symlinked-libraries/Makefile2
-rw-r--r--src/test/run-make-fulldeps/symlinked-rlib/Makefile2
-rw-r--r--src/test/run-make-fulldeps/target-cpu-native/Makefile2
-rw-r--r--src/test/run-make-fulldeps/target-specs/Makefile2
-rw-r--r--src/test/run-make-fulldeps/target-without-atomic-cas/Makefile2
-rw-r--r--src/test/run-make-fulldeps/test-harness/Makefile2
-rw-r--r--src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile2
-rw-r--r--src/test/run-make-fulldeps/use-extern-for-plugins/Makefile2
-rw-r--r--src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile2
-rw-r--r--src/test/run-make-fulldeps/used-cdylib-macos/Makefile2
-rw-r--r--src/test/run-make-fulldeps/used/Makefile2
-rw-r--r--src/test/run-make-fulldeps/version/Makefile2
-rw-r--r--src/test/run-make-fulldeps/volatile-intrinsics/Makefile2
-rw-r--r--src/test/run-make-fulldeps/weird-output-filenames/Makefile2
-rw-r--r--src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile2
-rw-r--r--src/test/run-make-fulldeps/windows-spawn/Makefile2
-rw-r--r--src/test/run-make-fulldeps/windows-subsystem/Makefile2
-rw-r--r--src/test/run-make/const_fn_mir/Makefile2
-rw-r--r--src/test/run-make/coverage-llvmir/filecheck.testprog.txt2
-rw-r--r--src/test/run-make/coverage-reports/Makefile13
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.async.txt2
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.closure.txt16
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.doctest.txt6
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.generator.txt2
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.inline-dead.txt2
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.issue-83601.txt6
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.issue-84561.txt6
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.partial_eq.txt5
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt4
-rw-r--r--src/test/run-make/coverage-reports/expected_show_coverage.yield.txt4
-rw-r--r--src/test/run-make/coverage/async.rs2
-rw-r--r--src/test/run-make/dep-graph/Makefile2
-rw-r--r--src/test/run-make/emit-named-files/Makefile2
-rw-r--r--src/test/run-make/emit-path-unhashed/Makefile2
-rw-r--r--src/test/run-make/emit-shared-files/Makefile2
-rw-r--r--src/test/run-make/env-dep-info/Makefile2
-rw-r--r--src/test/run-make/export-executable-symbols/Makefile2
-rw-r--r--src/test/run-make/fmt-write-bloat/Makefile2
-rw-r--r--src/test/run-make/issue-10971-temps-dir/Makefile2
-rw-r--r--src/test/run-make/issue-36710/Makefile6
-rw-r--r--src/test/run-make/issue-47384/Makefile2
-rw-r--r--src/test/run-make/issue-71519/Makefile3
-rw-r--r--src/test/run-make/issue-85401-static-mir/Makefile16
-rw-r--r--src/test/run-make/issue-85401-static-mir/bar.rs4
-rw-r--r--src/test/run-make/issue-85401-static-mir/baz.rs3
-rw-r--r--src/test/run-make/issue-85401-static-mir/foo.rs5
-rw-r--r--src/test/run-make/issue-85441/Makefile2
-rw-r--r--src/test/run-make/issue-88756-default-output/Makefile2
-rw-r--r--src/test/run-make/issue-96498/Makefile2
-rw-r--r--src/test/run-make/libtest-thread-limit/Makefile2
-rw-r--r--src/test/run-make/llvm-outputs/Makefile2
-rw-r--r--src/test/run-make/macos-fat-archive/Makefile10
-rw-r--r--src/test/run-make/macos-fat-archive/lib.rs3
-rw-r--r--src/test/run-make/macos-fat-archive/native-library.c1
-rw-r--r--src/test/run-make/native-link-modifier-bundle/Makefile2
-rw-r--r--src/test/run-make/native-link-modifier-verbatim-linker/Makefile15
-rw-r--r--src/test/run-make/native-link-modifier-verbatim-linker/local_native_dep.rs4
-rw-r--r--src/test/run-make/native-link-modifier-verbatim-linker/main.rs9
-rw-r--r--src/test/run-make/native-link-modifier-verbatim-rustc/Makefile12
-rw-r--r--src/test/run-make/native-link-modifier-verbatim-rustc/rust_dep.rs9
-rw-r--r--src/test/run-make/native-link-modifier-verbatim-rustc/upstream_native_dep.rs4
-rw-r--r--src/test/run-make/native-link-modifier-whole-archive/Makefile2
-rw-r--r--src/test/run-make/pass-linker-flags-from-dep/Makefile2
-rw-r--r--src/test/run-make/pass-linker-flags/Makefile2
-rw-r--r--src/test/run-make/raw-dylib-alt-calling-convention/Makefile2
-rw-r--r--src/test/run-make/raw-dylib-alt-calling-convention/extern.c15
-rw-r--r--src/test/run-make/raw-dylib-alt-calling-convention/lib.rs11
-rw-r--r--src/test/run-make/raw-dylib-alt-calling-convention/output.msvc.txt1
-rw-r--r--src/test/run-make/raw-dylib-alt-calling-convention/output.txt2
-rw-r--r--src/test/run-make/raw-dylib-c/Makefile2
-rw-r--r--src/test/run-make/raw-dylib-c/extern_1.c12
-rw-r--r--src/test/run-make/raw-dylib-c/lib.rs13
-rw-r--r--src/test/run-make/raw-dylib-c/output.txt3
-rw-r--r--src/test/run-make/raw-dylib-import-name-type/Makefile22
-rw-r--r--src/test/run-make/raw-dylib-import-name-type/driver.rs125
-rw-r--r--src/test/run-make/raw-dylib-import-name-type/extern.c103
-rw-r--r--src/test/run-make/raw-dylib-import-name-type/extern.gnu.def21
-rw-r--r--src/test/run-make/raw-dylib-import-name-type/extern.msvc.def25
-rw-r--r--src/test/run-make/raw-dylib-import-name-type/output.txt19
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/Makefile31
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs21
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c11
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c6
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs21
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs6
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/output.txt6
-rw-r--r--src/test/run-make/raw-dylib-link-ordinal/Makefile2
-rw-r--r--src/test/run-make/raw-dylib-link-ordinal/exporter.c7
-rw-r--r--src/test/run-make/raw-dylib-link-ordinal/exporter.def2
-rw-r--r--src/test/run-make/raw-dylib-link-ordinal/lib.rs10
-rw-r--r--src/test/run-make/raw-dylib-link-ordinal/output.txt2
-rw-r--r--src/test/run-make/raw-dylib-stdcall-ordinal/Makefile2
-rw-r--r--src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs2
-rw-r--r--src/test/run-make/remap-path-prefix-dwarf/Makefile2
-rw-r--r--src/test/run-make/rustc-macro-dep-files/Makefile2
-rw-r--r--src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile2
-rw-r--r--src/test/run-make/rustdoc-scrape-examples-multiple/Makefile2
-rw-r--r--src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk2
-rw-r--r--src/test/run-make/rustdoc-scrape-examples-ordering/Makefile2
-rw-r--r--src/test/run-make/rustdoc-scrape-examples-remap/Makefile2
-rw-r--r--src/test/run-make/rustdoc-scrape-examples-test/Makefile2
-rw-r--r--src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile2
-rw-r--r--src/test/run-make/rustdoc-with-out-dir-option/Makefile2
-rw-r--r--src/test/run-make/rustdoc-with-output-option/Makefile2
-rw-r--r--src/test/run-make/rustdoc-with-short-out-dir-option/Makefile2
-rw-r--r--src/test/run-make/static-pie/Makefile2
-rw-r--r--src/test/run-make/thumb-none-cortex-m/Makefile2
-rw-r--r--src/test/run-make/thumb-none-qemu/Makefile2
-rw-r--r--src/test/run-make/track-path-dep-info/Makefile2
-rw-r--r--src/test/run-make/track-pgo-dep-info/Makefile26
-rw-r--r--src/test/run-make/track-pgo-dep-info/main.rs1
-rw-r--r--src/test/run-make/translation/Makefile25
-rw-r--r--src/test/run-make/translation/basic-translation.ftl2
-rw-r--r--src/test/run-make/translation/broken.ftl3
-rw-r--r--src/test/run-make/translation/missing.ftl3
-rw-r--r--src/test/run-make/translation/test.rs (renamed from src/test/run-make/translation/basic-translation.rs)0
-rw-r--r--src/test/run-make/translation/working.ftl2
-rw-r--r--src/test/run-make/unstable-flag-required/Makefile2
-rw-r--r--src/test/run-make/wasm-abi/Makefile2
-rw-r--r--src/test/run-make/wasm-custom-section/Makefile2
-rw-r--r--src/test/run-make/wasm-custom-sections-opt/Makefile2
-rw-r--r--src/test/run-make/wasm-export-all-symbols/Makefile2
-rw-r--r--src/test/run-make/wasm-import-module/Makefile2
-rw-r--r--src/test/run-make/wasm-panic-small/Makefile2
-rw-r--r--src/test/run-make/wasm-spurious-import/Makefile2
-rw-r--r--src/test/run-make/wasm-stringify-ints-small/Makefile2
-rw-r--r--src/test/run-make/wasm-symbols-different-module/Makefile2
-rw-r--r--src/test/run-make/wasm-symbols-not-exported/Makefile2
-rw-r--r--src/test/run-make/wasm-symbols-not-imported/Makefile2
-rw-r--r--src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile2
-rw-r--r--src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh2
-rw-r--r--src/test/run-pass-valgrind/cast-enum-with-dtor.rs2
-rw-r--r--src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs4
-rw-r--r--src/test/run-pass-valgrind/coerce-match.rs15
-rw-r--r--src/test/rustdoc-gui/anchor-navigable.goml4
-rw-r--r--src/test/rustdoc-gui/anchors.goml121
-rw-r--r--src/test/rustdoc-gui/auto-hide-trait-implementations.goml2
-rw-r--r--src/test/rustdoc-gui/basic-code.goml4
-rw-r--r--src/test/rustdoc-gui/basic.goml4
-rw-r--r--src/test/rustdoc-gui/check-code-blocks-margin.goml6
-rw-r--r--src/test/rustdoc-gui/check-stab-in-docblock.goml27
-rw-r--r--src/test/rustdoc-gui/check_info_sign_position.goml12
-rw-r--r--src/test/rustdoc-gui/code-blocks-overflow.goml4
-rw-r--r--src/test/rustdoc-gui/code-color.goml38
-rw-r--r--src/test/rustdoc-gui/code-sidebar-toggle.goml2
-rw-r--r--src/test/rustdoc-gui/code-tags.goml14
-rw-r--r--src/test/rustdoc-gui/codeblock-tooltip.goml80
-rw-r--r--src/test/rustdoc-gui/default-settings.goml2
-rw-r--r--src/test/rustdoc-gui/docblock-big-code-mobile.goml2
-rw-r--r--src/test/rustdoc-gui/docblock-code-block-line-number.goml27
-rw-r--r--src/test/rustdoc-gui/docblock-details.goml15
-rw-r--r--src/test/rustdoc-gui/docblock-table-overflow.goml10
-rw-r--r--src/test/rustdoc-gui/docblock-table.goml4
-rw-r--r--src/test/rustdoc-gui/duplicate-macro-reexport.goml2
-rw-r--r--src/test/rustdoc-gui/escape-key.goml2
-rw-r--r--src/test/rustdoc-gui/font-weight.goml20
-rw-r--r--src/test/rustdoc-gui/hash-item-expansion.goml2
-rw-r--r--src/test/rustdoc-gui/headers-color.goml173
-rw-r--r--src/test/rustdoc-gui/headings.goml198
-rw-r--r--src/test/rustdoc-gui/help-page.goml24
-rw-r--r--src/test/rustdoc-gui/highlight-colors.goml94
-rw-r--r--src/test/rustdoc-gui/huge-collection-of-constants.goml2
-rw-r--r--src/test/rustdoc-gui/impl-default-expansion.goml2
-rw-r--r--src/test/rustdoc-gui/implementors.goml16
-rw-r--r--src/test/rustdoc-gui/item-decl-colors.goml74
-rw-r--r--src/test/rustdoc-gui/item-info-alignment.goml10
-rw-r--r--src/test/rustdoc-gui/item-info-overflow.goml10
-rw-r--r--src/test/rustdoc-gui/item-info.goml8
-rw-r--r--src/test/rustdoc-gui/item-summary-table.goml4
-rw-r--r--src/test/rustdoc-gui/javascript-disabled.goml2
-rw-r--r--src/test/rustdoc-gui/jump-to-def-background.goml57
-rw-r--r--src/test/rustdoc-gui/label-next-to-symbol.goml28
-rw-r--r--src/test/rustdoc-gui/links-color.goml85
-rw-r--r--src/test/rustdoc-gui/list_code_block.goml4
-rw-r--r--src/test/rustdoc-gui/mobile.goml6
-rw-r--r--src/test/rustdoc-gui/module-items-font.goml2
-rw-r--r--src/test/rustdoc-gui/no-docblock.goml8
-rw-r--r--src/test/rustdoc-gui/notable-trait.goml128
-rw-r--r--src/test/rustdoc-gui/overflow-tooltip-information.goml4
-rw-r--r--src/test/rustdoc-gui/pocket-menu.goml6
-rw-r--r--src/test/rustdoc-gui/run-on-hover.goml2
-rw-r--r--src/test/rustdoc-gui/rust-logo.goml100
-rw-r--r--src/test/rustdoc-gui/search-filter.goml22
-rw-r--r--src/test/rustdoc-gui/search-form-elements.goml263
-rw-r--r--src/test/rustdoc-gui/search-input-mobile.goml2
-rw-r--r--src/test/rustdoc-gui/search-input.goml23
-rw-r--r--src/test/rustdoc-gui/search-reexport.goml2
-rw-r--r--src/test/rustdoc-gui/search-result-color.goml288
-rw-r--r--src/test/rustdoc-gui/search-result-description.goml2
-rw-r--r--src/test/rustdoc-gui/search-result-display.goml33
-rw-r--r--src/test/rustdoc-gui/search-result-go-to-first.goml12
-rw-r--r--src/test/rustdoc-gui/search-result-keyword.goml2
-rw-r--r--src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml10
-rw-r--r--src/test/rustdoc-gui/settings.goml15
-rw-r--r--src/test/rustdoc-gui/shortcuts.goml20
-rw-r--r--src/test/rustdoc-gui/sidebar-links-color.goml233
-rw-r--r--src/test/rustdoc-gui/sidebar-macro-reexport.goml4
-rw-r--r--src/test/rustdoc-gui/sidebar-mobile-scroll.goml31
-rw-r--r--src/test/rustdoc-gui/sidebar-mobile.goml18
-rw-r--r--src/test/rustdoc-gui/sidebar-source-code-display.goml40
-rw-r--r--src/test/rustdoc-gui/sidebar-source-code.goml6
-rw-r--r--src/test/rustdoc-gui/sidebar.goml73
-rw-r--r--src/test/rustdoc-gui/source-anchor-scroll.goml4
-rw-r--r--src/test/rustdoc-gui/source-code-page.goml90
-rw-r--r--src/test/rustdoc-gui/src-font-size.goml10
-rw-r--r--src/test/rustdoc-gui/src/lib2/lib.rs40
-rw-r--r--src/test/rustdoc-gui/src/staged_api/Cargo.toml3
-rw-r--r--src/test/rustdoc-gui/src/staged_api/lib.rs2
-rw-r--r--src/test/rustdoc-gui/src/test_docs/lib.rs123
-rw-r--r--src/test/rustdoc-gui/theme-change.goml4
-rw-r--r--src/test/rustdoc-gui/theme-in-history.goml4
-rw-r--r--src/test/rustdoc-gui/toggle-click-deadspace.goml9
-rw-r--r--src/test/rustdoc-gui/toggle-docs-mobile.goml2
-rw-r--r--src/test/rustdoc-gui/toggle-docs.goml4
-rw-r--r--src/test/rustdoc-gui/toggle-implementors.goml2
-rw-r--r--src/test/rustdoc-gui/toggled-open-implementations.goml2
-rw-r--r--src/test/rustdoc-gui/trait-sidebar-item-order.goml2
-rw-r--r--src/test/rustdoc-gui/type-declation-overflow.goml20
-rw-r--r--src/test/rustdoc-gui/unsafe-fn.goml28
-rw-r--r--src/test/rustdoc-gui/where-whitespace.goml27
-rw-r--r--src/test/rustdoc-js-std/asrawfd.js6
-rw-r--r--src/test/rustdoc-json/assoc_items.rs32
-rw-r--r--src/test/rustdoc-json/assoc_type.rs9
-rw-r--r--src/test/rustdoc-json/blanket_impls.rs7
-rw-r--r--src/test/rustdoc-json/doc_hidden_failure.rs2
-rw-r--r--src/test/rustdoc-json/enums/discriminant/basic.rs12
-rw-r--r--src/test/rustdoc-json/enums/discriminant/expr.rs39
-rw-r--r--src/test/rustdoc-json/enums/discriminant/limits.rs43
-rw-r--r--src/test/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs15
-rw-r--r--src/test/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs10
-rw-r--r--src/test/rustdoc-json/enums/field_hidden.rs13
-rw-r--r--src/test/rustdoc-json/enums/kind.rs37
-rw-r--r--src/test/rustdoc-json/enums/struct_field_hidden.rs17
-rw-r--r--src/test/rustdoc-json/enums/tuple_fields_hidden.rs94
-rw-r--r--src/test/rustdoc-json/enums/variant_struct.rs10
-rw-r--r--src/test/rustdoc-json/enums/variant_tuple_struct.rs10
-rw-r--r--src/test/rustdoc-json/fn_pointer/abi.rs14
-rw-r--r--src/test/rustdoc-json/fn_pointer/generics.rs16
-rw-r--r--src/test/rustdoc-json/fn_pointer/qualifiers.rs12
-rw-r--r--src/test/rustdoc-json/fns/abi.rs14
-rw-r--r--src/test/rustdoc-json/fns/async_return.rs36
-rw-r--r--src/test/rustdoc-json/fns/generic_args.rs96
-rw-r--r--src/test/rustdoc-json/fns/generic_returns.rs12
-rw-r--r--src/test/rustdoc-json/fns/generics.rs32
-rw-r--r--src/test/rustdoc-json/fns/qualifiers.rs36
-rw-r--r--src/test/rustdoc-json/generic-associated-types/gats.rs42
-rw-r--r--src/test/rustdoc-json/generic_impl.rs7
-rw-r--r--src/test/rustdoc-json/glob_import.rs5
-rw-r--r--src/test/rustdoc-json/impls/auto.rs18
-rw-r--r--src/test/rustdoc-json/impls/auxiliary/foreign_struct.rs1
-rw-r--r--src/test/rustdoc-json/impls/auxiliary/foreign_trait.rs1
-rw-r--r--src/test/rustdoc-json/impls/blanket_with_local.rs8
-rw-r--r--src/test/rustdoc-json/impls/foreign_for_local.rs18
-rw-r--r--src/test/rustdoc-json/impls/import_from_private.rs22
-rw-r--r--src/test/rustdoc-json/impls/local_for_foreign.rs18
-rw-r--r--src/test/rustdoc-json/impls/local_for_local.rs15
-rw-r--r--src/test/rustdoc-json/impls/local_for_local_primitive.rs21
-rw-r--r--src/test/rustdoc-json/impls/local_for_primitive.rs7
-rw-r--r--src/test/rustdoc-json/intra-doc-links/non_page.rs34
-rw-r--r--src/test/rustdoc-json/intra-doc-links/user_written.rs8
-rw-r--r--src/test/rustdoc-json/keyword.rs9
-rw-r--r--src/test/rustdoc-json/lifetime/longest.rs40
-rw-r--r--src/test/rustdoc-json/lifetime/outlives.rs34
-rw-r--r--src/test/rustdoc-json/methods/abi.rs30
-rw-r--r--src/test/rustdoc-json/methods/qualifiers.rs36
-rw-r--r--src/test/rustdoc-json/nested.rs39
-rw-r--r--src/test/rustdoc-json/output_generics.rs11
-rw-r--r--src/test/rustdoc-json/primitive.rs14
-rw-r--r--src/test/rustdoc-json/primitives.rs22
-rw-r--r--src/test/rustdoc-json/primitives/primitive_impls.rs34
-rw-r--r--src/test/rustdoc-json/primitives/primitive_overloading.rs (renamed from src/test/rustdoc-json/primitive_overloading.rs)5
-rw-r--r--src/test/rustdoc-json/primitives/primitive_type.rs22
-rw-r--r--src/test/rustdoc-json/primitives/use_primitive.rs20
-rw-r--r--src/test/rustdoc-json/reexport/export_extern_crate_as_self.rs11
-rw-r--r--src/test/rustdoc-json/reexport/glob_collision.rs28
-rw-r--r--src/test/rustdoc-json/reexport/glob_empty_mod.rs8
-rw-r--r--src/test/rustdoc-json/reexport/glob_extern.rs15
-rw-r--r--src/test/rustdoc-json/reexport/glob_private.rs25
-rw-r--r--src/test/rustdoc-json/reexport/in_root_and_mod.rs9
-rw-r--r--src/test/rustdoc-json/reexport/in_root_and_mod_pub.rs16
-rw-r--r--src/test/rustdoc-json/reexport/macro.rs10
-rw-r--r--src/test/rustdoc-json/reexport/mod_not_included.rs14
-rw-r--r--src/test/rustdoc-json/reexport/private_twice_one_inline.rs18
-rw-r--r--src/test/rustdoc-json/reexport/private_two_names.rs17
-rw-r--r--src/test/rustdoc-json/reexport/reexport_method_from_private_module.rs28
-rw-r--r--src/test/rustdoc-json/reexport/rename_private.rs7
-rw-r--r--src/test/rustdoc-json/reexport/rename_public.rs16
-rw-r--r--src/test/rustdoc-json/reexport/same_type_reexported_more_than_once.rs18
-rw-r--r--src/test/rustdoc-json/reexport/simple_private.rs11
-rw-r--r--src/test/rustdoc-json/reexport/simple_public.rs14
-rw-r--r--src/test/rustdoc-json/return_private.rs4
-rw-r--r--src/test/rustdoc-json/stripped_modules.rs10
-rw-r--r--src/test/rustdoc-json/structs/plain_all_pub.rs11
-rw-r--r--src/test/rustdoc-json/structs/plain_doc_hidden.rs11
-rw-r--r--src/test/rustdoc-json/structs/plain_empty.rs9
-rw-r--r--src/test/rustdoc-json/structs/plain_pub_priv.rs9
-rw-r--r--src/test/rustdoc-json/structs/tuple.rs7
-rw-r--r--src/test/rustdoc-json/structs/tuple_empty.rs2
-rw-r--r--src/test/rustdoc-json/structs/tuple_pub_priv.rs13
-rw-r--r--src/test/rustdoc-json/structs/unit.rs7
-rw-r--r--src/test/rustdoc-json/structs/with_generics.rs16
-rw-r--r--src/test/rustdoc-json/structs/with_primitives.rs12
-rw-r--r--src/test/rustdoc-json/traits/has_body.rs16
-rw-r--r--src/test/rustdoc-json/traits/implementors.rs14
-rw-r--r--src/test/rustdoc-json/traits/supertrait.rs22
-rw-r--r--src/test/rustdoc-json/traits/uses_extern_trait.rs7
-rw-r--r--src/test/rustdoc-json/type/dyn.rs59
-rw-r--r--src/test/rustdoc-json/type/extern.rs10
-rw-r--r--src/test/rustdoc-json/type/fn_lifetime.rs41
-rw-r--r--src/test/rustdoc-json/type/generic_default.rs46
-rw-r--r--src/test/rustdoc-json/type/hrtb.rs24
-rw-r--r--src/test/rustdoc-json/unions/impl.rs10
-rw-r--r--src/test/rustdoc-json/unions/union.rs14
-rw-r--r--src/test/rustdoc-ui/bare-urls.stderr2
-rw-r--r--src/test/rustdoc-ui/check-attr-test.stderr2
-rw-r--r--src/test/rustdoc-ui/check-attr.stderr2
-rw-r--r--src/test/rustdoc-ui/check-cfg-test.stderr2
-rw-r--r--src/test/rustdoc-ui/check-fail.rs1
-rw-r--r--src/test/rustdoc-ui/check-fail.stderr14
-rw-r--r--src/test/rustdoc-ui/check.rs4
-rw-r--r--src/test/rustdoc-ui/check.stderr22
-rw-r--r--src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr2
-rw-r--r--src/test/rustdoc-ui/diagnostic-width.rs2
-rw-r--r--src/test/rustdoc-ui/diagnostic-width.stderr2
-rw-r--r--src/test/rustdoc-ui/doc-attr.stderr4
-rw-r--r--src/test/rustdoc-ui/doc-include-suggestion.stderr2
-rw-r--r--src/test/rustdoc-ui/doc-spotlight.stderr8
-rw-r--r--src/test/rustdoc-ui/doc-test-attr.stderr4
-rw-r--r--src/test/rustdoc-ui/doc-without-codeblock.rs3
-rw-r--r--src/test/rustdoc-ui/doc-without-codeblock.stderr12
-rw-r--r--src/test/rustdoc-ui/doc_cfg_hide.rs11
-rw-r--r--src/test/rustdoc-ui/doc_cfg_hide.stderr40
-rw-r--r--src/test/rustdoc-ui/doctest-edition.stderr2
-rw-r--r--src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs10
-rw-r--r--src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr29
-rw-r--r--src/test/rustdoc-ui/ignore-block-help.stderr2
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs3
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr17
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs4
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr17
-rw-r--r--src/test/rustdoc-ui/infinite-recursive-type.stderr4
-rw-r--r--src/test/rustdoc-ui/intra-doc/html-as-generics-intra-doc.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/malformed-generics.rs9
-rw-r--r--src/test/rustdoc-ui/intra-doc/malformed-generics.stderr82
-rw-r--r--src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/private-from-crate-level.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/private.private.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/private.public.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/unused-extern-crate.stderr2
-rw-r--r--src/test/rustdoc-ui/intra-doc/warning-crlf.stderr2
-rw-r--r--src/test/rustdoc-ui/invalid-doc-attr.stderr6
-rw-r--r--src/test/rustdoc-ui/invalid-html-self-closing-tag.rs70
-rw-r--r--src/test/rustdoc-ui/invalid-html-self-closing-tag.stderr80
-rw-r--r--src/test/rustdoc-ui/invalid-html-tags.rs7
-rw-r--r--src/test/rustdoc-ui/invalid-html-tags.stderr8
-rw-r--r--src/test/rustdoc-ui/invalid-syntax.rs6
-rw-r--r--src/test/rustdoc-ui/invalid-syntax.stderr19
-rw-r--r--src/test/rustdoc-ui/issue-101076.rs14
-rw-r--r--src/test/rustdoc-ui/issue-102986.rs4
-rw-r--r--src/test/rustdoc-ui/issue-102986.stderr14
-rw-r--r--src/test/rustdoc-ui/issue-74134.private.stderr2
-rw-r--r--src/test/rustdoc-ui/issue-74134.public.stderr2
-rw-r--r--src/test/rustdoc-ui/lint-group.rs2
-rw-r--r--src/test/rustdoc-ui/lint-group.stderr14
-rw-r--r--src/test/rustdoc-ui/lint-missing-doc-code-example.rs1
-rw-r--r--src/test/rustdoc-ui/lint-missing-doc-code-example.stderr12
-rw-r--r--src/test/rustdoc-ui/macro-docs.stderr2
-rw-r--r--src/test/rustdoc-ui/no-crate-level-doc-lint.stderr4
-rw-r--r--src/test/rustdoc-ui/normalize-cycle.rs3
-rw-r--r--src/test/rustdoc-ui/normalize-overflow.rs2
-rw-r--r--src/test/rustdoc-ui/pub-export-lint.stderr2
-rw-r--r--src/test/rustdoc-ui/reference-link-reports-error-once.stderr2
-rw-r--r--src/test/rustdoc-ui/renamed-lint-still-applies.stderr4
-rw-r--r--src/test/rustdoc-ui/rustc-check-passes.rs4
-rw-r--r--src/test/rustdoc-ui/rustc-check-passes.stderr6
-rw-r--r--src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.rs42
-rw-r--r--src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.stderr48
-rw-r--r--src/test/rustdoc-ui/suggestions/html-as-generics.fixed50
-rw-r--r--src/test/rustdoc-ui/suggestions/html-as-generics.rs50
-rw-r--r--src/test/rustdoc-ui/suggestions/html-as-generics.stderr112
-rw-r--r--src/test/rustdoc-ui/z-help.stdout50
-rw-r--r--src/test/rustdoc/all.rs2
-rw-r--r--src/test/rustdoc/anchors.no_const_anchor.html2
-rw-r--r--src/test/rustdoc/anchors.no_const_anchor2.html2
-rw-r--r--src/test/rustdoc/anchors.no_method_anchor.html2
-rw-r--r--src/test/rustdoc/anchors.no_trait_method_anchor.html2
-rw-r--r--src/test/rustdoc/anchors.no_tymethod_anchor.html2
-rw-r--r--src/test/rustdoc/anchors.no_type_anchor.html2
-rw-r--r--src/test/rustdoc/anonymous-lifetime.rs2
-rw-r--r--src/test/rustdoc/array-links.link_box_generic.html1
-rw-r--r--src/test/rustdoc/array-links.link_box_u32.html1
-rw-r--r--src/test/rustdoc/array-links.link_slice_generic.html1
-rw-r--r--src/test/rustdoc/array-links.link_slice_u32.html1
-rw-r--r--src/test/rustdoc/array-links.rs28
-rw-r--r--src/test/rustdoc/assoc-consts.rs12
-rw-r--r--src/test/rustdoc/associated-consts.rs8
-rw-r--r--src/test/rustdoc/async-trait.rs16
-rw-r--r--src/test/rustdoc/attribute-rendering.rs2
-rw-r--r--src/test/rustdoc/attributes.rs2
-rw-r--r--src/test/rustdoc/auxiliary/async-trait-dep.rs9
-rw-r--r--src/test/rustdoc/auxiliary/incoherent-impl-types.rs7
-rw-r--r--src/test/rustdoc/auxiliary/reexport-doc-aux.rs5
-rw-r--r--src/test/rustdoc/blanket-reexport-item.rs2
-rw-r--r--src/test/rustdoc/cfg_doc_reexport.rs33
-rw-r--r--src/test/rustdoc/check-source-code-urls-to-def-std.rs8
-rw-r--r--src/test/rustdoc/check-source-code-urls-to-def.rs22
-rw-r--r--src/test/rustdoc/codeblock-title.rs6
-rw-r--r--src/test/rustdoc/const-display.rs6
-rw-r--r--src/test/rustdoc/const-generics/add-impl.rs2
-rw-r--r--src/test/rustdoc/const-generics/const-generics-docs.rs18
-rw-r--r--src/test/rustdoc/const-generics/const-impl.rs10
-rw-r--r--src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs2
-rw-r--r--src/test/rustdoc/const-value-display.rs4
-rw-r--r--src/test/rustdoc/decl-trailing-whitespace.rs2
-rw-r--r--src/test/rustdoc/deprecated-impls.rs36
-rw-r--r--src/test/rustdoc/deref-recursive-pathbuf.rs4
-rw-r--r--src/test/rustdoc/deref-recursive.rs4
-rw-r--r--src/test/rustdoc/deref-typedef.rs2
-rw-r--r--src/test/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs38
-rw-r--r--src/test/rustdoc/doc_auto_cfg_nested_impl.rs24
-rw-r--r--src/test/rustdoc/duplicate_impls/issue-33054.rs6
-rw-r--r--src/test/rustdoc/elided-lifetime.rs14
-rw-r--r--src/test/rustdoc/empty-impl-block-private-with-doc.rs44
-rw-r--r--src/test/rustdoc/empty-impl-block-private.rs40
-rw-r--r--src/test/rustdoc/empty-impl-block.rs2
-rw-r--r--src/test/rustdoc/empty-mod-private.rs6
-rw-r--r--src/test/rustdoc/empty-mod-public.rs6
-rw-r--r--src/test/rustdoc/empty-section.rs2
-rw-r--r--src/test/rustdoc/ensure-src-link.rs2
-rw-r--r--src/test/rustdoc/escape-deref-methods.rs2
-rw-r--r--src/test/rustdoc/extern-impl.rs6
-rw-r--r--src/test/rustdoc/fn-bound.rs2
-rw-r--r--src/test/rustdoc/generic-associated-types/gats.rs5
-rw-r--r--src/test/rustdoc/generic-associated-types/issue-94683.rs5
-rw-r--r--src/test/rustdoc/generic-impl.rs2
-rw-r--r--src/test/rustdoc/glob-shadowing-const.rs20
-rw-r--r--src/test/rustdoc/glob-shadowing.rs86
-rw-r--r--src/test/rustdoc/hidden-impls.rs4
-rw-r--r--src/test/rustdoc/hidden-line.rs2
-rw-r--r--src/test/rustdoc/hidden-methods.rs8
-rw-r--r--src/test/rustdoc/hide-unstable-trait.rs4
-rw-r--r--src/test/rustdoc/higher-ranked-trait-bounds.rs10
-rw-r--r--src/test/rustdoc/impl-disambiguation.rs10
-rw-r--r--src/test/rustdoc/impl-parts-crosscrate.rs8
-rw-r--r--src/test/rustdoc/impl-parts.rs8
-rw-r--r--src/test/rustdoc/impl-trait-alias.rs4
-rw-r--r--src/test/rustdoc/impossible-default.rs20
-rw-r--r--src/test/rustdoc/index-page.rs6
-rw-r--r--src/test/rustdoc/infinite-redirection.rs2
-rw-r--r--src/test/rustdoc/inline_cross/add-docs.rs2
-rw-r--r--src/test/rustdoc/inline_cross/assoc-items.rs4
-rw-r--r--src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html1
-rw-r--r--src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html1
-rw-r--r--src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html1
-rw-r--r--src/test/rustdoc/inline_cross/assoc_item_trait_bounds.rs40
-rw-r--r--src/test/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs46
-rw-r--r--src/test/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs13
-rw-r--r--src/test/rustdoc/inline_cross/auxiliary/issue-24183.rs14
-rw-r--r--src/test/rustdoc/inline_cross/hidden-use.rs4
-rw-r--r--src/test/rustdoc/inline_cross/impl_trait.rs7
-rw-r--r--src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html1
-rw-r--r--src/test/rustdoc/inline_cross/issue-24183.rs18
-rw-r--r--src/test/rustdoc/inline_cross/issue-31948-1.rs20
-rw-r--r--src/test/rustdoc/inline_cross/issue-31948-2.rs12
-rw-r--r--src/test/rustdoc/inline_cross/issue-31948.rs20
-rw-r--r--src/test/rustdoc/inline_cross/issue-32881.rs4
-rw-r--r--src/test/rustdoc/inline_cross/issue-33113.rs4
-rw-r--r--src/test/rustdoc/inline_cross/proc_macro.rs12
-rw-r--r--src/test/rustdoc/inline_cross/trait-vis.rs2
-rw-r--r--src/test/rustdoc/inline_local/glob-extern-document-private-items.rs10
-rw-r--r--src/test/rustdoc/inline_local/glob-extern.rs6
-rw-r--r--src/test/rustdoc/inline_local/glob-private-document-private-items.rs26
-rw-r--r--src/test/rustdoc/inline_local/glob-private.rs12
-rw-r--r--src/test/rustdoc/inline_local/hidden-use.rs4
-rw-r--r--src/test/rustdoc/inline_local/macro_by_example.rs2
-rw-r--r--src/test/rustdoc/inline_local/please_inline.rs4
-rw-r--r--src/test/rustdoc/inline_local/trait-vis.rs4
-rw-r--r--src/test/rustdoc/internal.rs10
-rw-r--r--src/test/rustdoc/intra-doc/assoc-reexport-super.rs20
-rw-r--r--src/test/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs4
-rw-r--r--src/test/rustdoc/intra-doc/extern-crate-only-used-in-link.rs2
-rw-r--r--src/test/rustdoc/intra-doc/extern-type.rs6
-rw-r--r--src/test/rustdoc/intra-doc/issue-103463.rs8
-rw-r--r--src/test/rustdoc/intra-doc/issue-104145.rs14
-rw-r--r--src/test/rustdoc/intra-doc/no-doc-primitive.rs15
-rw-r--r--src/test/rustdoc/issue-100241.rs12
-rw-r--r--src/test/rustdoc/issue-100620.rs19
-rw-r--r--src/test/rustdoc/issue-100679-sidebar-links-deref.rs30
-rw-r--r--src/test/rustdoc/issue-101743-bold-tag.rs19
-rw-r--r--src/test/rustdoc/issue-16265-1.rs2
-rw-r--r--src/test/rustdoc/issue-16265-2.rs2
-rw-r--r--src/test/rustdoc/issue-20727-4.rs4
-rw-r--r--src/test/rustdoc/issue-21801.rs2
-rw-r--r--src/test/rustdoc/issue-23511.rs2
-rw-r--r--src/test/rustdoc/issue-23812.rs16
-rw-r--r--src/test/rustdoc/issue-27104.rs6
-rw-r--r--src/test/rustdoc/issue-27759.rs4
-rw-r--r--src/test/rustdoc/issue-29503.rs2
-rw-r--r--src/test/rustdoc/issue-29584.rs2
-rw-r--r--src/test/rustdoc/issue-31899.rs8
-rw-r--r--src/test/rustdoc/issue-32374.rs16
-rw-r--r--src/test/rustdoc/issue-32395.rs12
-rw-r--r--src/test/rustdoc/issue-33592.rs4
-rw-r--r--src/test/rustdoc/issue-34473.rs2
-rw-r--r--src/test/rustdoc/issue-34928.rs2
-rw-r--r--src/test/rustdoc/issue-41783.codeblock.html5
-rw-r--r--src/test/rustdoc/issue-41783.rs14
-rw-r--r--src/test/rustdoc/issue-46727.rs2
-rw-r--r--src/test/rustdoc/issue-50159.rs4
-rw-r--r--src/test/rustdoc/issue-51236.rs4
-rw-r--r--src/test/rustdoc/issue-53689.rs2
-rw-r--r--src/test/rustdoc/issue-54705.rs10
-rw-r--r--src/test/rustdoc/issue-55321.rs8
-rw-r--r--src/test/rustdoc/issue-56822.rs2
-rw-r--r--src/test/rustdoc/issue-60726.rs4
-rw-r--r--src/test/rustdoc/issue-61592.rs4
-rw-r--r--src/test/rustdoc/issue-75588.rs4
-rw-r--r--src/test/rustdoc/issue-80233-normalize-auto-trait.rs2
-rw-r--r--src/test/rustdoc/issue-82465-asref-for-and-of-local.rs4
-rw-r--r--src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline-last-item.rs16
-rw-r--r--src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline.rs16
-rw-r--r--src/test/rustdoc/issue-89852.rs4
-rw-r--r--src/test/rustdoc/issue-98697.rs6
-rw-r--r--src/test/rustdoc/keyword.rs2
-rw-r--r--src/test/rustdoc/link-title-escape.rs2
-rw-r--r--src/test/rustdoc/logo-class-default.rs2
-rw-r--r--src/test/rustdoc/logo-class.rs4
-rw-r--r--src/test/rustdoc/macro-document-private-duplicate.rs10
-rw-r--r--src/test/rustdoc/macro-higher-kinded-function.rs4
-rw-r--r--src/test/rustdoc/macro-private-not-documented.rs4
-rw-r--r--src/test/rustdoc/macro_rules-matchers.rs29
-rw-r--r--src/test/rustdoc/markdown-summaries.rs12
-rw-r--r--src/test/rustdoc/masked.rs14
-rw-r--r--src/test/rustdoc/module-impls.rs2
-rw-r--r--src/test/rustdoc/negative-impl-sidebar.rs2
-rw-r--r--src/test/rustdoc/negative-impl.rs4
-rw-r--r--src/test/rustdoc/nested-modules.rs14
-rw-r--r--src/test/rustdoc/no-crate-filter.rs2
-rw-r--r--src/test/rustdoc/normalize-assoc-item.rs13
-rw-r--r--src/test/rustdoc/not-wf-ambiguous-normalization.rs24
-rw-r--r--src/test/rustdoc/primitive-reference.rs37
-rw-r--r--src/test/rustdoc/primitive-slice-auto-trait.rs6
-rw-r--r--src/test/rustdoc/primitive-tuple-auto-trait.rs2
-rw-r--r--src/test/rustdoc/primitive-unit-auto-trait.rs2
-rw-r--r--src/test/rustdoc/primitive.rs2
-rw-r--r--src/test/rustdoc/primitive/primitive-generic-impl.rs2
-rw-r--r--src/test/rustdoc/recursive-deref.rs26
-rw-r--r--src/test/rustdoc/reexport-dep-foreign-fn.rs2
-rw-r--r--src/test/rustdoc/reexport-doc.rs8
-rw-r--r--src/test/rustdoc/reexports-priv.rs32
-rw-r--r--src/test/rustdoc/reexports.rs16
-rw-r--r--src/test/rustdoc/remove-url-from-headings.rs2
-rw-r--r--src/test/rustdoc/rfc-2632-const-trait-impl.rs16
-rw-r--r--src/test/rustdoc/rustc-incoherent-impls.rs28
-rw-r--r--src/test/rustdoc/safe-intrinsic.rs2
-rw-r--r--src/test/rustdoc/search-index-summaries.rs6
-rw-r--r--src/test/rustdoc/search-index.rs10
-rw-r--r--src/test/rustdoc/short-docblock-codeblock.rs4
-rw-r--r--src/test/rustdoc/short-docblock.rs10
-rw-r--r--src/test/rustdoc/show-const-contents.rs48
-rw-r--r--src/test/rustdoc/sidebar-all-page.rs35
-rw-r--r--src/test/rustdoc/sidebar-items.rs18
-rw-r--r--src/test/rustdoc/sidebar-links-to-foreign-impl.rs6
-rw-r--r--src/test/rustdoc/sized_trait.rs6
-rw-r--r--src/test/rustdoc/sort-modules-by-appearance.rs4
-rw-r--r--src/test/rustdoc/source-file.rs2
-rw-r--r--src/test/rustdoc/src-links-auto-impls.rs8
-rw-r--r--src/test/rustdoc/static-root-path.rs20
-rw-r--r--src/test/rustdoc/strip-enum-variant.no-not-shown.html2
-rw-r--r--src/test/rustdoc/strip-enum-variant.rs2
-rw-r--r--src/test/rustdoc/synthetic_auto/basic.rs4
-rw-r--r--src/test/rustdoc/synthetic_auto/complex.rs4
-rw-r--r--src/test/rustdoc/synthetic_auto/crate-local.rs6
-rw-r--r--src/test/rustdoc/synthetic_auto/lifetimes.rs8
-rw-r--r--src/test/rustdoc/synthetic_auto/manual.rs6
-rw-r--r--src/test/rustdoc/synthetic_auto/negative.rs4
-rw-r--r--src/test/rustdoc/synthetic_auto/nested.rs8
-rw-r--r--src/test/rustdoc/synthetic_auto/no-redundancy.rs4
-rw-r--r--src/test/rustdoc/synthetic_auto/overflow.rs2
-rw-r--r--src/test/rustdoc/synthetic_auto/project.rs8
-rw-r--r--src/test/rustdoc/synthetic_auto/self-referential.rs4
-rw-r--r--src/test/rustdoc/synthetic_auto/static-region.rs4
-rw-r--r--src/test/rustdoc/table-in-docblock.rs2
-rw-r--r--src/test/rustdoc/toggle-item-contents.rs6
-rw-r--r--src/test/rustdoc/toggle-trait-fn.rs12
-rw-r--r--src/test/rustdoc/trait-impl-items-links-and-anchors.rs2
-rw-r--r--src/test/rustdoc/trait-impl.rs24
-rw-r--r--src/test/rustdoc/trait_alias.rs6
-rw-r--r--src/test/rustdoc/traits-in-bodies.rs6
-rw-r--r--src/test/rustdoc/tuple-struct-fields-doc.rs4
-rw-r--r--src/test/rustdoc/type-layout-flag-required.rs2
-rw-r--r--src/test/rustdoc/type-layout.rs64
-rw-r--r--src/test/rustdoc/typedef.rs6
-rw-r--r--src/test/rustdoc/universal-impl-trait.rs30
-rw-r--r--src/test/rustdoc/version-separator-without-source.rs2
-rw-r--r--src/test/rustdoc/where-clause-order.rs2
-rw-r--r--src/test/rustdoc/where.SWhere_Simd_item-decl.html2
-rw-r--r--src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html9
-rw-r--r--src/test/rustdoc/where.rs49
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.enum.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.enum2.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.rs16
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.struct.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.struct2.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.trait.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.trait2.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.union.html4
-rw-r--r--src/test/rustdoc/whitespace-after-where-clause.union2.html4
-rw-r--r--src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs12
-rw-r--r--src/test/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs6
-rw-r--r--src/test/ui-fulldeps/auxiliary/lint-for-crate.rs10
-rw-r--r--src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs12
-rw-r--r--src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs4
-rw-r--r--src/test/ui-fulldeps/auxiliary/lint-tool-test.rs8
-rw-r--r--src/test/ui-fulldeps/fluent-messages/duplicate-a-b.ftl1
-rw-r--r--src/test/ui-fulldeps/fluent-messages/duplicate-a.ftl2
-rw-r--r--src/test/ui-fulldeps/fluent-messages/duplicate-b.ftl1
-rw-r--r--src/test/ui-fulldeps/fluent-messages/label-with-hyphens.ftl2
-rw-r--r--src/test/ui-fulldeps/fluent-messages/missing-crate-name.ftl2
-rw-r--r--src/test/ui-fulldeps/fluent-messages/missing-message.ftl2
-rw-r--r--src/test/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl1
-rw-r--r--src/test/ui-fulldeps/fluent-messages/test.rs38
-rw-r--r--src/test/ui-fulldeps/fluent-messages/test.stderr73
-rw-r--r--src/test/ui-fulldeps/fluent-messages/valid.ftl2
-rw-r--r--src/test/ui-fulldeps/internal-lints/default_hash_types.stderr2
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics.rs72
-rw-r--r--src/test/ui-fulldeps/internal-lints/diagnostics.stderr34
-rw-r--r--src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr2
-rw-r--r--src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr2
-rw-r--r--src/test/ui-fulldeps/internal-lints/query_stability.stderr2
-rw-r--r--src/test/ui-fulldeps/issue-15778-pass.rs23
-rw-r--r--src/test/ui-fulldeps/issue-15778-pass.stderr10
-rw-r--r--src/test/ui-fulldeps/pprust-expr-roundtrip.rs9
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs676
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr686
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs430
-rw-r--r--src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr376
-rw-r--r--src/test/ui/abi/abi-sysv64-register-usage.rs26
-rw-r--r--src/test/ui/abi/abi-typo-unstable.rs6
-rw-r--r--src/test/ui/abi/abi-typo-unstable.stderr11
-rw-r--r--src/test/ui/abi/issues/issue-97463-broken-abi-leaked-uninit-data.rs39
-rw-r--r--src/test/ui/abi/segfault-no-out-of-stack.rs1
-rw-r--r--src/test/ui/abi/stack-probes-lto.rs3
-rw-r--r--src/test/ui/abi/stack-probes.rs30
-rw-r--r--src/test/ui/abi/unsupported.aarch64.stderr2
-rw-r--r--src/test/ui/abi/unsupported.arm.stderr2
-rw-r--r--src/test/ui/abi/unsupported.x64.stderr2
-rw-r--r--src/test/ui/abi/x86stdcall.rs26
-rw-r--r--src/test/ui/abi/x86stdcall2.rs12
-rw-r--r--src/test/ui/alloc-error/default-alloc-error-hook.rs11
-rw-r--r--src/test/ui/allocator/no_std-alloc-error-handler-custom.rs2
-rw-r--r--src/test/ui/allocator/no_std-alloc-error-handler-default.rs2
-rw-r--r--src/test/ui/anon-params/anon-params-deprecated.stderr4
-rw-r--r--src/test/ui/anonymous-higher-ranked-lifetime.stderr20
-rw-r--r--src/test/ui/argument-suggestions/basic.stderr10
-rw-r--r--src/test/ui/argument-suggestions/complex.stderr4
-rw-r--r--src/test/ui/argument-suggestions/exotic-calls.stderr8
-rw-r--r--src/test/ui/argument-suggestions/extra_arguments.stderr28
-rw-r--r--src/test/ui/argument-suggestions/invalid_arguments.stderr20
-rw-r--r--src/test/ui/argument-suggestions/issue-100478.rs52
-rw-r--r--src/test/ui/argument-suggestions/issue-100478.stderr81
-rw-r--r--src/test/ui/argument-suggestions/issue-101097.rs21
-rw-r--r--src/test/ui/argument-suggestions/issue-101097.stderr160
-rw-r--r--src/test/ui/argument-suggestions/issue-96638.stderr6
-rw-r--r--src/test/ui/argument-suggestions/issue-97197.stderr2
-rw-r--r--src/test/ui/argument-suggestions/issue-97484.stderr7
-rw-r--r--src/test/ui/argument-suggestions/issue-98894.stderr2
-rw-r--r--src/test/ui/argument-suggestions/issue-98897.stderr2
-rw-r--r--src/test/ui/argument-suggestions/issue-99482.stderr2
-rw-r--r--src/test/ui/argument-suggestions/missing_arguments.stderr38
-rw-r--r--src/test/ui/argument-suggestions/mixed_cases.stderr12
-rw-r--r--src/test/ui/argument-suggestions/permuted_arguments.stderr4
-rw-r--r--src/test/ui/argument-suggestions/swapped_arguments.stderr10
-rw-r--r--src/test/ui/argument-suggestions/too-long.rs41
-rw-r--r--src/test/ui/argument-suggestions/too-long.stderr24
-rw-r--r--src/test/ui/argument-suggestions/two-mismatch-notes.rs11
-rw-r--r--src/test/ui/argument-suggestions/two-mismatch-notes.stderr29
-rw-r--r--src/test/ui/array-slice-vec/array_const_index-0.rs3
-rw-r--r--src/test/ui/array-slice-vec/array_const_index-0.stderr20
-rw-r--r--src/test/ui/array-slice-vec/array_const_index-1.rs3
-rw-r--r--src/test/ui/array-slice-vec/array_const_index-1.stderr20
-rw-r--r--src/test/ui/array-slice-vec/suggest-array-length.fixed26
-rw-r--r--src/test/ui/array-slice-vec/suggest-array-length.rs26
-rw-r--r--src/test/ui/array-slice-vec/suggest-array-length.stderr108
-rw-r--r--src/test/ui/asm/aarch64/bad-reg.rs2
-rw-r--r--src/test/ui/asm/aarch64/may_unwind.rs3
-rw-r--r--src/test/ui/asm/aarch64/sym.rs2
-rw-r--r--src/test/ui/asm/aarch64/type-check-2-2.rs2
-rw-r--r--src/test/ui/asm/aarch64/type-check-2-2.stderr10
-rw-r--r--src/test/ui/asm/aarch64/type-check-2.rs2
-rw-r--r--src/test/ui/asm/aarch64/type-check-3.stderr40
-rw-r--r--src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr4
-rw-r--r--src/test/ui/asm/generic-const.rs2
-rw-r--r--src/test/ui/asm/may_unwind.rs1
-rw-r--r--src/test/ui/asm/naked-functions-ffi.stderr2
-rw-r--r--src/test/ui/asm/naked-functions.rs2
-rw-r--r--src/test/ui/asm/naked-functions.stderr103
-rw-r--r--src/test/ui/asm/named-asm-labels.stderr6
-rw-r--r--src/test/ui/asm/type-check-1.rs2
-rw-r--r--src/test/ui/asm/type-check-1.stderr4
-rw-r--r--src/test/ui/asm/unpretty-expanded.rs4
-rw-r--r--src/test/ui/asm/unpretty-expanded.stdout10
-rw-r--r--src/test/ui/asm/x86_64/bad-reg.rs2
-rw-r--r--src/test/ui/asm/x86_64/issue-96797.rs2
-rw-r--r--src/test/ui/asm/x86_64/may_unwind.rs4
-rw-r--r--src/test/ui/asm/x86_64/multiple-clobber-abi.rs2
-rw-r--r--src/test/ui/asm/x86_64/sym.rs3
-rw-r--r--src/test/ui/asm/x86_64/type-check-2.rs2
-rw-r--r--src/test/ui/asm/x86_64/type-check-3.stderr16
-rw-r--r--src/test/ui/asm/x86_64/type-check-4.rs5
-rw-r--r--src/test/ui/asm/x86_64/type-check-4.stderr6
-rw-r--r--src/test/ui/asm/x86_64/type-check-5.rs2
-rw-r--r--src/test/ui/asm/x86_64/type-check-5.stderr10
-rw-r--r--src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.stderr2
-rw-r--r--src/test/ui/associated-consts/defaults-cyclic-fail.stderr4
-rw-r--r--src/test/ui/associated-consts/defaults-not-assumed-fail.rs4
-rw-r--r--src/test/ui/associated-consts/defaults-not-assumed-fail.stderr39
-rw-r--r--src/test/ui/associated-consts/issue-102335-const.rs12
-rw-r--r--src/test/ui/associated-consts/issue-102335-const.stderr9
-rw-r--r--src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr2
-rw-r--r--src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr2
-rw-r--r--src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr2
-rw-r--r--src/test/ui/associated-consts/mismatched_impl_ty_1.rs18
-rw-r--r--src/test/ui/associated-consts/mismatched_impl_ty_2.rs11
-rw-r--r--src/test/ui/associated-consts/mismatched_impl_ty_3.rs11
-rw-r--r--src/test/ui/associated-item/associated-item-duplicate-names-2.stderr8
-rw-r--r--src/test/ui/associated-item/associated-item-duplicate-names-3.rs1
-rw-r--r--src/test/ui/associated-item/associated-item-duplicate-names-3.stderr18
-rw-r--r--src/test/ui/associated-item/associated-item-duplicate-names.stderr14
-rw-r--r--src/test/ui/associated-item/impl-duplicate-methods.rs (renamed from src/test/ui/impl-duplicate-methods.rs)2
-rw-r--r--src/test/ui/associated-item/impl-duplicate-methods.stderr11
-rw-r--r--src/test/ui/associated-type-bounds/binder-on-bound.rs2
-rw-r--r--src/test/ui/associated-type-bounds/binder-on-bound.stderr2
-rw-r--r--src/test/ui/associated-type-bounds/elision.rs2
-rw-r--r--src/test/ui/associated-type-bounds/inside-adt.rs4
-rw-r--r--src/test/ui/associated-type-bounds/inside-adt.stderr10
-rw-r--r--src/test/ui/associated-type-bounds/issue-102335-ty.rs12
-rw-r--r--src/test/ui/associated-type-bounds/issue-102335-ty.stderr9
-rw-r--r--src/test/ui/associated-type-bounds/issue-79949.rs1
-rw-r--r--src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr8
-rw-r--r--src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr12
-rw-r--r--src/test/ui/associated-types/associated-types-eq-3.stderr6
-rw-r--r--src/test/ui/associated-types/associated-types-eq-hr.stderr8
-rw-r--r--src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr4
-rw-r--r--src/test/ui/associated-types/associated-types-issue-20346.stderr6
-rw-r--r--src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr12
-rw-r--r--src/test/ui/associated-types/associated-types-no-suitable-bound.stderr4
-rw-r--r--src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr4
-rw-r--r--src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr8
-rw-r--r--src/test/ui/associated-types/associated-types-overridden-binding-2.rs2
-rw-r--r--src/test/ui/associated-types/associated-types-overridden-binding-2.stderr2
-rw-r--r--src/test/ui/associated-types/associated-types-path-2.rs2
-rw-r--r--src/test/ui/associated-types/associated-types-path-2.stderr32
-rw-r--r--src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr4
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr10
-rw-r--r--src/test/ui/associated-types/cache/project-fn-ret-invariant.rs2
-rw-r--r--src/test/ui/associated-types/defaults-specialization.stderr2
-rw-r--r--src/test/ui/associated-types/defaults-suitability.stderr6
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.badbase.stderr17
-rw-r--r--src/test/ui/associated-types/higher-ranked-projection.badnll.stderr2
-rw-r--r--src/test/ui/associated-types/hr-associated-type-bound-2.stderr4
-rw-r--r--src/test/ui/associated-types/impl-wf-cycle-1.stderr4
-rw-r--r--src/test/ui/associated-types/impl-wf-cycle-2.stderr2
-rw-r--r--src/test/ui/associated-types/issue-22560.stderr46
-rw-r--r--src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr6
-rw-r--r--src/test/ui/associated-types/issue-44153.stderr2
-rw-r--r--src/test/ui/associated-types/issue-59324.rs2
-rw-r--r--src/test/ui/associated-types/issue-59324.stderr17
-rw-r--r--src/test/ui/associated-types/issue-62200.rs3
-rw-r--r--src/test/ui/associated-types/issue-62200.stderr3
-rw-r--r--src/test/ui/associated-types/issue-65774-1.stderr2
-rw-r--r--src/test/ui/associated-types/issue-85103.rs2
-rw-r--r--src/test/ui/associated-types/issue-85103.stderr2
-rw-r--r--src/test/ui/associated-types/issue-87261.rs6
-rw-r--r--src/test/ui/associated-types/issue-87261.stderr102
-rw-r--r--src/test/ui/associated-types/substs-ppaux.normal.stderr8
-rw-r--r--src/test/ui/associated-types/substs-ppaux.verbose.stderr8
-rw-r--r--src/test/ui/async-await/async-await-let-else.drop-tracking.stderr110
-rw-r--r--src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr (renamed from src/test/ui/async-await/async-await-let-else.stderr)28
-rw-r--r--src/test/ui/async-await/async-await-let-else.rs13
-rw-r--r--src/test/ui/async-await/async-block-control-flow-static-semantics.rs8
-rw-r--r--src/test/ui/async-await/async-block-control-flow-static-semantics.stderr8
-rw-r--r--src/test/ui/async-await/async-fn-nonsend.stderr2
-rw-r--r--src/test/ui/async-await/async-fn-size-moved-locals.rs2
-rw-r--r--src/test/ui/async-await/async-fn-size-uninit-locals.rs5
-rw-r--r--src/test/ui/async-await/async-trait-fn.stderr23
-rw-r--r--src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr4
-rw-r--r--src/test/ui/async-await/await-keyword/2015-edition-warning.stderr4
-rw-r--r--src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr4
-rw-r--r--src/test/ui/async-await/edition-deny-async-fns-2015.rs2
-rw-r--r--src/test/ui/async-await/edition-deny-async-fns-2015.stderr4
-rw-r--r--src/test/ui/async-await/feature-gate-async_fn_in_trait.rs25
-rw-r--r--src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr42
-rw-r--r--src/test/ui/async-await/generator-desc.stderr4
-rw-r--r--src/test/ui/async-await/in-trait/async-associated-types.rs24
-rw-r--r--src/test/ui/async-await/in-trait/async-associated-types.stderr57
-rw-r--r--src/test/ui/async-await/in-trait/async-associated-types2.rs30
-rw-r--r--src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs21
-rw-r--r--src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr17
-rw-r--r--src/test/ui/async-await/in-trait/async-example-desugared-boxed.rs24
-rw-r--r--src/test/ui/async-await/in-trait/async-example-desugared-in-trait.rs21
-rw-r--r--src/test/ui/async-await/in-trait/async-example-desugared.rs23
-rw-r--r--src/test/ui/async-await/in-trait/async-example.rs32
-rw-r--r--src/test/ui/async-await/in-trait/async-generics-and-bounds.rs21
-rw-r--r--src/test/ui/async-await/in-trait/async-generics-and-bounds.stderr37
-rw-r--r--src/test/ui/async-await/in-trait/async-generics.rs18
-rw-r--r--src/test/ui/async-await/in-trait/async-generics.stderr37
-rw-r--r--src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.rs20
-rw-r--r--src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.stderr23
-rw-r--r--src/test/ui/async-await/in-trait/async-lifetimes.rs18
-rw-r--r--src/test/ui/async-await/in-trait/async-lifetimes.stderr23
-rw-r--r--src/test/ui/async-await/in-trait/async-recursive-generic.rs21
-rw-r--r--src/test/ui/async-await/in-trait/async-recursive-generic.stderr12
-rw-r--r--src/test/ui/async-await/in-trait/async-recursive.rs21
-rw-r--r--src/test/ui/async-await/in-trait/async-recursive.stderr12
-rw-r--r--src/test/ui/async-await/in-trait/fn-not-async-err.rs17
-rw-r--r--src/test/ui/async-await/in-trait/fn-not-async-err.stderr17
-rw-r--r--src/test/ui/async-await/in-trait/fn-not-async-err2.rs21
-rw-r--r--src/test/ui/async-await/in-trait/fn-not-async-err2.stderr12
-rw-r--r--src/test/ui/async-await/in-trait/issue-102138.rs46
-rw-r--r--src/test/ui/async-await/in-trait/issue-102219.rs10
-rw-r--r--src/test/ui/async-await/in-trait/issue-102310.rs15
-rw-r--r--src/test/ui/async-await/issue-101715.rs17
-rw-r--r--src/test/ui/async-await/issue-101715.stderr16
-rw-r--r--src/test/ui/async-await/issue-64130-1-sync.rs2
-rw-r--r--src/test/ui/async-await/issue-64130-2-send.rs2
-rw-r--r--src/test/ui/async-await/issue-64130-3-other.rs2
-rw-r--r--src/test/ui/async-await/issue-64130-4-async-move.drop-tracking.stderr (renamed from src/test/ui/async-await/issue-64130-4-async-move.stderr)6
-rw-r--r--src/test/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr26
-rw-r--r--src/test/ui/async-await/issue-64130-4-async-move.rs10
-rw-r--r--src/test/ui/async-await/issue-66387-if-without-else.stderr2
-rw-r--r--src/test/ui/async-await/issue-67252-unnamed-future.stderr10
-rw-r--r--src/test/ui/async-await/issue-68112.drop_tracking.stderr79
-rw-r--r--src/test/ui/async-await/issue-68112.no_drop_tracking.stderr (renamed from src/test/ui/async-await/issue-68112.stderr)39
-rw-r--r--src/test/ui/async-await/issue-68112.rs11
-rw-r--r--src/test/ui/async-await/issue-70594.stderr12
-rw-r--r--src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr12
-rw-r--r--src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr (renamed from src/test/ui/async-await/issue-70935-complex-spans.normal.stderr)8
-rw-r--r--src/test/ui/async-await/issue-70935-complex-spans.rs5
-rw-r--r--src/test/ui/async-await/issue-73137.rs3
-rw-r--r--src/test/ui/async-await/issue-73541-3.rs (renamed from src/test/ui/issues/issue-73541-3.rs)0
-rw-r--r--src/test/ui/async-await/issue-73541-3.stderr (renamed from src/test/ui/issues/issue-73541-3.stderr)0
-rw-r--r--src/test/ui/async-await/issue-73541.rs (renamed from src/test/ui/issues/issue-73541.rs)0
-rw-r--r--src/test/ui/async-await/issue-73541.stderr (renamed from src/test/ui/issues/issue-73541.stderr)0
-rw-r--r--src/test/ui/async-await/issue-98634.rs50
-rw-r--r--src/test/ui/async-await/issue-98634.stderr60
-rw-r--r--src/test/ui/async-await/issues/issue-62009-1.stderr14
-rw-r--r--src/test/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs1
-rw-r--r--src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr (renamed from src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr)18
-rw-r--r--src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs6
-rw-r--r--src/test/ui/async-await/issues/issue-95307.stderr14
-rw-r--r--src/test/ui/async-await/large_moves.attribute.stderr2
-rw-r--r--src/test/ui/async-await/large_moves.option.stderr2
-rw-r--r--src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr2
-rw-r--r--src/test/ui/async-await/no-const-async.stderr2
-rw-r--r--src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr35
-rw-r--r--src/test/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr (renamed from src/test/ui/async-await/partial-drop-partial-reinit.stderr)6
-rw-r--r--src/test/ui/async-await/partial-drop-partial-reinit.rs11
-rw-r--r--src/test/ui/async-await/unnecessary-await.stderr2
-rw-r--r--src/test/ui/attempted-access-non-fatal.rs4
-rw-r--r--src/test/ui/attempted-access-non-fatal.stderr46
-rw-r--r--src/test/ui/attr-from-macro.rs20
-rw-r--r--src/test/ui/attributes/collapse-debuginfo-invalid.rs110
-rw-r--r--src/test/ui/attributes/collapse-debuginfo-invalid.stderr222
-rw-r--r--src/test/ui/attributes/doc-attr.stderr4
-rw-r--r--src/test/ui/attributes/invalid-doc-attr.stderr6
-rw-r--r--src/test/ui/attributes/issue-100631.rs8
-rw-r--r--src/test/ui/attributes/issue-100631.stderr12
-rw-r--r--src/test/ui/attributes/issue-90873.stderr4
-rw-r--r--src/test/ui/attributes/register-attr-tool-fail.rs13
-rw-r--r--src/test/ui/attributes/register-attr-tool-fail.stderr42
-rw-r--r--src/test/ui/attributes/register-attr-tool-import.rs17
-rw-r--r--src/test/ui/attributes/register-attr-tool-import.stderr38
-rw-r--r--src/test/ui/attributes/register-attr-tool-prelude.rs14
-rw-r--r--src/test/ui/attributes/register-attr-tool-prelude.stderr15
-rw-r--r--src/test/ui/attributes/register-attr-tool-unused.rs8
-rw-r--r--src/test/ui/attributes/register-attr-tool-unused.stderr21
-rw-r--r--src/test/ui/attributes/register-attr-tool.rs19
-rw-r--r--src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs33
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.rs4
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.stderr13
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs5
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr14
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-error.rs13
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs14
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs4
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr15
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.rs6
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.stderr8
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.rs8
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.stderr8
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs9
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs13
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-rustc_main.rs15
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-sig_dfl.rs13
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.rs6
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.stderr8
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.rs6
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.stderr8
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.rs4
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.stderr8
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe.rs4
-rw-r--r--src/test/ui/attributes/unix_sigpipe/unix_sigpipe.stderr8
-rw-r--r--src/test/ui/auto-ref-slice-plus-ref.stderr2
-rw-r--r--src/test/ui/auto-traits/suspicious-impls-lint.stderr10
-rw-r--r--src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr4
-rw-r--r--src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr6
-rw-r--r--src/test/ui/auxiliary/attr-from-macro.rs15
-rw-r--r--src/test/ui/backtrace-apple-no-dsymutil.rs2
-rw-r--r--src/test/ui/backtrace.rs1
-rw-r--r--src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs1
-rw-r--r--src/test/ui/binding/issue-53114-safety-checks.stderr10
-rw-r--r--src/test/ui/binop/binary-op-on-double-ref.stderr2
-rw-r--r--src/test/ui/binop/issue-77910-1.rs2
-rw-r--r--src/test/ui/binop/issue-77910-1.stderr12
-rw-r--r--src/test/ui/binop/issue-77910-2.stderr9
-rw-r--r--src/test/ui/block-result/consider-removing-last-semi.stderr6
-rw-r--r--src/test/ui/block-result/issue-11714.stderr2
-rw-r--r--src/test/ui/block-result/issue-13428.stderr2
-rw-r--r--src/test/ui/block-result/issue-22645.stderr2
-rw-r--r--src/test/ui/block-result/issue-3563.stderr2
-rw-r--r--src/test/ui/borrowck/anonymous-region-in-apit.rs12
-rw-r--r--src/test/ui/borrowck/anonymous-region-in-apit.stderr16
-rw-r--r--src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr30
-rw-r--r--src/test/ui/borrowck/borrowck-block-unint.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-break-uninit-2.stderr4
-rw-r--r--src/test/ui/borrowck/borrowck-break-uninit.stderr4
-rw-r--r--src/test/ui/borrowck/borrowck-describe-lvalue.stderr12
-rw-r--r--src/test/ui/borrowck/borrowck-init-in-called-fn-expr.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-init-in-fn-expr.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-init-in-fru.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-init-op-equal.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-init-plus-equal.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-from-array-match.stderr6
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-from-array-no-overlap-match.stderr6
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-from-array-use-match.stderr10
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-from-array-use-no-overlap-match.stderr6
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-from-array-use.stderr20
-rw-r--r--src/test/ui/borrowck/borrowck-move-out-from-array.stderr16
-rw-r--r--src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-return.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-slice-pattern-element-loan-array.stderr8
-rw-r--r--src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr8
-rw-r--r--src/test/ui/borrowck/borrowck-storage-dead.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-uninit-after-item.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-uninit-field-access.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-uninit-in-assignop.stderr50
-rw-r--r--src/test/ui/borrowck/borrowck-uninit-ref-chain.stderr15
-rw-r--r--src/test/ui/borrowck/borrowck-uninit.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-use-in-index-lvalue.stderr10
-rw-r--r--src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.stderr5
-rw-r--r--src/test/ui/borrowck/borrowck-vec-pattern-move-tail.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr2
-rw-r--r--src/test/ui/borrowck/borrowck-while-cond.stderr5
-rw-r--r--src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs8
-rw-r--r--src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.stderr18
-rw-r--r--src/test/ui/borrowck/index-mut-help.rs3
-rw-r--r--src/test/ui/borrowck/index-mut-help.stderr19
-rw-r--r--src/test/ui/borrowck/issue-101119.rs16
-rw-r--r--src/test/ui/borrowck/issue-101119.stderr15
-rw-r--r--src/test/ui/borrowck/issue-102209.rs28
-rw-r--r--src/test/ui/borrowck/issue-102209.stderr22
-rw-r--r--src/test/ui/borrowck/issue-103250.rs37
-rw-r--r--src/test/ui/borrowck/issue-103250.stderr17
-rw-r--r--src/test/ui/borrowck/issue-103624.rs31
-rw-r--r--src/test/ui/borrowck/issue-103624.stderr35
-rw-r--r--src/test/ui/borrowck/issue-17718-static-move.rs (renamed from src/test/ui/issues/issue-17718-static-move.rs)0
-rw-r--r--src/test/ui/borrowck/issue-17718-static-move.stderr (renamed from src/test/ui/issues/issue-17718-static-move.stderr)0
-rw-r--r--src/test/ui/borrowck/issue-23338-params-outlive-temps-of-body.rs (renamed from src/test/ui/issues/issue-23338-params-outlive-temps-of-body.rs)0
-rw-r--r--src/test/ui/borrowck/issue-24267-flow-exit.stderr8
-rw-r--r--src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr4
-rw-r--r--src/test/ui/borrowck/issue-62107-match-arm-scopes.stderr5
-rw-r--r--src/test/ui/borrowck/issue-64453.stderr1
-rw-r--r--src/test/ui/borrowck/issue-81899.rs3
-rw-r--r--src/test/ui/borrowck/issue-81899.stderr23
-rw-r--r--src/test/ui/borrowck/issue-88434-minimal-example.rs3
-rw-r--r--src/test/ui/borrowck/issue-88434-minimal-example.stderr23
-rw-r--r--src/test/ui/borrowck/issue-88434-removal-index-should-be-less.rs3
-rw-r--r--src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr23
-rw-r--r--src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.rs14
-rw-r--r--src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.stderr37
-rw-r--r--src/test/ui/borrowck/reborrow-sugg-move-then-borrow.rs26
-rw-r--r--src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr24
-rw-r--r--src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr5
-rw-r--r--src/test/ui/borrowck/suggest-assign-rvalue.rs57
-rw-r--r--src/test/ui/borrowck/suggest-assign-rvalue.stderr138
-rw-r--r--src/test/ui/borrowck/two-phase-across-loop.stderr5
-rw-r--r--src/test/ui/borrowck/two-phase-nonrecv-autoref.rs4
-rw-r--r--src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs2
-rw-r--r--src/test/ui/box/issue-95036.rs2
-rw-r--r--src/test/ui/btreemap/btreemap-index-mut.rs6
-rw-r--r--src/test/ui/btreemap/btreemap-index-mut.stderr19
-rw-r--r--src/test/ui/builtin-clone-unwind.rs1
-rw-r--r--src/test/ui/c-variadic/issue-86053-1.stderr6
-rw-r--r--src/test/ui/c-variadic/variadic-ffi-1.stderr4
-rw-r--r--src/test/ui/cast/cast-rfc0401.rs6
-rw-r--r--src/test/ui/cast/issue-88621.rs2
-rw-r--r--src/test/ui/cast/issue-88621.stderr2
-rw-r--r--src/test/ui/catch-unwind-bang.rs1
-rw-r--r--src/test/ui/cenum_impl_drop_cast.stderr8
-rw-r--r--src/test/ui/cfg/cfg-method-receiver-ok.rs14
-rw-r--r--src/test/ui/cfg/cfg-method-receiver.rs11
-rw-r--r--src/test/ui/cfg/cfg-method-receiver.stderr24
-rw-r--r--src/test/ui/cfg/cfg-panic.rs3
-rw-r--r--src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs1
-rw-r--r--src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr15
-rw-r--r--src/test/ui/chalkify/type_wf.rs4
-rw-r--r--src/test/ui/chalkify/type_wf.stderr6
-rw-r--r--src/test/ui/check-cfg/allow-at-crate-level.rs8
-rw-r--r--src/test/ui/check-cfg/compact-values.stderr2
-rw-r--r--src/test/ui/check-cfg/empty-values.stderr2
-rw-r--r--src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr2
-rw-r--r--src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr2
-rw-r--r--src/test/ui/check-cfg/invalid-cfg-value.stderr8
-rw-r--r--src/test/ui/check-cfg/mix.rs2
-rw-r--r--src/test/ui/check-cfg/mix.stderr10
-rw-r--r--src/test/ui/check-cfg/no-values.stderr2
-rw-r--r--src/test/ui/check-cfg/well-known-values.stderr2
-rw-r--r--src/test/ui/check-static-values-constraints.rs2
-rw-r--r--src/test/ui/check-static-values-constraints.stderr5
-rw-r--r--src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr12
-rw-r--r--src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr2
-rw-r--r--src/test/ui/closure_context/issue-26046-fn-mut.stderr2
-rw-r--r--src/test/ui/closure_context/issue-26046-fn-once.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr10
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr10
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/issue-90465.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/match/issue-87097.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr8
-rw-r--r--src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr5
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed1
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs1
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/repr_packed.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr16
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs4
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs2
-rw-r--r--src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs2
-rw-r--r--src/test/ui/closures/binder/disallow-const.rs6
-rw-r--r--src/test/ui/closures/binder/disallow-const.stderr8
-rw-r--r--src/test/ui/closures/binder/disallow-ty.rs6
-rw-r--r--src/test/ui/closures/binder/disallow-ty.stderr8
-rw-r--r--src/test/ui/closures/closure-bounds-subtype.stderr4
-rw-r--r--src/test/ui/closures/closure-move-sync.stderr22
-rw-r--r--src/test/ui/closures/closure-reform-bad.stderr2
-rw-r--r--src/test/ui/closures/closure-return-type-must-be-sized.rs74
-rw-r--r--src/test/ui/closures/closure-return-type-must-be-sized.stderr99
-rw-r--r--src/test/ui/closures/closure-wrong-kind.stderr10
-rw-r--r--src/test/ui/closures/closure_promotion.rs2
-rw-r--r--src/test/ui/closures/coerce-unsafe-to-closure.stderr2
-rw-r--r--src/test/ui/closures/issue-101696.rs36
-rw-r--r--src/test/ui/closures/issue-102089-multiple-opaque-cast.rs17
-rw-r--r--src/test/ui/closures/issue-10398.rs4
-rw-r--r--src/test/ui/closures/issue-10398.stderr2
-rw-r--r--src/test/ui/closures/issue-52437.rs1
-rw-r--r--src/test/ui/closures/issue-52437.stderr13
-rw-r--r--src/test/ui/closures/issue-6801.rs4
-rw-r--r--src/test/ui/closures/issue-84128.rs2
-rw-r--r--src/test/ui/closures/issue-84128.stderr5
-rw-r--r--src/test/ui/closures/issue-97607.rs12
-rw-r--r--src/test/ui/closures/multiple-fn-bounds.rs15
-rw-r--r--src/test/ui/closures/multiple-fn-bounds.stderr24
-rw-r--r--src/test/ui/closures/old-closure-expression-remove-semicolon.fixed2
-rw-r--r--src/test/ui/closures/old-closure-expression-remove-semicolon.rs2
-rw-r--r--src/test/ui/closures/old-closure-expression-remove-semicolon.stderr2
-rw-r--r--src/test/ui/closures/print/closure-print-generic-verbose-1.stderr2
-rw-r--r--src/test/ui/codegen/issue-101585-128bit-repeat.rs14
-rw-r--r--src/test/ui/codegen/issue-99551.rs21
-rw-r--r--src/test/ui/codemap_tests/unicode.normal.stderr2
-rw-r--r--src/test/ui/coercion/coerce-reborrow-multi-arg-fail.stderr2
-rw-r--r--src/test/ui/coercion/coerce-to-bang.stderr10
-rw-r--r--src/test/ui/coercion/coercion-missing-tail-expected-type.stderr4
-rw-r--r--src/test/ui/coercion/issue-101066.rs16
-rw-r--r--src/test/ui/coercion/issue-36007.rs20
-rw-r--r--src/test/ui/coherence/auxiliary/trait-with-const-param.rs1
-rw-r--r--src/test/ui/coherence/coherence-default-trait-impl.stderr12
-rw-r--r--src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr4
-rw-r--r--src/test/ui/coherence/coherence-fn-implied-bounds.stderr6
-rw-r--r--src/test/ui/coherence/coherence-free-vs-bound-region.stderr6
-rw-r--r--src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr2
-rw-r--r--src/test/ui/coherence/coherence-negative-impls-copy-bad.rs11
-rw-r--r--src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr36
-rw-r--r--src/test/ui/coherence/coherence-negative-impls-copy.rs29
-rw-r--r--src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs13
-rw-r--r--src/test/ui/coherence/coherence-negative-outlives-lifetimes.stock.stderr (renamed from src/test/ui/coherence/coherence-negative-outlives-lifetimes.stderr)2
-rw-r--r--src/test/ui/coherence/coherence-subtyping.stderr2
-rw-r--r--src/test/ui/coherence/coherence-wasm-bindgen.stderr8
-rw-r--r--src/test/ui/coherence/const-generics-orphan-check-ok.rs28
-rw-r--r--src/test/ui/coherence/deep-bad-copy-reason.stderr4
-rw-r--r--src/test/ui/coherence/issue-100191-2.rs12
-rw-r--r--src/test/ui/coherence/issue-100191-2.stderr14
-rw-r--r--src/test/ui/coherence/issue-100191.rs21
-rw-r--r--src/test/ui/coherence/issue-100191.stderr12
-rw-r--r--src/test/ui/command/command-current-dir.rs3
-rw-r--r--src/test/ui/command/command-exec.rs1
-rw-r--r--src/test/ui/command/command-pre-exec.rs1
-rw-r--r--src/test/ui/command/command-uid-gid.rs1
-rw-r--r--src/test/ui/compare-method/issue-90444.stderr6
-rw-r--r--src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr4
-rw-r--r--src/test/ui/conflicting-repr-hints.stderr2
-rw-r--r--src/test/ui/const-generics/argument_order.stderr4
-rw-r--r--src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr5
-rw-r--r--src/test/ui/const-generics/const-param-before-other-params.rs2
-rw-r--r--src/test/ui/const-generics/const-param-before-other-params.stderr2
-rw-r--r--src/test/ui/const-generics/const_trait_fn-issue-88433.rs1
-rw-r--r--src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr4
-rw-r--r--src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr4
-rw-r--r--src/test/ui/const-generics/defaults/intermixed-lifetime.rs4
-rw-r--r--src/test/ui/const-generics/defaults/intermixed-lifetime.stderr4
-rw-r--r--src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs2
-rw-r--r--src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr2
-rw-r--r--src/test/ui/const-generics/defaults/trait_objects_fail.stderr8
-rw-r--r--src/test/ui/const-generics/early/const-param-from-outer-fn.stderr2
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr96
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/closures.stderr4
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr10
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr8
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs1
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/different-fn.stderr4
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr2
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/function-call.rs1
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/function-call.stderr4
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-100217.rs42
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-100360.rs13
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-102074.rs23
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-102768.rs14
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr33
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr4
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr4
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr22
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-73298.rs23
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-82268.rs73
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr8
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-83972.rs38
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-84669.rs30
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr12
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-86710.rs73
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-89851.rs12
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr2
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr2
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr10
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs24
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr20
-rw-r--r--src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr13
-rw-r--r--src/test/ui/const-generics/invariant.stderr2
-rw-r--r--src/test/ui/const-generics/issue-102124.rs20
-rw-r--r--src/test/ui/const-generics/issue-80471.stderr2
-rw-r--r--src/test/ui/const-generics/issue-93647.rs2
-rw-r--r--src/test/ui/const-generics/issues/issue-100313.rs21
-rw-r--r--src/test/ui/const-generics/issues/issue-100313.stderr15
-rw-r--r--src/test/ui/const-generics/issues/issue-73260.stderr24
-rw-r--r--src/test/ui/const-generics/issues/issue-79674.stderr12
-rw-r--r--src/test/ui/const-generics/issues/issue-83466.rs2
-rw-r--r--src/test/ui/const-generics/issues/issue-83466.stderr2
-rw-r--r--src/test/ui/const-generics/issues/issue-83765.stderr8
-rw-r--r--src/test/ui/const-generics/issues/issue-87493.stderr8
-rw-r--r--src/test/ui/const-generics/issues/issue-88119.rs1
-rw-r--r--src/test/ui/const-generics/issues/issue-98629.rs1
-rw-r--r--src/test/ui/const-generics/issues/issue-98629.stderr2
-rw-r--r--src/test/ui/const-generics/min_const_generics/complex-expression.rs1
-rw-r--r--src/test/ui/const-generics/min_const_generics/complex-expression.stderr18
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs1
-rw-r--r--src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr8
-rw-r--r--src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr26
-rw-r--r--src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr26
-rw-r--r--src/test/ui/const-generics/min_const_generics/invalid-patterns.rs6
-rw-r--r--src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr2
-rw-r--r--src/test/ui/const-generics/occurs-check/unused-substs-2.rs2
-rw-r--r--src/test/ui/const-generics/occurs-check/unused-substs-3.rs2
-rw-r--r--src/test/ui/const-generics/types-mismatch-const-args.full.stderr4
-rw-r--r--src/test/ui/const-ptr/forbidden_slices.32bit.stderr16
-rw-r--r--src/test/ui/const-ptr/forbidden_slices.64bit.stderr16
-rw-r--r--src/test/ui/const_prop/issue-102553.rs24
-rw-r--r--src/test/ui/consts/array-literal-index-oob.rs2
-rw-r--r--src/test/ui/consts/array-literal-index-oob.stderr6
-rw-r--r--src/test/ui/consts/assert-type-intrinsics.rs11
-rw-r--r--src/test/ui/consts/assert-type-intrinsics.stderr70
-rw-r--r--src/test/ui/consts/assoc_const_generic_impl.rs7
-rw-r--r--src/test/ui/consts/assoc_const_generic_impl.stderr40
-rw-r--r--src/test/ui/consts/cast-discriminant-zst-enum.rs1
-rw-r--r--src/test/ui/consts/const-block-const-bound.stderr4
-rw-r--r--src/test/ui/consts/const-blocks/fn-call-in-non-const.stderr2
-rw-r--r--src/test/ui/consts/const-blocks/migrate-fail.stderr4
-rw-r--r--src/test/ui/consts/const-blocks/nll-fail.stderr4
-rw-r--r--src/test/ui/consts/const-blocks/trait-error.stderr2
-rw-r--r--src/test/ui/consts/const-err-early.rs17
-rw-r--r--src/test/ui/consts/const-err-early.stderr126
-rw-r--r--src/test/ui/consts/const-err-late.rs22
-rw-r--r--src/test/ui/consts/const-err-late.stderr27
-rw-r--r--src/test/ui/consts/const-err-multi.rs14
-rw-r--r--src/test/ui/consts/const-err-multi.stderr102
-rw-r--r--src/test/ui/consts/const-err-rpass.rs2
-rw-r--r--src/test/ui/consts/const-err.rs19
-rw-r--r--src/test/ui/consts/const-err.stderr44
-rw-r--r--src/test/ui/consts/const-err4.32bit.stderr11
-rw-r--r--src/test/ui/consts/const-err4.64bit.stderr11
-rw-r--r--src/test/ui/consts/const-err4.rs3
-rw-r--r--src/test/ui/consts/const-eval/conditional_array_execution.rs10
-rw-r--r--src/test/ui/consts/const-eval/conditional_array_execution.stderr63
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-2.rs4
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-2.stderr24
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr4
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr4
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2.rs26
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2.stderr226
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2b.rs26
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2b.stderr226
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2c.rs26
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow2c.stderr226
-rw-r--r--src/test/ui/consts/const-eval/const-eval-query-stack.rs10
-rw-r--r--src/test/ui/consts/const-eval/const-eval-query-stack.stderr64
-rw-r--r--src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr588
-rw-r--r--src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs87
-rw-r--r--src/test/ui/consts/const-eval/const_fn_ptr_fail2.rs7
-rw-r--r--src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr92
-rw-r--r--src/test/ui/consts/const-eval/const_let.rs8
-rw-r--r--src/test/ui/consts/const-eval/const_let.stderr16
-rw-r--r--src/test/ui/consts/const-eval/const_panic_stability.e2018.stderr2
-rw-r--r--src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr20
-rw-r--r--src/test/ui/consts/const-eval/erroneous-const.rs6
-rw-r--r--src/test/ui/consts/const-eval/erroneous-const.stderr45
-rw-r--r--src/test/ui/consts/const-eval/erroneous-const2.rs6
-rw-r--r--src/test/ui/consts/const-eval/erroneous-const2.stderr41
-rw-r--r--src/test/ui/consts/const-eval/format.rs4
-rw-r--r--src/test/ui/consts/const-eval/format.stderr78
-rw-r--r--src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr2
-rw-r--r--src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr2
-rw-r--r--src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs6
-rw-r--r--src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr38
-rw-r--r--src/test/ui/consts/const-eval/infinite_loop.rs2
-rw-r--r--src/test/ui/consts/const-eval/infinite_loop.stderr6
-rw-r--r--src/test/ui/consts/const-eval/issue-100878.rs8
-rw-r--r--src/test/ui/consts/const-eval/issue-43197.rs16
-rw-r--r--src/test/ui/consts/const-eval/issue-43197.stderr119
-rw-r--r--src/test/ui/consts/const-eval/issue-44578.rs5
-rw-r--r--src/test/ui/consts/const-eval/issue-44578.stderr43
-rw-r--r--src/test/ui/consts/const-eval/issue-50814-2.rs3
-rw-r--r--src/test/ui/consts/const-eval/issue-50814-2.stderr23
-rw-r--r--src/test/ui/consts/const-eval/issue-50814.rs3
-rw-r--r--src/test/ui/consts/const-eval/issue-50814.stderr23
-rw-r--r--src/test/ui/consts/const-eval/issue-65394.rs2
-rw-r--r--src/test/ui/consts/const-eval/issue-65394.stderr4
-rw-r--r--src/test/ui/consts/const-eval/issue-91827-extern-types.rs1
-rw-r--r--src/test/ui/consts/const-eval/livedrop.rs2
-rw-r--r--src/test/ui/consts/const-eval/livedrop.stderr4
-rw-r--r--src/test/ui/consts/const-eval/panic-assoc-never-type.rs1
-rw-r--r--src/test/ui/consts/const-eval/panic-assoc-never-type.stderr6
-rw-r--r--src/test/ui/consts/const-eval/panic-never-type.rs1
-rw-r--r--src/test/ui/consts/const-eval/panic-never-type.stderr4
-rw-r--r--src/test/ui/consts/const-eval/partial_ptr_overwrite.rs3
-rw-r--r--src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr25
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail.rs2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs2
-rw-r--r--src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr2
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.noopt.stderr93
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.opt.stderr95
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr93
-rw-r--r--src/test/ui/consts/const-eval/promoted_errors.rs25
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err.rs10
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err.stderr31
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err_bin.rs10
-rw-r--r--src/test/ui/consts/const-eval/pub_const_err_bin.stderr31
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr21
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr21
-rw-r--r--src/test/ui/consts/const-eval/ref_to_int_match.rs3
-rw-r--r--src/test/ui/consts/const-eval/ub-enum-overwrite.rs3
-rw-r--r--src/test/ui/consts/const-eval/ub-enum-overwrite.stderr13
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.32bit.stderr119
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.64bit.stderr119
-rw-r--r--src/test/ui/consts/const-eval/ub-enum.rs21
-rw-r--r--src/test/ui/consts/const-eval/ub-int-array.32bit.stderr39
-rw-r--r--src/test/ui/consts/const-eval/ub-int-array.64bit.stderr39
-rw-r--r--src/test/ui/consts/const-eval/ub-int-array.rs13
-rw-r--r--src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr17
-rw-r--r--src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr17
-rw-r--r--src/test/ui/consts/const-eval/ub-nonnull.rs6
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr132
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr132
-rw-r--r--src/test/ui/consts/const-eval/ub-ref-ptr.rs21
-rw-r--r--src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr6
-rw-r--r--src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr6
-rw-r--r--src/test/ui/consts/const-eval/ub-uninhabit.rs1
-rw-r--r--src/test/ui/consts/const-eval/ub-upvars.rs2
-rw-r--r--src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr223
-rw-r--r--src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr223
-rw-r--r--src/test/ui/consts/const-eval/ub-wide-ptr.rs36
-rw-r--r--src/test/ui/consts/const-eval/union-const-eval-field.rs3
-rw-r--r--src/test/ui/consts/const-eval/union-const-eval-field.stderr13
-rw-r--r--src/test/ui/consts/const-eval/union-ice.rs12
-rw-r--r--src/test/ui/consts/const-eval/union-ice.stderr39
-rw-r--r--src/test/ui/consts/const-eval/union-ub.32bit.stderr13
-rw-r--r--src/test/ui/consts/const-eval/union-ub.64bit.stderr13
-rw-r--r--src/test/ui/consts/const-eval/union-ub.rs4
-rw-r--r--src/test/ui/consts/const-eval/union_promotion.rs2
-rw-r--r--src/test/ui/consts/const-eval/union_promotion.stderr2
-rw-r--r--src/test/ui/consts/const-eval/unused-broken-const.rs3
-rw-r--r--src/test/ui/consts/const-eval/unused-broken-const.stderr20
-rw-r--r--src/test/ui/consts/const-eval/valid-const.rs1
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr16
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr16
-rw-r--r--src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs2
-rw-r--r--src/test/ui/consts/const-external-macro-const-err.rs3
-rw-r--r--src/test/ui/consts/const-external-macro-const-err.stderr18
-rw-r--r--src/test/ui/consts/const-float-bits-reject-conv.rs24
-rw-r--r--src/test/ui/consts/const-float-bits-reject-conv.stderr239
-rw-r--r--src/test/ui/consts/const-fn-error.rs6
-rw-r--r--src/test/ui/consts/const-fn-error.stderr4
-rw-r--r--src/test/ui/consts/const-for.rs4
-rw-r--r--src/test/ui/consts/const-for.stderr4
-rw-r--r--src/test/ui/consts/const-int-arithmetic-overflow.rs1
-rw-r--r--src/test/ui/consts/const-len-underflow-separate-spans.rs3
-rw-r--r--src/test/ui/consts/const-len-underflow-separate-spans.stderr21
-rw-r--r--src/test/ui/consts/const-negation.rs2
-rw-r--r--src/test/ui/consts/const-points-to-static.32bit.stderr2
-rw-r--r--src/test/ui/consts/const-points-to-static.64bit.stderr2
-rw-r--r--src/test/ui/consts/const-prop-read-static-in-const.rs3
-rw-r--r--src/test/ui/consts/const-prop-read-static-in-const.stderr20
-rw-r--r--src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs6
-rw-r--r--src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr40
-rw-r--r--src/test/ui/consts/const-slice-oob.rs5
-rw-r--r--src/test/ui/consts/const-slice-oob.stderr22
-rw-r--r--src/test/ui/consts/const_discriminant.rs1
-rw-r--r--src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr2
-rw-r--r--src/test/ui/consts/const_in_pattern/incomplete-slice.rs15
-rw-r--r--src/test/ui/consts/const_in_pattern/incomplete-slice.stderr26
-rw-r--r--src/test/ui/consts/const_in_pattern/issue-44333.stderr4
-rw-r--r--src/test/ui/consts/const_in_pattern/reject_non_structural.stderr4
-rw-r--r--src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr2
-rw-r--r--src/test/ui/consts/const_limit/const_eval_limit_reached.rs3
-rw-r--r--src/test/ui/consts/const_limit/const_eval_limit_reached.stderr24
-rw-r--r--src/test/ui/consts/const_unsafe_unreachable_ub.stderr10
-rw-r--r--src/test/ui/consts/constifconst-call-in-const-position.rs22
-rw-r--r--src/test/ui/consts/constifconst-call-in-const-position.stderr18
-rw-r--r--src/test/ui/consts/control-flow/drop-fail.precise.stderr8
-rw-r--r--src/test/ui/consts/control-flow/drop-fail.rs8
-rw-r--r--src/test/ui/consts/control-flow/drop-fail.stock.stderr16
-rw-r--r--src/test/ui/consts/control-flow/issue-50577.stderr2
-rw-r--r--src/test/ui/consts/dangling-alloc-id-ice.rs1
-rw-r--r--src/test/ui/consts/dangling-alloc-id-ice.stderr2
-rw-r--r--src/test/ui/consts/drop_box.rs2
-rw-r--r--src/test/ui/consts/drop_box.stderr4
-rw-r--r--src/test/ui/consts/drop_zst.stderr4
-rw-r--r--src/test/ui/consts/extra-const-ub/detect-extra-ub.rs42
-rw-r--r--src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr58
-rw-r--r--src/test/ui/consts/extra-const-ub/issue-100771.rs20
-rw-r--r--src/test/ui/consts/extra-const-ub/issue-101034.rs17
-rw-r--r--src/test/ui/consts/invalid-union.32bit.stderr17
-rw-r--r--src/test/ui/consts/invalid-union.64bit.stderr17
-rw-r--r--src/test/ui/consts/invalid-union.rs1
-rw-r--r--src/test/ui/consts/issue-102117.rs30
-rw-r--r--src/test/ui/consts/issue-102117.stderr37
-rw-r--r--src/test/ui/consts/issue-104155.rs5
-rw-r--r--src/test/ui/consts/issue-17718-constants-not-static.rs (renamed from src/test/ui/issues/issue-17718-constants-not-static.rs)0
-rw-r--r--src/test/ui/consts/issue-17718-constants-not-static.stderr (renamed from src/test/ui/issues/issue-17718-constants-not-static.stderr)0
-rw-r--r--src/test/ui/consts/issue-25826.stderr4
-rw-r--r--src/test/ui/consts/issue-32829-2.stderr2
-rw-r--r--src/test/ui/consts/issue-36163.stderr2
-rw-r--r--src/test/ui/consts/issue-46553.rs1
-rw-r--r--src/test/ui/consts/issue-56164.rs5
-rw-r--r--src/test/ui/consts/issue-56164.stderr22
-rw-r--r--src/test/ui/consts/issue-66693.rs3
-rw-r--r--src/test/ui/consts/issue-66693.stderr18
-rw-r--r--src/test/ui/consts/issue-78655.stderr5
-rw-r--r--src/test/ui/consts/issue-88071.rs2
-rw-r--r--src/test/ui/consts/issue-94675.rs5
-rw-r--r--src/test/ui/consts/issue-94675.stderr31
-rw-r--r--src/test/ui/consts/issue-miri-1910.rs1
-rw-r--r--src/test/ui/consts/issue-miri-1910.stderr44
-rw-r--r--src/test/ui/consts/min_const_fn/min_const_fn.rs6
-rw-r--r--src/test/ui/consts/min_const_fn/min_const_fn.stderr20
-rw-r--r--src/test/ui/consts/mir_check_nonconst.stderr1
-rw-r--r--src/test/ui/consts/miri_unleashed/abi-mismatch.rs1
-rw-r--r--src/test/ui/consts/miri_unleashed/abi-mismatch.stderr8
-rw-r--r--src/test/ui/consts/miri_unleashed/assoc_const.rs2
-rw-r--r--src/test/ui/consts/miri_unleashed/assoc_const.stderr46
-rw-r--r--src/test/ui/consts/miri_unleashed/assoc_const_2.rs4
-rw-r--r--src/test/ui/consts/miri_unleashed/assoc_const_2.stderr25
-rw-r--r--src/test/ui/consts/miri_unleashed/box.rs1
-rw-r--r--src/test/ui/consts/miri_unleashed/box.stderr10
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr81
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr81
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static.rs34
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr100
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr38
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr38
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs24
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr108
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr108
-rw-r--r--src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs14
-rw-r--r--src/test/ui/consts/miri_unleashed/drop.rs1
-rw-r--r--src/test/ui/consts/miri_unleashed/drop.stderr6
-rw-r--r--src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.rs4
-rw-r--r--src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.stderr6
-rw-r--r--src/test/ui/consts/miri_unleashed/inline_asm.rs1
-rw-r--r--src/test/ui/consts/miri_unleashed/inline_asm.stderr4
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_references.rs1
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_references.stderr12
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr12
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr12
-rw-r--r--src/test/ui/consts/miri_unleashed/mutable_references_err.rs2
-rw-r--r--src/test/ui/consts/miri_unleashed/mutating_global.rs1
-rw-r--r--src/test/ui/consts/miri_unleashed/mutating_global.stderr2
-rw-r--r--src/test/ui/consts/miri_unleashed/non_const_fn.rs2
-rw-r--r--src/test/ui/consts/miri_unleashed/non_const_fn.stderr4
-rw-r--r--src/test/ui/consts/miri_unleashed/ptr_arith.rs6
-rw-r--r--src/test/ui/consts/miri_unleashed/ptr_arith.stderr8
-rw-r--r--src/test/ui/consts/miri_unleashed/raw_mutable_const.rs2
-rw-r--r--src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr4
-rw-r--r--src/test/ui/consts/miri_unleashed/slice_eq.rs12
-rw-r--r--src/test/ui/consts/miri_unleashed/tls.rs1
-rw-r--r--src/test/ui/consts/miri_unleashed/tls.stderr8
-rw-r--r--src/test/ui/consts/offset.rs1
-rw-r--r--src/test/ui/consts/offset_from.rs1
-rw-r--r--src/test/ui/consts/offset_from_ub.rs2
-rw-r--r--src/test/ui/consts/promote-not.rs2
-rw-r--r--src/test/ui/consts/ptr_comparisons.rs30
-rw-r--r--src/test/ui/consts/ptr_comparisons.stderr49
-rw-r--r--src/test/ui/consts/qualif-indirect-mutation-fail.rs18
-rw-r--r--src/test/ui/consts/qualif-indirect-mutation-fail.stderr36
-rw-r--r--src/test/ui/consts/raw-ptr-const.rs2
-rw-r--r--src/test/ui/consts/raw-ptr-const.stderr2
-rw-r--r--src/test/ui/consts/recursive.rs3
-rw-r--r--src/test/ui/consts/recursive.stderr31
-rw-r--r--src/test/ui/consts/refs_check_const_eq-issue-88384.stderr2
-rw-r--r--src/test/ui/consts/stable-precise-live-drops-in-libcore.rs2
-rw-r--r--src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr4
-rw-r--r--src/test/ui/consts/trait_specialization.stderr2
-rw-r--r--src/test/ui/consts/uninhabited-const-issue-61744.rs3
-rw-r--r--src/test/ui/consts/uninhabited-const-issue-61744.stderr285
-rw-r--r--src/test/ui/consts/unnormalized-param-env.rs31
-rw-r--r--src/test/ui/consts/unstable-const-fn-in-libcore.rs10
-rw-r--r--src/test/ui/consts/unstable-const-fn-in-libcore.stderr33
-rw-r--r--src/test/ui/consts/write_to_static_via_mut_ref.rs1
-rw-r--r--src/test/ui/consts/write_to_static_via_mut_ref.stderr4
-rw-r--r--src/test/ui/cycle-trait/cycle-trait-default-type-trait.rs1
-rw-r--r--src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr21
-rw-r--r--src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs3
-rw-r--r--src/test/ui/deprecation/deprecation-lint.rs2
-rw-r--r--src/test/ui/deprecation/deprecation-sanity.stderr4
-rw-r--r--src/test/ui/derive-uninhabited-enum-38885.stderr2
-rw-r--r--src/test/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr2
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs1
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr22
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-enum.rs3
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-enum.stderr22
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-struct.rs1
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-struct.stderr22
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs1
-rw-r--r--src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr22
-rw-r--r--src/test/ui/derives/deriving-copyclone.stderr12
-rw-r--r--src/test/ui/derives/deriving-no-inner-impl-error-message.rs1
-rw-r--r--src/test/ui/derives/deriving-no-inner-impl-error-message.stderr24
-rw-r--r--src/test/ui/derives/deriving-with-repr-packed.stderr20
-rw-r--r--src/test/ui/deriving/deriving-all-codegen.rs2
-rw-r--r--src/test/ui/deriving/deriving-all-codegen.stdout137
-rw-r--r--src/test/ui/deriving/deriving-default-enum.rs10
-rw-r--r--src/test/ui/deriving/deriving-hash.rs20
-rw-r--r--src/test/ui/deriving/issue-103157.rs12
-rw-r--r--src/test/ui/deriving/issue-103157.stderr30
-rw-r--r--src/test/ui/deriving/issue-89188-gat-hrtb.rs2
-rw-r--r--src/test/ui/destructuring-assignment/warn-unused-duplication.stderr2
-rw-r--r--src/test/ui/did_you_mean/bad-assoc-ty.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr6
-rw-r--r--src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr6
-rw-r--r--src/test/ui/did_you_mean/issue-31424.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed5
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs5
-rw-r--r--src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr34
-rw-r--r--src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr16
-rw-r--r--src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr10
-rw-r--r--src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr4
-rw-r--r--src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr16
-rw-r--r--src/test/ui/did_you_mean/issue-54109-without-witness.stderr16
-rw-r--r--src/test/ui/did_you_mean/use_instead_of_import.fixed8
-rw-r--r--src/test/ui/did_you_mean/use_instead_of_import.rs8
-rw-r--r--src/test/ui/did_you_mean/use_instead_of_import.stderr16
-rw-r--r--src/test/ui/drop/drop-foreign-fundamental.rs23
-rw-r--r--src/test/ui/drop/drop-foreign-fundamental.stderr9
-rw-r--r--src/test/ui/drop/drop_order.rs209
-rw-r--r--src/test/ui/drop/dropck_legal_cycles.rs14
-rw-r--r--src/test/ui/drop/dynamic-drop-async.rs1
-rw-r--r--src/test/ui/drop/dynamic-drop.rs1
-rw-r--r--src/test/ui/drop/issue-100276.rs12
-rw-r--r--src/test/ui/drop/issue-17718-const-destructors.rs (renamed from src/test/ui/issues/issue-17718-const-destructors.rs)0
-rw-r--r--src/test/ui/drop/issue-23338-ensure-param-drop-order.rs (renamed from src/test/ui/issues/issue-23338-ensure-param-drop-order.rs)0
-rw-r--r--src/test/ui/drop/issue-48962.rs (renamed from src/test/ui/issues/issue-48962.rs)0
-rw-r--r--src/test/ui/drop/repeat-drop-2.rs2
-rw-r--r--src/test/ui/drop/repeat-drop-2.stderr9
-rw-r--r--src/test/ui/drop/repeat-drop.rs3
-rw-r--r--src/test/ui/dropck/drop-on-non-struct.rs7
-rw-r--r--src/test/ui/dropck/drop-on-non-struct.stderr4
-rw-r--r--src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr12
-rw-r--r--src/test/ui/dropck/issue-24805-dropck-itemless.rs (renamed from src/test/ui/issues/issue-24805-dropck-itemless.rs)0
-rw-r--r--src/test/ui/dst/dst-bad-coercions.stderr8
-rw-r--r--src/test/ui/dst/dst-rvalue.rs6
-rw-r--r--src/test/ui/dst/dst-rvalue.stderr28
-rw-r--r--src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr4
-rw-r--r--src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr39
-rw-r--r--src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr10
-rw-r--r--src/test/ui/dyn-keyword/dyn-angle-brackets.stderr9
-rw-r--r--src/test/ui/dyn-star/auxiliary/dyn-star-foreign.rs10
-rw-r--r--src/test/ui/dyn-star/box.rs17
-rw-r--r--src/test/ui/dyn-star/const.rs14
-rw-r--r--src/test/ui/dyn-star/drop.rs23
-rw-r--r--src/test/ui/dyn-star/drop.run.stdout1
-rw-r--r--src/test/ui/dyn-star/error.rs13
-rw-r--r--src/test/ui/dyn-star/error.stderr9
-rw-r--r--src/test/ui/dyn-star/feature-gate-dyn_star.rs9
-rw-r--r--src/test/ui/dyn-star/feature-gate-dyn_star.stderr12
-rw-r--r--src/test/ui/dyn-star/make-dyn-star.rs18
-rw-r--r--src/test/ui/dyn-star/method.rs27
-rw-r--r--src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs13
-rw-r--r--src/test/ui/dyn-star/no-explicit-dyn-star-cast.stderr28
-rw-r--r--src/test/ui/dyn-star/no-explicit-dyn-star.rs8
-rw-r--r--src/test/ui/dyn-star/no-explicit-dyn-star.stderr9
-rw-r--r--src/test/ui/dyn-star/no-implicit-dyn-star.rs8
-rw-r--r--src/test/ui/dyn-star/no-implicit-dyn-star.stderr19
-rw-r--r--src/test/ui/dyn-star/syntax.rs11
-rw-r--r--src/test/ui/dyn-star/upcast.rs33
-rw-r--r--src/test/ui/dynamically-sized-types/dst-struct.rs3
-rw-r--r--src/test/ui/dynamically-sized-types/dst-trait.rs1
-rw-r--r--src/test/ui/editions/edition-raw-pointer-method-2015.stderr4
-rw-r--r--src/test/ui/empty/empty-attributes.stderr2
-rw-r--r--src/test/ui/empty/empty-never-array.rs2
-rw-r--r--src/test/ui/empty/empty-never-array.stderr6
-rw-r--r--src/test/ui/empty/empty-struct-braces-expr.stderr46
-rw-r--r--src/test/ui/empty_global_asm.rs15
-rw-r--r--src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs1
-rw-r--r--src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr2
-rw-r--r--src/test/ui/enum-discriminant/arbitrary_enum_discriminant.rs2
-rw-r--r--src/test/ui/enum-discriminant/discriminant_size.stderr2
-rw-r--r--src/test/ui/enum-discriminant/discriminant_value.rs2
-rw-r--r--src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.rs10
-rw-r--r--src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.stderr36
-rw-r--r--src/test/ui/enum-discriminant/issue-43398.stderr2
-rw-r--r--src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.rs2
-rw-r--r--src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.rs2
-rw-r--r--src/test/ui/enum-discriminant/issue-70509-partial_eq.rs2
-rw-r--r--src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr4
-rw-r--r--src/test/ui/enum-discriminant/repr128.stderr2
-rw-r--r--src/test/ui/enum/enum-discrim-autosizing.rs4
-rw-r--r--src/test/ui/enum/enum-discrim-autosizing.stderr4
-rw-r--r--src/test/ui/enum/enum-discrim-too-small2.stderr4
-rw-r--r--src/test/ui/env-funky-keys.rs1
-rw-r--r--src/test/ui/error-codes/E0004.stderr6
-rw-r--r--src/test/ui/error-codes/E0005.stderr2
-rw-r--r--src/test/ui/error-codes/E0017.stderr2
-rw-r--r--src/test/ui/error-codes/E0057.stderr4
-rw-r--r--src/test/ui/error-codes/E0060.stderr2
-rw-r--r--src/test/ui/error-codes/E0061.stderr4
-rw-r--r--src/test/ui/error-codes/E0081.rs37
-rw-r--r--src/test/ui/error-codes/E0081.stderr52
-rw-r--r--src/test/ui/error-codes/E0094.rs2
-rw-r--r--src/test/ui/error-codes/E0094.stderr2
-rw-r--r--src/test/ui/error-codes/E0107.stderr2
-rw-r--r--src/test/ui/error-codes/E0117.rs2
-rw-r--r--src/test/ui/error-codes/E0117.stderr4
-rw-r--r--src/test/ui/error-codes/E0120.stderr4
-rw-r--r--src/test/ui/error-codes/E0199.stderr6
-rw-r--r--src/test/ui/error-codes/E0200.stderr6
-rw-r--r--src/test/ui/error-codes/E0201.rs2
-rw-r--r--src/test/ui/error-codes/E0201.stderr33
-rw-r--r--src/test/ui/error-codes/E0271.stderr6
-rw-r--r--src/test/ui/error-codes/E0275.stderr4
-rw-r--r--src/test/ui/error-codes/E0277-2.stderr4
-rw-r--r--src/test/ui/error-codes/E0283.stderr4
-rw-r--r--src/test/ui/error-codes/E0308.rs2
-rw-r--r--src/test/ui/error-codes/E0308.stderr2
-rw-r--r--src/test/ui/error-codes/E0311.rs9
-rw-r--r--src/test/ui/error-codes/E0311.stderr24
-rw-r--r--src/test/ui/error-codes/E0388.stderr2
-rw-r--r--src/test/ui/error-codes/E0401.stderr8
-rw-r--r--src/test/ui/error-codes/E0423.stderr22
-rw-r--r--src/test/ui/error-codes/E0520.stderr2
-rw-r--r--src/test/ui/error-codes/E0565-2.stderr4
-rw-r--r--src/test/ui/error-codes/E0585.stderr2
-rw-r--r--src/test/ui/error-codes/E0771.stderr2
-rw-r--r--src/test/ui/error-codes/E0790.stderr20
-rw-r--r--src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr2
-rw-r--r--src/test/ui/explain.stdout4
-rw-r--r--src/test/ui/explore-issue-38412.stderr6
-rw-r--r--src/test/ui/expr/if/bad-if-let-suggestion.stderr5
-rw-r--r--src/test/ui/expr/if/if-branch-types.stderr5
-rw-r--r--src/test/ui/expr/if/if-else-type-mismatch.stderr10
-rw-r--r--src/test/ui/expr/if/if-let.stderr2
-rw-r--r--src/test/ui/expr/if/if-without-else-result.rs2
-rw-r--r--src/test/ui/expr/if/if-without-else-result.stderr2
-rw-r--r--src/test/ui/expr/if/issue-4201.rs2
-rw-r--r--src/test/ui/expr/if/issue-4201.stderr2
-rw-r--r--src/test/ui/expr/malformed_closure/ruby_style_closure.stderr2
-rw-r--r--src/test/ui/extenv/issue-55897.rs2
-rw-r--r--src/test/ui/extenv/issue-55897.stderr7
-rw-r--r--src/test/ui/extern-flag/empty-extern-arg.rs2
-rw-r--r--src/test/ui/extern/extern-no-mangle.stderr2
-rw-r--r--src/test/ui/extern/extern-types-unsized.stderr12
-rw-r--r--src/test/ui/extern/extern-with-type-bounds.rs2
-rw-r--r--src/test/ui/extern/extern-with-type-bounds.stderr2
-rw-r--r--src/test/ui/extern/extern-wrong-value-type.stderr2
-rw-r--r--src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs1
-rw-r--r--src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs1
-rw-r--r--src/test/ui/feature-gates/bench.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm_sym.rs19
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm_sym.stderr21
-rw-r--r--src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs7
-rw-r--r--src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr30
-rw-r--r--src/test/ui/feature-gates/feature-gate-generic_associated_types.rs31
-rw-r--r--src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr78
-rw-r--r--src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs2
-rw-r--r--src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-label_break_value.rs5
-rw-r--r--src/test/ui/feature-gates/feature-gate-label_break_value.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-let_else.rs5
-rw-r--r--src/test/ui/feature-gates/feature-gate-let_else.stderr14
-rw-r--r--src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs2
-rw-r--r--src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr8
-rw-r--r--src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr8
-rw-r--r--src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs6
-rw-r--r--src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr15
-rw-r--r--src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs8
-rw-r--r--src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr21
-rw-r--r--src/test/ui/feature-gates/feature-gate-raw-dylib.rs3
-rw-r--r--src/test/ui/feature-gates/feature-gate-raw-dylib.stderr4
-rw-r--r--src/test/ui/feature-gates/feature-gate-register_attr.rs3
-rw-r--r--src/test/ui/feature-gates/feature-gate-register_attr.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-repr-simd.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs18
-rw-r--r--src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr30
-rw-r--r--src/test/ui/feature-gates/feature-gate-strict_provenance.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs4
-rw-r--r--src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr12
-rw-r--r--src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr2
-rw-r--r--src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs30
-rw-r--r--src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr21
-rw-r--r--src/test/ui/feature-gates/soft-syntax-gates-without-errors.rs26
-rw-r--r--src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr24
-rw-r--r--src/test/ui/fmt/auxiliary/format-string-proc-macro.rs28
-rw-r--r--src/test/ui/fmt/format-args-capture-issue-102057.rs19
-rw-r--r--src/test/ui/fmt/format-args-capture-issue-102057.stderr45
-rw-r--r--src/test/ui/fmt/format-args-capture-issue-93378.rs4
-rw-r--r--src/test/ui/fmt/format-args-capture-issue-93378.stderr17
-rw-r--r--src/test/ui/fmt/format-args-capture-macro-hygiene.rs18
-rw-r--r--src/test/ui/fmt/format-args-capture-macro-hygiene.stderr37
-rw-r--r--src/test/ui/fmt/format-concat-span.stderr11
-rw-r--r--src/test/ui/fmt/format-expanded-string.rs (renamed from src/test/ui/fmt/format-concat-span.rs)9
-rw-r--r--src/test/ui/fmt/format-expanded-string.stderr19
-rw-r--r--src/test/ui/fmt/ifmt-bad-arg.rs8
-rw-r--r--src/test/ui/fmt/ifmt-bad-arg.stderr101
-rw-r--r--src/test/ui/fmt/ifmt-unimpl.stderr2
-rw-r--r--src/test/ui/fmt/send-sync.stderr14
-rw-r--r--src/test/ui/fn/fn-compare-mismatch.stderr10
-rw-r--r--src/test/ui/fn/fn-item-type.stderr10
-rw-r--r--src/test/ui/fn/fn-trait-formatting.stderr8
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs3
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr17
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-3.rs5
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-3.stderr14
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-4.rs24
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-4.stderr14
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-5.rs23
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type-5.stderr19
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type.rs6
-rw-r--r--src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr20
-rw-r--r--src/test/ui/for-loop-while/break-while-condition.stderr8
-rw-r--r--src/test/ui/for-loop-while/label_break_value.rs1
-rw-r--r--src/test/ui/for-loop-while/label_break_value_invalid.rs1
-rw-r--r--src/test/ui/for-loop-while/label_break_value_invalid.stderr6
-rw-r--r--src/test/ui/for-loop-while/while-let-2.stderr2
-rw-r--r--src/test/ui/for/for-c-in-str.rs2
-rw-r--r--src/test/ui/for/for-c-in-str.stderr2
-rw-r--r--src/test/ui/for/for-loop-bogosity.stderr2
-rw-r--r--src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr12
-rw-r--r--src/test/ui/function-pointer/issue-102289.rs54
-rw-r--r--src/test/ui/function-pointer/sized-ret-with-binder.rs15
-rw-r--r--src/test/ui/function-pointer/unsized-ret.rs14
-rw-r--r--src/test/ui/function-pointer/unsized-ret.stderr35
-rw-r--r--src/test/ui/functions-closures/fn-help-with-err.rs28
-rw-r--r--src/test/ui/functions-closures/fn-help-with-err.stderr38
-rw-r--r--src/test/ui/future-incompatible-lint-group.stderr8
-rw-r--r--src/test/ui/generator/clone-impl-async.rs71
-rw-r--r--src/test/ui/generator/clone-impl-async.stderr171
-rw-r--r--src/test/ui/generator/clone-impl-static.rs17
-rw-r--r--src/test/ui/generator/clone-impl-static.stderr31
-rw-r--r--src/test/ui/generator/clone-impl.rs73
-rw-r--r--src/test/ui/generator/clone-impl.stderr142
-rw-r--r--src/test/ui/generator/drop-tracking-parent-expression.stderr12
-rw-r--r--src/test/ui/generator/drop-yield-twice.stderr12
-rw-r--r--src/test/ui/generator/generator-yielding-or-returning-itself.stderr26
-rw-r--r--src/test/ui/generator/issue-102645.rs23
-rw-r--r--src/test/ui/generator/issue-102645.stderr19
-rw-r--r--src/test/ui/generator/issue-52398.stderr2
-rw-r--r--src/test/ui/generator/issue-57084.stderr2
-rw-r--r--src/test/ui/generator/issue-68112.rs3
-rw-r--r--src/test/ui/generator/issue-68112.stderr12
-rw-r--r--src/test/ui/generator/match-bindings.stderr2
-rw-r--r--src/test/ui/generator/not-send-sync.stderr28
-rw-r--r--src/test/ui/generator/panic-drops-resume.rs2
-rw-r--r--src/test/ui/generator/panic-drops.rs1
-rw-r--r--src/test/ui/generator/panic-safe.rs1
-rw-r--r--src/test/ui/generator/partial-drop.stderr39
-rw-r--r--src/test/ui/generator/print/generator-print-verbose-1.stderr20
-rw-r--r--src/test/ui/generator/print/generator-print-verbose-2.stderr28
-rw-r--r--src/test/ui/generator/reborrow-mut-upvar.stderr2
-rw-r--r--src/test/ui/generator/resume-after-return.rs1
-rw-r--r--src/test/ui/generator/size-moved-locals.rs1
-rw-r--r--src/test/ui/generator/too-live-local-in-immovable-gen.stderr2
-rw-r--r--src/test/ui/generator/type-mismatch-signature-deduction.stderr6
-rw-r--r--src/test/ui/generator/yield-in-args-rev.stderr2
-rw-r--r--src/test/ui/generator/yield-in-box.stderr2
-rw-r--r--src/test/ui/generator/yield-in-initializer.stderr2
-rw-r--r--src/test/ui/generator/yield-outside-generator-issue-78653.stderr2
-rw-r--r--src/test/ui/generator/yield-subtype.stderr2
-rw-r--r--src/test/ui/generic-associated-types/anonymize-bound-vars.rs1
-rw-r--r--src/test/ui/generic-associated-types/auxiliary/foo_defn.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs35
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr20
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs40
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr22
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs23
-rw-r--r--src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr22
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-80626.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-80626.stderr4
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-86218.stderr23
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87735.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87735.stderr2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87748.rs23
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87748.stderr20
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87755.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87755.stderr2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87803.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-87803.stderr2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88382.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88382.stderr8
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88460.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88460.stderr8
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88526.rs2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88526.stderr2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-89008.stderr19
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-91762.rs (renamed from src/test/ui/generic-associated-types/issue-91762.rs)5
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-91762.stderr (renamed from src/test/ui/generic-associated-types/issue-91762.stderr)2
-rw-r--r--src/test/ui/generic-associated-types/collections-project-default.rs1
-rw-r--r--src/test/ui/generic-associated-types/collections-project-default.stderr2
-rw-r--r--src/test/ui/generic-associated-types/collections.rs1
-rw-r--r--src/test/ui/generic-associated-types/collectivity-regression.rs2
-rw-r--r--src/test/ui/generic-associated-types/collectivity-regression.stderr2
-rw-r--r--src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs1
-rw-r--r--src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs1
-rw-r--r--src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs1
-rw-r--r--src/test/ui/generic-associated-types/const_params_have_right_type.rs2
-rw-r--r--src/test/ui/generic-associated-types/const_params_have_right_type.stderr2
-rw-r--r--src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs2
-rw-r--r--src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr2
-rw-r--r--src/test/ui/generic-associated-types/construct_with_other_type.rs2
-rw-r--r--src/test/ui/generic-associated-types/cross-crate-bounds.stderr2
-rw-r--r--src/test/ui/generic-associated-types/elided-in-expr-position.rs1
-rw-r--r--src/test/ui/generic-associated-types/elided-in-expr-position.stderr8
-rw-r--r--src/test/ui/generic-associated-types/empty_generics.rs2
-rw-r--r--src/test/ui/generic-associated-types/empty_generics.stderr2
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr2
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator.rs1
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr2
-rw-r--r--src/test/ui/generic-associated-types/extended/lending_iterator_2.rs1
-rw-r--r--src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs16
-rw-r--r--src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr21
-rw-r--r--src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs16
-rw-r--r--src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr19
-rw-r--r--src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs2
-rw-r--r--src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr4
-rw-r--r--src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr4
-rw-r--r--src/test/ui/generic-associated-types/gat-in-trait-path.rs1
-rw-r--r--src/test/ui/generic-associated-types/gat-incomplete-warning.rs5
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs2
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr6
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs2
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr8
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs2
-rw-r--r--src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr18
-rw-r--r--src/test/ui/generic-associated-types/generic-associated-type-bounds.rs2
-rw-r--r--src/test/ui/generic-associated-types/generic-associated-types-where.rs2
-rw-r--r--src/test/ui/generic-associated-types/generic-associated-types-where.stderr4
-rw-r--r--src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs2
-rw-r--r--src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr4
-rw-r--r--src/test/ui/generic-associated-types/impl_bounds.rs1
-rw-r--r--src/test/ui/generic-associated-types/impl_bounds.stderr26
-rw-r--r--src/test/ui/generic-associated-types/impl_bounds_ok.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-101020.rs35
-rw-r--r--src/test/ui/generic-associated-types/issue-101020.stderr25
-rw-r--r--src/test/ui/generic-associated-types/issue-102114.rs16
-rw-r--r--src/test/ui/generic-associated-types/issue-102114.stderr12
-rw-r--r--src/test/ui/generic-associated-types/issue-102333.rs15
-rw-r--r--src/test/ui/generic-associated-types/issue-102335-gat.rs12
-rw-r--r--src/test/ui/generic-associated-types/issue-102335-gat.stderr9
-rw-r--r--src/test/ui/generic-associated-types/issue-47206-where-clause.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-47206-where-clause.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-67424.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-67424.stderr12
-rw-r--r--src/test/ui/generic-associated-types/issue-67510-pass.base.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-67510-pass.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-67510.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-67510.stderr8
-rw-r--r--src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-68643-broken-mir.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-68648-1.rs3
-rw-r--r--src/test/ui/generic-associated-types/issue-68648-2.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68648-2.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-68649-pass.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68653.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68656-unsized-values.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-70303.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-70304.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-70304.stderr6
-rw-r--r--src/test/ui/generic-associated-types/issue-71176.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-71176.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-74684-1.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-74684-1.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-74684-2.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-74684-2.stderr10
-rw-r--r--src/test/ui/generic-associated-types/issue-74816.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-74816.stderr8
-rw-r--r--src/test/ui/generic-associated-types/issue-74824.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-74824.stderr10
-rw-r--r--src/test/ui/generic-associated-types/issue-76407.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-76535.base.stderr14
-rw-r--r--src/test/ui/generic-associated-types/issue-76535.extended.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-76535.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-76826.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs4
-rw-r--r--src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr26
-rw-r--r--src/test/ui/generic-associated-types/issue-78671.base.stderr8
-rw-r--r--src/test/ui/generic-associated-types/issue-78671.extended.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-78671.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-79422.base.stderr14
-rw-r--r--src/test/ui/generic-associated-types/issue-79422.extended.stderr8
-rw-r--r--src/test/ui/generic-associated-types/issue-79422.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-79636-1.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-79636-1.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-79636-2.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-79636-2.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-80433-reduced.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-80433.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-80433.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-81487.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-81862.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-81862.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-84931.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-84931.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-85921.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-86218-2.rs23
-rw-r--r--src/test/ui/generic-associated-types/issue-86218.rs (renamed from src/test/ui/generic-associated-types/bugs/issue-86218.rs)9
-rw-r--r--src/test/ui/generic-associated-types/issue-86483.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-86787.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-86787.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-87258_a.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-87258_a.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-87258_b.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-87258_b.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-87429-2.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-87429-specialization.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-87429-specialization.stderr6
-rw-r--r--src/test/ui/generic-associated-types/issue-87429.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-87748.rs21
-rw-r--r--src/test/ui/generic-associated-types/issue-87750.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-87750.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-88287.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-88287.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-88360.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-88360.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-88405.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-88459.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-88595.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-88595.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-89008.rs (renamed from src/test/ui/generic-associated-types/bugs/issue-89008.rs)29
-rw-r--r--src/test/ui/generic-associated-types/issue-89352.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-90014.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-90014.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-90729.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-91139.migrate.stderr13
-rw-r--r--src/test/ui/generic-associated-types/issue-91139.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-91139.stderr18
-rw-r--r--src/test/ui/generic-associated-types/issue-91883.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-91883.stderr6
-rw-r--r--src/test/ui/generic-associated-types/issue-92033.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-92033.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-92096.migrate.stderr4
-rw-r--r--src/test/ui/generic-associated-types/issue-92096.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-92096.stderr2
-rw-r--r--src/test/ui/generic-associated-types/issue-92280.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-92954.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-93141.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-93262.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-93340.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-93341.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-93342.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-93874.rs2
-rw-r--r--src/test/ui/generic-associated-types/issue-95305.rs1
-rw-r--r--src/test/ui/generic-associated-types/issue-95305.stderr2
-rw-r--r--src/test/ui/generic-associated-types/iterable.rs2
-rw-r--r--src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs2
-rw-r--r--src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr4
-rw-r--r--src/test/ui/generic-associated-types/missing-bounds.fixed2
-rw-r--r--src/test/ui/generic-associated-types/missing-bounds.stderr4
-rw-r--r--src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs2
-rw-r--r--src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr2
-rw-r--r--src/test/ui/generic-associated-types/missing_lifetime_args.rs2
-rw-r--r--src/test/ui/generic-associated-types/missing_lifetime_args.stderr12
-rw-r--r--src/test/ui/generic-associated-types/missing_lifetime_const.rs2
-rw-r--r--src/test/ui/generic-associated-types/missing_lifetime_const.stderr4
-rw-r--r--src/test/ui/generic-associated-types/parameter_number_and_kind.rs1
-rw-r--r--src/test/ui/generic-associated-types/parameter_number_and_kind.stderr12
-rw-r--r--src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs1
-rw-r--r--src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr12
-rw-r--r--src/test/ui/generic-associated-types/parse/in-trait-impl.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/in-trait.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-expressions.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr4
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr10
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-segments.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-segments.stderr6
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr8
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-types.rs2
-rw-r--r--src/test/ui/generic-associated-types/parse/trait-path-types.stderr6
-rw-r--r--src/test/ui/generic-associated-types/pointer_family.rs2
-rw-r--r--src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs2
-rw-r--r--src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr4
-rw-r--r--src/test/ui/generic-associated-types/projection-bound-cycle.rs1
-rw-r--r--src/test/ui/generic-associated-types/projection-bound-cycle.stderr4
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs2
-rw-r--r--src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr6
-rw-r--r--src/test/ui/generic-associated-types/self-outlives-lint.rs15
-rw-r--r--src/test/ui/generic-associated-types/self-outlives-lint.stderr43
-rw-r--r--src/test/ui/generic-associated-types/shadowing.rs2
-rw-r--r--src/test/ui/generic-associated-types/shadowing.stderr8
-rw-r--r--src/test/ui/generic-associated-types/streaming_iterator.rs2
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.base.stderr4
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.extended.stderr4
-rw-r--r--src/test/ui/generic-associated-types/trait-objects.rs1
-rw-r--r--src/test/ui/generic-associated-types/type-param-defaults.rs34
-rw-r--r--src/test/ui/generic-associated-types/type-param-defaults.stderr20
-rw-r--r--src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs2
-rw-r--r--src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr14
-rw-r--r--src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs2
-rw-r--r--src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr8
-rw-r--r--src/test/ui/generic-associated-types/variance_constraints.rs1
-rw-r--r--src/test/ui/generics/issue-59508-1.rs2
-rw-r--r--src/test/ui/generics/issue-59508-1.stderr2
-rw-r--r--src/test/ui/generics/issue-59508.fixed2
-rw-r--r--src/test/ui/generics/issue-59508.rs2
-rw-r--r--src/test/ui/generics/issue-59508.stderr2
-rw-r--r--src/test/ui/generics/issue-80512-param-reordering-with-defaults.rs2
-rw-r--r--src/test/ui/generics/issue-80512-param-reordering-with-defaults.stderr2
-rw-r--r--src/test/ui/generics/issue-94923.rs49
-rw-r--r--src/test/ui/generics/issue-98432.stderr6
-rw-r--r--src/test/ui/generics/lifetime-before-type-params.rs8
-rw-r--r--src/test/ui/generics/lifetime-before-type-params.stderr8
-rw-r--r--src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.rs2
-rw-r--r--src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.rs2
-rw-r--r--src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr6
-rw-r--r--src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs7
-rw-r--r--src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr12
-rw-r--r--src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.rs18
-rw-r--r--src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.stderr53
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr6
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.stderr136
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs2
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr10
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs2
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr12
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.rs2
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr16
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-semantics.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-syntactic-pass.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr52
-rw-r--r--src/test/ui/half-open-range-patterns/pat-tuple-4.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/pat-tuple-5.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/pat-tuple-5.stderr2
-rw-r--r--src/test/ui/half-open-range-patterns/range_pat_interactions0.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/range_pat_interactions3.rs3
-rw-r--r--src/test/ui/half-open-range-patterns/range_pat_interactions3.stderr11
-rw-r--r--src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem0.rs2
-rw-r--r--src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs1
-rw-r--r--src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr13
-rw-r--r--src/test/ui/hashmap/hashmap-index-mut.rs6
-rw-r--r--src/test/ui/hashmap/hashmap-index-mut.stderr19
-rw-r--r--src/test/ui/higher-rank-trait-bounds/complex.rs (renamed from src/test/ui/hrtb/complex.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/due-to-where-clause.rs (renamed from src/test/ui/hrtb/due-to-where-clause.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/due-to-where-clause.stderr (renamed from src/test/ui/hrtb/due-to-where-clause.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.rs (renamed from src/test/ui/hrtb/hrtb-cache-issue-54302.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.stderr (renamed from src/test/ui/hrtb/hrtb-cache-issue-54302.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-conflate-regions.rs (renamed from src/test/ui/hrtb/hrtb-conflate-regions.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-conflate-regions.stderr (renamed from src/test/ui/hrtb/hrtb-conflate-regions.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.rs (renamed from src/test/ui/hrtb/hrtb-debruijn-in-receiver.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.stderr (renamed from src/test/ui/hrtb/hrtb-debruijn-in-receiver.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.rs (renamed from src/test/ui/hrtb/hrtb-exists-forall-fn.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.stderr (renamed from src/test/ui/hrtb/hrtb-exists-forall-fn.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.rs (renamed from src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.stderr (renamed from src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-covariant.rs (renamed from src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.rs (renamed from src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.stderr (renamed from src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs (renamed from src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr (renamed from src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.rs (renamed from src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.stderr (renamed from src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.rs (renamed from src/test/ui/hrtb/hrtb-identity-fn-borrows.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.stderr (renamed from src/test/ui/hrtb/hrtb-identity-fn-borrows.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-just-for-static.rs (renamed from src/test/ui/hrtb/hrtb-just-for-static.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-just-for-static.stderr (renamed from src/test/ui/hrtb/hrtb-just-for-static.stderr)6
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.polonius.stderr (renamed from src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.rs (renamed from src/test/ui/hrtb/hrtb-perfect-forwarding.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.stderr (renamed from src/test/ui/hrtb/hrtb-perfect-forwarding.stderr)8
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-100689.rs29
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-102899.rs32
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-30786.rs (renamed from src/test/ui/hrtb/issue-30786.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-30786.stderr (renamed from src/test/ui/hrtb/issue-30786.stderr)18
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-46989.rs (renamed from src/test/ui/hrtb/issue-46989.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-46989.stderr (renamed from src/test/ui/hrtb/issue-46989.stderr)2
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-57639.rs (renamed from src/test/ui/hrtb/issue-57639.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-58451.rs (renamed from src/test/ui/hrtb/issue-58451.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-58451.stderr (renamed from src/test/ui/hrtb/issue-58451.stderr)2
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.rs (renamed from src/test/ui/hrtb/issue-62203-hrtb-ice.rs)12
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr (renamed from src/test/ui/hrtb/issue-62203-hrtb-ice.stderr)30
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-88446.rs (renamed from src/test/ui/hrtb/issue-88446.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-90177.rs (renamed from src/test/ui/hrtb/issue-90177.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-95034.rs (renamed from src/test/ui/hrtb/issue-95034.rs)20
-rw-r--r--src/test/ui/higher-rank-trait-bounds/issue-95230.rs (renamed from src/test/ui/hrtb/issue-95230.rs)0
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr6
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr16
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs3
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr19
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr6
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs2
-rw-r--r--src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs2
-rw-r--r--src/test/ui/hrtb/issue-95034.stderr1
-rw-r--r--src/test/ui/hygiene/globs.stderr18
-rw-r--r--src/test/ui/hygiene/impl_items-2.rs26
-rw-r--r--src/test/ui/hygiene/impl_items-2.stderr15
-rw-r--r--src/test/ui/hygiene/impl_items.rs2
-rw-r--r--src/test/ui/hygiene/impl_items.stderr2
-rw-r--r--src/test/ui/hygiene/rustc-macro-transparency.stderr8
-rw-r--r--src/test/ui/impl-duplicate-methods.stderr11
-rw-r--r--src/test/ui/impl-trait/auto-trait-leak.stderr18
-rw-r--r--src/test/ui/impl-trait/equality-rpass.stderr2
-rw-r--r--src/test/ui/impl-trait/equality.stderr9
-rw-r--r--src/test/ui/impl-trait/equality2.stderr2
-rw-r--r--src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr4
-rw-r--r--src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr9
-rw-r--r--src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs2
-rw-r--r--src/test/ui/impl-trait/hidden-lifetimes.stderr8
-rw-r--r--src/test/ui/impl-trait/impl-generic-mismatch.rs9
-rw-r--r--src/test/ui/impl-trait/impl-generic-mismatch.stderr18
-rw-r--r--src/test/ui/impl-trait/in-trait/auxiliary/rpitit.rs11
-rw-r--r--src/test/ui/impl-trait/in-trait/deep-match-works.rs16
-rw-r--r--src/test/ui/impl-trait/in-trait/deep-match.rs15
-rw-r--r--src/test/ui/impl-trait/in-trait/deep-match.stderr15
-rw-r--r--src/test/ui/impl-trait/in-trait/default-body-type-err-2.rs13
-rw-r--r--src/test/ui/impl-trait/in-trait/default-body-type-err-2.stderr11
-rw-r--r--src/test/ui/impl-trait/in-trait/default-body-type-err.rs13
-rw-r--r--src/test/ui/impl-trait/in-trait/default-body-type-err.stderr12
-rw-r--r--src/test/ui/impl-trait/in-trait/default-body-with-rpit.rs21
-rw-r--r--src/test/ui/impl-trait/in-trait/default-body.rs21
-rw-r--r--src/test/ui/impl-trait/in-trait/doesnt-satisfy.rs13
-rw-r--r--src/test/ui/impl-trait/in-trait/doesnt-satisfy.stderr17
-rw-r--r--src/test/ui/impl-trait/in-trait/early.rs23
-rw-r--r--src/test/ui/impl-trait/in-trait/encode.rs9
-rw-r--r--src/test/ui/impl-trait/in-trait/foreign.rs9
-rw-r--r--src/test/ui/impl-trait/in-trait/issue-102140.rs30
-rw-r--r--src/test/ui/impl-trait/in-trait/issue-102140.stderr29
-rw-r--r--src/test/ui/impl-trait/in-trait/issue-102301.rs18
-rw-r--r--src/test/ui/impl-trait/in-trait/issue-102571.rs24
-rw-r--r--src/test/ui/impl-trait/in-trait/issue-102571.stderr14
-rw-r--r--src/test/ui/impl-trait/in-trait/nested-rpitit.rs32
-rw-r--r--src/test/ui/impl-trait/in-trait/object-safety.rs22
-rw-r--r--src/test/ui/impl-trait/in-trait/object-safety.stderr50
-rw-r--r--src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs19
-rw-r--r--src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr17
-rw-r--r--src/test/ui/impl-trait/in-trait/opaque-in-impl.rs48
-rw-r--r--src/test/ui/impl-trait/in-trait/reveal.rs18
-rw-r--r--src/test/ui/impl-trait/in-trait/signature-mismatch.rs21
-rw-r--r--src/test/ui/impl-trait/in-trait/signature-mismatch.stderr16
-rw-r--r--src/test/ui/impl-trait/in-trait/success.rs40
-rw-r--r--src/test/ui/impl-trait/in-trait/wf-bounds.rs16
-rw-r--r--src/test/ui/impl-trait/in-trait/wf-bounds.stderr33
-rw-r--r--src/test/ui/impl-trait/issue-100075-2.rs8
-rw-r--r--src/test/ui/impl-trait/issue-100075-2.stderr24
-rw-r--r--src/test/ui/impl-trait/issue-100075.rs21
-rw-r--r--src/test/ui/impl-trait/issue-100075.stderr12
-rw-r--r--src/test/ui/impl-trait/issue-102605.rs15
-rw-r--r--src/test/ui/impl-trait/issue-102605.stderr41
-rw-r--r--src/test/ui/impl-trait/issue-103181-1.rs85
-rw-r--r--src/test/ui/impl-trait/issue-103181-1.stderr12
-rw-r--r--src/test/ui/impl-trait/issue-103181-2.rs29
-rw-r--r--src/test/ui/impl-trait/issue-103181-2.stderr9
-rw-r--r--src/test/ui/impl-trait/issue-103599.rs10
-rw-r--r--src/test/ui/impl-trait/issue-103599.stderr14
-rw-r--r--src/test/ui/impl-trait/issue-86465.rs6
-rw-r--r--src/test/ui/impl-trait/issue-86465.stderr2
-rw-r--r--src/test/ui/impl-trait/issue-87450.stderr2
-rw-r--r--src/test/ui/impl-trait/issue-99914.rs13
-rw-r--r--src/test/ui/impl-trait/issue-99914.stderr21
-rw-r--r--src/test/ui/impl-trait/issues/issue-78722.rs4
-rw-r--r--src/test/ui/impl-trait/issues/issue-78722.stderr6
-rw-r--r--src/test/ui/impl-trait/issues/issue-86800.stderr15
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr2
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr2
-rw-r--r--src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr14
-rw-r--r--src/test/ui/impl-trait/nested-return-type2-tait.rs1
-rw-r--r--src/test/ui/impl-trait/nested-return-type2-tait.stderr17
-rw-r--r--src/test/ui/impl-trait/nested-return-type2-tait2.stderr2
-rw-r--r--src/test/ui/impl-trait/nested-return-type2-tait3.stderr2
-rw-r--r--src/test/ui/impl-trait/nested-return-type2.rs1
-rw-r--r--src/test/ui/impl-trait/nested-return-type2.stderr17
-rw-r--r--src/test/ui/impl-trait/nested-return-type3-tait.rs1
-rw-r--r--src/test/ui/impl-trait/nested-return-type3-tait.stderr17
-rw-r--r--src/test/ui/impl-trait/nested-return-type3-tait2.rs1
-rw-r--r--src/test/ui/impl-trait/nested-return-type3-tait2.stderr17
-rw-r--r--src/test/ui/impl-trait/nested-return-type3-tait3.rs1
-rw-r--r--src/test/ui/impl-trait/nested-return-type3-tait3.stderr17
-rw-r--r--src/test/ui/impl-trait/nested-return-type3.rs1
-rw-r--r--src/test/ui/impl-trait/nested-return-type3.stderr17
-rw-r--r--src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs23
-rw-r--r--src/test/ui/impl-trait/nested_impl_trait.stderr4
-rw-r--r--src/test/ui/impl-trait/normalize-tait-in-const.rs39
-rw-r--r--src/test/ui/impl-trait/normalize-tait-in-const.stderr8
-rw-r--r--src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr4
-rw-r--r--src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr4
-rw-r--r--src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr96
-rw-r--r--src/test/ui/impl-trait/projection-mismatch-in-impl-where-clause.stderr2
-rw-r--r--src/test/ui/impl-trait/region-escape-via-bound.stderr2
-rw-r--r--src/test/ui/impl-trait/static-return-lifetime-infered.stderr8
-rw-r--r--src/test/ui/impl-trait/suggest-calling-rpit-closure.stderr2
-rw-r--r--src/test/ui/impl-trait/unactionable_diagnostic.fixed25
-rw-r--r--src/test/ui/impl-trait/unactionable_diagnostic.rs25
-rw-r--r--src/test/ui/impl-trait/unactionable_diagnostic.stderr14
-rw-r--r--src/test/ui/impl-trait/where-allowed.stderr8
-rw-r--r--src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.rs27
-rw-r--r--src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.stderr15
-rw-r--r--src/test/ui/implied-bounds/impl-header-unnormalized-types.rs28
-rw-r--r--src/test/ui/implied-bounds/impl-header-unnormalized-types.stderr20
-rw-r--r--src/test/ui/implied-bounds/issue-100690.rs45
-rw-r--r--src/test/ui/implied-bounds/issue-100690.stderr22
-rw-r--r--src/test/ui/implied-bounds/issue-101951.rs50
-rw-r--r--src/test/ui/imports/issue-56125.stderr12
-rw-r--r--src/test/ui/imports/issue-57015.stderr5
-rw-r--r--src/test/ui/imports/local-modularized-tricky-fail-2.stderr2
-rw-r--r--src/test/ui/index-help.stderr2
-rw-r--r--src/test/ui/indexing-requires-a-uint.stderr2
-rw-r--r--src/test/ui/inference/char-as-str-single.fixed1
-rw-r--r--src/test/ui/inference/char-as-str-single.rs1
-rw-r--r--src/test/ui/inference/char-as-str-single.stderr15
-rw-r--r--src/test/ui/inference/inference-variable-behind-raw-pointer.stderr2
-rw-r--r--src/test/ui/inference/inference_unstable.stderr2
-rw-r--r--src/test/ui/inference/issue-36053.rs (renamed from src/test/ui/issues/issue-36053.rs)0
-rw-r--r--src/test/ui/inference/issue-71732.stderr6
-rw-r--r--src/test/ui/inference/issue-86162-1.stderr2
-rw-r--r--src/test/ui/inference/issue-86162-2.stderr2
-rw-r--r--src/test/ui/inference/need_type_info/concrete-impl.stderr9
-rw-r--r--src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs11
-rw-r--r--src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr9
-rw-r--r--src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs2
-rw-r--r--src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr2
-rw-r--r--src/test/ui/inference/need_type_info/issue-103053.rs18
-rw-r--r--src/test/ui/inference/need_type_info/issue-103053.stderr14
-rw-r--r--src/test/ui/inference/str-as-char.fixed4
-rw-r--r--src/test/ui/inference/str-as-char.rs4
-rw-r--r--src/test/ui/inference/str-as-char.stderr24
-rw-r--r--src/test/ui/infinite/infinite-struct.rs7
-rw-r--r--src/test/ui/infinite/infinite-struct.stderr19
-rw-r--r--src/test/ui/infinite/infinite-tag-type-recursion.stderr4
-rw-r--r--src/test/ui/inline-const/const-match-pat-range.rs3
-rw-r--r--src/test/ui/integral-indexing.stderr16
-rw-r--r--src/test/ui/interior-mutability/interior-mutability.stderr8
-rw-r--r--src/test/ui/intrinsics/const-eval-select-backtrace-std.rs7
-rw-r--r--src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr2
-rw-r--r--src/test/ui/intrinsics/const-eval-select-backtrace.rs19
-rw-r--r--src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr2
-rw-r--r--src/test/ui/intrinsics/const-eval-select-bad.rs14
-rw-r--r--src/test/ui/intrinsics/const-eval-select-bad.stderr85
-rw-r--r--src/test/ui/intrinsics/intrinsic-alignment.rs1
-rw-r--r--src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.rs1
-rw-r--r--src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr2
-rw-r--r--src/test/ui/intrinsics/intrinsic-raw_eq-const.rs1
-rw-r--r--src/test/ui/intrinsics/intrinsics-integer.rs6
-rw-r--r--src/test/ui/intrinsics/panic-uninitialized-zeroed.rs253
-rw-r--r--src/test/ui/intrinsics/safe-intrinsic-mismatch.rs11
-rw-r--r--src/test/ui/intrinsics/safe-intrinsic-mismatch.stderr14
-rw-r--r--src/test/ui/invalid/invalid-inline.rs9
-rw-r--r--src/test/ui/invalid/invalid-inline.stderr15
-rw-r--r--src/test/ui/invalid/invalid-llvm-passes.rs2
-rw-r--r--src/test/ui/issue-94866.stderr6
-rw-r--r--src/test/ui/issues/auxiliary/issue-2380.rs4
-rw-r--r--src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs39
-rw-r--r--src/test/ui/issues/issue-100605.rs9
-rw-r--r--src/test/ui/issues/issue-100605.stderr46
-rw-r--r--src/test/ui/issues/issue-102964.rs10
-rw-r--r--src/test/ui/issues/issue-102964.stderr19
-rw-r--r--src/test/ui/issues/issue-10682.rs4
-rw-r--r--src/test/ui/issues/issue-10767.rs4
-rw-r--r--src/test/ui/issues/issue-10802.rs9
-rw-r--r--src/test/ui/issues/issue-11192.rs8
-rw-r--r--src/test/ui/issues/issue-11192.stderr2
-rw-r--r--src/test/ui/issues/issue-11374.stderr2
-rw-r--r--src/test/ui/issues/issue-11515.rs6
-rw-r--r--src/test/ui/issues/issue-11515.stderr6
-rw-r--r--src/test/ui/issues/issue-11552.rs6
-rw-r--r--src/test/ui/issues/issue-11844.rs4
-rw-r--r--src/test/ui/issues/issue-11844.stderr2
-rw-r--r--src/test/ui/issues/issue-11958.stderr4
-rw-r--r--src/test/ui/issues/issue-12127.rs4
-rw-r--r--src/test/ui/issues/issue-13323.rs3
-rw-r--r--src/test/ui/issues/issue-14399.rs4
-rw-r--r--src/test/ui/issues/issue-1460.stderr2
-rw-r--r--src/test/ui/issues/issue-14875.rs1
-rw-r--r--src/test/ui/issues/issue-14915.rs4
-rw-r--r--src/test/ui/issues/issue-14915.stderr2
-rw-r--r--src/test/ui/issues/issue-15524.rs16
-rw-r--r--src/test/ui/issues/issue-15524.stderr40
-rw-r--r--src/test/ui/issues/issue-15571.rs7
-rw-r--r--src/test/ui/issues/issue-15763.rs9
-rw-r--r--src/test/ui/issues/issue-16250.stderr12
-rw-r--r--src/test/ui/issues/issue-16256.stderr2
-rw-r--r--src/test/ui/issues/issue-16538.mir.stderr1
-rw-r--r--src/test/ui/issues/issue-16538.thir.stderr1
-rw-r--r--src/test/ui/issues/issue-16739.rs7
-rw-r--r--src/test/ui/issues/issue-16774.rs3
-rw-r--r--src/test/ui/issues/issue-16939.stderr2
-rw-r--r--src/test/ui/issues/issue-17252.stderr2
-rw-r--r--src/test/ui/issues/issue-17322.rs4
-rw-r--r--src/test/ui/issues/issue-17431-1.stderr10
-rw-r--r--src/test/ui/issues/issue-17431-2.rs3
-rw-r--r--src/test/ui/issues/issue-17431-2.stderr31
-rw-r--r--src/test/ui/issues/issue-17431-3.stderr10
-rw-r--r--src/test/ui/issues/issue-17431-4.stderr10
-rw-r--r--src/test/ui/issues/issue-17431-5.stderr4
-rw-r--r--src/test/ui/issues/issue-17431-6.stderr10
-rw-r--r--src/test/ui/issues/issue-17431-7.stderr10
-rw-r--r--src/test/ui/issues/issue-18611.stderr8
-rw-r--r--src/test/ui/issues/issue-18819.stderr12
-rw-r--r--src/test/ui/issues/issue-18919.stderr4
-rw-r--r--src/test/ui/issues/issue-19991.rs2
-rw-r--r--src/test/ui/issues/issue-19991.stderr2
-rw-r--r--src/test/ui/issues/issue-20162.stderr6
-rw-r--r--src/test/ui/issues/issue-20413.stderr16
-rw-r--r--src/test/ui/issues/issue-20605.stderr4
-rw-r--r--src/test/ui/issues/issue-20831-debruijn.stderr24
-rw-r--r--src/test/ui/issues/issue-21033.rs5
-rw-r--r--src/test/ui/issues/issue-21174.stderr4
-rw-r--r--src/test/ui/issues/issue-21763.stderr6
-rw-r--r--src/test/ui/issues/issue-21950.stderr18
-rw-r--r--src/test/ui/issues/issue-22644.rs2
-rw-r--r--src/test/ui/issues/issue-22644.stderr2
-rw-r--r--src/test/ui/issues/issue-22872.stderr2
-rw-r--r--src/test/ui/issues/issue-2288.rs4
-rw-r--r--src/test/ui/issues/issue-23024.rs3
-rw-r--r--src/test/ui/issues/issue-23024.stderr6
-rw-r--r--src/test/ui/issues/issue-23122-2.rs1
-rw-r--r--src/test/ui/issues/issue-23122-2.stderr6
-rw-r--r--src/test/ui/issues/issue-23302-3.stderr4
-rw-r--r--src/test/ui/issues/issue-23491.rs3
-rw-r--r--src/test/ui/issues/issue-23611-enum-swap-in-drop.rs2
-rw-r--r--src/test/ui/issues/issue-24013.stderr5
-rw-r--r--src/test/ui/issues/issue-24322.stderr4
-rw-r--r--src/test/ui/issues/issue-25901.rs2
-rw-r--r--src/test/ui/issues/issue-25901.stderr21
-rw-r--r--src/test/ui/issues/issue-26217.stderr6
-rw-r--r--src/test/ui/issues/issue-2708.rs4
-rw-r--r--src/test/ui/issues/issue-2734.rs8
-rw-r--r--src/test/ui/issues/issue-2735.rs8
-rw-r--r--src/test/ui/issues/issue-28344.stderr6
-rw-r--r--src/test/ui/issues/issue-2935.rs3
-rw-r--r--src/test/ui/issues/issue-29746.rs2
-rw-r--r--src/test/ui/issues/issue-29948.rs1
-rw-r--r--src/test/ui/issues/issue-3008-1.stderr4
-rw-r--r--src/test/ui/issues/issue-3008-2.stderr4
-rw-r--r--src/test/ui/issues/issue-3008-3.stderr4
-rw-r--r--src/test/ui/issues/issue-3026.rs4
-rw-r--r--src/test/ui/issues/issue-30371.rs1
-rw-r--r--src/test/ui/issues/issue-30490.rs1
-rw-r--r--src/test/ui/issues/issue-31173.rs11
-rw-r--r--src/test/ui/issues/issue-31173.stderr42
-rw-r--r--src/test/ui/issues/issue-3121.rs3
-rw-r--r--src/test/ui/issues/issue-3214.stderr5
-rw-r--r--src/test/ui/issues/issue-32326.stderr12
-rw-r--r--src/test/ui/issues/issue-32709.stderr2
-rw-r--r--src/test/ui/issues/issue-3290.rs3
-rw-r--r--src/test/ui/issues/issue-33941.rs6
-rw-r--r--src/test/ui/issues/issue-33941.stderr18
-rw-r--r--src/test/ui/issues/issue-34334.stderr6
-rw-r--r--src/test/ui/issues/issue-34349.stderr10
-rw-r--r--src/test/ui/issues/issue-3447.rs3
-rw-r--r--src/test/ui/issues/issue-35241.stderr6
-rw-r--r--src/test/ui/issues/issue-35570.rs3
-rw-r--r--src/test/ui/issues/issue-35570.stderr12
-rw-r--r--src/test/ui/issues/issue-3563-2.rs14
-rw-r--r--src/test/ui/issues/issue-3779.stderr6
-rw-r--r--src/test/ui/issues/issue-3794.rs3
-rw-r--r--src/test/ui/issues/issue-3878.rs3
-rw-r--r--src/test/ui/issues/issue-38821.stderr2
-rw-r--r--src/test/ui/issues/issue-39970.stderr2
-rw-r--r--src/test/ui/issues/issue-40000.stderr4
-rw-r--r--src/test/ui/issues/issue-40510-3.stderr4
-rw-r--r--src/test/ui/issues/issue-40827.stderr4
-rw-r--r--src/test/ui/issues/issue-41139.stderr4
-rw-r--r--src/test/ui/issues/issue-41726.stderr4
-rw-r--r--src/test/ui/issues/issue-41974.stderr4
-rw-r--r--src/test/ui/issues/issue-4265.stderr8
-rw-r--r--src/test/ui/issues/issue-43853.rs1
-rw-r--r--src/test/ui/issues/issue-43988.stderr4
-rw-r--r--src/test/ui/issues/issue-46519.rs1
-rw-r--r--src/test/ui/issues/issue-47094.stderr2
-rw-r--r--src/test/ui/issues/issue-47486.stderr5
-rw-r--r--src/test/ui/issues/issue-47511.stderr3
-rw-r--r--src/test/ui/issues/issue-4759.rs4
-rw-r--r--src/test/ui/issues/issue-47725.stderr2
-rw-r--r--src/test/ui/issues/issue-4935.stderr2
-rw-r--r--src/test/ui/issues/issue-4972.rs1
-rw-r--r--src/test/ui/issues/issue-4972.stderr2
-rw-r--r--src/test/ui/issues/issue-49824.stderr4
-rw-r--r--src/test/ui/issues/issue-50582.stderr4
-rw-r--r--src/test/ui/issues/issue-50781.stderr10
-rw-r--r--src/test/ui/issues/issue-5100.rs2
-rw-r--r--src/test/ui/issues/issue-5192.rs4
-rw-r--r--src/test/ui/issues/issue-54044.stderr2
-rw-r--r--src/test/ui/issues/issue-5439.rs4
-rw-r--r--src/test/ui/issues/issue-5439.stderr6
-rw-r--r--src/test/ui/issues/issue-55380.stderr2
-rw-r--r--src/test/ui/issues/issue-5666.rs5
-rw-r--r--src/test/ui/issues/issue-5718.rs4
-rw-r--r--src/test/ui/issues/issue-57271.rs4
-rw-r--r--src/test/ui/issues/issue-57271.stderr28
-rw-r--r--src/test/ui/issues/issue-57362-1.stderr4
-rw-r--r--src/test/ui/issues/issue-57362-2.stderr6
-rw-r--r--src/test/ui/issues/issue-58022.stderr12
-rw-r--r--src/test/ui/issues/issue-58734.stderr2
-rw-r--r--src/test/ui/issues/issue-5884.rs4
-rw-r--r--src/test/ui/issues/issue-59488.rs1
-rw-r--r--src/test/ui/issues/issue-59488.stderr43
-rw-r--r--src/test/ui/issues/issue-5997-enum.stderr8
-rw-r--r--src/test/ui/issues/issue-5997-struct.stderr8
-rw-r--r--src/test/ui/issues/issue-60218.stderr4
-rw-r--r--src/test/ui/issues/issue-60622.stderr4
-rw-r--r--src/test/ui/issues/issue-62480.rs2
-rw-r--r--src/test/ui/issues/issue-62480.stderr4
-rw-r--r--src/test/ui/issues/issue-6318.rs4
-rw-r--r--src/test/ui/issues/issue-6458-3.stderr6
-rw-r--r--src/test/ui/issues/issue-6458-4.stderr2
-rw-r--r--src/test/ui/issues/issue-6557.rs1
-rw-r--r--src/test/ui/issues/issue-66706.rs3
-rw-r--r--src/test/ui/issues/issue-66706.stderr35
-rw-r--r--src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr12
-rw-r--r--src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr2
-rw-r--r--src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr14
-rw-r--r--src/test/ui/issues/issue-69455.stderr2
-rw-r--r--src/test/ui/issues/issue-7013.rs4
-rw-r--r--src/test/ui/issues/issue-7013.stderr8
-rw-r--r--src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr11
-rw-r--r--src/test/ui/issues/issue-72278.stderr2
-rw-r--r--src/test/ui/issues/issue-72554.rs1
-rw-r--r--src/test/ui/issues/issue-72554.stderr24
-rw-r--r--src/test/ui/issues/issue-7364.rs4
-rw-r--r--src/test/ui/issues/issue-7364.stderr6
-rw-r--r--src/test/ui/issues/issue-75307.rs2
-rw-r--r--src/test/ui/issues/issue-75307.stderr8
-rw-r--r--src/test/ui/issues/issue-75907.rs2
-rw-r--r--src/test/ui/issues/issue-75907_b.rs2
-rw-r--r--src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs4
-rw-r--r--src/test/ui/issues/issue-77993-1.rs12
-rw-r--r--src/test/ui/issues/issue-77993-1.stderr16
-rw-r--r--src/test/ui/issues/issue-78957.stderr2
-rw-r--r--src/test/ui/issues/issue-86756.stderr7
-rw-r--r--src/test/ui/issues/issue-8727.stderr2
-rw-r--r--src/test/ui/issues/issue-87707.rs1
-rw-r--r--src/test/ui/issues/issue-87707.run.stderr4
-rw-r--r--src/test/ui/issues/issue-9129.rs4
-rw-r--r--src/test/ui/issues/issue-9382.rs5
-rw-r--r--src/test/ui/issues/issue-99838.rs2
-rw-r--r--src/test/ui/issues/issue-99875.rs16
-rw-r--r--src/test/ui/issues/issue-99875.stderr33
-rw-r--r--src/test/ui/iterators/collect-into-array.rs1
-rw-r--r--src/test/ui/iterators/collect-into-array.stderr6
-rw-r--r--src/test/ui/iterators/collect-into-slice.rs5
-rw-r--r--src/test/ui/iterators/collect-into-slice.stderr23
-rw-r--r--src/test/ui/iterators/integral.stderr24
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-2018.stderr2
-rw-r--r--src/test/ui/iterators/into-iter-on-arrays-lint.stderr2
-rw-r--r--src/test/ui/iterators/issue-28098.rs4
-rw-r--r--src/test/ui/iterators/issue-28098.stderr50
-rw-r--r--src/test/ui/iterators/issue-58952-filter-type-length.rs2
-rw-r--r--src/test/ui/iterators/iter-count-overflow-debug.rs1
-rw-r--r--src/test/ui/iterators/iter-position-overflow-debug.rs1
-rw-r--r--src/test/ui/iterators/iter-step-overflow-debug.rs1
-rw-r--r--src/test/ui/iterators/iter-sum-overflow-debug.rs1
-rw-r--r--src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs1
-rw-r--r--src/test/ui/iterators/ranges.stderr4
-rw-r--r--src/test/ui/iterators/string.stderr4
-rw-r--r--src/test/ui/json-multiple.stderr1
-rw-r--r--src/test/ui/json-options.stderr1
-rw-r--r--src/test/ui/json/json-and-color.rs (renamed from src/test/ui/json-and-color.rs)0
-rw-r--r--src/test/ui/json/json-and-color.stderr (renamed from src/test/ui/json-and-color.stderr)0
-rw-r--r--src/test/ui/json/json-and-error-format.rs (renamed from src/test/ui/json-and-error-format.rs)0
-rw-r--r--src/test/ui/json/json-and-error-format.stderr (renamed from src/test/ui/json-and-error-format.stderr)0
-rw-r--r--src/test/ui/json/json-bom-plus-crlf-multifile-aux.rs (renamed from src/test/ui/json-bom-plus-crlf-multifile-aux.rs)0
-rw-r--r--src/test/ui/json/json-bom-plus-crlf-multifile.rs (renamed from src/test/ui/json-bom-plus-crlf-multifile.rs)0
-rw-r--r--src/test/ui/json/json-bom-plus-crlf-multifile.stderr (renamed from src/test/ui/json-bom-plus-crlf-multifile.stderr)0
-rw-r--r--src/test/ui/json/json-bom-plus-crlf.rs (renamed from src/test/ui/json-bom-plus-crlf.rs)0
-rw-r--r--src/test/ui/json/json-bom-plus-crlf.stderr (renamed from src/test/ui/json-bom-plus-crlf.stderr)0
-rw-r--r--src/test/ui/json/json-invalid.rs (renamed from src/test/ui/json-invalid.rs)0
-rw-r--r--src/test/ui/json/json-invalid.stderr (renamed from src/test/ui/json-invalid.stderr)0
-rw-r--r--src/test/ui/json/json-multiple.polonius.stderr (renamed from src/test/ui/json-multiple.polonius.stderr)0
-rw-r--r--src/test/ui/json/json-multiple.rs (renamed from src/test/ui/json-multiple.rs)0
-rw-r--r--src/test/ui/json/json-multiple.stderr1
-rw-r--r--src/test/ui/json/json-options.polonius.stderr (renamed from src/test/ui/json-options.polonius.stderr)0
-rw-r--r--src/test/ui/json/json-options.rs (renamed from src/test/ui/json-options.rs)0
-rw-r--r--src/test/ui/json/json-options.stderr1
-rw-r--r--src/test/ui/json/json-short.rs (renamed from src/test/ui/json-short.rs)0
-rw-r--r--src/test/ui/json/json-short.stderr (renamed from src/test/ui/json-short.stderr)0
-rw-r--r--src/test/ui/keyword/keyword-self-as-type-param.stderr4
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params-2.rs2
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params-2.stderr4
-rw-r--r--src/test/ui/kindck/kindck-impl-type-params.stderr12
-rw-r--r--src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr6
-rw-r--r--src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr6
-rw-r--r--src/test/ui/kindck/kindck-nonsendable-1.stderr10
-rw-r--r--src/test/ui/kindck/kindck-send-object.stderr12
-rw-r--r--src/test/ui/kindck/kindck-send-object1.stderr12
-rw-r--r--src/test/ui/kindck/kindck-send-object2.stderr12
-rw-r--r--src/test/ui/kindck/kindck-send-owned.stderr6
-rw-r--r--src/test/ui/label/label_break_value_continue.rs1
-rw-r--r--src/test/ui/label/label_break_value_continue.stderr6
-rw-r--r--src/test/ui/label/label_break_value_desugared_break.rs9
-rw-r--r--src/test/ui/label/label_break_value_illegal_uses.fixed1
-rw-r--r--src/test/ui/label/label_break_value_illegal_uses.rs1
-rw-r--r--src/test/ui/label/label_break_value_illegal_uses.stderr8
-rw-r--r--src/test/ui/label/label_break_value_unlabeled_break.rs1
-rw-r--r--src/test/ui/label/label_break_value_unlabeled_break.stderr4
-rw-r--r--src/test/ui/lang-items/issue-83471.stderr14
-rw-r--r--src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr4
-rw-r--r--src/test/ui/layout/zero-sized-array-enum-niche.stderr2
-rw-r--r--src/test/ui/lazy-type-alias-impl-trait/branches.stderr6
-rw-r--r--src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr12
-rw-r--r--src/test/ui/let-else/const-fn.rs18
-rw-r--r--src/test/ui/let-else/issue-100103.rs15
-rw-r--r--src/test/ui/let-else/issue-102317.rs20
-rw-r--r--src/test/ui/let-else/issue-94176.rs10
-rw-r--r--src/test/ui/let-else/issue-94176.stderr19
-rw-r--r--src/test/ui/let-else/issue-99975.rs20
-rw-r--r--src/test/ui/let-else/let-else-allow-in-expr.rs2
-rw-r--r--src/test/ui/let-else/let-else-allow-in-expr.stderr6
-rw-r--r--src/test/ui/let-else/let-else-allow-unused.rs2
-rw-r--r--src/test/ui/let-else/let-else-binding-explicit-mut-annotated.rs2
-rw-r--r--src/test/ui/let-else/let-else-binding-explicit-mut-borrow.rs4
-rw-r--r--src/test/ui/let-else/let-else-binding-explicit-mut-pass.rs2
-rw-r--r--src/test/ui/let-else/let-else-binding-explicit-mut.rs2
-rw-r--r--src/test/ui/let-else/let-else-binding-immutable.rs2
-rw-r--r--src/test/ui/let-else/let-else-bindings.rs2
-rw-r--r--src/test/ui/let-else/let-else-bool-binop-init.fixed2
-rw-r--r--src/test/ui/let-else/let-else-bool-binop-init.rs2
-rw-r--r--src/test/ui/let-else/let-else-brace-before-else.fixed2
-rw-r--r--src/test/ui/let-else/let-else-brace-before-else.rs2
-rw-r--r--src/test/ui/let-else/let-else-brace-before-else.stderr8
-rw-r--r--src/test/ui/let-else/let-else-check.rs2
-rw-r--r--src/test/ui/let-else/let-else-check.stderr6
-rw-r--r--src/test/ui/let-else/let-else-deref-coercion-annotated.rs2
-rw-r--r--src/test/ui/let-else/let-else-deref-coercion.rs2
-rw-r--r--src/test/ui/let-else/let-else-destructuring.rs1
-rw-r--r--src/test/ui/let-else/let-else-destructuring.stderr4
-rw-r--r--src/test/ui/let-else/let-else-drop-order.rs270
-rw-r--r--src/test/ui/let-else/let-else-drop-order.run.stdout51
-rw-r--r--src/test/ui/let-else/let-else-if.rs2
-rw-r--r--src/test/ui/let-else/let-else-if.stderr2
-rw-r--r--src/test/ui/let-else/let-else-irrefutable.rs2
-rw-r--r--src/test/ui/let-else/let-else-irrefutable.stderr2
-rw-r--r--src/test/ui/let-else/let-else-missing-semicolon.rs2
-rw-r--r--src/test/ui/let-else/let-else-missing-semicolon.stderr4
-rw-r--r--src/test/ui/let-else/let-else-no-double-error.rs2
-rw-r--r--src/test/ui/let-else/let-else-non-copy.rs2
-rw-r--r--src/test/ui/let-else/let-else-non-diverging.rs13
-rw-r--r--src/test/ui/let-else/let-else-non-diverging.stderr19
-rw-r--r--src/test/ui/let-else/let-else-ref-bindings-pass.rs2
-rw-r--r--src/test/ui/let-else/let-else-ref-bindings.rs2
-rw-r--r--src/test/ui/let-else/let-else-run-pass.rs2
-rw-r--r--src/test/ui/let-else/let-else-scope.rs2
-rw-r--r--src/test/ui/let-else/let-else-scope.stderr2
-rw-r--r--src/test/ui/let-else/let-else-slicing-error.rs2
-rw-r--r--src/test/ui/let-else/let-else-source-expr-nomove-pass.rs2
-rw-r--r--src/test/ui/let-else/let-else-temp-borrowck.rs2
-rw-r--r--src/test/ui/let-else/let-else-temporary-lifetime.rs13
-rw-r--r--src/test/ui/let-else/let-else-then-diverge.rs17
-rw-r--r--src/test/ui/let-else/let-else-then-diverge.stderr14
-rw-r--r--src/test/ui/let-else/let-else.rs8
-rw-r--r--src/test/ui/lexer/lex-emoji-identifiers.rs17
-rw-r--r--src/test/ui/lexer/lex-emoji-identifiers.stderr52
-rw-r--r--src/test/ui/lexical-scopes.stderr4
-rw-r--r--src/test/ui/lifetimes/elided-lifetime-in-param-pat.rs11
-rw-r--r--src/test/ui/lifetimes/fullwidth-ampersand.rs7
-rw-r--r--src/test/ui/lifetimes/fullwidth-ampersand.stderr26
-rw-r--r--src/test/ui/lifetimes/issue-26638.stderr2
-rw-r--r--src/test/ui/lifetimes/issue-79187-2.stderr2
-rw-r--r--src/test/ui/lifetimes/issue-79187.stderr2
-rw-r--r--src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs6
-rw-r--r--src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr14
-rw-r--r--src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr2
-rw-r--r--src/test/ui/lifetimes/missing-lifetime-in-alias.rs2
-rw-r--r--src/test/ui/lifetimes/missing-lifetime-in-alias.stderr10
-rw-r--r--src/test/ui/lifetimes/nested-binder-print.rs10
-rw-r--r--src/test/ui/lifetimes/nested-binder-print.stderr14
-rw-r--r--src/test/ui/lifetimes/re-empty-in-error.stderr2
-rw-r--r--src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.rs9
-rw-r--r--src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.stderr24
-rw-r--r--src/test/ui/lifetimes/unusual-rib-combinations.rs28
-rw-r--r--src/test/ui/lifetimes/unusual-rib-combinations.stderr61
-rw-r--r--src/test/ui/limits/issue-17913.rs6
-rw-r--r--src/test/ui/limits/issue-55878.stderr17
-rw-r--r--src/test/ui/linkage-attr/link-attr-validation-early.stderr6
-rw-r--r--src/test/ui/linkage-attr/link-attr-validation-late.stderr4
-rw-r--r--src/test/ui/lint/auxiliary/trivial-cast-ice.rs7
-rw-r--r--src/test/ui/lint/bare-trait-objects-path.stderr2
-rw-r--r--src/test/ui/lint/clashing-extern-fn.stderr6
-rw-r--r--src/test/ui/lint/cli-lint-override.forbid_warn.stderr2
-rw-r--r--src/test/ui/lint/cli-lint-override.force_warn_deny.stderr2
-rw-r--r--src/test/ui/lint/cli-lint-override.warn_deny.stderr2
-rw-r--r--src/test/ui/lint/dead-code/issue-85071-2.stderr10
-rw-r--r--src/test/ui/lint/dead-code/issue-85071.stderr10
-rw-r--r--src/test/ui/lint/dead-code/unused-variant.stderr2
-rw-r--r--src/test/ui/lint/deny-overflowing-literals.stderr2
-rw-r--r--src/test/ui/lint/expansion-time.stderr8
-rw-r--r--src/test/ui/lint/fn_must_use.stderr2
-rw-r--r--src/test/ui/lint/for_loop_over_fallibles.rs43
-rw-r--r--src/test/ui/lint/for_loop_over_fallibles.stderr101
-rw-r--r--src/test/ui/lint/forbid-group-group-2.stderr4
-rw-r--r--src/test/ui/lint/forbid-group-member.stderr2
-rw-r--r--src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs12
-rw-r--r--src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr23
-rw-r--r--src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs14
-rw-r--r--src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr23
-rw-r--r--src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr17
-rw-r--r--src/test/ui/lint/force-warn/cap-lints-allow.stderr17
-rw-r--r--src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr2
-rw-r--r--src/test/ui/lint/force-warn/deny-by-default-lint.rs12
-rw-r--r--src/test/ui/lint/force-warn/deny-by-default-lint.stderr23
-rw-r--r--src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr17
-rw-r--r--src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr17
-rw-r--r--src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr17
-rw-r--r--src/test/ui/lint/inclusive-range-pattern-syntax.stderr4
-rw-r--r--src/test/ui/lint/inert-attr-macro.stderr10
-rw-r--r--src/test/ui/lint/inline-trait-and-foreign-items.stderr6
-rw-r--r--src/test/ui/lint/invalid_value.rs (renamed from src/test/ui/lint/uninitialized-zeroed.rs)53
-rw-r--r--src/test/ui/lint/invalid_value.stderr (renamed from src/test/ui/lint/uninitialized-zeroed.stderr)280
-rw-r--r--src/test/ui/lint/issue-101284.rs15
-rw-r--r--src/test/ui/lint/issue-102705.rs22
-rw-r--r--src/test/ui/lint/issue-14309.stderr10
-rw-r--r--src/test/ui/lint/issue-1866.stderr4
-rw-r--r--src/test/ui/lint/issue-63364.stderr2
-rw-r--r--src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs2
-rw-r--r--src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr4
-rw-r--r--src/test/ui/lint/issue-79744.stderr2
-rw-r--r--src/test/ui/lint/issue-80988.stderr2
-rw-r--r--src/test/ui/lint/issue-83477.stderr2
-rw-r--r--src/test/ui/lint/issue-86600-lint-twice.stderr2
-rw-r--r--src/test/ui/lint/let_underscore/let_underscore_drop.rs14
-rw-r--r--src/test/ui/lint/let_underscore/let_underscore_drop.stderr22
-rw-r--r--src/test/ui/lint/let_underscore/let_underscore_lock.rs7
-rw-r--r--src/test/ui/lint/let_underscore/let_underscore_lock.stderr20
-rw-r--r--src/test/ui/lint/lint-attr-everywhere-early.rs176
-rw-r--r--src/test/ui/lint/lint-attr-everywhere-early.stderr486
-rw-r--r--src/test/ui/lint/lint-attr-everywhere-late.rs197
-rw-r--r--src/test/ui/lint/lint-attr-everywhere-late.stderr428
-rw-r--r--src/test/ui/lint/lint-const-item-mutation.stderr2
-rw-r--r--src/test/ui/lint/lint-ctypes-73249-2.stderr2
-rw-r--r--src/test/ui/lint/lint-ctypes-73249-3.stderr2
-rw-r--r--src/test/ui/lint/lint-ctypes-73249-5.stderr2
-rw-r--r--src/test/ui/lint/lint-ctypes-73251-1.stderr2
-rw-r--r--src/test/ui/lint/lint-ctypes-73251-2.stderr2
-rw-r--r--src/test/ui/lint/lint-ctypes-enum.stderr10
-rw-r--r--src/test/ui/lint/lint-ctypes-fn.stderr4
-rw-r--r--src/test/ui/lint/lint-ctypes.stderr10
-rw-r--r--src/test/ui/lint/lint-enum-intrinsics-non-enums.stderr2
-rw-r--r--src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr2
-rw-r--r--src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr2
-rw-r--r--src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr2
-rw-r--r--src/test/ui/lint/lint-exceeding-bitshifts.rs2
-rw-r--r--src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr44
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr2
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr2
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr2
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr2
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr2
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr2
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr2
-rw-r--r--src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr2
-rw-r--r--src/test/ui/lint/lint-non-snake-case-crate-2.stderr2
-rw-r--r--src/test/ui/lint/lint-output-format.rs1
-rw-r--r--src/test/ui/lint/lint-output-format.stderr12
-rw-r--r--src/test/ui/lint/lint-pre-expansion-extern-module.stderr2
-rw-r--r--src/test/ui/lint/lint-stability-deprecated.rs2
-rw-r--r--src/test/ui/lint/lint-strict-provenance-fuzzy-casts.stderr2
-rw-r--r--src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr2
-rw-r--r--src/test/ui/lint/lint-temporary-cstring-as-param.stderr4
-rw-r--r--src/test/ui/lint/lint-temporary-cstring-as-ptr.stderr4
-rw-r--r--src/test/ui/lint/lint-type-limits2.stderr4
-rw-r--r--src/test/ui/lint/lint-type-limits3.stderr4
-rw-r--r--src/test/ui/lint/lint-type-overflow.stderr2
-rw-r--r--src/test/ui/lint/lint-type-overflow2.rs1
-rw-r--r--src/test/ui/lint/lint-type-overflow2.stderr14
-rw-r--r--src/test/ui/lint/lint-unconditional-recursion.stderr2
-rw-r--r--src/test/ui/lint/lint-unsafe-code.stderr2
-rw-r--r--src/test/ui/lint/must_not_suspend/boxed.stderr10
-rw-r--r--src/test/ui/lint/must_not_suspend/dedup.stderr10
-rw-r--r--src/test/ui/lint/must_not_suspend/gated.stderr2
-rw-r--r--src/test/ui/lint/must_not_suspend/mutex.stderr10
-rw-r--r--src/test/ui/lint/must_not_suspend/ref-drop-tracking.rs30
-rw-r--r--src/test/ui/lint/must_not_suspend/ref-drop-tracking.stderr27
-rw-r--r--src/test/ui/lint/must_not_suspend/ref.drop_tracking.stderr27
-rw-r--r--src/test/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr (renamed from src/test/ui/lint/must_not_suspend/ref.stderr)16
-rw-r--r--src/test/ui/lint/must_not_suspend/ref.rs12
-rw-r--r--src/test/ui/lint/must_not_suspend/trait.stderr10
-rw-r--r--src/test/ui/lint/must_not_suspend/unit.stderr10
-rw-r--r--src/test/ui/lint/must_not_suspend/warn.stderr10
-rw-r--r--src/test/ui/lint/no-coverage.stderr2
-rw-r--r--src/test/ui/lint/noop-method-call.rs1
-rw-r--r--src/test/ui/lint/noop-method-call.stderr14
-rw-r--r--src/test/ui/lint/opaque-ty-ffi-unsafe.stderr2
-rw-r--r--src/test/ui/lint/outer-forbid.stderr4
-rw-r--r--src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr2
-rw-r--r--src/test/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr2
-rw-r--r--src/test/ui/lint/rfc-2383-lint-reason/expect_unfulfilled_expectation.stderr2
-rw-r--r--src/test/ui/lint/rfc-2383-lint-reason/expect_with_reason.stderr2
-rw-r--r--src/test/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr16
-rw-r--r--src/test/ui/lint/rfc-2383-lint-reason/lint-attribute-only-with-reason.stderr2
-rw-r--r--src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr4
-rw-r--r--src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr8
-rw-r--r--src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr2
-rw-r--r--src/test/ui/lint/trivial-cast-ice.rs12
-rw-r--r--src/test/ui/lint/trivial-casts-featuring-type-ascription.stderr4
-rw-r--r--src/test/ui/lint/trivial-casts.stderr4
-rw-r--r--src/test/ui/lint/trivial_casts.stderr4
-rw-r--r--src/test/ui/lint/type-overflow.stderr4
-rw-r--r--src/test/ui/lint/unaligned_references.stderr80
-rw-r--r--src/test/ui/lint/unaligned_references_external_macro.stderr16
-rw-r--r--src/test/ui/lint/unreachable_pub.stderr2
-rw-r--r--src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr2
-rw-r--r--src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr12
-rw-r--r--src/test/ui/lint/unused/lint-unused-variables.stderr28
-rw-r--r--src/test/ui/lint/unused/must-use-box-from-raw.stderr2
-rw-r--r--src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr2
-rw-r--r--src/test/ui/lint/unused/must_use-tuple.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-attr-duplicate.stderr10
-rw-r--r--src/test/ui/lint/unused/unused-closure.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-supertrait.rs11
-rw-r--r--src/test/ui/lint/unused/unused-supertrait.stderr15
-rw-r--r--src/test/ui/lint/unused/unused_attributes-must_use.rs6
-rw-r--r--src/test/ui/lint/unused/unused_attributes-must_use.stderr24
-rw-r--r--src/test/ui/lint/unused/useless-comment.stderr2
-rw-r--r--src/test/ui/lint/unused_labels.rs1
-rw-r--r--src/test/ui/lint/unused_labels.stderr20
-rw-r--r--src/test/ui/lint/unused_parens_multibyte_recovery.rs11
-rw-r--r--src/test/ui/lint/unused_parens_multibyte_recovery.stderr43
-rw-r--r--src/test/ui/liveness/liveness-asm.stderr2
-rw-r--r--src/test/ui/liveness/liveness-consts.stderr16
-rw-r--r--src/test/ui/liveness/liveness-dead.stderr2
-rw-r--r--src/test/ui/liveness/liveness-return-last-stmt-semi.rs1
-rw-r--r--src/test/ui/liveness/liveness-return-last-stmt-semi.stderr10
-rw-r--r--src/test/ui/liveness/liveness-unused.stderr2
-rw-r--r--src/test/ui/liveness/liveness-upvars.stderr4
-rw-r--r--src/test/ui/loops/loop-proper-liveness.stderr4
-rw-r--r--src/test/ui/lowering/issue-96847.rs14
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr2
-rw-r--r--src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr2
-rw-r--r--src/test/ui/macros/auxiliary/issue-100199.rs18
-rw-r--r--src/test/ui/macros/format-parse-errors.stderr2
-rw-r--r--src/test/ui/macros/issue-100199.rs16
-rw-r--r--src/test/ui/macros/issue-100199.stderr15
-rw-r--r--src/test/ui/macros/issue-102878.rs10
-rw-r--r--src/test/ui/macros/issue-102878.stderr60
-rw-r--r--src/test/ui/macros/issue-39404.stderr2
-rw-r--r--src/test/ui/macros/issue-84195-lint-anon-const.stderr4
-rw-r--r--src/test/ui/macros/issue-99265.stderr278
-rw-r--r--src/test/ui/macros/issue-99907.stderr4
-rw-r--r--src/test/ui/macros/lint-trailing-macro-call.stderr2
-rw-r--r--src/test/ui/macros/macro-comma-behavior-rpass.rs1
-rw-r--r--src/test/ui/macros/macro-context.stderr4
-rw-r--r--src/test/ui/macros/macro-in-expression-context.stderr2
-rw-r--r--src/test/ui/macros/macro-match-nonterminal.stderr2
-rw-r--r--src/test/ui/macros/macro-missing-fragment-deduplication.stderr2
-rw-r--r--src/test/ui/macros/macro-missing-fragment.stderr4
-rw-r--r--src/test/ui/macros/macro-or-patterns-back-compat.stderr4
-rw-r--r--src/test/ui/macros/macro-use-all-and-none.stderr2
-rw-r--r--src/test/ui/macros/macro_rules-unmatchable-literals.rs14
-rw-r--r--src/test/ui/macros/macro_rules-unmatchable-literals.stderr14
-rw-r--r--src/test/ui/macros/macros-nonfatal-errors.rs23
-rw-r--r--src/test/ui/macros/macros-nonfatal-errors.stderr12
-rw-r--r--src/test/ui/macros/must-use-in-macro-55516.stderr2
-rw-r--r--src/test/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs1
-rw-r--r--src/test/ui/macros/rfc-2011-nicer-assert-messages/all-not-available-cases.rs1
-rw-r--r--src/test/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs1
-rw-r--r--src/test/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr44
-rw-r--r--src/test/ui/macros/stringify.rs12
-rw-r--r--src/test/ui/macros/syntax-error-recovery.rs18
-rw-r--r--src/test/ui/macros/syntax-error-recovery.stderr30
-rw-r--r--src/test/ui/malformed/malformed-regressions.stderr6
-rw-r--r--src/test/ui/marker_trait_attr/overlap-doesnt-conflict-with-specialization.stderr2
-rw-r--r--src/test/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs10
-rw-r--r--src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.rs9
-rw-r--r--src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.stderr31
-rw-r--r--src/test/ui/marker_trait_attr/overlap-marker-trait.rs3
-rw-r--r--src/test/ui/marker_trait_attr/overlap-marker-trait.stderr4
-rw-r--r--src/test/ui/marker_trait_attr/overlap-permitted-for-annotated-marker-traits.rs3
-rw-r--r--src/test/ui/match/expr_before_ident_pat.rs2
-rw-r--r--src/test/ui/match/expr_before_ident_pat.stderr4
-rw-r--r--src/test/ui/match/issue-41255.rs1
-rw-r--r--src/test/ui/match/issue-41255.stderr30
-rw-r--r--src/test/ui/match/issue-42679.rs7
-rw-r--r--src/test/ui/match/issue-92100.rs2
-rw-r--r--src/test/ui/match/match_non_exhaustive.rs2
-rw-r--r--src/test/ui/match/match_non_exhaustive.stderr8
-rw-r--r--src/test/ui/methods/issues/issue-90315.rs79
-rw-r--r--src/test/ui/methods/issues/issue-90315.stderr198
-rw-r--r--src/test/ui/methods/method-call-err-msg.stderr16
-rw-r--r--src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr4
-rw-r--r--src/test/ui/methods/method-call-lifetime-args-lint.stderr4
-rw-r--r--src/test/ui/methods/method-call-lifetime-args-unresolved.stderr2
-rw-r--r--src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr2
-rw-r--r--src/test/ui/methods/method-macro-backtrace.stderr8
-rw-r--r--src/test/ui/methods/method-on-ambiguous-numeric-type.stderr8
-rw-r--r--src/test/ui/mir/drop-elaboration-after-borrowck-error.rs8
-rw-r--r--src/test/ui/mir/drop-elaboration-after-borrowck-error.stderr21
-rw-r--r--src/test/ui/mir/issue-100476-recursion-check-blewup.rs42
-rw-r--r--src/test/ui/mir/issue-101844.rs73
-rw-r--r--src/test/ui/mir/issue-102389.rs8
-rw-r--r--src/test/ui/mir/issue-102389.stderr9
-rw-r--r--src/test/ui/mir/issue-99852.rs24
-rw-r--r--src/test/ui/mir/issue-99866.rs25
-rw-r--r--src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs30
-rw-r--r--src/test/ui/mir/mir_calls_to_shims.rs1
-rw-r--r--src/test/ui/mir/mir_codegen_calls_diverging_drops.rs2
-rw-r--r--src/test/ui/mir/mir_drop_order.rs1
-rw-r--r--src/test/ui/mir/mir_drop_panics.rs1
-rw-r--r--src/test/ui/mir/mir_let_chains_drop_order.rs9
-rw-r--r--src/test/ui/mir/thir-constparam-temp.stderr2
-rw-r--r--src/test/ui/mismatched_types/E0409.stderr4
-rw-r--r--src/test/ui/mismatched_types/E0631.rs2
-rw-r--r--src/test/ui/mismatched_types/E0631.stderr8
-rw-r--r--src/test/ui/mismatched_types/closure-arg-count.rs2
-rw-r--r--src/test/ui/mismatched_types/closure-arg-count.stderr8
-rw-r--r--src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr2
-rw-r--r--src/test/ui/mismatched_types/closure-mismatch.stderr2
-rw-r--r--src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs23
-rw-r--r--src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr26
-rw-r--r--src/test/ui/mismatched_types/dont-point-return-on-E0308.rs18
-rw-r--r--src/test/ui/mismatched_types/dont-point-return-on-E0308.stderr19
-rw-r--r--src/test/ui/mismatched_types/fn-variance-1.stderr4
-rw-r--r--src/test/ui/mismatched_types/issue-19109.stderr2
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.stderr4
-rw-r--r--src/test/ui/mismatched_types/issue-84976.stderr5
-rw-r--r--src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr6
-rw-r--r--src/test/ui/mismatched_types/normalize-fn-sig.rs16
-rw-r--r--src/test/ui/mismatched_types/normalize-fn-sig.stderr19
-rw-r--r--src/test/ui/mismatched_types/overloaded-calls-bad.stderr4
-rw-r--r--src/test/ui/mismatched_types/show_module.rs18
-rw-r--r--src/test/ui/mismatched_types/show_module.stderr23
-rw-r--r--src/test/ui/mismatched_types/similar_paths.rs11
-rw-r--r--src/test/ui/mismatched_types/similar_paths.stderr23
-rw-r--r--src/test/ui/mismatched_types/similar_paths_primitive.rs10
-rw-r--r--src/test/ui/mismatched_types/similar_paths_primitive.stderr24
-rw-r--r--src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.fixed21
-rw-r--r--src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.rs21
-rw-r--r--src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.stderr49
-rw-r--r--src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed28
-rw-r--r--src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.rs28
-rw-r--r--src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr47
-rw-r--r--src/test/ui/modules/auxiliary/dummy_lib.rs2
-rw-r--r--src/test/ui/modules/special_module_name.rs8
-rw-r--r--src/test/ui/modules/special_module_name.stderr37
-rw-r--r--src/test/ui/modules/special_module_name_ignore.rs9
-rw-r--r--src/test/ui/moves/issue-72649-uninit-in-loop.stderr10
-rw-r--r--src/test/ui/moves/move-into-dead-array-1.stderr5
-rw-r--r--src/test/ui/moves/move-of-addr-of-mut.stderr4
-rw-r--r--src/test/ui/moves/move-out-of-array-ref.stderr4
-rw-r--r--src/test/ui/moves/move-out-of-slice-2.stderr10
-rw-r--r--src/test/ui/mutexguard-sync.stderr2
-rw-r--r--src/test/ui/namespace/namespace-mix.stderr8
-rw-r--r--src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr24
-rw-r--r--src/test/ui/namespace/namespaced-enum-glob-import-no-impls.stderr24
-rw-r--r--src/test/ui/native-library-link-flags/suggest-libname-only-1.rs9
-rw-r--r--src/test/ui/native-library-link-flags/suggest-libname-only-1.stderr6
-rw-r--r--src/test/ui/native-library-link-flags/suggest-libname-only-2.rs9
-rw-r--r--src/test/ui/native-library-link-flags/suggest-libname-only-2.stderr6
-rw-r--r--src/test/ui/nested-ty-params.stderr12
-rw-r--r--src/test/ui/never_type/defaulted-never-note.fallback.stderr6
-rw-r--r--src/test/ui/never_type/defaulted-never-note.rs1
-rw-r--r--src/test/ui/never_type/diverging-fallback-no-leak.fallback.stderr6
-rw-r--r--src/test/ui/never_type/fallback-closure-wrap.fallback.stderr2
-rw-r--r--src/test/ui/never_type/fallback-closure-wrap.rs4
-rw-r--r--src/test/ui/never_type/feature-gate-never_type_fallback.stderr8
-rw-r--r--src/test/ui/never_type/issue-52443.rs4
-rw-r--r--src/test/ui/never_type/issue-52443.stderr4
-rw-r--r--src/test/ui/never_type/issue-5500-1.rs (renamed from src/test/ui/issues/issue-5500-1.rs)0
-rw-r--r--src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr6
-rw-r--r--src/test/ui/nll/closure-malformed-projection-input-issue-102800.rs31
-rw-r--r--src/test/ui/nll/closure-malformed-projection-input-issue-102800.stderr104
-rw-r--r--src/test/ui/nll/closure-requirements/escape-argument-callee.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/escape-argument.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr10
-rw-r--r--src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr10
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr24
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr14
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr14
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr12
-rw-r--r--src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr6
-rw-r--r--src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr9
-rw-r--r--src/test/ui/nll/closures-in-loops.stderr16
-rw-r--r--src/test/ui/nll/issue-21232-partial-init-and-use.rs2
-rw-r--r--src/test/ui/nll/issue-48623-generator.stderr2
-rw-r--r--src/test/ui/nll/issue-51191.stderr2
-rw-r--r--src/test/ui/nll/issue-51244.stderr2
-rw-r--r--src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr10
-rw-r--r--src/test/ui/nll/issue-97997.stderr4
-rw-r--r--src/test/ui/nll/local-outlives-static-via-hrtb.stderr12
-rw-r--r--src/test/ui/nll/match-cfg-fake-edges.stderr5
-rw-r--r--src/test/ui/nll/match-on-borrowed.stderr5
-rw-r--r--src/test/ui/nll/normalization-bounds-error.stderr8
-rw-r--r--src/test/ui/nll/polonius/assignment-kills-loans.rs2
-rw-r--r--src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs1
-rw-r--r--src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr15
-rw-r--r--src/test/ui/nll/relate_tys/universe-violation.stderr2
-rw-r--r--src/test/ui/nll/trait-associated-constant.stderr2
-rw-r--r--src/test/ui/nll/ty-outlives/impl-trait-captures.stderr8
-rw-r--r--src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr22
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr22
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr27
-rw-r--r--src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr26
-rw-r--r--src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr43
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr18
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr6
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr27
-rw-r--r--src/test/ui/nll/type-test-universe.stderr6
-rw-r--r--src/test/ui/nll/user-annotations/adt-nullary-enums.stderr5
-rw-r--r--src/test/ui/nll/user-annotations/adt-tuple-struct-calls.stderr10
-rw-r--r--src/test/ui/nll/user-annotations/fns.stderr6
-rw-r--r--src/test/ui/nll/user-annotations/method-call.stderr5
-rw-r--r--src/test/ui/nll/user-annotations/method-ufcs-3.stderr5
-rw-r--r--src/test/ui/no-patterns-in-args-2.stderr4
-rw-r--r--src/test/ui/no-send-res-ports.stderr17
-rw-r--r--src/test/ui/non-fmt-panic.stderr2
-rw-r--r--src/test/ui/not-clone-closure.stderr6
-rw-r--r--src/test/ui/not-enough-arguments.stderr4
-rw-r--r--src/test/ui/not-panic/not-panic-safe-2.stderr12
-rw-r--r--src/test/ui/not-panic/not-panic-safe-3.stderr12
-rw-r--r--src/test/ui/not-panic/not-panic-safe-4.stderr12
-rw-r--r--src/test/ui/not-panic/not-panic-safe-5.stderr6
-rw-r--r--src/test/ui/not-panic/not-panic-safe-6.stderr12
-rw-r--r--src/test/ui/numbers-arithmetic/float-int-invalid-const-cast.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/issue-8460-const.noopt.stderr48
-rw-r--r--src/test/ui/numbers-arithmetic/issue-8460-const.opt.stderr48
-rw-r--r--src/test/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr48
-rw-r--r--src/test/ui/numbers-arithmetic/issue-8460-const.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs1
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs2
-rw-r--r--src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr2
-rw-r--r--src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs1
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default.rs44
-rw-r--r--src/test/ui/object-lifetime/object-lifetime-default.stderr60
-rw-r--r--src/test/ui/object-safety/issue-102762.rs26
-rw-r--r--src/test/ui/object-safety/issue-102762.stderr20
-rw-r--r--src/test/ui/object-safety/issue-102933.rs25
-rw-r--r--src/test/ui/object-safety/issue-19538.stderr2
-rw-r--r--src/test/ui/object-safety/object-safety-associated-consts.curr.stderr4
-rw-r--r--src/test/ui/object-safety/object-safety-associated-consts.object_safe_for_dispatch.stderr2
-rw-r--r--src/test/ui/object-safety/object-safety-bounds.stderr4
-rw-r--r--src/test/ui/object-safety/object-safety-generics.curr.stderr8
-rw-r--r--src/test/ui/object-safety/object-safety-generics.object_safe_for_dispatch.stderr4
-rw-r--r--src/test/ui/object-safety/object-safety-mentions-Self.curr.stderr8
-rw-r--r--src/test/ui/object-safety/object-safety-mentions-Self.object_safe_for_dispatch.stderr4
-rw-r--r--src/test/ui/object-safety/object-safety-no-static.curr.stderr4
-rw-r--r--src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr2
-rw-r--r--src/test/ui/object-safety/object-safety-sized-2.curr.stderr4
-rw-r--r--src/test/ui/object-safety/object-safety-sized-2.object_safe_for_dispatch.stderr2
-rw-r--r--src/test/ui/object-safety/object-safety-sized.curr.stderr4
-rw-r--r--src/test/ui/object-safety/object-safety-sized.object_safe_for_dispatch.stderr2
-rw-r--r--src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs15
-rw-r--r--src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr43
-rw-r--r--src/test/ui/on-unimplemented/enclosing-scope.rs27
-rw-r--r--src/test/ui/on-unimplemented/enclosing-scope.stderr86
-rw-r--r--src/test/ui/on-unimplemented/multiple-impls.rs3
-rw-r--r--src/test/ui/on-unimplemented/multiple-impls.stderr51
-rw-r--r--src/test/ui/on-unimplemented/on-impl.rs1
-rw-r--r--src/test/ui/on-unimplemented/on-impl.stderr15
-rw-r--r--src/test/ui/on-unimplemented/parent-label.rs27
-rw-r--r--src/test/ui/on-unimplemented/parent-label.stderr69
-rw-r--r--src/test/ui/on-unimplemented/slice-index.stderr4
-rw-r--r--src/test/ui/oom_unwind.rs2
-rw-r--r--src/test/ui/opt-in-copy.stderr8
-rw-r--r--src/test/ui/or-patterns/inner-or-pat.or3.stderr11
-rw-r--r--src/test/ui/or-patterns/inner-or-pat.or4.stderr11
-rw-r--r--src/test/ui/or-patterns/inner-or-pat.rs73
-rw-r--r--src/test/ui/or-patterns/or-patterns-syntactic-pass.rs16
-rw-r--r--src/test/ui/or-patterns/or-patterns-syntactic-pass.stderr13
-rw-r--r--src/test/ui/packed/issue-27060-rpass.stderr32
-rw-r--r--src/test/ui/packed/issue-27060.stderr10
-rw-r--r--src/test/ui/packed/packed-struct-borrow-element-64bit.stderr16
-rw-r--r--src/test/ui/packed/packed-struct-borrow-element.stderr24
-rw-r--r--src/test/ui/panic-handler/weak-lang-item.rs2
-rw-r--r--src/test/ui/panic-runtime/need-abort-got-unwind.rs1
-rw-r--r--src/test/ui/panic-runtime/transitive-link-a-bunch.rs1
-rw-r--r--src/test/ui/panic-runtime/want-unwind-got-abort.rs1
-rw-r--r--src/test/ui/panic-runtime/want-unwind-got-abort2.rs1
-rw-r--r--src/test/ui/panic-while-printing.rs1
-rw-r--r--src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr2
-rw-r--r--src/test/ui/panics/issue-47429-short-backtraces.rs1
-rw-r--r--src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr2
-rw-r--r--src/test/ui/panics/runtime-switch.legacy.run.stderr2
-rw-r--r--src/test/ui/panics/runtime-switch.rs1
-rw-r--r--src/test/ui/panics/runtime-switch.v0.run.stderr2
-rw-r--r--src/test/ui/parser/assoc-static-semantic-fail.stderr2
-rw-r--r--src/test/ui/parser/attr-stmt-expr-attr-bad.rs2
-rw-r--r--src/test/ui/parser/attr-stmt-expr-attr-bad.stderr106
-rw-r--r--src/test/ui/parser/bad-interpolated-block.rs2
-rw-r--r--src/test/ui/parser/bad-interpolated-block.stderr6
-rw-r--r--src/test/ui/parser/bad-let-as-field.rs6
-rw-r--r--src/test/ui/parser/bad-let-as-field.stderr15
-rw-r--r--src/test/ui/parser/bad-lit-suffixes.rs16
-rw-r--r--src/test/ui/parser/bad-lit-suffixes.stderr16
-rw-r--r--src/test/ui/parser/bad-pointer-type.rs2
-rw-r--r--src/test/ui/parser/bad-pointer-type.stderr11
-rw-r--r--src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs4
-rw-r--r--src/test/ui/parser/constraints-before-generic-args-syntactic-pass.stderr24
-rw-r--r--src/test/ui/parser/default.stderr2
-rw-r--r--src/test/ui/parser/do-not-suggest-semicolon-before-array.rs8
-rw-r--r--src/test/ui/parser/do-not-suggest-semicolon-before-array.stderr10
-rw-r--r--src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.rs3
-rw-r--r--src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.stderr8
-rw-r--r--src/test/ui/parser/doc-after-struct-field.rs4
-rw-r--r--src/test/ui/parser/doc-after-struct-field.stderr4
-rw-r--r--src/test/ui/parser/doc-before-extern-rbrace.stderr2
-rw-r--r--src/test/ui/parser/doc-before-fn-rbrace.rs2
-rw-r--r--src/test/ui/parser/doc-before-fn-rbrace.stderr2
-rw-r--r--src/test/ui/parser/doc-before-rbrace.rs2
-rw-r--r--src/test/ui/parser/doc-before-rbrace.stderr2
-rw-r--r--src/test/ui/parser/doc-before-semi.rs2
-rw-r--r--src/test/ui/parser/doc-before-semi.stderr2
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-1.rs2
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-1.stderr5
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-2.rs2
-rw-r--r--src/test/ui/parser/doc-before-struct-rbrace-2.stderr2
-rw-r--r--src/test/ui/parser/doc-inside-trait-item.stderr2
-rw-r--r--src/test/ui/parser/double-pointer.rs7
-rw-r--r--src/test/ui/parser/double-pointer.stderr15
-rw-r--r--src/test/ui/parser/emoji-identifiers.stderr18
-rw-r--r--src/test/ui/parser/empty-impl-semicolon.rs5
-rw-r--r--src/test/ui/parser/empty-impl-semicolon.stderr8
-rw-r--r--src/test/ui/parser/expr-as-stmt-2.stderr5
-rw-r--r--src/test/ui/parser/expr-as-stmt.stderr9
-rw-r--r--src/test/ui/parser/fn-defined-using-def.rs10
-rw-r--r--src/test/ui/parser/fn-defined-using-def.stderr10
-rw-r--r--src/test/ui/parser/fn-defined-using-fun.rs10
-rw-r--r--src/test/ui/parser/fn-defined-using-fun.stderr10
-rw-r--r--src/test/ui/parser/fn-defined-using-func.rs10
-rw-r--r--src/test/ui/parser/fn-defined-using-func.stderr10
-rw-r--r--src/test/ui/parser/fn-defined-using-function.rs10
-rw-r--r--src/test/ui/parser/fn-defined-using-function.stderr10
-rw-r--r--src/test/ui/parser/fn-field-parse-error-ice.rs2
-rw-r--r--src/test/ui/parser/fn-field-parse-error-ice.stderr12
-rw-r--r--src/test/ui/parser/fn-header-semantic-fail.rs2
-rw-r--r--src/test/ui/parser/fn-header-semantic-fail.stderr188
-rw-r--r--src/test/ui/parser/impl-item-type-no-body-semantic-fail.rs2
-rw-r--r--src/test/ui/parser/impl-item-type-no-body-semantic-fail.stderr20
-rw-r--r--src/test/ui/parser/increment-notfixed.stderr30
-rw-r--r--src/test/ui/parser/inner-attr-after-doc-comment.stderr2
-rw-r--r--src/test/ui/parser/issue-100197-mut-let.fixed6
-rw-r--r--src/test/ui/parser/issue-100197-mut-let.rs6
-rw-r--r--src/test/ui/parser/issue-100197-mut-let.stderr8
-rw-r--r--src/test/ui/parser/issue-101477-enum.fixed10
-rw-r--r--src/test/ui/parser/issue-101477-enum.rs10
-rw-r--r--src/test/ui/parser/issue-101477-enum.stderr14
-rw-r--r--src/test/ui/parser/issue-101477-let.fixed6
-rw-r--r--src/test/ui/parser/issue-101477-let.rs6
-rw-r--r--src/test/ui/parser/issue-101477-let.stderr8
-rw-r--r--src/test/ui/parser/issue-103143.rs5
-rw-r--r--src/test/ui/parser/issue-103143.stderr20
-rw-r--r--src/test/ui/parser/issue-103425.rs15
-rw-r--r--src/test/ui/parser/issue-103425.stderr29
-rw-r--r--src/test/ui/parser/issue-17718-parse-const.rs (renamed from src/test/ui/issues/issue-17718-parse-const.rs)0
-rw-r--r--src/test/ui/parser/issue-99910-const-let-mutually-exclusive.fixed8
-rw-r--r--src/test/ui/parser/issue-99910-const-let-mutually-exclusive.rs8
-rw-r--r--src/test/ui/parser/issue-99910-const-let-mutually-exclusive.stderr14
-rw-r--r--src/test/ui/parser/issues/issue-101540.rs7
-rw-r--r--src/test/ui/parser/issues/issue-101540.stderr12
-rw-r--r--src/test/ui/parser/issues/issue-102182-impl-trait-recover.rs3
-rw-r--r--src/test/ui/parser/issues/issue-102182-impl-trait-recover.stderr14
-rw-r--r--src/test/ui/parser/issues/issue-14303-enum.rs6
-rw-r--r--src/test/ui/parser/issues/issue-14303-enum.stderr8
-rw-r--r--src/test/ui/parser/issues/issue-14303-fn-def.rs4
-rw-r--r--src/test/ui/parser/issues/issue-14303-fn-def.stderr8
-rw-r--r--src/test/ui/parser/issues/issue-14303-impl.rs6
-rw-r--r--src/test/ui/parser/issues/issue-14303-impl.stderr8
-rw-r--r--src/test/ui/parser/issues/issue-14303-path.rs13
-rw-r--r--src/test/ui/parser/issues/issue-14303-path.stderr9
-rw-r--r--src/test/ui/parser/issues/issue-14303-struct.rs6
-rw-r--r--src/test/ui/parser/issues/issue-14303-struct.stderr8
-rw-r--r--src/test/ui/parser/issues/issue-14303-trait.rs4
-rw-r--r--src/test/ui/parser/issues/issue-14303-trait.stderr8
-rw-r--r--src/test/ui/parser/issues/issue-14303.rs33
-rw-r--r--src/test/ui/parser/issues/issue-14303.stderr39
-rw-r--r--src/test/ui/parser/issues/issue-17383.rs7
-rw-r--r--src/test/ui/parser/issues/issue-17383.stderr15
-rw-r--r--src/test/ui/parser/issues/issue-34222-1.stderr2
-rw-r--r--src/test/ui/parser/issues/issue-48636.stderr4
-rw-r--r--src/test/ui/parser/issues/issue-63115-range-pat-interpolated.rs1
-rw-r--r--src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr4
-rw-r--r--src/test/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr2
-rw-r--r--src/test/ui/parser/issues/issue-8537.stderr2
-rw-r--r--src/test/ui/parser/issues/issue-89574.stderr4
-rw-r--r--src/test/ui/parser/issues/issue-93282.rs1
-rw-r--r--src/test/ui/parser/issues/issue-93282.stderr27
-rw-r--r--src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr4
-rw-r--r--src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr8
-rw-r--r--src/test/ui/parser/item-needs-block.rs10
-rw-r--r--src/test/ui/parser/item-needs-block.stderr26
-rw-r--r--src/test/ui/parser/kw-in-trait-bounds.rs47
-rw-r--r--src/test/ui/parser/kw-in-trait-bounds.stderr171
-rw-r--r--src/test/ui/parser/label-after-block-like.rs43
-rw-r--r--src/test/ui/parser/label-after-block-like.stderr176
-rw-r--r--src/test/ui/parser/label-is-actually-char.rs16
-rw-r--r--src/test/ui/parser/label-is-actually-char.stderr46
-rw-r--r--src/test/ui/parser/labeled-no-colon-expr.rs2
-rw-r--r--src/test/ui/parser/labeled-no-colon-expr.stderr16
-rw-r--r--src/test/ui/parser/macro/issue-33569.stderr2
-rw-r--r--src/test/ui/parser/macro/issue-37113.stderr2
-rw-r--r--src/test/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr3
-rw-r--r--src/test/ui/parser/missing-closing-angle-bracket-struct-field-ty.stderr3
-rw-r--r--src/test/ui/parser/numeric-lifetime.stderr16
-rw-r--r--src/test/ui/parser/parser-recovery-1.stderr12
-rw-r--r--src/test/ui/parser/parser-recovery-2.stderr12
-rw-r--r--src/test/ui/parser/public-instead-of-pub-1.fixed11
-rw-r--r--src/test/ui/parser/public-instead-of-pub-1.rs11
-rw-r--r--src/test/ui/parser/public-instead-of-pub-1.stderr13
-rw-r--r--src/test/ui/parser/public-instead-of-pub-2.rs7
-rw-r--r--src/test/ui/parser/public-instead-of-pub-2.stderr8
-rw-r--r--src/test/ui/parser/public-instead-of-pub-3.fixed9
-rw-r--r--src/test/ui/parser/public-instead-of-pub-3.rs9
-rw-r--r--src/test/ui/parser/public-instead-of-pub-3.stderr13
-rw-r--r--src/test/ui/parser/recover-enum2.stderr2
-rw-r--r--src/test/ui/parser/recover-field-semi.rs16
-rw-r--r--src/test/ui/parser/recover-field-semi.stderr35
-rw-r--r--src/test/ui/parser/recover-labeled-non-block-expr.fixed1
-rw-r--r--src/test/ui/parser/recover-labeled-non-block-expr.rs1
-rw-r--r--src/test/ui/parser/recover-labeled-non-block-expr.stderr12
-rw-r--r--src/test/ui/parser/recover-missing-semi-before-item.fixed61
-rw-r--r--src/test/ui/parser/recover-missing-semi-before-item.rs61
-rw-r--r--src/test/ui/parser/recover-missing-semi-before-item.stderr83
-rw-r--r--src/test/ui/parser/recover-range-pats.rs1
-rw-r--r--src/test/ui/parser/recover-range-pats.stderr126
-rw-r--r--src/test/ui/parser/recover-struct.stderr2
-rw-r--r--src/test/ui/parser/recovered-struct-variant.stderr4
-rw-r--r--src/test/ui/parser/removed-syntax-enum-newtype.stderr4
-rw-r--r--src/test/ui/parser/removed-syntax-field-let-2.rs12
-rw-r--r--src/test/ui/parser/removed-syntax-field-let-2.stderr33
-rw-r--r--src/test/ui/parser/removed-syntax-field-let.stderr8
-rw-r--r--src/test/ui/parser/removed-syntax-field-semicolon.rs2
-rw-r--r--src/test/ui/parser/removed-syntax-field-semicolon.stderr6
-rw-r--r--src/test/ui/parser/removed-syntax-static-fn.stderr4
-rw-r--r--src/test/ui/parser/require-parens-for-chained-comparison.rs2
-rw-r--r--src/test/ui/parser/require-parens-for-chained-comparison.stderr16
-rw-r--r--src/test/ui/parser/semi-after-closure-in-macro.rs14
-rw-r--r--src/test/ui/parser/struct-filed-with-attr.fixed18
-rw-r--r--src/test/ui/parser/struct-filed-with-attr.rs18
-rw-r--r--src/test/ui/parser/struct-filed-with-attr.stderr8
-rw-r--r--src/test/ui/parser/struct-literal-in-for.stderr2
-rw-r--r--src/test/ui/parser/suggest-assoc-const.fixed10
-rw-r--r--src/test/ui/parser/suggest-assoc-const.rs10
-rw-r--r--src/test/ui/parser/suggest-assoc-const.stderr8
-rw-r--r--src/test/ui/parser/suggest-const-for-global-var.rs6
-rw-r--r--src/test/ui/parser/suggest-const-for-global-var.stderr8
-rw-r--r--src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.fixed7
-rw-r--r--src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.rs7
-rw-r--r--src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr15
-rw-r--r--src/test/ui/parser/suggest-semicolon-before-array.fixed11
-rw-r--r--src/test/ui/parser/suggest-semicolon-before-array.rs11
-rw-r--r--src/test/ui/parser/suggest-semicolon-before-array.stderr13
-rw-r--r--src/test/ui/parser/tag-variant-disr-non-nullary.rs12
-rw-r--r--src/test/ui/parser/tag-variant-disr-non-nullary.stderr25
-rw-r--r--src/test/ui/parser/trait-item-with-defaultness-fail-semantic.stderr2
-rw-r--r--src/test/ui/parser/trait-object-delimiters.rs2
-rw-r--r--src/test/ui/parser/trait-object-delimiters.stderr4
-rw-r--r--src/test/ui/parser/trait-object-trait-parens.stderr17
-rw-r--r--src/test/ui/parser/type-alias-where-fixable.fixed2
-rw-r--r--src/test/ui/parser/type-alias-where-fixable.rs2
-rw-r--r--src/test/ui/parser/type-alias-where-fixable.stderr8
-rw-r--r--src/test/ui/parser/type-alias-where.rs2
-rw-r--r--src/test/ui/parser/type-alias-where.stderr4
-rw-r--r--src/test/ui/parser/unicode-control-codepoints.stderr4
-rw-r--r--src/test/ui/parser/unmatched-langle-1.stderr12
-rw-r--r--src/test/ui/parser/unnecessary-let.rs11
-rw-r--r--src/test/ui/parser/unnecessary-let.stderr20
-rw-r--r--src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr10
-rw-r--r--src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr5
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr37
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr30
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr40
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr52
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr45
-rw-r--r--src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr35
-rw-r--r--src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr5
-rw-r--r--src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr2
-rw-r--r--src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr2
-rw-r--r--src/test/ui/pattern/issue-17718-patterns.rs (renamed from src/test/ui/issues/issue-17718-patterns.rs)0
-rw-r--r--src/test/ui/pattern/issue-17718-patterns.stderr (renamed from src/test/ui/issues/issue-17718-patterns.stderr)0
-rw-r--r--src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr2
-rw-r--r--src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr6
-rw-r--r--src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr30
-rw-r--r--src/test/ui/pattern/rest-pat-semantic-disallowed.rs2
-rw-r--r--src/test/ui/pattern/rest-pat-syntactic.rs5
-rw-r--r--src/test/ui/pattern/rest-pat-syntactic.stderr24
-rw-r--r--src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed10
-rw-r--r--src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs9
-rw-r--r--src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr24
-rw-r--r--src/test/ui/pattern/usefulness/consts-opaque.stderr2
-rw-r--r--src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr4
-rw-r--r--src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs8
-rw-r--r--src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr24
-rw-r--r--src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr28
-rw-r--r--src/test/ui/pattern/usefulness/empty-match.normal.stderr28
-rw-r--r--src/test/ui/pattern/usefulness/empty-match.rs12
-rw-r--r--src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr2
-rw-r--r--src/test/ui/pattern/usefulness/issue-15129.rs2
-rw-r--r--src/test/ui/pattern/usefulness/issue-15129.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/issue-31561.rs2
-rw-r--r--src/test/ui/pattern/usefulness/issue-31561.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/issue-35609.stderr32
-rw-r--r--src/test/ui/pattern/usefulness/issue-39362.stderr4
-rw-r--r--src/test/ui/pattern/usefulness/issue-40221.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/issue-50900.rs2
-rw-r--r--src/test/ui/pattern/usefulness/issue-50900.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/issue-56379.rs2
-rw-r--r--src/test/ui/pattern/usefulness/issue-56379.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/issue-72377.rs2
-rw-r--r--src/test/ui/pattern/usefulness/issue-72377.stderr4
-rw-r--r--src/test/ui/pattern/usefulness/match-arm-statics-2.rs4
-rw-r--r--src/test/ui/pattern/usefulness/match-arm-statics-2.stderr12
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-defined-here.rs32
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr42
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs2
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-match.rs6
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-match.stderr20
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs10
-rw-r--r--src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr28
-rw-r--r--src/test/ui/pattern/usefulness/stable-gated-patterns.rs2
-rw-r--r--src/test/ui/pattern/usefulness/stable-gated-patterns.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr6
-rw-r--r--src/test/ui/pattern/usefulness/top-level-alternation.rs2
-rw-r--r--src/test/ui/pattern/usefulness/top-level-alternation.stderr24
-rw-r--r--src/test/ui/pattern/usefulness/unstable-gated-patterns.rs2
-rw-r--r--src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr6
-rw-r--r--src/test/ui/phantom-auto-trait.stderr4
-rw-r--r--src/test/ui/polymorphization/const_parameters/closures.stderr2
-rw-r--r--src/test/ui/polymorphization/const_parameters/functions.stderr2
-rw-r--r--src/test/ui/polymorphization/generators.stderr2
-rw-r--r--src/test/ui/polymorphization/predicates.stderr2
-rw-r--r--src/test/ui/polymorphization/promoted-function-2.stderr2
-rw-r--r--src/test/ui/privacy/associated-item-privacy-inherent.rs6
-rw-r--r--src/test/ui/privacy/associated-item-privacy-inherent.stderr6
-rw-r--r--src/test/ui/privacy/associated-item-privacy-trait.rs6
-rw-r--r--src/test/ui/privacy/associated-item-privacy-trait.stderr6
-rw-r--r--src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs (renamed from src/test/ui/issues/auxiliary/issue-17718-const-privacy.rs)0
-rw-r--r--src/test/ui/privacy/effective_visibilities.rs75
-rw-r--r--src/test/ui/privacy/effective_visibilities.stderr134
-rw-r--r--src/test/ui/privacy/issue-17718-const-privacy.rs (renamed from src/test/ui/issues/issue-17718-const-privacy.rs)0
-rw-r--r--src/test/ui/privacy/issue-17718-const-privacy.stderr (renamed from src/test/ui/issues/issue-17718-const-privacy.stderr)0
-rw-r--r--src/test/ui/privacy/issue-30079.stderr2
-rw-r--r--src/test/ui/privacy/private-in-public-assoc-ty.stderr2
-rw-r--r--src/test/ui/privacy/private-in-public-non-principal.stderr2
-rw-r--r--src/test/ui/privacy/private-in-public-warn.stderr4
-rw-r--r--src/test/ui/privacy/private-inferred-type-3.rs2
-rw-r--r--src/test/ui/privacy/private-inferred-type-3.stderr2
-rw-r--r--src/test/ui/privacy/private-inferred-type.rs2
-rw-r--r--src/test/ui/privacy/private-inferred-type.stderr2
-rw-r--r--src/test/ui/privacy/reachable-unnameable-items.rs1
-rw-r--r--src/test/ui/privacy/where-priv-type.stderr2
-rw-r--r--src/test/ui/proc-macro/attr-complex-fn.stdout4
-rw-r--r--src/test/ui/proc-macro/auxiliary/expand-expr.rs23
-rw-r--r--src/test/ui/proc-macro/auxiliary/re-export.rs19
-rw-r--r--src/test/ui/proc-macro/call-deprecated.rs2
-rw-r--r--src/test/ui/proc-macro/capture-macro-rules-invoke.stdout12
-rw-r--r--src/test/ui/proc-macro/crt-static.rs2
-rw-r--r--src/test/ui/proc-macro/debug/dump-debug-span-debug.rs7
-rw-r--r--src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr127
-rw-r--r--src/test/ui/proc-macro/debug/dump-debug.stderr6
-rw-r--r--src/test/ui/proc-macro/derive-bad.stderr5
-rw-r--r--src/test/ui/proc-macro/derive-helper-shadowing.stderr2
-rw-r--r--src/test/ui/proc-macro/dollar-crate-issue-101211.rs29
-rw-r--r--src/test/ui/proc-macro/dollar-crate-issue-57089.stdout8
-rw-r--r--src/test/ui/proc-macro/dollar-crate-issue-62325.stdout8
-rw-r--r--src/test/ui/proc-macro/dollar-crate.stdout24
-rw-r--r--src/test/ui/proc-macro/expand-to-unstable-2.rs17
-rw-r--r--src/test/ui/proc-macro/expand-to-unstable-2.stderr10
-rw-r--r--src/test/ui/proc-macro/expand-with-a-macro.rs1
-rw-r--r--src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr4
-rw-r--r--src/test/ui/proc-macro/generate-mod.stderr18
-rw-r--r--src/test/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr2
-rw-r--r--src/test/ui/proc-macro/inner-attr-non-inline-mod.stderr2
-rw-r--r--src/test/ui/proc-macro/inner-attrs.rs1
-rw-r--r--src/test/ui/proc-macro/inner-attrs.stderr8
-rw-r--r--src/test/ui/proc-macro/inner-attrs.stdout356
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-1.rs1
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-1.stderr2
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-2.rs1
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-2.stderr2
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-3.rs1
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-3.stderr2
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-4.rs1
-rw-r--r--src/test/ui/proc-macro/invalid-punct-ident-4.stderr6
-rw-r--r--src/test/ui/proc-macro/issue-36935.rs1
-rw-r--r--src/test/ui/proc-macro/issue-36935.stderr4
-rw-r--r--src/test/ui/proc-macro/issue-41211.rs16
-rw-r--r--src/test/ui/proc-macro/issue-41211.stderr22
-rw-r--r--src/test/ui/proc-macro/issue-73933-procedural-masquerade.rs9
-rw-r--r--src/test/ui/proc-macro/issue-73933-procedural-masquerade.stderr91
-rw-r--r--src/test/ui/proc-macro/issue-73933-procedural-masquerade.stdout11
-rw-r--r--src/test/ui/proc-macro/issue-75930-derive-cfg.stderr2
-rw-r--r--src/test/ui/proc-macro/issue-75930-derive-cfg.stdout20
-rw-r--r--src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout4
-rw-r--r--src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs1
-rw-r--r--src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr2
-rw-r--r--src/test/ui/proc-macro/issue-79148.rs10
-rw-r--r--src/test/ui/proc-macro/issue-79148.stderr16
-rw-r--r--src/test/ui/proc-macro/keep-expr-tokens.stderr12
-rw-r--r--src/test/ui/proc-macro/load-panic-backtrace.rs1
-rw-r--r--src/test/ui/proc-macro/load-panic-backtrace.stderr2
-rw-r--r--src/test/ui/proc-macro/load-panic.rs1
-rw-r--r--src/test/ui/proc-macro/load-panic.stderr2
-rw-r--r--src/test/ui/proc-macro/meta-macro-hygiene.rs4
-rw-r--r--src/test/ui/proc-macro/meta-macro-hygiene.stdout6
-rw-r--r--src/test/ui/proc-macro/mixed-site-span.stderr4
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack-hide.rs12
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack-hide.stdout21
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack-show.rs17
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack-show.stderr179
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack-show.stdout44
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs14
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs14
-rw-r--r--src/test/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs14
-rw-r--r--src/test/ui/proc-macro/proc-macro-attributes.stderr2
-rw-r--r--src/test/ui/proc-macro/proc-macro-gates.stderr2
-rw-r--r--src/test/ui/proc-macro/signature.stderr7
-rw-r--r--src/test/ui/proc-macro/three-equals.stderr6
-rw-r--r--src/test/ui/process/core-run-destroy.rs1
-rw-r--r--src/test/ui/process/process-envs.rs1
-rw-r--r--src/test/ui/process/process-panic-after-fork.rs45
-rw-r--r--src/test/ui/process/process-remove-from-env.rs1
-rw-r--r--src/test/ui/process/process-sigpipe.rs1
-rw-r--r--src/test/ui/process/process-spawn-nonexistent.rs1
-rw-r--r--src/test/ui/process/process-spawn-with-unicode-params.rs1
-rw-r--r--src/test/ui/process/signal-exit-status.rs1
-rw-r--r--src/test/ui/ptr_ops/issue-80309-safe.rs1
-rw-r--r--src/test/ui/ptr_ops/issue-80309.rs1
-rw-r--r--src/test/ui/pub/pub-reexport-priv-extern-crate.stderr2
-rw-r--r--src/test/ui/pub/pub-restricted-error.stderr2
-rw-r--r--src/test/ui/query-system/query_depth.rs31
-rw-r--r--src/test/ui/query-system/query_depth.stderr11
-rw-r--r--src/test/ui/query-visibility.rs9
-rw-r--r--src/test/ui/range/range-1.stderr6
-rw-r--r--src/test/ui/range/range-inclusive-pattern-precedence.stderr4
-rw-r--r--src/test/ui/range/range-inclusive-pattern-precedence2.stderr4
-rw-r--r--src/test/ui/recursion/issue-83150.stderr4
-rw-r--r--src/test/ui/recursion/issue-95134.rs30
-rw-r--r--src/test/ui/recursion/recursive-enum.stderr4
-rw-r--r--src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr6
-rw-r--r--src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs12
-rw-r--r--src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr14
-rw-r--r--src/test/ui/regions/issue-101280.rs10
-rw-r--r--src/test/ui/regions/issue-101280.stderr14
-rw-r--r--src/test/ui/regions/issue-102374.rs20
-rw-r--r--src/test/ui/regions/issue-102374.stderr14
-rw-r--r--src/test/ui/regions/issue-102392.rs6
-rw-r--r--src/test/ui/regions/issue-102392.stderr14
-rw-r--r--src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs2
-rw-r--r--src/test/ui/regions/outlives-with-missing.rs16
-rw-r--r--src/test/ui/regions/outlives-with-missing.stderr12
-rw-r--r--src/test/ui/regions/region-bound-on-closure-outlives-call.stderr2
-rw-r--r--src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr4
-rw-r--r--src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr4
-rw-r--r--src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr2
-rw-r--r--src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs3
-rw-r--r--src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr17
-rw-r--r--src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr4
-rw-r--r--src/test/ui/reify-intrinsic.stderr3
-rw-r--r--src/test/ui/repr/invalid_repr_list_help.rs17
-rw-r--r--src/test/ui/repr/invalid_repr_list_help.stderr35
-rw-r--r--src/test/ui/repr/repr-transparent-issue-87496.stderr2
-rw-r--r--src/test/ui/repr/repr-transparent-non-exhaustive.rs24
-rw-r--r--src/test/ui/repr/repr-transparent-non-exhaustive.stderr30
-rw-r--r--src/test/ui/resolve/bad-env-capture.stderr12
-rw-r--r--src/test/ui/resolve/bad-env-capture2.stderr12
-rw-r--r--src/test/ui/resolve/bad-env-capture3.stderr12
-rw-r--r--src/test/ui/resolve/bad-expr-path.stderr12
-rw-r--r--src/test/ui/resolve/bad-expr-path2.stderr12
-rw-r--r--src/test/ui/resolve/bad-type-env-capture.stderr6
-rw-r--r--src/test/ui/resolve/issue-100365.rs50
-rw-r--r--src/test/ui/resolve/issue-100365.stderr54
-rw-r--r--src/test/ui/resolve/issue-102946.rs7
-rw-r--r--src/test/ui/resolve/issue-102946.stderr26
-rw-r--r--src/test/ui/resolve/issue-103202.rs7
-rw-r--r--src/test/ui/resolve/issue-103202.stderr9
-rw-r--r--src/test/ui/resolve/issue-14254.stderr127
-rw-r--r--src/test/ui/resolve/issue-22692.rs59
-rw-r--r--src/test/ui/resolve/issue-22692.stderr85
-rw-r--r--src/test/ui/resolve/issue-23305.rs2
-rw-r--r--src/test/ui/resolve/issue-23305.stderr16
-rw-r--r--src/test/ui/resolve/issue-2356.stderr90
-rw-r--r--src/test/ui/resolve/issue-3021-c.stderr16
-rw-r--r--src/test/ui/resolve/issue-42944.stderr24
-rw-r--r--src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs1
-rw-r--r--src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr43
-rw-r--r--src/test/ui/resolve/issue-73427.rs6
-rw-r--r--src/test/ui/resolve/issue-73427.stderr74
-rw-r--r--src/test/ui/resolve/levenshtein.stderr18
-rw-r--r--src/test/ui/resolve/name-collision-in-trait-fn-sig.rs11
-rw-r--r--src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.rs21
-rw-r--r--src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr17
-rw-r--r--src/test/ui/resolve/privacy-enum-ctor.stderr28
-rw-r--r--src/test/ui/resolve/resolve-assoc-suggestions.stderr2
-rw-r--r--src/test/ui/resolve/resolve-hint-macro.stderr22
-rw-r--r--src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr8
-rw-r--r--src/test/ui/resolve/resolve-inconsistent-names.rs1
-rw-r--r--src/test/ui/resolve/resolve-inconsistent-names.stderr9
-rw-r--r--src/test/ui/resolve/resolve-primitive-fallback.stderr2
-rw-r--r--src/test/ui/resolve/resolve-self-in-impl.rs9
-rw-r--r--src/test/ui/resolve/resolve-self-in-impl.stderr74
-rw-r--r--src/test/ui/resolve/resolve-speculative-adjustment.stderr12
-rw-r--r--src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr18
-rw-r--r--src/test/ui/resolve/suggest-path-for-tuple-struct.stderr8
-rw-r--r--src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs52
-rw-r--r--src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr82
-rw-r--r--src/test/ui/resolve/tuple-struct-alias.stderr16
-rw-r--r--src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr38
-rw-r--r--src/test/ui/return/issue-64620.rs (renamed from src/test/ui/issues/issue-64620.rs)0
-rw-r--r--src/test/ui/return/issue-64620.stderr (renamed from src/test/ui/issues/issue-64620.stderr)0
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr4
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr4
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr4
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr4
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr4
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr4
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr4
-rw-r--r--src/test/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr2
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr17
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs18
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr15
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs1
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr9
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs8
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr11
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs4
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr12
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr2
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr64
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr10
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/struct.stderr12
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr6
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr6
-rw-r--r--src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr6
-rw-r--r--src/test/ui/rfc-2091-track-caller/std-panic-locations.rs1
-rw-r--r--src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr7
-rw-r--r--src/test/ui/rfc-2294-if-let-guard/warns.stderr4
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr52
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs2
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr26
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs15
-rw-r--r--src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr42
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs9
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr8
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs10
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr8
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs9
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr8
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs17
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr14
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs7
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr8
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs7
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr19
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs6
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr15
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs6
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr15
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs6
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr21
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs24
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr20
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs6
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr15
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs6
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr15
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs17
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr14
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs1
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr13
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs3
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr13
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs2
-rw-r--r--src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr10
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr21
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs9
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr21
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr79
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs15
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr79
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-drop.rs3
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr4
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs9
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr10
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/feature-gate.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr13
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs39
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-102156.rs15
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-102156.stderr19
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-102985.rs12
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-102985.stderr41
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-103677.rs5
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-90052.rs9
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-90052.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs12
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs31
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr19
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/specializing-constness.rs26
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/specializing-constness.stderr8
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs18
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr8
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr8
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs9
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.stderr24
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr21
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr21
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr8
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs20
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr8
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr10
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/super-traits.rs3
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs34
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr14
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs7
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr36
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs17
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs31
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr35
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs1
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs19
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr58
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr6
-rw-r--r--src/test/ui/rfc1623-2.stderr2
-rw-r--r--src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr12
-rw-r--r--src/test/ui/rfcs/rfc1857-drop-order.rs1
-rw-r--r--src/test/ui/runtime/backtrace-debuginfo.rs1
-rw-r--r--src/test/ui/runtime/out-of-stack.rs1
-rw-r--r--src/test/ui/runtime/rt-explody-panic-payloads.rs14
-rw-r--r--src/test/ui/rust-2018/async-ident-allowed.stderr4
-rw-r--r--src/test/ui/rust-2018/async-ident.stderr4
-rw-r--r--src/test/ui/rust-2018/dyn-keyword.stderr4
-rw-r--r--src/test/ui/rust-2018/edition-lint-fully-qualified-paths.stderr4
-rw-r--r--src/test/ui/rust-2018/edition-lint-nested-empty-paths.stderr4
-rw-r--r--src/test/ui/rust-2018/edition-lint-nested-paths.stderr4
-rw-r--r--src/test/ui/rust-2018/edition-lint-paths.stderr4
-rw-r--r--src/test/ui/rust-2018/extern-crate-rename.stderr4
-rw-r--r--src/test/ui/rust-2018/extern-crate-submod.stderr4
-rw-r--r--src/test/ui/rust-2018/try-ident.stderr4
-rw-r--r--src/test/ui/rust-2018/try-macro.stderr4
-rw-r--r--src/test/ui/rust-2021/array-into-iter-ambiguous.stderr4
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr4
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-generic.stderr4
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-imported.stderr4
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-macros.stderr4
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr4
-rw-r--r--src/test/ui/rust-2021/future-prelude-collision.stderr4
-rw-r--r--src/test/ui/rust-2021/generic-type-collision.stderr4
-rw-r--r--src/test/ui/rust-2021/inherent-dyn-collision.stderr4
-rw-r--r--src/test/ui/rust-2021/reserved-prefixes-migration.stderr29
-rw-r--r--src/test/ui/rust-2021/reserved-prefixes.stderr45
-rw-r--r--src/test/ui/rustdoc/deny-invalid-doc-attrs.stderr4
-rw-r--r--src/test/ui/rustdoc/doc-test-attr.stderr4
-rw-r--r--src/test/ui/rustdoc/feature-gate-doc_primitive.stderr2
-rw-r--r--src/test/ui/sanitize/address.rs4
-rw-r--r--src/test/ui/sanitize/hwaddress.rs2
-rw-r--r--src/test/ui/sanitize/inline-always.stderr2
-rw-r--r--src/test/ui/sanitize/leak.rs2
-rw-r--r--src/test/ui/sanitize/memory-eager.rs37
-rw-r--r--src/test/ui/sanitize/memory.rs15
-rw-r--r--src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs2
-rw-r--r--src/test/ui/save-analysis/issue-68621.stderr2
-rw-r--r--src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr2
-rw-r--r--src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr2
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr2
-rw-r--r--src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr2
-rw-r--r--src/test/ui/simd/intrinsic/ptr-cast.rs33
-rw-r--r--src/test/ui/simd/portable-intrinsics-arent-exposed.stderr5
-rw-r--r--src/test/ui/simd/target-feature-mixup.rs1
-rw-r--r--src/test/ui/single-use-lifetime/derive-eq.rs11
-rw-r--r--src/test/ui/sized-cycle-note.rs11
-rw-r--r--src/test/ui/sized-cycle-note.stderr32
-rw-r--r--src/test/ui/span/E0072.stderr6
-rw-r--r--src/test/ui/span/E0204.stderr8
-rw-r--r--src/test/ui/span/E0493.rs2
-rw-r--r--src/test/ui/span/E0493.stderr4
-rw-r--r--src/test/ui/span/E0535.stderr2
-rw-r--r--src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs4
-rw-r--r--src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr24
-rw-r--r--src/test/ui/span/issue-34264.stderr6
-rw-r--r--src/test/ui/span/issue-35987.stderr4
-rw-r--r--src/test/ui/span/issue-36530.rs12
-rw-r--r--src/test/ui/span/issue-36530.stderr12
-rw-r--r--src/test/ui/span/issue-7575.rs75
-rw-r--r--src/test/ui/span/issue-7575.stderr82
-rw-r--r--src/test/ui/span/lint-unused-unsafe-thir.rs4
-rw-r--r--src/test/ui/span/lint-unused-unsafe-thir.stderr18
-rw-r--r--src/test/ui/span/lint-unused-unsafe.mir.stderr548
-rw-r--r--src/test/ui/span/lint-unused-unsafe.rs74
-rw-r--r--src/test/ui/span/missing-unit-argument.stderr16
-rw-r--r--src/test/ui/span/multiline-span-E0072.stderr6
-rw-r--r--src/test/ui/span/recursive-type-field.rs4
-rw-r--r--src/test/ui/span/recursive-type-field.stderr38
-rw-r--r--src/test/ui/specialization/assoc-ty-graph-cycle.stderr2
-rw-r--r--src/test/ui/specialization/const_trait_impl.rs55
-rw-r--r--src/test/ui/specialization/cross-crate-defaults.stderr2
-rw-r--r--src/test/ui/specialization/default-associated-type-bound-1.stderr2
-rw-r--r--src/test/ui/specialization/default-associated-type-bound-2.stderr2
-rw-r--r--src/test/ui/specialization/default-generic-associated-type-bound.rs3
-rw-r--r--src/test/ui/specialization/default-generic-associated-type-bound.stderr8
-rw-r--r--src/test/ui/specialization/defaultimpl/allowed-cross-crate.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/out-of-order.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/overlap-projection.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/projection.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/specialization-no-default.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented-rpass.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr2
-rw-r--r--src/test/ui/specialization/defaultimpl/validation.stderr2
-rw-r--r--src/test/ui/specialization/issue-33017.rs2
-rw-r--r--src/test/ui/specialization/issue-35376.stderr2
-rw-r--r--src/test/ui/specialization/issue-36804.stderr2
-rw-r--r--src/test/ui/specialization/issue-38091-2.stderr4
-rw-r--r--src/test/ui/specialization/issue-38091.stderr2
-rw-r--r--src/test/ui/specialization/issue-39448.stderr6
-rw-r--r--src/test/ui/specialization/issue-39618.stderr2
-rw-r--r--src/test/ui/specialization/issue-45814.stderr4
-rw-r--r--src/test/ui/specialization/issue-50452-fail.stderr2
-rw-r--r--src/test/ui/specialization/issue-50452.stderr2
-rw-r--r--src/test/ui/specialization/issue-52050.stderr2
-rw-r--r--src/test/ui/specialization/issue-63716-parse-async.stderr2
-rw-r--r--src/test/ui/specialization/issue-70442.stderr2
-rw-r--r--src/test/ui/specialization/min_specialization/issue-79224.stderr22
-rw-r--r--src/test/ui/specialization/non-defaulted-item-fail.stderr2
-rw-r--r--src/test/ui/specialization/specialization-allowed-cross-crate.stderr2
-rw-r--r--src/test/ui/specialization/specialization-assoc-fns.stderr2
-rw-r--r--src/test/ui/specialization/specialization-basics.stderr2
-rw-r--r--src/test/ui/specialization/specialization-cross-crate.stderr2
-rw-r--r--src/test/ui/specialization/specialization-default-methods.stderr2
-rw-r--r--src/test/ui/specialization/specialization-default-projection.stderr2
-rw-r--r--src/test/ui/specialization/specialization-default-types.stderr2
-rw-r--r--src/test/ui/specialization/specialization-no-default.stderr2
-rw-r--r--src/test/ui/specialization/specialization-on-projection.stderr2
-rw-r--r--src/test/ui/specialization/specialization-out-of-order.stderr2
-rw-r--r--src/test/ui/specialization/specialization-overlap-negative.stderr2
-rw-r--r--src/test/ui/specialization/specialization-overlap-projection.stderr2
-rw-r--r--src/test/ui/specialization/specialization-overlap.stderr2
-rw-r--r--src/test/ui/specialization/specialization-polarity.stderr2
-rw-r--r--src/test/ui/specialization/specialization-projection-alias.stderr2
-rw-r--r--src/test/ui/specialization/specialization-projection.stderr2
-rw-r--r--src/test/ui/specialization/specialization-supertraits.stderr2
-rw-r--r--src/test/ui/specialization/specialization-translate-projections-with-lifetimes.stderr2
-rw-r--r--src/test/ui/specialization/specialization-translate-projections-with-params.stderr2
-rw-r--r--src/test/ui/specialization/specialization-translate-projections.stderr2
-rw-r--r--src/test/ui/specialization/transmute-specialization.stderr2
-rw-r--r--src/test/ui/stability-attribute/auxiliary/ctor-stability.rs8
-rw-r--r--src/test/ui/stability-attribute/auxiliary/default_body.rs29
-rw-r--r--src/test/ui/stability-attribute/ctor-stability.rs8
-rw-r--r--src/test/ui/stability-attribute/default-body-stability-err.rs19
-rw-r--r--src/test/ui/stability-attribute/default-body-stability-err.stderr38
-rw-r--r--src/test/ui/stability-attribute/default-body-stability-ok-enables.rs18
-rw-r--r--src/test/ui/stability-attribute/default-body-stability-ok-impls.rs21
-rw-r--r--src/test/ui/stability-attribute/missing-const-stability.rs1
-rw-r--r--src/test/ui/stability-attribute/missing-const-stability.stderr2
-rw-r--r--src/test/ui/stability-attribute/stability-attribute-trait-impl.rs16
-rw-r--r--src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr16
-rw-r--r--src/test/ui/stability-attribute/stable-in-unstable.rs8
-rw-r--r--src/test/ui/stability-attribute/stable-in-unstable.stderr20
-rw-r--r--src/test/ui/static/static-drop-scope.rs16
-rw-r--r--src/test/ui/static/static-drop-scope.stderr32
-rw-r--r--src/test/ui/static/static-vec-repeat-not-constant.stderr1
-rw-r--r--src/test/ui/statics/issue-17718-static-sync.rs (renamed from src/test/ui/issues/issue-17718-static-sync.rs)0
-rw-r--r--src/test/ui/statics/issue-17718-static-sync.stderr (renamed from src/test/ui/issues/issue-17718-static-sync.stderr)0
-rw-r--r--src/test/ui/statics/issue-17718-static-unsafe-interior.rs (renamed from src/test/ui/issues/issue-17718-static-unsafe-interior.rs)0
-rw-r--r--src/test/ui/statics/uninhabited-static.stderr18
-rw-r--r--src/test/ui/stats/hir-stats.rs41
-rw-r--r--src/test/ui/stats/hir-stats.stderr178
-rw-r--r--src/test/ui/std-backtrace.rs3
-rw-r--r--src/test/ui/str/str-idx.stderr4
-rw-r--r--src/test/ui/str/str-mut-idx.stderr4
-rw-r--r--src/test/ui/structs-enums/align-struct.rs5
-rw-r--r--src/test/ui/structs-enums/issue-2718-a.rs (renamed from src/test/ui/issues/issue-2718-a.rs)0
-rw-r--r--src/test/ui/structs-enums/issue-2718-a.stderr (renamed from src/test/ui/issues/issue-2718-a.stderr)4
-rw-r--r--src/test/ui/structs-enums/rec-align-u32.rs1
-rw-r--r--src/test/ui/structs-enums/rec-align-u64.rs1
-rw-r--r--src/test/ui/structs-enums/struct-rec/issue-74224.stderr4
-rw-r--r--src/test/ui/structs-enums/struct-rec/issue-84611.stderr4
-rw-r--r--src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs6
-rw-r--r--src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr62
-rw-r--r--src/test/ui/structs-enums/type-sizes.rs79
-rw-r--r--src/test/ui/structs/incomplete-fn-in-struct-definition.rs5
-rw-r--r--src/test/ui/structs/incomplete-fn-in-struct-definition.stderr15
-rw-r--r--src/test/ui/structs/struct-fn-in-definition.stderr9
-rw-r--r--src/test/ui/structs/struct-path-associated-type.rs4
-rw-r--r--src/test/ui/structs/struct-path-associated-type.stderr30
-rw-r--r--src/test/ui/structs/struct-record-suggestion.fixed24
-rw-r--r--src/test/ui/structs/struct-record-suggestion.rs24
-rw-r--r--src/test/ui/structs/struct-record-suggestion.stderr23
-rw-r--r--src/test/ui/suggestions/abi-typo.fixed6
-rw-r--r--src/test/ui/suggestions/abi-typo.rs6
-rw-r--r--src/test/ui/suggestions/abi-typo.stderr14
-rw-r--r--src/test/ui/suggestions/args-instead-of-tuple-errors.stderr24
-rw-r--r--src/test/ui/suggestions/args-instead-of-tuple.stderr2
-rw-r--r--src/test/ui/suggestions/as-ref-2.fixed13
-rw-r--r--src/test/ui/suggestions/as-ref-2.rs2
-rw-r--r--src/test/ui/suggestions/as-ref-2.stderr10
-rw-r--r--src/test/ui/suggestions/as-ref.rs7
-rw-r--r--src/test/ui/suggestions/as-ref.stderr62
-rw-r--r--src/test/ui/suggestions/assoc-const-as-field.stderr4
-rw-r--r--src/test/ui/suggestions/assoc_fn_without_self.stderr12
-rw-r--r--src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr13
-rw-r--r--src/test/ui/suggestions/bool_typo_err_suggest.rs12
-rw-r--r--src/test/ui/suggestions/bool_typo_err_suggest.stderr25
-rw-r--r--src/test/ui/suggestions/boxed-variant-field.rs1
-rw-r--r--src/test/ui/suggestions/boxed-variant-field.stderr4
-rw-r--r--src/test/ui/suggestions/call-boxed.rs7
-rw-r--r--src/test/ui/suggestions/call-boxed.stderr20
-rw-r--r--src/test/ui/suggestions/call-on-missing.rs39
-rw-r--r--src/test/ui/suggestions/call-on-missing.stderr75
-rw-r--r--src/test/ui/suggestions/call-on-unimplemented-ctor.rs17
-rw-r--r--src/test/ui/suggestions/call-on-unimplemented-ctor.stderr21
-rw-r--r--src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs15
-rw-r--r--src/test/ui/suggestions/call-on-unimplemented-fn-ptr.stderr21
-rw-r--r--src/test/ui/suggestions/const-no-type.rs14
-rw-r--r--src/test/ui/suggestions/const-no-type.stderr28
-rw-r--r--src/test/ui/suggestions/copied-and-cloned.fixed23
-rw-r--r--src/test/ui/suggestions/copied-and-cloned.rs23
-rw-r--r--src/test/ui/suggestions/copied-and-cloned.stderr83
-rw-r--r--src/test/ui/suggestions/deref-path-method.rs6
-rw-r--r--src/test/ui/suggestions/deref-path-method.stderr14
-rw-r--r--src/test/ui/suggestions/derive-clone-for-eq.stderr2
-rw-r--r--src/test/ui/suggestions/derive-macro-missing-bounds.stderr16
-rw-r--r--src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr2
-rw-r--r--src/test/ui/suggestions/dont-try-removing-the-field.rs17
-rw-r--r--src/test/ui/suggestions/dont-try-removing-the-field.stderr10
-rw-r--r--src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr14
-rw-r--r--src/test/ui/suggestions/field-access-considering-privacy.rs35
-rw-r--r--src/test/ui/suggestions/field-access-considering-privacy.stderr14
-rw-r--r--src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr13
-rw-r--r--src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr74
-rw-r--r--src/test/ui/suggestions/fn-to-method.rs19
-rw-r--r--src/test/ui/suggestions/fn-to-method.stderr38
-rw-r--r--src/test/ui/suggestions/format-borrow.stderr16
-rw-r--r--src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr6
-rw-r--r--src/test/ui/suggestions/imm-ref-trait-object-literal.stderr2
-rw-r--r--src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr12
-rw-r--r--src/test/ui/suggestions/inner_type.fixed40
-rw-r--r--src/test/ui/suggestions/inner_type.rs40
-rw-r--r--src/test/ui/suggestions/inner_type.stderr83
-rw-r--r--src/test/ui/suggestions/inner_type2.rs26
-rw-r--r--src/test/ui/suggestions/inner_type2.stderr29
-rw-r--r--src/test/ui/suggestions/into-convert.rs26
-rw-r--r--src/test/ui/suggestions/into-convert.stderr44
-rw-r--r--src/test/ui/suggestions/into-str.stderr2
-rw-r--r--src/test/ui/suggestions/issue-101065.fixed14
-rw-r--r--src/test/ui/suggestions/issue-101065.rs14
-rw-r--r--src/test/ui/suggestions/issue-101065.stderr23
-rw-r--r--src/test/ui/suggestions/issue-101421.rs12
-rw-r--r--src/test/ui/suggestions/issue-101421.stderr17
-rw-r--r--src/test/ui/suggestions/issue-101465.rs25
-rw-r--r--src/test/ui/suggestions/issue-101465.stderr25
-rw-r--r--src/test/ui/suggestions/issue-101623.rs25
-rw-r--r--src/test/ui/suggestions/issue-101623.stderr14
-rw-r--r--src/test/ui/suggestions/issue-101984.rs27
-rw-r--r--src/test/ui/suggestions/issue-101984.stderr14
-rw-r--r--src/test/ui/suggestions/issue-102354.rs10
-rw-r--r--src/test/ui/suggestions/issue-102354.stderr24
-rw-r--r--src/test/ui/suggestions/issue-102892.rs25
-rw-r--r--src/test/ui/suggestions/issue-102892.stderr57
-rw-r--r--src/test/ui/suggestions/issue-103112.rs4
-rw-r--r--src/test/ui/suggestions/issue-103112.stderr15
-rw-r--r--src/test/ui/suggestions/issue-61963.stderr39
-rw-r--r--src/test/ui/suggestions/issue-62843.stderr4
-rw-r--r--src/test/ui/suggestions/issue-71394-no-from-impl.stderr8
-rw-r--r--src/test/ui/suggestions/issue-84973-2.stderr2
-rw-r--r--src/test/ui/suggestions/issue-84973-blacklist.stderr6
-rw-r--r--src/test/ui/suggestions/issue-84973-negative.stderr2
-rw-r--r--src/test/ui/suggestions/issue-84973.stderr2
-rw-r--r--src/test/ui/suggestions/issue-85347.rs3
-rw-r--r--src/test/ui/suggestions/issue-85347.stderr15
-rw-r--r--src/test/ui/suggestions/issue-89064.rs35
-rw-r--r--src/test/ui/suggestions/issue-89064.stderr82
-rw-r--r--src/test/ui/suggestions/issue-96223.stderr4
-rw-r--r--src/test/ui/suggestions/issue-96555.stderr6
-rw-r--r--src/test/ui/suggestions/issue-97677.fixed2
-rw-r--r--src/test/ui/suggestions/issue-97677.stderr4
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr5
-rw-r--r--src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr22
-rw-r--r--src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr4
-rw-r--r--src/test/ui/suggestions/many-type-ascription.rs4
-rw-r--r--src/test/ui/suggestions/many-type-ascription.stderr12
-rw-r--r--src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr2
-rw-r--r--src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr4
-rw-r--r--src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr4
-rw-r--r--src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs18
-rw-r--r--src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr24
-rw-r--r--src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs2
-rw-r--r--src/test/ui/suggestions/option-content-move.fixed39
-rw-r--r--src/test/ui/suggestions/option-content-move.rs2
-rw-r--r--src/test/ui/suggestions/option-content-move.stderr14
-rw-r--r--src/test/ui/suggestions/restrict-type-not-param.rs12
-rw-r--r--src/test/ui/suggestions/restrict-type-not-param.stderr26
-rw-r--r--src/test/ui/suggestions/return-closures.rs13
-rw-r--r--src/test/ui/suggestions/return-closures.stderr27
-rw-r--r--src/test/ui/suggestions/return-cycle-2.rs14
-rw-r--r--src/test/ui/suggestions/return-cycle-2.stderr12
-rw-r--r--src/test/ui/suggestions/return-cycle.rs14
-rw-r--r--src/test/ui/suggestions/return-cycle.stderr12
-rw-r--r--src/test/ui/suggestions/slice-issue-87994.stderr16
-rw-r--r--src/test/ui/suggestions/struct-field-type-including-single-colon.stderr4
-rw-r--r--src/test/ui/suggestions/sugg-else-for-closure.fixed8
-rw-r--r--src/test/ui/suggestions/sugg-else-for-closure.rs8
-rw-r--r--src/test/ui/suggestions/sugg-else-for-closure.stderr23
-rw-r--r--src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs10
-rw-r--r--src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr21
-rw-r--r--src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed15
-rw-r--r--src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs15
-rw-r--r--src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr25
-rw-r--r--src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs2
-rw-r--r--src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr35
-rw-r--r--src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr4
-rw-r--r--src/test/ui/suggestions/suggest-dereferencing-index.stderr2
-rw-r--r--src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr6
-rw-r--r--src/test/ui/suggestions/suggest-let-for-assignment.fixed17
-rw-r--r--src/test/ui/suggestions/suggest-let-for-assignment.rs17
-rw-r--r--src/test/ui/suggestions/suggest-let-for-assignment.stderr60
-rw-r--r--src/test/ui/suggestions/suggest-methods.stderr8
-rw-r--r--src/test/ui/suggestions/suggest-move-lifetimes.stderr8
-rw-r--r--src/test/ui/suggestions/suggest-move-types.stderr4
-rw-r--r--src/test/ui/suggestions/suggest-ref-macro.stderr10
-rw-r--r--src/test/ui/suggestions/suggest-remove-refs-1.stderr2
-rw-r--r--src/test/ui/suggestions/suggest-remove-refs-2.stderr2
-rw-r--r--src/test/ui/suggestions/suggest-remove-refs-3.stderr2
-rw-r--r--src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr5
-rw-r--r--src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr7
-rw-r--r--src/test/ui/suggestions/too-many-field-suggestions.rs29
-rw-r--r--src/test/ui/suggestions/too-many-field-suggestions.stderr44
-rw-r--r--src/test/ui/suggestions/try-removing-the-field.rs17
-rw-r--r--src/test/ui/suggestions/try-removing-the-field.stderr12
-rw-r--r--src/test/ui/suggestions/type-ascription-and-other-error.rs6
-rw-r--r--src/test/ui/suggestions/type-ascription-and-other-error.stderr8
-rw-r--r--src/test/ui/suggestions/unnamable-types.stderr20
-rw-r--r--src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr2
-rw-r--r--src/test/ui/symbol-names/impl1.legacy.stderr2
-rw-r--r--src/test/ui/symbol-names/impl1.rs4
-rw-r--r--src/test/ui/symbol-names/impl1.v0.stderr2
-rw-r--r--src/test/ui/tag-variant-disr-dup.rs12
-rw-r--r--src/test/ui/tag-variant-disr-dup.stderr14
-rw-r--r--src/test/ui/test-attrs/inaccessible-test-modules.stderr14
-rw-r--r--src/test/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs1
-rw-r--r--src/test/ui/test-attrs/test-on-not-fn.stderr24
-rw-r--r--src/test/ui/test-attrs/test-panic-while-printing.rs1
-rw-r--r--src/test/ui/test-attrs/test-should-fail-good-message.rs1
-rw-r--r--src/test/ui/test-attrs/test-thread-capture.rs1
-rw-r--r--src/test/ui/test-attrs/test-thread-capture.run.stdout2
-rw-r--r--src/test/ui/test-attrs/test-thread-nocapture.rs1
-rw-r--r--src/test/ui/test-attrs/test-thread-nocapture.run.stderr2
-rw-r--r--src/test/ui/thir-tree.stdout26
-rw-r--r--src/test/ui/threads-sendsync/issue-43733-2.rs2
-rw-r--r--src/test/ui/threads-sendsync/issue-43733.rs2
-rw-r--r--src/test/ui/threads-sendsync/sync-send-in-std.rs1
-rw-r--r--src/test/ui/traits/alias/cross-crate.stderr4
-rw-r--r--src/test/ui/traits/alias/generic-default-in-dyn.rs10
-rw-r--r--src/test/ui/traits/alias/generic-default-in-dyn.stderr39
-rw-r--r--src/test/ui/traits/alias/self-in-const-generics.rs12
-rw-r--r--src/test/ui/traits/alias/self-in-const-generics.stderr11
-rw-r--r--src/test/ui/traits/alias/self-in-generics.rs15
-rw-r--r--src/test/ui/traits/alias/self-in-generics.stderr11
-rw-r--r--src/test/ui/traits/assoc-type-in-superbad.rs8
-rw-r--r--src/test/ui/traits/assoc-type-in-superbad.stderr6
-rw-r--r--src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr4
-rw-r--r--src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr6
-rw-r--r--src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr4
-rw-r--r--src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr6
-rw-r--r--src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr6
-rw-r--r--src/test/ui/traits/bad-method-typaram-kind.stderr4
-rw-r--r--src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs3
-rw-r--r--src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr8
-rw-r--r--src/test/ui/traits/bound/not-on-bare-trait.stderr7
-rw-r--r--src/test/ui/traits/bound/on-structs-and-enums-locals.rs2
-rw-r--r--src/test/ui/traits/bound/on-structs-and-enums-locals.stderr6
-rw-r--r--src/test/ui/traits/bound/on-structs-and-enums-xc1.rs2
-rw-r--r--src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr6
-rw-r--r--src/test/ui/traits/copy-impl-cannot-normalize.stderr4
-rw-r--r--src/test/ui/traits/cycle-cache-err-60010.stderr4
-rw-r--r--src/test/ui/traits/inductive-overflow/lifetime.rs2
-rw-r--r--src/test/ui/traits/inductive-overflow/lifetime.stderr4
-rw-r--r--src/test/ui/traits/inductive-overflow/simultaneous.stderr2
-rw-r--r--src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr2
-rw-r--r--src/test/ui/traits/inductive-overflow/supertrait.stderr2
-rw-r--r--src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr30
-rw-r--r--src/test/ui/traits/issue-102989.rs16
-rw-r--r--src/test/ui/traits/issue-102989.stderr59
-rw-r--r--src/test/ui/traits/issue-18400.stderr4
-rw-r--r--src/test/ui/traits/issue-20692.stderr2
-rw-r--r--src/test/ui/traits/issue-33140-hack-boundaries.stderr17
-rw-r--r--src/test/ui/traits/issue-38604.stderr2
-rw-r--r--src/test/ui/traits/issue-43784-supertrait.rs (renamed from src/test/ui/issues/issue-43784-supertrait.rs)0
-rw-r--r--src/test/ui/traits/issue-43784-supertrait.stderr (renamed from src/test/ui/issues/issue-43784-supertrait.stderr)0
-rw-r--r--src/test/ui/traits/issue-71036.rs2
-rw-r--r--src/test/ui/traits/issue-71036.stderr2
-rw-r--r--src/test/ui/traits/issue-71136.stderr2
-rw-r--r--src/test/ui/traits/issue-77982.stderr8
-rw-r--r--src/test/ui/traits/issue-8153.stderr7
-rw-r--r--src/test/ui/traits/issue-82830.stderr2
-rw-r--r--src/test/ui/traits/issue-91594.stderr6
-rw-r--r--src/test/ui/traits/issue-91949-hangs-on-recursion.stderr6
-rw-r--r--src/test/ui/traits/issue-97576.stderr8
-rw-r--r--src/test/ui/traits/multidispatch-bad.stderr2
-rw-r--r--src/test/ui/traits/multidispatch-convert-ambig-dest.stderr10
-rw-r--r--src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs2
-rw-r--r--src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr8
-rw-r--r--src/test/ui/traits/negative-impls/negative-default-impls.stderr2
-rw-r--r--src/test/ui/traits/negative-impls/negative-specializes-negative.stderr2
-rw-r--r--src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr2
-rw-r--r--src/test/ui/traits/negative-impls/negative-specializes-positive.stderr2
-rw-r--r--src/test/ui/traits/negative-impls/positive-specializes-negative.stderr2
-rw-r--r--src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr2
-rw-r--r--src/test/ui/traits/object/enforce-supertrait-projection.stderr4
-rw-r--r--src/test/ui/traits/object/issue-33140-traitobject-crate.stderr57
-rw-r--r--src/test/ui/traits/object/safety.stderr2
-rw-r--r--src/test/ui/traits/pointee-tail-is-generic-errors.stderr8
-rw-r--r--src/test/ui/traits/resolution-in-overloaded-op.stderr4
-rw-r--r--src/test/ui/traits/safety-trait-impl-cc.stderr6
-rw-r--r--src/test/ui/traits/safety-trait-impl.stderr12
-rw-r--r--src/test/ui/traits/static-method-generic-inference.stderr4
-rw-r--r--src/test/ui/traits/suggest-deferences/issue-39029.stderr12
-rw-r--r--src/test/ui/traits/suggest-deferences/issue-62530.stderr10
-rw-r--r--src/test/ui/traits/suggest-deferences/multiple-0.stderr10
-rw-r--r--src/test/ui/traits/suggest-deferences/root-obligation.stderr4
-rw-r--r--src/test/ui/traits/suggest-where-clause.stderr4
-rw-r--r--src/test/ui/traits/test-2.stderr2
-rw-r--r--src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr4
-rw-r--r--src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs (renamed from src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs)0
-rw-r--r--src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr (renamed from src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr)2
-rw-r--r--src/test/ui/traits/trait-upcasting/subtrait-method.stderr10
-rw-r--r--src/test/ui/traits/unspecified-self-in-trait-ref.rs (renamed from src/test/ui/unspecified-self-in-trait-ref.rs)0
-rw-r--r--src/test/ui/traits/unspecified-self-in-trait-ref.stderr (renamed from src/test/ui/unspecified-self-in-trait-ref.stderr)2
-rw-r--r--src/test/ui/transmutability/abstraction/abstracted_assume.rs27
-rw-r--r--src/test/ui/transmutability/abstraction/const_generic_fn.rs6
-rw-r--r--src/test/ui/transmutability/arrays/should_have_correct_length.rs4
-rw-r--r--src/test/ui/transmutability/arrays/should_inherit_alignment.rs9
-rw-r--r--src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs9
-rw-r--r--src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr120
-rw-r--r--src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs11
-rw-r--r--src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr420
-rw-r--r--src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs11
-rw-r--r--src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr126
-rw-r--r--src/test/ui/transmutability/enums/should_order_correctly.rs10
-rw-r--r--src/test/ui/transmutability/enums/should_pad_variants.rs9
-rw-r--r--src/test/ui/transmutability/enums/should_pad_variants.stderr20
-rw-r--r--src/test/ui/transmutability/enums/should_respect_endianness.rs10
-rw-r--r--src/test/ui/transmutability/enums/should_respect_endianness.stderr22
-rw-r--r--src/test/ui/transmutability/issue-101739-1.rs21
-rw-r--r--src/test/ui/transmutability/issue-101739-1.stderr16
-rw-r--r--src/test/ui/transmutability/issue-101739-2.rs37
-rw-r--r--src/test/ui/transmutability/issue-101739-2.stderr20
-rw-r--r--src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs2
-rw-r--r--src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs2
-rw-r--r--src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs2
-rw-r--r--src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs25
-rw-r--r--src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr8
-rw-r--r--src/test/ui/transmutability/primitives/bool.rs6
-rw-r--r--src/test/ui/transmutability/primitives/bool.stderr6
-rw-r--r--src/test/ui/transmutability/primitives/numbers.rs2
-rw-r--r--src/test/ui/transmutability/primitives/numbers.stderr342
-rw-r--r--src/test/ui/transmutability/primitives/unit.rs9
-rw-r--r--src/test/ui/transmutability/primitives/unit.stderr20
-rw-r--r--src/test/ui/transmutability/references.rs11
-rw-r--r--src/test/ui/transmutability/references.stderr23
-rw-r--r--src/test/ui/transmutability/structs/repr/should_handle_align.rs11
-rw-r--r--src/test/ui/transmutability/structs/repr/should_handle_packed.rs11
-rw-r--r--src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs11
-rw-r--r--src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr252
-rw-r--r--src/test/ui/transmutability/structs/should_order_fields_correctly.rs9
-rw-r--r--src/test/ui/transmutability/unions/boolish.rs4
-rw-r--r--src/test/ui/transmutability/unions/repr/should_handle_align.rs11
-rw-r--r--src/test/ui/transmutability/unions/repr/should_handle_packed.rs11
-rw-r--r--src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs11
-rw-r--r--src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr42
-rw-r--r--src/test/ui/transmutability/unions/should_pad_variants.rs9
-rw-r--r--src/test/ui/transmutability/unions/should_pad_variants.stderr20
-rw-r--r--src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs5
-rw-r--r--src/test/ui/transmutability/unions/should_reject_contraction.rs4
-rw-r--r--src/test/ui/transmutability/unions/should_reject_contraction.stderr6
-rw-r--r--src/test/ui/transmutability/unions/should_reject_disjoint.rs5
-rw-r--r--src/test/ui/transmutability/unions/should_reject_disjoint.stderr16
-rw-r--r--src/test/ui/transmutability/unions/should_reject_intersecting.rs6
-rw-r--r--src/test/ui/transmutability/unions/should_reject_intersecting.stderr12
-rw-r--r--src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs6
-rw-r--r--src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs6
-rw-r--r--src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs6
-rw-r--r--src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs6
-rw-r--r--src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs6
-rw-r--r--src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr2
-rw-r--r--src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr4
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr8
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr8
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr8
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs3
-rw-r--r--src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr12
-rw-r--r--src/test/ui/transmute-equal-assoc-types.rs4
-rw-r--r--src/test/ui/transmute-equal-assoc-types.stderr11
-rw-r--r--src/test/ui/transmute/lifetimes.rs23
-rw-r--r--src/test/ui/transmute/main.rs2
-rw-r--r--src/test/ui/transmute/main.stderr10
-rw-r--r--src/test/ui/treat-err-as-bug/delay_span_bug.rs2
-rw-r--r--src/test/ui/treat-err-as-bug/delay_span_bug.stderr2
-rw-r--r--src/test/ui/try-block/try-block-bad-type.stderr2
-rw-r--r--src/test/ui/try-trait/bad-interconversion.stderr77
-rw-r--r--src/test/ui/try-trait/option-to-result.stderr24
-rw-r--r--src/test/ui/try-trait/try-on-option-diagnostics.stderr47
-rw-r--r--src/test/ui/try-trait/try-on-option.stderr24
-rw-r--r--src/test/ui/try-trait/try-operator-on-main.stderr30
-rw-r--r--src/test/ui/tuple/add-tuple-within-arguments.stderr4
-rw-r--r--src/test/ui/tuple/builtin-fail.rs19
-rw-r--r--src/test/ui/tuple/builtin-fail.stderr55
-rw-r--r--src/test/ui/tuple/builtin.rs20
-rw-r--r--src/test/ui/tuple/wrong_argument_ice-3.stderr11
-rw-r--r--src/test/ui/tuple/wrong_argument_ice-4.stderr2
-rw-r--r--src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr2
-rw-r--r--src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/closure_args.rs16
-rw-r--r--src/test/ui/type-alias-impl-trait/closure_args2.rs23
-rw-r--r--src/test/ui/type-alias-impl-trait/closure_parent_substs.rs65
-rw-r--r--src/test/ui/type-alias-impl-trait/closure_wf_outlives.rs65
-rw-r--r--src/test/ui/type-alias-impl-trait/closure_wf_outlives.stderr64
-rw-r--r--src/test/ui/type-alias-impl-trait/constrain_inputs.rs24
-rw-r--r--src/test/ui/type-alias-impl-trait/constrain_inputs.stderr58
-rw-r--r--src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs31
-rw-r--r--src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.stderr9
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs3
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr10
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs6
-rw-r--r--src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr10
-rw-r--r--src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs4
-rw-r--r--src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr14
-rw-r--r--src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.rs12
-rw-r--r--src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.stderr14
-rw-r--r--src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs6
-rw-r--r--src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr4
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs5
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr6
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs7
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr12
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr8
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr6
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr4
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr8
-rw-r--r--src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs5
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds.rs51
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds.stderr16
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds2.rs10
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds3.rs18
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds_closure.rs31
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds_closure.stderr11
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds_from_types.rs51
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_bounds_from_types.stderr16
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs27
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs43
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.stderr58
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs11
-rw-r--r--src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.stderr14
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-101750.rs37
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr3
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-57961.rs2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-57961.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-58662-generator-with-lifetime.rs2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-58662-simplified.rs20
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-60371.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-74280.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-89686.rs2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-89686.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-90400-1.rs1
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-90400-1.stderr4
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-90400-2.rs1
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-90400-2.stderr6
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.rs10
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.stderr15
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-96572-unconstrained.rs92
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-98604.rs6
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-98604.stderr6
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-98608.rs6
-rw-r--r--src/test/ui/type-alias-impl-trait/issue-98608.stderr6
-rw-r--r--src/test/ui/type-alias-impl-trait/missing_lifetime_bound.rs7
-rw-r--r--src/test/ui/type-alias-impl-trait/missing_lifetime_bound.stderr8
-rw-r--r--src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs6
-rw-r--r--src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs6
-rw-r--r--src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr4
-rw-r--r--src/test/ui/type-alias-impl-trait/unbounded_opaque_type.rs14
-rw-r--r--src/test/ui/type-alias-impl-trait/underconstrained_generic.stderr2
-rw-r--r--src/test/ui/type/issue-100584.rs15
-rw-r--r--src/test/ui/type/issue-100584.stderr44
-rw-r--r--src/test/ui/type/issue-101866.rs15
-rw-r--r--src/test/ui/type/issue-101866.stderr18
-rw-r--r--src/test/ui/type/issue-94187-verbose-type-name.rs13
-rw-r--r--src/test/ui/type/type-alias-bounds.rs2
-rw-r--r--src/test/ui/type/type-arg-out-of-scope.stderr12
-rw-r--r--src/test/ui/type/type-ascription-instead-of-initializer.stderr2
-rw-r--r--src/test/ui/type/type-check-defaults.stderr8
-rw-r--r--src/test/ui/type/type-check/assignment-expected-bool.stderr22
-rw-r--r--src/test/ui/type/type-check/assignment-in-if.rs19
-rw-r--r--src/test/ui/type/type-check/assignment-in-if.stderr71
-rw-r--r--src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr16
-rw-r--r--src/test/ui/type/type-mismatch-same-crate-name.stderr11
-rw-r--r--src/test/ui/type/type-params-in-different-spaces-2.stderr12
-rw-r--r--src/test/ui/type/type-recursive-box-shadowed.stderr4
-rw-r--r--src/test/ui/type/type-recursive.stderr42
-rw-r--r--src/test/ui/type_length_limit.stderr4
-rw-r--r--src/test/ui/typeck/assign-non-lval-derefmut.stderr4
-rw-r--r--src/test/ui/typeck/assign-non-lval-mut-ref.stderr4
-rw-r--r--src/test/ui/typeck/assign-non-lval-needs-deref.rs19
-rw-r--r--src/test/ui/typeck/assign-non-lval-needs-deref.stderr16
-rw-r--r--src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.rs8
-rw-r--r--src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.stderr20
-rw-r--r--src/test/ui/typeck/issue-100164.fixed9
-rw-r--r--src/test/ui/typeck/issue-100164.rs9
-rw-r--r--src/test/ui/typeck/issue-100164.stderr14
-rw-r--r--src/test/ui/typeck/issue-100246.rs30
-rw-r--r--src/test/ui/typeck/issue-100246.stderr13
-rw-r--r--src/test/ui/typeck/issue-100285.rs22
-rw-r--r--src/test/ui/typeck/issue-100285.stderr34
-rw-r--r--src/test/ui/typeck/issue-29124.stderr8
-rw-r--r--src/test/ui/typeck/issue-69378-ice-on-invalid-type-node-after-recovery.stderr4
-rw-r--r--src/test/ui/typeck/issue-79040.stderr4
-rw-r--r--src/test/ui/typeck/issue-87181/empty-tuple-method.rs2
-rw-r--r--src/test/ui/typeck/issue-87181/empty-tuple-method.stderr6
-rw-r--r--src/test/ui/typeck/issue-87181/enum-variant.rs2
-rw-r--r--src/test/ui/typeck/issue-87181/enum-variant.stderr6
-rw-r--r--src/test/ui/typeck/issue-87181/tuple-field.stderr10
-rw-r--r--src/test/ui/typeck/issue-87181/tuple-method.stderr9
-rw-r--r--src/test/ui/typeck/issue-90101.stderr2
-rw-r--r--src/test/ui/typeck/issue-91210-ptr-method.stderr9
-rw-r--r--src/test/ui/typeck/issue-91633.rs8
-rw-r--r--src/test/ui/typeck/issue-96738.stderr18
-rw-r--r--src/test/ui/typeck/issue-98982.rs9
-rw-r--r--src/test/ui/typeck/issue-98982.stderr24
-rw-r--r--src/test/ui/typeck/point-at-type-param-in-path-expr.rs6
-rw-r--r--src/test/ui/typeck/point-at-type-param-in-path-expr.stderr17
-rw-r--r--src/test/ui/typeck/remove-extra-argument.stderr2
-rw-r--r--src/test/ui/typeck/slow-lhs-suggestion.rs26
-rw-r--r--src/test/ui/typeck/slow-lhs-suggestion.stderr187
-rw-r--r--src/test/ui/typeck/struct-enum-wrong-args.stderr16
-rw-r--r--src/test/ui/typeck/suggest-adding-missing-zero-to-floating-point-number.stderr14
-rw-r--r--src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr8
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_item.stderr4
-rw-r--r--src/test/ui/typeof/issue-100183.rs6
-rw-r--r--src/test/ui/typeof/issue-100183.stderr14
-rw-r--r--src/test/ui/ufcs/ufcs-qpath-self-mismatch.rs1
-rw-r--r--src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr30
-rw-r--r--src/test/ui/unboxed-closures/non-tupled-arg-mismatch.rs8
-rw-r--r--src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr17
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-counter-not-moved.stderr2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr12
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-move-mutable.stderr2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr4
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr6
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr12
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr18
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr6
-rw-r--r--src/test/ui/uninhabited/privately-uninhabited-mir-call.stderr5
-rw-r--r--src/test/ui/uninhabited/uninhabited-irrefutable.rs2
-rw-r--r--src/test/ui/uninhabited/uninhabited-irrefutable.stderr6
-rw-r--r--src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr2
-rw-r--r--src/test/ui/union/union-copy.stderr4
-rw-r--r--src/test/ui/union/union-generic.mirunsafeck.stderr4
-rw-r--r--src/test/ui/union/union-generic.thirunsafeck.stderr4
-rw-r--r--src/test/ui/union/union-nonrepresentable.stderr10
-rw-r--r--src/test/ui/union/union-repr-c.stderr10
-rw-r--r--src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr2
-rw-r--r--src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr4
-rw-r--r--src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr2
-rw-r--r--src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr4
-rw-r--r--src/test/ui/unpretty/avoid-crash.rs4
-rw-r--r--src/test/ui/unpretty/avoid-crash.stderr4
-rw-r--r--src/test/ui/unpretty/bad-literal.rs8
-rw-r--r--src/test/ui/unpretty/bad-literal.stderr10
-rw-r--r--src/test/ui/unpretty/bad-literal.stdout11
-rw-r--r--src/test/ui/unpretty/pretty-let-else.rs10
-rw-r--r--src/test/ui/unpretty/pretty-let-else.stdout18
-rw-r--r--src/test/ui/unresolved/unresolved-candidates.rs13
-rw-r--r--src/test/ui/unresolved/unresolved-candidates.stderr26
-rw-r--r--src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr42
-rw-r--r--src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs2
-rw-r--r--src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr28
-rw-r--r--src/test/ui/unsized-locals/borrow-after-move.stderr2
-rw-r--r--src/test/ui/unsized-locals/by-value-trait-object-safety.stderr2
-rw-r--r--src/test/ui/unsized-locals/double-move.stderr2
-rw-r--r--src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr2
-rw-r--r--src/test/ui/unsized-locals/issue-50940-with-feature.stderr2
-rw-r--r--src/test/ui/unsized-locals/unsized-exprs.stderr4
-rw-r--r--src/test/ui/unsized/issue-71659.stderr6
-rw-r--r--src/test/ui/unsized/issue-75707.stderr4
-rw-r--r--src/test/ui/unsized/issue-75899-but-gats.rs21
-rw-r--r--src/test/ui/unsized/issue-75899.rs18
-rw-r--r--src/test/ui/unsized/unsized-fn-param.stderr16
-rw-r--r--src/test/ui/unsized/unsized-struct.stderr4
-rw-r--r--src/test/ui/unsized/unsized3.stderr10
-rw-r--r--src/test/ui/unwind-abis/feature-gate-c-unwind.stderr2
-rw-r--r--src/test/ui/unwind-abis/ffi-unwind-calls-lint.rs1
-rw-r--r--src/test/ui/unwind-abis/ffi-unwind-calls-lint.stderr6
-rw-r--r--src/test/ui/unwind-no-uwtable.rs1
-rw-r--r--src/test/ui/variance/variance-regions-unused-indirect.rs1
-rw-r--r--src/test/ui/variance/variance-regions-unused-indirect.stderr30
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-1.rs2
-rw-r--r--src/test/ui/variance/variance-use-contravariant-struct-2.rs2
-rw-r--r--src/test/ui/variance/variance-use-invariant-struct-1.rs2
-rw-r--r--src/test/ui/wait-forked-but-failed-child.rs1
-rw-r--r--src/test/ui/wf/hir-wf-check-erase-regions.stderr4
-rw-r--r--src/test/ui/wf/issue-103573.rs22
-rw-r--r--src/test/ui/wf/issue-103573.stderr14
-rw-r--r--src/test/ui/wf/wf-const-type.stderr2
-rw-r--r--src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr6
-rw-r--r--src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr6
-rw-r--r--src/test/ui/wf/wf-foreign-fn-decl-ret.stderr4
-rw-r--r--src/test/ui/wf/wf-static-type.stderr2
-rw-r--r--src/test/ui/wf/wf-trait-fn-ret.stderr4
-rw-r--r--src/test/ui/wf/wf-unsafe-trait-obj-match.stderr4
-rw-r--r--src/test/ui/where-clauses/higher-ranked-fn-type.quiet.stderr18
-rw-r--r--src/test/ui/where-clauses/higher-ranked-fn-type.rs25
-rw-r--r--src/test/ui/where-clauses/higher-ranked-fn-type.verbose.stderr18
-rw-r--r--src/test/ui/where-clauses/where-clause-method-substituion.stderr4
-rw-r--r--src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr6
4866 files changed, 46304 insertions, 24432 deletions
diff --git a/src/test/assembly/aarch64-pointer-auth.rs b/src/test/assembly/aarch64-pointer-auth.rs
index 27e289086..da14cd026 100644
--- a/src/test/assembly/aarch64-pointer-auth.rs
+++ b/src/test/assembly/aarch64-pointer-auth.rs
@@ -1,6 +1,5 @@
// Test that PAC instructions are emitted when branch-protection is specified.
-// min-llvm-version: 10.0.1
// assembly-output: emit-asm
// compile-flags: --target aarch64-unknown-linux-gnu
// compile-flags: -Z branch-protection=pac-ret,leaf
diff --git a/src/test/assembly/asm/aarch64-types.rs b/src/test/assembly/asm/aarch64-types.rs
index 04b5f4aed..66c39a48c 100644
--- a/src/test/assembly/asm/aarch64-types.rs
+++ b/src/test/assembly/asm/aarch64-types.rs
@@ -2,7 +2,7 @@
// compile-flags: --target aarch64-unknown-linux-gnu
// needs-llvm-components: aarch64
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/asm/arm-types.rs b/src/test/assembly/asm/arm-types.rs
index 5ac1af6af..b22a26ce3 100644
--- a/src/test/assembly/asm/arm-types.rs
+++ b/src/test/assembly/asm/arm-types.rs
@@ -3,7 +3,7 @@
// compile-flags: -C target-feature=+neon
// needs-llvm-components: arm
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/asm/avr-modifiers.rs b/src/test/assembly/asm/avr-modifiers.rs
index aba4c982c..ffdc8f2e3 100644
--- a/src/test/assembly/asm/avr-modifiers.rs
+++ b/src/test/assembly/asm/avr-modifiers.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target avr-unknown-gnu-atmega328
// needs-llvm-components: avr
diff --git a/src/test/assembly/asm/avr-types.rs b/src/test/assembly/asm/avr-types.rs
index 53a601e51..b2d11a882 100644
--- a/src/test/assembly/asm/avr-types.rs
+++ b/src/test/assembly/asm/avr-types.rs
@@ -1,9 +1,8 @@
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target avr-unknown-gnu-atmega328
// needs-llvm-components: avr
-#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(non_camel_case_types)]
diff --git a/src/test/assembly/asm/bpf-types.rs b/src/test/assembly/asm/bpf-types.rs
index 3428d93fb..e177b8d0d 100644
--- a/src/test/assembly/asm/bpf-types.rs
+++ b/src/test/assembly/asm/bpf-types.rs
@@ -1,9 +1,8 @@
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target bpfel-unknown-none -C target_feature=+alu32
// needs-llvm-components: bpf
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/asm/global_asm.rs b/src/test/assembly/asm/global_asm.rs
index 4cf73b40f..0b361a7ed 100644
--- a/src/test/assembly/asm/global_asm.rs
+++ b/src/test/assembly/asm/global_asm.rs
@@ -4,7 +4,7 @@
// compile-flags: -C llvm-args=--x86-asm-syntax=intel
// compile-flags: -C symbol-mangling-version=v0
-#![feature(asm_const, asm_sym)]
+#![feature(asm_const)]
#![crate_type = "rlib"]
use std::arch::global_asm;
@@ -28,4 +28,6 @@ global_asm!("lea rax, [rip + {}]", sym MY_STATIC);
// CHECK: call _RNvCsiubXh4Yz005_10global_asm6foobar
global_asm!("call {}", sym foobar);
// CHECK: _RNvCsiubXh4Yz005_10global_asm6foobar:
-fn foobar() { loop {} }
+fn foobar() {
+ loop {}
+}
diff --git a/src/test/assembly/asm/hexagon-types.rs b/src/test/assembly/asm/hexagon-types.rs
index eff9a0bb4..af16faedb 100644
--- a/src/test/assembly/asm/hexagon-types.rs
+++ b/src/test/assembly/asm/hexagon-types.rs
@@ -2,7 +2,7 @@
// compile-flags: --target hexagon-unknown-linux-musl
// needs-llvm-components: hexagon
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/asm/mips-types.rs b/src/test/assembly/asm/mips-types.rs
index 04bf49a40..6aa28b062 100644
--- a/src/test/assembly/asm/mips-types.rs
+++ b/src/test/assembly/asm/mips-types.rs
@@ -5,7 +5,7 @@
//[mips64] compile-flags: --target mips64-unknown-linux-gnuabi64
//[mips64] needs-llvm-components: mips
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/asm/msp430-types.rs b/src/test/assembly/asm/msp430-types.rs
index 6cfb86e27..2c73b3b09 100644
--- a/src/test/assembly/asm/msp430-types.rs
+++ b/src/test/assembly/asm/msp430-types.rs
@@ -1,9 +1,8 @@
-// min-llvm-version: 13.0
// assembly-output: emit-asm
// compile-flags: --target msp430-none-elf
// needs-llvm-components: msp430
-#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch, asm_const)]
+#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch, asm_const)]
#![crate_type = "rlib"]
#![no_core]
#![allow(non_camel_case_types)]
diff --git a/src/test/assembly/asm/nvptx-types.rs b/src/test/assembly/asm/nvptx-types.rs
index 3ebd5b4b8..c319946b5 100644
--- a/src/test/assembly/asm/nvptx-types.rs
+++ b/src/test/assembly/asm/nvptx-types.rs
@@ -3,7 +3,7 @@
// compile-flags: --crate-type cdylib
// needs-llvm-components: nvptx
-#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
#![no_core]
#[rustc_builtin_macro]
diff --git a/src/test/assembly/asm/powerpc-types.rs b/src/test/assembly/asm/powerpc-types.rs
index b8859c07e..e27b00520 100644
--- a/src/test/assembly/asm/powerpc-types.rs
+++ b/src/test/assembly/asm/powerpc-types.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 12.0.1
// revisions: powerpc powerpc64
// assembly-output: emit-asm
//[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
@@ -6,7 +5,7 @@
//[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu
//[powerpc64] needs-llvm-components: powerpc
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/asm/riscv-types.rs b/src/test/assembly/asm/riscv-types.rs
index 68dc186ea..f18ba294d 100644
--- a/src/test/assembly/asm/riscv-types.rs
+++ b/src/test/assembly/asm/riscv-types.rs
@@ -6,7 +6,7 @@
//[riscv32] needs-llvm-components: riscv
// compile-flags: -C target-feature=+d
-#![feature(no_core, lang_items, rustc_attrs, asm_sym)]
+#![feature(no_core, lang_items, rustc_attrs)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register)]
diff --git a/src/test/assembly/asm/s390x-types.rs b/src/test/assembly/asm/s390x-types.rs
index 6a12902a0..2fb404dd9 100644
--- a/src/test/assembly/asm/s390x-types.rs
+++ b/src/test/assembly/asm/s390x-types.rs
@@ -3,7 +3,7 @@
//[s390x] compile-flags: --target s390x-unknown-linux-gnu
//[s390x] needs-llvm-components: systemz
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/asm/wasm-types.rs b/src/test/assembly/asm/wasm-types.rs
index 3aa128c46..3b1ac1b45 100644
--- a/src/test/assembly/asm/wasm-types.rs
+++ b/src/test/assembly/asm/wasm-types.rs
@@ -3,7 +3,7 @@
// compile-flags: --crate-type cdylib
// needs-llvm-components: webassembly
-#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch)]
+#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
#![no_core]
#[rustc_builtin_macro]
diff --git a/src/test/assembly/asm/x86-types.rs b/src/test/assembly/asm/x86-types.rs
index e871535cf..81be79cba 100644
--- a/src/test/assembly/asm/x86-types.rs
+++ b/src/test/assembly/asm/x86-types.rs
@@ -7,7 +7,7 @@
// compile-flags: -C llvm-args=--x86-asm-syntax=intel
// compile-flags: -C target-feature=+avx512bw
-#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)]
+#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
#![crate_type = "rlib"]
#![no_core]
#![allow(asm_sub_register, non_camel_case_types)]
diff --git a/src/test/assembly/stack-protector/stack-protector-target-support.rs b/src/test/assembly/stack-protector/stack-protector-target-support.rs
index 5ba46d082..2fb62e93e 100644
--- a/src/test/assembly/stack-protector/stack-protector-target-support.rs
+++ b/src/test/assembly/stack-protector/stack-protector-target-support.rs
@@ -156,7 +156,6 @@
// [r74] needs-llvm-components: x86
// [r75] compile-flags:--target x86_64-fortanix-unknown-sgx
// [r75] needs-llvm-components: x86
-// [r75] min-llvm-version: 11.0.0
// [r76] compile-flags:--target x86_64-fuchsia
// [r76] needs-llvm-components: x86
// [r77] compile-flags:--target x86_64-linux-android
diff --git a/src/test/assembly/x86-stack-probes.rs b/src/test/assembly/x86-stack-probes.rs
new file mode 100644
index 000000000..c7141fb20
--- /dev/null
+++ b/src/test/assembly/x86-stack-probes.rs
@@ -0,0 +1,42 @@
+// min-llvm-version: 16
+// revisions: x86_64 i686
+// assembly-output: emit-asm
+//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
+//[x86_64] needs-llvm-components: x86
+//[i686] compile-flags: --target i686-unknown-linux-gnu
+//[i686] needs-llvm-components: x86
+// compile-flags: -C llvm-args=-x86-asm-syntax=intel
+
+#![feature(no_core, lang_items)]
+#![crate_type = "lib"]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+#[lang = "copy"]
+trait Copy {}
+
+impl Copy for u8 {}
+
+// Check that inline-asm stack probes are generated correctly.
+// To avoid making this test fragile to slight asm changes,
+// we only check that the stack pointer is decremented by a page at a time,
+// instead of matching the whole probe sequence.
+
+// CHECK-LABEL: small_stack_probe:
+#[no_mangle]
+pub fn small_stack_probe(x: u8, f: fn(&mut [u8; 8192])) {
+ // CHECK-NOT: __rust_probestack
+ // x86_64: sub rsp, 4096
+ // i686: sub esp, 4096
+ f(&mut [x; 8192]);
+}
+
+// CHECK-LABEL: big_stack_probe:
+#[no_mangle]
+pub fn big_stack_probe(x: u8, f: fn(&[u8; 65536])) {
+ // CHECK-NOT: __rust_probestack
+ // x86_64: sub rsp, 4096
+ // i686: sub esp, 4096
+ f(&mut [x; 65536]);
+}
diff --git a/src/test/assembly/x86_64-floating-point-clamp.rs b/src/test/assembly/x86_64-floating-point-clamp.rs
new file mode 100644
index 000000000..0f3b465d0
--- /dev/null
+++ b/src/test/assembly/x86_64-floating-point-clamp.rs
@@ -0,0 +1,25 @@
+// Floating-point clamp is designed to be implementable as max+min,
+// so check to make sure that's what it's actually emitting.
+
+// assembly-output: emit-asm
+// compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
+// only-x86_64
+
+// CHECK-LABEL: clamp_demo:
+#[no_mangle]
+pub fn clamp_demo(a: f32, x: f32, y: f32) -> f32 {
+ // CHECK: maxss
+ // CHECK: minss
+ a.clamp(x, y)
+}
+
+// CHECK-LABEL: clamp12_demo:
+#[no_mangle]
+pub fn clamp12_demo(a: f32) -> f32 {
+ // CHECK: movss xmm1
+ // CHECK-NEXT: maxss xmm1, xmm0
+ // CHECK-NEXT: movss xmm0
+ // CHECK-NEXT: minss xmm0, xmm1
+ // CHECK: ret
+ a.clamp(1.0, 2.0)
+}
diff --git a/src/test/auxiliary/rust_test_helpers.c b/src/test/auxiliary/rust_test_helpers.c
index 92b7dd4b7..977ea487a 100644
--- a/src/test/auxiliary/rust_test_helpers.c
+++ b/src/test/auxiliary/rust_test_helpers.c
@@ -1,6 +1,7 @@
// Helper functions used only in tests
#include <stdint.h>
+#include <stdlib.h>
#include <assert.h>
#include <stdarg.h>
@@ -415,3 +416,14 @@ rust_dbg_unpack_option_u64u64(struct U8TaggedEnumOptionU64U64 o, uint64_t *a, ui
return 0;
}
}
+
+uint16_t issue_97463_leak_uninit_data(uint32_t a, uint32_t b, uint32_t c) {
+ struct bloc { uint16_t a; uint16_t b; uint16_t c; };
+ struct bloc *data = malloc(sizeof(struct bloc));
+
+ data->a = a & 0xFFFF;
+ data->b = b & 0xFFFF;
+ data->c = c & 0xFFFF;
+
+ return data->b; /* leak data */
+}
diff --git a/src/test/codegen-units/item-collection/asm-sym.rs b/src/test/codegen-units/item-collection/asm-sym.rs
new file mode 100644
index 000000000..8bafb95bc
--- /dev/null
+++ b/src/test/codegen-units/item-collection/asm-sym.rs
@@ -0,0 +1,20 @@
+// needs-asm-support
+// compile-flags: -Ccodegen-units=1 -Zprint-mono-items=lazy --crate-type=lib
+
+#[inline(always)]
+pub unsafe fn f() {
+ //~ MONO_ITEM static f::S @@ asm_sym-cgu.0[External]
+ static S: usize = 1;
+ //~ MONO_ITEM fn f::fun @@ asm_sym-cgu.0[External]
+ fn fun() {}
+ core::arch::asm!("/* {0} {1} */", sym S, sym fun);
+}
+
+//~ MONO_ITEM fn g @@ asm_sym-cgu.0[External]
+pub unsafe fn g() {
+ //~ MONO_ITEM static g::S @@ asm_sym-cgu.0[Internal]
+ static S: usize = 2;
+ //~ MONO_ITEM fn g::fun @@ asm_sym-cgu.0[Internal]
+ fn fun() {}
+ core::arch::asm!("/* {0} {1} */", sym S, sym fun);
+}
diff --git a/src/test/codegen-units/item-collection/generic-impl.rs b/src/test/codegen-units/item-collection/generic-impl.rs
index dd5367ef0..4260230c2 100644
--- a/src/test/codegen-units/item-collection/generic-impl.rs
+++ b/src/test/codegen-units/item-collection/generic-impl.rs
@@ -30,11 +30,11 @@ pub struct LifeTimeOnly<'a> {
impl<'a> LifeTimeOnly<'a> {
- //~ MONO_ITEM fn LifeTimeOnly::foo
+ //~ MONO_ITEM fn LifeTimeOnly::<'_>::foo
pub fn foo(&self) {}
- //~ MONO_ITEM fn LifeTimeOnly::bar
+ //~ MONO_ITEM fn LifeTimeOnly::<'_>::bar
pub fn bar(&'a self) {}
- //~ MONO_ITEM fn LifeTimeOnly::baz
+ //~ MONO_ITEM fn LifeTimeOnly::<'_>::baz
pub fn baz<'b>(&'b self) {}
pub fn non_instantiated<T>(&self) {}
diff --git a/src/test/codegen/README.md b/src/test/codegen/README.md
index 00de55eea..8f2daaafc 100644
--- a/src/test/codegen/README.md
+++ b/src/test/codegen/README.md
@@ -1,2 +1,24 @@
The files here use the LLVM FileCheck framework, documented at
<https://llvm.org/docs/CommandGuide/FileCheck.html>.
+
+One extension worth noting is the use of revisions as custom prefixes for
+FileCheck. If your codegen test has different behavior based on the chosen
+target or different compiler flags that you want to exercise, you can use a
+revisions annotation, like so:
+
+```rust
+// revisions: aaa bbb
+// [bbb] compile-flags: --flags-for-bbb
+```
+
+After specifying those variations, you can write different expected, or
+explicitly *unexpected* output by using `<prefix>-SAME:` and `<prefix>-NOT:`,
+like so:
+
+```rust
+// CHECK: expected code
+// aaa-SAME: emitted-only-for-aaa
+// aaa-NOT: emitted-only-for-bbb
+// bbb-NOT: emitted-only-for-aaa
+// bbb-SAME: emitted-only-for-bbb
+```
diff --git a/src/test/codegen/abi-main-signature-32bit-c-int.rs b/src/test/codegen/abi-main-signature-32bit-c-int.rs
index 31b19a542..7f22ddcfc 100644
--- a/src/test/codegen/abi-main-signature-32bit-c-int.rs
+++ b/src/test/codegen/abi-main-signature-32bit-c-int.rs
@@ -7,4 +7,4 @@
fn main() {
}
-// CHECK: define i32 @main(i32{{( %0)?}}, {{i8\*\*|ptr}}{{( %1)?}})
+// CHECK: define{{( hidden)?}} i32 @main(i32{{( %0)?}}, {{i8\*\*|ptr}}{{( %1)?}})
diff --git a/src/test/codegen/abi-repr-ext.rs b/src/test/codegen/abi-repr-ext.rs
index 2b34eaf94..23ade3c72 100644
--- a/src/test/codegen/abi-repr-ext.rs
+++ b/src/test/codegen/abi-repr-ext.rs
@@ -1,6 +1,32 @@
// compile-flags: -O
-#![crate_type="lib"]
+// revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv
+
+//[x86_64] compile-flags: --target x86_64-unknown-uefi
+//[x86_64] needs-llvm-components: x86
+//[i686] compile-flags: --target i686-unknown-linux-musl
+//[i686] needs-llvm-components: x86
+//[aarch64-windows] compile-flags: --target aarch64-pc-windows-msvc
+//[aarch64-windows] needs-llvm-components: aarch64
+//[aarch64-linux] compile-flags: --target aarch64-unknown-linux-gnu
+//[aarch64-linux] needs-llvm-components: aarch64
+//[aarch64-apple] compile-flags: --target aarch64-apple-darwin
+//[aarch64-apple] needs-llvm-components: aarch64
+//[arm] compile-flags: --target armv7r-none-eabi
+//[arm] needs-llvm-components: arm
+//[riscv] compile-flags: --target riscv64gc-unknown-none-elf
+//[riscv] needs-llvm-components: riscv
+
+// See bottom of file for a corresponding C source file that is meant to yield
+// equivalent declarations.
+#![feature(no_core, lang_items)]
+#![crate_type = "lib"]
+#![no_std]
+#![no_core]
+
+#[lang="sized"] trait Sized { }
+#[lang="freeze"] trait Freeze { }
+#[lang="copy"] trait Copy { }
#[repr(i8)]
pub enum Type {
@@ -8,7 +34,23 @@ pub enum Type {
Type2 = 1
}
-// CHECK: define{{( dso_local)?}} noundef signext i8 @test()
+// To accommodate rust#97800, one might consider writing the below as:
+//
+// `define{{( dso_local)?}} noundef{{( signext)?}} i8 @test()`
+//
+// but based on rust#80556, it seems important to actually check for the
+// presence of the `signext` for those targets where we expect it.
+
+// CHECK: define{{( dso_local)?}} noundef
+// x86_64-SAME: signext
+// aarch64-apple-SAME: signext
+// aarch64-windows-NOT: signext
+// aarch64-linux-NOT: signext
+// arm-SAME: signext
+// riscv-SAME: signext
+// CHECK-SAME: i8 @test()
+
+
#[no_mangle]
pub extern "C" fn test() -> Type {
Type::Type1
diff --git a/src/test/codegen/asm-may_unwind.rs b/src/test/codegen/asm-may_unwind.rs
index bf4202764..c97933035 100644
--- a/src/test/codegen/asm-may_unwind.rs
+++ b/src/test/codegen/asm-may_unwind.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
// compile-flags: -O
// only-x86_64
diff --git a/src/test/codegen/async-fn-debug-awaitee-field.rs b/src/test/codegen/async-fn-debug-awaitee-field.rs
index efb345fa9..909cd0062 100644
--- a/src/test/codegen/async-fn-debug-awaitee-field.rs
+++ b/src/test/codegen/async-fn-debug-awaitee-field.rs
@@ -12,11 +12,11 @@ async fn async_fn_test() {
}
// NONMSVC: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "{async_fn_env#0}",
-// MSVC: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum$<async_fn_debug_awaitee_field::async_fn_test::async_fn_env$0>",
+// MSVC: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<async_fn_debug_awaitee_field::async_fn_test::async_fn_env$0>",
// CHECK: [[SUSPEND_STRUCT:!.*]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Suspend0", scope: [[GEN]],
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "__awaitee", scope: [[SUSPEND_STRUCT]], {{.*}}, baseType: [[AWAITEE_TYPE:![0-9]*]],
// NONMSVC: [[AWAITEE_TYPE]] = !DICompositeType(tag: DW_TAG_structure_type, name: "GenFuture<async_fn_debug_awaitee_field::foo::{async_fn_env#0}>",
-// MSVC: [[AWAITEE_TYPE]] = !DICompositeType(tag: DW_TAG_structure_type, name: "GenFuture<enum$<async_fn_debug_awaitee_field::foo::async_fn_env$0> >",
+// MSVC: [[AWAITEE_TYPE]] = !DICompositeType(tag: DW_TAG_structure_type, name: "GenFuture<enum2$<async_fn_debug_awaitee_field::foo::async_fn_env$0> >",
fn main() {
let _fn = async_fn_test();
diff --git a/src/test/codegen/async-fn-debug-msvc.rs b/src/test/codegen/async-fn-debug-msvc.rs
index 8995605e3..73c652c9d 100644
--- a/src/test/codegen/async-fn-debug-msvc.rs
+++ b/src/test/codegen/async-fn-debug-msvc.rs
@@ -16,7 +16,7 @@ async fn async_fn_test() {
// FIXME: No way to reliably check the filename.
-// CHECK-DAG: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum$<async_fn_debug_msvc::async_fn_test::async_fn_env$0>",
+// CHECK-DAG: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<async_fn_debug_msvc::async_fn_test::async_fn_env$0>",
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant0", scope: [[GEN]],
// For brevity, we only check the struct name and members of the last variant.
// CHECK-SAME: file: [[FILE:![0-9]*]], line: 11,
@@ -36,16 +36,17 @@ async fn async_fn_test() {
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant4", scope: [[GEN]],
// CHECK-SAME: file: [[FILE]], line: 14,
-// CHECK-SAME: baseType: [[VARIANT:![0-9]*]]
+// CHECK-SAME: baseType: [[VARIANT_WRAPPER:![0-9]*]]
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
+// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "value", scope: [[VARIANT_WRAPPER]], file: !2, baseType: [[VARIANT:![0-9]*]],
// CHECK: [[VARIANT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Suspend1", scope: [[GEN]],
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: [[VARIANT]]
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
-// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "discriminant", scope: [[GEN]],
+// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "tag", scope: [[GEN]],
// CHECK-NOT: flags: DIFlagArtificial
fn main() {
diff --git a/src/test/codegen/atomic-operations-llvm-12.rs b/src/test/codegen/atomic-operations-llvm-12.rs
deleted file mode 100644
index bd4c63dcf..000000000
--- a/src/test/codegen/atomic-operations-llvm-12.rs
+++ /dev/null
@@ -1,84 +0,0 @@
-// Code generation of atomic operations for LLVM 12
-// ignore-llvm-version: 13 - 99
-// compile-flags: -O
-#![crate_type = "lib"]
-
-use std::sync::atomic::{AtomicI32, Ordering::*};
-
-// CHECK-LABEL: @compare_exchange
-#[no_mangle]
-pub fn compare_exchange(a: &AtomicI32) {
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 10 monotonic monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 11 acquire acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 12 seq_cst seq_cst
- let _ = a.compare_exchange(0, 10, Relaxed, Relaxed);
- let _ = a.compare_exchange(0, 11, Relaxed, Acquire);
- let _ = a.compare_exchange(0, 12, Relaxed, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 20 release monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 21 acq_rel acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 22 seq_cst seq_cst
- let _ = a.compare_exchange(0, 20, Release, Relaxed);
- let _ = a.compare_exchange(0, 21, Release, Acquire);
- let _ = a.compare_exchange(0, 22, Release, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 30 acquire monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 31 acquire acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 32 seq_cst seq_cst
- let _ = a.compare_exchange(0, 30, Acquire, Relaxed);
- let _ = a.compare_exchange(0, 31, Acquire, Acquire);
- let _ = a.compare_exchange(0, 32, Acquire, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 40 acq_rel monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 41 acq_rel acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 42 seq_cst seq_cst
- let _ = a.compare_exchange(0, 40, AcqRel, Relaxed);
- let _ = a.compare_exchange(0, 41, AcqRel, Acquire);
- let _ = a.compare_exchange(0, 42, AcqRel, SeqCst);
-
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 50 seq_cst monotonic
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 51 seq_cst acquire
- // CHECK: cmpxchg i32* %{{.*}}, i32 0, i32 52 seq_cst seq_cst
- let _ = a.compare_exchange(0, 50, SeqCst, Relaxed);
- let _ = a.compare_exchange(0, 51, SeqCst, Acquire);
- let _ = a.compare_exchange(0, 52, SeqCst, SeqCst);
-}
-
-// CHECK-LABEL: @compare_exchange_weak
-#[no_mangle]
-pub fn compare_exchange_weak(w: &AtomicI32) {
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 10 monotonic monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 11 acquire acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 12 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 10, Relaxed, Relaxed);
- let _ = w.compare_exchange_weak(1, 11, Relaxed, Acquire);
- let _ = w.compare_exchange_weak(1, 12, Relaxed, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 20 release monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 21 acq_rel acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 22 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 20, Release, Relaxed);
- let _ = w.compare_exchange_weak(1, 21, Release, Acquire);
- let _ = w.compare_exchange_weak(1, 22, Release, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 30 acquire monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 31 acquire acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 32 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 30, Acquire, Relaxed);
- let _ = w.compare_exchange_weak(1, 31, Acquire, Acquire);
- let _ = w.compare_exchange_weak(1, 32, Acquire, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 40 acq_rel monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 41 acq_rel acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 42 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 40, AcqRel, Relaxed);
- let _ = w.compare_exchange_weak(1, 41, AcqRel, Acquire);
- let _ = w.compare_exchange_weak(1, 42, AcqRel, SeqCst);
-
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 50 seq_cst monotonic
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 51 seq_cst acquire
- // CHECK: cmpxchg weak i32* %{{.*}}, i32 1, i32 52 seq_cst seq_cst
- let _ = w.compare_exchange_weak(1, 50, SeqCst, Relaxed);
- let _ = w.compare_exchange_weak(1, 51, SeqCst, Acquire);
- let _ = w.compare_exchange_weak(1, 52, SeqCst, SeqCst);
-}
diff --git a/src/test/codegen/atomic-operations.rs b/src/test/codegen/atomic-operations.rs
index 771cf5872..d2bc618df 100644
--- a/src/test/codegen/atomic-operations.rs
+++ b/src/test/codegen/atomic-operations.rs
@@ -1,5 +1,4 @@
// Code generation of atomic operations.
-// min-llvm-version: 13.0
// compile-flags: -O
#![crate_type = "lib"]
diff --git a/src/test/codegen/avr/avr-func-addrspace.rs b/src/test/codegen/avr/avr-func-addrspace.rs
index 530164edd..a038dfe76 100644
--- a/src/test/codegen/avr/avr-func-addrspace.rs
+++ b/src/test/codegen/avr/avr-func-addrspace.rs
@@ -77,7 +77,7 @@ fn update_bar_value() {
}
}
-// CHECK: define void @test(){{.+}}addrspace(1)
+// CHECK: define dso_local void @test(){{.+}}addrspace(1)
#[no_mangle]
pub extern "C" fn test() {
let mut buf = 7;
diff --git a/src/test/codegen/binary-search-index-no-bound-check.rs b/src/test/codegen/binary-search-index-no-bound-check.rs
index 2deabcaa6..c1766a4a4 100644
--- a/src/test/codegen/binary-search-index-no-bound-check.rs
+++ b/src/test/codegen/binary-search-index-no-bound-check.rs
@@ -16,3 +16,23 @@ pub fn binary_search_index_no_bounds_check(s: &[u8]) -> u8 {
42
}
}
+
+// Similarly, check that `partition_point` is known to return a valid fencepost.
+
+// CHECK-LABEL: @unknown_split
+#[no_mangle]
+pub fn unknown_split(x: &[i32], i: usize) -> (&[i32], &[i32]) {
+ // This just makes sure that the subsequent function is looking for the
+ // absence of something that might actually be there.
+
+ // CHECK: call core::panicking::panic
+ x.split_at(i)
+}
+
+// CHECK-LABEL: @partition_point_split_no_bounds_check
+#[no_mangle]
+pub fn partition_point_split_no_bounds_check(x: &[i32], needle: i32) -> (&[i32], &[i32]) {
+ // CHECK-NOT: call core::panicking::panic
+ let i = x.partition_point(|p| p < &needle);
+ x.split_at(i)
+}
diff --git a/src/test/codegen/branch-protection.rs b/src/test/codegen/branch-protection.rs
index b23073778..994c71b26 100644
--- a/src/test/codegen/branch-protection.rs
+++ b/src/test/codegen/branch-protection.rs
@@ -1,7 +1,6 @@
// Test that the correct module flags are emitted with different branch protection flags.
// revisions: BTI PACRET LEAF BKEY NONE
-// min-llvm-version: 12.0.0
// needs-llvm-components: aarch64
// [BTI] compile-flags: -Z branch-protection=bti
// [PACRET] compile-flags: -Z branch-protection=pac-ret
diff --git a/src/test/codegen/debug-vtable.rs b/src/test/codegen/debug-vtable.rs
index b9cb4f93d..bdd312878 100644
--- a/src/test/codegen/debug-vtable.rs
+++ b/src/test/codegen/debug-vtable.rs
@@ -46,7 +46,7 @@
// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "align", scope: ![[VTABLE_TY2]], {{.*}}, baseType: ![[USIZE]], size: {{64|32}}, align: {{64|32}}, offset: {{128|64}})
// NONMSVC: !DIGlobalVariable(name: "<debug_vtable::bar::{closure_env#0} as core::ops::function::FnOnce<(core::option::Option<&dyn core::ops::function::Fn<(), Output=()>>)>>::{vtable}"
-// MSVC: !DIGlobalVariable(name: "impl$<debug_vtable::bar::closure_env$0, core::ops::function::FnOnce<tuple$<enum$<core::option::Option<ref$<dyn$<core::ops::function::Fn<tuple$<>,assoc$<Output,tuple$<> > > > > >, {{.*}}, {{.*}}, Some> > > >::vtable$"
+// MSVC: !DIGlobalVariable(name: "impl$<debug_vtable::bar::closure_env$0, core::ops::function::FnOnce<tuple$<enum2$<core::option::Option<ref$<dyn$<core::ops::function::Fn<tuple$<>,assoc$<Output,tuple$<> > > > > > > > > >::vtable$"
// NONMSVC: !DIGlobalVariable(name: "<debug_vtable::generic_closure::{closure_env#0}<bool> as core::ops::function::FnOnce<()>>::{vtable}"
// MSVC: !DIGlobalVariable(name: "impl$<debug_vtable::generic_closure::closure_env$0<bool>, core::ops::function::FnOnce<tuple$<> > >::vtable$
diff --git a/src/test/codegen/deduced-param-attrs.rs b/src/test/codegen/deduced-param-attrs.rs
new file mode 100644
index 000000000..153046eef
--- /dev/null
+++ b/src/test/codegen/deduced-param-attrs.rs
@@ -0,0 +1,60 @@
+// compile-flags: -O
+
+#![crate_type = "lib"]
+#![allow(incomplete_features)]
+#![feature(unsized_locals, unsized_fn_params)]
+
+use std::cell::Cell;
+use std::hint;
+
+// Check to make sure that we can deduce the `readonly` attribute from function bodies for
+// parameters passed indirectly.
+
+pub struct BigStruct {
+ blah: [i32; 1024],
+}
+
+pub struct BigCellContainer {
+ blah: [Cell<i32>; 1024],
+}
+
+// The by-value parameter for this big struct can be marked readonly.
+//
+// CHECK: @use_big_struct_immutably({{.*}} readonly {{.*}} %big_struct)
+#[no_mangle]
+pub fn use_big_struct_immutably(big_struct: BigStruct) {
+ hint::black_box(&big_struct);
+}
+
+// The by-value parameter for this big struct can't be marked readonly, because we mutate it.
+//
+// CHECK-NOT: @use_big_struct_mutably({{.*}} readonly {{.*}} %big_struct)
+#[no_mangle]
+pub fn use_big_struct_mutably(mut big_struct: BigStruct) {
+ big_struct.blah[987] = 654;
+ hint::black_box(&big_struct);
+}
+
+// The by-value parameter for this big struct can't be marked readonly, because it contains
+// UnsafeCell.
+//
+// CHECK-NOT: @use_big_cell_container({{.*}} readonly {{.*}} %big_cell_container)
+#[no_mangle]
+pub fn use_big_cell_container(big_cell_container: BigCellContainer) {
+ hint::black_box(&big_cell_container);
+}
+
+// Make sure that we don't mistakenly mark a big struct as `readonly` when passed through a generic
+// type parameter if it contains UnsafeCell.
+//
+// CHECK-NOT: @use_something({{.*}} readonly {{.*}} %something)
+#[no_mangle]
+#[inline(never)]
+pub fn use_something<T>(something: T) {
+ hint::black_box(&something);
+}
+
+#[no_mangle]
+pub fn forward_big_cell_container(big_cell_container: BigCellContainer) {
+ use_something(big_cell_container)
+}
diff --git a/src/test/codegen/external-no-mangle-statics.rs b/src/test/codegen/external-no-mangle-statics.rs
index 6274434cd..c6ecb7aa9 100644
--- a/src/test/codegen/external-no-mangle-statics.rs
+++ b/src/test/codegen/external-no-mangle-statics.rs
@@ -1,12 +1,11 @@
// revisions: lib staticlib
// ignore-emscripten default visibility is hidden
// compile-flags: -O
+// [lib] compile-flags: --crate-type lib
+// [staticlib] compile-flags: --crate-type staticlib
// `#[no_mangle]`d static variables always have external linkage, i.e., no `internal` in their
// definitions
-#![cfg_attr(lib, crate_type = "lib")]
-#![cfg_attr(staticlib, crate_type = "staticlib")]
-
// CHECK: @A = local_unnamed_addr constant
#[no_mangle]
static A: u8 = 0;
diff --git a/src/test/codegen/function-arguments.rs b/src/test/codegen/function-arguments.rs
index bc650ebf5..44fee9523 100644
--- a/src/test/codegen/function-arguments.rs
+++ b/src/test/codegen/function-arguments.rs
@@ -127,7 +127,7 @@ pub fn mutable_notunpin_borrow(_: &mut NotUnpin) {
pub fn notunpin_borrow(_: &NotUnpin) {
}
-// CHECK: @indirect_struct({{%S\*|ptr}} noalias nocapture noundef dereferenceable(32) %_1)
+// CHECK: @indirect_struct({{%S\*|ptr}} noalias nocapture noundef readonly dereferenceable(32) %_1)
#[no_mangle]
pub fn indirect_struct(_: S) {
}
diff --git a/src/test/codegen/generator-debug-msvc.rs b/src/test/codegen/generator-debug-msvc.rs
index 033da80be..9d70ccdef 100644
--- a/src/test/codegen/generator-debug-msvc.rs
+++ b/src/test/codegen/generator-debug-msvc.rs
@@ -20,18 +20,18 @@ fn generator_test() -> impl Generator<Yield = i32, Return = ()> {
// FIXME: No way to reliably check the filename.
-// CHECK-DAG: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum$<generator_debug_msvc::generator_test::generator_env$0>"
+// CHECK-DAG: [[GEN:!.*]] = !DICompositeType(tag: DW_TAG_union_type, name: "enum2$<generator_debug_msvc::generator_test::generator_env$0>"
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant0", scope: [[GEN]],
// For brevity, we only check the struct name and members of the last variant.
// CHECK-SAME: file: [[FILE:![0-9]*]], line: 14,
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant1", scope: [[GEN]],
-// CHECK-SAME: file: [[FILE]], line: 14,
+// CHECK-SAME: file: [[FILE]], line: 18,
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant2", scope: [[GEN]],
-// CHECK-SAME: file: [[FILE]], line: 14,
+// CHECK-SAME: file: [[FILE]], line: 18,
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant3", scope: [[GEN]],
@@ -40,16 +40,18 @@ fn generator_test() -> impl Generator<Yield = i32, Return = ()> {
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "variant4", scope: [[GEN]],
// CHECK-SAME: file: [[FILE]], line: 17,
-// CHECK-SAME: baseType: [[VARIANT:![0-9]*]]
+// CHECK-SAME: baseType: [[VARIANT_WRAPPER:![0-9]*]]
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
+// CHECK: [[VARIANT_WRAPPER]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Variant4", scope: [[GEN]],
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "value", scope: [[VARIANT_WRAPPER]], {{.*}}, baseType: [[VARIANT:![0-9]*]],
// CHECK: [[VARIANT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "Suspend1", scope: [[GEN]],
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: [[VARIANT]]
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
-// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "discriminant", scope: [[GEN]],
+// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "tag", scope: [[GEN]],
// CHECK-NOT: flags: DIFlagArtificial
fn main() {
diff --git a/src/test/codegen/generator-debug.rs b/src/test/codegen/generator-debug.rs
index 9c9f5518b..3ec860f2c 100644
--- a/src/test/codegen/generator-debug.rs
+++ b/src/test/codegen/generator-debug.rs
@@ -33,11 +33,11 @@ fn generator_test() -> impl Generator<Yield = i32, Return = ()> {
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "1", scope: [[VARIANT]],
-// CHECK-SAME: file: [[FILE]], line: 14,
+// CHECK-SAME: file: [[FILE]], line: 18,
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "2", scope: [[VARIANT]],
-// CHECK-SAME: file: [[FILE]], line: 14,
+// CHECK-SAME: file: [[FILE]], line: 18,
// CHECK-NOT: flags: DIFlagArtificial
// CHECK-SAME: )
// CHECK: {{!.*}} = !DIDerivedType(tag: DW_TAG_member, name: "3", scope: [[VARIANT]],
diff --git a/src/test/codegen/instrument-coverage.rs b/src/test/codegen/instrument-coverage.rs
new file mode 100644
index 000000000..78f8875a2
--- /dev/null
+++ b/src/test/codegen/instrument-coverage.rs
@@ -0,0 +1,17 @@
+// Test that `-Cinstrument-coverage` creates expected __llvm_profile_filename symbol in LLVM IR.
+
+// needs-profiler-support
+// compile-flags: -Cinstrument-coverage
+
+// CHECK: @__llvm_profile_filename = {{.*}}"default_%m_%p.profraw\00"{{.*}}
+
+#![crate_type="lib"]
+
+#[inline(never)]
+fn some_function() {
+
+}
+
+pub fn some_other_function() {
+ some_function();
+}
diff --git a/src/test/codegen/intrinsics/mask.rs b/src/test/codegen/intrinsics/mask.rs
new file mode 100644
index 000000000..2e984db1b
--- /dev/null
+++ b/src/test/codegen/intrinsics/mask.rs
@@ -0,0 +1,11 @@
+#![crate_type = "lib"]
+#![feature(core_intrinsics)]
+
+// CHECK-LABEL: @mask_ptr
+// CHECK-SAME: [[WORD:i[0-9]+]] %mask
+#[no_mangle]
+pub fn mask_ptr(ptr: *const u16, mask: usize) -> *const u16 {
+ // CHECK: call
+ // CHECK-SAME: @llvm.ptrmask.{{p0|p0i8}}.[[WORD]]({{ptr|i8\*}} {{%ptr|%0}}, [[WORD]] %mask)
+ core::intrinsics::ptr_mask(ptr, mask)
+}
diff --git a/src/test/codegen/issue-34634.rs b/src/test/codegen/issue-34634.rs
index 6c18adbcb..f53fa240c 100644
--- a/src/test/codegen/issue-34634.rs
+++ b/src/test/codegen/issue-34634.rs
@@ -1,5 +1,5 @@
// Test that `wrapping_div` only checks divisor once.
-// This test checks that there is only a single compare agains -1 and -1 is not present as a
+// This test checks that there is only a single compare against -1 and -1 is not present as a
// switch case (the second check present until rustc 1.12).
// This test also verifies that a single panic call is generated (for the division by zero case).
diff --git a/src/test/codegen/issue-85872-multiple-reverse.rs b/src/test/codegen/issue-85872-multiple-reverse.rs
new file mode 100644
index 000000000..591a1aca7
--- /dev/null
+++ b/src/test/codegen/issue-85872-multiple-reverse.rs
@@ -0,0 +1,20 @@
+// min-llvm-version: 15.0.0
+// compile-flags: -O
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn u16_be_to_arch(mut data: [u8; 2]) -> [u8; 2] {
+ // CHECK-LABEL: @u16_be_to_arch
+ // CHECK: @llvm.bswap.i16
+ data.reverse();
+ data
+}
+
+#[no_mangle]
+pub fn u32_be_to_arch(mut data: [u8; 4]) -> [u8; 4] {
+ // CHECK-LABEL: @u32_be_to_arch
+ // CHECK: @llvm.bswap.i32
+ data.reverse();
+ data
+}
diff --git a/src/test/codegen/issue-96274.rs b/src/test/codegen/issue-96274.rs
new file mode 100644
index 000000000..28bfcce0d
--- /dev/null
+++ b/src/test/codegen/issue-96274.rs
@@ -0,0 +1,17 @@
+// min-llvm-version: 15.0
+// compile-flags: -O
+
+#![crate_type = "lib"]
+#![feature(inline_const)]
+
+use std::mem::MaybeUninit;
+
+pub fn maybe_uninit() -> [MaybeUninit<u8>; 3000] {
+ // CHECK-NOT: memset
+ [MaybeUninit::uninit(); 3000]
+}
+
+pub fn maybe_uninit_const<T>() -> [MaybeUninit<T>; 8192] {
+ // CHECK-NOT: memset
+ [const { MaybeUninit::uninit() }; 8192]
+}
diff --git a/src/test/codegen/issue-98294-get-mut-copy-from-slice-opt.rs b/src/test/codegen/issue-98294-get-mut-copy-from-slice-opt.rs
new file mode 100644
index 000000000..7da29cd79
--- /dev/null
+++ b/src/test/codegen/issue-98294-get-mut-copy-from-slice-opt.rs
@@ -0,0 +1,19 @@
+// min-llvm-version: 15.0.0
+// ignore-debug: The debug assertions get in the way
+// compile-flags: -O
+
+#![crate_type = "lib"]
+
+// There should be no calls to panic / len_mismatch_fail.
+
+#[no_mangle]
+pub fn test(a: &mut [u8], offset: usize, bytes: &[u8]) {
+ // CHECK-LABEL: @test(
+ // CHECK-NOT: call
+ // CHECK: call void @llvm.memcpy
+ // CHECK-NOT: call
+ // CHECK: }
+ if let Some(dst) = a.get_mut(offset..offset + bytes.len()) {
+ dst.copy_from_slice(bytes);
+ }
+}
diff --git a/src/test/codegen/layout-size-checks.rs b/src/test/codegen/layout-size-checks.rs
new file mode 100644
index 000000000..d067cc10a
--- /dev/null
+++ b/src/test/codegen/layout-size-checks.rs
@@ -0,0 +1,31 @@
+// compile-flags: -O
+// only-x86_64
+// ignore-debug: the debug assertions get in the way
+
+#![crate_type = "lib"]
+
+use std::alloc::Layout;
+
+type RGB48 = [u16; 3];
+
+// CHECK-LABEL: @layout_array_rgb48
+#[no_mangle]
+pub fn layout_array_rgb48(n: usize) -> Layout {
+ // CHECK-NOT: llvm.umul.with.overflow.i64
+ // CHECK: icmp ugt i64 %n, 1537228672809129301
+ // CHECK-NOT: llvm.umul.with.overflow.i64
+ // CHECK: mul nuw nsw i64 %n, 6
+ // CHECK-NOT: llvm.umul.with.overflow.i64
+ Layout::array::<RGB48>(n).unwrap()
+}
+
+// CHECK-LABEL: @layout_array_i32
+#[no_mangle]
+pub fn layout_array_i32(n: usize) -> Layout {
+ // CHECK-NOT: llvm.umul.with.overflow.i64
+ // CHECK: icmp ugt i64 %n, 2305843009213693951
+ // CHECK-NOT: llvm.umul.with.overflow.i64
+ // CHECK: shl nuw nsw i64 %n, 2
+ // CHECK-NOT: llvm.umul.with.overflow.i64
+ Layout::array::<i32>(n).unwrap()
+}
diff --git a/src/test/codegen/mem-replace-direct-memcpy.rs b/src/test/codegen/mem-replace-direct-memcpy.rs
index 8095d309f..4318e926e 100644
--- a/src/test/codegen/mem-replace-direct-memcpy.rs
+++ b/src/test/codegen/mem-replace-direct-memcpy.rs
@@ -1,21 +1,10 @@
-// ignore-test
-
-// WHY IS THIS TEST BEING IGNORED:
-//
-// This test depends on characteristics of how the stdlib was compiled,
-// namely that sufficient inlining occurred to ensure that the call to
-// `std::mem::replace` boils down to just two calls of `llvm.memcpy`.
-//
-// But the MIR inlining policy is in flux as of 1.64-beta, and the intermittent
-// breakage of this test that results is causing problems for people trying to
-// do development.
-
// 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"]
diff --git a/src/test/codegen/merge-functions.rs b/src/test/codegen/merge-functions.rs
index 5eefc0f98..8e8fe5c96 100644
--- a/src/test/codegen/merge-functions.rs
+++ b/src/test/codegen/merge-functions.rs
@@ -1,7 +1,10 @@
-// compile-flags: -O
+// min-llvm-version: 14.0
+// revisions: O Os
+//[Os] compile-flags: -Copt-level=s
+//[O] compile-flags: -O
#![crate_type = "lib"]
-// CHECK: @func2 = {{.*}}alias{{.*}}@func1
+// CHECK: @func{{2|1}} = {{.*}}alias{{.*}}@func{{1|2}}
#[no_mangle]
pub fn func1(c: char) -> bool {
diff --git a/src/test/codegen/mir-inlined-line-numbers.rs b/src/test/codegen/mir-inlined-line-numbers.rs
new file mode 100644
index 000000000..19d83f0ee
--- /dev/null
+++ b/src/test/codegen/mir-inlined-line-numbers.rs
@@ -0,0 +1,25 @@
+// compile-flags: -O -g
+
+#![crate_type = "lib"]
+
+#[inline(always)]
+fn foo() {
+ bar();
+}
+
+#[inline(never)]
+#[no_mangle]
+fn bar() {
+ panic!();
+}
+
+#[no_mangle]
+pub fn example() {
+ foo();
+}
+
+// CHECK-LABEL: @example
+// CHECK: tail call void @bar(), !dbg [[DBG_ID:![0-9]+]]
+// CHECK: [[DBG_ID]] = !DILocation(line: 7,
+// CHECK-SAME: inlinedAt: [[INLINE_ID:![0-9]+]])
+// CHECK: [[INLINE_ID]] = !DILocation(line: 18,
diff --git a/src/test/codegen/pic-relocation-model.rs b/src/test/codegen/pic-relocation-model.rs
index 6e1d5a6c3..602a08067 100644
--- a/src/test/codegen/pic-relocation-model.rs
+++ b/src/test/codegen/pic-relocation-model.rs
@@ -10,7 +10,10 @@ pub fn call_foreign_fn() -> u8 {
}
}
-// CHECK: declare zeroext i8 @foreign_fn()
+// (Allow but do not require `zeroext` here, because it is not worth effort to
+// spell out which targets have it and which ones do not; see rust#97800.)
+
+// CHECK: declare{{( zeroext)?}} i8 @foreign_fn()
extern "C" {fn foreign_fn() -> u8;}
-// CHECK: !{i32 7, !"PIC Level", i32 2}
+// CHECK: !{i32 {{[78]}}, !"PIC Level", i32 2}
diff --git a/src/test/codegen/pie-relocation-model.rs b/src/test/codegen/pie-relocation-model.rs
index a843202a9..ec44edc06 100644
--- a/src/test/codegen/pie-relocation-model.rs
+++ b/src/test/codegen/pie-relocation-model.rs
@@ -18,5 +18,5 @@ pub fn call_foreign_fn() -> u8 {
// CHECK: declare zeroext i8 @foreign_fn()
extern "C" {fn foreign_fn() -> u8;}
-// CHECK: !{i32 7, !"PIC Level", i32 2}
+// CHECK: !{i32 {{[78]}}, !"PIC Level", i32 2}
// CHECK: !{i32 7, !"PIE Level", i32 2}
diff --git a/src/test/codegen/sanitizer_scs_attr_check.rs b/src/test/codegen/sanitizer_scs_attr_check.rs
index 0b53db3b7..a885d9117 100644
--- a/src/test/codegen/sanitizer_scs_attr_check.rs
+++ b/src/test/codegen/sanitizer_scs_attr_check.rs
@@ -7,11 +7,11 @@
#![crate_type = "lib"]
#![feature(no_sanitize)]
-// CHECK: ; Function Attrs:{{.*}}shadowcallstack
-// CHECK-NEXT: scs
+// CHECK: ; sanitizer_scs_attr_check::scs
+// CHECK-NEXT: ; Function Attrs:{{.*}}shadowcallstack
pub fn scs() {}
+// CHECK: ; sanitizer_scs_attr_check::no_scs
// CHECK-NOT: ; Function Attrs:{{.*}}shadowcallstack
-// CHECK-NEXT: no_scs
#[no_sanitize(shadow_call_stack)]
pub fn no_scs() {}
diff --git a/src/test/codegen/slice-iter-len-eq-zero.rs b/src/test/codegen/slice-iter-len-eq-zero.rs
index fd19e624c..112402825 100644
--- a/src/test/codegen/slice-iter-len-eq-zero.rs
+++ b/src/test/codegen/slice-iter-len-eq-zero.rs
@@ -1,5 +1,6 @@
// no-system-llvm
// compile-flags: -O
+// ignore-debug: the debug assertions add extra comparisons
#![crate_type = "lib"]
type Demo = [u8; 3];
@@ -12,3 +13,16 @@ pub fn slice_iter_len_eq_zero(y: std::slice::Iter<'_, Demo>) -> bool {
// CHECK: ret i1 %2
y.len() == 0
}
+
+// CHECK-LABEL: @array_into_iter_len_eq_zero
+#[no_mangle]
+pub fn array_into_iter_len_eq_zero(y: std::array::IntoIter<Demo, 123>) -> bool {
+ // This should be able to just check that the indexes are equal, and not
+ // need any subtractions or comparisons to handle `start > end`.
+
+ // CHECK-NOT: icmp
+ // CHECK-NOT: sub
+ // CHECK: %1 = icmp eq {{i16|i32|i64}}
+ // CHECK: ret i1 %1
+ y.len() == 0
+}
diff --git a/src/test/codegen/slice_as_from_ptr_range.rs b/src/test/codegen/slice_as_from_ptr_range.rs
new file mode 100644
index 000000000..0e3fefd97
--- /dev/null
+++ b/src/test/codegen/slice_as_from_ptr_range.rs
@@ -0,0 +1,23 @@
+// compile-flags: -O
+// only-64bit (because we're using [ui]size)
+// ignore-debug (because the assertions get in the way)
+// min-llvm-version: 15.0 (because this is a relatively new instcombine)
+
+#![crate_type = "lib"]
+#![feature(slice_from_ptr_range)]
+
+// This is intentionally using a non-power-of-two array length,
+// as that's where the optimization differences show up
+
+// CHECK-LABEL: @flatten_via_ptr_range
+#[no_mangle]
+pub fn flatten_via_ptr_range(slice_of_arrays: &[[i32; 13]]) -> &[i32] {
+ // CHECK-NOT: lshr
+ // CHECK-NOT: udiv
+ // CHECK: mul nuw nsw i64 %{{.+}}, 13
+ // CHECK-NOT: lshr
+ // CHECK-NOT: udiv
+ let r = slice_of_arrays.as_ptr_range();
+ let r = r.start.cast()..r.end.cast();
+ unsafe { core::slice::from_ptr_range(r) }
+}
diff --git a/src/test/codegen/some-abis-do-extend-params-to-32-bits.rs b/src/test/codegen/some-abis-do-extend-params-to-32-bits.rs
new file mode 100644
index 000000000..7fc34af3d
--- /dev/null
+++ b/src/test/codegen/some-abis-do-extend-params-to-32-bits.rs
@@ -0,0 +1,204 @@
+// compile-flags: -Cno-prepopulate-passes
+
+// revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv
+
+//[x86_64] compile-flags: --target x86_64-unknown-uefi
+//[x86_64] needs-llvm-components: x86
+//[i686] compile-flags: --target i686-unknown-linux-musl
+//[i686] needs-llvm-components: x86
+//[aarch64-windows] compile-flags: --target aarch64-pc-windows-msvc
+//[aarch64-windows] needs-llvm-components: aarch64
+//[aarch64-linux] compile-flags: --target aarch64-unknown-linux-gnu
+//[aarch64-linux] needs-llvm-components: aarch64
+//[aarch64-apple] compile-flags: --target aarch64-apple-darwin
+//[aarch64-apple] needs-llvm-components: aarch64
+//[arm] compile-flags: --target armv7r-none-eabi
+//[arm] needs-llvm-components: arm
+//[riscv] compile-flags: --target riscv64gc-unknown-none-elf
+//[riscv] needs-llvm-components: riscv
+
+// See bottom of file for a corresponding C source file that is meant to yield
+// equivalent declarations.
+#![feature(no_core, lang_items)]
+#![crate_type = "lib"]
+#![no_std]
+#![no_core]
+
+#[lang="sized"] trait Sized { }
+#[lang="freeze"] trait Freeze { }
+#[lang="copy"] trait Copy { }
+
+// The patterns in this file are written in the style of a table to make the
+// uniformities and distinctions more apparent.
+//
+// ZERO/SIGN-EXTENDING TO 32 BITS NON-EXTENDING
+// ============================== =======================
+// x86_64: void @c_arg_u8(i8 zeroext %_a)
+// i686: void @c_arg_u8(i8 zeroext %_a)
+// aarch64-apple: void @c_arg_u8(i8 zeroext %_a)
+// aarch64-windows: void @c_arg_u8(i8 %_a)
+// aarch64-linux: void @c_arg_u8(i8 %_a)
+// arm: void @c_arg_u8(i8 zeroext %_a)
+// riscv: void @c_arg_u8(i8 zeroext %_a)
+#[no_mangle] pub extern "C" fn c_arg_u8(_a: u8) { }
+
+// x86_64: void @c_arg_u16(i16 zeroext %_a)
+// i686: void @c_arg_u16(i16 zeroext %_a)
+// aarch64-apple: void @c_arg_u16(i16 zeroext %_a)
+// aarch64-windows: void @c_arg_u16(i16 %_a)
+// aarch64-linux: void @c_arg_u16(i16 %_a)
+// arm: void @c_arg_u16(i16 zeroext %_a)
+// riscv: void @c_arg_u16(i16 zeroext %_a)
+#[no_mangle] pub extern "C" fn c_arg_u16(_a: u16) { }
+
+// x86_64: void @c_arg_u32(i32 %_a)
+// i686: void @c_arg_u32(i32 %_a)
+// aarch64-apple: void @c_arg_u32(i32 %_a)
+// aarch64-windows: void @c_arg_u32(i32 %_a)
+// aarch64-linux: void @c_arg_u32(i32 %_a)
+// arm: void @c_arg_u32(i32 %_a)
+// riscv: void @c_arg_u32(i32 signext %_a)
+#[no_mangle] pub extern "C" fn c_arg_u32(_a: u32) { }
+
+// x86_64: void @c_arg_u64(i64 %_a)
+// i686: void @c_arg_u64(i64 %_a)
+// aarch64-apple: void @c_arg_u64(i64 %_a)
+// aarch64-windows: void @c_arg_u64(i64 %_a)
+// aarch64-linux: void @c_arg_u64(i64 %_a)
+// arm: void @c_arg_u64(i64 %_a)
+// riscv: void @c_arg_u64(i64 %_a)
+#[no_mangle] pub extern "C" fn c_arg_u64(_a: u64) { }
+
+// x86_64: void @c_arg_i8(i8 signext %_a)
+// i686: void @c_arg_i8(i8 signext %_a)
+// aarch64-apple: void @c_arg_i8(i8 signext %_a)
+// aarch64-windows: void @c_arg_i8(i8 %_a)
+// aarch64-linux: void @c_arg_i8(i8 %_a)
+// arm: void @c_arg_i8(i8 signext %_a)
+// riscv: void @c_arg_i8(i8 signext %_a)
+#[no_mangle] pub extern "C" fn c_arg_i8(_a: i8) { }
+
+// x86_64: void @c_arg_i16(i16 signext %_a)
+// i686: void @c_arg_i16(i16 signext %_a)
+// aarch64-apple: void @c_arg_i16(i16 signext %_a)
+// aarch64-windows: void @c_arg_i16(i16 %_a)
+// aarch64-linux: void @c_arg_i16(i16 %_a)
+// arm: void @c_arg_i16(i16 signext %_a)
+// riscv: void @c_arg_i16(i16 signext %_a)
+#[no_mangle] pub extern "C" fn c_arg_i16(_a: i16) { }
+
+// x86_64: void @c_arg_i32(i32 %_a)
+// i686: void @c_arg_i32(i32 %_a)
+// aarch64-apple: void @c_arg_i32(i32 %_a)
+// aarch64-windows: void @c_arg_i32(i32 %_a)
+// aarch64-linux: void @c_arg_i32(i32 %_a)
+// arm: void @c_arg_i32(i32 %_a)
+// riscv: void @c_arg_i32(i32 signext %_a)
+#[no_mangle] pub extern "C" fn c_arg_i32(_a: i32) { }
+
+// x86_64: void @c_arg_i64(i64 %_a)
+// i686: void @c_arg_i64(i64 %_a)
+// aarch64-apple: void @c_arg_i64(i64 %_a)
+// aarch64-windows: void @c_arg_i64(i64 %_a)
+// aarch64-linux: void @c_arg_i64(i64 %_a)
+// arm: void @c_arg_i64(i64 %_a)
+// riscv: void @c_arg_i64(i64 %_a)
+#[no_mangle] pub extern "C" fn c_arg_i64(_a: i64) { }
+
+// x86_64: zeroext i8 @c_ret_u8()
+// i686: zeroext i8 @c_ret_u8()
+// aarch64-apple: zeroext i8 @c_ret_u8()
+// aarch64-windows: i8 @c_ret_u8()
+// aarch64-linux: i8 @c_ret_u8()
+// arm: zeroext i8 @c_ret_u8()
+// riscv: zeroext i8 @c_ret_u8()
+#[no_mangle] pub extern "C" fn c_ret_u8() -> u8 { 0 }
+
+// x86_64: zeroext i16 @c_ret_u16()
+// i686: zeroext i16 @c_ret_u16()
+// aarch64-apple: zeroext i16 @c_ret_u16()
+// aarch64-windows: i16 @c_ret_u16()
+// aarch64-linux: i16 @c_ret_u16()
+// arm: zeroext i16 @c_ret_u16()
+// riscv: zeroext i16 @c_ret_u16()
+#[no_mangle] pub extern "C" fn c_ret_u16() -> u16 { 0 }
+
+// x86_64: i32 @c_ret_u32()
+// i686: i32 @c_ret_u32()
+// aarch64-apple: i32 @c_ret_u32()
+// aarch64-windows: i32 @c_ret_u32()
+// aarch64-linux: i32 @c_ret_u32()
+// arm: i32 @c_ret_u32()
+// riscv: signext i32 @c_ret_u32()
+#[no_mangle] pub extern "C" fn c_ret_u32() -> u32 { 0 }
+
+// x86_64: i64 @c_ret_u64()
+// i686: i64 @c_ret_u64()
+// aarch64-apple: i64 @c_ret_u64()
+// aarch64-windows: i64 @c_ret_u64()
+// aarch64-linux: i64 @c_ret_u64()
+// arm: i64 @c_ret_u64()
+// riscv: i64 @c_ret_u64()
+#[no_mangle] pub extern "C" fn c_ret_u64() -> u64 { 0 }
+
+// x86_64: signext i8 @c_ret_i8()
+// i686: signext i8 @c_ret_i8()
+// aarch64-apple: signext i8 @c_ret_i8()
+// aarch64-windows: i8 @c_ret_i8()
+// aarch64-linux: i8 @c_ret_i8()
+// arm: signext i8 @c_ret_i8()
+// riscv: signext i8 @c_ret_i8()
+#[no_mangle] pub extern "C" fn c_ret_i8() -> i8 { 0 }
+
+// x86_64: signext i16 @c_ret_i16()
+// i686: signext i16 @c_ret_i16()
+// aarch64-apple: signext i16 @c_ret_i16()
+// aarch64-windows: i16 @c_ret_i16()
+// aarch64-linux: i16 @c_ret_i16()
+// arm: signext i16 @c_ret_i16()
+// riscv: signext i16 @c_ret_i16()
+#[no_mangle] pub extern "C" fn c_ret_i16() -> i16 { 0 }
+
+// x86_64: i32 @c_ret_i32()
+// i686: i32 @c_ret_i32()
+// aarch64-apple: i32 @c_ret_i32()
+// aarch64-windows: i32 @c_ret_i32()
+// aarch64-linux: i32 @c_ret_i32()
+// arm: i32 @c_ret_i32()
+// riscv: signext i32 @c_ret_i32()
+#[no_mangle] pub extern "C" fn c_ret_i32() -> i32 { 0 }
+
+// x86_64: i64 @c_ret_i64()
+// i686: i64 @c_ret_i64()
+// aarch64-apple: i64 @c_ret_i64()
+// aarch64-windows: i64 @c_ret_i64()
+// aarch64-linux: i64 @c_ret_i64()
+// arm: i64 @c_ret_i64()
+// riscv: i64 @c_ret_i64()
+#[no_mangle] pub extern "C" fn c_ret_i64() -> i64 { 0 }
+
+const C_SOURCE_FILE: &'static str = r##"
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+
+void c_arg_u8(uint8_t _a) { }
+void c_arg_u16(uint16_t _a) { }
+void c_arg_u32(uint32_t _a) { }
+void c_arg_u64(uint64_t _a) { }
+
+void c_arg_i8(int8_t _a) { }
+void c_arg_i16(int16_t _a) { }
+void c_arg_i32(int32_t _a) { }
+void c_arg_i64(int64_t _a) { }
+
+uint8_t c_ret_u8() { return 0; }
+uint16_t c_ret_u16() { return 0; }
+uint32_t c_ret_u32() { return 0; }
+uint64_t c_ret_u64() { return 0; }
+
+int8_t c_ret_i8() { return 0; }
+int16_t c_ret_i16() { return 0; }
+int32_t c_ret_i32() { return 0; }
+int64_t c_ret_i64() { return 0; }
+"##;
diff --git a/src/test/codegen/stack-probes-call.rs b/src/test/codegen/stack-probes-call.rs
new file mode 100644
index 000000000..a18fd41c2
--- /dev/null
+++ b/src/test/codegen/stack-probes-call.rs
@@ -0,0 +1,24 @@
+// Check the "probe-stack" attribute for targets with `StackProbeType::Call`,
+// or `StackProbeType::InlineOrCall` when running on older LLVM.
+
+// compile-flags: -C no-prepopulate-passes
+// revisions: i686 x86_64
+//[i686] compile-flags: --target i686-unknown-linux-gnu
+//[i686] needs-llvm-components: x86
+//[i686] ignore-llvm-version: 16 - 99
+//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
+//[x86_64] needs-llvm-components: x86
+//[x86_64] ignore-llvm-version: 16 - 99
+
+#![crate_type = "rlib"]
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+
+#[no_mangle]
+pub fn foo() {
+// CHECK: @foo() unnamed_addr #0
+// CHECK: attributes #0 = { {{.*}}"probe-stack"="__rust_probestack"{{.*}} }
+}
diff --git a/src/test/codegen/stack-probes-inline.rs b/src/test/codegen/stack-probes-inline.rs
new file mode 100644
index 000000000..a6b781de5
--- /dev/null
+++ b/src/test/codegen/stack-probes-inline.rs
@@ -0,0 +1,32 @@
+// Check the "probe-stack" attribute for targets with `StackProbeType::Inline`,
+// or `StackProbeType::InlineOrCall` when running on newer LLVM.
+
+// compile-flags: -C no-prepopulate-passes
+// revisions: powerpc powerpc64 powerpc64le s390x i686 x86_64
+//[powerpc] compile-flags: --target powerpc-unknown-linux-gnu
+//[powerpc] needs-llvm-components: powerpc
+//[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu
+//[powerpc64] needs-llvm-components: powerpc
+//[powerpc64le] compile-flags: --target powerpc64le-unknown-linux-gnu
+//[powerpc64le] needs-llvm-components: powerpc
+//[s390x] compile-flags: --target s390x-unknown-linux-gnu
+//[s390x] needs-llvm-components: systemz
+//[i686] compile-flags: --target i686-unknown-linux-gnu
+//[i686] needs-llvm-components: x86
+//[i686] min-llvm-version: 16
+//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
+//[x86_64] needs-llvm-components: x86
+//[x86_64] min-llvm-version: 16
+
+#![crate_type = "rlib"]
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+
+#[no_mangle]
+pub fn foo() {
+// CHECK: @foo() unnamed_addr #0
+// CHECK: attributes #0 = { {{.*}}"probe-stack"="inline-asm"{{.*}} }
+}
diff --git a/src/test/codegen/stack-probes.rs b/src/test/codegen/stack-probes.rs
deleted file mode 100644
index 9bd351df3..000000000
--- a/src/test/codegen/stack-probes.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-// ignore-arm
-// ignore-aarch64
-// ignore-mips
-// ignore-mips64
-// ignore-powerpc
-// ignore-powerpc64
-// ignore-powerpc64le
-// ignore-riscv64
-// ignore-s390x
-// ignore-sparc
-// ignore-sparc64
-// ignore-wasm
-// ignore-emscripten
-// ignore-windows
-// compile-flags: -C no-prepopulate-passes
-
-#![crate_type = "lib"]
-
-#[no_mangle]
-pub fn foo() {
-// CHECK: @foo() unnamed_addr #0
-}
diff --git a/src/test/codegen/try_question_mark_nop.rs b/src/test/codegen/try_question_mark_nop.rs
new file mode 100644
index 000000000..d23938776
--- /dev/null
+++ b/src/test/codegen/try_question_mark_nop.rs
@@ -0,0 +1,54 @@
+// min-llvm-version: 15.0
+// compile-flags: -O -Z merge-functions=disabled --edition=2021
+// only-x86_64
+
+#![crate_type = "lib"]
+#![feature(try_blocks)]
+
+// These are now NOPs in LLVM 15, presumably thanks to nikic's change mentioned in
+// <https://github.com/rust-lang/rust/issues/85133#issuecomment-1072168354>.
+// Unfortunately, as of 2022-08-17 they're not yet nops for `u64`s nor `Option`.
+
+use std::ops::ControlFlow::{self, Continue, Break};
+
+// CHECK-LABEL: @result_nop_match_32
+#[no_mangle]
+pub fn result_nop_match_32(x: Result<i32, u32>) -> Result<i32, u32> {
+ // CHECK: start
+ // CHECK-NEXT: ret i64 %0
+ match x {
+ Ok(x) => Ok(x),
+ Err(x) => Err(x),
+ }
+}
+
+// CHECK-LABEL: @result_nop_traits_32
+#[no_mangle]
+pub fn result_nop_traits_32(x: Result<i32, u32>) -> Result<i32, u32> {
+ // CHECK: start
+ // CHECK-NEXT: ret i64 %0
+ try {
+ x?
+ }
+}
+
+// CHECK-LABEL: @control_flow_nop_match_32
+#[no_mangle]
+pub fn control_flow_nop_match_32(x: ControlFlow<i32, u32>) -> ControlFlow<i32, u32> {
+ // CHECK: start
+ // CHECK-NEXT: ret i64 %0
+ match x {
+ Continue(x) => Continue(x),
+ Break(x) => Break(x),
+ }
+}
+
+// CHECK-LABEL: @control_flow_nop_traits_32
+#[no_mangle]
+pub fn control_flow_nop_traits_32(x: ControlFlow<i32, u32>) -> ControlFlow<i32, u32> {
+ // CHECK: start
+ // CHECK-NEXT: ret i64 %0
+ try {
+ x?
+ }
+}
diff --git a/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs b/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs
index 1fe048068..c092e28a0 100644
--- a/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/aapcs-unwind-abi.rs
@@ -5,7 +5,7 @@
#[lang="sized"]
trait Sized { }
-// Test that `nounwind` atributes are correctly applied to exported `aapcs` and
+// Test that `nounwind` attributes are correctly applied to exported `aapcs` and
// `aapcs-unwind` extern functions. `aapcs-unwind` functions MUST NOT have this attribute. We
// disable optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs b/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
index e817d5715..8447bbeb1 100644
--- a/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
+++ b/src/test/codegen/unwind-abis/c-unwind-abi-panic-abort.rs
@@ -1,6 +1,6 @@
// compile-flags: -C panic=abort
-// Test that `nounwind` atributes are also applied to extern `C-unwind` Rust functions
+// Test that `nounwind` attributes are also applied to extern `C-unwind` Rust functions
// when the code is compiled with `panic=abort`.
#![crate_type = "lib"]
diff --git a/src/test/codegen/unwind-abis/c-unwind-abi.rs b/src/test/codegen/unwind-abis/c-unwind-abi.rs
index f15765367..e258dbcac 100644
--- a/src/test/codegen/unwind-abis/c-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/c-unwind-abi.rs
@@ -1,6 +1,6 @@
// compile-flags: -C opt-level=0
-// Test that `nounwind` atributes are correctly applied to exported `C` and `C-unwind` extern
+// Test that `nounwind` attributes are correctly applied to exported `C` and `C-unwind` extern
// functions. `C-unwind` functions MUST NOT have this attribute. We disable optimizations above
// to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs b/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs
index 52e0d2d6e..19a722883 100644
--- a/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/cdecl-unwind-abi.rs
@@ -1,6 +1,6 @@
// compile-flags: -C opt-level=0
-// Test that `nounwind` atributes are correctly applied to exported `cdecl` and
+// Test that `nounwind` attributes are correctly applied to exported `cdecl` and
// `cdecl-unwind` extern functions. `cdecl-unwind` functions MUST NOT have this attribute. We
// disable optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs b/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs
index ed23235eb..b74099a5d 100644
--- a/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/fastcall-unwind-abi.rs
@@ -5,7 +5,7 @@
#[lang="sized"]
trait Sized { }
-// Test that `nounwind` atributes are correctly applied to exported `fastcall` and
+// Test that `nounwind` attributes are correctly applied to exported `fastcall` and
// `fastcall-unwind` extern functions. `fastcall-unwind` functions MUST NOT have this attribute. We
// disable optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs b/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs
index 9a4b3d3b4..106d593b2 100644
--- a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs
+++ b/src/test/codegen/unwind-abis/nounwind-on-stable-panic-abort.rs
@@ -3,7 +3,7 @@
#![crate_type = "lib"]
-// We disable optimizations to prevent LLVM from infering the attribute.
+// We disable optimizations to prevent LLVM from inferring the attribute.
// CHECK: Function Attrs:{{.*}}nounwind
// CHECK-NEXT: @foo
diff --git a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs b/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
index 2783c83d3..c1c5bbdda 100644
--- a/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
+++ b/src/test/codegen/unwind-abis/nounwind-on-stable-panic-unwind.rs
@@ -3,7 +3,7 @@
#![crate_type = "lib"]
-// We disable optimizations to prevent LLVM from infering the attribute.
+// We disable optimizations to prevent LLVM from inferring the attribute.
extern "C" {
fn bar();
diff --git a/src/test/codegen/unwind-abis/nounwind.rs b/src/test/codegen/unwind-abis/nounwind.rs
index cfc140361..c46d71733 100644
--- a/src/test/codegen/unwind-abis/nounwind.rs
+++ b/src/test/codegen/unwind-abis/nounwind.rs
@@ -4,7 +4,7 @@
#![crate_type = "lib"]
#![feature(c_unwind)]
-// We disable optimizations to prevent LLVM from infering the attribute.
+// We disable optimizations to prevent LLVM from inferring the attribute.
// CHECK: Function Attrs:{{.*}}nounwind
// CHECK-NEXT: @foo
diff --git a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs b/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs
index f1dff27ad..8eff0719f 100644
--- a/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/stdcall-unwind-abi.rs
@@ -5,7 +5,7 @@
#[lang="sized"]
trait Sized { }
-// Test that `nounwind` atributes are correctly applied to exported `stdcall` and `stdcall-unwind`
+// Test that `nounwind` attributes are correctly applied to exported `stdcall` and `stdcall-unwind`
// extern functions. `stdcall-unwind` functions MUST NOT have this attribute. We disable
// optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/system-unwind-abi.rs b/src/test/codegen/unwind-abis/system-unwind-abi.rs
index c4d513283..2591c1d48 100644
--- a/src/test/codegen/unwind-abis/system-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/system-unwind-abi.rs
@@ -1,6 +1,6 @@
// compile-flags: -C opt-level=0
-// Test that `nounwind` atributes are correctly applied to exported `system` and `system-unwind`
+// Test that `nounwind` attributes are correctly applied to exported `system` and `system-unwind`
// extern functions. `system-unwind` functions MUST NOT have this attribute. We disable
// optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs b/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs
index a38736f2a..694fde17c 100644
--- a/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/sysv64-unwind-abi.rs
@@ -5,7 +5,7 @@
#[lang="sized"]
trait Sized { }
-// Test that `nounwind` atributes are correctly applied to exported `sysv64` and
+// Test that `nounwind` attributes are correctly applied to exported `sysv64` and
// `sysv64-unwind` extern functions. `sysv64-unwind` functions MUST NOT have this attribute. We
// disable optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs b/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs
index d2cf041b7..7e81367fc 100644
--- a/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/thiscall-unwind-abi.rs
@@ -5,7 +5,7 @@
#[lang="sized"]
trait Sized { }
-// Test that `nounwind` atributes are correctly applied to exported `thiscall` and
+// Test that `nounwind` attributes are correctly applied to exported `thiscall` and
// `thiscall-unwind` extern functions. `thiscall-unwind` functions MUST NOT have this attribute. We
// disable optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs b/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs
index 0fb9612a5..d7eca2a97 100644
--- a/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/vectorcall-unwind-abi.rs
@@ -5,7 +5,7 @@
#[lang="sized"]
trait Sized { }
-// Test that `nounwind` atributes are correctly applied to exported `vectorcall` and
+// Test that `nounwind` attributes are correctly applied to exported `vectorcall` and
// `vectorcall-unwind` extern functions. `vectorcall-unwind` functions MUST NOT have this attribute.
// We disable optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-abis/win64-unwind-abi.rs b/src/test/codegen/unwind-abis/win64-unwind-abi.rs
index 5d8482da6..6591348c3 100644
--- a/src/test/codegen/unwind-abis/win64-unwind-abi.rs
+++ b/src/test/codegen/unwind-abis/win64-unwind-abi.rs
@@ -5,7 +5,7 @@
#[lang="sized"]
trait Sized { }
-// Test that `nounwind` atributes are correctly applied to exported `win64` and
+// Test that `nounwind` attributes are correctly applied to exported `win64` and
// `win64-unwind` extern functions. `win64-unwind` functions MUST NOT have this attribute. We
// disable optimizations above to prevent LLVM from inferring the attribute.
diff --git a/src/test/codegen/unwind-extern-exports.rs b/src/test/codegen/unwind-extern-exports.rs
index c939235fb..6ac3c079f 100644
--- a/src/test/codegen/unwind-extern-exports.rs
+++ b/src/test/codegen/unwind-extern-exports.rs
@@ -5,7 +5,7 @@
#![feature(c_unwind)]
// Make sure these all do *not* get the attribute.
-// We disable optimizations to prevent LLVM from infering the attribute.
+// We disable optimizations to prevent LLVM from inferring the attribute.
// CHECK-NOT: nounwind
// "C" ABI
diff --git a/src/test/codegen/vec-calloc.rs b/src/test/codegen/vec-calloc.rs
index 435a4ab51..ae6e448f1 100644
--- a/src/test/codegen/vec-calloc.rs
+++ b/src/test/codegen/vec-calloc.rs
@@ -1,4 +1,4 @@
-// compile-flags: -O
+// compile-flags: -O -Z merge-functions=disabled
// only-x86_64
// ignore-debug
// min-llvm-version: 15.0
@@ -144,6 +144,23 @@ pub fn vec_non_zero_tuple(n: usize) -> Vec<(i16, u8, char)> {
vec![(0, 0, 'A'); n]
}
+// CHECK-LABEL: @vec_option_bool
+#[no_mangle]
+pub fn vec_option_bool(n: usize) -> Vec<Option<bool>> {
+ // CHECK-NOT: call {{.*}}alloc::vec::from_elem
+ // CHECK-NOT: call {{.*}}reserve
+ // CHECK-NOT: call {{.*}}__rust_alloc(
+
+ // CHECK: call {{.*}}__rust_alloc_zeroed(
+
+ // CHECK-NOT: call {{.*}}alloc::vec::from_elem
+ // CHECK-NOT: call {{.*}}reserve
+ // CHECK-NOT: call {{.*}}__rust_alloc(
+
+ // CHECK: ret void
+ vec![Some(false); n]
+}
+
// Ensure that __rust_alloc_zeroed gets the right attributes for LLVM to optimize it away.
// CHECK: declare noalias ptr @__rust_alloc_zeroed(i64, i64 allocalign) unnamed_addr [[RUST_ALLOC_ZEROED_ATTRS:#[0-9]+]]
diff --git a/src/test/codegen/vec-in-place.rs b/src/test/codegen/vec-in-place.rs
index 62139aa9b..5df366905 100644
--- a/src/test/codegen/vec-in-place.rs
+++ b/src/test/codegen/vec-in-place.rs
@@ -17,7 +17,7 @@ pub struct Foo {
// 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 for repr(C) or non-Copy structs.
+// reliably recognize the loops as noop for repr(C) or non-Copy structs.
#[derive(Copy, Clone)]
pub struct Bar {
a: u64,
diff --git a/src/test/debuginfo/collapse-debuginfo-no-attr-flag.rs b/src/test/debuginfo/collapse-debuginfo-no-attr-flag.rs
new file mode 100644
index 000000000..413f61201
--- /dev/null
+++ b/src/test/debuginfo/collapse-debuginfo-no-attr-flag.rs
@@ -0,0 +1,61 @@
+// ignore-lldb
+#![feature(collapse_debuginfo)]
+
+// Test that line numbers are not replaced with those of the outermost expansion site when the
+// `collapse_debuginfo` is active, `-Zdebug-macros` is provided and `#[collapse_debuginfo]` not
+// being used.
+
+// compile-flags:-g -Zdebug-macros
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc1[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc2[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc3[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc4[...]
+// gdb-command:continue
+
+fn one() {
+ println!("one");
+}
+fn two() {
+ println!("two");
+}
+fn three() {
+ println!("three");
+}
+fn four() {
+ println!("four");
+}
+
+macro_rules! outer {
+ ($b:block) => {
+ one(); // #loc1
+ inner!();
+ $b
+ };
+}
+
+macro_rules! inner {
+ () => {
+ two(); // #loc2
+ };
+}
+
+fn main() {
+ let ret = 0; // #break
+ outer!({
+ three(); // #loc3
+ four(); // #loc4
+ });
+ std::process::exit(ret);
+}
diff --git a/src/test/debuginfo/collapse-debuginfo-no-attr.rs b/src/test/debuginfo/collapse-debuginfo-no-attr.rs
new file mode 100644
index 000000000..230c8795b
--- /dev/null
+++ b/src/test/debuginfo/collapse-debuginfo-no-attr.rs
@@ -0,0 +1,60 @@
+// ignore-lldb
+#![feature(collapse_debuginfo)]
+
+// Test that line numbers are not replaced with those of the outermost expansion site when the
+// `collapse_debuginfo` feature is active and the attribute is not provided.
+
+// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc1[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc2[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc3[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc4[...]
+// gdb-command:continue
+
+fn one() {
+ println!("one");
+}
+fn two() {
+ println!("two");
+}
+fn three() {
+ println!("three");
+}
+fn four() {
+ println!("four");
+}
+
+macro_rules! outer {
+ ($b:block) => {
+ one(); // #loc1
+ inner!();
+ $b
+ };
+}
+
+macro_rules! inner {
+ () => {
+ two(); // #loc2
+ };
+}
+
+fn main() {
+ let ret = 0; // #break
+ outer!({
+ three(); // #loc3
+ four(); // #loc4
+ });
+ std::process::exit(ret);
+}
diff --git a/src/test/debuginfo/collapse-debuginfo-with-attr-flag.rs b/src/test/debuginfo/collapse-debuginfo-with-attr-flag.rs
new file mode 100644
index 000000000..183cf537e
--- /dev/null
+++ b/src/test/debuginfo/collapse-debuginfo-with-attr-flag.rs
@@ -0,0 +1,63 @@
+// ignore-lldb
+#![feature(collapse_debuginfo)]
+
+// Test that line numbers are not replaced with those of the outermost expansion site when the
+// `collapse_debuginfo` is active and `-Zdebug-macros` is provided, despite `#[collapse_debuginfo]`
+// being used.
+
+// compile-flags:-g -Zdebug-macros
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc1[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc2[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc3[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc4[...]
+// gdb-command:continue
+
+fn one() {
+ println!("one");
+}
+fn two() {
+ println!("two");
+}
+fn three() {
+ println!("three");
+}
+fn four() {
+ println!("four");
+}
+
+#[collapse_debuginfo]
+macro_rules! outer {
+ ($b:block) => {
+ one(); // #loc1
+ inner!();
+ $b
+ };
+}
+
+#[collapse_debuginfo]
+macro_rules! inner {
+ () => {
+ two(); // #loc2
+ };
+}
+
+fn main() {
+ let ret = 0; // #break
+ outer!({
+ three(); // #loc3
+ four(); // #loc4
+ });
+ std::process::exit(ret);
+}
diff --git a/src/test/debuginfo/collapse-debuginfo-with-attr.rs b/src/test/debuginfo/collapse-debuginfo-with-attr.rs
new file mode 100644
index 000000000..34d03c18b
--- /dev/null
+++ b/src/test/debuginfo/collapse-debuginfo-with-attr.rs
@@ -0,0 +1,59 @@
+// ignore-lldb
+#![feature(collapse_debuginfo)]
+
+// Test that line numbers are replaced with those of the outermost expansion site when the
+// `collapse_debuginfo` feature is active and the attribute is provided.
+
+// compile-flags:-g
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc1[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc2[...]
+// gdb-command:next
+// gdb-command:frame
+// gdb-check:[...]#loc3[...]
+// gdb-command:continue
+
+fn one() {
+ println!("one");
+}
+fn two() {
+ println!("two");
+}
+fn three() {
+ println!("three");
+}
+fn four() {
+ println!("four");
+}
+
+#[collapse_debuginfo]
+macro_rules! outer {
+ ($b:block) => {
+ one();
+ inner!();
+ $b
+ };
+}
+
+#[collapse_debuginfo]
+macro_rules! inner {
+ () => {
+ two();
+ };
+}
+
+fn main() {
+ let ret = 0; // #break
+ outer!({ // #loc1
+ three(); // #loc2
+ four(); // #loc3
+ });
+ std::process::exit(ret);
+}
diff --git a/src/test/debuginfo/generator-objects.rs b/src/test/debuginfo/generator-objects.rs
index d6d7e5b44..11c4ae2f6 100644
--- a/src/test/debuginfo/generator-objects.rs
+++ b/src/test/debuginfo/generator-objects.rs
@@ -41,31 +41,26 @@
// cdb-command: g
// cdb-command: dx b
-// cdb-check: b : Unresumed [Type: enum$<generator_objects::main::generator_env$0>]
-// cdb-check: [variant] : Unresumed
+// cdb-check: b : Unresumed [Type: enum2$<generator_objects::main::generator_env$0>]
// cdb-check: [+0x[...]] _ref__a : 0x[...] : 5 [Type: int *]
// cdb-command: g
// cdb-command: dx b
-// cdb-check: b : Suspend0 [Type: enum$<generator_objects::main::generator_env$0>]
-// cdb-check: [variant] : Suspend0
+// cdb-check: b : Suspend0 [Type: enum2$<generator_objects::main::generator_env$0>]
// cdb-check: [+0x[...]] c : 6 [Type: int]
// cdb-check: [+0x[...]] d : 7 [Type: int]
// cdb-check: [+0x[...]] _ref__a : 0x[...] : 5 [Type: int *]
// cdb-command: g
// cdb-command: dx b
-// cdb-check: b : Suspend1 [Type: enum$<generator_objects::main::generator_env$0>]
-// cdb-check: [variant] : Suspend1
+// cdb-check: b : Suspend1 [Type: enum2$<generator_objects::main::generator_env$0>]
// cdb-check: [+0x[...]] c : 7 [Type: int]
// cdb-check: [+0x[...]] d : 8 [Type: int]
// cdb-check: [+0x[...]] _ref__a : 0x[...] : 6 [Type: int *]
// cdb-command: g
// cdb-command: dx b
-// cdb-check: b : Returned [Type: enum$<generator_objects::main::generator_env$0>]
-// cdb-check: [<Raw View>] [Type: enum$<generator_objects::main::generator_env$0>]
-// cdb-check: [variant] : Returned
+// cdb-check: b : Returned [Type: enum2$<generator_objects::main::generator_env$0>]
// cdb-check: [+0x[...]] _ref__a : 0x[...] : 6 [Type: int *]
#![feature(omit_gdb_pretty_printer_section, generators, generator_trait)]
diff --git a/src/test/debuginfo/msvc-pretty-enums.rs b/src/test/debuginfo/msvc-pretty-enums.rs
index a153a9a42..7f1be6f27 100644
--- a/src/test/debuginfo/msvc-pretty-enums.rs
+++ b/src/test/debuginfo/msvc-pretty-enums.rs
@@ -4,69 +4,141 @@
// cdb-command: g
// cdb-command: dx a
-// cdb-check:a : Some({...}) [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
-// cdb-check: [variant] : Some
+// cdb-check:a : Some [Type: enum2$<core::option::Option<msvc_pretty_enums::CStyleEnum> >]
// cdb-check: [+0x000] __0 : Low (0x2) [Type: msvc_pretty_enums::CStyleEnum]
// cdb-command: dx b
-// cdb-check:b : None [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<msvc_pretty_enums::CStyleEnum>, 2, 16, Some>]
-// cdb-check: [variant] : None
+// cdb-check:b : None [Type: enum2$<core::option::Option<msvc_pretty_enums::CStyleEnum> >]
// cdb-command: dx c
-// cdb-check:c : Tag1 [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
-// cdb-check: [<Raw View>] [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
-// cdb-check: [variant] : Tag1
+// cdb-check:c : Tag1 [Type: enum2$<msvc_pretty_enums::NicheLayoutEnum>]
// cdb-command: dx d
-// cdb-check:d : Data({...}) [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
-// cdb-check: [<Raw View>] [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
-// cdb-check: [variant] : Data
+// cdb-check:d : Data [Type: enum2$<msvc_pretty_enums::NicheLayoutEnum>]
// cdb-check: [+0x000] my_data : High (0x10) [Type: msvc_pretty_enums::CStyleEnum]
// cdb-command: dx e
-// cdb-check:e : Tag2 [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
-// cdb-check: [<Raw View>] [Type: enum$<msvc_pretty_enums::NicheLayoutEnum, 2, 16, Data>]
-// cdb-check: [variant] : Tag2
+// cdb-check:e : Tag2 [Type: enum2$<msvc_pretty_enums::NicheLayoutEnum>]
// cdb-command: dx f
-// cdb-check:f : Some({...}) [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
-// cdb-check: [variant] : Some
+// cdb-check:f : Some [Type: enum2$<core::option::Option<ref$<u32> > >]
// cdb-check: [+0x000] __0 : 0x[...] : 0x1 [Type: unsigned int *]
// cdb-command: dx g
-// cdb-check:g : None [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<ref$<u32> >, 1, [...], Some>]
-// cdb-check: [variant] : None
+// cdb-check:g : None [Type: enum2$<core::option::Option<ref$<u32> > >]
// cdb-command: dx h
-// cdb-check:h : Some [Type: enum$<core::option::Option<u32> >]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<u32> >]
-// cdb-check: [variant] : Some
+// cdb-check:h : Some [Type: enum2$<core::option::Option<u32> >]
// cdb-check: [+0x004] __0 : 0xc [Type: unsigned int]
// cdb-command: dx i
-// cdb-check:i : None [Type: enum$<core::option::Option<u32> >]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<u32> >]
-// cdb-check: [variant] : None
+// cdb-check:i : None [Type: enum2$<core::option::Option<u32> >]
// cdb-command: dx j
// cdb-check:j : High (0x10) [Type: msvc_pretty_enums::CStyleEnum]
// cdb-command: dx k
-// cdb-check:k : Some({...}) [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
-// cdb-check: [variant] : Some
+// cdb-check:k : Some [Type: enum2$<core::option::Option<alloc::string::String> >]
// cdb-check: [+0x000] __0 : "IAMA optional string!" [Type: alloc::string::String]
// cdb-command: dx l
-// cdb-check:l : Ok [Type: enum$<core::result::Result<u32,enum$<msvc_pretty_enums::Empty> >, Ok>]
-// cdb-check: [<Raw View>] [Type: enum$<core::result::Result<u32,enum$<msvc_pretty_enums::Empty> >, Ok>]
-// cdb-check: [variant] : Ok
+// cdb-check:l : Ok [Type: enum2$<core::result::Result<u32,enum2$<msvc_pretty_enums::Empty> > >]
// cdb-check: [+0x000] __0 : 0x2a [Type: unsigned int]
+// cdb-command: dx niche128_some
+// cdb-check: niche128_some : Some [Type: enum2$<core::option::Option<core::num::nonzero::NonZeroI128> >]
+// Note: we can't actually read the value of the field because CDB cannot handle 128 bit integers.
+// cdb-check: [+0x000] __0 [...] [Type: core::num::nonzero::NonZeroI128]
+
+// cdb-command: dx niche128_none
+// cdb-check: niche128_none : None [Type: enum2$<core::option::Option<core::num::nonzero::NonZeroI128> >]
+
+// cdb-command: dx wrapping_niche128_untagged
+// cdb-check: wrapping_niche128_untagged : X [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
+// cdb-check: [+0x[...]] __0 [Type: msvc_pretty_enums::Wrapping128]
+
+// cdb-command: dx wrapping_niche128_none1
+// cdb-check: wrapping_niche128_none1 : Y [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
+// cdb-check: [+0x[...]] __0 [Type: msvc_pretty_enums::Wrapping128]
+
+// cdb-command: dx wrapping_niche128_none2
+// cdb-check: wrapping_niche128_none2 : Z [Type: enum2$<msvc_pretty_enums::Wrapping128Niche>]
+// cdb-check: [+0x[...]] __0 [Type: msvc_pretty_enums::Wrapping128]
+
+// cdb-command: dx direct_tag_128_a,d
+// cdb-check: direct_tag_128_a,d : A [Type: enum2$<msvc_pretty_enums::DirectTag128>]
+// cdb-check: [+0x[...]] __0 : 42 [Type: unsigned int]
+
+// cdb-command: dx direct_tag_128_b,d
+// cdb-check: direct_tag_128_b,d : B [Type: enum2$<msvc_pretty_enums::DirectTag128>]
+// cdb-check: [+0x[...]] __0 : 137 [Type: unsigned int]
+
+// cdb-command: dx niche_w_fields_1_some,d
+// cdb-check: niche_w_fields_1_some,d : A [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields1>]
+// cdb-check: [+0x[...]] __0 : 0x[...] : 77 [Type: unsigned char *]
+// cdb-check: [+0x[...]] __1 : 7 [Type: unsigned int]
+
+// cdb-command: dx niche_w_fields_1_none,d
+// cdb-check: niche_w_fields_1_none,d : B [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields1>]
+// cdb-check: [+0x[...]] __0 : 99 [Type: unsigned int]
+
+// cdb-command: dx niche_w_fields_2_some,d
+// cdb-check: niche_w_fields_2_some,d : A [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields2>]
+// cdb-check: [+0x[...]] __0 : 800 [Type: core::num::nonzero::NonZeroU32]
+// cdb-check: [+0x[...]] __1 : 900 [Type: unsigned __int64]
+
+// cdb-command: dx niche_w_fields_2_none,d
+// cdb-check: niche_w_fields_2_none,d : B [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields2>]
+// cdb-check: [+0x[...]] __0 : 1000 [Type: unsigned __int64]
+
+// cdb-command: dx niche_w_fields_3_some,d
+// cdb-check: niche_w_fields_3_some,d : A [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields3>]
+// cdb-check: [+0x[...]] __0 : 137 [Type: unsigned char]
+// cdb-check: [+0x[...]] __1 : true [Type: bool]
+
+// cdb-command: dx niche_w_fields_3_niche1,d
+// cdb-check: niche_w_fields_3_niche1,d : B [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields3>]
+// cdb-check: [+0x[...]] __0 : 12 [Type: unsigned char]
+
+// cdb-command: dx niche_w_fields_3_niche2,d
+// cdb-check: niche_w_fields_3_niche2,d : C [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields3>]
+// cdb-check: [+0x[...]] __0 : false [Type: bool]
+
+// cdb-command: dx niche_w_fields_3_niche3,d
+// cdb-check: niche_w_fields_3_niche3,d : D [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields3>]
+// cdb-check: [+0x[...]] __0 : 34 [Type: unsigned char]
+
+// cdb-command: dx niche_w_fields_3_niche4,d
+// cdb-check: niche_w_fields_3_niche4,d : E [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields3>]
+// cdb-check: [+0x[...]] __0 : 56 [Type: unsigned char]
+
+// cdb-command: dx niche_w_fields_3_niche5,d
+// cdb-check: niche_w_fields_3_niche5,d : F [Type: enum2$<msvc_pretty_enums::NicheLayoutWithFields3>]
+
+// cdb-command: dx -r3 niche_w_fields_std_result_ok,d
+// cdb-check: niche_w_fields_std_result_ok,d : Ok [Type: enum2$<core::result::Result<alloc::boxed::Box<slice$<u8>,alloc::alloc::Global>,u64> >]
+// cdb-check: [+0x[...]] __0 [Type: alloc::boxed::Box<slice$<u8>,alloc::alloc::Global>]
+// cdb-check: [+0x[...]] data_ptr : [...]
+// cdb-check: [+0x[...]] length : 3 [...]
+
+// cdb-command: dx -r3 niche_w_fields_std_result_err,d
+// cdb-check: niche_w_fields_std_result_err,d : Err [Type: enum2$<core::result::Result<alloc::boxed::Box<slice$<u8>,alloc::alloc::Global>,u64> >]
+// cdb-check: [+0x[...]] __0 : 789 [Type: unsigned __int64]
+
+// cdb-command: dx -r2 arbitrary_discr1,d
+// cdb-check: arbitrary_discr1,d : Abc [Type: enum2$<msvc_pretty_enums::ArbitraryDiscr>]
+// cdb-check: [+0x[...]] __0 : 1234 [Type: unsigned int]
+
+// cdb-command: dx -r2 arbitrary_discr2,d
+// cdb-check: arbitrary_discr2,d : Def [Type: enum2$<msvc_pretty_enums::ArbitraryDiscr>]
+// cdb-check: [+0x[...]] __0 : 5678 [Type: unsigned int]
+
+#![feature(rustc_attrs)]
+#![feature(repr128)]
+#![feature(arbitrary_enum_discriminant)]
+
+use std::num::{NonZeroI128, NonZeroU32};
+
pub enum CStyleEnum {
Low = 2,
High = 16,
@@ -80,6 +152,51 @@ pub enum NicheLayoutEnum {
pub enum Empty {}
+// The following three types will use a niche layout once
+// https://github.com/rust-lang/rust/pull/94075 is merged:
+enum NicheLayoutWithFields1<'a> {
+ A(&'a u8, u32),
+ B(u32),
+}
+
+enum NicheLayoutWithFields2 {
+ A(NonZeroU32, u64),
+ B(u64),
+}
+
+enum NicheLayoutWithFields3 {
+ A(u8, bool),
+ B(u8),
+ C(bool),
+ D(u8),
+ E(u8),
+ F,
+}
+
+#[rustc_layout_scalar_valid_range_start(340282366920938463463374607431768211454)]
+#[rustc_layout_scalar_valid_range_end(1)]
+#[repr(transparent)]
+struct Wrapping128(u128);
+
+// #[rustc_layout(debug)]
+enum Wrapping128Niche {
+ X(Wrapping128),
+ Y,
+ Z,
+}
+
+#[repr(i128)]
+enum DirectTag128 {
+ A(u32),
+ B(u32),
+}
+
+#[repr(u32)]
+enum ArbitraryDiscr {
+ Abc(u32) = 1000,
+ Def(u32) = 5000_000,
+}
+
fn main() {
let a = Some(CStyleEnum::Low);
let b = Option::<CStyleEnum>::None;
@@ -93,6 +210,35 @@ fn main() {
let j = CStyleEnum::High;
let k = Some("IAMA optional string!".to_string());
let l = Result::<u32, Empty>::Ok(42);
+ let niche128_some = Some(NonZeroI128::new(123456).unwrap());
+ let niche128_none: Option<NonZeroI128> = None;
+
+ let wrapping_niche128_untagged =
+ unsafe { Wrapping128Niche::X(Wrapping128(340282366920938463463374607431768211454)) };
+ let wrapping_niche128_none1 = Wrapping128Niche::Y;
+ let wrapping_niche128_none2 = Wrapping128Niche::Z;
+
+ let direct_tag_128_a = DirectTag128::A(42);
+ let direct_tag_128_b = DirectTag128::B(137);
+
+ let niche_w_fields_1_some = NicheLayoutWithFields1::A(&77, 7);
+ let niche_w_fields_1_none = NicheLayoutWithFields1::B(99);
+
+ let niche_w_fields_2_some = NicheLayoutWithFields2::A(NonZeroU32::new(800).unwrap(), 900);
+ let niche_w_fields_2_none = NicheLayoutWithFields2::B(1000);
+
+ let niche_w_fields_3_some = NicheLayoutWithFields3::A(137, true);
+ let niche_w_fields_3_niche1 = NicheLayoutWithFields3::B(12);
+ let niche_w_fields_3_niche2 = NicheLayoutWithFields3::C(false);
+ let niche_w_fields_3_niche3 = NicheLayoutWithFields3::D(34);
+ let niche_w_fields_3_niche4 = NicheLayoutWithFields3::E(56);
+ let niche_w_fields_3_niche5 = NicheLayoutWithFields3::F;
+
+ let niche_w_fields_std_result_ok: Result<Box<[u8]>, u64> = Ok(vec![1, 2, 3].into());
+ let niche_w_fields_std_result_err: Result<Box<[u8]>, u64> = Err(789);
+
+ let arbitrary_discr1 = ArbitraryDiscr::Abc(1234);
+ let arbitrary_discr2 = ArbitraryDiscr::Def(5678);
zzz(); // #break
}
diff --git a/src/test/debuginfo/msvc-scalarpair-params.rs b/src/test/debuginfo/msvc-scalarpair-params.rs
index 3846fb42f..9630952cb 100644
--- a/src/test/debuginfo/msvc-scalarpair-params.rs
+++ b/src/test/debuginfo/msvc-scalarpair-params.rs
@@ -18,12 +18,10 @@
// cdb-command: g
// cdb-command: dx o1
-// cdb-check:o1 : Some [Type: enum$<core::option::Option<u32> >]
-// cdb-check: [variant] : Some
+// cdb-check:o1 : Some [Type: enum2$<core::option::Option<u32> >]
// cdb-check: [+0x004] __0 : 0x4d2 [Type: [...]]
// cdb-command: dx o2
-// cdb-check:o2 : Some [Type: enum$<core::option::Option<u64> >]
-// cdb-check: [variant] : Some
+// cdb-check:o2 : Some [Type: enum2$<core::option::Option<u64> >]
// cdb-check: [+0x008] __0 : 0x162e [Type: unsigned __int64]
// cdb-command: g
@@ -89,7 +87,7 @@ fn slice(s: &[u8]) {
zzz(); // #break
}
-fn zzz() { }
+fn zzz() {}
fn main() {
range(10..12, 20..30);
diff --git a/src/test/debuginfo/mutex.rs b/src/test/debuginfo/mutex.rs
index 00dccf5f9..314ba40b0 100644
--- a/src/test/debuginfo/mutex.rs
+++ b/src/test/debuginfo/mutex.rs
@@ -20,19 +20,20 @@
// cdb-check: [<Raw View>] [Type: core::cell::UnsafeCell<i32>]
//
-// cdb-command:dx lock,d
-// cdb-check:lock,d : Ok [Type: enum$<core::result::Result<std::sync::mutex::MutexGuard<i32>,enum$<std::sync::poison::TryLockError<std::sync::mutex::MutexGuard<i32> >, 0, 1, Poisoned> > >]
-// cdb-check: [variant] : Ok
+// cdb-command:dx _lock,d
+// cdb-check:_lock,d : Ok [Type: enum2$<core::result::Result<std::sync::mutex::MutexGuard<i32>,enum2$<std::sync::poison::TryLockError<std::sync::mutex::MutexGuard<i32> > > > >]
// cdb-check: [...] __0 [Type: std::sync::mutex::MutexGuard<i32>]
use std::sync::Mutex;
-#[allow(unused_variables)]
-fn main()
-{
+fn main() {
let m = Mutex::new(0);
- let lock = m.try_lock();
+ let _lock = m.try_lock();
+
+ println!("this line avoids an `Ambiguous symbol error` while setting the breakpoint");
+
zzz(); // #break
}
+#[inline(never)]
fn zzz() {}
diff --git a/src/test/debuginfo/numeric-types.rs b/src/test/debuginfo/numeric-types.rs
index 2eae9239b..c41c9ee21 100644
--- a/src/test/debuginfo/numeric-types.rs
+++ b/src/test/debuginfo/numeric-types.rs
@@ -1,6 +1,7 @@
-// only-cdb
// compile-flags:-g
+// min-gdb-version: 8.1
+
// Tests the visualizations for `NonZero{I,U}{8,16,32,64,128,size}`, `Wrapping<T>` and
// `Atomic{Bool,I8,I16,I32,I64,Isize,U8,U16,U32,U64,Usize}` located in `libcore.natvis`.
@@ -153,6 +154,90 @@
// cdb-check:a_usize : 0x400 [Type: core::sync::atomic::AtomicUsize]
// cdb-check: [<Raw View>] [Type: core::sync::atomic::AtomicUsize]
+
+// === GDB TESTS ===================================================================================
+
+// gdb-command:run
+
+// gdb-command:print/d nz_i8
+// gdb-check:[...]$1 = 11
+
+// gdb-command:print nz_i16
+// gdb-check:[...]$2 = 22
+
+// gdb-command:print nz_i32
+// gdb-check:[...]$3 = 33
+
+// gdb-command:print nz_i64
+// gdb-check:[...]$4 = 44
+
+// gdb-command:print nz_i128
+// gdb-check:[...]$5 = 55
+
+// gdb-command:print nz_isize
+// gdb-check:[...]$6 = 66
+
+// gdb-command:print/d nz_u8
+// gdb-check:[...]$7 = 77
+
+// gdb-command:print nz_u16
+// gdb-check:[...]$8 = 88
+
+// gdb-command:print nz_u32
+// gdb-check:[...]$9 = 99
+
+// gdb-command:print nz_u64
+// gdb-check:[...]$10 = 100
+
+// gdb-command:print nz_u128
+// gdb-check:[...]$11 = 111
+
+// gdb-command:print nz_usize
+// gdb-check:[...]$12 = 122
+
+
+
+// === LLDB TESTS ==================================================================================
+
+// lldb-command:run
+
+// lldb-command:print/d nz_i8
+// lldb-check:[...]$0 = 11 { __0 = 11 }
+
+// lldb-command:print nz_i16
+// lldb-check:[...]$1 = 22 { __0 = 22 }
+
+// lldb-command:print nz_i32
+// lldb-check:[...]$2 = 33 { __0 = 33 }
+
+// lldb-command:print nz_i64
+// lldb-check:[...]$3 = 44 { __0 = 44 }
+
+// lldb-command:print nz_i128
+// lldb-check:[...]$4 = 55 { __0 = 55 }
+
+// lldb-command:print nz_isize
+// lldb-check:[...]$5 = 66 { __0 = 66 }
+
+// lldb-command:print/d nz_u8
+// lldb-check:[...]$6 = 77 { __0 = 77 }
+
+// lldb-command:print nz_u16
+// lldb-check:[...]$7 = 88 { __0 = 88 }
+
+// lldb-command:print nz_u32
+// lldb-check:[...]$8 = 99 { __0 = 99 }
+
+// lldb-command:print nz_u64
+// lldb-check:[...]$9 = 100 { __0 = 100 }
+
+// lldb-command:print nz_u128
+// lldb-check:[...]$10 = 111 { __0 = 111 }
+
+// lldb-command:print nz_usize
+// lldb-check:[...]$11 = 122 { __0 = 122 }
+
+
use std::num::*;
use std::sync::atomic::*;
diff --git a/src/test/debuginfo/pretty-std.rs b/src/test/debuginfo/pretty-std.rs
index 55a4ecc1c..a51b37205 100644
--- a/src/test/debuginfo/pretty-std.rs
+++ b/src/test/debuginfo/pretty-std.rs
@@ -39,7 +39,6 @@
// gdb-command: print some_string
// gdb-check:$8 = Some = {"IAMA "...}
-
// === LLDB TESTS ==================================================================================
// lldb-command: run
@@ -65,7 +64,6 @@
// lldb-command: print os_string
// lldb-check:[...]$6 = "IAMA OS string 😃"[...]
-
// === CDB TESTS ==================================================================================
// cdb-command: g
@@ -118,20 +116,17 @@
// cdb-check: [chars] : "IAMA OS string [...]"
// cdb-command: dx some
-// cdb-check:some : Some [Type: enum$<core::option::Option<i16> >]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<i16> >]
-// cdb-check: [variant] : Some
+// cdb-check:some : Some [Type: enum2$<core::option::Option<i16> >]
+// cdb-check: [<Raw View>] [Type: enum2$<core::option::Option<i16> >]
// cdb-check: [+0x002] __0 : 8 [Type: short]
// cdb-command: dx none
-// cdb-check:none : None [Type: enum$<core::option::Option<i64> >]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<i64> >]
-// cdb-check: [variant] : None
+// cdb-check:none : None [Type: enum2$<core::option::Option<i64> >]
+// cdb-check: [<Raw View>] [Type: enum2$<core::option::Option<i64> >]
// cdb-command: dx some_string
-// cdb-check:some_string : Some({...}) [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
-// cdb-check: [<Raw View>] [Type: enum$<core::option::Option<alloc::string::String>, 1, [...], Some>]
-// cdb-check: [variant] : Some
+// cdb-check:some_string : Some [Type: enum2$<core::option::Option<alloc::string::String> >]
+// cdb-check: [<Raw View>] [Type: enum2$<core::option::Option<alloc::string::String> >]
// cdb-check: [+0x000] __0 : "IAMA optional string!" [Type: alloc::string::String]
// cdb-command: dx linkedlist
@@ -153,7 +148,6 @@ use std::collections::{LinkedList, VecDeque};
use std::ffi::OsString;
fn main() {
-
// &[]
let slice: &[i32] = &[0, 1, 2, 3];
@@ -188,4 +182,6 @@ fn main() {
zzz(); // #break
}
-fn zzz() { () }
+fn zzz() {
+ ()
+}
diff --git a/src/test/debuginfo/result-types.rs b/src/test/debuginfo/result-types.rs
index c0d905a6a..cdac47a78 100644
--- a/src/test/debuginfo/result-types.rs
+++ b/src/test/debuginfo/result-types.rs
@@ -7,15 +7,14 @@
// cdb-command: g
// cdb-command: dx x,d
-// cdb-check:x,d : Ok [Type: enum$<core::result::Result<i32,str> >]
+// cdb-check:x,d : Ok [Type: enum2$<core::result::Result<i32,str> >]
// cdb-check: [...] __0 : -3 [Type: int]
// cdb-command: dx y
-// cdb-check:y : Err [Type: enum$<core::result::Result<i32,str> >]
+// cdb-check:y : Err [Type: enum2$<core::result::Result<i32,str> >]
// cdb-check: [...] __0 : "Some error message" [Type: str]
-fn main()
-{
+fn main() {
let x: Result<i32, &str> = Ok(-3);
assert_eq!(x.is_ok(), true);
@@ -25,4 +24,6 @@ fn main()
zzz(); // #break.
}
-fn zzz() { () }
+fn zzz() {
+ ()
+}
diff --git a/src/test/debuginfo/type-names.rs b/src/test/debuginfo/type-names.rs
index b040a6e74..9cc99d776 100644
--- a/src/test/debuginfo/type-names.rs
+++ b/src/test/debuginfo/type-names.rs
@@ -175,51 +175,51 @@
// 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<enum$<type_names::mod1::Enum2>,f64> mut_generic_struct = [...]
+// cdb-check:struct type_names::GenericStruct<enum2$<type_names::mod1::Enum2>,f64> mut_generic_struct = [...]
// ENUMS
// cdb-command:dv /t *_enum_*
-// cdb-check:union enum$<type_names::Enum1> simple_enum_1 = [...]
-// cdb-check:union enum$<type_names::Enum1> simple_enum_2 = [...]
-// cdb-check:union enum$<type_names::mod1::Enum2> simple_enum_3 = [...]
-// cdb-check:union enum$<type_names::mod1::mod2::Enum3<type_names::mod1::Struct2> > generic_enum_1 = [...]
-// cdb-check:union enum$<type_names::mod1::mod2::Enum3<type_names::Struct1> > generic_enum_2 = [...]
+// cdb-check:union enum2$<type_names::Enum1> simple_enum_1 = [...]
+// cdb-check:union enum2$<type_names::Enum1> simple_enum_2 = [...]
+// cdb-check:union enum2$<type_names::mod1::Enum2> simple_enum_3 = [...]
+// cdb-check:union enum2$<type_names::mod1::mod2::Enum3<type_names::mod1::Struct2> > generic_enum_1 = [...]
+// cdb-check:union enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > generic_enum_2 = [...]
// TUPLES
// cdb-command:dv /t tuple*
-// cdb-check:struct tuple$<u32,type_names::Struct1,enum$<type_names::mod1::mod2::Enum3<type_names::mod1::Struct2> > > tuple1 = [...]
-// cdb-check:struct tuple$<tuple$<type_names::Struct1,type_names::mod1::mod2::Struct3>,enum$<type_names::mod1::Enum2>,char> tuple2 = [...]
+// cdb-check:struct tuple$<u32,type_names::Struct1,enum2$<type_names::mod1::mod2::Enum3<type_names::mod1::Struct2> > > tuple1 = [...]
+// cdb-check:struct tuple$<tuple$<type_names::Struct1,type_names::mod1::mod2::Struct3>,enum2$<type_names::mod1::Enum2>,char> tuple2 = [...]
// BOX
// cdb-command:dv /t box*
// cdb-check:struct tuple$<alloc::boxed::Box<f32,alloc::alloc::Global>,i32> box1 = [...]
-// cdb-check:struct tuple$<alloc::boxed::Box<enum$<type_names::mod1::mod2::Enum3<f32> >,alloc::alloc::Global>,i32> box2 = [...]
+// cdb-check:struct tuple$<alloc::boxed::Box<enum2$<type_names::mod1::mod2::Enum3<f32> >,alloc::alloc::Global>,i32> box2 = [...]
// REFERENCES
// cdb-command:dv /t *ref*
// cdb-check:struct tuple$<ref$<type_names::Struct1>,i32> ref1 = [...]
// cdb-check:struct tuple$<ref$<type_names::GenericStruct<char,type_names::Struct1> >,i32> ref2 = [...]
// cdb-check:struct tuple$<ref_mut$<type_names::Struct1>,i32> mut_ref1 = [...]
-// cdb-check:struct tuple$<ref_mut$<type_names::GenericStruct<enum$<type_names::mod1::Enum2>,f64> >,i32> mut_ref2 = [...]
+// cdb-check:struct tuple$<ref_mut$<type_names::GenericStruct<enum2$<type_names::mod1::Enum2>,f64> >,i32> mut_ref2 = [...]
// RAW POINTERS
// cdb-command:dv /t *_ptr*
// cdb-check:struct tuple$<ptr_mut$<type_names::Struct1>,isize> mut_ptr1 = [...]
// cdb-check:struct tuple$<ptr_mut$<isize>,isize> mut_ptr2 = [...]
-// cdb-check:struct tuple$<ptr_mut$<enum$<type_names::mod1::mod2::Enum3<type_names::Struct1> > >,isize> mut_ptr3 = [...]
+// cdb-check:struct tuple$<ptr_mut$<enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > >,isize> mut_ptr3 = [...]
// cdb-check:struct tuple$<ptr_const$<type_names::Struct1>,isize> const_ptr1 = [...]
// cdb-check:struct tuple$<ptr_const$<isize>,isize> const_ptr2 = [...]
-// cdb-check:struct tuple$<ptr_const$<enum$<type_names::mod1::mod2::Enum3<type_names::Struct1> > >,isize> const_ptr3 = [...]
+// cdb-check:struct tuple$<ptr_const$<enum2$<type_names::mod1::mod2::Enum3<type_names::Struct1> > >,isize> const_ptr3 = [...]
// VECTORS
// cdb-command:dv /t *vec*
// cdb-check:struct tuple$<array$<type_names::Struct1,3>,i16> fixed_size_vec1 = [...]
// cdb-check:struct tuple$<array$<usize,3>,i16> fixed_size_vec2 = [...]
// cdb-check:struct alloc::vec::Vec<usize,alloc::alloc::Global> vec1 = [...]
-// cdb-check:struct alloc::vec::Vec<enum$<type_names::mod1::Enum2>,alloc::alloc::Global> vec2 = [...]
+// cdb-check:struct alloc::vec::Vec<enum2$<type_names::mod1::Enum2>,alloc::alloc::Global> vec2 = [...]
// cdb-command:dv /t slice*
// cdb-check:struct slice$<usize> slice1 = [...]
-// cdb-check:struct slice$<enum$<type_names::mod1::Enum2> > slice2 = [...]
+// cdb-check:struct slice$<enum2$<type_names::mod1::Enum2> > slice2 = [...]
// TRAITS
// cdb-command:dv /t *_trait
@@ -238,16 +238,16 @@
// cdb-check:struct tuple$<type_names::mod1::Struct2 (*)(type_names::GenericStruct<u16,u8>),usize> unsafe_fn_with_return_value = [...]
// cdb-check:struct tuple$<type_names::Struct1 (*)(),usize> extern_c_fn_with_return_value = [...]
// cdb-check:struct tuple$<usize (*)(f64),usize> rust_fn_with_return_value = [...]
-// cdb-check:struct tuple$<void (*)(enum$<core::result::Result<char,f64> >),usize> unsafe_fn = [...]
+// cdb-check:struct tuple$<void (*)(enum2$<core::result::Result<char,f64> >),usize> unsafe_fn = [...]
// cdb-check:struct tuple$<void (*)(isize),usize> extern_c_fn = [...]
-// cdb-check:struct tuple$<void (*)(enum$<core::option::Option<isize> >,enum$<core::option::Option<ref$<type_names::mod1::Struct2> >, 1, [...], Some>),usize> rust_fn = [...]
+// cdb-check:struct tuple$<void (*)(enum2$<core::option::Option<isize> >,enum2$<core::option::Option<ref$<type_names::mod1::Struct2> > >),usize> rust_fn = [...]
// cdb-command:dv /t *_function*
// cdb-check:struct tuple$<isize (*)(ptr_const$<u8>, ...),usize> variadic_function = [...]
// cdb-check:struct tuple$<type_names::mod1::mod2::Struct3 (*)(type_names::mod1::mod2::Struct3),usize> generic_function_struct3 = [...]
// cdb-check:struct tuple$<isize (*)(isize),usize> generic_function_int = [...]
// cdb-command:dx Debugger.State.Scripts.@"type-names.cdb".Contents.getFunctionDetails("rust_fn")
// cdb-check:Return Type: void
-// cdb-check:Parameter Types: enum$<core::option::Option<isize> >,enum$<core::option::Option<ref$<type_names::mod1::Struct2> >, 1, [...], Some>
+// cdb-check:Parameter Types: enum2$<core::option::Option<isize> >,enum2$<core::option::Option<ref$<type_names::mod1::Struct2> > >
// cdb-command:dx Debugger.State.Scripts.@"type-names.cdb".Contents.getFunctionDetails("rust_fn_with_return_value")
// cdb-check:Return Type: usize
// cdb-check:Parameter Types: f64
diff --git a/src/test/incremental/hashes/enum_defs.rs b/src/test/incremental/hashes/enum_defs.rs
index b466cfdd5..0f8898c38 100644
--- a/src/test/incremental/hashes/enum_defs.rs
+++ b/src/test/incremental/hashes/enum_defs.rs
@@ -504,9 +504,9 @@ enum EnumAddLifetimeBoundToParameter<'a, T> {
}
#[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
+#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail3")]
-#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
+#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumAddLifetimeBoundToParameter<'a, T: 'a> {
Variant1(T),
@@ -559,9 +559,9 @@ enum EnumAddLifetimeBoundToParameterWhere<'a, T> {
}
#[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
+#[rustc_clean(cfg="cfail2", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail3")]
-#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,generics_of,predicates_of")]
+#[rustc_clean(cfg="cfail5", except="hir_owner,hir_owner_nodes,predicates_of")]
#[rustc_clean(cfg="cfail6")]
enum EnumAddLifetimeBoundToParameterWhere<'a, T> where T: 'a {
Variant1(T),
diff --git a/src/test/incremental/hashes/function_interfaces.rs b/src/test/incremental/hashes/function_interfaces.rs
index 076eddaab..3ff949fbb 100644
--- a/src/test/incremental/hashes/function_interfaces.rs
+++ b/src/test/incremental/hashes/function_interfaces.rs
@@ -323,7 +323,7 @@ pub fn change_return_impl_trait() -> impl Clone {
#[cfg(not(any(cfail1,cfail4)))]
#[rustc_clean(cfg = "cfail2")]
#[rustc_clean(cfg = "cfail3")]
-#[rustc_clean(cfg = "cfail5")]
+#[rustc_clean(cfg = "cfail5", except = "typeck")]
#[rustc_clean(cfg = "cfail6")]
pub fn change_return_impl_trait() -> impl Copy {
0u32
diff --git a/src/test/incremental/hashes/trait_defs.rs b/src/test/incremental/hashes/trait_defs.rs
index 1988f3f35..c453eeceb 100644
--- a/src/test/incremental/hashes/trait_defs.rs
+++ b/src/test/incremental/hashes/trait_defs.rs
@@ -1066,9 +1066,9 @@ trait TraitAddTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0> { }
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T> { }
#[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
trait TraitAddLifetimeBoundToTypeParameterOfTrait<'a, T: 'a> { }
@@ -1144,9 +1144,9 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTrait<T: ReferencedTrait0 + Refer
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a> { }
#[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
trait TraitAddSecondLifetimeBoundToTypeParameterOfTrait<'a, 'b, T: 'a + 'b> { }
@@ -1201,9 +1201,9 @@ trait TraitAddTraitBoundToTypeParameterOfTraitWhere<T> where T: ReferencedTrait0
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> { }
#[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
trait TraitAddLifetimeBoundToTypeParameterOfTraitWhere<'a, T> where T: 'a { }
@@ -1254,9 +1254,9 @@ trait TraitAddSecondTraitBoundToTypeParameterOfTraitWhere<T>
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a { }
#[cfg(not(any(cfail1,cfail4)))]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail2")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail2")]
#[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="hir_owner,hir_owner_nodes,generics_of,predicates_of", cfg="cfail5")]
+#[rustc_clean(except="hir_owner,hir_owner_nodes,predicates_of", cfg="cfail5")]
#[rustc_clean(cfg="cfail6")]
trait TraitAddSecondLifetimeBoundToTypeParameterOfTraitWhere<'a, 'b, T> where T: 'a + 'b { }
diff --git a/src/test/incremental/hygiene/load_cached_hygiene.rs b/src/test/incremental/hygiene/load_cached_hygiene.rs
index 812414141..355d33458 100644
--- a/src/test/incremental/hygiene/load_cached_hygiene.rs
+++ b/src/test/incremental/hygiene/load_cached_hygiene.rs
@@ -2,7 +2,7 @@
// compile-flags: -Z query-dep-graph
// aux-build:cached_hygiene.rs
-// This tests the folllowing scenario
+// This tests the following scenario
// 1. A foreign crate is compiled with incremental compilation.
// This causes hygiene information to be saved to the incr cache.
// 2. One function is the foreign crate is modified. This causes the
diff --git a/src/test/incremental/issue-100521-change-struct-name-assocty.rs b/src/test/incremental/issue-100521-change-struct-name-assocty.rs
new file mode 100644
index 000000000..7f8d1e608
--- /dev/null
+++ b/src/test/incremental/issue-100521-change-struct-name-assocty.rs
@@ -0,0 +1,65 @@
+// revisions: rpass1 rpass2
+
+pub fn foo() {
+ bar();
+ baz::<()>();
+}
+
+fn bar()
+where
+ <() as Table>::AllColumns:,
+{
+}
+
+fn baz<W>()
+where
+ W: AsQuery,
+ <W as AsQuery>::Query:,
+{
+}
+
+trait AsQuery {
+ type Query;
+}
+
+trait UnimplementedTrait {}
+
+impl<T> AsQuery for T
+where
+ T: UnimplementedTrait,
+{
+ type Query = ();
+}
+
+struct Wrapper<Expr>(Expr);
+
+impl<Ret> AsQuery for Wrapper<Ret> {
+ type Query = ();
+}
+
+impl AsQuery for ()
+where
+ Wrapper<<() as Table>::AllColumns>: AsQuery,
+{
+ type Query = ();
+}
+
+trait Table {
+ type AllColumns;
+}
+
+#[cfg(rpass1)]
+impl Table for () {
+ type AllColumns = Checksum1;
+}
+#[cfg(rpass1)]
+struct Checksum1;
+
+#[cfg(rpass2)]
+impl Table for () {
+ type AllColumns = Checksum2;
+}
+#[cfg(rpass2)]
+struct Checksum2;
+
+fn main() {}
diff --git a/src/test/incremental/issue-49043.rs b/src/test/incremental/issue-49043.rs
index 50d8fb869..8d13718b8 100644
--- a/src/test/incremental/issue-49043.rs
+++ b/src/test/incremental/issue-49043.rs
@@ -1,5 +1,5 @@
// Regression test for hashing involving canonical variables. In this
-// test -- which has an intensional error -- the type of the value
+// test -- which has an intentional error -- the type of the value
// being dropped winds up including a type variable. Canonicalization
// would then produce a `?0` which -- in turn -- triggered an ICE in
// hashing.
diff --git a/src/test/incremental/issue-61323.rs b/src/test/incremental/issue-61323.rs
index 97cbfe408..7ce47947c 100644
--- a/src/test/incremental/issue-61323.rs
+++ b/src/test/incremental/issue-61323.rs
@@ -1,7 +1,7 @@
// revisions: rpass cfail
enum A {
- //[cfail]~^ ERROR 3:1: 3:7: recursive type `A` has infinite size [E0072]
+ //[cfail]~^ ERROR 3:1: 3:7: recursive types `A` and `C` have infinite size [E0072]
B(C),
}
@@ -10,6 +10,5 @@ struct C(Box<A>);
#[cfg(cfail)]
struct C(A);
-//[cfail]~^ ERROR 12:1: 12:9: recursive type `C` has infinite size [E0072]
fn main() {}
diff --git a/src/test/incremental/spans_significant_w_panic.rs b/src/test/incremental/spans_significant_w_panic.rs
index e9e35791a..6f51c9729 100644
--- a/src/test/incremental/spans_significant_w_panic.rs
+++ b/src/test/incremental/spans_significant_w_panic.rs
@@ -8,7 +8,6 @@
// compile-flags: -C overflow-checks=on -Z query-dep-graph
#![feature(rustc_attrs)]
-#![feature(bench_black_box)]
#![rustc_partition_codegened(module = "spans_significant_w_panic", cfg = "rpass2")]
#![rustc_partition_codegened(module = "spans_significant_w_panic", cfg = "rpass4")]
diff --git a/src/test/incremental/split_debuginfo_cached.rs b/src/test/incremental/split_debuginfo_cached.rs
index 25c802d5a..ba8385f89 100644
--- a/src/test/incremental/split_debuginfo_cached.rs
+++ b/src/test/incremental/split_debuginfo_cached.rs
@@ -6,8 +6,8 @@
// only-x86_64-unknown-linux-gnu
// revisions:rpass1 rpass2
-// [rpass1]compile-flags: -g -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split
-// [rpass2]compile-flags: -g -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split
+// [rpass1]compile-flags: -g -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split
+// [rpass2]compile-flags: -g -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split
#![feature(rustc_attrs)]
// For `rpass2`, nothing has changed so everything should re-used.
diff --git a/src/test/incremental/split_debuginfo_mode.rs b/src/test/incremental/split_debuginfo_mode.rs
index f2533e414..edc1a80d3 100644
--- a/src/test/incremental/split_debuginfo_mode.rs
+++ b/src/test/incremental/split_debuginfo_mode.rs
@@ -6,10 +6,10 @@
// only-x86_64-unknown-linux-gnu
// revisions:rpass1 rpass2 rpass3 rpass4
-// [rpass1]compile-flags: -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
-// [rpass2]compile-flags: -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=packed -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
-// [rpass3]compile-flags: -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split -Zsplit-dwarf-inlining=on
-// [rpass4]compile-flags: -Zquery-dep-graph -Zunstable-options -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split -Zsplit-dwarf-inlining=off
+// [rpass1]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
+// [rpass2]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=single -Zsplit-dwarf-inlining=on
+// [rpass3]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split -Zsplit-dwarf-inlining=on
+// [rpass4]compile-flags: -Zquery-dep-graph -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split -Zsplit-dwarf-inlining=off
#![feature(rustc_attrs)]
// For rpass2 we change -Csplit-debuginfo and thus expect every CGU to be recompiled
diff --git a/src/test/incremental/thinlto/cgu_invalidated_when_export_added.rs b/src/test/incremental/thinlto/cgu_invalidated_when_export_added.rs
index 4d48a5f0a..95f3b8ae4 100644
--- a/src/test/incremental/thinlto/cgu_invalidated_when_export_added.rs
+++ b/src/test/incremental/thinlto/cgu_invalidated_when_export_added.rs
@@ -3,7 +3,7 @@
// rust-lang/rust#69798:
//
-// This is analgous to cgu_invalidated_when_import_added, but it covers a
+// This is analogous to cgu_invalidated_when_import_added, but it covers a
// problem uncovered where a change to the *export* set caused a link failure
// when reusing post-LTO optimized object code.
diff --git a/src/test/incremental/thinlto/cgu_invalidated_when_export_removed.rs b/src/test/incremental/thinlto/cgu_invalidated_when_export_removed.rs
index e85b4856f..e86ebd354 100644
--- a/src/test/incremental/thinlto/cgu_invalidated_when_export_removed.rs
+++ b/src/test/incremental/thinlto/cgu_invalidated_when_export_removed.rs
@@ -3,7 +3,7 @@
// rust-lang/rust#69798:
//
-// This is analgous to cgu_invalidated_when_export_added, but it covers the
+// This is analogous to cgu_invalidated_when_export_added, but it covers the
// other direction. This is analogous to cgu_invalidated_when_import_added: we
// include it, because it may uncover bugs in variant implementation strategies.
diff --git a/src/test/mir-opt/README.md b/src/test/mir-opt/README.md
index a0550466c..0721d9f70 100644
--- a/src/test/mir-opt/README.md
+++ b/src/test/mir-opt/README.md
@@ -14,6 +14,18 @@ presence of pointers in constants or other bit width dependent things. In that c
to your test, causing separate files to be generated for 32bit and 64bit systems.
+## Unit testing
+
+If you are only testing the behavior of a particular mir-opt pass on some specific input (as is
+usually the case), you should add
+
+```
+// unit-test: PassName
+```
+
+to the top of the file. This makes sure that other passes don't run which means you'll get the input
+you expected and your test won't break when other code changes.
+
## Emit a diff of the mir for a specific optimization
This is what you want most often when you want to see how an optimization changes the MIR.
diff --git a/src/test/mir-opt/array-index-is-temporary.rs b/src/test/mir-opt/array-index-is-temporary.rs
index 0e4c486e4..e7bde81d4 100644
--- a/src/test/mir-opt/array-index-is-temporary.rs
+++ b/src/test/mir-opt/array-index-is-temporary.rs
@@ -7,7 +7,7 @@ unsafe fn foo(z: *mut usize) -> u32 {
99
}
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir
fn main() {
let mut x = [42, 43, 44];
diff --git a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir b/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir
deleted file mode 100644
index 27f883ed3..000000000
--- a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.64bit.mir
+++ /dev/null
@@ -1,64 +0,0 @@
-// MIR for `main` after SimplifyCfg-elaborate-drops
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/array-index-is-temporary.rs:+0:11: +0:11
- let mut _1: [u32; 3]; // in scope 0 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
- let mut _4: &mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
- let mut _5: u32; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:12: +4:29
- let mut _6: *mut usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
- let _7: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
- let mut _8: usize; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
- let mut _9: bool; // in scope 0 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
- let mut _2: usize; // in scope 1 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
- scope 2 {
- debug y => _2; // in scope 2 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
- let _3: *mut usize; // in scope 2 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
- scope 3 {
- debug z => _3; // in scope 3 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
- scope 4 {
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:+1:9: +1:14
- _1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array-index-is-temporary.rs:+1:17: +1:29
- StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:+2:9: +2:14
- _2 = const 1_usize; // scope 1 at $DIR/array-index-is-temporary.rs:+2:17: +2:18
- StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:+3:9: +3:10
- StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
- _4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
- _3 = &raw mut (*_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:25: +3:31
- StorageDead(_4); // scope 2 at $DIR/array-index-is-temporary.rs:+3:31: +3:32
- StorageLive(_5); // scope 3 at $DIR/array-index-is-temporary.rs:+4:12: +4:29
- StorageLive(_6); // scope 4 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
- _6 = _3; // scope 4 at $DIR/array-index-is-temporary.rs:+4:25: +4:26
- _5 = foo(move _6) -> bb1; // scope 4 at $DIR/array-index-is-temporary.rs:+4:21: +4:27
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:16:21: 16:24
- // + literal: Const { ty: unsafe fn(*mut usize) -> u32 {foo}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_6); // scope 4 at $DIR/array-index-is-temporary.rs:+4:26: +4:27
- StorageLive(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
- _7 = _2; // scope 3 at $DIR/array-index-is-temporary.rs:+4:7: +4:8
- _8 = Len(_1); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
- _9 = Lt(_7, _8); // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:9
- }
-
- bb2: {
- _1[_7] = move _5; // scope 3 at $DIR/array-index-is-temporary.rs:+4:5: +4:29
- StorageDead(_5); // scope 3 at $DIR/array-index-is-temporary.rs:+4:28: +4:29
- StorageDead(_7); // scope 3 at $DIR/array-index-is-temporary.rs:+4:29: +4:30
- _0 = const (); // scope 0 at $DIR/array-index-is-temporary.rs:+0:11: +5:2
- StorageDead(_3); // scope 2 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
- StorageDead(_2); // scope 1 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
- StorageDead(_1); // scope 0 at $DIR/array-index-is-temporary.rs:+5:1: +5:2
- return; // scope 0 at $DIR/array-index-is-temporary.rs:+5:2: +5:2
- }
-}
diff --git a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.32bit.mir b/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir
index 27f883ed3..27f883ed3 100644
--- a/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.32bit.mir
+++ b/src/test/mir-opt/array_index_is_temporary.main.SimplifyCfg-elaborate-drops.after.mir
diff --git a/src/test/mir-opt/asm_unwind_panic_abort.rs b/src/test/mir-opt/asm_unwind_panic_abort.rs
index 8201d5434..ad8f9398e 100644
--- a/src/test/mir-opt/asm_unwind_panic_abort.rs
+++ b/src/test/mir-opt/asm_unwind_panic_abort.rs
@@ -1,7 +1,6 @@
//! Tests that unwinding from an asm block is caught and forced to abort
//! when `-C panic=abort`.
-// min-llvm-version: 13.0.0
// only-x86_64
// compile-flags: -C panic=abort
// no-prefer-dynamic
diff --git a/src/test/mir-opt/bool_compare.rs b/src/test/mir-opt/bool_compare.rs
index 3ff046325..4435bf5b0 100644
--- a/src/test/mir-opt/bool_compare.rs
+++ b/src/test/mir-opt/bool_compare.rs
@@ -1,3 +1,5 @@
+// unit-test: InstCombine
+
// EMIT_MIR bool_compare.opt1.InstCombine.diff
fn opt1(x: bool) -> u32 {
if x != true { 0 } else { 1 }
diff --git a/src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff b/src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff
deleted file mode 100644
index c73150f94..000000000
--- a/src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff
+++ /dev/null
@@ -1,77 +0,0 @@
-- // MIR for `norm2` before InstCombine
-+ // MIR for `norm2` after InstCombine
-
- fn norm2(_1: [f32; 2]) -> f32 {
- debug x => _1; // in scope 0 at $DIR/combine_array_len.rs:+0:10: +0:11
- let mut _0: f32; // return place in scope 0 at $DIR/combine_array_len.rs:+0:26: +0:29
- let _2: f32; // in scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
- let _3: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
- let mut _4: usize; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- let mut _5: bool; // in scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- let _7: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:15: +2:16
- let mut _8: usize; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
- let mut _9: bool; // in scope 0 at $DIR/combine_array_len.rs:+2:13: +2:17
- let mut _10: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:8
- let mut _11: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:5: +3:6
- let mut _12: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:7: +3:8
- let mut _13: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:14
- let mut _14: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:11: +3:12
- let mut _15: f32; // in scope 0 at $DIR/combine_array_len.rs:+3:13: +3:14
- scope 1 {
- debug a => _2; // in scope 1 at $DIR/combine_array_len.rs:+1:9: +1:10
- let _6: f32; // in scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
- scope 2 {
- debug b => _6; // in scope 2 at $DIR/combine_array_len.rs:+2:9: +2:10
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:+1:9: +1:10
- StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
- _3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:+1:15: +1:16
-- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
-+ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- _5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- }
-
- bb1: {
- _2 = _1[_3]; // scope 0 at $DIR/combine_array_len.rs:+1:13: +1:17
- StorageDead(_3); // scope 0 at $DIR/combine_array_len.rs:+1:17: +1:18
- StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:+2:9: +2:10
- StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
- _7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:+2:15: +2:16
-- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
-+ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- _9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- assert(move _9, "index out of bounds: the length is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- }
-
- bb2: {
- _6 = _1[_7]; // scope 1 at $DIR/combine_array_len.rs:+2:13: +2:17
- StorageDead(_7); // scope 1 at $DIR/combine_array_len.rs:+2:17: +2:18
- StorageLive(_10); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
- StorageLive(_11); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
- _11 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:6
- StorageLive(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- _12 = _2; // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- _10 = Mul(move _11, move _12); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:8
- StorageDead(_12); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- StorageDead(_11); // scope 2 at $DIR/combine_array_len.rs:+3:7: +3:8
- StorageLive(_13); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
- StorageLive(_14); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
- _14 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:12
- StorageLive(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- _15 = _6; // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- _13 = Mul(move _14, move _15); // scope 2 at $DIR/combine_array_len.rs:+3:11: +3:14
- StorageDead(_15); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- StorageDead(_14); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- _0 = Add(move _10, move _13); // scope 2 at $DIR/combine_array_len.rs:+3:5: +3:14
- StorageDead(_13); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- StorageDead(_10); // scope 2 at $DIR/combine_array_len.rs:+3:13: +3:14
- StorageDead(_6); // scope 1 at $DIR/combine_array_len.rs:+4:1: +4:2
- StorageDead(_2); // scope 0 at $DIR/combine_array_len.rs:+4:1: +4:2
- return; // scope 0 at $DIR/combine_array_len.rs:+4:2: +4:2
- }
- }
-
diff --git a/src/test/mir-opt/combine_array_len.norm2.InstCombine.32bit.diff b/src/test/mir-opt/combine_array_len.norm2.InstCombine.diff
index c73150f94..c73150f94 100644
--- a/src/test/mir-opt/combine_array_len.norm2.InstCombine.32bit.diff
+++ b/src/test/mir-opt/combine_array_len.norm2.InstCombine.diff
diff --git a/src/test/mir-opt/combine_array_len.rs b/src/test/mir-opt/combine_array_len.rs
index 93490c14f..3ef3bd09a 100644
--- a/src/test/mir-opt/combine_array_len.rs
+++ b/src/test/mir-opt/combine_array_len.rs
@@ -1,4 +1,4 @@
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+// unit-test: InstCombine
// EMIT_MIR combine_array_len.norm2.InstCombine.diff
fn norm2(x: [f32; 2]) -> f32 {
diff --git a/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff b/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff
index 833d620cc..6f01553ee 100644
--- a/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff
+++ b/src/test/mir-opt/combine_clone_of_primitives.{impl#0}-clone.InstCombine.diff
@@ -4,63 +4,63 @@
fn <impl at $DIR/combine_clone_of_primitives.rs:6:10: 6:15>::clone(_1: &MyThing<T>) -> MyThing<T> {
debug self => _1; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
let mut _0: MyThing<T>; // return place in scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
- let mut _2: T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
- let mut _3: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
- let _4: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
- let mut _5: u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
- let mut _6: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
- let _7: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
- let mut _8: [f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
- let mut _9: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
- let _10: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
+ let mut _2: T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+ let mut _3: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+ let _4: &T; // in scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+ let mut _5: u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+ let mut _6: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+ let _7: &u64; // in scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+ let mut _8: [f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
+ let mut _9: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
+ let _10: &[f32; 3]; // in scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
bb0: {
- StorageLive(_2); // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
- StorageLive(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
- StorageLive(_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
- _4 = &((*_1).0: T); // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
-- _3 = &(*_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
-+ _3 = _4; // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
- _2 = <T as Clone>::clone(move _3) -> bb1; // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:5: +2:9
+ StorageLive(_2); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+ StorageLive(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+ StorageLive(_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+ _4 = &((*_1).0: T); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+- _3 = &(*_4); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
++ _3 = _4; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
+ _2 = <T as Clone>::clone(move _3) -> bb1; // scope 0 at $DIR/combine_clone_of_primitives.rs:8:5: 8:9
// mir::Constant
// + span: $DIR/combine_clone_of_primitives.rs:8:5: 8:9
- // + literal: Const { ty: for<'r> fn(&'r T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:+2:8: +2:9
- StorageLive(_5); // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
- StorageLive(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
- StorageLive(_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
- _7 = &((*_1).1: u64); // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
-- _6 = &(*_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
-- _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
+ StorageDead(_3); // scope 0 at $DIR/combine_clone_of_primitives.rs:8:8: 8:9
+ StorageLive(_5); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+ StorageLive(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+ StorageLive(_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+ _7 = &((*_1).1: u64); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+- _6 = &(*_7); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
+- _5 = <u64 as Clone>::clone(move _6) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
- // mir::Constant
- // + span: $DIR/combine_clone_of_primitives.rs:9:5: 9:11
-- // + literal: Const { ty: for<'r> fn(&'r u64) -> u64 {<u64 as Clone>::clone}, val: Value(<ZST>) }
-+ _6 = _7; // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
-+ _5 = (*_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
-+ goto -> bb2; // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:5: +3:11
+- // + literal: Const { ty: for<'a> fn(&'a u64) -> u64 {<u64 as Clone>::clone}, val: Value(<ZST>) }
++ _6 = _7; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
++ _5 = (*_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
++ goto -> bb2; // scope 0 at $DIR/combine_clone_of_primitives.rs:9:5: 9:11
}
bb2: {
- StorageDead(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:+3:10: +3:11
- StorageLive(_8); // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
- StorageLive(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
- StorageLive(_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
- _10 = &((*_1).2: [f32; 3]); // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
-- _9 = &(*_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
-- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
+ StorageDead(_6); // scope 0 at $DIR/combine_clone_of_primitives.rs:9:10: 9:11
+ StorageLive(_8); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
+ StorageLive(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
+ StorageLive(_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
+ _10 = &((*_1).2: [f32; 3]); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
+- _9 = &(*_10); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
+- _8 = <[f32; 3] as Clone>::clone(move _9) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
- // mir::Constant
- // + span: $DIR/combine_clone_of_primitives.rs:10:5: 10:16
-- // + literal: Const { ty: for<'r> fn(&'r [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value(<ZST>) }
-+ _9 = _10; // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
-+ _8 = (*_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
-+ goto -> bb3; // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:5: +4:16
+- // + literal: Const { ty: for<'a> fn(&'a [f32; 3]) -> [f32; 3] {<[f32; 3] as Clone>::clone}, val: Value(<ZST>) }
++ _9 = _10; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
++ _8 = (*_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
++ goto -> bb3; // scope 0 at $DIR/combine_clone_of_primitives.rs:10:5: 10:16
}
bb3: {
- StorageDead(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:+4:15: +4:16
+ StorageDead(_9); // scope 0 at $DIR/combine_clone_of_primitives.rs:10:15: 10:16
Deinit(_0); // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
(_0.0: T) = move _2; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
(_0.1: u64) = move _5; // scope 0 at $DIR/combine_clone_of_primitives.rs:+0:10: +0:15
diff --git a/src/test/mir-opt/const_goto.rs b/src/test/mir-opt/const_goto.rs
index 939902e70..6f84f186b 100644
--- a/src/test/mir-opt/const_goto.rs
+++ b/src/test/mir-opt/const_goto.rs
@@ -1,3 +1,5 @@
+// unit-test: ConstGoto
+
pub enum Foo {
A,
B,
diff --git a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff b/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff
index 2b09ef786..81c356cb1 100644
--- a/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff
+++ b/src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff
@@ -17,7 +17,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_goto_storage.rs:+1:9: +1:12
- StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
-- nop; // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
+- Deinit(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
- StorageLive(_3); // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
- StorageLive(_4); // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52
diff --git a/src/test/mir-opt/const_goto_storage.rs b/src/test/mir-opt/const_goto_storage.rs
index 4ef68e7e1..459599c73 100644
--- a/src/test/mir-opt/const_goto_storage.rs
+++ b/src/test/mir-opt/const_goto_storage.rs
@@ -1,3 +1,5 @@
+// unit-test: ConstGoto
+
// EMIT_MIR const_goto_storage.match_nested_if.ConstGoto.diff
fn match_nested_if() -> bool {
let val = match () {
diff --git a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
index f58ba56b9..f8a7c687e 100644
--- a/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
+++ b/src/test/mir-opt/const_promotion_extern_static.BAR.PromoteTemps.diff
@@ -17,7 +17,7 @@
- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:32: +0:34
- StorageLive(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:33: +0:34
- _5 = const {alloc1: &i32}; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:33: +0:34
-+ _6 = const BAR::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:44
++ _6 = const _; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:44
// mir::Constant
- // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
- // + literal: Const { ty: &i32, val: Value(Scalar(alloc1)) }
@@ -33,18 +33,18 @@
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:44
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:9:36: 9:42
- // + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:43: +0:44
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:43: +0:44
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:43: +0:44
- return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:28
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:45
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:28
+ resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:45
}
- }
-
diff --git a/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir b/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir
index deb467977..90920fbe7 100644
--- a/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir
+++ b/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir
@@ -12,6 +12,6 @@ static BOP: &i32 = {
_1 = &_2; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:20: +0:23
_0 = &(*_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:20: +0:23
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:22: +0:23
- return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:17
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:24
}
}
diff --git a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
index 5300f555f..e938ca28a 100644
--- a/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
+++ b/src/test/mir-opt/const_promotion_extern_static.FOO.PromoteTemps.diff
@@ -19,7 +19,7 @@
- StorageLive(_4); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:32: +0:45
- StorageLive(_5); // scope 1 at $DIR/const-promotion-extern-static.rs:+0:42: +0:43
- _5 = const {alloc3: *const i32}; // scope 1 at $DIR/const-promotion-extern-static.rs:+0:42: +0:43
-+ _6 = const FOO::promoted[0]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:55
++ _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)) }
@@ -35,18 +35,18 @@
_0 = core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:31: +0:55
// mir::Constant
// + span: $DIR/const-promotion-extern-static.rs:13:47: 13:53
- // + literal: Const { ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_5); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:54: +0:55
- StorageDead(_3); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:54: +0:55
StorageDead(_1); // scope 0 at $DIR/const-promotion-extern-static.rs:+0:54: +0:55
- return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:28
+ return; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:56
}
bb2 (cleanup): {
- resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:28
+ resume; // scope 0 at $DIR/const-promotion-extern-static.rs:+0:1: +0:56
}
}
-
diff --git a/src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff b/src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff
index 836443bf4..04378dbf3 100644
--- a/src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/aggregate.main.ConstProp.diff
@@ -24,7 +24,7 @@
+ _1 = const 1_i32; // scope 0 at $DIR/aggregate.rs:+1:13: +1:28
StorageDead(_2); // scope 0 at $DIR/aggregate.rs:+1:27: +1:28
StorageDead(_3); // scope 0 at $DIR/aggregate.rs:+1:28: +1:29
- nop; // scope 0 at $DIR/aggregate.rs:+0:11: +2:2
+ _0 = const (); // scope 0 at $DIR/aggregate.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/aggregate.rs:+2:1: +2:2
return; // scope 0 at $DIR/aggregate.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/const_prop/aggregate.rs b/src/test/mir-opt/const_prop/aggregate.rs
index 7a3b26a73..493d0508a 100644
--- a/src/test/mir-opt/const_prop/aggregate.rs
+++ b/src/test/mir-opt/const_prop/aggregate.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -O
// EMIT_MIR aggregate.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff
index bb9abdd10..439b2a3e1 100644
--- a/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff
+++ b/src/test/mir-opt/const_prop/array_index.main.ConstProp.32bit.diff
@@ -18,11 +18,12 @@
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
- _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
+- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
++ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
}
bb1: {
@@ -30,7 +31,7 @@
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
- nop; // scope 0 at $DIR/array_index.rs:+0:11: +2:2
+ _0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff
index bb9abdd10..439b2a3e1 100644
--- a/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff
+++ b/src/test/mir-opt/const_prop/array_index.main.ConstProp.64bit.diff
@@ -18,11 +18,12 @@
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:+1:18: +1:30
StorageLive(_3); // scope 0 at $DIR/array_index.rs:+1:31: +1:32
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:+1:31: +1:32
- _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
+- _4 = Len(_2); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:+1:18: +1:33
- assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
++ _4 = const 4_usize; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
+ _5 = const true; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
-+ assert(const true, "index out of bounds: the length is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
++ assert(const true, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
}
bb1: {
@@ -30,7 +31,7 @@
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:+1:18: +1:33
StorageDead(_3); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
StorageDead(_2); // scope 0 at $DIR/array_index.rs:+1:33: +1:34
- nop; // scope 0 at $DIR/array_index.rs:+0:11: +2:2
+ _0 = const (); // scope 0 at $DIR/array_index.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/array_index.rs:+2:1: +2:2
return; // scope 0 at $DIR/array_index.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/const_prop/array_index.rs b/src/test/mir-opt/const_prop/array_index.rs
index 2c5254b5d..d31c2827b 100644
--- a/src/test/mir-opt/const_prop/array_index.rs
+++ b/src/test/mir-opt/const_prop/array_index.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR array_index.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff
index 45134a3fd..bea32a67e 100644
--- a/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/bad_op_div_by_zero.main.ConstProp.diff
@@ -24,10 +24,9 @@
StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
- _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-- assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
+ _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ assert(!const true, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
+ assert(!move _4, "attempt to divide `{}` by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
}
bb1: {
@@ -38,14 +37,13 @@
+ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
+ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
+ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
++ assert(!const false, "attempt to compute `{} / {}`, which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
}
bb2: {
-- _2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
-+ _2 = Div(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
+ _2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:14: +2:19
StorageDead(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:+2:18: +2:19
- nop; // scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +3:2
+ _0 = const (); // scope 0 at $DIR/bad_op_div_by_zero.rs:+0:11: +3:2
StorageDead(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
StorageDead(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:1: +3:2
return; // scope 0 at $DIR/bad_op_div_by_zero.rs:+3:2: +3:2
diff --git a/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs b/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs
index 6f39209b9..a6fd325ec 100644
--- a/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs
+++ b/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// EMIT_MIR bad_op_div_by_zero.main.ConstProp.diff
#[allow(unconditional_panic)]
fn main() {
diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
index 553488838..c27b19679 100644
--- a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
+++ b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.32bit.diff
@@ -25,7 +25,7 @@
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
+ _9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
index 553488838..c27b19679 100644
--- a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
+++ b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.main.ConstProp.64bit.diff
@@ -25,7 +25,7 @@
StorageLive(_1); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:9: +1:10
StorageLive(_2); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
StorageLive(_3); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
- _9 = const main::promoted[0]; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
+ _9 = const _; // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:+1:25: +1:35
// mir::Constant
// + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
// + literal: Const { ty: &[i32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
diff --git a/src/test/mir-opt/const_prop/boolean_identities.rs b/src/test/mir-opt/const_prop/boolean_identities.rs
index 57164e3e7..c7b609949 100644
--- a/src/test/mir-opt/const_prop/boolean_identities.rs
+++ b/src/test/mir-opt/const_prop/boolean_identities.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -O -Zmir-opt-level=4
// EMIT_MIR boolean_identities.test.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff b/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff
index f2d4bee1b..5ec421eb2 100644
--- a/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/boxes.main.ConstProp.diff
@@ -12,8 +12,6 @@
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 _10: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
- let mut _11: *const i32; // in scope 0 at $DIR/boxes.rs:+1:14: +1:22
scope 1 {
debug x => _1; // in scope 1 at $DIR/boxes.rs:+1:9: +1:10
}
@@ -26,28 +24,23 @@
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
-- _6 = alloc::alloc::exchange_malloc(move _4, move _5) -> bb1; // 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(const 4_usize, const 4_usize) -> bb1; // 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
// mir::Constant
- // + span: $DIR/boxes.rs:12:14: 12:22
+ // + span: $DIR/boxes.rs:13:14: 13:22
// + 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
- StorageLive(_8); // scope 0 at $DIR/boxes.rs:+1:19: +1:21
_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
- StorageDead(_8); // scope 0 at $DIR/boxes.rs:+1:14: +1:22
_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
- StorageLive(_9); // scope 0 at $DIR/boxes.rs:+1:13: +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
- StorageDead(_9); // scope 0 at $DIR/boxes.rs:+1:13: +1:26
_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
@@ -55,7 +48,7 @@
bb2: {
StorageDead(_3); // scope 0 at $DIR/boxes.rs:+1:26: +1:27
- nop; // scope 0 at $DIR/boxes.rs:+0:11: +2:2
+ _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
}
diff --git a/src/test/mir-opt/const_prop/boxes.rs b/src/test/mir-opt/const_prop/boxes.rs
index fea666a44..d287830db 100644
--- a/src/test/mir-opt/const_prop/boxes.rs
+++ b/src/test/mir-opt/const_prop/boxes.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -O
// ignore-emscripten compiled with panic=abort by default
// ignore-wasm32
diff --git a/src/test/mir-opt/const_prop/cast.main.ConstProp.diff b/src/test/mir-opt/const_prop/cast.main.ConstProp.diff
index 5698a612f..1d4dfc29f 100644
--- a/src/test/mir-opt/const_prop/cast.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/cast.main.ConstProp.diff
@@ -14,12 +14,12 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/cast.rs:+1:9: +1:10
-- _1 = const 42_u8 as u32 (Misc); // scope 0 at $DIR/cast.rs:+1:13: +1:24
+- _1 = const 42_u8 as u32 (IntToInt); // scope 0 at $DIR/cast.rs:+1:13: +1:24
+ _1 = const 42_u32; // scope 0 at $DIR/cast.rs:+1:13: +1:24
StorageLive(_2); // scope 1 at $DIR/cast.rs:+3:9: +3:10
-- _2 = const 42_u32 as u8 (Misc); // scope 1 at $DIR/cast.rs:+3:13: +3:24
+- _2 = const 42_u32 as u8 (IntToInt); // scope 1 at $DIR/cast.rs:+3:13: +3:24
+ _2 = const 42_u8; // scope 1 at $DIR/cast.rs:+3:13: +3:24
- nop; // scope 0 at $DIR/cast.rs:+0:11: +4:2
+ _0 = const (); // scope 0 at $DIR/cast.rs:+0:11: +4:2
StorageDead(_2); // scope 1 at $DIR/cast.rs:+4:1: +4:2
StorageDead(_1); // scope 0 at $DIR/cast.rs:+4:1: +4:2
return; // scope 0 at $DIR/cast.rs:+4:2: +4:2
diff --git a/src/test/mir-opt/const_prop/cast.rs b/src/test/mir-opt/const_prop/cast.rs
index 680cab007..984086eda 100644
--- a/src/test/mir-opt/const_prop/cast.rs
+++ b/src/test/mir-opt/const_prop/cast.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// EMIT_MIR cast.main.ConstProp.diff
fn main() {
diff --git a/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff b/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff
index 5e33d0542..96d0d2566 100644
--- a/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/checked_add.main.ConstProp.diff
@@ -20,7 +20,7 @@
bb1: {
- _1 = move (_2.0: u32); // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
+ _1 = const 2_u32; // scope 0 at $DIR/checked_add.rs:+1:18: +1:23
- nop; // scope 0 at $DIR/checked_add.rs:+0:11: +2:2
+ _0 = const (); // scope 0 at $DIR/checked_add.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/checked_add.rs:+2:1: +2:2
return; // scope 0 at $DIR/checked_add.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/const_prop/checked_add.rs b/src/test/mir-opt/const_prop/checked_add.rs
index 08d59b6fb..b9860da4c 100644
--- a/src/test/mir-opt/const_prop/checked_add.rs
+++ b/src/test/mir-opt/const_prop/checked_add.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -C overflow-checks=on
// EMIT_MIR checked_add.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff b/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff
index c21b24591..bea7114c7 100644
--- a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/const_prop_fails_gracefully.main.ConstProp.diff
@@ -16,9 +16,9 @@
StorageLive(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:9: +2:10
StorageLive(_2); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:30
StorageLive(_3); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+2:13: +2:16
- _3 = const FOO; // 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:7:13: 7:16
+ // + span: $DIR/const_prop_fails_gracefully.rs:8:13: 8: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,14 +29,14 @@
_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:8:5: 8:9
+ // + span: $DIR/const_prop_fails_gracefully.rs:9:5: 9:9
// + literal: Const { ty: fn(usize) {read}, val: Value(<ZST>) }
}
bb1: {
StorageDead(_5); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:11: +3:12
StorageDead(_4); // scope 1 at $DIR/const_prop_fails_gracefully.rs:+3:12: +3:13
- nop; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +4:2
+ _0 = const (); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+0:11: +4:2
StorageDead(_1); // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:1: +4:2
return; // scope 0 at $DIR/const_prop_fails_gracefully.rs:+4:2: +4:2
}
diff --git a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs b/src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs
index 8bd68527f..0a3dcbd38 100644
--- a/src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs
+++ b/src/test/mir-opt/const_prop/const_prop_fails_gracefully.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
#[inline(never)]
fn read(_: usize) { }
diff --git a/src/test/mir-opt/const_prop/control-flow-simplification.rs b/src/test/mir-opt/const_prop/control-flow-simplification.rs
index aa4ce19f6..7dbe8e734 100644
--- a/src/test/mir-opt/const_prop/control-flow-simplification.rs
+++ b/src/test/mir-opt/const_prop/control-flow-simplification.rs
@@ -1,10 +1,11 @@
+// unit-test: ConstProp
// compile-flags: -Zmir-opt-level=1
-trait NeedsDrop:Sized{
- const NEEDS:bool=std::mem::needs_drop::<Self>();
+trait NeedsDrop: Sized {
+ const NEEDS: bool = std::mem::needs_drop::<Self>();
}
-impl<This> NeedsDrop for This{}
+impl<This> NeedsDrop for This {}
// EMIT_MIR control_flow_simplification.hello.ConstProp.diff
// EMIT_MIR control_flow_simplification.hello.PreCodegen.before.mir
diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
index 5f4df0d88..a07bdd998 100644
--- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff
@@ -8,9 +8,8 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
-- _1 = const <bool as NeedsDrop>::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
+ _1 = const _; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
- switchInt(move _1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
-+ _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
+ switchInt(const false) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/control-flow-simplification.rs:+1:8: +1:21
}
diff --git a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
index 5b4ecaa80..6b29bb59c 100644
--- a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
+++ b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.32bit.diff
@@ -44,7 +44,7 @@
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:+1:13: +1:68
StorageDead(_2); // scope 0 at $DIR/discriminant.rs:+1:67: +1:68
StorageDead(_3); // scope 0 at $DIR/discriminant.rs:+1:68: +1:69
- nop; // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
+ _0 = const (); // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/discriminant.rs:+2:1: +2:2
return; // scope 0 at $DIR/discriminant.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
index 5b4ecaa80..6b29bb59c 100644
--- a/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
+++ b/src/test/mir-opt/const_prop/discriminant.main.ConstProp.64bit.diff
@@ -44,7 +44,7 @@
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:+1:13: +1:68
StorageDead(_2); // scope 0 at $DIR/discriminant.rs:+1:67: +1:68
StorageDead(_3); // scope 0 at $DIR/discriminant.rs:+1:68: +1:69
- nop; // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
+ _0 = const (); // scope 0 at $DIR/discriminant.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/discriminant.rs:+2:1: +2:2
return; // scope 0 at $DIR/discriminant.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/const_prop/discriminant.rs b/src/test/mir-opt/const_prop/discriminant.rs
index 67538b3c7..fdd67ca8a 100644
--- a/src/test/mir-opt/const_prop/discriminant.rs
+++ b/src/test/mir-opt/const_prop/discriminant.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -O
// FIXME(wesleywiser): Ideally, we could const-prop away all of this and just be left with
diff --git a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff b/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff
index 2e1e32545..f4c0c5c5e 100644
--- a/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/indirect.main.ConstProp.diff
@@ -13,19 +13,19 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/indirect.rs:+1:9: +1:10
StorageLive(_2); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
-- _2 = const 2_u32 as u8 (Misc); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
+- _2 = const 2_u32 as u8 (IntToInt); // scope 0 at $DIR/indirect.rs:+1:13: +1:25
- _3 = CheckedAdd(_2, const 1_u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
- assert(!move (_3.1: bool), "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
+ _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:25
+ _3 = const (3_u8, false); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
-+ assert(!const false, "attempt to compute `{} + {}`, which would overflow", const 2_u8, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
++ assert(!const false, "attempt to compute `{} + {}`, which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
}
bb1: {
- _1 = move (_3.0: u8); // scope 0 at $DIR/indirect.rs:+1:13: +1:29
+ _1 = const 3_u8; // scope 0 at $DIR/indirect.rs:+1:13: +1:29
StorageDead(_2); // scope 0 at $DIR/indirect.rs:+1:28: +1:29
- nop; // scope 0 at $DIR/indirect.rs:+0:11: +2:2
+ _0 = const (); // scope 0 at $DIR/indirect.rs:+0:11: +2:2
StorageDead(_1); // scope 0 at $DIR/indirect.rs:+2:1: +2:2
return; // scope 0 at $DIR/indirect.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/const_prop/indirect.rs b/src/test/mir-opt/const_prop/indirect.rs
index 37217ca81..44916cbfe 100644
--- a/src/test/mir-opt/const_prop/indirect.rs
+++ b/src/test/mir-opt/const_prop/indirect.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -C overflow-checks=on
// EMIT_MIR indirect.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/issue-66971.rs b/src/test/mir-opt/const_prop/issue-66971.rs
index 81eccae46..6ca03438e 100644
--- a/src/test/mir-opt/const_prop/issue-66971.rs
+++ b/src/test/mir-opt/const_prop/issue-66971.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -Z mir-opt-level=3
// Due to a bug in propagating scalar pairs the assertion below used to fail. In the expected
diff --git a/src/test/mir-opt/const_prop/issue-67019.rs b/src/test/mir-opt/const_prop/issue-67019.rs
index c78b8b971..ffc6fa1f2 100644
--- a/src/test/mir-opt/const_prop/issue-67019.rs
+++ b/src/test/mir-opt/const_prop/issue-67019.rs
@@ -1,3 +1,4 @@
+// unit-test: ConstProp
// compile-flags: -Z mir-opt-level=3
// This used to ICE in const-prop
diff --git a/src/test/mir-opt/const_prop/issue_66971.main.ConstProp.diff b/src/test/mir-opt/const_prop/issue_66971.main.ConstProp.diff
index b3d5980aa..9d541dcab 100644
--- a/src/test/mir-opt/const_prop/issue_66971.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/issue_66971.main.ConstProp.diff
@@ -19,7 +19,7 @@
StorageDead(_3); // scope 0 at $DIR/issue-66971.rs:+1:21: +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:16:5: 16:11
+ // + span: $DIR/issue-66971.rs:17:5: 17:11
// + literal: Const { ty: fn(((), u8, u8)) {encode}, val: Value(<ZST>) }
}
diff --git a/src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff b/src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff
index 8330b5052..b79d81476 100644
--- a/src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/issue_67019.main.ConstProp.diff
@@ -20,7 +20,7 @@
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:11:5: 11:9
+ // + span: $DIR/issue-67019.rs:12:5: 12:9
// + literal: Const { ty: fn(((u8, u8),)) {test}, val: Value(<ZST>) }
}
diff --git a/src/test/mir-opt/const_prop/mult_by_zero.rs b/src/test/mir-opt/const_prop/mult_by_zero.rs
index b0ecdf181..c839f92f2 100644
--- a/src/test/mir-opt/const_prop/mult_by_zero.rs
+++ b/src/test/mir-opt/const_prop/mult_by_zero.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O -Zmir-opt-level=4
// EMIT_MIR mult_by_zero.test.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/mutable_variable.rs b/src/test/mir-opt/const_prop/mutable_variable.rs
index 801e7a9fc..cb01719dd 100644
--- a/src/test/mir-opt/const_prop/mutable_variable.rs
+++ b/src/test/mir-opt/const_prop/mutable_variable.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O
// EMIT_MIR mutable_variable.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate.rs b/src/test/mir-opt/const_prop/mutable_variable_aggregate.rs
index e0b4b77ba..d4ff8d890 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_aggregate.rs
+++ b/src/test/mir-opt/const_prop/mutable_variable_aggregate.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O
// EMIT_MIR mutable_variable_aggregate.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs b/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs
index 79ac497c7..9060f7e9b 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs
+++ b/src/test/mir-opt/const_prop/mutable_variable_aggregate_mut_ref.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O
// EMIT_MIR mutable_variable_aggregate_mut_ref.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff b/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff
index c678f7b03..6eda503c1 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.main.ConstProp.diff
+++ b/src/test/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:5:29: 5:32
+ // + span: $DIR/mutable_variable_aggregate_partial_read.rs:6:29: 6:32
// + literal: Const { ty: fn() -> (i32, i32) {foo}, val: Value(<ZST>) }
}
diff --git a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs b/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
index 9bb62b897..cb59509ff 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
+++ b/src/test/mir-opt/const_prop/mutable_variable_aggregate_partial_read.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O
// EMIT_MIR mutable_variable_aggregate_partial_read.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff b/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
index 4c2ba9a09..eb3a7bc96 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/mutable_variable_no_prop.main.ConstProp.diff
@@ -25,7 +25,7 @@
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
_4 = const {alloc1: *mut u32}; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
// mir::Constant
- // + span: $DIR/mutable_variable_no_prop.rs:9:13: 9:19
+ // + span: $DIR/mutable_variable_no_prop.rs:10:13: 10:19
// + literal: Const { ty: *mut u32, val: Value(Scalar(alloc1)) }
_3 = (*_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:13: +3:19
_1 = move _3; // scope 2 at $DIR/mutable_variable_no_prop.rs:+3:9: +3:19
diff --git a/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs b/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs
index 4126fb3c6..8c23c5fcf 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs
+++ b/src/test/mir-opt/const_prop/mutable_variable_no_prop.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O
static mut STATIC: u32 = 42;
diff --git a/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff b/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff
index 5328792b3..186a95373 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.main.ConstProp.diff
@@ -25,7 +25,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:5:13: 5:16
+ // + span: $DIR/mutable_variable_unprop_assign.rs:6:13: 6:16
// + literal: Const { ty: fn() -> i32 {foo}, val: Value(<ZST>) }
}
@@ -41,7 +41,8 @@
StorageLive(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:9: +4:10
_4 = (_2.1: i32); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+4:13: +4:16
StorageLive(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:9: +5:10
- _5 = (_2.0: i32); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
+- _5 = (_2.0: i32); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
++ _5 = const 1_i32; // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+5:13: +5:16
nop; // scope 0 at $DIR/mutable_variable_unprop_assign.rs:+0:11: +6:2
StorageDead(_5); // scope 3 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
StorageDead(_4); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:+6:1: +6:2
diff --git a/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs b/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs
index 13f1b3f47..b077cfd3e 100644
--- a/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs
+++ b/src/test/mir-opt/const_prop/mutable_variable_unprop_assign.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O
// EMIT_MIR mutable_variable_unprop_assign.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/optimizes_into_variable.rs b/src/test/mir-opt/const_prop/optimizes_into_variable.rs
index 17265b7eb..c0fbd2558 100644
--- a/src/test/mir-opt/const_prop/optimizes_into_variable.rs
+++ b/src/test/mir-opt/const_prop/optimizes_into_variable.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -C overflow-checks=on
struct Point {
diff --git a/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff b/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
index 89f43d751..b9c283a54 100644
--- a/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/read_immutable_static.main.ConstProp.diff
@@ -18,7 +18,7 @@
StorageLive(_3); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
_3 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
// mir::Constant
- // + span: $DIR/read_immutable_static.rs:7:13: 7:16
+ // + span: $DIR/read_immutable_static.rs:8:13: 8:16
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
- _2 = (*_3); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
+ _2 = const 2_u8; // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:16
@@ -26,7 +26,7 @@
StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
_5 = const {alloc1: &u8}; // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
// mir::Constant
- // + span: $DIR/read_immutable_static.rs:7:19: 7:22
+ // + span: $DIR/read_immutable_static.rs:8:19: 8:22
// + literal: Const { ty: &u8, val: Value(Scalar(alloc1)) }
- _4 = (*_5); // scope 0 at $DIR/read_immutable_static.rs:+1:19: +1:22
- _1 = Add(move _2, move _4); // scope 0 at $DIR/read_immutable_static.rs:+1:13: +1:22
diff --git a/src/test/mir-opt/const_prop/read_immutable_static.rs b/src/test/mir-opt/const_prop/read_immutable_static.rs
index 8a5f12c6f..4f7afe6ca 100644
--- a/src/test/mir-opt/const_prop/read_immutable_static.rs
+++ b/src/test/mir-opt/const_prop/read_immutable_static.rs
@@ -1,3 +1,4 @@
+// unit-test
// compile-flags: -O
static FOO: u8 = 2;
diff --git a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
index c8b09220f..09ce67ff1 100644
--- a/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff
@@ -11,7 +11,7 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
- _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
// mir::Constant
// + span: $DIR/ref_deref.rs:5:6: 5:10
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
diff --git a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
index d141d2cf8..902cd7850 100644
--- a/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
+++ b/src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff
@@ -14,7 +14,7 @@
- StorageLive(_3); // scope 0 at $DIR/ref_deref.rs:+1:8: +1:9
- _3 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:+1:8: +1:9
- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
-+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
++ _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ // mir::Constant
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
+ // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
diff --git a/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff b/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
index f0c89caea..ec3d90433 100644
--- a/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
+++ b/src/test/mir-opt/const_prop/ref_deref_project.main.ConstProp.diff
@@ -11,9 +11,9 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
StorageLive(_2); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
- _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
+ _4 = const _; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
// mir::Constant
- // + span: $DIR/ref_deref_project.rs:5:6: 5:17
+ // + span: $DIR/ref_deref_project.rs:6:6: 6:17
// + literal: Const { ty: &(i32, i32), val: Unevaluated(main, [], Some(promoted[0])) }
_2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
_1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
diff --git a/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff b/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff
index d25540287..cd0616e65 100644
--- a/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff
+++ b/src/test/mir-opt/const_prop/ref_deref_project.main.PromoteTemps.diff
@@ -14,9 +14,9 @@
- StorageLive(_3); // scope 0 at $DIR/ref_deref_project.rs:+1:8: +1:14
- _3 = (const 4_i32, const 5_i32); // scope 0 at $DIR/ref_deref_project.rs:+1:8: +1:14
- _2 = &(_3.1: i32); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
-+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
++ _4 = const _; // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
+ // mir::Constant
-+ // + span: $DIR/ref_deref_project.rs:5:6: 5:17
++ // + span: $DIR/ref_deref_project.rs:6:6: 6:17
+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(main, [], Some(promoted[0])) }
+ _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:+1:6: +1:17
_1 = (*_2); // scope 0 at $DIR/ref_deref_project.rs:+1:5: +1:17
diff --git a/src/test/mir-opt/const_prop/ref_deref_project.rs b/src/test/mir-opt/const_prop/ref_deref_project.rs
index c7cc73651..659c11d9b 100644
--- a/src/test/mir-opt/const_prop/ref_deref_project.rs
+++ b/src/test/mir-opt/const_prop/ref_deref_project.rs
@@ -1,3 +1,4 @@
+// unit-test
// EMIT_MIR ref_deref_project.main.PromoteTemps.diff
// EMIT_MIR ref_deref_project.main.ConstProp.diff
diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
index 0ebfbca21..624376769 100644
--- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
+++ b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff
@@ -19,7 +19,7 @@
StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _9 = const main::promoted[0]; // 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:5:6: 5:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
diff --git a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
index 0ebfbca21..624376769 100644
--- a/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
+++ b/src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff
@@ -19,7 +19,7 @@
StorageLive(_2); // scope 0 at $DIR/slice_len.rs:+1:5: +1:30
StorageLive(_3); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
- _9 = const main::promoted[0]; // 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:5:6: 5:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
diff --git a/src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff b/src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff
index 300f0d5dc..b5f98233b 100644
--- a/src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff
+++ b/src/test/mir-opt/dead-store-elimination/provenance_soundness.retags.DeadStoreElimination.diff
@@ -6,7 +6,7 @@
let mut _0: (); // return place in scope 0 at $DIR/provenance_soundness.rs:+0:25: +0:25
bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/provenance_soundness.rs:+0:1: +0:27
+ Retag([fn entry] _1); // scope 0 at $DIR/provenance_soundness.rs:+0:11: +0:13
_0 = const (); // scope 0 at $DIR/provenance_soundness.rs:+0:25: +0:27
return; // scope 0 at $DIR/provenance_soundness.rs:+0:27: +0:27
}
diff --git a/src/test/mir-opt/deaggregator_test.rs b/src/test/mir-opt/deaggregator_test.rs
index 342e22243..ee59402af 100644
--- a/src/test/mir-opt/deaggregator_test.rs
+++ b/src/test/mir-opt/deaggregator_test.rs
@@ -1,3 +1,5 @@
+// unit-test: Deaggregator
+
struct Baz {
x: usize,
y: f32,
diff --git a/src/test/mir-opt/deaggregator_test_enum.rs b/src/test/mir-opt/deaggregator_test_enum.rs
index 02b63a1f5..ea402dafd 100644
--- a/src/test/mir-opt/deaggregator_test_enum.rs
+++ b/src/test/mir-opt/deaggregator_test_enum.rs
@@ -1,3 +1,5 @@
+// unit-test: Deaggregator
+
enum Baz {
Empty,
Foo { x: usize },
diff --git a/src/test/mir-opt/deaggregator_test_enum_2.rs b/src/test/mir-opt/deaggregator_test_enum_2.rs
index 489854ff0..955c31732 100644
--- a/src/test/mir-opt/deaggregator_test_enum_2.rs
+++ b/src/test/mir-opt/deaggregator_test_enum_2.rs
@@ -1,3 +1,4 @@
+// unit-test: Deaggregator
// Test that deaggregate fires in more than one basic block
enum Foo {
diff --git a/src/test/mir-opt/deaggregator_test_multiple.rs b/src/test/mir-opt/deaggregator_test_multiple.rs
index 9730b9aa8..46305fe21 100644
--- a/src/test/mir-opt/deaggregator_test_multiple.rs
+++ b/src/test/mir-opt/deaggregator_test_multiple.rs
@@ -1,3 +1,4 @@
+// unit-test: Deaggregator
// Test that deaggregate fires more than once per block
enum Foo {
diff --git a/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff b/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
index 01864ba24..995611f0e 100644
--- a/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
+++ b/src/test/mir-opt/deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
@@ -7,101 +7,94 @@
let mut _2: &[u8]; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
let mut _3: &str; // in scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
let mut _4: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- let mut _5: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- let mut _6: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- let mut _7: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- scope 1 (inlined core::str::<impl str>::as_bytes) { // at $DIR/deduplicate_blocks.rs:3:11: 3:23
- debug self => _3; // in scope 1 at $SRC_DIR/core/src/str/mod.rs:LL:COL
- let mut _8: &str; // in scope 1 at $SRC_DIR/core/src/str/mod.rs:LL:COL
- scope 2 {
- }
- }
+ let mut _5: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
+ let mut _6: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
+ let mut _7: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
+ let mut _8: usize; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
+ let mut _9: bool; // in scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
bb0: {
StorageLive(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
StorageLive(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- _3 = _1; // scope 0 at $DIR/deduplicate_blocks.rs:+1:11: +1:23
- StorageLive(_8); // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
- _8 = _3; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
-- _2 = transmute::<&str, &[u8]>(move _8) -> bb14; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
-+ _2 = transmute::<&str, &[u8]>(move _8) -> bb12; // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
+ _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: $SRC_DIR/core/src/str/mod.rs:LL:COL
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&str) -> &[u8] {transmute::<&str, &[u8]>}, val: Value(<ZST>) }
+ // + span: $DIR/deduplicate_blocks.rs:5:13: 5:21
+ // + literal: Const { ty: for<'a> fn(&'a str) -> &'a [u8] {core::str::<impl str>::as_bytes}, val: Value(<ZST>) }
}
bb1: {
- switchInt((*_2)[0 of 4]) -> [47_u8: bb2, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:22: +1:23
+ _7 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
+ _8 = const 4_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
+ _9 = Ge(move _7, move _8); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
+ switchInt(move _9) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
}
bb2: {
- switchInt((*_2)[1 of 4]) -> [47_u8: bb3, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[0 of 4]) -> [47_u8: bb3, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb3: {
- switchInt((*_2)[2 of 4]) -> [47_u8: bb4, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[1 of 4]) -> [47_u8: bb4, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb4: {
-- switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
-+ switchInt((*_2)[3 of 4]) -> [47_u8: bb9, otherwise: bb5]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[2 of 4]) -> [47_u8: bb5, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb5: {
- _4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- _5 = Ge(move _4, const 3_usize); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
- switchInt(move _5) -> [false: bb9, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
+- switchInt((*_2)[3 of 4]) -> [47_u8: bb11, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
++ switchInt((*_2)[3 of 4]) -> [47_u8: bb10, otherwise: bb6]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb6: {
- switchInt((*_2)[0 of 3]) -> [47_u8: bb7, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ _4 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
+ _5 = const 3_usize; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
+ _6 = Ge(move _4, move _5); // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
+ switchInt(move _6) -> [false: bb10, otherwise: bb7]; // scope 0 at $DIR/deduplicate_blocks.rs:+3:9: +3:31
}
bb7: {
- switchInt((*_2)[1 of 3]) -> [47_u8: bb8, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[0 of 3]) -> [47_u8: bb8, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb8: {
-- switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb12, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
-+ switchInt((*_2)[2 of 3]) -> [47_u8: bb10, 33_u8: bb10, otherwise: bb9]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ switchInt((*_2)[1 of 3]) -> [47_u8: bb9, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
}
bb9: {
+- switchInt((*_2)[2 of 3]) -> [47_u8: bb12, 33_u8: bb13, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
++ switchInt((*_2)[2 of 3]) -> [47_u8: bb11, 33_u8: bb11, otherwise: bb10]; // scope 0 at $DIR/deduplicate_blocks.rs:+1:5: +1:23
+ }
+
+ bb10: {
- _0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
-- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
+- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+5:14: +5:19
- }
-
-- bb10: {
+- bb11: {
_0 = const false; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
-- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
-+ goto -> bb11; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
+- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
++ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+2:41: +2:46
}
-- bb11: {
+- bb12: {
- _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
-- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
+- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+3:35: +3:39
- }
-
-- bb12: {
-+ bb10: {
- _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
-- goto -> bb13; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
-+ goto -> bb11; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
- }
-
- bb13: {
+ bb11: {
- StorageDead(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+7:1: +7:2
- return; // scope 0 at $DIR/deduplicate_blocks.rs:+7:2: +7:2
+ _0 = const true; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
+- goto -> bb14; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
++ goto -> bb12; // scope 0 at $DIR/deduplicate_blocks.rs:+4:35: +4:39
}
- bb14: {
+ bb12: {
- StorageDead(_8); // scope 2 at $SRC_DIR/core/src/str/mod.rs:LL:COL
- StorageDead(_3); // scope 0 at $DIR/deduplicate_blocks.rs:+1:22: +1:23
- _6 = Len((*_2)); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- _7 = Ge(move _6, const 4_usize); // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
- switchInt(move _7) -> [false: bb5, otherwise: bb1]; // scope 0 at $DIR/deduplicate_blocks.rs:+2:9: +2:37
+ StorageDead(_2); // scope 0 at $DIR/deduplicate_blocks.rs:+7:1: +7:2
+ return; // scope 0 at $DIR/deduplicate_blocks.rs:+7:2: +7:2
}
}
diff --git a/src/test/mir-opt/deduplicate_blocks.rs b/src/test/mir-opt/deduplicate_blocks.rs
index f8f7361dc..2b9eed99e 100644
--- a/src/test/mir-opt/deduplicate_blocks.rs
+++ b/src/test/mir-opt/deduplicate_blocks.rs
@@ -1,3 +1,5 @@
+// unit-test: DeduplicateBlocks
+
// EMIT_MIR deduplicate_blocks.is_line_doc_comment_2.DeduplicateBlocks.diff
pub const fn is_line_doc_comment_2(s: &str) -> bool {
match s.as_bytes() {
diff --git a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff b/src/test/mir-opt/derefer_complex_case.main.Derefer.diff
index de0c03bb7..713d56c38 100644
--- a/src/test/mir-opt/derefer_complex_case.main.Derefer.diff
+++ b/src/test/mir-opt/derefer_complex_case.main.Derefer.diff
@@ -3,15 +3,15 @@
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/derefer_complex_case.rs:+0:11: +0:11
- let mut _1: std::slice::Iter<i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
+ let mut _1: std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
let mut _2: &[i32; 2]; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
let _3: [i32; 2]; // in scope 0 at $DIR/derefer_complex_case.rs:+1:18: +1:26
- let mut _4: std::slice::Iter<i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
+ let mut _4: std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
let mut _5: (); // in scope 0 at $DIR/derefer_complex_case.rs:+0:1: +2:2
let _6: (); // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
let mut _7: std::option::Option<&i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _8: &mut std::slice::Iter<i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- let mut _9: &mut std::slice::Iter<i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
+ let mut _8: &mut std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
+ let mut _9: &mut std::slice::Iter<'_, i32>; // in scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
let mut _10: isize; // in scope 0 at $DIR/derefer_complex_case.rs:+1:5: +1:40
let mut _11: !; // in scope 0 at $DIR/derefer_complex_case.rs:+1:5: +1:40
let mut _13: i32; // in scope 0 at $DIR/derefer_complex_case.rs:+1:34: +1:37
@@ -28,14 +28,14 @@
bb0: {
StorageLive(_1); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
StorageLive(_2); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _14 = const main::promoted[0]; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
+ _14 = const _; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
// mir::Constant
- // + span: $DIR/derefer_complex_case.rs:5:17: 5:26
+ // + span: $DIR/derefer_complex_case.rs:6:17: 6:26
// + literal: Const { ty: &[i32; 2], val: Unevaluated(main, [], Some(promoted[0])) }
_2 = &(*_14); // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_1 = <&[i32; 2] as IntoIterator>::into_iter(move _2) -> bb1; // scope 0 at $DIR/derefer_complex_case.rs:+1:17: +1:26
// mir::Constant
- // + span: $DIR/derefer_complex_case.rs:5:17: 5:26
+ // + span: $DIR/derefer_complex_case.rs:6:17: 6:26
// + literal: Const { ty: fn(&[i32; 2]) -> <&[i32; 2] as IntoIterator>::IntoIter {<&[i32; 2] as IntoIterator>::into_iter}, val: Value(<ZST>) }
}
@@ -53,10 +53,10 @@
StorageLive(_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_9 = &mut _4; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
_8 = &mut (*_9); // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
- _7 = <std::slice::Iter<i32> as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
+ _7 = <std::slice::Iter<'_, i32> as Iterator>::next(move _8) -> bb3; // scope 1 at $DIR/derefer_complex_case.rs:+1:17: +1:26
// mir::Constant
- // + span: $DIR/derefer_complex_case.rs:5:17: 5:26
- // + literal: Const { ty: for<'r> fn(&'r mut std::slice::Iter<i32>) -> Option<<std::slice::Iter<i32> as Iterator>::Item> {<std::slice::Iter<i32> as Iterator>::next}, val: Value(<ZST>) }
+ // + span: $DIR/derefer_complex_case.rs:6:17: 6:26
+ // + literal: Const { ty: for<'a> fn(&'a mut std::slice::Iter<'_, i32>) -> Option<<std::slice::Iter<'_, i32> as Iterator>::Item> {<std::slice::Iter<'_, i32> as Iterator>::next}, val: Value(<ZST>) }
}
bb3: {
@@ -68,15 +68,13 @@
bb4: {
StorageLive(_12); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
- _12 = (*((_7 as Some).0: &i32)); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
-+ StorageLive(_15); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
+ _15 = deref_copy ((_7 as Some).0: &i32); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
+ _12 = (*_15); // scope 1 at $DIR/derefer_complex_case.rs:+1:10: +1:13
-+ StorageDead(_15); // scope 2 at $DIR/derefer_complex_case.rs:+1:34: +1:37
StorageLive(_13); // scope 2 at $DIR/derefer_complex_case.rs:+1:34: +1:37
_13 = _12; // scope 2 at $DIR/derefer_complex_case.rs:+1:34: +1:37
_6 = std::mem::drop::<i32>(move _13) -> bb7; // scope 2 at $DIR/derefer_complex_case.rs:+1:29: +1:38
// mir::Constant
- // + span: $DIR/derefer_complex_case.rs:5:29: 5:33
+ // + span: $DIR/derefer_complex_case.rs:6:29: 6:33
// + literal: Const { ty: fn(i32) {std::mem::drop::<i32>}, val: Value(<ZST>) }
}
diff --git a/src/test/mir-opt/derefer_complex_case.rs b/src/test/mir-opt/derefer_complex_case.rs
index 48bec3907..dc48cee95 100644
--- a/src/test/mir-opt/derefer_complex_case.rs
+++ b/src/test/mir-opt/derefer_complex_case.rs
@@ -1,3 +1,4 @@
+// unit-test: Derefer
// EMIT_MIR derefer_complex_case.main.Derefer.diff
// ignore-wasm32
diff --git a/src/test/mir-opt/derefer_inline_test.main.Derefer.diff b/src/test/mir-opt/derefer_inline_test.main.Derefer.diff
index ce6ffaa56..3540df308 100644
--- a/src/test/mir-opt/derefer_inline_test.main.Derefer.diff
+++ b/src/test/mir-opt/derefer_inline_test.main.Derefer.diff
@@ -17,7 +17,7 @@
_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
// mir::Constant
- // + span: $DIR/derefer_inline_test.rs:10:5: 10:12
+ // + 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>) }
}
@@ -26,7 +26,7 @@
_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
// mir::Constant
- // + span: $DIR/derefer_inline_test.rs:10:9: 10:10
+ // + span: $DIR/derefer_inline_test.rs:11:9: 11:10
// + literal: Const { ty: fn() -> Box<u32> {f}, val: Value(<ZST>) }
}
diff --git a/src/test/mir-opt/derefer_inline_test.rs b/src/test/mir-opt/derefer_inline_test.rs
index 191a8cbbe..cc06a7dd8 100644
--- a/src/test/mir-opt/derefer_inline_test.rs
+++ b/src/test/mir-opt/derefer_inline_test.rs
@@ -1,3 +1,4 @@
+// unit-test: Derefer
// EMIT_MIR derefer_inline_test.main.Derefer.diff
// ignore-wasm32 compiled with panic=abort by default
diff --git a/src/test/mir-opt/derefer_terminator_test.main.Derefer.diff b/src/test/mir-opt/derefer_terminator_test.main.Derefer.diff
index 0a56ee5e4..60f7b9d56 100644
--- a/src/test/mir-opt/derefer_terminator_test.main.Derefer.diff
+++ b/src/test/mir-opt/derefer_terminator_test.main.Derefer.diff
@@ -32,7 +32,7 @@
StorageLive(_1); // scope 0 at $DIR/derefer_terminator_test.rs:+1:9: +1:10
_1 = foo() -> bb1; // scope 0 at $DIR/derefer_terminator_test.rs:+1:13: +1:18
// mir::Constant
- // + span: $DIR/derefer_terminator_test.rs:5:13: 5:16
+ // + span: $DIR/derefer_terminator_test.rs:6:13: 6:16
// + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
}
@@ -40,7 +40,7 @@
StorageLive(_2); // scope 1 at $DIR/derefer_terminator_test.rs:+2:9: +2:10
_2 = foo() -> bb2; // scope 1 at $DIR/derefer_terminator_test.rs:+2:13: +2:18
// mir::Constant
- // + span: $DIR/derefer_terminator_test.rs:6:13: 6:16
+ // + span: $DIR/derefer_terminator_test.rs:7:13: 7:16
// + literal: Const { ty: fn() -> bool {foo}, val: Value(<ZST>) }
}
@@ -55,25 +55,18 @@
_5 = &_6; // scope 2 at $DIR/derefer_terminator_test.rs:+3:17: +3:21
_4 = &_5; // scope 2 at $DIR/derefer_terminator_test.rs:+3:15: +3:22
- switchInt((*(*(*(*_4))))) -> [false: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ StorageLive(_10); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+ _10 = deref_copy (*_4); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ StorageLive(_11); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+ _11 = deref_copy (*_10); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ StorageDead(_10); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ StorageLive(_12); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+ _12 = deref_copy (*_11); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
-+ StorageDead(_11); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
+ switchInt((*_12)) -> [false: bb3, otherwise: bb4]; // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
}
bb3: {
-+ StorageDead(_12); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
_3 = const (); // scope 2 at $DIR/derefer_terminator_test.rs:+5:18: +5:20
goto -> bb5; // scope 2 at $DIR/derefer_terminator_test.rs:+5:18: +5:20
}
bb4: {
-+ StorageDead(_12); // scope 2 at $DIR/derefer_terminator_test.rs:+3:5: +3:22
StorageLive(_8); // scope 2 at $DIR/derefer_terminator_test.rs:+4:22: +4:23
_8 = const 5_i32; // scope 2 at $DIR/derefer_terminator_test.rs:+4:26: +4:27
_3 = const (); // scope 2 at $DIR/derefer_terminator_test.rs:+4:17: +4:29
diff --git a/src/test/mir-opt/derefer_terminator_test.rs b/src/test/mir-opt/derefer_terminator_test.rs
index 787b14ae7..d6750c29d 100644
--- a/src/test/mir-opt/derefer_terminator_test.rs
+++ b/src/test/mir-opt/derefer_terminator_test.rs
@@ -1,3 +1,4 @@
+// unit-test: Derefer
// EMIT_MIR derefer_terminator_test.main.Derefer.diff
// ignore-wasm32
diff --git a/src/test/mir-opt/derefer_test.main.Derefer.diff b/src/test/mir-opt/derefer_test.main.Derefer.diff
index 6c2047e21..87306d818 100644
--- a/src/test/mir-opt/derefer_test.main.Derefer.diff
+++ b/src/test/mir-opt/derefer_test.main.Derefer.diff
@@ -33,16 +33,12 @@
StorageDead(_3); // scope 1 at $DIR/derefer_test.rs:+2:28: +2:29
StorageLive(_4); // scope 2 at $DIR/derefer_test.rs:+3:9: +3:10
- _4 = &mut ((*(_2.1: &mut (i32, i32))).0: i32); // scope 2 at $DIR/derefer_test.rs:+3:13: +3:26
-+ StorageLive(_6); // scope 2 at $DIR/derefer_test.rs:+3:13: +3:26
+ _6 = deref_copy (_2.1: &mut (i32, i32)); // scope 2 at $DIR/derefer_test.rs:+3:13: +3:26
+ _4 = &mut ((*_6).0: i32); // scope 2 at $DIR/derefer_test.rs:+3:13: +3:26
-+ StorageDead(_6); // scope 3 at $DIR/derefer_test.rs:+4:9: +4:10
StorageLive(_5); // scope 3 at $DIR/derefer_test.rs:+4:9: +4:10
- _5 = &mut ((*(_2.1: &mut (i32, i32))).1: i32); // scope 3 at $DIR/derefer_test.rs:+4:13: +4:26
-+ StorageLive(_7); // scope 3 at $DIR/derefer_test.rs:+4:13: +4:26
+ _7 = deref_copy (_2.1: &mut (i32, i32)); // scope 3 at $DIR/derefer_test.rs:+4:13: +4:26
+ _5 = &mut ((*_7).1: i32); // scope 3 at $DIR/derefer_test.rs:+4:13: +4:26
-+ StorageDead(_7); // scope 0 at $DIR/derefer_test.rs:+0:11: +5:2
_0 = const (); // scope 0 at $DIR/derefer_test.rs:+0:11: +5:2
StorageDead(_5); // scope 3 at $DIR/derefer_test.rs:+5:1: +5:2
StorageDead(_4); // scope 2 at $DIR/derefer_test.rs:+5:1: +5:2
diff --git a/src/test/mir-opt/derefer_test.rs b/src/test/mir-opt/derefer_test.rs
index 2ebc0d343..fad0fe8eb 100644
--- a/src/test/mir-opt/derefer_test.rs
+++ b/src/test/mir-opt/derefer_test.rs
@@ -1,3 +1,4 @@
+// unit-test: Derefer
// EMIT_MIR derefer_test.main.Derefer.diff
fn main() {
let mut a = (42,43);
diff --git a/src/test/mir-opt/derefer_test_multiple.main.Derefer.diff b/src/test/mir-opt/derefer_test_multiple.main.Derefer.diff
index e2dceecfd..3e40db118 100644
--- a/src/test/mir-opt/derefer_test_multiple.main.Derefer.diff
+++ b/src/test/mir-opt/derefer_test_multiple.main.Derefer.diff
@@ -57,28 +57,16 @@
StorageDead(_7); // scope 3 at $DIR/derefer_test_multiple.rs:+4:28: +4:29
StorageLive(_8); // scope 4 at $DIR/derefer_test_multiple.rs:+5:9: +5:10
- _8 = &mut ((*((*((*(_6.1: &mut (i32, &mut (i32, &mut (i32, i32))))).1: &mut (i32, &mut (i32, i32)))).1: &mut (i32, i32))).1: i32); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ StorageLive(_10); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
+ _10 = deref_copy (_6.1: &mut (i32, &mut (i32, &mut (i32, i32)))); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ StorageLive(_11); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
+ _11 = deref_copy ((*_10).1: &mut (i32, &mut (i32, i32))); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ StorageDead(_10); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ StorageLive(_12); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
+ _12 = deref_copy ((*_11).1: &mut (i32, i32)); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ StorageDead(_11); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
+ _8 = &mut ((*_12).1: i32); // scope 4 at $DIR/derefer_test_multiple.rs:+5:13: +5:30
-+ StorageDead(_12); // scope 5 at $DIR/derefer_test_multiple.rs:+6:9: +6:10
StorageLive(_9); // scope 5 at $DIR/derefer_test_multiple.rs:+6:9: +6:10
- _9 = &mut ((*((*((*(_6.1: &mut (i32, &mut (i32, &mut (i32, i32))))).1: &mut (i32, &mut (i32, i32)))).1: &mut (i32, i32))).1: i32); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ StorageLive(_13); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
+ _13 = deref_copy (_6.1: &mut (i32, &mut (i32, &mut (i32, i32)))); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ StorageLive(_14); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
+ _14 = deref_copy ((*_13).1: &mut (i32, &mut (i32, i32))); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ StorageDead(_13); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ StorageLive(_15); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
+ _15 = deref_copy ((*_14).1: &mut (i32, i32)); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ StorageDead(_14); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
+ _9 = &mut ((*_15).1: i32); // scope 5 at $DIR/derefer_test_multiple.rs:+6:13: +6:30
-+ StorageDead(_15); // scope 0 at $DIR/derefer_test_multiple.rs:+0:12: +7:2
_0 = const (); // scope 0 at $DIR/derefer_test_multiple.rs:+0:12: +7:2
StorageDead(_9); // scope 5 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
StorageDead(_8); // scope 4 at $DIR/derefer_test_multiple.rs:+7:1: +7:2
diff --git a/src/test/mir-opt/derefer_test_multiple.rs b/src/test/mir-opt/derefer_test_multiple.rs
index a27363447..0b3888b07 100644
--- a/src/test/mir-opt/derefer_test_multiple.rs
+++ b/src/test/mir-opt/derefer_test_multiple.rs
@@ -1,3 +1,4 @@
+// unit-test: Derefer
// EMIT_MIR derefer_test_multiple.main.Derefer.diff
fn main () {
let mut a = (42, 43);
diff --git a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff b/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff
index a20a172af..80b09ed5f 100644
--- a/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff
+++ b/src/test/mir-opt/dest-prop/simple.nrvo.DestinationPropagation.diff
@@ -1,12 +1,12 @@
- // MIR for `nrvo` before DestinationPropagation
+ // MIR for `nrvo` after DestinationPropagation
- fn nrvo(_1: for<'r> fn(&'r mut [u8; 1024])) -> [u8; 1024] {
+ fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
debug init => _1; // in scope 0 at $DIR/simple.rs:+0:9: +0:13
let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/simple.rs:+0:39: +0:49
let mut _2: [u8; 1024]; // in scope 0 at $DIR/simple.rs:+1:9: +1:16
let _3: (); // in scope 0 at $DIR/simple.rs:+2:5: +2:19
- let mut _4: for<'r> fn(&'r mut [u8; 1024]); // in scope 0 at $DIR/simple.rs:+2:5: +2:9
+ let mut _4: for<'a> fn(&'a mut [u8; 1024]); // in scope 0 at $DIR/simple.rs:+2:5: +2:9
let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18
let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/simple.rs:+2:10: +2:18
scope 1 {
diff --git a/src/test/mir-opt/dest-prop/union.rs b/src/test/mir-opt/dest-prop/union.rs
index 68c834dfb..eb6cb09fc 100644
--- a/src/test/mir-opt/dest-prop/union.rs
+++ b/src/test/mir-opt/dest-prop/union.rs
@@ -1,4 +1,4 @@
-//! Tests that we can propogate into places that are projections into unions
+//! Tests that we can propagate into places that are projections into unions
// compile-flags: -Zunsound-mir-opts
fn val() -> u32 {
1
diff --git a/src/test/mir-opt/early_otherwise_branch_68867.rs b/src/test/mir-opt/early_otherwise_branch_68867.rs
index ca298e921..a6a56f3a9 100644
--- a/src/test/mir-opt/early_otherwise_branch_68867.rs
+++ b/src/test/mir-opt/early_otherwise_branch_68867.rs
@@ -1,4 +1,6 @@
-// compile-flags: -Z mir-opt-level=4 -Zunsound-mir-opts
+// unit-test: EarlyOtherwiseBranch
+
+// FIXME: This test was broken by the derefer change.
// example from #68867
type CSSFloat = f32;
@@ -11,7 +13,6 @@ pub enum ViewportPercentageLength {
}
// EMIT_MIR early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
-// EMIT_MIR early_otherwise_branch_68867.try_sum EarlyOtherwiseBranch.before SimplifyConstCondition-final.after
#[no_mangle]
pub extern "C" fn try_sum(
x: &ViewportPercentageLength,
diff --git a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyConstCondition-final.after.diff b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyConstCondition-final.after.diff
deleted file mode 100644
index 4e6852ad7..000000000
--- a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.before-SimplifyConstCondition-final.after.diff
+++ /dev/null
@@ -1,344 +0,0 @@
-- // MIR for `try_sum` before EarlyOtherwiseBranch
-+ // MIR for `try_sum` after SimplifyConstCondition-final
-
- fn try_sum(_1: &ViewportPercentageLength, _2: &ViewportPercentageLength) -> Result<ViewportPercentageLength, ()> {
- debug x => _1; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+1:5: +1:6
- debug other => _2; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+2:5: +2:10
- let mut _0: std::result::Result<ViewportPercentageLength, ()>; // return place in scope 0 at $DIR/early_otherwise_branch_68867.rs:+3:6: +3:42
- let mut _3: ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +11:6
- let mut _4: (&ViewportPercentageLength, &ViewportPercentageLength); // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _5: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
- let mut _6: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:18: +5:23
- let mut _7: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:21: +6:30
- let mut _8: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:21: +7:30
- let mut _9: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:23: +8:34
- let mut _10: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:23: +9:34
- let mut _11: isize; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:11: +6:18
- let _12: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- let _13: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- let mut _14: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
- let mut _15: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
- let mut _16: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
- let _17: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- let _18: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- let mut _19: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
- let mut _20: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
- let mut _21: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
- let _22: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- let _23: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- let mut _24: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
- let mut _25: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
- let mut _26: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
- let _27: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- let _28: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- let mut _29: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
- let mut _30: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
- let mut _31: f32; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
- let mut _32: !; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:14: +10:28
- let mut _33: (); // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
- let mut _34: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _35: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _36: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _37: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _38: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _39: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _40: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _41: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _42: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _43: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _44: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _45: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- let mut _46: &ViewportPercentageLength; // in scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- scope 1 {
-- debug one => _12; // in scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
-- debug other => _13; // in scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
-+ debug one => _15; // in scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
-+ debug other => _16; // in scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- }
- scope 2 {
-- debug one => _17; // in scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
-- debug other => _18; // in scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
-+ debug one => _20; // in scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
-+ debug other => _21; // in scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- }
- scope 3 {
-- debug one => _22; // in scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
-- debug other => _23; // in scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
-+ debug one => _25; // in scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
-+ debug other => _26; // in scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- }
- scope 4 {
-- debug one => _27; // in scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
-- debug other => _28; // in scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
-+ debug one => _30; // in scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
-+ debug other => _31; // in scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- }
-
- bb0: {
-- StorageLive(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +11:6
-- StorageLive(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
-- StorageLive(_5); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
-- _5 = _1; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +11:6
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
-+ (_4.0: &ViewportPercentageLength) = _1; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:15: +5:16
- StorageLive(_6); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:18: +5:23
- _6 = _2; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:18: +5:23
- Deinit(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
-- (_4.0: &ViewportPercentageLength) = move _5; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- (_4.1: &ViewportPercentageLength) = move _6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_6); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
-- StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
- StorageLive(_34); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _34 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _11 = discriminant((*_34)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_34); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- switchInt(move _11) -> [0_isize: bb1, 1_isize: bb3, 2_isize: bb4, 3_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- }
-
- bb1: {
- StorageLive(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _35 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _7 = discriminant((*_35)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- switchInt(move _7) -> [0_isize: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- }
-
- bb2: {
- StorageLive(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
- nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
- Deinit(_0); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
- nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
- discriminant(_0) = 1; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
- StorageDead(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:27: +10:28
-- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
-- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
- return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
- }
-
- bb3: {
- StorageLive(_36); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _36 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _8 = discriminant((*_36)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_36); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- switchInt(move _8) -> [1_isize: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- }
-
- bb4: {
- StorageLive(_37); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _37 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _9 = discriminant((*_37)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_37); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- switchInt(move _9) -> [2_isize: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- }
-
- bb5: {
- StorageLive(_38); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _38 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- _10 = discriminant((*_38)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_38); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- switchInt(move _10) -> [3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
- }
-
- bb6: {
-- StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- StorageLive(_39); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- _39 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
-- _12 = (((*_39) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
-+ _15 = (((*_39) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- StorageDead(_39); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
-- StorageLive(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- StorageLive(_40); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- _40 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
-- _13 = (((*_40) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
-+ _16 = (((*_40) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- StorageDead(_40); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
-- StorageLive(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
-- StorageLive(_15); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
-- _15 = _12; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
-- StorageLive(_16); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
-- _16 = _13; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
-- _14 = Add(move _15, move _16); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
-- StorageDead(_16); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:48: +6:49
-- StorageDead(_15); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:48: +6:49
-- Deinit(_3); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:35: +6:50
-- ((_3 as Vw).0: f32) = move _14; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:35: +6:50
-- discriminant(_3) = 0; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:35: +6:50
-- StorageDead(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
-- StorageDead(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
-- StorageDead(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:44: +6:49
-+ ((((_0 as Ok).0: ViewportPercentageLength) as Vw).0: f32) = Add(move _15, move _16); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:48: +6:49
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:48: +6:49
-+ Deinit(((_0 as Ok).0: ViewportPercentageLength)); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:35: +6:50
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:35: +6:50
-+ discriminant(((_0 as Ok).0: ViewportPercentageLength)) = 0; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:35: +6:50
-+ nop; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:49: +6:50
- }
-
- bb7: {
-- StorageLive(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- StorageLive(_41); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- _41 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
-- _17 = (((*_41) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
-+ _20 = (((*_41) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- StorageDead(_41); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
-- StorageLive(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- StorageLive(_42); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- _42 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
-- _18 = (((*_42) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
-+ _21 = (((*_42) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- StorageDead(_42); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
-- StorageLive(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
-- StorageLive(_20); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
-- _20 = _17; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
-- StorageLive(_21); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
-- _21 = _18; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
-- _19 = Add(move _20, move _21); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
-- StorageDead(_21); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:48: +7:49
-- StorageDead(_20); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:48: +7:49
-- Deinit(_3); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:35: +7:50
-- ((_3 as Vh).0: f32) = move _19; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:35: +7:50
-- discriminant(_3) = 1; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:35: +7:50
-- StorageDead(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
-- StorageDead(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
-- StorageDead(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:44: +7:49
-+ ((((_0 as Ok).0: ViewportPercentageLength) as Vh).0: f32) = Add(move _20, move _21); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:48: +7:49
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:48: +7:49
-+ Deinit(((_0 as Ok).0: ViewportPercentageLength)); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:35: +7:50
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:35: +7:50
-+ discriminant(((_0 as Ok).0: ViewportPercentageLength)) = 1; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:35: +7:50
-+ nop; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:49: +7:50
- }
-
- bb8: {
-- StorageLive(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- StorageLive(_43); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- _43 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
-- _22 = (((*_43) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
-+ _25 = (((*_43) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- StorageDead(_43); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
-- StorageLive(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- StorageLive(_44); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- _44 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
-- _23 = (((*_44) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
-+ _26 = (((*_44) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- StorageDead(_44); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
-- StorageLive(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
-- StorageLive(_25); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
-- _25 = _22; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
-- StorageLive(_26); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
-- _26 = _23; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
-- _24 = Add(move _25, move _26); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
-- StorageDead(_26); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:54: +8:55
-- StorageDead(_25); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:54: +8:55
-- Deinit(_3); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:39: +8:56
-- ((_3 as Vmin).0: f32) = move _24; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:39: +8:56
-- discriminant(_3) = 2; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:39: +8:56
-- StorageDead(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
-- StorageDead(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
-- StorageDead(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:50: +8:55
-+ ((((_0 as Ok).0: ViewportPercentageLength) as Vmin).0: f32) = Add(move _25, move _26); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:54: +8:55
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:54: +8:55
-+ Deinit(((_0 as Ok).0: ViewportPercentageLength)); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:39: +8:56
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:39: +8:56
-+ discriminant(((_0 as Ok).0: ViewportPercentageLength)) = 2; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:39: +8:56
-+ nop; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:55: +8:56
- }
-
- bb9: {
-- StorageLive(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- StorageLive(_45); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- _45 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
-- _27 = (((*_45) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
-+ _30 = (((*_45) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- StorageDead(_45); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
-- StorageLive(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- StorageLive(_46); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- _46 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
-- _28 = (((*_46) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
-+ _31 = (((*_46) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- StorageDead(_46); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
-- StorageLive(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
-- StorageLive(_30); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
-- _30 = _27; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
-- StorageLive(_31); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
-- _31 = _28; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
-- _29 = Add(move _30, move _31); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
-- StorageDead(_31); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:54: +9:55
-- StorageDead(_30); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:54: +9:55
-- Deinit(_3); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:39: +9:56
-- ((_3 as Vmax).0: f32) = move _29; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:39: +9:56
-- discriminant(_3) = 3; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:39: +9:56
-- StorageDead(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
-- StorageDead(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
-- StorageDead(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:50: +9:55
-+ ((((_0 as Ok).0: ViewportPercentageLength) as Vmax).0: f32) = Add(move _30, move _31); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:54: +9:55
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:54: +9:55
-+ Deinit(((_0 as Ok).0: ViewportPercentageLength)); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:39: +9:56
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:39: +9:56
-+ discriminant(((_0 as Ok).0: ViewportPercentageLength)) = 3; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:39: +9:56
-+ nop; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
- goto -> bb10; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:55: +9:56
- }
-
- bb10: {
- Deinit(_0); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:5: +11:7
-- ((_0 as Ok).0: ViewportPercentageLength) = move _3; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:5: +11:7
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:5: +11:7
- discriminant(_0) = 0; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:5: +11:7
-- StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
-- StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
-+ nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
- return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
- }
- }
-
diff --git a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
index 2519f79f8..6bc025bb5 100644
--- a/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
+++ b/src/test/mir-opt/early_otherwise_branch_68867.try_sum.EarlyOtherwiseBranch.diff
@@ -78,68 +78,54 @@
(_4.1: &ViewportPercentageLength) = move _6; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
StorageDead(_6); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
StorageDead(_5); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:23: +5:24
- StorageLive(_34); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_34 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_11 = discriminant((*_34)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_34); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
switchInt(move _11) -> [0_isize: bb1, 1_isize: bb3, 2_isize: bb4, 3_isize: bb5, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb1: {
- StorageLive(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_35 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_7 = discriminant((*_35)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_35); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
switchInt(move _7) -> [0_isize: bb6, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb2: {
StorageLive(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
- nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
+ Deinit(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:25: +10:27
Deinit(_0); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
- nop; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
+ ((_0 as Err).0: ()) = move _33; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
discriminant(_0) = 1; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:21: +10:28
StorageDead(_33); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+10:27: +10:28
StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
- return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
+ goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
}
bb3: {
- StorageLive(_36); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_36 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_8 = discriminant((*_36)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_36); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
switchInt(move _8) -> [1_isize: bb7, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb4: {
- StorageLive(_37); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_37 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_9 = discriminant((*_37)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_37); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
switchInt(move _9) -> [2_isize: bb8, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb5: {
- StorageLive(_38); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_38 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
_10 = discriminant((*_38)); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:14: +5:24
- StorageDead(_38); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
switchInt(move _10) -> [3_isize: bb9, otherwise: bb2]; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:8: +5:24
}
bb6: {
StorageLive(_12); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- StorageLive(_39); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
_39 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
_12 = (((*_39) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:14: +6:17
- StorageDead(_39); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
StorageLive(_13); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- StorageLive(_40); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
_40 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
_13 = (((*_40) as Vw).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+6:24: +6:29
- StorageDead(_40); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
StorageLive(_14); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:49
StorageLive(_15); // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
_15 = _12; // scope 1 at $DIR/early_otherwise_branch_68867.rs:+6:38: +6:41
@@ -159,15 +145,11 @@
bb7: {
StorageLive(_17); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- StorageLive(_41); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
_41 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
_17 = (((*_41) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:14: +7:17
- StorageDead(_41); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
StorageLive(_18); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- StorageLive(_42); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
_42 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
_18 = (((*_42) as Vh).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+7:24: +7:29
- StorageDead(_42); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
StorageLive(_19); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:49
StorageLive(_20); // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
_20 = _17; // scope 2 at $DIR/early_otherwise_branch_68867.rs:+7:38: +7:41
@@ -187,15 +169,11 @@
bb8: {
StorageLive(_22); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- StorageLive(_43); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
_43 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
_22 = (((*_43) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:16: +8:19
- StorageDead(_43); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
StorageLive(_23); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- StorageLive(_44); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
_44 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
_23 = (((*_44) as Vmin).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+8:28: +8:33
- StorageDead(_44); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
StorageLive(_24); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:55
StorageLive(_25); // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
_25 = _22; // scope 3 at $DIR/early_otherwise_branch_68867.rs:+8:44: +8:47
@@ -215,15 +193,11 @@
bb9: {
StorageLive(_27); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- StorageLive(_45); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
_45 = deref_copy (_4.0: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
_27 = (((*_45) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:16: +9:19
- StorageDead(_45); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
StorageLive(_28); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- StorageLive(_46); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
_46 = deref_copy (_4.1: &ViewportPercentageLength); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
_28 = (((*_46) as Vmax).0: f32); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+9:28: +9:33
- StorageDead(_46); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
StorageLive(_29); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:55
StorageLive(_30); // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
_30 = _27; // scope 4 at $DIR/early_otherwise_branch_68867.rs:+9:44: +9:47
@@ -247,6 +221,10 @@
discriminant(_0) = 0; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+5:5: +11:7
StorageDead(_3); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+11:6: +11:7
StorageDead(_4); // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:1: +12:2
+ goto -> bb11; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
+ }
+
+ bb11: {
return; // scope 0 at $DIR/early_otherwise_branch_68867.rs:+12:2: +12:2
}
}
diff --git a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff b/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff
index 3d7b3f75a..659aed18f 100644
--- a/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff
+++ b/src/test/mir-opt/early_otherwise_branch_soundness.no_downcast.EarlyOtherwiseBranch.diff
@@ -1,12 +1,12 @@
- // MIR for `no_downcast` before EarlyOtherwiseBranch
+ // MIR for `no_downcast` after EarlyOtherwiseBranch
- fn no_downcast(_1: &E) -> u32 {
+ fn no_downcast(_1: &E<'_>) -> u32 {
debug e => _1; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17
let mut _0: u32; // return place in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:26: +0:29
let mut _2: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:20: +1:30
let mut _3: isize; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- let mut _4: &E; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17
+ let mut _4: &E<'_>; // in scope 0 at $DIR/early_otherwise_branch_soundness.rs:+0:16: +0:17
scope 1 {
}
@@ -16,10 +16,8 @@
}
bb1: {
- StorageLive(_4); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- _4 = deref_copy (((*_1) as Some).0: &E); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
+ _4 = deref_copy (((*_1) as Some).0: &E<'_>); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
_2 = discriminant((*_4)); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
- StorageDead(_4); // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/early_otherwise_branch_soundness.rs:+1:12: +1:31
}
diff --git a/src/test/mir-opt/enum_cast.bar.mir_map.0.mir b/src/test/mir-opt/enum_cast.bar.mir_map.0.mir
index afca2fd29..e58085f70 100644
--- a/src/test/mir-opt/enum_cast.bar.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.bar.mir_map.0.mir
@@ -3,11 +3,15 @@
fn bar(_1: Bar) -> usize {
debug bar => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let mut _2: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ let _2: Bar; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
}
}
diff --git a/src/test/mir-opt/enum_cast.boo.mir_map.0.mir b/src/test/mir-opt/enum_cast.boo.mir_map.0.mir
index c79596d78..525c6234e 100644
--- a/src/test/mir-opt/enum_cast.boo.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.boo.mir_map.0.mir
@@ -3,11 +3,15 @@
fn boo(_1: Boo) -> usize {
debug boo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let mut _2: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ let _2: Boo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ let mut _3: u8; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
}
}
diff --git a/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir b/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir
index 8ced136db..bb5faa480 100644
--- a/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir
@@ -4,8 +4,9 @@ fn droppy() -> () {
let mut _0: (); // return place in scope 0 at $DIR/enum_cast.rs:+0:13: +0:13
let _1: (); // in scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
let _2: Droppy; // in scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
- let mut _4: isize; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
- let _5: Droppy; // in scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
+ let _4: Droppy; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
+ let mut _5: isize; // in scope 0 at $DIR/enum_cast.rs:+5:17: +5:18
+ let _6: Droppy; // in scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
scope 1 {
debug x => _2; // in scope 1 at $DIR/enum_cast.rs:+2:13: +2:14
scope 2 {
@@ -16,7 +17,7 @@ fn droppy() -> () {
}
}
scope 4 {
- debug z => _5; // in scope 4 at $DIR/enum_cast.rs:+7:9: +7:10
+ debug z => _6; // in scope 4 at $DIR/enum_cast.rs:+7:9: +7:10
}
bb0: {
@@ -25,30 +26,41 @@ fn droppy() -> () {
_2 = Droppy::C; // scope 0 at $DIR/enum_cast.rs:+2:17: +2:26
FakeRead(ForLet(None), _2); // scope 0 at $DIR/enum_cast.rs:+2:13: +2:14
StorageLive(_3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
- _4 = discriminant(_2); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
- _3 = move _4 as usize (Misc); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
+ StorageLive(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
+ _4 = move _2; // scope 3 at $DIR/enum_cast.rs:+5:17: +5:18
+ _5 = discriminant(_4); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
+ _3 = move _5 as usize (IntToInt); // scope 3 at $DIR/enum_cast.rs:+5:17: +5:27
+ drop(_4) -> [return: bb1, unwind: bb4]; // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
+ }
+
+ bb1: {
+ StorageDead(_4); // scope 3 at $DIR/enum_cast.rs:+5:26: +5:27
FakeRead(ForLet(None), _3); // scope 3 at $DIR/enum_cast.rs:+5:13: +5:14
_1 = const (); // scope 0 at $DIR/enum_cast.rs:+1:5: +6:6
StorageDead(_3); // scope 1 at $DIR/enum_cast.rs:+6:5: +6:6
- drop(_2) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
+ drop(_2) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
}
- bb1: {
+ bb2: {
StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
StorageDead(_1); // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
- StorageLive(_5); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
- _5 = Droppy::B; // scope 0 at $DIR/enum_cast.rs:+7:13: +7:22
- FakeRead(ForLet(None), _5); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
+ StorageLive(_6); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
+ _6 = Droppy::B; // scope 0 at $DIR/enum_cast.rs:+7:13: +7:22
+ FakeRead(ForLet(None), _6); // scope 0 at $DIR/enum_cast.rs:+7:9: +7:10
_0 = const (); // scope 0 at $DIR/enum_cast.rs:+0:13: +8:2
- drop(_5) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
+ drop(_6) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
}
- bb2: {
- StorageDead(_5); // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
+ bb3: {
+ StorageDead(_6); // scope 0 at $DIR/enum_cast.rs:+8:1: +8:2
return; // scope 0 at $DIR/enum_cast.rs:+8:2: +8:2
}
- bb3 (cleanup): {
+ bb4 (cleanup): {
+ drop(_2) -> bb5; // scope 0 at $DIR/enum_cast.rs:+6:5: +6:6
+ }
+
+ bb5 (cleanup): {
resume; // scope 0 at $DIR/enum_cast.rs:+0:1: +8:2
}
}
diff --git a/src/test/mir-opt/enum_cast.foo.mir_map.0.mir b/src/test/mir-opt/enum_cast.foo.mir_map.0.mir
index 39d6adeba..a1d29a0b9 100644
--- a/src/test/mir-opt/enum_cast.foo.mir_map.0.mir
+++ b/src/test/mir-opt/enum_cast.foo.mir_map.0.mir
@@ -3,11 +3,15 @@
fn foo(_1: Foo) -> usize {
debug foo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11
let mut _0: usize; // return place in scope 0 at $DIR/enum_cast.rs:+0:21: +0:26
- let mut _2: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ let _2: Foo; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ let mut _3: isize; // in scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
- _0 = move _2 as usize (Misc); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ StorageLive(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ _2 = move _1; // scope 0 at $DIR/enum_cast.rs:+1:5: +1:8
+ _3 = discriminant(_2); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ _0 = move _3 as usize (IntToInt); // scope 0 at $DIR/enum_cast.rs:+1:5: +1:17
+ StorageDead(_2); // scope 0 at $DIR/enum_cast.rs:+1:16: +1:17
return; // scope 0 at $DIR/enum_cast.rs:+2:2: +2:2
}
}
diff --git a/src/test/mir-opt/equal_true.rs b/src/test/mir-opt/equal_true.rs
index 994cd194a..717d10c6d 100644
--- a/src/test/mir-opt/equal_true.rs
+++ b/src/test/mir-opt/equal_true.rs
@@ -1,3 +1,5 @@
+// unit-test InstCombine
+
// EMIT_MIR equal_true.opt.InstCombine.diff
fn opt(x: bool) -> i32 {
diff --git a/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir b/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
index d39145973..96716a39a 100644
--- a/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
+++ b/src/test/mir-opt/exponential_or.match_tuple.SimplifyCfg-initial.after.mir
@@ -8,13 +8,13 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
let mut _4: bool; // in scope 0 at $DIR/exponential-or.rs:+2:70: +2:77
let mut _5: bool; // in scope 0 at $DIR/exponential-or.rs:+2:62: +2:67
let mut _6: bool; // in scope 0 at $DIR/exponential-or.rs:+2:62: +2:67
- let _7: u32; // in scope 0 at $DIR/exponential-or.rs:+2:10: +2:21
- let _8: u32; // in scope 0 at $DIR/exponential-or.rs:+2:57: +2:78
+ let _7: u32; // in scope 0 at $DIR/exponential-or.rs:+2:10: +2:11
+ let _8: u32; // in scope 0 at $DIR/exponential-or.rs:+2:57: +2:58
let mut _9: u32; // in scope 0 at $DIR/exponential-or.rs:+2:83: +2:84
let mut _10: u32; // in scope 0 at $DIR/exponential-or.rs:+2:87: +2:88
scope 1 {
- debug y => _7; // in scope 1 at $DIR/exponential-or.rs:+2:10: +2:21
- debug z => _8; // in scope 1 at $DIR/exponential-or.rs:+2:57: +2:78
+ debug y => _7; // in scope 1 at $DIR/exponential-or.rs:+2:10: +2:11
+ debug z => _8; // in scope 1 at $DIR/exponential-or.rs:+2:57: +2:58
}
bb0: {
@@ -61,10 +61,10 @@ fn match_tuple(_1: (u32, bool, Option<i32>, u32)) -> u32 {
}
bb9: {
- StorageLive(_7); // scope 0 at $DIR/exponential-or.rs:+2:10: +2:21
- _7 = (_1.0: u32); // scope 0 at $DIR/exponential-or.rs:+2:10: +2:21
- StorageLive(_8); // scope 0 at $DIR/exponential-or.rs:+2:57: +2:78
- _8 = (_1.3: u32); // scope 0 at $DIR/exponential-or.rs:+2:57: +2:78
+ StorageLive(_7); // scope 0 at $DIR/exponential-or.rs:+2:10: +2:11
+ _7 = (_1.0: u32); // scope 0 at $DIR/exponential-or.rs:+2:10: +2:11
+ StorageLive(_8); // scope 0 at $DIR/exponential-or.rs:+2:57: +2:58
+ _8 = (_1.3: u32); // scope 0 at $DIR/exponential-or.rs:+2:57: +2:58
StorageLive(_9); // scope 1 at $DIR/exponential-or.rs:+2:83: +2:84
_9 = _7; // scope 1 at $DIR/exponential-or.rs:+2:83: +2:84
StorageLive(_10); // scope 1 at $DIR/exponential-or.rs:+2:87: +2:88
diff --git a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
index dca36b1a7..6ab63e82e 100644
--- a/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
+++ b/src/test/mir-opt/funky_arms.float_to_exponential_common.ConstProp.diff
@@ -1,24 +1,24 @@
- // MIR for `float_to_exponential_common` before ConstProp
+ // MIR for `float_to_exponential_common` after ConstProp
- fn float_to_exponential_common(_1: &mut Formatter, _2: &T, _3: bool) -> Result<(), std::fmt::Error> {
+ fn float_to_exponential_common(_1: &mut Formatter<'_>, _2: &T, _3: bool) -> Result<(), std::fmt::Error> {
debug fmt => _1; // in scope 0 at $DIR/funky_arms.rs:+0:35: +0:38
debug num => _2; // in scope 0 at $DIR/funky_arms.rs:+0:60: +0:63
debug upper => _3; // in scope 0 at $DIR/funky_arms.rs:+0:69: +0:74
let mut _0: std::result::Result<(), std::fmt::Error>; // return place in scope 0 at $DIR/funky_arms.rs:+0:85: +0:91
let _4: bool; // in scope 0 at $DIR/funky_arms.rs:+4:9: +4:19
- let mut _5: &std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
+ let mut _5: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
let mut _7: std::option::Option<usize>; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45
- let mut _8: &std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45
+ let mut _8: &std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+13:30: +13:45
let mut _9: isize; // in scope 0 at $DIR/funky_arms.rs:+13:12: +13:27
- let mut _11: &mut std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+15:43: +15:46
+ let mut _11: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+15:43: +15:46
let mut _12: &T; // in scope 0 at $DIR/funky_arms.rs:+15:48: +15:51
let mut _13: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+15:53: +15:57
let mut _14: u32; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:79
let mut _15: u32; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:75
let mut _16: usize; // in scope 0 at $DIR/funky_arms.rs:+15:59: +15:68
let mut _17: bool; // in scope 0 at $DIR/funky_arms.rs:+15:81: +15:86
- let mut _18: &mut std::fmt::Formatter; // in scope 0 at $DIR/funky_arms.rs:+17:46: +17:49
+ let mut _18: &mut std::fmt::Formatter<'_>; // in scope 0 at $DIR/funky_arms.rs:+17:46: +17:49
let mut _19: &T; // in scope 0 at $DIR/funky_arms.rs:+17:51: +17:54
let mut _20: core::num::flt2dec::Sign; // in scope 0 at $DIR/funky_arms.rs:+17:56: +17:60
let mut _21: bool; // in scope 0 at $DIR/funky_arms.rs:+17:62: +17:67
@@ -38,10 +38,10 @@
StorageLive(_4); // scope 0 at $DIR/funky_arms.rs:+4:9: +4:19
StorageLive(_5); // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
_5 = &(*_1); // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
- _4 = Formatter::sign_plus(move _5) -> bb1; // scope 0 at $DIR/funky_arms.rs:+4:22: +4:37
+ _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
- // + literal: Const { ty: for<'r> fn(&'r Formatter) -> bool {Formatter::sign_plus}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> bool {Formatter::<'_>::sign_plus}, val: Value(<ZST>) }
}
bb1: {
@@ -66,10 +66,10 @@
StorageLive(_7); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
StorageLive(_8); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
_8 = &(*_1); // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
- _7 = Formatter::precision(move _8) -> bb5; // scope 3 at $DIR/funky_arms.rs:+13:30: +13:45
+ _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
- // + literal: Const { ty: for<'r> fn(&'r Formatter) -> Option<usize> {Formatter::precision}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a Formatter<'_>) -> Option<usize> {Formatter::<'_>::precision}, val: Value(<ZST>) }
}
bb5: {
@@ -91,7 +91,7 @@
StorageLive(_15); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
StorageLive(_16); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:68
_16 = _10; // scope 3 at $DIR/funky_arms.rs:+15:59: +15:68
- _15 = move _16 as u32 (Misc); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
+ _15 = move _16 as u32 (IntToInt); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:75
StorageDead(_16); // scope 3 at $DIR/funky_arms.rs:+15:74: +15:75
_14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:+15:59: +15:79
StorageDead(_15); // scope 3 at $DIR/funky_arms.rs:+15:78: +15:79
@@ -100,7 +100,7 @@
_0 = float_to_exponential_common_exact::<T>(move _11, move _12, move _13, move _14, move _17) -> bb7; // scope 3 at $DIR/funky_arms.rs:+15:9: +15:87
// mir::Constant
// + span: $DIR/funky_arms.rs:26:9: 26:42
- // + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut Formatter<'s>, &'t0 T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, u32, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_exact::<T>}, val: Value(<ZST>) }
}
bb7: {
@@ -125,7 +125,7 @@
_0 = float_to_exponential_common_shortest::<T>(move _18, move _19, move _20, move _21) -> bb9; // scope 2 at $DIR/funky_arms.rs:+17:9: +17:68
// mir::Constant
// + span: $DIR/funky_arms.rs:28:9: 28:45
- // + literal: Const { ty: for<'r, 's, 't0> fn(&'r mut Formatter<'s>, &'t0 T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b, 'c> fn(&'a mut Formatter<'b>, &'c T, Sign, bool) -> Result<(), std::fmt::Error> {float_to_exponential_common_shortest::<T>}, val: Value(<ZST>) }
}
bb9: {
diff --git a/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir b/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir
index 09765c7b9..c718138b6 100644
--- a/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir
+++ b/src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir
@@ -15,21 +15,21 @@
} */
fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 10:17]) -> () {
- let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
- let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ let mut _0: (); // return place in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
+ let mut _2: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
let _3: std::string::String; // in scope 0 at $DIR/generator-drop-cleanup.rs:+1:13: +1:15
let _4: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+2:9: +2:14
let mut _5: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+2:9: +2:14
let mut _6: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:18: +0:18
- let mut _7: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
- let mut _8: u32; // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ let mut _7: (); // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
+ let mut _8: u32; // in scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
scope 1 {
debug _s => (((*_1) as variant#3).0: std::string::String); // in scope 1 at $DIR/generator-drop-cleanup.rs:+1:13: +1:15
}
bb0: {
- _8 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
- switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ _8 = discriminant((*_1)); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
+ switchInt(move _8) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb1: {
@@ -44,11 +44,11 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 1
}
bb3: {
- return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb4 (cleanup): {
- resume; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ resume; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb5 (cleanup): {
@@ -57,11 +57,11 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 1
}
bb6: {
- return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb7: {
- goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ goto -> bb9; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb8: {
@@ -69,16 +69,16 @@ fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 1
}
bb9: {
- goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ goto -> bb6; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb10: {
- StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
- StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
- goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ StorageLive(_4); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
+ StorageLive(_5); // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
+ goto -> bb1; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
bb11: {
- return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +0:17
+ return; // scope 0 at $DIR/generator-drop-cleanup.rs:+0:15: +3:6
}
}
diff --git a/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir b/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir
index cb6ed3321..3184343f2 100644
--- a/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir
+++ b/src/test/mir-opt/generator_storage_dead_unwind.main-{closure#0}.StateTransform.before.mir
@@ -21,15 +21,13 @@ yields ()
bb0: {
StorageLive(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+1:13: +1:14
- Deinit(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+1:17: +1:23
- (_3.0: i32) = const 5_i32; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+1:17: +1:23
+ _3 = Foo(const 5_i32); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+1:17: +1:23
StorageLive(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+2:13: +2:14
- Deinit(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+2:17: +2:23
- (_4.0: i32) = const 6_i32; // scope 1 at $DIR/generator-storage-dead-unwind.rs:+2:17: +2:23
+ _4 = Bar(const 6_i32); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+2:17: +2:23
StorageLive(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
StorageLive(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
- Deinit(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
- _5 = yield(move _6) -> [resume: bb1, drop: bb5]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
+ _6 = (); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
+ _5 = yield(move _6) -> [resume: bb1, drop: bb6]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:9: +3:14
}
bb1: {
@@ -38,7 +36,7 @@ yields ()
StorageLive(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:9: +4:16
StorageLive(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:14: +4:15
_8 = move _3; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:14: +4:15
- _7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:9: +4:16
+ _7 = take::<Foo>(move _8) -> [return: bb2, unwind: bb10]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:9: +4:16
// mir::Constant
// + span: $DIR/generator-storage-dead-unwind.rs:26:9: 26:13
// + literal: Const { ty: fn(Foo) {take::<Foo>}, val: Value(<ZST>) }
@@ -50,7 +48,7 @@ yields ()
StorageLive(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:9: +5:16
StorageLive(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:14: +5:15
_10 = move _4; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:14: +5:15
- _9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb8]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:9: +5:16
+ _9 = take::<Bar>(move _10) -> [return: bb3, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:9: +5:16
// mir::Constant
// + span: $DIR/generator-storage-dead-unwind.rs:27:9: 27:13
// + literal: Const { ty: fn(Bar) {take::<Bar>}, val: Value(<ZST>) }
@@ -61,54 +59,66 @@ yields ()
StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:16: +5:17
_0 = const (); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:19: +6:6
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
- StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
- drop(_1) -> [return: bb4, unwind: bb11]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
+ goto -> bb4; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb4: {
- return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:18: +0:18
+ StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
+ drop(_1) -> [return: bb5, unwind: bb14]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
bb5: {
+ return; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:6: +6:6
+ }
+
+ bb6: {
StorageDead(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:13: +3:14
StorageDead(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+3:14: +3:15
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
- drop(_3) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
+ drop(_3) -> [return: bb7, unwind: bb15]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
- bb6: {
+ bb7: {
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
- drop(_1) -> [return: bb7, unwind: bb11]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
+ drop(_1) -> [return: bb8, unwind: bb14]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
}
- bb7: {
- generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +0:18
+ bb8: {
+ generator_drop; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +6:6
}
- bb8 (cleanup): {
+ bb9 (cleanup): {
StorageDead(_10); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:15: +5:16
StorageDead(_9); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+5:16: +5:17
- goto -> bb10; // scope 2 at no-location
+ goto -> bb12; // scope 2 at no-location
}
- bb9 (cleanup): {
+ bb10 (cleanup): {
+ goto -> bb11; // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:15: +4:16
+ }
+
+ bb11 (cleanup): {
StorageDead(_8); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:15: +4:16
StorageDead(_7); // scope 2 at $DIR/generator-storage-dead-unwind.rs:+4:16: +4:17
- goto -> bb10; // scope 2 at no-location
+ goto -> bb12; // scope 2 at no-location
}
- bb10 (cleanup): {
+ bb12 (cleanup): {
StorageDead(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
+ goto -> bb13; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
+ }
+
+ bb13 (cleanup): {
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
- drop(_1) -> bb11; // 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
}
- bb11 (cleanup): {
- resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +0:18
+ bb14 (cleanup): {
+ resume; // scope 0 at $DIR/generator-storage-dead-unwind.rs:+0:16: +6:6
}
- bb12 (cleanup): {
+ bb15 (cleanup): {
StorageDead(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:+6:5: +6:6
- drop(_1) -> bb11; // 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
}
}
diff --git a/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir b/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir
index 62e7d7b2d..07aeeaae0 100644
--- a/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir
+++ b/src/test/mir-opt/generator_tiny.main-{closure#0}.generator_resume.0.mir
@@ -16,29 +16,29 @@
fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]>, _2: u8) -> GeneratorState<(), ()> {
debug _x => _10; // in scope 0 at $DIR/generator-tiny.rs:+0:17: +0:19
- let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
+ let mut _0: std::ops::GeneratorState<(), ()>; // return place in scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
let _3: HasDrop; // in scope 0 at $DIR/generator-tiny.rs:+1:13: +1:15
let mut _4: !; // in scope 0 at $DIR/generator-tiny.rs:+2:9: +5:10
- let mut _5: (); // in scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
+ let mut _5: (); // in scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
let _6: u8; // in scope 0 at $DIR/generator-tiny.rs:+3:13: +3:18
let mut _7: (); // in scope 0 at $DIR/generator-tiny.rs:+3:13: +3:18
let _8: (); // in scope 0 at $DIR/generator-tiny.rs:+4:13: +4:21
let mut _9: (); // in scope 0 at $DIR/generator-tiny.rs:+0:25: +0:25
let _10: u8; // in scope 0 at $DIR/generator-tiny.rs:+0:17: +0:19
- let mut _11: u32; // in scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
+ let mut _11: u32; // in scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
scope 1 {
debug _d => (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop); // in scope 1 at $DIR/generator-tiny.rs:+1:13: +1:15
}
bb0: {
- _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
- switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
+ _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24]))); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
+ switchInt(move _11) -> [0_u32: bb1, 3_u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
}
bb1: {
- _10 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
+ _10 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
nop; // scope 0 at $DIR/generator-tiny.rs:+1:13: +1:15
- Deinit((((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop)); // scope 0 at $DIR/generator-tiny.rs:+1:18: +1:25
+ (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:19:16: 19:24])) as variant#3).0: HasDrop) = HasDrop; // scope 0 at $DIR/generator-tiny.rs:+1:18: +1:25
StorageLive(_4); // scope 1 at $DIR/generator-tiny.rs:+2:9: +5:10
goto -> bb2; // scope 1 at $DIR/generator-tiny.rs:+2:9: +5:10
}
@@ -46,7 +46,7 @@ fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 19:24
bb2: {
StorageLive(_6); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
StorageLive(_7); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
- Deinit(_7); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
+ _7 = (); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
Deinit(_0); // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
((_0 as Yielded).0: ()) = move _7; // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
discriminant(_0) = 0; // scope 1 at $DIR/generator-tiny.rs:+3:13: +3:18
@@ -71,14 +71,14 @@ fn main::{closure#0}(_1: Pin<&mut [generator@$DIR/generator-tiny.rs:19:16: 19:24
}
bb5: {
- StorageLive(_4); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
- StorageLive(_6); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
- StorageLive(_7); // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
- _6 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
- goto -> bb3; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
+ StorageLive(_4); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
+ StorageLive(_6); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
+ StorageLive(_7); // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
+ _6 = move _2; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
+ goto -> bb3; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
}
bb6: {
- unreachable; // scope 0 at $DIR/generator-tiny.rs:+0:16: +0:24
+ unreachable; // scope 0 at $DIR/generator-tiny.rs:+0:16: +6:6
}
}
diff --git a/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff b/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
index 3f612e03f..ed53c9a95 100644
--- a/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
+++ b/src/test/mir-opt/if_condition_int.dont_remove_comparison.SimplifyComparisonIntegral.diff
@@ -31,7 +31,7 @@
StorageLive(_6); // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:31
StorageLive(_7); // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:24
_7 = _2; // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:24
- _6 = move _7 as i32 (Misc); // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:31
+ _6 = move _7 as i32 (IntToInt); // scope 1 at $DIR/if-condition-int.rs:+4:23: +4:31
StorageDead(_7); // scope 1 at $DIR/if-condition-int.rs:+4:30: +4:31
_0 = Add(const 100_i32, move _6); // scope 1 at $DIR/if-condition-int.rs:+4:17: +4:31
StorageDead(_6); // scope 1 at $DIR/if-condition-int.rs:+4:30: +4:31
@@ -43,7 +43,7 @@
StorageLive(_4); // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:31
StorageLive(_5); // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:24
_5 = _2; // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:24
- _4 = move _5 as i32 (Misc); // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:31
+ _4 = move _5 as i32 (IntToInt); // scope 1 at $DIR/if-condition-int.rs:+3:23: +3:31
StorageDead(_5); // scope 1 at $DIR/if-condition-int.rs:+3:30: +3:31
_0 = Add(const 10_i32, move _4); // scope 1 at $DIR/if-condition-int.rs:+3:18: +3:31
StorageDead(_4); // scope 1 at $DIR/if-condition-int.rs:+3:30: +3:31
diff --git a/src/test/mir-opt/inline/asm-unwind.rs b/src/test/mir-opt/inline/asm-unwind.rs
new file mode 100644
index 000000000..c03feb433
--- /dev/null
+++ b/src/test/mir-opt/inline/asm-unwind.rs
@@ -0,0 +1,22 @@
+// Tests inlining of `may_unwind` inline assembly.
+//
+// ignore-wasm32-bare compiled with panic=abort by default
+// needs-asm-support
+#![feature(asm_unwind)]
+
+struct D;
+
+impl Drop for D {
+ fn drop(&mut self) {}
+}
+
+#[inline(always)]
+fn foo() {
+ let _d = D;
+ unsafe { std::arch::asm!("", options(may_unwind)) };
+}
+
+// EMIT_MIR asm_unwind.main.Inline.diff
+pub fn main() {
+ foo();
+}
diff --git a/src/test/mir-opt/inline/asm_unwind.main.Inline.diff b/src/test/mir-opt/inline/asm_unwind.main.Inline.diff
new file mode 100644
index 000000000..57072fc0a
--- /dev/null
+++ b/src/test/mir-opt/inline/asm_unwind.main.Inline.diff
@@ -0,0 +1,45 @@
+- // MIR for `main` before Inline
++ // MIR for `main` after Inline
+
+ fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/asm-unwind.rs:+0:15: +0:15
+ let _1: (); // in scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10
++ scope 1 (inlined foo) { // at $DIR/asm-unwind.rs:21:5: 21:10
++ let _2: D; // in scope 1 at $DIR/asm-unwind.rs:15:9: 15:11
++ scope 2 {
++ debug _d => _2; // in scope 2 at $DIR/asm-unwind.rs:15:9: 15:11
++ scope 3 {
++ }
++ }
++ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10
+- _1 = foo() -> bb1; // scope 0 at $DIR/asm-unwind.rs:+1:5: +1:10
+- // mir::Constant
+- // + span: $DIR/asm-unwind.rs:21:5: 21:8
+- // + literal: Const { ty: fn() {foo}, val: Value(<ZST>) }
++ StorageLive(_2); // scope 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
+ }
+
+ 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(_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
++ }
++
++ bb3 (cleanup): {
++ drop(_2) -> bb4; // scope 1 at $DIR/asm-unwind.rs:17:1: 17:2
++ }
++
++ bb4 (cleanup): {
++ resume; // scope 1 at $DIR/asm-unwind.rs:14:1: 17:2
+ }
+ }
+
diff --git a/src/test/mir-opt/inline/cycle.f.Inline.diff b/src/test/mir-opt/inline/cycle.f.Inline.diff
index 40fdd1cdb..75ea69a42 100644
--- a/src/test/mir-opt/inline/cycle.f.Inline.diff
+++ b/src/test/mir-opt/inline/cycle.f.Inline.diff
@@ -17,7 +17,7 @@
_2 = <impl Fn() as Fn<()>>::call(move _3, move _4) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/cycle.rs:+1:5: +1:8
// mir::Constant
// + span: $DIR/cycle.rs:6:5: 6:6
- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
}
bb1: {
diff --git a/src/test/mir-opt/inline/cycle.g.Inline.diff b/src/test/mir-opt/inline/cycle.g.Inline.diff
index 59f34d379..5f3ee467c 100644
--- a/src/test/mir-opt/inline/cycle.g.Inline.diff
+++ b/src/test/mir-opt/inline/cycle.g.Inline.diff
@@ -6,10 +6,10 @@
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
+ scope 1 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
-+ debug g => _2; // in scope 1 at $DIR/cycle.rs:+0:6: +0:7
-+ let _3: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ let mut _4: &fn() {main}; // in scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ let mut _5: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
++ 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,10 +25,10 @@
- // 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:+0:5: +0:8
-+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ _4 = &_2; // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:+0:5: +0:8
++ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
++ 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
+ _3 = move (*_4)() -> [return: bb4, unwind: bb2]; // scope 2 at $SRC_DIR/core/src/ops/function.rs:LL:COL
}
@@ -40,18 +40,18 @@
+ }
+
+ bb2 (cleanup): {
-+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
+ }
+
+ bb3 (cleanup): {
-+ resume; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
+ }
+
+ bb4: {
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:+0:8: +0:9
-+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 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/src/test/mir-opt/inline/cycle.main.Inline.diff b/src/test/mir-opt/inline/cycle.main.Inline.diff
index 6def7c3ee..8b4099b9d 100644
--- a/src/test/mir-opt/inline/cycle.main.Inline.diff
+++ b/src/test/mir-opt/inline/cycle.main.Inline.diff
@@ -6,17 +6,17 @@
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
+ scope 1 (inlined f::<fn() {g}>) { // at $DIR/cycle.rs:17:5: 17:9
-+ debug g => _2; // in scope 1 at $DIR/cycle.rs:+0:6: +0:7
-+ let _3: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ let mut _4: &fn() {g}; // in scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ let mut _5: (); // in scope 1 at $DIR/cycle.rs:+0:5: +0:8
++ 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
+ scope 3 (inlined g) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL
-+ let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:+0:5: +0:12
++ let mut _6: fn() {main}; // in scope 3 at $DIR/cycle.rs:12:5: 12:12
+ scope 4 (inlined f::<fn() {main}>) { // at $DIR/cycle.rs:12:5: 12:12
-+ debug g => _6; // in scope 4 at $DIR/cycle.rs:+0:6: +0:7
-+ let _7: (); // in scope 4 at $DIR/cycle.rs:+0:5: +0:8
-+ let mut _8: &fn() {main}; // in scope 4 at $DIR/cycle.rs:+0:5: +0:6
++ debug g => _6; // in scope 4 at $DIR/cycle.rs:5:6: 5:7
++ let _7: (); // in scope 4 at $DIR/cycle.rs:6:5: 6:8
++ let mut _8: &fn() {main}; // in scope 4 at $DIR/cycle.rs:6:5: 6:6
+ scope 5 (inlined <fn() {main} as Fn<()>>::call - shim(fn() {main})) { // at $DIR/cycle.rs:6:5: 6:8
+ }
+ }
@@ -35,14 +35,14 @@
- // 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:+0:5: +0:8
-+ StorageLive(_4); // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ _4 = &_2; // scope 1 at $DIR/cycle.rs:+0:5: +0:6
-+ StorageLive(_5); // scope 1 at $DIR/cycle.rs:+0:5: +0:8
-+ StorageLive(_6); // scope 3 at $DIR/cycle.rs:+0:5: +0:12
-+ StorageLive(_7); // scope 4 at $DIR/cycle.rs:+0:5: +0:8
-+ StorageLive(_8); // scope 4 at $DIR/cycle.rs:+0:5: +0:6
-+ _8 = &_6; // scope 4 at $DIR/cycle.rs:+0:5: +0:6
++ StorageLive(_3); // scope 1 at $DIR/cycle.rs:6:5: 6:8
++ 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
++ StorageLive(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12
++ StorageLive(_7); // scope 4 at $DIR/cycle.rs:6:5: 6:8
++ StorageLive(_8); // scope 4 at $DIR/cycle.rs:6:5: 6:6
++ _8 = &_6; // scope 4 at $DIR/cycle.rs:6:5: 6:6
+ _7 = move (*_8)() -> [return: bb4, unwind: bb2]; // scope 5 at $SRC_DIR/core/src/ops/function.rs:LL:COL
}
@@ -54,21 +54,21 @@
+ }
+
+ bb2 (cleanup): {
-+ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ drop(_2) -> bb3; // scope 1 at $DIR/cycle.rs:7:1: 7:2
+ }
+
+ bb3 (cleanup): {
-+ resume; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ resume; // scope 1 at $DIR/cycle.rs:5:1: 7:2
+ }
+
+ bb4: {
-+ StorageDead(_8); // scope 4 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_7); // scope 4 at $DIR/cycle.rs:+0:8: +0:9
-+ StorageDead(_6); // scope 3 at $DIR/cycle.rs:+0:5: +0:12
-+ StorageDead(_5); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_4); // scope 1 at $DIR/cycle.rs:+0:7: +0:8
-+ StorageDead(_3); // scope 1 at $DIR/cycle.rs:+0:8: +0:9
-+ drop(_2) -> bb1; // scope 1 at $DIR/cycle.rs:+0:1: +0:2
++ StorageDead(_8); // scope 4 at $DIR/cycle.rs:6:7: 6:8
++ StorageDead(_7); // scope 4 at $DIR/cycle.rs:6:8: 6:9
++ StorageDead(_6); // scope 3 at $DIR/cycle.rs:12:5: 12:12
++ StorageDead(_5); // scope 1 at $DIR/cycle.rs:6:7: 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/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff b/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff
index 8eae04c4d..1e95b5b29 100644
--- a/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff
+++ b/src/test/mir-opt/inline/dyn_trait.get_query.Inline.diff
@@ -10,12 +10,12 @@
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:+0:36: +0:37
-+ let mut _5: &dyn Cache<V = <Q as Query>::V>; // in scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ let mut _6: &<Q as Query>::C; // in scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
++ 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
++ let mut _6: &<Q as Query>::C; // 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:+0:27: +0:28
-+ let mut _7: &dyn Cache<V = <Q as Query>::V>; // in scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
++ debug c => _5; // in scope 3 at $DIR/dyn-trait.rs:20:27: 20:28
++ let mut _7: &dyn Cache<V = <Q as Query>::V>; // in scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
+ }
+ }
}
@@ -28,7 +28,7 @@
// mir::Constant
// + span: $DIR/dyn-trait.rs:33:13: 33:21
// + user_ty: UserType(0)
- // + literal: Const { ty: for<'r> fn(&'r T) -> &'r <Q as Query>::C {<Q as Query>::cache::<T>}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a T) -> &'a <Q as Query>::C {<Q as Query>::cache::<T>}, val: Value(<ZST>) }
}
bb1: {
@@ -36,24 +36,24 @@
StorageLive(_4); // scope 1 at $DIR/dyn-trait.rs:+2:23: +2:24
_4 = &(*_2); // scope 1 at $DIR/dyn-trait.rs:+2:23: +2:24
- _0 = try_execute_query::<<Q as Query>::C>(move _4) -> bb2; // scope 1 at $DIR/dyn-trait.rs:+2:5: +2:25
-+ StorageLive(_5); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ StorageLive(_6); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ _6 = _4; // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ _5 = move _6 as &dyn Cache<V = <Q as Query>::V> (Pointer(Unsize)); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ StorageDead(_6); // scope 2 at $DIR/dyn-trait.rs:+0:14: +0:15
-+ StorageLive(_7); // scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _7 = _5; // scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(move _7) -> bb2; // scope 3 at $DIR/dyn-trait.rs:+0:5: +0:22
++ StorageLive(_5); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ StorageLive(_6); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ _6 = _4; // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ _5 = move _6 as &dyn Cache<V = <Q as Query>::V> (Pointer(Unsize)); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ StorageDead(_6); // scope 2 at $DIR/dyn-trait.rs:27:14: 27:15
++ StorageLive(_7); // scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
++ _7 = _5; // scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
++ _0 = <dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache(move _7) -> bb2; // scope 3 at $DIR/dyn-trait.rs:21:5: 21:22
// mir::Constant
- // + span: $DIR/dyn-trait.rs:34:5: 34:22
-- // + literal: Const { ty: for<'r> fn(&'r <Q as Query>::C) {try_execute_query::<<Q as Query>::C>}, val: Value(<ZST>) }
+- // + 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
-+ // + literal: Const { ty: for<'r> fn(&'r dyn Cache<V = <Q as Query>::V>) {<dyn Cache<V = <Q as Query>::V> as Cache>::store_nocache}, val: Value(<ZST>) }
++ // + 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(_7); // scope 3 at $DIR/dyn-trait.rs:+0:21: +0:22
-+ StorageDead(_5); // scope 2 at $DIR/dyn-trait.rs:+0:15: +0:16
++ StorageDead(_7); // scope 3 at $DIR/dyn-trait.rs:21:21: 21:22
++ StorageDead(_5); // scope 2 at $DIR/dyn-trait.rs:27:15: 27: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/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff b/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
index 994930ef4..7421db4d0 100644
--- a/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
+++ b/src/test/mir-opt/inline/dyn_trait.mk_cycle.Inline.diff
@@ -12,7 +12,7 @@
_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
- // + literal: Const { ty: for<'r> fn(&'r dyn Cache<V = V>) {<dyn Cache<V = V> as Cache>::store_nocache}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a dyn Cache<V = V>) {<dyn Cache<V = V> as Cache>::store_nocache}, val: Value(<ZST>) }
}
bb1: {
diff --git a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff b/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
index e7c5972f4..e6e783744 100644
--- a/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
+++ b/src/test/mir-opt/inline/dyn_trait.try_execute_query.Inline.diff
@@ -7,8 +7,8 @@
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:+0:27: +0:28
-+ let mut _4: &dyn Cache<V = <C as Cache>::V>; // in scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
++ debug c => _2; // in scope 1 at $DIR/dyn-trait.rs:20:27: 20:28
++ let mut _4: &dyn Cache<V = <C as Cache>::V>; // in scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
+ }
bb0: {
@@ -18,18 +18,18 @@
_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
-+ StorageLive(_4); // scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _4 = _2; // scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
-+ _0 = <dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache(move _4) -> bb1; // scope 1 at $DIR/dyn-trait.rs:+0:5: +0:22
++ StorageLive(_4); // scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
++ _4 = _2; // scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
++ _0 = <dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache(move _4) -> bb1; // scope 1 at $DIR/dyn-trait.rs:21:5: 21:22
// mir::Constant
- // + span: $DIR/dyn-trait.rs:27:5: 27:13
-- // + literal: Const { ty: for<'r> fn(&'r (dyn Cache<V = <C as Cache>::V> + 'r)) {mk_cycle::<<C as Cache>::V>}, val: Value(<ZST>) }
+- // + 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
-+ // + literal: Const { ty: for<'r> fn(&'r dyn Cache<V = <C as Cache>::V>) {<dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache}, val: Value(<ZST>) }
++ // + literal: Const { ty: for<'a> fn(&'a dyn Cache<V = <C as Cache>::V>) {<dyn Cache<V = <C as Cache>::V> as Cache>::store_nocache}, val: Value(<ZST>) }
}
bb1: {
-+ StorageDead(_4); // scope 1 at $DIR/dyn-trait.rs:+0:21: +0:22
++ StorageDead(_4); // scope 1 at $DIR/dyn-trait.rs:21:21: 21:22
StorageDead(_2); // scope 0 at $DIR/dyn-trait.rs:+1:15: +1:16
return; // scope 0 at $DIR/dyn-trait.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/inline/inline-into-box-place.rs b/src/test/mir-opt/inline/inline-into-box-place.rs
index 049a97816..232bcc7b2 100644
--- a/src/test/mir-opt/inline/inline-into-box-place.rs
+++ b/src/test/mir-opt/inline/inline-into-box-place.rs
@@ -1,7 +1,7 @@
// ignore-endian-big
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -Z mir-opt-level=4
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
#![feature(box_syntax)]
// EMIT_MIR inline_into_box_place.main.Inline.diff
fn main() {
diff --git a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir b/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
index 630225258..b27425fb1 100644
--- a/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_any_operand.bar.Inline.after.mir
@@ -9,10 +9,10 @@ fn bar() -> bool {
scope 1 {
debug f => _1; // in scope 1 at $DIR/inline-any-operand.rs:+1:9: +1:10
scope 2 (inlined foo) { // at $DIR/inline-any-operand.rs:12:5: 12:13
- debug x => _3; // in scope 2 at $DIR/inline-any-operand.rs:+6:8: +6:9
- debug y => _4; // in scope 2 at $DIR/inline-any-operand.rs:+6:16: +6:17
- let mut _5: i32; // in scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:6
- let mut _6: i32; // in scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
+ debug x => _3; // in scope 2 at $DIR/inline-any-operand.rs:16:8: 16:9
+ debug y => _4; // in scope 2 at $DIR/inline-any-operand.rs:16:16: 16:17
+ let mut _5: i32; // in scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
+ let mut _6: i32; // in scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
}
}
@@ -28,13 +28,13 @@ fn bar() -> bool {
_3 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
StorageLive(_4); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
_4 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
- StorageLive(_5); // scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:6
- _5 = _3; // scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:6
- StorageLive(_6); // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
- _6 = _4; // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
- _0 = Eq(move _5, move _6); // scope 2 at $DIR/inline-any-operand.rs:+7:5: +7:11
- StorageDead(_6); // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
- StorageDead(_5); // scope 2 at $DIR/inline-any-operand.rs:+7:10: +7:11
+ StorageLive(_5); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
+ _5 = _3; // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:6
+ StorageLive(_6); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
+ _6 = _4; // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
+ _0 = Eq(move _5, move _6); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
+ StorageDead(_6); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
+ StorageDead(_5); // scope 2 at $DIR/inline-any-operand.rs:17:10: 17:11
StorageDead(_4); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
StorageDead(_3); // scope 1 at $DIR/inline-any-operand.rs:+2:5: +2:13
StorageDead(_2); // scope 1 at $DIR/inline-any-operand.rs:+2:12: +2:13
diff --git a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir b/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
index d60b06460..a2234e7c1 100644
--- a/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_closure_captures.foo.Inline.after.mir
@@ -19,8 +19,8 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
debug t => (*((*_6).1: &T)); // in scope 2 at $DIR/inline-closure-captures.rs:+0:17: +0:18
let mut _10: i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
let mut _11: T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
- let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:17
- let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:17
+ let mut _12: &i32; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:24
+ let mut _13: &T; // in scope 2 at $DIR/inline-closure-captures.rs:+1:13: +1:24
}
}
@@ -45,15 +45,11 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
StorageLive(_9); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9
_9 = move (_7.0: i32); // scope 1 at $DIR/inline-closure-captures.rs:+2:5: +2:9
StorageLive(_10); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
- StorageLive(_12); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
_12 = deref_copy ((*_6).0: &i32); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
_10 = (*_12); // scope 2 at $DIR/inline-closure-captures.rs:+1:19: +1:20
- StorageDead(_12); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
StorageLive(_11); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
- StorageLive(_13); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
_13 = deref_copy ((*_6).1: &T); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
_11 = (*_13); // scope 2 at $DIR/inline-closure-captures.rs:+1:22: +1:23
- StorageDead(_13); // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
Deinit(_0); // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
(_0.0: i32) = move _10; // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
(_0.1: T) = move _11; // scope 2 at $DIR/inline-closure-captures.rs:+1:18: +1:24
diff --git a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff
index b1c476362..a4d706de0 100644
--- a/src/test/mir-opt/inline/inline_cycle.one.Inline.diff
+++ b/src/test/mir-opt/inline/inline_cycle.one.Inline.diff
@@ -14,7 +14,7 @@
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:+23:9: +23:28
++ _1 = <C as Call>::call() -> bb1; // scope 3 at $DIR/inline-cycle.rs:36:9: 36:28
// mir::Constant
- // + span: $DIR/inline-cycle.rs:14:5: 14:22
+ // + span: $DIR/inline-cycle.rs:36:9: 36:26
diff --git a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff
index dc890a365..b1a5b62ef 100644
--- a/src/test/mir-opt/inline/inline_cycle.two.Inline.diff
+++ b/src/test/mir-opt/inline/inline_cycle.two.Inline.diff
@@ -6,13 +6,13 @@
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:+5:22: +5:23
-+ let _3: (); // in scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
-+ let mut _4: fn() {f}; // in scope 1 at $DIR/inline-cycle.rs:+6:5: +6:6
-+ let mut _5: (); // in scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
++ 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: fn() {f}; // in scope 1 at $DIR/inline-cycle.rs:54:5: 54:6
++ let mut _5: (); // 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
+ scope 3 (inlined f) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL
-+ let _6: (); // in scope 3 at $DIR/inline-cycle.rs:+11:5: +11:12
++ let _6: (); // in scope 3 at $DIR/inline-cycle.rs:59:5: 59:12
+ }
+ }
+ }
@@ -26,12 +26,12 @@
- // + span: $DIR/inline-cycle.rs:49:5: 49:9
+ // + span: $DIR/inline-cycle.rs:49:10: 49:11
+ // + literal: Const { ty: fn() {f}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
-+ StorageLive(_4); // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:6
-+ _4 = move _2; // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:6
-+ StorageLive(_5); // scope 1 at $DIR/inline-cycle.rs:+6:5: +6:8
-+ StorageLive(_6); // scope 3 at $DIR/inline-cycle.rs:+11:5: +11:12
-+ _6 = call::<fn() {f}>(f) -> bb1; // scope 3 at $DIR/inline-cycle.rs:+11:5: +11:12
++ 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:6
++ _4 = move _2; // scope 1 at $DIR/inline-cycle.rs:54:5: 54:6
++ StorageLive(_5); // scope 1 at $DIR/inline-cycle.rs:54:5: 54:8
++ StorageLive(_6); // scope 3 at $DIR/inline-cycle.rs:59:5: 59:12
++ _6 = call::<fn() {f}>(f) -> bb1; // scope 3 at $DIR/inline-cycle.rs:59:5: 59:12
+ // mir::Constant
+ // + span: $DIR/inline-cycle.rs:59:5: 59:9
// + literal: Const { ty: fn(fn() {f}) {call::<fn() {f}>}, val: Value(<ZST>) }
@@ -42,10 +42,10 @@
}
bb1: {
-+ StorageDead(_6); // scope 3 at $DIR/inline-cycle.rs:+11:12: +11:13
-+ StorageDead(_5); // scope 1 at $DIR/inline-cycle.rs:+6:7: +6:8
-+ StorageDead(_4); // scope 1 at $DIR/inline-cycle.rs:+6:7: +6:8
-+ StorageDead(_3); // scope 1 at $DIR/inline-cycle.rs:+6:8: +6:9
++ StorageDead(_6); // scope 3 at $DIR/inline-cycle.rs:59:12: 59:13
++ StorageDead(_5); // scope 1 at $DIR/inline-cycle.rs:54:7: 54:8
++ 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(_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/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff
index 082f57e59..fc5d57ce8 100644
--- a/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff
+++ b/src/test/mir-opt/inline/inline_cycle_generic.main.Inline.diff
@@ -16,7 +16,7 @@
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:+23:9: +23:28
++ _1 = <C as Call>::call() -> bb1; // scope 4 at $DIR/inline-cycle-generic.rs:31:9: 31:28
// mir::Constant
- // + span: $DIR/inline-cycle-generic.rs:9:5: 9:22
+ // + span: $DIR/inline-cycle-generic.rs:31:9: 31:26
diff --git a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff b/src/test/mir-opt/inline/inline_diverging.f.Inline.diff
index 6b24b3e16..cef4cfc67 100644
--- a/src/test/mir-opt/inline/inline_diverging.f.Inline.diff
+++ b/src/test/mir-opt/inline/inline_diverging.f.Inline.diff
@@ -18,7 +18,7 @@
+ }
+
+ bb1: {
-+ goto -> bb1; // scope 1 at $DIR/inline-diverging.rs:+32:5: +32:12
++ goto -> bb1; // scope 1 at $DIR/inline-diverging.rs:39:5: 39:12
}
}
diff --git a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff
index a25f1454f..a71baad3e 100644
--- a/src/test/mir-opt/inline/inline_diverging.g.Inline.diff
+++ b/src/test/mir-opt/inline/inline_diverging.g.Inline.diff
@@ -25,7 +25,7 @@
bb1: {
StorageLive(_4); // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10
_4 = _1; // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:10
- _0 = move _4 as u32 (Misc); // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:17
+ _0 = move _4 as u32 (IntToInt); // scope 0 at $DIR/inline-diverging.rs:+2:9: +2:17
StorageDead(_4); // scope 0 at $DIR/inline-diverging.rs:+2:16: +2:17
StorageDead(_2); // scope 0 at $DIR/inline-diverging.rs:+5:5: +5:6
return; // scope 0 at $DIR/inline-diverging.rs:+6:2: +6:2
diff --git a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff b/src/test/mir-opt/inline/inline_diverging.h.Inline.diff
index 8759f3d02..6569ab24c 100644
--- a/src/test/mir-opt/inline/inline_diverging.h.Inline.diff
+++ b/src/test/mir-opt/inline/inline_diverging.h.Inline.diff
@@ -6,19 +6,19 @@
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
+ 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:+5:36: +5:37
-+ let _3: !; // in scope 1 at $DIR/inline-diverging.rs:+6:9: +6:10
-+ let mut _4: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:+6:13: +6:14
-+ let mut _5: (); // in scope 1 at $DIR/inline-diverging.rs:+6:13: +6:16
-+ let mut _7: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:+7:13: +7:14
-+ let mut _8: (); // in scope 1 at $DIR/inline-diverging.rs:+7:13: +7:16
-+ let mut _9: !; // in scope 1 at $DIR/inline-diverging.rs:+8:6: +8:7
-+ let mut _10: !; // in scope 1 at $DIR/inline-diverging.rs:+8:9: +8:10
++ 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 _7: &fn() -> ! {sleep}; // in scope 1 at $DIR/inline-diverging.rs:28:13: 28:14
++ let mut _8: (); // in scope 1 at $DIR/inline-diverging.rs:28:13: 28:16
++ let mut _9: !; // in scope 1 at $DIR/inline-diverging.rs:29:6: 29:7
++ let mut _10: !; // 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:+6:9: +6:10
-+ let _6: !; // in scope 2 at $DIR/inline-diverging.rs:+7:9: +7:10
++ debug a => _3; // in scope 2 at $DIR/inline-diverging.rs:27:9: 27:10
++ let _6: !; // in scope 2 at $DIR/inline-diverging.rs:28:9: 28:10
+ scope 3 {
-+ debug b => _6; // in scope 3 at $DIR/inline-diverging.rs:+7:9: +7:10
++ debug b => _6; // in scope 3 at $DIR/inline-diverging.rs:28:9: 28:10
+ }
+ scope 6 (inlined <fn() -> ! {sleep} as Fn<()>>::call - shim(fn() -> ! {sleep})) { // at $DIR/inline-diverging.rs:28:13: 28:16
+ scope 7 (inlined sleep) { // at $SRC_DIR/core/src/ops/function.rs:LL:COL
@@ -42,15 +42,15 @@
- // mir::Constant
// + span: $DIR/inline-diverging.rs:22:16: 22:21
// + literal: Const { ty: fn() -> ! {sleep}, val: Value(<ZST>) }
-+ StorageLive(_3); // scope 1 at $DIR/inline-diverging.rs:+6:9: +6:10
-+ StorageLive(_4); // scope 1 at $DIR/inline-diverging.rs:+6:13: +6:14
-+ _4 = &_2; // scope 1 at $DIR/inline-diverging.rs:+6:13: +6:14
-+ StorageLive(_5); // scope 1 at $DIR/inline-diverging.rs:+6:13: +6:16
-+ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:+18:5: +18:12
++ 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
++ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:39:5: 39:12
+ }
+
+ bb1: {
-+ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:+18:5: +18:12
++ goto -> bb1; // scope 5 at $DIR/inline-diverging.rs:39:5: 39:12
}
}
diff --git a/src/test/mir-opt/inline/inline_generator.main.Inline.diff b/src/test/mir-opt/inline/inline_generator.main.Inline.diff
index c7c2759cc..3fd8aad72 100644
--- a/src/test/mir-opt/inline/inline_generator.main.Inline.diff
+++ b/src/test/mir-opt/inline/inline_generator.main.Inline.diff
@@ -24,15 +24,15 @@
+ }
+ }
+ scope 6 (inlined g::{closure#0}) { // at $DIR/inline-generator.rs:9:14: 9:46
-+ debug a => _11; // in scope 6 at $DIR/inline-generator.rs:+7:6: +7:7
-+ let mut _8: i32; // in scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
-+ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
-+ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:+7:9: +7:9
-+ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:+7:6: +7:7
-+ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ debug a => _11; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
++ let mut _8: i32; // in scope 6 at $DIR/inline-generator.rs:15:17: 15:39
++ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:15:20: 15:21
++ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:15:9: 15:9
++ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
++ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ }
bb0: {
@@ -47,8 +47,8 @@
- }
-
- bb1: {
-+ Deinit(_4); // scope 2 at $DIR/inline-generator.rs:+7:5: +7:41
-+ discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:+7:5: +7:41
++ Deinit(_4); // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
++ discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
_3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:+1:23: +1:31
- _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:32
- // mir::Constant
@@ -70,22 +70,18 @@
- _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
- // mir::Constant
- // + span: $DIR/inline-generator.rs:9:33: 9:39
-- // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(<ZST>) }
+- // + literal: Const { ty: for<'a> fn(Pin<&'a mut [generator@$DIR/inline-generator.rs:15:5: 15:8]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:8] as Generator<bool>>::resume}, val: Value(<ZST>) }
+ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
-+ StorageLive(_12); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
-+ StorageLive(_13); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ StorageDead(_13); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ _13 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
}
- bb3: {
+ bb1: {
-+ StorageDead(_12); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageDead(_11); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageDead(_10); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
+ StorageDead(_7); // scope 0 at $DIR/inline-generator.rs:+1:14: +1:46
@@ -102,55 +98,51 @@
+ }
+
+ bb3: {
-+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
-+ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
-+ _9 = _11; // scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
-+ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:+7:20: +7:21
++ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
++ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
++ _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
++ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
+ }
+
+ bb4: {
-+ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:+7:24: +7:25
-+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
++ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:15:24: 15:25
++ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ }
+
+ bb5: {
-+ _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:+7:35: +7:37
-+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:+7:17: +7:39
++ _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:15:35: 15:37
++ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
+ }
+
+ bb6: {
-+ StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:+7:38: +7:39
-+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ StorageLive(_14); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ _14 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ discriminant((*_14)) = 3; // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ StorageDead(_14); // scope 6 at $DIR/inline-generator.rs:+7:11: +7:39
-+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:+7:11: +7:39
++ StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
++ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ _14 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ discriminant((*_14)) = 3; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
++ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39
+ }
+
+ bb7: {
-+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
-+ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:+7:38: +7:39
-+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ StorageLive(_15); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ _15 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ StorageDead(_15); // scope 6 at $DIR/inline-generator.rs:+7:8: +7:8
-+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:+7:8: +7:8
++ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
++ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
++ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ _15 = deref_copy (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:8]); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
++ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:41: 15:41
+ }
+
+ bb8: {
-+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
+ }
+
+ bb9: {
-+ unreachable; // scope 6 at $DIR/inline-generator.rs:+7:5: +7:8
++ unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
}
}
diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff
deleted file mode 100644
index deaba70e0..000000000
--- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.64bit.diff
+++ /dev/null
@@ -1,86 +0,0 @@
-- // MIR for `main` before Inline
-+ // MIR for `main` after Inline
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/inline-into-box-place.rs:+0:11: +0:11
- let _1: std::boxed::Box<std::vec::Vec<u32>>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:9: +1:11
- let mut _2: 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: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
-+ let mut _9: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- 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
-+ }
-
- 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
- // 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>) }
- }
-
- 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
- StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +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: bb4]; // 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
-+ _9 = &mut (*_7); // 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 alloc::raw_vec::RawVec::<u32>::NEW; // 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
-- // + user_ty: UserType(1)
-- // + literal: Const { ty: fn() -> Vec<u32> {Vec::<u32>::new}, val: Value(<ZST>) }
-- }
--
-- 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) }
-+ Deinit((*_9)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).0: alloc::raw_vec::RawVec<u32>) = move _10; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).1: usize) = 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
-+ StorageDead(_9); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- StorageDead(_7); // 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
-- drop(_1) -> [return: bb3, unwind: bb5]; // 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
- }
-
-- 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
- }
-
-- bb4 (cleanup): {
-- StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-- _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)) -> bb5; // 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>) }
-- }
--
-- bb5 (cleanup): {
-+ bb3 (cleanup): {
- resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2
- }
- }
-
diff --git a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff
index deaba70e0..7e017373b 100644
--- a/src/test/mir-opt/inline/inline_into_box_place.main.Inline.32bit.diff
+++ b/src/test/mir-opt/inline/inline_into_box_place.main.Inline.diff
@@ -10,15 +10,14 @@
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: *const std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:29: +1:43
-+ let mut _9: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
++ let mut _8: &mut std::vec::Vec<u32>; // in scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
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
++ let mut _9: alloc::raw_vec::RawVec<u32>; // in scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+ }
bb0: {
@@ -34,13 +33,12 @@
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
- StorageLive(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +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: bb4]; // 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
-+ _9 = &mut (*_7); // 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 alloc::raw_vec::RawVec::<u32>::NEW; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
+- (*_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 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ _9 = 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
- // + user_ty: UserType(1)
@@ -51,16 +49,15 @@
+ // + 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) }
-+ Deinit((*_9)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).0: alloc::raw_vec::RawVec<u32>) = move _10; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
-+ ((*_9).1: usize) = 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
-+ StorageDead(_9); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
- StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
++ Deinit((*_8)); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ ((*_8).0: alloc::raw_vec::RawVec<u32>) = move _9; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ ((*_8).1: usize) = const 0_usize; // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ StorageDead(_9); // scope 3 at $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
++ 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
-- drop(_1) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/inline-into-box-place.rs:+2:1: +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
}
@@ -71,16 +68,15 @@
}
- bb4 (cleanup): {
-- StorageDead(_7); // scope 0 at $DIR/inline-into-box-place.rs:+1:33: +1:43
-- _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)) -> bb5; // 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>) }
++ bb3 (cleanup): {
+ resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2
- }
-
- bb5 (cleanup): {
-+ bb3 (cleanup): {
- resume; // scope 0 at $DIR/inline-into-box-place.rs:+0:1: +2:2
+- _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>) }
}
}
diff --git a/src/test/mir-opt/inline/inline_options.main.Inline.after.mir b/src/test/mir-opt/inline/inline_options.main.Inline.after.mir
index 275493066..361b02715 100644
--- a/src/test/mir-opt/inline/inline_options.main.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_options.main.Inline.after.mir
@@ -5,9 +5,9 @@ fn main() -> () {
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:+8:23: +8:26
- let _4: (); // in scope 1 at $DIR/inline-options.rs:+8:28: +8:31
- let _5: (); // in scope 1 at $DIR/inline-options.rs:+8:33: +8:36
+ 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
}
bb0: {
@@ -21,33 +21,33 @@ fn main() -> () {
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:+8:23: +8:26
- _3 = g() -> bb2; // scope 1 at $DIR/inline-options.rs:+8:23: +8:26
+ 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
// mir::Constant
// + span: $DIR/inline-options.rs:16:23: 16:24
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
}
bb2: {
- StorageDead(_3); // scope 1 at $DIR/inline-options.rs:+8:26: +8:27
- StorageLive(_4); // scope 1 at $DIR/inline-options.rs:+8:28: +8:31
- _4 = g() -> bb3; // scope 1 at $DIR/inline-options.rs:+8:28: +8:31
+ 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>) }
}
bb3: {
- StorageDead(_4); // scope 1 at $DIR/inline-options.rs:+8:31: +8:32
- StorageLive(_5); // scope 1 at $DIR/inline-options.rs:+8:33: +8:36
- _5 = g() -> bb4; // scope 1 at $DIR/inline-options.rs:+8:33: +8:36
+ 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
// mir::Constant
// + span: $DIR/inline-options.rs:16:33: 16:34
// + literal: Const { ty: fn() {g}, val: Value(<ZST>) }
}
bb4: {
- StorageDead(_5); // scope 1 at $DIR/inline-options.rs:+8:36: +8:37
+ 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
diff --git a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
index 768608564..169e7f5c5 100644
--- a/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_retag.bar.Inline.after.mir
@@ -2,8 +2,8 @@
fn bar() -> bool {
let mut _0: bool; // return place in scope 0 at $DIR/inline-retag.rs:+0:13: +0:17
- let _1: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+1:9: +1:10
- let mut _2: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+2:5: +2:6
+ let _1: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+1:9: +1:10
+ let mut _2: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}; // in scope 0 at $DIR/inline-retag.rs:+2:5: +2:6
let mut _3: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:7: +2:9
let _4: &i32; // in scope 0 at $DIR/inline-retag.rs:+2:7: +2:9
let _5: i32; // in scope 0 at $DIR/inline-retag.rs:+2:8: +2:9
@@ -15,10 +15,10 @@ fn bar() -> bool {
let mut _9: &i32; // in scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
let mut _10: &i32; // in scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
scope 2 (inlined foo) { // at $DIR/inline-retag.rs:12:5: 12:15
- debug x => _3; // in scope 2 at $DIR/inline-retag.rs:+6:8: +6:9
- debug y => _6; // in scope 2 at $DIR/inline-retag.rs:+6:17: +6:18
- let mut _11: i32; // in scope 2 at $DIR/inline-retag.rs:+7:5: +7:7
- let mut _12: i32; // in scope 2 at $DIR/inline-retag.rs:+7:11: +7:13
+ debug x => _3; // in scope 2 at $DIR/inline-retag.rs:16:8: 16:9
+ debug y => _6; // in scope 2 at $DIR/inline-retag.rs:16:17: 16:18
+ let mut _11: i32; // in scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ let mut _12: i32; // in scope 2 at $DIR/inline-retag.rs:17:11: 17:13
}
}
@@ -27,12 +27,12 @@ fn bar() -> bool {
_1 = foo; // scope 0 at $DIR/inline-retag.rs:+1:13: +1:16
// mir::Constant
// + span: $DIR/inline-retag.rs:11:13: 11:16
- // + literal: Const { ty: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b> fn(&'a i32, &'b i32) -> bool {foo}, val: Value(<ZST>) }
StorageLive(_2); // scope 1 at $DIR/inline-retag.rs:+2:5: +2:6
_2 = _1; // scope 1 at $DIR/inline-retag.rs:+2:5: +2:6
StorageLive(_3); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
StorageLive(_4); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
- _10 = const bar::promoted[1]; // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
+ _10 = const _; // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
// mir::Constant
// + span: $DIR/inline-retag.rs:12:7: 12:9
// + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[1])) }
@@ -43,7 +43,7 @@ fn bar() -> bool {
Retag(_3); // scope 1 at $DIR/inline-retag.rs:+2:7: +2:9
StorageLive(_6); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
StorageLive(_7); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
- _9 = const bar::promoted[0]; // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
+ _9 = const _; // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
// mir::Constant
// + span: $DIR/inline-retag.rs:12:11: 12:14
// + literal: Const { ty: &i32, val: Unevaluated(bar, [], Some(promoted[0])) }
@@ -52,15 +52,15 @@ fn bar() -> bool {
Retag(_7); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
_6 = &(*_7); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
Retag(_6); // scope 1 at $DIR/inline-retag.rs:+2:11: +2:14
- Retag(_3); // scope 2 at $DIR/inline-retag.rs:+6:1: +8:2
- Retag(_6); // scope 2 at $DIR/inline-retag.rs:+6:1: +8:2
- StorageLive(_11); // scope 2 at $DIR/inline-retag.rs:+7:5: +7:7
- _11 = (*_3); // scope 2 at $DIR/inline-retag.rs:+7:5: +7:7
- StorageLive(_12); // scope 2 at $DIR/inline-retag.rs:+7:11: +7:13
- _12 = (*_6); // scope 2 at $DIR/inline-retag.rs:+7:11: +7:13
- _0 = Eq(move _11, move _12); // scope 2 at $DIR/inline-retag.rs:+7:5: +7:13
- StorageDead(_12); // scope 2 at $DIR/inline-retag.rs:+7:12: +7:13
- StorageDead(_11); // scope 2 at $DIR/inline-retag.rs:+7:12: +7:13
+ Retag(_3); // scope 2 at $DIR/inline-retag.rs:16:8: 16:9
+ Retag(_6); // scope 2 at $DIR/inline-retag.rs:16:17: 16:18
+ StorageLive(_11); // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ _11 = (*_3); // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+ StorageLive(_12); // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+ _12 = (*_6); // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+ _0 = Eq(move _11, move _12); // scope 2 at $DIR/inline-retag.rs:17:5: 17:13
+ StorageDead(_12); // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
+ StorageDead(_11); // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
StorageDead(_6); // scope 1 at $DIR/inline-retag.rs:+2:14: +2:15
StorageDead(_3); // scope 1 at $DIR/inline-retag.rs:+2:14: +2:15
StorageDead(_2); // scope 1 at $DIR/inline-retag.rs:+2:14: +2:15
diff --git a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff b/src/test/mir-opt/inline/inline_shims.clone.Inline.diff
index 25ca05893..d691e90b7 100644
--- a/src/test/mir-opt/inline/inline_shims.clone.Inline.diff
+++ b/src/test/mir-opt/inline/inline_shims.clone.Inline.diff
@@ -14,7 +14,7 @@
- _0 = <fn(A, B) as Clone>::clone(move _2) -> bb1; // scope 0 at $DIR/inline-shims.rs:+1:5: +1:14
- // mir::Constant
- // + span: $DIR/inline-shims.rs:6:7: 6:12
-- // + literal: Const { ty: for<'r> fn(&'r fn(A, B)) -> fn(A, B) {<fn(A, B) as Clone>::clone}, val: Value(<ZST>) }
+- // + literal: Const { ty: for<'a> fn(&'a fn(A, B)) -> fn(A, B) {<fn(A, B) as Clone>::clone}, val: Value(<ZST>) }
- }
-
- bb1: {
diff --git a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff b/src/test/mir-opt/inline/inline_specialization.main.Inline.diff
index 106291b36..fdf2a1e1f 100644
--- a/src/test/mir-opt/inline/inline_specialization.main.Inline.diff
+++ b/src/test/mir-opt/inline/inline_specialization.main.Inline.diff
@@ -19,7 +19,7 @@
- }
-
- bb1: {
-+ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:+10:31: +10:34
++ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:14:31: 14: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/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir b/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir
index ed95edd16..89eefc292 100644
--- a/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_trait_method.test.Inline.after.mir
@@ -11,7 +11,7 @@ fn test(_1: &dyn X) -> u32 {
_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
- // + literal: Const { ty: for<'r> fn(&'r dyn X) -> u32 {<dyn X as X>::y}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a dyn X) -> u32 {<dyn X as X>::y}, val: Value(<ZST>) }
}
bb1: {
diff --git a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
index 116ae4e36..3d05869fa 100644
--- a/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
+++ b/src/test/mir-opt/inline/inline_trait_method_2.test2.Inline.after.mir
@@ -6,8 +6,8 @@ fn test2(_1: &dyn X) -> bool {
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:+5:9: +5:10
- let mut _4: &dyn X; // in scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
+ debug x => _2; // in scope 1 at $DIR/inline-trait-method_2.rs:9:9: 9:10
+ let mut _4: &dyn X; // in scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
}
bb0: {
@@ -16,16 +16,16 @@ 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
- StorageLive(_4); // scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
- _4 = _2; // scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
- _0 = <dyn X as X>::y(move _4) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:+6:5: +6:10
+ StorageLive(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
+ _4 = _2; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
+ _0 = <dyn X as X>::y(move _4) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
// mir::Constant
// + span: $DIR/inline-trait-method_2.rs:10:7: 10:8
- // + literal: Const { ty: for<'r> fn(&'r dyn X) -> bool {<dyn X as X>::y}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a dyn X) -> bool {<dyn X as X>::y}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_4); // scope 1 at $DIR/inline-trait-method_2.rs:+6:9: +6:10
+ StorageDead(_4); // scope 1 at $DIR/inline-trait-method_2.rs:10:9: 10:10
StorageDead(_2); // scope 0 at $DIR/inline-trait-method_2.rs:+1:11: +1:12
return; // scope 0 at $DIR/inline-trait-method_2.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
index 4006dd15a..06d442ae8 100644
--- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
+++ b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.b.Inline.after.mir
@@ -21,13 +21,9 @@ fn b(_1: &mut Box<T>) -> &mut T {
_4 = &mut (*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
StorageLive(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageLive(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageLive(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_7 = deref_copy (*_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageLive(_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_8 = (((_7.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_6 = &mut (*_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_8); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_7); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_5 = &mut (*_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_3 = &mut (*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
StorageDead(_6); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
diff --git a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
index e516269c1..d5f06c54a 100644
--- a/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
+++ b/src/test/mir-opt/inline/issue_58867_inline_as_ref_as_mut.d.Inline.after.mir
@@ -15,13 +15,9 @@ fn d(_1: &Box<T>) -> &T {
StorageLive(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
StorageLive(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
_3 = &(*_1); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
- StorageLive(_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_4 = deref_copy (*_3); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageLive(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_5 = (((_4.0: std::ptr::Unique<T>).0: std::ptr::NonNull<T>).0: *const T); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_2 = &(*_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_5); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
- StorageDead(_4); // scope 1 at $SRC_DIR/alloc/src/boxed.rs:LL:COL
_0 = &(*_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:5: +1:15
StorageDead(_3); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+1:14: +1:15
StorageDead(_2); // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:+2:1: +2:2
diff --git a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff b/src/test/mir-opt/inline/issue_78442.bar.Inline.diff
index c16dfdf39..4186650df 100644
--- a/src/test/mir-opt/inline/issue_78442.bar.Inline.diff
+++ b/src/test/mir-opt/inline/issue_78442.bar.Inline.diff
@@ -29,7 +29,7 @@
- _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
- // mir::Constant
- // + span: $DIR/issue-78442.rs:11:5: 11:15
-- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(<ZST>) }
+- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(<ZST>) }
+ _2 = move (*_3)() -> [return: bb5, unwind: bb3]; // scope 1 at $SRC_DIR/core/src/ops/function.rs:LL:COL
}
diff --git a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff b/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff
index 0faa522cb..24e9a3df1 100644
--- a/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff
+++ b/src/test/mir-opt/inline/issue_78442.bar.RevealAll.diff
@@ -29,8 +29,8 @@
+ _2 = <fn() {foo} as Fn<()>>::call(move _3, move _5) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-78442.rs:+4:5: +4:17
// mir::Constant
// + span: $DIR/issue-78442.rs:11:5: 11:15
-- // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
-+ // + literal: Const { ty: for<'r> extern "rust-call" fn(&'r fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(<ZST>) }
+- // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a impl Fn(), ()) -> <impl Fn() as FnOnce<()>>::Output {<impl Fn() as Fn<()>>::call}, val: Value(<ZST>) }
++ // + literal: Const { ty: for<'a> extern "rust-call" fn(&'a fn() {foo}, ()) -> <fn() {foo} as FnOnce<()>>::Output {<fn() {foo} as Fn<()>>::call}, val: Value(<ZST>) }
}
bb2: {
diff --git a/src/test/mir-opt/inline/polymorphic-recursion.rs b/src/test/mir-opt/inline/polymorphic-recursion.rs
new file mode 100644
index 000000000..7388722b7
--- /dev/null
+++ b/src/test/mir-opt/inline/polymorphic-recursion.rs
@@ -0,0 +1,25 @@
+// Make sure that the MIR inliner does not loop indefinitely on polymorphic recursion.
+// compile-flags: --crate-type lib
+
+// Randomize `def_path_hash` by defining them under a module with different names
+macro_rules! emit {
+ ($($m:ident)*) => {$(
+ pub mod $m {
+ pub trait Tr { type Next: Tr; }
+
+ pub fn hoge<const N: usize, T: Tr>() {
+ inner::<N, T>();
+ }
+
+ #[inline(always)]
+ fn inner<const N: usize, T: Tr>()
+ {
+ inner::<N, T::Next>();
+ inner::<N, T::Next>();
+ }
+ }
+ )*};
+}
+
+// Increase the chance of triggering the bug
+emit!(m00 m01 m02 m03 m04 m05 m06 m07 m08 m09 m10 m11 m12 m13 m14 m15 m16 m17 m18 m19);
diff --git a/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff b/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff
index b78ef36ea..a3cee3ecf 100644
--- a/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff
+++ b/src/test/mir-opt/instrument_coverage.bar.InstrumentCoverage.diff
@@ -5,7 +5,7 @@
let mut _0: bool; // return place in scope 0 at /the/src/instrument_coverage.rs:+0:13: +0:17
bb0: {
-+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:19:1 - 21:2; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
++ Coverage::Counter(1) for /the/src/instrument_coverage.rs:20:1 - 22:2; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
_0 = const true; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +1:9
return; // scope 0 at /the/src/instrument_coverage.rs:+2:2: +2:2
}
diff --git a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff b/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
index 0490c0df2..81d552823 100644
--- a/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
+++ b/src/test/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
@@ -8,12 +8,12 @@
let mut _3: !; // in scope 0 at /the/src/instrument_coverage.rs:+2:18: +4:10
bb0: {
-+ Coverage::Counter(1) for /the/src/instrument_coverage.rs:10:1 - 10:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
++ Coverage::Counter(1) for /the/src/instrument_coverage.rs:11:1 - 11:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
}
bb1: {
-+ Coverage::Expression(4294967295) = 1 + 2 for /the/src/instrument_coverage.rs:11:5 - 12:17; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
++ Coverage::Expression(4294967295) = 1 + 2 for /the/src/instrument_coverage.rs:12:5 - 13:17; // 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
}
@@ -21,7 +21,7 @@
StorageLive(_2); // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
_2 = bar() -> [return: bb3, unwind: bb6]; // scope 0 at /the/src/instrument_coverage.rs:+2:12: +2:17
// mir::Constant
- // + span: /the/src/instrument_coverage.rs:12:12: 12:15
+ // + span: /the/src/instrument_coverage.rs:13:12: 13:15
// + literal: Const { ty: fn() -> bool {bar}, val: Value(<ZST>) }
}
@@ -30,15 +30,15 @@
}
bb4: {
-+ Coverage::Expression(4294967293) = 4294967294 + 0 for /the/src/instrument_coverage.rs:16:1 - 16:2; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
-+ Coverage::Expression(4294967294) = 4294967295 - 2 for /the/src/instrument_coverage.rs:13:13 - 13:18; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
++ Coverage::Expression(4294967293) = 4294967294 + 0 for /the/src/instrument_coverage.rs:17:1 - 17:2; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
++ Coverage::Expression(4294967294) = 4294967295 - 2 for /the/src/instrument_coverage.rs:14:13 - 14:18; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
_0 = const (); // scope 0 at /the/src/instrument_coverage.rs:+3:13: +3:18
StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
return; // scope 0 at /the/src/instrument_coverage.rs:+6:2: +6:2
}
bb5: {
-+ Coverage::Counter(2) for /the/src/instrument_coverage.rs:14:10 - 14:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
++ Coverage::Counter(2) for /the/src/instrument_coverage.rs:15:10 - 15:11; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
_1 = const (); // scope 0 at /the/src/instrument_coverage.rs:+4:10: +4:10
StorageDead(_2); // scope 0 at /the/src/instrument_coverage.rs:+4:9: +4:10
goto -> bb1; // scope 0 at /the/src/instrument_coverage.rs:+1:5: +5:6
diff --git a/src/test/mir-opt/instrument_coverage.rs b/src/test/mir-opt/instrument_coverage.rs
index a748f2c5c..7f6a0a0eb 100644
--- a/src/test/mir-opt/instrument_coverage.rs
+++ b/src/test/mir-opt/instrument_coverage.rs
@@ -1,6 +1,7 @@
// Test that `-C instrument-coverage` injects Coverage statements. The Coverage Counter statements
// are later converted into LLVM instrprof.increment intrinsics, during codegen.
+// unit-test: InstrumentCoverage
// needs-profiler-support
// ignore-windows
// compile-flags: -C instrument-coverage --remap-path-prefix={{src-base}}=/the/src
diff --git a/src/test/mir-opt/issue-101867.rs b/src/test/mir-opt/issue-101867.rs
new file mode 100644
index 000000000..8a357eb79
--- /dev/null
+++ b/src/test/mir-opt/issue-101867.rs
@@ -0,0 +1,7 @@
+// EMIT_MIR issue_101867.main.mir_map.0.mir
+fn main() {
+ let x: Option<u8> = Some(1);
+ let Some(y) = x else {
+ panic!();
+ };
+}
diff --git a/src/test/mir-opt/issue-101973.rs b/src/test/mir-opt/issue-101973.rs
new file mode 100644
index 000000000..216659a23
--- /dev/null
+++ b/src/test/mir-opt/issue-101973.rs
@@ -0,0 +1,20 @@
+// compile-flags: -O -C debug-assertions=on
+// This needs inlining followed by ConstProp to reproduce, so we cannot use "unit-test".
+
+#[inline]
+pub fn imm8(x: u32) -> u32 {
+ let mut out = 0u32;
+ out |= (x >> 0) & 0xff;
+ out
+}
+
+// EMIT_MIR issue_101973.inner.ConstProp.diff
+#[inline(never)]
+pub fn inner(fields: u32) -> i64 {
+ imm8(fields).rotate_right(((fields >> 8) & 0xf) << 1) as i32 as i64
+}
+
+fn main() {
+ let val = inner(0xe32cf20f);
+ assert_eq!(val as u64, 0xfffffffff0000000);
+}
diff --git a/src/test/mir-opt/issue-41697.rs b/src/test/mir-opt/issue-41697.rs
index 5c34d8e68..cbd8633a3 100644
--- a/src/test/mir-opt/issue-41697.rs
+++ b/src/test/mir-opt/issue-41697.rs
@@ -13,7 +13,7 @@ trait Foo {
fn get(&self) -> [u8; 2];
}
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir
impl Foo for [u8; 1+1] {
fn get(&self) -> [u8; 2] {
diff --git a/src/test/mir-opt/issue-72181.rs b/src/test/mir-opt/issue-72181.rs
index 844d53a4b..ebb5f5042 100644
--- a/src/test/mir-opt/issue-72181.rs
+++ b/src/test/mir-opt/issue-72181.rs
@@ -11,14 +11,14 @@ union Foo {
b: Never
}
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR issue_72181.foo.mir_map.0.mir
fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 }
// EMIT_MIR issue_72181.bar.mir_map.0.mir
fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x }
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR issue_72181.main.mir_map.0.mir
fn main() {
let _ = mem::size_of::<Foo>();
diff --git a/src/test/mir-opt/issue-73223.rs b/src/test/mir-opt/issue-73223.rs
index 703b87612..be114cab7 100644
--- a/src/test/mir-opt/issue-73223.rs
+++ b/src/test/mir-opt/issue-73223.rs
@@ -8,6 +8,5 @@ fn main() {
assert_eq!(split, 1);
}
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR issue_73223.main.SimplifyArmIdentity.diff
-// EMIT_MIR issue_73223.main.PreCodegen.diff
diff --git a/src/test/mir-opt/issue-91633.rs b/src/test/mir-opt/issue-91633.rs
new file mode 100644
index 000000000..8f6601985
--- /dev/null
+++ b/src/test/mir-opt/issue-91633.rs
@@ -0,0 +1,31 @@
+// compile-flags: -Z mir-opt-level=0
+// EMIT_MIR issue_91633.hey.mir_map.0.mir
+fn hey<T> (it: &[T])
+ where
+ [T] : std::ops::Index<usize>,
+ {
+ let _ = &it[0];
+ }
+
+// EMIT_MIR issue_91633.bar.mir_map.0.mir
+fn bar<T> (it: Box<[T]>)
+ where
+ [T] : std::ops::Index<usize>,
+ {
+ let _ = it[0];
+ }
+
+// EMIT_MIR issue_91633.fun.mir_map.0.mir
+fn fun<T> (it: &[T]) -> &T
+ {
+ let f = &it[0];
+ f
+ }
+
+// EMIT_MIR issue_91633.foo.mir_map.0.mir
+fn foo<T: Clone> (it: Box<[T]>) -> T
+ {
+ let f = it[0].clone();
+ f
+ }
+ fn main(){}
diff --git a/src/test/mir-opt/issue_101867.main.mir_map.0.mir b/src/test/mir-opt/issue_101867.main.mir_map.0.mir
new file mode 100644
index 000000000..42a9e5587
--- /dev/null
+++ b/src/test/mir-opt/issue_101867.main.mir_map.0.mir
@@ -0,0 +1,75 @@
+// MIR for `main` 0 mir_map
+
+| 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>
+|
+fn main() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/issue-101867.rs:+0:11: +0:11
+ let _1: std::option::Option<u8> as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/issue-101867.rs:+1:9: +1:10
+ let mut _2: !; // in scope 0 at $DIR/issue-101867.rs:+2:26: +4:6
+ let _3: (); // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
+ let mut _4: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
+ let mut _6: isize; // in scope 0 at $DIR/issue-101867.rs:+2:9: +2:16
+ scope 1 {
+ debug x => _1; // in scope 1 at $DIR/issue-101867.rs:+1:9: +1:10
+ let _5: u8; // in scope 1 at $DIR/issue-101867.rs:+2:14: +2:15
+ scope 2 {
+ debug y => _5; // in scope 2 at $DIR/issue-101867.rs:+2:14: +2:15
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/issue-101867.rs:+1:9: +1:10
+ _1 = Option::<u8>::Some(const 1_u8); // scope 0 at $DIR/issue-101867.rs:+1:25: +1:32
+ FakeRead(ForLet(None), _1); // scope 0 at $DIR/issue-101867.rs:+1:9: +1:10
+ AscribeUserType(_1, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 0 at $DIR/issue-101867.rs:+1:12: +1:22
+ StorageLive(_5); // scope 1 at $DIR/issue-101867.rs:+2:14: +2:15
+ FakeRead(ForMatchedPlace(None), _1); // scope 1 at $DIR/issue-101867.rs:+2:19: +2:20
+ _6 = discriminant(_1); // scope 1 at $DIR/issue-101867.rs:+2:19: +2:20
+ switchInt(move _6) -> [1_isize: bb4, otherwise: bb3]; // scope 1 at $DIR/issue-101867.rs:+2:9: +2:16
+ }
+
+ bb1: {
+ StorageLive(_3); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
+ StorageLive(_4); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
+ _4 = begin_panic::<&str>(const "explicit panic") -> bb7; // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
+ // mir::Constant
+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL
+ // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
+ // mir::Constant
+ // + span: $SRC_DIR/std/src/panic.rs:LL:COL
+ // + literal: Const { ty: &str, val: Value(Slice(..)) }
+ }
+
+ bb2: {
+ StorageDead(_4); // scope 1 at $SRC_DIR/std/src/panic.rs:LL:COL
+ StorageDead(_3); // scope 1 at $DIR/issue-101867.rs:+3:16: +3:17
+ unreachable; // scope 1 at $DIR/issue-101867.rs:+2:26: +4:6
+ }
+
+ bb3: {
+ goto -> bb6; // scope 1 at $DIR/issue-101867.rs:+2:19: +2:20
+ }
+
+ bb4: {
+ falseEdge -> [real: bb5, imaginary: bb3]; // scope 1 at $DIR/issue-101867.rs:+2:9: +2:16
+ }
+
+ bb5: {
+ _5 = ((_1 as Some).0: u8); // scope 1 at $DIR/issue-101867.rs:+2:14: +2:15
+ _0 = const (); // scope 0 at $DIR/issue-101867.rs:+0:11: +5:2
+ StorageDead(_5); // scope 1 at $DIR/issue-101867.rs:+5:1: +5:2
+ StorageDead(_1); // scope 0 at $DIR/issue-101867.rs:+5:1: +5:2
+ return; // scope 0 at $DIR/issue-101867.rs:+5:2: +5:2
+ }
+
+ bb6: {
+ StorageDead(_5); // scope 1 at $DIR/issue-101867.rs:+5:1: +5:2
+ goto -> bb1; // scope 0 at $DIR/issue-101867.rs:+0:11: +5:2
+ }
+
+ bb7 (cleanup): {
+ resume; // scope 0 at $DIR/issue-101867.rs:+0:1: +5:2
+ }
+}
diff --git a/src/test/mir-opt/issue_101973.inner.ConstProp.diff b/src/test/mir-opt/issue_101973.inner.ConstProp.diff
new file mode 100644
index 000000000..281afe4be
--- /dev/null
+++ b/src/test/mir-opt/issue_101973.inner.ConstProp.diff
@@ -0,0 +1,100 @@
+- // MIR for `inner` before ConstProp
++ // MIR for `inner` after ConstProp
+
+ fn inner(_1: u32) -> i64 {
+ debug fields => _1; // in scope 0 at $DIR/issue-101973.rs:+0:14: +0:20
+ let mut _0: i64; // return place in scope 0 at $DIR/issue-101973.rs:+0:30: +0:33
+ let mut _2: i32; // in scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
+ let mut _3: u32; // in scope 0 at $DIR/issue-101973.rs:+1:5: +1:58
+ let mut _4: u32; // in scope 0 at $DIR/issue-101973.rs:+1:5: +1:17
+ let mut _5: u32; // in scope 0 at $DIR/issue-101973.rs:+1:10: +1:16
+ let mut _6: u32; // in scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
+ let mut _7: u32; // in scope 0 at $DIR/issue-101973.rs:+1:31: +1:52
+ let mut _8: u32; // in scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
+ let mut _9: u32; // in scope 0 at $DIR/issue-101973.rs:+1:33: +1:39
+ let mut _10: (u32, 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 => _5; // 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; // in scope 1 at $DIR/issue-101973.rs:7:13: 7:14
+ let mut _15: (u32, bool); // in scope 1 at $DIR/issue-101973.rs:7:12: 7:20
+ scope 2 {
+ debug out => _4; // in scope 2 at $DIR/issue-101973.rs:6:9: 6:16
+ }
+ }
+ scope 3 (inlined core::num::<impl u32>::rotate_right) { // at $DIR/issue-101973.rs:14:5: 14: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
+ let mut _16: u32; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ let mut _17: u32; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
+ StorageLive(_3); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:58
+ StorageLive(_4); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:17
+ StorageLive(_5); // scope 0 at $DIR/issue-101973.rs:+1:10: +1:16
+ _5 = _1; // scope 0 at $DIR/issue-101973.rs:+1:10: +1:16
+ _4 = const 0_u32; // scope 1 at $DIR/issue-101973.rs:6:19: 6:23
+ 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
+ StorageLive(_14); // scope 2 at $DIR/issue-101973.rs:7:13: 7:14
+ _14 = _5; // scope 2 at $DIR/issue-101973.rs:7:13: 7:14
+ _15 = CheckedShr(_14, const 0_i32); // scope 2 at $DIR/issue-101973.rs:7:12: 7:20
+ assert(!move (_15.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
+ }
+
+ bb1: {
+ _8 = move (_10.0: u32); // scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
+ StorageDead(_9); // scope 0 at $DIR/issue-101973.rs:+1:44: +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
+ }
+
+ bb2: {
+ _6 = move (_11.0: u32); // scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
+ StorageDead(_7); // scope 0 at $DIR/issue-101973.rs:+1:56: +1:57
+ StorageLive(_16); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _16 = _4; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageLive(_17); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _17 = _6; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ _3 = rotate_right::<u32>(move _16, move _17) -> bb4; // 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 (_15.0: u32); // scope 2 at $DIR/issue-101973.rs:7:12: 7:20
+ StorageDead(_14); // scope 2 at $DIR/issue-101973.rs:7:19: 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(_4, 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
+ StorageDead(_5); // scope 0 at $DIR/issue-101973.rs:+1:16: +1:17
+ 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
+ StorageLive(_9); // scope 0 at $DIR/issue-101973.rs:+1:33: +1:39
+ _9 = _1; // scope 0 at $DIR/issue-101973.rs:+1:33: +1:39
+ _10 = CheckedShr(_9, 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(_17); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageDead(_16); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
+ StorageDead(_6); // scope 0 at $DIR/issue-101973.rs:+1:57: +1:58
+ StorageDead(_4); // scope 0 at $DIR/issue-101973.rs:+1:57: +1:58
+ _2 = move _3 as i32 (IntToInt); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
+ StorageDead(_3); // scope 0 at $DIR/issue-101973.rs:+1:64: +1:65
+ _0 = move _2 as i64 (IntToInt); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:72
+ StorageDead(_2); // scope 0 at $DIR/issue-101973.rs:+1:71: +1:72
+ return; // scope 0 at $DIR/issue-101973.rs:+2:2: +2:2
+ }
+ }
+
diff --git a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir
deleted file mode 100644
index 047b24db4..000000000
--- a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.64bit.mir
+++ /dev/null
@@ -1,20 +0,0 @@
-// MIR for `<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}` after SimplifyCfg-promote-consts
-
-<impl at $DIR/issue-41697.rs:18:1: 18:23>::{constant#0}: usize = {
- let mut _0: usize; // return place in scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
- let mut _1: (usize, bool); // in scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
-
- bb0: {
- _1 = CheckedAdd(const 1_usize, const 1_usize); // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
- assert(!move (_1.1: bool), "attempt to compute `{} + {}`, which would overflow", const 1_usize, const 1_usize) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
- }
-
- bb1: {
- _0 = move (_1.0: usize); // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
- return; // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
- }
-
- bb2 (cleanup): {
- resume; // scope 0 at $DIR/issue-41697.rs:+0:19: +0:22
- }
-}
diff --git a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir
index 047b24db4..047b24db4 100644
--- a/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.32bit.mir
+++ b/src/test/mir-opt/issue_41697.{impl#0}-{constant#0}.SimplifyCfg-promote-consts.after.mir
diff --git a/src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir b/src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir
deleted file mode 100644
index 972ce1d50..000000000
--- a/src/test/mir-opt/issue_72181.bar.mir_map.0.64bit.mir
+++ /dev/null
@@ -1,17 +0,0 @@
-// MIR for `bar` 0 mir_map
-
-fn bar(_1: [(Never, u32); 1]) -> u32 {
- let mut _0: u32; // return place in scope 0 at $DIR/issue-72181.rs:+0:40: +0:43
- let _2: u32; // in scope 0 at $DIR/issue-72181.rs:+0:13: +0:14
- scope 1 {
- debug x => _2; // in scope 1 at $DIR/issue-72181.rs:+0:13: +0:14
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue-72181.rs:+0:13: +0:14
- _2 = (_1[0 of 1].1: u32); // scope 0 at $DIR/issue-72181.rs:+0:13: +0:14
- _0 = _2; // scope 1 at $DIR/issue-72181.rs:+0:46: +0:47
- StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:+0:48: +0:49
- return; // scope 0 at $DIR/issue-72181.rs:+0:49: +0:49
- }
-}
diff --git a/src/test/mir-opt/issue_72181.bar.mir_map.0.32bit.mir b/src/test/mir-opt/issue_72181.bar.mir_map.0.mir
index 972ce1d50..972ce1d50 100644
--- a/src/test/mir-opt/issue_72181.bar.mir_map.0.32bit.mir
+++ b/src/test/mir-opt/issue_72181.bar.mir_map.0.mir
diff --git a/src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir b/src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir
deleted file mode 100644
index 534f131ea..000000000
--- a/src/test/mir-opt/issue_72181.foo.mir_map.0.64bit.mir
+++ /dev/null
@@ -1,27 +0,0 @@
-// MIR for `foo` 0 mir_map
-
-fn foo(_1: [(Never, u32); 1]) -> u32 {
- debug xs => _1; // in scope 0 at $DIR/issue-72181.rs:+0:8: +0:10
- let mut _0: u32; // return place in scope 0 at $DIR/issue-72181.rs:+0:34: +0:37
- let _2: usize; // in scope 0 at $DIR/issue-72181.rs:+0:43: +0:44
- let mut _3: usize; // in scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
- let mut _4: bool; // in scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/issue-72181.rs:+0:43: +0:44
- _2 = const 0_usize; // scope 0 at $DIR/issue-72181.rs:+0:43: +0:44
- _3 = Len(_1); // scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
- _4 = Lt(_2, _3); // scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
- assert(move _4, "index out of bounds: the length is {} but the index is {}", move _3, _2) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-72181.rs:+0:40: +0:45
- }
-
- bb1: {
- _0 = (_1[_2].1: u32); // scope 0 at $DIR/issue-72181.rs:+0:40: +0:47
- StorageDead(_2); // scope 0 at $DIR/issue-72181.rs:+0:48: +0:49
- return; // scope 0 at $DIR/issue-72181.rs:+0:49: +0:49
- }
-
- bb2 (cleanup): {
- resume; // scope 0 at $DIR/issue-72181.rs:+0:1: +0:49
- }
-}
diff --git a/src/test/mir-opt/issue_72181.foo.mir_map.0.32bit.mir b/src/test/mir-opt/issue_72181.foo.mir_map.0.mir
index 534f131ea..534f131ea 100644
--- a/src/test/mir-opt/issue_72181.foo.mir_map.0.32bit.mir
+++ b/src/test/mir-opt/issue_72181.foo.mir_map.0.mir
diff --git a/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir b/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir
deleted file mode 100644
index 425906f84..000000000
--- a/src/test/mir-opt/issue_72181.main.mir_map.0.64bit.mir
+++ /dev/null
@@ -1,62 +0,0 @@
-// MIR for `main` 0 mir_map
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue-72181.rs:+0:11: +0:11
- let mut _1: usize; // in scope 0 at $DIR/issue-72181.rs:+1:13: +1:34
- let mut _3: Foo; // in scope 0 at $DIR/issue-72181.rs:+3:14: +3:27
- let mut _4: Foo; // in scope 0 at $DIR/issue-72181.rs:+3:29: +3:42
- let mut _5: u64; // in scope 0 at $DIR/issue-72181.rs:+4:13: +4:30
- let _6: usize; // in scope 0 at $DIR/issue-72181.rs:+4:24: +4:25
- let mut _7: usize; // in scope 0 at $DIR/issue-72181.rs:+4:22: +4:26
- let mut _8: bool; // in scope 0 at $DIR/issue-72181.rs:+4:22: +4:26
- scope 1 {
- let _2: [Foo; 2]; // in scope 1 at $DIR/issue-72181.rs:+3:9: +3:10
- scope 2 {
- debug f => _2; // in scope 2 at $DIR/issue-72181.rs:+3:9: +3:10
- scope 3 {
- }
- scope 4 {
- }
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue-72181.rs:+1:13: +1:34
- _1 = std::mem::size_of::<Foo>() -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-72181.rs:+1:13: +1:34
- // mir::Constant
- // + span: $DIR/issue-72181.rs:24:13: 24:32
- // + literal: Const { ty: fn() -> usize {std::mem::size_of::<Foo>}, val: Value(<ZST>) }
- }
-
- bb1: {
- StorageDead(_1); // scope 0 at $DIR/issue-72181.rs:+1:34: +1:35
- StorageLive(_2); // scope 1 at $DIR/issue-72181.rs:+3:9: +3:10
- StorageLive(_3); // scope 1 at $DIR/issue-72181.rs:+3:14: +3:27
- _3 = Foo { a: const 42_u64 }; // scope 1 at $DIR/issue-72181.rs:+3:14: +3:27
- StorageLive(_4); // scope 1 at $DIR/issue-72181.rs:+3:29: +3:42
- _4 = Foo { a: const 10_u64 }; // scope 1 at $DIR/issue-72181.rs:+3:29: +3:42
- _2 = [move _3, move _4]; // scope 1 at $DIR/issue-72181.rs:+3:13: +3:43
- StorageDead(_4); // scope 1 at $DIR/issue-72181.rs:+3:42: +3:43
- StorageDead(_3); // scope 1 at $DIR/issue-72181.rs:+3:42: +3:43
- FakeRead(ForLet(None), _2); // scope 1 at $DIR/issue-72181.rs:+3:9: +3:10
- StorageLive(_5); // scope 2 at $DIR/issue-72181.rs:+4:13: +4:30
- StorageLive(_6); // scope 4 at $DIR/issue-72181.rs:+4:24: +4:25
- _6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:+4:24: +4:25
- _7 = Len(_2); // scope 4 at $DIR/issue-72181.rs:+4:22: +4:26
- _8 = Lt(_6, _7); // scope 4 at $DIR/issue-72181.rs:+4:22: +4:26
- assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> [success: bb2, unwind: bb3]; // scope 4 at $DIR/issue-72181.rs:+4:22: +4:26
- }
-
- bb2: {
- _5 = (_2[_6].0: u64); // scope 4 at $DIR/issue-72181.rs:+4:22: +4:28
- StorageDead(_6); // scope 2 at $DIR/issue-72181.rs:+4:30: +4:31
- StorageDead(_5); // scope 2 at $DIR/issue-72181.rs:+4:30: +4:31
- _0 = const (); // scope 0 at $DIR/issue-72181.rs:+0:11: +5:2
- StorageDead(_2); // scope 1 at $DIR/issue-72181.rs:+5:1: +5:2
- return; // scope 0 at $DIR/issue-72181.rs:+5:2: +5:2
- }
-
- bb3 (cleanup): {
- resume; // scope 0 at $DIR/issue-72181.rs:+0:1: +5:2
- }
-}
diff --git a/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir b/src/test/mir-opt/issue_72181.main.mir_map.0.mir
index 425906f84..425906f84 100644
--- a/src/test/mir-opt/issue_72181.main.mir_map.0.32bit.mir
+++ b/src/test/mir-opt/issue_72181.main.mir_map.0.mir
diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff
deleted file mode 100644
index be8e86a83..000000000
--- a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff
+++ /dev/null
@@ -1,117 +0,0 @@
-- // MIR for `main` before PreCodegen
-+ // MIR for `main` after PreCodegen
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- let _3: i32; // in scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _6: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _7: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _11: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _12: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _14: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _15: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _16: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _17: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _19: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 1 {
- debug split => _1; // in scope 1 at $DIR/issue-73223.rs:+1:9: +1:14
- let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
- scope 3 {
- debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:+6:9: +6:14
- let _8: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _9: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _20: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 4 {
- debug left_val => _8; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- debug right_val => _9; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _13: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 5 {
- debug kind => _13; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
- }
- }
- }
- scope 2 {
- debug v => _3; // in scope 2 at $DIR/issue-73223.rs:+2:14: +2:15
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
- StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- Deinit(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- StorageLive(_3); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- _3 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- _1 = _3; // scope 2 at $DIR/issue-73223.rs:+2:20: +2:21
- StorageDead(_3); // scope 0 at $DIR/issue-73223.rs:+2:20: +2:21
- StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:+4:6: +4:7
- StorageLive(_4); // scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
- StorageLive(_5); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_6); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _6 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _20 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
- _7 = _20; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Deinit(_5); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- (_5.0: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- (_5.1: &i32) = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_6); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _8 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _9 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _12 = (*_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _11 = Eq(move _12, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _10 = Not(move _11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _10) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb1: {
- StorageLive(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _16 = _8; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _15 = _16; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _18 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _17 = _18; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Deinit(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- discriminant(_19) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _14 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
- }
-
- bb2: {
- StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_5); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_4); // scope 1 at $DIR/issue-73223.rs:+8:1: +8:2
- StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:+8:1: +8:2
- return; // scope 0 at $DIR/issue-73223.rs:+8:2: +8:2
- }
- }
-
diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff
deleted file mode 100644
index be8e86a83..000000000
--- a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff
+++ /dev/null
@@ -1,117 +0,0 @@
-- // MIR for `main` before PreCodegen
-+ // MIR for `main` after PreCodegen
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- let _3: i32; // in scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- let mut _5: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _6: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _7: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _11: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _12: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _14: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _15: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _16: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _17: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _18: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _19: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 1 {
- debug split => _1; // in scope 1 at $DIR/issue-73223.rs:+1:9: +1:14
- let _4: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
- scope 3 {
- debug _prev => _4; // in scope 3 at $DIR/issue-73223.rs:+6:9: +6:14
- let _8: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _9: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _20: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 4 {
- debug left_val => _8; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- debug right_val => _9; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _13: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 5 {
- debug kind => _13; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
- }
- }
- }
- scope 2 {
- debug v => _3; // in scope 2 at $DIR/issue-73223.rs:+2:14: +2:15
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
- StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- Deinit(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- StorageLive(_3); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- _3 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- _1 = _3; // scope 2 at $DIR/issue-73223.rs:+2:20: +2:21
- StorageDead(_3); // scope 0 at $DIR/issue-73223.rs:+2:20: +2:21
- StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:+4:6: +4:7
- StorageLive(_4); // scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
- StorageLive(_5); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_6); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _6 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _20 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
- _7 = _20; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Deinit(_5); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- (_5.0: &i32) = move _6; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- (_5.1: &i32) = move _7; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_7); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_6); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _8 = (_5.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _9 = (_5.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _12 = (*_8); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _11 = Eq(move _12, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _10 = Not(move _11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _10) -> [false: bb2, otherwise: bb1]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb1: {
- StorageLive(_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_15); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_16); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _16 = _8; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _15 = _16; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_17); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _18 = _9; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _17 = _18; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Deinit(_19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- discriminant(_19) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _14 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _15, move _17, move _19); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
- }
-
- bb2: {
- StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_5); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_4); // scope 1 at $DIR/issue-73223.rs:+8:1: +8:2
- StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:+8:1: +8:2
- return; // scope 0 at $DIR/issue-73223.rs:+8:2: +8:2
- }
- }
-
diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff
deleted file mode 100644
index 50948180f..000000000
--- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff
+++ /dev/null
@@ -1,157 +0,0 @@
-- // MIR for `main` before SimplifyArmIdentity
-+ // MIR for `main` after SimplifyArmIdentity
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/issue-73223.rs:+0:11: +0:11
- let _1: i32; // in scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
- let mut _2: std::option::Option<i32>; // in scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- let mut _3: isize; // in scope 0 at $DIR/issue-73223.rs:+2:9: +2:16
- let _4: i32; // in scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- let mut _5: !; // in scope 0 at $DIR/issue-73223.rs:+3:17: +3:23
- let mut _7: i32; // in scope 0 at $DIR/issue-73223.rs:+6:22: +6:27
- let _8: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _9: (&i32, &i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _10: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _11: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _12: i32; // in scope 0 at $DIR/issue-73223.rs:+7:23: +7:24
- let mut _15: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _16: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _17: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _18: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _19: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _21: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _22: core::panicking::AssertKind; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _23: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _24: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _25: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _26: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _27: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 1 {
- debug split => _1; // in scope 1 at $DIR/issue-73223.rs:+1:9: +1:14
- let _6: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
- scope 3 {
- debug _prev => _6; // in scope 3 at $DIR/issue-73223.rs:+6:9: +6:14
- let _13: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _14: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _28: &i32; // in scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 4 {
- debug left_val => _13; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- debug right_val => _14; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let _20: core::panicking::AssertKind; // in scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- scope 5 {
- debug kind => _20; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
- }
- }
- }
- scope 2 {
- debug v => _4; // in scope 2 at $DIR/issue-73223.rs:+2:14: +2:15
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:+1:9: +1:14
- StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- Deinit(_2); // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- ((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- _3 = const 1_isize; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- goto -> bb2; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
- }
-
- bb1: {
- nop; // scope 0 at $DIR/issue-73223.rs:+3:17: +3:23
- StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:+4:6: +4:7
- StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:+8:1: +8:2
- return; // scope 0 at $DIR/issue-73223.rs:+8:2: +8:2
- }
-
- bb2: {
- StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- _4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
- _1 = _4; // scope 2 at $DIR/issue-73223.rs:+2:20: +2:21
- StorageDead(_4); // scope 0 at $DIR/issue-73223.rs:+2:20: +2:21
- StorageDead(_2); // scope 0 at $DIR/issue-73223.rs:+4:6: +4:7
- StorageLive(_6); // scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
- StorageLive(_7); // scope 1 at $DIR/issue-73223.rs:+6:22: +6:27
- _7 = _1; // scope 1 at $DIR/issue-73223.rs:+6:22: +6:27
- Deinit(_6); // scope 1 at $DIR/issue-73223.rs:+6:17: +6:28
- ((_6 as Some).0: i32) = move _7; // scope 1 at $DIR/issue-73223.rs:+6:17: +6:28
- discriminant(_6) = 1; // scope 1 at $DIR/issue-73223.rs:+6:17: +6:28
- StorageDead(_7); // scope 1 at $DIR/issue-73223.rs:+6:27: +6:28
- StorageLive(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _10 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _28 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
- _11 = _28; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Deinit(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- (_9.0: &i32) = move _10; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- (_9.1: &i32) = move _11; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _13 = (_9.0: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _14 = (_9.1: &i32); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _17 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _18 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _16 = Eq(move _17, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- }
-
- bb3: {
- StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_21); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_22); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _22 = const core::panicking::AssertKind::Eq; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
- StorageLive(_23); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_24); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _24 = _13; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _23 = _24; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_25); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_26); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _26 = _14; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _25 = _26; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageLive(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- Deinit(_27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- discriminant(_27) = 0; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _21 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) }
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
- }
-
- bb4: {
- nop; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_13); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_9); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_8); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- nop; // scope 0 at $DIR/issue-73223.rs:+0:11: +8:2
- StorageDead(_6); // scope 1 at $DIR/issue-73223.rs:+8:1: +8:2
- StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:+8:1: +8:2
- return; // scope 0 at $DIR/issue-73223.rs:+8:2: +8:2
- }
- }
-
diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff
index 50948180f..269e4e326 100644
--- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff
+++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.diff
@@ -25,7 +25,7 @@
let _24: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _25: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _26: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _27: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ let mut _27: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 1 {
debug split => _1; // in scope 1 at $DIR/issue-73223.rs:+1:9: +1:14
let _6: std::option::Option<i32>; // in scope 1 at $DIR/issue-73223.rs:+6:9: +6:14
@@ -55,7 +55,7 @@
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
_3 = const 1_isize; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
- goto -> bb2; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
+ goto -> bb3; // scope 0 at $DIR/issue-73223.rs:+1:17: +1:30
}
bb1: {
@@ -66,6 +66,10 @@
}
bb2: {
+ unreachable; // scope 0 at $DIR/issue-73223.rs:+1:23: +1:30
+ }
+
+ bb3: {
StorageLive(_4); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
_4 = ((_2 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:+2:14: +2:15
_1 = _4; // scope 2 at $DIR/issue-73223.rs:+2:20: +2:21
@@ -83,7 +87,7 @@
StorageLive(_10); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_10 = &_1; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_11); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _28 = const main::promoted[0]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _28 = const _; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
@@ -108,10 +112,10 @@
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- switchInt(move _15) -> [false: bb4, otherwise: bb3]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ switchInt(move _15) -> [false: bb5, otherwise: bb4]; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
- bb3: {
+ bb4: {
StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Deinit(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
discriminant(_20) = 0; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
@@ -135,13 +139,13 @@
_21 = core::panicking::assert_failed::<i32, i32>(const core::panicking::AssertKind::Eq, move _23, move _25, move _27); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r i32, &'s i32, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a i32, &'b i32, Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<i32, i32>}, val: Value(<ZST>) }
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: core::panicking::AssertKind, val: Value(Scalar(0x00)) }
}
- bb4: {
+ bb5: {
nop; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_14); // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
diff --git a/src/test/mir-opt/issue_91633.bar.mir_map.0.mir b/src/test/mir-opt/issue_91633.bar.mir_map.0.mir
new file mode 100644
index 000000000..625f6c736
--- /dev/null
+++ b/src/test/mir-opt/issue_91633.bar.mir_map.0.mir
@@ -0,0 +1,39 @@
+// MIR for `bar` 0 mir_map
+
+fn bar(_1: Box<[T]>) -> () {
+ debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:12: +0:14
+ let mut _0: (); // return place in scope 0 at $DIR/issue-91633.rs:+1:2: +1:2
+ let mut _2: &<[T] as std::ops::Index<usize>>::Output; // in scope 0 at $DIR/issue-91633.rs:+4:14: +4:19
+ let mut _3: &[T]; // in scope 0 at $DIR/issue-91633.rs:+4:14: +4:16
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-91633.rs:+4:14: +4:19
+ StorageLive(_3); // scope 0 at $DIR/issue-91633.rs:+4:14: +4:16
+ _3 = &(*_1); // scope 0 at $DIR/issue-91633.rs:+4:14: +4:16
+ _2 = <[T] as Index<usize>>::index(move _3, const 0_usize) -> [return: bb1, unwind: bb3]; // scope 0 at $DIR/issue-91633.rs:+4:14: +4:19
+ // mir::Constant
+ // + span: $DIR/issue-91633.rs:15:14: 15:19
+ // + literal: Const { ty: for<'a> fn(&'a [T], usize) -> &'a <[T] as Index<usize>>::Output {<[T] as Index<usize>>::index}, val: Value(<ZST>) }
+ }
+
+ bb1: {
+ StorageDead(_3); // scope 0 at $DIR/issue-91633.rs:+4:18: +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
+ }
+
+ bb2: {
+ return; // scope 0 at $DIR/issue-91633.rs:+5:3: +5:3
+ }
+
+ bb3 (cleanup): {
+ drop(_1) -> bb4; // scope 0 at $DIR/issue-91633.rs:+5:2: +5:3
+ }
+
+ bb4 (cleanup): {
+ resume; // scope 0 at $DIR/issue-91633.rs:+0:1: +5:3
+ }
+}
diff --git a/src/test/mir-opt/issue_91633.foo.mir_map.0.mir b/src/test/mir-opt/issue_91633.foo.mir_map.0.mir
new file mode 100644
index 000000000..9903e203a
--- /dev/null
+++ b/src/test/mir-opt/issue_91633.foo.mir_map.0.mir
@@ -0,0 +1,57 @@
+// MIR for `foo` 0 mir_map
+
+fn foo(_1: Box<[T]>) -> T {
+ debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:19: +0:21
+ let mut _0: T; // return place in scope 0 at $DIR/issue-91633.rs:+0:36: +0:37
+ let _2: T; // in scope 0 at $DIR/issue-91633.rs:+2:10: +2:11
+ let mut _3: &T; // in scope 0 at $DIR/issue-91633.rs:+2:14: +2:27
+ let _4: usize; // in scope 0 at $DIR/issue-91633.rs:+2:17: +2:18
+ let mut _5: usize; // in scope 0 at $DIR/issue-91633.rs:+2:14: +2:19
+ let mut _6: bool; // in scope 0 at $DIR/issue-91633.rs:+2:14: +2:19
+ scope 1 {
+ debug f => _2; // in scope 1 at $DIR/issue-91633.rs:+2:10: +2:11
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-91633.rs:+2:10: +2:11
+ StorageLive(_3); // scope 0 at $DIR/issue-91633.rs:+2:14: +2:27
+ StorageLive(_4); // scope 0 at $DIR/issue-91633.rs:+2:17: +2:18
+ _4 = const 0_usize; // scope 0 at $DIR/issue-91633.rs:+2:17: +2:18
+ _5 = Len((*_1)); // scope 0 at $DIR/issue-91633.rs:+2:14: +2:19
+ _6 = Lt(_4, _5); // scope 0 at $DIR/issue-91633.rs:+2:14: +2:19
+ assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, _4) -> [success: bb1, unwind: bb5]; // scope 0 at $DIR/issue-91633.rs:+2:14: +2:19
+ }
+
+ bb1: {
+ _3 = &(*_1)[_4]; // scope 0 at $DIR/issue-91633.rs:+2:14: +2:27
+ _2 = <T as Clone>::clone(move _3) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/issue-91633.rs:+2:14: +2:27
+ // mir::Constant
+ // + span: $DIR/issue-91633.rs:28:20: 28:25
+ // + literal: Const { ty: for<'a> fn(&'a T) -> T {<T as Clone>::clone}, val: Value(<ZST>) }
+ }
+
+ bb2: {
+ StorageDead(_3); // scope 0 at $DIR/issue-91633.rs:+2:26: +2:27
+ FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue-91633.rs:+2:10: +2:11
+ StorageDead(_4); // scope 0 at $DIR/issue-91633.rs:+2:27: +2:28
+ _0 = move _2; // scope 1 at $DIR/issue-91633.rs:+3:6: +3:7
+ drop(_2) -> [return: bb3, unwind: bb5]; // scope 0 at $DIR/issue-91633.rs:+4:2: +4:3
+ }
+
+ bb3: {
+ StorageDead(_2); // scope 0 at $DIR/issue-91633.rs:+4:2: +4:3
+ drop(_1) -> [return: bb4, unwind: bb6]; // scope 0 at $DIR/issue-91633.rs:+4:2: +4:3
+ }
+
+ bb4: {
+ return; // scope 0 at $DIR/issue-91633.rs:+4:3: +4:3
+ }
+
+ bb5 (cleanup): {
+ drop(_1) -> bb6; // scope 0 at $DIR/issue-91633.rs:+4:2: +4:3
+ }
+
+ bb6 (cleanup): {
+ resume; // scope 0 at $DIR/issue-91633.rs:+0:1: +4:3
+ }
+}
diff --git a/src/test/mir-opt/issue_91633.fun.mir_map.0.mir b/src/test/mir-opt/issue_91633.fun.mir_map.0.mir
new file mode 100644
index 000000000..ded9a4cf7
--- /dev/null
+++ b/src/test/mir-opt/issue_91633.fun.mir_map.0.mir
@@ -0,0 +1,35 @@
+// MIR for `fun` 0 mir_map
+
+fn fun(_1: &[T]) -> &T {
+ debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:12: +0:14
+ let mut _0: &T; // return place in scope 0 at $DIR/issue-91633.rs:+0:25: +0:27
+ let _2: &T; // in scope 0 at $DIR/issue-91633.rs:+2:10: +2:11
+ let _3: usize; // in scope 0 at $DIR/issue-91633.rs:+2:18: +2:19
+ let mut _4: usize; // in scope 0 at $DIR/issue-91633.rs:+2:15: +2:20
+ let mut _5: bool; // in scope 0 at $DIR/issue-91633.rs:+2:15: +2:20
+ scope 1 {
+ debug f => _2; // in scope 1 at $DIR/issue-91633.rs:+2:10: +2:11
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-91633.rs:+2:10: +2:11
+ StorageLive(_3); // scope 0 at $DIR/issue-91633.rs:+2:18: +2:19
+ _3 = const 0_usize; // scope 0 at $DIR/issue-91633.rs:+2:18: +2:19
+ _4 = Len((*_1)); // scope 0 at $DIR/issue-91633.rs:+2:15: +2:20
+ _5 = Lt(_3, _4); // scope 0 at $DIR/issue-91633.rs:+2:15: +2:20
+ assert(move _5, "index out of bounds: the length is {} but the index is {}", move _4, _3) -> [success: bb1, unwind: bb2]; // scope 0 at $DIR/issue-91633.rs:+2:15: +2:20
+ }
+
+ bb1: {
+ _2 = &(*_1)[_3]; // scope 0 at $DIR/issue-91633.rs:+2:14: +2:20
+ FakeRead(ForLet(None), _2); // scope 0 at $DIR/issue-91633.rs:+2:10: +2:11
+ _0 = &(*_2); // scope 1 at $DIR/issue-91633.rs:+3:6: +3:7
+ StorageDead(_3); // scope 0 at $DIR/issue-91633.rs:+4:2: +4:3
+ StorageDead(_2); // scope 0 at $DIR/issue-91633.rs:+4:2: +4:3
+ return; // scope 0 at $DIR/issue-91633.rs:+4:3: +4:3
+ }
+
+ bb2 (cleanup): {
+ resume; // scope 0 at $DIR/issue-91633.rs:+0:1: +4:3
+ }
+}
diff --git a/src/test/mir-opt/issue_91633.hey.mir_map.0.mir b/src/test/mir-opt/issue_91633.hey.mir_map.0.mir
new file mode 100644
index 000000000..37c3b3fca
--- /dev/null
+++ b/src/test/mir-opt/issue_91633.hey.mir_map.0.mir
@@ -0,0 +1,35 @@
+// MIR for `hey` 0 mir_map
+
+fn hey(_1: &[T]) -> () {
+ debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:12: +0:14
+ let mut _0: (); // return place in scope 0 at $DIR/issue-91633.rs:+1:2: +1:2
+ let mut _2: &<[T] as std::ops::Index<usize>>::Output; // in scope 0 at $DIR/issue-91633.rs:+4:14: +4:20
+ let _3: &<[T] as std::ops::Index<usize>>::Output; // in scope 0 at $DIR/issue-91633.rs:+4:15: +4:20
+ let mut _4: &[T]; // in scope 0 at $DIR/issue-91633.rs:+4:15: +4:17
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/issue-91633.rs:+4:14: +4:20
+ StorageLive(_3); // scope 0 at $DIR/issue-91633.rs:+4:15: +4:20
+ StorageLive(_4); // scope 0 at $DIR/issue-91633.rs:+4:15: +4:17
+ _4 = &(*_1); // scope 0 at $DIR/issue-91633.rs:+4:15: +4:17
+ _3 = <[T] as Index<usize>>::index(move _4, const 0_usize) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/issue-91633.rs:+4:15: +4:20
+ // mir::Constant
+ // + span: $DIR/issue-91633.rs:7:15: 7:20
+ // + literal: Const { ty: for<'a> fn(&'a [T], usize) -> &'a <[T] as Index<usize>>::Output {<[T] as Index<usize>>::index}, val: Value(<ZST>) }
+ }
+
+ 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
+ StorageDead(_2); // scope 0 at $DIR/issue-91633.rs:+4:20: +4:21
+ _0 = const (); // scope 0 at $DIR/issue-91633.rs:+3:2: +5:3
+ StorageDead(_3); // scope 0 at $DIR/issue-91633.rs:+5:2: +5:3
+ return; // scope 0 at $DIR/issue-91633.rs:+5:3: +5:3
+ }
+
+ bb2 (cleanup): {
+ resume; // scope 0 at $DIR/issue-91633.rs:+0:1: +5:3
+ }
+}
diff --git a/src/test/mir-opt/issue_99325.main.mir_map.0.mir b/src/test/mir-opt/issue_99325.main.mir_map.0.mir
index 5bca9f0ea..165efa9df 100644
--- a/src/test/mir-opt/issue_99325.main.mir_map.0.mir
+++ b/src/test/mir-opt/issue_99325.main.mir_map.0.mir
@@ -2,7 +2,7 @@
| 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(Unevaluated { 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: [], promoted: None }) }], user_self_ty: None }) }, span: $DIR/issue-99325.rs:11:16: 11:68, 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">}
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/issue-99325.rs:+0:15: +0:15
@@ -26,7 +26,7 @@ fn main() -> () {
let _19: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _20: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _21: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _22: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ let mut _22: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _23: (); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _24: (&&[u8], &&[u8; 4]); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _25: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
@@ -46,7 +46,7 @@ fn main() -> () {
let _40: &&[u8]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _41: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _42: &&[u8; 4]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _43: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ let mut _43: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 1 {
debug left_val => _8; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
debug right_val => _9; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
@@ -101,7 +101,7 @@ fn main() -> () {
_11 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _12, move _13) -> [return: bb2, unwind: bb19]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's> fn(&'r &[u8], &'s &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value(<ZST>) }
}
bb2: {
@@ -128,11 +128,11 @@ fn main() -> () {
_21 = &(*_9); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_20 = &(*_21); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_22); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _22 = Option::<Arguments>::None; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _22 = Option::<Arguments<'_>>::None; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_16 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _17, move _18, move _20, move _22) -> bb19; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value(<ZST>) }
}
bb4: {
@@ -210,7 +210,7 @@ fn main() -> () {
_32 = <&[u8] as PartialEq<&[u8; 4]>>::eq(move _33, move _34) -> [return: bb11, unwind: bb19]; // scope 3 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's> fn(&'r &[u8], &'s &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b> fn(&'a &[u8], &'b &[u8; 4]) -> bool {<&[u8] as PartialEq<&[u8; 4]>>::eq}, val: Value(<ZST>) }
}
bb11: {
@@ -237,11 +237,11 @@ fn main() -> () {
_42 = &(*_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_41 = &(*_42); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_43); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _43 = Option::<Arguments>::None; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _43 = Option::<Arguments<'_>>::None; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_37 = core::panicking::assert_failed::<&[u8], &[u8; 4]>(move _38, move _39, move _41, move _43) -> bb19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r &[u8], &'s &[u8; 4], Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a &[u8], &'b &[u8; 4], Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<&[u8], &[u8; 4]>}, val: Value(<ZST>) }
}
bb13: {
diff --git a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
index 86b38d4b7..f46c10711 100644
--- a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
+++ b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir
@@ -55,7 +55,6 @@ fn num_to_digit(_1: char) -> u32 {
bb2: {
StorageDead(_4); // scope 0 at $DIR/issue-59352.rs:+2:40: +2:41
- StorageLive(_10); // scope 0 at $DIR/issue-59352.rs:+2:26: +2:50
_10 = discriminant(_3); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
switchInt(move _10) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
}
@@ -73,11 +72,9 @@ fn num_to_digit(_1: char) -> u32 {
bb5: {
_6 = &_7; // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
StorageDead(_8); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
- StorageLive(_9); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
_9 = discriminant((*_6)); // scope 2 at $SRC_DIR/core/src/option.rs:LL:COL
StorageLive(_12); // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_12 = move _9; // scope 2 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- StorageDead(_9); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
StorageDead(_6); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
StorageDead(_7); // scope 1 at $SRC_DIR/core/src/char/methods.rs:LL:COL
StorageDead(_5); // scope 0 at $DIR/issue-59352.rs:+2:8: +2:23
@@ -102,7 +99,6 @@ fn num_to_digit(_1: char) -> u32 {
bb8: {
_0 = move ((_3 as Some).0: u32); // scope 3 at $SRC_DIR/core/src/option.rs:LL:COL
- StorageDead(_10); // scope 0 at $DIR/issue-59352.rs:+2:26: +2:50
StorageDead(_3); // scope 0 at $DIR/issue-59352.rs:+2:49: +2:50
goto -> bb4; // scope 0 at $DIR/issue-59352.rs:+2:5: +2:63
}
diff --git a/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff
deleted file mode 100644
index 2589c9f28..000000000
--- a/src/test/mir-opt/lower_array_len.array_bound.InstCombine.diff
+++ /dev/null
@@ -1,66 +0,0 @@
-- // MIR for `array_bound` before InstCombine
-+ // MIR for `array_bound` after InstCombine
-
- fn array_bound(_1: usize, _2: &[u8; N]) -> u8 {
- debug index => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:36: +0:41
- debug slice => _2; // in scope 0 at $DIR/lower_array_len.rs:+0:50: +0:55
- let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len.rs:+0:70: +0:72
- let mut _3: bool; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- let mut _4: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- let mut _5: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _7: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- _4 = _1; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-+ _7 = _2; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _11 = _7; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:+1:20: +1:21
-- _5 = Len((*_11)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-+ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- }
-
- bb1: {
- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ _9 = const N; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- }
-
- bb2: {
- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
- goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:+1:5: +5:6
- }
-
- bb3: {
- _0 = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:11
- goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:+1:5: +5:6
- }
-
- bb4: {
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+5:5: +5:6
- return; // scope 0 at $DIR/lower_array_len.rs:+6:2: +6:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff
deleted file mode 100644
index 8312db6b3..000000000
--- a/src/test/mir-opt/lower_array_len.array_bound.SimplifyLocals.diff
+++ /dev/null
@@ -1,70 +0,0 @@
-- // MIR for `array_bound` before SimplifyLocals
-+ // MIR for `array_bound` after SimplifyLocals
-
- fn array_bound(_1: usize, _2: &[u8; N]) -> u8 {
- debug index => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:36: +0:41
- debug slice => _2; // in scope 0 at $DIR/lower_array_len.rs:+0:50: +0:55
- let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len.rs:+0:70: +0:72
- let mut _3: bool; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- let mut _4: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- let mut _5: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- let mut _7: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- let mut _11: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-+ let _6: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-+ let mut _7: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ let mut _8: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- _4 = _1; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:+1:20: +1:21
- _5 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- }
-
- bb1: {
-- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- _9 = const N; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-+ _6 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-+ _7 = const N; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- }
-
- bb2: {
-- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
-+ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
- goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:+1:5: +5:6
- }
-
- bb3: {
- _0 = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:11
- goto -> bb4; // scope 0 at $DIR/lower_array_len.rs:+1:5: +5:6
- }
-
- bb4: {
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+5:5: +5:6
- return; // scope 0 at $DIR/lower_array_len.rs:+6:2: +6:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff
deleted file mode 100644
index 401d4bac6..000000000
--- a/src/test/mir-opt/lower_array_len.array_bound_mut.InstCombine.diff
+++ /dev/null
@@ -1,79 +0,0 @@
-- // MIR for `array_bound_mut` before InstCombine
-+ // MIR for `array_bound_mut` after InstCombine
-
- fn array_bound_mut(_1: usize, _2: &mut [u8; N]) -> u8 {
- debug index => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:40: +0:45
- debug slice => _2; // in scope 0 at $DIR/lower_array_len.rs:+0:54: +0:59
- let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len.rs:+0:78: +0:80
- let mut _3: bool; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- let mut _4: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- let mut _5: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let mut _7: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
- let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- _4 = _1; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _7 = &(*_2); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _14 = _7; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- _6 = move _7 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:+1:20: +1:21
-- _5 = Len((*_14)); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-+ _5 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- }
-
- bb1: {
- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- _9 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ _9 = const N; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- }
-
- bb2: {
- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
- goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:+1:5: +7:6
- }
-
- bb3: {
- StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
- _11 = const 0_usize; // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
-- _12 = Len((*_2)); // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-+ _12 = const N; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- _13 = Lt(_11, _12); // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, _11) -> bb4; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- }
-
- bb4: {
- (*_2)[_11] = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:22
- StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:+4:22: +4:23
- _0 = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+6:9: +6:11
- goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:+1:5: +7:6
- }
-
- bb5: {
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+7:5: +7:6
- return; // scope 0 at $DIR/lower_array_len.rs:+8:2: +8:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff
deleted file mode 100644
index 4f241d7c9..000000000
--- a/src/test/mir-opt/lower_array_len.array_bound_mut.SimplifyLocals.diff
+++ /dev/null
@@ -1,93 +0,0 @@
-- // MIR for `array_bound_mut` before SimplifyLocals
-+ // MIR for `array_bound_mut` after SimplifyLocals
-
- fn array_bound_mut(_1: usize, _2: &mut [u8; N]) -> u8 {
- debug index => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:40: +0:45
- debug slice => _2; // in scope 0 at $DIR/lower_array_len.rs:+0:54: +0:59
- let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len.rs:+0:78: +0:80
- let mut _3: bool; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- let mut _4: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- let mut _5: usize; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- let mut _6: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- let mut _7: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- let _8: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- let mut _9: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- let mut _10: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- let _11: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
-- let mut _12: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-- let mut _13: bool; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-- let mut _14: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-+ let _6: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-+ let mut _7: usize; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ let mut _8: bool; // in scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ let _9: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
-+ let mut _10: usize; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-+ let mut _11: bool; // in scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-
- bb0: {
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- _4 = _1; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:13
- StorageLive(_5); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageLive(_7); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageLive(_14); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageDead(_7); // scope 0 at $DIR/lower_array_len.rs:+1:20: +1:21
- _5 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageDead(_14); // scope 0 at $DIR/lower_array_len.rs:+1:16: +1:27
-- StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- StorageDead(_5); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:26: +1:27
- switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len.rs:+1:8: +1:27
- }
-
- bb1: {
-- StorageLive(_8); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- _8 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-- _9 = const N; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- _10 = Lt(_8, _9); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- assert(move _10, "index out of bounds: the length is {} but the index is {}", move _9, _8) -> bb2; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ StorageLive(_6); // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-+ _6 = _1; // scope 0 at $DIR/lower_array_len.rs:+2:15: +2:20
-+ _7 = const N; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
- }
-
- bb2: {
-- _0 = (*_2)[_8]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-- StorageDead(_8); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
-+ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len.rs:+2:9: +2:21
-+ StorageDead(_6); // scope 0 at $DIR/lower_array_len.rs:+3:5: +3:6
- goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:+1:5: +7:6
- }
-
- bb3: {
-- StorageLive(_11); // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
-- _11 = const 0_usize; // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
-- _12 = const N; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-- _13 = Lt(const 0_usize, _12); // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-- assert(move _13, "index out of bounds: the length is {} but the index is {}", move _12, const 0_usize) -> bb4; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-+ StorageLive(_9); // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
-+ _9 = const 0_usize; // scope 0 at $DIR/lower_array_len.rs:+4:15: +4:16
-+ _10 = const N; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-+ _11 = Lt(const 0_usize, _10); // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
-+ assert(move _11, "index out of bounds: the length is {} but the index is {}", move _10, const 0_usize) -> bb4; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:17
- }
-
- bb4: {
-- (*_2)[_11] = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:22
-- StorageDead(_11); // scope 0 at $DIR/lower_array_len.rs:+4:22: +4:23
-+ (*_2)[_9] = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+4:9: +4:22
-+ StorageDead(_9); // scope 0 at $DIR/lower_array_len.rs:+4:22: +4:23
- _0 = const 42_u8; // scope 0 at $DIR/lower_array_len.rs:+6:9: +6:11
- goto -> bb5; // scope 0 at $DIR/lower_array_len.rs:+1:5: +7:6
- }
-
- bb5: {
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+7:5: +7:6
- return; // scope 0 at $DIR/lower_array_len.rs:+8:2: +8:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.array_len.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_len.InstCombine.diff
deleted file mode 100644
index 26f45be17..000000000
--- a/src/test/mir-opt/lower_array_len.array_len.InstCombine.diff
+++ /dev/null
@@ -1,27 +0,0 @@
-- // MIR for `array_len` before InstCombine
-+ // MIR for `array_len` after InstCombine
-
- fn array_len(_1: &[u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:34: +0:37
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:52: +0:57
- let mut _2: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- let mut _3: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- let mut _4: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- _3 = &(*_1); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-+ _3 = _1; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _4 = _3; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:7: +1:8
-- _0 = Len((*_4)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-+ _0 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+1:13: +1:14
- return; // scope 0 at $DIR/lower_array_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.array_len.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_len.SimplifyLocals.diff
deleted file mode 100644
index 09d571d20..000000000
--- a/src/test/mir-opt/lower_array_len.array_len.SimplifyLocals.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `array_len` before SimplifyLocals
-+ // MIR for `array_len` after SimplifyLocals
-
- fn array_len(_1: &[u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:34: +0:37
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:52: +0:57
-- let mut _2: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- let mut _3: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- let mut _4: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:7: +1:8
- _0 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+1:13: +1:14
- return; // scope 0 at $DIR/lower_array_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.array_len_by_value.InstCombine.diff b/src/test/mir-opt/lower_array_len.array_len_by_value.InstCombine.diff
deleted file mode 100644
index 843da758d..000000000
--- a/src/test/mir-opt/lower_array_len.array_len_by_value.InstCombine.diff
+++ /dev/null
@@ -1,26 +0,0 @@
-- // MIR for `array_len_by_value` before InstCombine
-+ // MIR for `array_len_by_value` after InstCombine
-
- fn array_len_by_value(_1: [u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:43: +0:46
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:60: +0:65
- let mut _2: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- let mut _3: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- let mut _4: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _3 = &_1; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _4 = _3; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- _2 = move _3 as &[u8] (Pointer(Unsize)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:7: +1:8
-- _0 = Len((*_4)); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-+ _0 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+1:13: +1:14
- return; // scope 0 at $DIR/lower_array_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.array_len_by_value.SimplifyLocals.diff b/src/test/mir-opt/lower_array_len.array_len_by_value.SimplifyLocals.diff
deleted file mode 100644
index dc1c00b69..000000000
--- a/src/test/mir-opt/lower_array_len.array_len_by_value.SimplifyLocals.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `array_len_by_value` before SimplifyLocals
-+ // MIR for `array_len_by_value` after SimplifyLocals
-
- fn array_len_by_value(_1: [u8; N]) -> usize {
- debug arr => _1; // in scope 0 at $DIR/lower_array_len.rs:+0:43: +0:46
- let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len.rs:+0:60: +0:65
-- let mut _2: &[u8]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- let mut _3: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- let mut _4: &[u8; N]; // in scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-
- bb0: {
-- StorageLive(_2); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageLive(_3); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageLive(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageDead(_3); // scope 0 at $DIR/lower_array_len.rs:+1:7: +1:8
- _0 = const N; // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageDead(_4); // scope 0 at $DIR/lower_array_len.rs:+1:5: +1:14
-- StorageDead(_2); // scope 0 at $DIR/lower_array_len.rs:+1:13: +1:14
- return; // scope 0 at $DIR/lower_array_len.rs:+2:2: +2:2
- }
- }
-
diff --git a/src/test/mir-opt/lower_array_len.rs b/src/test/mir-opt/lower_array_len.rs
index fc12ee75f..ea0224b21 100644
--- a/src/test/mir-opt/lower_array_len.rs
+++ b/src/test/mir-opt/lower_array_len.rs
@@ -1,8 +1,7 @@
-// compile-flags: -Z mir-opt-level=4
+// unit-test: NormalizeArrayLen
+// compile-flags: -Zmir-enable-passes=+LowerSliceLenCalls
// EMIT_MIR lower_array_len.array_bound.NormalizeArrayLen.diff
-// EMIT_MIR lower_array_len.array_bound.SimplifyLocals.diff
-// EMIT_MIR lower_array_len.array_bound.InstCombine.diff
pub fn array_bound<const N: usize>(index: usize, slice: &[u8; N]) -> u8 {
if index < slice.len() {
slice[index]
@@ -12,8 +11,6 @@ pub fn array_bound<const N: usize>(index: usize, slice: &[u8; N]) -> u8 {
}
// EMIT_MIR lower_array_len.array_bound_mut.NormalizeArrayLen.diff
-// EMIT_MIR lower_array_len.array_bound_mut.SimplifyLocals.diff
-// EMIT_MIR lower_array_len.array_bound_mut.InstCombine.diff
pub fn array_bound_mut<const N: usize>(index: usize, slice: &mut [u8; N]) -> u8 {
if index < slice.len() {
slice[index]
@@ -25,15 +22,11 @@ pub fn array_bound_mut<const N: usize>(index: usize, slice: &mut [u8; N]) -> u8
}
// EMIT_MIR lower_array_len.array_len.NormalizeArrayLen.diff
-// EMIT_MIR lower_array_len.array_len.SimplifyLocals.diff
-// EMIT_MIR lower_array_len.array_len.InstCombine.diff
pub fn array_len<const N: usize>(arr: &[u8; N]) -> usize {
arr.len()
}
// EMIT_MIR lower_array_len.array_len_by_value.NormalizeArrayLen.diff
-// EMIT_MIR lower_array_len.array_len_by_value.SimplifyLocals.diff
-// EMIT_MIR lower_array_len.array_len_by_value.InstCombine.diff
pub fn array_len_by_value<const N: usize>(arr: [u8; N]) -> usize {
arr.len()
}
diff --git a/src/test/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir b/src/test/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir
new file mode 100644
index 000000000..2c6c93cb1
--- /dev/null
+++ b/src/test/mir-opt/lower_array_len_e2e.array_bound.PreCodegen.after.mir
@@ -0,0 +1,49 @@
+// MIR for `array_bound` after PreCodegen
+
+fn array_bound(_1: usize, _2: &[u8; N]) -> u8 {
+ debug index => _1; // in scope 0 at $DIR/lower_array_len_e2e.rs:+0:36: +0:41
+ debug slice => _2; // in scope 0 at $DIR/lower_array_len_e2e.rs:+0:50: +0:55
+ let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len_e2e.rs:+0:70: +0:72
+ let mut _3: bool; // in scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ let mut _4: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:13
+ let mut _5: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+1:16: +1:27
+ let _6: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+2:15: +2:20
+ let mut _7: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ let mut _8: bool; // in scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+
+ bb0: {
+ StorageLive(_3); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ StorageLive(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:13
+ _4 = _1; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:13
+ StorageLive(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:16: +1:27
+ _5 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:16: +1:27
+ _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ StorageDead(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
+ StorageDead(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
+ switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ }
+
+ bb1: {
+ StorageLive(_6); // scope 0 at $DIR/lower_array_len_e2e.rs:+2:15: +2:20
+ _6 = _1; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:15: +2:20
+ _7 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ }
+
+ bb2: {
+ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ StorageDead(_6); // scope 0 at $DIR/lower_array_len_e2e.rs:+3:5: +3:6
+ goto -> bb4; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:5: +5:6
+ }
+
+ bb3: {
+ _0 = const 42_u8; // scope 0 at $DIR/lower_array_len_e2e.rs:+4:9: +4:11
+ goto -> bb4; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:5: +5:6
+ }
+
+ bb4: {
+ StorageDead(_3); // scope 0 at $DIR/lower_array_len_e2e.rs:+5:5: +5:6
+ return; // scope 0 at $DIR/lower_array_len_e2e.rs:+6:2: +6:2
+ }
+}
diff --git a/src/test/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir b/src/test/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir
new file mode 100644
index 000000000..aee3a8242
--- /dev/null
+++ b/src/test/mir-opt/lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir
@@ -0,0 +1,62 @@
+// MIR for `array_bound_mut` after PreCodegen
+
+fn array_bound_mut(_1: usize, _2: &mut [u8; N]) -> u8 {
+ debug index => _1; // in scope 0 at $DIR/lower_array_len_e2e.rs:+0:40: +0:45
+ debug slice => _2; // in scope 0 at $DIR/lower_array_len_e2e.rs:+0:54: +0:59
+ let mut _0: u8; // return place in scope 0 at $DIR/lower_array_len_e2e.rs:+0:78: +0:80
+ let mut _3: bool; // in scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ let mut _4: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:13
+ let mut _5: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+1:16: +1:27
+ let _6: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+2:15: +2:20
+ let mut _7: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ let mut _8: bool; // in scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ let _9: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+4:15: +4:16
+ let mut _10: usize; // in scope 0 at $DIR/lower_array_len_e2e.rs:+4:9: +4:17
+ let mut _11: bool; // in scope 0 at $DIR/lower_array_len_e2e.rs:+4:9: +4:17
+
+ bb0: {
+ StorageLive(_3); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ StorageLive(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:13
+ _4 = _1; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:13
+ StorageLive(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:16: +1:27
+ _5 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:16: +1:27
+ _3 = Lt(move _4, move _5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ StorageDead(_5); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
+ StorageDead(_4); // scope 0 at $DIR/lower_array_len_e2e.rs:+1:26: +1:27
+ switchInt(move _3) -> [false: bb3, otherwise: bb1]; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:8: +1:27
+ }
+
+ bb1: {
+ StorageLive(_6); // scope 0 at $DIR/lower_array_len_e2e.rs:+2:15: +2:20
+ _6 = _1; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:15: +2:20
+ _7 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ _8 = Lt(_6, _7); // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ assert(move _8, "index out of bounds: the length is {} but the index is {}", move _7, _6) -> bb2; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ }
+
+ bb2: {
+ _0 = (*_2)[_6]; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:9: +2:21
+ StorageDead(_6); // scope 0 at $DIR/lower_array_len_e2e.rs:+3:5: +3:6
+ goto -> bb5; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:5: +7:6
+ }
+
+ bb3: {
+ StorageLive(_9); // scope 0 at $DIR/lower_array_len_e2e.rs:+4:15: +4:16
+ _9 = const 0_usize; // scope 0 at $DIR/lower_array_len_e2e.rs:+4:15: +4:16
+ _10 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+4:9: +4:17
+ _11 = Lt(const 0_usize, _10); // scope 0 at $DIR/lower_array_len_e2e.rs:+4:9: +4:17
+ assert(move _11, "index out of bounds: the length is {} but the index is {}", move _10, const 0_usize) -> bb4; // scope 0 at $DIR/lower_array_len_e2e.rs:+4:9: +4:17
+ }
+
+ bb4: {
+ (*_2)[_9] = const 42_u8; // scope 0 at $DIR/lower_array_len_e2e.rs:+4:9: +4:22
+ StorageDead(_9); // scope 0 at $DIR/lower_array_len_e2e.rs:+4:22: +4:23
+ _0 = const 42_u8; // scope 0 at $DIR/lower_array_len_e2e.rs:+6:9: +6:11
+ goto -> bb5; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:5: +7:6
+ }
+
+ bb5: {
+ StorageDead(_3); // scope 0 at $DIR/lower_array_len_e2e.rs:+7:5: +7:6
+ return; // scope 0 at $DIR/lower_array_len_e2e.rs:+8:2: +8:2
+ }
+}
diff --git a/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir b/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir
new file mode 100644
index 000000000..4b19f6795
--- /dev/null
+++ b/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir
@@ -0,0 +1,11 @@
+// MIR for `array_len` after PreCodegen
+
+fn array_len(_1: &[u8; N]) -> usize {
+ debug arr => _1; // in scope 0 at $DIR/lower_array_len_e2e.rs:+0:34: +0:37
+ let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len_e2e.rs:+0:52: +0:57
+
+ bb0: {
+ _0 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:5: +1:14
+ return; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:2: +2:2
+ }
+}
diff --git a/src/test/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir b/src/test/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir
new file mode 100644
index 000000000..4dc0ba9a2
--- /dev/null
+++ b/src/test/mir-opt/lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir
@@ -0,0 +1,11 @@
+// MIR for `array_len_by_value` after PreCodegen
+
+fn array_len_by_value(_1: [u8; N]) -> usize {
+ debug arr => _1; // in scope 0 at $DIR/lower_array_len_e2e.rs:+0:43: +0:46
+ let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len_e2e.rs:+0:60: +0:65
+
+ bb0: {
+ _0 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:5: +1:14
+ return; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:2: +2:2
+ }
+}
diff --git a/src/test/mir-opt/lower_array_len_e2e.rs b/src/test/mir-opt/lower_array_len_e2e.rs
new file mode 100644
index 000000000..49b35d509
--- /dev/null
+++ b/src/test/mir-opt/lower_array_len_e2e.rs
@@ -0,0 +1,39 @@
+// compile-flags: -Z mir-opt-level=4
+
+// EMIT_MIR lower_array_len_e2e.array_bound.PreCodegen.after.mir
+pub fn array_bound<const N: usize>(index: usize, slice: &[u8; N]) -> u8 {
+ if index < slice.len() {
+ slice[index]
+ } else {
+ 42
+ }
+}
+
+// EMIT_MIR lower_array_len_e2e.array_bound_mut.PreCodegen.after.mir
+pub fn array_bound_mut<const N: usize>(index: usize, slice: &mut [u8; N]) -> u8 {
+ if index < slice.len() {
+ slice[index]
+ } else {
+ slice[0] = 42;
+
+ 42
+ }
+}
+
+// EMIT_MIR lower_array_len_e2e.array_len.PreCodegen.after.mir
+pub fn array_len<const N: usize>(arr: &[u8; N]) -> usize {
+ arr.len()
+}
+
+// EMIT_MIR lower_array_len_e2e.array_len_by_value.PreCodegen.after.mir
+pub fn array_len_by_value<const N: usize>(arr: [u8; N]) -> usize {
+ arr.len()
+}
+
+fn main() {
+ let _ = array_bound(3, &[0, 1, 2, 3]);
+ let mut tmp = [0, 1, 2, 3, 4];
+ let _ = array_bound_mut(3, &mut [0, 1, 2, 3]);
+ let _ = array_len(&[0]);
+ let _ = array_len_by_value([0, 2]);
+}
diff --git a/src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
index 5c635e222..3389db733 100644
--- a/src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.align_of.LowerIntrinsics.diff
@@ -7,7 +7,7 @@
bb0: {
- _0 = std::intrinsics::min_align_of::<T>() -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:42
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:19:5: 19:40
+- // + span: $DIR/lower_intrinsics.rs:21:5: 21:40
- // + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::min_align_of::<T>}, val: Value(<ZST>) }
+ _0 = AlignOf(T); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:42
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:42
diff --git a/src/test/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff
new file mode 100644
index 000000000..d9898d8e0
--- /dev/null
+++ b/src/test/mir-opt/lower_intrinsics.assume.LowerIntrinsics.diff
@@ -0,0 +1,26 @@
+- // MIR for `assume` before LowerIntrinsics
++ // MIR for `assume` after LowerIntrinsics
+
+ fn assume() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:17: +0:17
+ let _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:+2:9: +2:38
+ scope 1 {
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
+- _1 = std::intrinsics::assume(const true) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
+- // mir::Constant
+- // + span: $DIR/lower_intrinsics.rs:72:9: 72:32
+- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(bool) {std::intrinsics::assume}, val: Value(<ZST>) }
++ assume(const true); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
++ goto -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:38
+ }
+
+ bb1: {
+ StorageDead(_1); // scope 1 at $DIR/lower_intrinsics.rs:+2:38: +2:39
+ _0 = const (); // scope 1 at $DIR/lower_intrinsics.rs:+1:5: +3:6
+ return; // scope 0 at $DIR/lower_intrinsics.rs:+4:2: +4:2
+ }
+ }
+
diff --git a/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
index 8a80de32f..d962ef8cb 100644
--- a/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.discriminant.LowerIntrinsics.diff
@@ -31,8 +31,8 @@
_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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:74:5: 74:41
-- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r T) -> <T as DiscriminantKind>::Discriminant {discriminant_value::<T>}, val: Value(<ZST>) }
+- // + span: $DIR/lower_intrinsics.rs:49:5: 49: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
}
@@ -44,16 +44,16 @@
StorageLive(_5); // scope 0 at $DIR/lower_intrinsics.rs:+2:5: +2:45
StorageLive(_6); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
StorageLive(_7); // scope 0 at $DIR/lower_intrinsics.rs:+2:42: +2:44
- _19 = const discriminant::<T>::promoted[2]; // 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:75:42: 75:44
+ // + span: $DIR/lower_intrinsics.rs:50:42: 50: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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:75:5: 75:41
-- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r i32) -> <i32 as DiscriminantKind>::Discriminant {discriminant_value::<i32>}, val: Value(<ZST>) }
+- // + span: $DIR/lower_intrinsics.rs:50:5: 50: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
}
@@ -65,16 +65,16 @@
StorageLive(_9); // scope 0 at $DIR/lower_intrinsics.rs:+3:5: +3:46
StorageLive(_10); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
StorageLive(_11); // scope 0 at $DIR/lower_intrinsics.rs:+3:42: +3:45
- _18 = const discriminant::<T>::promoted[1]; // 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:76:42: 76:45
+ // + span: $DIR/lower_intrinsics.rs:51:42: 51: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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:76:5: 76:41
-- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r ()) -> <() as DiscriminantKind>::Discriminant {discriminant_value::<()>}, val: Value(<ZST>) }
+- // + span: $DIR/lower_intrinsics.rs:51:5: 51: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
}
@@ -86,16 +86,16 @@
StorageLive(_13); // scope 0 at $DIR/lower_intrinsics.rs:+4:5: +4:48
StorageLive(_14); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
StorageLive(_15); // scope 0 at $DIR/lower_intrinsics.rs:+4:42: +4:47
- _17 = const discriminant::<T>::promoted[0]; // 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:77:42: 77:47
+ // + span: $DIR/lower_intrinsics.rs:52:42: 52: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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:77:5: 77:41
-- // + literal: Const { ty: for<'r> extern "rust-intrinsic" fn(&'r E) -> <E as DiscriminantKind>::Discriminant {discriminant_value::<E>}, val: Value(<ZST>) }
+- // + span: $DIR/lower_intrinsics.rs:52:5: 52: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
}
@@ -105,11 +105,15 @@
StorageDead(_15); // scope 0 at $DIR/lower_intrinsics.rs:+4:48: +4:49
StorageDead(_13); // scope 0 at $DIR/lower_intrinsics.rs:+4:48: +4:49
_0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:+0:30: +5:2
- drop(_1) -> bb5; // scope 0 at $DIR/lower_intrinsics.rs:+5:1: +5:2
+ drop(_1) -> [return: bb5, unwind: bb6]; // scope 0 at $DIR/lower_intrinsics.rs:+5:1: +5:2
}
bb5: {
return; // scope 0 at $DIR/lower_intrinsics.rs:+5:2: +5:2
}
+
+ bb6 (cleanup): {
+ resume; // scope 0 at $DIR/lower_intrinsics.rs:+0:1: +5:2
+ }
}
diff --git a/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
new file mode 100644
index 000000000..ec15fd1ef
--- /dev/null
+++ b/src/test/mir-opt/lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
@@ -0,0 +1,72 @@
+- // MIR for `f_copy_nonoverlapping` before LowerIntrinsics
++ // MIR for `f_copy_nonoverlapping` after LowerIntrinsics
+
+ fn f_copy_nonoverlapping() -> () {
+ let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:32: +0:32
+ let _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:12
+ let _3: (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:9: +4:95
+ let mut _4: *const i32; // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:59
+ let mut _5: *const (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:45
+ let mut _6: *const (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:45
+ let _7: &(); // in scope 0 at $DIR/lower_intrinsics.rs:+4:29: +4:33
+ let mut _8: *mut i32; // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:91
+ let mut _9: *mut (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:79
+ let mut _10: *mut (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:79
+ let mut _11: &mut (); // in scope 0 at $DIR/lower_intrinsics.rs:+4:61: +4:69
+ scope 1 {
+ debug src => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+1:9: +1:12
+ let mut _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:16
+ scope 2 {
+ debug dst => _2; // in scope 2 at $DIR/lower_intrinsics.rs:+2:9: +2:16
+ scope 3 {
+ }
+ }
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:9: +1:12
+ Deinit(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:15: +1:17
+ StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+2:9: +2:16
+ Deinit(_2); // scope 1 at $DIR/lower_intrinsics.rs:+2:19: +2:21
+ StorageLive(_3); // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
+ StorageLive(_4); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:59
+ StorageLive(_5); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:45
+ StorageLive(_6); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:45
+ StorageLive(_7); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
+ _7 = &_1; // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
+ _6 = &raw const (*_7); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:33
+ _5 = _6; // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:45
+ _4 = move _5 as *const i32 (PtrToPtr); // scope 3 at $DIR/lower_intrinsics.rs:+4:29: +4:59
+ StorageDead(_5); // scope 3 at $DIR/lower_intrinsics.rs:+4:58: +4:59
+ StorageLive(_8); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:91
+ StorageLive(_9); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
+ StorageLive(_10); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
+ StorageLive(_11); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
+ _11 = &mut _2; // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
+ _10 = &raw mut (*_11); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:69
+ _9 = _10; // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:79
+ _8 = move _9 as *mut i32 (PtrToPtr); // scope 3 at $DIR/lower_intrinsics.rs:+4:61: +4:91
+ StorageDead(_9); // scope 3 at $DIR/lower_intrinsics.rs:+4:90: +4:91
+- _3 = copy_nonoverlapping::<i32>(move _4, move _8, const 0_usize) -> bb1; // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
+- // mir::Constant
+- // + span: $DIR/lower_intrinsics.rs:65:9: 65:28
+- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(*const i32, *mut i32, usize) {copy_nonoverlapping::<i32>}, val: Value(<ZST>) }
++ copy_nonoverlapping(dst = move _8, src = move _4, count = const 0_usize); // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
++ goto -> bb1; // scope 3 at $DIR/lower_intrinsics.rs:+4:9: +4:95
+ }
+
+ bb1: {
+ StorageDead(_8); // scope 3 at $DIR/lower_intrinsics.rs:+4:94: +4:95
+ StorageDead(_4); // scope 3 at $DIR/lower_intrinsics.rs:+4:94: +4:95
+ StorageDead(_11); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
+ StorageDead(_10); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
+ StorageDead(_7); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
+ StorageDead(_6); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
+ StorageDead(_3); // scope 3 at $DIR/lower_intrinsics.rs:+4:95: +4:96
+ _0 = const (); // scope 3 at $DIR/lower_intrinsics.rs:+3:5: +5:6
+ StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+6:1: +6:2
+ StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:+6:1: +6:2
+ return; // scope 0 at $DIR/lower_intrinsics.rs:+6:2: +6:2
+ }
+ }
+
diff --git a/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
index e6a2f6512..4cbbc02c9 100644
--- a/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.forget.LowerIntrinsics.diff
@@ -11,7 +11,7 @@
_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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:24:5: 24:29
+- // + span: $DIR/lower_intrinsics.rs:26:5: 26:29
- // + literal: Const { ty: extern "rust-intrinsic" fn(T) {std::intrinsics::forget::<T>}, val: Value(<ZST>) }
+ _0 = const (); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:32
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:32
diff --git a/src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
index 1ab2f2a0a..d8cd5f59a 100644
--- a/src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.non_const.LowerIntrinsics.diff
@@ -13,7 +13,7 @@
StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+2:9: +2:18
_1 = std::intrinsics::size_of::<T>; // scope 0 at $DIR/lower_intrinsics.rs:+2:21: +2:51
// mir::Constant
- // + span: $DIR/lower_intrinsics.rs:62:21: 62:51
+ // + span: $DIR/lower_intrinsics.rs:37:21: 37:51
// + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}, val: Value(<ZST>) }
StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:14
_2 = _1; // scope 1 at $DIR/lower_intrinsics.rs:+3:5: +3:14
diff --git a/src/test/mir-opt/lower_intrinsics.rs b/src/test/mir-opt/lower_intrinsics.rs
index eab51b65f..66dae0e46 100644
--- a/src/test/mir-opt/lower_intrinsics.rs
+++ b/src/test/mir-opt/lower_intrinsics.rs
@@ -1,5 +1,7 @@
-// compile-flags: -Cpanic=abort
-#![feature(core_intrinsics)]
+// unit-test: LowerIntrinsics
+// ignore-wasm32 compiled with panic=abort by default
+
+#![feature(core_intrinsics, intrinsics)]
#![crate_type = "lib"]
// EMIT_MIR lower_intrinsics.wrapping.LowerIntrinsics.diff
@@ -29,33 +31,6 @@ pub fn unreachable() -> ! {
unsafe { core::intrinsics::unreachable() };
}
-// EMIT_MIR lower_intrinsics.f_unit.PreCodegen.before.mir
-pub fn f_unit() {
- f_dispatch(());
-}
-
-
-// EMIT_MIR lower_intrinsics.f_u64.PreCodegen.before.mir
-pub fn f_u64() {
- f_dispatch(0u64);
-}
-
-#[inline(always)]
-pub fn f_dispatch<T>(t: T) {
- if std::mem::size_of::<T>() == 0 {
- f_zst(t);
- } else {
- f_non_zst(t);
- }
-}
-
-#[inline(never)]
-pub fn f_zst<T>(_t: T) {
-}
-
-#[inline(never)]
-pub fn f_non_zst<T>(_t: T) {}
-
// EMIT_MIR lower_intrinsics.non_const.LowerIntrinsics.diff
pub fn non_const<T>() -> usize {
// Check that lowering works with non-const operand as a func.
@@ -76,3 +51,24 @@ pub fn discriminant<T>(t: T) {
core::intrinsics::discriminant_value(&());
core::intrinsics::discriminant_value(&E::B);
}
+
+extern "rust-intrinsic" {
+ // Cannot use `std::intrinsics::copy_nonoverlapping` as that is a wrapper function
+ fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
+}
+
+// EMIT_MIR lower_intrinsics.f_copy_nonoverlapping.LowerIntrinsics.diff
+pub fn f_copy_nonoverlapping() {
+ let src = ();
+ let mut dst = ();
+ unsafe {
+ copy_nonoverlapping(&src as *const _ as *const i32, &mut dst as *mut _ as *mut i32, 0);
+ }
+}
+
+// EMIT_MIR lower_intrinsics.assume.LowerIntrinsics.diff
+pub fn assume() {
+ unsafe {
+ std::intrinsics::assume(true);
+ }
+}
diff --git a/src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
index 11b27976b..cf0ab73a5 100644
--- a/src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.size_of.LowerIntrinsics.diff
@@ -7,7 +7,7 @@
bb0: {
- _0 = std::intrinsics::size_of::<T>() -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:37
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:14:5: 14:35
+- // + span: $DIR/lower_intrinsics.rs:16:5: 16:35
- // + literal: Const { ty: extern "rust-intrinsic" fn() -> usize {std::intrinsics::size_of::<T>}, val: Value(<ZST>) }
+ _0 = SizeOf(T); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:37
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:37
diff --git a/src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
index ac077e85b..6f17d4451 100644
--- a/src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.unreachable.LowerIntrinsics.diff
@@ -14,7 +14,7 @@
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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:29:14: 29:43
+- // + span: $DIR/lower_intrinsics.rs:31:14: 31:43
- // + literal: Const { ty: unsafe extern "rust-intrinsic" fn() -> ! {std::intrinsics::unreachable}, val: Value(<ZST>) }
+ unreachable; // scope 1 at $DIR/lower_intrinsics.rs:+1:14: +1:45
}
diff --git a/src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff b/src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
index e0a5416b2..22ef75fd8 100644
--- a/src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
+++ b/src/test/mir-opt/lower_intrinsics.wrapping.LowerIntrinsics.diff
@@ -32,7 +32,7 @@
_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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:7:14: 7:44
+- // + 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>) }
+ _3 = Add(move _4, move _5); // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:50
+ goto -> bb1; // scope 0 at $DIR/lower_intrinsics.rs:+1:14: +1:50
@@ -48,7 +48,7 @@
_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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:8:14: 8:44
+- // + 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>) }
+ _6 = Sub(move _7, move _8); // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:50
+ goto -> bb2; // scope 1 at $DIR/lower_intrinsics.rs:+2:14: +2:50
@@ -64,7 +64,7 @@
_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
- // mir::Constant
-- // + span: $DIR/lower_intrinsics.rs:9:14: 9:44
+- // + span: $DIR/lower_intrinsics.rs:11:14: 11:44
- // + literal: Const { ty: extern "rust-intrinsic" fn(i32, i32) -> i32 {wrapping_mul::<i32>}, val: Value(<ZST>) }
+ _9 = Mul(move _10, move _11); // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:50
+ goto -> bb3; // scope 2 at $DIR/lower_intrinsics.rs:+3:14: +3:50
diff --git a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir b/src/test/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir
index 9e4de2ac0..8e185323e 100644
--- a/src/test/mir-opt/lower_intrinsics.f_u64.PreCodegen.before.mir
+++ b/src/test/mir-opt/lower_intrinsics_e2e.f_u64.PreCodegen.after.mir
@@ -1,32 +1,32 @@
-// MIR for `f_u64` before PreCodegen
+// MIR for `f_u64` after PreCodegen
fn f_u64() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:16: +0:16
- let mut _1: u64; // in scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:21
- scope 1 (inlined f_dispatch::<u64>) { // at $DIR/lower_intrinsics.rs:40:5: 40:21
- debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+5:22: +5:23
- let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:+9:9: +9:21
- let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics.rs:+9:19: +9:20
- scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32
+ let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics_e2e.rs:+0:16: +0:16
+ let mut _1: u64; // in scope 0 at $DIR/lower_intrinsics_e2e.rs:+1:5: +1:21
+ scope 1 (inlined f_dispatch::<u64>) { // at $DIR/lower_intrinsics_e2e.rs:15:5: 15:21
+ 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:23:9: 23:21
+ let mut _3: u64; // in scope 1 at $DIR/lower_intrinsics_e2e.rs:23:19: 23:20
+ scope 2 (inlined std::mem::size_of::<u64>) { // at $DIR/lower_intrinsics_e2e.rs:20:8: 20:32
}
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:21
- _1 = const 0_u64; // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:21
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+9:9: +9:21
- StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+9:19: +9:20
- _3 = move _1; // scope 1 at $DIR/lower_intrinsics.rs:+9:19: +9:20
- _2 = f_non_zst::<u64>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+9:9: +9:21
+ StorageLive(_1); // scope 0 at $DIR/lower_intrinsics_e2e.rs:+1:5: +1:21
+ _1 = const 0_u64; // 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
+ StorageLive(_3); // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:19: 23:20
+ _3 = move _1; // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:19: 23:20
+ _2 = f_non_zst::<u64>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:9: 23:21
// mir::Constant
- // + span: $DIR/lower_intrinsics.rs:48:9: 48:18
+ // + span: $DIR/lower_intrinsics_e2e.rs:23:9: 23:18
// + literal: Const { ty: fn(u64) {f_non_zst::<u64>}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:+9:20: +9:21
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+9:21: +9:22
- StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:5: +1:21
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
+ StorageDead(_3); // scope 1 at $DIR/lower_intrinsics_e2e.rs:23:20: 23:21
+ 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/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir b/src/test/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir
index 9a6c0457f..a5b396ca0 100644
--- a/src/test/mir-opt/lower_intrinsics.f_unit.PreCodegen.before.mir
+++ b/src/test/mir-opt/lower_intrinsics_e2e.f_unit.PreCodegen.after.mir
@@ -1,30 +1,30 @@
-// MIR for `f_unit` before PreCodegen
+// MIR for `f_unit` after PreCodegen
fn f_unit() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/lower_intrinsics.rs:+0:17: +0:17
- let mut _1: (); // in scope 0 at $DIR/lower_intrinsics.rs:+1:16: +1:18
- scope 1 (inlined f_dispatch::<()>) { // at $DIR/lower_intrinsics.rs:34:5: 34:19
- debug t => _1; // in scope 1 at $DIR/lower_intrinsics.rs:+11:22: +11:23
- let _2: (); // in scope 1 at $DIR/lower_intrinsics.rs:+13:9: +13:17
- let mut _3: (); // in scope 1 at $DIR/lower_intrinsics.rs:+13:15: +13:16
- scope 2 (inlined std::mem::size_of::<()>) { // at $DIR/lower_intrinsics.rs:45:8: 45:32
+ 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
+ let mut _3: (); // in scope 1 at $DIR/lower_intrinsics_e2e.rs:21:15: 21:16
+ 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.rs:+1:16: +1:18
- StorageLive(_2); // scope 1 at $DIR/lower_intrinsics.rs:+13:9: +13:17
- StorageLive(_3); // scope 1 at $DIR/lower_intrinsics.rs:+13:15: +13:16
- _2 = f_zst::<()>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics.rs:+13:9: +13:17
+ 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
+ StorageLive(_3); // scope 1 at $DIR/lower_intrinsics_e2e.rs:21:15: 21:16
+ _2 = f_zst::<()>(move _3) -> bb1; // scope 1 at $DIR/lower_intrinsics_e2e.rs:21:9: 21:17
// mir::Constant
- // + span: $DIR/lower_intrinsics.rs:46:9: 46:14
+ // + span: $DIR/lower_intrinsics_e2e.rs:21:9: 21:14
// + literal: Const { ty: fn(()) {f_zst::<()>}, val: Value(<ZST>) }
}
bb1: {
- StorageDead(_3); // scope 1 at $DIR/lower_intrinsics.rs:+13:16: +13:17
- StorageDead(_2); // scope 1 at $DIR/lower_intrinsics.rs:+13:17: +13:18
- StorageDead(_1); // scope 0 at $DIR/lower_intrinsics.rs:+1:18: +1:19
- return; // scope 0 at $DIR/lower_intrinsics.rs:+2:2: +2:2
+ StorageDead(_3); // scope 1 at $DIR/lower_intrinsics_e2e.rs:21:16: 21:17
+ 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/src/test/mir-opt/lower_intrinsics_e2e.rs b/src/test/mir-opt/lower_intrinsics_e2e.rs
new file mode 100644
index 000000000..872ef59b0
--- /dev/null
+++ b/src/test/mir-opt/lower_intrinsics_e2e.rs
@@ -0,0 +1,32 @@
+// Checks that we do not have any branches in the MIR for the two tested functions.
+
+// compile-flags: -Cpanic=abort
+#![feature(core_intrinsics)]
+#![crate_type = "lib"]
+
+// EMIT_MIR lower_intrinsics_e2e.f_unit.PreCodegen.after.mir
+pub fn f_unit() {
+ f_dispatch(());
+}
+
+
+// EMIT_MIR lower_intrinsics_e2e.f_u64.PreCodegen.after.mir
+pub fn f_u64() {
+ f_dispatch(0u64);
+}
+
+#[inline(always)]
+pub fn f_dispatch<T>(t: T) {
+ if std::mem::size_of::<T>() == 0 {
+ f_zst(t);
+ } else {
+ f_non_zst(t);
+ }
+}
+
+#[inline(never)]
+pub fn f_zst<T>(_t: T) {
+}
+
+#[inline(never)]
+pub fn f_non_zst<T>(_t: T) {}
diff --git a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
index 46fccba56..5f5d6e68f 100644
--- a/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
+++ b/src/test/mir-opt/lower_slice_len.bound.LowerSliceLenCalls.diff
@@ -23,7 +23,7 @@
- _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
-- // + literal: Const { ty: for<'r> fn(&'r [u8]) -> usize {core::slice::<impl [u8]>::len}, val: Value(<ZST>) }
+- // + 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/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
index c05ed00f7..b193a8d76 100644
--- a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
+++ b/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir
@@ -51,7 +51,7 @@ fn full_tested_match() -> () {
bb5: {
StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
- _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
+ _11 = const _; // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15
// mir::Constant
// + span: $DIR/match_false_edges.rs:14:14: 14:15
// + literal: Const { ty: &Option<i32>, val: Unevaluated(full_tested_match, [], Some(promoted[0])) }
diff --git a/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.32bit.diff
deleted file mode 100644
index 2005c10ef..000000000
--- a/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.32bit.diff
+++ /dev/null
@@ -1,88 +0,0 @@
-- // MIR for `bar` before MatchBranchSimplification
-+ // MIR for `bar` after MatchBranchSimplification
-
- fn bar(_1: i32) -> (bool, bool, bool, bool) {
- debug i => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:9
- let mut _0: (bool, bool, bool, bool); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:19: +0:43
- let _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
- let _6: (); // in scope 0 at $DIR/matches_reduce_branches.rs:+6:5: +21:6
- let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
- let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
- let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
- let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
-+ let mut _11: i32; // in scope 0 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
- scope 1 {
- debug a => _2; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
- let _3: bool; // in scope 1 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
- scope 2 {
- debug b => _3; // in scope 2 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
- let _4: bool; // in scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
- scope 3 {
- debug c => _4; // in scope 3 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
- let _5: bool; // in scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
- scope 4 {
- debug d => _5; // in scope 4 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
- }
- }
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:10
- StorageLive(_3); // scope 1 at $DIR/matches_reduce_branches.rs:+2:9: +2:10
- StorageLive(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+3:9: +3:10
- StorageLive(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+4:9: +4:10
- StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +21:6
-- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
-- }
--
-- bb1: {
-- _2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+15:13: +15:21
-- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+16:13: +16:22
-- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+17:13: +17:22
-- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+18:13: +18:21
-- nop; // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
-- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
-- }
--
-- bb2: {
-- _2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+8:13: +8:22
-- _3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+9:13: +9:21
-+ StorageLive(_11); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
-+ _11 = _1; // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
-+ _2 = Ne(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:+8:13: +8:22
-+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:+9:13: +9:21
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+10:13: +10:22
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+11:13: +11:21
-- nop; // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
-- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
-- }
--
-- bb3: {
-+ StorageDead(_11); // scope 4 at $DIR/matches_reduce_branches.rs:+6:5: +6:12
- StorageDead(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+21:6: +21:7
- StorageLive(_7); // scope 4 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
- _7 = _2; // scope 4 at $DIR/matches_reduce_branches.rs:+23:6: +23:7
- StorageLive(_8); // scope 4 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
- _8 = _3; // scope 4 at $DIR/matches_reduce_branches.rs:+23:9: +23:10
- StorageLive(_9); // scope 4 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
- _9 = _4; // scope 4 at $DIR/matches_reduce_branches.rs:+23:12: +23:13
- StorageLive(_10); // scope 4 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
- _10 = _5; // scope 4 at $DIR/matches_reduce_branches.rs:+23:15: +23:16
- Deinit(_0); // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
- (_0.0: bool) = move _7; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
- (_0.1: bool) = move _8; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
- (_0.2: bool) = move _9; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
- (_0.3: bool) = move _10; // scope 4 at $DIR/matches_reduce_branches.rs:+23:5: +23:17
- StorageDead(_10); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_9); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_8); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_7); // scope 4 at $DIR/matches_reduce_branches.rs:+23:16: +23:17
- StorageDead(_5); // scope 3 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- StorageDead(_4); // scope 2 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- StorageDead(_3); // scope 1 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+24:1: +24:2
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+24:2: +24:2
- }
- }
-
diff --git a/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff
index 2005c10ef..f9eeb1ea5 100644
--- a/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.64bit.diff
+++ b/src/test/mir-opt/matches_reduce_branches.bar.MatchBranchSimplification.diff
@@ -41,7 +41,7 @@
- _3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+16:13: +16:22
- _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+17:13: +17:22
- _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+18:13: +18:21
-- nop; // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
+- Deinit(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+19:13: +19:15
- }
-
@@ -54,7 +54,7 @@
+ _3 = Eq(_11, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:+9:13: +9:21
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:+10:13: +10:22
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:+11:13: +11:21
-- nop; // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
+ Deinit(_6); // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
- goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:+12:13: +12:15
- }
-
diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff
deleted file mode 100644
index b7862e567..000000000
--- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.32bit.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-- // MIR for `foo` before MatchBranchSimplification
-+ // MIR for `foo` after MatchBranchSimplification
-
- fn foo(_1: Option<()>) -> () {
- debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:11
- let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:25
- let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:22: +1:26
-+ let mut _3: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:17: +1:20
-- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- }
--
-- bb1: {
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- }
--
-- bb2: {
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- }
--
-- bb3: {
-+ StorageLive(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ _3 = move _2; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ StorageDead(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+4:2: +4:2
- }
- }
-
diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff
deleted file mode 100644
index b7862e567..000000000
--- a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.64bit.diff
+++ /dev/null
@@ -1,30 +0,0 @@
-- // MIR for `foo` before MatchBranchSimplification
-+ // MIR for `foo` after MatchBranchSimplification
-
- fn foo(_1: Option<()>) -> () {
- debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:11
- let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:25
- let mut _2: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:22: +1:26
-+ let mut _3: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:17: +1:20
-- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- }
--
-- bb1: {
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- }
--
-- bb2: {
-- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-- }
--
-- bb3: {
-+ StorageLive(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ _3 = move _2; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ StorageDead(_3); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+4:2: +4:2
- }
- }
-
diff --git a/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
new file mode 100644
index 000000000..0b40b3be8
--- /dev/null
+++ b/src/test/mir-opt/matches_reduce_branches.foo.MatchBranchSimplification.diff
@@ -0,0 +1,55 @@
+- // MIR for `foo` before MatchBranchSimplification
++ // MIR for `foo` after MatchBranchSimplification
+
+ fn foo(_1: Option<()>) -> () {
+ debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:11
+ let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:25
+ let mut _2: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ let mut _3: isize; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:22: +1:26
++ let mut _4: isize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:17: +1:20
+- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
++ StorageLive(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
++ _4 = move _3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
++ _2 = Eq(_4, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
++ StorageDead(_4); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
++ switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ }
+
+ bb1: {
+- _2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- }
+-
+- bb2: {
+- _2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- }
+-
+- bb3: {
+- switchInt(move _2) -> [false: bb5, otherwise: bb4]; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+- }
+-
+- bb4: {
+ Deinit(_0); // scope 0 at $DIR/matches_reduce_branches.rs:+2:9: +2:11
+- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
++ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
+ }
+
+- bb5: {
++ bb2: {
+ _0 = const (); // scope 0 at $DIR/matches_reduce_branches.rs:+3:6: +3:6
+- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
++ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+1:5: +3:6
+ }
+
+- bb6: {
++ bb3: {
+ StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+3:5: +3:6
+ return; // scope 0 at $DIR/matches_reduce_branches.rs:+4:2: +4:2
+ }
+ }
+
diff --git a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.32bit.mir b/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.32bit.mir
deleted file mode 100644
index a36ec8de4..000000000
--- a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.32bit.mir
+++ /dev/null
@@ -1,10 +0,0 @@
-// MIR for `foo` before PreCodegen
-
-fn foo(_1: Option<()>) -> () {
- debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:11
- let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:25
-
- bb0: {
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+4:2: +4:2
- }
-}
diff --git a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir b/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir
deleted file mode 100644
index a36ec8de4..000000000
--- a/src/test/mir-opt/matches_reduce_branches.foo.PreCodegen.before.64bit.mir
+++ /dev/null
@@ -1,10 +0,0 @@
-// MIR for `foo` before PreCodegen
-
-fn foo(_1: Option<()>) -> () {
- debug bar => _1; // in scope 0 at $DIR/matches_reduce_branches.rs:+0:8: +0:11
- let mut _0: (); // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:25
-
- bb0: {
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+4:2: +4:2
- }
-}
diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff
deleted file mode 100644
index 672c6b34e..000000000
--- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.32bit.diff
+++ /dev/null
@@ -1,42 +0,0 @@
-- // MIR for `match_nested_if` before MatchBranchSimplification
-+ // MIR for `match_nested_if` after MatchBranchSimplification
-
- fn match_nested_if() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:29
- let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- let mut _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- scope 1 {
- debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- _2 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-- }
--
-- bb1: {
-+ StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ _3 = move _2; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
-- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
-- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
-- }
--
-- bb2: {
-- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
-- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-- }
--
-- bb3: {
-+ _1 = Ne(_3, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-+ StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- _0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:+12:5: +12:8
- StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+13:1: +13:2
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+13:2: +13:2
- }
- }
-
diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff
deleted file mode 100644
index 672c6b34e..000000000
--- a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.64bit.diff
+++ /dev/null
@@ -1,42 +0,0 @@
-- // MIR for `match_nested_if` before MatchBranchSimplification
-+ // MIR for `match_nested_if` after MatchBranchSimplification
-
- fn match_nested_if() -> bool {
- let mut _0: bool; // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:29
- let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- let mut _2: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- scope 1 {
- debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
- StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- _2 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-- switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-- }
--
-- bb1: {
-+ StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
-+ _3 = move _2; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
-- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
-- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
-- }
--
-- bb2: {
-- StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
-- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-- }
--
-- bb3: {
-+ _1 = Ne(_3, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
-+ StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
- _0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:+12:5: +12:8
- StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+13:1: +13:2
- return; // scope 0 at $DIR/matches_reduce_branches.rs:+13:2: +13:2
- }
- }
-
diff --git a/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
new file mode 100644
index 000000000..b8c7722cd
--- /dev/null
+++ b/src/test/mir-opt/matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
@@ -0,0 +1,113 @@
+- // MIR for `match_nested_if` before MatchBranchSimplification
++ // MIR for `match_nested_if` after MatchBranchSimplification
+
+ fn match_nested_if() -> bool {
+ let mut _0: bool; // return place in scope 0 at $DIR/matches_reduce_branches.rs:+0:25: +0:29
+ let _1: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
+ let mut _2: (); // in scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
+ let mut _3: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+ let mut _4: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+ let mut _5: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+ let mut _6: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
++ let mut _7: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
++ let mut _8: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
++ let mut _9: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
++ let mut _10: bool; // in scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+ scope 1 {
+ debug val => _1; // in scope 1 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
+ }
+
+ bb0: {
+ StorageLive(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+1:9: +1:12
+ StorageLive(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
+ Deinit(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+1:21: +1:23
+ StorageLive(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+ StorageLive(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+ StorageLive(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+ StorageLive(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+ _6 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+- switchInt(move _6) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+- }
+-
+- bb1: {
+- _5 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:31: +2:35
+- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+- }
+-
+- bb2: {
+- _5 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50
+- goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+- }
+-
+- bb3: {
++ StorageLive(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
++ _7 = move _6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
++ _5 = Ne(_7, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:45: +2:50
++ StorageDead(_7); // scope 0 at $DIR/matches_reduce_branches.rs:+2:24: +2:28
+ StorageDead(_6); // scope 0 at $DIR/matches_reduce_branches.rs:+2:51: +2:52
+- switchInt(move _5) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+- }
+-
+- bb4: {
+- _4 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+2:55: +2:59
+- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+- }
+-
+- bb5: {
+- _4 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74
+- goto -> bb6; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+- }
+-
+- bb6: {
++ StorageLive(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
++ _8 = move _5; // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
++ _4 = Ne(_8, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+2:69: +2:74
++ StorageDead(_8); // scope 0 at $DIR/matches_reduce_branches.rs:+2:21: +2:52
+ StorageDead(_5); // scope 0 at $DIR/matches_reduce_branches.rs:+2:75: +2:76
+- switchInt(move _4) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
+- }
+-
+- bb7: {
+- _3 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+3:13: +3:17
+- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+- }
+-
+- bb8: {
+- _3 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+5:13: +5:18
+- goto -> bb9; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+- }
+-
+- bb9: {
+- switchInt(move _3) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+- }
+-
+- bb10: {
++ StorageLive(_9); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
++ _9 = move _4; // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
++ _3 = Ne(_9, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+5:13: +5:18
++ StorageDead(_9); // scope 0 at $DIR/matches_reduce_branches.rs:+2:18: +2:76
++ StorageLive(_10); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
++ _10 = move _3; // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+ StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
+ StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
+- _1 = const true; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
+- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:+8:13: +8:17
+- }
+-
+- bb11: {
+- StorageDead(_4); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
+- StorageDead(_3); // scope 0 at $DIR/matches_reduce_branches.rs:+6:9: +6:10
+- _1 = const false; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
+- goto -> bb12; // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
+- }
+-
+- bb12: {
++ _1 = Ne(_10, const false); // scope 0 at $DIR/matches_reduce_branches.rs:+10:14: +10:19
++ StorageDead(_10); // scope 0 at $DIR/matches_reduce_branches.rs:+2:15: +6:10
+ StorageDead(_2); // scope 0 at $DIR/matches_reduce_branches.rs:+11:6: +11:7
+ _0 = _1; // scope 1 at $DIR/matches_reduce_branches.rs:+12:5: +12:8
+ StorageDead(_1); // scope 0 at $DIR/matches_reduce_branches.rs:+13:1: +13:2
+ return; // scope 0 at $DIR/matches_reduce_branches.rs:+13:2: +13:2
+ }
+ }
+
diff --git a/src/test/mir-opt/matches_reduce_branches.rs b/src/test/mir-opt/matches_reduce_branches.rs
index 51be3884d..a81d5f7b4 100644
--- a/src/test/mir-opt/matches_reduce_branches.rs
+++ b/src/test/mir-opt/matches_reduce_branches.rs
@@ -1,6 +1,7 @@
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+// unit-test: MatchBranchSimplification
+
+
// EMIT_MIR matches_reduce_branches.foo.MatchBranchSimplification.diff
-// EMIT_MIR matches_reduce_branches.foo.PreCodegen.before.mir
// EMIT_MIR matches_reduce_branches.bar.MatchBranchSimplification.diff
// EMIT_MIR matches_reduce_branches.match_nested_if.MatchBranchSimplification.diff
diff --git a/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.64bit.diff
deleted file mode 100644
index c42657b38..000000000
--- a/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.64bit.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-- // MIR for `exhaustive_match` before MatchBranchSimplification
-+ // MIR for `exhaustive_match` after MatchBranchSimplification
-
- fn exhaustive_match(_1: E) -> u8 {
- debug e => _1; // in scope 0 at $DIR/matches_u8.rs:+0:25: +0:26
- let mut _0: u8; // return place in scope 0 at $DIR/matches_u8.rs:+0:34: +0:36
- let mut _2: isize; // in scope 0 at $DIR/matches_u8.rs:+2:9: +2:13
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
- }
-
- bb1: {
- _0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- }
-
- bb2: {
- _0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- }
-
- bb3: {
- return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
- }
- }
-
diff --git a/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
index c42657b38..1b4dddc1d 100644
--- a/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.32bit.diff
+++ b/src/test/mir-opt/matches_u8.exhaustive_match.MatchBranchSimplification.diff
@@ -8,20 +8,24 @@
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
+ switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
}
bb1: {
_0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
+ goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
}
bb2: {
- _0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
}
bb3: {
+ _0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ }
+
+ bb4: {
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
}
}
diff --git a/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.64bit.diff b/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.64bit.diff
deleted file mode 100644
index a4ff2e437..000000000
--- a/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.64bit.diff
+++ /dev/null
@@ -1,28 +0,0 @@
-- // MIR for `exhaustive_match_i8` before MatchBranchSimplification
-+ // MIR for `exhaustive_match_i8` after MatchBranchSimplification
-
- fn exhaustive_match_i8(_1: E) -> i8 {
- debug e => _1; // in scope 0 at $DIR/matches_u8.rs:+0:28: +0:29
- let mut _0: i8; // return place in scope 0 at $DIR/matches_u8.rs:+0:37: +0:39
- let mut _2: isize; // in scope 0 at $DIR/matches_u8.rs:+2:9: +2:13
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
- }
-
- bb1: {
- _0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- }
-
- bb2: {
- _0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- }
-
- bb3: {
- return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
- }
- }
-
diff --git a/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.32bit.diff b/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
index a4ff2e437..6e734852e 100644
--- a/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.32bit.diff
+++ b/src/test/mir-opt/matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
@@ -8,20 +8,24 @@
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
+ switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/matches_u8.rs:+1:5: +1:12
}
bb1: {
_0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
+ goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+3:17: +3:18
}
bb2: {
- _0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
- goto -> bb3; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ unreachable; // scope 0 at $DIR/matches_u8.rs:+1:11: +1:12
}
bb3: {
+ _0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ goto -> bb4; // scope 0 at $DIR/matches_u8.rs:+2:17: +2:18
+ }
+
+ bb4: {
return; // scope 0 at $DIR/matches_u8.rs:+5:2: +5:2
}
}
diff --git a/src/test/mir-opt/matches_u8.rs b/src/test/mir-opt/matches_u8.rs
index 78373be48..422c3a95e 100644
--- a/src/test/mir-opt/matches_u8.rs
+++ b/src/test/mir-opt/matches_u8.rs
@@ -1,4 +1,6 @@
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+// unit-test: MatchBranchSimplification
+
+
// EMIT_MIR matches_u8.exhaustive_match.MatchBranchSimplification.diff
// EMIT_MIR matches_u8.exhaustive_match_i8.MatchBranchSimplification.diff
diff --git a/src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir b/src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir
index cbfdf8c5d..0ab9d712d 100644
--- a/src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir
+++ b/src/test/mir-opt/nll/named_lifetimes_basic.use_x.nll.0.mir
@@ -13,11 +13,10 @@
| '_#2r | U0 | {bb0[0..=1], '_#2r}
| '_#3r | U0 | {bb0[0..=1], '_#3r}
| '_#4r | U0 | {bb0[0..=1], '_#4r}
-| '_#5r | U0 | {}
-| '_#6r | U0 | {bb0[0..=1], '_#1r}
-| '_#7r | U0 | {bb0[0..=1], '_#2r}
-| '_#8r | U0 | {bb0[0..=1], '_#1r}
-| '_#9r | U0 | {bb0[0..=1], '_#3r}
+| '_#5r | U0 | {bb0[0..=1], '_#1r}
+| '_#6r | U0 | {bb0[0..=1], '_#2r}
+| '_#7r | U0 | {bb0[0..=1], '_#1r}
+| '_#8r | U0 | {bb0[0..=1], '_#3r}
|
| Inference Constraints
| '_#0r live at {bb0[0..=1]}
@@ -25,16 +24,16 @@
| '_#2r live at {bb0[0..=1]}
| '_#3r live at {bb0[0..=1]}
| '_#4r live at {bb0[0..=1]}
-| '_#1r: '_#6r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:26: 12:27) ($DIR/named-lifetimes-basic.rs:12:26: 12:27 (#0)
-| '_#1r: '_#8r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:54: 12:55) ($DIR/named-lifetimes-basic.rs:12:54: 12:55 (#0)
-| '_#2r: '_#7r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:42: 12:43) ($DIR/named-lifetimes-basic.rs:12:42: 12:43 (#0)
-| '_#3r: '_#9r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:66: 12:67) ($DIR/named-lifetimes-basic.rs:12:66: 12:67 (#0)
-| '_#6r: '_#1r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:26: 12:27) ($DIR/named-lifetimes-basic.rs:12:26: 12:27 (#0)
-| '_#7r: '_#2r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:42: 12:43) ($DIR/named-lifetimes-basic.rs:12:42: 12:43 (#0)
-| '_#8r: '_#1r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:54: 12:55) ($DIR/named-lifetimes-basic.rs:12:54: 12:55 (#0)
-| '_#9r: '_#3r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:66: 12:67) ($DIR/named-lifetimes-basic.rs:12:66: 12:67 (#0)
+| '_#1r: '_#5r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:26: 12:27) ($DIR/named-lifetimes-basic.rs:12:26: 12:27 (#0)
+| '_#1r: '_#7r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:54: 12:55) ($DIR/named-lifetimes-basic.rs:12:54: 12:55 (#0)
+| '_#2r: '_#6r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:42: 12:43) ($DIR/named-lifetimes-basic.rs:12:42: 12:43 (#0)
+| '_#3r: '_#8r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:66: 12:67) ($DIR/named-lifetimes-basic.rs:12:66: 12:67 (#0)
+| '_#5r: '_#1r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:26: 12:27) ($DIR/named-lifetimes-basic.rs:12:26: 12:27 (#0)
+| '_#6r: '_#2r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:42: 12:43) ($DIR/named-lifetimes-basic.rs:12:42: 12:43 (#0)
+| '_#7r: '_#1r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:54: 12:55) ($DIR/named-lifetimes-basic.rs:12:54: 12:55 (#0)
+| '_#8r: '_#3r due to BoringNoLocation at All($DIR/named-lifetimes-basic.rs:12:66: 12:67) ($DIR/named-lifetimes-basic.rs:12:66: 12:67 (#0)
|
-fn use_x(_1: &'_#6r mut i32, _2: &'_#7r u32, _3: &'_#8r u32, _4: &'_#9r u32) -> bool {
+fn use_x(_1: &'_#5r mut i32, _2: &'_#6r u32, _3: &'_#7r u32, _4: &'_#8r u32) -> bool {
debug w => _1; // in scope 0 at $DIR/named-lifetimes-basic.rs:+0:26: +0:27
debug x => _2; // in scope 0 at $DIR/named-lifetimes-basic.rs:+0:42: +0:43
debug y => _3; // in scope 0 at $DIR/named-lifetimes-basic.rs:+0:54: +0:55
diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir
index 55e7faf9e..36705d18e 100644
--- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir
+++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.32bit.mir
@@ -7,19 +7,18 @@
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r}
| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r}
-| '_#2r | U0 | {}
-| '_#3r | U0 | {bb1[0..=7], bb2[0..=2]}
-| '_#4r | U0 | {bb1[1..=7], bb2[0..=2]}
-| '_#5r | U0 | {bb1[4..=7], bb2[0..=2]}
+| '_#2r | U0 | {bb1[0..=7], bb2[0..=2]}
+| '_#3r | U0 | {bb1[1..=7], bb2[0..=2]}
+| '_#4r | U0 | {bb1[4..=7], bb2[0..=2]}
|
| Inference Constraints
| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
-| '_#3r live at {bb1[0]}
-| '_#4r live at {bb1[1..=3]}
-| '_#5r live at {bb1[4..=7], bb2[0..=2]}
-| '_#3r: '_#4r due to Assignment at Single(bb1[0]) ($DIR/region-subtyping-basic.rs:18:13: 18:18 (#0)
-| '_#4r: '_#5r due to Assignment at Single(bb1[3]) ($DIR/region-subtyping-basic.rs:19:13: 19:14 (#0)
+| '_#2r live at {bb1[0]}
+| '_#3r live at {bb1[1..=3]}
+| '_#4r live at {bb1[4..=7], bb2[0..=2]}
+| '_#2r: '_#3r due to Assignment at Single(bb1[0]) ($DIR/region-subtyping-basic.rs:18:13: 18:18 (#0)
+| '_#3r: '_#4r due to Assignment at Single(bb1[3]) ($DIR/region-subtyping-basic.rs:19:13: 19:14 (#0)
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/region-subtyping-basic.rs:+0:11: +0:11
@@ -33,10 +32,10 @@ fn main() -> () {
let _10: bool; // in scope 0 at $DIR/region-subtyping-basic.rs:+7:9: +7:18
scope 1 {
debug v => _1; // in scope 1 at $DIR/region-subtyping-basic.rs:+1:9: +1:14
- let _2: &'_#4r usize; // in scope 1 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
+ let _2: &'_#3r usize; // in scope 1 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
scope 2 {
debug p => _2; // in scope 2 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
- let _6: &'_#5r usize; // in scope 2 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
+ let _6: &'_#4r usize; // in scope 2 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
scope 3 {
debug q => _6; // in scope 3 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
}
@@ -56,7 +55,7 @@ fn main() -> () {
}
bb1: {
- _2 = &'_#3r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:+2:13: +2:18
+ _2 = &'_#2r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:+2:13: +2:18
FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
_6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:+3:13: +3:14
diff --git a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir
index 2647c9433..4f6256a67 100644
--- a/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir
+++ b/src/test/mir-opt/nll/region_subtyping_basic.main.nll.0.64bit.mir
@@ -7,19 +7,18 @@
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#0r, '_#1r}
| '_#1r | U0 | {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0], '_#1r}
-| '_#2r | U0 | {}
-| '_#3r | U0 | {bb1[0..=7], bb2[0..=2]}
-| '_#4r | U0 | {bb1[1..=7], bb2[0..=2]}
-| '_#5r | U0 | {bb1[4..=7], bb2[0..=2]}
+| '_#2r | U0 | {bb1[0..=7], bb2[0..=2]}
+| '_#3r | U0 | {bb1[1..=7], bb2[0..=2]}
+| '_#4r | U0 | {bb1[4..=7], bb2[0..=2]}
|
| Inference Constraints
| '_#0r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
| '_#1r live at {bb0[0..=8], bb1[0..=7], bb2[0..=3], bb3[0..=3], bb4[0..=1], bb5[0..=2], bb6[0..=5], bb7[0]}
-| '_#3r live at {bb1[0]}
-| '_#4r live at {bb1[1..=3]}
-| '_#5r live at {bb1[4..=7], bb2[0..=2]}
-| '_#3r: '_#4r due to Assignment at Single(bb1[0]) ($DIR/region-subtyping-basic.rs:18:13: 18:18 (#0)
-| '_#4r: '_#5r due to Assignment at Single(bb1[3]) ($DIR/region-subtyping-basic.rs:19:13: 19:14 (#0)
+| '_#2r live at {bb1[0]}
+| '_#3r live at {bb1[1..=3]}
+| '_#4r live at {bb1[4..=7], bb2[0..=2]}
+| '_#2r: '_#3r due to Assignment at Single(bb1[0]) ($DIR/region-subtyping-basic.rs:18:13: 18:18 (#0)
+| '_#3r: '_#4r due to Assignment at Single(bb1[3]) ($DIR/region-subtyping-basic.rs:19:13: 19:14 (#0)
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/region-subtyping-basic.rs:+0:11: +0:11
@@ -33,10 +32,10 @@ fn main() -> () {
let _10: bool; // in scope 0 at $DIR/region-subtyping-basic.rs:+7:9: +7:18
scope 1 {
debug v => _1; // in scope 1 at $DIR/region-subtyping-basic.rs:+1:9: +1:14
- let _2: &'_#4r usize; // in scope 1 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
+ let _2: &'_#3r usize; // in scope 1 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
scope 2 {
debug p => _2; // in scope 2 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
- let _6: &'_#5r usize; // in scope 2 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
+ let _6: &'_#4r usize; // in scope 2 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
scope 3 {
debug q => _6; // in scope 3 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
}
@@ -56,7 +55,7 @@ fn main() -> () {
}
bb1: {
- _2 = &'_#3r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:+2:13: +2:18
+ _2 = &'_#2r _1[_3]; // bb1[0]: scope 1 at $DIR/region-subtyping-basic.rs:+2:13: +2:18
FakeRead(ForLet(None), _2); // bb1[1]: scope 1 at $DIR/region-subtyping-basic.rs:+2:9: +2:10
StorageLive(_6); // bb1[2]: scope 2 at $DIR/region-subtyping-basic.rs:+3:9: +3:10
_6 = _2; // bb1[3]: scope 2 at $DIR/region-subtyping-basic.rs:+3:13: +3:14
diff --git a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir b/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
index 25c6e3060..963e7cde6 100644
--- a/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
+++ b/src/test/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
@@ -20,7 +20,7 @@ fn main() -> () {
_2 = <str as ToString>::to_string(move _3) -> bb1; // scope 0 at $DIR/no-spurious-drop-after-call.rs:+1:20: +1:34
// mir::Constant
// + span: $DIR/no-spurious-drop-after-call.rs:9:23: 9:32
- // + literal: Const { ty: for<'r> fn(&'r str) -> String {<str as ToString>::to_string}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a str) -> String {<str as ToString>::to_string}, val: Value(<ZST>) }
}
bb1: {
diff --git a/src/test/mir-opt/not_equal_false.rs b/src/test/mir-opt/not_equal_false.rs
index 5fbb848dc..2ae03da40 100644
--- a/src/test/mir-opt/not_equal_false.rs
+++ b/src/test/mir-opt/not_equal_false.rs
@@ -1,3 +1,4 @@
+// unit-test: InstCombine
// EMIT_MIR not_equal_false.opt.InstCombine.diff
fn opt(x: bool) -> u32 {
diff --git a/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff b/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff
index 9e89bd9fb..ce35f920b 100644
--- a/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff
+++ b/src/test/mir-opt/nrvo_simple.nrvo.RenameReturnPlace.diff
@@ -1,13 +1,13 @@
- // MIR for `nrvo` before RenameReturnPlace
+ // MIR for `nrvo` after RenameReturnPlace
- fn nrvo(_1: for<'r> fn(&'r mut [u8; 1024])) -> [u8; 1024] {
+ fn nrvo(_1: for<'a> fn(&'a mut [u8; 1024])) -> [u8; 1024] {
debug init => _1; // in scope 0 at $DIR/nrvo-simple.rs:+0:9: +0:13
- let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/nrvo-simple.rs:+0:39: +0:49
+ let mut _0: [u8; 1024]; // return place in scope 0 at $DIR/nrvo-simple.rs:+1:9: +1:16
let mut _2: [u8; 1024]; // in scope 0 at $DIR/nrvo-simple.rs:+1:9: +1:16
let _3: (); // in scope 0 at $DIR/nrvo-simple.rs:+2:5: +2:19
- let mut _4: for<'r> fn(&'r mut [u8; 1024]); // in scope 0 at $DIR/nrvo-simple.rs:+2:5: +2:9
+ let mut _4: for<'a> fn(&'a mut [u8; 1024]); // in scope 0 at $DIR/nrvo-simple.rs:+2:5: +2:9
let mut _5: &mut [u8; 1024]; // in scope 0 at $DIR/nrvo-simple.rs:+2:10: +2:18
let mut _6: &mut [u8; 1024]; // in scope 0 at $DIR/nrvo-simple.rs:+2:10: +2:18
scope 1 {
diff --git a/src/test/mir-opt/packed-struct-drop-aligned.rs b/src/test/mir-opt/packed-struct-drop-aligned.rs
index 6c2e265d5..cb6524260 100644
--- a/src/test/mir-opt/packed-struct-drop-aligned.rs
+++ b/src/test/mir-opt/packed-struct-drop-aligned.rs
@@ -1,6 +1,6 @@
// ignore-wasm32-bare compiled with panic=abort by default
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir
fn main() {
let mut x = Packed(Aligned(Droppy(0)));
diff --git a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir b/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir
deleted file mode 100644
index c3874d3b3..000000000
--- a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.32bit.mir
+++ /dev/null
@@ -1,55 +0,0 @@
-// MIR for `main` after SimplifyCfg-elaborate-drops
-
-fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/packed-struct-drop-aligned.rs:+0:11: +0:11
- let mut _1: Packed; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:9: +1:14
- let mut _2: Aligned; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
- let mut _3: Droppy; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
- let mut _4: Aligned; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
- let mut _5: Droppy; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
- let mut _6: Aligned; // in scope 0 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
- scope 1 {
- debug x => _1; // in scope 1 at $DIR/packed-struct-drop-aligned.rs:+1:9: +1:14
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:9: +1:14
- StorageLive(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
- StorageLive(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
- _3 = Droppy(const 0_usize); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
- _2 = Aligned(move _3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
- StorageDead(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:41: +1:42
- _1 = Packed(move _2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:17: +1:43
- StorageDead(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:42: +1:43
- StorageLive(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
- StorageLive(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
- _5 = Droppy(const 0_usize); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
- _4 = Aligned(move _5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
- StorageDead(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:28: +2:29
- StorageLive(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
- _6 = move (_1.0: Aligned); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
- drop(_6) -> [return: bb4, unwind: bb3]; // 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
- }
-
- bb2 (cleanup): {
- resume; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+0:1: +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
- }
-
- bb4: {
- StorageDead(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
- (_1.0: Aligned) = move _4; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
- StorageDead(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:28: +2:29
- _0 = const (); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+0:11: +3:2
- drop(_1) -> [return: bb1, unwind: bb2]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+3:1: +3:2
- }
-}
diff --git a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.64bit.mir b/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir
index c3874d3b3..f9ed1036f 100644
--- a/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.64bit.mir
+++ b/src/test/mir-opt/packed_struct_drop_aligned.main.SimplifyCfg-elaborate-drops.after.mir
@@ -16,15 +16,20 @@ fn main() -> () {
StorageLive(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:9: +1:14
StorageLive(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
StorageLive(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
- _3 = Droppy(const 0_usize); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
- _2 = Aligned(move _3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
+ Deinit(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
+ (_3.0: usize) = const 0_usize; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:32: +1:41
+ Deinit(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
+ (_2.0: Droppy) = move _3; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:24: +1:42
StorageDead(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:41: +1:42
- _1 = Packed(move _2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:17: +1:43
+ Deinit(_1); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:17: +1:43
+ (_1.0: Aligned) = move _2; // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:17: +1:43
StorageDead(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:+1:42: +1:43
StorageLive(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
StorageLive(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
- _5 = Droppy(const 0_usize); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
- _4 = Aligned(move _5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
+ Deinit(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
+ (_5.0: usize) = const 0_usize; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:19: +2:28
+ Deinit(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
+ (_4.0: Droppy) = move _5; // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:11: +2:29
StorageDead(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:28: +2:29
StorageLive(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
_6 = move (_1.0: Aligned); // scope 1 at $DIR/packed-struct-drop-aligned.rs:+2:5: +2:8
diff --git a/src/test/mir-opt/remove-never-const.rs b/src/test/mir-opt/remove-never-const.rs
index 017746647..16095cfdd 100644
--- a/src/test/mir-opt/remove-never-const.rs
+++ b/src/test/mir-opt/remove-never-const.rs
@@ -6,7 +6,6 @@
// compile-flags: --emit mir,link
#![feature(never_type)]
-#![warn(const_err)]
struct PrintName<T>(T);
diff --git a/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff b/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
index 750aaa88b..188aa5564 100644
--- a/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
+++ b/src/test/mir-opt/remove_storage_markers.main.RemoveStorageMarkers.diff
@@ -23,13 +23,6 @@
scope 3 {
debug i => _12; // in scope 3 at $DIR/remove_storage_markers.rs:+2:9: +2:10
}
- scope 5 (inlined iter::range::<impl Iterator for std::ops::Range<i32>>::next) { // at $DIR/remove_storage_markers.rs:8:14: 8:19
- debug self => _8; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- let mut _14: &mut std::ops::Range<i32>; // in scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- }
- }
- scope 4 (inlined <std::ops::Range<i32> as IntoIterator>::into_iter) { // at $DIR/remove_storage_markers.rs:8:14: 8:19
- debug self => _3; // in scope 4 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
}
}
@@ -41,29 +34,39 @@
Deinit(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
(_3.0: i32) = const 0_i32; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
(_3.1: i32) = const 10_i32; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- _2 = move _3; // scope 4 at $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+ _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
+ // + literal: Const { ty: fn(std::ops::Range<i32>) -> <std::ops::Range<i32> as IntoIterator>::IntoIter {<std::ops::Range<i32> as IntoIterator>::into_iter}, val: Value(<ZST>) }
+ }
+
+ bb1: {
- StorageDead(_3); // scope 1 at $DIR/remove_storage_markers.rs:+2:18: +2:19
- StorageLive(_4); // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_4 = move _2; // scope 1 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- goto -> bb1; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
+ goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
}
- bb1: {
+ bb2: {
- StorageLive(_6); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- StorageLive(_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_9 = &mut _4; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
_8 = &mut (*_9); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
-- StorageLive(_14); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- _14 = &mut (*_8); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
- _7 = <std::ops::Range<i32> as iter::range::RangeIteratorImpl>::spec_next(move _14) -> bb4; // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
+ _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: $SRC_DIR/core/src/iter/range.rs:LL:COL
- // + literal: Const { ty: for<'r> fn(&'r mut std::ops::Range<i32>) -> Option<<std::ops::Range<i32> as iter::range::RangeIteratorImpl>::Item> {<std::ops::Range<i32> as iter::range::RangeIteratorImpl>::spec_next}, val: Value(<ZST>) }
+ // + span: $DIR/remove_storage_markers.rs:10:14: 10: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>) }
}
- bb2: {
+ bb3: {
+- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
+ _10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
+ switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
+ }
+
+ bb4: {
- StorageLive(_12); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
_12 = ((_7 as Some).0: i32); // scope 2 at $DIR/remove_storage_markers.rs:+2:9: +2:10
- StorageLive(_13); // scope 3 at $DIR/remove_storage_markers.rs:+3:16: +3:17
@@ -76,10 +79,14 @@
- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
- StorageDead(_6); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
_5 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- goto -> bb1; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
+ goto -> bb2; // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
}
- bb3: {
+ bb5: {
+ unreachable; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
+ }
+
+ bb6: {
_0 = const (); // scope 2 at $DIR/remove_storage_markers.rs:+2:5: +4:6
- StorageDead(_9); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
- StorageDead(_7); // scope 2 at $DIR/remove_storage_markers.rs:+4:5: +4:6
@@ -89,12 +96,5 @@
- StorageDead(_1); // scope 0 at $DIR/remove_storage_markers.rs:+5:1: +5:2
return; // scope 0 at $DIR/remove_storage_markers.rs:+5:2: +5:2
}
-
- bb4: {
-- StorageDead(_14); // scope 5 at $SRC_DIR/core/src/iter/range.rs:LL:COL
-- StorageDead(_8); // scope 2 at $DIR/remove_storage_markers.rs:+2:18: +2:19
- _10 = discriminant(_7); // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- switchInt(move _10) -> [0_isize: bb3, otherwise: bb2]; // scope 2 at $DIR/remove_storage_markers.rs:+2:14: +2:19
- }
}
diff --git a/src/test/mir-opt/remove_storage_markers.rs b/src/test/mir-opt/remove_storage_markers.rs
index c144d3ff7..f00b82691 100644
--- a/src/test/mir-opt/remove_storage_markers.rs
+++ b/src/test/mir-opt/remove_storage_markers.rs
@@ -1,3 +1,5 @@
+// unit-test: RemoveStorageMarkers
+
// Checks that storage markers are removed at opt-level=0.
//
// compile-flags: -C opt-level=0 -Coverflow-checks=off
diff --git a/src/test/mir-opt/remove_zsts_dont_touch_unions.rs b/src/test/mir-opt/remove_zsts_dont_touch_unions.rs
index 7a6f86b80..8b9de9b4d 100644
--- a/src/test/mir-opt/remove_zsts_dont_touch_unions.rs
+++ b/src/test/mir-opt/remove_zsts_dont_touch_unions.rs
@@ -1,4 +1,4 @@
-// compile-flags: -Zmir-opt-level=3
+// unit-test: RemoveZsts
// Ensure RemoveZsts doesn't remove ZST assignments to union fields,
// which causes problems in Miri.
diff --git a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
index 451d0fe4c..fe57e32a7 100644
--- a/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.mir
@@ -29,7 +29,7 @@ fn array_casts() -> () {
let _31: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let mut _32: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
let _33: &usize; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- let mut _34: std::option::Option<std::fmt::Arguments>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ let mut _34: std::option::Option<std::fmt::Arguments<'_>>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
scope 1 {
debug x => _1; // in scope 1 at $DIR/retag.rs:+1:9: +1:14
let _2: *mut usize; // in scope 1 at $DIR/retag.rs:+2:9: +2:10
@@ -80,7 +80,7 @@ fn array_casts() -> () {
_7 = _2; // scope 3 at $DIR/retag.rs:+3:15: +3:16
_6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> bb1; // scope 3 at $DIR/retag.rs:+3:15: +3:23
// mir::Constant
- // + span: $DIR/retag.rs:60:17: 60:20
+ // + span: $DIR/retag.rs:61:17: 61:20
// + literal: Const { ty: unsafe fn(*mut usize, usize) -> *mut usize {ptr::mut_ptr::<impl *mut usize>::add}, val: Value(<ZST>) }
}
@@ -111,7 +111,7 @@ fn array_casts() -> () {
_17 = _9; // scope 6 at $DIR/retag.rs:+7:26: +7:27
_16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> bb2; // scope 6 at $DIR/retag.rs:+7:26: +7:34
// mir::Constant
- // + span: $DIR/retag.rs:64:28: 64:31
+ // + span: $DIR/retag.rs:65:28: 65:31
// + literal: Const { ty: unsafe fn(*const usize, usize) -> *const usize {ptr::const_ptr::<impl *const usize>::add}, val: Value(<ZST>) }
}
@@ -121,14 +121,16 @@ fn array_casts() -> () {
_14 = &_15; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Retag(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _35 = const array_casts::promoted[0]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ _35 = const _; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
// + literal: Const { ty: &usize, val: Unevaluated(array_casts, [], Some(promoted[0])) }
Retag(_35); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_18 = &(*_35); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Retag(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _13 = (move _14, move _18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ Deinit(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ (_13.0: &usize) = move _14; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ (_13.1: &usize) = move _18; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Retag(_13); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_18); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_14); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
@@ -154,7 +156,8 @@ fn array_casts() -> () {
bb3: {
StorageLive(_27); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _27 = core::panicking::AssertKind::Eq; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ Deinit(_27); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ discriminant(_27) = 0; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_28); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_29); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_29 = move _27; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
@@ -171,12 +174,13 @@ fn array_casts() -> () {
_32 = &(*_33); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Retag(_32); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- _34 = Option::<Arguments>::None; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ Deinit(_34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
+ discriminant(_34) = 0; // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
Retag(_34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_28 = core::panicking::assert_failed::<usize, usize>(move _29, move _30, move _32, move _34); // scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
// mir::Constant
// + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: for<'r, 's, 't0> fn(core::panicking::AssertKind, &'r usize, &'s usize, Option<Arguments<'t0>>) -> ! {core::panicking::assert_failed::<usize, usize>}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a, 'b, 'c> fn(core::panicking::AssertKind, &'a usize, &'b usize, Option<Arguments<'c>>) -> ! {core::panicking::assert_failed::<usize, usize>}, val: Value(<ZST>) }
}
bb4: {
diff --git a/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir b/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
index 84f674db2..cdc413c56 100644
--- a/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
+++ b/src/test/mir-opt/retag.core.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
@@ -11,7 +11,7 @@ fn std::ptr::drop_in_place(_1: *mut Test) -> () {
_3 = <Test as Drop>::drop(move _2) -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
// mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: for<'r> fn(&'r mut Test) {<Test as Drop>::drop}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a mut Test) {<Test as Drop>::drop}, val: Value(<ZST>) }
}
bb1: {
diff --git a/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir
index 60c0f336e..96fc7e649 100644
--- a/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/retag.main-{closure#0}.SimplifyCfg-elaborate-drops.after.mir
@@ -9,14 +9,14 @@ fn main::{closure#0}(_1: &[closure@main::{closure#0}], _2: &i32) -> &i32 {
}
bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:31: +0:48
- Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:31: +0:48
+ Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:31: +3:6
+ Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:32: +0:33
StorageLive(_3); // scope 0 at $DIR/retag.rs:+1:13: +1:15
_3 = _2; // scope 0 at $DIR/retag.rs:+1:18: +1:19
Retag(_3); // scope 0 at $DIR/retag.rs:+1:18: +1:19
- _0 = _2; // scope 1 at $DIR/retag.rs:+2:9: +2:10
+ _0 = &(*_2); // scope 1 at $DIR/retag.rs:+2:9: +2:10
Retag(_0); // scope 1 at $DIR/retag.rs:+2:9: +2:10
StorageDead(_3); // scope 0 at $DIR/retag.rs:+3:5: +3:6
- return; // scope 0 at $DIR/retag.rs:+0:48: +0:48
+ return; // scope 0 at $DIR/retag.rs:+3:6: +3:6
}
}
diff --git a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
index ae6b5cfe2..81225b44e 100644
--- a/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/retag.main.SimplifyCfg-elaborate-drops.after.mir
@@ -11,7 +11,7 @@ fn main() -> () {
let mut _9: &mut i32; // in scope 0 at $DIR/retag.rs:+4:19: +4:20
let mut _12: *mut i32; // in scope 0 at $DIR/retag.rs:+7:18: +7:29
let mut _14: [closure@main::{closure#0}]; // in scope 0 at $DIR/retag.rs:+11:31: +14:6
- let mut _16: for<'r> fn(&'r i32) -> &'r i32; // in scope 0 at $DIR/retag.rs:+15:14: +15:15
+ let mut _16: for<'a> fn(&'a i32) -> &'a i32; // in scope 0 at $DIR/retag.rs:+15:14: +15:15
let mut _17: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18
let _18: &i32; // in scope 0 at $DIR/retag.rs:+15:16: +15:18
let _19: &i32; // in scope 0 at $DIR/retag.rs:+18:5: +18:24
@@ -25,7 +25,7 @@ fn main() -> () {
scope 1 {
debug x => _1; // in scope 1 at $DIR/retag.rs:+1:9: +1:14
let _3: &mut i32; // in scope 1 at $DIR/retag.rs:+3:13: +3:14
- let _13: for<'r> fn(&'r i32) -> &'r i32; // in scope 1 at $DIR/retag.rs:+11:9: +11:10
+ let _13: for<'a> fn(&'a i32) -> &'a i32; // in scope 1 at $DIR/retag.rs:+11:9: +11:10
scope 2 {
debug v => _3; // in scope 2 at $DIR/retag.rs:+3:13: +3:14
let _8: &mut i32; // in scope 2 at $DIR/retag.rs:+4:13: +4:14
@@ -62,7 +62,8 @@ fn main() -> () {
StorageLive(_3); // scope 1 at $DIR/retag.rs:+3:13: +3:14
StorageLive(_4); // scope 1 at $DIR/retag.rs:+3:17: +3:36
StorageLive(_5); // scope 1 at $DIR/retag.rs:+3:17: +3:24
- _5 = Test(const 0_i32); // scope 1 at $DIR/retag.rs:+3:17: +3:24
+ Deinit(_5); // scope 1 at $DIR/retag.rs:+3:17: +3:24
+ (_5.0: i32) = const 0_i32; // scope 1 at $DIR/retag.rs:+3:17: +3:24
_4 = &_5; // scope 1 at $DIR/retag.rs:+3:17: +3:36
Retag(_4); // scope 1 at $DIR/retag.rs:+3:17: +3:36
StorageLive(_6); // scope 1 at $DIR/retag.rs:+3:29: +3:35
@@ -73,8 +74,8 @@ fn main() -> () {
Retag([2phase] _6); // scope 1 at $DIR/retag.rs:+3:29: +3:35
_3 = Test::foo(move _4, move _6) -> [return: bb1, unwind: bb8]; // scope 1 at $DIR/retag.rs:+3:17: +3:36
// mir::Constant
- // + span: $DIR/retag.rs:32:25: 32:28
- // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value(<ZST>) }
+ // + span: $DIR/retag.rs:33:25: 33:28
+ // + literal: Const { ty: for<'a, 'x> fn(&'a Test, &'x mut i32) -> &'x mut i32 {Test::foo}, val: Value(<ZST>) }
}
bb1: {
@@ -111,16 +112,9 @@ fn main() -> () {
StorageDead(_2); // scope 1 at $DIR/retag.rs:+8:5: +8:6
StorageLive(_13); // scope 1 at $DIR/retag.rs:+11:9: +11:10
StorageLive(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6
- _14 = [closure@main::{closure#0}]; // scope 1 at $DIR/retag.rs:+11:31: +14:6
- // closure
- // + def_id: DefId(0:14 ~ retag[4622]::main::{closure#0})
- // + substs: [
- // i8,
- // for<'r> extern "rust-call" fn((&'r i32,)) -> &'r i32,
- // (),
- // ]
+ Deinit(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6
Retag(_14); // scope 1 at $DIR/retag.rs:+11:31: +14:6
- _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:+11:31: +14:6
+ _13 = move _14 as for<'a> fn(&'a i32) -> &'a i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:+11:31: +14:6
StorageDead(_14); // scope 1 at $DIR/retag.rs:+11:47: +11:48
StorageLive(_15); // scope 6 at $DIR/retag.rs:+15:9: +15:11
StorageLive(_16); // scope 6 at $DIR/retag.rs:+15:14: +15:15
@@ -142,14 +136,15 @@ fn main() -> () {
StorageLive(_19); // scope 7 at $DIR/retag.rs:+18:5: +18:24
StorageLive(_20); // scope 7 at $DIR/retag.rs:+18:5: +18:24
StorageLive(_21); // scope 7 at $DIR/retag.rs:+18:5: +18:12
- _21 = Test(const 0_i32); // scope 7 at $DIR/retag.rs:+18:5: +18:12
+ Deinit(_21); // scope 7 at $DIR/retag.rs:+18:5: +18:12
+ (_21.0: i32) = const 0_i32; // scope 7 at $DIR/retag.rs:+18:5: +18:12
_20 = &_21; // scope 7 at $DIR/retag.rs:+18:5: +18:24
Retag(_20); // scope 7 at $DIR/retag.rs:+18:5: +18:24
StorageLive(_22); // scope 7 at $DIR/retag.rs:+18:21: +18:23
StorageLive(_23); // scope 7 at $DIR/retag.rs:+18:21: +18:23
- _28 = const main::promoted[0]; // scope 7 at $DIR/retag.rs:+18:21: +18:23
+ _28 = const _; // scope 7 at $DIR/retag.rs:+18:21: +18:23
// mir::Constant
- // + span: $DIR/retag.rs:47:21: 47:23
+ // + span: $DIR/retag.rs:48:21: 48:23
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
Retag(_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
_23 = &(*_28); // scope 7 at $DIR/retag.rs:+18:21: +18:23
@@ -158,8 +153,8 @@ fn main() -> () {
Retag(_22); // scope 7 at $DIR/retag.rs:+18:21: +18:23
_19 = Test::foo_shr(move _20, move _22) -> [return: bb4, unwind: bb7]; // scope 7 at $DIR/retag.rs:+18:5: +18:24
// mir::Constant
- // + span: $DIR/retag.rs:47:13: 47:20
- // + literal: Const { ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value(<ZST>) }
+ // + span: $DIR/retag.rs:48:13: 48:20
+ // + literal: Const { ty: for<'a, 'x> fn(&'a Test, &'x i32) -> &'x i32 {Test::foo_shr}, val: Value(<ZST>) }
}
bb4: {
@@ -182,7 +177,7 @@ fn main() -> () {
StorageLive(_27); // scope 8 at $DIR/retag.rs:+23:5: +23:18
_27 = array_casts() -> bb6; // scope 8 at $DIR/retag.rs:+23:5: +23:18
// mir::Constant
- // + span: $DIR/retag.rs:52:5: 52:16
+ // + span: $DIR/retag.rs:53:5: 53:16
// + literal: Const { ty: fn() {array_casts}, val: Value(<ZST>) }
}
diff --git a/src/test/mir-opt/retag.rs b/src/test/mir-opt/retag.rs
index 13568b822..86deb0e7c 100644
--- a/src/test/mir-opt/retag.rs
+++ b/src/test/mir-opt/retag.rs
@@ -1,3 +1,4 @@
+// unit-test: AddRetag
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-tidy-linelength
// compile-flags: -Z mir-emit-retag -Z mir-opt-level=0 -Z span_free_formats
diff --git a/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir
index e395fdb27..08fd655ae 100644
--- a/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/retag.{impl#0}-foo.SimplifyCfg-elaborate-drops.after.mir
@@ -1,14 +1,14 @@
-// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo` after SimplifyCfg-elaborate-drops
+// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo` after SimplifyCfg-elaborate-drops
-fn <impl at $DIR/retag.rs:11:1: 11:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
+fn <impl at $DIR/retag.rs:12:1: 12:10>::foo(_1: &Test, _2: &mut i32) -> &mut i32 {
debug self => _1; // in scope 0 at $DIR/retag.rs:+0:16: +0:21
debug x => _2; // in scope 0 at $DIR/retag.rs:+0:23: +0:24
let mut _0: &mut i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:53
let mut _3: &mut i32; // in scope 0 at $DIR/retag.rs:+1:9: +1:10
bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:5: +2:6
- Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:5: +2:6
+ Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:16: +0:21
+ Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:23: +0:24
StorageLive(_3); // scope 0 at $DIR/retag.rs:+1:9: +1:10
_3 = &mut (*_2); // scope 0 at $DIR/retag.rs:+1:9: +1:10
Retag(_3); // scope 0 at $DIR/retag.rs:+1:9: +1:10
diff --git a/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir
index e609166de..f32a84e4c 100644
--- a/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir
+++ b/src/test/mir-opt/retag.{impl#0}-foo_shr.SimplifyCfg-elaborate-drops.after.mir
@@ -1,13 +1,13 @@
-// MIR for `<impl at $DIR/retag.rs:11:1: 11:10>::foo_shr` after SimplifyCfg-elaborate-drops
+// MIR for `<impl at $DIR/retag.rs:12:1: 12:10>::foo_shr` after SimplifyCfg-elaborate-drops
-fn <impl at $DIR/retag.rs:11:1: 11:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
+fn <impl at $DIR/retag.rs:12:1: 12:10>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
debug self => _1; // in scope 0 at $DIR/retag.rs:+0:20: +0:25
debug x => _2; // in scope 0 at $DIR/retag.rs:+0:27: +0:28
let mut _0: &i32; // return place in scope 0 at $DIR/retag.rs:+0:42: +0:49
bb0: {
- Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:5: +2:6
- Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:5: +2:6
+ Retag([fn entry] _1); // scope 0 at $DIR/retag.rs:+0:20: +0:25
+ Retag([fn entry] _2); // scope 0 at $DIR/retag.rs:+0:27: +0:28
_0 = _2; // scope 0 at $DIR/retag.rs:+1:9: +1:10
Retag(_0); // scope 0 at $DIR/retag.rs:+1:9: +1:10
return; // scope 0 at $DIR/retag.rs:+2:6: +2:6
diff --git a/src/test/mir-opt/separate_const_switch.identity.ConstProp.diff b/src/test/mir-opt/separate_const_switch.identity.ConstProp.diff
deleted file mode 100644
index 3a11e45ca..000000000
--- a/src/test/mir-opt/separate_const_switch.identity.ConstProp.diff
+++ /dev/null
@@ -1,145 +0,0 @@
-- // MIR for `identity` before ConstProp
-+ // MIR for `identity` after ConstProp
-
- fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
- debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:13: +0:14
- let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:37: +0:53
- let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- let mut _5: isize; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let mut _7: !; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let mut _8: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- scope 1 {
- debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:+1:9: +1:10
- scope 2 {
- scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
- debug residual => _8; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let _16: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _17: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _18: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 9 {
- debug e => _16; // 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 => _18; // in scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- }
- }
- }
- }
- }
- scope 3 {
- debug val => _9; // in scope 3 at $DIR/separate_const_switch.rs:+1:8: +1:10
- scope 4 {
- }
- }
- scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
- debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _10: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _12: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let _13: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _14: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _15: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 6 {
- debug v => _11; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- scope 7 {
- debug e => _13; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- _4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- StorageLive(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- switchInt(move _10) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb1: {
- StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _9 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _2 = _9; // scope 4 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- Deinit(_0); // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
- ((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
- discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
- StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
- StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
- return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
- }
-
- bb2: {
- StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _8 = _6; // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- _16 = move ((_8 as Err).0: i32); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- _18 = move _16; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- _17 = move _18; // scope 10 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
- StorageDead(_18); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- Deinit(_0); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_0 as Err).0: i32) = move _17; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_0) = 1; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_17); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_16); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
- StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
- return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
- }
-
- bb3: {
- StorageLive(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- _13 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_15); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _15 = move _13; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- Deinit(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_14 as Err).0: i32) = move _15; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_14) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_15); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- Deinit(_3); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _14; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_3) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
-- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ _5 = const 1_isize; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ switchInt(const 1_isize) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- }
-
- bb4: {
- unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb5: {
- StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- _11 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- _12 = move _11; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- Deinit(_3); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_3 as Continue).0: i32) = move _12; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_3) = 0; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
-- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ _5 = const 0_isize; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ switchInt(const 0_isize) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- }
- }
-
diff --git a/src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir b/src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir
deleted file mode 100644
index 952ef22d4..000000000
--- a/src/test/mir-opt/separate_const_switch.identity.PreCodegen.after.mir
+++ /dev/null
@@ -1,127 +0,0 @@
-// MIR for `identity` after PreCodegen
-
-fn identity(_1: Result<i32, i32>) -> Result<i32, i32> {
- debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:13: +0:14
- let mut _0: std::result::Result<i32, i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:37: +0:53
- let mut _2: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- let mut _3: std::ops::ControlFlow<std::result::Result<std::convert::Infallible, i32>, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- let mut _4: std::result::Result<i32, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- let _5: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let mut _6: std::result::Result<std::convert::Infallible, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- let _7: i32; // in scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- scope 1 {
- debug residual => _5; // in scope 1 at $DIR/separate_const_switch.rs:+1:9: +1:10
- scope 2 {
- scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
- debug residual => _6; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let _14: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _15: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _16: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- 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
- }
- }
- }
- }
- }
- scope 3 {
- debug val => _7; // in scope 3 at $DIR/separate_const_switch.rs:+1:8: +1:10
- scope 4 {
- }
- }
- scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
- debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _8: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let _9: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _10: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _12: std::result::Result<std::convert::Infallible, i32>; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- let mut _13: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- scope 6 {
- debug v => _9; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- scope 7 {
- debug e => _11; // in scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- }
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- _4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- StorageLive(_8); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _8 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- switchInt(move _8) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb1: {
- StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- _11 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- _13 = move _11; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- Deinit(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_12 as Err).0: i32) = move _13; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_12) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_13); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- Deinit(_3); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>) = move _12; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_3) = 1; // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_12); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_8); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_5); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _5 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_6); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _6 = _5; // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_14); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
- _14 = move ((_6 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
- Deinit(_0); // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_0 as Err).0: i32) = move _15; // scope 9 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_0) = 1; // 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 8 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_6); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageDead(_5); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
- StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
- return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
- }
-
- bb2: {
- unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- }
-
- bb3: {
- StorageLive(_9); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- _9 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageLive(_10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- _10 = move _9; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- Deinit(_3); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- ((_3 as Continue).0: i32) = move _10; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- discriminant(_3) = 0; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_10); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_9); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- StorageDead(_8); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- StorageLive(_7); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _7 = ((_3 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- _2 = _7; // scope 4 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_7); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- Deinit(_0); // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
- ((_0 as Ok).0: i32) = move _2; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
- discriminant(_0) = 0; // scope 0 at $DIR/separate_const_switch.rs:+1:5: +1:11
- StorageDead(_2); // scope 0 at $DIR/separate_const_switch.rs:+1:10: +1:11
- StorageDead(_3); // scope 0 at $DIR/separate_const_switch.rs:+2:1: +2:2
- return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
- }
-}
diff --git a/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff b/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
index 8453d5341..f25b3ce72 100644
--- a/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
+++ b/src/test/mir-opt/separate_const_switch.identity.SeparateConstSwitch.diff
@@ -15,7 +15,7 @@
scope 1 {
debug residual => _6; // in scope 1 at $DIR/separate_const_switch.rs:+1:9: +1:10
scope 2 {
- scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:29:8: 29:10
+ scope 8 (inlined #[track_caller] <Result<i32, i32> as FromResidual<Result<Infallible, i32>>>::from_residual) { // at $DIR/separate_const_switch.rs:25:8: 25:10
debug residual => _8; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let _16: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _17: i32; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -34,7 +34,7 @@
scope 4 {
}
}
- scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:29:8: 29:10
+ scope 5 (inlined <Result<i32, i32> as Try>::branch) { // at $DIR/separate_const_switch.rs:25:8: 25:10
debug self => _4; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let mut _10: isize; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
let _11: i32; // in scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -55,17 +55,15 @@
StorageLive(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
_4 = _1; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:9
- StorageLive(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
_10 = discriminant(_4); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
-- switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
-+ switchInt(move _10) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
+- switchInt(move _10) -> [0_isize: bb7, 1_isize: bb5, otherwise: bb6]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
++ switchInt(move _10) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
}
bb1: {
-- StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
- _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-- switchInt(move _5) -> [0_isize: bb2, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+- switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
- }
-
- bb2: {
@@ -83,6 +81,11 @@
- bb3: {
+ bb2: {
+ unreachable; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ }
+
+- bb4: {
++ bb3: {
StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
_6 = ((_3 as Break).0: std::result::Result<std::convert::Infallible, i32>); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
StorageLive(_8); // scope 2 at $DIR/separate_const_switch.rs:+1:9: +1:10
@@ -106,8 +109,8 @@
return; // scope 0 at $DIR/separate_const_switch.rs:+2:2: +2:2
}
-- bb4: {
-+ bb3: {
+- bb5: {
++ bb4: {
StorageLive(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
_13 = move ((_4 as Err).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -123,19 +126,18 @@
StorageDead(_14); // scope 7 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_13); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
-+ StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
+ _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
++ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
}
-- bb5: {
-+ bb4: {
+- bb6: {
++ bb5: {
unreachable; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
}
-- bb6: {
-+ bb5: {
+- bb7: {
++ bb6: {
StorageLive(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
_11 = move ((_4 as Ok).0: i32); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
StorageLive(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
@@ -146,10 +148,9 @@
StorageDead(_12); // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_11); // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
- goto -> bb1; // scope 5 at $SRC_DIR/core/src/result.rs:LL:COL
-+ StorageDead(_10); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
+ StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+1:9: +1:10
+ _5 = discriminant(_3); // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
-+ switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
++ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+1:8: +1:10
}
}
diff --git a/src/test/mir-opt/separate_const_switch.rs b/src/test/mir-opt/separate_const_switch.rs
index 5d82acf4d..c809e5629 100644
--- a/src/test/mir-opt/separate_const_switch.rs
+++ b/src/test/mir-opt/separate_const_switch.rs
@@ -4,8 +4,6 @@
use std::ops::ControlFlow;
// EMIT_MIR separate_const_switch.too_complex.SeparateConstSwitch.diff
-// EMIT_MIR separate_const_switch.too_complex.ConstProp.diff
-// EMIT_MIR separate_const_switch.too_complex.PreCodegen.after.mir
fn too_complex(x: Result<i32, usize>) -> Option<i32> {
// The pass should break the outer match into
// two blocks that only have one parent each.
@@ -23,8 +21,6 @@ fn too_complex(x: Result<i32, usize>) -> Option<i32> {
}
// EMIT_MIR separate_const_switch.identity.SeparateConstSwitch.diff
-// EMIT_MIR separate_const_switch.identity.ConstProp.diff
-// EMIT_MIR separate_const_switch.identity.PreCodegen.after.mir
fn identity(x: Result<i32, i32>) -> Result<i32, i32> {
Ok(x?)
}
diff --git a/src/test/mir-opt/separate_const_switch.too_complex.ConstProp.diff b/src/test/mir-opt/separate_const_switch.too_complex.ConstProp.diff
deleted file mode 100644
index de9f45c3d..000000000
--- a/src/test/mir-opt/separate_const_switch.too_complex.ConstProp.diff
+++ /dev/null
@@ -1,95 +0,0 @@
-- // MIR for `too_complex` before ConstProp
-+ // MIR for `too_complex` after ConstProp
-
- fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
- debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:16: +0:17
- let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:42: +0:53
- let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:+7:13: +7:18
- let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:44: +7:45
- let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- let mut _7: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:42: +8:43
- let mut _8: isize; // in scope 0 at $DIR/separate_const_switch.rs:+11:9: +11:33
- let _9: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- let mut _10: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:42: +11:43
- let _11: usize; // in scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
- scope 1 {
- debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:+7:16: +7:17
- }
- scope 2 {
- debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:+8:17: +8:18
- }
- scope 3 {
- debug v => _9; // in scope 3 at $DIR/separate_const_switch.rs:+11:31: +11:32
- }
- scope 4 {
- debug r => _11; // in scope 4 at $DIR/separate_const_switch.rs:+12:28: +12:29
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- _3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
- }
-
- bb1: {
- StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- _6 = ((_1 as Err).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- StorageLive(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
- _7 = _6; // scope 2 at $DIR/separate_const_switch.rs:+8:42: +8:43
- Deinit(_2); // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
- ((_2 as Break).0: usize) = move _7; // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
- discriminant(_2) = 1; // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
- StorageDead(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:43: +8:44
- StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
-- _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-- switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
-+ _8 = const 1_isize; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-+ switchInt(const 1_isize) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
- }
-
- bb2: {
- StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- _4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
- _5 = _4; // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
- Deinit(_2); // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
- ((_2 as Continue).0: i32) = move _5; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
- discriminant(_2) = 0; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
- StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
-- _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-- switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
-+ _8 = const 0_isize; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-+ switchInt(const 0_isize) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
- }
-
- bb3: {
- StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
- _11 = ((_2 as Break).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
- Deinit(_0); // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
- discriminant(_0) = 0; // 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 -> bb5; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
- }
-
- bb4: {
- StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- _9 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- StorageLive(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
- _10 = _9; // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
- Deinit(_0); // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
- ((_0 as Some).0: i32) = move _10; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
- discriminant(_0) = 1; // 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 -> bb5; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
- }
-
- bb5: {
- 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/src/test/mir-opt/separate_const_switch.too_complex.PreCodegen.after.mir b/src/test/mir-opt/separate_const_switch.too_complex.PreCodegen.after.mir
deleted file mode 100644
index 1009225b7..000000000
--- a/src/test/mir-opt/separate_const_switch.too_complex.PreCodegen.after.mir
+++ /dev/null
@@ -1,69 +0,0 @@
-// MIR for `too_complex` after PreCodegen
-
-fn too_complex(_1: Result<i32, usize>) -> Option<i32> {
- debug x => _1; // in scope 0 at $DIR/separate_const_switch.rs:+0:16: +0:17
- let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/separate_const_switch.rs:+0:42: +0:53
- let mut _2: std::ops::ControlFlow<usize, i32>; // in scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- let mut _3: isize; // in scope 0 at $DIR/separate_const_switch.rs:+7:13: +7:18
- let _4: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- let mut _5: i32; // in scope 0 at $DIR/separate_const_switch.rs:+7:44: +7:45
- let _6: usize; // in scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- let _7: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- let mut _8: i32; // in scope 0 at $DIR/separate_const_switch.rs:+11:42: +11:43
- let _9: usize; // in scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
- scope 1 {
- debug v => _4; // in scope 1 at $DIR/separate_const_switch.rs:+7:16: +7:17
- }
- scope 2 {
- debug r => _6; // in scope 2 at $DIR/separate_const_switch.rs:+8:17: +8:18
- }
- scope 3 {
- debug v => _7; // in scope 3 at $DIR/separate_const_switch.rs:+11:31: +11:32
- }
- scope 4 {
- debug r => _9; // in scope 4 at $DIR/separate_const_switch.rs:+12:28: +12:29
- }
-
- bb0: {
- StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
- _3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
- }
-
- bb1: {
- StorageLive(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:17: +8:18
- StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
- StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
- Deinit(_0); // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
- discriminant(_0) = 0; // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
- StorageDead(_9); // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
- }
-
- bb2: {
- StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- _4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
- StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
- _5 = _4; // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
- Deinit(_2); // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
- ((_2 as Continue).0: i32) = move _5; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
- discriminant(_2) = 0; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
- StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46
- StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
- StorageLive(_7); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- _7 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
- StorageLive(_8); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
- _8 = _7; // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
- Deinit(_0); // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
- ((_0 as Some).0: i32) = move _8; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
- discriminant(_0) = 1; // scope 3 at $DIR/separate_const_switch.rs:+11:37: +11:44
- StorageDead(_8); // scope 3 at $DIR/separate_const_switch.rs:+11:43: +11:44
- StorageDead(_7); // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
- }
-
- bb3: {
- 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/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff b/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
index 3ab1c572a..437979081 100644
--- a/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
+++ b/src/test/mir-opt/separate_const_switch.too_complex.SeparateConstSwitch.diff
@@ -30,7 +30,7 @@
bb0: {
StorageLive(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
_3 = discriminant(_1); // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
+ switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/separate_const_switch.rs:+6:9: +6:16
}
bb1: {
@@ -43,12 +43,16 @@
discriminant(_2) = 1; // scope 2 at $DIR/separate_const_switch.rs:+8:23: +8:44
StorageDead(_7); // scope 2 at $DIR/separate_const_switch.rs:+8:43: +8:44
StorageDead(_6); // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
-- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
+- goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+8:43: +8:44
+ _8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-+ switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
++ switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
}
bb2: {
+ unreachable; // scope 0 at $DIR/separate_const_switch.rs:+6:15: +6:16
+ }
+
+ bb3: {
StorageLive(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
_4 = ((_1 as Ok).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+7:16: +7:17
StorageLive(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:44: +7:45
@@ -58,28 +62,33 @@
discriminant(_2) = 0; // scope 1 at $DIR/separate_const_switch.rs:+7:22: +7:46
StorageDead(_5); // scope 1 at $DIR/separate_const_switch.rs:+7:45: +7:46
StorageDead(_4); // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
-- goto -> bb3; // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
+- goto -> bb4; // scope 0 at $DIR/separate_const_switch.rs:+7:45: +7:46
- }
-
-- bb3: {
+- bb4: {
_8 = discriminant(_2); // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
-- switchInt(move _8) -> [0_isize: bb5, otherwise: bb4]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
-+ switchInt(move _8) -> [0_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
+- switchInt(move _8) -> [0_isize: bb7, 1_isize: bb5, otherwise: bb6]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
++ switchInt(move _8) -> [0_isize: bb6, 1_isize: bb4, otherwise: bb5]; // scope 0 at $DIR/separate_const_switch.rs:+5:5: +10:6
}
-- bb4: {
-+ bb3: {
+- bb5: {
++ bb4: {
StorageLive(_11); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
_11 = ((_2 as Break).0: usize); // scope 0 at $DIR/separate_const_switch.rs:+12:28: +12:29
Deinit(_0); // scope 4 at $DIR/separate_const_switch.rs:+12:34: +12:38
discriminant(_0) = 0; // 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 -> bb6; // scope 0 at $DIR/separate_const_switch.rs:+12:37: +12:38
-+ goto -> bb5; // 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
}
-- bb5: {
-+ bb4: {
+- bb6: {
++ bb5: {
+ unreachable; // scope 0 at $DIR/separate_const_switch.rs:+5:11: +10:6
+ }
+
+- bb7: {
++ bb6: {
StorageLive(_9); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
_9 = ((_2 as Continue).0: i32); // scope 0 at $DIR/separate_const_switch.rs:+11:31: +11:32
StorageLive(_10); // scope 3 at $DIR/separate_const_switch.rs:+11:42: +11:43
@@ -89,12 +98,12 @@
discriminant(_0) = 1; // 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 -> bb6; // scope 0 at $DIR/separate_const_switch.rs:+11:43: +11:44
-+ goto -> bb5; // 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
}
-- bb6: {
-+ bb5: {
+- 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/src/test/mir-opt/simple-match.rs b/src/test/mir-opt/simple-match.rs
index 44adc55b6..103033c4e 100644
--- a/src/test/mir-opt/simple-match.rs
+++ b/src/test/mir-opt/simple-match.rs
@@ -1,6 +1,6 @@
// Test that we don't generate unnecessarily large MIR for very simple matches
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR simple_match.match_bool.mir_map.0.mir
fn match_bool(x: bool) -> usize {
match x {
diff --git a/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir b/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir
deleted file mode 100644
index 3bef6aa05..000000000
--- a/src/test/mir-opt/simple_match.match_bool.mir_map.0.64bit.mir
+++ /dev/null
@@ -1,29 +0,0 @@
-// MIR for `match_bool` 0 mir_map
-
-fn match_bool(_1: bool) -> usize {
- debug x => _1; // in scope 0 at $DIR/simple-match.rs:+0:15: +0:16
- let mut _0: usize; // return place in scope 0 at $DIR/simple-match.rs:+0:27: +0:32
-
- bb0: {
- FakeRead(ForMatchedPlace(None), _1); // scope 0 at $DIR/simple-match.rs:+1:11: +1:12
- switchInt(_1) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/simple-match.rs:+1:5: +1:12
- }
-
- bb1: {
- falseEdge -> [real: bb3, imaginary: bb2]; // scope 0 at $DIR/simple-match.rs:+2:9: +2:13
- }
-
- bb2: {
- _0 = const 20_usize; // scope 0 at $DIR/simple-match.rs:+3:14: +3:16
- goto -> bb4; // scope 0 at $DIR/simple-match.rs:+3:14: +3:16
- }
-
- bb3: {
- _0 = const 10_usize; // scope 0 at $DIR/simple-match.rs:+2:17: +2:19
- goto -> bb4; // scope 0 at $DIR/simple-match.rs:+2:17: +2:19
- }
-
- bb4: {
- return; // scope 0 at $DIR/simple-match.rs:+5:2: +5:2
- }
-}
diff --git a/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir b/src/test/mir-opt/simple_match.match_bool.mir_map.0.mir
index 3bef6aa05..3bef6aa05 100644
--- a/src/test/mir-opt/simple_match.match_bool.mir_map.0.32bit.mir
+++ b/src/test/mir-opt/simple_match.match_bool.mir_map.0.mir
diff --git a/src/test/mir-opt/simplify-arm-identity.rs b/src/test/mir-opt/simplify-arm-identity.rs
index bedc86bba..cf6ff57aa 100644
--- a/src/test/mir-opt/simplify-arm-identity.rs
+++ b/src/test/mir-opt/simplify-arm-identity.rs
@@ -4,6 +4,9 @@
// compile-flags: -Zmir-opt-level=3
// EMIT_MIR_FOR_EACH_BIT_WIDTH
+// This pass is broken since deaggregation changed
+// ignore-test
+
enum Src {
Foo(u8),
Bar,
diff --git a/src/test/mir-opt/simplify-arm.rs b/src/test/mir-opt/simplify-arm.rs
index f7dcaa134..c247872e2 100644
--- a/src/test/mir-opt/simplify-arm.rs
+++ b/src/test/mir-opt/simplify-arm.rs
@@ -6,6 +6,9 @@
// EMIT_MIR simplify_arm.id_try.SimplifyArmIdentity.diff
// EMIT_MIR simplify_arm.id_try.SimplifyBranchSame.diff
+// This pass is broken since deaggregation changed
+// ignore-test
+
fn id(o: Option<u8>) -> Option<u8> {
match o {
Some(v) => Some(v),
diff --git a/src/test/mir-opt/simplify-locals-removes-unused-consts.rs b/src/test/mir-opt/simplify-locals-removes-unused-consts.rs
index 179994544..39b7911d4 100644
--- a/src/test/mir-opt/simplify-locals-removes-unused-consts.rs
+++ b/src/test/mir-opt/simplify-locals-removes-unused-consts.rs
@@ -1,3 +1,4 @@
+// unit-test: SimplifyLocals
// compile-flags: -C overflow-checks=no
fn use_zst(_: ((), ())) {}
diff --git a/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs b/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs
index 84f57decc..d09bd92c4 100644
--- a/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs
+++ b/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs
@@ -1,4 +1,4 @@
-// compile-flags: -Zunsound-mir-opts
+// unit-test: SimplifyLocals
fn map(x: Option<Box<()>>) -> Option<Box<()>> {
match x {
@@ -11,5 +11,4 @@ fn main() {
map(None);
}
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.diff
diff --git a/src/test/mir-opt/simplify-locals.rs b/src/test/mir-opt/simplify-locals.rs
index f6bf396cd..89d9391f8 100644
--- a/src/test/mir-opt/simplify-locals.rs
+++ b/src/test/mir-opt/simplify-locals.rs
@@ -1,6 +1,6 @@
// unit-test: SimplifyLocals
-#![feature(box_syntax)]
+
#![feature(thread_local)]
#[derive(Copy, Clone)]
diff --git a/src/test/mir-opt/simplify_arm.id.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_arm.id.SimplifyArmIdentity.diff
deleted file mode 100644
index 9c3ad4b4d..000000000
--- a/src/test/mir-opt/simplify_arm.id.SimplifyArmIdentity.diff
+++ /dev/null
@@ -1,46 +0,0 @@
-- // MIR for `id` before SimplifyArmIdentity
-+ // MIR for `id` after SimplifyArmIdentity
-
- fn id(_1: Option<u8>) -> Option<u8> {
- debug o => _1; // in scope 0 at $DIR/simplify-arm.rs:+0:7: +0:8
- let mut _0: std::option::Option<u8>; // return place in scope 0 at $DIR/simplify-arm.rs:+0:25: +0:35
- let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:+2:9: +2:16
- let _3: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:14: +2:15
- let mut _4: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:25: +2:26
- scope 1 {
- debug v => _3; // in scope 1 at $DIR/simplify-arm.rs:+2:14: +2:15
- }
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:5: +1:12
- }
-
- bb1: {
- Deinit(_0); // scope 0 at $DIR/simplify-arm.rs:+3:17: +3:21
- discriminant(_0) = 0; // scope 0 at $DIR/simplify-arm.rs:+3:17: +3:21
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+3:17: +3:21
- }
-
- bb2: {
- unreachable; // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:+2:14: +2:15
- _3 = ((_1 as Some).0: u8); // scope 0 at $DIR/simplify-arm.rs:+2:14: +2:15
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:+2:25: +2:26
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:+2:25: +2:26
- Deinit(_0); // scope 1 at $DIR/simplify-arm.rs:+2:20: +2:27
- ((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:+2:20: +2:27
- discriminant(_0) = 1; // scope 1 at $DIR/simplify-arm.rs:+2:20: +2:27
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:+2:26: +2:27
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:+2:26: +2:27
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+2:26: +2:27
- }
-
- bb4: {
- return; // scope 0 at $DIR/simplify-arm.rs:+5:2: +5:2
- }
- }
-
diff --git a/src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff b/src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff
deleted file mode 100644
index 7b3a69936..000000000
--- a/src/test/mir-opt/simplify_arm.id.SimplifyBranchSame.diff
+++ /dev/null
@@ -1,46 +0,0 @@
-- // MIR for `id` before SimplifyBranchSame
-+ // MIR for `id` after SimplifyBranchSame
-
- fn id(_1: Option<u8>) -> Option<u8> {
- debug o => _1; // in scope 0 at $DIR/simplify-arm.rs:+0:7: +0:8
- let mut _0: std::option::Option<u8>; // return place in scope 0 at $DIR/simplify-arm.rs:+0:25: +0:35
- let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:+2:9: +2:16
- let _3: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:14: +2:15
- let mut _4: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:25: +2:26
- scope 1 {
- debug v => _3; // in scope 1 at $DIR/simplify-arm.rs:+2:14: +2:15
- }
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:5: +1:12
- }
-
- bb1: {
- Deinit(_0); // scope 0 at $DIR/simplify-arm.rs:+3:17: +3:21
- discriminant(_0) = 0; // scope 0 at $DIR/simplify-arm.rs:+3:17: +3:21
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+3:17: +3:21
- }
-
- bb2: {
- unreachable; // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:+2:14: +2:15
- _3 = ((_1 as Some).0: u8); // scope 0 at $DIR/simplify-arm.rs:+2:14: +2:15
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:+2:25: +2:26
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:+2:25: +2:26
- Deinit(_0); // scope 1 at $DIR/simplify-arm.rs:+2:20: +2:27
- ((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:+2:20: +2:27
- discriminant(_0) = 1; // scope 1 at $DIR/simplify-arm.rs:+2:20: +2:27
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:+2:26: +2:27
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:+2:26: +2:27
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+2:26: +2:27
- }
-
- bb4: {
- return; // scope 0 at $DIR/simplify-arm.rs:+5:2: +5:2
- }
- }
-
diff --git a/src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff
deleted file mode 100644
index 31d8453ce..000000000
--- a/src/test/mir-opt/simplify_arm.id_result.SimplifyArmIdentity.diff
+++ /dev/null
@@ -1,58 +0,0 @@
-- // MIR for `id_result` before SimplifyArmIdentity
-+ // MIR for `id_result` after SimplifyArmIdentity
-
- fn id_result(_1: Result<u8, i32>) -> Result<u8, i32> {
- debug r => _1; // in scope 0 at $DIR/simplify-arm.rs:+0:14: +0:15
- let mut _0: std::result::Result<u8, i32>; // return place in scope 0 at $DIR/simplify-arm.rs:+0:37: +0:52
- let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:+2:9: +2:14
- let _3: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
- let mut _4: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:21: +2:22
- let _5: i32; // in scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
- let mut _6: i32; // in scope 0 at $DIR/simplify-arm.rs:+3:23: +3:24
- scope 1 {
- debug x => _3; // in scope 1 at $DIR/simplify-arm.rs:+2:12: +2:13
- }
- scope 2 {
- debug y => _5; // in scope 2 at $DIR/simplify-arm.rs:+3:13: +3:14
- }
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:5: +1:12
- }
-
- bb1: {
- StorageLive(_5); // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
- _5 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
- StorageLive(_6); // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24
- _6 = _5; // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24
- Deinit(_0); // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
- ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
- discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
- StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:+3:24: +3:25
- StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25
- }
-
- bb2: {
- unreachable; // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
- _3 = ((_1 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22
- Deinit(_0); // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
- ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:+2:22: +2:23
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23
- }
-
- bb4: {
- return; // scope 0 at $DIR/simplify-arm.rs:+5:2: +5:2
- }
- }
-
diff --git a/src/test/mir-opt/simplify_arm.id_result.SimplifyBranchSame.diff b/src/test/mir-opt/simplify_arm.id_result.SimplifyBranchSame.diff
deleted file mode 100644
index 3692ebf74..000000000
--- a/src/test/mir-opt/simplify_arm.id_result.SimplifyBranchSame.diff
+++ /dev/null
@@ -1,58 +0,0 @@
-- // MIR for `id_result` before SimplifyBranchSame
-+ // MIR for `id_result` after SimplifyBranchSame
-
- fn id_result(_1: Result<u8, i32>) -> Result<u8, i32> {
- debug r => _1; // in scope 0 at $DIR/simplify-arm.rs:+0:14: +0:15
- let mut _0: std::result::Result<u8, i32>; // return place in scope 0 at $DIR/simplify-arm.rs:+0:37: +0:52
- let mut _2: isize; // in scope 0 at $DIR/simplify-arm.rs:+2:9: +2:14
- let _3: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
- let mut _4: u8; // in scope 0 at $DIR/simplify-arm.rs:+2:21: +2:22
- let _5: i32; // in scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
- let mut _6: i32; // in scope 0 at $DIR/simplify-arm.rs:+3:23: +3:24
- scope 1 {
- debug x => _3; // in scope 1 at $DIR/simplify-arm.rs:+2:12: +2:13
- }
- scope 2 {
- debug y => _5; // in scope 2 at $DIR/simplify-arm.rs:+3:13: +3:14
- }
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:5: +1:12
- }
-
- bb1: {
- StorageLive(_5); // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
- _5 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:+3:13: +3:14
- StorageLive(_6); // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24
- _6 = _5; // scope 2 at $DIR/simplify-arm.rs:+3:23: +3:24
- Deinit(_0); // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
- ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
- discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:+3:19: +3:25
- StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:+3:24: +3:25
- StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+3:24: +3:25
- }
-
- bb2: {
- unreachable; // scope 0 at $DIR/simplify-arm.rs:+1:11: +1:12
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
- _3 = ((_1 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:+2:12: +2:13
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:+2:21: +2:22
- Deinit(_0); // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
- ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:+2:18: +2:23
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:+2:22: +2:23
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:+2:22: +2:23
- }
-
- bb4: {
- return; // scope 0 at $DIR/simplify-arm.rs:+5:2: +5:2
- }
- }
-
diff --git a/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff
index 452cc8a9c..cff9afc38 100644
--- a/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/simplify_arm.id_try.SimplifyArmIdentity.diff
@@ -23,14 +23,14 @@
debug t => _9; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
scope 6 (inlined from_error::<u8, i32>) { // at $DIR/simplify-arm.rs:37:26: 37:51
- debug e => _8; // in scope 6 at $DIR/simplify-arm.rs:+0:21: +0:22
+ debug e => _8; // in scope 6 at $DIR/simplify-arm.rs:27:21: 27:22
}
}
scope 3 {
debug v => _10; // in scope 3 at $DIR/simplify-arm.rs:+3:12: +3:13
}
scope 4 (inlined into_result::<u8, i32>) { // at $DIR/simplify-arm.rs:36:19: 36:33
- debug r => _4; // in scope 4 at $DIR/simplify-arm.rs:+0:22: +0:23
+ debug r => _4; // in scope 4 at $DIR/simplify-arm.rs:23:22: 23:23
}
bb0: {
@@ -38,7 +38,7 @@
StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:+1:19: +1:33
StorageLive(_4); // scope 0 at $DIR/simplify-arm.rs:+1:31: +1:32
_4 = _1; // scope 0 at $DIR/simplify-arm.rs:+1:31: +1:32
- _3 = move _4; // scope 4 at $DIR/simplify-arm.rs:+0:5: +0:6
+ _3 = move _4; // scope 4 at $DIR/simplify-arm.rs:24:5: 24:6
StorageDead(_4); // scope 0 at $DIR/simplify-arm.rs:+1:32: +1:33
_5 = discriminant(_3); // scope 0 at $DIR/simplify-arm.rs:+1:19: +1:33
switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:13: +1:33
@@ -72,9 +72,9 @@
_9 = _6; // scope 2 at $DIR/simplify-arm.rs:+2:48: +2:49
_8 = move _9; // scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
StorageDead(_9); // scope 2 at $DIR/simplify-arm.rs:+2:49: +2:50
- ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify-arm.rs:+0:9: +0:10
- Deinit(_0); // scope 6 at $DIR/simplify-arm.rs:+0:5: +0:11
- discriminant(_0) = 1; // scope 6 at $DIR/simplify-arm.rs:+0:5: +0:11
+ ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify-arm.rs:28:9: 28:10
+ Deinit(_0); // scope 6 at $DIR/simplify-arm.rs:28:5: 28:11
+ discriminant(_0) = 1; // scope 6 at $DIR/simplify-arm.rs:28:5: 28:11
StorageDead(_8); // scope 2 at $DIR/simplify-arm.rs:+2:50: +2:51
StorageDead(_6); // scope 0 at $DIR/simplify-arm.rs:+2:50: +2:51
StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:+4:6: +4:7
diff --git a/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff b/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff
index 5d7d4ba7c..9d38b9350 100644
--- a/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff
+++ b/src/test/mir-opt/simplify_arm.id_try.SimplifyBranchSame.diff
@@ -23,14 +23,14 @@
debug t => _9; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
scope 6 (inlined from_error::<u8, i32>) { // at $DIR/simplify-arm.rs:37:26: 37:51
- debug e => _8; // in scope 6 at $DIR/simplify-arm.rs:+0:21: +0:22
+ debug e => _8; // in scope 6 at $DIR/simplify-arm.rs:27:21: 27:22
}
}
scope 3 {
debug v => _10; // in scope 3 at $DIR/simplify-arm.rs:+3:12: +3:13
}
scope 4 (inlined into_result::<u8, i32>) { // at $DIR/simplify-arm.rs:36:19: 36:33
- debug r => _4; // in scope 4 at $DIR/simplify-arm.rs:+0:22: +0:23
+ debug r => _4; // in scope 4 at $DIR/simplify-arm.rs:23:22: 23:23
}
bb0: {
@@ -38,7 +38,7 @@
StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:+1:19: +1:33
StorageLive(_4); // scope 0 at $DIR/simplify-arm.rs:+1:31: +1:32
_4 = _1; // scope 0 at $DIR/simplify-arm.rs:+1:31: +1:32
- _3 = move _4; // scope 4 at $DIR/simplify-arm.rs:+0:5: +0:6
+ _3 = move _4; // scope 4 at $DIR/simplify-arm.rs:24:5: 24:6
StorageDead(_4); // scope 0 at $DIR/simplify-arm.rs:+1:32: +1:33
_5 = discriminant(_3); // scope 0 at $DIR/simplify-arm.rs:+1:19: +1:33
switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:+1:13: +1:33
@@ -72,9 +72,9 @@
_9 = _6; // scope 2 at $DIR/simplify-arm.rs:+2:48: +2:49
_8 = move _9; // scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
StorageDead(_9); // scope 2 at $DIR/simplify-arm.rs:+2:49: +2:50
- ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify-arm.rs:+0:9: +0:10
- Deinit(_0); // scope 6 at $DIR/simplify-arm.rs:+0:5: +0:11
- discriminant(_0) = 1; // scope 6 at $DIR/simplify-arm.rs:+0:5: +0:11
+ ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify-arm.rs:28:9: 28:10
+ Deinit(_0); // scope 6 at $DIR/simplify-arm.rs:28:5: 28:11
+ discriminant(_0) = 1; // scope 6 at $DIR/simplify-arm.rs:28:5: 28:11
StorageDead(_8); // scope 2 at $DIR/simplify-arm.rs:+2:50: +2:51
StorageDead(_6); // scope 0 at $DIR/simplify-arm.rs:+2:50: +2:51
StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:+4:6: +4:7
diff --git a/src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.32bit.diff b/src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.32bit.diff
deleted file mode 100644
index 118f5dd0a..000000000
--- a/src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.32bit.diff
+++ /dev/null
@@ -1,61 +0,0 @@
-- // MIR for `main` before SimplifyArmIdentity
-+ // MIR for `main` after SimplifyArmIdentity
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify-arm-identity.rs:+0:11: +0:11
- let _1: Src; // in scope 0 at $DIR/simplify-arm-identity.rs:+1:9: +1:10
- let mut _2: Dst; // in scope 0 at $DIR/simplify-arm-identity.rs:+2:18: +5:6
- let mut _3: isize; // in scope 0 at $DIR/simplify-arm-identity.rs:+3:9: +3:20
- let mut _5: u8; // in scope 0 at $DIR/simplify-arm-identity.rs:+3:33: +3:34
- scope 1 {
- debug e => _1; // in scope 1 at $DIR/simplify-arm-identity.rs:+1:9: +1:10
- let _4: u8; // in scope 1 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- scope 2 {
- }
- scope 3 {
- debug x => _4; // in scope 3 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/simplify-arm-identity.rs:+1:9: +1:10
- Deinit(_1); // scope 0 at $DIR/simplify-arm-identity.rs:+1:18: +1:29
- ((_1 as Foo).0: u8) = const 0_u8; // scope 0 at $DIR/simplify-arm-identity.rs:+1:18: +1:29
- discriminant(_1) = 0; // scope 0 at $DIR/simplify-arm-identity.rs:+1:18: +1:29
- StorageLive(_2); // scope 1 at $DIR/simplify-arm-identity.rs:+2:18: +5:6
- _3 = const 0_isize; // scope 1 at $DIR/simplify-arm-identity.rs:+2:24: +2:25
- goto -> bb3; // scope 1 at $DIR/simplify-arm-identity.rs:+2:18: +2:25
- }
-
- bb1: {
- Deinit(_2); // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- ((_2 as Foo).0: u8) = const 0_u8; // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- discriminant(_2) = 0; // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- }
-
- bb2: {
- unreachable; // scope 1 at $DIR/simplify-arm-identity.rs:+2:24: +2:25
- }
-
- bb3: {
- StorageLive(_4); // scope 1 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- _4 = ((_1 as Foo).0: u8); // scope 1 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- StorageLive(_5); // scope 3 at $DIR/simplify-arm-identity.rs:+3:33: +3:34
- _5 = _4; // scope 3 at $DIR/simplify-arm-identity.rs:+3:33: +3:34
- Deinit(_2); // scope 3 at $DIR/simplify-arm-identity.rs:+3:24: +3:35
- ((_2 as Foo).0: u8) = move _5; // scope 3 at $DIR/simplify-arm-identity.rs:+3:24: +3:35
- discriminant(_2) = 0; // scope 3 at $DIR/simplify-arm-identity.rs:+3:24: +3:35
- StorageDead(_5); // scope 3 at $DIR/simplify-arm-identity.rs:+3:34: +3:35
- StorageDead(_4); // scope 1 at $DIR/simplify-arm-identity.rs:+3:34: +3:35
- goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:+3:34: +3:35
- }
-
- bb4: {
- StorageDead(_2); // scope 1 at $DIR/simplify-arm-identity.rs:+5:6: +5:7
- nop; // scope 0 at $DIR/simplify-arm-identity.rs:+0:11: +6:2
- StorageDead(_1); // scope 0 at $DIR/simplify-arm-identity.rs:+6:1: +6:2
- return; // scope 0 at $DIR/simplify-arm-identity.rs:+6:2: +6:2
- }
- }
-
diff --git a/src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.64bit.diff b/src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.64bit.diff
deleted file mode 100644
index 118f5dd0a..000000000
--- a/src/test/mir-opt/simplify_arm_identity.main.SimplifyArmIdentity.64bit.diff
+++ /dev/null
@@ -1,61 +0,0 @@
-- // MIR for `main` before SimplifyArmIdentity
-+ // MIR for `main` after SimplifyArmIdentity
-
- fn main() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/simplify-arm-identity.rs:+0:11: +0:11
- let _1: Src; // in scope 0 at $DIR/simplify-arm-identity.rs:+1:9: +1:10
- let mut _2: Dst; // in scope 0 at $DIR/simplify-arm-identity.rs:+2:18: +5:6
- let mut _3: isize; // in scope 0 at $DIR/simplify-arm-identity.rs:+3:9: +3:20
- let mut _5: u8; // in scope 0 at $DIR/simplify-arm-identity.rs:+3:33: +3:34
- scope 1 {
- debug e => _1; // in scope 1 at $DIR/simplify-arm-identity.rs:+1:9: +1:10
- let _4: u8; // in scope 1 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- scope 2 {
- }
- scope 3 {
- debug x => _4; // in scope 3 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/simplify-arm-identity.rs:+1:9: +1:10
- Deinit(_1); // scope 0 at $DIR/simplify-arm-identity.rs:+1:18: +1:29
- ((_1 as Foo).0: u8) = const 0_u8; // scope 0 at $DIR/simplify-arm-identity.rs:+1:18: +1:29
- discriminant(_1) = 0; // scope 0 at $DIR/simplify-arm-identity.rs:+1:18: +1:29
- StorageLive(_2); // scope 1 at $DIR/simplify-arm-identity.rs:+2:18: +5:6
- _3 = const 0_isize; // scope 1 at $DIR/simplify-arm-identity.rs:+2:24: +2:25
- goto -> bb3; // scope 1 at $DIR/simplify-arm-identity.rs:+2:18: +2:25
- }
-
- bb1: {
- Deinit(_2); // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- ((_2 as Foo).0: u8) = const 0_u8; // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- discriminant(_2) = 0; // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:+4:21: +4:32
- }
-
- bb2: {
- unreachable; // scope 1 at $DIR/simplify-arm-identity.rs:+2:24: +2:25
- }
-
- bb3: {
- StorageLive(_4); // scope 1 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- _4 = ((_1 as Foo).0: u8); // scope 1 at $DIR/simplify-arm-identity.rs:+3:18: +3:19
- StorageLive(_5); // scope 3 at $DIR/simplify-arm-identity.rs:+3:33: +3:34
- _5 = _4; // scope 3 at $DIR/simplify-arm-identity.rs:+3:33: +3:34
- Deinit(_2); // scope 3 at $DIR/simplify-arm-identity.rs:+3:24: +3:35
- ((_2 as Foo).0: u8) = move _5; // scope 3 at $DIR/simplify-arm-identity.rs:+3:24: +3:35
- discriminant(_2) = 0; // scope 3 at $DIR/simplify-arm-identity.rs:+3:24: +3:35
- StorageDead(_5); // scope 3 at $DIR/simplify-arm-identity.rs:+3:34: +3:35
- StorageDead(_4); // scope 1 at $DIR/simplify-arm-identity.rs:+3:34: +3:35
- goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:+3:34: +3:35
- }
-
- bb4: {
- StorageDead(_2); // scope 1 at $DIR/simplify-arm-identity.rs:+5:6: +5:7
- nop; // scope 0 at $DIR/simplify-arm-identity.rs:+0:11: +6:2
- StorageDead(_1); // scope 0 at $DIR/simplify-arm-identity.rs:+6:1: +6:2
- return; // scope 0 at $DIR/simplify-arm-identity.rs:+6:2: +6:2
- }
- }
-
diff --git a/src/test/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals.diff b/src/test/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals.diff
index da2f6fc44..b41527ba0 100644
--- a/src/test/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals.diff
+++ b/src/test/mir-opt/simplify_locals_removes_unused_consts.main.SimplifyLocals.diff
@@ -16,29 +16,53 @@
- let mut _11: Temp; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+ let _1: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
+ let mut _2: ((), ()); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
-+ let _3: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
++ let mut _3: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
++ let mut _4: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
++ let _5: (); // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
++ let mut _6: u8; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
++ let mut _7: u8; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
++ let mut _8: Temp; // in scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
scope 1 {
}
bb0: {
- StorageLive(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
- StorageLive(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:21: +1:23
+- Deinit(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:21: +1:23
- StorageLive(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:25: +1:27
+- Deinit(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:25: +1:27
+- Deinit(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
+- (_1.0: ()) = move _2; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
+- (_1.1: ()) = move _3; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:20: +1:28
- StorageDead(_3); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:27: +1:28
- StorageDead(_2); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:27: +1:28
- StorageDead(_1); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+1:28: +1:29
- StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
- StorageLive(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
- StorageLive(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
+- Deinit(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
- StorageLive(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
+- Deinit(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
+- Deinit(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
+- (_5.0: ()) = move _6; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
+- (_5.1: ()) = move _7; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
- StorageDead(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
- StorageDead(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
- _4 = use_zst(move _5) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
+ StorageLive(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
+ StorageLive(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
++ StorageLive(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
++ Deinit(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:14: +2:16
++ StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
++ Deinit(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:18: +2:20
++ Deinit(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
++ (_2.0: ()) = move _3; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
++ (_2.1: ()) = move _4; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:13: +2:21
++ StorageDead(_4); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
++ StorageDead(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:20: +2:21
+ _1 = use_zst(move _2) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:5: +2:22
// mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:12
+ // + span: $DIR/simplify-locals-removes-unused-consts.rs:15:5: 15:12
// + literal: Const { ty: fn(((), ())) {use_zst}, val: Value(<ZST>) }
}
@@ -49,22 +73,36 @@
- StorageLive(_9); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
- StorageLive(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
- StorageLive(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+- Deinit(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+- (_11.0: u8) = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
+- _10 = (_11.0: u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
+- _9 = Add(move _10, const 2_u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
- StorageDead(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:33: +4:34
-- _8 = use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+- _8 = use_u8(move _9) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
+ StorageDead(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:21: +2:22
+ StorageDead(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+2:22: +2:23
-+ StorageLive(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
-+ _3 = use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
++ StorageLive(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
++ StorageLive(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
++ StorageLive(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
++ StorageLive(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
++ Deinit(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
++ (_8.0: u8) = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:28
++ _7 = (_8.0: u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:30
++ _6 = Add(move _7, const 2_u8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:12: +4:34
++ StorageDead(_7); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:33: +4:34
++ _5 = use_u8(move _6) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:5: +4:35
// mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:11
+ // + span: $DIR/simplify-locals-removes-unused-consts.rs:17:5: 17:11
// + literal: Const { ty: fn(u8) {use_u8}, val: Value(<ZST>) }
}
bb2: {
- StorageDead(_9); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:34: +4:35
- StorageDead(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
-- StorageDead(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
-+ StorageDead(_3); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
++ StorageDead(_6); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:34: +4:35
+ StorageDead(_8); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
++ StorageDead(_5); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:+4:35: +4:36
+ _0 = const (); // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+0:11: +5:2
return; // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:+5:2: +5:2
}
}
diff --git a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff b/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff
deleted file mode 100644
index c6895fa41..000000000
--- a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.64bit.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-- // MIR for `map` before SimplifyLocals
-+ // MIR for `map` after SimplifyLocals
-
- fn map(_1: Option<Box<()>>) -> Option<Box<()>> {
- debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+0:8: +0:9
- let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+0:31: +0:46
- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:9: +2:13
-- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
-- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
-- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
-- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
-- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
- scope 1 {
- debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
- }
-
- bb0: {
- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:5: +1:12
- }
-
- bb1: {
- ((_0 as Some).0: std::boxed::Box<()>) = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
- Deinit(_0); // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
- discriminant(_0) = 1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
- }
-
- bb2: {
- Deinit(_0); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
- discriminant(_0) = 0; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
- }
-
- bb3: {
- return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:2: +5:2
- }
- }
-
diff --git a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.32bit.diff b/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.diff
index c6895fa41..51d26b08b 100644
--- a/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.32bit.diff
+++ b/src/test/mir-opt/simplify_locals_removes_unused_discriminant_reads.map.SimplifyLocals.diff
@@ -5,34 +5,47 @@
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+0:8: +0:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+0:31: +0:46
let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:9: +2:13
-- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
-- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
+ let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
+ let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
- let mut _6: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
- let mut _7: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
scope 1 {
- debug x => ((_0 as Some).0: std::boxed::Box<()>); // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
+ debug x => _3; // in scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
}
bb0: {
+- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
+- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
_2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:5: +1:12
+ switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:5: +1:12
}
bb1: {
- ((_0 as Some).0: std::boxed::Box<()>) = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
+ StorageLive(_3); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
+ _3 = move ((_1 as Some).0: std::boxed::Box<()>); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:14: +3:15
+ StorageLive(_4); // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
+ _4 = move _3; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:25: +3:26
Deinit(_0); // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
+ ((_0 as Some).0: std::boxed::Box<()>) = move _4; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
discriminant(_0) = 1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:20: +3:27
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
+ StorageDead(_4); // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
+ StorageDead(_3); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
+ goto -> bb4; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+3:26: +3:27
}
bb2: {
+ unreachable; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+1:11: +1:12
+ }
+
+ bb3: {
Deinit(_0); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
discriminant(_0) = 0; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
+ goto -> bb4; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+2:17: +2:21
}
- bb3: {
+ bb4: {
+- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:1: +5:2
return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:+5:2: +5:2
}
}
diff --git a/src/test/mir-opt/simplify_try.rs b/src/test/mir-opt/simplify_try.rs
deleted file mode 100644
index 15e351e7d..000000000
--- a/src/test/mir-opt/simplify_try.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// compile-flags: -Zunsound-mir-opts
-// EMIT_MIR simplify_try.try_identity.SimplifyArmIdentity.diff
-// EMIT_MIR simplify_try.try_identity.SimplifyBranchSame.after.mir
-// EMIT_MIR simplify_try.try_identity.SimplifyLocals.after.mir
-// EMIT_MIR simplify_try.try_identity.DestinationPropagation.diff
-
-
-fn into_result<T, E>(r: Result<T, E>) -> Result<T, E> {
- r
-}
-
-fn from_error<T, E>(e: E) -> Result<T, E> {
- Err(e)
-}
-
-// This was written to the `?` from `try_trait`, but `try_trait_v2` uses a different structure,
-// so the relevant desugar is copied inline in order to keep the test testing the same thing.
-// FIXME(#85133): while this might be useful for `r#try!`, it would be nice to have a MIR
-// optimization that picks up the `?` desugaring, as `SimplifyArmIdentity` does not.
-fn try_identity(x: Result<u32, i32>) -> Result<u32, i32> {
- let y = match into_result(x) {
- Err(e) => return from_error(From::from(e)),
- Ok(v) => v,
- };
- Ok(y)
-}
-
-fn main() {
- let _ = try_identity(Ok(0));
-}
diff --git a/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff b/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff
index d81d23c1c..83b91309b 100644
--- a/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff
+++ b/src/test/mir-opt/simplify_try.try_identity.DestinationPropagation.diff
@@ -24,7 +24,7 @@
debug t => _9; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
scope 6 (inlined from_error::<u32, i32>) { // at $DIR/simplify_try.rs:22:26: 22:51
- debug e => _8; // in scope 6 at $DIR/simplify_try.rs:+0:21: +0:22
+ debug e => _8; // in scope 6 at $DIR/simplify_try.rs:12:21: 12:22
}
}
scope 3 {
@@ -32,8 +32,8 @@
+ debug v => ((_0 as Ok).0: u32); // in scope 3 at $DIR/simplify_try.rs:+3:12: +3:13
}
scope 4 (inlined into_result::<u32, i32>) { // at $DIR/simplify_try.rs:21:19: 21:33
-- debug r => _4; // in scope 4 at $DIR/simplify_try.rs:+0:22: +0:23
-+ debug r => _3; // in scope 4 at $DIR/simplify_try.rs:+0:22: +0:23
+- debug r => _4; // in scope 4 at $DIR/simplify_try.rs:8:22: 8:23
++ debug r => _3; // in scope 4 at $DIR/simplify_try.rs:8:22: 8:23
}
bb0: {
@@ -41,16 +41,16 @@
- StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
- StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
- _4 = _1; // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
-- _3 = move _4; // scope 4 at $DIR/simplify_try.rs:+0:5: +0:6
+- _3 = move _4; // scope 4 at $DIR/simplify_try.rs:9:5: 9:6
- StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:+1:32: +1:33
+ nop; // scope 0 at $DIR/simplify_try.rs:+1:9: +1:10
+ nop; // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
+ nop; // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
+ _3 = _1; // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
-+ nop; // scope 4 at $DIR/simplify_try.rs:+0:5: +0:6
++ nop; // scope 4 at $DIR/simplify_try.rs:9:5: 9:6
+ nop; // scope 0 at $DIR/simplify_try.rs:+1:32: +1:33
_5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
}
bb1: {
@@ -80,6 +80,10 @@
}
bb2: {
+ unreachable; // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
+ }
+
+ bb3: {
StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:+2:13: +2:14
nop; // scope 0 at $DIR/simplify_try.rs:+2:13: +2:14
StorageLive(_8); // scope 2 at $DIR/simplify_try.rs:+2:37: +2:50
@@ -87,9 +91,9 @@
nop; // scope 2 at $DIR/simplify_try.rs:+2:48: +2:49
nop; // scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
StorageDead(_9); // scope 2 at $DIR/simplify_try.rs:+2:49: +2:50
- nop; // scope 6 at $DIR/simplify_try.rs:+0:9: +0:10
- Deinit(_0); // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
- discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
+ nop; // scope 6 at $DIR/simplify_try.rs:13:9: 13:10
+ Deinit(_0); // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
+ discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
StorageDead(_8); // scope 2 at $DIR/simplify_try.rs:+2:50: +2:51
StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:+2:50: +2:51
- StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:+4:6: +4:7
diff --git a/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff
index 853b95cc6..e025ae7c5 100644
--- a/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff
+++ b/src/test/mir-opt/simplify_try.try_identity.SimplifyArmIdentity.diff
@@ -23,14 +23,14 @@
debug t => _9; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
scope 6 (inlined from_error::<u32, i32>) { // at $DIR/simplify_try.rs:22:26: 22:51
- debug e => _8; // in scope 6 at $DIR/simplify_try.rs:+0:21: +0:22
+ debug e => _8; // in scope 6 at $DIR/simplify_try.rs:12:21: 12:22
}
}
scope 3 {
debug v => _10; // in scope 3 at $DIR/simplify_try.rs:+3:12: +3:13
}
scope 4 (inlined into_result::<u32, i32>) { // at $DIR/simplify_try.rs:21:19: 21:33
- debug r => _4; // in scope 4 at $DIR/simplify_try.rs:+0:22: +0:23
+ debug r => _4; // in scope 4 at $DIR/simplify_try.rs:8:22: 8:23
}
bb0: {
@@ -38,10 +38,10 @@
StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
_4 = _1; // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
- _3 = move _4; // scope 4 at $DIR/simplify_try.rs:+0:5: +0:6
+ _3 = move _4; // scope 4 at $DIR/simplify_try.rs:9:5: 9:6
StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:+1:32: +1:33
_5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
}
bb1: {
@@ -61,6 +61,10 @@
}
bb2: {
+ unreachable; // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
+ }
+
+ bb3: {
StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:+2:13: +2:14
_6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:+2:13: +2:14
StorageLive(_8); // scope 2 at $DIR/simplify_try.rs:+2:37: +2:50
@@ -68,9 +72,9 @@
_9 = _6; // scope 2 at $DIR/simplify_try.rs:+2:48: +2:49
_8 = move _9; // scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
StorageDead(_9); // scope 2 at $DIR/simplify_try.rs:+2:49: +2:50
- ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify_try.rs:+0:9: +0:10
- Deinit(_0); // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
- discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
+ ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify_try.rs:13:9: 13:10
+ Deinit(_0); // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
+ discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
StorageDead(_8); // scope 2 at $DIR/simplify_try.rs:+2:50: +2:51
StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:+2:50: +2:51
StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:+4:6: +4:7
diff --git a/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir b/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir
index 10799cd92..eb5af2227 100644
--- a/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir
+++ b/src/test/mir-opt/simplify_try.try_identity.SimplifyBranchSame.after.mir
@@ -22,14 +22,14 @@ fn try_identity(_1: Result<u32, i32>) -> Result<u32, i32> {
debug t => _9; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
scope 6 (inlined from_error::<u32, i32>) { // at $DIR/simplify_try.rs:22:26: 22:51
- debug e => _8; // in scope 6 at $DIR/simplify_try.rs:+0:21: +0:22
+ debug e => _8; // in scope 6 at $DIR/simplify_try.rs:12:21: 12:22
}
}
scope 3 {
debug v => _10; // in scope 3 at $DIR/simplify_try.rs:+3:12: +3:13
}
scope 4 (inlined into_result::<u32, i32>) { // at $DIR/simplify_try.rs:21:19: 21:33
- debug r => _4; // in scope 4 at $DIR/simplify_try.rs:+0:22: +0:23
+ debug r => _4; // in scope 4 at $DIR/simplify_try.rs:8:22: 8:23
}
bb0: {
@@ -37,10 +37,10 @@ fn try_identity(_1: Result<u32, i32>) -> Result<u32, i32> {
StorageLive(_3); // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
_4 = _1; // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
- _3 = move _4; // scope 4 at $DIR/simplify_try.rs:+0:5: +0:6
+ _3 = move _4; // scope 4 at $DIR/simplify_try.rs:9:5: 9:6
StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:+1:32: +1:33
_5 = discriminant(_3); // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
- switchInt(move _5) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
}
bb1: {
@@ -60,6 +60,10 @@ fn try_identity(_1: Result<u32, i32>) -> Result<u32, i32> {
}
bb2: {
+ unreachable; // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
+ }
+
+ bb3: {
StorageLive(_6); // scope 0 at $DIR/simplify_try.rs:+2:13: +2:14
_6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify_try.rs:+2:13: +2:14
StorageLive(_8); // scope 2 at $DIR/simplify_try.rs:+2:37: +2:50
@@ -67,9 +71,9 @@ fn try_identity(_1: Result<u32, i32>) -> Result<u32, i32> {
_9 = _6; // scope 2 at $DIR/simplify_try.rs:+2:48: +2:49
_8 = move _9; // scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
StorageDead(_9); // scope 2 at $DIR/simplify_try.rs:+2:49: +2:50
- ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify_try.rs:+0:9: +0:10
- Deinit(_0); // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
- discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
+ ((_0 as Err).0: i32) = move _8; // scope 6 at $DIR/simplify_try.rs:13:9: 13:10
+ Deinit(_0); // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
+ discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
StorageDead(_8); // scope 2 at $DIR/simplify_try.rs:+2:50: +2:51
StorageDead(_6); // scope 0 at $DIR/simplify_try.rs:+2:50: +2:51
StorageDead(_3); // scope 0 at $DIR/simplify_try.rs:+4:6: +4:7
diff --git a/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir b/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir
index f8c9034f7..1efa8a67e 100644
--- a/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir
+++ b/src/test/mir-opt/simplify_try.try_identity.SimplifyLocals.after.mir
@@ -17,20 +17,20 @@ fn try_identity(_1: Result<u32, i32>) -> Result<u32, i32> {
debug t => _6; // in scope 5 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
}
scope 6 (inlined from_error::<u32, i32>) { // at $DIR/simplify_try.rs:22:26: 22:51
- debug e => _5; // in scope 6 at $DIR/simplify_try.rs:+0:21: +0:22
+ debug e => _5; // in scope 6 at $DIR/simplify_try.rs:12:21: 12:22
}
}
scope 3 {
debug v => ((_0 as Ok).0: u32); // in scope 3 at $DIR/simplify_try.rs:+3:12: +3:13
}
scope 4 (inlined into_result::<u32, i32>) { // at $DIR/simplify_try.rs:21:19: 21:33
- debug r => _2; // in scope 4 at $DIR/simplify_try.rs:+0:22: +0:23
+ debug r => _2; // in scope 4 at $DIR/simplify_try.rs:8:22: 8:23
}
bb0: {
_2 = _1; // scope 0 at $DIR/simplify_try.rs:+1:31: +1:32
_3 = discriminant(_2); // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
- switchInt(move _3) -> [0_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
+ switchInt(move _3) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:+1:13: +1:33
}
bb1: {
@@ -41,12 +41,16 @@ fn try_identity(_1: Result<u32, i32>) -> Result<u32, i32> {
}
bb2: {
+ unreachable; // scope 0 at $DIR/simplify_try.rs:+1:19: +1:33
+ }
+
+ bb3: {
StorageLive(_4); // scope 0 at $DIR/simplify_try.rs:+2:13: +2:14
StorageLive(_5); // scope 2 at $DIR/simplify_try.rs:+2:37: +2:50
StorageLive(_6); // scope 2 at $DIR/simplify_try.rs:+2:48: +2:49
StorageDead(_6); // scope 2 at $DIR/simplify_try.rs:+2:49: +2:50
- Deinit(_0); // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
- discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:+0:5: +0:11
+ Deinit(_0); // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
+ discriminant(_0) = 1; // scope 6 at $DIR/simplify_try.rs:13:5: 13:11
StorageDead(_5); // scope 2 at $DIR/simplify_try.rs:+2:50: +2:51
StorageDead(_4); // scope 0 at $DIR/simplify_try.rs:+2:50: +2:51
return; // scope 0 at $DIR/simplify_try.rs:+6:2: +6:2
diff --git a/src/test/mir-opt/slice-drop-shim.rs b/src/test/mir-opt/slice-drop-shim.rs
index 0fd32906d..344c1af2c 100644
--- a/src/test/mir-opt/slice-drop-shim.rs
+++ b/src/test/mir-opt/slice-drop-shim.rs
@@ -1,6 +1,6 @@
// compile-flags: -Zmir-opt-level=0
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
// EMIT_MIR core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
fn main() {
let _fn = std::ptr::drop_in_place::<[String]> as unsafe fn(_);
diff --git a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.32bit.mir b/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.32bit.mir
deleted file mode 100644
index b4b317e84..000000000
--- a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.32bit.mir
+++ /dev/null
@@ -1,101 +0,0 @@
-// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
-
-fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
- let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _2: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _3: usize; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _4: 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
-
- bb0: {
- goto -> bb15; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb1: {
- return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb2 (cleanup): {
- resume; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- 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
- }
-
- bb4 (cleanup): {
- _6 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _6) -> [false: 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
- }
-
- bb6: {
- _8 = Eq(_4, _3); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- switchInt(move _8) -> [false: 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
- 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) -> [false: 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) -> [false: 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 (Misc); // 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_usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-}
diff --git a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.64bit.mir b/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
index b4b317e84..31ccf1454 100644
--- a/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.64bit.mir
+++ b/src/test/mir-opt/slice_drop_shim.core.ptr-drop_in_place.[String].AddMovesForPackedDrops.before.mir
@@ -84,7 +84,7 @@ fn std::ptr::drop_in_place(_1: *mut [String]) -> () {
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 (Misc); // 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
}
diff --git a/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir b/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir
index bc9e91420..e50067ea2 100644
--- a/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir
+++ b/src/test/mir-opt/storage_live_dead_in_statics.XXX.mir_map.0.mir
@@ -198,6 +198,6 @@ static XXX: &Foo = {
_0 = &(*_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:28: +18:2
StorageDead(_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
StorageDead(_1); // scope 0 at $DIR/storage_live_dead_in_statics.rs:+18:1: +18:2
- return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:1: +0:25
+ return; // scope 0 at $DIR/storage_live_dead_in_statics.rs:+0:1: +18:3
}
}
diff --git a/src/test/mir-opt/storage_ranges.main.nll.0.mir b/src/test/mir-opt/storage_ranges.main.nll.0.mir
index 812eb3b82..8e10e70f1 100644
--- a/src/test/mir-opt/storage_ranges.main.nll.0.mir
+++ b/src/test/mir-opt/storage_ranges.main.nll.0.mir
@@ -7,16 +7,15 @@
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=22], '_#0r, '_#1r}
| '_#1r | U0 | {bb0[0..=22], '_#1r}
-| '_#2r | U0 | {}
-| '_#3r | U0 | {bb0[10..=11]}
-| '_#4r | U0 | {bb0[11]}
+| '_#2r | U0 | {bb0[10..=11]}
+| '_#3r | U0 | {bb0[11]}
|
| Inference Constraints
| '_#0r live at {bb0[0..=22]}
| '_#1r live at {bb0[0..=22]}
-| '_#3r live at {bb0[10]}
-| '_#4r live at {bb0[11]}
-| '_#3r: '_#4r due to Assignment at Single(bb0[10]) ($DIR/storage_ranges.rs:6:17: 6:25 (#0)
+| '_#2r live at {bb0[10]}
+| '_#3r live at {bb0[11]}
+| '_#2r: '_#3r due to Assignment at Single(bb0[10]) ($DIR/storage_ranges.rs:6:17: 6:25 (#0)
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/storage_ranges.rs:+0:11: +0:11
diff --git a/src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir b/src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
new file mode 100644
index 000000000..330929c58
--- /dev/null
+++ b/src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
@@ -0,0 +1,96 @@
+// MIR for `new` after PreCodegen
+
+fn new(_1: Result<T, E>) -> Result<T, E> {
+ debug x => _1; // in scope 0 at $DIR/try_identity_e2e.rs:+0:14: +0:15
+ let mut _0: std::result::Result<T, E>; // return place in scope 0 at $DIR/try_identity_e2e.rs:+0:34: +0:46
+ let mut _2: T; // in scope 0 at $DIR/try_identity_e2e.rs:+2:9: +10:10
+ let mut _3: std::ops::ControlFlow<E, T>; // in scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
+ let mut _4: isize; // in scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:22
+ let _5: T; // in scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
+ let mut _6: T; // in scope 0 at $DIR/try_identity_e2e.rs:+4:48: +4:49
+ let _7: E; // in scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
+ let mut _8: E; // in scope 0 at $DIR/try_identity_e2e.rs:+5:46: +5:47
+ let mut _9: isize; // in scope 0 at $DIR/try_identity_e2e.rs:+8:13: +8:37
+ let _10: T; // in scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
+ let _11: E; // in scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
+ let mut _12: E; // in scope 0 at $DIR/try_identity_e2e.rs:+9:49: +9:50
+ scope 1 {
+ debug v => _5; // in scope 1 at $DIR/try_identity_e2e.rs:+4:20: +4:21
+ }
+ scope 2 {
+ debug e => _7; // in scope 2 at $DIR/try_identity_e2e.rs:+5:21: +5:22
+ }
+ scope 3 {
+ debug v => _10; // in scope 3 at $DIR/try_identity_e2e.rs:+8:35: +8:36
+ }
+ scope 4 {
+ debug e => _11; // in scope 4 at $DIR/try_identity_e2e.rs:+9:32: +9:33
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +10:10
+ StorageLive(_3); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
+ _4 = discriminant(_1); // scope 0 at $DIR/try_identity_e2e.rs:+3:19: +3:20
+ switchInt(move _4) -> [0_isize: bb2, 1_isize: bb1, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20
+ }
+
+ bb1: {
+ StorageLive(_7); // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
+ _7 = move ((_1 as Err).0: E); // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
+ StorageLive(_8); // scope 2 at $DIR/try_identity_e2e.rs:+5:46: +5:47
+ _8 = move _7; // scope 2 at $DIR/try_identity_e2e.rs:+5:46: +5:47
+ Deinit(_3); // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
+ ((_3 as Break).0: E) = move _8; // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
+ discriminant(_3) = 1; // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
+ StorageDead(_8); // scope 2 at $DIR/try_identity_e2e.rs:+5:47: +5:48
+ StorageDead(_7); // scope 0 at $DIR/try_identity_e2e.rs:+5:47: +5:48
+ _9 = discriminant(_3); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
+ switchInt(move _9) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
+ }
+
+ bb2: {
+ StorageLive(_5); // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
+ _5 = move ((_1 as Ok).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
+ StorageLive(_6); // scope 1 at $DIR/try_identity_e2e.rs:+4:48: +4:49
+ _6 = move _5; // scope 1 at $DIR/try_identity_e2e.rs:+4:48: +4:49
+ Deinit(_3); // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
+ ((_3 as Continue).0: T) = move _6; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
+ discriminant(_3) = 0; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
+ StorageDead(_6); // scope 1 at $DIR/try_identity_e2e.rs:+4:49: +4:50
+ StorageDead(_5); // scope 0 at $DIR/try_identity_e2e.rs:+4:49: +4:50
+ _9 = discriminant(_3); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
+ switchInt(move _9) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
+ }
+
+ bb3: {
+ StorageLive(_11); // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
+ _11 = move ((_3 as Break).0: E); // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
+ StorageLive(_12); // scope 4 at $DIR/try_identity_e2e.rs:+9:49: +9:50
+ _12 = move _11; // scope 4 at $DIR/try_identity_e2e.rs:+9:49: +9:50
+ Deinit(_0); // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
+ ((_0 as Err).0: E) = move _12; // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
+ discriminant(_0) = 1; // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
+ StorageDead(_12); // scope 4 at $DIR/try_identity_e2e.rs:+9:50: +9:51
+ StorageDead(_11); // scope 0 at $DIR/try_identity_e2e.rs:+9:50: +9:51
+ StorageDead(_2); // scope 0 at $DIR/try_identity_e2e.rs:+11:5: +11:6
+ StorageDead(_3); // 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
+ }
+
+ bb4: {
+ unreachable; // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
+ }
+
+ bb5: {
+ StorageLive(_10); // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
+ _10 = move ((_3 as Continue).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
+ _2 = move _10; // scope 3 at $DIR/try_identity_e2e.rs:+8:41: +8:42
+ StorageDead(_10); // scope 0 at $DIR/try_identity_e2e.rs:+8:41: +8:42
+ Deinit(_0); // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
+ ((_0 as Ok).0: T) = move _2; // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
+ discriminant(_0) = 0; // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
+ StorageDead(_2); // scope 0 at $DIR/try_identity_e2e.rs:+11:5: +11:6
+ StorageDead(_3); // 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
+ }
+}
diff --git a/src/test/mir-opt/try_identity_e2e.old.PreCodegen.after.mir b/src/test/mir-opt/try_identity_e2e.old.PreCodegen.after.mir
new file mode 100644
index 000000000..18d3e0fb2
--- /dev/null
+++ b/src/test/mir-opt/try_identity_e2e.old.PreCodegen.after.mir
@@ -0,0 +1,53 @@
+// MIR for `old` after PreCodegen
+
+fn old(_1: Result<T, E>) -> Result<T, E> {
+ debug x => _1; // in scope 0 at $DIR/try_identity_e2e.rs:+0:14: +0:15
+ let mut _0: std::result::Result<T, E>; // return place in scope 0 at $DIR/try_identity_e2e.rs:+0:34: +0:46
+ let mut _2: T; // in scope 0 at $DIR/try_identity_e2e.rs:+2:9: +5:10
+ let mut _3: isize; // in scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:18
+ let _4: T; // in scope 0 at $DIR/try_identity_e2e.rs:+3:16: +3:17
+ let _5: E; // in scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:18
+ let mut _6: E; // in scope 0 at $DIR/try_identity_e2e.rs:+4:34: +4:35
+ scope 1 {
+ debug v => _4; // in scope 1 at $DIR/try_identity_e2e.rs:+3:16: +3:17
+ }
+ scope 2 {
+ debug e => _5; // in scope 2 at $DIR/try_identity_e2e.rs:+4:17: +4:18
+ }
+
+ bb0: {
+ StorageLive(_2); // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +5:10
+ _3 = discriminant(_1); // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +2:16
+ switchInt(move _3) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +2:16
+ }
+
+ bb1: {
+ StorageLive(_5); // scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:18
+ _5 = move ((_1 as Err).0: E); // scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:18
+ StorageLive(_6); // scope 2 at $DIR/try_identity_e2e.rs:+4:34: +4:35
+ _6 = move _5; // scope 2 at $DIR/try_identity_e2e.rs:+4:34: +4:35
+ Deinit(_0); // scope 2 at $DIR/try_identity_e2e.rs:+4:30: +4:36
+ ((_0 as Err).0: E) = move _6; // scope 2 at $DIR/try_identity_e2e.rs:+4:30: +4:36
+ discriminant(_0) = 1; // scope 2 at $DIR/try_identity_e2e.rs:+4:30: +4:36
+ StorageDead(_6); // scope 2 at $DIR/try_identity_e2e.rs:+4:35: +4:36
+ StorageDead(_5); // scope 0 at $DIR/try_identity_e2e.rs:+4:35: +4:36
+ StorageDead(_2); // scope 0 at $DIR/try_identity_e2e.rs:+6:5: +6:6
+ return; // scope 0 at $DIR/try_identity_e2e.rs:+7:1: +7:2
+ }
+
+ bb2: {
+ unreachable; // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +2:16
+ }
+
+ bb3: {
+ StorageLive(_4); // scope 0 at $DIR/try_identity_e2e.rs:+3:16: +3:17
+ _4 = move ((_1 as Ok).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+3:16: +3:17
+ _2 = move _4; // scope 1 at $DIR/try_identity_e2e.rs:+3:22: +3:23
+ StorageDead(_4); // scope 0 at $DIR/try_identity_e2e.rs:+3:22: +3:23
+ Deinit(_0); // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +6:6
+ ((_0 as Ok).0: T) = move _2; // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +6:6
+ discriminant(_0) = 0; // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +6:6
+ StorageDead(_2); // scope 0 at $DIR/try_identity_e2e.rs:+6:5: +6:6
+ return; // scope 0 at $DIR/try_identity_e2e.rs:+7:1: +7:2
+ }
+}
diff --git a/src/test/mir-opt/try_identity_e2e.rs b/src/test/mir-opt/try_identity_e2e.rs
new file mode 100644
index 000000000..00cb80f50
--- /dev/null
+++ b/src/test/mir-opt/try_identity_e2e.rs
@@ -0,0 +1,34 @@
+// Track the status of MIR optimizations simplifying `Ok(res?)` for both the old and new desugarings
+// of that syntax.
+
+use std::ops::ControlFlow;
+
+// EMIT_MIR try_identity_e2e.new.PreCodegen.after.mir
+fn new<T, E>(x: Result<T, E>) -> Result<T, E> {
+ Ok(
+ match {
+ match x {
+ Ok(v) => ControlFlow::Continue(v),
+ Err(e) => ControlFlow::Break(e),
+ }
+ } {
+ ControlFlow::Continue(v) => v,
+ ControlFlow::Break(e) => return Err(e),
+ }
+ )
+}
+
+// EMIT_MIR try_identity_e2e.old.PreCodegen.after.mir
+fn old<T, E>(x: Result<T, E>) -> Result<T, E> {
+ Ok(
+ match x {
+ Ok(v) => v,
+ Err(e) => return Err(e),
+ }
+ )
+}
+
+fn main() {
+ let _ = new::<(), ()>(Ok(()));
+ let _ = old::<(), ()>(Ok(()));
+}
diff --git a/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir b/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir
index 6e9a8b4d9..6a5021139 100644
--- a/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir
+++ b/src/test/mir-opt/uniform_array_move_out.move_out_by_subslice.mir_map.0.mir
@@ -15,9 +15,9 @@ fn move_out_by_subslice() -> () {
let mut _11: std::boxed::Box<i32>; // in scope 0 at $DIR/uniform_array_move_out.rs:+1:21: +1:26
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:17
+ let _12: [std::boxed::Box<i32>; 2]; // in scope 1 at $DIR/uniform_array_move_out.rs:+2:10: +2:12
scope 4 {
- debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+2:10: +2:17
+ debug _y => _12; // in scope 4 at $DIR/uniform_array_move_out.rs:+2:10: +2:12
}
}
scope 2 {
@@ -77,8 +77,8 @@ fn move_out_by_subslice() -> () {
bb6: {
StorageDead(_2); // scope 0 at $DIR/uniform_array_move_out.rs:+1:26: +1:27
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:17
- _12 = move _1[0..2]; // scope 1 at $DIR/uniform_array_move_out.rs:+2:10: +2:17
+ 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
}
diff --git a/src/test/mir-opt/uninhabited_enum.process_never.SimplifyLocals.after.mir b/src/test/mir-opt/uninhabited_enum.process_never.SimplifyLocals.after.mir
index 34c38d24c..6ed53643f 100644
--- a/src/test/mir-opt/uninhabited_enum.process_never.SimplifyLocals.after.mir
+++ b/src/test/mir-opt/uninhabited_enum.process_never.SimplifyLocals.after.mir
@@ -11,8 +11,6 @@ fn process_never(_1: *const !) -> () {
}
bb0: {
- StorageLive(_2); // scope 0 at $DIR/uninhabited-enum.rs:+1:8: +1:14
- StorageDead(_2); // scope 0 at $DIR/uninhabited-enum.rs:+2:1: +2:2
unreachable; // scope 0 at $DIR/uninhabited-enum.rs:+0:39: +2:2
}
}
diff --git a/src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir b/src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
index 3d860dac3..4aa5ba007 100644
--- a/src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
+++ b/src/test/mir-opt/uninhabited_enum_branching.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
@@ -18,6 +18,10 @@ fn main() -> () {
Deinit(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
discriminant(_2) = 2; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
_3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
+ switchInt(move _3) -> [2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
+ }
+
+ bb1: {
StorageLive(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
_5 = const "C"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
// mir::Constant
@@ -32,10 +36,14 @@ fn main() -> () {
Deinit(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
discriminant(_7) = 0; // 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_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ switchInt(move _8) -> [4_isize: bb5, 5_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
}
- bb1: {
+ bb2: {
+ unreachable; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
+ }
+
+ bb3: {
StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
_9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
// mir::Constant
@@ -43,18 +51,22 @@ 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 -> bb3; // 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
}
- bb2: {
+ 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 -> bb3; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
+ goto -> bb6; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
}
- bb3: {
+ bb6: {
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/src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff b/src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
index 023f6ae32..c3d356aed 100644
--- a/src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
+++ b/src/test/mir-opt/uninhabited_enum_branching.main.UninhabitedEnumBranching.diff
@@ -19,8 +19,8 @@
Deinit(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
discriminant(_2) = 2; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
_3 = discriminant(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
-- switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
-+ switchInt(move _3) -> bb1; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
+- switchInt(move _3) -> [0_isize: bb3, 1_isize: bb4, 2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
++ switchInt(move _3) -> [2_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:5: +1:19
}
bb1: {
@@ -31,18 +31,22 @@
// + literal: Const { ty: &str, val: Value(Slice(..)) }
_1 = &(*_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:21: +4:24
StorageDead(_5); // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
- goto -> bb4; // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
+ goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+4:23: +4:24
}
bb2: {
+ unreachable; // scope 0 at $DIR/uninhabited_enum_branching.rs:+1:11: +1:19
+ }
+
+ bb3: {
_1 = const "A(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+2:24: +2:34
// mir::Constant
// + span: $DIR/uninhabited_enum_branching.rs:21:24: 21:34
// + literal: Const { ty: &str, val: Value(Slice(..)) }
- goto -> bb4; // scope 0 at $DIR/uninhabited_enum_branching.rs:+2:24: +2:34
+ goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+2:24: +2:34
}
- bb3: {
+ bb4: {
StorageLive(_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
_4 = const "B(Empty)"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
// mir::Constant
@@ -50,10 +54,10 @@
// + literal: Const { ty: &str, val: Value(Slice(..)) }
_1 = &(*_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:24: +3:34
StorageDead(_4); // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:33: +3:34
- goto -> bb4; // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:33: +3:34
+ goto -> bb5; // scope 0 at $DIR/uninhabited_enum_branching.rs:+3:33: +3:34
}
- bb4: {
+ bb5: {
StorageDead(_2); // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
StorageDead(_1); // scope 0 at $DIR/uninhabited_enum_branching.rs:+5:6: +5:7
StorageLive(_6); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +10:6
@@ -61,10 +65,10 @@
Deinit(_7); // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:11: +7:19
discriminant(_7) = 0; // 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_isize: bb6, otherwise: bb5]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
+ switchInt(move _8) -> [4_isize: bb8, 5_isize: bb6, otherwise: bb7]; // scope 0 at $DIR/uninhabited_enum_branching.rs:+7:5: +7:19
}
- bb5: {
+ bb6: {
StorageLive(_9); // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
_9 = const "E"; // scope 0 at $DIR/uninhabited_enum_branching.rs:+9:21: +9:24
// mir::Constant
@@ -72,18 +76,22 @@
// + 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 -> bb7; // 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
}
- bb6: {
+ 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 -> bb7; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
+ goto -> bb9; // scope 0 at $DIR/uninhabited_enum_branching.rs:+8:21: +8:24
}
- bb7: {
+ bb9: {
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/src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir b/src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
index a5e7f5269..ec5612ad7 100644
--- a/src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
+++ b/src/test/mir-opt/uninhabited_enum_branching2.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
@@ -32,7 +32,7 @@ fn main() -> () {
StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
- switchInt(move _5) -> [2_isize: bb2, otherwise: bb1]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
+ switchInt(move _5) -> [2_isize: bb3, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
}
bb1: {
@@ -43,10 +43,14 @@ fn main() -> () {
// + literal: Const { ty: &str, val: Value(Slice(..)) }
_3 = &(*_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
StorageDead(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
- goto -> bb3; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
+ goto -> bb4; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
}
bb2: {
+ unreachable; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
+ }
+
+ bb3: {
StorageLive(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
_7 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
// mir::Constant
@@ -54,18 +58,18 @@ fn main() -> () {
// + literal: Const { ty: &str, val: Value(Slice(..)) }
_3 = &(*_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
StorageDead(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
- goto -> bb3; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
+ goto -> bb4; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
}
- bb3: {
+ bb4: {
StorageDead(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
_10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
- switchInt(move _10) -> [2_isize: bb5, otherwise: bb4]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
+ switchInt(move _10) -> [2_isize: bb7, 3_isize: bb5, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
}
- bb4: {
+ bb5: {
StorageLive(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
_13 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
// mir::Constant
@@ -73,10 +77,14 @@ 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 -> bb6; // 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
}
- bb5: {
+ 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
@@ -84,10 +92,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 -> bb6; // 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
}
- bb6: {
+ bb8: {
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/src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff b/src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
index 157518491..77b358a48 100644
--- a/src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
+++ b/src/test/mir-opt/uninhabited_enum_branching2.main.UninhabitedEnumBranching.diff
@@ -33,8 +33,8 @@
StorageLive(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_4 = &(_1.1: Test1); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
_5 = discriminant((*_4)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
-- switchInt(move _5) -> [0_isize: bb2, 1_isize: bb3, 2_isize: bb4, otherwise: bb1]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
-+ switchInt(move _5) -> [2_isize: bb4, otherwise: bb1]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
+- switchInt(move _5) -> [0_isize: bb3, 1_isize: bb4, 2_isize: bb5, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
++ switchInt(move _5) -> [2_isize: bb5, 3_isize: bb1, otherwise: bb2]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:5: +3:22
}
bb1: {
@@ -45,18 +45,22 @@
// + literal: Const { ty: &str, val: Value(Slice(..)) }
_3 = &(*_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:21: +7:24
StorageDead(_8); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
- goto -> bb5; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
+ goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+7:23: +7:24
}
bb2: {
+ unreachable; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+3:11: +3:22
+ }
+
+ bb3: {
_3 = const "A(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+4:24: +4:34
// mir::Constant
// + span: $DIR/uninhabited_enum_branching2.rs:22:24: 22:34
// + literal: Const { ty: &str, val: Value(Slice(..)) }
- goto -> bb5; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+4:24: +4:34
+ goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+4:24: +4:34
}
- bb3: {
+ bb4: {
StorageLive(_6); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
_6 = const "B(Empty)"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
// mir::Constant
@@ -64,10 +68,10 @@
// + literal: Const { ty: &str, val: Value(Slice(..)) }
_3 = &(*_6); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:24: +5:34
StorageDead(_6); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:33: +5:34
- goto -> bb5; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:33: +5:34
+ goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+5:33: +5:34
}
- bb4: {
+ bb5: {
StorageLive(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
_7 = const "C"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
// mir::Constant
@@ -75,19 +79,19 @@
// + literal: Const { ty: &str, val: Value(Slice(..)) }
_3 = &(*_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:21: +6:24
StorageDead(_7); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
- goto -> bb5; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
+ goto -> bb6; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+6:23: +6:24
}
- bb5: {
+ bb6: {
StorageDead(_4); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
StorageDead(_3); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+8:6: +8:7
StorageLive(_9); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +15:6
_10 = discriminant((_1.1: Test1)); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:11: +10:21
-- switchInt(move _10) -> [0_isize: bb7, 1_isize: bb8, 2_isize: bb9, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
-+ switchInt(move _10) -> [2_isize: bb9, otherwise: bb6]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
+- switchInt(move _10) -> [0_isize: bb9, 1_isize: bb10, 2_isize: bb11, 3_isize: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
++ switchInt(move _10) -> [2_isize: bb11, 3_isize: bb7, otherwise: bb8]; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+10:5: +10:21
}
- bb6: {
+ bb7: {
StorageLive(_13); // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
_13 = const "D"; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+14:21: +14:24
// mir::Constant
@@ -95,18 +99,22 @@
// + 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 -> bb10; // 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
}
- bb7: {
+ 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 -> bb10; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+11:24: +11:34
+ goto -> bb12; // scope 1 at $DIR/uninhabited_enum_branching2.rs:+11:24: +11:34
}
- bb8: {
+ bb10: {
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
@@ -114,10 +122,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 -> bb10; // 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
}
- bb9: {
+ bb11: {
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
@@ -125,10 +133,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 -> bb10; // 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
}
- bb10: {
+ bb12: {
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/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
index 52d9543e9..9cd4b8ccf 100644
--- a/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
+++ b/src/test/mir-opt/unreachable.main.UnreachablePropagation.diff
@@ -28,7 +28,7 @@
bb1: {
_2 = discriminant(_1); // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
- switchInt(move _2) -> [1_isize: bb2, otherwise: bb6]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
-+ goto -> bb2; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
++ switchInt(move _2) -> [1_isize: bb2, otherwise: bb3]; // scope 1 at $DIR/unreachable.rs:+1:12: +1:20
}
bb2: {
@@ -39,9 +39,10 @@
- StorageLive(_6); // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
- _6 = const true; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
-- }
--
-- bb3: {
++ unreachable; // scope 2 at $DIR/unreachable.rs:+4:12: +4:16
+ }
+
+ bb3: {
- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:+5:13: +5:20
- _5 = const (); // scope 2 at $DIR/unreachable.rs:+4:17: +6:10
- goto -> bb5; // scope 2 at $DIR/unreachable.rs:+4:9: +8:10
diff --git a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
index 3d31553c4..afd6b00aa 100644
--- a/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
+++ b/src/test/mir-opt/unreachable_diverging.main.UnreachablePropagation.diff
@@ -29,8 +29,7 @@
bb1: {
_3 = discriminant(_2); // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
-- switchInt(move _3) -> [1_isize: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
-+ switchInt(move _3) -> [1_isize: bb2, otherwise: bb5]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
+ switchInt(move _3) -> [1_isize: bb2, otherwise: bb6]; // scope 2 at $DIR/unreachable_diverging.rs:+2:12: +2:22
}
bb2: {
@@ -39,13 +38,11 @@
StorageLive(_5); // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10
StorageLive(_6); // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
_6 = _1; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
-- switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
-+ goto -> bb3; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
+ switchInt(move _6) -> [false: bb4, otherwise: bb3]; // scope 2 at $DIR/unreachable_diverging.rs:+3:12: +3:13
}
bb3: {
-- _5 = loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:+4:13: +4:27
-+ _5 = loop_forever() -> bb4; // scope 2 at $DIR/unreachable_diverging.rs:+4:13: +4:27
+ _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
// + literal: Const { ty: fn() {loop_forever}, val: Value(<ZST>) }
@@ -54,17 +51,17 @@
bb4: {
- _5 = const (); // scope 2 at $DIR/unreachable_diverging.rs:+5:10: +5:10
- goto -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10
-- }
--
-- bb5: {
- StorageDead(_6); // scope 2 at $DIR/unreachable_diverging.rs:+5:9: +5:10
- StorageDead(_5); // scope 2 at $DIR/unreachable_diverging.rs:+5:9: +5:10
- StorageLive(_7); // scope 2 at $DIR/unreachable_diverging.rs:+6:9: +6:22
++ unreachable; // scope 2 at $DIR/unreachable_diverging.rs:+3:9: +5:10
+ }
+
+ bb5: {
+- StorageDead(_6); // scope 2 at $DIR/unreachable_diverging.rs:+5:9: +5:10
+- StorageDead(_5); // scope 2 at $DIR/unreachable_diverging.rs:+5:9: +5:10
+- StorageLive(_7); // scope 2 at $DIR/unreachable_diverging.rs:+6:9: +6:22
unreachable; // scope 2 at $DIR/unreachable_diverging.rs:+6:15: +6:19
}
-- bb6: {
-+ bb5: {
+ bb6: {
_0 = const (); // scope 1 at $DIR/unreachable_diverging.rs:+7:6: +7:6
StorageDead(_1); // scope 0 at $DIR/unreachable_diverging.rs:+8:1: +8:2
StorageDead(_2); // scope 0 at $DIR/unreachable_diverging.rs:+8:1: +8:2
diff --git a/src/test/mir-opt/unusual-item-types.rs b/src/test/mir-opt/unusual-item-types.rs
index 670f61cd5..9ef3d8647 100644
--- a/src/test/mir-opt/unusual-item-types.rs
+++ b/src/test/mir-opt/unusual-item-types.rs
@@ -1,7 +1,7 @@
// Test that we don't ICE when trying to dump MIR for unusual item types and
// that we don't create filenames containing `<` and `>`
// compile-flags: -Zmir-opt-level=0
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
+
struct A;
diff --git a/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.64bit.mir
deleted file mode 100644
index a72e00ecd..000000000
--- a/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.64bit.mir
+++ /dev/null
@@ -1,10 +0,0 @@
-// MIR for `E::V::{constant#0}` 0 mir_map
-
-E::V::{constant#0}: isize = {
- let mut _0: isize; // return place in scope 0 at $DIR/unusual-item-types.rs:+0:9: +0:10
-
- bb0: {
- _0 = const 5_isize; // scope 0 at $DIR/unusual-item-types.rs:+0:9: +0:10
- return; // scope 0 at $DIR/unusual-item-types.rs:+0:9: +0:10
- }
-}
diff --git a/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.mir
index a72e00ecd..a72e00ecd 100644
--- a/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.32bit.mir
+++ b/src/test/mir-opt/unusual_item_types.E-V-{constant#0}.mir_map.0.mir
diff --git a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir
deleted file mode 100644
index 0686af46e..000000000
--- a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.64bit.mir
+++ /dev/null
@@ -1,12 +0,0 @@
-// MIR for `Test::X` 0 mir_map
-
-fn Test::X(_1: usize) -> Test {
- let mut _0: Test; // return place in scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
-
- bb0: {
- Deinit(_0); // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
- ((_0 as X).0: usize) = move _1; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
- discriminant(_0) = 0; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
- return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:6
- }
-}
diff --git a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.mir
index 0686af46e..0686af46e 100644
--- a/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.32bit.mir
+++ b/src/test/mir-opt/unusual_item_types.Test-X-{constructor#0}.mir_map.0.mir
diff --git a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
deleted file mode 100644
index 7ffd242e0..000000000
--- a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.32bit.mir
+++ /dev/null
@@ -1,39 +0,0 @@
-// MIR for `std::ptr::drop_in_place` before AddMovesForPackedDrops
-
-fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
- let mut _0: (); // return place in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _2: &mut std::vec::Vec<i32>; // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- let mut _3: (); // in scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
-
- bb0: {
- goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb1: {
- return; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb2 (cleanup): {
- resume; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb3: {
- goto -> bb1; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- 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
- }
-
- bb5: {
- drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb2]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- }
-
- bb6: {
- _2 = &mut (*_1); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- _3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: for<'r> fn(&'r mut Vec<i32>) {<Vec<i32> as Drop>::drop}, val: Value(<ZST>) }
- }
-}
diff --git a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
index 7ffd242e0..ed9f3bdbd 100644
--- a/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.64bit.mir
+++ b/src/test/mir-opt/unusual_item_types.core.ptr-drop_in_place.Vec_i32_.AddMovesForPackedDrops.before.mir
@@ -34,6 +34,6 @@ fn std::ptr::drop_in_place(_1: *mut Vec<i32>) -> () {
_3 = <Vec<i32> as Drop>::drop(move _2) -> [return: bb5, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:+0:1: +0:56
// mir::Constant
// + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: for<'r> fn(&'r mut Vec<i32>) {<Vec<i32> as Drop>::drop}, val: Value(<ZST>) }
+ // + literal: Const { ty: for<'a> fn(&'a mut Vec<i32>) {<Vec<i32> as Drop>::drop}, val: Value(<ZST>) }
}
}
diff --git a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir
deleted file mode 100644
index f7bc8d58f..000000000
--- a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.64bit.mir
+++ /dev/null
@@ -1,10 +0,0 @@
-// MIR for `<impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT` 0 mir_map
-
-const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 = {
- let mut _0: i32; // return place in scope 0 at $DIR/unusual-item-types.rs:+0:32: +0:35
-
- bb0: {
- _0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:+0:38: +0:39
- return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:35
- }
-}
diff --git a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.mir
index f7bc8d58f..5579d25a1 100644
--- a/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.32bit.mir
+++ b/src/test/mir-opt/unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.mir
@@ -5,6 +5,6 @@ const <impl at $DIR/unusual-item-types.rs:9:1: 9:7>::ASSOCIATED_CONSTANT: i32 =
bb0: {
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:+0:38: +0:39
- return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:35
+ return; // scope 0 at $DIR/unusual-item-types.rs:+0:5: +0:40
}
}
diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff
deleted file mode 100644
index eef701114..000000000
--- a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.64bit.diff
+++ /dev/null
@@ -1,55 +0,0 @@
-- // MIR for `change_loop_body` before ConstProp
-+ // MIR for `change_loop_body` after ConstProp
-
- fn change_loop_body() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/while_let_loops.rs:+0:27: +0:27
- let mut _1: i32; // in scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
- let mut _2: (); // in scope 0 at $DIR/while_let_loops.rs:+0:1: +6:2
- let mut _3: std::option::Option<u32>; // in scope 0 at $DIR/while_let_loops.rs:+2:28: +2:32
- let mut _4: isize; // in scope 0 at $DIR/while_let_loops.rs:+2:15: +2:25
- let mut _5: !; // in scope 0 at $DIR/while_let_loops.rs:+2:33: +5:6
- let mut _6: !; // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
- let _7: (); // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
- let mut _8: !; // in scope 0 at $DIR/while_let_loops.rs:+2:5: +5:6
- scope 1 {
- debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:+1:9: +1:15
- scope 2 {
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
- _1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:+1:18: +1:19
- StorageLive(_3); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
- Deinit(_3); // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
- discriminant(_3) = 0; // scope 2 at $DIR/while_let_loops.rs:+2:28: +2:32
-- _4 = discriminant(_3); // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-- switchInt(move _4) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-+ _4 = const 0_isize; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
-+ switchInt(const 0_isize) -> [1_isize: bb1, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
- }
-
- bb1: {
- switchInt(((_3 as Some).0: u32)) -> [0_u32: bb2, otherwise: bb3]; // scope 2 at $DIR/while_let_loops.rs:+2:15: +2:25
- }
-
- bb2: {
- _1 = const 1_i32; // scope 2 at $DIR/while_let_loops.rs:+3:9: +3:15
- nop; // scope 2 at $DIR/while_let_loops.rs:+4:9: +4:14
- goto -> bb4; // scope 2 at $DIR/while_let_loops.rs:+4:9: +4:14
- }
-
- bb3: {
- StorageLive(_7); // scope 1 at $DIR/while_let_loops.rs:+2:5: +5:6
- nop; // scope 1 at $DIR/while_let_loops.rs:+2:5: +5:6
- StorageDead(_7); // scope 1 at $DIR/while_let_loops.rs:+5:5: +5:6
- goto -> bb4; // scope 1 at no-location
- }
-
- bb4: {
- StorageDead(_3); // scope 1 at $DIR/while_let_loops.rs:+5:5: +5:6
- StorageDead(_1); // scope 0 at $DIR/while_let_loops.rs:+6:1: +6:2
- return; // scope 0 at $DIR/while_let_loops.rs:+6:2: +6:2
- }
- }
-
diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.diff
index eef701114..eef701114 100644
--- a/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.32bit.diff
+++ b/src/test/mir-opt/while_let_loops.change_loop_body.ConstProp.diff
diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.64bit.mir b/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.64bit.mir
deleted file mode 100644
index 15b0aece8..000000000
--- a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.64bit.mir
+++ /dev/null
@@ -1,17 +0,0 @@
-// MIR for `change_loop_body` after PreCodegen
-
-fn change_loop_body() -> () {
- let mut _0: (); // return place in scope 0 at $DIR/while_let_loops.rs:+0:27: +0:27
- let mut _1: i32; // in scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
- scope 1 {
- debug _x => _1; // in scope 1 at $DIR/while_let_loops.rs:+1:9: +1:15
- scope 2 {
- }
- }
-
- bb0: {
- StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:+1:9: +1:15
- StorageDead(_1); // scope 0 at $DIR/while_let_loops.rs:+6:1: +6:2
- return; // scope 0 at $DIR/while_let_loops.rs:+6:2: +6:2
- }
-}
diff --git a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.32bit.mir b/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir
index 15b0aece8..15b0aece8 100644
--- a/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.32bit.mir
+++ b/src/test/mir-opt/while_let_loops.change_loop_body.PreCodegen.after.mir
diff --git a/src/test/mir-opt/while_let_loops.rs b/src/test/mir-opt/while_let_loops.rs
index f320a218c..fc56cd698 100644
--- a/src/test/mir-opt/while_let_loops.rs
+++ b/src/test/mir-opt/while_let_loops.rs
@@ -1,6 +1,5 @@
// EMIT_MIR while_let_loops.change_loop_body.ConstProp.diff
// EMIT_MIR while_let_loops.change_loop_body.PreCodegen.after.mir
-// EMIT_MIR_FOR_EACH_BIT_WIDTH
pub fn change_loop_body() {
let mut _x = 0;
diff --git a/src/test/pretty/gat-bounds.rs b/src/test/pretty/gat-bounds.rs
index 8877c6cc9..0a361a383 100644
--- a/src/test/pretty/gat-bounds.rs
+++ b/src/test/pretty/gat-bounds.rs
@@ -3,8 +3,6 @@
// pretty-compare-only
-#![feature(generic_associated_types)]
-
trait X {
type Y<T>: Trait where Self: Sized;
}
diff --git a/src/test/pretty/issue-4264.pp b/src/test/pretty/issue-4264.pp
index 752c36a0f..18e6d75b1 100644
--- a/src/test/pretty/issue-4264.pp
+++ b/src/test/pretty/issue-4264.pp
@@ -32,12 +32,12 @@ fn bar() ({
({
let res =
((::alloc::fmt::format as
- for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
+ for<'a> fn(Arguments<'a>) -> String {format})(((::core::fmt::Arguments::new_v1
as
- fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
+ fn(&[&'static str], &[ArgumentV1<'_>]) -> Arguments<'_> {Arguments::<'_>::new_v1})((&([("test"
as &str)] as [&str; 1]) as &[&str; 1]),
- (&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as
- Arguments)) as String);
+ (&([] as [ArgumentV1<'_>; 0]) as &[ArgumentV1<'_>; 0])) as
+ Arguments<'_>)) as String);
(res as String)
} as String);
} as ())
diff --git a/src/test/pretty/issue-85089.pp b/src/test/pretty/issue-85089.pp
new file mode 100644
index 000000000..f84e9df04
--- /dev/null
+++ b/src/test/pretty/issue-85089.pp
@@ -0,0 +1,20 @@
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// Test to print lifetimes on HIR pretty-printing.
+
+// pretty-compare-only
+// pretty-mode:hir
+// pp-exact:issue-85089.pp
+
+trait A<'x> { }
+trait B<'x> { }
+
+struct Foo<'b> {
+ bar: &'b dyn for<'a> A<'a>,
+}
+
+impl <'a> B<'a> for dyn for<'b> A<'b> { }
+
+impl <'a> A<'a> for Foo<'a> { }
diff --git a/src/test/pretty/issue-85089.rs b/src/test/pretty/issue-85089.rs
new file mode 100644
index 000000000..eb45d4731
--- /dev/null
+++ b/src/test/pretty/issue-85089.rs
@@ -0,0 +1,16 @@
+// Test to print lifetimes on HIR pretty-printing.
+
+// pretty-compare-only
+// pretty-mode:hir
+// pp-exact:issue-85089.pp
+
+trait A<'x> {}
+trait B<'x> {}
+
+struct Foo<'b> {
+ pub bar: &'b dyn for<'a> A<'a>,
+}
+
+impl<'a> B<'a> for dyn for<'b> A<'b> {}
+
+impl<'a> A<'a> for Foo<'a> {}
diff --git a/src/test/pretty/raw-str-nonexpr.rs b/src/test/pretty/raw-str-nonexpr.rs
index 7af80979b..12440b5ae 100644
--- a/src/test/pretty/raw-str-nonexpr.rs
+++ b/src/test/pretty/raw-str-nonexpr.rs
@@ -1,3 +1,4 @@
+// needs-asm-support
// pp-exact
#[cfg(foo = r#"just parse this"#)]
diff --git a/src/test/pretty/tests-are-sorted.pp b/src/test/pretty/tests-are-sorted.pp
new file mode 100644
index 000000000..15dcd4ed9
--- /dev/null
+++ b/src/test/pretty/tests-are-sorted.pp
@@ -0,0 +1,69 @@
+#![feature(prelude_import)]
+#![no_std]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// compile-flags: --crate-type=lib --test
+// pretty-compare-only
+// pretty-mode:expanded
+// pp-exact:tests-are-sorted.pp
+
+extern crate test;
+#[cfg(test)]
+#[rustc_test_marker = "m_test"]
+pub const m_test: test::TestDescAndFn =
+ test::TestDescAndFn {
+ desc: test::TestDesc {
+ name: test::StaticTestName("m_test"),
+ ignore: false,
+ ignore_message: ::core::option::Option::None,
+ compile_fail: false,
+ no_run: false,
+ should_panic: test::ShouldPanic::No,
+ test_type: test::TestType::Unknown,
+ },
+ testfn: test::StaticTestFn(|| test::assert_test_result(m_test())),
+ };
+fn m_test() {}
+
+extern crate test;
+#[cfg(test)]
+#[rustc_test_marker = "z_test"]
+pub const z_test: test::TestDescAndFn =
+ test::TestDescAndFn {
+ desc: test::TestDesc {
+ name: test::StaticTestName("z_test"),
+ ignore: false,
+ ignore_message: ::core::option::Option::None,
+ compile_fail: false,
+ no_run: false,
+ should_panic: test::ShouldPanic::No,
+ test_type: test::TestType::Unknown,
+ },
+ testfn: test::StaticTestFn(|| test::assert_test_result(z_test())),
+ };
+fn z_test() {}
+
+extern crate test;
+#[cfg(test)]
+#[rustc_test_marker = "a_test"]
+pub const a_test: test::TestDescAndFn =
+ test::TestDescAndFn {
+ desc: test::TestDesc {
+ name: test::StaticTestName("a_test"),
+ ignore: false,
+ ignore_message: ::core::option::Option::None,
+ compile_fail: false,
+ no_run: false,
+ should_panic: test::ShouldPanic::No,
+ test_type: test::TestType::Unknown,
+ },
+ testfn: test::StaticTestFn(|| test::assert_test_result(a_test())),
+ };
+fn a_test() {}
+#[rustc_main]
+pub fn main() -> () {
+ extern crate test;
+ test::test_main_static(&[&a_test, &m_test, &z_test])
+}
diff --git a/src/test/pretty/tests-are-sorted.rs b/src/test/pretty/tests-are-sorted.rs
new file mode 100644
index 000000000..1f737d547
--- /dev/null
+++ b/src/test/pretty/tests-are-sorted.rs
@@ -0,0 +1,13 @@
+// compile-flags: --crate-type=lib --test
+// pretty-compare-only
+// pretty-mode:expanded
+// pp-exact:tests-are-sorted.pp
+
+#[test]
+fn m_test() {}
+
+#[test]
+fn z_test() {}
+
+#[test]
+fn a_test() {}
diff --git a/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile b/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile
index 4a9b3d709..adc9e3d09 100644
--- a/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile
+++ b/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that if we build `b` against a version of `a` that has one set
# of types, it will not run with a dylib that has a different set of
diff --git a/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile b/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile
index eb6ad9bd1..735d91bd2 100644
--- a/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile
+++ b/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_global_oom_handling
diff --git a/src/test/run-make-fulldeps/alloc-no-rc/Makefile b/src/test/run-make-fulldeps/alloc-no-rc/Makefile
new file mode 100644
index 000000000..5f7ae70fa
--- /dev/null
+++ b/src/test/run-make-fulldeps/alloc-no-rc/Makefile
@@ -0,0 +1,4 @@
+include ../tools.mk
+
+all:
+ $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_rc
diff --git a/src/test/run-make-fulldeps/alloc-no-sync/Makefile b/src/test/run-make-fulldeps/alloc-no-sync/Makefile
new file mode 100644
index 000000000..6a258a2dd
--- /dev/null
+++ b/src/test/run-make-fulldeps/alloc-no-sync/Makefile
@@ -0,0 +1,4 @@
+include ../tools.mk
+
+all:
+ $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_sync
diff --git a/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile b/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile
index c14006cc2..60d9c7c37 100644
--- a/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile
+++ b/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that -A warnings makes the 'empty trait list for derive' warning go away
OUT=$(shell $(RUSTC) foo.rs -A warnings 2>&1 | grep "warning" )
diff --git a/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile b/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile
index 3eecaf931..1ce8d0ec2 100644
--- a/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile
+++ b/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that -A warnings makes the 'empty trait list for derive' warning go away
DEP=$(shell $(RUSTC) bar.rs)
diff --git a/src/test/run-make-fulldeps/archive-duplicate-names/Makefile b/src/test/run-make-fulldeps/archive-duplicate-names/Makefile
index 93711c41d..bbdcd2a34 100644
--- a/src/test/run-make-fulldeps/archive-duplicate-names/Makefile
+++ b/src/test/run-make-fulldeps/archive-duplicate-names/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
mkdir $(TMPDIR)/a
diff --git a/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile b/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile
index 5b5d620ef..513311c82 100644
--- a/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile
+++ b/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type=staticlib nonclike.rs
diff --git a/src/test/run-make-fulldeps/atomic-lock-free/Makefile b/src/test/run-make-fulldeps/atomic-lock-free/Makefile
index 9e8b4fabf..37e59624a 100644
--- a/src/test/run-make-fulldeps/atomic-lock-free/Makefile
+++ b/src/test/run-make-fulldeps/atomic-lock-free/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# This tests ensure that atomic types are never lowered into runtime library calls that are not
# guaranteed to be lock-free.
diff --git a/src/test/run-make-fulldeps/bare-outfile/Makefile b/src/test/run-make-fulldeps/bare-outfile/Makefile
index baa4c1c02..858466e94 100644
--- a/src/test/run-make-fulldeps/bare-outfile/Makefile
+++ b/src/test/run-make-fulldeps/bare-outfile/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
cp foo.rs $(TMPDIR)
diff --git a/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile b/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile
index c524610bf..ac6877892 100644
--- a/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile
+++ b/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-macos
#
diff --git a/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile b/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile
index 91343e73e..c65d648b9 100644
--- a/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile
+++ b/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-macos
#
diff --git a/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile
index 98e112a37..2a371b545 100644
--- a/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile
+++ b/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(TMPDIR)/$(call BIN,bar)
$(call RUN,bar)
diff --git a/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile
index 687b59ac0..d38bcef30 100644
--- a/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile
+++ b/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-freebsd
# FIXME
diff --git a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
index f124ca2ab..9ce2a34e6 100644
--- a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
+++ b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) checkrust.rs
diff --git a/src/test/run-make-fulldeps/c-static-dylib/Makefile b/src/test/run-make-fulldeps/c-static-dylib/Makefile
index f88786857..5b78005e3 100644
--- a/src/test/run-make-fulldeps/c-static-dylib/Makefile
+++ b/src/test/run-make-fulldeps/c-static-dylib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,cfoo)
$(RUSTC) foo.rs -C prefer-dynamic
diff --git a/src/test/run-make-fulldeps/c-static-rlib/Makefile b/src/test/run-make-fulldeps/c-static-rlib/Makefile
index be22b2728..11a3cf194 100644
--- a/src/test/run-make-fulldeps/c-static-rlib/Makefile
+++ b/src/test/run-make-fulldeps/c-static-rlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,cfoo)
$(RUSTC) foo.rs
diff --git a/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile b/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile
index a8515c533..134f000d4 100644
--- a/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile
+++ b/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: archive
# Compile `main.rs`, which will link into our library, and run it.
diff --git a/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile b/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile
index 9553b7aee..e93ec99da 100644
--- a/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile
+++ b/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,add)
$(RUSTC) main.rs
diff --git a/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile b/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile
index fead197ce..82351e220 100644
--- a/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile
+++ b/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
echo a | $(CGREP) a
diff --git a/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile b/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile
index 23491d814..324791af8 100644
--- a/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile
+++ b/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile
@@ -1,7 +1,7 @@
# 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.
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# FIXME: The __rdl_ and __rust_ symbol still remains, no matter using MSVC or GNU
diff --git a/src/test/run-make-fulldeps/codegen-options-parsing/Makefile b/src/test/run-make-fulldeps/codegen-options-parsing/Makefile
index f1410b69b..b063593c9 100644
--- a/src/test/run-make-fulldeps/codegen-options-parsing/Makefile
+++ b/src/test/run-make-fulldeps/codegen-options-parsing/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
#Option taking a number
diff --git a/src/test/run-make-fulldeps/compile-stdin/Makefile b/src/test/run-make-fulldeps/compile-stdin/Makefile
index 1442224cf..be1554869 100644
--- a/src/test/run-make-fulldeps/compile-stdin/Makefile
+++ b/src/test/run-make-fulldeps/compile-stdin/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
echo 'fn main(){}' | $(RUSTC) -
diff --git a/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile b/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile
index bd7f62d5c..d4ff7d8da 100644
--- a/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile
+++ b/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
mkdir -p $(TMPDIR)/a $(TMPDIR)/b
diff --git a/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile b/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile
index e22b937a0..c16bf7af6 100644
--- a/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile
+++ b/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(TMPDIR)/libnative.a
mkdir -p $(TMPDIR)/crate
diff --git a/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile b/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile
index 0cf5d1855..74917570a 100644
--- a/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile
+++ b/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-windows-gnu
diff --git a/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile b/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile
index f79e4c3f4..d083aaa66 100644
--- a/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile
+++ b/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --edition=2021 --crate-type=rlib ../../../../library/core/src/lib.rs --cfg no_fp_fmt_parse
diff --git a/src/test/run-make-fulldeps/crate-data-smoke/Makefile b/src/test/run-make-fulldeps/crate-data-smoke/Makefile
index 1afda4574..a453f65ff 100644
--- a/src/test/run-make-fulldeps/crate-data-smoke/Makefile
+++ b/src/test/run-make-fulldeps/crate-data-smoke/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
[ `$(RUSTC) --print crate-name crate.rs` = "foo" ]
diff --git a/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile b/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile
index 091508cd8..4f25a865e 100644
--- a/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile
+++ b/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# Ensure that crates compiled with different rustc versions cannot
# be dynamically linked.
diff --git a/src/test/run-make-fulldeps/crate-name-priority/Makefile b/src/test/run-make-fulldeps/crate-name-priority/Makefile
index 17ecb33ab..08a07c325 100644
--- a/src/test/run-make-fulldeps/crate-name-priority/Makefile
+++ b/src/test/run-make-fulldeps/crate-name-priority/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs
diff --git a/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile
index 3ca2a8afa..acaebf439 100644
--- a/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile
+++ b/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile
@@ -3,7 +3,7 @@
# This test makes sure that cross-language inlining actually works by checking
# the generated machine code.
--include ../tools.mk
+include ../tools.mk
all: cpp-executable rust-executable
diff --git a/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile
index f8efeca56..70085d9bd 100644
--- a/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile
+++ b/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile
@@ -5,7 +5,7 @@
# can be executed without anything crashing. It does not test whether PGO or
# xLTO have any specific effect on the generated code.
--include ../tools.mk
+include ../tools.mk
COMMON_FLAGS=-Copt-level=3 -Ccodegen-units=1
diff --git a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
index f70b411d7..6f1caa31a 100644
--- a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
+++ b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same
# (so fixing it is harder). See #57765 for context
diff --git a/src/test/run-make-fulldeps/cross-lang-lto/Makefile b/src/test/run-make-fulldeps/cross-lang-lto/Makefile
index b4394cb5b..92058f952 100644
--- a/src/test/run-make-fulldeps/cross-lang-lto/Makefile
+++ b/src/test/run-make-fulldeps/cross-lang-lto/Makefile
@@ -1,5 +1,5 @@
--include ../tools.mk
+include ../tools.mk
# ignore windows due to libLLVM being present in PATH and the PATH and library path being the same
# (so fixing it is harder). See #57765 for context
diff --git a/src/test/run-make-fulldeps/debug-assertions/Makefile b/src/test/run-make-fulldeps/debug-assertions/Makefile
index 76ada90f1..73beb4b03 100644
--- a/src/test/run-make-fulldeps/debug-assertions/Makefile
+++ b/src/test/run-make-fulldeps/debug-assertions/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) debug.rs -C debug-assertions=no
diff --git a/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile b/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile
index 2fd84639f..b4dc44ad2 100644
--- a/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile
+++ b/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs --emit dep-info
diff --git a/src/test/run-make-fulldeps/dep-info-spaces/Makefile b/src/test/run-make-fulldeps/dep-info-spaces/Makefile
index 339a751ff..0cfe513e4 100644
--- a/src/test/run-make-fulldeps/dep-info-spaces/Makefile
+++ b/src/test/run-make-fulldeps/dep-info-spaces/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# ignore-freebsd
diff --git a/src/test/run-make-fulldeps/dep-info/Makefile b/src/test/run-make-fulldeps/dep-info/Makefile
index afb9db177..c76f43a8e 100644
--- a/src/test/run-make-fulldeps/dep-info/Makefile
+++ b/src/test/run-make-fulldeps/dep-info/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# ignore-freebsd
diff --git a/src/test/run-make-fulldeps/dylib-chain/Makefile b/src/test/run-make-fulldeps/dylib-chain/Makefile
index a33177197..1139822f4 100644
--- a/src/test/run-make-fulldeps/dylib-chain/Makefile
+++ b/src/test/run-make-fulldeps/dylib-chain/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) m1.rs -C prefer-dynamic
diff --git a/src/test/run-make-fulldeps/emit-stack-sizes/Makefile b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile
index d27028948..f636ebd28 100644
--- a/src/test/run-make-fulldeps/emit-stack-sizes/Makefile
+++ b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# ignore-macos
diff --git a/src/test/run-make-fulldeps/emit/Makefile b/src/test/run-make-fulldeps/emit/Makefile
index e0b57107e..78e68bd61 100644
--- a/src/test/run-make-fulldeps/emit/Makefile
+++ b/src/test/run-make-fulldeps/emit/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -Copt-level=0 --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs
diff --git a/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile b/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile
index fef12c4da..0eae41d72 100644
--- a/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile
+++ b/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs --crate-type staticlib
diff --git a/src/test/run-make-fulldeps/error-writing-dependencies/Makefile b/src/test/run-make-fulldeps/error-writing-dependencies/Makefile
index cbc96901a..a5d30a647 100644
--- a/src/test/run-make-fulldeps/error-writing-dependencies/Makefile
+++ b/src/test/run-make-fulldeps/error-writing-dependencies/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
# Let's get a nice error message
diff --git a/src/test/run-make-fulldeps/exit-code/Makefile b/src/test/run-make-fulldeps/exit-code/Makefile
index 007f19852..3ffaafe90 100644
--- a/src/test/run-make-fulldeps/exit-code/Makefile
+++ b/src/test/run-make-fulldeps/exit-code/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) success.rs; [ $$? -eq 0 ]
diff --git a/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile b/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile
index b84e93075..54596c2f0 100644
--- a/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile
+++ b/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) lib.rs
diff --git a/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile b/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile
index 81930e969..a8f142a64 100644
--- a/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile
+++ b/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Attempt to build this dependency tree:
#
diff --git a/src/test/run-make-fulldeps/extern-flag-fun/Makefile b/src/test/run-make-fulldeps/extern-flag-fun/Makefile
index 38d1d5bb8..a0b7c15ed 100644
--- a/src/test/run-make-fulldeps/extern-flag-fun/Makefile
+++ b/src/test/run-make-fulldeps/extern-flag-fun/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=rlib
diff --git a/src/test/run-make-fulldeps/extern-flag-pathless/Makefile b/src/test/run-make-fulldeps/extern-flag-pathless/Makefile
index 4849fc62f..0f23815b6 100644
--- a/src/test/run-make-fulldeps/extern-flag-pathless/Makefile
+++ b/src/test/run-make-fulldeps/extern-flag-pathless/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test mixing pathless --extern with paths.
diff --git a/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile b/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile
index 4354209a7..d16a8e208 100644
--- a/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile
+++ b/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs
diff --git a/src/test/run-make-fulldeps/extern-fn-generic/Makefile b/src/test/run-make-fulldeps/extern-fn-generic/Makefile
index cf897dba1..71746fb10 100644
--- a/src/test/run-make-fulldeps/extern-fn-generic/Makefile
+++ b/src/test/run-make-fulldeps/extern-fn-generic/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) testcrate.rs
diff --git a/src/test/run-make-fulldeps/extern-fn-mangle/Makefile b/src/test/run-make-fulldeps/extern-fn-mangle/Makefile
index 042048ec2..4f5d026f2 100644
--- a/src/test/run-make-fulldeps/extern-fn-mangle/Makefile
+++ b/src/test/run-make-fulldeps/extern-fn-mangle/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) test.rs
diff --git a/src/test/run-make-fulldeps/extern-fn-reachable/Makefile b/src/test/run-make-fulldeps/extern-fn-reachable/Makefile
index 9231a2b35..05bdb8d65 100644
--- a/src/test/run-make-fulldeps/extern-fn-reachable/Makefile
+++ b/src/test/run-make-fulldeps/extern-fn-reachable/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows-msvc
diff --git a/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile b/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile
index 042048ec2..4f5d026f2 100644
--- a/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile
+++ b/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) test.rs
diff --git a/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile b/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile
index 8977e14c3..1fa708950 100644
--- a/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile
+++ b/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,ctest)
$(RUSTC) test.rs
diff --git a/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile b/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile
index 042048ec2..4f5d026f2 100644
--- a/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile
+++ b/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) test.rs
diff --git a/src/test/run-make-fulldeps/extern-fn-with-union/Makefile b/src/test/run-make-fulldeps/extern-fn-with-union/Makefile
index 71a5407e8..40bae923e 100644
--- a/src/test/run-make-fulldeps/extern-fn-with-union/Makefile
+++ b/src/test/run-make-fulldeps/extern-fn-with-union/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,ctest)
$(RUSTC) testcrate.rs
diff --git a/src/test/run-make-fulldeps/extern-multiple-copies/Makefile b/src/test/run-make-fulldeps/extern-multiple-copies/Makefile
index 1631aa806..00668a6bc 100644
--- a/src/test/run-make-fulldeps/extern-multiple-copies/Makefile
+++ b/src/test/run-make-fulldeps/extern-multiple-copies/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo1.rs
diff --git a/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile b/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile
index 567d7e78a..84de2ebf3 100644
--- a/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile
+++ b/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo1.rs
diff --git a/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile b/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile
index 7d063a4c8..c57b062cd 100644
--- a/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile
+++ b/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) libc.rs -Cmetadata=foo
diff --git a/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile b/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile
index e46390a9d..470448cf5 100644
--- a/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile
+++ b/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -C extra-filename=bar foo.rs -C save-temps
diff --git a/src/test/run-make-fulldeps/foreign-double-unwind/Makefile b/src/test/run-make-fulldeps/foreign-double-unwind/Makefile
index 27cf4d19c..ea2fe9ff8 100644
--- a/src/test/run-make-fulldeps/foreign-double-unwind/Makefile
+++ b/src/test/run-make-fulldeps/foreign-double-unwind/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: foo
$(call RUN,foo) | $(CGREP) -v unreachable
diff --git a/src/test/run-make-fulldeps/foreign-exceptions/Makefile b/src/test/run-make-fulldeps/foreign-exceptions/Makefile
index 7eba52f3c..38fe2773d 100644
--- a/src/test/run-make-fulldeps/foreign-exceptions/Makefile
+++ b/src/test/run-make-fulldeps/foreign-exceptions/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: foo
$(call RUN,foo)
diff --git a/src/test/run-make-fulldeps/foreign-rust-exceptions/Makefile b/src/test/run-make-fulldeps/foreign-rust-exceptions/Makefile
new file mode 100644
index 000000000..50fca7f24
--- /dev/null
+++ b/src/test/run-make-fulldeps/foreign-rust-exceptions/Makefile
@@ -0,0 +1,11 @@
+# ignore-i686-pc-windows-gnu
+
+# This test doesn't work on 32-bit MinGW as cdylib has its own copy of unwinder
+# so cross-DLL unwinding does not work.
+
+include ../tools.mk
+
+all:
+ $(RUSTC) bar.rs --crate-type=cdylib
+ $(RUSTC) foo.rs
+ $(call RUN,foo) 2>&1 | $(CGREP) "Rust cannot catch foreign exceptions"
diff --git a/src/test/run-make-fulldeps/foreign-rust-exceptions/bar.rs b/src/test/run-make-fulldeps/foreign-rust-exceptions/bar.rs
new file mode 100644
index 000000000..5f9efe323
--- /dev/null
+++ b/src/test/run-make-fulldeps/foreign-rust-exceptions/bar.rs
@@ -0,0 +1,7 @@
+#![crate_type = "cdylib"]
+#![feature(c_unwind)]
+
+#[no_mangle]
+extern "C-unwind" fn panic() {
+ panic!();
+}
diff --git a/src/test/run-make-fulldeps/foreign-rust-exceptions/foo.rs b/src/test/run-make-fulldeps/foreign-rust-exceptions/foo.rs
new file mode 100644
index 000000000..266987c5b
--- /dev/null
+++ b/src/test/run-make-fulldeps/foreign-rust-exceptions/foo.rs
@@ -0,0 +1,13 @@
+#![feature(c_unwind)]
+
+#[cfg_attr(not(windows), link(name = "bar"))]
+#[cfg_attr(windows, link(name = "bar.dll"))]
+extern "C-unwind" {
+ fn panic();
+}
+
+fn main() {
+ let _ = std::panic::catch_unwind(|| {
+ unsafe { panic() };
+ });
+}
diff --git a/src/test/run-make-fulldeps/fpic/Makefile b/src/test/run-make-fulldeps/fpic/Makefile
index a3d0190ee..5986de366 100644
--- a/src/test/run-make-fulldeps/fpic/Makefile
+++ b/src/test/run-make-fulldeps/fpic/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# ignore-macos
diff --git a/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile b/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile
index ad841ec61..39e64bacf 100644
--- a/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile
+++ b/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile
@@ -1,7 +1,7 @@
# only-gnu
# only-linux
--include ../tools.mk
+include ../tools.mk
# This ensures that std::env::args works in a library called from C on glibc Linux.
diff --git a/src/test/run-make-fulldeps/hir-tree/Makefile b/src/test/run-make-fulldeps/hir-tree/Makefile
index 3412c8ce1..b0450ea4b 100644
--- a/src/test/run-make-fulldeps/hir-tree/Makefile
+++ b/src/test/run-make-fulldeps/hir-tree/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that hir-tree output doesn't crash and includes
# the string constant we would expect to see.
diff --git a/src/test/run-make-fulldeps/include_bytes_deps/Makefile b/src/test/run-make-fulldeps/include_bytes_deps/Makefile
index f91af88ef..696dfd207 100644
--- a/src/test/run-make-fulldeps/include_bytes_deps/Makefile
+++ b/src/test/run-make-fulldeps/include_bytes_deps/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-freebsd
diff --git a/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile b/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile
index 371f94715..5c1d953cc 100644
--- a/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile
+++ b/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# rust-lang/rust#70924: Test that if we add rust-src component in between two
# incremental compiles, the compiler does not ICE on the second.
diff --git a/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile b/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile
index 0cab955f6..9945821db 100644
--- a/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile
+++ b/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs --emit llvm-ir -C codegen-units=2
diff --git a/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile b/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile
index 0a50859cd..dc5b55a99 100644
--- a/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile
+++ b/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# The rust crate foo will link to the native library foo, while the rust crate
# bar will link to the native library bar. There is also a dependency between
diff --git a/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile b/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile
index 203772856..ff9cc5709 100644
--- a/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile
+++ b/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile
@@ -1,5 +1,6 @@
--include ../tools.mk
+include ../tools.mk
+# needs-asm-support
# ignore-windows-msvc
#
# Because of Windows exception handling, the code is not necessarily any shorter.
diff --git a/src/test/run-make-fulldeps/invalid-library/Makefile b/src/test/run-make-fulldeps/invalid-library/Makefile
index de463a330..910d9af7b 100644
--- a/src/test/run-make-fulldeps/invalid-library/Makefile
+++ b/src/test/run-make-fulldeps/invalid-library/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
touch $(TMPDIR)/lib.rmeta
diff --git a/src/test/run-make-fulldeps/invalid-staticlib/Makefile b/src/test/run-make-fulldeps/invalid-staticlib/Makefile
index 3a91902cc..3f0f74ce3 100644
--- a/src/test/run-make-fulldeps/invalid-staticlib/Makefile
+++ b/src/test/run-make-fulldeps/invalid-staticlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
touch $(TMPDIR)/libfoo.a
diff --git a/src/test/run-make-fulldeps/issue-11908/Makefile b/src/test/run-make-fulldeps/issue-11908/Makefile
index cf6572c27..47005537e 100644
--- a/src/test/run-make-fulldeps/issue-11908/Makefile
+++ b/src/test/run-make-fulldeps/issue-11908/Makefile
@@ -5,7 +5,7 @@
# and then our aux-built libraries will collide with liburl (they have
# the same version listed)
--include ../tools.mk
+include ../tools.mk
all:
mkdir $(TMPDIR)/other
diff --git a/src/test/run-make-fulldeps/issue-14500/Makefile b/src/test/run-make-fulldeps/issue-14500/Makefile
index 0c0e331da..52550e570 100644
--- a/src/test/run-make-fulldeps/issue-14500/Makefile
+++ b/src/test/run-make-fulldeps/issue-14500/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# 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
diff --git a/src/test/run-make-fulldeps/issue-14698/Makefile b/src/test/run-make-fulldeps/issue-14698/Makefile
index dbe8317db..a1cfb5aba 100644
--- a/src/test/run-make-fulldeps/issue-14698/Makefile
+++ b/src/test/run-make-fulldeps/issue-14698/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
TMP=fake TMPDIR=fake $(RUSTC) foo.rs 2>&1 | $(CGREP) "couldn't create a temp dir:"
diff --git a/src/test/run-make-fulldeps/issue-15460/Makefile b/src/test/run-make-fulldeps/issue-15460/Makefile
index 846805686..1648d0c0c 100644
--- a/src/test/run-make-fulldeps/issue-15460/Makefile
+++ b/src/test/run-make-fulldeps/issue-15460/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
$(RUSTC) foo.rs -C extra-filename=-383hf8 -C prefer-dynamic
diff --git a/src/test/run-make-fulldeps/issue-18943/Makefile b/src/test/run-make-fulldeps/issue-18943/Makefile
index bef70a0ed..fc40d756d 100644
--- a/src/test/run-make-fulldeps/issue-18943/Makefile
+++ b/src/test/run-make-fulldeps/issue-18943/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Regression test for ICE #18943 when compiling as lib
diff --git a/src/test/run-make-fulldeps/issue-19371/Makefile b/src/test/run-make-fulldeps/issue-19371/Makefile
index 9f3ec7846..994e50801 100644
--- a/src/test/run-make-fulldeps/issue-19371/Makefile
+++ b/src/test/run-make-fulldeps/issue-19371/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# This test ensures that rustc compile_input can be called twice in one task
# without causing a panic.
diff --git a/src/test/run-make-fulldeps/issue-19371/foo.rs b/src/test/run-make-fulldeps/issue-19371/foo.rs
index fd294b018..7e1b6aeb3 100644
--- a/src/test/run-make-fulldeps/issue-19371/foo.rs
+++ b/src/test/run-make-fulldeps/issue-19371/foo.rs
@@ -5,7 +5,6 @@ extern crate rustc_driver;
extern crate rustc_session;
extern crate rustc_span;
-use rustc_session::DiagnosticOutput;
use rustc_session::config::{Input, Options, OutputType, OutputTypes};
use rustc_interface::interface;
use rustc_span::source_map::FileName;
@@ -55,7 +54,6 @@ fn compile(code: String, output: PathBuf, sysroot: PathBuf) {
output_file: Some(output),
output_dir: None,
file_loader: None,
- diagnostic_output: DiagnosticOutput::Default,
lint_caps: Default::default(),
parse_sess_created: None,
register_lints: None,
diff --git a/src/test/run-make-fulldeps/issue-20626/Makefile b/src/test/run-make-fulldeps/issue-20626/Makefile
index 0487b2404..f76f31e79 100644
--- a/src/test/run-make-fulldeps/issue-20626/Makefile
+++ b/src/test/run-make-fulldeps/issue-20626/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test output to be four
# The original error only occurred when printing, not when comparing using assert!
diff --git a/src/test/run-make-fulldeps/issue-22131/Makefile b/src/test/run-make-fulldeps/issue-22131/Makefile
index d76aaf5c1..770f4b04e 100644
--- a/src/test/run-make-fulldeps/issue-22131/Makefile
+++ b/src/test/run-make-fulldeps/issue-22131/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: foo.rs
$(RUSTC) --cfg 'feature="bar"' --crate-type lib foo.rs
diff --git a/src/test/run-make-fulldeps/issue-24445/Makefile b/src/test/run-make-fulldeps/issue-24445/Makefile
index f7ad238af..2a12226a6 100644
--- a/src/test/run-make-fulldeps/issue-24445/Makefile
+++ b/src/test/run-make-fulldeps/issue-24445/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-linux
diff --git a/src/test/run-make-fulldeps/issue-25581/Makefile b/src/test/run-make-fulldeps/issue-25581/Makefile
index 042048ec2..4f5d026f2 100644
--- a/src/test/run-make-fulldeps/issue-25581/Makefile
+++ b/src/test/run-make-fulldeps/issue-25581/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) test.rs
diff --git a/src/test/run-make-fulldeps/issue-26006/Makefile b/src/test/run-make-fulldeps/issue-26006/Makefile
index dd023c32b..0ff073020 100644
--- a/src/test/run-make-fulldeps/issue-26006/Makefile
+++ b/src/test/run-make-fulldeps/issue-26006/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
diff --git a/src/test/run-make-fulldeps/issue-26092/Makefile b/src/test/run-make-fulldeps/issue-26092/Makefile
index 885f45a02..96822e769 100644
--- a/src/test/run-make-fulldeps/issue-26092/Makefile
+++ b/src/test/run-make-fulldeps/issue-26092/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# This test ensures that rustc does not panic with `-o ""` option.
diff --git a/src/test/run-make-fulldeps/issue-28595/Makefile b/src/test/run-make-fulldeps/issue-28595/Makefile
index 61e9d0c65..30a1d9c56 100644
--- a/src/test/run-make-fulldeps/issue-28595/Makefile
+++ b/src/test/run-make-fulldeps/issue-28595/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,a) $(call NATIVE_STATICLIB,b)
$(RUSTC) a.rs
diff --git a/src/test/run-make-fulldeps/issue-28766/Makefile b/src/test/run-make-fulldeps/issue-28766/Makefile
index 1f47ef15b..96d0bdc2b 100644
--- a/src/test/run-make-fulldeps/issue-28766/Makefile
+++ b/src/test/run-make-fulldeps/issue-28766/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -O foo.rs
diff --git a/src/test/run-make-fulldeps/issue-30063/Makefile b/src/test/run-make-fulldeps/issue-30063/Makefile
index a76051dc8..e4ede598f 100644
--- a/src/test/run-make-fulldeps/issue-30063/Makefile
+++ b/src/test/run-make-fulldeps/issue-30063/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
rm -f $(TMPDIR)/foo-output
diff --git a/src/test/run-make-fulldeps/issue-33329/Makefile b/src/test/run-make-fulldeps/issue-33329/Makefile
index 591e4e3dd..9c149440d 100644
--- a/src/test/run-make-fulldeps/issue-33329/Makefile
+++ b/src/test/run-make-fulldeps/issue-33329/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --target x86_64_unknown-linux-musl main.rs 2>&1 | $(CGREP) \
diff --git a/src/test/run-make-fulldeps/issue-35164/Makefile b/src/test/run-make-fulldeps/issue-35164/Makefile
index a95125c56..38aa6f126 100644
--- a/src/test/run-make-fulldeps/issue-35164/Makefile
+++ b/src/test/run-make-fulldeps/issue-35164/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) main.rs --error-format json 2>&1 | $(CGREP) -e '"byte_start":23\b' '"byte_end":29\b'
diff --git a/src/test/run-make-fulldeps/issue-37839/Makefile b/src/test/run-make-fulldeps/issue-37839/Makefile
index f17ce537f..de50bd713 100644
--- a/src/test/run-make-fulldeps/issue-37839/Makefile
+++ b/src/test/run-make-fulldeps/issue-37839/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) a.rs && $(RUSTC) b.rs
diff --git a/src/test/run-make-fulldeps/issue-37893/Makefile b/src/test/run-make-fulldeps/issue-37893/Makefile
index 27b69baf9..33a60830e 100644
--- a/src/test/run-make-fulldeps/issue-37893/Makefile
+++ b/src/test/run-make-fulldeps/issue-37893/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs
diff --git a/src/test/run-make-fulldeps/issue-38237/Makefile b/src/test/run-make-fulldeps/issue-38237/Makefile
index 0a681401b..75121d040 100644
--- a/src/test/run-make-fulldeps/issue-38237/Makefile
+++ b/src/test/run-make-fulldeps/issue-38237/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs; $(RUSTC) bar.rs
diff --git a/src/test/run-make-fulldeps/issue-40535/Makefile b/src/test/run-make-fulldeps/issue-40535/Makefile
index 49db1d43e..155c88252 100644
--- a/src/test/run-make-fulldeps/issue-40535/Makefile
+++ b/src/test/run-make-fulldeps/issue-40535/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# The ICE occurred in the following situation:
# * `foo` declares `extern crate bar, baz`, depends only on `bar` (forgetting `baz` in `Cargo.toml`)
diff --git a/src/test/run-make-fulldeps/issue-46239/Makefile b/src/test/run-make-fulldeps/issue-46239/Makefile
index 698a605f7..a93ef3212 100644
--- a/src/test/run-make-fulldeps/issue-46239/Makefile
+++ b/src/test/run-make-fulldeps/issue-46239/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) main.rs -C opt-level=1
diff --git a/src/test/run-make-fulldeps/issue-47551/Makefile b/src/test/run-make-fulldeps/issue-47551/Makefile
index f4495e6b6..5a6ac7257 100644
--- a/src/test/run-make-fulldeps/issue-47551/Makefile
+++ b/src/test/run-make-fulldeps/issue-47551/Makefile
@@ -1,7 +1,7 @@
# only-linux
# ignore-32bit
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) eh_frame-terminator.rs
diff --git a/src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs b/src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs
index 2f740dc4f..a2c7a31b7 100644
--- a/src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs
+++ b/src/test/run-make-fulldeps/issue-47551/eh_frame-terminator.rs
@@ -1,6 +1,5 @@
// run-pass
-#![feature(backtrace)]
#[derive(Clone, Copy)]
struct Foo {
array: [u64; 10240],
diff --git a/src/test/run-make-fulldeps/issue-51671/Makefile b/src/test/run-make-fulldeps/issue-51671/Makefile
index ba3d3b710..1d1d370d3 100644
--- a/src/test/run-make-fulldeps/issue-51671/Makefile
+++ b/src/test/run-make-fulldeps/issue-51671/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows-msvc
diff --git a/src/test/run-make-fulldeps/issue-53964/Makefile b/src/test/run-make-fulldeps/issue-53964/Makefile
index c56beb52f..6bd830213 100644
--- a/src/test/run-make-fulldeps/issue-53964/Makefile
+++ b/src/test/run-make-fulldeps/issue-53964/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) panic.rs
diff --git a/src/test/run-make-fulldeps/issue-64153/Makefile b/src/test/run-make-fulldeps/issue-64153/Makefile
index 9c0c3fe6e..f42ea620f 100644
--- a/src/test/run-make-fulldeps/issue-64153/Makefile
+++ b/src/test/run-make-fulldeps/issue-64153/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# `llvm-objdump`'s output looks different on windows than on other platforms.
# It should be enough to check on Unix platforms, so:
@@ -19,7 +19,7 @@ all:
# Dump all the symbols from the staticlib into `syms`
"$(LLVM_BIN_DIR)"/llvm-objdump -t $(TMPDIR)/libdownstream.a > $(TMPDIR)/syms
# Count the global instances of `issue64153_test_function`. There'll be 2
- # if the `upstream` object file got erronously included twice.
+ # if the `upstream` object file got erroneously included twice.
# The line we are testing for with the regex looks something like:
# 0000000000000000 g F .text.issue64153_test_function 00000023 issue64153_test_function
grep -c -e "[[:space:]]g[[:space:]]*F[[:space:]].*issue64153_test_function" $(TMPDIR)/syms > $(TMPDIR)/count
diff --git a/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile b/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile
index 2f16ad328..13983f4ff 100644
--- a/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile
+++ b/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile
@@ -6,7 +6,7 @@
# The test links a rust static library into a shared library, and checks that
# the linker doesn't have to flag the resulting file as containing TEXTRELs.
--include ../tools.mk
+include ../tools.mk
# only-linux
diff --git a/src/test/run-make-fulldeps/issue-69368/Makefile b/src/test/run-make-fulldeps/issue-69368/Makefile
index dbb044d8f..41770475d 100644
--- a/src/test/run-make-fulldeps/issue-69368/Makefile
+++ b/src/test/run-make-fulldeps/issue-69368/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that previously triggered a linker failure with root cause
# similar to one found in the issue #69368.
diff --git a/src/test/run-make-fulldeps/issue-69368/a.rs b/src/test/run-make-fulldeps/issue-69368/a.rs
index 7d339c5a5..a54f42955 100644
--- a/src/test/run-make-fulldeps/issue-69368/a.rs
+++ b/src/test/run-make-fulldeps/issue-69368/a.rs
@@ -19,3 +19,8 @@ extern "C" fn __rust_drop_panic() -> ! {
extern "C" fn __rust_foreign_exception() -> ! {
loop {}
}
+
+#[lang = "eh_personality"]
+fn eh_personality() {
+ loop {}
+}
diff --git a/src/test/run-make-fulldeps/issue-7349/Makefile b/src/test/run-make-fulldeps/issue-7349/Makefile
index 9658b99e3..dc073b77f 100644
--- a/src/test/run-make-fulldeps/issue-7349/Makefile
+++ b/src/test/run-make-fulldeps/issue-7349/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test to make sure that inner functions within a polymorphic outer function
# don't get re-codegened when the outer function is monomorphized. The test
diff --git a/src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile b/src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile
index 157edb20c..879ce1743 100644
--- a/src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile
+++ b/src/test/run-make-fulldeps/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 ../../run-make-fulldeps/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/src/test/run-make-fulldeps/issue-97463-abi-param-passing/Makefile b/src/test/run-make-fulldeps/issue-97463-abi-param-passing/Makefile
new file mode 100644
index 000000000..db1b53e15
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-97463-abi-param-passing/Makefile
@@ -0,0 +1,14 @@
+-include ../tools.mk
+
+# ignore-msvc
+
+# The issue exercised by this test, rust-lang/rust#97463, explicitly needs `-O`
+# flags (like `-O3`) to reproduce. Thus, we call $(CC) instead of nicer
+# alternatives provided by tools.mk like using `COMPILE_OBJ` or using a
+# `NATIVE_STATICLIB` dependency.
+
+all:
+ $(CC) -c -O3 -o $(TMPDIR)/bad.o bad.c
+ $(AR) rcs $(TMPDIR)/libbad.a $(TMPDIR)/bad.o
+ $(RUSTC) param_passing.rs -L$(TMPDIR) -lbad -C opt-level=3
+ $(call RUN,param_passing)
diff --git a/src/test/run-make-fulldeps/issue-97463-abi-param-passing/bad.c b/src/test/run-make-fulldeps/issue-97463-abi-param-passing/bad.c
new file mode 100644
index 000000000..013314ab2
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-97463-abi-param-passing/bad.c
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+
+
+struct bloc {
+ uint16_t a;
+ uint16_t b;
+ uint16_t c;
+};
+
+uint16_t c_read_value(uint32_t a, uint32_t b, uint32_t c) {
+ struct bloc *data = malloc(sizeof(struct bloc));
+
+ data->a = a & 0xFFFF;
+ data->b = b & 0xFFFF;
+ data->c = c & 0xFFFF;
+
+ printf("C struct: a = %u, b = %u, c = %u\n",
+ (unsigned) data->a, (unsigned) data->b, (unsigned) data->c);
+ printf("C function returns %u\n", (unsigned) data->b);
+
+ return data->b; /* leak data */
+}
diff --git a/src/test/run-make-fulldeps/issue-97463-abi-param-passing/param_passing.rs b/src/test/run-make-fulldeps/issue-97463-abi-param-passing/param_passing.rs
new file mode 100644
index 000000000..c11f3cc72
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-97463-abi-param-passing/param_passing.rs
@@ -0,0 +1,38 @@
+// NOTE: Exposing the bug encoded in this test is sensitive to
+// LLVM optimization choices. See additional note below for an
+// example.
+
+#[link(name = "bad")]
+extern "C" {
+ pub fn c_read_value(a: u32, b: u32, c: u32) -> u16;
+}
+
+fn main() {
+ const C1: usize = 0x327b23c6;
+ const C2: usize = C1 & 0xFFFF;
+
+ let r1: usize = 0x0;
+ let r2: usize = C1;
+ let r3: usize = 0x0;
+ let value: u16 = unsafe { c_read_value(r1 as u32, r2 as u32, r3 as u32) };
+
+ // NOTE: as an example of the sensitivity of this test to optimization choices,
+ // uncommenting this block of code makes the bug go away on pnkfelix's machine.
+ // (But observing via `dbg!` doesn't hide the bug. At least sometimes.)
+ /*
+ println!("{}", value);
+ println!("{}", value as usize);
+ println!("{}", usize::from(value));
+ println!("{}", (value as usize) & 0xFFFF);
+ */
+
+ let d1 = value;
+ let d2 = value as usize;
+ let d3 = usize::from(value);
+ let d4 = (value as usize) & 0xFFFF;
+
+ let d = (&d1, &d2, &d3, &d4);
+ let d_ = (d1, d2, d3, d4);
+
+ assert_eq!(((&(C2 as u16), &C2, &C2, &C2), (C2 as u16, C2, C2, C2)), (d, d_));
+}
diff --git a/src/test/run-make-fulldeps/issue64319/Makefile b/src/test/run-make-fulldeps/issue64319/Makefile
index 5592f5a71..ee0d177ab 100644
--- a/src/test/run-make-fulldeps/issue64319/Makefile
+++ b/src/test/run-make-fulldeps/issue64319/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/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/src/test/run-make-fulldeps/issues-41478-43796/Makefile b/src/test/run-make-fulldeps/issues-41478-43796/Makefile
index f9735253a..e451cb031 100644
--- a/src/test/run-make-fulldeps/issues-41478-43796/Makefile
+++ b/src/test/run-make-fulldeps/issues-41478-43796/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
# Work in /tmp, because we need to create the `save-analysis-temp` folder.
diff --git a/src/test/run-make-fulldeps/libs-through-symlinks/Makefile b/src/test/run-make-fulldeps/libs-through-symlinks/Makefile
index 8be2e234f..45deaecb8 100644
--- a/src/test/run-make-fulldeps/libs-through-symlinks/Makefile
+++ b/src/test/run-make-fulldeps/libs-through-symlinks/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
diff --git a/src/test/run-make-fulldeps/libtest-json/Makefile b/src/test/run-make-fulldeps/libtest-json/Makefile
index 67b5fc2ed..37b6cb9e2 100644
--- a/src/test/run-make-fulldeps/libtest-json/Makefile
+++ b/src/test/run-make-fulldeps/libtest-json/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test expected libtest's JSON output
diff --git a/src/test/run-make-fulldeps/link-arg/Makefile b/src/test/run-make-fulldeps/link-arg/Makefile
index 0360ede76..103527c3e 100644
--- a/src/test/run-make-fulldeps/link-arg/Makefile
+++ b/src/test/run-make-fulldeps/link-arg/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
RUSTC_FLAGS = -C link-arg="-lfoo" -C link-arg="-lbar" --print link-args
all:
diff --git a/src/test/run-make-fulldeps/link-args-order/Makefile b/src/test/run-make-fulldeps/link-args-order/Makefile
index f94e882cc..c562cc1b3 100644
--- a/src/test/run-make-fulldeps/link-args-order/Makefile
+++ b/src/test/run-make-fulldeps/link-args-order/Makefile
@@ -1,6 +1,6 @@
# ignore-msvc
--include ../tools.mk
+include ../tools.mk
RUSTC_FLAGS = -C linker-flavor=ld -C link-arg=a -C link-args="b c" -C link-args="d e" -C link-arg=f
RUSTC_FLAGS_PRE = -C linker-flavor=ld -Z pre-link-arg=a -Z pre-link-args="b c" -Z pre-link-args="d e" -Z pre-link-arg=f
diff --git a/src/test/run-make-fulldeps/link-cfg/Makefile b/src/test/run-make-fulldeps/link-cfg/Makefile
index 2701b4a59..0b25ccded 100644
--- a/src/test/run-make-fulldeps/link-cfg/Makefile
+++ b/src/test/run-make-fulldeps/link-cfg/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call DYLIB,return1) $(call DYLIB,return2) $(call NATIVE_STATICLIB,return3)
ls $(TMPDIR)
diff --git a/src/test/run-make-fulldeps/link-dedup/Makefile b/src/test/run-make-fulldeps/link-dedup/Makefile
index 4e7ce0f02..5c9603352 100644
--- a/src/test/run-make-fulldeps/link-dedup/Makefile
+++ b/src/test/run-make-fulldeps/link-dedup/Makefile
@@ -1,6 +1,6 @@
# ignore-msvc
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) depa.rs
diff --git a/src/test/run-make-fulldeps/link-path-order/Makefile b/src/test/run-make-fulldeps/link-path-order/Makefile
index eeea0e371..ed7c299e6 100644
--- a/src/test/run-make-fulldeps/link-path-order/Makefile
+++ b/src/test/run-make-fulldeps/link-path-order/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Verifies that the -L arguments given to the linker is in the same order
# as the -L arguments on the rustc command line.
diff --git a/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile b/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile
index 4befbe144..7cc54e40a 100644
--- a/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile
+++ b/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
$(RUSTC) bar.rs
diff --git a/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile
index debe9e938..a38f4fe5d 100644
--- a/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile
+++ b/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs -g
diff --git a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
index 5876fbc94..00199ca97 100644
--- a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
+++ b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs -g -O
diff --git a/src/test/run-make-fulldeps/longjmp-across-rust/Makefile b/src/test/run-make-fulldeps/longjmp-across-rust/Makefile
index 9d71ed8fc..848638d82 100644
--- a/src/test/run-make-fulldeps/longjmp-across-rust/Makefile
+++ b/src/test/run-make-fulldeps/longjmp-across-rust/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
$(RUSTC) main.rs
diff --git a/src/test/run-make-fulldeps/ls-metadata/Makefile b/src/test/run-make-fulldeps/ls-metadata/Makefile
index fc3f5bce0..e0f916a24 100644
--- a/src/test/run-make-fulldeps/ls-metadata/Makefile
+++ b/src/test/run-make-fulldeps/ls-metadata/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs
diff --git a/src/test/run-make-fulldeps/lto-dylib-dep/Makefile b/src/test/run-make-fulldeps/lto-dylib-dep/Makefile
index ab8ee6c2e..41487b23c 100644
--- a/src/test/run-make-fulldeps/lto-dylib-dep/Makefile
+++ b/src/test/run-make-fulldeps/lto-dylib-dep/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that we don't run into an assertion when using a Rust dylib dependency
# while compiling with full LTO.
diff --git a/src/test/run-make-fulldeps/lto-empty/Makefile b/src/test/run-make-fulldeps/lto-empty/Makefile
index 345d10bc4..b4345ba18 100644
--- a/src/test/run-make-fulldeps/lto-empty/Makefile
+++ b/src/test/run-make-fulldeps/lto-empty/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: cdylib-fat cdylib-thin
diff --git a/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile b/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile
index 25afad92a..e576ee37c 100644
--- a/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile
+++ b/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,foo) $(call NATIVE_STATICLIB,bar)
$(RUSTC) lib1.rs
diff --git a/src/test/run-make-fulldeps/lto-readonly-lib/Makefile b/src/test/run-make-fulldeps/lto-readonly-lib/Makefile
index 0afbbc345..a20ecea88 100644
--- a/src/test/run-make-fulldeps/lto-readonly-lib/Makefile
+++ b/src/test/run-make-fulldeps/lto-readonly-lib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) lib.rs
diff --git a/src/test/run-make-fulldeps/lto-smoke-c/Makefile b/src/test/run-make-fulldeps/lto-smoke-c/Makefile
index 0f61f5de9..7c6ee3be8 100644
--- a/src/test/run-make-fulldeps/lto-smoke-c/Makefile
+++ b/src/test/run-make-fulldeps/lto-smoke-c/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Apparently older versions of GCC segfault if -g is passed...
CC := $(CC:-g=)
diff --git a/src/test/run-make-fulldeps/lto-smoke/Makefile b/src/test/run-make-fulldeps/lto-smoke/Makefile
index 9b1dc2550..8bce708b4 100644
--- a/src/test/run-make-fulldeps/lto-smoke/Makefile
+++ b/src/test/run-make-fulldeps/lto-smoke/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: noparam bool_true bool_false thin fat
diff --git a/src/test/run-make-fulldeps/manual-crate-name/Makefile b/src/test/run-make-fulldeps/manual-crate-name/Makefile
index 1d1419997..c00e20c7c 100644
--- a/src/test/run-make-fulldeps/manual-crate-name/Makefile
+++ b/src/test/run-make-fulldeps/manual-crate-name/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-name foo bar.rs
diff --git a/src/test/run-make-fulldeps/manual-link/Makefile b/src/test/run-make-fulldeps/manual-link/Makefile
index dccf0d99b..401f6eb44 100644
--- a/src/test/run-make-fulldeps/manual-link/Makefile
+++ b/src/test/run-make-fulldeps/manual-link/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(TMPDIR)/libbar.a
$(RUSTC) foo.rs -lstatic=bar
diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile b/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile
index e7268311b..ca0ab8e9e 100644
--- a/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile
+++ b/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Modelled after ui/changing-crates.rs test, but this one puts
# more than one (mismatching) candidate crate into the search path,
diff --git a/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile b/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile
index 3ffbba944..dc6b10f4e 100644
--- a/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile
+++ b/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs -C metadata=a -C extra-filename=-a
diff --git a/src/test/run-make-fulldeps/min-global-align/Makefile b/src/test/run-make-fulldeps/min-global-align/Makefile
index 621027470..82f38749e 100644
--- a/src/test/run-make-fulldeps/min-global-align/Makefile
+++ b/src/test/run-make-fulldeps/min-global-align/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-linux
diff --git a/src/test/run-make-fulldeps/mismatching-target-triples/Makefile b/src/test/run-make-fulldeps/mismatching-target-triples/Makefile
index 1636e41b0..409388e04 100644
--- a/src/test/run-make-fulldeps/mismatching-target-triples/Makefile
+++ b/src/test/run-make-fulldeps/mismatching-target-triples/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Issue #10814
#
diff --git a/src/test/run-make-fulldeps/missing-crate-dependency/Makefile b/src/test/run-make-fulldeps/missing-crate-dependency/Makefile
index b5a5bf492..7c271ab8a 100644
--- a/src/test/run-make-fulldeps/missing-crate-dependency/Makefile
+++ b/src/test/run-make-fulldeps/missing-crate-dependency/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type=rlib crateA.rs
diff --git a/src/test/run-make-fulldeps/mixing-deps/Makefile b/src/test/run-make-fulldeps/mixing-deps/Makefile
index 0e52d4a8b..956e704ee 100644
--- a/src/test/run-make-fulldeps/mixing-deps/Makefile
+++ b/src/test/run-make-fulldeps/mixing-deps/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) both.rs -C prefer-dynamic
diff --git a/src/test/run-make-fulldeps/mixing-formats/Makefile b/src/test/run-make-fulldeps/mixing-formats/Makefile
index 48257669b..b27e54257 100644
--- a/src/test/run-make-fulldeps/mixing-formats/Makefile
+++ b/src/test/run-make-fulldeps/mixing-formats/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Testing various mixings of rlibs and dylibs. Makes sure that it's possible to
# link an rlib to a dylib. The dependency tree among the file looks like:
diff --git a/src/test/run-make-fulldeps/mixing-libs/Makefile b/src/test/run-make-fulldeps/mixing-libs/Makefile
index babeeef16..39cc0708c 100644
--- a/src/test/run-make-fulldeps/mixing-libs/Makefile
+++ b/src/test/run-make-fulldeps/mixing-libs/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) rlib.rs
diff --git a/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile b/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile
index 1095a047d..a5f019f24 100644
--- a/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile
+++ b/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs -Copt-level=z 2>&1
diff --git a/src/test/run-make-fulldeps/multiple-emits/Makefile b/src/test/run-make-fulldeps/multiple-emits/Makefile
index e12642283..d1f297644 100644
--- a/src/test/run-make-fulldeps/multiple-emits/Makefile
+++ b/src/test/run-make-fulldeps/multiple-emits/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out 2>&1
diff --git a/src/test/run-make-fulldeps/no-builtins-lto/Makefile b/src/test/run-make-fulldeps/no-builtins-lto/Makefile
index 2e41be39d..c8f05d991 100644
--- a/src/test/run-make-fulldeps/no-builtins-lto/Makefile
+++ b/src/test/run-make-fulldeps/no-builtins-lto/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
# Compile a `#![no_builtins]` rlib crate
diff --git a/src/test/run-make-fulldeps/no-duplicate-libs/Makefile b/src/test/run-make-fulldeps/no-duplicate-libs/Makefile
index 13d8366c6..b05aff782 100644
--- a/src/test/run-make-fulldeps/no-duplicate-libs/Makefile
+++ b/src/test/run-make-fulldeps/no-duplicate-libs/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
ifdef IS_MSVC
# FIXME(#27979)
diff --git a/src/test/run-make-fulldeps/no-intermediate-extras/Makefile b/src/test/run-make-fulldeps/no-intermediate-extras/Makefile
index 258cbf04c..4116aac1b 100644
--- a/src/test/run-make-fulldeps/no-intermediate-extras/Makefile
+++ b/src/test/run-make-fulldeps/no-intermediate-extras/Makefile
@@ -1,6 +1,6 @@
# Regression test for issue #10973
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type=rlib --test foo.rs
diff --git a/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile b/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile
index 903349152..effcfc94c 100644
--- a/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile
+++ b/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# check that rustc builds all crate_type attributes
# delete rlib
diff --git a/src/test/run-make-fulldeps/obtain-borrowck/driver.rs b/src/test/run-make-fulldeps/obtain-borrowck/driver.rs
index 8f78bda03..a6c60df83 100644
--- a/src/test/run-make-fulldeps/obtain-borrowck/driver.rs
+++ b/src/test/run-make-fulldeps/obtain-borrowck/driver.rs
@@ -69,25 +69,25 @@ impl rustc_driver::Callbacks for CompilerCalls {
let crate_items = tcx.hir_crate_items(());
for id in crate_items.items() {
- if matches!(tcx.def_kind(id.def_id), DefKind::Fn) {
- bodies.push(id.def_id);
+ if matches!(tcx.def_kind(id.owner_id), DefKind::Fn) {
+ bodies.push(id.owner_id);
}
}
for id in crate_items.trait_items() {
- if matches!(tcx.def_kind(id.def_id), DefKind::AssocFn) {
+ if matches!(tcx.def_kind(id.owner_id), DefKind::AssocFn) {
let trait_item = hir.trait_item(id);
if let rustc_hir::TraitItemKind::Fn(_, trait_fn) = &trait_item.kind {
if let rustc_hir::TraitFn::Provided(_) = trait_fn {
- bodies.push(trait_item.def_id);
+ bodies.push(trait_item.owner_id);
}
}
}
}
for id in crate_items.impl_items() {
- if matches!(tcx.def_kind(id.def_id), DefKind::AssocFn) {
- bodies.push(id.def_id);
+ if matches!(tcx.def_kind(id.owner_id), DefKind::AssocFn) {
+ bodies.push(id.owner_id);
}
}
diff --git a/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile b/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile
index 74e5dcfcf..45221356c 100644
--- a/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile
+++ b/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
cp foo.rs $(TMPDIR)/foo.rs
diff --git a/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile b/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile
index 6377038b7..33069c06f 100644
--- a/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile
+++ b/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
cp foo.rs $(TMPDIR)/foo
diff --git a/src/test/run-make-fulldeps/output-type-permutations/Makefile b/src/test/run-make-fulldeps/output-type-permutations/Makefile
index b6e0cbaf5..791606c64 100644
--- a/src/test/run-make-fulldeps/output-type-permutations/Makefile
+++ b/src/test/run-make-fulldeps/output-type-permutations/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs --crate-type=rlib,dylib,staticlib
diff --git a/src/test/run-make-fulldeps/output-with-hyphens/Makefile b/src/test/run-make-fulldeps/output-with-hyphens/Makefile
index 69a286f0b..365fb6e59 100644
--- a/src/test/run-make-fulldeps/output-with-hyphens/Makefile
+++ b/src/test/run-make-fulldeps/output-with-hyphens/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo-bar.rs --crate-type bin
diff --git a/src/test/run-make-fulldeps/override-aliased-flags/Makefile b/src/test/run-make-fulldeps/override-aliased-flags/Makefile
index bea610eeb..186b8c7c8 100644
--- a/src/test/run-make-fulldeps/override-aliased-flags/Makefile
+++ b/src/test/run-make-fulldeps/override-aliased-flags/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# FIXME: it would be good to check that it's actually the rightmost flags
# that are used when multiple flags are specified, but I can't think of a
diff --git a/src/test/run-make-fulldeps/panic-impl-transitive/Makefile b/src/test/run-make-fulldeps/panic-impl-transitive/Makefile
index 1714578b2..c3192efcb 100644
--- a/src/test/run-make-fulldeps/panic-impl-transitive/Makefile
+++ b/src/test/run-make-fulldeps/panic-impl-transitive/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/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/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile b/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile
index f3d935786..42d3c977f 100644
--- a/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile
+++ b/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) nonclike.rs -L$(TMPDIR) -ltest
diff --git a/src/test/run-make-fulldeps/pgo-branch-weights/Makefile b/src/test/run-make-fulldeps/pgo-branch-weights/Makefile
index 9773e3f1f..c60206a1f 100644
--- a/src/test/run-make-fulldeps/pgo-branch-weights/Makefile
+++ b/src/test/run-make-fulldeps/pgo-branch-weights/Makefile
@@ -4,7 +4,7 @@
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.
--include ../tools.mk
+include ../tools.mk
# For some very small programs GNU ld seems to not properly handle
# instrumentation sections correctly. Neither Gold nor LLD have that problem.
diff --git a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
index a7d5c5616..3f2f6a838 100644
--- a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile
@@ -4,7 +4,7 @@
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.
--include ../tools.mk
+include ../tools.mk
COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Cprofile-generate="$(TMPDIR)"
diff --git a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
index 425bfc28a..7f72b11b6 100644
--- a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile
@@ -1,6 +1,6 @@
# needs-profiler-support
--include ../tools.mk
+include ../tools.mk
COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)"
diff --git a/src/test/run-make-fulldeps/pgo-gen/Makefile b/src/test/run-make-fulldeps/pgo-gen/Makefile
index 6533355be..4623a7495 100644
--- a/src/test/run-make-fulldeps/pgo-gen/Makefile
+++ b/src/test/run-make-fulldeps/pgo-gen/Makefile
@@ -4,7 +4,7 @@
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.
--include ../tools.mk
+include ../tools.mk
COMPILE_FLAGS=-g -Cprofile-generate="$(TMPDIR)"
diff --git a/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile b/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile
index c0195dcbb..45302215c 100644
--- a/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile
+++ b/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile
@@ -4,7 +4,7 @@
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.
--include ../tools.mk
+include ../tools.mk
all:
# We don't compile `opaque` with either optimizations or instrumentation.
diff --git a/src/test/run-make-fulldeps/pgo-use/Makefile b/src/test/run-make-fulldeps/pgo-use/Makefile
index d7863c9c5..3bac9b77a 100644
--- a/src/test/run-make-fulldeps/pgo-use/Makefile
+++ b/src/test/run-make-fulldeps/pgo-use/Makefile
@@ -4,7 +4,7 @@
# FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
# properly. Since we only have GCC on the CI ignore the test for now.
--include ../tools.mk
+include ../tools.mk
# This test makes sure that PGO profiling data leads to cold functions being
# marked as `cold` and hot functions with `inlinehint`.
diff --git a/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile b/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile
index d0e22cfef..7acea0380 100644
--- a/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile
+++ b/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-aarch64
diff --git a/src/test/run-make-fulldeps/prefer-dylib/Makefile b/src/test/run-make-fulldeps/prefer-dylib/Makefile
index bd44feecf..3817ca195 100644
--- a/src/test/run-make-fulldeps/prefer-dylib/Makefile
+++ b/src/test/run-make-fulldeps/prefer-dylib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib -C prefer-dynamic
diff --git a/src/test/run-make-fulldeps/prefer-rlib/Makefile b/src/test/run-make-fulldeps/prefer-rlib/Makefile
index c6a239eef..adc345d76 100644
--- a/src/test/run-make-fulldeps/prefer-rlib/Makefile
+++ b/src/test/run-make-fulldeps/prefer-rlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib
diff --git a/src/test/run-make-fulldeps/pretty-expanded/Makefile b/src/test/run-make-fulldeps/pretty-expanded/Makefile
index e721c5afd..5a0097a83 100644
--- a/src/test/run-make-fulldeps/pretty-expanded/Makefile
+++ b/src/test/run-make-fulldeps/pretty-expanded/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -o $(TMPDIR)/input.expanded.rs -Zunpretty=expanded input.rs
diff --git a/src/test/run-make-fulldeps/pretty-print-to-file/Makefile b/src/test/run-make-fulldeps/pretty-print-to-file/Makefile
index b224c52fc..ca11b8c47 100644
--- a/src/test/run-make-fulldeps/pretty-print-to-file/Makefile
+++ b/src/test/run-make-fulldeps/pretty-print-to-file/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -o $(TMPDIR)/input.out -Zunpretty=normal input.rs
diff --git a/src/test/run-make-fulldeps/print-calling-conventions/Makefile b/src/test/run-make-fulldeps/print-calling-conventions/Makefile
new file mode 100644
index 000000000..d3fd06392
--- /dev/null
+++ b/src/test/run-make-fulldeps/print-calling-conventions/Makefile
@@ -0,0 +1,4 @@
+-include ../tools.mk
+
+all:
+ $(RUSTC) --print calling-conventions
diff --git a/src/test/run-make-fulldeps/print-cfg/Makefile b/src/test/run-make-fulldeps/print-cfg/Makefile
index 5472baae3..126f5768c 100644
--- a/src/test/run-make-fulldeps/print-cfg/Makefile
+++ b/src/test/run-make-fulldeps/print-cfg/Makefile
@@ -1,6 +1,6 @@
# needs-llvm-components: x86 arm
--include ../tools.mk
+include ../tools.mk
all: default
$(RUSTC) --target x86_64-pc-windows-gnu --print cfg | $(CGREP) windows
diff --git a/src/test/run-make-fulldeps/print-target-list/Makefile b/src/test/run-make-fulldeps/print-target-list/Makefile
index 5f10f2aa3..f23c40d42 100644
--- a/src/test/run-make-fulldeps/print-target-list/Makefile
+++ b/src/test/run-make-fulldeps/print-target-list/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Checks that all the targets returned by `rustc --print target-list` are valid
# target specifications
diff --git a/src/test/run-make-fulldeps/profile/Makefile b/src/test/run-make-fulldeps/profile/Makefile
index 04d382b47..fffc051ad 100644
--- a/src/test/run-make-fulldeps/profile/Makefile
+++ b/src/test/run-make-fulldeps/profile/Makefile
@@ -1,6 +1,6 @@
# needs-profiler-support
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -g -Z profile test.rs
diff --git a/src/test/run-make-fulldeps/prune-link-args/Makefile b/src/test/run-make-fulldeps/prune-link-args/Makefile
index 3589f98e7..a359dc5ae 100644
--- a/src/test/run-make-fulldeps/prune-link-args/Makefile
+++ b/src/test/run-make-fulldeps/prune-link-args/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
diff --git a/src/test/run-make-fulldeps/redundant-libs/Makefile b/src/test/run-make-fulldeps/redundant-libs/Makefile
index e09841fb4..b2dff05d1 100644
--- a/src/test/run-make-fulldeps/redundant-libs/Makefile
+++ b/src/test/run-make-fulldeps/redundant-libs/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows-msvc
diff --git a/src/test/run-make-fulldeps/relocation-model/Makefile b/src/test/run-make-fulldeps/relocation-model/Makefile
index 485ecbb4b..a31dbfd91 100644
--- a/src/test/run-make-fulldeps/relocation-model/Makefile
+++ b/src/test/run-make-fulldeps/relocation-model/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: others
$(RUSTC) -C relocation-model=dynamic-no-pic foo.rs
diff --git a/src/test/run-make-fulldeps/relro-levels/Makefile b/src/test/run-make-fulldeps/relro-levels/Makefile
index aacb5acb7..6176fc1a5 100644
--- a/src/test/run-make-fulldeps/relro-levels/Makefile
+++ b/src/test/run-make-fulldeps/relro-levels/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-linux
#
diff --git a/src/test/run-make-fulldeps/remap-path-prefix/Makefile b/src/test/run-make-fulldeps/remap-path-prefix/Makefile
index 86785c595..2a7378fdf 100644
--- a/src/test/run-make-fulldeps/remap-path-prefix/Makefile
+++ b/src/test/run-make-fulldeps/remap-path-prefix/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
diff --git a/src/test/run-make-fulldeps/reproducible-build-2/Makefile b/src/test/run-make-fulldeps/reproducible-build-2/Makefile
index fd94516fb..1df5e102c 100644
--- a/src/test/run-make-fulldeps/reproducible-build-2/Makefile
+++ b/src/test/run-make-fulldeps/reproducible-build-2/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-musl
# ignore-windows
diff --git a/src/test/run-make-fulldeps/reproducible-build/Makefile b/src/test/run-make-fulldeps/reproducible-build/Makefile
index adccc1535..642a48081 100644
--- a/src/test/run-make-fulldeps/reproducible-build/Makefile
+++ b/src/test/run-make-fulldeps/reproducible-build/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-musl
# Objects are reproducible but their path is not.
diff --git a/src/test/run-make-fulldeps/resolve-rename/Makefile b/src/test/run-make-fulldeps/resolve-rename/Makefile
index 4b0c36d01..00f83a5d6 100644
--- a/src/test/run-make-fulldeps/resolve-rename/Makefile
+++ b/src/test/run-make-fulldeps/resolve-rename/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -C extra-filename=-hash foo.rs
diff --git a/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile b/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile
index f3d935786..42d3c977f 100644
--- a/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile
+++ b/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) nonclike.rs -L$(TMPDIR) -ltest
diff --git a/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile b/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile
index 5b5d620ef..513311c82 100644
--- a/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile
+++ b/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) --crate-type=staticlib nonclike.rs
diff --git a/src/test/run-make-fulldeps/rlib-chain/Makefile b/src/test/run-make-fulldeps/rlib-chain/Makefile
index 30b6811a3..236943a2a 100644
--- a/src/test/run-make-fulldeps/rlib-chain/Makefile
+++ b/src/test/run-make-fulldeps/rlib-chain/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) m1.rs
diff --git a/src/test/run-make-fulldeps/rustdoc-determinism/Makefile b/src/test/run-make-fulldeps/rustdoc-determinism/Makefile
index 0534c2c38..a3ef16906 100644
--- a/src/test/run-make-fulldeps/rustdoc-determinism/Makefile
+++ b/src/test/run-make-fulldeps/rustdoc-determinism/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Assert that the search index is generated deterministically, regardless of the
# order that crates are documented in.
diff --git a/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile b/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile
index c9d41f0ec..2dc30f56b 100644
--- a/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile
+++ b/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that hir-tree output doesn't crash and includes
# the string constant we would expect to see.
diff --git a/src/test/run-make-fulldeps/rustdoc-io-error/Makefile b/src/test/run-make-fulldeps/rustdoc-io-error/Makefile
index f95fa88d4..27f5ecf94 100644
--- a/src/test/run-make-fulldeps/rustdoc-io-error/Makefile
+++ b/src/test/run-make-fulldeps/rustdoc-io-error/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# This test verifies that rustdoc doesn't ICE when it encounters an IO error
# while generating files. Ideally this would be a rustdoc-ui test, so we could
diff --git a/src/test/run-make-fulldeps/rustdoc-map-file/Makefile b/src/test/run-make-fulldeps/rustdoc-map-file/Makefile
index ce977fa0c..5cbf7747a 100644
--- a/src/test/run-make-fulldeps/rustdoc-map-file/Makefile
+++ b/src/test/run-make-fulldeps/rustdoc-map-file/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTDOC) -Z unstable-options --generate-redirect-map foo.rs -o "$(TMPDIR)/out"
diff --git a/src/test/run-make-fulldeps/rustdoc-output-path/Makefile b/src/test/run-make-fulldeps/rustdoc-output-path/Makefile
index 8ce1c6995..8f5cda9e5 100644
--- a/src/test/run-make-fulldeps/rustdoc-output-path/Makefile
+++ b/src/test/run-make-fulldeps/rustdoc-output-path/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTDOC) -o "$(TMPDIR)/foo/bar/doc" foo.rs
diff --git a/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile b/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile
index 4934e875d..c857aa4b9 100644
--- a/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile
+++ b/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
DYLIB_NAME := $(shell echo | $(RUSTC) --crate-name foobar_macro --crate-type dylib --print file-names -)
diff --git a/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs b/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs
index bac3970a4..d8658a0f2 100644
--- a/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs
+++ b/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/src/lib.rs
@@ -1,8 +1,8 @@
// Scraped example should only include line numbers for items b and c in ex.rs
-// @!has foobar/fn.f.html '//*[@class="line-numbers"]' '14'
-// @has foobar/fn.f.html '//*[@class="line-numbers"]' '15'
-// @has foobar/fn.f.html '//*[@class="line-numbers"]' '21'
-// @!has foobar/fn.f.html '//*[@class="line-numbers"]' '22'
+// @!has foobar/fn.f.html '//*[@class="src-line-numbers"]' '14'
+// @has foobar/fn.f.html '//*[@class="src-line-numbers"]' '15'
+// @has foobar/fn.f.html '//*[@class="src-line-numbers"]' '21'
+// @!has foobar/fn.f.html '//*[@class="src-line-numbers"]' '22'
pub fn f() {}
diff --git a/src/test/run-make-fulldeps/rustdoc-themes/Makefile b/src/test/run-make-fulldeps/rustdoc-themes/Makefile
index f3d07b25c..a6d9a43ad 100644
--- a/src/test/run-make-fulldeps/rustdoc-themes/Makefile
+++ b/src/test/run-make-fulldeps/rustdoc-themes/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that rustdoc will properly load in a theme file and display it in the theme selector.
diff --git a/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile b/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile
index e72fe5a50..691585268 100644
--- a/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile
+++ b/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile
@@ -1,7 +1,7 @@
# needs-sanitizer-support
# needs-sanitizer-address
--include ../tools.mk
+include ../tools.mk
LOG := $(TMPDIR)/log.txt
diff --git a/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile b/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile
index b9a3f8295..b0a91e5b1 100644
--- a/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile
+++ b/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile
@@ -1,7 +1,7 @@
# needs-sanitizer-support
# needs-sanitizer-address
--include ../tools.mk
+include ../tools.mk
LOG := $(TMPDIR)/log.txt
diff --git a/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile b/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile
index 4894f65b1..7b1a286ed 100644
--- a/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile
+++ b/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile
@@ -1,7 +1,7 @@
# needs-sanitizer-support
# needs-sanitizer-address
--include ../tools.mk
+include ../tools.mk
# This test first builds a staticlib with AddressSanitizer and checks that
# linking it to an executable fails due to the missing sanitizer runtime.
diff --git a/src/test/run-make-fulldeps/save-analysis-fail/Makefile b/src/test/run-make-fulldeps/save-analysis-fail/Makefile
index f29f907cf..69a2b2746 100644
--- a/src/test/run-make-fulldeps/save-analysis-fail/Makefile
+++ b/src/test/run-make-fulldeps/save-analysis-fail/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: code
krate2: krate2.rs
$(RUSTC) $<
diff --git a/src/test/run-make-fulldeps/save-analysis-fail/foo.rs b/src/test/run-make-fulldeps/save-analysis-fail/foo.rs
index 94879c2a6..c5a70605e 100644
--- a/src/test/run-make-fulldeps/save-analysis-fail/foo.rs
+++ b/src/test/run-make-fulldeps/save-analysis-fail/foo.rs
@@ -1,5 +1,4 @@
#![crate_name = "test"]
-#![feature(box_syntax)]
#![feature(rustc_private)]
extern crate rustc_graphviz;
@@ -261,9 +260,9 @@ fn hello<X: SomeTrait>((z, a): (u32, String), ex: X) {
let x = 32.0f32;
let _ = (x + ((x * x) + 1.0).sqrt()).ln();
- let s: Box<SomeTrait> = box some_fields { field1: 43 };
- let s2: Box<some_fields> = box some_fields { field1: 43 };
- let s3 = box nofields;
+ let s: Box<SomeTrait> = Box::new(some_fields { field1: 43 });
+ let s2: Box<some_fields> = Box::new(some_fields { field1: 43 });
+ let s3 = Box::new(nofields);
s.Method(43);
s3.Method(43);
@@ -317,7 +316,7 @@ mod macro_use_test {
fn main() {
// foo
- let s = box some_fields { field1: 43 };
+ let s = Box::new(some_fields { field1: 43 });
hello((43, "a".to_string()), *s);
sub::sub2::hello();
sub2::sub3::hello();
@@ -345,17 +344,17 @@ fn main() {
let s4: msalias::nested_struct = sub::sub2::nested_struct { field2: 55 };
let s4: msalias::nested_struct = sub2::nested_struct { field2: 55 };
println(&s2.field1.to_string());
- let s5: MyType = box some_fields { field1: 55 };
+ let s5: MyType = Box::new(some_fields { field1: 55 });
let s = SameDir::SameStruct { name: "Bob".to_string() };
let s = SubDir::SubStruct { name: "Bob".to_string() };
- let s6: SomeEnum = SomeEnum::MyTypes(box s2.clone(), s5);
+ let s6: SomeEnum = SomeEnum::MyTypes(Box::new(s2.clone()), s5);
let s7: SomeEnum = SomeEnum::Strings("one", "two", "three");
matchSomeEnum(s6);
matchSomeEnum(s7);
let s8: SomeOtherEnum = SomeOtherEnum::SomeConst2;
matchSomeOtherEnum(s8);
let s9: SomeStructEnum =
- SomeStructEnum::EnumStruct2 { f1: box some_fields { field1: 10 }, f2: box s2 };
+ SomeStructEnum::EnumStruct2 { f1: Box::new(some_fields { field1: 10 }), f2: Box::new(s2) };
matchSomeStructEnum(s9);
for x in &vec![1, 2, 3] {
diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
index 36288c4b8..30f57034b 100644
--- a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
+++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: extern_absolute_paths.rs krate2
$(RUSTC) extern_absolute_paths.rs -Zsave-analysis --edition=2018 --extern krate2
diff --git a/src/test/run-make-fulldeps/save-analysis/Makefile b/src/test/run-make-fulldeps/save-analysis/Makefile
index 7296fb9cc..b8b6be13d 100644
--- a/src/test/run-make-fulldeps/save-analysis/Makefile
+++ b/src/test/run-make-fulldeps/save-analysis/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: code
krate2: krate2.rs
$(RUSTC) $<
diff --git a/src/test/run-make-fulldeps/save-analysis/foo.rs b/src/test/run-make-fulldeps/save-analysis/foo.rs
index dd7067503..74aaabfbf 100644
--- a/src/test/run-make-fulldeps/save-analysis/foo.rs
+++ b/src/test/run-make-fulldeps/save-analysis/foo.rs
@@ -1,5 +1,4 @@
#![crate_name = "test"]
-#![feature(box_syntax)]
#![feature(rustc_private)]
#![feature(associated_type_defaults)]
@@ -255,9 +254,9 @@ fn hello<X: SomeTrait>((z, a): (u32, String), ex: X) {
let x = 32.0f32;
let _ = (x + ((x * x) + 1.0).sqrt()).ln();
- let s: Box<SomeTrait> = box some_fields { field1: 43 };
- let s2: Box<some_fields> = box some_fields { field1: 43 };
- let s3 = box nofields;
+ let s: Box<SomeTrait> = Box::new(some_fields { field1: 43 });
+ let s2: Box<some_fields> = Box::new(some_fields { field1: 43 });
+ let s3 = Box::new(nofields);
s.Method(43);
s3.Method(43);
@@ -311,7 +310,7 @@ mod macro_use_test {
fn main() {
// foo
- let s = box some_fields { field1: 43 };
+ let s = Box::new(some_fields { field1: 43 });
hello((43, "a".to_string()), *s);
sub::sub2::hello();
sub2::sub3::hello();
@@ -339,17 +338,17 @@ fn main() {
let s4: msalias::nested_struct = sub::sub2::nested_struct { field2: 55 };
let s4: msalias::nested_struct = sub2::nested_struct { field2: 55 };
println(&s2.field1.to_string());
- let s5: MyType = box some_fields { field1: 55 };
+ let s5: MyType = Box::new(some_fields { field1: 55 });
let s = SameDir::SameStruct { name: "Bob".to_string() };
let s = SubDir::SubStruct { name: "Bob".to_string() };
- let s6: SomeEnum = SomeEnum::MyTypes(box s2.clone(), s5);
+ let s6: SomeEnum = SomeEnum::MyTypes(Box::new(s2.clone()), s5);
let s7: SomeEnum = SomeEnum::Strings("one", "two", "three");
matchSomeEnum(s6);
matchSomeEnum(s7);
let s8: SomeOtherEnum = SomeOtherEnum::SomeConst2;
matchSomeOtherEnum(s8);
let s9: SomeStructEnum =
- SomeStructEnum::EnumStruct2 { f1: box some_fields { field1: 10 }, f2: box s2 };
+ SomeStructEnum::EnumStruct2 { f1: Box::new(some_fields { field1: 10 }), f2: Box::new(s2) };
matchSomeStructEnum(s9);
for x in &vec![1, 2, 3] {
diff --git a/src/test/run-make-fulldeps/separate-link-fail/Makefile b/src/test/run-make-fulldeps/separate-link-fail/Makefile
index c759f42a2..bfd18fbf9 100644
--- a/src/test/run-make-fulldeps/separate-link-fail/Makefile
+++ b/src/test/run-make-fulldeps/separate-link-fail/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
echo 'fn main(){}' > $(TMPDIR)/main.rs
diff --git a/src/test/run-make-fulldeps/separate-link/Makefile b/src/test/run-make-fulldeps/separate-link/Makefile
index 060484e89..3ccdb6275 100644
--- a/src/test/run-make-fulldeps/separate-link/Makefile
+++ b/src/test/run-make-fulldeps/separate-link/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
echo 'fn main(){}' | $(RUSTC) -Z no-link -
diff --git a/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile b/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile
index 77d1d71e9..df289d0b0 100644
--- a/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile
+++ b/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Check that cross-crate inlined items are inlined in all compilation units
# that refer to them, and not in any other compilation units.
diff --git a/src/test/run-make-fulldeps/sepcomp-inlining/Makefile b/src/test/run-make-fulldeps/sepcomp-inlining/Makefile
index 1d20d9400..327aeb75e 100644
--- a/src/test/run-make-fulldeps/sepcomp-inlining/Makefile
+++ b/src/test/run-make-fulldeps/sepcomp-inlining/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that #[inline] functions still get inlined across compilation unit
# boundaries. Compilation should produce three IR files, but only the two
diff --git a/src/test/run-make-fulldeps/sepcomp-separate/Makefile b/src/test/run-make-fulldeps/sepcomp-separate/Makefile
index 5b8bdb0fa..62cf54a88 100644
--- a/src/test/run-make-fulldeps/sepcomp-separate/Makefile
+++ b/src/test/run-make-fulldeps/sepcomp-separate/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Test that separate compilation actually puts code into separate compilation
# units. `foo.rs` defines `magic_fn` in three different modules, which should
diff --git a/src/test/run-make-fulldeps/share-generics-dylib/Makefile b/src/test/run-make-fulldeps/share-generics-dylib/Makefile
index 282cb2461..065fb574c 100644
--- a/src/test/run-make-fulldeps/share-generics-dylib/Makefile
+++ b/src/test/run-make-fulldeps/share-generics-dylib/Makefile
@@ -9,7 +9,7 @@
#
# This is regression test for https://github.com/rust-lang/rust/issues/67276.
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Csymbol-mangling-version=v0
diff --git a/src/test/run-make-fulldeps/simd-ffi/Makefile b/src/test/run-make-fulldeps/simd-ffi/Makefile
index e9c974a01..297353470 100644
--- a/src/test/run-make-fulldeps/simd-ffi/Makefile
+++ b/src/test/run-make-fulldeps/simd-ffi/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
TARGETS =
ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm)
diff --git a/src/test/run-make-fulldeps/simple-dylib/Makefile b/src/test/run-make-fulldeps/simple-dylib/Makefile
index 26730820f..5dda5d66d 100644
--- a/src/test/run-make-fulldeps/simple-dylib/Makefile
+++ b/src/test/run-make-fulldeps/simple-dylib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=dylib -C prefer-dynamic
$(RUSTC) foo.rs
diff --git a/src/test/run-make-fulldeps/simple-rlib/Makefile b/src/test/run-make-fulldeps/simple-rlib/Makefile
index 7b156cb87..d912b8a7b 100644
--- a/src/test/run-make-fulldeps/simple-rlib/Makefile
+++ b/src/test/run-make-fulldeps/simple-rlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) bar.rs --crate-type=rlib
$(RUSTC) foo.rs
diff --git a/src/test/run-make-fulldeps/split-debuginfo/Makefile b/src/test/run-make-fulldeps/split-debuginfo/Makefile
index e2dc64d8c..1032f3408 100644
--- a/src/test/run-make-fulldeps/split-debuginfo/Makefile
+++ b/src/test/run-make-fulldeps/split-debuginfo/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: off packed unpacked
@@ -29,14 +29,19 @@ unpacked:
[ ! -d $(TMPDIR)/foo.dSYM ]
else
ifdef IS_WINDOWS
-# Windows only supports =off
+# Windows only supports =packed
off:
packed:
unpacked:
else
-# If disabled, don't run dsymutil
+ifeq ($(UNAME),Linux)
+ UNSTABLEOPTS :=
+else
+ UNSTABLEOPTS := -Zunstable-options
+endif
+
off:
- $(RUSTC) foo.rs -g -C split-debuginfo=off -Z unstable-options
+ $(RUSTC) foo.rs -g -C $(UNSTABLEOPTS) split-debuginfo=off
[ ! -f $(TMPDIR)/*.dwp ]
[ ! -f $(TMPDIR)/*.dwo ]
@@ -47,12 +52,12 @@ off:
packed: packed-split packed-single
packed-split:
- $(RUSTC) foo.rs -g -C split-debuginfo=packed -Z unstable-options -Zsplit-dwarf-kind=split
+ $(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=packed -Zsplit-dwarf-kind=split
ls $(TMPDIR)/*.dwp
rm -rf $(TMPDIR)/*.dwp $(TMPDIR)/*.dwo
packed-single:
- $(RUSTC) foo.rs -g -C split-debuginfo=packed -Z unstable-options -Zsplit-dwarf-kind=single
+ $(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=packed -Zsplit-dwarf-kind=single
ls $(TMPDIR)/*.dwp
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
rm -rf $(TMPDIR)/*.dwp
@@ -60,37 +65,37 @@ packed-single:
packed-remapped: packed-remapped-split packed-remapped-single
packed-remapped-split:
- $(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 \
+ $(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=packed -C debuginfo=2 \
-Z split-dwarf-kind=split --remap-path-prefix $(TMPDIR)=/a foo.rs -g
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
packed-remapped-single:
- $(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 \
+ $(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=packed -C debuginfo=2 \
-Z split-dwarf-kind=single --remap-path-prefix $(TMPDIR)=/a foo.rs -g
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
packed-crosscrate: packed-crosscrate-split packed-crosscrate-single
packed-crosscrate-split:
- $(RUSTC) --crate-type lib -Z unstable-options -C split-debuginfo=packed \
+ $(RUSTC) --crate-type lib $(UNSTABLEOPTS) -C split-debuginfo=packed \
-Zsplit-dwarf-kind=split -C debuginfo=2 -g bar.rs
ls $(TMPDIR)/*.rlib
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
- $(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options -C split-debuginfo=packed \
- -Zsplit-dwarf-kind=split -C debuginfo=2 -g main.rs
+ $(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options $(UNSTABLEOPTS) \
+ -C split-debuginfo=packed -Zsplit-dwarf-kind=split -C debuginfo=2 -g main.rs
rm $(TMPDIR)/*.dwo
rm $(TMPDIR)/main.dwp
rm $(TMPDIR)/$(call BIN,main)
packed-crosscrate-single:
- $(RUSTC) --crate-type lib -Z unstable-options -C split-debuginfo=packed \
+ $(RUSTC) --crate-type lib $(UNSTABLEOPTS) -C split-debuginfo=packed \
-Zsplit-dwarf-kind=single -C debuginfo=2 -g bar.rs
ls $(TMPDIR)/*.rlib
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
- $(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options -C split-debuginfo=packed \
- -Zsplit-dwarf-kind=single -C debuginfo=2 -g main.rs
+ $(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options $(UNSTABLEOPTS) \
+ -C split-debuginfo=packed -Zsplit-dwarf-kind=single -C debuginfo=2 -g main.rs
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
rm $(TMPDIR)/main.dwp
rm $(TMPDIR)/$(call BIN,main)
@@ -98,23 +103,23 @@ packed-crosscrate-single:
unpacked: unpacked-split unpacked-single unpacked-remapped-split unpacked-remapped-single
unpacked-split:
- $(RUSTC) foo.rs -g -C split-debuginfo=unpacked -Z unstable-options -Zsplit-dwarf-kind=split
+ $(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=unpacked -Zsplit-dwarf-kind=split
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
ls $(TMPDIR)/*.dwo
rm -rf $(TMPDIR)/*.dwp $(TMPDIR)/*.dwo
unpacked-single:
- $(RUSTC) foo.rs -g -C split-debuginfo=unpacked -Z unstable-options -Zsplit-dwarf-kind=single
+ $(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=unpacked -Zsplit-dwarf-kind=single
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
unpacked-remapped-split:
- $(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 \
+ $(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=unpacked -C debuginfo=2 \
-Z split-dwarf-kind=split --remap-path-prefix $(TMPDIR)=/a foo.rs -g
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
unpacked-remapped-single:
- $(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 \
+ $(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=unpacked -C debuginfo=2 \
-Z split-dwarf-kind=single --remap-path-prefix $(TMPDIR)=/a foo.rs -g
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
endif
diff --git a/src/test/run-make-fulldeps/stable-symbol-names/Makefile b/src/test/run-make-fulldeps/stable-symbol-names/Makefile
index 451af809b..bbfb8e388 100644
--- a/src/test/run-make-fulldeps/stable-symbol-names/Makefile
+++ b/src/test/run-make-fulldeps/stable-symbol-names/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# The following command will:
# 1. dump the symbols of a library using `nm`
diff --git a/src/test/run-make-fulldeps/static-dylib-by-default/Makefile b/src/test/run-make-fulldeps/static-dylib-by-default/Makefile
index 6409aa66a..eedd0b320 100644
--- a/src/test/run-make-fulldeps/static-dylib-by-default/Makefile
+++ b/src/test/run-make-fulldeps/static-dylib-by-default/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
TO_LINK := $(call DYLIB,bar)
ifdef IS_MSVC
diff --git a/src/test/run-make-fulldeps/static-extern-type/Makefile b/src/test/run-make-fulldeps/static-extern-type/Makefile
index 5879fc0ce..e9aa95e63 100644
--- a/src/test/run-make-fulldeps/static-extern-type/Makefile
+++ b/src/test/run-make-fulldeps/static-extern-type/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all: $(call NATIVE_STATICLIB,define-foo)
$(RUSTC) -ldefine-foo use-foo.rs
diff --git a/src/test/run-make-fulldeps/static-unwinding/Makefile b/src/test/run-make-fulldeps/static-unwinding/Makefile
index cb0397442..9c755d4ab 100644
--- a/src/test/run-make-fulldeps/static-unwinding/Makefile
+++ b/src/test/run-make-fulldeps/static-unwinding/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) lib.rs
diff --git a/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile b/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile
index 92a278825..fcbf87758 100644
--- a/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile
+++ b/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(AR) crus $(TMPDIR)/libfoo.a foo.rs
diff --git a/src/test/run-make-fulldeps/std-core-cycle/Makefile b/src/test/run-make-fulldeps/std-core-cycle/Makefile
index ce3b2d46b..4f2528637 100644
--- a/src/test/run-make-fulldeps/std-core-cycle/Makefile
+++ b/src/test/run-make-fulldeps/std-core-cycle/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
ifeq ($(UNAME),Darwin)
FLAGS :=
diff --git a/src/test/run-make-fulldeps/stdin-non-utf8/Makefile b/src/test/run-make-fulldeps/stdin-non-utf8/Makefile
index 7948c4426..709d4cf14 100644
--- a/src/test/run-make-fulldeps/stdin-non-utf8/Makefile
+++ b/src/test/run-make-fulldeps/stdin-non-utf8/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
cp non-utf8 $(TMPDIR)/non-utf.rs
diff --git a/src/test/run-make-fulldeps/suspicious-library/Makefile b/src/test/run-make-fulldeps/suspicious-library/Makefile
index 12f437075..2af9e85c2 100644
--- a/src/test/run-make-fulldeps/suspicious-library/Makefile
+++ b/src/test/run-make-fulldeps/suspicious-library/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs -C prefer-dynamic
diff --git a/src/test/run-make-fulldeps/symbols-include-type-name/Makefile b/src/test/run-make-fulldeps/symbols-include-type-name/Makefile
index 0850a2633..ac26a852e 100644
--- a/src/test/run-make-fulldeps/symbols-include-type-name/Makefile
+++ b/src/test/run-make-fulldeps/symbols-include-type-name/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# Check that symbol names for methods include type names, instead of <impl>.
diff --git a/src/test/run-make-fulldeps/symlinked-extern/Makefile b/src/test/run-make-fulldeps/symlinked-extern/Makefile
index e5061fdde..058f43e85 100644
--- a/src/test/run-make-fulldeps/symlinked-extern/Makefile
+++ b/src/test/run-make-fulldeps/symlinked-extern/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# `ln` is actually `cp` on msys.
diff --git a/src/test/run-make-fulldeps/symlinked-libraries/Makefile b/src/test/run-make-fulldeps/symlinked-libraries/Makefile
index 618ae87bf..576bf7e54 100644
--- a/src/test/run-make-fulldeps/symlinked-libraries/Makefile
+++ b/src/test/run-make-fulldeps/symlinked-libraries/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# `ln` is actually `cp` on msys.
diff --git a/src/test/run-make-fulldeps/symlinked-rlib/Makefile b/src/test/run-make-fulldeps/symlinked-rlib/Makefile
index 996989ce4..49d3f220a 100644
--- a/src/test/run-make-fulldeps/symlinked-rlib/Makefile
+++ b/src/test/run-make-fulldeps/symlinked-rlib/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows
# `ln` is actually `cp` on msys.
diff --git a/src/test/run-make-fulldeps/target-cpu-native/Makefile b/src/test/run-make-fulldeps/target-cpu-native/Makefile
index d152e9f76..eb3ca1e13 100644
--- a/src/test/run-make-fulldeps/target-cpu-native/Makefile
+++ b/src/test/run-make-fulldeps/target-cpu-native/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-linux
# only-x86_64
diff --git a/src/test/run-make-fulldeps/target-specs/Makefile b/src/test/run-make-fulldeps/target-specs/Makefile
index fb95ee553..a33f5368e 100644
--- a/src/test/run-make-fulldeps/target-specs/Makefile
+++ b/src/test/run-make-fulldeps/target-specs/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) foo.rs --target=my-awesome-platform.json --crate-type=lib --emit=asm
$(CGREP) -v morestack < $(TMPDIR)/foo.s
diff --git a/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile b/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile
index 9868fc1d4..451f03d66 100644
--- a/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile
+++ b/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# The target used below doesn't support atomic CAS operations. Verify that's the case
all:
diff --git a/src/test/run-make-fulldeps/test-harness/Makefile b/src/test/run-make-fulldeps/test-harness/Makefile
index 39477c07c..1fe059b07 100644
--- a/src/test/run-make-fulldeps/test-harness/Makefile
+++ b/src/test/run-make-fulldeps/test-harness/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
# check that #[cfg_attr(..., ignore)] does the right thing.
diff --git a/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile b/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile
index 802b3df46..9f4be7126 100644
--- a/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile
+++ b/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
# compile two different versions of crateA
diff --git a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
index 838b1a271..6ae53afad 100644
--- a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
+++ b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-freebsd
# ignore-openbsd
diff --git a/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile b/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile
index fc39691c5..37cd6283c 100644
--- a/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile
+++ b/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) ep-nested-lib.rs
diff --git a/src/test/run-make-fulldeps/used-cdylib-macos/Makefile b/src/test/run-make-fulldeps/used-cdylib-macos/Makefile
index 4828d9c8a..38a4c31c7 100644
--- a/src/test/run-make-fulldeps/used-cdylib-macos/Makefile
+++ b/src/test/run-make-fulldeps/used-cdylib-macos/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-macos
#
diff --git a/src/test/run-make-fulldeps/used/Makefile b/src/test/run-make-fulldeps/used/Makefile
index 4d9044729..e80eb9e40 100644
--- a/src/test/run-make-fulldeps/used/Makefile
+++ b/src/test/run-make-fulldeps/used/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# ignore-windows-msvc
diff --git a/src/test/run-make-fulldeps/version/Makefile b/src/test/run-make-fulldeps/version/Makefile
index 23e14a9cb..3a130545d 100644
--- a/src/test/run-make-fulldeps/version/Makefile
+++ b/src/test/run-make-fulldeps/version/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) -V
diff --git a/src/test/run-make-fulldeps/volatile-intrinsics/Makefile b/src/test/run-make-fulldeps/volatile-intrinsics/Makefile
index acbadbef9..2a78c7b9c 100644
--- a/src/test/run-make-fulldeps/volatile-intrinsics/Makefile
+++ b/src/test/run-make-fulldeps/volatile-intrinsics/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
# The tests must pass...
diff --git a/src/test/run-make-fulldeps/weird-output-filenames/Makefile b/src/test/run-make-fulldeps/weird-output-filenames/Makefile
index f161fe9f8..d3a34e3b4 100644
--- a/src/test/run-make-fulldeps/weird-output-filenames/Makefile
+++ b/src/test/run-make-fulldeps/weird-output-filenames/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
cp foo.rs $(TMPDIR)/.foo.rs
diff --git a/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile b/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile
index f6adb6d76..8960020fe 100644
--- a/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile
+++ b/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-windows
diff --git a/src/test/run-make-fulldeps/windows-spawn/Makefile b/src/test/run-make-fulldeps/windows-spawn/Makefile
index c09ce8109..b6cdb169b 100644
--- a/src/test/run-make-fulldeps/windows-spawn/Makefile
+++ b/src/test/run-make-fulldeps/windows-spawn/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
# only-windows
diff --git a/src/test/run-make-fulldeps/windows-subsystem/Makefile b/src/test/run-make-fulldeps/windows-subsystem/Makefile
index 34fb5db32..78c4e2ac1 100644
--- a/src/test/run-make-fulldeps/windows-subsystem/Makefile
+++ b/src/test/run-make-fulldeps/windows-subsystem/Makefile
@@ -1,4 +1,4 @@
--include ../tools.mk
+include ../tools.mk
all:
$(RUSTC) windows.rs
diff --git a/src/test/run-make/const_fn_mir/Makefile b/src/test/run-make/const_fn_mir/Makefile
index 2aa0bc9d4..ad5695093 100644
--- a/src/test/run-make/const_fn_mir/Makefile
+++ b/src/test/run-make/const_fn_mir/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
$(RUSTC) main.rs --emit=mir -o "$(TMPDIR)"/dump.mir
diff --git a/src/test/run-make/coverage-llvmir/filecheck.testprog.txt b/src/test/run-make/coverage-llvmir/filecheck.testprog.txt
index 7a5f21922..c943261d7 100644
--- a/src/test/run-make/coverage-llvmir/filecheck.testprog.txt
+++ b/src/test/run-make/coverage-llvmir/filecheck.testprog.txt
@@ -9,7 +9,7 @@ CHECK-SAME: section "[[INSTR_PROF_COVFUN]]"[[COMDAT_IF_SUPPORTED]], align 8
CHECK: @__llvm_coverage_mapping = private constant
CHECK-SAME: section "[[INSTR_PROF_COVMAP]]", align 8
-WINDOWS: @__llvm_profile_runtime = external global i32
+WINDOWS: @__llvm_profile_runtime = external{{.*}}global i32
CHECK: @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called = {{private|internal}} global
CHECK-SAME: section "[[INSTR_PROF_CNTS]]"{{.*}}, align 8
diff --git a/src/test/run-make/coverage-reports/Makefile b/src/test/run-make/coverage-reports/Makefile
index 4e75672f2..64b2f75ef 100644
--- a/src/test/run-make/coverage-reports/Makefile
+++ b/src/test/run-make/coverage-reports/Makefile
@@ -1,6 +1,11 @@
# needs-profiler-support
# ignore-windows-gnu
+# FIXME(pietroalbini): this test currently does not work on cross-compiled
+# targets because remote-test is not capable of sending back the *.profraw
+# files generated by the LLVM instrumentation.
+# ignore-cross-compile
+
# Rust coverage maps support LLVM Coverage Mapping Format versions 5 and 6,
# corresponding with LLVM versions 12 and 13, respectively.
# When upgrading LLVM versions, consider whether to enforce a minimum LLVM
@@ -60,7 +65,7 @@ endif
# for now, but it is effectively ignored for all tests that don't include this file anyway.
#
# (Note that it's also possible the `_counters.<test>.txt` and `<test>.json` files (if generated)
-# may order results from multiple files inconsistently, which might also have to be accomodated
+# may order results from multiple files inconsistently, which might also have to be accommodated
# if and when we allow `llvm-cov` to produce results for multiple files. Note, the path separators
# appear to be normalized to `/` in those files, thankfully.)
LLVM_COV_IGNORE_FILES=\
@@ -81,13 +86,13 @@ endif
# Compile the test library with coverage instrumentation
$(RUSTC) $(SOURCEDIR)/lib/$@.rs \
$$( sed -n 's/^\/\/ compile-flags: \([^#]*\).*/\1/p' $(SOURCEDIR)/lib/$@.rs ) \
- --crate-type rlib -Cinstrument-coverage
+ --crate-type rlib -Cinstrument-coverage --target $(TARGET)
%: $(SOURCEDIR)/%.rs
# Compile the test program with coverage instrumentation
$(RUSTC) $(SOURCEDIR)/$@.rs \
$$( sed -n 's/^\/\/ compile-flags: \([^#]*\).*/\1/p' $(SOURCEDIR)/$@.rs ) \
- -L "$(TMPDIR)" -Cinstrument-coverage
+ -L "$(TMPDIR)" -Cinstrument-coverage --target $(TARGET)
# Run it in order to generate some profiling data,
# with `LLVM_PROFILE_FILE=<profdata_file>` environment variable set to
@@ -157,7 +162,7 @@ else
# `// ignore-llvm-cov-show-diffs` anymore. This directive exists to work around a limitation
# with `llvm-cov show`. When reporting coverage for multiple instantiations of a generic function,
# with different type substitutions, `llvm-cov show` prints these in a non-deterministic order,
- # breaking the `diff` comparision.
+ # breaking the `diff` comparison.
#
# A partial workaround is implemented below, with `diff --ignore-matching-lines=RE`
# to ignore each line prefixing each generic instantiation coverage code region.
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.async.txt b/src/test/run-make/coverage-reports/expected_show_coverage.async.txt
index 2f69adbd8..87ccb6c43 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.async.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.async.txt
@@ -55,7 +55,7 @@
53| 1| 1 // This line appears covered, but the 1-character expression span covering the `1`
^0
54| 1| // is not executed. (`llvm-cov show` displays a `^0` below the `1` ). This is because
- 55| 1| // `fn j()` executes the open brace for the funciton body, followed by the function's
+ 55| 1| // `fn j()` executes the open brace for the function body, followed by the function's
56| 1| // first executable statement, `match x`. Inner function declarations are not
57| 1| // "visible" to the MIR for `j()`, so the code region counts all lines between the
58| 1| // open brace and the first statement as executed, which is, in a sense, true.
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.closure.txt b/src/test/run-make/coverage-reports/expected_show_coverage.closure.txt
index 09ad276aa..e463099a5 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.closure.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.closure.txt
@@ -37,7 +37,7 @@
37| 0| countdown = 10;
38| 0| }
39| 0| "alt string 2".to_owned()
- 40| | };
+ 40| 0| };
41| 1| println!(
42| 1| "The string or alt: {}"
43| 1| ,
@@ -79,7 +79,7 @@
79| 0| countdown = 10;
80| 1| }
81| 1| "alt string 4".to_owned()
- 82| | };
+ 82| 1| };
83| 1| println!(
84| 1| "The string or alt: {}"
85| 1| ,
@@ -101,7 +101,7 @@
101| 0| countdown = 10;
102| 5| }
103| 5| format!("'{}'", val)
- 104| | };
+ 104| 5| };
105| 1| println!(
106| 1| "Repeated, quoted string: {:?}"
107| 1| ,
@@ -125,7 +125,7 @@
125| 0| countdown = 10;
126| 0| }
127| 0| "closure should be unused".to_owned()
- 128| | };
+ 128| 0| };
129| |
130| 1| let mut countdown = 10;
131| 1| let _short_unused_closure = | _unused_arg: u8 | countdown += 1;
@@ -177,7 +177,7 @@
173| 0| println!(
174| 0| "not called: {}",
175| 0| if is_true { "check" } else { "me" }
- 176| | )
+ 176| 0| )
177| | ;
178| |
179| 1| let short_used_not_covered_closure_line_break_block_embedded_branch =
@@ -187,7 +187,7 @@
183| 0| "not called: {}",
184| 0| if is_true { "check" } else { "me" }
185| | )
- 186| | }
+ 186| 0| }
187| | ;
188| |
189| 1| let short_used_covered_closure_line_break_no_block_embedded_branch =
@@ -196,7 +196,7 @@
192| 1| "not called: {}",
193| 1| if is_true { "check" } else { "me" }
^0
- 194| | )
+ 194| 1| )
195| | ;
196| |
197| 1| let short_used_covered_closure_line_break_block_embedded_branch =
@@ -207,7 +207,7 @@
202| 1| if is_true { "check" } else { "me" }
^0
203| | )
- 204| | }
+ 204| 1| }
205| | ;
206| |
207| 1| if is_false {
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.doctest.txt b/src/test/run-make/coverage-reports/expected_show_coverage.doctest.txt
index 7ae0e9788..732de6526 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.doctest.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.doctest.txt
@@ -23,12 +23,6 @@
22| 1|//! ```
23| 2|//! #[derive(Debug, PartialEq)]
^1
- ------------------
- | Unexecuted instantiation: <rust_out::main::_doctest_main____coverage_doctest_rs_22_0::SomeError as core::cmp::PartialEq>::ne
- ------------------
- | <rust_out::main::_doctest_main____coverage_doctest_rs_22_0::SomeError as core::cmp::PartialEq>::eq:
- | 23| 2|//! #[derive(Debug, PartialEq)]
- ------------------
24| 1|//! struct SomeError {
25| 1|//! msg: String,
26| 1|//! }
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.generator.txt b/src/test/run-make/coverage-reports/expected_show_coverage.generator.txt
index d70e12e41..0fb3808ff 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.generator.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.generator.txt
@@ -18,7 +18,7 @@
17| 1| let mut generator = || {
18| 1| yield get_u32(is_true);
19| 1| return "foo";
- 20| | };
+ 20| 1| };
21| |
22| 1| match Pin::new(&mut generator).resume(()) {
23| 1| GeneratorState::Yielded(Ok(1)) => {}
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.inline-dead.txt b/src/test/run-make/coverage-reports/expected_show_coverage.inline-dead.txt
index effdef80e..a59fe1146 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.inline-dead.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.inline-dead.txt
@@ -6,7 +6,7 @@
6| 1|
7| 1| let f = |x: bool| {
8| | debug_assert!(
- 9| | x
+ 9| 0| x
10| | );
11| 1| };
12| 1| f(false);
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.issue-83601.txt b/src/test/run-make/coverage-reports/expected_show_coverage.issue-83601.txt
index de32c88b7..25c74ab2e 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.issue-83601.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.issue-83601.txt
@@ -2,12 +2,6 @@
2| |
3| 3|#[derive(Debug, PartialEq, Eq)]
^2
- ------------------
- | <issue_83601::Foo as core::cmp::PartialEq>::eq:
- | 3| 2|#[derive(Debug, PartialEq, Eq)]
- ------------------
- | Unexecuted instantiation: <issue_83601::Foo as core::cmp::PartialEq>::ne
- ------------------
4| |struct Foo(u32);
5| |
6| 1|fn main() {
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.issue-84561.txt b/src/test/run-make/coverage-reports/expected_show_coverage.issue-84561.txt
index f24f7c694..4a60432c1 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.issue-84561.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.issue-84561.txt
@@ -2,12 +2,6 @@
2| |
3| |// expect-exit-status-101
4| 21|#[derive(PartialEq, Eq)]
- ------------------
- | <issue_84561::Foo as core::cmp::PartialEq>::eq:
- | 4| 21|#[derive(PartialEq, Eq)]
- ------------------
- | Unexecuted instantiation: <issue_84561::Foo as core::cmp::PartialEq>::ne
- ------------------
5| |struct Foo(u32);
6| 1|fn test3() {
7| 1| let is_true = std::env::args().len() == 1;
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.partial_eq.txt b/src/test/run-make/coverage-reports/expected_show_coverage.partial_eq.txt
index fc2666533..a77175af6 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.partial_eq.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.partial_eq.txt
@@ -3,11 +3,6 @@
3| |
4| 2|#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
^0 ^0 ^0 ^1 ^1 ^0^0
- ------------------
- | Unexecuted instantiation: <partial_eq::Version as core::cmp::PartialEq>::ne
- ------------------
- | Unexecuted instantiation: <partial_eq::Version as core::cmp::PartialEq>::eq
- ------------------
5| |pub struct Version {
6| | major: usize,
7| | minor: usize,
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt b/src/test/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt
index dab31cbf4..748343885 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.uses_inline_crate.txt
@@ -61,12 +61,12 @@
46| 4| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
47| 4|}
------------------
- | used_inline_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
+ | used_inline_crate::used_only_from_this_lib_crate_generic_function::<&str>:
| 45| 2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
| 46| 2| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
| 47| 2|}
------------------
- | used_inline_crate::used_only_from_this_lib_crate_generic_function::<&str>:
+ | used_inline_crate::used_only_from_this_lib_crate_generic_function::<alloc::vec::Vec<i32>>:
| 45| 2|pub fn used_only_from_this_lib_crate_generic_function<T: Debug>(arg: T) {
| 46| 2| println!("used_only_from_this_lib_crate_generic_function with {:?}", arg);
| 47| 2|}
diff --git a/src/test/run-make/coverage-reports/expected_show_coverage.yield.txt b/src/test/run-make/coverage-reports/expected_show_coverage.yield.txt
index 60a8d943f..6e2f23ee7 100644
--- a/src/test/run-make/coverage-reports/expected_show_coverage.yield.txt
+++ b/src/test/run-make/coverage-reports/expected_show_coverage.yield.txt
@@ -8,7 +8,7 @@
8| 1| let mut generator = || {
9| 1| yield 1;
10| 1| return "foo"
- 11| | };
+ 11| 1| };
12| |
13| 1| match Pin::new(&mut generator).resume(()) {
14| 1| GeneratorState::Yielded(1) => {}
@@ -24,7 +24,7 @@
24| 1| yield 2;
25| 0| yield 3;
26| 0| return "foo"
- 27| | };
+ 27| 0| };
28| |
29| 1| match Pin::new(&mut generator).resume(()) {
30| 1| GeneratorState::Yielded(1) => {}
diff --git a/src/test/run-make/coverage/async.rs b/src/test/run-make/coverage/async.rs
index a6e387747..efd9e62d6 100644
--- a/src/test/run-make/coverage/async.rs
+++ b/src/test/run-make/coverage/async.rs
@@ -52,7 +52,7 @@ fn j(x: u8) {
if x == 8 {
1 // This line appears covered, but the 1-character expression span covering the `1`
// is not executed. (`llvm-cov show` displays a `^0` below the `1` ). This is because
- // `fn j()` executes the open brace for the funciton body, followed by the function's
+ // `fn j()` executes the open brace for the function body, followed by the function's
// first executable statement, `match x`. Inner function declarations are not
// "visible" to the MIR for `j()`, so the code region counts all lines between the
// open brace and the first statement as executed, which is, in a sense, true.
diff --git a/src/test/run-make/dep-graph/Makefile b/src/test/run-make/dep-graph/Makefile
index 88916022c..ae97b1672 100644
--- a/src/test/run-make/dep-graph/Makefile
+++ b/src/test/run-make/dep-graph/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# ignore-cross-compile
diff --git a/src/test/run-make/emit-named-files/Makefile b/src/test/run-make/emit-named-files/Makefile
index 03eb83b97..e081fa479 100644
--- a/src/test/run-make/emit-named-files/Makefile
+++ b/src/test/run-make/emit-named-files/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
OUT=$(TMPDIR)/emit
diff --git a/src/test/run-make/emit-path-unhashed/Makefile b/src/test/run-make/emit-path-unhashed/Makefile
index b6b2d8af6..c144d4aa9 100644
--- a/src/test/run-make/emit-path-unhashed/Makefile
+++ b/src/test/run-make/emit-path-unhashed/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
OUT=$(TMPDIR)/emit
diff --git a/src/test/run-make/emit-shared-files/Makefile b/src/test/run-make/emit-shared-files/Makefile
index 9f46883be..09b4c29c1 100644
--- a/src/test/run-make/emit-shared-files/Makefile
+++ b/src/test/run-make/emit-shared-files/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
INVOCATION_ONLY = $(TMPDIR)/invocation-only
TOOLCHAIN_ONLY = $(TMPDIR)/toolchain-only
diff --git a/src/test/run-make/env-dep-info/Makefile b/src/test/run-make/env-dep-info/Makefile
index 25d9a31c2..1675a61b1 100644
--- a/src/test/run-make/env-dep-info/Makefile
+++ b/src/test/run-make/env-dep-info/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
# instead of hardcoding them everywhere they're needed.
diff --git a/src/test/run-make/export-executable-symbols/Makefile b/src/test/run-make/export-executable-symbols/Makefile
index 5006f9cb8..daa77c99d 100644
--- a/src/test/run-make/export-executable-symbols/Makefile
+++ b/src/test/run-make/export-executable-symbols/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# ignore-wasm32
# ignore-wasm64
diff --git a/src/test/run-make/fmt-write-bloat/Makefile b/src/test/run-make/fmt-write-bloat/Makefile
index 26e08086a..07e6e025e 100644
--- a/src/test/run-make/fmt-write-bloat/Makefile
+++ b/src/test/run-make/fmt-write-bloat/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# ignore-windows
diff --git a/src/test/run-make/issue-10971-temps-dir/Makefile b/src/test/run-make/issue-10971-temps-dir/Makefile
index 5ce271926..e589bbffe 100644
--- a/src/test/run-make/issue-10971-temps-dir/Makefile
+++ b/src/test/run-make/issue-10971-temps-dir/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# Regression test for issue #10971
# Running two invocations in parallel would overwrite each other's temp files.
diff --git a/src/test/run-make/issue-36710/Makefile b/src/test/run-make/issue-36710/Makefile
index b5270ad2b..986a3f4e6 100644
--- a/src/test/run-make/issue-36710/Makefile
+++ b/src/test/run-make/issue-36710/Makefile
@@ -1,10 +1,6 @@
-# ignore-riscv64 $(call RUN,foo) expects to run the target executable natively
+# ignore-cross-compile $(call RUN,foo) expects to run the target executable natively
# so it won't work with remote-test-server
-# ignore-arm Another build using remote-test-server
# 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)
diff --git a/src/test/run-make/issue-47384/Makefile b/src/test/run-make/issue-47384/Makefile
index f10365f8c..0aadf6c88 100644
--- a/src/test/run-make/issue-47384/Makefile
+++ b/src/test/run-make/issue-47384/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-linux
# ignore-cross-compile
diff --git a/src/test/run-make/issue-71519/Makefile b/src/test/run-make/issue-71519/Makefile
index 636665ec1..16d9a56e6 100644
--- a/src/test/run-make/issue-71519/Makefile
+++ b/src/test/run-make/issue-71519/Makefile
@@ -1,5 +1,6 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
+# ignore-msvc
# needs-rust-lld
all:
RUSTC_LOG=rustc_codegen_ssa::back::link=info $(RUSTC) -Z gcc-ld=lld -C link-args=-Wl,-v main.rs 2> $(TMPDIR)/output.txt
diff --git a/src/test/run-make/issue-85401-static-mir/Makefile b/src/test/run-make/issue-85401-static-mir/Makefile
new file mode 100644
index 000000000..99590166b
--- /dev/null
+++ b/src/test/run-make/issue-85401-static-mir/Makefile
@@ -0,0 +1,16 @@
+include ../../run-make-fulldeps/tools.mk
+
+# Regression test for issue #85401
+# Verify that we do not ICE when trying to access MIR for statics,
+# but emit an error when linking.
+
+OUTPUT_FILE := $(TMPDIR)/build-output
+
+all:
+ $(RUSTC) --crate-type rlib --crate-name foo -Crelocation-model=pic --edition=2018 foo.rs -Zalways-encode-mir=yes --emit metadata -o $(TMPDIR)/libfoo.rmeta
+ $(RUSTC) --crate-type rlib --crate-name bar -Crelocation-model=pic --edition=2018 bar.rs -o $(TMPDIR)/libbar.rlib --extern=foo=$(TMPDIR)/libfoo.rmeta
+ $(RUSTC) --crate-type bin --crate-name baz -Crelocation-model=pic --edition=2018 baz.rs -o $(TMPDIR)/baz -L $(TMPDIR) --extern=bar=$(TMPDIR)/libbar.rlib > $(OUTPUT_FILE) 2>&1; [ $$? -eq 1 ]
+ cat $(OUTPUT_FILE)
+ $(CGREP) 'crate `foo` required to be available in rlib format, but was not found in this form' < $(OUTPUT_FILE)
+ # -v tests are fragile, hopefully this text won't change
+ $(CGREP) -v "internal compiler error" < $(OUTPUT_FILE)
diff --git a/src/test/run-make/issue-85401-static-mir/bar.rs b/src/test/run-make/issue-85401-static-mir/bar.rs
new file mode 100644
index 000000000..15b12ecf3
--- /dev/null
+++ b/src/test/run-make/issue-85401-static-mir/bar.rs
@@ -0,0 +1,4 @@
+pub fn bar() {
+ println!("bar {}", foo::FOO);
+ foo::foo();
+}
diff --git a/src/test/run-make/issue-85401-static-mir/baz.rs b/src/test/run-make/issue-85401-static-mir/baz.rs
new file mode 100644
index 000000000..2ff4c51e5
--- /dev/null
+++ b/src/test/run-make/issue-85401-static-mir/baz.rs
@@ -0,0 +1,3 @@
+fn main() {
+ bar::bar()
+}
diff --git a/src/test/run-make/issue-85401-static-mir/foo.rs b/src/test/run-make/issue-85401-static-mir/foo.rs
new file mode 100644
index 000000000..d064c4546
--- /dev/null
+++ b/src/test/run-make/issue-85401-static-mir/foo.rs
@@ -0,0 +1,5 @@
+pub static FOO: &str = "foo";
+
+pub fn foo() {
+ println!("foo");
+}
diff --git a/src/test/run-make/issue-85441/Makefile b/src/test/run-make/issue-85441/Makefile
index c7ae708c1..f04b07d51 100644
--- a/src/test/run-make/issue-85441/Makefile
+++ b/src/test/run-make/issue-85441/Makefile
@@ -1,6 +1,6 @@
# only-windows-msvc
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# Tests that WS2_32.dll is not unnecessarily linked, see issue #85441
diff --git a/src/test/run-make/issue-88756-default-output/Makefile b/src/test/run-make/issue-88756-default-output/Makefile
index cacbcbf39..275c35c26 100644
--- a/src/test/run-make/issue-88756-default-output/Makefile
+++ b/src/test/run-make/issue-88756-default-output/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/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/src/test/run-make/issue-96498/Makefile b/src/test/run-make/issue-96498/Makefile
index eae6400ae..ce2b1b1ff 100644
--- a/src/test/run-make/issue-96498/Makefile
+++ b/src/test/run-make/issue-96498/Makefile
@@ -1,7 +1,7 @@
# only-windows
# needs-rust-lld
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# Ensure that LLD can link
all:
diff --git a/src/test/run-make/libtest-thread-limit/Makefile b/src/test/run-make/libtest-thread-limit/Makefile
index 29c1bc71d..d43a89e60 100644
--- a/src/test/run-make/libtest-thread-limit/Makefile
+++ b/src/test/run-make/libtest-thread-limit/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-linux
diff --git a/src/test/run-make/llvm-outputs/Makefile b/src/test/run-make/llvm-outputs/Makefile
index d7f67577b..a3f25eba0 100644
--- a/src/test/run-make/llvm-outputs/Makefile
+++ b/src/test/run-make/llvm-outputs/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
echo 'fn main() {}' | $(BARE_RUSTC) - --out-dir=$(TMPDIR)/random_directory_that_does_not_exist_ir/ --emit=llvm-ir
diff --git a/src/test/run-make/macos-fat-archive/Makefile b/src/test/run-make/macos-fat-archive/Makefile
new file mode 100644
index 000000000..cc99375db
--- /dev/null
+++ b/src/test/run-make/macos-fat-archive/Makefile
@@ -0,0 +1,10 @@
+# only-macos
+
+-include ../../run-make-fulldeps/tools.mk
+
+"$(TMPDIR)"/libnative-library.a: native-library.c
+ $(CC) -arch arm64 -arch x86_64 native-library.c -c -o "$(TMPDIR)"/native-library.o
+ $(AR) crs "$(TMPDIR)"/libnative-library.a "$(TMPDIR)"/native-library.o
+
+all: "$(TMPDIR)"/libnative-library.a
+ $(RUSTC) lib.rs --crate-type=lib -L "native=$(TMPDIR)" -l static=native-library
diff --git a/src/test/run-make/macos-fat-archive/lib.rs b/src/test/run-make/macos-fat-archive/lib.rs
new file mode 100644
index 000000000..9943a266c
--- /dev/null
+++ b/src/test/run-make/macos-fat-archive/lib.rs
@@ -0,0 +1,3 @@
+extern "C" {
+ pub fn native_func();
+}
diff --git a/src/test/run-make/macos-fat-archive/native-library.c b/src/test/run-make/macos-fat-archive/native-library.c
new file mode 100644
index 000000000..d300fdf1c
--- /dev/null
+++ b/src/test/run-make/macos-fat-archive/native-library.c
@@ -0,0 +1 @@
+void native_func() {}
diff --git a/src/test/run-make/native-link-modifier-bundle/Makefile b/src/test/run-make/native-link-modifier-bundle/Makefile
index e4b0f74ac..7c78d7783 100644
--- a/src/test/run-make/native-link-modifier-bundle/Makefile
+++ b/src/test/run-make/native-link-modifier-bundle/Makefile
@@ -1,7 +1,7 @@
# ignore-cross-compile
# ignore-windows-msvc
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/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/src/test/run-make/native-link-modifier-verbatim-linker/Makefile b/src/test/run-make/native-link-modifier-verbatim-linker/Makefile
new file mode 100644
index 000000000..e56e1e94e
--- /dev/null
+++ b/src/test/run-make/native-link-modifier-verbatim-linker/Makefile
@@ -0,0 +1,15 @@
+# ignore-cross-compile
+# ignore-macos
+
+include ../../run-make-fulldeps/tools.mk
+
+all:
+ # Verbatim allows specify precise name.
+ $(RUSTC) local_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/local_some_strange_name.ext
+ $(RUSTC) main.rs -Zunstable-options -l static:+verbatim=local_some_strange_name.ext
+
+ # With verbatim any other name cannot be used (local).
+ $(RUSTC) local_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/liblocal_native_dep.a
+ $(RUSTC) local_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/local_native_dep.a
+ $(RUSTC) local_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/local_native_dep.lib
+ $(RUSTC) main.rs -Zunstable-options -l static:+verbatim=local_native_dep 2>&1 | $(CGREP) "local_native_dep"
diff --git a/src/test/run-make/native-link-modifier-verbatim-linker/local_native_dep.rs b/src/test/run-make/native-link-modifier-verbatim-linker/local_native_dep.rs
new file mode 100644
index 000000000..59b6c92d2
--- /dev/null
+++ b/src/test/run-make/native-link-modifier-verbatim-linker/local_native_dep.rs
@@ -0,0 +1,4 @@
+#[no_mangle]
+pub fn local_native_f() -> i32 {
+ return 0;
+}
diff --git a/src/test/run-make/native-link-modifier-verbatim-linker/main.rs b/src/test/run-make/native-link-modifier-verbatim-linker/main.rs
new file mode 100644
index 000000000..71b73a489
--- /dev/null
+++ b/src/test/run-make/native-link-modifier-verbatim-linker/main.rs
@@ -0,0 +1,9 @@
+extern "C" {
+ fn local_native_f() -> i32;
+}
+
+pub fn main() {
+ unsafe {
+ assert!(local_native_f() == 0);
+ };
+}
diff --git a/src/test/run-make/native-link-modifier-verbatim-rustc/Makefile b/src/test/run-make/native-link-modifier-verbatim-rustc/Makefile
new file mode 100644
index 000000000..1093b1cd3
--- /dev/null
+++ b/src/test/run-make/native-link-modifier-verbatim-rustc/Makefile
@@ -0,0 +1,12 @@
+include ../../run-make-fulldeps/tools.mk
+
+all:
+ # Verbatim allows specify precise name.
+ $(RUSTC) upstream_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/upstream_some_strange_name.ext
+ $(RUSTC) rust_dep.rs -Zunstable-options -l static:+verbatim=upstream_some_strange_name.ext --crate-type rlib
+
+ # With verbatim any other name cannot be used (upstream).
+ $(RUSTC) upstream_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/libupstream_native_dep.a
+ $(RUSTC) upstream_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/upstream_native_dep.a
+ $(RUSTC) upstream_native_dep.rs --crate-type=staticlib -o $(TMPDIR)/upstream_native_dep.lib
+ $(RUSTC) rust_dep.rs -Zunstable-options -l static:+verbatim=upstream_native_dep --crate-type rlib 2>&1 | $(CGREP) "upstream_native_dep"
diff --git a/src/test/run-make/native-link-modifier-verbatim-rustc/rust_dep.rs b/src/test/run-make/native-link-modifier-verbatim-rustc/rust_dep.rs
new file mode 100644
index 000000000..e9517218e
--- /dev/null
+++ b/src/test/run-make/native-link-modifier-verbatim-rustc/rust_dep.rs
@@ -0,0 +1,9 @@
+extern "C" {
+ fn upstream_native_f() -> i32;
+}
+
+pub fn rust_dep() {
+ unsafe {
+ assert!(upstream_native_f() == 0);
+ }
+}
diff --git a/src/test/run-make/native-link-modifier-verbatim-rustc/upstream_native_dep.rs b/src/test/run-make/native-link-modifier-verbatim-rustc/upstream_native_dep.rs
new file mode 100644
index 000000000..839686233
--- /dev/null
+++ b/src/test/run-make/native-link-modifier-verbatim-rustc/upstream_native_dep.rs
@@ -0,0 +1,4 @@
+#[no_mangle]
+pub fn upstream_native_f() -> i32 {
+ return 0;
+}
diff --git a/src/test/run-make/native-link-modifier-whole-archive/Makefile b/src/test/run-make/native-link-modifier-whole-archive/Makefile
index 967cb065c..f26bd864c 100644
--- a/src/test/run-make/native-link-modifier-whole-archive/Makefile
+++ b/src/test/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 ../../run-make-fulldeps/tools.mk
all: $(TMPDIR)/$(call BIN,directly_linked) \
$(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive) \
diff --git a/src/test/run-make/pass-linker-flags-from-dep/Makefile b/src/test/run-make/pass-linker-flags-from-dep/Makefile
index 365216b4c..b9426326a 100644
--- a/src/test/run-make/pass-linker-flags-from-dep/Makefile
+++ b/src/test/run-make/pass-linker-flags-from-dep/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
# Build deps
diff --git a/src/test/run-make/pass-linker-flags/Makefile b/src/test/run-make/pass-linker-flags/Makefile
index 02b1e2179..a3efb8df6 100644
--- a/src/test/run-make/pass-linker-flags/Makefile
+++ b/src/test/run-make/pass-linker-flags/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/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/src/test/run-make/raw-dylib-alt-calling-convention/Makefile b/src/test/run-make/raw-dylib-alt-calling-convention/Makefile
index a254285ab..03f8778d2 100644
--- a/src/test/run-make/raw-dylib-alt-calling-convention/Makefile
+++ b/src/test/run-make/raw-dylib-alt-calling-convention/Makefile
@@ -3,7 +3,7 @@
# only-x86
# only-windows
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_alt_calling_convention_test lib.rs
diff --git a/src/test/run-make/raw-dylib-alt-calling-convention/extern.c b/src/test/run-make/raw-dylib-alt-calling-convention/extern.c
index 0c4d12af9..344d4a6bf 100644
--- a/src/test/run-make/raw-dylib-alt-calling-convention/extern.c
+++ b/src/test/run-make/raw-dylib-alt-calling-convention/extern.c
@@ -70,6 +70,11 @@ __declspec(dllexport) void __stdcall stdcall_fn_9(uint8_t x, double y) {
fflush(stdout);
}
+__declspec(dllexport) void __stdcall stdcall_fn_10(int i) {
+ printf("stdcall_fn_10(%d)\n", i);
+ fflush(stdout);
+}
+
__declspec(dllexport) void __fastcall fastcall_fn_1(int i) {
printf("fastcall_fn_1(%d)\n", i);
fflush(stdout);
@@ -122,6 +127,11 @@ __declspec(dllexport) void __fastcall fastcall_fn_9(uint8_t x, double y) {
fflush(stdout);
}
+__declspec(dllexport) void __fastcall fastcall_fn_10(int i) {
+ printf("fastcall_fn_10(%d)\n", i);
+ fflush(stdout);
+}
+
// GCC doesn't support vectorcall: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89485
#ifdef _MSC_VER
__declspec(dllexport) void __vectorcall vectorcall_fn_1(int i) {
@@ -175,4 +185,9 @@ __declspec(dllexport) void __vectorcall vectorcall_fn_9(uint8_t x, double y) {
printf("vectorcall_fn_9(%d, %.1f)\n", x, y);
fflush(stdout);
}
+
+__declspec(dllexport) void __vectorcall vectorcall_fn_10(int i) {
+ printf("vectorcall_fn_10(%d)\n", i);
+ fflush(stdout);
+}
#endif
diff --git a/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs b/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs
index b5e9415b2..22f222c12 100644
--- a/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs
+++ b/src/test/run-make/raw-dylib-alt-calling-convention/lib.rs
@@ -1,5 +1,5 @@
-#![feature(raw_dylib)]
#![feature(abi_vectorcall)]
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[repr(C)]
#[derive(Clone)]
@@ -32,6 +32,8 @@ extern "stdcall" {
fn stdcall_fn_7(a: S2, b: i32);
fn stdcall_fn_8(a: S3, b: S3);
fn stdcall_fn_9(x: u8, y: f64);
+ #[link_name = "stdcall_fn_10"]
+ fn stdcall_fn_10_renamed(i: i32);
}
#[link(name = "extern", kind = "raw-dylib")]
@@ -45,6 +47,8 @@ extern "fastcall" {
fn fastcall_fn_7(a: S2, b: i32);
fn fastcall_fn_8(a: S3, b: S3);
fn fastcall_fn_9(x: u8, y: f64);
+ #[link_name = "fastcall_fn_10"]
+ fn fastcall_fn_10_renamed(i: i32);
}
#[cfg(target_env = "msvc")]
@@ -59,6 +63,8 @@ extern "vectorcall" {
fn vectorcall_fn_7(a: S2, b: i32);
fn vectorcall_fn_8(a: S3, b: S3);
fn vectorcall_fn_9(x: u8, y: f64);
+ #[link_name = "vectorcall_fn_10"]
+ fn vectorcall_fn_10_renamed(i: i32);
}
pub fn library_function(run_msvc_only: bool) {
@@ -73,6 +79,7 @@ pub fn library_function(run_msvc_only: bool) {
stdcall_fn_7(S2 { x: 15, y: 16 }, 3);
stdcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] });
stdcall_fn_9(1, 3.0);
+ stdcall_fn_10_renamed(19);
fastcall_fn_1(14);
fastcall_fn_2(16, 3.5);
@@ -81,6 +88,7 @@ pub fn library_function(run_msvc_only: bool) {
fastcall_fn_6(Some(&S { x: 10, y: 12 }));
fastcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] });
fastcall_fn_9(1, 3.0);
+ fastcall_fn_10_renamed(19);
} else {
// FIXME: 91167
// rustc generates incorrect code for the calls to fastcall_fn_5 and fastcall_fn_7
@@ -100,6 +108,7 @@ pub fn library_function(run_msvc_only: bool) {
vectorcall_fn_7(S2 { x: 15, y: 16 }, 3);
vectorcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] });
vectorcall_fn_9(1, 3.0);
+ vectorcall_fn_10_renamed(19);
}
}
}
diff --git a/src/test/run-make/raw-dylib-alt-calling-convention/output.msvc.txt b/src/test/run-make/raw-dylib-alt-calling-convention/output.msvc.txt
index 9ddd1b110..a216835c4 100644
--- a/src/test/run-make/raw-dylib-alt-calling-convention/output.msvc.txt
+++ b/src/test/run-make/raw-dylib-alt-calling-convention/output.msvc.txt
@@ -9,3 +9,4 @@ vectorcall_fn_6(S { x: 10, y: 12 })
vectorcall_fn_7(S2 { x: 15, y: 16 }, 3)
vectorcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] })
vectorcall_fn_9(1, 3.0)
+vectorcall_fn_10(19)
diff --git a/src/test/run-make/raw-dylib-alt-calling-convention/output.txt b/src/test/run-make/raw-dylib-alt-calling-convention/output.txt
index 348bad63e..7622d3161 100644
--- a/src/test/run-make/raw-dylib-alt-calling-convention/output.txt
+++ b/src/test/run-make/raw-dylib-alt-calling-convention/output.txt
@@ -7,6 +7,7 @@ stdcall_fn_6(S { x: 10, y: 12 })
stdcall_fn_7(S2 { x: 15, y: 16 }, 3)
stdcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] })
stdcall_fn_9(1, 3.0)
+stdcall_fn_10(19)
fastcall_fn_1(14)
fastcall_fn_2(16, 3.5)
fastcall_fn_3(3.5)
@@ -14,3 +15,4 @@ fastcall_fn_4(1, 2, 3.0)
fastcall_fn_6(S { x: 10, y: 12 })
fastcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] })
fastcall_fn_9(1, 3.0)
+fastcall_fn_10(19)
diff --git a/src/test/run-make/raw-dylib-c/Makefile b/src/test/run-make/raw-dylib-c/Makefile
index 713f66507..f47ab24f4 100644
--- a/src/test/run-make/raw-dylib-c/Makefile
+++ b/src/test/run-make/raw-dylib-c/Makefile
@@ -2,7 +2,7 @@
# only-windows
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
diff --git a/src/test/run-make/raw-dylib-c/extern_1.c b/src/test/run-make/raw-dylib-c/extern_1.c
index 72737c086..5d695547d 100644
--- a/src/test/run-make/raw-dylib-c/extern_1.c
+++ b/src/test/run-make/raw-dylib-c/extern_1.c
@@ -1,5 +1,7 @@
#include <stdio.h>
+__declspec(dllexport) int extern_variable = 0;
+
__declspec(dllexport) void extern_fn_1() {
printf("extern_fn_1\n");
fflush(stdout);
@@ -10,7 +12,17 @@ __declspec(dllexport) void extern_fn_2() {
fflush(stdout);
}
+__declspec(dllexport) void print_extern_variable() {
+ printf("extern_variable value: %d\n", extern_variable);
+ fflush(stdout);
+}
+
__declspec(dllexport) void extern_fn_with_long_name() {
printf("extern_fn_with_long_name; got the rename\n");
fflush(stdout);
}
+
+__declspec(dllexport) void extern_fn_4() {
+ printf("extern_fn_4\n");
+ fflush(stdout);
+}
diff --git a/src/test/run-make/raw-dylib-c/lib.rs b/src/test/run-make/raw-dylib-c/lib.rs
index 58f7ccb38..005ffcdda 100644
--- a/src/test/run-make/raw-dylib-c/lib.rs
+++ b/src/test/run-make/raw-dylib-c/lib.rs
@@ -12,12 +12,23 @@ extern {
pub fn library_function() {
#[link(name = "extern_1", kind = "raw-dylib")]
- extern { fn extern_fn_2(); }
+ extern {
+ fn extern_fn_2();
+ fn print_extern_variable();
+ static mut extern_variable: i32;
+ #[link_name = "extern_fn_4"]
+ fn extern_fn_4_renamed();
+ }
unsafe {
extern_fn_1();
extern_fn_2();
extern_fn_3();
+ extern_fn_4_renamed();
+ extern_variable = 42;
+ print_extern_variable();
+ extern_variable = -42;
+ print_extern_variable();
}
}
diff --git a/src/test/run-make/raw-dylib-c/output.txt b/src/test/run-make/raw-dylib-c/output.txt
index 7800cba18..cc970cef7 100644
--- a/src/test/run-make/raw-dylib-c/output.txt
+++ b/src/test/run-make/raw-dylib-c/output.txt
@@ -1,3 +1,6 @@
extern_fn_1
extern_fn_2; didn't get the rename
extern_fn_3
+extern_fn_4
+extern_variable value: 42
+extern_variable value: -42
diff --git a/src/test/run-make/raw-dylib-import-name-type/Makefile b/src/test/run-make/raw-dylib-import-name-type/Makefile
new file mode 100644
index 000000000..fcc60e88e
--- /dev/null
+++ b/src/test/run-make/raw-dylib-import-name-type/Makefile
@@ -0,0 +1,22 @@
+# Test the behavior of #[link(.., kind = "raw-dylib")] with alternative calling conventions.
+
+# only-x86
+# only-windows
+
+-include ../../run-make-fulldeps/tools.mk
+
+all:
+ $(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
+ $(call COMPILE_OBJ,"$(TMPDIR)"/extern.obj,extern.c)
+ifdef IS_MSVC
+ $(CC) "$(TMPDIR)"/extern.obj extern.msvc.def -link -dll -out:"$(TMPDIR)"/extern.dll -noimplib
+else
+ $(CC) "$(TMPDIR)"/extern.obj extern.gnu.def --no-leading-underscore -shared -o "$(TMPDIR)"/extern.dll
+endif
+ "$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
+
+ifdef RUSTC_BLESS_TEST
+ cp "$(TMPDIR)"/output.txt output.txt
+else
+ $(DIFF) output.txt "$(TMPDIR)"/output.txt
+endif
diff --git a/src/test/run-make/raw-dylib-import-name-type/driver.rs b/src/test/run-make/raw-dylib-import-name-type/driver.rs
new file mode 100644
index 000000000..a38849fc8
--- /dev/null
+++ b/src/test/run-make/raw-dylib-import-name-type/driver.rs
@@ -0,0 +1,125 @@
+#![feature(raw_dylib)]
+#![feature(abi_vectorcall)]
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "undecorated")]
+extern "C" {
+ fn cdecl_fn_undecorated(i: i32);
+ #[link_name = "cdecl_fn_undecorated2"]
+ fn cdecl_fn_undecorated_renamed(i: i32);
+ static mut extern_variable_undecorated: i32;
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "noprefix")]
+extern "C" {
+ fn cdecl_fn_noprefix(i: i32);
+ static mut extern_variable_noprefix: i32;
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "decorated")]
+extern "C" {
+ fn cdecl_fn_decorated(i: i32);
+ static mut extern_variable_decorated: i32;
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "undecorated")]
+extern "stdcall" {
+ fn stdcall_fn_undecorated(i: i32);
+ #[link_name = "stdcall_fn_undecorated2"]
+ fn stdcall_fn_undecorated_renamed(i: i32);
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "noprefix")]
+extern "stdcall" {
+ fn stdcall_fn_noprefix(i: i32);
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "decorated")]
+extern "stdcall" {
+ fn stdcall_fn_decorated(i: i32);
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "undecorated")]
+extern "fastcall" {
+ fn fastcall_fn_undecorated(i: i32);
+ #[link_name = "fastcall_fn_undecorated2"]
+ fn fastcall_fn_undecorated_renamed(i: i32);
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "noprefix")]
+extern "fastcall" {
+ fn fastcall_fn_noprefix(i: i32);
+}
+
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "decorated")]
+extern "fastcall" {
+ fn fastcall_fn_decorated(i: i32);
+}
+
+#[cfg(target_env = "msvc")]
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "undecorated")]
+extern "vectorcall" {
+ fn vectorcall_fn_undecorated(i: i32);
+ #[link_name = "vectorcall_fn_undecorated2"]
+ fn vectorcall_fn_undecorated_renamed(i: i32);
+}
+
+#[cfg(target_env = "msvc")]
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "noprefix")]
+extern "vectorcall" {
+ fn vectorcall_fn_noprefix(i: i32);
+}
+
+#[cfg(target_env = "msvc")]
+#[link(name = "extern", kind = "raw-dylib", import_name_type = "decorated")]
+extern "vectorcall" {
+ fn vectorcall_fn_decorated(i: i32);
+}
+
+#[link(name = "extern", kind = "raw-dylib")]
+extern {
+ fn print_extern_variable_undecorated();
+ fn print_extern_variable_noprefix();
+ fn print_extern_variable_decorated();
+}
+
+pub fn main() {
+ unsafe {
+ cdecl_fn_undecorated(1);
+ cdecl_fn_undecorated_renamed(10);
+ cdecl_fn_noprefix(2);
+ cdecl_fn_decorated(3);
+
+ stdcall_fn_undecorated(4);
+ stdcall_fn_undecorated_renamed(14);
+ stdcall_fn_noprefix(5);
+ stdcall_fn_decorated(6);
+
+ fastcall_fn_undecorated(7);
+ fastcall_fn_undecorated_renamed(17);
+ fastcall_fn_noprefix(8);
+ fastcall_fn_decorated(9);
+
+ extern_variable_undecorated = 42;
+ print_extern_variable_undecorated();
+ extern_variable_noprefix = 43;
+ print_extern_variable_noprefix();
+ extern_variable_decorated = 44;
+ print_extern_variable_decorated();
+
+ // GCC doesn't support vectorcall: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89485
+ #[cfg(target_env = "msvc")]
+ {
+ vectorcall_fn_undecorated(10);
+ vectorcall_fn_undecorated_renamed(20);
+ vectorcall_fn_noprefix(11);
+ vectorcall_fn_decorated(12);
+ }
+ #[cfg(not(target_env = "msvc"))]
+ {
+ println!("vectorcall_fn_undecorated(10)");
+ println!("vectorcall_fn_undecorated2(20)");
+ println!("vectorcall_fn_noprefix(11)");
+ println!("vectorcall_fn_decorated(12)");
+ }
+ }
+}
diff --git a/src/test/run-make/raw-dylib-import-name-type/extern.c b/src/test/run-make/raw-dylib-import-name-type/extern.c
new file mode 100644
index 000000000..195126d51
--- /dev/null
+++ b/src/test/run-make/raw-dylib-import-name-type/extern.c
@@ -0,0 +1,103 @@
+#include <stdio.h>
+#include <stdint.h>
+
+void _cdecl cdecl_fn_undecorated(int i) {
+ printf("cdecl_fn_undecorated(%d)\n", i);
+ fflush(stdout);
+}
+
+void _cdecl cdecl_fn_undecorated2(int i) {
+ printf("cdecl_fn_undecorated2(%d)\n", i);
+ fflush(stdout);
+}
+
+void _cdecl cdecl_fn_noprefix(int i) {
+ printf("cdecl_fn_noprefix(%d)\n", i);
+ fflush(stdout);
+}
+
+void _cdecl cdecl_fn_decorated(int i) {
+ printf("cdecl_fn_decorated(%d)\n", i);
+ fflush(stdout);
+}
+
+void __stdcall stdcall_fn_undecorated(int i) {
+ printf("stdcall_fn_undecorated(%d)\n", i);
+ fflush(stdout);
+}
+
+void __stdcall stdcall_fn_undecorated2(int i) {
+ printf("stdcall_fn_undecorated2(%d)\n", i);
+ fflush(stdout);
+}
+
+void __stdcall stdcall_fn_noprefix(int i) {
+ printf("stdcall_fn_noprefix(%d)\n", i);
+ fflush(stdout);
+}
+
+void __stdcall stdcall_fn_decorated(int i) {
+ printf("stdcall_fn_decorated(%d)\n", i);
+ fflush(stdout);
+}
+
+void __fastcall fastcall_fn_undecorated(int i) {
+ printf("fastcall_fn_undecorated(%d)\n", i);
+ fflush(stdout);
+}
+
+void __fastcall fastcall_fn_undecorated2(int i) {
+ printf("fastcall_fn_undecorated2(%d)\n", i);
+ fflush(stdout);
+}
+
+void __fastcall fastcall_fn_noprefix(int i) {
+ printf("fastcall_fn_noprefix(%d)\n", i);
+ fflush(stdout);
+}
+
+void __fastcall fastcall_fn_decorated(int i) {
+ printf("fastcall_fn_decorated(%d)\n", i);
+ fflush(stdout);
+}
+
+int extern_variable_undecorated = 0;
+__declspec(dllexport) void print_extern_variable_undecorated() {
+ printf("extern_variable_undecorated value: %d\n", extern_variable_undecorated);
+ fflush(stdout);
+}
+
+int extern_variable_noprefix = 0;
+__declspec(dllexport) void print_extern_variable_noprefix() {
+ printf("extern_variable_noprefix value: %d\n", extern_variable_noprefix);
+ fflush(stdout);
+}
+
+int extern_variable_decorated = 0;
+__declspec(dllexport) void print_extern_variable_decorated() {
+ printf("extern_variable_decorated value: %d\n", extern_variable_decorated);
+ fflush(stdout);
+}
+
+// GCC doesn't support vectorcall: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89485
+#ifdef _MSC_VER
+void __vectorcall vectorcall_fn_undecorated(int i) {
+ printf("vectorcall_fn_undecorated(%d)\n", i);
+ fflush(stdout);
+}
+
+void __vectorcall vectorcall_fn_undecorated2(int i) {
+ printf("vectorcall_fn_undecorated2(%d)\n", i);
+ fflush(stdout);
+}
+
+void __vectorcall vectorcall_fn_noprefix(int i) {
+ printf("vectorcall_fn_noprefix(%d)\n", i);
+ fflush(stdout);
+}
+
+void __vectorcall vectorcall_fn_decorated(int i) {
+ printf("vectorcall_fn_decorated(%d)\n", i);
+ fflush(stdout);
+}
+#endif
diff --git a/src/test/run-make/raw-dylib-import-name-type/extern.gnu.def b/src/test/run-make/raw-dylib-import-name-type/extern.gnu.def
new file mode 100644
index 000000000..a523c959a
--- /dev/null
+++ b/src/test/run-make/raw-dylib-import-name-type/extern.gnu.def
@@ -0,0 +1,21 @@
+LIBRARY extern
+EXPORTS
+ cdecl_fn_undecorated
+ cdecl_fn_undecorated2
+ cdecl_fn_noprefix
+ cdecl_fn_decorated
+ stdcall_fn_undecorated
+ stdcall_fn_undecorated2
+ stdcall_fn_noprefix@4
+ fastcall_fn_undecorated
+ fastcall_fn_undecorated2
+ @fastcall_fn_decorated@4
+
+ ;ld doesn't handle fully-decorated stdcall, or no-prefix fastcall
+ _stdcall_fn_decorated@4=stdcall_fn_decorated@4
+ fastcall_fn_noprefix@4=@fastcall_fn_noprefix@4
+
+ ;Variables are never decorated
+ extern_variable_undecorated
+ extern_variable_noprefix
+ extern_variable_decorated
diff --git a/src/test/run-make/raw-dylib-import-name-type/extern.msvc.def b/src/test/run-make/raw-dylib-import-name-type/extern.msvc.def
new file mode 100644
index 000000000..dbff32d4c
--- /dev/null
+++ b/src/test/run-make/raw-dylib-import-name-type/extern.msvc.def
@@ -0,0 +1,25 @@
+LIBRARY extern
+EXPORTS
+ cdecl_fn_undecorated
+ cdecl_fn_undecorated2
+ cdecl_fn_noprefix
+ cdecl_fn_decorated
+ stdcall_fn_undecorated
+ stdcall_fn_undecorated2
+ _stdcall_fn_decorated@4
+ fastcall_fn_undecorated
+ fastcall_fn_undecorated2
+ @fastcall_fn_decorated@4
+ vectorcall_fn_undecorated
+ vectorcall_fn_undecorated2
+ vectorcall_fn_decorated@@4
+ vectorcall_fn_noprefix@@4
+
+ ;MSVC doesn't seem to recognize the "no prefix" syntax.
+ stdcall_fn_noprefix@4=_stdcall_fn_noprefix@4
+ fastcall_fn_noprefix@4=@fastcall_fn_noprefix@4
+
+ ;Variables are never decorated
+ extern_variable_undecorated
+ extern_variable_noprefix
+ extern_variable_decorated
diff --git a/src/test/run-make/raw-dylib-import-name-type/output.txt b/src/test/run-make/raw-dylib-import-name-type/output.txt
new file mode 100644
index 000000000..707faf403
--- /dev/null
+++ b/src/test/run-make/raw-dylib-import-name-type/output.txt
@@ -0,0 +1,19 @@
+cdecl_fn_undecorated(1)
+cdecl_fn_undecorated2(10)
+cdecl_fn_noprefix(2)
+cdecl_fn_decorated(3)
+stdcall_fn_undecorated(4)
+stdcall_fn_undecorated2(14)
+stdcall_fn_noprefix(5)
+stdcall_fn_decorated(6)
+fastcall_fn_undecorated(7)
+fastcall_fn_undecorated2(17)
+fastcall_fn_noprefix(8)
+fastcall_fn_decorated(9)
+extern_variable_undecorated value: 42
+extern_variable_noprefix value: 43
+extern_variable_decorated value: 44
+vectorcall_fn_undecorated(10)
+vectorcall_fn_undecorated2(20)
+vectorcall_fn_noprefix(11)
+vectorcall_fn_decorated(12)
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/Makefile b/src/test/run-make/raw-dylib-inline-cross-dylib/Makefile
new file mode 100644
index 000000000..9e603f958
--- /dev/null
+++ b/src/test/run-make/raw-dylib-inline-cross-dylib/Makefile
@@ -0,0 +1,31 @@
+# Regression test for calling an inline function that uses a raw-dylib function.
+
+# only-windows
+
+include ../../run-make-fulldeps/tools.mk
+
+all:
+ $(RUSTC) --crate-type dylib --crate-name raw_dylib_test lib.rs -C prefer-dynamic
+ $(RUSTC) --crate-type dylib --crate-name raw_dylib_test_wrapper lib_wrapper.rs -C prefer-dynamic
+ $(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)" -C prefer-dynamic
+ # Make sure we don't find an import to the functions we expect to be inlined.
+ "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -v -e "inline_library_function"
+ "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -v -e "inline_library_function_calls_inline"
+ # Make sure we do find an import to the functions we expect to be imported.
+ "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -e "library_function"
+ $(call COMPILE_OBJ,"$(TMPDIR)"/extern_1.obj,extern_1.c)
+ $(call COMPILE_OBJ,"$(TMPDIR)"/extern_2.obj,extern_2.c)
+ifdef IS_MSVC
+ $(CC) "$(TMPDIR)"/extern_1.obj -link -dll -out:"$(TMPDIR)"/extern_1.dll -noimplib
+ $(CC) "$(TMPDIR)"/extern_2.obj -link -dll -out:"$(TMPDIR)"/extern_2.dll -noimplib
+else
+ $(CC) "$(TMPDIR)"/extern_1.obj -shared -o "$(TMPDIR)"/extern_1.dll
+ $(CC) "$(TMPDIR)"/extern_2.obj -shared -o "$(TMPDIR)"/extern_2.dll
+endif
+ $(call RUN,driver) > "$(TMPDIR)"/output.txt
+
+ifdef RUSTC_BLESS_TEST
+ cp "$(TMPDIR)"/output.txt output.txt
+else
+ $(DIFF) output.txt "$(TMPDIR)"/output.txt
+endif
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs b/src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs
new file mode 100644
index 000000000..f72ded7d9
--- /dev/null
+++ b/src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs
@@ -0,0 +1,21 @@
+#![feature(raw_dylib)]
+
+extern crate raw_dylib_test;
+extern crate raw_dylib_test_wrapper;
+
+#[link(name = "extern_2", kind = "raw-dylib")]
+extern {
+ fn extern_fn_2();
+}
+
+fn main() {
+ // NOTE: The inlined call to `extern_fn_2` links against the function in extern_2.dll instead
+ // of extern_1.dll since raw-dylib symbols from the current crate are passed to the linker
+ // first, so any ambiguous names will prefer the current crate's definition.
+ raw_dylib_test::inline_library_function();
+ raw_dylib_test::library_function();
+ raw_dylib_test_wrapper::inline_library_function_calls_inline();
+ unsafe {
+ extern_fn_2();
+ }
+}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c b/src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c
new file mode 100644
index 000000000..e5baaf5f0
--- /dev/null
+++ b/src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+__declspec(dllexport) void extern_fn_1() {
+ printf("extern_fn_1\n");
+ fflush(stdout);
+}
+
+__declspec(dllexport) void extern_fn_2() {
+ printf("extern_fn_2 in extern_1\n");
+ fflush(stdout);
+}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c b/src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c
new file mode 100644
index 000000000..30aa46922
--- /dev/null
+++ b/src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+__declspec(dllexport) void extern_fn_2() {
+ printf("extern_fn_2 in extern_2\n");
+ fflush(stdout);
+}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs b/src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs
new file mode 100644
index 000000000..00c2c1c42
--- /dev/null
+++ b/src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs
@@ -0,0 +1,21 @@
+#![feature(raw_dylib)]
+
+#[link(name = "extern_1", kind = "raw-dylib")]
+extern {
+ fn extern_fn_1();
+ fn extern_fn_2();
+}
+
+#[inline]
+pub fn inline_library_function() {
+ unsafe {
+ extern_fn_1();
+ extern_fn_2();
+ }
+}
+
+pub fn library_function() {
+ unsafe {
+ extern_fn_2();
+ }
+}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs b/src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs
new file mode 100644
index 000000000..47191b8de
--- /dev/null
+++ b/src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs
@@ -0,0 +1,6 @@
+extern crate raw_dylib_test;
+
+#[inline]
+pub fn inline_library_function_calls_inline() {
+ raw_dylib_test::inline_library_function();
+}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/output.txt b/src/test/run-make/raw-dylib-inline-cross-dylib/output.txt
new file mode 100644
index 000000000..e7009baa0
--- /dev/null
+++ b/src/test/run-make/raw-dylib-inline-cross-dylib/output.txt
@@ -0,0 +1,6 @@
+extern_fn_1
+extern_fn_2 in extern_2
+extern_fn_2 in extern_1
+extern_fn_1
+extern_fn_2 in extern_2
+extern_fn_2 in extern_2
diff --git a/src/test/run-make/raw-dylib-link-ordinal/Makefile b/src/test/run-make/raw-dylib-link-ordinal/Makefile
index c9baa3c1e..b55a94dbc 100644
--- a/src/test/run-make/raw-dylib-link-ordinal/Makefile
+++ b/src/test/run-make/raw-dylib-link-ordinal/Makefile
@@ -2,7 +2,7 @@
# only-windows
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
diff --git a/src/test/run-make/raw-dylib-link-ordinal/exporter.c b/src/test/run-make/raw-dylib-link-ordinal/exporter.c
index a9dd6da66..aabf32ff1 100644
--- a/src/test/run-make/raw-dylib-link-ordinal/exporter.c
+++ b/src/test/run-make/raw-dylib-link-ordinal/exporter.c
@@ -3,3 +3,10 @@
void exported_function() {
printf("exported_function\n");
}
+
+int exported_variable = 0;
+
+void print_exported_variable() {
+ printf("exported_variable value: %d\n", exported_variable);
+ fflush(stdout);
+}
diff --git a/src/test/run-make/raw-dylib-link-ordinal/exporter.def b/src/test/run-make/raw-dylib-link-ordinal/exporter.def
index 1a4b4c941..5d87c580a 100644
--- a/src/test/run-make/raw-dylib-link-ordinal/exporter.def
+++ b/src/test/run-make/raw-dylib-link-ordinal/exporter.def
@@ -1,3 +1,5 @@
LIBRARY exporter
EXPORTS
exported_function @13 NONAME
+ exported_variable @5 NONAME
+ print_exported_variable @9 NONAME
diff --git a/src/test/run-make/raw-dylib-link-ordinal/lib.rs b/src/test/run-make/raw-dylib-link-ordinal/lib.rs
index 20609caa5..bb25ac64c 100644
--- a/src/test/run-make/raw-dylib-link-ordinal/lib.rs
+++ b/src/test/run-make/raw-dylib-link-ordinal/lib.rs
@@ -1,13 +1,21 @@
-#![feature(raw_dylib)]
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "exporter", kind = "raw-dylib")]
extern {
#[link_ordinal(13)]
fn imported_function();
+ #[link_ordinal(5)]
+ static mut imported_variable: i32;
+ #[link_ordinal(9)]
+ fn print_imported_variable();
}
pub fn library_function() {
unsafe {
imported_function();
+ imported_variable = 42;
+ print_imported_variable();
+ imported_variable = -42;
+ print_imported_variable();
}
}
diff --git a/src/test/run-make/raw-dylib-link-ordinal/output.txt b/src/test/run-make/raw-dylib-link-ordinal/output.txt
index 2d0ed60f2..a4b2031d9 100644
--- a/src/test/run-make/raw-dylib-link-ordinal/output.txt
+++ b/src/test/run-make/raw-dylib-link-ordinal/output.txt
@@ -1 +1,3 @@
exported_function
+exported_variable value: 42
+exported_variable value: -42
diff --git a/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile b/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile
index 3360a97b5..b9deb7729 100644
--- a/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile
+++ b/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile
@@ -3,7 +3,7 @@
# only-x86
# only-windows
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
diff --git a/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs b/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs
index 07dd3d7be..b7921396a 100644
--- a/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs
+++ b/src/test/run-make/raw-dylib-stdcall-ordinal/lib.rs
@@ -1,4 +1,4 @@
-#![feature(raw_dylib)]
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "exporter", kind = "raw-dylib")]
extern "stdcall" {
diff --git a/src/test/run-make/remap-path-prefix-dwarf/Makefile b/src/test/run-make/remap-path-prefix-dwarf/Makefile
index 561a343d6..fbaea7b68 100644
--- a/src/test/run-make/remap-path-prefix-dwarf/Makefile
+++ b/src/test/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 ../../run-make-fulldeps/tools.mk
all: \
abs_input_outside_working_dir \
diff --git a/src/test/run-make/rustc-macro-dep-files/Makefile b/src/test/run-make/rustc-macro-dep-files/Makefile
index a08a63fb4..6ae659db2 100644
--- a/src/test/run-make/rustc-macro-dep-files/Makefile
+++ b/src/test/run-make/rustc-macro-dep-files/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
# instead of hardcoding them everywhere they're needed.
diff --git a/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile b/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile
index dce8b83ee..7786ff762 100644
--- a/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile
+++ b/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile
@@ -1,5 +1,5 @@
deps := ex
--include ../rustdoc-scrape-examples-multiple/scrape.mk
+include ../rustdoc-scrape-examples-multiple/scrape.mk
all: scrape
diff --git a/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile b/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile
index 897805e44..453a7d4bc 100644
--- a/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile
+++ b/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile
@@ -1,5 +1,5 @@
deps := ex ex2
--include ./scrape.mk
+include ./scrape.mk
all: scrape
diff --git a/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk b/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk
index d49b6c1f2..7a28d2145 100644
--- a/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk
+++ b/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile b/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile
index 339d539bf..bf45b8148 100644
--- a/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile
+++ b/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile
@@ -1,5 +1,5 @@
deps := ex1 ex2
--include ../rustdoc-scrape-examples-multiple/scrape.mk
+include ../rustdoc-scrape-examples-multiple/scrape.mk
all: scrape
diff --git a/src/test/run-make/rustdoc-scrape-examples-remap/Makefile b/src/test/run-make/rustdoc-scrape-examples-remap/Makefile
index dce8b83ee..7786ff762 100644
--- a/src/test/run-make/rustdoc-scrape-examples-remap/Makefile
+++ b/src/test/run-make/rustdoc-scrape-examples-remap/Makefile
@@ -1,5 +1,5 @@
deps := ex
--include ../rustdoc-scrape-examples-multiple/scrape.mk
+include ../rustdoc-scrape-examples-multiple/scrape.mk
all: scrape
diff --git a/src/test/run-make/rustdoc-scrape-examples-test/Makefile b/src/test/run-make/rustdoc-scrape-examples-test/Makefile
index 9f80a8d96..1235ead67 100644
--- a/src/test/run-make/rustdoc-scrape-examples-test/Makefile
+++ b/src/test/run-make/rustdoc-scrape-examples-test/Makefile
@@ -1,6 +1,6 @@
extra_flags := --scrape-tests
deps := ex
--include ../rustdoc-scrape-examples-multiple/scrape.mk
+include ../rustdoc-scrape-examples-multiple/scrape.mk
all: scrape
diff --git a/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile b/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile
index dce8b83ee..7786ff762 100644
--- a/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile
+++ b/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile
@@ -1,5 +1,5 @@
deps := ex
--include ../rustdoc-scrape-examples-multiple/scrape.mk
+include ../rustdoc-scrape-examples-multiple/scrape.mk
all: scrape
diff --git a/src/test/run-make/rustdoc-with-out-dir-option/Makefile b/src/test/run-make/rustdoc-with-out-dir-option/Makefile
index f79fce8ee..b3c3f5230 100644
--- a/src/test/run-make/rustdoc-with-out-dir-option/Makefile
+++ b/src/test/run-make/rustdoc-with-out-dir-option/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/src/test/run-make/rustdoc-with-output-option/Makefile b/src/test/run-make/rustdoc-with-output-option/Makefile
index 654f96725..02093a35c 100644
--- a/src/test/run-make/rustdoc-with-output-option/Makefile
+++ b/src/test/run-make/rustdoc-with-output-option/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile b/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile
index 1e9ba71de..dc5056a86 100644
--- a/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile
+++ b/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
diff --git a/src/test/run-make/static-pie/Makefile b/src/test/run-make/static-pie/Makefile
index 945ec1724..e71770636 100644
--- a/src/test/run-make/static-pie/Makefile
+++ b/src/test/run-make/static-pie/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-x86_64
# only-linux
diff --git a/src/test/run-make/thumb-none-cortex-m/Makefile b/src/test/run-make/thumb-none-cortex-m/Makefile
index 13385369e..aa046af95 100644
--- a/src/test/run-make/thumb-none-cortex-m/Makefile
+++ b/src/test/run-make/thumb-none-cortex-m/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# How to run this
# $ ./x.py clean
diff --git a/src/test/run-make/thumb-none-qemu/Makefile b/src/test/run-make/thumb-none-qemu/Makefile
index ab8b90e15..328758d41 100644
--- a/src/test/run-make/thumb-none-qemu/Makefile
+++ b/src/test/run-make/thumb-none-qemu/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-thumb
diff --git a/src/test/run-make/track-path-dep-info/Makefile b/src/test/run-make/track-path-dep-info/Makefile
index 465d37447..ee853943f 100644
--- a/src/test/run-make/track-path-dep-info/Makefile
+++ b/src/test/run-make/track-path-dep-info/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
# instead of hardcoding them everywhere they're needed.
diff --git a/src/test/run-make/track-pgo-dep-info/Makefile b/src/test/run-make/track-pgo-dep-info/Makefile
new file mode 100644
index 000000000..60b59c04a
--- /dev/null
+++ b/src/test/run-make/track-pgo-dep-info/Makefile
@@ -0,0 +1,26 @@
+# needs-profiler-support
+# ignore-windows-gnu
+
+-include ../../run-make-fulldeps/tools.mk
+
+# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
+# instead of hardcoding them everywhere they're needed.
+ifeq ($(IS_MUSL_HOST),1)
+ADDITIONAL_ARGS := $(RUSTFLAGS)
+endif
+
+all:
+ # Generate PGO profiles
+ $(BARE_RUSTC) $(ADDITIONAL_ARGS) -Cprofile-generate=$(TMPDIR)/profiles --out-dir $(TMPDIR) main.rs
+ $(TMPDIR)/main
+
+ # Merge profiles
+ "$(LLVM_BIN_DIR)/llvm-profdata" merge \
+ -o "$(TMPDIR)/merged.profdata" \
+ "$(TMPDIR)/profiles" || exit 1
+
+ # Use the profile
+ $(RUSTC) -Cprofile-use=$(TMPDIR)/merged.profdata --emit dep-info main.rs
+
+ # Check that profile file is in depinfo
+ $(CGREP) "merged.profdata" < $(TMPDIR)/main.d
diff --git a/src/test/run-make/track-pgo-dep-info/main.rs b/src/test/run-make/track-pgo-dep-info/main.rs
new file mode 100644
index 000000000..f328e4d9d
--- /dev/null
+++ b/src/test/run-make/track-pgo-dep-info/main.rs
@@ -0,0 +1 @@
+fn main() {}
diff --git a/src/test/run-make/translation/Makefile b/src/test/run-make/translation/Makefile
index bfff75e7a..20e86c7f9 100644
--- a/src/test/run-make/translation/Makefile
+++ b/src/test/run-make/translation/Makefile
@@ -9,16 +9,29 @@ FAKEROOT=$(TMPDIR)/fakeroot
all: normal custom sysroot
-normal: basic-translation.rs
+# Check that the test works normally, using the built-in fallback bundle.
+normal: test.rs
$(RUSTC) $< 2>&1 | grep "struct literal body without path"
-custom: basic-translation.rs basic-translation.ftl
- $(RUSTC) $< -Ztranslate-additional-ftl=$(CURDIR)/basic-translation.ftl 2>&1 | grep "this is a test message"
+# 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"
+
+# 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"
+
+# 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"
# 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
# to it.
-sysroot: basic-translation.rs basic-translation.ftl
+sysroot: test.rs working.ftl
mkdir $(FAKEROOT)
ln -s $(SYSROOT)/* $(FAKEROOT)
rm -f $(FAKEROOT)/lib
@@ -31,7 +44,7 @@ sysroot: basic-translation.rs basic-translation.ftl
mkdir $(FAKEROOT)/lib/rustlib/src
ln -s $(SYSROOT)/lib/rustlib/src/* $(FAKEROOT)/lib/rustlib/src
mkdir -p $(FAKEROOT)/share/locale/zh-CN/
- ln -s $(CURDIR)/basic-translation.ftl $(FAKEROOT)/share/locale/zh-CN/basic-translation.ftl
+ 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"
# Check that the compiler errors out when the sysroot requested cannot be
@@ -43,7 +56,7 @@ sysroot-missing:
# 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-invalid: basic-translation.rs basic-translation.ftl
+sysroot-invalid: test.rs working.ftl
mkdir $(FAKEROOT)
ln -s $(SYSROOT)/* $(FAKEROOT)
rm -f $(FAKEROOT)/lib
diff --git a/src/test/run-make/translation/basic-translation.ftl b/src/test/run-make/translation/basic-translation.ftl
deleted file mode 100644
index 4681b879c..000000000
--- a/src/test/run-make/translation/basic-translation.ftl
+++ /dev/null
@@ -1,2 +0,0 @@
-parser-struct-literal-body-without-path = this is a test message
- .suggestion = this is a test suggestion
diff --git a/src/test/run-make/translation/broken.ftl b/src/test/run-make/translation/broken.ftl
new file mode 100644
index 000000000..4e3585835
--- /dev/null
+++ b/src/test/run-make/translation/broken.ftl
@@ -0,0 +1,3 @@
+# `foo` isn't provided by this diagnostic so it is expected that the fallback message is used.
+parser_struct_literal_body_without_path = this is a {$foo} message
+ .suggestion = this is a test suggestion
diff --git a/src/test/run-make/translation/missing.ftl b/src/test/run-make/translation/missing.ftl
new file mode 100644
index 000000000..77bbda357
--- /dev/null
+++ b/src/test/run-make/translation/missing.ftl
@@ -0,0 +1,3 @@
+# `parser_struct_literal_body_without_path` isn't provided by this resource at all, so the
+# fallback should be used.
+foo = bar
diff --git a/src/test/run-make/translation/basic-translation.rs b/src/test/run-make/translation/test.rs
index b8f5bff31..b8f5bff31 100644
--- a/src/test/run-make/translation/basic-translation.rs
+++ b/src/test/run-make/translation/test.rs
diff --git a/src/test/run-make/translation/working.ftl b/src/test/run-make/translation/working.ftl
new file mode 100644
index 000000000..d5ea86738
--- /dev/null
+++ b/src/test/run-make/translation/working.ftl
@@ -0,0 +1,2 @@
+parser_struct_literal_body_without_path = this is a test message
+ .suggestion = this is a test suggestion
diff --git a/src/test/run-make/unstable-flag-required/Makefile b/src/test/run-make/unstable-flag-required/Makefile
index b8769d5f6..d3a734fae 100644
--- a/src/test/run-make/unstable-flag-required/Makefile
+++ b/src/test/run-make/unstable-flag-required/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
all:
$(RUSTDOC) --output-format=json x.html 2>&1 | diff - output-format-json.stderr
diff --git a/src/test/run-make/wasm-abi/Makefile b/src/test/run-make/wasm-abi/Makefile
index 61fc4e8f5..e713ca187 100644
--- a/src/test/run-make/wasm-abi/Makefile
+++ b/src/test/run-make/wasm-abi/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-custom-section/Makefile b/src/test/run-make/wasm-custom-section/Makefile
index 2f48b8525..92b0802e3 100644
--- a/src/test/run-make/wasm-custom-section/Makefile
+++ b/src/test/run-make/wasm-custom-section/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-custom-sections-opt/Makefile b/src/test/run-make/wasm-custom-sections-opt/Makefile
index 76698c0aa..e5b45d963 100644
--- a/src/test/run-make/wasm-custom-sections-opt/Makefile
+++ b/src/test/run-make/wasm-custom-sections-opt/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-export-all-symbols/Makefile b/src/test/run-make/wasm-export-all-symbols/Makefile
index 7e47ba485..834f4d258 100644
--- a/src/test/run-make/wasm-export-all-symbols/Makefile
+++ b/src/test/run-make/wasm-export-all-symbols/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-import-module/Makefile b/src/test/run-make/wasm-import-module/Makefile
index fe63e66f2..18cef16aa 100644
--- a/src/test/run-make/wasm-import-module/Makefile
+++ b/src/test/run-make/wasm-import-module/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-panic-small/Makefile b/src/test/run-make/wasm-panic-small/Makefile
index 68397e4bc..2af9f7135 100644
--- a/src/test/run-make/wasm-panic-small/Makefile
+++ b/src/test/run-make/wasm-panic-small/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-spurious-import/Makefile b/src/test/run-make/wasm-spurious-import/Makefile
index 1bb59dc1b..6f50e6e55 100644
--- a/src/test/run-make/wasm-spurious-import/Makefile
+++ b/src/test/run-make/wasm-spurious-import/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-stringify-ints-small/Makefile b/src/test/run-make/wasm-stringify-ints-small/Makefile
index 01e1c6b0c..2fa2c954d 100644
--- a/src/test/run-make/wasm-stringify-ints-small/Makefile
+++ b/src/test/run-make/wasm-stringify-ints-small/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
all:
diff --git a/src/test/run-make/wasm-symbols-different-module/Makefile b/src/test/run-make/wasm-symbols-different-module/Makefile
index bb6a5d3c9..9e657222d 100644
--- a/src/test/run-make/wasm-symbols-different-module/Makefile
+++ b/src/test/run-make/wasm-symbols-different-module/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-symbols-not-exported/Makefile b/src/test/run-make/wasm-symbols-not-exported/Makefile
index 62bd0f087..60b0dee00 100644
--- a/src/test/run-make/wasm-symbols-not-exported/Makefile
+++ b/src/test/run-make/wasm-symbols-not-exported/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/wasm-symbols-not-imported/Makefile b/src/test/run-make/wasm-symbols-not-imported/Makefile
index 7a923375c..dc7618c19 100644
--- a/src/test/run-make/wasm-symbols-not-imported/Makefile
+++ b/src/test/run-make/wasm-symbols-not-imported/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
# only-wasm32-bare
diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
index 6a04d3439..84dcd2393 100644
--- a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
+++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile
@@ -1,4 +1,4 @@
--include ../../run-make-fulldeps/tools.mk
+include ../../run-make-fulldeps/tools.mk
#only-x86_64-fortanix-unknown-sgx
diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
index 54645e9e2..944343df6 100644
--- a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
+++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
@@ -45,7 +45,7 @@ check cc_plus_one_cxx cc_plus_one_cxx.checks
check cc_plus_one_cxx_asm cc_plus_one_cxx_asm.checks
check cc_plus_one_asm cc_plus_one_asm.checks \
|| echo "warning: the cc crate forwards assembly files to the CC compiler." \
- "Clang uses its own intergrated assembler, which does not include the LVI passes."
+ "Clang uses its own integrated assembler, which does not include the LVI passes."
check cmake_plus_one_c cmake_plus_one_c.checks
check cmake_plus_one_c_asm cmake_plus_one_c_asm.checks
diff --git a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs
index f29bc50e8..f7ef92df8 100644
--- a/src/test/run-pass-valgrind/cast-enum-with-dtor.rs
+++ b/src/test/run-pass-valgrind/cast-enum-with-dtor.rs
@@ -28,7 +28,7 @@ fn main() {
{
let e = E::C;
assert_eq!(e as u32, 2);
- assert_eq!(FLAG.load(Ordering::SeqCst), 0);
+ assert_eq!(FLAG.load(Ordering::SeqCst), 1);
}
assert_eq!(FLAG.load(Ordering::SeqCst), 1);
}
diff --git a/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs b/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs
index fb2b4d476..dfc094abe 100644
--- a/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs
+++ b/src/test/run-pass-valgrind/cleanup-auto-borrow-obj.rs
@@ -2,8 +2,6 @@
// schedule cleanups when auto borrowing trait objects.
// This program should be valgrind clean.
-#![feature(box_syntax)]
-
static mut DROP_RAN: bool = false;
struct Foo;
@@ -19,7 +17,7 @@ impl Trait for Foo {}
pub fn main() {
{
- let _x: &Trait = &*(box Foo as Box<Trait>);
+ let _x: &Trait = &*(Box::new(Foo) as Box<Trait>);
}
unsafe {
assert!(DROP_RAN);
diff --git a/src/test/run-pass-valgrind/coerce-match.rs b/src/test/run-pass-valgrind/coerce-match.rs
index a4ba5427d..5b78f1ec7 100644
--- a/src/test/run-pass-valgrind/coerce-match.rs
+++ b/src/test/run-pass-valgrind/coerce-match.rs
@@ -2,15 +2,18 @@
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
pub fn main() {
- let _: Box<[isize]> =
- if true { let b: Box<_> = box [1, 2, 3]; b } else { let b: Box<_> = box [1]; b };
+ let _: Box<[isize]> = if true {
+ let b: Box<_> = Box::new([1, 2, 3]);
+ b
+ } else {
+ let b: Box<_> = Box::new([1]);
+ b
+ };
let _: Box<[isize]> = match true {
- true => { let b: Box<_> = box [1, 2, 3]; b }
- false => { let b: Box<_> = box [1]; b }
+ true => { let b: Box<_> = Box::new([1, 2, 3]); b }
+ false => { let b: Box<_> = Box::new([1]); b }
};
// Check we don't get over-keen at propagating coercions in the case of casts.
diff --git a/src/test/rustdoc-gui/anchor-navigable.goml b/src/test/rustdoc-gui/anchor-navigable.goml
index 424c31223..9d5c55a1e 100644
--- a/src/test/rustdoc-gui/anchor-navigable.goml
+++ b/src/test/rustdoc-gui/anchor-navigable.goml
@@ -4,8 +4,8 @@
// 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
+goto: "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": "9"})
+assert-property: (".impl > a.anchor", {"offsetWidth": "8"})
assert-css: (".impl > a.anchor", {"left": "-8px"})
diff --git a/src/test/rustdoc-gui/anchors.goml b/src/test/rustdoc-gui/anchors.goml
index 84b8bbd1b..fb8e288fa 100644
--- a/src/test/rustdoc-gui/anchors.goml
+++ b/src/test/rustdoc-gui/anchors.goml
@@ -1,34 +1,107 @@
// This test is to ensure that the anchors (`§`) have the expected color and position.
-goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
-show-text: true
-// This is needed to ensure that the text color is computed.
-show-text: true
+define-function: (
+ "check-colors",
+ (theme, main_color, title_color, fqn_color, fqn_type_color, src_link_color, sidebar_link_color),
+ [
+ ("goto", "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"),
+ // This is needed to ensure that the text color is computed.
+ ("show-text", true),
-// Set the theme to light.
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
-// We reload the page so the local storage settings are being used.
-reload:
+ // Setting the theme.
+ ("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: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"})
-assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"})
-assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(173, 55, 138)"})
-assert-css: (".srclink", {"color": "rgb(56, 115, 173)"})
+ ("assert-css", ("#toggle-all-docs", {"color": |main_color|})),
+ ("assert-css", (".fqn a:nth-of-type(1)", {"color": |fqn_color|})),
+ ("assert-css", (".fqn a:nth-of-type(2)", {"color": |fqn_type_color|})),
+ ("assert-css", (
+ ".rightside .srclink",
+ {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
+ ALL,
+ )),
+ (
+ "compare-elements-css",
+ (".rightside .srclink", ".rightside.srclink", ["color", "text-decoration"]),
+ ),
+ (
+ "compare-elements-css",
+ (".main-heading .srclink", ".rightside.srclink", ["color", "text-decoration"]),
+ ),
-move-cursor-to: ".main-heading .srclink"
-assert-css: (".srclink", {"text-decoration": "underline solid rgb(56, 115, 173)"})
+ ("move-cursor-to", ".main-heading .srclink"),
+ ("assert-css", (
+ ".main-heading .srclink",
+ {"color": |src_link_color|, "text-decoration": "underline solid " + |src_link_color|},
+ )),
+ ("move-cursor-to", ".impl-items .rightside .srclink"),
+ ("assert-css", (
+ ".impl-items .rightside .srclink",
+ {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
+ )),
+ ("move-cursor-to", ".impl-items .rightside.srclink"),
+ ("assert-css", (
+ ".impl-items .rightside.srclink",
+ {"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
+ )),
-assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"})
+ ("goto", "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"}),
+ // We reload the page so the local storage settings are being used.
+ ("reload"),
-assert-css: (".sidebar a", {"color": "rgb(53, 109, 164)"})
-assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"})
+ ("assert-css", ("#top-doc-prose-title", {"color": |title_color|})),
-// We move the cursor over the "Implementations" title so the anchor is displayed.
-move-cursor-to: "h2#implementations"
-assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"})
+ ("assert-css", (".sidebar a", {"color": |sidebar_link_color|})),
+ ("assert-css", ("h1.fqn a", {"color": |title_color|})),
-// Same thing with the impl block title.
-move-cursor-to: "#impl-HeavilyDocumentedStruct"
-assert-css: ("#impl-HeavilyDocumentedStruct a.anchor", {"color": "rgb(0, 0, 0)"})
+ // We move the cursor over the "Implementations" title so the anchor is displayed.
+ ("move-cursor-to", "h2#implementations"),
+ ("assert-css", ("h2#implementations a.anchor", {"color": |main_color|})),
-assert-css: ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})
+ // Same thing with the impl block title.
+ ("move-cursor-to", "#impl-HeavilyDocumentedStruct"),
+ ("assert-css", ("#impl-HeavilyDocumentedStruct a.anchor", {"color": |main_color|})),
+
+ ("assert-css", ("#title-for-struct-impl-item-doc", {"margin-left": "0px"})),
+ ],
+)
+
+call-function: (
+ "check-colors",
+ {
+ "theme": "ayu",
+ "main_color": "rgb(197, 197, 197)",
+ "title_color": "rgb(255, 255, 255)",
+ "fqn_color": "rgb(255, 255, 255)",
+ "fqn_type_color": "rgb(255, 160, 165)",
+ "src_link_color": "rgb(57, 175, 215)",
+ "sidebar_link_color": "rgb(83, 177, 219)",
+ },
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "dark",
+ "main_color": "rgb(221, 221, 221)",
+ "title_color": "rgb(221, 221, 221)",
+ "fqn_color": "rgb(221, 221, 221)",
+ "fqn_type_color": "rgb(45, 191, 184)",
+ "src_link_color": "rgb(210, 153, 29)",
+ "sidebar_link_color": "rgb(253, 191, 53)",
+ },
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "light",
+ "main_color": "rgb(0, 0, 0)",
+ "title_color": "rgb(0, 0, 0)",
+ "fqn_color": "rgb(0, 0, 0)",
+ "fqn_type_color": "rgb(173, 55, 138)",
+ "src_link_color": "rgb(56, 115, 173)",
+ "sidebar_link_color": "rgb(53, 109, 164)",
+ },
+)
diff --git a/src/test/rustdoc-gui/auto-hide-trait-implementations.goml b/src/test/rustdoc-gui/auto-hide-trait-implementations.goml
index 7b1358fed..0a619c352 100644
--- a/src/test/rustdoc-gui/auto-hide-trait-implementations.goml
+++ b/src/test/rustdoc-gui/auto-hide-trait-implementations.goml
@@ -1,5 +1,5 @@
// Checks that the setting "auto hide trait implementations" is working as expected.
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html
+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)
diff --git a/src/test/rustdoc-gui/basic-code.goml b/src/test/rustdoc-gui/basic-code.goml
index 27deb2c98..f4ba5a128 100644
--- a/src/test/rustdoc-gui/basic-code.goml
+++ b/src/test/rustdoc-gui/basic-code.goml
@@ -1,3 +1,3 @@
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: ".srclink"
-assert-count: (".line-numbers", 1)
+assert-count: (".src-line-numbers", 1)
diff --git a/src/test/rustdoc-gui/basic.goml b/src/test/rustdoc-gui/basic.goml
index 239e51a91..60292835b 100644
--- a/src/test/rustdoc-gui/basic.goml
+++ b/src/test/rustdoc-gui/basic.goml
@@ -1,4 +1,4 @@
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert: ("#functions")
-goto: ./struct.Foo.html
+goto: "./struct.Foo.html"
assert: ("div.item-decl")
diff --git a/src/test/rustdoc-gui/check-code-blocks-margin.goml b/src/test/rustdoc-gui/check-code-blocks-margin.goml
index f6266eba7..c2cec0020 100644
--- a/src/test/rustdoc-gui/check-code-blocks-margin.goml
+++ b/src/test/rustdoc-gui/check-code-blocks-margin.goml
@@ -1,6 +1,6 @@
// This test ensures that the docblock elements have the appropriate left margin.
-goto: file://|DOC_PATH|/test_docs/fn.foo.html
+goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
// The top docblock elements shouldn't have left margin...
-assert-css: ("#main-content .docblock.item-decl", {"margin-left": "0px"})
+assert-css: ("#main-content .item-decl", {"margin-left": "0px"})
// ... but all the others should!
-assert-css: ("#main-content .docblock:not(.item-decl)", {"margin-left": "24px"})
+assert-css: ("#main-content .docblock", {"margin-left": "24px"})
diff --git a/src/test/rustdoc-gui/check-stab-in-docblock.goml b/src/test/rustdoc-gui/check-stab-in-docblock.goml
new file mode 100644
index 000000000..266fa9997
--- /dev/null
+++ b/src/test/rustdoc-gui/check-stab-in-docblock.goml
@@ -0,0 +1,27 @@
+// This test checks that using `.stab` attributes in `.docblock` elements doesn't
+// create scrollable paragraphs.
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+// Needs the text to be display to check for scrollable content.
+show-text: true
+size: (786, 600)
+// Confirms that there 3 paragraphs.
+assert-count: (".top-doc .docblock p", 3)
+// Checking that there is no scrollable content.
+store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(1)", "clientHeight")
+store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(1)", "clientWidth")
+assert-property: (
+ ".top-doc .docblock p:nth-of-type(1)",
+ {"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
+)
+store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(2)", "clientHeight")
+store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(2)", "clientWidth")
+assert-property: (
+ ".top-doc .docblock p:nth-of-type(2)",
+ {"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
+)
+store-property: (clientHeight, ".top-doc .docblock p:nth-of-type(3)", "clientHeight")
+store-property: (clientWidth, ".top-doc .docblock p:nth-of-type(3)", "clientWidth")
+assert-property: (
+ ".top-doc .docblock p:nth-of-type(3)",
+ {"scrollHeight": |clientHeight|, "scrollWidth": |clientWidth|},
+)
diff --git a/src/test/rustdoc-gui/check_info_sign_position.goml b/src/test/rustdoc-gui/check_info_sign_position.goml
index 3bed7a0a0..f36e73fc5 100644
--- a/src/test/rustdoc-gui/check_info_sign_position.goml
+++ b/src/test/rustdoc-gui/check_info_sign_position.goml
@@ -1,11 +1,11 @@
// 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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+goto: "./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 > .information > .compile_fail", { "margin-top": "16px" })
+assert-css: (".docblock > .example-wrap.compile_fail .tooltip", { "margin-top": "16px" })
// Checks that the other codeblocks don't have this top margin.
-assert-css: ("ol > li > .information > .compile_fail", { "margin-top": "0px" })
-assert-css: ("ol > li > .information > .ignore", { "margin-top": "0px" })
-assert-css: (".docblock > .information > .ignore", { "margin-top": "0px" })
+assert-css: ("ol > li > .example-wrap.compile_fail .tooltip", { "margin-top": "0px" })
+assert-css: ("ol > li > .example-wrap.ignore .tooltip", { "margin-top": "0px" })
+assert-css: (".docblock > .example-wrap.ignore .tooltip", { "margin-top": "0px" })
diff --git a/src/test/rustdoc-gui/code-blocks-overflow.goml b/src/test/rustdoc-gui/code-blocks-overflow.goml
index f93f3f0ae..fbf0e890b 100644
--- a/src/test/rustdoc-gui/code-blocks-overflow.goml
+++ b/src/test/rustdoc-gui/code-blocks-overflow.goml
@@ -1,8 +1,8 @@
// This test ensures that codeblocks content don't overflow.
-goto: file://|DOC_PATH|/lib2/sub_mod/struct.Foo.html
+goto: "file://" + |DOC_PATH| + "/lib2/sub_mod/struct.Foo.html"
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"
assert: ".docblock > .example-wrap > .rust-example-rendered"
-assert-css: (".docblock > .example-wrap > pre", {"width": "785.25px", "overflow-x": "auto"}, ALL)
+assert-css: (".docblock > .example-wrap > pre", {"width": "796px", "overflow-x": "auto"}, ALL)
diff --git a/src/test/rustdoc-gui/code-color.goml b/src/test/rustdoc-gui/code-color.goml
index 2f95bfb6b..118f04ad6 100644
--- a/src/test/rustdoc-gui/code-color.goml
+++ b/src/test/rustdoc-gui/code-color.goml
@@ -2,29 +2,23 @@
// 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
+goto: "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
-// Set the theme to dark.
-local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
-// We reload the page so the local storage settings are being used.
-reload:
-assert-css: (".docblock pre > code", {"color": "rgb(221, 221, 221)"}, ALL)
-assert-css: (".docblock > p > code", {"color": "rgb(221, 221, 221)"}, ALL)
+define-function: (
+ "check-colors",
+ (theme, doc_code_color, doc_inline_code_color),
+ [
+ // Set the theme.
+ ("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)),
+ ("assert-css", (".docblock > p > code", {"color": |doc_inline_code_color|}, ALL)),
+ ],
+)
-// Set the theme to ayu.
-local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"}
-// We reload the page so the local storage settings are being used.
-reload:
-
-assert-css: (".docblock pre > code", {"color": "rgb(230, 225, 207)"}, ALL)
-assert-css: (".docblock > p > code", {"color": "rgb(255, 180, 84)"}, ALL)
-
-// Set the theme to light.
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
-// We reload the page so the local storage settings are being used.
-reload:
-
-assert-css: (".docblock pre > code", {"color": "rgb(0, 0, 0)"}, ALL)
-assert-css: (".docblock > p > code", {"color": "rgb(0, 0, 0)"}, ALL)
+call-function: ("check-colors", ("ayu", "rgb(230, 225, 207)", "rgb(255, 180, 84)"))
+call-function: ("check-colors", ("dark", "rgb(221, 221, 221)", "rgb(221, 221, 221)"))
+call-function: ("check-colors", ("light", "rgb(0, 0, 0)", "rgb(0, 0, 0)"))
diff --git a/src/test/rustdoc-gui/code-sidebar-toggle.goml b/src/test/rustdoc-gui/code-sidebar-toggle.goml
index 867db0569..00a0ea1e1 100644
--- a/src/test/rustdoc-gui/code-sidebar-toggle.goml
+++ b/src/test/rustdoc-gui/code-sidebar-toggle.goml
@@ -1,5 +1,5 @@
// This test checks that the source code pages sidebar toggle is working as expected.
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
click: ".srclink"
wait-for: "#sidebar-toggle"
click: "#sidebar-toggle"
diff --git a/src/test/rustdoc-gui/code-tags.goml b/src/test/rustdoc-gui/code-tags.goml
index 200569a28..837a2c1d5 100644
--- a/src/test/rustdoc-gui/code-tags.goml
+++ b/src/test/rustdoc-gui/code-tags.goml
@@ -1,20 +1,20 @@
// This test ensures that items and documentation code blocks are wrapped in <pre><code>
-goto: file://|DOC_PATH|/test_docs/fn.foo.html
+goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
size: (1080, 600)
-// There should be three doc codeblocks
+// There should be four doc codeblocks.
// Check that their content is inside <pre><code>
-assert-count: (".example-wrap pre > code", 3)
+assert-count: (".example-wrap pre > code", 4)
// Check that function signature is inside <pre><code>
assert: "pre.rust.fn > code"
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert: "pre.rust.struct > code"
-goto: file://|DOC_PATH|/test_docs/enum.AnEnum.html
+goto: "file://" + |DOC_PATH| + "/test_docs/enum.AnEnum.html"
assert: "pre.rust.enum > code"
-goto: file://|DOC_PATH|/test_docs/trait.AnotherOne.html
+goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
assert: "pre.rust.trait > code"
-goto: file://|DOC_PATH|/test_docs/type.SomeType.html
+goto: "file://" + |DOC_PATH| + "/test_docs/type.SomeType.html"
assert: "pre.rust.typedef > code"
diff --git a/src/test/rustdoc-gui/codeblock-tooltip.goml b/src/test/rustdoc-gui/codeblock-tooltip.goml
new file mode 100644
index 000000000..8e681a2a0
--- /dev/null
+++ b/src/test/rustdoc-gui/codeblock-tooltip.goml
@@ -0,0 +1,80 @@
+// Checking the colors of the codeblocks tooltips.
+goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+show-text: true
+
+define-function: (
+ "check-colors",
+ (theme),
+ [
+ // Setting the theme.
+ ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
+ ("reload"),
+
+ // compile_fail block
+ ("assert-css", (
+ ".docblock .example-wrap.compile_fail .tooltip",
+ {"color": "rgba(255, 0, 0, 0.5)"},
+ )),
+ ("assert-css", (
+ ".docblock .example-wrap.compile_fail",
+ {"border-left": "2px solid rgba(255, 0, 0, 0.5)"},
+ )),
+
+ ("move-cursor-to", ".docblock .example-wrap.compile_fail"),
+
+ ("assert-css", (
+ ".docblock .example-wrap.compile_fail .tooltip",
+ {"color": "rgb(255, 0, 0)"},
+ )),
+ ("assert-css", (
+ ".docblock .example-wrap.compile_fail",
+ {"border-left": "2px solid rgb(255, 0, 0)"},
+ )),
+
+ // should_panic block
+ ("assert-css", (
+ ".docblock .example-wrap.should_panic .tooltip",
+ {"color": "rgba(255, 0, 0, 0.5)"},
+ )),
+ ("assert-css", (
+ ".docblock .example-wrap.should_panic",
+ {"border-left": "2px solid rgba(255, 0, 0, 0.5)"},
+ )),
+
+ ("move-cursor-to", ".docblock .example-wrap.should_panic"),
+
+ ("assert-css", (
+ ".docblock .example-wrap.should_panic .tooltip",
+ {"color": "rgb(255, 0, 0)"},
+ )),
+ ("assert-css", (
+ ".docblock .example-wrap.should_panic",
+ {"border-left": "2px solid rgb(255, 0, 0)"},
+ )),
+
+ // ignore block
+ ("assert-css", (
+ ".docblock .example-wrap.ignore .tooltip",
+ {"color": "rgba(255, 142, 0, 0.6)"},
+ )),
+ ("assert-css", (
+ ".docblock .example-wrap.ignore",
+ {"border-left": "2px solid rgba(255, 142, 0, 0.6)"},
+ )),
+
+ ("move-cursor-to", ".docblock .example-wrap.ignore"),
+
+ ("assert-css", (
+ ".docblock .example-wrap.ignore .tooltip",
+ {"color": "rgb(255, 142, 0)"},
+ )),
+ ("assert-css", (
+ ".docblock .example-wrap.ignore",
+ {"border-left": "2px solid rgb(255, 142, 0)"},
+ )),
+ ],
+)
+
+call-function: ("check-colors", ("ayu"))
+call-function: ("check-colors", ("dark"))
+call-function: ("check-colors", ("light"))
diff --git a/src/test/rustdoc-gui/default-settings.goml b/src/test/rustdoc-gui/default-settings.goml
index 90f0b087a..ab27b001e 100644
--- a/src/test/rustdoc-gui/default-settings.goml
+++ b/src/test/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
+goto: "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/src/test/rustdoc-gui/docblock-big-code-mobile.goml b/src/test/rustdoc-gui/docblock-big-code-mobile.goml
index 02f79f1fc..9f8df44d7 100644
--- a/src/test/rustdoc-gui/docblock-big-code-mobile.goml
+++ b/src/test/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
+goto: "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
diff --git a/src/test/rustdoc-gui/docblock-code-block-line-number.goml b/src/test/rustdoc-gui/docblock-code-block-line-number.goml
index baf9651c4..911ee34be 100644
--- a/src/test/rustdoc-gui/docblock-code-block-line-number.goml
+++ b/src/test/rustdoc-gui/docblock-code-block-line-number.goml
@@ -1,8 +1,8 @@
// Checks that the setting "line numbers" is working as expected.
-goto: file://|DOC_PATH|/test_docs/fn.foo.html
+goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
// We check that without this setting, there is no line number displayed.
-assert-false: "pre.line-number"
+assert-false: "pre.example-line-numbers"
// We now set the setting to show the line numbers on code examples.
local-storage: {"rustdoc-line-numbers": "true" }
@@ -10,13 +10,30 @@ local-storage: {"rustdoc-line-numbers": "true" }
reload:
// We wait for them to be added into the DOM by the JS...
-wait-for: "pre.line-number"
+wait-for: "pre.example-line-numbers"
// If the test didn't fail, it means that it was found!
// Let's now check some CSS properties...
-assert-css: ("pre.line-number", {
+assert-css: ("pre.example-line-numbers", {
"margin": "0px",
"padding": "13px 8px",
"text-align": "right",
})
// The first code block has two lines so let's check its `<pre>` elements lists both of them.
-assert-text: ("pre.line-number", "1\n2")
+assert-text: ("pre.example-line-numbers", "1\n2")
+
+// Now, try changing the setting dynamically. We'll turn it off, using the settings menu,
+// and make sure it goes away.
+
+// First, open the settings menu.
+click: "#settings-menu"
+wait-for: "#settings"
+assert-css: ("#settings", {"display": "block"})
+
+// Then, click the toggle button.
+click: "input#line-numbers + .slider"
+wait-for: 100 // wait-for-false does not exist
+assert-false: "pre.example-line-numbers"
+
+// Finally, turn it on again.
+click: "input#line-numbers + .slider"
+wait-for: "pre.example-line-numbers"
diff --git a/src/test/rustdoc-gui/docblock-details.goml b/src/test/rustdoc-gui/docblock-details.goml
index f6287ade2..9ae571efb 100644
--- a/src/test/rustdoc-gui/docblock-details.goml
+++ b/src/test/rustdoc-gui/docblock-details.goml
@@ -1,5 +1,5 @@
// This ensures that the `<details>`/`<summary>` elements are displayed as expected.
-goto: file://|DOC_PATH|/test_docs/details/struct.Details.html
+goto: "file://" + |DOC_PATH| + "/test_docs/details/struct.Details.html"
show-text: true
local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
reload:
@@ -14,10 +14,21 @@ assert-css: (
// We now check that the `<summary>` doesn't have a bottom border and has the correct display.
assert-css: (
".top-doc .docblock summary h4",
- {"border-bottom": "0px none rgb(210, 210, 210)"},
+ {"border-bottom-width": "0px"},
)
// This allows to ensure that summary is on one line only!
assert-property: (".top-doc .docblock summary h4", {"offsetHeight": "33"})
assert-css: (".top-doc .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
// So `33 + 15 + 5` == `53`
assert-property: (".top-doc .docblock summary", {"offsetHeight": "53"})
+
+// We now check the `<summary>` on a method.
+assert-css: (
+ ".method-toggle .docblock summary h4",
+ {"border-bottom-width": "0px"},
+)
+// This allows to ensure that summary is on one line only!
+assert-property: (".method-toggle .docblock summary h4", {"offsetHeight": "30"})
+assert-css: (".method-toggle .docblock summary h4", {"margin-top": "15px", "margin-bottom": "5px"})
+// So `30 + 15 + 5` == `50`
+assert-property: (".method-toggle .docblock summary", {"offsetHeight": "50"})
diff --git a/src/test/rustdoc-gui/docblock-table-overflow.goml b/src/test/rustdoc-gui/docblock-table-overflow.goml
index af76d2ea4..d8670089a 100644
--- a/src/test/rustdoc-gui/docblock-table-overflow.goml
+++ b/src/test/rustdoc-gui/docblock-table-overflow.goml
@@ -1,12 +1,12 @@
// 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
+goto: "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)
// 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": "801"})
+assert-property: (".top-doc .docblock", {"scrollWidth": "816"})
// However, since there is overflow in the <table>, its scroll width is bigger.
-assert-property: (".top-doc .docblock table", {"scrollWidth": "1573"})
+assert-property: (".top-doc .docblock table", {"scrollWidth": "1572"})
// Checking it works on other doc blocks as well...
@@ -16,6 +16,6 @@ compare-elements-property: (
"#implementations-list > details .docblock > p",
["scrollWidth"],
)
-assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "801"})
+assert-property: ("#implementations-list > details .docblock", {"scrollWidth": "816"})
// However, since there is overflow in the <table>, its scroll width is bigger.
-assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1573"})
+assert-property: ("#implementations-list > details .docblock table", {"scrollWidth": "1572"})
diff --git a/src/test/rustdoc-gui/docblock-table.goml b/src/test/rustdoc-gui/docblock-table.goml
new file mode 100644
index 000000000..4e316ce0b
--- /dev/null
+++ b/src/test/rustdoc-gui/docblock-table.goml
@@ -0,0 +1,4 @@
+goto: "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"])
diff --git a/src/test/rustdoc-gui/duplicate-macro-reexport.goml b/src/test/rustdoc-gui/duplicate-macro-reexport.goml
index 9ea599062..496203c12 100644
--- a/src/test/rustdoc-gui/duplicate-macro-reexport.goml
+++ b/src/test/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
+goto: "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/src/test/rustdoc-gui/escape-key.goml b/src/test/rustdoc-gui/escape-key.goml
index a5afb037d..78e9f2309 100644
--- a/src/test/rustdoc-gui/escape-key.goml
+++ b/src/test/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
+goto: "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/src/test/rustdoc-gui/font-weight.goml b/src/test/rustdoc-gui/font-weight.goml
index 5f29fde66..8ba005b0c 100644
--- a/src/test/rustdoc-gui/font-weight.goml
+++ b/src/test/rustdoc-gui/font-weight.goml
@@ -1,6 +1,6 @@
// This test checks that the font weight is correctly applied.
-goto: file://|DOC_PATH|/lib2/struct.Foo.html
-assert-css: ("//*[@class='docblock item-decl']//a[text()='Alias']", {"font-weight": "400"})
+goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
+assert-css: ("//*[@class='item-decl']//a[text()='Alias']", {"font-weight": "400"})
assert-css: (
"//*[@class='structfield small-section-header']//a[text()='Alias']",
{"font-weight": "400"},
@@ -9,17 +9,17 @@ 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
+goto: "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
-assert-css: (".impl-items .method", {"font-weight": "600"}, ALL)
+goto: "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
+goto: "file://" + |DOC_PATH| + "/lib2/trait.Trait.html"
// This is a complex selector, so here's how it works:
//
-// * //*[@class='docblock item-decl'] — selects element of any tag with classes docblock and item-decl
+// * //*[@class='item-decl'] — selects element of any tag with classes docblock and item-decl
// * /pre[@class='rust trait'] — selects immediate child with tag pre and classes rust and trait
// * /code — selects immediate child with tag code
// * /a[@class='constant'] — selects immediate child with tag a and class constant
@@ -29,11 +29,11 @@ goto: file://|DOC_PATH|/lib2/trait.Trait.html
// This uses '/parent::*' as a proxy for the style of the text node.
// We can't just select the '<a>' because intermediate tags could be added.
assert-count: (
- "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
+ "//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
1,
)
assert-css: (
- "//*[@class='docblock item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
+ "//*[@class='item-decl']/pre[@class='rust trait']/code/a[@class='constant']//text()/parent::*",
{"font-weight": "400"},
)
@@ -41,4 +41,4 @@ assert-count: (".methods .associatedtype", 1)
assert-css: (".methods .associatedtype", {"font-weight": "600"})
assert-count: (".methods .constant", 1)
assert-css: (".methods .constant", {"font-weight": "600"})
-assert-css: (".methods .method", {"font-weight": "600"})
+assert-css: (".methods .method > .code-header", {"font-weight": "600"})
diff --git a/src/test/rustdoc-gui/hash-item-expansion.goml b/src/test/rustdoc-gui/hash-item-expansion.goml
index 861f69283..3cf94f624 100644
--- a/src/test/rustdoc-gui/hash-item-expansion.goml
+++ b/src/test/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
+goto: "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/src/test/rustdoc-gui/headers-color.goml b/src/test/rustdoc-gui/headers-color.goml
index a47a9c8a1..c80a49c52 100644
--- a/src/test/rustdoc-gui/headers-color.goml
+++ b/src/test/rustdoc-gui/headers-color.goml
@@ -1,117 +1,70 @@
// This test check for headers text and background colors for the different themes.
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html
-// This is needed so that the text color is computed.
-show-text: true
-
-// Ayu theme
-local-storage: {
- "rustdoc-theme": "ayu",
- "rustdoc-preferred-dark-theme": "ayu",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".impl",
- {"color": "rgb(197, 197, 197)", "background-color": "rgba(0, 0, 0, 0)"},
- ALL,
-)
-assert-css: (
- ".impl .code-header",
- {"color": "rgb(230, 225, 207)", "background-color": "rgb(15, 20, 25)"},
- ALL,
+define-function: (
+ "check-colors",
+ (theme, color, code_header_color, focus_background_color, headings_color),
+ [
+ ("goto", "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"}),
+ ("reload"),
+ ("assert-css", (
+ ".impl",
+ {"color": |color|, "background-color": "rgba(0, 0, 0, 0)"},
+ ALL,
+ )),
+ ("assert-css", (
+ ".impl .code-header",
+ {"color": |code_header_color|, "background-color": "rgba(0, 0, 0, 0)"},
+ ALL,
+ )),
+ ("goto", "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"),
+ ("assert-css", (
+ "#method\.must_use",
+ {"color": |color|, "background-color": |focus_background_color|},
+ ALL,
+ )),
+ ("goto", "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"),
+ // We select headings (h2, h3, h...).
+ ("assert-css", (".docblock > :not(p) > a", {"color": |headings_color|}, ALL)),
+ ],
)
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
-assert-css: (
- "#impl-Foo",
- {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
+call-function: (
+ "check-colors",
+ {
+ "theme": "ayu",
+ "color": "rgb(197, 197, 197)",
+ "code_header_color": "rgb(230, 225, 207)",
+ "focus_background_color": "rgba(255, 236, 164, 0.06)",
+ "headings_color": "rgb(57, 175, 215)",
+ },
)
-
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
-assert-css: (
- "#method\.must_use",
- {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"},
- ALL,
+call-function: (
+ "check-colors",
+ {
+ "theme": "dark",
+ "color": "rgb(221, 221, 221)",
+ "code_header_color": "rgb(221, 221, 221)",
+ "focus_background_color": "rgb(73, 74, 61)",
+ "headings_color": "rgb(210, 153, 29)",
+ },
)
-
-goto: file://|DOC_PATH|/test_docs/index.html
-assert-css: (".small-section-header a", {"color": "rgb(197, 197, 197)"}, ALL)
-
-goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
-// We select headings (h2, h3, h...).
-assert-css: (".docblock > :not(p) > a", {"color": "rgb(57, 175, 215)"}, ALL)
-
-// Dark theme
-local-storage: {
- "rustdoc-theme": "dark",
- "rustdoc-preferred-dark-theme": "dark",
- "rustdoc-use-system-theme": "false",
-}
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html
-
-assert-css: (
- ".impl",
- {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
- ALL,
-)
-assert-css: (
- ".impl .code-header",
- {"color": "rgb(221, 221, 221)", "background-color": "rgb(53, 53, 53)"},
- ALL,
-)
-
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
-assert-css: (
- "#impl-Foo",
- {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
-)
-
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
-assert-css: (
- "#method\.must_use",
- {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"},
- ALL,
+call-function: (
+ "check-colors",
+ {
+ "theme": "light",
+ "color": "rgb(0, 0, 0)",
+ "code_header_color": "rgb(0, 0, 0)",
+ "focus_background_color": "rgb(253, 255, 211)",
+ "headings_color": "rgb(56, 115, 173)",
+ },
)
-
-goto: file://|DOC_PATH|/test_docs/index.html
-assert-css: (".small-section-header a", {"color": "rgb(221, 221, 221)"}, ALL)
-
-goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
-// We select headings (h2, h3, h...).
-assert-css: (".docblock > :not(p) > a", {"color": "rgb(210, 153, 29)"}, ALL)
-
-// Light theme
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
-reload:
-
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html
-
-assert-css: (
- ".impl",
- {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
- ALL,
-)
-assert-css: (
- ".impl .code-header",
- {"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
- ALL,
-)
-
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html#impl-Foo
-assert-css: ("#impl-Foo", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"})
-
-goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use
-assert-css: (
- "#method\.must_use",
- {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"},
- ALL,
-)
-
-goto: file://|DOC_PATH|/test_docs/index.html
-assert-css: (".small-section-header a", {"color": "rgb(0, 0, 0)"}, ALL)
-
-goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
-// We select headings (h2, h3, h...).
-assert-css: (".docblock > :not(p) > a", {"color": "rgb(56, 115, 173)"}, ALL)
diff --git a/src/test/rustdoc-gui/headings.goml b/src/test/rustdoc-gui/headings.goml
index 8c2c3df15..85e17ca95 100644
--- a/src/test/rustdoc-gui/headings.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
assert-css: ("h1.fqn", {"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
+goto: "file://" + |DOC_PATH| + "/test_docs/enum.HeavilyDocumentedEnum.html"
assert-css: ("h1.fqn", {"font-size": "24px"})
@@ -106,10 +106,10 @@ assert-css: ("h6#sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0
assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"font-size": "14px"})
assert-css: ("h6#sub-sub-heading-for-enum-impl-item-doc", {"border-bottom-width": "0px"})
-assert-text: (".sidebar .mod h3", "Modules")
-assert-css: (".sidebar .mod h3", {"border-bottom-width": "0px"}, ALL)
+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
+goto: "file://" + |DOC_PATH| + "/test_docs/union.HeavilyDocumentedUnion.html"
assert-css: ("h1.fqn", {"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
+goto: "file://" + |DOC_PATH| + "/test_docs/macro.heavily_documented_macro.html"
assert-css: ("h1.fqn", {"font-size": "24px"})
@@ -150,109 +150,85 @@ assert-css: ("h2#top-doc-prose-title", {"border-bottom-width": "1px"})
assert-css: ("h3#top-doc-prose-sub-heading", {"font-size": "20px"})
assert-css: ("h3#top-doc-prose-sub-heading", {"border-bottom-width": "1px"})
-// Checking colors now.
+// Needed to check colors
show-text: true
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
-goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html
-assert-css: (
- ".top-doc .docblock h2",
- {"color": "rgb(0, 0, 0)", "border-bottom": "1px solid rgb(221, 221, 221)"},
-)
-assert-css: (
- ".top-doc .docblock h3",
- {"color": "rgb(0, 0, 0)", "border-bottom": "1px solid rgb(221, 221, 221)"},
-)
-assert-css: (
- ".top-doc .docblock h4",
- {"color": "rgb(0, 0, 0)", "border-bottom": "1px solid rgb(221, 221, 221)"},
-)
-assert-css: (
- ".top-doc .docblock h5",
- {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
-)
-assert-css: (
- "#implementations-list .docblock h4",
- {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
-)
-assert-css: (
- "#implementations-list .docblock h5",
- {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
-)
-assert-css: (
- "#implementations-list .docblock h6",
- {"color": "rgb(0, 0, 0)", "border-bottom": "0px none rgb(221, 221, 221)"},
-)
-
-local-storage: {"rustdoc-theme": "dark"}
-reload:
-assert-css: (
- ".top-doc .docblock h2",
- {"color": "rgb(221, 221, 221)", "border-bottom": "1px solid rgb(210, 210, 210)"},
-)
-assert-css: (
- ".top-doc .docblock h3",
- {"color": "rgb(221, 221, 221)", "border-bottom": "1px solid rgb(210, 210, 210)"},
-)
-assert-css: (
- ".top-doc .docblock h4",
- {"color": "rgb(221, 221, 221)", "border-bottom": "1px solid rgb(210, 210, 210)"},
-)
-assert-css: (
- ".top-doc .docblock h5",
- {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
-)
-assert-css: (
- "#implementations-list .docblock h4",
- {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
-)
-assert-css: (
- "#implementations-list .docblock h5",
- {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
-)
-assert-css: (
- "#implementations-list .docblock h6",
- {"color": "rgb(221, 221, 221)", "border-bottom": "0px none rgb(210, 210, 210)"},
-)
-
-local-storage: {"rustdoc-theme": "ayu"}
-reload:
-assert-css: (
- ".top-doc .docblock h2",
- {"color": "rgb(255, 255, 255)", "border-bottom": "1px solid rgb(92, 103, 115)"},
-)
-assert-css: (
- ".top-doc .docblock h2",
- {"color": "rgb(255, 255, 255)", "border-bottom": "1px solid rgb(92, 103, 115)"},
-)
-assert-css: (
- ".top-doc .docblock h4",
- {"color": "rgb(255, 255, 255)", "border-bottom": "1px solid rgb(92, 103, 115)"},
-)
-assert-css: (
- ".top-doc .docblock h5",
- {"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
-)
-assert-css: (
- "#implementations-list .docblock h4",
- {"color": "rgb(255, 255, 255)", "border-bottom": "0px none rgb(92, 103, 115)"},
-)
-assert-css: (
- "#implementations-list .docblock h5",
- {"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
-)
-assert-css: (
- "#implementations-list .docblock h6",
- {"color": "rgb(197, 197, 197)", "border-bottom": "0px none rgb(92, 103, 115)"},
-)
-
-local-storage: {"rustdoc-theme": "light"}
-goto: file://|DOC_PATH|/staged_api/struct.Foo.html
-assert-css: (".since", {"color": "rgb(128, 128, 128)"})
-
-local-storage: {"rustdoc-theme": "dark"}
-reload:
-assert-css: (".since", {"color": "rgb(128, 128, 128)"})
-
-local-storage: {"rustdoc-theme": "ayu"}
-reload:
-assert-css: (".since", {"color": "rgb(128, 128, 128)"})
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
+
+define-function: (
+ "check-colors",
+ (theme, heading_color, small_heading_color, heading_border_color),
+ [
+ ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
+ ("reload"),
+ ("assert-css", (
+ ".top-doc .docblock h2",
+ {"color": |heading_color|, "border-bottom": "1px solid " + |heading_border_color|},
+ )),
+ ("assert-css", (
+ ".top-doc .docblock h3",
+ {"color": |heading_color|, "border-bottom": "1px solid " + |heading_border_color|},
+ )),
+ ("assert-css", (
+ ".top-doc .docblock h4",
+ {"color": |heading_color|, "border-bottom": "1px solid " + |heading_border_color|},
+ )),
+ ("assert-css", (
+ ".top-doc .docblock h5",
+ {"color": |small_heading_color|, "border-bottom-width": "0px"},
+ )),
+ ("assert-css", (
+ "#implementations-list .docblock h4",
+ {"color": |heading_color|, "border-bottom-width": "0px"},
+ )),
+ ("assert-css", (
+ "#implementations-list .docblock h5",
+ {"color": |small_heading_color|, "border-bottom-width": "0px"},
+ )),
+ ("assert-css", (
+ "#implementations-list .docblock h6",
+ {"color": |small_heading_color|, "border-bottom-width": "0px"},
+ )),
+ ],
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "ayu",
+ "heading_color": "rgb(255, 255, 255)",
+ "small_heading_color": "rgb(197, 197, 197)",
+ "heading_border_color": "rgb(92, 103, 115)",
+ },
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "dark",
+ "heading_color": "rgb(221, 221, 221)",
+ "small_heading_color": "rgb(221, 221, 221)",
+ "heading_border_color": "rgb(210, 210, 210)",
+ },
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "light",
+ "heading_color": "rgb(0, 0, 0)",
+ "small_heading_color": "rgb(0, 0, 0)",
+ "heading_border_color": "rgb(221, 221, 221)",
+ },
+)
+
+define-function: (
+ "check-since-color",
+ (theme),
+ [
+ ("local-storage", {"rustdoc-theme": |theme|}),
+ ("reload"),
+ ("assert-css", (".since", {"color": "rgb(128, 128, 128)"}, ALL)),
+ ],
+)
+
+goto: "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/src/test/rustdoc-gui/help-page.goml b/src/test/rustdoc-gui/help-page.goml
new file mode 100644
index 000000000..521e14748
--- /dev/null
+++ b/src/test/rustdoc-gui/help-page.goml
@@ -0,0 +1,24 @@
+// 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.
+wait-for: "#help"
+assert-css: ("#help", {"display": "block"})
+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.
+assert-css: ("#help", {"display": "block"})
+compare-elements-property: (".sub", "#help", ["offsetWidth"])
+compare-elements-position: (".sub", "#help", ("x"))
+
+// 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.
+assert-false: "#help"
+click: "#help-button > a"
+assert-css: ("#help", {"display": "block"})
+click: "#help-button > a"
+assert-css: ("#help", {"display": "none"})
+compare-elements-property-false: (".sub", "#help", ["offsetWidth"])
+compare-elements-position-false: (".sub", "#help", ("x"))
diff --git a/src/test/rustdoc-gui/highlight-colors.goml b/src/test/rustdoc-gui/highlight-colors.goml
new file mode 100644
index 000000000..51693314e
--- /dev/null
+++ b/src/test/rustdoc-gui/highlight-colors.goml
@@ -0,0 +1,94 @@
+// This test checks the highlight colors in the source code pages.
+goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+show-text: true
+
+define-function: (
+ "check-colors",
+ (
+ theme,
+ kw,
+ kw2,
+ prelude_ty,
+ prelude_val,
+ lifetime,
+ number,
+ string,
+ bool_val,
+ self,
+ attribute,
+ macro,
+ question_mark,
+ comment,
+ doc_comment,
+ ),
+ [
+ ("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)),
+ ("assert-css", ("pre.rust .prelude-ty", {"color": |prelude_ty|}, ALL)),
+ ("assert-css", ("pre.rust .prelude-val", {"color": |prelude_val|}, ALL)),
+ ("assert-css", ("pre.rust .lifetime", {"color": |lifetime|}, ALL)),
+ ("assert-css", ("pre.rust .number", {"color": |number|}, ALL)),
+ ("assert-css", ("pre.rust .string", {"color": |string|}, ALL)),
+ ("assert-css", ("pre.rust .bool-val", {"color": |bool_val|}, ALL)),
+ ("assert-css", ("pre.rust .self", {"color": |self|}, ALL)),
+ ("assert-css", ("pre.rust .attribute", {"color": |attribute|}, ALL)),
+ ("assert-css", ("pre.rust .macro", {"color": |macro|}, ALL)),
+ ("assert-css", ("pre.rust .question-mark", {"color": |question_mark|}, ALL)),
+ ("assert-css", ("pre.rust .comment", {"color": |comment|}, ALL)),
+ ("assert-css", ("pre.rust .doccomment", {"color": |doc_comment|}, ALL)),
+ ],
+)
+
+call-function: ("check-colors", {
+ "theme": "ayu",
+ "kw": "rgb(255, 119, 51)",
+ "kw2": "rgb(255, 119, 51)",
+ "prelude_ty": "rgb(105, 242, 223)",
+ "prelude_val": "rgb(255, 119, 51)",
+ "lifetime": "rgb(255, 119, 51)",
+ "number": "rgb(184, 204, 82)",
+ "string": "rgb(184, 204, 82)",
+ "bool_val": "rgb(255, 119, 51)",
+ "self": "rgb(54, 163, 217)",
+ "attribute": "rgb(230, 225, 207)",
+ "macro": "rgb(163, 122, 204)",
+ "question_mark": "rgb(255, 144, 17)",
+ "comment": "rgb(120, 135, 151)",
+ "doc_comment": "rgb(161, 172, 136)",
+})
+call-function: ("check-colors", {
+ "theme": "dark",
+ "kw": "rgb(171, 138, 193)",
+ "kw2": "rgb(118, 154, 203)",
+ "prelude_ty": "rgb(118, 154, 203)",
+ "prelude_val": "rgb(238, 104, 104)",
+ "lifetime": "rgb(217, 127, 38)",
+ "number": "rgb(131, 163, 0)",
+ "string": "rgb(131, 163, 0)",
+ "bool_val": "rgb(238, 104, 104)",
+ "self": "rgb(238, 104, 104)",
+ "attribute": "rgb(238, 104, 104)",
+ "macro": "rgb(62, 153, 159)",
+ "question_mark": "rgb(255, 144, 17)",
+ "comment": "rgb(141, 141, 139)",
+ "doc_comment": "rgb(140, 163, 117)",
+})
+call-function: ("check-colors", {
+ "theme": "light",
+ "kw": "rgb(137, 89, 168)",
+ "kw2": "rgb(66, 113, 174)",
+ "prelude_ty": "rgb(66, 113, 174)",
+ "prelude_val": "rgb(200, 40, 41)",
+ "lifetime": "rgb(183, 101, 20)",
+ "number": "rgb(113, 140, 0)",
+ "string": "rgb(113, 140, 0)",
+ "bool_val": "rgb(200, 40, 41)",
+ "self": "rgb(200, 40, 41)",
+ "attribute": "rgb(200, 40, 41)",
+ "macro": "rgb(62, 153, 159)",
+ "question_mark": "rgb(255, 144, 17)",
+ "comment": "rgb(142, 144, 140)",
+ "doc_comment": "rgb(77, 77, 76)",
+})
diff --git a/src/test/rustdoc-gui/huge-collection-of-constants.goml b/src/test/rustdoc-gui/huge-collection-of-constants.goml
index 4f75b5841..3ccd33f1c 100644
--- a/src/test/rustdoc-gui/huge-collection-of-constants.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/huge_amount_of_consts/index.html"
compare-elements-position-near-false: (
"//*[@class='item-table']//div[last()-1]",
diff --git a/src/test/rustdoc-gui/impl-default-expansion.goml b/src/test/rustdoc-gui/impl-default-expansion.goml
index 6df2661e6..c3f9240cc 100644
--- a/src/test/rustdoc-gui/impl-default-expansion.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-attribute: ("#implementations-list details.implementors-toggle", {"open": ""})
diff --git a/src/test/rustdoc-gui/implementors.goml b/src/test/rustdoc-gui/implementors.goml
index 666a6e125..4999283dc 100644
--- a/src/test/rustdoc-gui/implementors.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html"
assert: "#implementors-list"
// There are supposed to be two implementors listed.
assert-count: ("#implementors-list .impl", 2)
@@ -8,28 +8,28 @@ assert-count: ("#implementors-list .impl", 2)
assert: ("#implementors-list .impl:nth-child(1) > a.anchor")
assert-attribute: ("#implementors-list .impl:nth-child(1)", {"id": "impl-Whatever-for-Struct"})
assert-attribute: ("#implementors-list .impl:nth-child(1) > a.anchor", {"href": "#impl-Whatever-for-Struct"})
-assert: "#implementors-list .impl:nth-child(1) > .code-header.in-band"
+assert: "#implementors-list .impl:nth-child(1) > .code-header"
assert: ("#implementors-list .impl:nth-child(2) > a.anchor")
assert-attribute: ("#implementors-list .impl:nth-child(2)", {"id": "impl-Whatever-1"})
assert-attribute: ("#implementors-list .impl:nth-child(2) > a.anchor", {"href": "#impl-Whatever-1"})
-assert: "#implementors-list .impl:nth-child(2) > .code-header.in-band"
+assert: "#implementors-list .impl:nth-child(2) > .code-header"
-goto: file://|DOC_PATH|/test_docs/struct.HasEmptyTraits.html
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.HasEmptyTraits.html"
compare-elements-position-near-false: (
"#impl-EmptyTrait1-for-HasEmptyTraits",
"#impl-EmptyTrait2-for-HasEmptyTraits",
- {"y": 30},
+ {"y": 34},
)
compare-elements-position-near: (
"#impl-EmptyTrait3-for-HasEmptyTraits h3",
"#impl-EmptyTrait3-for-HasEmptyTraits .item-info",
- {"y": 30},
+ {"y": 34},
)
// 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
+goto: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html"
assert-count: ("#implementors-list .impl", 1)
-goto: file://|DOC_PATH|/implementors/trait.TraitToReexport.html
+goto: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html"
assert-count: ("#implementors-list .impl", 1)
diff --git a/src/test/rustdoc-gui/item-decl-colors.goml b/src/test/rustdoc-gui/item-decl-colors.goml
new file mode 100644
index 000000000..ce688287a
--- /dev/null
+++ b/src/test/rustdoc-gui/item-decl-colors.goml
@@ -0,0 +1,74 @@
+// This test ensures that the color of the items in the type decl are working as expected.
+define-function: (
+ "check-colors",
+ (
+ theme,
+ attr_color,
+ trait_color,
+ struct_color,
+ enum_color,
+ primitive_color,
+ constant_color,
+ fn_color,
+ assoc_type_color,
+ ),
+ [
+ ("goto", "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"),
+ ("show-text", true),
+ ("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)),
+ // We need to add `code` here because otherwise it would select the parent too.
+ ("assert-css", (".item-decl code .struct", {"color": |struct_color|}, ALL)),
+ ("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"),
+ ("assert-css", (".item-decl .constant", {"color": |constant_color|}, ALL)),
+ ("assert-css", (".item-decl .fnname", {"color": |fn_color|}, ALL)),
+ ("assert-css", (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL)),
+ ],
+)
+
+call-function: (
+ "check-colors",
+ {
+ "theme": "ayu",
+ "attr_color": "rgb(153, 153, 153)",
+ "trait_color": "rgb(57, 175, 215)",
+ "struct_color": "rgb(255, 160, 165)",
+ "enum_color": "rgb(255, 160, 165)",
+ "primitive_color": "rgb(255, 160, 165)",
+ "constant_color": "rgb(57, 175, 215)",
+ "fn_color": "rgb(253, 214, 135)",
+ "assoc_type_color": "rgb(57, 175, 215)",
+ },
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "dark",
+ "attr_color": "rgb(153, 153, 153)",
+ "trait_color": "rgb(183, 140, 242)",
+ "struct_color": "rgb(45, 191, 184)",
+ "enum_color": "rgb(45, 191, 184)",
+ "primitive_color": "rgb(45, 191, 184)",
+ "constant_color": "rgb(210, 153, 29)",
+ "fn_color": "rgb(43, 171, 99)",
+ "assoc_type_color": "rgb(210, 153, 29)",
+ },
+)
+call-function: (
+ "check-colors",
+ {
+ "theme": "light",
+ "attr_color": "rgb(153, 153, 153)",
+ "trait_color": "rgb(110, 79, 201)",
+ "struct_color": "rgb(173, 55, 138)",
+ "enum_color": "rgb(173, 55, 138)",
+ "primitive_color": "rgb(173, 55, 138)",
+ "constant_color": "rgb(56, 115, 173)",
+ "fn_color": "rgb(173, 124, 55)",
+ "assoc_type_color": "rgb(56, 115, 173)",
+ },
+)
diff --git a/src/test/rustdoc-gui/item-info-alignment.goml b/src/test/rustdoc-gui/item-info-alignment.goml
new file mode 100644
index 000000000..94b52f005
--- /dev/null
+++ b/src/test/rustdoc-gui/item-info-alignment.goml
@@ -0,0 +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"
+
+// First, we try it in "desktop" mode.
+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)
+compare-elements-position: (".impl-items > .item-info", "summary > .item-info", ("x"))
diff --git a/src/test/rustdoc-gui/item-info-overflow.goml b/src/test/rustdoc-gui/item-info-overflow.goml
index b7095a3c5..8ea14621c 100644
--- a/src/test/rustdoc-gui/item-info-overflow.goml
+++ b/src/test/rustdoc-gui/item-info-overflow.goml
@@ -1,10 +1,10 @@
// This test ensures that the "item-info" elements don't overflow.
-goto: file://|DOC_PATH|/lib2/struct.LongItemInfo.html
+goto: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo.html"
// We set a fixed size so there is no chance of "random" resize.
size: (1200, 870)
// Logically, the "item-decl" and the "item-info" should have the same scroll width.
-compare-elements-property: (".docblock.item-decl", ".item-info", ["scrollWidth"])
-assert-property: (".item-info", {"scrollWidth": "890"})
+compare-elements-property: (".item-decl", ".item-info", ["scrollWidth"])
+assert-property: (".item-info", {"scrollWidth": "940"})
// Just to be sure we're comparing the correct "item-info":
assert-text: (
".item-info",
@@ -13,7 +13,7 @@ assert-text: (
)
// Checking the "item-info" on an impl block as well:
-goto: file://|DOC_PATH|/lib2/struct.LongItemInfo2.html
+goto: "file://" + |DOC_PATH| + "/lib2/struct.LongItemInfo2.html"
compare-elements-property: (
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
"#impl-SimpleTrait-for-LongItemInfo2 + .docblock",
@@ -21,7 +21,7 @@ compare-elements-property: (
)
assert-property: (
"#impl-SimpleTrait-for-LongItemInfo2 .item-info",
- {"scrollWidth": "866"},
+ {"scrollWidth": "916"},
)
// Just to be sure we're comparing the correct "item-info":
assert-text: (
diff --git a/src/test/rustdoc-gui/item-info.goml b/src/test/rustdoc-gui/item-info.goml
index 50c45b76b..6780dfca6 100644
--- a/src/test/rustdoc-gui/item-info.goml
+++ b/src/test/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
+goto: "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)
// We check that ".item-info" is bigger than its content.
-assert-css: (".item-info", {"width": "790px"})
+assert-css: (".item-info", {"width": "840px"})
assert-css: (".item-info .stab", {"width": "289px"})
-assert-position: (".item-info .stab", {"x": 295})
+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
+goto: "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/src/test/rustdoc-gui/item-summary-table.goml b/src/test/rustdoc-gui/item-summary-table.goml
index 6bf4e288c..2a92e9da5 100644
--- a/src/test/rustdoc-gui/item-summary-table.goml
+++ b/src/test/rustdoc-gui/item-summary-table.goml
@@ -1,6 +1,6 @@
// This test ensures that <table> elements aren't display in items summary.
-goto: file://|DOC_PATH|/lib2/summary_table/index.html
+goto: "file://" + |DOC_PATH| + "/lib2/summary_table/index.html"
// We check that we picked the right item first.
assert-text: (".item-table .item-left", "Foo")
// Then we check that its summary is empty.
-assert-text: (".item-table .item-right", "")
+assert-false: ".item-table .item-right"
diff --git a/src/test/rustdoc-gui/javascript-disabled.goml b/src/test/rustdoc-gui/javascript-disabled.goml
index 1693f7b64..edf179d0d 100644
--- a/src/test/rustdoc-gui/javascript-disabled.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-css: (".sub", {"display": "none"})
diff --git a/src/test/rustdoc-gui/jump-to-def-background.goml b/src/test/rustdoc-gui/jump-to-def-background.goml
index d17400f5b..b65faf13d 100644
--- a/src/test/rustdoc-gui/jump-to-def-background.goml
+++ b/src/test/rustdoc-gui/jump-to-def-background.goml
@@ -1,43 +1,22 @@
// 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
+goto: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
-// Set the theme to dark.
-local-storage: {
- "rustdoc-theme": "dark",
- "rustdoc-preferred-dark-theme": "dark",
- "rustdoc-use-system-theme": "false",
-}
-// We reload the page so the local storage settings are being used.
-reload:
-
-assert-css: (
- "body.source .example-wrap pre.rust a",
- {"background-color": "rgb(51, 51, 51)"},
- ALL,
-)
-
-// Set the theme to ayu.
-local-storage: {
- "rustdoc-theme": "ayu",
- "rustdoc-preferred-dark-theme": "ayu",
- "rustdoc-use-system-theme": "false",
-}
-// We reload the page so the local storage settings are being used.
-reload:
-
-assert-css: (
- "body.source .example-wrap pre.rust a",
- {"background-color": "rgb(51, 51, 51)"},
- ALL,
+define-function: (
+ "check-background-color",
+ (theme, background_color),
+ [
+ // Set the theme.
+ ("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", (
+ "body.source .example-wrap pre.rust a",
+ {"background-color": |background_color|},
+ ALL,
+ )),
+ ],
)
-// Set the theme to light.
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
-// We reload the page so the local storage settings are being used.
-reload:
-
-assert-css: (
- "body.source .example-wrap pre.rust a",
- {"background-color": "rgb(238, 238, 238)"},
- ALL,
-)
+call-function: ("check-background-color", ("ayu", "rgb(51, 51, 51)"))
+call-function: ("check-background-color", ("dark", "rgb(51, 51, 51)"))
+call-function: ("check-background-color", ("light", "rgb(238, 238, 238)"))
diff --git a/src/test/rustdoc-gui/label-next-to-symbol.goml b/src/test/rustdoc-gui/label-next-to-symbol.goml
index ca3994a08..05f8ddc71 100644
--- a/src/test/rustdoc-gui/label-next-to-symbol.goml
+++ b/src/test/rustdoc-gui/label-next-to-symbol.goml
@@ -1,20 +1,20 @@
// 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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Desktop view
size: (1080, 600)
assert: (".stab.deprecated")
assert: (".stab.portability")
-// make sure that deprecated and portability are different colours
+// make sure that deprecated and portability have the right colors
assert-css: (
".item-table .item-left .stab.deprecated",
- { "background-color": "rgb(255, 196, 196)" },
+ { "background-color": "rgb(255, 245, 214)" },
)
assert-css: (
".item-table .item-left .stab.portability",
- { "background-color": "rgb(243, 223, 255)" },
+ { "background-color": "rgb(255, 245, 214)" },
)
// table like view
@@ -31,15 +31,9 @@ compare-elements-position: (
)
// Ensure no wrap
-compare-elements-position-near: (
- "//*[@class='item-left module-item']//a[text()='replaced_function']",
- "//*[@class='item-right docblock-short']//p[text()='a thing with a label']",
- {"y": 2},
-)
-// compare parent elements
compare-elements-position: (
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
- "//*[@class='item-right docblock-short']//p[text()='a thing with a label']/..",
+ "//*[@class='item-right docblock-short'][text()='a thing with a label']",
("y"),
)
@@ -51,7 +45,7 @@ assert-css: (".item-right.docblock-short", { "padding-left": "32px" })
compare-elements-position-near: (
"//*[@class='item-left module-item']//a[text()='replaced_function']",
".item-left .stab.deprecated",
- {"y": 1},
+ {"y": 2},
)
compare-elements-position: (
".item-left .stab.deprecated",
@@ -60,19 +54,13 @@ compare-elements-position: (
)
// Ensure wrap
-compare-elements-position-near-false: (
- "//*[@class='item-left module-item']//a[text()='replaced_function']",
- "//*[@class='item-right docblock-short']//p[text()='a thing with a label']",
- {"y": 12},
-)
-// compare parent elements
compare-elements-position-false: (
"//*[@class='item-left module-item']//a[text()='replaced_function']/..",
- "//*[@class='item-right docblock-short']//p[text()='a thing with a label']/..",
+ "//*[@class='item-right docblock-short'][text()='a thing with a label']",
("y"),
)
compare-elements-position-false: (
".item-left .stab.deprecated",
- "//*[@class='item-right docblock-short']//p[text()='a thing with a label']",
+ "//*[@class='item-right docblock-short'][text()='a thing with a label']",
("y"),
)
diff --git a/src/test/rustdoc-gui/links-color.goml b/src/test/rustdoc-gui/links-color.goml
new file mode 100644
index 000000000..839629ad9
--- /dev/null
+++ b/src/test/rustdoc-gui/links-color.goml
@@ -0,0 +1,85 @@
+// This test checks links colors.
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+
+// This is needed so that the text color is computed.
+show-text: true
+
+// Ayu theme
+local-storage: {
+ "rustdoc-theme": "ayu",
+ "rustdoc-use-system-theme": "false",
+}
+reload:
+
+assert-css: (".item-table .mod", {"color": "rgb(57, 175, 215)"}, ALL)
+assert-css: (".item-table .macro", {"color": "rgb(163, 122, 204)"}, ALL)
+assert-css: (".item-table .struct", {"color": "rgb(255, 160, 165)"}, ALL)
+assert-css: (".item-table .enum", {"color": "rgb(255, 160, 165)"}, ALL)
+assert-css: (".item-table .trait", {"color": "rgb(57, 175, 215)"}, ALL)
+assert-css: (".item-table .fn", {"color": "rgb(253, 214, 135)"}, ALL)
+assert-css: (".item-table .type", {"color": "rgb(255, 160, 165)"}, ALL)
+assert-css: (".item-table .union", {"color": "rgb(255, 160, 165)"}, ALL)
+assert-css: (".item-table .keyword", {"color": "rgb(57, 175, 215)"}, ALL)
+
+assert-css: (
+ ".sidebar-elems a:not(.current)",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
+ ALL,
+)
+assert-css: (
+ ".sidebar-elems a.current",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "500"},
+ ALL,
+)
+
+
+// Dark theme
+local-storage: {"rustdoc-theme": "dark"}
+reload:
+
+assert-css: (".item-table .mod", {"color": "rgb(210, 153, 29)"}, ALL)
+assert-css: (".item-table .macro", {"color": "rgb(9, 189, 0)"}, ALL)
+assert-css: (".item-table .struct", {"color": "rgb(45, 191, 184)"}, ALL)
+assert-css: (".item-table .enum", {"color": "rgb(45, 191, 184)"}, ALL)
+assert-css: (".item-table .trait", {"color": "rgb(183, 140, 242)"}, ALL)
+assert-css: (".item-table .fn", {"color": "rgb(43, 171, 99)"}, ALL)
+assert-css: (".item-table .type", {"color": "rgb(45, 191, 184)"}, ALL)
+assert-css: (".item-table .union", {"color": "rgb(45, 191, 184)"}, ALL)
+assert-css: (".item-table .keyword", {"color": "rgb(210, 153, 29)"}, ALL)
+
+assert-css: (
+ ".sidebar-elems a:not(.current)",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
+ ALL,
+)
+assert-css: (
+ ".sidebar-elems a.current",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)", "font-weight": "500"},
+ ALL,
+)
+
+
+// Light theme
+local-storage: {"rustdoc-theme": "light"}
+reload:
+
+assert-css: (".item-table .mod", {"color": "rgb(56, 115, 173)"}, ALL)
+assert-css: (".item-table .macro", {"color": "rgb(6, 128, 0)"}, ALL)
+assert-css: (".item-table .struct", {"color": "rgb(173, 55, 138)"}, ALL)
+assert-css: (".item-table .enum", {"color": "rgb(173, 55, 138)"}, ALL)
+assert-css: (".item-table .trait", {"color": "rgb(110, 79, 201)"}, ALL)
+assert-css: (".item-table .fn", {"color": "rgb(173, 124, 55)"}, ALL)
+assert-css: (".item-table .type", {"color": "rgb(173, 55, 138)"}, ALL)
+assert-css: (".item-table .union", {"color": "rgb(173, 55, 138)"}, ALL)
+assert-css: (".item-table .keyword", {"color": "rgb(56, 115, 173)"}, ALL)
+
+assert-css: (
+ ".sidebar-elems a:not(.current)",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
+ ALL,
+)
+assert-css: (
+ ".sidebar-elems a.current",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)", "font-weight": "500"},
+ ALL,
+)
diff --git a/src/test/rustdoc-gui/list_code_block.goml b/src/test/rustdoc-gui/list_code_block.goml
index eba1a662b..3423a449d 100644
--- a/src/test/rustdoc-gui/list_code_block.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+goto: "./fn.check_list_code_block.html"
assert: ("pre.rust.fn")
diff --git a/src/test/rustdoc-gui/mobile.goml b/src/test/rustdoc-gui/mobile.goml
index 13b9b563d..704542a39 100644
--- a/src/test/rustdoc-gui/mobile.goml
+++ b/src/test/rustdoc-gui/mobile.goml
@@ -1,5 +1,5 @@
// Test various properties of the mobile UI
-goto: file://|DOC_PATH|/staged_api/struct.Foo.html
+goto: "file://" + |DOC_PATH| + "/staged_api/struct.Foo.html"
size: (400, 600)
font-size: 18
@@ -12,7 +12,7 @@ assert-css: (".main-heading", {
"flex-direction": "column"
})
-assert-property: (".mobile-topbar h2.location", {"offsetHeight": 36})
+assert-property: (".mobile-topbar h2", {"offsetHeight": 36})
// Note: We can't use assert-text here because the 'Since' is set by CSS and
// is therefore not part of the DOM.
@@ -24,7 +24,7 @@ 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
+goto: "file://" + |DOC_PATH| + "/settings.html"
size: (400, 600)
// Ignored for now https://github.com/rust-lang/rust/issues/93784.
// compare-elements-position-near-false: ("#preferred-light-theme .setting-name", "#preferred-light-theme .choice", {"y": 16})
diff --git a/src/test/rustdoc-gui/module-items-font.goml b/src/test/rustdoc-gui/module-items-font.goml
index 758ee391a..cd3676a98 100644
--- a/src/test/rustdoc-gui/module-items-font.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-css: (
".item-table .module-item a",
{"font-family": '"Fira Sans", Arial, NanumBarunGothic, sans-serif'},
diff --git a/src/test/rustdoc-gui/no-docblock.goml b/src/test/rustdoc-gui/no-docblock.goml
new file mode 100644
index 000000000..2366a60f5
--- /dev/null
+++ b/src/test/rustdoc-gui/no-docblock.goml
@@ -0,0 +1,8 @@
+// This test checks that there are margins applied to methods with no docblocks.
+goto: "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"
+// 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/src/test/rustdoc-gui/notable-trait.goml b/src/test/rustdoc-gui/notable-trait.goml
new file mode 100644
index 000000000..efe0cb15f
--- /dev/null
+++ b/src/test/rustdoc-gui/notable-trait.goml
@@ -0,0 +1,128 @@
+// This test checks the position of the `i` for the notable traits.
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.NotableStructWithLongName.html"
+show-text: true
+// We start with a wide screen.
+size: (1100, 600)
+// Checking they have the same y position.
+compare-elements-position: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ ("y"),
+)
+// Checking they don't have the same x position.
+compare-elements-position-false: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ ("x"),
+)
+// The `i` should be *after* the type.
+assert-position: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ {"x": 677},
+)
+assert-position: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ {"x": 951},
+)
+// The tooltip should be beside the `i`
+click: "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']"
+compare-elements-position-near: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
+ {"y": 2}
+)
+compare-elements-position-false: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
+ ("x")
+)
+// The docblock should be flush with the border.
+assert-css: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
+ {"margin-left": "0px"}
+)
+
+// Now only the `i` should be on the next line.
+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='notable-traits']",
+ ("y", "x"),
+)
+
+// Now both the `i` and the struct name should be on the next line.
+size: (980, 600)
+// Checking they have the same y position.
+compare-elements-position: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ ("y"),
+)
+// Checking they don't have the same x position.
+compare-elements-position-false: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ ("x"),
+)
+// The `i` should be *after* the type.
+assert-position: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ {"x": 245},
+)
+assert-position: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ {"x": 519},
+)
+
+// Checking on mobile now.
+size: (650, 600)
+// Checking they have the same y position.
+compare-elements-position: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ ("y"),
+)
+// Checking they don't have the same x position.
+compare-elements-position-false: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ ("x"),
+)
+// The `i` should be *after* the type.
+assert-position: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ {"x": 15},
+)
+assert-position: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ {"x": 289},
+)
+// The tooltip should be below `i`
+compare-elements-position-near-false: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
+ {"y": 2}
+)
+compare-elements-position-false: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
+ ("x")
+)
+compare-elements-position-near: (
+ "//*[@id='method.create_an_iterator_from_read']/parent::*",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']",
+ {"x": 5}
+)
+// The docblock should be flush with the border.
+assert-css: (
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits-tooltiptext force-tooltip']/*[@class='docblock']",
+ {"margin-left": "0px"}
+)
+
+// Checking on very small mobile. The `i` should be on its own line.
+size: (365, 600)
+compare-elements-position-false: (
+ "//*[@id='method.create_an_iterator_from_read']//a[text()='NotableStructWithLongName']",
+ "//*[@id='method.create_an_iterator_from_read']//*[@class='notable-traits']",
+ ("y", "x"),
+)
diff --git a/src/test/rustdoc-gui/overflow-tooltip-information.goml b/src/test/rustdoc-gui/overflow-tooltip-information.goml
index 7ef85a4c4..09ad6cdd7 100644
--- a/src/test/rustdoc-gui/overflow-tooltip-information.goml
+++ b/src/test/rustdoc-gui/overflow-tooltip-information.goml
@@ -1,8 +1,8 @@
// 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
-assert-css: (".docblock > .information", {
+goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
+assert-css: (".docblock > .example-wrap .tooltip", {
"overflow-x": "visible",
"max-width": "none"
}, ALL)
diff --git a/src/test/rustdoc-gui/pocket-menu.goml b/src/test/rustdoc-gui/pocket-menu.goml
index 54f3790a7..fb63ea62a 100644
--- a/src/test/rustdoc-gui/pocket-menu.goml
+++ b/src/test/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
+goto: "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.
@@ -56,7 +56,7 @@ reload:
click: "#help-button"
assert-css: (
"#help-button .popover",
- {"display": "block", "border-color": "rgb(210, 210, 210)"},
+ {"display": "block", "border-color": "rgb(224, 224, 224)"},
)
compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
@@ -71,7 +71,7 @@ reload:
click: "#help-button"
assert-css: (
"#help-button .popover",
- {"display": "block", "border-color": "rgb(221, 221, 221)"},
+ {"display": "block", "border-color": "rgb(224, 224, 224)"},
)
compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
diff --git a/src/test/rustdoc-gui/run-on-hover.goml b/src/test/rustdoc-gui/run-on-hover.goml
index b8efa8e30..6c785e1c4 100644
--- a/src/test/rustdoc-gui/run-on-hover.goml
+++ b/src/test/rustdoc-gui/run-on-hover.goml
@@ -1,7 +1,7 @@
// Example code blocks sometimes have a "Run" button to run them on the
// 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.
-goto: file://|DOC_PATH|/test_docs/fn.foo.html
+goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
assert-css: (".test-arrow", {"visibility": "hidden"})
move-cursor-to: ".example-wrap"
assert-css: (".test-arrow", {"visibility": "visible"})
diff --git a/src/test/rustdoc-gui/rust-logo.goml b/src/test/rustdoc-gui/rust-logo.goml
index 4a9dcf735..6c8dc8594 100644
--- a/src/test/rustdoc-gui/rust-logo.goml
+++ b/src/test/rustdoc-gui/rust-logo.goml
@@ -1,78 +1,34 @@
// This test ensures that the correct style is applied to the rust logo in the sidebar.
-goto: file://|DOC_PATH|/test_docs/index.html
-
-// First we start with the dark theme.
-local-storage: {
- "rustdoc-theme": "dark",
- "rustdoc-preferred-dark-theme": "dark",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".rust-logo",
- {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
-)
-
-// In the source view page now.
-goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
-
-local-storage: {
- "rustdoc-theme": "dark",
- "rustdoc-preferred-dark-theme": "dark",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".rust-logo",
- {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
-)
-
-// Then with the ayu theme.
-local-storage: {
- "rustdoc-theme": "ayu",
- "rustdoc-preferred-dark-theme": "ayu",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".rust-logo",
- {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+
+define-function: (
+ "check-logo",
+ (theme, filter),
+ [
+ // Going to the doc page.
+ ("goto", "file://" + |DOC_PATH| + "/test_docs/index.html"),
+ // Changing theme.
+ ("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"),
+ // Changing theme (since it's local files, the local storage works by folder).
+ ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
+ ("reload"),
+ ("assert-css", (".rust-logo", {"filter": |filter|})),
+ ],
)
-// In the source view page now.
-goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
-
-local-storage: {
- "rustdoc-theme": "ayu",
- "rustdoc-preferred-dark-theme": "ayu",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".rust-logo",
- {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"},
+call-function: (
+ "check-logo",
+ ("ayu", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"),
)
-
-// And finally with the light theme.
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
-reload:
-
-assert-css: (
- ".rust-logo",
- {"filter": "none"},
+call-function: (
+ "check-logo",
+ ("dark", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"),
)
-
-// In the source view page now.
-goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
-
-local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
-reload:
-
-assert-css: (
- ".rust-logo",
- {"filter": "none"},
+call-function: (
+ "check-logo",
+ ("light", "none"),
)
diff --git a/src/test/rustdoc-gui/search-filter.goml b/src/test/rustdoc-gui/search-filter.goml
index d645e2370..27db816e6 100644
--- a/src/test/rustdoc-gui/search-filter.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true
write: (".search-input", "test")
// To be SURE that the search will be run.
@@ -40,16 +40,16 @@ press-key: "ArrowUp"
press-key: "Enter"
// Waiting for the search results to appear...
wait-for: "#titles"
-assert-property: ("#crate-search", {"value": "All crates"})
+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
+goto: "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"
-// Checking that the text for the "title" is correct (the "All" comes from the "<select>").
-assert-text: ("#search-settings", "Results for test in All", STARTS_WITH)
+// Checking that the text for the "title" is correct (the "all crates" comes from the "<select>").
+assert-text: (".search-results-title", "Results in all crates", STARTS_WITH)
// Checking the display of the crate filter.
// We start with the light theme.
@@ -69,15 +69,15 @@ click: "#settings-menu"
wait-for: "#settings"
click: "#theme-dark"
wait-for-css: ("#crate-search", {
- "border": "1px solid rgb(240, 240, 240)",
- "color": "rgb(17, 17, 17)",
- "background-color": "rgb(240, 240, 240)",
+ "border": "1px solid rgb(224, 224, 224)",
+ "color": "rgb(221, 221, 221)",
+ "background-color": "rgb(53, 53, 53)",
})
// And finally we check the ayu theme.
click: "#theme-ayu"
wait-for-css: ("#crate-search", {
- "border": "1px solid rgb(66, 76, 87)",
- "color": "rgb(197, 197, 197)",
- "background-color": "rgb(20, 25, 32)",
+ "border": "1px solid rgb(92, 103, 115)",
+ "color": "rgb(255, 255, 255)",
+ "background-color": "rgb(15, 20, 25)",
})
diff --git a/src/test/rustdoc-gui/search-form-elements.goml b/src/test/rustdoc-gui/search-form-elements.goml
new file mode 100644
index 000000000..542db348c
--- /dev/null
+++ b/src/test/rustdoc-gui/search-form-elements.goml
@@ -0,0 +1,263 @@
+// This test ensures that the elements in ".search-form" have the expected display.
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+show-text: true
+
+// Ayu theme
+local-storage: {
+ "rustdoc-theme": "ayu",
+ "rustdoc-use-system-theme": "false",
+}
+reload:
+
+assert-css: (
+ ".search-input",
+ {
+ "border-color": "rgb(92, 103, 115)",
+ "background-color": "rgb(20, 25, 32)",
+ "color": "rgb(255, 255, 255)",
+ },
+)
+focus: ".search-input"
+// Nothing should change.
+assert-css: (
+ ".search-input",
+ {
+ "border-color": "rgb(92, 103, 115)",
+ "background-color": "rgb(20, 25, 32)",
+ "color": "rgb(255, 255, 255)",
+ },
+)
+
+assert-css: (
+ "#help-button",
+ {"border-color": "rgb(197, 197, 197)"},
+)
+assert-css: (
+ "#help-button > a",
+ {
+ "color": "rgb(255, 255, 255)",
+ "border-color": "rgb(92, 103, 115)",
+ "background-color": "rgb(20, 25, 32)",
+ },
+)
+move-cursor-to: "#help-button"
+assert-css: (
+ "#help-button:hover",
+ {"border-color": "rgb(197, 197, 197)"},
+)
+// Only "border-color" should change.
+assert-css: (
+ "#help-button:hover > a",
+ {
+ "color": "rgb(255, 255, 255)",
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(20, 25, 32)",
+ },
+)
+// Link color inside
+click: "#help-button"
+assert-css: (
+ "#help a",
+ {
+ "color": "rgb(57, 175, 215)",
+ },
+)
+
+assert-css: (
+ "#settings-menu",
+ {"border-color": "rgb(197, 197, 197)"},
+)
+assert-css: (
+ "#settings-menu > a",
+ {
+ "border-color": "rgb(92, 103, 115)",
+ "background-color": "rgb(20, 25, 32)",
+ },
+)
+move-cursor-to: "#settings-menu"
+assert-css: (
+ "#settings-menu:hover",
+ {"border-color": "rgb(197, 197, 197)"},
+)
+// Only "border-color" should change.
+assert-css: (
+ "#settings-menu:hover > a",
+ {
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(20, 25, 32)",
+ },
+)
+
+// Dark theme
+local-storage: {
+ "rustdoc-theme": "dark",
+ "rustdoc-use-system-theme": "false",
+}
+reload:
+
+assert-css: (
+ ".search-input",
+ {
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(240, 240, 240)",
+ "color": "rgb(17, 17, 17)",
+ },
+)
+focus: ".search-input"
+// Only "border-color" should change.
+assert-css: (
+ ".search-input",
+ {
+ "border-color": "rgb(0, 141, 253)",
+ "background-color": "rgb(240, 240, 240)",
+ "color": "rgb(17, 17, 17)",
+ },
+)
+
+assert-css: (
+ "#help-button",
+ {"border-color": "rgb(221, 221, 221)"},
+)
+assert-css: (
+ "#help-button > a",
+ {
+ "color": "rgb(0, 0, 0)",
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(240, 240, 240)",
+ },
+)
+move-cursor-to: "#help-button"
+assert-css: (
+ "#help-button:hover",
+ {"border-color": "rgb(221, 221, 221)"},
+)
+// Only "border-color" should change.
+assert-css: (
+ "#help-button:hover > a",
+ {
+ "color": "rgb(0, 0, 0)",
+ "border-color": "rgb(255, 185, 0)",
+ "background-color": "rgb(240, 240, 240)",
+ },
+)
+// Link color inside
+click: "#help-button"
+assert-css: (
+ "#help a",
+ {
+ "color": "rgb(210, 153, 29)",
+ },
+)
+
+assert-css: (
+ "#settings-menu",
+ {"border-color": "rgb(221, 221, 221)"},
+)
+assert-css: (
+ "#settings-menu > a",
+ {
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(240, 240, 240)",
+ },
+)
+move-cursor-to: "#settings-menu"
+assert-css: (
+ "#settings-menu:hover",
+ {"border-color": "rgb(221, 221, 221)"},
+)
+// Only "border-color" should change.
+assert-css: (
+ "#settings-menu:hover > a",
+ {
+ "color": "rgb(0, 0, 0)",
+ "border-color": "rgb(255, 185, 0)",
+ "background-color": "rgb(240, 240, 240)",
+ },
+)
+
+// Light theme
+local-storage: {
+ "rustdoc-theme": "light",
+ "rustdoc-use-system-theme": "false",
+}
+reload:
+
+assert-css: (
+ ".search-input",
+ {
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(255, 255, 255)",
+ "color": "rgb(0, 0, 0)",
+ },
+)
+focus: ".search-input"
+// Nothing should change.
+assert-css: (
+ ".search-input",
+ {
+ "border-color": "rgb(102, 175, 233)",
+ "background-color": "rgb(255, 255, 255)",
+ "color": "rgb(0, 0, 0)",
+ },
+)
+
+assert-css: (
+ "#help-button",
+ {"border-color": "rgb(0, 0, 0)"},
+)
+assert-css: (
+ "#help-button > a",
+ {
+ "color": "rgb(0, 0, 0)",
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(255, 255, 255)",
+ },
+)
+move-cursor-to: "#help-button"
+assert-css: (
+ "#help-button:hover",
+ {"border-color": "rgb(0, 0, 0)"},
+)
+// Only "border-color" should change.
+assert-css: (
+ "#help-button:hover > a",
+ {
+ "color": "rgb(0, 0, 0)",
+ "border-color": "rgb(113, 113, 113)",
+ "background-color": "rgb(255, 255, 255)",
+ },
+)
+// Link color inside
+click: "#help-button"
+assert-css: (
+ "#help a",
+ {
+ "color": "rgb(56, 115, 173)",
+ },
+)
+
+assert-css: (
+ "#settings-menu",
+ {"border-color": "rgb(0, 0, 0)"},
+)
+assert-css: (
+ "#settings-menu > a",
+ {
+ "border-color": "rgb(224, 224, 224)",
+ "background-color": "rgb(255, 255, 255)",
+ },
+)
+move-cursor-to: "#settings-menu"
+assert-css: (
+ "#settings-menu:hover",
+ {"border-color": "rgb(0, 0, 0)"},
+)
+// Only "border-color" should change.
+assert-css: (
+ "#settings-menu:hover > a",
+ {
+ "color": "rgb(0, 0, 0)",
+ "border-color": "rgb(113, 113, 113)",
+ "background-color": "rgb(255, 255, 255)",
+ },
+)
diff --git a/src/test/rustdoc-gui/search-input-mobile.goml b/src/test/rustdoc-gui/search-input-mobile.goml
index 5c95db70a..ce0cef77c 100644
--- a/src/test/rustdoc-gui/search-input-mobile.goml
+++ b/src/test/rustdoc-gui/search-input-mobile.goml
@@ -1,6 +1,6 @@
// 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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
size: (463, 700)
// We first check that the search input isn't already focused.
assert-false: ("input.search-input:focus")
diff --git a/src/test/rustdoc-gui/search-input.goml b/src/test/rustdoc-gui/search-input.goml
deleted file mode 100644
index 44123b702..000000000
--- a/src/test/rustdoc-gui/search-input.goml
+++ /dev/null
@@ -1,23 +0,0 @@
-// Ensures that the search input border color changes on focus.
-goto: file://|DOC_PATH|/test_docs/index.html
-local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
-reload:
-
-assert-css: (".search-input", {"border-color": "rgb(224, 224, 224)"})
-click: ".search-input"
-focus: ".search-input"
-assert-css: (".search-input", {"border-color": "rgb(0, 141, 253)"})
-
-local-storage: {"rustdoc-theme": "light"}
-reload:
-
-assert-css: (".search-input", {"border-color": "rgb(224, 224, 224)"})
-click: ".search-input"
-assert-css: (".search-input", {"border-color": "rgb(102, 175, 233)"})
-
-local-storage: {"rustdoc-theme": "ayu"}
-reload:
-
-assert-css: (".search-input", {"border-color": "rgb(66, 76, 87)"})
-click: ".search-input"
-assert-css: (".search-input", {"border-color": "rgb(66, 76, 87)"})
diff --git a/src/test/rustdoc-gui/search-reexport.goml b/src/test/rustdoc-gui/search-reexport.goml
index 5ef890d47..dd19f03bd 100644
--- a/src/test/rustdoc-gui/search-reexport.goml
+++ b/src/test/rustdoc-gui/search-reexport.goml
@@ -1,6 +1,6 @@
// 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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
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.
diff --git a/src/test/rustdoc-gui/search-result-color.goml b/src/test/rustdoc-gui/search-result-color.goml
index 9a49ae2c6..69bb30df9 100644
--- a/src/test/rustdoc-gui/search-result-color.goml
+++ b/src/test/rustdoc-gui/search-result-color.goml
@@ -1,5 +1,58 @@
// The goal of this test is to ensure the color of the text is the one expected.
-goto: file://|DOC_PATH|/test_docs/index.html?search=coo
+
+define-function: (
+ "check-result-color",
+ (result_kind, color, hover_color),
+ [
+ (
+ "assert-css",
+ (".result-" + |result_kind| + " ." + |result_kind|, {"color": |color|}, ALL),
+ ),
+ (
+ "assert-css",
+ (
+ ".result-" + |result_kind|,
+ {"color": |entry_color|, "background-color": |background_color|},
+ ),
+ ),
+ (
+ "move-cursor-to",
+ ".result-" + |result_kind|,
+ ),
+ (
+ "assert-css",
+ (
+ ".result-" + |result_kind| + ":hover",
+ {"color": |hover_entry_color|, "background-color": |hover_background_color|},
+ ),
+ ),
+ (
+ "assert-css",
+ (".result-" + |result_kind| + ":hover ." + |result_kind|, {"color": |hover_color|}),
+ ),
+ (
+ "move-cursor-to",
+ ".search-input",
+ ),
+ (
+ "focus",
+ ".result-" + |result_kind|,
+ ),
+ (
+ "assert-css",
+ (
+ ".result-" + |result_kind| + ":focus",
+ {"color": |hover_entry_color|, "background-color": |hover_background_color|},
+ ),
+ ),
+ (
+ "assert-css",
+ (".result-" + |result_kind| + ":focus ." + |result_kind|, {"color": |hover_color|}),
+ ),
+ ],
+)
+
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
// This is needed so that the text color is computed.
show-text: true
@@ -7,7 +60,6 @@ show-text: true
// Ayu theme
local-storage: {
"rustdoc-theme": "ayu",
- "rustdoc-preferred-dark-theme": "ayu",
"rustdoc-use-system-theme": "false",
}
reload:
@@ -23,16 +75,97 @@ assert-css: (
{"color": "rgb(0, 150, 207)"},
)
-// Checking the color for "keyword".
+// Checking the color of "keyword" text.
assert-css: (
"//*[@class='result-name']//*[text()='(keyword)']",
{"color": "rgb(120, 135, 151)"},
)
+store-value: (entry_color, "rgb(0, 150, 207)") // color of the search entry
+store-value: (hover_entry_color, "rgb(255, 255, 255)") // color of the hovered/focused search entry
+store-value: (background_color, "rgba(0, 0, 0, 0)") // background color
+store-value: (hover_background_color, "rgb(60, 60, 60)") // hover background color
+
+call-function: (
+ "check-result-color", (
+ "keyword", // item kind
+ "rgb(57, 175, 215)", // color of item kind
+ "rgb(57, 175, 215)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "struct", // item kind
+ "rgb(255, 160, 165)", // color of item kind
+ "rgb(255, 160, 165)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "associatedtype", // item kind
+ "rgb(57, 175, 215)", // color of item kind
+ "rgb(57, 175, 215)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "tymethod", // item kind
+ "rgb(253, 214, 135)", // color of item kind
+ "rgb(253, 214, 135)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "method", // item kind
+ "rgb(253, 214, 135)", // color of item kind
+ "rgb(253, 214, 135)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "structfield", // item kind
+ "rgb(0, 150, 207)", // color of item kind
+ "rgb(255, 255, 255)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "macro", // item kind
+ "rgb(163, 122, 204)", // color of item kind
+ "rgb(163, 122, 204)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "fn", // item kind
+ "rgb(253, 214, 135)", // color of item kind
+ "rgb(253, 214, 135)", // color of hovered/focused item kind
+ ),
+)
+
+// Checking the `<a>` container.
+move-cursor-to: ".search-input"
+focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
+assert-css: (
+ "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"},
+ ALL,
+)
+
+// Checking color and background on hover.
+move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']"
+assert-css: (
+ "//*[@class='result-name']/*[text()='test_docs::']",
+ {"color": "rgb(255, 255, 255)"},
+)
+assert-css: (
+ "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"},
+)
+
// Dark theme
local-storage: {
"rustdoc-theme": "dark",
- "rustdoc-preferred-dark-theme": "dark",
"rustdoc-use-system-theme": "false",
}
reload:
@@ -48,12 +181,82 @@ assert-css: (
{"color": "rgb(221, 221, 221)"},
)
-// Checking the color for "keyword".
+// Checking the color for "keyword" text.
assert-css: (
"//*[@class='result-name']//*[text()='(keyword)']",
{"color": "rgb(221, 221, 221)"},
)
+store-value: (entry_color, "rgb(221, 221, 221)") // color of the search entry
+store-value: (hover_entry_color, "rgb(221, 221, 221)") // color of the hovered/focused search entry
+store-value: (background_color, "rgba(0, 0, 0, 0)") // background color
+store-value: (hover_background_color, "rgb(97, 97, 97)") // hover background color
+
+call-function: (
+ "check-result-color", (
+ "keyword", // item kind
+ "rgb(210, 153, 29)", // color of item kind
+ "rgb(210, 153, 29)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "struct", // item kind
+ "rgb(45, 191, 184)", // color of item kind
+ "rgb(45, 191, 184)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "associatedtype", // item kind
+ "rgb(210, 153, 29)", // color of item kind
+ "rgb(210, 153, 29)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "tymethod", // item kind
+ "rgb(43, 171, 99)", // color of item kind
+ "rgb(43, 171, 99)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "method", // item kind
+ "rgb(43, 171, 99)", // color of item kind
+ "rgb(43, 171, 99)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "structfield", // item kind
+ "rgb(221, 221, 221)", // color of item kind
+ "rgb(221, 221, 221)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "macro", // item kind
+ "rgb(9, 189, 0)", // color of item kind
+ "rgb(9, 189, 0)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "fn", // item kind
+ "rgb(43, 171, 99)", // color of item kind
+ "rgb(43, 171, 99)", // color of hovered/focused item kind
+ ),
+)
+
+// Checking the `<a>` container.
+move-cursor-to: ".search-input"
+focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
+assert-css: (
+ "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+
// Light theme
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
reload:
@@ -69,19 +272,88 @@ assert-css: (
{"color": "rgb(0, 0, 0)"},
)
-// Checking the color for "keyword".
+// Checking the color for "keyword" text.
assert-css: (
"//*[@class='result-name']//*[text()='(keyword)']",
{"color": "rgb(0, 0, 0)"},
)
+store-value: (entry_color, "rgb(0, 0, 0)") // color of the search entry
+store-value: (hover_entry_color, "rgb(0, 0, 0)") // color of the hovered/focused search entry
+store-value: (background_color, "rgba(0, 0, 0, 0)") // background color
+store-value: (hover_background_color, "rgb(204, 204, 204)") // hover background color
+
+call-function: (
+ "check-result-color", (
+ "keyword", // item kind
+ "rgb(56, 115, 173)", // color of item kind
+ "rgb(56, 115, 173)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "struct", // item kind
+ "rgb(173, 55, 138)", // color of item kind
+ "rgb(173, 55, 138)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "associatedtype", // item kind
+ "rgb(56, 115, 173)", // color of item kind
+ "rgb(56, 115, 173)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "tymethod", // item kind
+ "rgb(173, 124, 55)", // color of item kind
+ "rgb(173, 124, 55)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "method", // item kind
+ "rgb(173, 124, 55)", // color of item kind
+ "rgb(173, 124, 55)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "structfield", // item kind
+ "rgb(0, 0, 0)", // color of item kind
+ "rgb(0, 0, 0)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "macro", // item kind
+ "rgb(6, 128, 0)", // color of item kind
+ "rgb(6, 128, 0)", // color of hovered/focused item kind
+ ),
+)
+call-function: (
+ "check-result-color", (
+ "fn", // item kind
+ "rgb(173, 124, 55)", // color of item kind
+ "rgb(173, 124, 55)", // color of hovered/focused item kind
+ ),
+)
+
+// Checking the `<a>` container.
+move-cursor-to: ".search-input"
+focus: ".search-input" // To ensure the `<a>` container isnt focus or hover.
+assert-css: (
+ "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a",
+ {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+
// Check the alias more specifically in the dark theme.
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
// We set the theme so we're sure that the correct values will be used, whatever the computer
// this test is running on.
local-storage: {
"rustdoc-theme": "dark",
- "rustdoc-preferred-dark-theme": "dark",
"rustdoc-use-system-theme": "false",
}
// If the text isn't displayed, the browser doesn't compute color style correctly...
diff --git a/src/test/rustdoc-gui/search-result-description.goml b/src/test/rustdoc-gui/search-result-description.goml
index d8cb6ee57..53a335b63 100644
--- a/src/test/rustdoc-gui/search-result-description.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=some_more_function"
// Waiting for the search results to appear...
wait-for: "#titles"
assert-text: (".search-results .desc code", "format!")
diff --git a/src/test/rustdoc-gui/search-result-display.goml b/src/test/rustdoc-gui/search-result-display.goml
index 8464ba7c2..053bfd8c9 100644
--- a/src/test/rustdoc-gui/search-result-display.goml
+++ b/src/test/rustdoc-gui/search-result-display.goml
@@ -1,29 +1,28 @@
// Checks that the search results have the expected width.
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
size: (900, 1000)
write: (".search-input", "test")
// To be SURE that the search will be run.
press-key: 'Enter'
-wait-for: "#search-settings"
+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": "295px"})
+assert-css: (".search-results div.desc", {"width": "318px"})
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": "570px"})
+assert-css: (".search-results div.desc", {"width": "566px"})
+
+// The result set is all on one line.
+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)
-// First we check the current width and position.
-assert-css: ("#crate-search", {"width": "218px"})
-compare-elements-position-near: (
- "#crate-search",
- "#search-settings .search-results-title",
- {"y": 5},
-)
+// First we check the current width, height and position.
+assert-css: ("#crate-search", {"width": "223px"})
+assert-css: (".search-results-title", {"height": "44px", "width": "336px"})
// Then we update the text of one of the `<option>`.
text: (
@@ -31,12 +30,8 @@ text: (
"sdjfaksdjfaksjdbfkadsbfkjsadbfkdsbkfbsadkjfbkdsabfkadsfkjdsafa",
)
-// Then we compare again.
-assert-css: ("#crate-search", {"width": "640px"})
-compare-elements-position-near-false: (
- "#crate-search",
- "#search-settings .search-results-title",
- {"y": 5},
-)
-// And we check that the `<select>` isn't bigger than its container.
+// Then we compare again to confirm the height didn't change.
+assert-css: ("#crate-search", {"width": "527px"})
+assert-css: (".search-results-title", {"height": "44px", "width": "640px"})
+// And we check that the `<select>` isn't bigger than its container (".search-results-title").
assert-css: ("#search", {"width": "640px"})
diff --git a/src/test/rustdoc-gui/search-result-go-to-first.goml b/src/test/rustdoc-gui/search-result-go-to-first.goml
index 255470a3e..eeddf5ef6 100644
--- a/src/test/rustdoc-gui/search-result-go-to-first.goml
+++ b/src/test/rustdoc-gui/search-result-go-to-first.goml
@@ -2,18 +2,18 @@
// 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
-assert-text-false: (".fqn .in-band", "Struct test_docs::Foo")
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+assert-text-false: (".fqn", "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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo"
// Waiting for the search results to appear...
wait-for: "#titles"
-assert-text-false: (".fqn .in-band", "Struct test_docs::Foo")
+assert-text-false: (".fqn", "Struct test_docs::Foo")
// Ensure that the search results are displayed, not the "normal" content.
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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html?search=struct%3AFoo&go_to_first=true"
// Waiting for the page to load...
-wait-for-text: (".fqn .in-band", "Struct test_docs::Foo")
+wait-for-text: (".fqn", "Struct test_docs::Foo")
diff --git a/src/test/rustdoc-gui/search-result-keyword.goml b/src/test/rustdoc-gui/search-result-keyword.goml
index 16ae10431..66e63155a 100644
--- a/src/test/rustdoc-gui/search-result-keyword.goml
+++ b/src/test/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
+goto: "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/src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml b/src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml
index 9d506c151..a19dc6a8b 100644
--- a/src/test/rustdoc-gui/search-tab-change-title-fn-sig.goml
+++ b/src/test/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
+goto: "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: ("#titles > button:nth-of-type(3)", {"class": "selected"})
// Now try search-by-return
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "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: ("#titles > button:nth-of-type(1)", {"class": "selected"})
// Try with a search-by-return with no results
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "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: ("#titles > button:nth-of-type(1)", {"class": "selected"})
assert-text: ("#titles > 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
+goto: "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: ("#titles > button:nth-of-type(1)", {"class": "selected"})
assert-text: ("#titles > 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
+goto: "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/src/test/rustdoc-gui/settings.goml b/src/test/rustdoc-gui/settings.goml
index d9cf5ee66..f258f4d2a 100644
--- a/src/test/rustdoc-gui/settings.goml
+++ b/src/test/rustdoc-gui/settings.goml
@@ -1,5 +1,6 @@
-// This test ensures that the settings menu display is working as expected.
-goto: file://|DOC_PATH|/test_docs/index.html
+// 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"
show-text: true // needed when we check for colors below.
// First, we check that the settings page doesn't exist.
assert-false: "#settings"
@@ -138,9 +139,15 @@ wait-for-css: ("#help-button .popover", {"display": "block"})
assert-css: ("#settings-menu .popover", {"display": "none"})
// Now we go to the settings page to check that the CSS is loaded as expected.
-goto: file://|DOC_PATH|/settings.html
+goto: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
-assert-css: (".setting-line .toggle .slider", {"width": "45px", "margin-right": "20px"})
+assert-css: (
+ ".setting-line .toggle .slider",
+ {"width": "45px", "margin-right": "20px", "border": "0px none rgb(0, 0, 0)"},
+)
+
+assert-attribute-false: ("#settings", {"class": "popover"}, CONTAINS)
+compare-elements-position: (".sub form", "#settings", ("x"))
// We now check the display with JS disabled.
assert-false: "noscript section"
diff --git a/src/test/rustdoc-gui/shortcuts.goml b/src/test/rustdoc-gui/shortcuts.goml
index 1f20a0eaa..9068680d6 100644
--- a/src/test/rustdoc-gui/shortcuts.goml
+++ b/src/test/rustdoc-gui/shortcuts.goml
@@ -1,5 +1,5 @@
// Check that the various shortcuts are working.
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "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"
@@ -11,3 +11,21 @@ press-key: "?"
assert-css: ("#help-button .popover", {"display": "block"})
press-key: "Escape"
assert-css: ("#help-button .popover", {"display": "none"})
+// Checking doc collapse and expand.
+// It should be displaying a "-":
+assert-text: ("#toggle-all-docs", "[\u2212]")
+press-key: "-"
+wait-for-text: ("#toggle-all-docs", "[+]")
+assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
+// Pressing it again shouldn't do anything.
+press-key: "-"
+assert-text: ("#toggle-all-docs", "[+]")
+assert-attribute: ("#toggle-all-docs", {"class": "will-expand"})
+// Expanding now.
+press-key: "+"
+wait-for-text: ("#toggle-all-docs", "[\u2212]")
+assert-attribute: ("#toggle-all-docs", {"class": ""})
+// Pressing it again shouldn't do anything.
+press-key: "+"
+assert-text: ("#toggle-all-docs", "[\u2212]")
+assert-attribute: ("#toggle-all-docs", {"class": ""})
diff --git a/src/test/rustdoc-gui/sidebar-links-color.goml b/src/test/rustdoc-gui/sidebar-links-color.goml
new file mode 100644
index 000000000..18a1a3fad
--- /dev/null
+++ b/src/test/rustdoc-gui/sidebar-links-color.goml
@@ -0,0 +1,233 @@
+// This test checks links colors in sidebar before and after hover.
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
+
+// This is needed so that the text color is computed.
+show-text: true
+
+// Ayu theme
+local-storage: {
+ "rustdoc-theme": "ayu",
+ "rustdoc-use-system-theme": "false",
+}
+reload:
+
+// Struct
+assert-css: (
+ ".sidebar .block.struct a:not(.current)",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.struct a:not(.current)"
+assert-css: (
+ ".sidebar .block.struct a:hover",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+// Enum
+assert-css: (
+ ".sidebar .block.enum a",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.enum a"
+assert-css: (
+ ".sidebar .block.enum a:hover",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+// Union
+assert-css: (
+ ".sidebar .block.union a",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.union a"
+assert-css: (
+ ".sidebar .block.union a:hover",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+// Trait
+assert-css: (
+ ".sidebar .block.trait a",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.trait a"
+assert-css: (
+ ".sidebar .block.trait a:hover",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+// Function
+assert-css: (
+ ".sidebar .block.fn a",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.fn a"
+assert-css: (
+ ".sidebar .block.fn a:hover",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+// Type definition
+assert-css: (
+ ".sidebar .block.type a",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.type a"
+assert-css: (
+ ".sidebar .block.type a:hover",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+// Keyword
+assert-css: (
+ ".sidebar .block.keyword a",
+ {"color": "rgb(83, 177, 219)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.keyword a"
+assert-css: (
+ ".sidebar .block.keyword a:hover",
+ {"color": "rgb(255, 180, 76)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+
+// Dark theme
+local-storage: {"rustdoc-theme": "dark"}
+reload:
+
+// Struct
+assert-css: (
+ ".sidebar .block.struct a:not(.current)",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.struct a:not(.current)"
+assert-css: (
+ ".sidebar .block.struct a:hover",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
+)
+// Enum
+assert-css: (
+ ".sidebar .block.enum a",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.enum a"
+assert-css: (
+ ".sidebar .block.enum a:hover",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
+)
+// Union
+assert-css: (
+ ".sidebar .block.union a",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.union a"
+assert-css: (
+ ".sidebar .block.union a:hover",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
+)
+// Trait
+assert-css: (
+ ".sidebar .block.trait a",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.trait a"
+assert-css: (
+ ".sidebar .block.trait a:hover",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
+)
+// Function
+assert-css: (
+ ".sidebar .block.fn a",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.fn a"
+assert-css: (
+ ".sidebar .block.fn a:hover",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
+)
+// Type definition
+assert-css: (
+ ".sidebar .block.type a",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.type a"
+assert-css: (
+ ".sidebar .block.type a:hover",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
+)
+// Keyword
+assert-css: (
+ ".sidebar .block.keyword a",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.keyword a"
+assert-css: (
+ ".sidebar .block.keyword a:hover",
+ {"color": "rgb(253, 191, 53)", "background-color": "rgb(68, 68, 68)"},
+)
+
+// Light theme
+local-storage: {"rustdoc-theme": "light"}
+reload:
+
+// Struct
+assert-css: (
+ ".sidebar .block.struct a:not(.current)",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.struct a:not(.current)"
+assert-css: (
+ ".sidebar .block.struct a:hover",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
+)
+// Enum
+assert-css: (
+ ".sidebar .block.enum a",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.enum a"
+assert-css: (
+ ".sidebar .block.enum a:hover",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
+)
+// Union
+assert-css: (
+ ".sidebar .block.union a",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.union a"
+assert-css: (
+ ".sidebar .block.union a:hover",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
+)
+// Trait
+assert-css: (
+ ".sidebar .block.trait a",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.trait a"
+assert-css: (
+ ".sidebar .block.trait a:hover",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
+)
+// Function
+assert-css: (
+ ".sidebar .block.fn a",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.fn a"
+assert-css: (
+ ".sidebar .block.fn a:hover",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
+)
+// Type definition
+assert-css: (
+ ".sidebar .block.type a",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.type a"
+assert-css: (
+ ".sidebar .block.type a:hover",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
+)
+// Keyword
+assert-css: (
+ ".sidebar .block.keyword a",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgba(0, 0, 0, 0)"},
+)
+move-cursor-to: ".sidebar .block.keyword a"
+assert-css: (
+ ".sidebar .block.keyword a:hover",
+ {"color": "rgb(53, 109, 164)", "background-color": "rgb(255, 255, 255)"},
+)
diff --git a/src/test/rustdoc-gui/sidebar-macro-reexport.goml b/src/test/rustdoc-gui/sidebar-macro-reexport.goml
index a3a62fe54..b5c1b6a43 100644
--- a/src/test/rustdoc-gui/sidebar-macro-reexport.goml
+++ b/src/test/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
-wait-for: ".sidebar-elems .macro .macro"
+goto: "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/src/test/rustdoc-gui/sidebar-mobile-scroll.goml b/src/test/rustdoc-gui/sidebar-mobile-scroll.goml
new file mode 100644
index 000000000..2449269b1
--- /dev/null
+++ b/src/test/rustdoc-gui/sidebar-mobile-scroll.goml
@@ -0,0 +1,31 @@
+// 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": "627"}
+
+// 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": "627"}
+
+// 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": "627"}
diff --git a/src/test/rustdoc-gui/sidebar-mobile.goml b/src/test/rustdoc-gui/sidebar-mobile.goml
index 033c65783..453873f1b 100644
--- a/src/test/rustdoc-gui/sidebar-mobile.goml
+++ b/src/test/rustdoc-gui/sidebar-mobile.goml
@@ -1,7 +1,7 @@
// 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
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
// Switching to "mobile view" by reducing the width to 600px.
size: (600, 600)
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
@@ -13,7 +13,7 @@ click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
// Force the sidebar open by focusing a link inside it.
// This makes it easier for keyboard users to get to it.
-focus: ".sidebar-title a"
+focus: ".sidebar-elems h3 a"
assert-css: (".sidebar", {"display": "block", "left": "0px"})
// When we tab out of the sidebar, close it.
focus: ".search-input"
@@ -23,6 +23,11 @@ assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
click: ".sidebar-menu-toggle"
assert-css: (".sidebar", {"left": "0px"})
+// Make sure the "struct Foo" header is hidden, since the mobile topbar already does it.
+assert-css: ("//nav[contains(@class, 'sidebar')]//h2/a[text()='Foo']/parent::h2", {"display": "none"})
+// Make sure the global navigation is still here.
+assert-css: ("//nav[contains(@class, 'sidebar')]//h2/a[text()='In test_docs']/parent::h2", {"display": "block"})
+
// Click elsewhere.
click: "body"
assert-css: (".sidebar", {"display": "block", "left": "-1000px"})
@@ -39,26 +44,27 @@ assert-position: ("#method\.must_use", {"y": 45})
// Check that the bottom-most item on the sidebar menu can be scrolled fully into view.
click: ".sidebar-menu-toggle"
scroll-to: ".block.keyword li:nth-child(1)"
-compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topbar", {"y": 543})
+compare-elements-position-near: (".block.keyword li:nth-child(1)", ".mobile-topbar", {"y": 543.19})
// Now checking the background color of the sidebar.
+show-text: true
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
-assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)"})
+assert-css: (".sidebar", {"background-color": "rgb(80, 80, 80)", "color": "rgb(221, 221, 221)"})
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "ayu"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
-assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)"})
+assert-css: (".sidebar", {"background-color": "rgb(20, 25, 31)", "color": "rgb(197, 197, 197)"})
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "light"}
reload:
// Open the sidebar menu.
click: ".sidebar-menu-toggle"
-assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)"})
+assert-css: (".sidebar", {"background-color": "rgb(245, 245, 245)", "color": "rgb(0, 0, 0)"})
diff --git a/src/test/rustdoc-gui/sidebar-source-code-display.goml b/src/test/rustdoc-gui/sidebar-source-code-display.goml
index fa322574f..4155dab64 100644
--- a/src/test/rustdoc-gui/sidebar-source-code-display.goml
+++ b/src/test/rustdoc-gui/sidebar-source-code-display.goml
@@ -1,22 +1,19 @@
// This test ensures that the elements in the sidebar are displayed correctly.
javascript: false
-goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
+goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
// Since the javascript is disabled, there shouldn't be a toggle.
assert-false: "#sidebar-toggle"
-// For some reason, we need to wait a bit here because it seems like the transition on opacity
-// is being applied whereas it can't be reproduced in a browser...
-wait-for-css: (".sidebar > *", {"visibility": "hidden", "opacity": 0})
+wait-for-css: (".sidebar", {"display": "none"})
// Let's retry with javascript enabled.
javascript: true
reload:
wait-for: "#sidebar-toggle"
-assert-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
-assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "hidden", "opacity": 0})
+assert-css: ("#sidebar-toggle", {"visibility": "visible"})
+assert-css: (".sidebar > *:not(#sidebar-toggle)", {"visibility": "hidden"})
// Let's expand the sidebar now.
click: "#sidebar-toggle"
-// Because of the transition CSS, we check by using `wait-for-css` instead of `assert-css`.
-wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
+wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
// We now check that opening the sidebar and clicking a link will leave it open.
// The behavior here on desktop is different than the behavior on mobile,
@@ -25,7 +22,7 @@ wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
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
+goto: "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 +33,7 @@ show-text: true
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
reload:
// Waiting for the sidebar to be displayed...
-wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
+wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
assert-css: (
"#source-sidebar details[open] > .files a.selected",
{"color": "rgb(0, 0, 0)", "background-color": "rgb(255, 255, 255)"},
@@ -91,7 +88,7 @@ assert-css: (
local-storage: {"rustdoc-theme": "dark", "rustdoc-use-system-theme": "false"}
reload:
// Waiting for the sidebar to be displayed...
-wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
+wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
assert-css: (
"#source-sidebar details[open] > .files > a.selected",
{"color": "rgb(221, 221, 221)", "background-color": "rgb(51, 51, 51)"},
@@ -146,7 +143,7 @@ assert-css: (
local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"}
reload:
// Waiting for the sidebar to be displayed...
-wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
+wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
assert-css: (
"#source-sidebar details[open] > .files a.selected",
{"color": "rgb(255, 180, 76)", "background-color": "rgb(20, 25, 31)"},
@@ -201,7 +198,7 @@ assert-css: (
size: (500, 700)
reload:
// Waiting for the sidebar to be displayed...
-wait-for-css: ("#sidebar-toggle", {"visibility": "visible", "opacity": 1})
+wait-for-css: ("#sidebar-toggle", {"visibility": "visible"})
// We now check it takes the full size of the display.
assert-property: ("body", {"clientWidth": "500", "clientHeight": "700"})
@@ -224,14 +221,25 @@ click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
// We scroll to line 117 to change the scroll position.
scroll-to: '//*[@id="117"]'
-assert-window-property: {"pageYOffset": "2519"}
+assert-window-property: {"pageYOffset": "2542"}
// Expanding the sidebar...
click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "500px"})
click: "#sidebar-toggle"
wait-for-css: (".sidebar", {"width": "0px"})
// The "scrollTop" property should be the same.
-assert-window-property: {"pageYOffset": "2519"}
+assert-window-property: {"pageYOffset": "2542"}
+
+// We now check that the scroll position is restored if the window is resized.
+size: (500, 700)
+click: "#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: "#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,
@@ -242,7 +250,7 @@ click: "#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
+goto: "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.
diff --git a/src/test/rustdoc-gui/sidebar-source-code.goml b/src/test/rustdoc-gui/sidebar-source-code.goml
index e882080c7..9ba663687 100644
--- a/src/test/rustdoc-gui/sidebar-source-code.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
// First: desktop mode.
size: (1100, 800)
// We check that the sidebar isn't expanded and has the expected width.
@@ -17,7 +17,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
+goto: "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.
@@ -42,4 +42,4 @@ assert-false: ".source-sidebar-expanded"
assert: "nav.sidebar"
// Check that the topbar is not visible
-assert-property: (".mobile-topbar", {"offsetParent": "null"})
+assert-false: ".mobile-topbar"
diff --git a/src/test/rustdoc-gui/sidebar.goml b/src/test/rustdoc-gui/sidebar.goml
index 32fe3334f..5058630f4 100644
--- a/src/test/rustdoc-gui/sidebar.goml
+++ b/src/test/rustdoc-gui/sidebar.goml
@@ -1,5 +1,6 @@
// Checks multiple things on the sidebar display (width of its elements, colors, etc).
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+assert-property: (".sidebar", {"clientWidth": "200"})
show-text: true
local-storage: {"rustdoc-theme": "light"}
// We reload the page so the local storage settings are being used.
@@ -8,26 +9,29 @@ reload:
assert-text: (".sidebar > .location", "Crate test_docs")
// In modules, we only have one "location" element.
assert-count: (".sidebar .location", 1)
+assert-count: (".sidebar h2", 1)
assert-text: ("#all-types", "All Items")
assert-css: ("#all-types", {"color": "rgb(53, 109, 164)"})
// We check that we have the crates list and that the "current" on is "test_docs".
-assert-text: (".sidebar-elems .crate > ul > li > a.current", "test_docs")
+assert-text: (".sidebar-elems ul.crate > li > a.current", "test_docs")
// And we're also supposed to have the list of items in the current module.
assert-text: (".sidebar-elems section ul > li:nth-child(1)", "Re-exports")
assert-text: (".sidebar-elems section ul > li:nth-child(2)", "Modules")
assert-text: (".sidebar-elems section ul > li:nth-child(3)", "Macros")
assert-text: (".sidebar-elems section ul > li:nth-child(4)", "Structs")
assert-text: (".sidebar-elems section ul > li:nth-child(5)", "Enums")
-assert-text: (".sidebar-elems section ul > li:nth-child(6)", "Traits")
-assert-text: (".sidebar-elems section ul > li:nth-child(7)", "Functions")
-assert-text: (".sidebar-elems section ul > li:nth-child(8)", "Type Definitions")
-assert-text: (".sidebar-elems section ul > li:nth-child(9)", "Unions")
-assert-text: (".sidebar-elems section ul > li:nth-child(10)", "Keywords")
+assert-text: (".sidebar-elems section ul > li:nth-child(6)", "Constants")
+assert-text: (".sidebar-elems section ul > li:nth-child(7)", "Traits")
+assert-text: (".sidebar-elems section ul > li:nth-child(8)", "Functions")
+assert-text: (".sidebar-elems section ul > li:nth-child(9)", "Type Definitions")
+assert-text: (".sidebar-elems section ul > li:nth-child(10)", "Unions")
+assert-text: (".sidebar-elems section ul > li:nth-child(11)", "Keywords")
assert-text: ("#structs + .item-table .item-left > a", "Foo")
click: "#structs + .item-table .item-left > a"
// PAGE: struct.Foo.html
-assert-count: (".sidebar .location", 2)
+assert-count: (".sidebar .location", 1)
+assert-count: (".sidebar h2", 2)
// We check that there is no crate listed outside of the top level.
assert-false: ".sidebar-elems > .crate"
@@ -38,38 +42,43 @@ 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
-assert-css: (".sidebar-elems .crate > ul > li:first-child > a", {"color": "rgb(53, 109, 164)"})
-click: ".sidebar-elems .crate > ul > li:first-child > a"
+goto: "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
+goto: "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".
-assert-text: (".sidebar-elems .crate > ul > li > a.current", "lib2")
+assert-text: (".sidebar-elems ul.crate > li > a.current", "lib2")
// We now go to the "foobar" function page.
-assert-text: (".sidebar-elems > section .block ul > li:nth-child(1)", "Modules")
-assert-text: (".sidebar-elems > section .block ul > li:nth-child(2)", "Structs")
-assert-text: (".sidebar-elems > section .block ul > li:nth-child(3)", "Traits")
-assert-text: (".sidebar-elems > section .block ul > li:nth-child(4)", "Functions")
-assert-text: (".sidebar-elems > section .block ul > li:nth-child(5)", "Type Definitions")
+assert-text: (".sidebar-elems > section ul.block > li:nth-child(1)", "Modules")
+assert-text: (".sidebar-elems > section ul.block > li:nth-child(2)", "Structs")
+assert-text: (".sidebar-elems > section ul.block > li:nth-child(3)", "Traits")
+assert-text: (".sidebar-elems > section ul.block > li:nth-child(4)", "Functions")
+assert-text: (".sidebar-elems > section ul.block > li:nth-child(5)", "Type Definitions")
assert-text: ("#functions + .item-table .item-left > a", "foobar")
click: "#functions + .item-table .item-left > a"
// PAGE: fn.foobar.html
-// In items containing no items (like functions or constants) and in modules, we have one
-// "location" elements.
-assert-count: (".sidebar .location", 1)
-assert-text: (".sidebar .sidebar-elems .location", "In lib2")
+// In items containing no items (like functions or constants) and in modules, we have no
+// "location" elements. Only the parent module h2.
+assert-count: (".sidebar .location", 0)
+assert-count: (".sidebar h2", 1)
+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
+goto: "./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
+goto: "./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.
assert-false: ".sidebar-elems .crate"
@@ -77,12 +86,22 @@ assert-text: (".sidebar-elems > section ul > li:nth-child(1)", "Functions")
assert-text: ("#functions + .item-table .item-left > 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
+goto: "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
-click: ".block.mod h3 a"
+goto: "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
assert-css: ("#modules", {"background-color": "rgb(253, 255, 211)"})
+
+// Finally, assert that the `[+]/[−]` toggle doesn't affect sidebar width.
+click: "#toggle-all-docs"
+assert-text: ("#toggle-all-docs", "[+]")
+assert-property: (".sidebar", {"clientWidth": "200"})
+click: "#toggle-all-docs"
+assert-text: ("#toggle-all-docs", "[−]")
+assert-property: (".sidebar", {"clientWidth": "200"}) \ No newline at end of file
diff --git a/src/test/rustdoc-gui/source-anchor-scroll.goml b/src/test/rustdoc-gui/source-anchor-scroll.goml
index 4e51c8dca..ddfe0c3d1 100644
--- a/src/test/rustdoc-gui/source-anchor-scroll.goml
+++ b/src/test/rustdoc-gui/source-anchor-scroll.goml
@@ -1,6 +1,6 @@
// 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
+goto: "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)
@@ -10,7 +10,7 @@ assert-property: ("html", {"scrollTop": "0"})
click: '//a[text() = "barbar"]'
assert-property: ("html", {"scrollTop": "125"})
click: '//a[text() = "bar"]'
-assert-property: ("html", {"scrollTop": "166"})
+assert-property: ("html", {"scrollTop": "156"})
click: '//a[text() = "sub_fn"]'
assert-property: ("html", {"scrollTop": "53"})
diff --git a/src/test/rustdoc-gui/source-code-page.goml b/src/test/rustdoc-gui/source-code-page.goml
index 581f826a3..a2dac2aa6 100644
--- a/src/test/rustdoc-gui/source-code-page.goml
+++ b/src/test/rustdoc-gui/source-code-page.goml
@@ -1,30 +1,72 @@
// Checks that the interactions with the source code pages are working as expected.
-goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
+goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+show-text: true
// Check that we can click on the line number.
-click: ".line-numbers > span:nth-child(4)" // This is the span for line 4.
+click: ".src-line-numbers > span:nth-child(4)" // This is the span for line 4.
// Ensure that the page URL was updated.
assert-document-property: ({"URL": "lib.rs.html#4"}, ENDS_WITH)
assert-attribute: ("//*[@id='4']", {"class": "line-highlighted"})
// We now check that the good spans are highlighted
-goto: file://|DOC_PATH|/src/test_docs/lib.rs.html#4-6
-assert-attribute-false: (".line-numbers > span:nth-child(3)", {"class": "line-highlighted"})
-assert-attribute: (".line-numbers > span:nth-child(4)", {"class": "line-highlighted"})
-assert-attribute: (".line-numbers > span:nth-child(5)", {"class": "line-highlighted"})
-assert-attribute: (".line-numbers > span:nth-child(6)", {"class": "line-highlighted"})
-assert-attribute-false: (".line-numbers > span:nth-child(7)", {"class": "line-highlighted"})
+goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4-6"
+assert-attribute-false: (".src-line-numbers > span:nth-child(3)", {"class": "line-highlighted"})
+assert-attribute: (".src-line-numbers > span:nth-child(4)", {"class": "line-highlighted"})
+assert-attribute: (".src-line-numbers > span:nth-child(5)", {"class": "line-highlighted"})
+assert-attribute: (".src-line-numbers > span:nth-child(6)", {"class": "line-highlighted"})
+assert-attribute-false: (".src-line-numbers > span:nth-child(7)", {"class": "line-highlighted"})
+
+define-function: (
+ "check-colors",
+ (theme, color, background_color, highlight_color, highlight_background_color),
+ [
+ ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
+ ("reload"),
+ ("assert-css", (
+ ".src-line-numbers > span:not(.line-highlighted)",
+ {"color": |color|, "background-color": |background_color|},
+ ALL,
+ )),
+ ("assert-css", (
+ ".src-line-numbers > span.line-highlighted",
+ {"color": |highlight_color|, "background-color": |highlight_background_color|},
+ ALL,
+ )),
+ ],
+)
+
+call-function: ("check-colors", {
+ "theme": "ayu",
+ "color": "rgb(92, 103, 115)",
+ "background_color": "rgba(0, 0, 0, 0)",
+ "highlight_color": "rgb(112, 128, 144)",
+ "highlight_background_color": "rgba(255, 236, 164, 0.06)",
+})
+call-function: ("check-colors", {
+ "theme": "dark",
+ "color": "rgb(59, 145, 226)",
+ "background_color": "rgba(0, 0, 0, 0)",
+ "highlight_color": "rgb(59, 145, 226)",
+ "highlight_background_color": "rgb(10, 4, 47)",
+})
+call-function: ("check-colors", {
+ "theme": "light",
+ "color": "rgb(198, 126, 45)",
+ "background_color": "rgba(0, 0, 0, 0)",
+ "highlight_color": "rgb(198, 126, 45)",
+ "highlight_background_color": "rgb(253, 255, 211)",
+})
+
// This is to ensure that the content is correctly align with the line numbers.
compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y"))
// Assert that the line numbers text is aligned to the right.
-assert-css: (".line-numbers", {"text-align": "right"})
+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!).
-show-text: true
-goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
+goto: "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": 104, "y": 103})
-// We click on the left of the "1" span but still in the "line-number" `<pre>`.
+assert-position: ("//*[@id='1']", {"x": 104, "y": 112})
+// We click on the left of the "1" span but still in the "src-line-number" `<pre>`.
click: (103, 103)
assert-document-property: ({"URL": "/lib.rs.html"}, ENDS_WITH)
@@ -47,3 +89,25 @@ assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
// Check the spacing.
assert-css: ("#source-sidebar > details.dir-entry", {"padding-left": "4px"})
+
+// Check the search form
+assert-css: ("nav.sub", {"flex-direction": "row"})
+// The goal of this test is to ensure the search input is perfectly centered
+// between the top of the page and the top of the gray code block.
+// To check this, we maintain the invariant:
+//
+// offsetTop[nav.sub form] = offsetTop[#main-content] - offsetHeight[nav.sub form] - offsetTop[nav.sub form]
+assert-property: ("nav.sub form", {"offsetTop": 28, "offsetHeight": 34})
+assert-property: ("#main-content", {"offsetTop": 90})
+// 28 = 90 - 34 - 28
+
+// Now do the same check on moderately-sized mobile.
+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})
+// 21 = 76 - 34 - 21
+
+// Tiny mobile gets a different display where the logo is stacked on top.
+size: (450, 700)
+assert-css: ("nav.sub", {"flex-direction": "column"})
diff --git a/src/test/rustdoc-gui/src-font-size.goml b/src/test/rustdoc-gui/src-font-size.goml
index 0c01e2545..b17dfd94c 100644
--- a/src/test/rustdoc-gui/src-font-size.goml
+++ b/src/test/rustdoc-gui/src-font-size.goml
@@ -1,11 +1,11 @@
// 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
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
show-text: true
// Check the impl headers.
-assert-css: (".impl.has-srclink .srclink", {"font-size": "16px"}, ALL)
-assert-css: (".impl.has-srclink .code-header.in-band", {"font-size": "18px"}, ALL)
+assert-css: (".impl.has-srclink .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
+assert-css: (".impl.has-srclink .code-header", {"font-size": "18px", "font-weight": 600}, ALL)
// Check the impl items.
-assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px"}, ALL)
-assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px"}, ALL)
+assert-css: (".impl-items .has-srclink .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
+assert-css: (".impl-items .has-srclink .code-header", {"font-size": "16px", "font-weight": 600}, ALL)
diff --git a/src/test/rustdoc-gui/src/lib2/lib.rs b/src/test/rustdoc-gui/src/lib2/lib.rs
index 87f91be3a..24aecc70d 100644
--- a/src/test/rustdoc-gui/src/lib2/lib.rs
+++ b/src/test/rustdoc-gui/src/lib2/lib.rs
@@ -38,11 +38,14 @@ pub trait Trait {
#[deprecated = "Whatever [`Foo`](#tadam)"]
fn foo() {}
+ fn fooo();
}
impl Trait for Foo {
type X = u32;
const Y: u32 = 0;
+
+ fn fooo() {}
}
impl implementors::Whatever for Foo {
@@ -143,3 +146,40 @@ pub struct LongItemInfo2;
/// Some docs.
#[doc(cfg(any(target_os = "android", target_os = "linux", target_os = "emscripten", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))]
impl SimpleTrait for LongItemInfo2 {}
+
+pub struct WhereWhitespace<T>;
+
+impl<T> WhereWhitespace<T> {
+ pub fn new<F>(f: F) -> Self
+ where
+ F: FnMut() -> i32,
+ {}
+}
+
+impl<K, T> Whitespace<&K> for WhereWhitespace<T>
+where
+ K: std::fmt::Debug,
+{
+ type Output = WhereWhitespace<T>;
+ fn index(&self, _key: &K) -> &Self::Output {
+ self
+ }
+}
+
+pub trait Whitespace<Idx>
+where
+ Idx: ?Sized,
+{
+ type Output;
+ fn index(&self, index: Idx) -> &Self::Output;
+}
+
+pub struct ItemInfoAlignmentTest;
+
+impl ItemInfoAlignmentTest {
+ /// This method has docs
+ #[deprecated]
+ pub fn foo() {}
+ #[deprecated]
+ pub fn bar() {}
+}
diff --git a/src/test/rustdoc-gui/src/staged_api/Cargo.toml b/src/test/rustdoc-gui/src/staged_api/Cargo.toml
index 117c4134e..b231be6ee 100644
--- a/src/test/rustdoc-gui/src/staged_api/Cargo.toml
+++ b/src/test/rustdoc-gui/src/staged_api/Cargo.toml
@@ -7,5 +7,6 @@ edition = "2021"
path = "lib.rs"
[features]
-default = ["some_feature"]
+default = ["some_feature", "some_other_feature"]
some_feature = []
+some_other_feature = []
diff --git a/src/test/rustdoc-gui/src/staged_api/lib.rs b/src/test/rustdoc-gui/src/staged_api/lib.rs
index 0cb460f03..5934593a8 100644
--- a/src/test/rustdoc-gui/src/staged_api/lib.rs
+++ b/src/test/rustdoc-gui/src/staged_api/lib.rs
@@ -7,4 +7,6 @@ pub struct Foo {}
impl Foo {
#[stable(feature = "some_feature", since = "1.3.5")]
pub fn bar() {}
+ #[stable(feature = "some_other_feature", since = "1.3.6")]
+ pub fn yo() {}
}
diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs
index 1b26aaecb..fdf97e492 100644
--- a/src/test/rustdoc-gui/src/test_docs/lib.rs
+++ b/src/test/rustdoc-gui/src/test_docs/lib.rs
@@ -5,6 +5,25 @@
#![crate_name = "test_docs"]
#![feature(rustdoc_internals)]
#![feature(doc_cfg)]
+#![feature(associated_type_defaults)]
+
+/*!
+Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
+this crate even more!
+Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
+this crate even more!
+Enable the feature <span class="stab portability"><code>some-feature</code></span> to enjoy
+this crate even more!
+
+Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
+Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
+Also, stop using `bar` as it's <span class="stab deprecated" title="">deprecated</span>.
+
+Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
+</span>.
+Finally, you can use `quz` only on <span class="stab portability"><code>Unix or x86-64</code>
+</span>.
+*/
use std::convert::AsRef;
use std::fmt;
@@ -28,6 +47,12 @@ use std::fmt;
/// Let's say I'm just some text will ya?
/// ```
///
+/// A failing to run one:
+///
+/// ```should_panic
+/// panic!("tadam");
+/// ```
+///
/// An inlined `code`!
pub fn foo() {}
@@ -292,4 +317,102 @@ pub mod details {
/// <div>I'm the content of the details!</div>
/// </details>
pub struct Details;
+
+ impl Details {
+ /// We check the appearance of the `<details>`/`<summary>` in here.
+ ///
+ /// ## Hello
+ ///
+ /// <details>
+ /// <summary><h4>I'm a summary</h4></summary>
+ /// <div>I'm the content of the details!</div>
+ /// </details>
+ pub fn method() {}
+ }
+}
+
+pub mod doc_block_table {
+
+ pub trait DocBlockTableTrait {
+ fn func();
+ }
+
+ /// Struct doc.
+ ///
+ /// | header1 | header2 |
+ /// |--------------------------|--------------------------|
+ /// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum |
+ pub struct DocBlockTable {}
+
+ impl DocBlockTableTrait for DocBlockTable {
+ /// Trait impl func doc for struct.
+ ///
+ /// | header1 | header2 |
+ /// |--------------------------|--------------------------|
+ /// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum |
+ fn func() {
+ println!();
+ }
+ }
+
+}
+
+pub struct NotableStructWithLongName<R>(R);
+
+impl<R: std::io::Read> NotableStructWithLongName<R> {
+ pub fn create_an_iterator_from_read(r: R) -> NotableStructWithLongName<R> { Self(r) }
+}
+
+impl<R: std::io::Read> std::iter::Iterator for NotableStructWithLongName<R> {
+ type Item = ();
+
+ fn next(&mut self) -> Option<Self::Item> { () }
+}
+
+pub trait TraitWithNoDocblocks {
+ fn first_fn(&self);
+ fn second_fn(&self);
+}
+
+pub struct TypeWithNoDocblocks;
+
+impl TypeWithNoDocblocks {
+ fn x() -> Option<Self> {
+ Some(Self)
+ }
+ fn y() -> Option<u32> {
+ // code comment
+ let t = Self::x()?;
+ Some(0)
+ }
+}
+
+impl TypeWithNoDocblocks {
+ pub fn first_fn(&self) {}
+ pub fn second_fn<'a>(&'a self) {
+ let x = 12;
+ let y = "a";
+ let z = false;
+ }
+}
+
+pub unsafe fn unsafe_fn() {}
+
+pub fn safe_fn() {}
+
+#[repr(C)]
+pub struct WithGenerics<T: TraitWithNoDocblocks, S = String, E = WhoLetTheDogOut, P = i8> {
+ s: S,
+ t: T,
+ e: E,
+ p: P,
+}
+
+pub const CONST: u8 = 0;
+
+pub trait TraitWithoutGenerics {
+ const C: u8 = CONST;
+ type T = SomeType;
+
+ fn foo();
}
diff --git a/src/test/rustdoc-gui/theme-change.goml b/src/test/rustdoc-gui/theme-change.goml
index fb1c37ae6..b1de3c366 100644
--- a/src/test/rustdoc-gui/theme-change.goml
+++ b/src/test/rustdoc-gui/theme-change.goml
@@ -1,5 +1,5 @@
// Ensures that the theme change is working as expected.
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
local-storage: {"rustdoc-use-system-theme": "false", "rustdoc-theme": "dark"}
reload:
click: "#settings-menu"
@@ -17,7 +17,7 @@ click: "#theme-dark"
wait-for-css: ("body", { "background-color": "rgb(53, 53, 53)" })
assert-local-storage: { "rustdoc-theme": "dark" }
-goto: file://|DOC_PATH|/settings.html
+goto: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
click: "#theme-light"
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
diff --git a/src/test/rustdoc-gui/theme-in-history.goml b/src/test/rustdoc-gui/theme-in-history.goml
index f576ced1c..c29571728 100644
--- a/src/test/rustdoc-gui/theme-in-history.goml
+++ b/src/test/rustdoc-gui/theme-in-history.goml
@@ -1,5 +1,5 @@
// Ensures that the theme is working when going back in history.
-goto: file://|DOC_PATH|/test_docs/index.html
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
// Set the theme to dark.
local-storage: {
"rustdoc-theme": "dark",
@@ -12,7 +12,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
+goto: "file://" + |DOC_PATH| + "/settings.html"
wait-for: "#settings"
// We change the theme to "light".
click: "#theme-light"
diff --git a/src/test/rustdoc-gui/toggle-click-deadspace.goml b/src/test/rustdoc-gui/toggle-click-deadspace.goml
index 4a328c9f9..029403ee1 100644
--- a/src/test/rustdoc-gui/toggle-click-deadspace.goml
+++ b/src/test/rustdoc-gui/toggle-click-deadspace.goml
@@ -1,12 +1,15 @@
// 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
+goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
click: "h4.code-header" // This is the position of "pub" in "pub fn a_method"
assert-attribute: (".impl-items .rustdoc-toggle", {"open": ""})
-click: ".impl-items .rustdoc-toggle summary::before" // This is the position of "[-]" next to that pub fn.
+click-with-offset: (
+ ".impl-items .rustdoc-toggle summary",
+ {"x": -24, "y": 8}, // This is the position of "[-]" next to that pub fn.
+)
assert-attribute-false: (".impl-items .rustdoc-toggle", {"open": ""})
// Click the "Trait" part of "impl Trait" and verify it navigates.
click: "#impl-Trait-for-Foo h3 a:first-of-type"
-assert-text: (".fqn .in-band", "Trait lib2::Trait")
+assert-text: (".fqn", "Trait lib2::Trait")
diff --git a/src/test/rustdoc-gui/toggle-docs-mobile.goml b/src/test/rustdoc-gui/toggle-docs-mobile.goml
index ee6bc3cf7..6ce24a81b 100644
--- a/src/test/rustdoc-gui/toggle-docs-mobile.goml
+++ b/src/test/rustdoc-gui/toggle-docs-mobile.goml
@@ -1,6 +1,6 @@
// 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
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
size: (433, 600)
assert-attribute: (".top-doc", {"open": ""})
click: (4, 270) // This is the position of the top doc comment toggle
diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml
index 63962b576..8c9fd0a88 100644
--- a/src/test/rustdoc-gui/toggle-docs.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
assert-attribute: ("#main-content > details.top-doc", {"open": ""})
assert-text: ("#toggle-all-docs", "[−]")
click: "#toggle-all-docs"
@@ -13,7 +13,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
+goto: "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.rustdoc-toggle", {"open": ""}, ALL)
diff --git a/src/test/rustdoc-gui/toggle-implementors.goml b/src/test/rustdoc-gui/toggle-implementors.goml
index 15521ff0f..8ff5b91af 100644
--- a/src/test/rustdoc-gui/toggle-implementors.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/implementors/trait.Whatever.html"
assert-attribute-false: ("#implementors-list > details", {"open": ""}, ALL)
diff --git a/src/test/rustdoc-gui/toggled-open-implementations.goml b/src/test/rustdoc-gui/toggled-open-implementations.goml
index bc97b38c8..e4d59b5d7 100644
--- a/src/test/rustdoc-gui/toggled-open-implementations.goml
+++ b/src/test/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
+goto: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
assert-attribute: (".rustdoc-toggle.implementors-toggle", {"open": ""})
diff --git a/src/test/rustdoc-gui/trait-sidebar-item-order.goml b/src/test/rustdoc-gui/trait-sidebar-item-order.goml
index d77d1dca4..a799444a1 100644
--- a/src/test/rustdoc-gui/trait-sidebar-item-order.goml
+++ b/src/test/rustdoc-gui/trait-sidebar-item-order.goml
@@ -1,5 +1,5 @@
// Checks that the elements in the sidebar are alphabetically sorted.
-goto: file://|DOC_PATH|/test_docs/trait.AnotherOne.html
+goto: "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/src/test/rustdoc-gui/type-declation-overflow.goml b/src/test/rustdoc-gui/type-declation-overflow.goml
index 22212a317..fce3002e7 100644
--- a/src/test/rustdoc-gui/type-declation-overflow.goml
+++ b/src/test/rustdoc-gui/type-declation-overflow.goml
@@ -1,5 +1,5 @@
// This test ensures that the items declaration content overflow is handled inside the <pre> directly.
-goto: file://|DOC_PATH|/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html
+goto: "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)
// Logically, the <body> scroll width should be the width of the window.
@@ -8,30 +8,30 @@ assert-property: ("body", {"scrollWidth": "1100"})
assert-property: (".item-decl pre", {"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
+goto: "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
+goto: "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": "825"})
+assert-property: ("#main-content", {"scrollWidth": "840"})
// And now checking that it has scrollable content.
assert-property: (".item-decl pre", {"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
+goto: "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": "825"})
+assert-property: ("#main-content", {"scrollWidth": "840"})
// And now checking that it has scrollable content.
assert-property: (".item-decl pre", {"scrollWidth": "950"})
// On mobile:
size: (600, 600)
-goto: file://|DOC_PATH|/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html
+goto: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"
// It shouldn't have an overflow in the topbar either.
-assert-property: (".mobile-topbar .location", {"scrollWidth": "492"})
-assert-property: (".mobile-topbar .location", {"clientWidth": "492"})
-assert-css: (".mobile-topbar .location", {"overflow-x": "hidden"})
+store-property: (scrollWidth, ".mobile-topbar h2", "scrollWidth")
+assert-property: (".mobile-topbar h2", {"clientWidth": |scrollWidth|})
+assert-css: (".mobile-topbar h2", {"overflow-x": "hidden"})
diff --git a/src/test/rustdoc-gui/unsafe-fn.goml b/src/test/rustdoc-gui/unsafe-fn.goml
new file mode 100644
index 000000000..5e43b85fc
--- /dev/null
+++ b/src/test/rustdoc-gui/unsafe-fn.goml
@@ -0,0 +1,28 @@
+// Check position and color of the `<sup>` for unsafe elements.
+goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
+// If the text isn't displayed, the browser doesn't compute color style correctly...
+show-text: true
+
+compare-elements-property: (
+ "//a[@title='test_docs::safe_fn fn']/..",
+ "//a[@title='test_docs::unsafe_fn fn']/..",
+ ["clientHeight"]
+)
+
+define-function: (
+ "sup-check",
+ // `theme` is the theme being tested.
+ // `color` is the expected color of the `<sup>` element.
+ (theme, color),
+ [
+ // Set the theme.
+ ("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-left sup", {"color": |color|})),
+ ],
+)
+
+call-function: ("sup-check", ("dark", "rgb(221, 221, 221)"))
+call-function: ("sup-check", ("ayu", "rgb(197, 197, 197)"))
+call-function: ("sup-check", ("light", "rgb(0, 0, 0)"))
diff --git a/src/test/rustdoc-gui/where-whitespace.goml b/src/test/rustdoc-gui/where-whitespace.goml
new file mode 100644
index 000000000..776c8ec72
--- /dev/null
+++ b/src/test/rustdoc-gui/where-whitespace.goml
@@ -0,0 +1,27 @@
+// This test ensures that the where conditions are correctly displayed.
+goto: "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>").
+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 .fnname", ".where.fmt-newline", ("y"))
+
+goto: "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)
+
+compare-elements-position-false: ("#method\.new .fnname", "#method\.new .where.fmt-newline", ("y"))
+// We ensure that both the trait name and the struct name are on the same line in
+// "impl<K, T> Whitespace<&K> for WhereWhitespace<T>".
+compare-elements-position: (
+ "#trait-implementations-list .impl h3 .trait",
+ "#trait-implementations-list .impl h3 .struct",
+ ("y"),
+)
+// And we now check that the where condition isn't on the same line.
+compare-elements-position-false: (
+ "#trait-implementations-list .impl h3 .trait",
+ "#trait-implementations-list .impl h3 .where.fmt-newline",
+ ("y"),
+)
diff --git a/src/test/rustdoc-js-std/asrawfd.js b/src/test/rustdoc-js-std/asrawfd.js
index fd228a590..369a34f9c 100644
--- a/src/test/rustdoc-js-std/asrawfd.js
+++ b/src/test/rustdoc-js-std/asrawfd.js
@@ -6,9 +6,9 @@ const EXPECTED = {
'others': [
// Reproduction test for https://github.com/rust-lang/rust/issues/78724
// Validate that type alias methods get the correct path.
- { 'path': 'std::os::unix::io::AsRawFd', 'name': 'as_raw_fd' },
- { 'path': 'std::os::wasi::io::AsRawFd', 'name': 'as_raw_fd' },
+ { 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' },
+ { 'path': 'std::os::fd::AsRawFd', 'name': 'as_raw_fd' },
{ 'path': 'std::os::linux::process::PidFd', 'name': 'as_raw_fd' },
- { 'path': 'std::os::unix::io::RawFd', 'name': 'as_raw_fd' },
+ { 'path': 'std::os::fd::RawFd', 'name': 'as_raw_fd' },
],
};
diff --git a/src/test/rustdoc-json/assoc_items.rs b/src/test/rustdoc-json/assoc_items.rs
index 2ee64c9f6..6d7f6bb96 100644
--- a/src/test/rustdoc-json/assoc_items.rs
+++ b/src/test/rustdoc-json/assoc_items.rs
@@ -1,29 +1,37 @@
#![no_std]
-// @has assoc_items.json
-
pub struct Simple;
impl Simple {
- // @has - "$.index[*][?(@.name=='CONSTANT')].kind" \"assoc_const\"
+ // @is "$.index[*][?(@.name=='CONSTANT')].kind" \"assoc_const\"
pub const CONSTANT: usize = 0;
}
pub trait EasyToImpl {
- // @has - "$.index[*][?(@.name=='ToDeclare')].kind" \"assoc_type\"
- // @has - "$.index[*][?(@.name=='ToDeclare')].inner.default" null
+ // @is "$.index[*][?(@.docs=='ToDeclare trait')].kind" \"assoc_type\"
+ // @is "$.index[*][?(@.docs=='ToDeclare trait')].inner.default" null
+ // @is "$.index[*][?(@.docs=='ToDeclare trait')].inner.bounds" []
+ /// ToDeclare trait
type ToDeclare;
- // @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].kind" \"assoc_const\"
- // @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.default" null
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].kind" \"assoc_const\"
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.default" null
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.type.kind" '"primitive"'
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.type.inner" '"usize"'
+ /// AN_ATTRIBUTE trait
const AN_ATTRIBUTE: usize;
}
impl EasyToImpl for Simple {
- // @has - "$.index[*][?(@.name=='ToDeclare')].inner.default.kind" \"primitive\"
- // @has - "$.index[*][?(@.name=='ToDeclare')].inner.default.inner" \"usize\"
+ // @is "$.index[*][?(@.docs=='ToDeclare impl')].kind" '"assoc_type"'
+ // @is "$.index[*][?(@.docs=='ToDeclare impl')].inner.default.kind" \"primitive\"
+ // @is "$.index[*][?(@.docs=='ToDeclare impl')].inner.default.inner" \"usize\"
+ /// ToDeclare impl
type ToDeclare = usize;
- // @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.type.kind" \"primitive\"
- // @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.type.inner" \"usize\"
- // @has - "$.index[*][?(@.name=='AN_ATTRIBUTE')].inner.default" \"12\"
+
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].kind" '"assoc_const"'
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.type.kind" \"primitive\"
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.type.inner" \"usize\"
+ // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.default" \"12\"
+ /// AN_ATTRIBUTE impl
const AN_ATTRIBUTE: usize = 12;
}
diff --git a/src/test/rustdoc-json/assoc_type.rs b/src/test/rustdoc-json/assoc_type.rs
index 716bb3d28..edc1f73c8 100644
--- a/src/test/rustdoc-json/assoc_type.rs
+++ b/src/test/rustdoc-json/assoc_type.rs
@@ -1,10 +1,9 @@
// Regression test for <https://github.com/rust-lang/rust/issues/98547>.
-// @has assoc_type.json
-// @has - "$.index[*][?(@.name=='Trait')]"
-// @has - "$.index[*][?(@.name=='AssocType')]"
-// @has - "$.index[*][?(@.name=='S')]"
-// @has - "$.index[*][?(@.name=='S2')]"
+// @has "$.index[*][?(@.name=='Trait')]"
+// @has "$.index[*][?(@.name=='AssocType')]"
+// @has "$.index[*][?(@.name=='S')]"
+// @has "$.index[*][?(@.name=='S2')]"
pub trait Trait {
type AssocType;
diff --git a/src/test/rustdoc-json/blanket_impls.rs b/src/test/rustdoc-json/blanket_impls.rs
index edf1a9fe2..c5cc87ca1 100644
--- a/src/test/rustdoc-json/blanket_impls.rs
+++ b/src/test/rustdoc-json/blanket_impls.rs
@@ -2,8 +2,7 @@
#![no_std]
-// @has blanket_impls.json
-// @has - "$.index[*][?(@.name=='Error')].kind" \"assoc_type\"
-// @has - "$.index[*][?(@.name=='Error')].inner.default.kind" \"resolved_path\"
-// @has - "$.index[*][?(@.name=='Error')].inner.default.inner.name" \"Infallible\"
+// @has "$.index[*][?(@.name=='Error')].kind" \"assoc_type\"
+// @has "$.index[*][?(@.name=='Error')].inner.default.kind" \"resolved_path\"
+// @has "$.index[*][?(@.name=='Error')].inner.default.inner.name" \"Infallible\"
pub struct ForBlanketTryFromImpl;
diff --git a/src/test/rustdoc-json/doc_hidden_failure.rs b/src/test/rustdoc-json/doc_hidden_failure.rs
index 5c4ccf996..6573166c4 100644
--- a/src/test/rustdoc-json/doc_hidden_failure.rs
+++ b/src/test/rustdoc-json/doc_hidden_failure.rs
@@ -14,7 +14,7 @@ mod auto {
}
}
-// @count doc_hidden_failure.json "$.index[*][?(@.name=='builders')]" 2
+// @count "$.index[*][?(@.name=='builders')]" 2
pub use auto::*;
pub mod builders {
diff --git a/src/test/rustdoc-json/enums/discriminant/basic.rs b/src/test/rustdoc-json/enums/discriminant/basic.rs
new file mode 100644
index 000000000..8c221615a
--- /dev/null
+++ b/src/test/rustdoc-json/enums/discriminant/basic.rs
@@ -0,0 +1,12 @@
+#[repr(i8)]
+pub enum Ordering {
+ // @is "$.index[*][?(@.name=='Less')].inner.variant_inner.expr" '"-1"'
+ // @is "$.index[*][?(@.name=='Less')].inner.variant_inner.value" '"-1"'
+ Less = -1,
+ // @is "$.index[*][?(@.name=='Equal')].inner.variant_inner.expr" '"0"'
+ // @is "$.index[*][?(@.name=='Equal')].inner.variant_inner.value" '"0"'
+ Equal = 0,
+ // @is "$.index[*][?(@.name=='Greater')].inner.variant_inner.expr" '"1"'
+ // @is "$.index[*][?(@.name=='Greater')].inner.variant_inner.value" '"1"'
+ Greater = 1,
+}
diff --git a/src/test/rustdoc-json/enums/discriminant/expr.rs b/src/test/rustdoc-json/enums/discriminant/expr.rs
new file mode 100644
index 000000000..235b0b473
--- /dev/null
+++ b/src/test/rustdoc-json/enums/discriminant/expr.rs
@@ -0,0 +1,39 @@
+pub enum Foo {
+ // @is "$.index[*][?(@.name=='Addition')].inner.variant_inner.value" '"0"'
+ // @is "$.index[*][?(@.name=='Addition')].inner.variant_inner.expr" '"{ _ }"'
+ Addition = 0 + 0,
+ // @is "$.index[*][?(@.name=='Bin')].inner.variant_inner.value" '"1"'
+ // @is "$.index[*][?(@.name=='Bin')].inner.variant_inner.expr" '"0b1"'
+ Bin = 0b1,
+ // @is "$.index[*][?(@.name=='Oct')].inner.variant_inner.value" '"2"'
+ // @is "$.index[*][?(@.name=='Oct')].inner.variant_inner.expr" '"0o2"'
+ Oct = 0o2,
+ // @is "$.index[*][?(@.name=='PubConst')].inner.variant_inner.value" '"3"'
+ // @is "$.index[*][?(@.name=='PubConst')].inner.variant_inner.expr" '"THREE"'
+ PubConst = THREE,
+ // @is "$.index[*][?(@.name=='Hex')].inner.variant_inner.value" '"4"'
+ // @is "$.index[*][?(@.name=='Hex')].inner.variant_inner.expr" '"0x4"'
+ Hex = 0x4,
+ // @is "$.index[*][?(@.name=='Cast')].inner.variant_inner.value" '"5"'
+ // @is "$.index[*][?(@.name=='Cast')].inner.variant_inner.expr" '"{ _ }"'
+ Cast = 5 as isize,
+ // @is "$.index[*][?(@.name=='PubCall')].inner.variant_inner.value" '"6"'
+ // @is "$.index[*][?(@.name=='PubCall')].inner.variant_inner.expr" '"{ _ }"'
+ PubCall = six(),
+ // @is "$.index[*][?(@.name=='PrivCall')].inner.variant_inner.value" '"7"'
+ // @is "$.index[*][?(@.name=='PrivCall')].inner.variant_inner.expr" '"{ _ }"'
+ PrivCall = seven(),
+ // @is "$.index[*][?(@.name=='PrivConst')].inner.variant_inner.value" '"8"'
+ // @is "$.index[*][?(@.name=='PrivConst')].inner.variant_inner.expr" '"EIGHT"'
+ PrivConst = EIGHT,
+}
+
+pub const THREE: isize = 3;
+const EIGHT: isize = 8;
+
+pub const fn six() -> isize {
+ 6
+}
+const fn seven() -> isize {
+ 7
+}
diff --git a/src/test/rustdoc-json/enums/discriminant/limits.rs b/src/test/rustdoc-json/enums/discriminant/limits.rs
new file mode 100644
index 000000000..8df73d78d
--- /dev/null
+++ b/src/test/rustdoc-json/enums/discriminant/limits.rs
@@ -0,0 +1,43 @@
+// ignore-tidy-linelength
+#![feature(repr128)]
+#![allow(incomplete_features)]
+
+#[repr(u64)]
+pub enum U64 {
+ // @is "$.index[*][?(@.name=='U64Min')].inner.variant_inner.value" '"0"'
+ // @is "$.index[*][?(@.name=='U64Min')].inner.variant_inner.expr" '"u64::MIN"'
+ U64Min = u64::MIN,
+ // @is "$.index[*][?(@.name=='U64Max')].inner.variant_inner.value" '"18446744073709551615"'
+ // @is "$.index[*][?(@.name=='U64Max')].inner.variant_inner.expr" '"u64::MAX"'
+ U64Max = u64::MAX,
+}
+
+#[repr(i64)]
+pub enum I64 {
+ // @is "$.index[*][?(@.name=='I64Min')].inner.variant_inner.value" '"-9223372036854775808"'
+ // @is "$.index[*][?(@.name=='I64Min')].inner.variant_inner.expr" '"i64::MIN"'
+ I64Min = i64::MIN,
+ // @is "$.index[*][?(@.name=='I64Max')].inner.variant_inner.value" '"9223372036854775807"'
+ // @is "$.index[*][?(@.name=='I64Max')].inner.variant_inner.expr" '"i64::MAX"'
+ I64Max = i64::MAX,
+}
+
+#[repr(u128)]
+pub enum U128 {
+ // @is "$.index[*][?(@.name=='U128Min')].inner.variant_inner.value" '"0"'
+ // @is "$.index[*][?(@.name=='U128Min')].inner.variant_inner.expr" '"u128::MIN"'
+ U128Min = u128::MIN,
+ // @is "$.index[*][?(@.name=='U128Max')].inner.variant_inner.value" '"340282366920938463463374607431768211455"'
+ // @is "$.index[*][?(@.name=='U128Max')].inner.variant_inner.expr" '"u128::MAX"'
+ U128Max = u128::MAX,
+}
+
+#[repr(i128)]
+pub enum I128 {
+ // @is "$.index[*][?(@.name=='I128Min')].inner.variant_inner.value" '"-170141183460469231731687303715884105728"'
+ // @is "$.index[*][?(@.name=='I128Min')].inner.variant_inner.expr" '"i128::MIN"'
+ I128Min = i128::MIN,
+ // @is "$.index[*][?(@.name=='I128Max')].inner.variant_inner.value" '"170141183460469231731687303715884105727"'
+ // @is "$.index[*][?(@.name=='I128Max')].inner.variant_inner.expr" '"i128::MAX"'
+ I128Max = i128::MAX,
+}
diff --git a/src/test/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs b/src/test/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs
new file mode 100644
index 000000000..3417baa07
--- /dev/null
+++ b/src/test/rustdoc-json/enums/discriminant/num_underscore_and_suffix.rs
@@ -0,0 +1,15 @@
+#[repr(u32)]
+pub enum Foo {
+ // @is "$.index[*][?(@.name=='Basic')].inner.variant_inner.value" '"0"'
+ // @is "$.index[*][?(@.name=='Basic')].inner.variant_inner.expr" '"0"'
+ Basic = 0,
+ // @is "$.index[*][?(@.name=='Suffix')].inner.variant_inner.value" '"10"'
+ // @is "$.index[*][?(@.name=='Suffix')].inner.variant_inner.expr" '"10u32"'
+ Suffix = 10u32,
+ // @is "$.index[*][?(@.name=='Underscore')].inner.variant_inner.value" '"100"'
+ // @is "$.index[*][?(@.name=='Underscore')].inner.variant_inner.expr" '"1_0_0"'
+ Underscore = 1_0_0,
+ // @is "$.index[*][?(@.name=='SuffixUnderscore')].inner.variant_inner.value" '"1000"'
+ // @is "$.index[*][?(@.name=='SuffixUnderscore')].inner.variant_inner.expr" '"1_0_0_0u32"'
+ SuffixUnderscore = 1_0_0_0u32,
+}
diff --git a/src/test/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs b/src/test/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs
new file mode 100644
index 000000000..6af944a22
--- /dev/null
+++ b/src/test/rustdoc-json/enums/discriminant/only_some_have_discriminant.rs
@@ -0,0 +1,10 @@
+pub enum Foo {
+ // @is "$.index[*][?(@.name=='Has')].inner.variant_inner" '{"expr":"0", "value":"0"}'
+ Has = 0,
+ // @is "$.index[*][?(@.name=='Doesnt')].inner.variant_inner" null
+ Doesnt,
+ // @is "$.index[*][?(@.name=='AlsoDoesnt')].inner.variant_inner" null
+ AlsoDoesnt,
+ // @is "$.index[*][?(@.name=='AlsoHas')].inner.variant_inner" '{"expr":"44", "value":"44"}'
+ AlsoHas = 44,
+}
diff --git a/src/test/rustdoc-json/enums/field_hidden.rs b/src/test/rustdoc-json/enums/field_hidden.rs
new file mode 100644
index 000000000..e6310cc3b
--- /dev/null
+++ b/src/test/rustdoc-json/enums/field_hidden.rs
@@ -0,0 +1,13 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/100529>.
+
+#![no_core]
+#![feature(no_core)]
+
+// @has "$.index[*][?(@.name=='ParseError')]"
+// @has "$.index[*][?(@.name=='UnexpectedEndTag')]"
+// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant_kind" '"tuple"'
+// @is "$.index[*][?(@.name=='UnexpectedEndTag')].inner.variant_inner" [null]
+
+pub enum ParseError {
+ UnexpectedEndTag(#[doc(hidden)] u32),
+}
diff --git a/src/test/rustdoc-json/enums/kind.rs b/src/test/rustdoc-json/enums/kind.rs
new file mode 100644
index 000000000..e9ea3ae23
--- /dev/null
+++ b/src/test/rustdoc-json/enums/kind.rs
@@ -0,0 +1,37 @@
+// ignore-tidy-linelength
+
+#![feature(no_core)]
+#![no_core]
+
+pub enum Foo {
+ // @set Unit = "$.index[*][?(@.name=='Unit')].id"
+ // @is "$.index[*][?(@.name=='Unit')].inner.variant_kind" '"plain"'
+ // @is "$.index[*][?(@.name=='Unit')].inner.variant_inner" null
+ Unit,
+ // @set Named = "$.index[*][?(@.name=='Named')].id"
+ // @is "$.index[*][?(@.name=='Named')].inner.variant_kind" '"struct"'
+ // @is "$.index[*][?(@.name=='Named')].inner.variant_inner" '{"fields": [], "fields_stripped": false}'
+ Named {},
+ // @set Tuple = "$.index[*][?(@.name=='Tuple')].id"
+ // @is "$.index[*][?(@.name=='Tuple')].inner.variant_kind" '"tuple"'
+ // @is "$.index[*][?(@.name=='Tuple')].inner.variant_inner" []
+ Tuple(),
+ // @set NamedField = "$.index[*][?(@.name=='NamedField')].id"
+ // @set x = "$.index[*][?(@.name=='x' && @.kind=='struct_field')].id"
+ // @is "$.index[*][?(@.name=='NamedField')].inner.variant_kind" '"struct"'
+ // @is "$.index[*][?(@.name=='NamedField')].inner.variant_inner.fields[*]" $x
+ // @is "$.index[*][?(@.name=='NamedField')].inner.variant_inner.fields_stripped" false
+ NamedField { x: i32 },
+ // @set TupleField = "$.index[*][?(@.name=='TupleField')].id"
+ // @is "$.index[*][?(@.name=='TupleField')].inner.variant_kind" '"tuple"'
+ // @set tup_field = "$.index[*][?(@.name=='0' && @.kind=='struct_field')].id"
+ // @is "$.index[*][?(@.name=='TupleField')].inner.variant_inner[*]" $tup_field
+ TupleField(i32),
+}
+
+// @is "$.index[*][?(@.name=='Foo')].inner.variants[0]" $Unit
+// @is "$.index[*][?(@.name=='Foo')].inner.variants[1]" $Named
+// @is "$.index[*][?(@.name=='Foo')].inner.variants[2]" $Tuple
+// @is "$.index[*][?(@.name=='Foo')].inner.variants[3]" $NamedField
+// @is "$.index[*][?(@.name=='Foo')].inner.variants[4]" $TupleField
+// @count "$.index[*][?(@.name=='Foo')].inner.variants[*]" 5
diff --git a/src/test/rustdoc-json/enums/struct_field_hidden.rs b/src/test/rustdoc-json/enums/struct_field_hidden.rs
new file mode 100644
index 000000000..f612a34a4
--- /dev/null
+++ b/src/test/rustdoc-json/enums/struct_field_hidden.rs
@@ -0,0 +1,17 @@
+pub enum Foo {
+ Variant {
+ #[doc(hidden)]
+ a: i32,
+ // @set b = "$.index[*][?(@.name=='b')].id"
+ b: i32,
+ #[doc(hidden)]
+ x: i32,
+ // @set y = "$.index[*][?(@.name=='y')].id"
+ y: i32,
+ },
+ // @is "$.index[*][?(@.name=='Variant')].inner.variant_kind" '"struct"'
+ // @is "$.index[*][?(@.name=='Variant')].inner.variant_inner.fields_stripped" true
+ // @is "$.index[*][?(@.name=='Variant')].inner.variant_inner.fields[0]" $b
+ // @is "$.index[*][?(@.name=='Variant')].inner.variant_inner.fields[1]" $y
+ // @count "$.index[*][?(@.name=='Variant')].inner.variant_inner.fields[*]" 2
+}
diff --git a/src/test/rustdoc-json/enums/tuple_fields_hidden.rs b/src/test/rustdoc-json/enums/tuple_fields_hidden.rs
new file mode 100644
index 000000000..f546eaa0d
--- /dev/null
+++ b/src/test/rustdoc-json/enums/tuple_fields_hidden.rs
@@ -0,0 +1,94 @@
+#![feature(no_core)]
+#![no_core]
+
+// @set 1.1.0 = "$.index[*][?(@.docs=='1.1.0')].id"
+// @set 2.1.0 = "$.index[*][?(@.docs=='2.1.0')].id"
+// @set 2.1.1 = "$.index[*][?(@.docs=='2.1.1')].id"
+// @set 2.2.1 = "$.index[*][?(@.docs=='2.2.1')].id"
+// @set 2.3.0 = "$.index[*][?(@.docs=='2.3.0')].id"
+// @set 3.1.1 = "$.index[*][?(@.docs=='3.1.1')].id"
+// @set 3.1.2 = "$.index[*][?(@.docs=='3.1.2')].id"
+// @set 3.2.0 = "$.index[*][?(@.docs=='3.2.0')].id"
+// @set 3.2.2 = "$.index[*][?(@.docs=='3.2.2')].id"
+// @set 3.3.0 = "$.index[*][?(@.docs=='3.3.0')].id"
+// @set 3.3.1 = "$.index[*][?(@.docs=='3.3.1')].id"
+
+pub enum EnumWithStrippedTupleVariants {
+ // @is "$.index[*][?(@.name=='None')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='None')].inner.variant_inner[*]" 0
+ None(),
+
+ // @is "$.index[*][?(@.name=='One')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='One')].inner.variant_inner[*]" 1
+ // @is "$.index[*][?(@.name=='One')].inner.variant_inner[0]" $1.1.0
+ One(/** 1.1.0*/ bool),
+ // @is "$.index[*][?(@.name=='OneHidden')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='OneHidden')].inner.variant_inner[*]" 1
+ // @is "$.index[*][?(@.name=='OneHidden')].inner.variant_inner[0]" null
+ OneHidden(#[doc(hidden)] bool),
+
+ // @is "$.index[*][?(@.name=='Two')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='Two')].inner.variant_inner[*]" 2
+ // @is "$.index[*][?(@.name=='Two')].inner.variant_inner[0]" $2.1.0
+ // @is "$.index[*][?(@.name=='Two')].inner.variant_inner[1]" $2.1.1
+ Two(/** 2.1.0*/ bool, /** 2.1.1*/ bool),
+ // @is "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_inner[*]" 2
+ // @is "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_inner[0]" null
+ // @is "$.index[*][?(@.name=='TwoLeftHidden')].inner.variant_inner[1]" $2.2.1
+ TwoLeftHidden(#[doc(hidden)] bool, /** 2.2.1*/ bool),
+ // @is "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_inner[*]" 2
+ // @is "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_inner[0]" $2.3.0
+ // @is "$.index[*][?(@.name=='TwoRightHidden')].inner.variant_inner[1]" null
+ TwoRightHidden(/** 2.3.0*/ bool, #[doc(hidden)] bool),
+ // @is "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_inner[*]" 2
+ // @is "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_inner[0]" null
+ // @is "$.index[*][?(@.name=='TwoBothHidden')].inner.variant_inner[1]" null
+ TwoBothHidden(#[doc(hidden)] bool, #[doc(hidden)] bool),
+
+ // @is "$.index[*][?(@.name=='Three1')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='Three1')].inner.variant_inner[*]" 3
+ // @is "$.index[*][?(@.name=='Three1')].inner.variant_inner[0]" null
+ // @is "$.index[*][?(@.name=='Three1')].inner.variant_inner[1]" $3.1.1
+ // @is "$.index[*][?(@.name=='Three1')].inner.variant_inner[2]" $3.1.2
+ Three1(#[doc(hidden)] bool, /** 3.1.1*/ bool, /** 3.1.2*/ bool),
+ // @is "$.index[*][?(@.name=='Three2')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='Three2')].inner.variant_inner[*]" 3
+ // @is "$.index[*][?(@.name=='Three2')].inner.variant_inner[0]" $3.2.0
+ // @is "$.index[*][?(@.name=='Three2')].inner.variant_inner[1]" null
+ // @is "$.index[*][?(@.name=='Three2')].inner.variant_inner[2]" $3.2.2
+ Three2(/** 3.2.0*/ bool, #[doc(hidden)] bool, /** 3.2.2*/ bool),
+ // @is "$.index[*][?(@.name=='Three3')].inner.variant_kind" '"tuple"'
+ // @count "$.index[*][?(@.name=='Three3')].inner.variant_inner[*]" 3
+ // @is "$.index[*][?(@.name=='Three3')].inner.variant_inner[0]" $3.3.0
+ // @is "$.index[*][?(@.name=='Three3')].inner.variant_inner[1]" $3.3.1
+ // @is "$.index[*][?(@.name=='Three3')].inner.variant_inner[2]" null
+ Three3(/** 3.3.0*/ bool, /** 3.3.1*/ bool, #[doc(hidden)] bool),
+}
+
+
+// @is "$.index[*][?(@.docs=='1.1.0')].name" '"0"'
+// @is "$.index[*][?(@.docs=='2.1.0')].name" '"0"'
+// @is "$.index[*][?(@.docs=='2.1.1')].name" '"1"'
+// @is "$.index[*][?(@.docs=='2.2.1')].name" '"1"'
+// @is "$.index[*][?(@.docs=='2.3.0')].name" '"0"'
+// @is "$.index[*][?(@.docs=='3.1.1')].name" '"1"'
+// @is "$.index[*][?(@.docs=='3.1.2')].name" '"2"'
+// @is "$.index[*][?(@.docs=='3.2.0')].name" '"0"'
+// @is "$.index[*][?(@.docs=='3.2.2')].name" '"2"'
+// @is "$.index[*][?(@.docs=='3.3.0')].name" '"0"'
+// @is "$.index[*][?(@.docs=='3.3.1')].name" '"1"'
+
+// @is "$.index[*][?(@.docs=='1.1.0')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='2.1.0')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='2.1.1')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='2.2.1')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='2.3.0')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='3.1.1')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='3.1.2')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='3.2.0')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='3.2.2')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='3.3.0')].inner" '{"kind": "primitive", "inner": "bool"}'
+// @is "$.index[*][?(@.docs=='3.3.1')].inner" '{"kind": "primitive", "inner": "bool"}'
diff --git a/src/test/rustdoc-json/enums/variant_struct.rs b/src/test/rustdoc-json/enums/variant_struct.rs
index fcd92887c..23b854d8d 100644
--- a/src/test/rustdoc-json/enums/variant_struct.rs
+++ b/src/test/rustdoc-json/enums/variant_struct.rs
@@ -1,9 +1,9 @@
-// @has variant_struct.json "$.index[*][?(@.name=='EnumStruct')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='EnumStruct')].kind" \"enum\"
+// @is "$.index[*][?(@.name=='EnumStruct')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='EnumStruct')].kind" \"enum\"
pub enum EnumStruct {
- // @has - "$.index[*][?(@.name=='VariantS')].inner.variant_kind" \"struct\"
- // @has - "$.index[*][?(@.name=='x')].kind" \"struct_field\"
- // @has - "$.index[*][?(@.name=='y')].kind" \"struct_field\"
+ // @is "$.index[*][?(@.name=='VariantS')].inner.variant_kind" \"struct\"
+ // @is "$.index[*][?(@.name=='x')].kind" \"struct_field\"
+ // @is "$.index[*][?(@.name=='y')].kind" \"struct_field\"
VariantS {
x: u32,
y: String,
diff --git a/src/test/rustdoc-json/enums/variant_tuple_struct.rs b/src/test/rustdoc-json/enums/variant_tuple_struct.rs
index ac3e72e29..b71ec47a8 100644
--- a/src/test/rustdoc-json/enums/variant_tuple_struct.rs
+++ b/src/test/rustdoc-json/enums/variant_tuple_struct.rs
@@ -1,8 +1,8 @@
-// @has variant_tuple_struct.json "$.index[*][?(@.name=='EnumTupleStruct')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='EnumTupleStruct')].kind" \"enum\"
+// @is "$.index[*][?(@.name=='EnumTupleStruct')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='EnumTupleStruct')].kind" \"enum\"
pub enum EnumTupleStruct {
- // @has - "$.index[*][?(@.name=='VariantA')].inner.variant_kind" \"tuple\"
- // @has - "$.index[*][?(@.name=='0')].kind" \"struct_field\"
- // @has - "$.index[*][?(@.name=='1')].kind" \"struct_field\"
+ // @is "$.index[*][?(@.name=='VariantA')].inner.variant_kind" \"tuple\"
+ // @is "$.index[*][?(@.name=='0')].kind" \"struct_field\"
+ // @is "$.index[*][?(@.name=='1')].kind" \"struct_field\"
VariantA(u32, String),
}
diff --git a/src/test/rustdoc-json/fn_pointer/abi.rs b/src/test/rustdoc-json/fn_pointer/abi.rs
index eef20e60a..3c1a453d1 100644
--- a/src/test/rustdoc-json/fn_pointer/abi.rs
+++ b/src/test/rustdoc-json/fn_pointer/abi.rs
@@ -3,23 +3,23 @@
#![feature(abi_vectorcall)]
#![feature(c_unwind)]
-// @is abi.json "$.index[*][?(@.name=='AbiRust')].inner.type.inner.header.abi" \"Rust\"
+// @is "$.index[*][?(@.name=='AbiRust')].inner.type.inner.header.abi" \"Rust\"
pub type AbiRust = fn();
-// @is - "$.index[*][?(@.name=='AbiC')].inner.type.inner.header.abi" '{"C": {"unwind": false}}'
+// @is "$.index[*][?(@.name=='AbiC')].inner.type.inner.header.abi" '{"C": {"unwind": false}}'
pub type AbiC = extern "C" fn();
-// @is - "$.index[*][?(@.name=='AbiSystem')].inner.type.inner.header.abi" '{"System": {"unwind": false}}'
+// @is "$.index[*][?(@.name=='AbiSystem')].inner.type.inner.header.abi" '{"System": {"unwind": false}}'
pub type AbiSystem = extern "system" fn();
-// @is - "$.index[*][?(@.name=='AbiCUnwind')].inner.type.inner.header.abi" '{"C": {"unwind": true}}'
+// @is "$.index[*][?(@.name=='AbiCUnwind')].inner.type.inner.header.abi" '{"C": {"unwind": true}}'
pub type AbiCUnwind = extern "C-unwind" fn();
-// @is - "$.index[*][?(@.name=='AbiSystemUnwind')].inner.type.inner.header.abi" '{"System": {"unwind": true}}'
+// @is "$.index[*][?(@.name=='AbiSystemUnwind')].inner.type.inner.header.abi" '{"System": {"unwind": true}}'
pub type AbiSystemUnwind = extern "system-unwind" fn();
-// @is - "$.index[*][?(@.name=='AbiVecorcall')].inner.type.inner.header.abi.Other" '"\"vectorcall\""'
+// @is "$.index[*][?(@.name=='AbiVecorcall')].inner.type.inner.header.abi.Other" '"\"vectorcall\""'
pub type AbiVecorcall = extern "vectorcall" fn();
-// @is - "$.index[*][?(@.name=='AbiVecorcallUnwind')].inner.type.inner.header.abi.Other" '"\"vectorcall-unwind\""'
+// @is "$.index[*][?(@.name=='AbiVecorcallUnwind')].inner.type.inner.header.abi.Other" '"\"vectorcall-unwind\""'
pub type AbiVecorcallUnwind = extern "vectorcall-unwind" fn();
diff --git a/src/test/rustdoc-json/fn_pointer/generics.rs b/src/test/rustdoc-json/fn_pointer/generics.rs
index 646f720e6..a93b01ac2 100644
--- a/src/test/rustdoc-json/fn_pointer/generics.rs
+++ b/src/test/rustdoc-json/fn_pointer/generics.rs
@@ -3,12 +3,12 @@
#![feature(no_core)]
#![no_core]
-// @count generics.json "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[*]" 1
-// @is - "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[0][0]" '"val"'
-// @is - "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[0][1].kind" '"borrowed_ref"'
-// @is - "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[0][1].inner.lifetime" \"\'c\"
-// @is - "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.output" '{ "kind": "primitive", "inner": "i32" }'
-// @count - "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.generic_params[*]" 1
-// @is - "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.generic_params[0].name" \"\'c\"
-// @is - "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
+// @count "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[0][0]" '"val"'
+// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[0][1].kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.inputs[0][1].inner.lifetime" \"\'c\"
+// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.decl.output" '{ "kind": "primitive", "inner": "i32" }'
+// @count "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.generic_params[*]" 1
+// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.generic_params[0].name" \"\'c\"
+// @is "$.index[*][?(@.name=='WithHigherRankTraitBounds')].inner.type.inner.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
pub type WithHigherRankTraitBounds = for<'c> fn(val: &'c i32) -> i32;
diff --git a/src/test/rustdoc-json/fn_pointer/qualifiers.rs b/src/test/rustdoc-json/fn_pointer/qualifiers.rs
index 381922085..bd65bb3ee 100644
--- a/src/test/rustdoc-json/fn_pointer/qualifiers.rs
+++ b/src/test/rustdoc-json/fn_pointer/qualifiers.rs
@@ -1,9 +1,9 @@
-// @is qualifiers.json "$.index[*][?(@.name=='FnPointer')].inner.type.inner.header.unsafe" false
-// @is - "$.index[*][?(@.name=='FnPointer')].inner.type.inner.header.const" false
-// @is - "$.index[*][?(@.name=='FnPointer')].inner.type.inner.header.async" false
+// @is "$.index[*][?(@.name=='FnPointer')].inner.type.inner.header.unsafe" false
+// @is "$.index[*][?(@.name=='FnPointer')].inner.type.inner.header.const" false
+// @is "$.index[*][?(@.name=='FnPointer')].inner.type.inner.header.async" false
pub type FnPointer = fn();
-// @is - "$.index[*][?(@.name=='UnsafePointer')].inner.type.inner.header.unsafe" true
-// @is - "$.index[*][?(@.name=='UnsafePointer')].inner.type.inner.header.const" false
-// @is - "$.index[*][?(@.name=='UnsafePointer')].inner.type.inner.header.async" false
+// @is "$.index[*][?(@.name=='UnsafePointer')].inner.type.inner.header.unsafe" true
+// @is "$.index[*][?(@.name=='UnsafePointer')].inner.type.inner.header.const" false
+// @is "$.index[*][?(@.name=='UnsafePointer')].inner.type.inner.header.async" false
pub type UnsafePointer = unsafe fn();
diff --git a/src/test/rustdoc-json/fns/abi.rs b/src/test/rustdoc-json/fns/abi.rs
index 16b579130..0e8b78bc0 100644
--- a/src/test/rustdoc-json/fns/abi.rs
+++ b/src/test/rustdoc-json/fns/abi.rs
@@ -3,23 +3,23 @@
#![feature(abi_vectorcall)]
#![feature(c_unwind)]
-// @is abi.json "$.index[*][?(@.name=='abi_rust')].inner.header.abi" \"Rust\"
+// @is "$.index[*][?(@.name=='abi_rust')].inner.header.abi" \"Rust\"
pub fn abi_rust() {}
-// @is - "$.index[*][?(@.name=='abi_c')].inner.header.abi" '{"C": {"unwind": false}}'
+// @is "$.index[*][?(@.name=='abi_c')].inner.header.abi" '{"C": {"unwind": false}}'
pub extern "C" fn abi_c() {}
-// @is - "$.index[*][?(@.name=='abi_system')].inner.header.abi" '{"System": {"unwind": false}}'
+// @is "$.index[*][?(@.name=='abi_system')].inner.header.abi" '{"System": {"unwind": false}}'
pub extern "system" fn abi_system() {}
-// @is - "$.index[*][?(@.name=='abi_c_unwind')].inner.header.abi" '{"C": {"unwind": true}}'
+// @is "$.index[*][?(@.name=='abi_c_unwind')].inner.header.abi" '{"C": {"unwind": true}}'
pub extern "C-unwind" fn abi_c_unwind() {}
-// @is - "$.index[*][?(@.name=='abi_system_unwind')].inner.header.abi" '{"System": {"unwind": true}}'
+// @is "$.index[*][?(@.name=='abi_system_unwind')].inner.header.abi" '{"System": {"unwind": true}}'
pub extern "system-unwind" fn abi_system_unwind() {}
-// @is - "$.index[*][?(@.name=='abi_vectorcall')].inner.header.abi.Other" '"\"vectorcall\""'
+// @is "$.index[*][?(@.name=='abi_vectorcall')].inner.header.abi.Other" '"\"vectorcall\""'
pub extern "vectorcall" fn abi_vectorcall() {}
-// @is - "$.index[*][?(@.name=='abi_vectorcall_unwind')].inner.header.abi.Other" '"\"vectorcall-unwind\""'
+// @is "$.index[*][?(@.name=='abi_vectorcall_unwind')].inner.header.abi.Other" '"\"vectorcall-unwind\""'
pub extern "vectorcall-unwind" fn abi_vectorcall_unwind() {}
diff --git a/src/test/rustdoc-json/fns/async_return.rs b/src/test/rustdoc-json/fns/async_return.rs
new file mode 100644
index 000000000..b89781ca9
--- /dev/null
+++ b/src/test/rustdoc-json/fns/async_return.rs
@@ -0,0 +1,36 @@
+// edition:2021
+// ignore-tidy-linelength
+
+// Regression test for <https://github.com/rust-lang/rust/issues/101199>
+
+use std::future::Future;
+
+// @is "$.index[*][?(@.name=='get_int')].inner.decl.output" '{"inner": "i32", "kind": "primitive"}'
+// @is "$.index[*][?(@.name=='get_int')].inner.header.async" false
+pub fn get_int() -> i32 {
+ 42
+}
+
+// @is "$.index[*][?(@.name=='get_int_async')].inner.decl.output" '{"inner": "i32", "kind": "primitive"}'
+// @is "$.index[*][?(@.name=='get_int_async')].inner.header.async" true
+pub async fn get_int_async() -> i32 {
+ 42
+}
+
+// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.kind" '"impl_trait"'
+// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.inner[0].trait_bound.trait.name" '"Future"'
+// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].name" '"Output"'
+// @is "$.index[*][?(@.name=='get_int_future')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].binding.equality.type" '{"inner": "i32", "kind": "primitive"}'
+// @is "$.index[*][?(@.name=='get_int_future')].inner.header.async" false
+pub fn get_int_future() -> impl Future<Output = i32> {
+ async { 42 }
+}
+
+// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.kind" '"impl_trait"'
+// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.inner[0].trait_bound.trait.name" '"Future"'
+// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].name" '"Output"'
+// @is "$.index[*][?(@.name=='get_int_future_async')].inner.decl.output.inner[0].trait_bound.trait.args.angle_bracketed.bindings[0].binding.equality.type" '{"inner": "i32", "kind": "primitive"}'
+// @is "$.index[*][?(@.name=='get_int_future_async')].inner.header.async" true
+pub async fn get_int_future_async() -> impl Future<Output = i32> {
+ async { 42 }
+}
diff --git a/src/test/rustdoc-json/fns/generic_args.rs b/src/test/rustdoc-json/fns/generic_args.rs
index 69150443c..eec295efe 100644
--- a/src/test/rustdoc-json/fns/generic_args.rs
+++ b/src/test/rustdoc-json/fns/generic_args.rs
@@ -3,65 +3,65 @@
#![feature(no_core)]
#![no_core]
-// @set foo = generic_args.json "$.index[*][?(@.name=='Foo')].id"
+// @set foo = "$.index[*][?(@.name=='Foo')].id"
pub trait Foo {}
-// @set generic_foo = generic_args.json "$.index[*][?(@.name=='GenericFoo')].id"
+// @set generic_foo = "$.index[*][?(@.name=='GenericFoo')].id"
pub trait GenericFoo<'a> {}
-// @is - "$.index[*][?(@.name=='generics')].inner.generics.where_predicates" "[]"
-// @count - "$.index[*][?(@.name=='generics')].inner.generics.params[*]" 1
-// @is - "$.index[*][?(@.name=='generics')].inner.generics.params[0].name" '"F"'
-// @is - "$.index[*][?(@.name=='generics')].inner.generics.params[0].kind.type.default" 'null'
-// @count - "$.index[*][?(@.name=='generics')].inner.generics.params[0].kind.type.bounds[*]" 1
-// @is - "$.index[*][?(@.name=='generics')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.inner.id" '$foo'
-// @count - "$.index[*][?(@.name=='generics')].inner.decl.inputs[*]" 1
-// @is - "$.index[*][?(@.name=='generics')].inner.decl.inputs[0][0]" '"f"'
-// @is - "$.index[*][?(@.name=='generics')].inner.decl.inputs[0][1].kind" '"generic"'
-// @is - "$.index[*][?(@.name=='generics')].inner.decl.inputs[0][1].inner" '"F"'
+// @is "$.index[*][?(@.name=='generics')].inner.generics.where_predicates" "[]"
+// @count "$.index[*][?(@.name=='generics')].inner.generics.params[*]" 1
+// @is "$.index[*][?(@.name=='generics')].inner.generics.params[0].name" '"F"'
+// @is "$.index[*][?(@.name=='generics')].inner.generics.params[0].kind.type.default" 'null'
+// @count "$.index[*][?(@.name=='generics')].inner.generics.params[0].kind.type.bounds[*]" 1
+// @is "$.index[*][?(@.name=='generics')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" '$foo'
+// @count "$.index[*][?(@.name=='generics')].inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='generics')].inner.decl.inputs[0][0]" '"f"'
+// @is "$.index[*][?(@.name=='generics')].inner.decl.inputs[0][1].kind" '"generic"'
+// @is "$.index[*][?(@.name=='generics')].inner.decl.inputs[0][1].inner" '"F"'
pub fn generics<F: Foo>(f: F) {}
-// @is - "$.index[*][?(@.name=='impl_trait')].inner.generics.where_predicates" "[]"
-// @count - "$.index[*][?(@.name=='impl_trait')].inner.generics.params[*]" 1
-// @is - "$.index[*][?(@.name=='impl_trait')].inner.generics.params[0].name" '"impl Foo"'
-// @is - "$.index[*][?(@.name=='impl_trait')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.inner.id" $foo
-// @count - "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[*]" 1
-// @is - "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][0]" '"f"'
-// @is - "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][1].kind" '"impl_trait"'
-// @count - "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][1].inner[*]" 1
-// @is - "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][1].inner[0].trait_bound.trait.inner.id" $foo
+// @is "$.index[*][?(@.name=='impl_trait')].inner.generics.where_predicates" "[]"
+// @count "$.index[*][?(@.name=='impl_trait')].inner.generics.params[*]" 1
+// @is "$.index[*][?(@.name=='impl_trait')].inner.generics.params[0].name" '"impl Foo"'
+// @is "$.index[*][?(@.name=='impl_trait')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" $foo
+// @count "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][0]" '"f"'
+// @is "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][1].kind" '"impl_trait"'
+// @count "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][1].inner[*]" 1
+// @is "$.index[*][?(@.name=='impl_trait')].inner.decl.inputs[0][1].inner[0].trait_bound.trait.id" $foo
pub fn impl_trait(f: impl Foo) {}
-// @count - "$.index[*][?(@.name=='where_clase')].inner.generics.params[*]" 3
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.params[0].name" '"F"'
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.params[0].kind" '{"type": {"bounds": [], "default": null, "synthetic": false}}'
-// @count - "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[*]" 3
-// @is - "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[0][0]" '"f"'
-// @is - "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[0][1].kind" '"generic"'
-// @is - "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[0][1].inner" '"F"'
-// @count - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[*]" 3
+// @count "$.index[*][?(@.name=='where_clase')].inner.generics.params[*]" 3
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.params[0].name" '"F"'
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.params[0].kind" '{"type": {"bounds": [], "default": null, "synthetic": false}}'
+// @count "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[*]" 3
+// @is "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[0][0]" '"f"'
+// @is "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[0][1].kind" '"generic"'
+// @is "$.index[*][?(@.name=='where_clase')].inner.decl.inputs[0][1].inner" '"F"'
+// @count "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[*]" 3
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[0].bound_predicate.type" '{"inner": "F", "kind": "generic"}'
-// @count - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[0].bound_predicate.bounds[*]" 1
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[0].bound_predicate.bounds[0].trait_bound.trait.inner.id" $foo
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[0].bound_predicate.type" '{"inner": "F", "kind": "generic"}'
+// @count "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[0].bound_predicate.bounds[*]" 1
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[0].bound_predicate.bounds[0].trait_bound.trait.id" $foo
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.type" '{"inner": "G", "kind": "generic"}'
-// @count - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[*]" 1
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.trait.inner.id" $generic_foo
-// @count - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[*]" 1
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[0].name" \"\'a\"
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.generic_params" "[]"
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.type" '{"inner": "G", "kind": "generic"}'
+// @count "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[*]" 1
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.trait.id" $generic_foo
+// @count "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[*]" 1
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[0].name" \"\'a\"
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.bounds[0].trait_bound.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[1].bound_predicate.generic_params" "[]"
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.type.kind" '"borrowed_ref"'
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.type.inner.lifetime" \"\'b\"
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.type.inner.type" '{"inner": "H", "kind": "generic"}'
-// @count - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.bounds[*]" 1
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.bounds[0].trait_bound.trait.inner.id" $foo
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.bounds[0].trait_bound.generic_params" "[]"
-// @count - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.generic_params[*]" 1
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.generic_params[0].name" \"\'b\"
-// @is - "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.type.kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.type.inner.lifetime" \"\'b\"
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.type.inner.type" '{"inner": "H", "kind": "generic"}'
+// @count "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.bounds[*]" 1
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.bounds[0].trait_bound.trait.id" $foo
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.bounds[0].trait_bound.generic_params" "[]"
+// @count "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.generic_params[*]" 1
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.generic_params[0].name" \"\'b\"
+// @is "$.index[*][?(@.name=='where_clase')].inner.generics.where_predicates[2].bound_predicate.generic_params[0].kind" '{ "lifetime": { "outlives": [] } }'
pub fn where_clase<F, G, H>(f: F, g: G, h: H)
where
F: Foo,
diff --git a/src/test/rustdoc-json/fns/generic_returns.rs b/src/test/rustdoc-json/fns/generic_returns.rs
index 1a0f33fe3..a9bc2d5d7 100644
--- a/src/test/rustdoc-json/fns/generic_returns.rs
+++ b/src/test/rustdoc-json/fns/generic_returns.rs
@@ -3,15 +3,15 @@
#![feature(no_core)]
#![no_core]
-// @count generic_returns.json "$.index[*][?(@.name=='generic_returns')].inner.items[*]" 2
+// @count "$.index[*][?(@.name=='generic_returns')].inner.items[*]" 2
-// @set foo = - "$.index[*][?(@.name=='Foo')].id"
+// @set foo = "$.index[*][?(@.name=='Foo')].id"
pub trait Foo {}
-// @is - "$.index[*][?(@.name=='get_foo')].inner.decl.inputs" []
-// @is - "$.index[*][?(@.name=='get_foo')].inner.decl.output.kind" '"impl_trait"'
-// @count - "$.index[*][?(@.name=='get_foo')].inner.decl.output.inner[*]" 1
-// @is - "$.index[*][?(@.name=='get_foo')].inner.decl.output.inner[0].trait_bound.trait.inner.id" $foo
+// @is "$.index[*][?(@.name=='get_foo')].inner.decl.inputs" []
+// @is "$.index[*][?(@.name=='get_foo')].inner.decl.output.kind" '"impl_trait"'
+// @count "$.index[*][?(@.name=='get_foo')].inner.decl.output.inner[*]" 1
+// @is "$.index[*][?(@.name=='get_foo')].inner.decl.output.inner[0].trait_bound.trait.id" $foo
pub fn get_foo() -> impl Foo {
Fooer {}
}
diff --git a/src/test/rustdoc-json/fns/generics.rs b/src/test/rustdoc-json/fns/generics.rs
index e777fabaa..7b70ff1df 100644
--- a/src/test/rustdoc-json/fns/generics.rs
+++ b/src/test/rustdoc-json/fns/generics.rs
@@ -3,24 +3,24 @@
#![feature(no_core)]
#![no_core]
-// @set wham_id = generics.json "$.index[*][?(@.name=='Wham')].id"
+// @set wham_id = "$.index[*][?(@.name=='Wham')].id"
pub trait Wham {}
-// @is - "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.where_predicates" []
-// @count - "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[*]" 1
-// @is - "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[0].name" '"T"'
-// @has - "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[0].kind.type.synthetic" false
-// @has - "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.inner.id" $wham_id
-// @is - "$.index[*][?(@.name=='one_generic_param_fn')].inner.decl.inputs" '[["w", {"inner": "T", "kind": "generic"}]]'
+// @is "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.where_predicates" []
+// @count "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[*]" 1
+// @is "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[0].name" '"T"'
+// @is "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[0].kind.type.synthetic" false
+// @is "$.index[*][?(@.name=='one_generic_param_fn')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" $wham_id
+// @is "$.index[*][?(@.name=='one_generic_param_fn')].inner.decl.inputs" '[["w", {"inner": "T", "kind": "generic"}]]'
pub fn one_generic_param_fn<T: Wham>(w: T) {}
-// @is - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.where_predicates" []
-// @count - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[*]" 1
-// @is - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[0].name" '"impl Wham"'
-// @has - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[0].kind.type.synthetic" true
-// @has - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.inner.id" $wham_id
-// @count - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[*]" 1
-// @is - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[0][0]" '"w"'
-// @is - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[0][1].kind" '"impl_trait"'
-// @is - "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[0][1].inner[0].trait_bound.trait.inner.id" $wham_id
+// @is "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.where_predicates" []
+// @count "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[*]" 1
+// @is "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[0].name" '"impl Wham"'
+// @is "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[0].kind.type.synthetic" true
+// @is "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.generics.params[0].kind.type.bounds[0].trait_bound.trait.id" $wham_id
+// @count "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[0][0]" '"w"'
+// @is "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[0][1].kind" '"impl_trait"'
+// @is "$.index[*][?(@.name=='one_synthetic_generic_param_fn')].inner.decl.inputs[0][1].inner[0].trait_bound.trait.id" $wham_id
pub fn one_synthetic_generic_param_fn(w: impl Wham) {}
diff --git a/src/test/rustdoc-json/fns/qualifiers.rs b/src/test/rustdoc-json/fns/qualifiers.rs
index 5cb3b43e6..7ff542900 100644
--- a/src/test/rustdoc-json/fns/qualifiers.rs
+++ b/src/test/rustdoc-json/fns/qualifiers.rs
@@ -1,33 +1,33 @@
// edition:2018
-// @is qualifiers.json "$.index[*][?(@.name=='nothing_fn')].inner.header.async" false
-// @is - "$.index[*][?(@.name=='nothing_fn')].inner.header.const" false
-// @is - "$.index[*][?(@.name=='nothing_fn')].inner.header.unsafe" false
+// @is "$.index[*][?(@.name=='nothing_fn')].inner.header.async" false
+// @is "$.index[*][?(@.name=='nothing_fn')].inner.header.const" false
+// @is "$.index[*][?(@.name=='nothing_fn')].inner.header.unsafe" false
pub fn nothing_fn() {}
-// @is - "$.index[*][?(@.name=='unsafe_fn')].inner.header.async" false
-// @is - "$.index[*][?(@.name=='unsafe_fn')].inner.header.const" false
-// @is - "$.index[*][?(@.name=='unsafe_fn')].inner.header.unsafe" true
+// @is "$.index[*][?(@.name=='unsafe_fn')].inner.header.async" false
+// @is "$.index[*][?(@.name=='unsafe_fn')].inner.header.const" false
+// @is "$.index[*][?(@.name=='unsafe_fn')].inner.header.unsafe" true
pub unsafe fn unsafe_fn() {}
-// @is - "$.index[*][?(@.name=='const_fn')].inner.header.async" false
-// @is - "$.index[*][?(@.name=='const_fn')].inner.header.const" true
-// @is - "$.index[*][?(@.name=='const_fn')].inner.header.unsafe" false
+// @is "$.index[*][?(@.name=='const_fn')].inner.header.async" false
+// @is "$.index[*][?(@.name=='const_fn')].inner.header.const" true
+// @is "$.index[*][?(@.name=='const_fn')].inner.header.unsafe" false
pub const fn const_fn() {}
-// @is - "$.index[*][?(@.name=='async_fn')].inner.header.async" true
-// @is - "$.index[*][?(@.name=='async_fn')].inner.header.const" false
-// @is - "$.index[*][?(@.name=='async_fn')].inner.header.unsafe" false
+// @is "$.index[*][?(@.name=='async_fn')].inner.header.async" true
+// @is "$.index[*][?(@.name=='async_fn')].inner.header.const" false
+// @is "$.index[*][?(@.name=='async_fn')].inner.header.unsafe" false
pub async fn async_fn() {}
-// @is - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.async" true
-// @is - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.const" false
-// @is - "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.unsafe" true
+// @is "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.async" true
+// @is "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.const" false
+// @is "$.index[*][?(@.name=='async_unsafe_fn')].inner.header.unsafe" true
pub async unsafe fn async_unsafe_fn() {}
-// @is - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.async" false
-// @is - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.const" true
-// @is - "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.unsafe" true
+// @is "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.async" false
+// @is "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.const" true
+// @is "$.index[*][?(@.name=='const_unsafe_fn')].inner.header.unsafe" true
pub const unsafe fn const_unsafe_fn() {}
// It's impossible for a function to be both const and async, so no test for that
diff --git a/src/test/rustdoc-json/generic-associated-types/gats.rs b/src/test/rustdoc-json/generic-associated-types/gats.rs
index 368ff8d8d..e5809783a 100644
--- a/src/test/rustdoc-json/generic-associated-types/gats.rs
+++ b/src/test/rustdoc-json/generic-associated-types/gats.rs
@@ -1,44 +1,42 @@
// ignore-tidy-linelength
#![no_core]
-#![feature(generic_associated_types, lang_items, no_core)]
+#![feature(lang_items, no_core)]
#[lang = "sized"]
pub trait Sized {}
pub trait Display {}
-// @has gats.json
pub trait LendingIterator {
- // @count - "$.index[*][?(@.name=='LendingItem')].inner.generics.params[*]" 1
- // @is - "$.index[*][?(@.name=='LendingItem')].inner.generics.params[*].name" \"\'a\"
- // @count - "$.index[*][?(@.name=='LendingItem')].inner.generics.where_predicates[*]" 1
- // @is - "$.index[*][?(@.name=='LendingItem')].inner.generics.where_predicates[*].bound_predicate.type.inner" \"Self\"
- // @is - "$.index[*][?(@.name=='LendingItem')].inner.generics.where_predicates[*].bound_predicate.bounds[*].outlives" \"\'a\"
- // @count - "$.index[*][?(@.name=='LendingItem')].inner.bounds[*]" 1
+ // @count "$.index[*][?(@.name=='LendingItem')].inner.generics.params[*]" 1
+ // @is "$.index[*][?(@.name=='LendingItem')].inner.generics.params[*].name" \"\'a\"
+ // @count "$.index[*][?(@.name=='LendingItem')].inner.generics.where_predicates[*]" 1
+ // @is "$.index[*][?(@.name=='LendingItem')].inner.generics.where_predicates[*].bound_predicate.type.inner" \"Self\"
+ // @is "$.index[*][?(@.name=='LendingItem')].inner.generics.where_predicates[*].bound_predicate.bounds[*].outlives" \"\'a\"
+ // @count "$.index[*][?(@.name=='LendingItem')].inner.bounds[*]" 1
type LendingItem<'a>: Display
where
Self: 'a;
- // @is - "$.index[*][?(@.name=='lending_next')].inner.decl.output.kind" \"qualified_path\"
- // @count - "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.args.angle_bracketed.args[*]" 1
- // @count - "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.args.angle_bracketed.bindings[*]" 0
- // @is - "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.self_type.inner" \"Self\"
- // @is - "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.name" \"LendingItem\"
+ // @is "$.index[*][?(@.name=='lending_next')].inner.decl.output.kind" \"qualified_path\"
+ // @count "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.args.angle_bracketed.args[*]" 1
+ // @count "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.args.angle_bracketed.bindings[*]" 0
+ // @is "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.self_type.inner" \"Self\"
+ // @is "$.index[*][?(@.name=='lending_next')].inner.decl.output.inner.name" \"LendingItem\"
fn lending_next<'a>(&'a self) -> Self::LendingItem<'a>;
}
-// @has gats.json
pub trait Iterator {
- // @count - "$.index[*][?(@.name=='Item')].inner.generics.params[*]" 0
- // @count - "$.index[*][?(@.name=='Item')].inner.generics.where_predicates[*]" 0
- // @count - "$.index[*][?(@.name=='Item')].inner.bounds[*]" 1
+ // @count "$.index[*][?(@.name=='Item')].inner.generics.params[*]" 0
+ // @count "$.index[*][?(@.name=='Item')].inner.generics.where_predicates[*]" 0
+ // @count "$.index[*][?(@.name=='Item')].inner.bounds[*]" 1
type Item: Display;
- // @is - "$.index[*][?(@.name=='next')].inner.decl.output.kind" \"qualified_path\"
- // @count - "$.index[*][?(@.name=='next')].inner.decl.output.inner.args.angle_bracketed.args[*]" 0
- // @count - "$.index[*][?(@.name=='next')].inner.decl.output.inner.args.angle_bracketed.bindings[*]" 0
- // @is - "$.index[*][?(@.name=='next')].inner.decl.output.inner.self_type.inner" \"Self\"
- // @is - "$.index[*][?(@.name=='next')].inner.decl.output.inner.name" \"Item\"
+ // @is "$.index[*][?(@.name=='next')].inner.decl.output.kind" \"qualified_path\"
+ // @count "$.index[*][?(@.name=='next')].inner.decl.output.inner.args.angle_bracketed.args[*]" 0
+ // @count "$.index[*][?(@.name=='next')].inner.decl.output.inner.args.angle_bracketed.bindings[*]" 0
+ // @is "$.index[*][?(@.name=='next')].inner.decl.output.inner.self_type.inner" \"Self\"
+ // @is "$.index[*][?(@.name=='next')].inner.decl.output.inner.name" \"Item\"
fn next<'a>(&'a self) -> Self::Item;
}
diff --git a/src/test/rustdoc-json/generic_impl.rs b/src/test/rustdoc-json/generic_impl.rs
index ac68ba578..31f41d0f3 100644
--- a/src/test/rustdoc-json/generic_impl.rs
+++ b/src/test/rustdoc-json/generic_impl.rs
@@ -1,9 +1,8 @@
// Regression test for <https://github.com/rust-lang/rust/issues/97986>.
-// @has generic_impl.json
-// @has - "$.index[*][?(@.name=='f')]"
-// @has - "$.index[*][?(@.name=='AssocTy')]"
-// @has - "$.index[*][?(@.name=='AssocConst')]"
+// @has "$.index[*][?(@.name=='f')]"
+// @has "$.index[*][?(@.name=='AssocTy')]"
+// @has "$.index[*][?(@.name=='AssocConst')]"
pub mod m {
pub struct S;
diff --git a/src/test/rustdoc-json/glob_import.rs b/src/test/rustdoc-json/glob_import.rs
index d7ac952d1..00051b121 100644
--- a/src/test/rustdoc-json/glob_import.rs
+++ b/src/test/rustdoc-json/glob_import.rs
@@ -4,9 +4,8 @@
#![no_std]
#![no_core]
-// @has glob_import.json
-// @has - "$.index[*][?(@.name=='glob')]"
-// @has - "$.index[*][?(@.kind=='import')].inner.name" \"*\"
+// @has "$.index[*][?(@.name=='glob')]"
+// @has "$.index[*][?(@.kind=='import')].inner.name" \"*\"
mod m1 {
diff --git a/src/test/rustdoc-json/impls/auto.rs b/src/test/rustdoc-json/impls/auto.rs
new file mode 100644
index 000000000..50d852414
--- /dev/null
+++ b/src/test/rustdoc-json/impls/auto.rs
@@ -0,0 +1,18 @@
+#![feature(no_core, auto_traits, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+
+pub auto trait Bar {}
+
+/// has span
+impl Foo {
+ pub fn baz(&self) {}
+}
+
+// Testing spans, so all tests below code
+// @is "$.index[*][?(@.kind=='impl' && @.inner.synthetic==true)].span" null
+// @is "$.index[*][?(@.docs=='has span')].span.begin" "[10, 0]"
+// @is "$.index[*][?(@.docs=='has span')].span.end" "[12, 1]"
+pub struct Foo;
diff --git a/src/test/rustdoc-json/impls/auxiliary/foreign_struct.rs b/src/test/rustdoc-json/impls/auxiliary/foreign_struct.rs
new file mode 100644
index 000000000..832d0fce5
--- /dev/null
+++ b/src/test/rustdoc-json/impls/auxiliary/foreign_struct.rs
@@ -0,0 +1 @@
+pub struct ForeignStruct;
diff --git a/src/test/rustdoc-json/impls/auxiliary/foreign_trait.rs b/src/test/rustdoc-json/impls/auxiliary/foreign_trait.rs
new file mode 100644
index 000000000..2c81bee61
--- /dev/null
+++ b/src/test/rustdoc-json/impls/auxiliary/foreign_trait.rs
@@ -0,0 +1 @@
+pub trait ForeignTrait {}
diff --git a/src/test/rustdoc-json/impls/blanket_with_local.rs b/src/test/rustdoc-json/impls/blanket_with_local.rs
index a3d55b35f..2fb4a84b9 100644
--- a/src/test/rustdoc-json/impls/blanket_with_local.rs
+++ b/src/test/rustdoc-json/impls/blanket_with_local.rs
@@ -1,11 +1,11 @@
// Test for the ICE in rust/83718
// A blanket impl plus a local type together shouldn't result in mismatched ID issues
-// @has blanket_with_local.json "$.index[*][?(@.name=='Load')]"
+// @has "$.index[*][?(@.name=='Load')]"
pub trait Load {
- // @has - "$.index[*][?(@.name=='load')]"
+ // @has "$.index[*][?(@.name=='load')]"
fn load() {}
- // @has - "$.index[*][?(@.name=='write')]"
+ // @has "$.index[*][?(@.name=='write')]"
fn write(self) {}
}
@@ -14,5 +14,5 @@ impl<P> Load for P {
fn write(self) {}
}
-// @has - "$.index[*][?(@.name=='Wrapper')]"
+// @has "$.index[*][?(@.name=='Wrapper')]"
pub struct Wrapper {}
diff --git a/src/test/rustdoc-json/impls/foreign_for_local.rs b/src/test/rustdoc-json/impls/foreign_for_local.rs
new file mode 100644
index 000000000..290c2d571
--- /dev/null
+++ b/src/test/rustdoc-json/impls/foreign_for_local.rs
@@ -0,0 +1,18 @@
+// aux-build: foreign_trait.rs
+extern crate foreign_trait;
+
+/// ForeignTrait id hack
+pub use foreign_trait::ForeignTrait as _;
+// @set ForeignTrait = "$.index[*][?(@.docs=='ForeignTrait id hack')].inner.id"
+
+pub struct LocalStruct;
+// @set LocalStruct = "$.index[*][?(@.name=='LocalStruct')].id"
+
+/// foreign for local
+impl foreign_trait::ForeignTrait for LocalStruct {}
+
+// @set impl = "$.index[*][?(@.docs=='foreign for local')].id"
+// @is "$.index[*][?(@.docs=='foreign for local')].inner.for.inner.id" $LocalStruct
+// @is "$.index[*][?(@.docs=='foreign for local')].inner.trait.id" $ForeignTrait
+
+// @has "$.index[*][?(@.name=='LocalStruct')].inner.impls[*]" $impl
diff --git a/src/test/rustdoc-json/impls/import_from_private.rs b/src/test/rustdoc-json/impls/import_from_private.rs
new file mode 100644
index 000000000..856f7c701
--- /dev/null
+++ b/src/test/rustdoc-json/impls/import_from_private.rs
@@ -0,0 +1,22 @@
+// https://github.com/rust-lang/rust/issues/100252
+
+#![feature(no_core)]
+#![no_core]
+
+mod bar {
+ // @set baz = "$.index[*][?(@.kind=='struct')].id"
+ pub struct Baz;
+ // @set impl = "$.index[*][?(@.kind=='impl')].id"
+ impl Baz {
+ // @set doit = "$.index[*][?(@.kind=='method')].id"
+ pub fn doit() {}
+ }
+}
+
+// @set import = "$.index[*][?(@.kind=='import')].id"
+pub use bar::Baz;
+
+// @is "$.index[*][?(@.kind=='module')].inner.items[*]" $import
+// @is "$.index[*][?(@.kind=='import')].inner.id" $baz
+// @is "$.index[*][?(@.kind=='struct')].inner.impls[*]" $impl
+// @is "$.index[*][?(@.kind=='impl')].inner.items[*]" $doit
diff --git a/src/test/rustdoc-json/impls/local_for_foreign.rs b/src/test/rustdoc-json/impls/local_for_foreign.rs
new file mode 100644
index 000000000..74f2f08b5
--- /dev/null
+++ b/src/test/rustdoc-json/impls/local_for_foreign.rs
@@ -0,0 +1,18 @@
+// aux-build: foreign_struct.rs
+extern crate foreign_struct;
+
+/// ForeignStruct id hack
+pub use foreign_struct::ForeignStruct as _;
+// @set ForeignStruct = "$.index[*][?(@.docs=='ForeignStruct id hack')].inner.id"
+
+pub trait LocalTrait {}
+// @set LocalTrait = "$.index[*][?(@.name=='LocalTrait')].id"
+
+/// local for foreign
+impl LocalTrait for foreign_struct::ForeignStruct {}
+
+// @set impl = "$.index[*][?(@.docs=='local for foreign')].id"
+// @is "$.index[*][?(@.docs=='local for foreign')].inner.trait.id" $LocalTrait
+// @is "$.index[*][?(@.docs=='local for foreign')].inner.for.inner.id" $ForeignStruct
+
+// @is "$.index[*][?(@.name=='LocalTrait')].inner.implementations[*]" $impl
diff --git a/src/test/rustdoc-json/impls/local_for_local.rs b/src/test/rustdoc-json/impls/local_for_local.rs
new file mode 100644
index 000000000..93dedb7ec
--- /dev/null
+++ b/src/test/rustdoc-json/impls/local_for_local.rs
@@ -0,0 +1,15 @@
+#![feature(no_core)]
+#![no_core]
+
+// @set struct = "$.index[*][?(@.name=='Struct')].id"
+pub struct Struct;
+// @set trait = "$.index[*][?(@.name=='Trait')].id"
+pub trait Trait {}
+// @set impl = "$.index[*][?(@.docs=='impl')].id"
+/// impl
+impl Trait for Struct {}
+
+// @is "$.index[*][?(@.name=='Struct')].inner.impls[*]" $impl
+// @is "$.index[*][?(@.name=='Trait')].inner.implementations[*]" $impl
+// @is "$.index[*][?(@.docs=='impl')].inner.trait.id" $trait
+// @is "$.index[*][?(@.docs=='impl')].inner.for.inner.id" $struct
diff --git a/src/test/rustdoc-json/impls/local_for_local_primitive.rs b/src/test/rustdoc-json/impls/local_for_local_primitive.rs
new file mode 100644
index 000000000..38e7e2658
--- /dev/null
+++ b/src/test/rustdoc-json/impls/local_for_local_primitive.rs
@@ -0,0 +1,21 @@
+#![feature(no_core)]
+#![feature(rustdoc_internals)]
+#![no_core]
+
+// @set Local = "$.index[*][?(@.name=='Local')].id"
+pub trait Local {}
+
+// @is "$.index[*][?(@.docs=='Local for bool')].inner.trait.id" $Local
+// @is "$.index[*][?(@.docs=='Local for bool')].inner.for.kind" '"primitive"'
+// @is "$.index[*][?(@.docs=='Local for bool')].inner.for.inner" '"bool"'
+/// Local for bool
+impl Local for bool {}
+
+// @set impl = "$.index[*][?(@.docs=='Local for bool')].id"
+// @is "$.index[*][?(@.name=='Local')].inner.implementations[*]" $impl
+
+// FIXME(#101695): Test bool's `impls` include "Local for bool"
+// @has "$.index[*][?(@.name=='bool')]"
+#[doc(primitive = "bool")]
+/// Boolean docs
+mod prim_bool {}
diff --git a/src/test/rustdoc-json/impls/local_for_primitive.rs b/src/test/rustdoc-json/impls/local_for_primitive.rs
new file mode 100644
index 000000000..7702a526f
--- /dev/null
+++ b/src/test/rustdoc-json/impls/local_for_primitive.rs
@@ -0,0 +1,7 @@
+// @set local = "$.index[*][?(@.name=='Local')]"
+pub trait Local {}
+
+// @set impl = "$.index[*][?(@.docs=='local for bool')].id"
+// @is "$.index[*][?(@.name=='Local')].inner.implementations[*]" $impl
+/// local for bool
+impl Local for bool {}
diff --git a/src/test/rustdoc-json/intra-doc-links/non_page.rs b/src/test/rustdoc-json/intra-doc-links/non_page.rs
new file mode 100644
index 000000000..73c5334bb
--- /dev/null
+++ b/src/test/rustdoc-json/intra-doc-links/non_page.rs
@@ -0,0 +1,34 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/101531>,
+// where links where to the item who's HTML page had the item linked to.
+
+//! [`Struct::struct_field`]
+//! [`Enum::Variant`]
+//! [`Trait::AssocType`]
+//! [`Trait::ASSOC_CONST`]
+//! [`Trait::method`]
+
+// @set struct_field = "$.index[*][?(@.name=='struct_field')].id"
+// @set Variant = "$.index[*][?(@.name=='Variant')].id"
+// @set AssocType = "$.index[*][?(@.name=='AssocType')].id"
+// @set ASSOC_CONST = "$.index[*][?(@.name=='ASSOC_CONST')].id"
+// @set method = "$.index[*][?(@.name=='method')].id"
+
+// @is "$.index[*][?(@.name=='non_page')].links['`Struct::struct_field`']" $struct_field
+// @is "$.index[*][?(@.name=='non_page')].links['`Enum::Variant`']" $Variant
+// @is "$.index[*][?(@.name=='non_page')].links['`Trait::AssocType`']" $AssocType
+// @is "$.index[*][?(@.name=='non_page')].links['`Trait::ASSOC_CONST`']" $ASSOC_CONST
+// @is "$.index[*][?(@.name=='non_page')].links['`Trait::method`']" $method
+
+pub struct Struct {
+ pub struct_field: i32,
+}
+
+pub enum Enum {
+ Variant(),
+}
+
+pub trait Trait {
+ const ASSOC_CONST: i32;
+ type AssocType;
+ fn method();
+}
diff --git a/src/test/rustdoc-json/intra-doc-links/user_written.rs b/src/test/rustdoc-json/intra-doc-links/user_written.rs
new file mode 100644
index 000000000..6871dfea4
--- /dev/null
+++ b/src/test/rustdoc-json/intra-doc-links/user_written.rs
@@ -0,0 +1,8 @@
+//! For motivation, see [the reasons](foo#reasons)
+
+/// # Reasons
+/// To test rustdoc json
+pub fn foo() {}
+
+// @set foo = "$.index[*][?(@.name=='foo')].id"
+// @is "$.index[*][?(@.name=='user_written')].links['foo#reasons']" $foo
diff --git a/src/test/rustdoc-json/keyword.rs b/src/test/rustdoc-json/keyword.rs
index 78a843aca..3446b212c 100644
--- a/src/test/rustdoc-json/keyword.rs
+++ b/src/test/rustdoc-json/keyword.rs
@@ -6,16 +6,15 @@
#![feature(rustdoc_internals)]
#![no_std]
-// @has keyword.json
-// @!has - "$.index[*][?(@.name=='match')]"
-// @has - "$.index[*][?(@.name=='foo')]"
+// @!has "$.index[*][?(@.name=='match')]"
+// @has "$.index[*][?(@.name=='foo')]"
#[doc(keyword = "match")]
/// this is a test!
pub mod foo {}
-// @!has - "$.index[*][?(@.name=='hello')]"
-// @!has - "$.index[*][?(@.name=='bar')]"
+// @!has "$.index[*][?(@.name=='hello')]"
+// @!has "$.index[*][?(@.name=='bar')]"
#[doc(keyword = "hello")]
/// hello
mod bar {}
diff --git a/src/test/rustdoc-json/lifetime/longest.rs b/src/test/rustdoc-json/lifetime/longest.rs
index 95b99599e..326dab8e5 100644
--- a/src/test/rustdoc-json/lifetime/longest.rs
+++ b/src/test/rustdoc-json/lifetime/longest.rs
@@ -3,30 +3,30 @@
#![feature(no_core)]
#![no_core]
-// @is longest.json "$.index[*][?(@.name=='longest')].inner.generics.params[0].name" \"\'a\"
-// @is - "$.index[*][?(@.name=='longest')].inner.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
-// @is - "$.index[*][?(@.name=='longest')].inner.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
-// @count - "$.index[*][?(@.name=='longest')].inner.generics.params[*]" 1
-// @is - "$.index[*][?(@.name=='longest')].inner.generics.where_predicates" []
+// @is "$.index[*][?(@.name=='longest')].inner.generics.params[0].name" \"\'a\"
+// @is "$.index[*][?(@.name=='longest')].inner.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
+// @is "$.index[*][?(@.name=='longest')].inner.generics.params[0].kind" '{"lifetime": {"outlives": []}}'
+// @count "$.index[*][?(@.name=='longest')].inner.generics.params[*]" 1
+// @is "$.index[*][?(@.name=='longest')].inner.generics.where_predicates" []
-// @count - "$.index[*][?(@.name=='longest')].inner.decl.inputs[*]" 2
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][0]" '"l"'
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][0]" '"r"'
+// @count "$.index[*][?(@.name=='longest')].inner.decl.inputs[*]" 2
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][0]" '"l"'
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][0]" '"r"'
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].kind" '"borrowed_ref"'
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].inner.lifetime" \"\'a\"
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].inner.mutable" false
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].inner.type" '{"inner": "str", "kind": "primitive"}'
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].inner.mutable" false
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[0][1].inner.type" '{"inner": "str", "kind": "primitive"}'
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].kind" '"borrowed_ref"'
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].inner.lifetime" \"\'a\"
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].inner.mutable" false
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].inner.type" '{"inner": "str", "kind": "primitive"}'
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].inner.mutable" false
+// @is "$.index[*][?(@.name=='longest')].inner.decl.inputs[1][1].inner.type" '{"inner": "str", "kind": "primitive"}'
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.output.kind" '"borrowed_ref"'
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.output.inner.lifetime" \"\'a\"
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.output.inner.mutable" false
-// @is - "$.index[*][?(@.name=='longest')].inner.decl.output.inner.type" '{"inner": "str", "kind": "primitive"}'
+// @is "$.index[*][?(@.name=='longest')].inner.decl.output.kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='longest')].inner.decl.output.inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='longest')].inner.decl.output.inner.mutable" false
+// @is "$.index[*][?(@.name=='longest')].inner.decl.output.inner.type" '{"inner": "str", "kind": "primitive"}'
pub fn longest<'a>(l: &'a str, r: &'a str) -> &'a str {
if l.len() > r.len() { l } else { r }
diff --git a/src/test/rustdoc-json/lifetime/outlives.rs b/src/test/rustdoc-json/lifetime/outlives.rs
index 096dd7f7a..e15a533ef 100644
--- a/src/test/rustdoc-json/lifetime/outlives.rs
+++ b/src/test/rustdoc-json/lifetime/outlives.rs
@@ -3,21 +3,21 @@
#![feature(no_core)]
#![no_core]
-// @count outlives.json "$.index[*][?(@.name=='foo')].inner.generics.params[*]" 3
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.where_predicates" []
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.params[0].name" \"\'a\"
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.params[1].name" \"\'b\"
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.params[2].name" '"T"'
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.params[0].kind.lifetime.outlives" []
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.params[1].kind.lifetime.outlives" [\"\'a\"]
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.params[2].kind.type.default" null
-// @count - "$.index[*][?(@.name=='foo')].inner.generics.params[2].kind.type.bounds[*]" 1
-// @is - "$.index[*][?(@.name=='foo')].inner.generics.params[2].kind.type.bounds[0].outlives" \"\'b\"
-// @is - "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].kind" '"borrowed_ref"'
-// @is - "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.lifetime" \"\'a\"
-// @is - "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.mutable" false
-// @is - "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.kind" '"borrowed_ref"'
-// @is - "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.inner.lifetime" \"\'b\"
-// @is - "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.inner.mutable" false
-// @is - "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.inner.type" '{"inner": "T", "kind": "generic"}'
+// @count "$.index[*][?(@.name=='foo')].inner.generics.params[*]" 3
+// @is "$.index[*][?(@.name=='foo')].inner.generics.where_predicates" []
+// @is "$.index[*][?(@.name=='foo')].inner.generics.params[0].name" \"\'a\"
+// @is "$.index[*][?(@.name=='foo')].inner.generics.params[1].name" \"\'b\"
+// @is "$.index[*][?(@.name=='foo')].inner.generics.params[2].name" '"T"'
+// @is "$.index[*][?(@.name=='foo')].inner.generics.params[0].kind.lifetime.outlives" []
+// @is "$.index[*][?(@.name=='foo')].inner.generics.params[1].kind.lifetime.outlives" [\"\'a\"]
+// @is "$.index[*][?(@.name=='foo')].inner.generics.params[2].kind.type.default" null
+// @count "$.index[*][?(@.name=='foo')].inner.generics.params[2].kind.type.bounds[*]" 1
+// @is "$.index[*][?(@.name=='foo')].inner.generics.params[2].kind.type.bounds[0].outlives" \"\'b\"
+// @is "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.mutable" false
+// @is "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.inner.lifetime" \"\'b\"
+// @is "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.inner.mutable" false
+// @is "$.index[*][?(@.name=='foo')].inner.decl.inputs[0][1].inner.type.inner.type" '{"inner": "T", "kind": "generic"}'
pub fn foo<'a, 'b: 'a, T: 'b>(_: &'a &'b T) {}
diff --git a/src/test/rustdoc-json/methods/abi.rs b/src/test/rustdoc-json/methods/abi.rs
index 07b01d03b..4c97d97ce 100644
--- a/src/test/rustdoc-json/methods/abi.rs
+++ b/src/test/rustdoc-json/methods/abi.rs
@@ -5,51 +5,51 @@
#![feature(no_core)]
#![no_core]
-// @has abi.json "$.index[*][?(@.name=='Foo')]"
+// @has "$.index[*][?(@.name=='Foo')]"
pub struct Foo;
impl Foo {
- // @is - "$.index[*][?(@.name=='abi_rust')].inner.header.abi" \"Rust\"
+ // @is "$.index[*][?(@.name=='abi_rust')].inner.header.abi" \"Rust\"
pub fn abi_rust() {}
- // @is - "$.index[*][?(@.name=='abi_c')].inner.header.abi" '{"C": {"unwind": false}}'
+ // @is "$.index[*][?(@.name=='abi_c')].inner.header.abi" '{"C": {"unwind": false}}'
pub extern "C" fn abi_c() {}
- // @is - "$.index[*][?(@.name=='abi_system')].inner.header.abi" '{"System": {"unwind": false}}'
+ // @is "$.index[*][?(@.name=='abi_system')].inner.header.abi" '{"System": {"unwind": false}}'
pub extern "system" fn abi_system() {}
- // @is - "$.index[*][?(@.name=='abi_c_unwind')].inner.header.abi" '{"C": {"unwind": true}}'
+ // @is "$.index[*][?(@.name=='abi_c_unwind')].inner.header.abi" '{"C": {"unwind": true}}'
pub extern "C-unwind" fn abi_c_unwind() {}
- // @is - "$.index[*][?(@.name=='abi_system_unwind')].inner.header.abi" '{"System": {"unwind": true}}'
+ // @is "$.index[*][?(@.name=='abi_system_unwind')].inner.header.abi" '{"System": {"unwind": true}}'
pub extern "system-unwind" fn abi_system_unwind() {}
- // @is - "$.index[*][?(@.name=='abi_vectorcall')].inner.header.abi.Other" '"\"vectorcall\""'
+ // @is "$.index[*][?(@.name=='abi_vectorcall')].inner.header.abi.Other" '"\"vectorcall\""'
pub extern "vectorcall" fn abi_vectorcall() {}
- // @is - "$.index[*][?(@.name=='abi_vectorcall_unwind')].inner.header.abi.Other" '"\"vectorcall-unwind\""'
+ // @is "$.index[*][?(@.name=='abi_vectorcall_unwind')].inner.header.abi.Other" '"\"vectorcall-unwind\""'
pub extern "vectorcall-unwind" fn abi_vectorcall_unwind() {}
}
pub trait Bar {
- // @is - "$.index[*][?(@.name=='trait_abi_rust')].inner.header.abi" \"Rust\"
+ // @is "$.index[*][?(@.name=='trait_abi_rust')].inner.header.abi" \"Rust\"
fn trait_abi_rust() {}
- // @is - "$.index[*][?(@.name=='trait_abi_c')].inner.header.abi" '{"C": {"unwind": false}}'
+ // @is "$.index[*][?(@.name=='trait_abi_c')].inner.header.abi" '{"C": {"unwind": false}}'
extern "C" fn trait_abi_c() {}
- // @is - "$.index[*][?(@.name=='trait_abi_system')].inner.header.abi" '{"System": {"unwind": false}}'
+ // @is "$.index[*][?(@.name=='trait_abi_system')].inner.header.abi" '{"System": {"unwind": false}}'
extern "system" fn trait_abi_system() {}
- // @is - "$.index[*][?(@.name=='trait_abi_c_unwind')].inner.header.abi" '{"C": {"unwind": true}}'
+ // @is "$.index[*][?(@.name=='trait_abi_c_unwind')].inner.header.abi" '{"C": {"unwind": true}}'
extern "C-unwind" fn trait_abi_c_unwind() {}
- // @is - "$.index[*][?(@.name=='trait_abi_system_unwind')].inner.header.abi" '{"System": {"unwind": true}}'
+ // @is "$.index[*][?(@.name=='trait_abi_system_unwind')].inner.header.abi" '{"System": {"unwind": true}}'
extern "system-unwind" fn trait_abi_system_unwind() {}
- // @is - "$.index[*][?(@.name=='trait_abi_vectorcall')].inner.header.abi.Other" '"\"vectorcall\""'
+ // @is "$.index[*][?(@.name=='trait_abi_vectorcall')].inner.header.abi.Other" '"\"vectorcall\""'
extern "vectorcall" fn trait_abi_vectorcall() {}
- // @is - "$.index[*][?(@.name=='trait_abi_vectorcall_unwind')].inner.header.abi.Other" '"\"vectorcall-unwind\""'
+ // @is "$.index[*][?(@.name=='trait_abi_vectorcall_unwind')].inner.header.abi.Other" '"\"vectorcall-unwind\""'
extern "vectorcall-unwind" fn trait_abi_vectorcall_unwind() {}
}
diff --git a/src/test/rustdoc-json/methods/qualifiers.rs b/src/test/rustdoc-json/methods/qualifiers.rs
index af36d36b6..b9a5e5601 100644
--- a/src/test/rustdoc-json/methods/qualifiers.rs
+++ b/src/test/rustdoc-json/methods/qualifiers.rs
@@ -3,34 +3,34 @@
pub struct Foo;
impl Foo {
- // @is qualifiers.json "$.index[*][?(@.name=='const_meth')].inner.header.async" false
- // @is - "$.index[*][?(@.name=='const_meth')].inner.header.const" true
- // @is - "$.index[*][?(@.name=='const_meth')].inner.header.unsafe" false
+ // @is "$.index[*][?(@.name=='const_meth')].inner.header.async" false
+ // @is "$.index[*][?(@.name=='const_meth')].inner.header.const" true
+ // @is "$.index[*][?(@.name=='const_meth')].inner.header.unsafe" false
pub const fn const_meth() {}
- // @is - "$.index[*][?(@.name=='nothing_meth')].inner.header.async" false
- // @is - "$.index[*][?(@.name=='nothing_meth')].inner.header.const" false
- // @is - "$.index[*][?(@.name=='nothing_meth')].inner.header.unsafe" false
+ // @is "$.index[*][?(@.name=='nothing_meth')].inner.header.async" false
+ // @is "$.index[*][?(@.name=='nothing_meth')].inner.header.const" false
+ // @is "$.index[*][?(@.name=='nothing_meth')].inner.header.unsafe" false
pub fn nothing_meth() {}
- // @is - "$.index[*][?(@.name=='unsafe_meth')].inner.header.async" false
- // @is - "$.index[*][?(@.name=='unsafe_meth')].inner.header.const" false
- // @is - "$.index[*][?(@.name=='unsafe_meth')].inner.header.unsafe" true
+ // @is "$.index[*][?(@.name=='unsafe_meth')].inner.header.async" false
+ // @is "$.index[*][?(@.name=='unsafe_meth')].inner.header.const" false
+ // @is "$.index[*][?(@.name=='unsafe_meth')].inner.header.unsafe" true
pub unsafe fn unsafe_meth() {}
- // @is - "$.index[*][?(@.name=='async_meth')].inner.header.async" true
- // @is - "$.index[*][?(@.name=='async_meth')].inner.header.const" false
- // @is - "$.index[*][?(@.name=='async_meth')].inner.header.unsafe" false
+ // @is "$.index[*][?(@.name=='async_meth')].inner.header.async" true
+ // @is "$.index[*][?(@.name=='async_meth')].inner.header.const" false
+ // @is "$.index[*][?(@.name=='async_meth')].inner.header.unsafe" false
pub async fn async_meth() {}
- // @is - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.async" true
- // @is - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.const" false
- // @is - "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.unsafe" true
+ // @is "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.async" true
+ // @is "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.const" false
+ // @is "$.index[*][?(@.name=='async_unsafe_meth')].inner.header.unsafe" true
pub async unsafe fn async_unsafe_meth() {}
- // @is - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.async" false
- // @is - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.const" true
- // @is - "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.unsafe" true
+ // @is "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.async" false
+ // @is "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.const" true
+ // @is "$.index[*][?(@.name=='const_unsafe_meth')].inner.header.unsafe" true
pub const unsafe fn const_unsafe_meth() {}
// It's impossible for a method to be both const and async, so no test for that
diff --git a/src/test/rustdoc-json/nested.rs b/src/test/rustdoc-json/nested.rs
index b0e717d8a..ee2d2efa9 100644
--- a/src/test/rustdoc-json/nested.rs
+++ b/src/test/rustdoc-json/nested.rs
@@ -1,30 +1,31 @@
// edition:2018
// compile-flags: --crate-version 1.0.0
-// @is nested.json "$.crate_version" \"1.0.0\"
-// @is - "$.index[*][?(@.name=='nested')].kind" \"module\"
-// @is - "$.index[*][?(@.name=='nested')].inner.is_crate" true
-// @count - "$.index[*][?(@.name=='nested')].inner.items[*]" 1
+// @is "$.crate_version" \"1.0.0\"
+// @is "$.index[*][?(@.name=='nested')].kind" \"module\"
+// @is "$.index[*][?(@.name=='nested')].inner.is_crate" true
-// @is nested.json "$.index[*][?(@.name=='l1')].kind" \"module\"
-// @is - "$.index[*][?(@.name=='l1')].inner.is_crate" false
-// @count - "$.index[*][?(@.name=='l1')].inner.items[*]" 2
-pub mod l1 {
+// @set l1_id = "$.index[*][?(@.name=='l1')].id"
+// @ismany "$.index[*][?(@.name=='nested')].inner.items[*]" $l1_id
- // @is nested.json "$.index[*][?(@.name=='l3')].kind" \"module\"
- // @is - "$.index[*][?(@.name=='l3')].inner.is_crate" false
- // @count - "$.index[*][?(@.name=='l3')].inner.items[*]" 1
- // @set l3_id = - "$.index[*][?(@.name=='l3')].id"
- // @has - "$.index[*][?(@.name=='l1')].inner.items[*]" $l3_id
+// @is "$.index[*][?(@.name=='l1')].kind" \"module\"
+// @is "$.index[*][?(@.name=='l1')].inner.is_crate" false
+pub mod l1 {
+ // @is "$.index[*][?(@.name=='l3')].kind" \"module\"
+ // @is "$.index[*][?(@.name=='l3')].inner.is_crate" false
+ // @set l3_id = "$.index[*][?(@.name=='l3')].id"
pub mod l3 {
- // @is nested.json "$.index[*][?(@.name=='L4')].kind" \"struct\"
- // @is - "$.index[*][?(@.name=='L4')].inner.struct_type" \"unit\"
- // @set l4_id = - "$.index[*][?(@.name=='L4')].id"
- // @has - "$.index[*][?(@.name=='l3')].inner.items[*]" $l4_id
+ // @is "$.index[*][?(@.name=='L4')].kind" \"struct\"
+ // @is "$.index[*][?(@.name=='L4')].inner.kind" \"unit\"
+ // @set l4_id = "$.index[*][?(@.name=='L4')].id"
+ // @ismany "$.index[*][?(@.name=='l3')].inner.items[*]" $l4_id
pub struct L4;
}
- // @is nested.json "$.index[*][?(@.inner.source=='l3::L4')].kind" \"import\"
- // @is - "$.index[*][?(@.inner.source=='l3::L4')].inner.glob" false
+ // @is "$.index[*][?(@.inner.source=='l3::L4')].kind" \"import\"
+ // @is "$.index[*][?(@.inner.source=='l3::L4')].inner.glob" false
+ // @is "$.index[*][?(@.inner.source=='l3::L4')].inner.id" $l4_id
+ // @set l4_use_id = "$.index[*][?(@.inner.source=='l3::L4')].id"
pub use l3::L4;
}
+// @ismany "$.index[*][?(@.name=='l1')].inner.items[*]" $l3_id $l4_use_id
diff --git a/src/test/rustdoc-json/output_generics.rs b/src/test/rustdoc-json/output_generics.rs
index d80656c7f..04b1a358f 100644
--- a/src/test/rustdoc-json/output_generics.rs
+++ b/src/test/rustdoc-json/output_generics.rs
@@ -2,12 +2,11 @@
// This is a regression test for #98009.
-// @has output_generics.json
-// @has - "$.index[*][?(@.name=='this_compiles')]"
-// @has - "$.index[*][?(@.name=='this_does_not')]"
-// @has - "$.index[*][?(@.name=='Events')]"
-// @has - "$.index[*][?(@.name=='Other')]"
-// @has - "$.index[*][?(@.name=='Trait')]"
+// @has "$.index[*][?(@.name=='this_compiles')]"
+// @has "$.index[*][?(@.name=='this_does_not')]"
+// @has "$.index[*][?(@.name=='Events')]"
+// @has "$.index[*][?(@.name=='Other')]"
+// @has "$.index[*][?(@.name=='Trait')]"
struct Events<R>(R);
diff --git a/src/test/rustdoc-json/primitive.rs b/src/test/rustdoc-json/primitive.rs
deleted file mode 100644
index b84c2f7c6..000000000
--- a/src/test/rustdoc-json/primitive.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// edition:2018
-
-#![feature(rustdoc_internals)]
-
-#[doc(primitive = "usize")]
-mod usize {}
-
-// @set local_crate_id = primitive.json "$.index[*][?(@.name=='primitive')].crate_id"
-
-// @has - "$.index[*][?(@.name=='log10')]"
-// @!is - "$.index[*][?(@.name=='log10')].crate_id" $local_crate_id
-// @has - "$.index[*][?(@.name=='checked_add')]"
-// @!is - "$.index[*][?(@.name=='checked_add')]" $local_crate_id
-// @!has - "$.index[*][?(@.name=='is_ascii_uppercase')]"
diff --git a/src/test/rustdoc-json/primitives.rs b/src/test/rustdoc-json/primitives.rs
deleted file mode 100644
index fd04f04da..000000000
--- a/src/test/rustdoc-json/primitives.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-#![feature(never_type)]
-
-// @has primitives.json "$.index[*][?(@.name=='PrimNever')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='PrimNever')].inner.type.kind" \"primitive\"
-// @has - "$.index[*][?(@.name=='PrimNever')].inner.type.inner" \"never\"
-pub type PrimNever = !;
-
-// @has - "$.index[*][?(@.name=='PrimStr')].inner.type.kind" \"primitive\"
-// @has - "$.index[*][?(@.name=='PrimStr')].inner.type.inner" \"str\"
-pub type PrimStr = str;
-
-// @has - "$.index[*][?(@.name=='PrimBool')].inner.type.kind" \"primitive\"
-// @has - "$.index[*][?(@.name=='PrimBool')].inner.type.inner" \"bool\"
-pub type PrimBool = bool;
-
-// @has - "$.index[*][?(@.name=='PrimChar')].inner.type.kind" \"primitive\"
-// @has - "$.index[*][?(@.name=='PrimChar')].inner.type.inner" \"char\"
-pub type PrimChar = char;
-
-// @has - "$.index[*][?(@.name=='PrimU8')].inner.type.kind" \"primitive\"
-// @has - "$.index[*][?(@.name=='PrimU8')].inner.type.inner" \"u8\"
-pub type PrimU8 = u8;
diff --git a/src/test/rustdoc-json/primitives/primitive_impls.rs b/src/test/rustdoc-json/primitives/primitive_impls.rs
new file mode 100644
index 000000000..1fc937406
--- /dev/null
+++ b/src/test/rustdoc-json/primitives/primitive_impls.rs
@@ -0,0 +1,34 @@
+#![feature(no_core)]
+#![feature(rustc_attrs)]
+#![feature(rustdoc_internals)]
+#![no_core]
+#![rustc_coherence_is_core]
+
+// @set impl_i32 = "$.index[*][?(@.docs=='Only core can do this')].id"
+
+/// Only core can do this
+impl i32 {
+ // @set identity = "$.index[*][?(@.docs=='Do Nothing')].id"
+
+ /// Do Nothing
+ pub fn identity(self) -> Self {
+ self
+ }
+
+ // @is "$.index[*][?(@.docs=='Only core can do this')].inner.items[*]" $identity
+}
+
+// @set Trait = "$.index[*][?(@.name=='Trait')].id"
+pub trait Trait {}
+// @set impl_trait_for_i32 = "$.index[*][?(@.docs=='impl Trait for i32')].id"
+/// impl Trait for i32
+impl Trait for i32 {}
+
+/// i32
+#[doc(primitive = "i32")]
+mod prim_i32 {}
+
+// @set i32 = "$.index[*][?(@.docs=='i32')].id"
+// @is "$.index[*][?(@.docs=='i32')].name" '"i32"'
+// @is "$.index[*][?(@.docs=='i32')].inner.name" '"i32"'
+// @ismany "$.index[*][?(@.docs=='i32')].inner.impls[*]" $impl_i32 $impl_trait_for_i32
diff --git a/src/test/rustdoc-json/primitive_overloading.rs b/src/test/rustdoc-json/primitives/primitive_overloading.rs
index a10d5a837..56b35cd14 100644
--- a/src/test/rustdoc-json/primitive_overloading.rs
+++ b/src/test/rustdoc-json/primitives/primitive_overloading.rs
@@ -7,9 +7,8 @@
#![no_core]
-// @has primitive_overloading.json
-// @has - "$.index[*][?(@.name=='usize')]"
-// @has - "$.index[*][?(@.name=='prim')]"
+// @has "$.index[*][?(@.name=='usize')]"
+// @has "$.index[*][?(@.name=='prim')]"
#[doc(primitive = "usize")]
/// This is the built-in type `usize`.
diff --git a/src/test/rustdoc-json/primitives/primitive_type.rs b/src/test/rustdoc-json/primitives/primitive_type.rs
new file mode 100644
index 000000000..8024044bc
--- /dev/null
+++ b/src/test/rustdoc-json/primitives/primitive_type.rs
@@ -0,0 +1,22 @@
+#![feature(never_type)]
+
+// @is "$.index[*][?(@.name=='PrimNever')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='PrimNever')].inner.type.kind" \"primitive\"
+// @is "$.index[*][?(@.name=='PrimNever')].inner.type.inner" \"never\"
+pub type PrimNever = !;
+
+// @is "$.index[*][?(@.name=='PrimStr')].inner.type.kind" \"primitive\"
+// @is "$.index[*][?(@.name=='PrimStr')].inner.type.inner" \"str\"
+pub type PrimStr = str;
+
+// @is "$.index[*][?(@.name=='PrimBool')].inner.type.kind" \"primitive\"
+// @is "$.index[*][?(@.name=='PrimBool')].inner.type.inner" \"bool\"
+pub type PrimBool = bool;
+
+// @is "$.index[*][?(@.name=='PrimChar')].inner.type.kind" \"primitive\"
+// @is "$.index[*][?(@.name=='PrimChar')].inner.type.inner" \"char\"
+pub type PrimChar = char;
+
+// @is "$.index[*][?(@.name=='PrimU8')].inner.type.kind" \"primitive\"
+// @is "$.index[*][?(@.name=='PrimU8')].inner.type.inner" \"u8\"
+pub type PrimU8 = u8;
diff --git a/src/test/rustdoc-json/primitives/use_primitive.rs b/src/test/rustdoc-json/primitives/use_primitive.rs
new file mode 100644
index 000000000..e22927374
--- /dev/null
+++ b/src/test/rustdoc-json/primitives/use_primitive.rs
@@ -0,0 +1,20 @@
+// edition:2018
+
+#![feature(rustdoc_internals)]
+
+#[doc(primitive = "usize")]
+mod usize {}
+
+// @set local_crate_id = "$.index[*][?(@.name=='use_primitive')].crate_id"
+
+// @has "$.index[*][?(@.name=='ilog10')]"
+// @!is "$.index[*][?(@.name=='ilog10')].crate_id" $local_crate_id
+// @has "$.index[*][?(@.name=='checked_add')]"
+// @!is "$.index[*][?(@.name=='checked_add')]" $local_crate_id
+// @!has "$.index[*][?(@.name=='is_ascii_uppercase')]"
+
+// @is "$.index[*][?(@.kind=='import' && @.inner.name=='my_i32')].inner.id" null
+pub use i32 as my_i32;
+
+// @is "$.index[*][?(@.kind=='import' && @.inner.name=='u32')].inner.id" null
+pub use u32;
diff --git a/src/test/rustdoc-json/reexport/export_extern_crate_as_self.rs b/src/test/rustdoc-json/reexport/export_extern_crate_as_self.rs
new file mode 100644
index 000000000..f076feb71
--- /dev/null
+++ b/src/test/rustdoc-json/reexport/export_extern_crate_as_self.rs
@@ -0,0 +1,11 @@
+//! Regression test for <https://github.com/rust-lang/rust/issues/100531>
+
+#![feature(no_core)]
+#![no_core]
+
+#![crate_name = "export_extern_crate_as_self"]
+
+// ignore-tidy-linelength
+
+// @is "$.index[*][?(@.kind=='module')].name" \"export_extern_crate_as_self\"
+pub extern crate self as export_extern_crate_as_self; // Must be the same name as the crate already has
diff --git a/src/test/rustdoc-json/reexport/glob_collision.rs b/src/test/rustdoc-json/reexport/glob_collision.rs
new file mode 100644
index 000000000..f91144dbf
--- /dev/null
+++ b/src/test/rustdoc-json/reexport/glob_collision.rs
@@ -0,0 +1,28 @@
+// Regression test for https://github.com/rust-lang/rust/issues/100973
+
+#![feature(no_core)]
+#![no_core]
+
+// @set m1 = "$.index[*][?(@.name == 'm1' && @.kind == 'module')].id"
+// @is "$.index[*][?(@.name == 'm1' && @.kind == 'module')].inner.items" []
+// @is "$.index[*][?(@.name == 'm1' && @.kind == 'module')].inner.is_stripped" true
+mod m1 {
+ pub fn f() {}
+}
+// @set m2 = "$.index[*][?(@.name == 'm2' && @.kind == 'module')].id"
+// @is "$.index[*][?(@.name == 'm2' && @.kind == 'module')].inner.items" []
+// @is "$.index[*][?(@.name == 'm2' && @.kind == 'module')].inner.is_stripped" true
+mod m2 {
+ pub fn f(_: u8) {}
+}
+
+// @set m1_use = "$.index[*][?(@.inner.name=='m1')].id"
+// @is "$.index[*][?(@.inner.name=='m1')].inner.id" $m1
+// @is "$.index[*][?(@.inner.name=='m1')].inner.glob" true
+pub use m1::*;
+// @set m2_use = "$.index[*][?(@.inner.name=='m2')].id"
+// @is "$.index[*][?(@.inner.name=='m2')].inner.id" $m2
+// @is "$.index[*][?(@.inner.name=='m2')].inner.glob" true
+pub use m2::*;
+
+// @ismany "$.index[*][?(@.inner.is_crate==true)].inner.items[*]" $m1_use $m2_use
diff --git a/src/test/rustdoc-json/reexport/glob_empty_mod.rs b/src/test/rustdoc-json/reexport/glob_empty_mod.rs
new file mode 100644
index 000000000..da6822835
--- /dev/null
+++ b/src/test/rustdoc-json/reexport/glob_empty_mod.rs
@@ -0,0 +1,8 @@
+// Regression test for https://github.com/rust-lang/rust/issues/100973
+
+// @is "$.index[*][?(@.name=='m1' && @.kind == 'module')].inner.is_stripped" true
+// @set m1 = "$.index[*][?(@.name=='m1')].id"
+mod m1 {}
+
+// @is "$.index[*][?(@.inner.name=='m1' && @.kind=='import')].inner.id" $m1
+pub use m1::*;
diff --git a/src/test/rustdoc-json/reexport/glob_extern.rs b/src/test/rustdoc-json/reexport/glob_extern.rs
index ba1cfd8a0..7a1e8c11f 100644
--- a/src/test/rustdoc-json/reexport/glob_extern.rs
+++ b/src/test/rustdoc-json/reexport/glob_extern.rs
@@ -3,16 +3,21 @@
#![no_core]
#![feature(no_core)]
-// @is glob_extern.json "$.index[*][?(@.name=='mod1')].kind" \"module\"
-// @is glob_extern.json "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
+// @is "$.index[*][?(@.name=='mod1')].kind" \"module\"
+// @is "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
mod mod1 {
extern "C" {
- // @has - "$.index[*][?(@.name=='public_fn')].id"
+ // @set public_fn_id = "$.index[*][?(@.name=='public_fn')].id"
pub fn public_fn();
- // @!has - "$.index[*][?(@.name=='private_fn')]"
+ // @!has "$.index[*][?(@.name=='private_fn')]"
fn private_fn();
}
+ // @ismany "$.index[*][?(@.name=='mod1')].inner.items[*]" $public_fn_id
+ // @set mod1_id = "$.index[*][?(@.name=='mod1')].id"
}
-// @is - "$.index[*][?(@.kind=='import')].inner.glob" true
+// @is "$.index[*][?(@.kind=='import')].inner.glob" true
+// @is "$.index[*][?(@.kind=='import')].inner.id" $mod1_id
+// @set use_id = "$.index[*][?(@.kind=='import')].id"
+// @ismany "$.index[*][?(@.name=='glob_extern')].inner.items[*]" $use_id
pub use mod1::*;
diff --git a/src/test/rustdoc-json/reexport/glob_private.rs b/src/test/rustdoc-json/reexport/glob_private.rs
index e6a44748c..3a83a2081 100644
--- a/src/test/rustdoc-json/reexport/glob_private.rs
+++ b/src/test/rustdoc-json/reexport/glob_private.rs
@@ -3,30 +3,31 @@
#![no_core]
#![feature(no_core)]
-// @is glob_private.json "$.index[*][?(@.name=='mod1')].kind" \"module\"
-// @is glob_private.json "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
+// @is "$.index[*][?(@.name=='mod1')].kind" \"module\"
+// @is "$.index[*][?(@.name=='mod1')].inner.is_stripped" "true"
mod mod1 {
- // @is - "$.index[*][?(@.name=='mod2')].kind" \"module\"
- // @is - "$.index[*][?(@.name=='mod2')].inner.is_stripped" "true"
+ // @is "$.index[*][?(@.name=='mod2')].kind" \"module\"
+ // @is "$.index[*][?(@.name=='mod2')].inner.is_stripped" "true"
mod mod2 {
- // @set m2pub_id = - "$.index[*][?(@.name=='Mod2Public')].id"
+ // @set m2pub_id = "$.index[*][?(@.name=='Mod2Public')].id"
pub struct Mod2Public;
- // @!has - "$.index[*][?(@.name=='Mod2Private')]"
+ // @!has "$.index[*][?(@.name=='Mod2Private')]"
struct Mod2Private;
}
- // @has - "$.index[*][?(@.kind=='import' && @.inner.name=='mod2')]"
+ // @set mod2_use_id = "$.index[*][?(@.kind=='import' && @.inner.name=='mod2')].id"
pub use self::mod2::*;
- // @set m1pub_id = - "$.index[*][?(@.name=='Mod1Public')].id"
+ // @set m1pub_id = "$.index[*][?(@.name=='Mod1Public')].id"
pub struct Mod1Public;
- // @!has - "$.index[*][?(@.name=='Mod1Private')]"
+ // @!has "$.index[*][?(@.name=='Mod1Private')]"
struct Mod1Private;
}
-// @has - "$.index[*][?(@.kind=='import' && @.inner.name=='mod1')]"
+// @set mod1_use_id = "$.index[*][?(@.kind=='import' && @.inner.name=='mod1')].id"
pub use mod1::*;
-// @has - "$.index[*][?(@.name=='mod2')].inner.items[*]" $m2pub_id
-// @has - "$.index[*][?(@.name=='mod1')].inner.items[*]" $m1pub_id
+// @ismany "$.index[*][?(@.name=='mod2')].inner.items[*]" $m2pub_id
+// @ismany "$.index[*][?(@.name=='mod1')].inner.items[*]" $m1pub_id $mod2_use_id
+// @ismany "$.index[*][?(@.name=='glob_private')].inner.items[*]" $mod1_use_id
diff --git a/src/test/rustdoc-json/reexport/in_root_and_mod.rs b/src/test/rustdoc-json/reexport/in_root_and_mod.rs
index 7bf10a986..7b97ebf21 100644
--- a/src/test/rustdoc-json/reexport/in_root_and_mod.rs
+++ b/src/test/rustdoc-json/reexport/in_root_and_mod.rs
@@ -1,17 +1,16 @@
#![feature(no_core)]
#![no_core]
-// @is in_root_and_mod.json "$.index[*][?(@.name=='foo')].kind" \"module\"
-// @is in_root_and_mod.json "$.index[*][?(@.name=='foo')].inner.is_stripped" "true"
+// @!has "$.index[*][?(@.name=='foo')]"
mod foo {
- // @has - "$.index[*][?(@.name=='Foo')]"
+ // @has "$.index[*][?(@.name=='Foo')]"
pub struct Foo;
}
-// @has - "$.index[*][?(@.kind=='import' && @.inner.source=='foo::Foo')]"
+// @has "$.index[*][?(@.kind=='import' && @.inner.source=='foo::Foo')]"
pub use foo::Foo;
pub mod bar {
- // @has - "$.index[*][?(@.kind=='import' && @.inner.source=='crate::foo::Foo')]"
+ // @has "$.index[*][?(@.kind=='import' && @.inner.source=='crate::foo::Foo')]"
pub use crate::foo::Foo;
}
diff --git a/src/test/rustdoc-json/reexport/in_root_and_mod_pub.rs b/src/test/rustdoc-json/reexport/in_root_and_mod_pub.rs
index 2daadf762..f6d932d92 100644
--- a/src/test/rustdoc-json/reexport/in_root_and_mod_pub.rs
+++ b/src/test/rustdoc-json/reexport/in_root_and_mod_pub.rs
@@ -2,19 +2,19 @@
#![no_core]
pub mod foo {
- // @set bar_id = in_root_and_mod_pub.json "$.index[*][?(@.name=='Bar')].id"
- // @has - "$.index[*][?(@.name=='foo')].inner.items[*]" $bar_id
+ // @set bar_id = "$.index[*][?(@.name=='Bar')].id"
+ // @ismany "$.index[*][?(@.name=='foo')].inner.items[*]" $bar_id
pub struct Bar;
}
-// @set root_import_id = - "$.index[*][?(@.inner.source=='foo::Bar')].id"
-// @is - "$.index[*][?(@.inner.source=='foo::Bar')].inner.id" $bar_id
-// @has - "$.index[*][?(@.name=='in_root_and_mod_pub')].inner.items[*]" $root_import_id
+// @set root_import_id = "$.index[*][?(@.inner.source=='foo::Bar')].id"
+// @is "$.index[*][?(@.inner.source=='foo::Bar')].inner.id" $bar_id
+// @has "$.index[*][?(@.name=='in_root_and_mod_pub')].inner.items[*]" $root_import_id
pub use foo::Bar;
pub mod baz {
- // @set baz_import_id = - "$.index[*][?(@.inner.source=='crate::foo::Bar')].id"
- // @is - "$.index[*][?(@.inner.source=='crate::foo::Bar')].inner.id" $bar_id
- // @has - "$.index[*][?(@.name=='baz')].inner.items[*]" $baz_import_id
+ // @set baz_import_id = "$.index[*][?(@.inner.source=='crate::foo::Bar')].id"
+ // @is "$.index[*][?(@.inner.source=='crate::foo::Bar')].inner.id" $bar_id
+ // @ismany "$.index[*][?(@.name=='baz')].inner.items[*]" $baz_import_id
pub use crate::foo::Bar;
}
diff --git a/src/test/rustdoc-json/reexport/macro.rs b/src/test/rustdoc-json/reexport/macro.rs
index b86614ffb..b4882100f 100644
--- a/src/test/rustdoc-json/reexport/macro.rs
+++ b/src/test/rustdoc-json/reexport/macro.rs
@@ -3,15 +3,13 @@
#![no_core]
#![feature(no_core)]
-// @count macro.json "$.index[*][?(@.name=='macro')].inner.items[*]" 2
-
-// @set repro_id = macro.json "$.index[*][?(@.name=='repro')].id"
-// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro_id
+// @set repro_id = "$.index[*][?(@.name=='repro')].id"
#[macro_export]
macro_rules! repro {
() => {};
}
-// @set repro2_id = macro.json "$.index[*][?(@.inner.name=='repro2')].id"
-// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro2_id
+// @set repro2_id = "$.index[*][?(@.inner.name=='repro2')].id"
pub use crate::repro as repro2;
+
+// @ismany "$.index[*][?(@.name=='macro')].inner.items[*]" $repro_id $repro2_id
diff --git a/src/test/rustdoc-json/reexport/mod_not_included.rs b/src/test/rustdoc-json/reexport/mod_not_included.rs
new file mode 100644
index 000000000..7b7600ef2
--- /dev/null
+++ b/src/test/rustdoc-json/reexport/mod_not_included.rs
@@ -0,0 +1,14 @@
+// Regression test for https://github.com/rust-lang/rust/issues/101103
+
+#![feature(no_core)]
+#![no_core]
+
+mod m1 {
+ pub fn x() {}
+}
+
+pub use m1::x;
+
+// @has "$.index[*][?(@.name=='x' && @.kind=='function')]"
+// @has "$.index[*][?(@.kind=='import' && @.inner.name=='x')].inner.source" '"m1::x"'
+// @!has "$.index[*][?(@.name=='m1')]"
diff --git a/src/test/rustdoc-json/reexport/private_twice_one_inline.rs b/src/test/rustdoc-json/reexport/private_twice_one_inline.rs
index 327b0f45f..687a3b2ac 100644
--- a/src/test/rustdoc-json/reexport/private_twice_one_inline.rs
+++ b/src/test/rustdoc-json/reexport/private_twice_one_inline.rs
@@ -1,18 +1,28 @@
// aux-build:pub-struct.rs
+// ignore-tidy-linelength
-// Test for the ICE in rust/83057
-// Am external type re-exported with different attributes shouldn't cause an error
+// Test for the ICE in https://github.com/rust-lang/rust/issues/83057
+// An external type re-exported with different attributes shouldn't cause an error
#![no_core]
#![feature(no_core)]
extern crate pub_struct as foo;
-
#[doc(inline)]
+
+// @set crate_use_id = "$.index[*][?(@.docs=='Hack A')].id"
+// @set foo_id = "$.index[*][?(@.docs=='Hack A')].inner.id"
+/// Hack A
pub use foo::Foo;
+// @set bar_id = "$.index[*][?(@.name=='bar')].id"
pub mod bar {
+ // @is "$.index[*][?(@.docs=='Hack B')].inner.id" $foo_id
+ // @set bar_use_id = "$.index[*][?(@.docs=='Hack B')].id"
+ // @ismany "$.index[*][?(@.name=='bar')].inner.items[*]" $bar_use_id
+ /// Hack B
pub use foo::Foo;
}
-// @count private_twice_one_inline.json "$.index[*][?(@.kind=='import')]" 2
+// @ismany "$.index[*][?(@.kind=='import')].id" $crate_use_id $bar_use_id
+// @ismany "$.index[*][?(@.name=='private_twice_one_inline')].inner.items[*]" $bar_id $crate_use_id
diff --git a/src/test/rustdoc-json/reexport/private_two_names.rs b/src/test/rustdoc-json/reexport/private_two_names.rs
index 36d6a50d3..9858538a9 100644
--- a/src/test/rustdoc-json/reexport/private_two_names.rs
+++ b/src/test/rustdoc-json/reexport/private_two_names.rs
@@ -1,17 +1,22 @@
-// Test for the ICE in rust/83720
+// ignore-tidy-linelength
+
+// Test for the ICE in https://github.com/rust-lang/rust/issues/83720
// A pub-in-private type re-exported under two different names shouldn't cause an error
#![no_core]
#![feature(no_core)]
-// @is private_two_names.json "$.index[*][?(@.name=='style')].kind" \"module\"
-// @is private_two_names.json "$.index[*][?(@.name=='style')].inner.is_stripped" "true"
+// @!has "$.index[*][?(@.name=='style')]"
mod style {
- // @has - "$.index[*](?(@.name=='Color'))"
+ // @set color_struct_id = "$.index[*][?(@.kind=='struct' && @.name=='Color')].id"
pub struct Color;
}
-// @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Color')]"
+// @is "$.index[*][?(@.kind=='import' && @.inner.name=='Color')].inner.id" $color_struct_id
+// @set color_export_id = "$.index[*][?(@.kind=='import' && @.inner.name=='Color')].id"
pub use style::Color;
-// @has - "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')]"
+// @is "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')].inner.id" $color_struct_id
+// @set colour_export_id = "$.index[*][?(@.kind=='import' && @.inner.name=='Colour')].id"
pub use style::Color as Colour;
+
+// @ismany "$.index[*][?(@.name=='private_two_names')].inner.items[*]" $color_export_id $colour_export_id
diff --git a/src/test/rustdoc-json/reexport/reexport_method_from_private_module.rs b/src/test/rustdoc-json/reexport/reexport_method_from_private_module.rs
new file mode 100644
index 000000000..239b1a23b
--- /dev/null
+++ b/src/test/rustdoc-json/reexport/reexport_method_from_private_module.rs
@@ -0,0 +1,28 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/102583>.
+
+// @set impl_S = "$.index[*][?(@.docs=='impl S')].id"
+// @has "$.index[*][?(@.name=='S')].inner.impls[*]" $impl_S
+// @set is_present = "$.index[*][?(@.name=='is_present')].id"
+// @is "$.index[*][?(@.docs=='impl S')].inner.items[*]" $is_present
+// @!has "$.index[*][?(@.name=='hidden_impl')]"
+// @!has "$.index[*][?(@.name=='hidden_fn')]"
+
+#![no_std]
+
+mod private_mod {
+ pub struct S;
+
+ /// impl S
+ impl S {
+ pub fn is_present() {}
+ #[doc(hidden)]
+ pub fn hidden_fn() {}
+ }
+
+ #[doc(hidden)]
+ impl S {
+ pub fn hidden_impl() {}
+ }
+}
+
+pub use private_mod::*;
diff --git a/src/test/rustdoc-json/reexport/rename_private.rs b/src/test/rustdoc-json/reexport/rename_private.rs
index 2476399bd..8fd850f9b 100644
--- a/src/test/rustdoc-json/reexport/rename_private.rs
+++ b/src/test/rustdoc-json/reexport/rename_private.rs
@@ -3,12 +3,11 @@
#![no_core]
#![feature(no_core)]
-// @is rename_private.json "$.index[*][?(@.name=='inner')].kind" \"module\"
-// @is rename_private.json "$.index[*][?(@.name=='inner')].inner.is_stripped" "true"
+// @!has "$.index[*][?(@.kind=='inner')]"
mod inner {
- // @has - "$.index[*][?(@.name=='Public')]"
+ // @has "$.index[*][?(@.name=='Public')]"
pub struct Public;
}
-// @is - "$.index[*][?(@.kind=='import')].inner.name" \"NewName\"
+// @is "$.index[*][?(@.kind=='import')].inner.name" \"NewName\"
pub use inner::Public as NewName;
diff --git a/src/test/rustdoc-json/reexport/rename_public.rs b/src/test/rustdoc-json/reexport/rename_public.rs
index 2dd438d22..e30907fe2 100644
--- a/src/test/rustdoc-json/reexport/rename_public.rs
+++ b/src/test/rustdoc-json/reexport/rename_public.rs
@@ -3,15 +3,15 @@
#![no_core]
#![feature(no_core)]
-// @set inner_id = rename_public.json "$.index[*][?(@.name=='inner')].id"
-// @has - "$.index[*][?(@.name=='rename_public')].inner.items[*]" $inner_id
+// @set inner_id = "$.index[*][?(@.name=='inner')].id"
pub mod inner {
- // @set public_id = - "$.index[*][?(@.name=='Public')].id"
- // @has - "$.index[*][?(@.name=='inner')].inner.items[*]" $public_id
+ // @set public_id = "$.index[*][?(@.name=='Public')].id"
+ // @ismany "$.index[*][?(@.name=='inner')].inner.items[*]" $public_id
pub struct Public;
}
-// @set import_id = - "$.index[*][?(@.inner.name=='NewName')].id"
-// @!has - "$.index[*][?(@.inner.name=='Public')]"
-// @has - "$.index[*][?(@.name=='rename_public')].inner.items[*]" $import_id
-// @is - "$.index[*][?(@.inner.name=='NewName')].inner.source" \"inner::Public\"
+// @set import_id = "$.index[*][?(@.inner.name=='NewName')].id"
+// @!has "$.index[*][?(@.inner.name=='Public')]"
+// @is "$.index[*][?(@.inner.name=='NewName')].inner.source" \"inner::Public\"
pub use inner::Public as NewName;
+
+// @ismany "$.index[*][?(@.name=='rename_public')].inner.items[*]" $inner_id $import_id
diff --git a/src/test/rustdoc-json/reexport/same_type_reexported_more_than_once.rs b/src/test/rustdoc-json/reexport/same_type_reexported_more_than_once.rs
index eedddd6a7..880dbdc44 100644
--- a/src/test/rustdoc-json/reexport/same_type_reexported_more_than_once.rs
+++ b/src/test/rustdoc-json/reexport/same_type_reexported_more_than_once.rs
@@ -1,15 +1,21 @@
+// ignore-tidy-linelength
+
// Regression test for <https://github.com/rust-lang/rust/issues/97432>.
#![feature(no_core)]
#![no_std]
#![no_core]
-// @has same_type_reexported_more_than_once.json
-// @has - "$.index[*][?(@.name=='Trait')]"
-pub use inner::Trait;
-// @has - "$.index[*].inner[?(@.name=='Reexport')].id"
-pub use inner::Trait as Reexport;
-
mod inner {
+ // @set trait_id = "$.index[*][?(@.name=='Trait')].id"
pub trait Trait {}
}
+
+// @set export_id = "$.index[*][?(@.inner.name=='Trait')].id"
+// @is "$.index[*][?(@.inner.name=='Trait')].inner.id" $trait_id
+pub use inner::Trait;
+// @set reexport_id = "$.index[*][?(@.inner.name=='Reexport')].id"
+// @is "$.index[*][?(@.inner.name=='Reexport')].inner.id" $trait_id
+pub use inner::Trait as Reexport;
+
+// @ismany "$.index[*][?(@.name=='same_type_reexported_more_than_once')].inner.items[*]" $reexport_id $export_id
diff --git a/src/test/rustdoc-json/reexport/simple_private.rs b/src/test/rustdoc-json/reexport/simple_private.rs
index 5ec13e403..d058ce059 100644
--- a/src/test/rustdoc-json/reexport/simple_private.rs
+++ b/src/test/rustdoc-json/reexport/simple_private.rs
@@ -2,14 +2,15 @@
#![no_core]
#![feature(no_core)]
-// @is simple_private.json "$.index[*][?(@.name=='inner')].kind" \"module\"
-// @is simple_private.json "$.index[*][?(@.name=='inner')].inner.is_stripped" "true"
+// @!has "$.index[*][?(@.name=='inner')]"
mod inner {
- // @set pub_id = - "$.index[*][?(@.name=='Public')].id"
+ // @set pub_id = "$.index[*][?(@.name=='Public')].id"
pub struct Public;
}
-// @is - "$.index[*][?(@.kind=='import')].inner.name" \"Public\"
+// @is "$.index[*][?(@.kind=='import')].inner.name" \"Public\"
+// @is "$.index[*][?(@.kind=='import')].inner.id" $pub_id
+// @set use_id = "$.index[*][?(@.kind=='import')].id"
pub use inner::Public;
-// @has - "$.index[*][?(@.name=='inner')].inner.items[*]" $pub_id
+// @ismany "$.index[*][?(@.name=='simple_private')].inner.items[*]" $use_id
diff --git a/src/test/rustdoc-json/reexport/simple_public.rs b/src/test/rustdoc-json/reexport/simple_public.rs
index 2e4de301f..e64a0dcb7 100644
--- a/src/test/rustdoc-json/reexport/simple_public.rs
+++ b/src/test/rustdoc-json/reexport/simple_public.rs
@@ -3,16 +3,16 @@
#![no_core]
#![feature(no_core)]
-// @set inner_id = simple_public.json "$.index[*][?(@.name=='inner')].id"
-// @has - "$.index[*][?(@.name=='simple_public')].inner.items[*]" $inner_id
+// @set inner_id = "$.index[*][?(@.name=='inner')].id"
pub mod inner {
- // @set public_id = - "$.index[*][?(@.name=='Public')].id"
- // @has - "$.index[*][?(@.name=='inner')].inner.items[*]" $public_id
+ // @set public_id = "$.index[*][?(@.name=='Public')].id"
+ // @ismany "$.index[*][?(@.name=='inner')].inner.items[*]" $public_id
pub struct Public;
}
-// @set import_id = - "$.index[*][?(@.inner.name=='Public')].id"
-// @has - "$.index[*][?(@.name=='simple_public')].inner.items[*]" $import_id
-// @is - "$.index[*][?(@.inner.name=='Public')].inner.source" \"inner::Public\"
+// @set import_id = "$.index[*][?(@.inner.name=='Public')].id"
+// @is "$.index[*][?(@.inner.name=='Public')].inner.source" \"inner::Public\"
pub use inner::Public;
+
+// @ismany "$.index[*][?(@.name=='simple_public')].inner.items[*]" $import_id $inner_id
diff --git a/src/test/rustdoc-json/return_private.rs b/src/test/rustdoc-json/return_private.rs
index 6b324d009..a8d1fae30 100644
--- a/src/test/rustdoc-json/return_private.rs
+++ b/src/test/rustdoc-json/return_private.rs
@@ -8,8 +8,8 @@ mod secret {
pub struct Secret;
}
-// @is return_private.json "$.index[*][?(@.name=='get_secret')].kind" \"function\"
-// @is return_private.json "$.index[*][?(@.name=='get_secret')].inner.decl.output.inner.name" \"secret::Secret\"
+// @is "$.index[*][?(@.name=='get_secret')].kind" \"function\"
+// @is "$.index[*][?(@.name=='get_secret')].inner.decl.output.inner.name" \"secret::Secret\"
pub fn get_secret() -> secret::Secret {
secret::Secret
}
diff --git a/src/test/rustdoc-json/stripped_modules.rs b/src/test/rustdoc-json/stripped_modules.rs
index 91f9f02ad..d2664b49e 100644
--- a/src/test/rustdoc-json/stripped_modules.rs
+++ b/src/test/rustdoc-json/stripped_modules.rs
@@ -1,20 +1,20 @@
#![no_core]
#![feature(no_core)]
-// @!has stripped_modules.json "$.index[*][?(@.name=='no_pub_inner')]"
+// @!has "$.index[*][?(@.name=='no_pub_inner')]"
mod no_pub_inner {
fn priv_inner() {}
}
-// @!has - "$.index[*][?(@.name=='pub_inner_unreachable')]"
+// @!has "$.index[*][?(@.name=='pub_inner_unreachable')]"
mod pub_inner_unreachable {
- // @!has - "$.index[*][?(@.name=='pub_inner_1')]"
+ // @!has "$.index[*][?(@.name=='pub_inner_1')]"
pub fn pub_inner_1() {}
}
-// @has - "$.index[*][?(@.name=='pub_inner_reachable')]"
+// @!has "$.index[*][?(@.name=='pub_inner_reachable')]"
mod pub_inner_reachable {
- // @has - "$.index[*][?(@.name=='pub_inner_2')]"
+ // @has "$.index[*][?(@.name=='pub_inner_2')]"
pub fn pub_inner_2() {}
}
diff --git a/src/test/rustdoc-json/structs/plain_all_pub.rs b/src/test/rustdoc-json/structs/plain_all_pub.rs
new file mode 100644
index 000000000..b86ab93c2
--- /dev/null
+++ b/src/test/rustdoc-json/structs/plain_all_pub.rs
@@ -0,0 +1,11 @@
+pub struct Demo {
+ pub x: i32,
+ pub y: i32,
+}
+
+// @set x = "$.index[*][?(@.name=='x')].id"
+// @set y = "$.index[*][?(@.name=='y')].id"
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[1]" $y
+// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 2
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" false
diff --git a/src/test/rustdoc-json/structs/plain_doc_hidden.rs b/src/test/rustdoc-json/structs/plain_doc_hidden.rs
new file mode 100644
index 000000000..7800b55a4
--- /dev/null
+++ b/src/test/rustdoc-json/structs/plain_doc_hidden.rs
@@ -0,0 +1,11 @@
+pub struct Demo {
+ pub x: i32,
+ #[doc(hidden)]
+ pub y: i32,
+}
+
+// @set x = "$.index[*][?(@.name=='x')].id"
+// @!has "$.index[*][?(@.name=='y')].id"
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x
+// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 1
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" true
diff --git a/src/test/rustdoc-json/structs/plain_empty.rs b/src/test/rustdoc-json/structs/plain_empty.rs
index a251caf4b..1d01b8bc1 100644
--- a/src/test/rustdoc-json/structs/plain_empty.rs
+++ b/src/test/rustdoc-json/structs/plain_empty.rs
@@ -1,6 +1,5 @@
-// @has plain_empty.json "$.index[*][?(@.name=='PlainEmpty')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='PlainEmpty')].kind" \"struct\"
-// @has - "$.index[*][?(@.name=='PlainEmpty')].inner.struct_type" \"plain\"
-// @has - "$.index[*][?(@.name=='PlainEmpty')].inner.fields_stripped" false
-// @has - "$.index[*][?(@.name=='PlainEmpty')].inner.fields" []
+// @is "$.index[*][?(@.name=='PlainEmpty')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='PlainEmpty')].kind" \"struct\"
+// @is "$.index[*][?(@.name=='PlainEmpty')].inner.kind.plain.fields_stripped" false
+// @is "$.index[*][?(@.name=='PlainEmpty')].inner.kind.plain.fields" []
pub struct PlainEmpty {}
diff --git a/src/test/rustdoc-json/structs/plain_pub_priv.rs b/src/test/rustdoc-json/structs/plain_pub_priv.rs
new file mode 100644
index 000000000..9b771224d
--- /dev/null
+++ b/src/test/rustdoc-json/structs/plain_pub_priv.rs
@@ -0,0 +1,9 @@
+pub struct Demo {
+ pub x: i32,
+ y: i32,
+}
+
+// @set x = "$.index[*][?(@.name=='x')].id"
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[0]" $x
+// @count "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields[*]" 1
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.plain.fields_stripped" true
diff --git a/src/test/rustdoc-json/structs/tuple.rs b/src/test/rustdoc-json/structs/tuple.rs
index 4e510b398..6bdb753ee 100644
--- a/src/test/rustdoc-json/structs/tuple.rs
+++ b/src/test/rustdoc-json/structs/tuple.rs
@@ -1,5 +1,4 @@
-// @has tuple.json "$.index[*][?(@.name=='Tuple')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='Tuple')].kind" \"struct\"
-// @has - "$.index[*][?(@.name=='Tuple')].inner.struct_type" \"tuple\"
-// @has - "$.index[*][?(@.name=='Tuple')].inner.fields_stripped" true
+// @is "$.index[*][?(@.name=='Tuple')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='Tuple')].kind" \"struct\"
+// @is "$.index[*][?(@.name=='Tuple')].inner.kind.tuple" '[null, null]'
pub struct Tuple(u32, String);
diff --git a/src/test/rustdoc-json/structs/tuple_empty.rs b/src/test/rustdoc-json/structs/tuple_empty.rs
new file mode 100644
index 000000000..0ad6a8954
--- /dev/null
+++ b/src/test/rustdoc-json/structs/tuple_empty.rs
@@ -0,0 +1,2 @@
+// @is "$.index[*][?(@.name=='TupleUnit')].inner.kind.tuple" []
+pub struct TupleUnit();
diff --git a/src/test/rustdoc-json/structs/tuple_pub_priv.rs b/src/test/rustdoc-json/structs/tuple_pub_priv.rs
new file mode 100644
index 000000000..9d5a1d1c8
--- /dev/null
+++ b/src/test/rustdoc-json/structs/tuple_pub_priv.rs
@@ -0,0 +1,13 @@
+pub struct Demo(
+ i32,
+ /// field
+ pub i32,
+ #[doc(hidden)] i32,
+);
+
+// @set field = "$.index[*][?(@.docs=='field')].id"
+
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[0]" null
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[1]" $field
+// @is "$.index[*][?(@.name=='Demo')].inner.kind.tuple[2]" null
+// @count "$.index[*][?(@.name=='Demo')].inner.kind.tuple[*]" 3
diff --git a/src/test/rustdoc-json/structs/unit.rs b/src/test/rustdoc-json/structs/unit.rs
index 559d3068d..265709717 100644
--- a/src/test/rustdoc-json/structs/unit.rs
+++ b/src/test/rustdoc-json/structs/unit.rs
@@ -1,5 +1,4 @@
-// @has unit.json "$.index[*][?(@.name=='Unit')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='Unit')].kind" \"struct\"
-// @has - "$.index[*][?(@.name=='Unit')].inner.struct_type" \"unit\"
-// @has - "$.index[*][?(@.name=='Unit')].inner.fields" []
+// @is "$.index[*][?(@.name=='Unit')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='Unit')].kind" \"struct\"
+// @is "$.index[*][?(@.name=='Unit')].inner.kind" \"unit\"
pub struct Unit;
diff --git a/src/test/rustdoc-json/structs/with_generics.rs b/src/test/rustdoc-json/structs/with_generics.rs
index 65cfe7eff..00474800a 100644
--- a/src/test/rustdoc-json/structs/with_generics.rs
+++ b/src/test/rustdoc-json/structs/with_generics.rs
@@ -1,13 +1,13 @@
use std::collections::HashMap;
-// @has with_generics.json "$.index[*][?(@.name=='WithGenerics')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='WithGenerics')].kind" \"struct\"
-// @has - "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[0].name" \"T\"
-// @has - "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[0].kind.type"
-// @has - "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[1].name" \"U\"
-// @has - "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[1].kind.type"
-// @has - "$.index[*][?(@.name=='WithGenerics')].inner.struct_type" \"plain\"
-// @has - "$.index[*][?(@.name=='WithGenerics')].inner.fields_stripped" true
+// @is "$.index[*][?(@.name=='WithGenerics')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='WithGenerics')].kind" \"struct\"
+// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[0].name" \"T\"
+// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[0].kind.type.bounds" []
+// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[1].name" \"U\"
+// @is "$.index[*][?(@.name=='WithGenerics')].inner.generics.params[1].kind.type.bounds" []
+// @is "$.index[*][?(@.name=='WithGenerics')].inner.kind.plain.fields_stripped" true
+// @is "$.index[*][?(@.name=='WithGenerics')].inner.kind.plain.fields" []
pub struct WithGenerics<T, U> {
stuff: Vec<T>,
things: HashMap<U, U>,
diff --git a/src/test/rustdoc-json/structs/with_primitives.rs b/src/test/rustdoc-json/structs/with_primitives.rs
index 9e64317ec..9c5a37f39 100644
--- a/src/test/rustdoc-json/structs/with_primitives.rs
+++ b/src/test/rustdoc-json/structs/with_primitives.rs
@@ -1,9 +1,9 @@
-// @has with_primitives.json "$.index[*][?(@.name=='WithPrimitives')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='WithPrimitives')].kind" \"struct\"
-// @has - "$.index[*][?(@.name=='WithPrimitives')].inner.generics.params[0].name" \"\'a\"
-// @has - "$.index[*][?(@.name=='WithPrimitives')].inner.generics.params[0].kind.lifetime.outlives" []
-// @has - "$.index[*][?(@.name=='WithPrimitives')].inner.struct_type" \"plain\"
-// @has - "$.index[*][?(@.name=='WithPrimitives')].inner.fields_stripped" true
+// @is "$.index[*][?(@.name=='WithPrimitives')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='WithPrimitives')].kind" \"struct\"
+// @is "$.index[*][?(@.name=='WithPrimitives')].inner.generics.params[0].name" \"\'a\"
+// @is "$.index[*][?(@.name=='WithPrimitives')].inner.generics.params[0].kind.lifetime.outlives" []
+// @is "$.index[*][?(@.name=='WithPrimitives')].inner.kind.plain.fields_stripped" true
+// @is "$.index[*][?(@.name=='WithPrimitives')].inner.kind.plain.fields" []
pub struct WithPrimitives<'a> {
num: u32,
s: &'a str,
diff --git a/src/test/rustdoc-json/traits/has_body.rs b/src/test/rustdoc-json/traits/has_body.rs
index 44dacb1ee..a57cb97d4 100644
--- a/src/test/rustdoc-json/traits/has_body.rs
+++ b/src/test/rustdoc-json/traits/has_body.rs
@@ -1,21 +1,21 @@
-// @has has_body.json "$.index[*][?(@.name=='Foo')]"
+// @has "$.index[*][?(@.name=='Foo')]"
pub trait Foo {
- // @has - "$.index[*][?(@.name=='no_self')].inner.has_body" false
+ // @is "$.index[*][?(@.name=='no_self')].inner.has_body" false
fn no_self();
- // @has - "$.index[*][?(@.name=='move_self')].inner.has_body" false
+ // @is "$.index[*][?(@.name=='move_self')].inner.has_body" false
fn move_self(self);
- // @has - "$.index[*][?(@.name=='ref_self')].inner.has_body" false
+ // @is "$.index[*][?(@.name=='ref_self')].inner.has_body" false
fn ref_self(&self);
- // @has - "$.index[*][?(@.name=='no_self_def')].inner.has_body" true
+ // @is "$.index[*][?(@.name=='no_self_def')].inner.has_body" true
fn no_self_def() {}
- // @has - "$.index[*][?(@.name=='move_self_def')].inner.has_body" true
+ // @is "$.index[*][?(@.name=='move_self_def')].inner.has_body" true
fn move_self_def(self) {}
- // @has - "$.index[*][?(@.name=='ref_self_def')].inner.has_body" true
+ // @is "$.index[*][?(@.name=='ref_self_def')].inner.has_body" true
fn ref_self_def(&self) {}
}
pub trait Bar: Clone {
- // @has - "$.index[*][?(@.name=='method')].inner.has_body" false
+ // @is "$.index[*][?(@.name=='method')].inner.has_body" false
fn method(&self, param: usize);
}
diff --git a/src/test/rustdoc-json/traits/implementors.rs b/src/test/rustdoc-json/traits/implementors.rs
index f7f03d987..db3fe5df7 100644
--- a/src/test/rustdoc-json/traits/implementors.rs
+++ b/src/test/rustdoc-json/traits/implementors.rs
@@ -1,19 +1,19 @@
#![feature(no_core)]
#![no_core]
-// @set wham = implementors.json "$.index[*][?(@.name=='Wham')].id"
-// @count - "$.index[*][?(@.name=='Wham')].inner.implementations[*]" 1
-// @set gmWham = - "$.index[*][?(@.name=='Wham')].inner.implementations[0]"
+// @set wham = "$.index[*][?(@.name=='Wham')].id"
+// @count "$.index[*][?(@.name=='Wham')].inner.implementations[*]" 1
+// @set gmWham = "$.index[*][?(@.name=='Wham')].inner.implementations[0]"
pub trait Wham {}
-// @count - "$.index[*][?(@.name=='GeorgeMichael')].inner.impls[*]" 1
-// @is - "$.index[*][?(@.name=='GeorgeMichael')].inner.impls[0]" $gmWham
-// @set gm = - "$.index[*][?(@.name=='Wham')].id"
+// @count "$.index[*][?(@.name=='GeorgeMichael')].inner.impls[*]" 1
+// @is "$.index[*][?(@.name=='GeorgeMichael')].inner.impls[0]" $gmWham
+// @set gm = "$.index[*][?(@.name=='Wham')].id"
// jsonpath_lib isnt expressive enough (for now) to get the "impl" item, so we
// just check it isn't pointing to the type, but when you port to jsondocck-ng
// check what the impl item is
-// @!is - "$.index[*][?(@.name=='Wham')].inner.implementations[0]" $gm
+// @!is "$.index[*][?(@.name=='Wham')].inner.implementations[0]" $gm
pub struct GeorgeMichael {}
impl Wham for GeorgeMichael {}
diff --git a/src/test/rustdoc-json/traits/supertrait.rs b/src/test/rustdoc-json/traits/supertrait.rs
index 486a8e713..4048fdd74 100644
--- a/src/test/rustdoc-json/traits/supertrait.rs
+++ b/src/test/rustdoc-json/traits/supertrait.rs
@@ -4,23 +4,23 @@
#![feature(lang_items)]
#![no_core]
-// @set loud_id = supertrait.json "$.index[*][?(@.name=='Loud')].id"
+// @set loud_id = "$.index[*][?(@.name=='Loud')].id"
pub trait Loud {}
-// @set very_loud_id = - "$.index[*][?(@.name=='VeryLoud')].id"
-// @count - "$.index[*][?(@.name=='VeryLoud')].inner.bounds[*]" 1
-// @is - "$.index[*][?(@.name=='VeryLoud')].inner.bounds[0].trait_bound.trait.inner.id" $loud_id
+// @set very_loud_id = "$.index[*][?(@.name=='VeryLoud')].id"
+// @count "$.index[*][?(@.name=='VeryLoud')].inner.bounds[*]" 1
+// @is "$.index[*][?(@.name=='VeryLoud')].inner.bounds[0].trait_bound.trait.id" $loud_id
pub trait VeryLoud: Loud {}
-// @set sounds_good_id = - "$.index[*][?(@.name=='SoundsGood')].id"
+// @set sounds_good_id = "$.index[*][?(@.name=='SoundsGood')].id"
pub trait SoundsGood {}
-// @count - "$.index[*][?(@.name=='MetalBand')].inner.bounds[*]" 2
-// @is - "$.index[*][?(@.name=='MetalBand')].inner.bounds[0].trait_bound.trait.inner.id" $very_loud_id
-// @is - "$.index[*][?(@.name=='MetalBand')].inner.bounds[1].trait_bound.trait.inner.id" $sounds_good_id
+// @count "$.index[*][?(@.name=='MetalBand')].inner.bounds[*]" 2
+// @is "$.index[*][?(@.name=='MetalBand')].inner.bounds[0].trait_bound.trait.id" $very_loud_id
+// @is "$.index[*][?(@.name=='MetalBand')].inner.bounds[1].trait_bound.trait.id" $sounds_good_id
pub trait MetalBand: VeryLoud + SoundsGood {}
-// @count - "$.index[*][?(@.name=='DnabLatem')].inner.bounds[*]" 2
-// @is - "$.index[*][?(@.name=='DnabLatem')].inner.bounds[1].trait_bound.trait.inner.id" $very_loud_id
-// @is - "$.index[*][?(@.name=='DnabLatem')].inner.bounds[0].trait_bound.trait.inner.id" $sounds_good_id
+// @count "$.index[*][?(@.name=='DnabLatem')].inner.bounds[*]" 2
+// @is "$.index[*][?(@.name=='DnabLatem')].inner.bounds[1].trait_bound.trait.id" $very_loud_id
+// @is "$.index[*][?(@.name=='DnabLatem')].inner.bounds[0].trait_bound.trait.id" $sounds_good_id
pub trait DnabLatem: SoundsGood + VeryLoud {}
diff --git a/src/test/rustdoc-json/traits/uses_extern_trait.rs b/src/test/rustdoc-json/traits/uses_extern_trait.rs
new file mode 100644
index 000000000..430dd1543
--- /dev/null
+++ b/src/test/rustdoc-json/traits/uses_extern_trait.rs
@@ -0,0 +1,7 @@
+#![no_std]
+pub fn drop_default<T: core::default::Default>(_x: T) {}
+
+// FIXME(adotinthevoid): Theses shouldn't be here
+// @has "$.index[*][?(@.name=='Debug')]"
+// @set Debug_fmt = "$.index[*][?(@.name=='Debug')].inner.items[*]"
+// @has "$.index[*][?(@.name=='fmt')].id" $Debug_fmt
diff --git a/src/test/rustdoc-json/type/dyn.rs b/src/test/rustdoc-json/type/dyn.rs
index f53dc03f4..eaf249252 100644
--- a/src/test/rustdoc-json/type/dyn.rs
+++ b/src/test/rustdoc-json/type/dyn.rs
@@ -1,21 +1,46 @@
// ignore-tidy-linelength
+use std::fmt::Debug;
-// @count dyn.json "$.index[*][?(@.name=='dyn')].inner.items" 1
-// @set sync_int_gen = - "$.index[*][?(@.name=='SyncIntGen')].id"
-// @is - "$.index[*][?(@.name=='dyn')].inner.items[0]" $sync_int_gen
+// @count "$.index[*][?(@.name=='dyn')].inner.items[*]" 3
+// @set sync_int_gen = "$.index[*][?(@.name=='SyncIntGen')].id"
+// @set ref_fn = "$.index[*][?(@.name=='RefFn')].id"
+// @set weird_order = "$.index[*][?(@.name=='WeirdOrder')].id"
+// @ismany "$.index[*][?(@.name=='dyn')].inner.items[*]" $sync_int_gen $ref_fn $weird_order
-// @is - "$.index[*][?(@.name=='SyncIntGen')].kind" \"typedef\"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.generics" '{"params": [], "where_predicates": []}'
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.kind" \"resolved_path\"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.name" \"Box\"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.bindings" []
-// @count - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args" 1
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.kind" \"resolved_path\"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.kind" \"resolved_path\"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.name" \"Fn\"
-// @count - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.param_names[*]" 3
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.param_names[0].trait_bound.trait.inner.name" \"Send\"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.param_names[1].trait_bound.trait.inner.name" \"Sync\"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.param_names[2]" "{\"outlives\": \"'static\"}"
-// @is - "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.args" '{"parenthesized": {"inputs": [],"output": {"inner": "i32","kind": "primitive"}}}'
+// @is "$.index[*][?(@.name=='SyncIntGen')].kind" \"typedef\"
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.generics" '{"params": [], "where_predicates": []}'
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.kind" \"resolved_path\"
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.name" \"Box\"
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.bindings" []
+// @count "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args" 1
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.kind" \"dyn_trait\"
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.lifetime" \"\'static\"
+// @count "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[*]" 3
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[0].generic_params" []
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[1].generic_params" []
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[2].generic_params" []
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[0].trait.name" '"Fn"'
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[1].trait.name" '"Send"'
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[2].trait.name" '"Sync"'
+// @is "$.index[*][?(@.name=='SyncIntGen')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[0].trait.args" '{"parenthesized": {"inputs": [],"output": {"inner": "i32","kind": "primitive"}}}'
pub type SyncIntGen = Box<dyn Fn() -> i32 + Send + Sync + 'static>;
+
+// @is "$.index[*][?(@.name=='RefFn')].kind" \"typedef\"
+// @is "$.index[*][?(@.name=='RefFn')].inner.generics" '{"params": [{"kind": {"lifetime": {"outlives": []}},"name": "'\''a"}],"where_predicates": []}'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.mutable" 'false'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.lifetime" "\"'a\""
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.kind" '"dyn_trait"'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.lifetime" null
+// @count "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.traits[*]" 1
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.traits[0].generic_params" '[{"kind": {"lifetime": {"outlives": []}},"name": "'\''b"}]'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.traits[0].trait.name" '"Fn"'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.traits[0].trait.args.parenthesized.inputs[0].kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.traits[0].trait.args.parenthesized.inputs[0].inner.lifetime" "\"'b\""
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.traits[0].trait.args.parenthesized.output.kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='RefFn')].inner.type.inner.type.inner.traits[0].trait.args.parenthesized.output.inner.lifetime" "\"'b\""
+pub type RefFn<'a> = &'a dyn for<'b> Fn(&'b i32) -> &'b i32;
+
+// @is "$.index[*][?(@.name=='WeirdOrder')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[0].trait.name" '"Send"'
+// @is "$.index[*][?(@.name=='WeirdOrder')].inner.type.inner.args.angle_bracketed.args[0].type.inner.traits[1].trait.name" '"Debug"'
+pub type WeirdOrder = Box<dyn Send + Debug>;
diff --git a/src/test/rustdoc-json/type/extern.rs b/src/test/rustdoc-json/type/extern.rs
new file mode 100644
index 000000000..d287d5ebe
--- /dev/null
+++ b/src/test/rustdoc-json/type/extern.rs
@@ -0,0 +1,10 @@
+#![feature(extern_types)]
+
+extern {
+ /// No inner information
+ pub type Foo;
+}
+
+// @is "$.index[*][?(@.docs=='No inner information')].name" '"Foo"'
+// @is "$.index[*][?(@.docs=='No inner information')].kind" '"foreign_type"'
+// @!has "$.index[*][?(@.docs=='No inner information')].inner"
diff --git a/src/test/rustdoc-json/type/fn_lifetime.rs b/src/test/rustdoc-json/type/fn_lifetime.rs
index e0d1e9649..d7216ec76 100644
--- a/src/test/rustdoc-json/type/fn_lifetime.rs
+++ b/src/test/rustdoc-json/type/fn_lifetime.rs
@@ -1,28 +1,27 @@
// ignore-tidy-linelength
-// @is fn_lifetime.json "$.index[*][?(@.name=='GenericFn')].kind" \"typedef\"
+// @is "$.index[*][?(@.name=='GenericFn')].kind" \"typedef\"
-// @count - "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*]" 1
-// @is - "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].name" \"\'a\"
-// @has - "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].kind.lifetime"
-// @count - "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].kind.lifetime.outlives[*]" 0
-// @count - "$.index[*][?(@.name=='GenericFn')].inner.generics.where_predicates[*]" 0
-// @is - "$.index[*][?(@.name=='GenericFn')].inner.type.kind" \"function_pointer\"
-// @count - "$.index[*][?(@.name=='GenericFn')].inner.type.inner.generic_params[*]" 0
-// @count - "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.inputs[*]" 1
-// @is - "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.inputs[*][1].inner.lifetime" \"\'a\"
-// @is - "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.output.inner.lifetime" \"\'a\"
+// @ismany "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].name" \"\'a\"
+// @has "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].kind.lifetime"
+// @count "$.index[*][?(@.name=='GenericFn')].inner.generics.params[*].kind.lifetime.outlives[*]" 0
+// @count "$.index[*][?(@.name=='GenericFn')].inner.generics.where_predicates[*]" 0
+// @is "$.index[*][?(@.name=='GenericFn')].inner.type.kind" \"function_pointer\"
+// @count "$.index[*][?(@.name=='GenericFn')].inner.type.inner.generic_params[*]" 0
+// @count "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.inputs[*][1].inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='GenericFn')].inner.type.inner.decl.output.inner.lifetime" \"\'a\"
pub type GenericFn<'a> = fn(&'a i32) -> &'a i32;
-// @is fn_lifetime.json "$.index[*][?(@.name=='ForAll')].kind" \"typedef\"
-// @count - "$.index[*][?(@.name=='ForAll')].inner.generics.params[*]" 0
-// @count - "$.index[*][?(@.name=='ForAll')].inner.generics.where_predicates[*]" 0
-// @count - "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*]" 1
-// @is - "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].name" \"\'a\"
-// @has - "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].kind.lifetime"
-// @count - "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].kind.lifetime.outlives[*]" 0
-// @count - "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.inputs[*]" 1
-// @is - "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.inputs[*][1].inner.lifetime" \"\'a\"
-// @is - "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.output.inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='ForAll')].kind" \"typedef\"
+// @count "$.index[*][?(@.name=='ForAll')].inner.generics.params[*]" 0
+// @count "$.index[*][?(@.name=='ForAll')].inner.generics.where_predicates[*]" 0
+// @count "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*]" 1
+// @is "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].name" \"\'a\"
+// @has "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].kind.lifetime"
+// @count "$.index[*][?(@.name=='ForAll')].inner.type.inner.generic_params[*].kind.lifetime.outlives[*]" 0
+// @count "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.inputs[*]" 1
+// @is "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.inputs[*][1].inner.lifetime" \"\'a\"
+// @is "$.index[*][?(@.name=='ForAll')].inner.type.inner.decl.output.inner.lifetime" \"\'a\"
pub type ForAll = for<'a> fn(&'a i32) -> &'a i32;
diff --git a/src/test/rustdoc-json/type/generic_default.rs b/src/test/rustdoc-json/type/generic_default.rs
index b6bb6dcc5..9c6d4540b 100644
--- a/src/test/rustdoc-json/type/generic_default.rs
+++ b/src/test/rustdoc-json/type/generic_default.rs
@@ -1,33 +1,33 @@
// ignore-tidy-linelength
-// @set result = generic_default.json "$.index[*][?(@.name=='Result')].id"
+// @set result = "$.index[*][?(@.name=='Result')].id"
pub enum Result<T, E> {
Ok(T),
Err(E),
}
-// @set my_error = - "$.index[*][?(@.name=='MyError')].id"
+// @set my_error = "$.index[*][?(@.name=='MyError')].id"
pub struct MyError {}
-// @is - "$.index[*][?(@.name=='MyResult')].kind" \"typedef\"
-// @count - "$.index[*][?(@.name=='MyResult')].inner.generics.where_predicates[*]" 0
-// @count - "$.index[*][?(@.name=='MyResult')].inner.generics.params[*]" 2
-// @is - "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].name" \"T\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].name" \"E\"
-// @has - "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].kind.type"
-// @has - "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type"
-// @count - "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].kind.type.bounds[*]" 0
-// @count - "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.bounds[*]" 0
-// @is - "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].kind.type.default" null
-// @is - "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.default.kind" \"resolved_path\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.default.inner.id" $my_error
-// @is - "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.default.inner.name" \"MyError\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.kind" \"resolved_path\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.inner.id" $result
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.inner.name" \"Result\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.bindings" []
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[0].type.kind" \"generic\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[1].type.kind" \"generic\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[0].type.inner" \"T\"
-// @is - "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[1].type.inner" \"E\"
+// @is "$.index[*][?(@.name=='MyResult')].kind" \"typedef\"
+// @count "$.index[*][?(@.name=='MyResult')].inner.generics.where_predicates[*]" 0
+// @count "$.index[*][?(@.name=='MyResult')].inner.generics.params[*]" 2
+// @is "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].name" \"T\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].name" \"E\"
+// @has "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].kind.type"
+// @has "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type"
+// @count "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].kind.type.bounds[*]" 0
+// @count "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.bounds[*]" 0
+// @is "$.index[*][?(@.name=='MyResult')].inner.generics.params[0].kind.type.default" null
+// @is "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.default.kind" \"resolved_path\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.default.inner.id" $my_error
+// @is "$.index[*][?(@.name=='MyResult')].inner.generics.params[1].kind.type.default.inner.name" \"MyError\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.kind" \"resolved_path\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.inner.id" $result
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.inner.name" \"Result\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.bindings" []
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[0].type.kind" \"generic\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[1].type.kind" \"generic\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[0].type.inner" \"T\"
+// @is "$.index[*][?(@.name=='MyResult')].inner.type.inner.args.angle_bracketed.args[1].type.inner" \"E\"
pub type MyResult<T, E = MyError> = Result<T, E>;
diff --git a/src/test/rustdoc-json/type/hrtb.rs b/src/test/rustdoc-json/type/hrtb.rs
new file mode 100644
index 000000000..2c4ee00d4
--- /dev/null
+++ b/src/test/rustdoc-json/type/hrtb.rs
@@ -0,0 +1,24 @@
+// ignore-tidy-linelength
+
+// @is "$.index[*][?(@.name=='genfn')].inner.generics.where_predicates[0].bound_predicate.type" '{"inner": "F","kind": "generic"}'
+// @is "$.index[*][?(@.name=='genfn')].inner.generics.where_predicates[0].bound_predicate.generic_params" '[{"kind": {"lifetime": {"outlives": []}},"name": "'\''a"},{"kind": {"lifetime": {"outlives": []}},"name": "'\''b"}]'
+pub fn genfn<F>(f: F)
+where
+ for<'a, 'b> F: Fn(&'a i32, &'b i32),
+{
+ let zero = 0;
+ f(&zero, &zero);
+}
+
+// @is "$.index[*][?(@.name=='dynfn')].inner.generics" '{"params": [], "where_predicates": []}'
+// @is "$.index[*][?(@.name=='dynfn')].inner.generics" '{"params": [], "where_predicates": []}'
+// @is "$.index[*][?(@.name=='dynfn')].inner.decl.inputs[0][1].kind" '"borrowed_ref"'
+// @is "$.index[*][?(@.name=='dynfn')].inner.decl.inputs[0][1].inner.type.kind" '"dyn_trait"'
+// @is "$.index[*][?(@.name=='dynfn')].inner.decl.inputs[0][1].inner.type.inner.lifetime" null
+// @count "$.index[*][?(@.name=='dynfn')].inner.decl.inputs[0][1].inner.type.inner.traits[*]" 1
+// @is "$.index[*][?(@.name=='dynfn')].inner.decl.inputs[0][1].inner.type.inner.traits[0].generic_params" '[{"kind": {"lifetime": {"outlives": []}},"name": "'\''a"},{"kind": {"lifetime": {"outlives": []}},"name": "'\''b"}]'
+// @is "$.index[*][?(@.name=='dynfn')].inner.decl.inputs[0][1].inner.type.inner.traits[0].trait.name" '"Fn"'
+pub fn dynfn(f: &dyn for<'a, 'b> Fn(&'a i32, &'b i32)) {
+ let zero = 0;
+ f(&zero, &zero);
+}
diff --git a/src/test/rustdoc-json/unions/impl.rs b/src/test/rustdoc-json/unions/impl.rs
index 0388b4a8c..4454a69ec 100644
--- a/src/test/rustdoc-json/unions/impl.rs
+++ b/src/test/rustdoc-json/unions/impl.rs
@@ -1,15 +1,15 @@
#![no_std]
-// @has impl.json "$.index[*][?(@.name=='Ux')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='Ux')].kind" \"union\"
+// @is "$.index[*][?(@.name=='Ux')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='Ux')].kind" \"union\"
pub union Ux {
a: u32,
b: u64
}
-// @has - "$.index[*][?(@.name=='Num')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='Num')].kind" \"trait\"
+// @is "$.index[*][?(@.name=='Num')].visibility" \"public\"
+// @is "$.index[*][?(@.name=='Num')].kind" \"trait\"
pub trait Num {}
-// @count - "$.index[*][?(@.name=='Ux')].inner.impls" 1
+// @count "$.index[*][?(@.name=='Ux')].inner.impls" 1
impl Num for Ux {}
diff --git a/src/test/rustdoc-json/unions/union.rs b/src/test/rustdoc-json/unions/union.rs
index ac2eb7977..c9df2b81c 100644
--- a/src/test/rustdoc-json/unions/union.rs
+++ b/src/test/rustdoc-json/unions/union.rs
@@ -1,7 +1,15 @@
-// @has union.json "$.index[*][?(@.name=='Union')].visibility" \"public\"
-// @has - "$.index[*][?(@.name=='Union')].kind" \"union\"
-// @!has - "$.index[*][?(@.name=='Union')].inner.struct_type"
+// @has "$.index[*][?(@.name=='Union')].visibility" \"public\"
+// @has "$.index[*][?(@.name=='Union')].kind" \"union\"
+// @!has "$.index[*][?(@.name=='Union')].inner.struct_type"
+// @set Union = "$.index[*][?(@.name=='Union')].id"
pub union Union {
int: i32,
float: f32,
}
+
+
+// @is "$.index[*][?(@.name=='make_int_union')].inner.decl.output.kind" '"resolved_path"'
+// @is "$.index[*][?(@.name=='make_int_union')].inner.decl.output.inner.id" $Union
+pub fn make_int_union(int: i32) -> Union {
+ Union { int }
+}
diff --git a/src/test/rustdoc-ui/bare-urls.stderr b/src/test/rustdoc-ui/bare-urls.stderr
index 7097a8ddf..ccf52cd0b 100644
--- a/src/test/rustdoc-ui/bare-urls.stderr
+++ b/src/test/rustdoc-ui/bare-urls.stderr
@@ -4,12 +4,12 @@ error: this URL is not a hyperlink
LL | /// https://somewhere.com
| ^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com>`
|
+ = note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/bare-urls.rs:3:9
|
LL | #![deny(rustdoc::bare_urls)]
| ^^^^^^^^^^^^^^^^^^
- = note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:7:5
diff --git a/src/test/rustdoc-ui/check-attr-test.stderr b/src/test/rustdoc-ui/check-attr-test.stderr
index b1fa9edf0..01beba1ff 100644
--- a/src/test/rustdoc-ui/check-attr-test.stderr
+++ b/src/test/rustdoc-ui/check-attr-test.stderr
@@ -8,12 +8,12 @@ error: unknown attribute `compile-fail`. Did you mean `compile_fail`?
9 | | /// ```
| |_______^
|
+ = help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
note: the lint level is defined here
--> $DIR/check-attr-test.rs:3:9
|
3 | #![deny(rustdoc::invalid_codeblock_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
error: unknown attribute `compilefail`. Did you mean `compile_fail`?
--> $DIR/check-attr-test.rs:5:1
diff --git a/src/test/rustdoc-ui/check-attr.stderr b/src/test/rustdoc-ui/check-attr.stderr
index 370b804c5..f66e63ab7 100644
--- a/src/test/rustdoc-ui/check-attr.stderr
+++ b/src/test/rustdoc-ui/check-attr.stderr
@@ -10,12 +10,12 @@ LL | | /// boo
LL | | /// ```
| |_______^
|
+ = help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
note: the lint level is defined here
--> $DIR/check-attr.rs:1:9
|
LL | #![deny(rustdoc::invalid_codeblock_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: the code block will either not be tested if not marked as a rust one or won't fail if it compiles successfully
error: unknown attribute `compilefail`. Did you mean `compile_fail`?
--> $DIR/check-attr.rs:3:1
diff --git a/src/test/rustdoc-ui/check-cfg-test.stderr b/src/test/rustdoc-ui/check-cfg-test.stderr
index dc25205da..9770be2f1 100644
--- a/src/test/rustdoc-ui/check-cfg-test.stderr
+++ b/src/test/rustdoc-ui/check-cfg-test.stderr
@@ -4,8 +4,8 @@ warning: unexpected `cfg` condition value
LL | #[cfg(feature = "invalid")]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: expected values for `feature` are: test
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/check-fail.rs b/src/test/rustdoc-ui/check-fail.rs
index 2355d6a3d..c5e1759ee 100644
--- a/src/test/rustdoc-ui/check-fail.rs
+++ b/src/test/rustdoc-ui/check-fail.rs
@@ -1,5 +1,6 @@
// compile-flags: -Z unstable-options --check
+#![feature(rustdoc_missing_doc_code_examples)]
#![deny(missing_docs)]
#![deny(rustdoc::all)]
diff --git a/src/test/rustdoc-ui/check-fail.stderr b/src/test/rustdoc-ui/check-fail.stderr
index 5d46dc720..d8aeccbfc 100644
--- a/src/test/rustdoc-ui/check-fail.stderr
+++ b/src/test/rustdoc-ui/check-fail.stderr
@@ -1,30 +1,30 @@
error: missing documentation for a function
- --> $DIR/check-fail.rs:11:1
+ --> $DIR/check-fail.rs:12:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/check-fail.rs:3:9
+ --> $DIR/check-fail.rs:4:9
|
LL | #![deny(missing_docs)]
| ^^^^^^^^^^^^
error: missing code example in this documentation
- --> $DIR/check-fail.rs:11:1
+ --> $DIR/check-fail.rs:12:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/check-fail.rs:4:9
+ --> $DIR/check-fail.rs:5:9
|
LL | #![deny(rustdoc::all)]
| ^^^^^^^^^^^^
= note: `#[deny(rustdoc::missing_doc_code_examples)]` implied by `#[deny(rustdoc::all)]`
error: unknown attribute `testharness`. Did you mean `test_harness`?
- --> $DIR/check-fail.rs:6:1
+ --> $DIR/check-fail.rs:7:1
|
LL | / //! ```rust,testharness
LL | |
@@ -32,11 +32,11 @@ LL | | //! let x = 12;
LL | | //! ```
| |_______^
|
- = note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(rustdoc::all)]`
= help: the code block will either not be tested if not marked as a rust one or the code will be wrapped inside a main function
+ = note: `#[deny(rustdoc::invalid_codeblock_attributes)]` implied by `#[deny(rustdoc::all)]`
error: unknown attribute `testharness`. Did you mean `test_harness`?
- --> $DIR/check-fail.rs:15:1
+ --> $DIR/check-fail.rs:16:1
|
LL | / /// hello
LL | |
diff --git a/src/test/rustdoc-ui/check.rs b/src/test/rustdoc-ui/check.rs
index 2b44ba24b..f70b03361 100644
--- a/src/test/rustdoc-ui/check.rs
+++ b/src/test/rustdoc-ui/check.rs
@@ -2,9 +2,11 @@
// compile-flags: -Z unstable-options --check
// normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
-#![warn(missing_docs)]
+#![feature(rustdoc_missing_doc_code_examples)]
//~^ WARN
//~^^ WARN
+
+#![warn(missing_docs)]
#![warn(rustdoc::all)]
pub fn foo() {}
diff --git a/src/test/rustdoc-ui/check.stderr b/src/test/rustdoc-ui/check.stderr
index 06e607fbe..d379f33f2 100644
--- a/src/test/rustdoc-ui/check.stderr
+++ b/src/test/rustdoc-ui/check.stderr
@@ -1,44 +1,46 @@
warning: missing documentation for the crate
--> $DIR/check.rs:5:1
|
-LL | / #![warn(missing_docs)]
+LL | / #![feature(rustdoc_missing_doc_code_examples)]
LL | |
LL | |
-LL | | #![warn(rustdoc::all)]
+LL | |
+... |
LL | |
LL | | pub fn foo() {}
| |_______________^
|
note: the lint level is defined here
- --> $DIR/check.rs:5:9
+ --> $DIR/check.rs:9:9
|
LL | #![warn(missing_docs)]
| ^^^^^^^^^^^^
warning: missing documentation for a function
- --> $DIR/check.rs:10:1
+ --> $DIR/check.rs:12:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^
warning: no documentation found for this crate's top-level module
|
+ = help: The following guide may be of use:
+ https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
note: the lint level is defined here
- --> $DIR/check.rs:8:9
+ --> $DIR/check.rs:10:9
|
LL | #![warn(rustdoc::all)]
| ^^^^^^^^^^^^
= note: `#[warn(rustdoc::missing_crate_level_docs)]` implied by `#[warn(rustdoc::all)]`
- = help: The following guide may be of use:
- https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
warning: missing code example in this documentation
--> $DIR/check.rs:5:1
|
-LL | / #![warn(missing_docs)]
+LL | / #![feature(rustdoc_missing_doc_code_examples)]
+LL | |
LL | |
LL | |
-LL | | #![warn(rustdoc::all)]
+... |
LL | |
LL | | pub fn foo() {}
| |_______________^
@@ -46,7 +48,7 @@ LL | | pub fn foo() {}
= note: `#[warn(rustdoc::missing_doc_code_examples)]` implied by `#[warn(rustdoc::all)]`
warning: missing code example in this documentation
- --> $DIR/check.rs:10:1
+ --> $DIR/check.rs:12:1
|
LL | pub fn foo() {}
| ^^^^^^^^^^^^^^^
diff --git a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr
index 67d9c3989..3e08354a6 100644
--- a/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr
+++ b/src/test/rustdoc-ui/deny-intra-link-resolution-failure.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `v2`
LL | /// [v2]
| ^^ no item named `v2` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/deny-intra-link-resolution-failure.rs:1:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/diagnostic-width.rs b/src/test/rustdoc-ui/diagnostic-width.rs
index 61961d5ec..290d9db77 100644
--- a/src/test/rustdoc-ui/diagnostic-width.rs
+++ b/src/test/rustdoc-ui/diagnostic-width.rs
@@ -1,4 +1,4 @@
-// compile-flags: -Zunstable-options --diagnostic-width=10
+// compile-flags: --diagnostic-width=10
#![deny(rustdoc::bare_urls)]
/// This is a long line that contains a http://link.com
diff --git a/src/test/rustdoc-ui/diagnostic-width.stderr b/src/test/rustdoc-ui/diagnostic-width.stderr
index fed049d2b..1a00d10d3 100644
--- a/src/test/rustdoc-ui/diagnostic-width.stderr
+++ b/src/test/rustdoc-ui/diagnostic-width.stderr
@@ -4,12 +4,12 @@ error: this URL is not a hyperlink
LL | ... a http://link.com
| ^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://link.com>`
|
+ = note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/diagnostic-width.rs:2:9
|
LL | ...ny(rustdoc::bare_url...
| ^^^^^^^^^^^^^^^^^^
- = note: bare URLs are not automatically turned into clickable links
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/doc-attr.stderr b/src/test/rustdoc-ui/doc-attr.stderr
index cc2494c92..68df2771f 100644
--- a/src/test/rustdoc-ui/doc-attr.stderr
+++ b/src/test/rustdoc-ui/doc-attr.stderr
@@ -4,14 +4,14 @@ error: unknown `doc` attribute `as_ptr`
LL | #[doc(as_ptr)]
| ^^^^^^
|
+ = 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-attr.rs:2:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
- = 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>
error: invalid `doc` attribute
--> $DIR/doc-attr.rs:12:7
diff --git a/src/test/rustdoc-ui/doc-include-suggestion.stderr b/src/test/rustdoc-ui/doc-include-suggestion.stderr
index 870b7efa2..fcc93d053 100644
--- a/src/test/rustdoc-ui/doc-include-suggestion.stderr
+++ b/src/test/rustdoc-ui/doc-include-suggestion.stderr
@@ -4,9 +4,9 @@ warning: unknown `doc` attribute `include`
LL | #[doc(include = "external-cross-doc.md")]
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- help: use `doc = include_str!` instead: `#[doc = include_str!("external-cross-doc.md")]`
|
- = note: `#[warn(invalid_doc_attributes)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+ = note: `#[warn(invalid_doc_attributes)]` on by default
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/doc-spotlight.stderr b/src/test/rustdoc-ui/doc-spotlight.stderr
index 8e7831139..58612327f 100644
--- a/src/test/rustdoc-ui/doc-spotlight.stderr
+++ b/src/test/rustdoc-ui/doc-spotlight.stderr
@@ -4,16 +4,16 @@ error: unknown `doc` attribute `spotlight`
LL | #[doc(spotlight)]
| ^^^^^^^^^ help: use `notable_trait` instead
|
+ = 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: `doc(spotlight)` was renamed to `doc(notable_trait)`
+ = note: `doc(spotlight)` is now a no-op
note: the lint level is defined here
--> $DIR/doc-spotlight.rs:2:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
- = 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: `doc(spotlight)` was renamed to `doc(notable_trait)`
- = note: `doc(spotlight)` is now a no-op
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/doc-test-attr.stderr b/src/test/rustdoc-ui/doc-test-attr.stderr
index 7f5e2d6bc..5e6014954 100644
--- a/src/test/rustdoc-ui/doc-test-attr.stderr
+++ b/src/test/rustdoc-ui/doc-test-attr.stderr
@@ -4,13 +4,13 @@ error: `#[doc(test(...)]` takes a list of attributes
LL | #![doc(test)]
| ^^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
note: the lint level is defined here
--> $DIR/doc-test-attr.rs:2:9
|
LL | #![deny(invalid_doc_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = 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>
error: `#[doc(test(...)]` takes a list of attributes
--> $DIR/doc-test-attr.rs:7:8
diff --git a/src/test/rustdoc-ui/doc-without-codeblock.rs b/src/test/rustdoc-ui/doc-without-codeblock.rs
index 315fca195..86d7c83d3 100644
--- a/src/test/rustdoc-ui/doc-without-codeblock.rs
+++ b/src/test/rustdoc-ui/doc-without-codeblock.rs
@@ -1,4 +1,5 @@
-#![deny(rustdoc::missing_doc_code_examples)] //~ ERROR missing code example in this documentation
+#![feature(rustdoc_missing_doc_code_examples)] //~ ERROR missing code example in this documentation
+#![deny(rustdoc::missing_doc_code_examples)]
/// Some docs.
//~^ ERROR missing code example in this documentation
diff --git a/src/test/rustdoc-ui/doc-without-codeblock.stderr b/src/test/rustdoc-ui/doc-without-codeblock.stderr
index 1c1380441..ebf2a2d54 100644
--- a/src/test/rustdoc-ui/doc-without-codeblock.stderr
+++ b/src/test/rustdoc-ui/doc-without-codeblock.stderr
@@ -1,35 +1,35 @@
error: missing code example in this documentation
--> $DIR/doc-without-codeblock.rs:1:1
|
-LL | / #![deny(rustdoc::missing_doc_code_examples)]
+LL | / #![feature(rustdoc_missing_doc_code_examples)]
+LL | | #![deny(rustdoc::missing_doc_code_examples)]
LL | |
LL | | /// Some docs.
-LL | |
... |
LL | | }
LL | | }
| |_^
|
note: the lint level is defined here
- --> $DIR/doc-without-codeblock.rs:1:9
+ --> $DIR/doc-without-codeblock.rs:2:9
|
LL | #![deny(rustdoc::missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing code example in this documentation
- --> $DIR/doc-without-codeblock.rs:7:1
+ --> $DIR/doc-without-codeblock.rs:8:1
|
LL | /// And then, the princess died.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing code example in this documentation
- --> $DIR/doc-without-codeblock.rs:10:5
+ --> $DIR/doc-without-codeblock.rs:11:5
|
LL | /// Or maybe not because she saved herself!
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing code example in this documentation
- --> $DIR/doc-without-codeblock.rs:3:1
+ --> $DIR/doc-without-codeblock.rs:4:1
|
LL | /// Some docs.
| ^^^^^^^^^^^^^^
diff --git a/src/test/rustdoc-ui/doc_cfg_hide.rs b/src/test/rustdoc-ui/doc_cfg_hide.rs
new file mode 100644
index 000000000..5d8791748
--- /dev/null
+++ b/src/test/rustdoc-ui/doc_cfg_hide.rs
@@ -0,0 +1,11 @@
+#![feature(doc_cfg_hide)]
+#![deny(warnings)]
+
+#![doc(cfg_hide = "test")] //~ ERROR
+//~^ WARN
+#![doc(cfg_hide)] //~ ERROR
+//~^ WARN
+
+#[doc(cfg_hide(doc))] //~ ERROR
+//~^ WARN
+pub fn foo() {}
diff --git a/src/test/rustdoc-ui/doc_cfg_hide.stderr b/src/test/rustdoc-ui/doc_cfg_hide.stderr
new file mode 100644
index 000000000..03623368c
--- /dev/null
+++ b/src/test/rustdoc-ui/doc_cfg_hide.stderr
@@ -0,0 +1,40 @@
+error: this attribute can only be applied at the crate level
+ --> $DIR/doc_cfg_hide.rs:9:7
+ |
+LL | #[doc(cfg_hide(doc))]
+ | ^^^^^^^^^^^^^
+ |
+ = 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: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
+note: the lint level is defined here
+ --> $DIR/doc_cfg_hide.rs:2:9
+ |
+LL | #![deny(warnings)]
+ | ^^^^^^^^
+ = note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
+help: to apply to the crate, use an inner attribute
+ |
+LL | #![doc(cfg_hide(doc))]
+ | ~~~~~~~~~~~~~~~~~~~~~~
+
+error: `#[doc(cfg_hide(...)]` takes a list of attributes
+ --> $DIR/doc_cfg_hide.rs:4:8
+ |
+LL | #![doc(cfg_hide = "test")]
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+
+error: `#[doc(cfg_hide(...)]` takes a list of attributes
+ --> $DIR/doc_cfg_hide.rs:6:8
+ |
+LL | #![doc(cfg_hide)]
+ | ^^^^^^^^
+ |
+ = 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>
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/rustdoc-ui/doctest-edition.stderr b/src/test/rustdoc-ui/doctest-edition.stderr
index 1643d6053..8a3329aa3 100644
--- a/src/test/rustdoc-ui/doctest-edition.stderr
+++ b/src/test/rustdoc-ui/doctest-edition.stderr
@@ -7,12 +7,12 @@ LL | | //! foo'b'
LL | | //! ```
| |_______^
|
+ = note: error from rustc: prefix `foo` is unknown
note: the lint level is defined here
--> $DIR/doctest-edition.rs:3:9
|
LL | #![deny(rustdoc::invalid_rust_codeblocks)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: error from rustc: prefix `foo` is unknown
help: mark blocks that do not contain Rust code as text
|
LL | //! ```text
diff --git a/src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs b/src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs
new file mode 100644
index 000000000..daba69868
--- /dev/null
+++ b/src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.rs
@@ -0,0 +1,10 @@
+#![deny(unknown_lints)]
+//~^ NOTE defined here
+
+#![allow(rustdoc::missing_doc_code_examples)]
+//~^ ERROR unknown lint
+//~| ERROR unknown lint
+//~| NOTE lint is unstable
+//~| NOTE lint is unstable
+//~| NOTE see issue
+//~| NOTE see issue
diff --git a/src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr b/src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr
new file mode 100644
index 000000000..cbe9a3d14
--- /dev/null
+++ b/src/test/rustdoc-ui/feature-gate-rustdoc_missing_doc_code_examples.stderr
@@ -0,0 +1,29 @@
+error: unknown lint: `rustdoc::missing_doc_code_examples`
+ --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:1
+ |
+LL | #![allow(rustdoc::missing_doc_code_examples)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `rustdoc::missing_doc_code_examples` lint is unstable
+ = note: see issue #101730 <https://github.com/rust-lang/rust/issues/101730> for more information
+ = help: add `#![feature(rustdoc_missing_doc_code_examples)]` to the crate attributes to enable
+note: the lint level is defined here
+ --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:1:9
+ |
+LL | #![deny(unknown_lints)]
+ | ^^^^^^^^^^^^^
+
+error: unknown lint: `rustdoc::missing_doc_code_examples`
+ --> $DIR/feature-gate-rustdoc_missing_doc_code_examples.rs:4:1
+ |
+LL | #![allow(rustdoc::missing_doc_code_examples)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the `rustdoc::missing_doc_code_examples` lint is unstable
+ = note: see issue #101730 <https://github.com/rust-lang/rust/issues/101730> for more information
+ = help: add `#![feature(rustdoc_missing_doc_code_examples)]` to the crate attributes to enable
+
+error: Compilation failed, aborting rustdoc
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/rustdoc-ui/ignore-block-help.stderr b/src/test/rustdoc-ui/ignore-block-help.stderr
index 9c02ff11d..a30ea51dd 100644
--- a/src/test/rustdoc-ui/ignore-block-help.stderr
+++ b/src/test/rustdoc-ui/ignore-block-help.stderr
@@ -7,13 +7,13 @@ LL | | /// let heart = '❤️';
LL | | /// ```
| |_______^
|
- = note: `#[warn(rustdoc::invalid_rust_codeblocks)]` on by default
help: `ignore` code blocks require valid Rust code for syntax highlighting; mark blocks that do not contain Rust code as text: ```text
--> $DIR/ignore-block-help.rs:3:5
|
LL | /// ```ignore (to-prevent-tidy-error)
| ^^^
= note: error from rustc: character literal may only contain one codepoint
+ = note: `#[warn(rustdoc::invalid_rust_codeblocks)]` on by default
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
index 2319de556..4b1e04234 100644
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
+++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.rs
@@ -1,11 +1,12 @@
+// check-pass
// normalize-stderr-test: "`.*`" -> "`DEF_ID`"
// normalize-stdout-test: "`.*`" -> "`DEF_ID`"
// edition:2018
pub async fn f() -> impl std::fmt::Debug {
+ // rustdoc doesn't care that this is infinitely sized
#[derive(Debug)]
enum E {
- //~^ ERROR recursive type `f::{closure#0}::E` has infinite size
This(E),
Unit,
}
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr
deleted file mode 100644
index aa39d26fe..000000000
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait-return.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0072]: recursive type `DEF_ID` has infinite size
- --> $DIR/infinite-recursive-type-impl-trait-return.rs:7:5
- |
-LL | enum E {
- | ^^^^^^ recursive type has infinite size
-LL |
-LL | This(E),
- | - recursive without indirection
- |
-help: insert some indirection (e.g., a `DEF_ID` representable
- |
-LL | This(Box<E>),
- | ++++ +
-
-error: aborting due to previous error
-
-For more information about this error, try `DEF_ID`.
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs
index b3a7ee563..ac79582fb 100644
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs
+++ b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.rs
@@ -1,6 +1,8 @@
+// check-pass
+
fn f() -> impl Sized {
+ // rustdoc doesn't care that this is infinitely sized
enum E {
- //~^ ERROR recursive type `f::E` has infinite size
V(E),
}
unimplemented!()
diff --git a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr b/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr
deleted file mode 100644
index 009bedec5..000000000
--- a/src/test/rustdoc-ui/infinite-recursive-type-impl-trait.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0072]: recursive type `f::E` has infinite size
- --> $DIR/infinite-recursive-type-impl-trait.rs:2:5
- |
-LL | enum E {
- | ^^^^^^ recursive type has infinite size
-LL |
-LL | V(E),
- | - recursive without indirection
- |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `f::E` representable
- |
-LL | V(Box<E>),
- | ++++ +
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/rustdoc-ui/infinite-recursive-type.stderr b/src/test/rustdoc-ui/infinite-recursive-type.stderr
index b33aba446..9e2c3ff16 100644
--- a/src/test/rustdoc-ui/infinite-recursive-type.stderr
+++ b/src/test/rustdoc-ui/infinite-recursive-type.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `E` has infinite size
--> $DIR/infinite-recursive-type.rs:1:1
|
LL | enum E {
- | ^^^^^^ recursive type has infinite size
+ | ^^^^^^
LL |
LL | V(E),
| - recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `E` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | V(Box<E>),
| ++++ +
diff --git a/src/test/rustdoc-ui/intra-doc/html-as-generics-intra-doc.stderr b/src/test/rustdoc-ui/intra-doc/html-as-generics-intra-doc.stderr
index 00fe229da..7c81044db 100644
--- a/src/test/rustdoc-ui/intra-doc/html-as-generics-intra-doc.stderr
+++ b/src/test/rustdoc-ui/intra-doc/html-as-generics-intra-doc.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `NonExistentStruct`
LL | /// This [test][NonExistentStruct<i32>] thing!
| ^^^^^^^^^^^^^^^^^^^^^^ no item named `NonExistentStruct` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/html-as-generics-intra-doc.rs:2:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: unresolved link to `NonExistentStruct2`
--> $DIR/html-as-generics-intra-doc.rs:17:11
diff --git a/src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr b/src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr
index 8e17323fd..6ad8084b0 100644
--- a/src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr
+++ b/src/test/rustdoc-ui/intra-doc/macro-rules-error.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `before_but_limited_to_module`
LL | /// [before_but_limited_to_module]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `before_but_limited_to_module` in scope
|
+ = note: `macro_rules` named `before_but_limited_to_module` exists in this crate, but it is not in scope at this link's location
note: the lint level is defined here
--> $DIR/macro-rules-error.rs:5:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: `macro_rules` named `before_but_limited_to_module` exists in this crate, but it is not in scope at this link's location
error: unresolved link to `after`
--> $DIR/macro-rules-error.rs:15:6
diff --git a/src/test/rustdoc-ui/intra-doc/malformed-generics.rs b/src/test/rustdoc-ui/intra-doc/malformed-generics.rs
index 15e02925e..161625ed2 100644
--- a/src/test/rustdoc-ui/intra-doc/malformed-generics.rs
+++ b/src/test/rustdoc-ui/intra-doc/malformed-generics.rs
@@ -3,17 +3,26 @@
//! [Vec<] //~ ERROR
//! [Vec<Box<T] //~ ERROR
//! [Vec<Box<T>] //~ ERROR
+//~^ WARN
//! [Vec<Box<T>>>] //~ ERROR
+//~^ WARN
//! [Vec<T>>>] //~ ERROR
+//~^ WARN
//! [<Vec] //~ ERROR
//! [Vec::<] //~ ERROR
//! [<T>] //~ ERROR
+//~^ WARN
//! [<invalid syntax>] //~ ERROR
+//~^ WARN
//! [Vec:<T>:new()] //~ ERROR
+//~^ WARN
//! [Vec<<T>>] //~ ERROR
+//~^ WARN
//! [Vec<>] //~ ERROR
//! [Vec<<>>] //~ ERROR
// FIXME(#74563) support UFCS
//! [<Vec as IntoIterator>::into_iter] //~ ERROR
+//~^ WARN
//! [<Vec<T> as IntoIterator>::iter] //~ ERROR
+//~^ WARN
diff --git a/src/test/rustdoc-ui/intra-doc/malformed-generics.stderr b/src/test/rustdoc-ui/intra-doc/malformed-generics.stderr
index 5bc0f84e2..08349fef8 100644
--- a/src/test/rustdoc-ui/intra-doc/malformed-generics.stderr
+++ b/src/test/rustdoc-ui/intra-doc/malformed-generics.stderr
@@ -23,67 +23,67 @@ LL | //! [Vec<Box<T>]
| ^^^^^^^^^^ unbalanced angle brackets
error: unresolved link to `Vec<Box<T>>>`
- --> $DIR/malformed-generics.rs:6:6
+ --> $DIR/malformed-generics.rs:7:6
|
LL | //! [Vec<Box<T>>>]
| ^^^^^^^^^^^^ unbalanced angle brackets
error: unresolved link to `Vec<T>>>`
- --> $DIR/malformed-generics.rs:7:6
+ --> $DIR/malformed-generics.rs:9:6
|
LL | //! [Vec<T>>>]
| ^^^^^^^^ unbalanced angle brackets
error: unresolved link to `<Vec`
- --> $DIR/malformed-generics.rs:8:6
+ --> $DIR/malformed-generics.rs:11:6
|
LL | //! [<Vec]
| ^^^^ unbalanced angle brackets
error: unresolved link to `Vec::<`
- --> $DIR/malformed-generics.rs:9:6
+ --> $DIR/malformed-generics.rs:12:6
|
LL | //! [Vec::<]
| ^^^^^^ unbalanced angle brackets
error: unresolved link to `<T>`
- --> $DIR/malformed-generics.rs:10:6
+ --> $DIR/malformed-generics.rs:13:6
|
LL | //! [<T>]
| ^^^ missing type for generic parameters
error: unresolved link to `<invalid syntax>`
- --> $DIR/malformed-generics.rs:11:6
+ --> $DIR/malformed-generics.rs:15:6
|
LL | //! [<invalid syntax>]
| ^^^^^^^^^^^^^^^^ missing type for generic parameters
error: unresolved link to `Vec:<T>:new`
- --> $DIR/malformed-generics.rs:12:6
+ --> $DIR/malformed-generics.rs:17:6
|
LL | //! [Vec:<T>:new()]
| ^^^^^^^^^^^^^ has invalid path separator
error: unresolved link to `Vec<<T>>`
- --> $DIR/malformed-generics.rs:13:6
+ --> $DIR/malformed-generics.rs:19:6
|
LL | //! [Vec<<T>>]
| ^^^^^^^^ too many angle brackets
error: unresolved link to `Vec<>`
- --> $DIR/malformed-generics.rs:14:6
+ --> $DIR/malformed-generics.rs:21:6
|
LL | //! [Vec<>]
| ^^^^^ empty angle brackets
error: unresolved link to `Vec<<>>`
- --> $DIR/malformed-generics.rs:15:6
+ --> $DIR/malformed-generics.rs:22:6
|
LL | //! [Vec<<>>]
| ^^^^^^^ too many angle brackets
error: unresolved link to `<Vec as IntoIterator>::into_iter`
- --> $DIR/malformed-generics.rs:18:6
+ --> $DIR/malformed-generics.rs:25:6
|
LL | //! [<Vec as IntoIterator>::into_iter]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fully-qualified syntax is unsupported
@@ -91,12 +91,68 @@ LL | //! [<Vec as IntoIterator>::into_iter]
= note: see https://github.com/rust-lang/rust/issues/74563 for more information
error: unresolved link to `<Vec<T> as IntoIterator>::iter`
- --> $DIR/malformed-generics.rs:19:6
+ --> $DIR/malformed-generics.rs:27:6
|
LL | //! [<Vec<T> as IntoIterator>::iter]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ fully-qualified syntax is unsupported
|
= note: see https://github.com/rust-lang/rust/issues/74563 for more information
-error: aborting due to 15 previous errors
+warning: unclosed HTML tag `T`
+ --> $DIR/malformed-generics.rs:5:13
+ |
+LL | //! [Vec<Box<T>]
+ | ^^^
+ |
+ = note: `#[warn(rustdoc::invalid_html_tags)]` on by default
+
+warning: unclosed HTML tag `T`
+ --> $DIR/malformed-generics.rs:7:13
+ |
+LL | //! [Vec<Box<T>>>]
+ | ^^^
+
+warning: unclosed HTML tag `T`
+ --> $DIR/malformed-generics.rs:9:9
+ |
+LL | //! [Vec<T>>>]
+ | ^^^
+
+warning: unclosed HTML tag `T`
+ --> $DIR/malformed-generics.rs:13:6
+ |
+LL | //! [<T>]
+ | ^^^
+
+warning: unclosed HTML tag `invalid`
+ --> $DIR/malformed-generics.rs:15:6
+ |
+LL | //! [<invalid syntax>]
+ | ^^^^^^^^
+
+warning: unclosed HTML tag `T`
+ --> $DIR/malformed-generics.rs:17:10
+ |
+LL | //! [Vec:<T>:new()]
+ | ^^^
+
+warning: unclosed HTML tag `T`
+ --> $DIR/malformed-generics.rs:19:10
+ |
+LL | //! [Vec<<T>>]
+ | ^^^
+
+warning: unclosed HTML tag `Vec`
+ --> $DIR/malformed-generics.rs:25:6
+ |
+LL | //! [<Vec as IntoIterator>::into_iter]
+ | ^^^^
+
+warning: unclosed HTML tag `T`
+ --> $DIR/malformed-generics.rs:27:10
+ |
+LL | //! [<Vec<T> as IntoIterator>::iter]
+ | ^^^
+
+error: aborting due to 15 previous errors; 9 warnings emitted
diff --git a/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr b/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr
index 4828a3044..8ec894d10 100644
--- a/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr
+++ b/src/test/rustdoc-ui/intra-doc/non-path-primitives.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `T`
LL | //! [[T]::rotate_left]
| ^ no item named `T` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/non-path-primitives.rs:1:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: unresolved link to `Z`
--> $DIR/non-path-primitives.rs:14:5
diff --git a/src/test/rustdoc-ui/intra-doc/private-from-crate-level.stderr b/src/test/rustdoc-ui/intra-doc/private-from-crate-level.stderr
index 6172cd2e3..4d5bd70bf 100644
--- a/src/test/rustdoc-ui/intra-doc/private-from-crate-level.stderr
+++ b/src/test/rustdoc-ui/intra-doc/private-from-crate-level.stderr
@@ -4,8 +4,8 @@ warning: public documentation for `private_from_crate_level` links to private it
LL | //! [my_module]
| ^^^^^^^^^ this item is private
|
- = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`
+ = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/intra-doc/private.private.stderr b/src/test/rustdoc-ui/intra-doc/private.private.stderr
index 392321f9c..6661e9021 100644
--- a/src/test/rustdoc-ui/intra-doc/private.private.stderr
+++ b/src/test/rustdoc-ui/intra-doc/private.private.stderr
@@ -4,8 +4,8 @@ warning: public documentation for `DocMe` links to private item `DontDocMe`
LL | /// docs [DontDocMe] [DontDocMe::f] [DontDocMe::x]
| ^^^^^^^^^ this item is private
|
- = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
= note: this link resolves only because you passed `--document-private-items`, but will break without
+ = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
warning: public documentation for `DocMe` links to private item `DontDocMe::f`
--> $DIR/private.rs:7:23
diff --git a/src/test/rustdoc-ui/intra-doc/private.public.stderr b/src/test/rustdoc-ui/intra-doc/private.public.stderr
index 5d1c34b91..45b51e12e 100644
--- a/src/test/rustdoc-ui/intra-doc/private.public.stderr
+++ b/src/test/rustdoc-ui/intra-doc/private.public.stderr
@@ -4,8 +4,8 @@ warning: public documentation for `DocMe` links to private item `DontDocMe`
LL | /// docs [DontDocMe] [DontDocMe::f] [DontDocMe::x]
| ^^^^^^^^^ this item is private
|
- = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`
+ = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
warning: public documentation for `DocMe` links to private item `DontDocMe::f`
--> $DIR/private.rs:7:23
diff --git a/src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr b/src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr
index bf4ab9fdd..e8ee40ad4 100644
--- a/src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr
+++ b/src/test/rustdoc-ui/intra-doc/span-ice-55723.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `i`
LL | /// (arr[i])
| ^ no item named `i` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/span-ice-55723.rs:1:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr b/src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr
index f0a7ed178..508d0683d 100644
--- a/src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr
+++ b/src/test/rustdoc-ui/intra-doc/through-proc-macro.stderr
@@ -4,12 +4,12 @@ warning: unresolved link to `Oooops`
LL | /// [Oooops]
| ^^^^^^ no item named `Oooops` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/through-proc-macro.rs:7:9
|
LL | #![warn(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
index d280e6497..e7b4c43e7 100644
--- a/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
+++ b/src/test/rustdoc-ui/intra-doc/unknown-disambiguator.stderr
@@ -4,13 +4,13 @@ error: unknown disambiguator `foo`
LL | //! Linking to [foo@banana] and [`bar@banana!()`].
| ^^^
|
+ = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
note: the lint level is defined here
--> $DIR/unknown-disambiguator.rs:2:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(warnings)]`
- = note: see https://doc.rust-lang.org/$CHANNEL/rustdoc/linking-to-items-by-name.html#namespaces-and-disambiguators for more info about disambiguators
error: unknown disambiguator `bar`
--> $DIR/unknown-disambiguator.rs:4:35
diff --git a/src/test/rustdoc-ui/intra-doc/unused-extern-crate.stderr b/src/test/rustdoc-ui/intra-doc/unused-extern-crate.stderr
index 5c0df1d1b..815324563 100644
--- a/src/test/rustdoc-ui/intra-doc/unused-extern-crate.stderr
+++ b/src/test/rustdoc-ui/intra-doc/unused-extern-crate.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `zip`
LL | /// See [zip] crate.
| ^^^ no item named `zip` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/unused-extern-crate.rs:2:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/intra-doc/warning-crlf.stderr b/src/test/rustdoc-ui/intra-doc/warning-crlf.stderr
index d46df9264..c309a55f4 100644
--- a/src/test/rustdoc-ui/intra-doc/warning-crlf.stderr
+++ b/src/test/rustdoc-ui/intra-doc/warning-crlf.stderr
@@ -4,8 +4,8 @@ warning: unresolved link to `error`
LL | /// [error]
| ^^^^^ no item named `error` in scope
|
- = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
+ = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
warning: unresolved link to `error1`
--> $DIR/warning-crlf.rs:12:11
diff --git a/src/test/rustdoc-ui/invalid-doc-attr.stderr b/src/test/rustdoc-ui/invalid-doc-attr.stderr
index a4fa38179..3c66e587b 100644
--- a/src/test/rustdoc-ui/invalid-doc-attr.stderr
+++ b/src/test/rustdoc-ui/invalid-doc-attr.stderr
@@ -4,15 +4,15 @@ error: this attribute can only be applied at the crate level
LL | #[doc(test(no_crate_inject))]
| ^^^^^^^^^^^^^^^^^^^^^
|
+ = 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: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
note: the lint level is defined here
--> $DIR/invalid-doc-attr.rs:2:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
- = 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: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
help: to apply to the crate, use an inner attribute
|
LL | #![doc(test(no_crate_inject))]
diff --git a/src/test/rustdoc-ui/invalid-html-self-closing-tag.rs b/src/test/rustdoc-ui/invalid-html-self-closing-tag.rs
new file mode 100644
index 000000000..d973a53cb
--- /dev/null
+++ b/src/test/rustdoc-ui/invalid-html-self-closing-tag.rs
@@ -0,0 +1,70 @@
+#![deny(rustdoc::invalid_html_tags)]
+
+/// <p/>
+//~^ ERROR invalid self-closing HTML tag `p`
+pub struct A;
+
+/// <p style/>
+//~^ ERROR invalid self-closing HTML tag `p`
+pub struct B;
+
+/// <p style=""/>
+//~^ ERROR invalid self-closing HTML tag `p`
+pub struct C;
+
+/// <p style="x"/>
+//~^ ERROR invalid self-closing HTML tag `p`
+pub struct D;
+
+/// <p style="x/></p>
+//~^ ERROR unclosed quoted HTML attribute
+pub struct E;
+
+/// <p style='x/></p>
+//~^ ERROR unclosed quoted HTML attribute
+pub struct F;
+
+/// <p style="x/"></p>
+pub struct G;
+
+/// <p style="x/"/>
+//~^ ERROR invalid self-closing HTML tag `p`
+pub struct H;
+
+/// <p / >
+//~^ ERROR invalid self-closing HTML tag `p`
+pub struct I;
+
+/// <br/>
+pub struct J;
+
+/// <a href=/></a>
+pub struct K;
+
+/// <a href=//></a>
+pub struct L;
+
+/// <a href="/"/>
+//~^ ERROR invalid self-closing HTML tag `a`
+pub struct M;
+
+/// <a href=x />
+//~^ ERROR invalid self-closing HTML tag `a`
+pub struct N;
+
+/// <a href= />
+//~^ ERROR invalid self-closing HTML tag `a`
+pub struct O;
+
+/// <a href=x/></a>
+pub struct P;
+
+/// <svg><rect width=1 height=1 /></svg>
+pub struct Q;
+
+/// <svg><rect width=1 height=/></svg>
+//~^ ERROR unclosed HTML tag `rect`
+pub struct R;
+
+/// <svg / q>
+pub struct S;
diff --git a/src/test/rustdoc-ui/invalid-html-self-closing-tag.stderr b/src/test/rustdoc-ui/invalid-html-self-closing-tag.stderr
new file mode 100644
index 000000000..e45edfb43
--- /dev/null
+++ b/src/test/rustdoc-ui/invalid-html-self-closing-tag.stderr
@@ -0,0 +1,80 @@
+error: invalid self-closing HTML tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:3:5
+ |
+LL | /// <p/>
+ | ^^
+ |
+note: the lint level is defined here
+ --> $DIR/invalid-html-self-closing-tag.rs:1:9
+ |
+LL | #![deny(rustdoc::invalid_html_tags)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: invalid self-closing HTML tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:7:5
+ |
+LL | /// <p style/>
+ | ^^
+
+error: invalid self-closing HTML tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:11:5
+ |
+LL | /// <p style=""/>
+ | ^^
+
+error: invalid self-closing HTML tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:15:5
+ |
+LL | /// <p style="x"/>
+ | ^^
+
+error: unclosed quoted HTML attribute on tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:19:14
+ |
+LL | /// <p style="x/></p>
+ | ^
+
+error: unclosed quoted HTML attribute on tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:23:14
+ |
+LL | /// <p style='x/></p>
+ | ^
+
+error: invalid self-closing HTML tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:30:5
+ |
+LL | /// <p style="x/"/>
+ | ^^
+
+error: invalid self-closing HTML tag `p`
+ --> $DIR/invalid-html-self-closing-tag.rs:34:5
+ |
+LL | /// <p / >
+ | ^^
+
+error: invalid self-closing HTML tag `a`
+ --> $DIR/invalid-html-self-closing-tag.rs:47:5
+ |
+LL | /// <a href="/"/>
+ | ^^
+
+error: invalid self-closing HTML tag `a`
+ --> $DIR/invalid-html-self-closing-tag.rs:51:5
+ |
+LL | /// <a href=x />
+ | ^^
+
+error: invalid self-closing HTML tag `a`
+ --> $DIR/invalid-html-self-closing-tag.rs:55:5
+ |
+LL | /// <a href= />
+ | ^^
+
+error: unclosed HTML tag `rect`
+ --> $DIR/invalid-html-self-closing-tag.rs:65:10
+ |
+LL | /// <svg><rect width=1 height=/></svg>
+ | ^^^^^
+
+error: aborting due to 12 previous errors
+
diff --git a/src/test/rustdoc-ui/invalid-html-tags.rs b/src/test/rustdoc-ui/invalid-html-tags.rs
index 0f9d2e4b3..317f1fd1d 100644
--- a/src/test/rustdoc-ui/invalid-html-tags.rs
+++ b/src/test/rustdoc-ui/invalid-html-tags.rs
@@ -114,3 +114,10 @@ pub fn k() {}
/// Web Components style </unopened-tag>
//~^ ERROR unopened HTML tag `unopened-tag`
pub fn m() {}
+
+/// backslashed \<a href="">
+pub fn no_error_1() {}
+
+/// backslashed \<<a href="">
+//~^ ERROR unclosed HTML tag `a`
+pub fn p() {}
diff --git a/src/test/rustdoc-ui/invalid-html-tags.stderr b/src/test/rustdoc-ui/invalid-html-tags.stderr
index 24a455576..9c2bfcf2c 100644
--- a/src/test/rustdoc-ui/invalid-html-tags.stderr
+++ b/src/test/rustdoc-ui/invalid-html-tags.stderr
@@ -94,5 +94,11 @@ error: unclosed HTML tag `dashed-tags`
LL | /// Web Components style <dashed-tags>
| ^^^^^^^^^^^^^
-error: aborting due to 15 previous errors
+error: unclosed HTML tag `a`
+ --> $DIR/invalid-html-tags.rs:121:19
+ |
+LL | /// backslashed \<<a href="">
+ | ^^
+
+error: aborting due to 16 previous errors
diff --git a/src/test/rustdoc-ui/invalid-syntax.rs b/src/test/rustdoc-ui/invalid-syntax.rs
index b503d1093..acb2a6f08 100644
--- a/src/test/rustdoc-ui/invalid-syntax.rs
+++ b/src/test/rustdoc-ui/invalid-syntax.rs
@@ -99,3 +99,9 @@ pub fn indent_after_fenced() {}
/// ```
pub fn invalid() {}
//~^^^^ WARNING could not parse code block as Rust code
+
+/// ```
+/// fn wook_at_my_beautifuw_bwaces_plz() {);
+/// ```
+pub fn uwu() {}
+//~^^^^ WARNING could not parse code block as Rust code
diff --git a/src/test/rustdoc-ui/invalid-syntax.stderr b/src/test/rustdoc-ui/invalid-syntax.stderr
index 4c6249cc6..597d19e74 100644
--- a/src/test/rustdoc-ui/invalid-syntax.stderr
+++ b/src/test/rustdoc-ui/invalid-syntax.stderr
@@ -7,10 +7,10 @@ LL | | /// \__________pkt->size___________/ \_result->size_/ \__pkt->si
LL | | /// ```
| |_______^
|
- = note: `#[warn(rustdoc::invalid_rust_codeblocks)]` on by default
= note: error from rustc: unknown start of token: \
= note: error from rustc: unknown start of token: \
= note: error from rustc: unknown start of token: \
+ = note: `#[warn(rustdoc::invalid_rust_codeblocks)]` on by default
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
@@ -150,5 +150,20 @@ help: mark blocks that do not contain Rust code as text
LL | /// ```text
| ++++
-warning: 12 warnings emitted
+warning: could not parse code block as Rust code
+ --> $DIR/invalid-syntax.rs:103:5
+ |
+LL | /// ```
+ | _____^
+LL | | /// fn wook_at_my_beautifuw_bwaces_plz() {);
+LL | | /// ```
+ | |_______^
+ |
+ = note: error from rustc: mismatched closing delimiter: `)`
+help: mark blocks that do not contain Rust code as text
+ |
+LL | /// ```text
+ | ++++
+
+warning: 13 warnings emitted
diff --git a/src/test/rustdoc-ui/issue-101076.rs b/src/test/rustdoc-ui/issue-101076.rs
new file mode 100644
index 000000000..648f99029
--- /dev/null
+++ b/src/test/rustdoc-ui/issue-101076.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+const _: () = {
+ #[macro_export]
+ macro_rules! first_macro {
+ () => {}
+ }
+ mod foo {
+ #[macro_export]
+ macro_rules! second_macro {
+ () => {}
+ }
+ }
+};
diff --git a/src/test/rustdoc-ui/issue-102986.rs b/src/test/rustdoc-ui/issue-102986.rs
new file mode 100644
index 000000000..001784ac2
--- /dev/null
+++ b/src/test/rustdoc-ui/issue-102986.rs
@@ -0,0 +1,4 @@
+struct Struct {
+ y: (typeof("hey"),),
+ //~^ `typeof` is a reserved keyword but unimplemented
+}
diff --git a/src/test/rustdoc-ui/issue-102986.stderr b/src/test/rustdoc-ui/issue-102986.stderr
new file mode 100644
index 000000000..3a573726c
--- /dev/null
+++ b/src/test/rustdoc-ui/issue-102986.stderr
@@ -0,0 +1,14 @@
+error[E0516]: `typeof` is a reserved keyword but unimplemented
+ --> $DIR/issue-102986.rs:2:9
+ |
+LL | y: (typeof("hey"),),
+ | ^^^^^^^^^^^^^ reserved keyword
+ |
+help: consider replacing `typeof(...)` with an actual type
+ |
+LL | y: (&'static str,),
+ | ~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0516`.
diff --git a/src/test/rustdoc-ui/issue-74134.private.stderr b/src/test/rustdoc-ui/issue-74134.private.stderr
index 31d2dbe96..44c88b618 100644
--- a/src/test/rustdoc-ui/issue-74134.private.stderr
+++ b/src/test/rustdoc-ui/issue-74134.private.stderr
@@ -4,8 +4,8 @@ warning: public documentation for `public_item` links to private item `PrivateTy
LL | /// [`PrivateType`]
| ^^^^^^^^^^^ this item is private
|
- = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
= note: this link resolves only because you passed `--document-private-items`, but will break without
+ = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/issue-74134.public.stderr b/src/test/rustdoc-ui/issue-74134.public.stderr
index 6a3173e3e..5b1887b83 100644
--- a/src/test/rustdoc-ui/issue-74134.public.stderr
+++ b/src/test/rustdoc-ui/issue-74134.public.stderr
@@ -4,8 +4,8 @@ warning: public documentation for `public_item` links to private item `PrivateTy
LL | /// [`PrivateType`]
| ^^^^^^^^^^^ this item is private
|
- = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
= note: this link will resolve properly if you pass `--document-private-items`
+ = note: `#[warn(rustdoc::private_intra_doc_links)]` on by default
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/lint-group.rs b/src/test/rustdoc-ui/lint-group.rs
index 61555a6e6..09aca6d2b 100644
--- a/src/test/rustdoc-ui/lint-group.rs
+++ b/src/test/rustdoc-ui/lint-group.rs
@@ -1,3 +1,5 @@
+#![feature(rustdoc_missing_doc_code_examples)]
+
//! Documenting the kinds of lints emitted by rustdoc.
//!
//! ```
diff --git a/src/test/rustdoc-ui/lint-group.stderr b/src/test/rustdoc-ui/lint-group.stderr
index e28600160..4f2c96588 100644
--- a/src/test/rustdoc-ui/lint-group.stderr
+++ b/src/test/rustdoc-ui/lint-group.stderr
@@ -1,18 +1,18 @@
error: missing code example in this documentation
- --> $DIR/lint-group.rs:16:1
+ --> $DIR/lint-group.rs:18:1
|
LL | /// wait, this doesn't have a doctest?
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/lint-group.rs:7:9
+ --> $DIR/lint-group.rs:9:9
|
LL | #![deny(rustdoc::all)]
| ^^^^^^^^^^^^
= note: `#[deny(rustdoc::missing_doc_code_examples)]` implied by `#[deny(rustdoc::all)]`
error: documentation test in private item
- --> $DIR/lint-group.rs:19:1
+ --> $DIR/lint-group.rs:21:1
|
LL | / /// wait, this *does* have a doctest?
LL | | ///
@@ -24,22 +24,22 @@ LL | | /// ```
= note: `#[deny(rustdoc::private_doc_tests)]` implied by `#[deny(rustdoc::all)]`
error: missing code example in this documentation
- --> $DIR/lint-group.rs:26:1
+ --> $DIR/lint-group.rs:28:1
|
LL | /// <unknown>
| ^^^^^^^^^^^^^
error: unresolved link to `error`
- --> $DIR/lint-group.rs:9:29
+ --> $DIR/lint-group.rs:11:29
|
LL | /// what up, let's make an [error]
| ^^^^^ no item named `error` in scope
|
- = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(rustdoc::all)]`
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
+ = note: `#[deny(rustdoc::broken_intra_doc_links)]` implied by `#[deny(rustdoc::all)]`
error: unclosed HTML tag `unknown`
- --> $DIR/lint-group.rs:26:5
+ --> $DIR/lint-group.rs:28:5
|
LL | /// <unknown>
| ^^^^^^^^^
diff --git a/src/test/rustdoc-ui/lint-missing-doc-code-example.rs b/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
index fac6342cd..40f35728d 100644
--- a/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
+++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.rs
@@ -1,3 +1,4 @@
+#![feature(rustdoc_missing_doc_code_examples)]
#![deny(missing_docs)]
#![deny(rustdoc::missing_doc_code_examples)]
diff --git a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr
index 9e51ecd2b..f93312501 100644
--- a/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr
+++ b/src/test/rustdoc-ui/lint-missing-doc-code-example.stderr
@@ -1,35 +1,35 @@
error: missing code example in this documentation
- --> $DIR/lint-missing-doc-code-example.rs:19:1
+ --> $DIR/lint-missing-doc-code-example.rs:20:1
|
LL | pub mod module1 {
| ^^^^^^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/lint-missing-doc-code-example.rs:2:9
+ --> $DIR/lint-missing-doc-code-example.rs:3:9
|
LL | #![deny(rustdoc::missing_doc_code_examples)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing code example in this documentation
- --> $DIR/lint-missing-doc-code-example.rs:37:3
+ --> $DIR/lint-missing-doc-code-example.rs:38:3
|
LL | /// doc
| ^^^^^^^
error: missing code example in this documentation
- --> $DIR/lint-missing-doc-code-example.rs:49:1
+ --> $DIR/lint-missing-doc-code-example.rs:50:1
|
LL | /// Doc
| ^^^^^^^
error: missing code example in this documentation
- --> $DIR/lint-missing-doc-code-example.rs:56:1
+ --> $DIR/lint-missing-doc-code-example.rs:57:1
|
LL | /// Doc
| ^^^^^^^
error: missing code example in this documentation
- --> $DIR/lint-missing-doc-code-example.rs:63:1
+ --> $DIR/lint-missing-doc-code-example.rs:64:1
|
LL | /// Doc
| ^^^^^^^
diff --git a/src/test/rustdoc-ui/macro-docs.stderr b/src/test/rustdoc-ui/macro-docs.stderr
index e3cc17311..2b136f5be 100644
--- a/src/test/rustdoc-ui/macro-docs.stderr
+++ b/src/test/rustdoc-ui/macro-docs.stderr
@@ -7,13 +7,13 @@ LL | /// A
LL | m!();
| ---- in this macro invocation
|
- = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
= note: the link appears in this line:
[`long_cat`] is really long
^^^^^^^^^^
= note: no item named `long_cat` in scope
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
+ = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default
= note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 1 warning emitted
diff --git a/src/test/rustdoc-ui/no-crate-level-doc-lint.stderr b/src/test/rustdoc-ui/no-crate-level-doc-lint.stderr
index 1a1f8085a..fb3a5e415 100644
--- a/src/test/rustdoc-ui/no-crate-level-doc-lint.stderr
+++ b/src/test/rustdoc-ui/no-crate-level-doc-lint.stderr
@@ -1,12 +1,12 @@
error: no documentation found for this crate's top-level module
|
+ = help: The following guide may be of use:
+ https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
note: the lint level is defined here
--> $DIR/no-crate-level-doc-lint.rs:3:9
|
LL | #![deny(rustdoc::missing_crate_level_docs)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: The following guide may be of use:
- https://doc.rust-lang.org/$CHANNEL/rustdoc/how-to-write-documentation.html
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/normalize-cycle.rs b/src/test/rustdoc-ui/normalize-cycle.rs
index f48cad373..1ed9ac6bc 100644
--- a/src/test/rustdoc-ui/normalize-cycle.rs
+++ b/src/test/rustdoc-ui/normalize-cycle.rs
@@ -1,5 +1,6 @@
// check-pass
-// Regresion test for <https://github.com/rust-lang/rust/issues/79459>.
+// compile-flags: -Znormalize-docs
+// Regression test for <https://github.com/rust-lang/rust/issues/79459>.
pub trait Query {}
pub trait AsQuery {
diff --git a/src/test/rustdoc-ui/normalize-overflow.rs b/src/test/rustdoc-ui/normalize-overflow.rs
index 0cdcc88e3..3698fe70e 100644
--- a/src/test/rustdoc-ui/normalize-overflow.rs
+++ b/src/test/rustdoc-ui/normalize-overflow.rs
@@ -1,3 +1,5 @@
// aux-crate:overflow=overflow.rs
// check-pass
// Regression test for <https://github.com/rust-lang/rust/issues/79506>.
+
+extern crate overflow;
diff --git a/src/test/rustdoc-ui/pub-export-lint.stderr b/src/test/rustdoc-ui/pub-export-lint.stderr
index c6be9c6a9..81ef79961 100644
--- a/src/test/rustdoc-ui/pub-export-lint.stderr
+++ b/src/test/rustdoc-ui/pub-export-lint.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `aloha`
LL | /// [aloha]
| ^^^^^ no item named `aloha` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/pub-export-lint.rs:1:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/reference-link-reports-error-once.stderr b/src/test/rustdoc-ui/reference-link-reports-error-once.stderr
index b46a51e93..2ab67090f 100644
--- a/src/test/rustdoc-ui/reference-link-reports-error-once.stderr
+++ b/src/test/rustdoc-ui/reference-link-reports-error-once.stderr
@@ -4,12 +4,12 @@ error: unresolved link to `ref`
LL | /// [a]: ref
| ^^^ no item named `ref` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/reference-link-reports-error-once.rs:1:9
|
LL | #![deny(rustdoc::broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: unresolved link to `ref2`
--> $DIR/reference-link-reports-error-once.rs:15:10
diff --git a/src/test/rustdoc-ui/renamed-lint-still-applies.stderr b/src/test/rustdoc-ui/renamed-lint-still-applies.stderr
index 8e2a2cdd7..ee9b67cb9 100644
--- a/src/test/rustdoc-ui/renamed-lint-still-applies.stderr
+++ b/src/test/rustdoc-ui/renamed-lint-still-applies.stderr
@@ -18,12 +18,12 @@ error: unresolved link to `x`
LL | //! [x]
| ^ no item named `x` in scope
|
+ = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
note: the lint level is defined here
--> $DIR/renamed-lint-still-applies.rs:2:9
|
LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
error: this URL is not a hyperlink
--> $DIR/renamed-lint-still-applies.rs:9:5
@@ -31,12 +31,12 @@ error: this URL is not a hyperlink
LL | //! http://example.com
| ^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<http://example.com>`
|
+ = note: bare URLs are not automatically turned into clickable links
note: the lint level is defined here
--> $DIR/renamed-lint-still-applies.rs:7:9
|
LL | #![deny(rustdoc::non_autolinks)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = note: bare URLs are not automatically turned into clickable links
error: aborting due to 2 previous errors; 2 warnings emitted
diff --git a/src/test/rustdoc-ui/rustc-check-passes.rs b/src/test/rustdoc-ui/rustc-check-passes.rs
index 731cc8ba6..56d59164d 100644
--- a/src/test/rustdoc-ui/rustc-check-passes.rs
+++ b/src/test/rustdoc-ui/rustc-check-passes.rs
@@ -1,4 +1,4 @@
-#![feature(box_syntax)]
-#![feature(box_syntax)] //~ ERROR
+#![feature(rustdoc_internals)]
+#![feature(rustdoc_internals)] //~ ERROR
pub fn foo() {}
diff --git a/src/test/rustdoc-ui/rustc-check-passes.stderr b/src/test/rustdoc-ui/rustc-check-passes.stderr
index 9707895ff..83f4e87c6 100644
--- a/src/test/rustdoc-ui/rustc-check-passes.stderr
+++ b/src/test/rustdoc-ui/rustc-check-passes.stderr
@@ -1,8 +1,8 @@
-error[E0636]: the feature `box_syntax` has already been declared
+error[E0636]: the feature `rustdoc_internals` has already been declared
--> $DIR/rustc-check-passes.rs:2:12
|
-LL | #![feature(box_syntax)]
- | ^^^^^^^^^^
+LL | #![feature(rustdoc_internals)]
+ | ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.rs b/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.rs
index 744b3071f..476e3b2d4 100644
--- a/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.rs
+++ b/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.rs
@@ -8,6 +8,48 @@ pub struct ConstGeneric;
// HTML tags cannot contain commas, so no error.
pub struct MultipleGenerics;
+/// This <[u32] as Iterator<Item>> thing!
+//~^ERROR unclosed HTML tag `Item`
+// Some forms of fully-qualified path are simultaneously valid HTML tags
+// with attributes. They produce an error, but no suggestion, because figuring
+// out if this is valid would require parsing the entire path grammar.
+//
+// The important part is that we don't produce any *wrong* suggestions.
+// While several other examples below are added to make sure we don't
+// produce suggestions when given complex paths, this example is the actual
+// reason behind not just using the real path parser. It's ambiguous: there's
+// no way to locally reason out whether that `[u32]` is intended to be a slice
+// or an intra-doc link.
+pub struct FullyQualifiedPathsDoNotCount;
+
+/// This <Vec as IntoIter>::Iter thing!
+//~^ERROR unclosed HTML tag `Vec`
+// Some forms of fully-qualified path are simultaneously valid HTML tags
+// with attributes. They produce an error, but no suggestion, because figuring
+// out if this is valid would require parsing the entire path grammar.
+pub struct FullyQualifiedPathsDoNotCount1;
+
+/// This Vec<Vec as IntoIter>::Iter thing!
+//~^ERROR unclosed HTML tag `Vec`
+// Some forms of fully-qualified path are simultaneously valid HTML tags
+// with attributes. They produce an error, but no suggestion, because figuring
+// out if this is valid would require parsing the entire path grammar.
+pub struct FullyQualifiedPathsDoNotCount2;
+
+/// This Vec<Vec as IntoIter> thing!
+//~^ERROR unclosed HTML tag `Vec`
+// Some forms of fully-qualified path are simultaneously valid HTML tags
+// with attributes. They produce an error, but no suggestion, because figuring
+// out if this is valid would require parsing the entire path grammar.
+pub struct FullyQualifiedPathsDoNotCount3;
+
+/// This Vec<Vec<i32> as IntoIter> thing!
+//~^ERROR unclosed HTML tag `i32`
+// Some forms of fully-qualified path are simultaneously valid HTML tags
+// with attributes. They produce an error, but no suggestion, because figuring
+// out if this is valid would require parsing the entire path grammar.
+pub struct FullyQualifiedPathsDoNotCount4;
+
/// This Vec<i32 class="test"> thing!
//~^ERROR unclosed HTML tag `i32`
// HTML attributes shouldn't be treated as Rust syntax, so no suggestions.
diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.stderr b/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.stderr
index 832b8b2ca..3856a2513 100644
--- a/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.stderr
+++ b/src/test/rustdoc-ui/suggestions/html-as-generics-no-suggestions.stderr
@@ -1,8 +1,8 @@
-error: unclosed HTML tag `i32`
- --> $DIR/html-as-generics-no-suggestions.rs:11:13
+error: unclosed HTML tag `Item`
+ --> $DIR/html-as-generics-no-suggestions.rs:11:28
|
-LL | /// This Vec<i32 class="test"> thing!
- | ^^^^
+LL | /// This <[u32] as Iterator<Item>> thing!
+ | ^^^^^^
|
note: the lint level is defined here
--> $DIR/html-as-generics-no-suggestions.rs:1:9
@@ -10,29 +10,59 @@ note: the lint level is defined here
LL | #![deny(rustdoc::invalid_html_tags)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: unclosed HTML tag `Vec`
+ --> $DIR/html-as-generics-no-suggestions.rs:25:10
+ |
+LL | /// This <Vec as IntoIter>::Iter thing!
+ | ^^^^
+
+error: unclosed HTML tag `Vec`
+ --> $DIR/html-as-generics-no-suggestions.rs:32:13
+ |
+LL | /// This Vec<Vec as IntoIter>::Iter thing!
+ | ^^^^
+
+error: unclosed HTML tag `Vec`
+ --> $DIR/html-as-generics-no-suggestions.rs:39:13
+ |
+LL | /// This Vec<Vec as IntoIter> thing!
+ | ^^^^
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics-no-suggestions.rs:46:17
+ |
+LL | /// This Vec<Vec<i32> as IntoIter> thing!
+ | ^^^^^
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics-no-suggestions.rs:53:13
+ |
+LL | /// This Vec<i32 class="test"> thing!
+ | ^^^^
+
error: unopened HTML tag `i32`
- --> $DIR/html-as-generics-no-suggestions.rs:20:13
+ --> $DIR/html-as-generics-no-suggestions.rs:62:13
|
LL | /// This Vec</i32> thing!
| ^^^^^^
error: unclosed HTML tag `i32`
- --> $DIR/html-as-generics-no-suggestions.rs:25:13
+ --> $DIR/html-as-generics-no-suggestions.rs:67:13
|
LL | /// This 123<i32> thing!
| ^^^^^
error: unclosed HTML tag `i32`
- --> $DIR/html-as-generics-no-suggestions.rs:30:14
+ --> $DIR/html-as-generics-no-suggestions.rs:72:14
|
LL | /// This Vec:<i32> thing!
| ^^^^^
error: unclosed HTML tag `i32`
- --> $DIR/html-as-generics-no-suggestions.rs:35:39
+ --> $DIR/html-as-generics-no-suggestions.rs:77:39
|
LL | /// This [link](https://rust-lang.org)<i32> thing!
| ^^^^^
-error: aborting due to 5 previous errors
+error: aborting due to 10 previous errors
diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics.fixed b/src/test/rustdoc-ui/suggestions/html-as-generics.fixed
index c0a0de24c..003542d38 100644
--- a/src/test/rustdoc-ui/suggestions/html-as-generics.fixed
+++ b/src/test/rustdoc-ui/suggestions/html-as-generics.fixed
@@ -30,3 +30,53 @@ pub struct BareTurbofish;
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
pub struct Nested;
+
+/// Nested generics `Vec<Vec<u32>>`
+//~^ ERROR unclosed HTML tag `u32`
+//~|HELP try marking as source
+pub struct NestedGenerics;
+
+/// Generics with path `Vec<i32>::Iter`
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct GenericsWithPath;
+
+/// Generics with path `<Vec<i32>>::Iter`
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPath;
+
+/// Generics with path `Vec<Vec<i32>>::Iter`
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPath2;
+
+/// Generics with bump `<Vec<i32>>`s
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithBump;
+
+/// Generics with bump `Vec<Vec<i32>>`s
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithBump2;
+
+/// Generics with punct `<Vec<i32>>`!
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPunct;
+
+/// Generics with punct `Vec<Vec<i32>>`!
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPunct2;
+
+/// This [`Vec<i32>`] thing!
+//~^ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct IntraDocLink;
+
+/// This [`Vec::<i32>`] thing!
+//~^ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct IntraDocLinkTurbofish;
diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics.rs b/src/test/rustdoc-ui/suggestions/html-as-generics.rs
index 0b6009b0e..4254a660b 100644
--- a/src/test/rustdoc-ui/suggestions/html-as-generics.rs
+++ b/src/test/rustdoc-ui/suggestions/html-as-generics.rs
@@ -30,3 +30,53 @@ pub struct BareTurbofish;
//~^ERROR unclosed HTML tag `i32`
//~|HELP try marking as source
pub struct Nested;
+
+/// Nested generics Vec<Vec<u32>>
+//~^ ERROR unclosed HTML tag `u32`
+//~|HELP try marking as source
+pub struct NestedGenerics;
+
+/// Generics with path Vec<i32>::Iter
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct GenericsWithPath;
+
+/// Generics with path <Vec<i32>>::Iter
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPath;
+
+/// Generics with path Vec<Vec<i32>>::Iter
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPath2;
+
+/// Generics with bump <Vec<i32>>s
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithBump;
+
+/// Generics with bump Vec<Vec<i32>>s
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithBump2;
+
+/// Generics with punct <Vec<i32>>!
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPunct;
+
+/// Generics with punct Vec<Vec<i32>>!
+//~^ ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct NestedGenericsWithPunct2;
+
+/// This [Vec<i32>] thing!
+//~^ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct IntraDocLink;
+
+/// This [Vec::<i32>] thing!
+//~^ERROR unclosed HTML tag `i32`
+//~|HELP try marking as source
+pub struct IntraDocLinkTurbofish;
diff --git a/src/test/rustdoc-ui/suggestions/html-as-generics.stderr b/src/test/rustdoc-ui/suggestions/html-as-generics.stderr
index df54b7126..481278bda 100644
--- a/src/test/rustdoc-ui/suggestions/html-as-generics.stderr
+++ b/src/test/rustdoc-ui/suggestions/html-as-generics.stderr
@@ -69,5 +69,115 @@ help: try marking as source code
LL | /// This <span>`Vec::<i32>`</span> thing!
| + +
-error: aborting due to 6 previous errors
+error: unclosed HTML tag `u32`
+ --> $DIR/html-as-generics.rs:34:28
+ |
+LL | /// Nested generics Vec<Vec<u32>>
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Nested generics `Vec<Vec<u32>>`
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:39:27
+ |
+LL | /// Generics with path Vec<i32>::Iter
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Generics with path `Vec<i32>::Iter`
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:44:28
+ |
+LL | /// Generics with path <Vec<i32>>::Iter
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Generics with path `<Vec<i32>>::Iter`
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:49:31
+ |
+LL | /// Generics with path Vec<Vec<i32>>::Iter
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Generics with path `Vec<Vec<i32>>::Iter`
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:54:28
+ |
+LL | /// Generics with bump <Vec<i32>>s
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Generics with bump `<Vec<i32>>`s
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:59:31
+ |
+LL | /// Generics with bump Vec<Vec<i32>>s
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Generics with bump `Vec<Vec<i32>>`s
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:64:29
+ |
+LL | /// Generics with punct <Vec<i32>>!
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Generics with punct `<Vec<i32>>`!
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:69:32
+ |
+LL | /// Generics with punct Vec<Vec<i32>>!
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// Generics with punct `Vec<Vec<i32>>`!
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:74:14
+ |
+LL | /// This [Vec<i32>] thing!
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// This [`Vec<i32>`] thing!
+ | + +
+
+error: unclosed HTML tag `i32`
+ --> $DIR/html-as-generics.rs:79:16
+ |
+LL | /// This [Vec::<i32>] thing!
+ | ^^^^^
+ |
+help: try marking as source code
+ |
+LL | /// This [`Vec::<i32>`] thing!
+ | + +
+
+error: aborting due to 16 previous errors
diff --git a/src/test/rustdoc-ui/z-help.stdout b/src/test/rustdoc-ui/z-help.stdout
index 6dc412315..46f11d2e5 100644
--- a/src/test/rustdoc-ui/z-help.stdout
+++ b/src/test/rustdoc-ui/z-help.stdout
@@ -1,8 +1,8 @@
-Z allow-features=val -- only allow the listed language features to be enabled in code (space separated)
-Z always-encode-mir=val -- encode MIR of all functions into the crate metadata (default: no)
- -Z assume-incomplete-release=val -- make cfg(version) treat the current version as incomplete (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
@@ -17,6 +17,7 @@
-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)
@@ -35,9 +36,11 @@
-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 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
@@ -53,10 +56,11 @@
-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-threshold=val -- a default MIR inlining threshold (default: 50)
-Z inline-mir-hint-threshold=val -- inlining threshold for functions with inline hint (default: 100)
- -Z inline-in-all-cgus=val -- control whether `#[inline]` functions are in all CGUs
+ -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)
@@ -65,6 +69,7 @@
`=off` (default)
-Z instrument-mcount=val -- insert function instrument code for mcount-based tracing (default: no)
-Z keep-hygiene-data=val -- keep hygiene data after analysis (default: no)
+ -Z layout-seed=val -- seed layout randomization
-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)
@@ -76,11 +81,10 @@
-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-pretty-relative-line-numbers=val -- use line numbers relative to the function in mir pretty printing
-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 new-llvm-pass-manager=val -- use new LLVM pass manager (default: no)
-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
@@ -90,12 +94,12 @@
-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-unique-section-names=val -- do not use unique names for text and data sections when -Z function-sections is used
-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 diagnostic-width=val -- set the current output width for diagnostic truncation
+ -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)
@@ -118,15 +122,13 @@
-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 profiler-runtime=val -- name of the profiler runtime crate to automatically inject (default: `profiler_builtins`)
-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 layout-seed=val -- seed layout randomization
-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 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 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
@@ -134,22 +136,20 @@
-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 save-analysis=val -- write syntax and type analysis (in JSON format) information, in addition to normal output (default: no)
-Z self-profile=val -- run the self profiler and output the raw event data
- -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 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 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 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`)
@@ -157,26 +157,28 @@
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 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 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 translate-lang=val -- language identifier for diagnostic output
- -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 tune-cpu=val -- select processor to schedule for (`rustc --print target-cpus` for details)
-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=val -- measure time of rustc processes (default: no)
-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 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 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)
diff --git a/src/test/rustdoc/all.rs b/src/test/rustdoc/all.rs
index a95d6c462..4c8d02310 100644
--- a/src/test/rustdoc/all.rs
+++ b/src/test/rustdoc/all.rs
@@ -24,5 +24,5 @@ mod private_module {
}
// @has foo/all.html '//a[@href="struct.ReexportedStruct.html"]' 'ReexportedStruct'
-// @!has foo/all.html 'private_module'
+// @!hasraw foo/all.html 'private_module'
pub use private_module::ReexportedStruct;
diff --git a/src/test/rustdoc/anchors.no_const_anchor.html b/src/test/rustdoc/anchors.no_const_anchor.html
index 98f47e530..75e67330a 100644
--- a/src/test/rustdoc/anchors.no_const_anchor.html
+++ b/src/test/rustdoc/anchors.no_const_anchor.html
@@ -1 +1 @@
-<div id="associatedconstant.YOLO" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/foo/anchors.rs.html#16">source</a></div><h4 class="code-header">const <a href="#associatedconstant.YOLO" class="constant">YOLO</a>: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></div>
+<section id="associatedconstant.YOLO" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#16">source</a><h4 class="code-header">const <a href="#associatedconstant.YOLO" class="constant">YOLO</a>: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a></h4></section> \ No newline at end of file
diff --git a/src/test/rustdoc/anchors.no_const_anchor2.html b/src/test/rustdoc/anchors.no_const_anchor2.html
index 6d37e8e5e..c00251976 100644
--- a/src/test/rustdoc/anchors.no_const_anchor2.html
+++ b/src/test/rustdoc/anchors.no_const_anchor2.html
@@ -1 +1 @@
-<section id="associatedconstant.X" class="associatedconstant has-srclink"><span class="rightside"><a class="srclink" href="../src/foo/anchors.rs.html#42">source</a></span><h4 class="code-header">pub const <a href="#associatedconstant.X" class="constant">X</a>: <a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a> = 0i32</h4></section>
+<section id="associatedconstant.X" class="associatedconstant has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#42">source</a><h4 class="code-header">pub const <a href="#associatedconstant.X" class="constant">X</a>: <a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a> = 0i32</h4></section> \ No newline at end of file
diff --git a/src/test/rustdoc/anchors.no_method_anchor.html b/src/test/rustdoc/anchors.no_method_anchor.html
index f46d3090e..521fdcb78 100644
--- a/src/test/rustdoc/anchors.no_method_anchor.html
+++ b/src/test/rustdoc/anchors.no_method_anchor.html
@@ -1 +1 @@
-<section id="method.new" class="method has-srclink"><span class="rightside"><a class="srclink" href="../src/foo/anchors.rs.html#48">source</a></span><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>() -&gt; Self</h4></section> \ No newline at end of file
+<section id="method.new" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#48">source</a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>() -&gt; Self</h4></section> \ No newline at end of file
diff --git a/src/test/rustdoc/anchors.no_trait_method_anchor.html b/src/test/rustdoc/anchors.no_trait_method_anchor.html
index 445a7bb56..d7bd525ff 100644
--- a/src/test/rustdoc/anchors.no_trait_method_anchor.html
+++ b/src/test/rustdoc/anchors.no_trait_method_anchor.html
@@ -1 +1 @@
-<div id="method.bar" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/foo/anchors.rs.html#23">source</a></div><h4 class="code-header">fn <a href="#method.bar" class="fnname">bar</a>()</h4></div> \ No newline at end of file
+<section id="method.bar" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#23">source</a><h4 class="code-header">fn <a href="#method.bar" class="fnname">bar</a>()</h4></section> \ No newline at end of file
diff --git a/src/test/rustdoc/anchors.no_tymethod_anchor.html b/src/test/rustdoc/anchors.no_tymethod_anchor.html
index bb0771b10..e668e5e4d 100644
--- a/src/test/rustdoc/anchors.no_tymethod_anchor.html
+++ b/src/test/rustdoc/anchors.no_tymethod_anchor.html
@@ -1 +1 @@
-<div id="tymethod.foo" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/foo/anchors.rs.html#20">source</a></div><h4 class="code-header">fn <a href="#tymethod.foo" class="fnname">foo</a>()</h4></div> \ No newline at end of file
+<section id="tymethod.foo" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#20">source</a><h4 class="code-header">fn <a href="#tymethod.foo" class="fnname">foo</a>()</h4></section> \ No newline at end of file
diff --git a/src/test/rustdoc/anchors.no_type_anchor.html b/src/test/rustdoc/anchors.no_type_anchor.html
index d317eb500..2c66d5aa3 100644
--- a/src/test/rustdoc/anchors.no_type_anchor.html
+++ b/src/test/rustdoc/anchors.no_type_anchor.html
@@ -1 +1 @@
-<div id="associatedtype.T" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/foo/anchors.rs.html#13">source</a></div><h4 class="code-header">type <a href="#associatedtype.T" class="associatedtype">T</a></h4></div> \ No newline at end of file
+<section id="associatedtype.T" class="method has-srclink"><a class="srclink rightside" href="../src/foo/anchors.rs.html#13">source</a><h4 class="code-header">type <a href="#associatedtype.T" class="associatedtype">T</a></h4></section> \ No newline at end of file
diff --git a/src/test/rustdoc/anonymous-lifetime.rs b/src/test/rustdoc/anonymous-lifetime.rs
index f5a7d2258..390ed5a1f 100644
--- a/src/test/rustdoc/anonymous-lifetime.rs
+++ b/src/test/rustdoc/anonymous-lifetime.rs
@@ -12,7 +12,7 @@ pub trait Stream {
}
// @has 'foo/trait.Stream.html'
-// @has - '//*[@class="code-header in-band"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
+// @has - '//*[@class="code-header"]' 'impl<S: ?Sized + Stream + Unpin> Stream for &mut S'
impl<S: ?Sized + Stream + Unpin> Stream for &mut S {
type Item = S::Item;
diff --git a/src/test/rustdoc/array-links.link_box_generic.html b/src/test/rustdoc/array-links.link_box_generic.html
new file mode 100644
index 000000000..3481bb6a0
--- /dev/null
+++ b/src/test/rustdoc/array-links.link_box_generic.html
@@ -0,0 +1 @@
+<code>pub fn delta&lt;T&gt;() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;<a class="primitive" href="{{channel}}/core/primitive.array.html">[T; 1]</a>&gt;</code> \ No newline at end of file
diff --git a/src/test/rustdoc/array-links.link_box_u32.html b/src/test/rustdoc/array-links.link_box_u32.html
new file mode 100644
index 000000000..e864ae55c
--- /dev/null
+++ b/src/test/rustdoc/array-links.link_box_u32.html
@@ -0,0 +1 @@
+<code>pub fn gamma() -&gt; <a class="struct" href="struct.MyBox.html" title="struct foo::MyBox">MyBox</a>&lt;[<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]&gt;</code> \ No newline at end of file
diff --git a/src/test/rustdoc/array-links.link_slice_generic.html b/src/test/rustdoc/array-links.link_slice_generic.html
new file mode 100644
index 000000000..f1ca2f59b
--- /dev/null
+++ b/src/test/rustdoc/array-links.link_slice_generic.html
@@ -0,0 +1 @@
+<code>pub fn beta&lt;T&gt;() -&gt; &amp;'static <a class="primitive" href="{{channel}}/core/primitive.array.html">[T; 1]</a></code> \ No newline at end of file
diff --git a/src/test/rustdoc/array-links.link_slice_u32.html b/src/test/rustdoc/array-links.link_slice_u32.html
new file mode 100644
index 000000000..c3943e8d3
--- /dev/null
+++ b/src/test/rustdoc/array-links.link_slice_u32.html
@@ -0,0 +1 @@
+<code>pub fn alpha() -&gt; &amp;'static [<a class="primitive" href="{{channel}}/core/primitive.u32.html">u32</a>; <a class="primitive" href="{{channel}}/core/primitive.array.html">1</a>]</code> \ No newline at end of file
diff --git a/src/test/rustdoc/array-links.rs b/src/test/rustdoc/array-links.rs
new file mode 100644
index 000000000..07f92ac51
--- /dev/null
+++ b/src/test/rustdoc/array-links.rs
@@ -0,0 +1,28 @@
+#![crate_name = "foo"]
+#![no_std]
+
+pub struct MyBox<T: ?Sized>(*const T);
+
+// @has 'foo/fn.alpha.html'
+// @snapshot link_slice_u32 - '//pre[@class="rust fn"]/code'
+pub fn alpha() -> &'static [u32; 1] {
+ loop {}
+}
+
+// @has 'foo/fn.beta.html'
+// @snapshot link_slice_generic - '//pre[@class="rust fn"]/code'
+pub fn beta<T>() -> &'static [T; 1] {
+ loop {}
+}
+
+// @has 'foo/fn.gamma.html'
+// @snapshot link_box_u32 - '//pre[@class="rust fn"]/code'
+pub fn gamma() -> MyBox<[u32; 1]> {
+ loop {}
+}
+
+// @has 'foo/fn.delta.html'
+// @snapshot link_box_generic - '//pre[@class="rust fn"]/code'
+pub fn delta<T>() -> MyBox<[T; 1]> {
+ loop {}
+}
diff --git a/src/test/rustdoc/assoc-consts.rs b/src/test/rustdoc/assoc-consts.rs
index a79e93145..a3e10ee55 100644
--- a/src/test/rustdoc/assoc-consts.rs
+++ b/src/test/rustdoc/assoc-consts.rs
@@ -5,7 +5,7 @@ pub trait Foo {
const FOO: usize = 12 + 1;
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
const FOO_NO_DEFAULT: bool;
- // @!has - FOO_HIDDEN
+ // @!hasraw - FOO_HIDDEN
#[doc(hidden)]
const FOO_HIDDEN: u8 = 0;
}
@@ -13,12 +13,12 @@ pub trait Foo {
pub struct Bar;
impl Foo for Bar {
- // @has assoc_consts/struct.Bar.html '//h3[@class="code-header in-band"]' 'impl Foo for Bar'
+ // @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Foo for Bar'
// @has - '//*[@id="associatedconstant.FOO"]' 'const FOO: usize'
const FOO: usize = 12;
// @has - '//*[@id="associatedconstant.FOO_NO_DEFAULT"]' 'const FOO_NO_DEFAULT: bool'
const FOO_NO_DEFAULT: bool = false;
- // @!has - FOO_HIDDEN
+ // @!hasraw - FOO_HIDDEN
#[doc(hidden)]
const FOO_HIDDEN: u8 = 0;
}
@@ -50,9 +50,9 @@ impl Bar {
}
impl Bar {
- // @!has assoc_consts/struct.Bar.html 'BAR_PRIVATE'
+ // @!hasraw assoc_consts/struct.Bar.html 'BAR_PRIVATE'
const BAR_PRIVATE: char = 'a';
- // @!has assoc_consts/struct.Bar.html 'BAR_HIDDEN'
+ // @!hasraw assoc_consts/struct.Bar.html 'BAR_HIDDEN'
#[doc(hidden)]
pub const BAR_HIDDEN: &'static str = "a";
}
@@ -81,7 +81,7 @@ pub trait Qux {
const QUX_DEFAULT2: u32 = 3;
}
-// @has assoc_consts/struct.Bar.html '//h3[@class="code-header in-band"]' 'impl Qux for Bar'
+// @has assoc_consts/struct.Bar.html '//h3[@class="code-header"]' 'impl Qux for Bar'
impl Qux for Bar {
// @has - '//*[@id="associatedconstant.QUX0"]' 'const QUX0: u8'
// @has - '//*[@class="docblock"]' "Docs for QUX0 in trait."
diff --git a/src/test/rustdoc/associated-consts.rs b/src/test/rustdoc/associated-consts.rs
index 9319a073b..adb155bb5 100644
--- a/src/test/rustdoc/associated-consts.rs
+++ b/src/test/rustdoc/associated-consts.rs
@@ -9,7 +9,7 @@ pub trait Trait {
pub struct Bar;
// @has 'foo/struct.Bar.html'
-// @!has - '//h3[@class="sidebar-title"]' 'Associated Constants'
+// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
// @!has - '//div[@class="sidebar-elems"]//a' 'FOO'
impl Trait for Bar {
const FOO: u32 = 1;
@@ -22,7 +22,7 @@ pub enum Foo {
}
// @has 'foo/enum.Foo.html'
-// @!has - '//h3[@class="sidebar-title"]' 'Associated Constants'
+// @!has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
// @!has - '//div[@class="sidebar-elems"]//a' 'FOO'
impl Trait for Foo {
const FOO: u32 = 1;
@@ -33,7 +33,7 @@ impl Trait for Foo {
pub struct Baz;
// @has 'foo/struct.Baz.html'
-// @has - '//h3[@class="sidebar-title"]' 'Associated Constants'
+// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
// @has - '//div[@class="sidebar-elems"]//a' 'FOO'
impl Baz {
pub const FOO: u32 = 42;
@@ -44,7 +44,7 @@ pub enum Quux {
}
// @has 'foo/enum.Quux.html'
-// @has - '//h3[@class="sidebar-title"]' 'Associated Constants'
+// @has - '//div[@class="sidebar-elems"]//h3' 'Associated Constants'
// @has - '//div[@class="sidebar-elems"]//a' 'FOO'
impl Quux {
pub const FOO: u32 = 42;
diff --git a/src/test/rustdoc/async-trait.rs b/src/test/rustdoc/async-trait.rs
new file mode 100644
index 000000000..a473e4674
--- /dev/null
+++ b/src/test/rustdoc/async-trait.rs
@@ -0,0 +1,16 @@
+// aux-build:async-trait-dep.rs
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+extern crate async_trait_dep;
+
+pub struct Oink {}
+
+// @has 'async_trait/struct.Oink.html' '//h4[@class="code-header"]' "async fn woof()"
+impl async_trait_dep::Meow for Oink {
+ async fn woof() {
+ todo!()
+ }
+}
diff --git a/src/test/rustdoc/attribute-rendering.rs b/src/test/rustdoc/attribute-rendering.rs
index 677787184..36e10923c 100644
--- a/src/test/rustdoc/attribute-rendering.rs
+++ b/src/test/rustdoc/attribute-rendering.rs
@@ -1,7 +1,7 @@
#![crate_name = "foo"]
// @has 'foo/fn.f.html'
-// @has - //*[@'class="docblock item-decl"]' '#[export_name = "f"] pub fn f()'
+// @has - //*[@'class="item-decl"]' '#[export_name = "f"] pub fn f()'
#[export_name = "\
f"]
pub fn f() {}
diff --git a/src/test/rustdoc/attributes.rs b/src/test/rustdoc/attributes.rs
index 1c7f4b724..a36dadced 100644
--- a/src/test/rustdoc/attributes.rs
+++ b/src/test/rustdoc/attributes.rs
@@ -8,6 +8,6 @@ pub extern "C" fn f() {}
#[export_name = "bar"]
pub extern "C" fn g() {}
-// @has foo/struct.Repr.html '//*[@class="docblock item-decl"]' '#[repr(C, align(8))]'
+// @has foo/struct.Repr.html '//*[@class="item-decl"]' '#[repr(C, align(8))]'
#[repr(C, align(8))]
pub struct Repr;
diff --git a/src/test/rustdoc/auxiliary/async-trait-dep.rs b/src/test/rustdoc/auxiliary/async-trait-dep.rs
new file mode 100644
index 000000000..10a55dd02
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/async-trait-dep.rs
@@ -0,0 +1,9 @@
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+pub trait Meow {
+ /// Who's a good dog?
+ async fn woof();
+}
diff --git a/src/test/rustdoc/auxiliary/incoherent-impl-types.rs b/src/test/rustdoc/auxiliary/incoherent-impl-types.rs
new file mode 100644
index 000000000..fc51e42e5
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/incoherent-impl-types.rs
@@ -0,0 +1,7 @@
+#![feature(rustc_attrs)]
+
+#[rustc_has_incoherent_inherent_impls]
+pub trait FooTrait {}
+
+#[rustc_has_incoherent_inherent_impls]
+pub struct FooStruct;
diff --git a/src/test/rustdoc/auxiliary/reexport-doc-aux.rs b/src/test/rustdoc/auxiliary/reexport-doc-aux.rs
new file mode 100644
index 000000000..3400717eb
--- /dev/null
+++ b/src/test/rustdoc/auxiliary/reexport-doc-aux.rs
@@ -0,0 +1,5 @@
+pub struct Foo;
+
+impl Foo {
+ pub fn foo() {}
+}
diff --git a/src/test/rustdoc/blanket-reexport-item.rs b/src/test/rustdoc/blanket-reexport-item.rs
index 676d656da..437f0001f 100644
--- a/src/test/rustdoc/blanket-reexport-item.rs
+++ b/src/test/rustdoc/blanket-reexport-item.rs
@@ -1,6 +1,6 @@
#![crate_name = "foo"]
-// @has foo/struct.S.html '//*[@id="impl-Into%3CU%3E-for-S"]//h3[@class="code-header in-band"]' 'impl<T, U> Into<U> for T'
+// @has foo/struct.S.html '//*[@id="impl-Into%3CU%3E-for-S"]//h3[@class="code-header"]' 'impl<T, U> Into<U> for T'
pub struct S2 {}
mod m {
pub struct S {}
diff --git a/src/test/rustdoc/cfg_doc_reexport.rs b/src/test/rustdoc/cfg_doc_reexport.rs
new file mode 100644
index 000000000..addb6709d
--- /dev/null
+++ b/src/test/rustdoc/cfg_doc_reexport.rs
@@ -0,0 +1,33 @@
+#![feature(doc_cfg)]
+#![feature(no_core)]
+
+#![crate_name = "foo"]
+#![no_core]
+
+// @has 'foo/index.html'
+// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'foobar'
+// @has - '//*[@class="item-left module-item"]/*[@class="stab portability"]' 'bar'
+
+#[doc(cfg(feature = "foobar"))]
+mod imp_priv {
+ // @has 'foo/struct.BarPriv.html'
+ // @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on crate feature foobar only.'
+ pub struct BarPriv {}
+ impl BarPriv {
+ pub fn test() {}
+ }
+}
+#[doc(cfg(feature = "foobar"))]
+pub use crate::imp_priv::*;
+
+pub mod bar {
+ // @has 'foo/bar/struct.Bar.html'
+ // @has - '//*[@id="main-content"]/*[@class="item-info"]/*[@class="stab portability"]' \
+ // 'Available on crate feature bar only.'
+ #[doc(cfg(feature = "bar"))]
+ pub struct Bar;
+}
+
+#[doc(cfg(feature = "bar"))]
+pub use bar::Bar;
diff --git a/src/test/rustdoc/check-source-code-urls-to-def-std.rs b/src/test/rustdoc/check-source-code-urls-to-def-std.rs
index 3396b234a..e12d8445f 100644
--- a/src/test/rustdoc/check-source-code-urls-to-def-std.rs
+++ b/src/test/rustdoc/check-source-code-urls-to-def-std.rs
@@ -9,7 +9,7 @@ fn babar() {}
// @has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32'
// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str'
// @has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool'
-// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#7"]' 'babar'
+// @has - '//a[@href="#7"]' 'babar'
pub fn foo(a: u32, b: &str, c: String) {
let x = 12;
let y: bool = true;
@@ -31,12 +31,12 @@ macro_rules! data {
pub fn another_foo() {
// This is known limitation: if the macro doesn't generate anything, the visitor
// can't find any item or anything that could tell us that it comes from expansion.
- // @!has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#19"]' 'yolo!'
+ // @!has - '//a[@href="#19"]' 'yolo!'
yolo!();
// @has - '//a[@href="{{channel}}/std/macro.eprintln.html"]' 'eprintln!'
eprintln!();
- // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#27-29"]' 'data!'
+ // @has - '//a[@href="#27-29"]' 'data!'
let x = data!(4);
- // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#23-25"]' 'bar!'
+ // @has - '//a[@href="#23-25"]' 'bar!'
bar!(x);
}
diff --git a/src/test/rustdoc/check-source-code-urls-to-def.rs b/src/test/rustdoc/check-source-code-urls-to-def.rs
index ec44e1bc6..d00a3e355 100644
--- a/src/test/rustdoc/check-source-code-urls-to-def.rs
+++ b/src/test/rustdoc/check-source-code-urls-to-def.rs
@@ -10,14 +10,14 @@ extern crate source_code;
// @has 'src/foo/check-source-code-urls-to-def.rs.html'
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
+// @has - '//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
#[path = "auxiliary/source-code-bar.rs"]
pub mod bar;
-// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5"]' 4
+// @count - '//a[@href="auxiliary/source-code-bar.rs.html#5"]' 4
use bar::Bar;
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13"]' 'self'
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
+// @has - '//a[@href="auxiliary/source-code-bar.rs.html#13"]' 'self'
+// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
use bar::sub::{self, Trait};
pub struct Foo;
@@ -31,26 +31,26 @@ fn babar() {}
// @has - '//a/@href' '/struct.String.html'
// @has - '//a/@href' '/primitive.u32.html'
// @has - '//a/@href' '/primitive.str.html'
-// @count - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#23"]' 5
+// @count - '//a[@href="#23"]' 5
// @has - '//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode'
pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) {
let x = 12;
let y: Foo = Foo;
let z: Bar = bar::Bar { field: Foo };
babar();
- // @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#26"]' 'hello'
+ // @has - '//a[@href="#26"]' 'hello'
y.hello();
}
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
-// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
+// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
+// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
pub trait AnotherTrait {}
pub trait WhyNot {}
-// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#49"]' 'AnotherTrait'
-// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#50"]' 'WhyNot'
+// @has - '//a[@href="#49"]' 'AnotherTrait'
+// @has - '//a[@href="#50"]' 'WhyNot'
pub fn foo3<T, V>(t: &T, v: &V)
where
T: AnotherTrait,
@@ -59,7 +59,7 @@ where
pub trait AnotherTrait2 {}
-// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#60"]' 'AnotherTrait2'
+// @has - '//a[@href="#60"]' 'AnotherTrait2'
pub fn foo4() {
let x: Vec<AnotherTrait2> = Vec::new();
}
diff --git a/src/test/rustdoc/codeblock-title.rs b/src/test/rustdoc/codeblock-title.rs
index 140c5b3a6..b9b0b0d1a 100644
--- a/src/test/rustdoc/codeblock-title.rs
+++ b/src/test/rustdoc/codeblock-title.rs
@@ -1,8 +1,8 @@
#![crate_name = "foo"]
-// @has foo/fn.bar.html '//*[@class="tooltip compile_fail"]' "ⓘ"
-// @has foo/fn.bar.html '//*[@class="tooltip ignore"]' "ⓘ"
-// @has foo/fn.bar.html '//*[@class="tooltip should_panic"]' "ⓘ"
+// @has foo/fn.bar.html '//*[@class="example-wrap compile_fail"]/*[@class="tooltip"]' "ⓘ"
+// @has foo/fn.bar.html '//*[@class="example-wrap ignore"]/*[@class="tooltip"]' "ⓘ"
+// @has foo/fn.bar.html '//*[@class="example-wrap should_panic"]/*[@class="tooltip"]' "ⓘ"
// @has foo/fn.bar.html '//*[@data-edition="2018"]' "ⓘ"
/// foo
diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs
index 8455dd9ef..594501b22 100644
--- a/src/test/rustdoc/const-display.rs
+++ b/src/test/rustdoc/const-display.rs
@@ -20,7 +20,7 @@ pub const fn foo() -> u32 { 42 }
pub const unsafe fn foo_unsafe() -> u32 { 42 }
// @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32'
-// @!has - '//span[@class="since"]'
+// @!hasraw - '//span[@class="since"]'
#[unstable(feature = "humans", issue = "none")]
pub const fn foo2() -> u32 { 42 }
@@ -32,7 +32,7 @@ pub const fn bar2() -> u32 { 42 }
// @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32'
-// @!has - '//span[@class="since"]'
+// @!hasraw - '//span[@class="since"]'
#[unstable(feature = "foo2", issue = "none")]
pub const unsafe fn foo2_gated() -> u32 { 42 }
@@ -43,7 +43,7 @@ pub const unsafe fn foo2_gated() -> u32 { 42 }
pub const unsafe fn bar2_gated() -> u32 { 42 }
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
-// @!has - '//span[@class="since"]'
+// @!hasraw - '//span[@class="since"]'
pub const unsafe fn bar_not_gated() -> u32 { 42 }
pub struct Foo;
diff --git a/src/test/rustdoc/const-generics/add-impl.rs b/src/test/rustdoc/const-generics/add-impl.rs
index 591139523..6cbae9abe 100644
--- a/src/test/rustdoc/const-generics/add-impl.rs
+++ b/src/test/rustdoc/const-generics/add-impl.rs
@@ -7,7 +7,7 @@ pub struct Simd<T, const WIDTH: usize> {
inner: T,
}
-// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3[@class="code-header in-band"]' 'impl Add<Simd<u8, 16>> for Simd<u8, 16>'
+// @has foo/struct.Simd.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl Add<Simd<u8, 16>> for Simd<u8, 16>'
impl Add for Simd<u8, 16> {
type Output = Self;
diff --git a/src/test/rustdoc/const-generics/const-generics-docs.rs b/src/test/rustdoc/const-generics/const-generics-docs.rs
index 352a8e646..5bf76e3c4 100644
--- a/src/test/rustdoc/const-generics/const-generics-docs.rs
+++ b/src/test/rustdoc/const-generics/const-generics-docs.rs
@@ -19,10 +19,10 @@ pub use extern_crate::WTrait;
// @has foo/trait.Trait.html '//pre[@class="rust trait"]' \
// 'pub trait Trait<const N: usize>'
-// @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<1> for u8'
-// @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<2> for u8'
-// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//h3[@class="code-header in-band"]' 'impl Trait<{1 + 2}> for u8'
-// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="impl-Trait%3C1%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<1> for u8'
+// @has - '//*[@id="impl-Trait%3C2%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<2> for u8'
+// @has - '//*[@id="impl-Trait%3C{1%20+%202}%3E-for-u8"]//h3[@class="code-header"]' 'impl Trait<{1 + 2}> for u8'
+// @has - '//*[@id="impl-Trait%3CN%3E-for-%5Bu8%3B%20N%5D"]//h3[@class="code-header"]' \
// 'impl<const N: usize> Trait<N> for [u8; N]'
pub trait Trait<const N: usize> {}
impl Trait<1> for u8 {}
@@ -31,12 +31,12 @@ impl Trait<{1 + 2}> for u8 {}
impl<const N: usize> Trait<N> for [u8; N] {}
// @has foo/struct.Foo.html '//pre[@class="rust struct"]' \
-// 'pub struct Foo<const N: usize> where u8: Trait<N>'
+// 'pub struct Foo<const N: usize>where u8: Trait<N>'
pub struct Foo<const N: usize> where u8: Trait<N>;
// @has foo/struct.Bar.html '//pre[@class="rust struct"]' 'pub struct Bar<T, const N: usize>(_)'
pub struct Bar<T, const N: usize>([T; N]);
-// @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header in-band"]' 'impl<const M: usize> Foo<M> where u8: Trait<M>'
+// @has foo/struct.Foo.html '//*[@id="impl-Foo%3CM%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Foo<M>where u8: Trait<M>'
impl<const M: usize> Foo<M> where u8: Trait<M> {
// @has - '//*[@id="associatedconstant.FOO_ASSOC"]' 'pub const FOO_ASSOC: usize'
pub const FOO_ASSOC: usize = M + 13;
@@ -47,17 +47,17 @@ impl<const M: usize> Foo<M> where u8: Trait<M> {
}
}
-// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8%2C%20M%3E"]/h3[@class="code-header in-band"]' 'impl<const M: usize> Bar<u8, M>'
+// @has foo/struct.Bar.html '//*[@id="impl-Bar%3Cu8%2C%20M%3E"]/h3[@class="code-header"]' 'impl<const M: usize> Bar<u8, M>'
impl<const M: usize> Bar<u8, M> {
// @has - '//*[@id="method.hey"]' \
- // 'pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N>'
+ // 'pub fn hey<const N: usize>(&self) -> Foo<N>where u8: Trait<N>'
pub fn hey<const N: usize>(&self) -> Foo<N> where u8: Trait<N> {
Foo
}
}
// @has foo/fn.test.html '//pre[@class="rust fn"]' \
-// 'pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N>'
+// 'pub fn test<const N: usize>() -> impl Trait<N>where u8: Trait<N>'
pub fn test<const N: usize>() -> impl Trait<N> where u8: Trait<N> {
2u8
}
diff --git a/src/test/rustdoc/const-generics/const-impl.rs b/src/test/rustdoc/const-generics/const-impl.rs
index f1181d54a..75ee84279 100644
--- a/src/test/rustdoc/const-generics/const-impl.rs
+++ b/src/test/rustdoc/const-generics/const-impl.rs
@@ -9,20 +9,20 @@ pub enum Order {
}
// @has foo/struct.VSet.html '//pre[@class="rust struct"]' 'pub struct VSet<T, const ORDER: Order>'
-// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header in-band"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
-// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header in-band"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
+// @has foo/struct.VSet.html '//*[@id="impl-Send-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Send for VSet<T, ORDER>'
+// @has foo/struct.VSet.html '//*[@id="impl-Sync-for-VSet%3CT%2C%20ORDER%3E"]/h3[@class="code-header"]' 'impl<T, const ORDER: Order> Sync for VSet<T, ORDER>'
pub struct VSet<T, const ORDER: Order> {
inner: Vec<T>,
}
-// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3ASorted%20}%3E"]/h3[@class="code-header in-band"]' 'impl<T> VSet<T, { Order::Sorted }>'
+// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3ASorted%20}%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Sorted }>'
impl<T> VSet<T, { Order::Sorted }> {
pub fn new() -> Self {
Self { inner: Vec::new() }
}
}
-// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3AUnsorted%20}%3E"]/h3[@class="code-header in-band"]' 'impl<T> VSet<T, { Order::Unsorted }>'
+// @has foo/struct.VSet.html '//*[@id="impl-VSet%3CT%2C%20{%20Order%3A%3AUnsorted%20}%3E"]/h3[@class="code-header"]' 'impl<T> VSet<T, { Order::Unsorted }>'
impl<T> VSet<T, { Order::Unsorted }> {
pub fn new() -> Self {
Self { inner: Vec::new() }
@@ -31,7 +31,7 @@ impl<T> VSet<T, { Order::Unsorted }> {
pub struct Escape<const S: &'static str>;
-// @has foo/struct.Escape.html '//*[@id="impl-Escape%3Cr#%22%3Cscript%3Ealert(%22Escape%22)%3B%3C/script%3E%22#%3E"]/h3[@class="code-header in-band"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
+// @has foo/struct.Escape.html '//*[@id="impl-Escape%3Cr#%22%3Cscript%3Ealert(%22Escape%22)%3B%3C/script%3E%22#%3E"]/h3[@class="code-header"]' 'impl Escape<r#"<script>alert("Escape");</script>"#>'
impl Escape<r#"<script>alert("Escape");</script>"#> {
pub fn f() {}
}
diff --git a/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs b/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
index 4eac8e31e..310e89a35 100644
--- a/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
+++ b/src/test/rustdoc/const-generics/lazy_normalization_consts/const-equate-pred.rs
@@ -12,7 +12,7 @@ pub struct Hasher<T> {
unsafe impl<T: Default> Send for Hasher<T> {}
// @has foo/struct.Foo.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Send for Foo'
+// @has - '//h3[@class="code-header"]' 'impl Send for Foo'
pub struct Foo {
hasher: Hasher<[u8; 3]>,
}
diff --git a/src/test/rustdoc/const-value-display.rs b/src/test/rustdoc/const-value-display.rs
index 5b2f3c48d..8d95f0de9 100644
--- a/src/test/rustdoc/const-value-display.rs
+++ b/src/test/rustdoc/const-value-display.rs
@@ -1,9 +1,9 @@
#![crate_name = "foo"]
// @has 'foo/constant.HOUR_IN_SECONDS.html'
-// @has - '//*[@class="docblock item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
+// @has - '//*[@class="item-decl"]//code' 'pub const HOUR_IN_SECONDS: u64 = _; // 3_600u64'
pub const HOUR_IN_SECONDS: u64 = 60 * 60;
// @has 'foo/constant.NEGATIVE.html'
-// @has - '//*[@class="docblock item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
+// @has - '//*[@class="item-decl"]//code' 'pub const NEGATIVE: i64 = _; // -3_600i64'
pub const NEGATIVE: i64 = -60 * 60;
diff --git a/src/test/rustdoc/decl-trailing-whitespace.rs b/src/test/rustdoc/decl-trailing-whitespace.rs
index 46a2307ab..e47edc132 100644
--- a/src/test/rustdoc/decl-trailing-whitespace.rs
+++ b/src/test/rustdoc/decl-trailing-whitespace.rs
@@ -7,7 +7,7 @@ pub struct Error;
// @has 'foo/trait.Write.html'
pub trait Write {
- // @snapshot 'declaration' - '//*[@class="docblock item-decl"]//code'
+ // @snapshot 'declaration' - '//*[@class="item-decl"]//code'
fn poll_write(
self: Option<String>,
cx: &mut Option<String>,
diff --git a/src/test/rustdoc/deprecated-impls.rs b/src/test/rustdoc/deprecated-impls.rs
index efd250ce9..e419d2631 100644
--- a/src/test/rustdoc/deprecated-impls.rs
+++ b/src/test/rustdoc/deprecated-impls.rs
@@ -5,8 +5,8 @@ pub struct Foo0;
impl Foo0 {
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.1: fn_with_doc'
- // @has - 'fn_with_doc short'
- // @has - 'fn_with_doc full'
+ // @hasraw - 'fn_with_doc short'
+ // @hasraw - 'fn_with_doc full'
/// fn_with_doc short
///
/// fn_with_doc full
@@ -52,8 +52,8 @@ pub struct Foo1;
impl Bar for Foo1 {
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
- // @has - 'fn_empty_with_doc_impl short'
- // @has - 'fn_empty_with_doc_impl full'
+ // @hasraw - 'fn_empty_with_doc_impl short'
+ // @hasraw - 'fn_empty_with_doc_impl full'
/// fn_empty_with_doc_impl short
///
/// fn_empty_with_doc_impl full
@@ -63,8 +63,8 @@ impl Bar for Foo1 {
fn fn_empty_without_doc() {}
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
- // @has - 'fn_def_with_doc_impl short'
- // @has - 'fn_def_with_doc_impl full'
+ // @hasraw - 'fn_def_with_doc_impl short'
+ // @hasraw - 'fn_def_with_doc_impl full'
/// fn_def_with_doc_impl short
///
/// fn_def_with_doc_impl full
@@ -74,8 +74,8 @@ impl Bar for Foo1 {
fn fn_def_without_doc() {}
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
- // @has - 'fn_def_def_with_doc short'
- // @!has - 'fn_def_def_with_doc full'
+ // @hasraw - 'fn_def_def_with_doc short'
+ // @!hasraw - 'fn_def_def_with_doc full'
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
}
@@ -85,34 +85,34 @@ pub struct Foo2;
impl Bar for Foo2 {
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.3: fn_empty_with_doc'
- // @has - 'fn_empty_with_doc short'
- // @!has - 'fn_empty_with_doc full'
+ // @hasraw - 'fn_empty_with_doc short'
+ // @!hasraw - 'fn_empty_with_doc full'
fn fn_empty_with_doc() {}
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.4: fn_empty_without_doc'
- // @has - 'fn_empty_without_doc_impl short'
- // @has - 'fn_empty_without_doc_impl full'
+ // @hasraw - 'fn_empty_without_doc_impl short'
+ // @hasraw - 'fn_empty_without_doc_impl full'
/// fn_empty_without_doc_impl short
///
/// fn_empty_without_doc_impl full
fn fn_empty_without_doc() {}
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.5: fn_def_with_doc'
- // @has - 'fn_def_with_doc short'
- // @!has - 'fn_def_with_doc full'
+ // @hasraw - 'fn_def_with_doc short'
+ // @!hasraw - 'fn_def_with_doc full'
fn fn_def_with_doc() {}
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.6: fn_def_without_doc'
- // @has - 'fn_def_without_doc_impl short'
- // @has - 'fn_def_without_doc_impl full'
+ // @hasraw - 'fn_def_without_doc_impl short'
+ // @hasraw - 'fn_def_without_doc_impl full'
/// fn_def_without_doc_impl short
///
/// fn_def_without_doc_impl full
fn fn_def_without_doc() {}
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.7: fn_def_def_with_doc'
- // @has - 'fn_def_def_with_doc short'
- // @!has - 'fn_def_def_with_doc full'
+ // @hasraw - 'fn_def_def_with_doc short'
+ // @!hasraw - 'fn_def_def_with_doc full'
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.0.8: fn_def_def_without_doc'
}
diff --git a/src/test/rustdoc/deref-recursive-pathbuf.rs b/src/test/rustdoc/deref-recursive-pathbuf.rs
index 746df9c80..be2b42b5a 100644
--- a/src/test/rustdoc/deref-recursive-pathbuf.rs
+++ b/src/test/rustdoc/deref-recursive-pathbuf.rs
@@ -7,9 +7,9 @@
// @has '-' '//*[@class="impl-items"]//*[@id="method.as_path"]' 'pub fn as_path(&self)'
// @has '-' '//*[@id="deref-methods-Path"]' 'Methods from Deref<Target = Path>'
// @has '-' '//*[@class="impl-items"]//*[@id="method.exists"]' 'pub fn exists(&self)'
-// @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref<Target=PathBuf>'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-PathBuf"]' 'Methods from Deref<Target=PathBuf>'
// @has '-' '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.as_path"]' 'as_path'
-// @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods-Path"]' 'Methods from Deref<Target=Path>'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Path"]' 'Methods from Deref<Target=Path>'
// @has '-' '//*[@class="sidebar-elems"]//*[@class="block"]//a[@href="#method.exists"]' 'exists'
#![crate_name = "foo"]
diff --git a/src/test/rustdoc/deref-recursive.rs b/src/test/rustdoc/deref-recursive.rs
index d5f8473f2..0436f2f86 100644
--- a/src/test/rustdoc/deref-recursive.rs
+++ b/src/test/rustdoc/deref-recursive.rs
@@ -7,9 +7,9 @@
// @has '-' '//*[@class="impl-items"]//*[@id="method.bar"]' 'pub fn bar(&self)'
// @has '-' '//*[@id="deref-methods-Baz"]' 'Methods from Deref<Target = Baz>'
// @has '-' '//*[@class="impl-items"]//*[@id="method.baz"]' 'pub fn baz(&self)'
-// @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods-Bar"]' 'Methods from Deref<Target=Bar>'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Bar"]' 'Methods from Deref<Target=Bar>'
// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.bar"]' 'bar'
-// @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods-Baz"]' 'Methods from Deref<Target=Baz>'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-Baz"]' 'Methods from Deref<Target=Baz>'
// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.baz"]' 'baz'
#![crate_name = "foo"]
diff --git a/src/test/rustdoc/deref-typedef.rs b/src/test/rustdoc/deref-typedef.rs
index 28f977e31..32424d13e 100644
--- a/src/test/rustdoc/deref-typedef.rs
+++ b/src/test/rustdoc/deref-typedef.rs
@@ -6,7 +6,7 @@
// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_b"]' 'pub fn foo_b(&self)'
// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_c"]' 'pub fn foo_c(&self)'
// @has '-' '//*[@class="impl-items"]//*[@id="method.foo_j"]' 'pub fn foo_j(&self)'
-// @has '-' '//*[@class="sidebar-title"]/a[@href="#deref-methods-FooJ"]' 'Methods from Deref<Target=FooJ>'
+// @has '-' '//div[@class="sidebar-elems"]//h3/a[@href="#deref-methods-FooJ"]' 'Methods from Deref<Target=FooJ>'
// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_a"]' 'foo_a'
// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_b"]' 'foo_b'
// @has '-' '//*[@class="sidebar-elems"]//section//a[@href="#method.foo_c"]' 'foo_c'
diff --git a/src/test/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs b/src/test/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs
new file mode 100644
index 000000000..3fb00c7db
--- /dev/null
+++ b/src/test/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs
@@ -0,0 +1,38 @@
+#![feature(doc_notable_trait)]
+#![feature(lang_items)]
+#![feature(no_core)]
+#![no_core]
+#[lang = "owned_box"]
+pub struct Box<T>;
+
+impl<T> Box<T> {
+ pub fn new(x: T) -> Box<T> {
+ Box
+ }
+}
+
+#[doc(notable_trait)]
+pub trait FakeIterator {}
+
+impl<I: FakeIterator> FakeIterator for Box<I> {}
+
+#[lang = "pin"]
+pub struct Pin<T>;
+
+impl<T> Pin<T> {
+ pub fn new(x: T) -> Pin<T> {
+ Pin
+ }
+}
+
+impl<I: FakeIterator> FakeIterator for Pin<I> {}
+
+// @!has doc_notable_trait_box_is_not_an_iterator/fn.foo.html '//*' 'Notable'
+pub fn foo<T>(x: T) -> Box<T> {
+ Box::new(x)
+}
+
+// @!has doc_notable_trait_box_is_not_an_iterator/fn.bar.html '//*' 'Notable'
+pub fn bar<T>(x: T) -> Pin<T> {
+ Pin::new(x)
+}
diff --git a/src/test/rustdoc/doc_auto_cfg_nested_impl.rs b/src/test/rustdoc/doc_auto_cfg_nested_impl.rs
new file mode 100644
index 000000000..4d73e0d82
--- /dev/null
+++ b/src/test/rustdoc/doc_auto_cfg_nested_impl.rs
@@ -0,0 +1,24 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/101129>.
+
+#![feature(doc_auto_cfg)]
+#![crate_type = "lib"]
+#![crate_name = "foo"]
+
+pub struct S;
+pub trait MyTrait1 {}
+pub trait MyTrait2 {}
+
+// @has foo/struct.S.html
+// @has - '//*[@id="impl-MyTrait1-for-S"]//*[@class="stab portability"]' \
+// 'Available on non-crate feature coolstuff only.'
+#[cfg(not(feature = "coolstuff"))]
+impl MyTrait1 for S {}
+
+#[cfg(not(feature = "coolstuff"))]
+mod submod {
+ use crate::{S, MyTrait2};
+ // This impl should also have the `not(feature = "coolstuff")`.
+ // @has - '//*[@id="impl-MyTrait2-for-S"]//*[@class="stab portability"]' \
+ // 'Available on non-crate feature coolstuff only.'
+ impl MyTrait2 for S {}
+}
diff --git a/src/test/rustdoc/duplicate_impls/issue-33054.rs b/src/test/rustdoc/duplicate_impls/issue-33054.rs
index 84c9e4ac0..c1f95ac91 100644
--- a/src/test/rustdoc/duplicate_impls/issue-33054.rs
+++ b/src/test/rustdoc/duplicate_impls/issue-33054.rs
@@ -1,12 +1,12 @@
// ignore-tidy-linelength
// @has issue_33054/impls/struct.Foo.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Foo'
-// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Foo'
+// @has - '//h3[@class="code-header"]' 'impl Foo'
+// @has - '//h3[@class="code-header"]' 'impl Bar for Foo'
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1
// @count - '//*[@id="main-content"]/div[@id="implementations-list"]/details/summary/*[@class="impl has-srclink"]' 1
// @has issue_33054/impls/bar/trait.Bar.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Foo'
+// @has - '//h3[@class="code-header"]' 'impl Bar for Foo'
// @count - '//*[@class="struct"]' 1
pub mod impls;
diff --git a/src/test/rustdoc/elided-lifetime.rs b/src/test/rustdoc/elided-lifetime.rs
index 5a32554f9..006132ef8 100644
--- a/src/test/rustdoc/elided-lifetime.rs
+++ b/src/test/rustdoc/elided-lifetime.rs
@@ -3,7 +3,7 @@
// rust-lang/rust#75225
//
// Since Rust 2018 we encourage writing out <'_> explicitly to make it clear
-// that borrowing is occuring. Make sure rustdoc is following the same idiom.
+// that borrowing is occurring. Make sure rustdoc is following the same idiom.
#![crate_name = "foo"]
@@ -11,33 +11,33 @@ pub struct Ref<'a>(&'a u32);
type ARef<'a> = Ref<'a>;
// @has foo/fn.test1.html
-// @matches - "Ref</a>&lt;'_&gt;"
+// @matchesraw - "Ref</a>&lt;'_&gt;"
pub fn test1(a: &u32) -> Ref {
Ref(a)
}
// @has foo/fn.test2.html
-// @matches - "Ref</a>&lt;'_&gt;"
+// @matchesraw - "Ref</a>&lt;'_&gt;"
pub fn test2(a: &u32) -> Ref<'_> {
Ref(a)
}
// @has foo/fn.test3.html
-// @matches - "Ref</a>&lt;'_&gt;"
+// @matchesraw - "Ref</a>&lt;'_&gt;"
pub fn test3(a: &u32) -> ARef {
Ref(a)
}
// @has foo/fn.test4.html
-// @matches - "Ref</a>&lt;'_&gt;"
+// @matchesraw - "Ref</a>&lt;'_&gt;"
pub fn test4(a: &u32) -> ARef<'_> {
Ref(a)
}
// Ensure external paths in inlined docs also display elided lifetime
// @has foo/bar/fn.test5.html
-// @matches - "Ref</a>&lt;'_&gt;"
+// @matchesraw - "Ref</a>&lt;'_&gt;"
// @has foo/bar/fn.test6.html
-// @matches - "Ref</a>&lt;'_&gt;"
+// @matchesraw - "Ref</a>&lt;'_&gt;"
#[doc(inline)]
pub extern crate bar;
diff --git a/src/test/rustdoc/empty-impl-block-private-with-doc.rs b/src/test/rustdoc/empty-impl-block-private-with-doc.rs
new file mode 100644
index 000000000..439719961
--- /dev/null
+++ b/src/test/rustdoc/empty-impl-block-private-with-doc.rs
@@ -0,0 +1,44 @@
+// compile-flags: --document-private-items
+
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+#![crate_name = "foo"]
+
+// @has 'foo/struct.Foo.html'
+pub struct Foo;
+
+// There are 3 impl blocks with public item and one that should not be displayed
+// by default because it only contains private items (but not in this case because
+// we used `--document-private-items`).
+// @count - '//*[@class="impl has-srclink"]' 'impl Foo' 4
+
+// Impl block only containing private items should not be displayed unless the
+// `--document-private-items` flag is used.
+/// Private
+impl Foo {
+ const BAR: u32 = 0;
+ type FOO = i32;
+ fn hello() {}
+}
+
+// But if any element of the impl block is public, it should be displayed.
+/// Not private
+impl Foo {
+ pub const BAR: u32 = 0;
+ type FOO = i32;
+ fn hello() {}
+}
+
+/// Not private
+impl Foo {
+ const BAR: u32 = 0;
+ pub type FOO = i32;
+ fn hello() {}
+}
+
+/// Not private
+impl Foo {
+ const BAR: u32 = 0;
+ type FOO = i32;
+ pub fn hello() {}
+}
diff --git a/src/test/rustdoc/empty-impl-block-private.rs b/src/test/rustdoc/empty-impl-block-private.rs
new file mode 100644
index 000000000..5caf02065
--- /dev/null
+++ b/src/test/rustdoc/empty-impl-block-private.rs
@@ -0,0 +1,40 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
+#![crate_name = "foo"]
+
+// @has 'foo/struct.Foo.html'
+pub struct Foo;
+
+// There are 3 impl blocks with public item and one that should not be displayed
+// because it only contains private items.
+// @count - '//*[@class="impl has-srclink"]' 'impl Foo' 3
+
+// Impl block only containing private items should not be displayed.
+/// Private
+impl Foo {
+ const BAR: u32 = 0;
+ type FOO = i32;
+ fn hello() {}
+}
+
+// But if any element of the impl block is public, it should be displayed.
+/// Not private
+impl Foo {
+ pub const BAR: u32 = 0;
+ type FOO = i32;
+ fn hello() {}
+}
+
+/// Not private
+impl Foo {
+ const BAR: u32 = 0;
+ pub type FOO = i32;
+ fn hello() {}
+}
+
+/// Not private
+impl Foo {
+ const BAR: u32 = 0;
+ type FOO = i32;
+ pub fn hello() {}
+}
diff --git a/src/test/rustdoc/empty-impl-block.rs b/src/test/rustdoc/empty-impl-block.rs
index 6a2a254f6..95d4db06b 100644
--- a/src/test/rustdoc/empty-impl-block.rs
+++ b/src/test/rustdoc/empty-impl-block.rs
@@ -16,5 +16,5 @@ pub struct Another;
pub trait Bar {}
// @has 'foo/struct.Another.html'
-// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Another'
+// @has - '//h3[@class="code-header"]' 'impl Bar for Another'
impl Bar for Another {}
diff --git a/src/test/rustdoc/empty-mod-private.rs b/src/test/rustdoc/empty-mod-private.rs
index c2a98049a..147e11e58 100644
--- a/src/test/rustdoc/empty-mod-private.rs
+++ b/src/test/rustdoc/empty-mod-private.rs
@@ -1,16 +1,16 @@
// compile-flags: --document-private-items
// @has 'empty_mod_private/index.html' '//a[@href="foo/index.html"]' 'foo'
-// @has 'empty_mod_private/sidebar-items.js' 'foo'
+// @hasraw 'empty_mod_private/sidebar-items.js' 'foo'
// @matches 'empty_mod_private/foo/index.html' '//h1' 'Module empty_mod_private::foo'
mod foo {}
// @has 'empty_mod_private/index.html' '//a[@href="bar/index.html"]' 'bar'
-// @has 'empty_mod_private/sidebar-items.js' 'bar'
+// @hasraw 'empty_mod_private/sidebar-items.js' 'bar'
// @matches 'empty_mod_private/bar/index.html' '//h1' 'Module empty_mod_private::bar'
mod bar {
// @has 'empty_mod_private/bar/index.html' '//a[@href="baz/index.html"]' 'baz'
- // @has 'empty_mod_private/bar/sidebar-items.js' 'baz'
+ // @hasraw 'empty_mod_private/bar/sidebar-items.js' 'baz'
// @matches 'empty_mod_private/bar/baz/index.html' '//h1' 'Module empty_mod_private::bar::baz'
mod baz {}
}
diff --git a/src/test/rustdoc/empty-mod-public.rs b/src/test/rustdoc/empty-mod-public.rs
index d097fcf83..c0bac4021 100644
--- a/src/test/rustdoc/empty-mod-public.rs
+++ b/src/test/rustdoc/empty-mod-public.rs
@@ -1,14 +1,14 @@
// @has 'empty_mod_public/index.html' '//a[@href="foo/index.html"]' 'foo'
-// @has 'empty_mod_public/sidebar-items.js' 'foo'
+// @hasraw 'empty_mod_public/sidebar-items.js' 'foo'
// @matches 'empty_mod_public/foo/index.html' '//h1' 'Module empty_mod_public::foo'
pub mod foo {}
// @has 'empty_mod_public/index.html' '//a[@href="bar/index.html"]' 'bar'
-// @has 'empty_mod_public/sidebar-items.js' 'bar'
+// @hasraw 'empty_mod_public/sidebar-items.js' 'bar'
// @matches 'empty_mod_public/bar/index.html' '//h1' 'Module empty_mod_public::bar'
pub mod bar {
// @has 'empty_mod_public/bar/index.html' '//a[@href="baz/index.html"]' 'baz'
- // @has 'empty_mod_public/bar/sidebar-items.js' 'baz'
+ // @hasraw 'empty_mod_public/bar/sidebar-items.js' 'baz'
// @matches 'empty_mod_public/bar/baz/index.html' '//h1' 'Module empty_mod_public::bar::baz'
pub mod baz {}
}
diff --git a/src/test/rustdoc/empty-section.rs b/src/test/rustdoc/empty-section.rs
index 665aa38b1..d8241ab96 100644
--- a/src/test/rustdoc/empty-section.rs
+++ b/src/test/rustdoc/empty-section.rs
@@ -5,7 +5,7 @@
pub struct Foo;
// @has foo/struct.Foo.html
-// @!has - 'Auto Trait Implementations'
+// @!hasraw - 'Auto Trait Implementations'
impl !Send for Foo {}
impl !Sync for Foo {}
impl !std::marker::Unpin for Foo {}
diff --git a/src/test/rustdoc/ensure-src-link.rs b/src/test/rustdoc/ensure-src-link.rs
index 9f8b0277e..c65387080 100644
--- a/src/test/rustdoc/ensure-src-link.rs
+++ b/src/test/rustdoc/ensure-src-link.rs
@@ -2,5 +2,5 @@
// This test ensures that the [src] link is present on traits items.
-// @has foo/trait.Iterator.html '//*[@id="method.zip"]//a[@class="srclink"]' "source"
+// @has foo/trait.Iterator.html '//*[@id="method.zip"]//a[@class="srclink rightside"]' "source"
pub use std::iter::Iterator;
diff --git a/src/test/rustdoc/escape-deref-methods.rs b/src/test/rustdoc/escape-deref-methods.rs
index a62ad2c40..66919d73e 100644
--- a/src/test/rustdoc/escape-deref-methods.rs
+++ b/src/test/rustdoc/escape-deref-methods.rs
@@ -27,7 +27,7 @@ impl Deref for TitleList {
}
// @has foo/struct.TitleList.html
-// @has - '//*[@class="sidebar-title"]' 'Methods from Deref<Target=Vec<Title>>'
+// @has - '//div[@class="sidebar-elems"]//h3' 'Methods from Deref<Target=Vec<Title>>'
impl DerefMut for TitleList {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.members
diff --git a/src/test/rustdoc/extern-impl.rs b/src/test/rustdoc/extern-impl.rs
index f357d65df..fd1bc2140 100644
--- a/src/test/rustdoc/extern-impl.rs
+++ b/src/test/rustdoc/extern-impl.rs
@@ -19,9 +19,9 @@ impl Foo {
// @has foo/trait.Bar.html
pub trait Bar {}
-// @has - '//h3[@class="code-header in-band"]' 'impl Bar for fn()'
+// @has - '//h3[@class="code-header"]' 'impl Bar for fn()'
impl Bar for fn() {}
-// @has - '//h3[@class="code-header in-band"]' 'impl Bar for extern "C" fn()'
+// @has - '//h3[@class="code-header"]' 'impl Bar for extern "C" fn()'
impl Bar for extern fn() {}
-// @has - '//h3[@class="code-header in-band"]' 'impl Bar for extern "system" fn()'
+// @has - '//h3[@class="code-header"]' 'impl Bar for extern "system" fn()'
impl Bar for extern "system" fn() {}
diff --git a/src/test/rustdoc/fn-bound.rs b/src/test/rustdoc/fn-bound.rs
index 4c4ffddc8..9e060ff20 100644
--- a/src/test/rustdoc/fn-bound.rs
+++ b/src/test/rustdoc/fn-bound.rs
@@ -11,7 +11,7 @@ pub struct ConditionalIterator<F> {
}
-// @has 'fn_bound/struct.ConditionalIterator.html' '//h3[@class="code-header in-band"]' 'impl<F: Fn(&i32)> Iterator for ConditionalIterator<F>'
+// @has 'fn_bound/struct.ConditionalIterator.html' '//h3[@class="code-header"]' 'impl<F: Fn(&i32)> Iterator for ConditionalIterator<F>'
impl<F: Fn(&i32)> Iterator for ConditionalIterator<F> {
type Item = ();
diff --git a/src/test/rustdoc/generic-associated-types/gats.rs b/src/test/rustdoc/generic-associated-types/gats.rs
index ae981b949..bcead3115 100644
--- a/src/test/rustdoc/generic-associated-types/gats.rs
+++ b/src/test/rustdoc/generic-associated-types/gats.rs
@@ -1,9 +1,8 @@
#![crate_name = "foo"]
-#![feature(generic_associated_types)]
// @has foo/trait.LendingIterator.html
pub trait LendingIterator {
- // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item<'a> where Self: 'a"
+ // @has - '//*[@id="associatedtype.Item"]//h4[@class="code-header"]' "type Item<'a>where Self: 'a"
type Item<'a> where Self: 'a;
// @has - '//*[@id="tymethod.next"]//h4[@class="code-header"]' \
@@ -24,7 +23,7 @@ impl LendingIterator for () {
pub struct Infinite<T>(T);
// @has foo/trait.LendingIterator.html
-// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a> where Self: 'a = &'a T"
+// @has - '//*[@id="associatedtype.Item-2"]//h4[@class="code-header"]' "type Item<'a>where Self: 'a = &'a T"
impl<T> LendingIterator for Infinite<T> {
type Item<'a> where Self: 'a = &'a T;
diff --git a/src/test/rustdoc/generic-associated-types/issue-94683.rs b/src/test/rustdoc/generic-associated-types/issue-94683.rs
index 38ecf5283..985c7e983 100644
--- a/src/test/rustdoc/generic-associated-types/issue-94683.rs
+++ b/src/test/rustdoc/generic-associated-types/issue-94683.rs
@@ -1,5 +1,4 @@
#![crate_name = "foo"]
-#![feature(generic_associated_types)]
pub trait Trait {
type Gat<'a>;
@@ -8,6 +7,6 @@ pub trait Trait {
// Make sure that the elided lifetime shows up
// @has foo/type.T.html
-// @has - "pub type T = "
-// @has - "&lt;'_&gt;"
+// @hasraw - "pub type T = "
+// @hasraw - "&lt;'_&gt;"
pub type T = fn(&<() as Trait>::Gat<'_>);
diff --git a/src/test/rustdoc/generic-impl.rs b/src/test/rustdoc/generic-impl.rs
index c6beed70a..6f68b1574 100644
--- a/src/test/rustdoc/generic-impl.rs
+++ b/src/test/rustdoc/generic-impl.rs
@@ -5,7 +5,7 @@ use std::fmt;
// @!has foo/struct.Bar.html '//*[@id="impl-ToString-for-Bar"]' ''
pub struct Bar;
-// @has foo/struct.Foo.html '//*[@id="impl-ToString-for-Foo"]//h3[@class="code-header in-band"]' 'impl<T> ToString for T'
+// @has foo/struct.Foo.html '//*[@id="impl-ToString-for-Foo"]//h3[@class="code-header"]' 'impl<T> ToString for T'
pub struct Foo;
// @has foo/struct.Foo.html '//*[@class="sidebar-elems"]//section//a[@href="#impl-ToString-for-Foo"]' 'ToString'
diff --git a/src/test/rustdoc/glob-shadowing-const.rs b/src/test/rustdoc/glob-shadowing-const.rs
new file mode 100644
index 000000000..5b786cf53
--- /dev/null
+++ b/src/test/rustdoc/glob-shadowing-const.rs
@@ -0,0 +1,20 @@
+// https://github.com/rust-lang/rust/pull/83872#issuecomment-820101008
+#![crate_name="foo"]
+
+mod sub4 {
+ /// 0
+ pub const X: usize = 0;
+ pub mod inner {
+ pub use super::*;
+ /// 1
+ pub const X: usize = 1;
+ }
+}
+
+#[doc(inline)]
+pub use sub4::inner::*;
+
+// @has 'foo/index.html'
+// @has - '//div[@class="item-right docblock-short"]' '1'
+// @!has - '//div[@class="item-right docblock-short"]' '0'
+fn main() { assert_eq!(X, 1); }
diff --git a/src/test/rustdoc/glob-shadowing.rs b/src/test/rustdoc/glob-shadowing.rs
new file mode 100644
index 000000000..66a31c42b
--- /dev/null
+++ b/src/test/rustdoc/glob-shadowing.rs
@@ -0,0 +1,86 @@
+// @has 'glob_shadowing/index.html'
+// @count - '//div[@class="item-left module-item"]' 6
+// @!has - '//div[@class="item-right docblock-short"]' 'sub1::describe'
+// @has - '//div[@class="item-right docblock-short"]' 'sub2::describe'
+
+// @!has - '//div[@class="item-right docblock-short"]' 'sub1::describe2'
+
+// @!has - '//div[@class="item-right docblock-short"]' 'sub1::prelude'
+// @has - '//div[@class="item-right docblock-short"]' 'mod::prelude'
+
+// @has - '//div[@class="item-right docblock-short"]' 'sub1::Foo (struct)'
+// @has - '//div[@class="item-right docblock-short"]' 'mod::Foo (function)'
+
+// @has - '//div[@class="item-right docblock-short"]' 'sub4::inner::X'
+
+// @has 'glob_shadowing/fn.describe.html'
+// @has - '//div[@class="docblock"]' 'sub2::describe'
+
+mod sub1 {
+ // this should be shadowed by sub2::describe
+ /// sub1::describe
+ pub fn describe() -> &'static str {
+ "sub1::describe"
+ }
+
+ // this should be shadowed by mod::prelude
+ /// sub1::prelude
+ pub mod prelude {
+ }
+
+ // this should *not* be shadowed, because sub1::Foo and mod::Foo are in different namespaces
+ /// sub1::Foo (struct)
+ pub struct Foo;
+
+ // this should be shadowed,
+ // because both sub1::describe2 and sub3::describe2 are from glob reexport
+ /// sub1::describe2
+ pub fn describe2() -> &'static str {
+ "sub1::describe2"
+ }
+}
+
+mod sub2 {
+ /// sub2::describe
+ pub fn describe() -> &'static str {
+ "sub2::describe"
+ }
+}
+
+mod sub3 {
+ // this should be shadowed
+ // because both sub1::describe2 and sub3::describe2 are from glob reexport
+ /// sub3::describe2
+ pub fn describe2() -> &'static str {
+ "sub3::describe2"
+ }
+}
+
+mod sub4 {
+ // this should be shadowed by sub4::inner::X
+ /// sub4::X
+ pub const X: usize = 0;
+ pub mod inner {
+ pub use super::*;
+ /// sub4::inner::X
+ pub const X: usize = 1;
+ }
+}
+
+/// mod::Foo (function)
+pub fn Foo() {}
+
+#[doc(inline)]
+pub use sub2::describe;
+
+#[doc(inline)]
+pub use sub1::*;
+
+#[doc(inline)]
+pub use sub3::*;
+
+#[doc(inline)]
+pub use sub4::inner::*;
+
+/// mod::prelude
+pub mod prelude {}
diff --git a/src/test/rustdoc/hidden-impls.rs b/src/test/rustdoc/hidden-impls.rs
index 8f33a6604..26e2e0e06 100644
--- a/src/test/rustdoc/hidden-impls.rs
+++ b/src/test/rustdoc/hidden-impls.rs
@@ -11,7 +11,7 @@ pub mod __hidden {
}
// @has foo/trait.Clone.html
-// @!has - 'Foo'
+// @!hasraw - 'Foo'
// @has implementors/core/clone/trait.Clone.js
-// @!has - 'Foo'
+// @!hasraw - 'Foo'
pub use std::clone::Clone;
diff --git a/src/test/rustdoc/hidden-line.rs b/src/test/rustdoc/hidden-line.rs
index f2f6173d2..00a05a7c2 100644
--- a/src/test/rustdoc/hidden-line.rs
+++ b/src/test/rustdoc/hidden-line.rs
@@ -15,5 +15,5 @@
/// ```
pub fn foo() {}
-// @!has hidden_line/fn.foo.html invisible
+// @!hasraw hidden_line/fn.foo.html invisible
// @matches - //pre "#\[derive\(PartialEq\)\] // Bar"
diff --git a/src/test/rustdoc/hidden-methods.rs b/src/test/rustdoc/hidden-methods.rs
index 27181d489..543d8f768 100644
--- a/src/test/rustdoc/hidden-methods.rs
+++ b/src/test/rustdoc/hidden-methods.rs
@@ -17,13 +17,13 @@ pub mod hidden {
}
// @has foo/struct.Foo.html
-// @!has - 'Methods'
+// @!hasraw - 'Methods'
// @!has - '//code' 'impl Foo'
-// @!has - 'this_should_be_hidden'
+// @!hasraw - 'this_should_be_hidden'
pub use hidden::Foo;
// @has foo/struct.Bar.html
-// @!has - 'Methods'
+// @!hasraw - 'Methods'
// @!has - '//code' 'impl Bar'
-// @!has - 'this_should_be_hidden'
+// @!hasraw - 'this_should_be_hidden'
pub use hidden::Bar;
diff --git a/src/test/rustdoc/hide-unstable-trait.rs b/src/test/rustdoc/hide-unstable-trait.rs
index c30d6ed7b..0bf7cabc4 100644
--- a/src/test/rustdoc/hide-unstable-trait.rs
+++ b/src/test/rustdoc/hide-unstable-trait.rs
@@ -5,7 +5,7 @@
extern crate unstable_trait;
-// @has foo/struct.Foo.html 'bar'
-// @has foo/struct.Foo.html 'bar2'
+// @hasraw foo/struct.Foo.html 'bar'
+// @hasraw foo/struct.Foo.html 'bar2'
#[doc(inline)]
pub use unstable_trait::Foo;
diff --git a/src/test/rustdoc/higher-ranked-trait-bounds.rs b/src/test/rustdoc/higher-ranked-trait-bounds.rs
index b75b8de52..3493ae6d2 100644
--- a/src/test/rustdoc/higher-ranked-trait-bounds.rs
+++ b/src/test/rustdoc/higher-ranked-trait-bounds.rs
@@ -4,7 +4,7 @@
pub trait Trait<'x> {}
// @has foo/fn.test1.html
-// @has - '//pre' "pub fn test1<T>() where for<'a> &'a T: Iterator,"
+// @has - '//pre' "pub fn test1<T>()where for<'a> &'a T: Iterator,"
pub fn test1<T>()
where
for<'a> &'a T: Iterator,
@@ -12,7 +12,7 @@ where
}
// @has foo/fn.test2.html
-// @has - '//pre' "pub fn test2<T>() where for<'a, 'b> &'a T: Trait<'b>,"
+// @has - '//pre' "pub fn test2<T>()where for<'a, 'b> &'a T: Trait<'b>,"
pub fn test2<T>()
where
for<'a, 'b> &'a T: Trait<'b>,
@@ -20,7 +20,7 @@ where
}
// @has foo/fn.test3.html
-// @has - '//pre' "pub fn test3<F>() where F: for<'a, 'b> Fn(&'a u8, &'b u8),"
+// @has - '//pre' "pub fn test3<F>()where F: for<'a, 'b> Fn(&'a u8, &'b u8),"
pub fn test3<F>()
where
F: for<'a, 'b> Fn(&'a u8, &'b u8),
@@ -38,7 +38,7 @@ pub struct Foo<'a> {
// @has - '//span[@id="structfield.some_trait"]' "some_trait: &'a dyn for<'b> Trait<'b>"
impl<'a> Foo<'a> {
- // @has - '//h4[@class="code-header"]' "pub fn bar<T>() where T: Trait<'a>,"
+ // @has - '//h4[@class="code-header"]' "pub fn bar<T>()where T: Trait<'a>,"
pub fn bar<T>()
where
T: Trait<'a>,
@@ -49,7 +49,7 @@ impl<'a> Foo<'a> {
// @has foo/trait.B.html
pub trait B<'x> {}
-// @has - '//h3[@class="code-header in-band"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>"
+// @has - '//h3[@class="code-header"]' "impl<'a> B<'a> for dyn for<'b> Trait<'b>"
impl<'a> B<'a> for dyn for<'b> Trait<'b> {}
// @has foo/struct.Bar.html
diff --git a/src/test/rustdoc/impl-disambiguation.rs b/src/test/rustdoc/impl-disambiguation.rs
index d1d39ccff..9e74ede8f 100644
--- a/src/test/rustdoc/impl-disambiguation.rs
+++ b/src/test/rustdoc/impl-disambiguation.rs
@@ -4,13 +4,13 @@ pub trait Foo {}
pub struct Bar<T> { field: T }
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
// "impl Foo for Bar<u8>"
impl Foo for Bar<u8> {}
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
// "impl Foo for Bar<u16>"
impl Foo for Bar<u16> {}
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
// "impl<'a> Foo for &'a Bar<u8>"
impl<'a> Foo for &'a Bar<u8> {}
@@ -22,9 +22,9 @@ pub mod mod2 {
pub enum Baz {}
}
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
// "impl Foo for foo::mod1::Baz"
impl Foo for mod1::Baz {}
-// @has foo/trait.Foo.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
+// @has foo/trait.Foo.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
// "impl<'a> Foo for &'a foo::mod2::Baz"
impl<'a> Foo for &'a mod2::Baz {}
diff --git a/src/test/rustdoc/impl-parts-crosscrate.rs b/src/test/rustdoc/impl-parts-crosscrate.rs
index 6c5e79d5a..34733f1f8 100644
--- a/src/test/rustdoc/impl-parts-crosscrate.rs
+++ b/src/test/rustdoc/impl-parts-crosscrate.rs
@@ -12,9 +12,9 @@ pub struct Bar<T> { t: T }
// full impl string. Instead, just make sure something from each part
// is mentioned.
-// @has implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
-// @has - Send
-// @has - !AnAutoTrait
-// @has - Copy
+// @hasraw implementors/rustdoc_impl_parts_crosscrate/trait.AnAutoTrait.js Bar
+// @hasraw - Send
+// @hasraw - !AnAutoTrait
+// @hasraw - Copy
impl<T: Send> !rustdoc_impl_parts_crosscrate::AnAutoTrait for Bar<T>
where T: Copy {}
diff --git a/src/test/rustdoc/impl-parts.rs b/src/test/rustdoc/impl-parts.rs
index 249158c1a..7b931727e 100644
--- a/src/test/rustdoc/impl-parts.rs
+++ b/src/test/rustdoc/impl-parts.rs
@@ -5,8 +5,8 @@ pub auto trait AnAutoTrait {}
pub struct Foo<T> { field: T }
-// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
-// @has impl_parts/trait.AnAutoTrait.html '//*[@class="item-list"]//h3[@class="code-header in-band"]' \
-// "impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync,"
+// @has impl_parts/struct.Foo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
+// @has impl_parts/trait.AnAutoTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
+// "impl<T: Clone> !AnAutoTrait for Foo<T>where T: Sync,"
impl<T: Clone> !AnAutoTrait for Foo<T> where T: Sync {}
diff --git a/src/test/rustdoc/impl-trait-alias.rs b/src/test/rustdoc/impl-trait-alias.rs
index 54c3f856d..4f681c78e 100644
--- a/src/test/rustdoc/impl-trait-alias.rs
+++ b/src/test/rustdoc/impl-trait-alias.rs
@@ -3,11 +3,11 @@
trait MyTrait {}
impl MyTrait for i32 {}
-// @has impl_trait_alias/type.Foo.html 'Foo'
+// @hasraw impl_trait_alias/type.Foo.html 'Foo'
/// debug type
pub type Foo = impl MyTrait;
-// @has impl_trait_alias/fn.foo.html 'foo'
+// @hasraw impl_trait_alias/fn.foo.html 'foo'
/// debug function
pub fn foo() -> Foo {
1
diff --git a/src/test/rustdoc/impossible-default.rs b/src/test/rustdoc/impossible-default.rs
new file mode 100644
index 000000000..24d6e3bda
--- /dev/null
+++ b/src/test/rustdoc/impossible-default.rs
@@ -0,0 +1,20 @@
+#![crate_name = "foo"]
+
+// Check that default trait items that are impossible to satisfy
+
+pub trait Foo {
+ fn needs_sized(&self)
+ where
+ Self: Sized,
+ {}
+
+ fn no_needs_sized(&self) {}
+}
+
+// @!has foo/struct.Bar.html '//*[@id="method.needs_sized"]//h4[@class="code-header"]' \
+// "fn needs_sized"
+// @has foo/struct.Bar.html '//*[@id="method.no_needs_sized"]//h4[@class="code-header"]' \
+// "fn no_needs_sized"
+pub struct Bar([u8]);
+
+impl Foo for Bar {}
diff --git a/src/test/rustdoc/index-page.rs b/src/test/rustdoc/index-page.rs
index be668a127..0c947ea2e 100644
--- a/src/test/rustdoc/index-page.rs
+++ b/src/test/rustdoc/index-page.rs
@@ -5,7 +5,7 @@
#![crate_name = "foo"]
// @has foo/../index.html
-// @has - '//span[@class="in-band"]' 'List of all crates'
-// @has - '//ul[@class="crate mod"]//a[@href="foo/index.html"]' 'foo'
-// @has - '//ul[@class="crate mod"]//a[@href="all_item_types/index.html"]' 'all_item_types'
+// @has - '//h1[@class="fqn"]' 'List of all crates'
+// @has - '//ul[@class="all-items"]//a[@href="foo/index.html"]' 'foo'
+// @has - '//ul[@class="all-items"]//a[@href="all_item_types/index.html"]' 'all_item_types'
pub struct Foo;
diff --git a/src/test/rustdoc/infinite-redirection.rs b/src/test/rustdoc/infinite-redirection.rs
index 96a43323c..f037a8e1a 100644
--- a/src/test/rustdoc/infinite-redirection.rs
+++ b/src/test/rustdoc/infinite-redirection.rs
@@ -7,7 +7,7 @@
// @has 'foo/builders/struct.ActionRowBuilder.html'
// @has - '//*[@id="synthetic-implementations"]' 'Auto Trait Implementations'
-// And that the link in the module is targetting it.
+// And that the link in the module is targeting it.
// @has 'foo/builders/index.html'
// @has - '//a[@href="struct.ActionRowBuilder.html"]' 'ActionRowBuilder'
diff --git a/src/test/rustdoc/inline_cross/add-docs.rs b/src/test/rustdoc/inline_cross/add-docs.rs
index 8f0c4e5e6..a1124d209 100644
--- a/src/test/rustdoc/inline_cross/add-docs.rs
+++ b/src/test/rustdoc/inline_cross/add-docs.rs
@@ -4,6 +4,6 @@ extern crate inner;
// @has add_docs/struct.MyStruct.html
-// @has add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition"
+// @hasraw add_docs/struct.MyStruct.html "Doc comment from ‘pub use’, Doc comment from definition"
/// Doc comment from 'pub use',
pub use inner::MyStruct;
diff --git a/src/test/rustdoc/inline_cross/assoc-items.rs b/src/test/rustdoc/inline_cross/assoc-items.rs
index 231805a52..811827a17 100644
--- a/src/test/rustdoc/inline_cross/assoc-items.rs
+++ b/src/test/rustdoc/inline_cross/assoc-items.rs
@@ -7,10 +7,10 @@
extern crate assoc_items;
// @has foo/struct.MyStruct.html
-// @!has - 'PrivateConst'
+// @!hasraw - 'PrivateConst'
// @has - '//*[@id="associatedconstant.PublicConst"]' 'pub const PublicConst: u8'
// @has - '//*[@class="docblock"]' 'docs for PublicConst'
-// @!has - 'private_method'
+// @!hasraw - 'private_method'
// @has - '//*[@id="method.public_method"]' 'pub fn public_method()'
// @has - '//*[@class="docblock"]' 'docs for public_method'
// @has - '//*[@id="associatedconstant.ConstNoDefault"]' 'const ConstNoDefault: i16'
diff --git a/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html
new file mode 100644
index 000000000..8934bc1ee
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out0.html
@@ -0,0 +1 @@
+<h4 class="code-header">type <a href="#associatedtype.Out0" class="associatedtype">Out0</a>: <a class="trait" href="../assoc_item_trait_bounds/trait.Support.html" title="trait assoc_item_trait_bounds::Support">Support</a>&lt;Item = <a class="primitive" href="{{channel}}/std/primitive.unit.html">()</a>&gt;</h4> \ No newline at end of file
diff --git a/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html
new file mode 100644
index 000000000..bf330670e
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out2.html
@@ -0,0 +1 @@
+<h4 class="code-header">type <a href="#associatedtype.Out2" class="associatedtype">Out2</a>&lt;T&gt;: <a class="trait" href="../assoc_item_trait_bounds/trait.Support.html" title="trait assoc_item_trait_bounds::Support">Support</a>&lt;Item = T&gt;</h4> \ No newline at end of file
diff --git a/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html
new file mode 100644
index 000000000..69d84e1b2
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.out9.html
@@ -0,0 +1 @@
+<h4 class="code-header">type <a href="#associatedtype.Out9" class="associatedtype">Out9</a>: <a class="trait" href="{{channel}}/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a>) -&gt; <a class="primitive" href="{{channel}}/std/primitive.bool.html">bool</a> + <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></h4> \ No newline at end of file
diff --git a/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.rs b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.rs
new file mode 100644
index 000000000..5f4712aab
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds.rs
@@ -0,0 +1,40 @@
+// Regression test for issues #77763, #84579 and #102142.
+#![crate_name = "main"]
+
+// aux-build:assoc_item_trait_bounds.rs
+// build-aux-docs
+// ignore-cross-compile
+extern crate assoc_item_trait_bounds as aux;
+
+// @has main/trait.Main.html
+// @has - '//*[@id="associatedtype.Out0"]' 'type Out0: Support<Item = ()>'
+// @has - '//*[@id="associatedtype.Out1"]' 'type Out1: Support<Item = Self::Item>'
+// @has - '//*[@id="associatedtype.Out2"]' 'type Out2<T>: Support<Item = T>'
+// @has - '//*[@id="associatedtype.Out3"]' 'type Out3: Support<Produce<()> = bool>'
+// @has - '//*[@id="associatedtype.Out4"]' 'type Out4<T>: Support<Produce<T> = T>'
+// @has - '//*[@id="associatedtype.Out5"]' "type Out5: Support<Output<'static> = &'static ()>"
+// @has - '//*[@id="associatedtype.Out6"]' "type Out6: for<'a> Support<Output<'a> = &'a ()>"
+// @has - '//*[@id="associatedtype.Out7"]' "type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated"
+// @has - '//*[@id="associatedtype.Out8"]' "type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>"
+// @has - '//*[@id="associatedtype.Out9"]' "type Out9: FnMut(i32) -> bool + Clone"
+// @has - '//*[@id="associatedtype.Out10"]' "type Out10<'q>: Support<Output<'q> = ()>"
+// @has - '//*[@id="associatedtype.Out11"]' "type Out11: for<'r, 's> Helper<A<'s> = &'s (), B<'r> = ()>"
+// @has - '//*[@id="associatedtype.Out12"]' "type Out12: for<'w> Helper<B<'w> = Cow<'w, str>, A<'w> = bool>"
+// @has - '//*[@id="associatedtype.Out13"]' "type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>"
+// @has - '//*[@id="associatedtype.Out14"]' "type Out14<P: Copy + Eq, Q: ?Sized>"
+//
+// Snapshots:
+// Check that we don't render any where-clauses for the following associated types since
+// all corresponding projection equality predicates should have already been re-sugared
+// to associated type bindings:
+//
+// @snapshot out0 - '//*[@id="associatedtype.Out0"]/*[@class="code-header"]'
+// @snapshot out2 - '//*[@id="associatedtype.Out2"]/*[@class="code-header"]'
+// @snapshot out9 - '//*[@id="associatedtype.Out9"]/*[@class="code-header"]'
+//
+// @has - '//*[@id="tymethod.make"]' \
+// "fn make<F>(F, impl FnMut(&str) -> bool)\
+// where \
+// F: FnOnce(u32) -> String, \
+// Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>"
+pub use aux::Main;
diff --git a/src/test/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs b/src/test/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
new file mode 100644
index 000000000..d326e61da
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds.rs
@@ -0,0 +1,46 @@
+pub trait Main {
+ type Item;
+
+ type Out0: Support<Item = ()>;
+ type Out1: Support<Item = Self::Item>;
+ type Out2<T>: Support<Item = T>;
+ type Out3: Support<Produce<()> = bool>;
+ type Out4<T>: Support<Produce<T> = T>;
+ type Out5: Support<Output<'static> = &'static ()>;
+ type Out6: for<'a> Support<Output<'a> = &'a ()>;
+ type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated;
+ type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>;
+ type Out9: FnMut(i32) -> bool + Clone;
+ type Out10<'q>: Support<Output<'q> = ()>;
+ type Out11: for<'r, 's> Helper<A<'s> = &'s (), B<'r> = ()>;
+ type Out12: for<'w> Helper<B<'w> = std::borrow::Cow<'w, str>, A<'w> = bool>;
+ type Out13: for<'fst, 'snd> Aid<'snd, Result<'fst> = &'fst mut str>;
+ type Out14<P: Copy + Eq, Q: ?Sized>;
+
+ fn make<F>(_: F, _: impl FnMut(&str) -> bool)
+ where
+ F: FnOnce(u32) -> String,
+ Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>;
+}
+
+pub trait Support {
+ type Item;
+ type Output<'a>;
+ type Produce<T>;
+}
+
+pub trait Protocol<K> {
+ type Q0;
+ type Q1;
+}
+
+pub trait Unrelated {}
+
+pub trait Helper {
+ type A<'q>;
+ type B<'q>;
+}
+
+pub trait Aid<'src> {
+ type Result<'inter>;
+}
diff --git a/src/test/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs b/src/test/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs
index 913ba8f2a..19433c968 100644
--- a/src/test/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs
+++ b/src/test/rustdoc/inline_cross/auxiliary/impl_trait_aux.rs
@@ -13,6 +13,19 @@ pub fn func3(_x: impl Iterator<Item = impl Iterator<Item = u8>> + Clone) {}
pub fn func4<T: Iterator<Item = impl Clone>>(_x: T) {}
+pub fn func5(
+ _f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other<T<'r> = ()>,
+ _a: impl for<'alpha, 'beta> Auxiliary<'alpha, Item<'beta> = fn(&'beta ())>,
+) {}
+
+pub trait Other {
+ type T<'dependency>;
+}
+
+pub trait Auxiliary<'arena> {
+ type Item<'input>;
+}
+
pub async fn async_fn() {}
pub struct Foo;
diff --git a/src/test/rustdoc/inline_cross/auxiliary/issue-24183.rs b/src/test/rustdoc/inline_cross/auxiliary/issue-24183.rs
new file mode 100644
index 000000000..e7a13acc6
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/auxiliary/issue-24183.rs
@@ -0,0 +1,14 @@
+#![crate_type = "lib"]
+
+pub trait U/*: ?Sized */ {
+ fn modified(self) -> Self
+ where
+ Self: Sized
+ {
+ self
+ }
+
+ fn touch(&self)/* where Self: ?Sized */{}
+}
+
+pub trait S: Sized {}
diff --git a/src/test/rustdoc/inline_cross/hidden-use.rs b/src/test/rustdoc/inline_cross/hidden-use.rs
index 97715737f..28a4f4bac 100644
--- a/src/test/rustdoc/inline_cross/hidden-use.rs
+++ b/src/test/rustdoc/inline_cross/hidden-use.rs
@@ -5,8 +5,8 @@
extern crate rustdoc_hidden;
// @has hidden_use/index.html
-// @!has - 'rustdoc_hidden'
-// @!has - 'Bar'
+// @!hasraw - 'rustdoc_hidden'
+// @!hasraw - 'Bar'
// @!has hidden_use/struct.Bar.html
#[doc(hidden)]
pub use rustdoc_hidden::Bar;
diff --git a/src/test/rustdoc/inline_cross/impl_trait.rs b/src/test/rustdoc/inline_cross/impl_trait.rs
index ef615472b..6c1cf8252 100644
--- a/src/test/rustdoc/inline_cross/impl_trait.rs
+++ b/src/test/rustdoc/inline_cross/impl_trait.rs
@@ -26,6 +26,13 @@ pub use impl_trait_aux::func3;
// @has - '//pre[@class="rust fn"]' "T: Iterator<Item = impl Clone>,"
pub use impl_trait_aux::func4;
+// @has impl_trait/fn.func5.html
+// @has - '//pre[@class="rust fn"]' "func5("
+// @has - '//pre[@class="rust fn"]' "_f: impl for<'any> Fn(&'any str, &'any str) -> bool + for<'r> Other<T<'r> = ()>,"
+// @has - '//pre[@class="rust fn"]' "_a: impl for<'alpha, 'beta> Auxiliary<'alpha, Item<'beta> = fn(&'beta ())>"
+// @!has - '//pre[@class="rust fn"]' 'where'
+pub use impl_trait_aux::func5;
+
// @has impl_trait/fn.async_fn.html
// @has - '//pre[@class="rust fn"]' "pub async fn async_fn()"
pub use impl_trait_aux::async_fn;
diff --git a/src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html b/src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html
new file mode 100644
index 000000000..6955a9614
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html
@@ -0,0 +1 @@
+<h4 class="code-header">fn <a href="#method.touch" class="fnname">touch</a>(&amp;self)</h4> \ No newline at end of file
diff --git a/src/test/rustdoc/inline_cross/issue-24183.rs b/src/test/rustdoc/inline_cross/issue-24183.rs
new file mode 100644
index 000000000..d11b6955f
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/issue-24183.rs
@@ -0,0 +1,18 @@
+#![crate_type = "lib"]
+#![crate_name = "usr"]
+
+// aux-crate:issue_24183=issue-24183.rs
+// edition: 2021
+
+// @has usr/trait.U.html
+// @has - '//*[@class="item-decl"]' "pub trait U {"
+// @has - '//*[@id="method.modified"]' \
+// "fn modified(self) -> Self\
+// where \
+// Self: Sized"
+// @snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]'
+pub use issue_24183::U;
+
+// @has usr/trait.S.html
+// @has - '//*[@class="item-decl"]' 'pub trait S: Sized {'
+pub use issue_24183::S;
diff --git a/src/test/rustdoc/inline_cross/issue-31948-1.rs b/src/test/rustdoc/inline_cross/issue-31948-1.rs
index be8585dd1..6e89167b3 100644
--- a/src/test/rustdoc/inline_cross/issue-31948-1.rs
+++ b/src/test/rustdoc/inline_cross/issue-31948-1.rs
@@ -5,22 +5,22 @@
extern crate rustdoc_nonreachable_impls;
// @has issue_31948_1/struct.Wobble.html
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bark for'
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Woof for'
-// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Bar for'
-// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Qux for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for'
pub use rustdoc_nonreachable_impls::hidden::Wobble;
// @has issue_31948_1/trait.Bark.html
-// @has - '//h3[@class="code-header in-band"]' 'for Foo'
-// @has - '//h3[@class="code-header in-band"]' 'for Wobble'
-// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @has - '//h3[@class="code-header"]' 'for Wobble'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
pub use rustdoc_nonreachable_impls::Bark;
// @has issue_31948_1/trait.Woof.html
-// @has - '//h3[@class="code-header in-band"]' 'for Foo'
-// @has - '//h3[@class="code-header in-band"]' 'for Wobble'
-// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @has - '//h3[@class="code-header"]' 'for Wobble'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
pub use rustdoc_nonreachable_impls::Woof;
// @!has issue_31948_1/trait.Bar.html
diff --git a/src/test/rustdoc/inline_cross/issue-31948-2.rs b/src/test/rustdoc/inline_cross/issue-31948-2.rs
index 7aa994f19..141e07656 100644
--- a/src/test/rustdoc/inline_cross/issue-31948-2.rs
+++ b/src/test/rustdoc/inline_cross/issue-31948-2.rs
@@ -5,15 +5,15 @@
extern crate rustdoc_nonreachable_impls;
// @has issue_31948_2/struct.Wobble.html
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Qux for'
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bark for'
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Woof for'
-// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Bar for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Qux for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Bar for'
pub use rustdoc_nonreachable_impls::hidden::Wobble;
// @has issue_31948_2/trait.Qux.html
-// @has - '//h3[@class="code-header in-band"]' 'for Foo'
-// @has - '//h3[@class="code-header in-band"]' 'for Wobble'
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @has - '//h3[@class="code-header"]' 'for Wobble'
pub use rustdoc_nonreachable_impls::hidden::Qux;
// @!has issue_31948_2/trait.Bar.html
diff --git a/src/test/rustdoc/inline_cross/issue-31948.rs b/src/test/rustdoc/inline_cross/issue-31948.rs
index 7bf4110d3..96fc6ca47 100644
--- a/src/test/rustdoc/inline_cross/issue-31948.rs
+++ b/src/test/rustdoc/inline_cross/issue-31948.rs
@@ -5,22 +5,22 @@
extern crate rustdoc_nonreachable_impls;
// @has issue_31948/struct.Foo.html
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bark for'
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Woof for'
-// @!has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'Bar for'
-// @!has - '//*[@class="impl"]//h3[@class="code-header in-band"]' 'Qux for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bark for'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Woof for'
+// @!has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'Bar for'
+// @!has - '//*[@class="impl"]//h3[@class="code-header"]' 'Qux for'
pub use rustdoc_nonreachable_impls::Foo;
// @has issue_31948/trait.Bark.html
-// @has - '//h3[@class="code-header in-band"]' 'for Foo'
-// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
-// @!has - '//h3[@class="code-header in-band"]' 'for Wobble'
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
+// @!has - '//h3[@class="code-header"]' 'for Wobble'
pub use rustdoc_nonreachable_impls::Bark;
// @has issue_31948/trait.Woof.html
-// @has - '//h3[@class="code-header in-band"]' 'for Foo'
-// @!has - '//h3[@class="code-header in-band"]' 'for Wibble'
-// @!has - '//h3[@class="code-header in-band"]' 'for Wobble'
+// @has - '//h3[@class="code-header"]' 'for Foo'
+// @!has - '//h3[@class="code-header"]' 'for Wibble'
+// @!has - '//h3[@class="code-header"]' 'for Wobble'
pub use rustdoc_nonreachable_impls::Woof;
// @!has issue_31948/trait.Bar.html
diff --git a/src/test/rustdoc/inline_cross/issue-32881.rs b/src/test/rustdoc/inline_cross/issue-32881.rs
index 8052339a8..183fd15ab 100644
--- a/src/test/rustdoc/inline_cross/issue-32881.rs
+++ b/src/test/rustdoc/inline_cross/issue-32881.rs
@@ -5,7 +5,7 @@
extern crate rustdoc_trait_object_impl;
// @has issue_32881/trait.Bar.html
-// @has - '//h3[@class="code-header in-band"]' "impl<'a> dyn Bar"
-// @has - '//h3[@class="code-header in-band"]' "impl<'a> Debug for dyn Bar"
+// @has - '//h3[@class="code-header"]' "impl<'a> dyn Bar"
+// @has - '//h3[@class="code-header"]' "impl<'a> Debug for dyn Bar"
pub use rustdoc_trait_object_impl::Bar;
diff --git a/src/test/rustdoc/inline_cross/issue-33113.rs b/src/test/rustdoc/inline_cross/issue-33113.rs
index c60859bbc..d954707fa 100644
--- a/src/test/rustdoc/inline_cross/issue-33113.rs
+++ b/src/test/rustdoc/inline_cross/issue-33113.rs
@@ -5,6 +5,6 @@
extern crate bar;
// @has issue_33113/trait.Bar.html
-// @has - '//h3[@class="code-header in-band"]' "for &'a char"
-// @has - '//h3[@class="code-header in-band"]' "for Foo"
+// @has - '//h3[@class="code-header"]' "for &'a char"
+// @has - '//h3[@class="code-header"]' "for Foo"
pub use bar::Bar;
diff --git a/src/test/rustdoc/inline_cross/proc_macro.rs b/src/test/rustdoc/inline_cross/proc_macro.rs
index 532a295c0..a46550865 100644
--- a/src/test/rustdoc/inline_cross/proc_macro.rs
+++ b/src/test/rustdoc/inline_cross/proc_macro.rs
@@ -12,25 +12,25 @@ extern crate some_macros;
// @has proc_macro/derive.SomeDerive.html
// @has proc_macro/macro.some_proc_macro.html
-// @has - 'a proc-macro that swallows its input and does nothing.'
+// @hasraw - 'a proc-macro that swallows its input and does nothing.'
pub use some_macros::some_proc_macro;
// @has proc_macro/macro.reexported_macro.html
-// @has - 'Doc comment from the original crate'
+// @hasraw - 'Doc comment from the original crate'
pub use some_macros::reexported_macro;
// @has proc_macro/attr.some_proc_attr.html
-// @has - 'a proc-macro attribute that passes its item through verbatim.'
+// @hasraw - 'a proc-macro attribute that passes its item through verbatim.'
pub use some_macros::some_proc_attr;
// @has proc_macro/derive.SomeDerive.html
-// @has - 'a derive attribute that adds nothing to its input.'
+// @hasraw - 'a derive attribute that adds nothing to its input.'
pub use some_macros::SomeDerive;
// @has proc_macro/attr.first_attr.html
-// @has - 'Generated doc comment'
+// @hasraw - 'Generated doc comment'
pub use some_macros::first_attr;
// @has proc_macro/attr.second_attr.html
-// @has - 'Generated doc comment'
+// @hasraw - 'Generated doc comment'
pub use some_macros::second_attr;
diff --git a/src/test/rustdoc/inline_cross/trait-vis.rs b/src/test/rustdoc/inline_cross/trait-vis.rs
index 363c52a33..b646babac 100644
--- a/src/test/rustdoc/inline_cross/trait-vis.rs
+++ b/src/test/rustdoc/inline_cross/trait-vis.rs
@@ -3,5 +3,5 @@
extern crate inner;
// @has trait_vis/struct.SomeStruct.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Clone for SomeStruct'
+// @has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct'
pub use inner::SomeStruct;
diff --git a/src/test/rustdoc/inline_local/glob-extern-document-private-items.rs b/src/test/rustdoc/inline_local/glob-extern-document-private-items.rs
index a2f0d65ef..8e1089d60 100644
--- a/src/test/rustdoc/inline_local/glob-extern-document-private-items.rs
+++ b/src/test/rustdoc/inline_local/glob-extern-document-private-items.rs
@@ -12,14 +12,14 @@ mod mod1 {
pub use mod1::*;
// @has foo/index.html
-// @has - "mod1"
-// @has - "public_fn"
-// @!has - "private_fn"
+// @hasraw - "mod1"
+// @hasraw - "public_fn"
+// @!hasraw - "private_fn"
// @has foo/fn.public_fn.html
// @!has foo/fn.private_fn.html
// @has foo/mod1/index.html
-// @has - "public_fn"
-// @has - "private_fn"
+// @hasraw - "public_fn"
+// @hasraw - "private_fn"
// @has foo/mod1/fn.public_fn.html
// @has foo/mod1/fn.private_fn.html
diff --git a/src/test/rustdoc/inline_local/glob-extern.rs b/src/test/rustdoc/inline_local/glob-extern.rs
index 686e55de3..c592a4db1 100644
--- a/src/test/rustdoc/inline_local/glob-extern.rs
+++ b/src/test/rustdoc/inline_local/glob-extern.rs
@@ -10,9 +10,9 @@ mod mod1 {
pub use mod1::*;
// @has foo/index.html
-// @!has - "mod1"
-// @has - "public_fn"
-// @!has - "private_fn"
+// @!hasraw - "mod1"
+// @hasraw - "public_fn"
+// @!hasraw - "private_fn"
// @has foo/fn.public_fn.html
// @!has foo/fn.private_fn.html
diff --git a/src/test/rustdoc/inline_local/glob-private-document-private-items.rs b/src/test/rustdoc/inline_local/glob-private-document-private-items.rs
index f16d21ecd..d8cbd4234 100644
--- a/src/test/rustdoc/inline_local/glob-private-document-private-items.rs
+++ b/src/test/rustdoc/inline_local/glob-private-document-private-items.rs
@@ -15,31 +15,31 @@ mod mod1 {
pub use mod1::*;
// @has foo/index.html
-// @has - "mod1"
-// @has - "Mod1Public"
-// @!has - "Mod1Private"
-// @!has - "mod2"
-// @has - "Mod2Public"
-// @!has - "Mod2Private"
+// @hasraw - "mod1"
+// @hasraw - "Mod1Public"
+// @!hasraw - "Mod1Private"
+// @!hasraw - "mod2"
+// @hasraw - "Mod2Public"
+// @!hasraw - "Mod2Private"
// @has foo/struct.Mod1Public.html
// @!has foo/struct.Mod1Private.html
// @has foo/struct.Mod2Public.html
// @!has foo/struct.Mod2Private.html
// @has foo/mod1/index.html
-// @has - "mod2"
-// @has - "Mod1Public"
-// @has - "Mod1Private"
-// @!has - "Mod2Public"
-// @!has - "Mod2Private"
+// @hasraw - "mod2"
+// @hasraw - "Mod1Public"
+// @hasraw - "Mod1Private"
+// @!hasraw - "Mod2Public"
+// @!hasraw - "Mod2Private"
// @has foo/mod1/struct.Mod1Public.html
// @has foo/mod1/struct.Mod1Private.html
// @!has foo/mod1/struct.Mod2Public.html
// @!has foo/mod1/struct.Mod2Private.html
// @has foo/mod1/mod2/index.html
-// @has - "Mod2Public"
-// @has - "Mod2Private"
+// @hasraw - "Mod2Public"
+// @hasraw - "Mod2Private"
// @has foo/mod1/mod2/struct.Mod2Public.html
// @has foo/mod1/mod2/struct.Mod2Private.html
diff --git a/src/test/rustdoc/inline_local/glob-private.rs b/src/test/rustdoc/inline_local/glob-private.rs
index d294d590e..303f1d610 100644
--- a/src/test/rustdoc/inline_local/glob-private.rs
+++ b/src/test/rustdoc/inline_local/glob-private.rs
@@ -13,12 +13,12 @@ mod mod1 {
pub use mod1::*;
// @has foo/index.html
-// @!has - "mod1"
-// @has - "Mod1Public"
-// @!has - "Mod1Private"
-// @!has - "mod2"
-// @has - "Mod2Public"
-// @!has - "Mod2Private"
+// @!hasraw - "mod1"
+// @hasraw - "Mod1Public"
+// @!hasraw - "Mod1Private"
+// @!hasraw - "mod2"
+// @hasraw - "Mod2Public"
+// @!hasraw - "Mod2Private"
// @has foo/struct.Mod1Public.html
// @!has foo/struct.Mod1Private.html
// @has foo/struct.Mod2Public.html
diff --git a/src/test/rustdoc/inline_local/hidden-use.rs b/src/test/rustdoc/inline_local/hidden-use.rs
index a972d376a..de512fb26 100644
--- a/src/test/rustdoc/inline_local/hidden-use.rs
+++ b/src/test/rustdoc/inline_local/hidden-use.rs
@@ -3,8 +3,8 @@ mod private {
}
// @has hidden_use/index.html
-// @!has - 'private'
-// @!has - 'Foo'
+// @!hasraw - 'private'
+// @!hasraw - 'Foo'
// @!has hidden_use/struct.Foo.html
#[doc(hidden)]
pub use private::Foo;
diff --git a/src/test/rustdoc/inline_local/macro_by_example.rs b/src/test/rustdoc/inline_local/macro_by_example.rs
index dacc7cfb3..5c33c0037 100644
--- a/src/test/rustdoc/inline_local/macro_by_example.rs
+++ b/src/test/rustdoc/inline_local/macro_by_example.rs
@@ -7,7 +7,7 @@ macro_rules! foo {
// @has macro_by_example/macros/index.html
pub mod macros {
- // @!has - 'pub use foo as bar;'
+ // @!hasraw - 'pub use foo as bar;'
// @has macro_by_example/macros/macro.bar.html
// @has - '//*[@class="docblock"]' 'docs for foo'
// @has - '//*[@class="stab deprecated"]' 'Deprecated since 1.2.3: text'
diff --git a/src/test/rustdoc/inline_local/please_inline.rs b/src/test/rustdoc/inline_local/please_inline.rs
index 48539361f..e4429ef33 100644
--- a/src/test/rustdoc/inline_local/please_inline.rs
+++ b/src/test/rustdoc/inline_local/please_inline.rs
@@ -4,7 +4,7 @@ pub mod foo {
// @has please_inline/a/index.html
pub mod a {
- // @!has - 'pub use foo::'
+ // @!hasraw - 'pub use foo::'
// @has please_inline/a/struct.Foo.html
#[doc(inline)]
pub use foo::Foo;
@@ -12,7 +12,7 @@ pub mod a {
// @has please_inline/b/index.html
pub mod b {
- // @has - 'pub use foo::'
+ // @hasraw - 'pub use foo::'
// @!has please_inline/b/struct.Foo.html
#[feature(inline)]
pub use foo::Foo;
diff --git a/src/test/rustdoc/inline_local/trait-vis.rs b/src/test/rustdoc/inline_local/trait-vis.rs
index e7b08088f..19b69da15 100644
--- a/src/test/rustdoc/inline_local/trait-vis.rs
+++ b/src/test/rustdoc/inline_local/trait-vis.rs
@@ -13,6 +13,6 @@ mod asdf {
}
// @has trait_vis/struct.SomeStruct.html
-// @has - '//h3[@class="code-header in-band"]' 'impl ThisTrait for SomeStruct'
-// @!has - '//h3[@class="code-header in-band"]' 'impl PrivateTrait for SomeStruct'
+// @has - '//h3[@class="code-header"]' 'impl ThisTrait for SomeStruct'
+// @!has - '//h3[@class="code-header"]' 'impl PrivateTrait for SomeStruct'
pub use asdf::SomeStruct;
diff --git a/src/test/rustdoc/internal.rs b/src/test/rustdoc/internal.rs
index f316eb24a..caad43a08 100644
--- a/src/test/rustdoc/internal.rs
+++ b/src/test/rustdoc/internal.rs
@@ -3,13 +3,15 @@
// Check that the unstable marker is not added for "rustc_private".
// @!matches internal/index.html \
-// '//*[@class="item-right docblock-short"]/span[@class="stab unstable"]'
+// '//*[@class="item-right docblock-short"]/span[@class="stab unstable"]' \
+// ''
// @!matches internal/index.html \
-// '//*[@class="item-right docblock-short"]/span[@class="stab internal"]'
+// '//*[@class="item-right docblock-short"]/span[@class="stab internal"]' \
+// ''
// @matches - '//*[@class="item-right docblock-short"]' 'Docs'
-// @!has internal/struct.S.html '//*[@class="stab unstable"]'
-// @!has internal/struct.S.html '//*[@class="stab internal"]'
+// @!has internal/struct.S.html '//*[@class="stab unstable"]' ''
+// @!has internal/struct.S.html '//*[@class="stab internal"]' ''
/// Docs
pub struct S;
diff --git a/src/test/rustdoc/intra-doc/assoc-reexport-super.rs b/src/test/rustdoc/intra-doc/assoc-reexport-super.rs
new file mode 100644
index 000000000..a7bc1c6a2
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/assoc-reexport-super.rs
@@ -0,0 +1,20 @@
+// Regression test for #93205
+
+#![crate_name = "foo"]
+
+mod generated {
+ pub struct MyNewType;
+ impl MyNewType {
+ pub const FOO: Self = Self;
+ }
+}
+
+pub use generated::MyNewType;
+
+mod prelude {
+ impl super::MyNewType {
+ /// An alias for [`Self::FOO`].
+ // @has 'foo/struct.MyNewType.html' '//a[@href="struct.MyNewType.html#associatedconstant.FOO"]' 'Self::FOO'
+ pub const FOO2: Self = Self::FOO;
+ }
+}
diff --git a/src/test/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs b/src/test/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs
new file mode 100644
index 000000000..2b8fdec1f
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/auxiliary/issue-103463-aux.rs
@@ -0,0 +1,4 @@
+pub trait Trait {
+ /// [`u8::clone`]
+ fn method();
+}
diff --git a/src/test/rustdoc/intra-doc/extern-crate-only-used-in-link.rs b/src/test/rustdoc/intra-doc/extern-crate-only-used-in-link.rs
index 5d8dcf8bc..ad50887e9 100644
--- a/src/test/rustdoc/intra-doc/extern-crate-only-used-in-link.rs
+++ b/src/test/rustdoc/intra-doc/extern-crate-only-used-in-link.rs
@@ -16,4 +16,4 @@
//! [`empty`]
// @has - '//a[@href="../empty2/index.html"]' 'empty2'
-//! [empty2<x>]
+//! [`empty2<x>`]
diff --git a/src/test/rustdoc/intra-doc/extern-type.rs b/src/test/rustdoc/intra-doc/extern-type.rs
index ab088ab78..5440f582d 100644
--- a/src/test/rustdoc/intra-doc/extern-type.rs
+++ b/src/test/rustdoc/intra-doc/extern-type.rs
@@ -25,11 +25,11 @@ impl G<usize> for ExternType {
}
// @has 'extern_type/foreigntype.ExternType.html'
-// @has 'extern_type/fn.links_to_extern_type.html' \
+// @hasraw 'extern_type/fn.links_to_extern_type.html' \
// 'href="foreigntype.ExternType.html#method.f"'
-// @has 'extern_type/fn.links_to_extern_type.html' \
+// @hasraw 'extern_type/fn.links_to_extern_type.html' \
// 'href="foreigntype.ExternType.html#method.test"'
-// @has 'extern_type/fn.links_to_extern_type.html' \
+// @hasraw 'extern_type/fn.links_to_extern_type.html' \
// 'href="foreigntype.ExternType.html#method.g"'
/// See also [ExternType::f]
/// See also [ExternType::test]
diff --git a/src/test/rustdoc/intra-doc/issue-103463.rs b/src/test/rustdoc/intra-doc/issue-103463.rs
new file mode 100644
index 000000000..4adf8a9a8
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/issue-103463.rs
@@ -0,0 +1,8 @@
+// The `Trait` is not pulled into the crate resulting in doc links in its methods being resolved.
+
+// aux-build:issue-103463-aux.rs
+
+extern crate issue_103463_aux;
+use issue_103463_aux::Trait;
+
+fn main() {}
diff --git a/src/test/rustdoc/intra-doc/issue-104145.rs b/src/test/rustdoc/intra-doc/issue-104145.rs
new file mode 100644
index 000000000..9ce36740d
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/issue-104145.rs
@@ -0,0 +1,14 @@
+// Doc links in `Trait`'s methods are resolved because it has a local impl.
+
+// aux-build:issue-103463-aux.rs
+
+extern crate issue_103463_aux;
+use issue_103463_aux::Trait;
+
+pub struct LocalType;
+
+impl Trait for LocalType {
+ fn method() {}
+}
+
+fn main() {}
diff --git a/src/test/rustdoc/intra-doc/no-doc-primitive.rs b/src/test/rustdoc/intra-doc/no-doc-primitive.rs
new file mode 100644
index 000000000..e5eba1d8d
--- /dev/null
+++ b/src/test/rustdoc/intra-doc/no-doc-primitive.rs
@@ -0,0 +1,15 @@
+// Crate tree without a `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)]
+#![no_core]
+#![rustc_coherence_is_core]
+#![crate_type = "rlib"]
+
+// @has no_doc_primitive/index.html
+//! A [`char`] and its [`char::len_utf8`].
+impl char {
+ pub fn len_utf8(self) -> usize {
+ 42
+ }
+}
diff --git a/src/test/rustdoc/issue-100241.rs b/src/test/rustdoc/issue-100241.rs
new file mode 100644
index 000000000..9e9cba13a
--- /dev/null
+++ b/src/test/rustdoc/issue-100241.rs
@@ -0,0 +1,12 @@
+//! See [`S`].
+
+// Check that this isn't an ICE
+// should-fail
+
+mod foo {
+ pub use inner::S;
+ //~^ ERROR unresolved imports `inner`, `foo::S`
+}
+
+use foo::*;
+use foo::S;
diff --git a/src/test/rustdoc/issue-100620.rs b/src/test/rustdoc/issue-100620.rs
new file mode 100644
index 000000000..097666eb5
--- /dev/null
+++ b/src/test/rustdoc/issue-100620.rs
@@ -0,0 +1,19 @@
+pub trait Bar<S> {}
+
+pub trait Qux<T> {}
+
+pub trait Foo<T, S> {
+ fn bar()
+ where
+ T: Bar<S>,
+ {
+ }
+}
+
+pub struct Concrete;
+
+impl<S> Foo<(), S> for Concrete {}
+
+impl<T, S> Bar<S> for T where S: Qux<T> {}
+
+impl<T, S> Qux<T> for S where T: Bar<S> {}
diff --git a/src/test/rustdoc/issue-100679-sidebar-links-deref.rs b/src/test/rustdoc/issue-100679-sidebar-links-deref.rs
new file mode 100644
index 000000000..f09d23206
--- /dev/null
+++ b/src/test/rustdoc/issue-100679-sidebar-links-deref.rs
@@ -0,0 +1,30 @@
+#![crate_name="foo"]
+
+pub struct Vec;
+
+pub struct Slice;
+
+impl std::ops::Deref for Vec {
+ type Target = Slice;
+ fn deref(&self) -> &Slice {
+ &Slice
+ }
+}
+
+// @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \
+// "is_empty"
+impl Vec {
+ pub fn is_empty(&self) -> bool {
+ true
+ }
+}
+
+// @has foo/struct.Vec.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty-1"]' \
+// "is_empty"
+// @has foo/struct.Slice.html '//*[@class="sidebar-elems"]//section//li/a[@href="#method.is_empty"]' \
+// "is_empty"
+impl Slice {
+ pub fn is_empty(&self) -> bool {
+ true
+ }
+}
diff --git a/src/test/rustdoc/issue-101743-bold-tag.rs b/src/test/rustdoc/issue-101743-bold-tag.rs
new file mode 100644
index 000000000..631181fec
--- /dev/null
+++ b/src/test/rustdoc/issue-101743-bold-tag.rs
@@ -0,0 +1,19 @@
+// Regression test for https://github.com/rust-lang/rust/issues/101743
+
+#![crate_name="foo"]
+
+pub type Word = usize;
+pub struct Repr<const B: usize>([i32; B]);
+pub struct IBig(usize);
+
+pub const fn base_as_ibig<const B: Word>() -> IBig {
+ IBig(B)
+}
+
+impl<const B: Word> Repr<B> {
+ // If we change back to rendering the value of consts, check this doesn't add
+ // a <b> tag, but escapes correctly
+
+ // @has foo/struct.Repr.html '//section[@id="associatedconstant.BASE"]/h4' '= _'
+ pub const BASE: IBig = base_as_ibig::<B>();
+}
diff --git a/src/test/rustdoc/issue-16265-1.rs b/src/test/rustdoc/issue-16265-1.rs
index ec007e36b..2fda637a6 100644
--- a/src/test/rustdoc/issue-16265-1.rs
+++ b/src/test/rustdoc/issue-16265-1.rs
@@ -1,6 +1,6 @@
pub struct Foo;
-// @has issue_16265_1/traits/index.html 'source'
+// @hasraw issue_16265_1/traits/index.html 'source'
pub mod traits {
impl PartialEq for super::Foo {
fn eq(&self, _: &super::Foo) -> bool {
diff --git a/src/test/rustdoc/issue-16265-2.rs b/src/test/rustdoc/issue-16265-2.rs
index d5cd18d9d..c3eb35617 100644
--- a/src/test/rustdoc/issue-16265-2.rs
+++ b/src/test/rustdoc/issue-16265-2.rs
@@ -1,4 +1,4 @@
-// @has issue_16265_2/index.html 'source'
+// @hasraw issue_16265_2/index.html 'source'
trait Y {}
impl Y for Option<u32> {}
diff --git a/src/test/rustdoc/issue-20727-4.rs b/src/test/rustdoc/issue-20727-4.rs
index 84fc6f94a..643f93875 100644
--- a/src/test/rustdoc/issue-20727-4.rs
+++ b/src/test/rustdoc/issue-20727-4.rs
@@ -25,7 +25,7 @@ pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
pub mod reexport {
// @has issue_20727_4/reexport/trait.Index.html
- // @has - '//*[@class="rust trait"]' 'trait Index<Idx> where Idx: ?Sized, {'
+ // @has - '//*[@class="rust trait"]' 'trait Index<Idx>where Idx: ?Sized,{'
// @has - '//*[@class="rust trait"]' 'type Output: ?Sized'
// @has - '//*[@class="rust trait"]' \
// 'fn index(&self, index: Idx) -> &Self::Output'
@@ -33,7 +33,7 @@ pub mod reexport {
// @has issue_20727_4/reexport/trait.IndexMut.html
// @has - '//*[@class="rust trait"]' \
- // 'trait IndexMut<Idx>: Index<Idx> where Idx: ?Sized, {'
+ // 'trait IndexMut<Idx>: Index<Idx>where Idx: ?Sized,{'
// @has - '//*[@class="rust trait"]' \
// 'fn index_mut(&mut self, index: Idx) -> &mut Self::Output;'
pub use issue_20727::IndexMut;
diff --git a/src/test/rustdoc/issue-21801.rs b/src/test/rustdoc/issue-21801.rs
index 2a586b6ff..29d2ec64c 100644
--- a/src/test/rustdoc/issue-21801.rs
+++ b/src/test/rustdoc/issue-21801.rs
@@ -5,5 +5,5 @@ extern crate issue_21801;
// @has issue_21801/struct.Foo.html
// @has - '//*[@id="method.new"]' \
-// 'fn new<F>(f: F) -> Foo where F: FnMut() -> i32'
+// 'fn new<F>(f: F) -> Foowhere F: FnMut() -> i32'
pub use issue_21801::Foo;
diff --git a/src/test/rustdoc/issue-23511.rs b/src/test/rustdoc/issue-23511.rs
index 2d2a7908f..7576ebb03 100644
--- a/src/test/rustdoc/issue-23511.rs
+++ b/src/test/rustdoc/issue-23511.rs
@@ -6,7 +6,7 @@ pub mod str {
#![doc(primitive = "str")]
impl str {
- // @has search-index.js foo
+ // @hasraw search-index.js foo
#[rustc_allow_incoherent_impl]
pub fn foo(&self) {}
}
diff --git a/src/test/rustdoc/issue-23812.rs b/src/test/rustdoc/issue-23812.rs
index 5dac8d87b..08fd1833b 100644
--- a/src/test/rustdoc/issue-23812.rs
+++ b/src/test/rustdoc/issue-23812.rs
@@ -16,10 +16,10 @@ doc! {
}
// @has issue_23812/Foo/index.html
-// @has - 'Outer comment'
-// @!has - '/// Outer comment'
-// @has - 'Inner comment'
-// @!has - '//! Inner comment'
+// @hasraw - 'Outer comment'
+// @!hasraw - '/// Outer comment'
+// @hasraw - 'Inner comment'
+// @!hasraw - '//! Inner comment'
doc! {
@@ -30,7 +30,7 @@ doc! {
}
// @has issue_23812/Bar/index.html
-// @has - 'Outer block comment'
-// @!has - '/** Outer block comment */'
-// @has - 'Inner block comment'
-// @!has - '/*! Inner block comment */'
+// @hasraw - 'Outer block comment'
+// @!hasraw - '/** Outer block comment */'
+// @hasraw - 'Inner block comment'
+// @!hasraw - '/*! Inner block comment */'
diff --git a/src/test/rustdoc/issue-27104.rs b/src/test/rustdoc/issue-27104.rs
index b74c3eb78..9f2fd9071 100644
--- a/src/test/rustdoc/issue-27104.rs
+++ b/src/test/rustdoc/issue-27104.rs
@@ -3,8 +3,8 @@
// ignore-cross-compile
// @has issue_27104/index.html
-// @!has - 'extern crate std'
-// @!has - 'use std::prelude::'
+// @!hasraw - 'extern crate std'
+// @!hasraw - 'use std::prelude::'
-// @has - 'pub extern crate empty'
+// @hasraw - 'pub extern crate empty'
pub extern crate empty;
diff --git a/src/test/rustdoc/issue-27759.rs b/src/test/rustdoc/issue-27759.rs
index f3739dafd..65e0f7cb8 100644
--- a/src/test/rustdoc/issue-27759.rs
+++ b/src/test/rustdoc/issue-27759.rs
@@ -4,11 +4,11 @@
#![unstable(feature="test", issue="27759")]
// @has issue_27759/unstable/index.html
-// @has - '<code>test</code>&nbsp;<a href="http://issue_url/27759">#27759</a>'
+// @hasraw - '<code>test</code>&nbsp;<a href="http://issue_url/27759">#27759</a>'
#[unstable(feature="test", issue="27759")]
pub mod unstable {
// @has issue_27759/unstable/fn.issue.html
- // @has - '<code>test_function</code>&nbsp;<a href="http://issue_url/12345">#12345</a>'
+ // @hasraw - '<code>test_function</code>&nbsp;<a href="http://issue_url/12345">#12345</a>'
#[unstable(feature="test_function", issue="12345")]
pub fn issue() {}
}
diff --git a/src/test/rustdoc/issue-29503.rs b/src/test/rustdoc/issue-29503.rs
index 635c3175f..01ae44385 100644
--- a/src/test/rustdoc/issue-29503.rs
+++ b/src/test/rustdoc/issue-29503.rs
@@ -5,7 +5,7 @@ pub trait MyTrait {
fn my_string(&self) -> String;
}
-// @has - "//div[@id='implementors-list']//*[@id='impl-MyTrait-for-T']//h3[@class='code-header in-band']" "impl<T> MyTrait for T where T: Debug"
+// @has - "//div[@id='implementors-list']//*[@id='impl-MyTrait-for-T']//h3[@class='code-header']" "impl<T> MyTrait for Twhere T: Debug"
impl<T> MyTrait for T
where
T: fmt::Debug,
diff --git a/src/test/rustdoc/issue-29584.rs b/src/test/rustdoc/issue-29584.rs
index 28e1efec6..4364a9649 100644
--- a/src/test/rustdoc/issue-29584.rs
+++ b/src/test/rustdoc/issue-29584.rs
@@ -4,5 +4,5 @@
extern crate issue_29584;
// @has issue_29584/struct.Foo.html
-// @!has - 'impl Bar for'
+// @!hasraw - 'impl Bar for'
pub use issue_29584::Foo;
diff --git a/src/test/rustdoc/issue-31899.rs b/src/test/rustdoc/issue-31899.rs
index e7a8ee239..3eee37446 100644
--- a/src/test/rustdoc/issue-31899.rs
+++ b/src/test/rustdoc/issue-31899.rs
@@ -1,8 +1,8 @@
// @has issue_31899/index.html
-// @has - 'Make this line a bit longer.'
-// @!has - 'rust rust-example-rendered'
-// @!has - 'use ndarray::arr2'
-// @!has - 'prohibited'
+// @hasraw - 'Make this line a bit longer.'
+// @!hasraw - 'rust rust-example-rendered'
+// @!hasraw - 'use ndarray::arr2'
+// @!hasraw - 'prohibited'
/// A tuple or fixed size array that can be used to index an array.
/// Make this line a bit longer.
diff --git a/src/test/rustdoc/issue-32374.rs b/src/test/rustdoc/issue-32374.rs
index 01f955381..8d2c27cf3 100644
--- a/src/test/rustdoc/issue-32374.rs
+++ b/src/test/rustdoc/issue-32374.rs
@@ -8,20 +8,24 @@
// 'Experimental'
// @matches issue_32374/index.html '//*[@class="item-right docblock-short"]/text()' 'Docs'
-// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]' \
-// '👎 Deprecated since 1.0.0: text'
-// @has - '<code>test</code>&nbsp;<a href="https://issue_url/32374">#32374</a>'
+// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' '👎'
+// @has issue_32374/struct.T.html '//*[@class="stab deprecated"]/span' \
+// 'Deprecated since 1.0.0: text'
+// @hasraw - '<code>test</code>&nbsp;<a href="https://issue_url/32374">#32374</a>'
+// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' '🔬'
// @matches issue_32374/struct.T.html '//*[@class="stab unstable"]' \
-// '🔬 This is a nightly-only experimental API. \(test\s#32374\)$'
+// 'This is a nightly-only experimental API. \(test\s#32374\)$'
/// Docs
#[deprecated(since = "1.0.0", note = "text")]
#[unstable(feature = "test", issue = "32374")]
pub struct T;
+// @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' '👎'
// @has issue_32374/struct.U.html '//*[@class="stab deprecated"]' \
-// '👎 Deprecated since 1.0.0: deprecated'
+// 'Deprecated since 1.0.0: deprecated'
+// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' '🔬'
// @has issue_32374/struct.U.html '//*[@class="stab unstable"]' \
-// '🔬 This is a nightly-only experimental API. (test #32374)'
+// 'This is a nightly-only experimental API. (test #32374)'
#[deprecated(since = "1.0.0", note = "deprecated")]
#[unstable(feature = "test", issue = "32374", reason = "unstable")]
pub struct U;
diff --git a/src/test/rustdoc/issue-32395.rs b/src/test/rustdoc/issue-32395.rs
index 13468c153..5552300f9 100644
--- a/src/test/rustdoc/issue-32395.rs
+++ b/src/test/rustdoc/issue-32395.rs
@@ -3,13 +3,13 @@
// ignore-cross-compile
// @has variant_struct/enum.Foo.html
-// @!has - 'pub qux'
-// @!has - 'pub(crate) qux'
-// @!has - 'pub Bar'
+// @!hasraw - 'pub qux'
+// @!hasraw - 'pub(crate) qux'
+// @!hasraw - 'pub Bar'
extern crate variant_struct;
// @has issue_32395/enum.Foo.html
-// @!has - 'pub qux'
-// @!has - 'pub(crate) qux'
-// @!has - 'pub Bar'
+// @!hasraw - 'pub qux'
+// @!hasraw - 'pub(crate) qux'
+// @!hasraw - 'pub Bar'
pub use variant_struct::Foo;
diff --git a/src/test/rustdoc/issue-33592.rs b/src/test/rustdoc/issue-33592.rs
index 815439db9..7a128f0b8 100644
--- a/src/test/rustdoc/issue-33592.rs
+++ b/src/test/rustdoc/issue-33592.rs
@@ -6,8 +6,8 @@ pub struct Bar;
pub struct Baz;
-// @has foo/trait.Foo.html '//h3[@class="code-header in-band"]' 'impl Foo<i32> for Bar'
+// @has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl Foo<i32> for Bar'
impl Foo<i32> for Bar {}
-// @has foo/trait.Foo.html '//h3[@class="code-header in-band"]' 'impl<T> Foo<T> for Baz'
+// @has foo/trait.Foo.html '//h3[@class="code-header"]' 'impl<T> Foo<T> for Baz'
impl<T> Foo<T> for Baz {}
diff --git a/src/test/rustdoc/issue-34473.rs b/src/test/rustdoc/issue-34473.rs
index d96301f3a..37da3dd19 100644
--- a/src/test/rustdoc/issue-34473.rs
+++ b/src/test/rustdoc/issue-34473.rs
@@ -5,7 +5,7 @@ mod second {
}
// @has foo/index.html
-// @!has - SomeTypeWithLongName
+// @!hasraw - SomeTypeWithLongName
// @has foo/struct.SomeType.html
// @!has foo/struct.SomeTypeWithLongName.html
pub use second::{SomeTypeWithLongName as SomeType};
diff --git a/src/test/rustdoc/issue-34928.rs b/src/test/rustdoc/issue-34928.rs
index 4184086f6..91b677574 100644
--- a/src/test/rustdoc/issue-34928.rs
+++ b/src/test/rustdoc/issue-34928.rs
@@ -2,5 +2,5 @@
pub trait Bar {}
-// @has foo/struct.Foo.html '//pre' 'pub struct Foo<T>(pub T) where T: Bar;'
+// @has foo/struct.Foo.html '//pre' 'pub struct Foo<T>(pub T)where T: Bar;'
pub struct Foo<T>(pub T) where T: Bar;
diff --git a/src/test/rustdoc/issue-41783.codeblock.html b/src/test/rustdoc/issue-41783.codeblock.html
new file mode 100644
index 000000000..89987491d
--- /dev/null
+++ b/src/test/rustdoc/issue-41783.codeblock.html
@@ -0,0 +1,5 @@
+<code># single
+## double
+### triple
+<span class="attribute">#[outer]
+#![inner]</span></code>
diff --git a/src/test/rustdoc/issue-41783.rs b/src/test/rustdoc/issue-41783.rs
index cb9b9b153..87267a750 100644
--- a/src/test/rustdoc/issue-41783.rs
+++ b/src/test/rustdoc/issue-41783.rs
@@ -1,11 +1,11 @@
// @has issue_41783/struct.Foo.html
-// @!has - 'space'
-// @!has - 'comment'
-// @has - '# <span class="ident">single'
-// @has - '## <span class="ident">double</span>'
-// @has - '### <span class="ident">triple</span>'
-// @has - '<span class="attribute">#[<span class="ident">outer</span>]</span>'
-// @has - '<span class="attribute">#![<span class="ident">inner</span>]</span>'
+// @!hasraw - 'space'
+// @!hasraw - 'comment'
+// @hasraw - '<span class="attribute">#[outer]'
+// @!hasraw - '<span class="attribute">#[outer]</span>'
+// @hasraw - '#![inner]</span>'
+// @!hasraw - '<span class="attribute">#![inner]</span>'
+// @snapshot 'codeblock' - '//*[@class="rustdoc-toggle top-doc"]/*[@class="docblock"]//pre/code'
/// ```no_run
/// # # space
diff --git a/src/test/rustdoc/issue-46727.rs b/src/test/rustdoc/issue-46727.rs
index 00e9127a3..8cfc4827a 100644
--- a/src/test/rustdoc/issue-46727.rs
+++ b/src/test/rustdoc/issue-46727.rs
@@ -3,5 +3,5 @@
extern crate issue_46727;
// @has issue_46727/trait.Foo.html
-// @has - '//h3[@class="code-header in-band"]' 'impl<T> Foo for Bar<[T; 3]>'
+// @has - '//h3[@class="code-header"]' 'impl<T> Foo for Bar<[T; 3]>'
pub use issue_46727::{Foo, Bar};
diff --git a/src/test/rustdoc/issue-50159.rs b/src/test/rustdoc/issue-50159.rs
index d88c29217..04bc4f304 100644
--- a/src/test/rustdoc/issue-50159.rs
+++ b/src/test/rustdoc/issue-50159.rs
@@ -11,8 +11,8 @@ impl<B, C> Signal2 for B where B: Signal<Item = C> {
}
// @has issue_50159/struct.Switch.html
-// @has - '//h3[@class="code-header in-band"]' 'impl<B> Send for Switch<B> where <B as Signal>::Item: Send'
-// @has - '//h3[@class="code-header in-band"]' 'impl<B> Sync for Switch<B> where <B as Signal>::Item: Sync'
+// @has - '//h3[@class="code-header"]' 'impl<B> Send for Switch<B>where <B as Signal>::Item: Send'
+// @has - '//h3[@class="code-header"]' 'impl<B> Sync for Switch<B>where <B as Signal>::Item: Sync'
// @count - '//*[@id="implementations-list"]//*[@class="impl"]' 0
// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]' 5
pub struct Switch<B: Signal> {
diff --git a/src/test/rustdoc/issue-51236.rs b/src/test/rustdoc/issue-51236.rs
index ee11ccc68..1c7aa9c7e 100644
--- a/src/test/rustdoc/issue-51236.rs
+++ b/src/test/rustdoc/issue-51236.rs
@@ -7,8 +7,8 @@ pub mod traits {
}
// @has issue_51236/struct.Owned.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<T> Send for Owned<T> where <T as Owned<'static>>::Reader: Send"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<T> Send for Owned<T>where <T as Owned<'static>>::Reader: Send"
pub struct Owned<T> where T: for<'a> ::traits::Owned<'a> {
marker: PhantomData<<T as ::traits::Owned<'static>>::Reader>,
}
diff --git a/src/test/rustdoc/issue-53689.rs b/src/test/rustdoc/issue-53689.rs
index 52ce4159d..832140e06 100644
--- a/src/test/rustdoc/issue-53689.rs
+++ b/src/test/rustdoc/issue-53689.rs
@@ -5,7 +5,7 @@
extern crate issue_53689;
// @has foo/trait.MyTrait.html
-// @!has - 'MyStruct'
+// @!hasraw - 'MyStruct'
// @count - '//*[h3="impl<T> MyTrait for T"]' 1
pub trait MyTrait {}
diff --git a/src/test/rustdoc/issue-54705.rs b/src/test/rustdoc/issue-54705.rs
index bedaf5c4d..7b7290ab4 100644
--- a/src/test/rustdoc/issue-54705.rs
+++ b/src/test/rustdoc/issue-54705.rs
@@ -1,13 +1,11 @@
pub trait ScopeHandle<'scope> {}
-
-
// @has issue_54705/struct.ScopeFutureContents.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<'scope, S> Send for ScopeFutureContents<'scope, S> where S: Sync"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<'scope, S> Send for ScopeFutureContents<'scope, S>where S: Sync"
//
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<'scope, S> Sync for ScopeFutureContents<'scope, S> where S: Sync"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<'scope, S> Sync for ScopeFutureContents<'scope, S>where S: Sync"
pub struct ScopeFutureContents<'scope, S>
where S: ScopeHandle<'scope>,
{
diff --git a/src/test/rustdoc/issue-55321.rs b/src/test/rustdoc/issue-55321.rs
index ee2420d86..22a18ef90 100644
--- a/src/test/rustdoc/issue-55321.rs
+++ b/src/test/rustdoc/issue-55321.rs
@@ -1,9 +1,9 @@
#![feature(negative_impls)]
// @has issue_55321/struct.A.html
-// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl !Send for A"
-// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl !Sync for A"
pub struct A();
@@ -11,8 +11,8 @@ impl !Send for A {}
impl !Sync for A {}
// @has issue_55321/struct.B.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Send for B<T>"
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Sync for B<T>"
pub struct B<T: ?Sized>(A, Box<T>);
diff --git a/src/test/rustdoc/issue-56822.rs b/src/test/rustdoc/issue-56822.rs
index aef6ddd8d..b4eef344b 100644
--- a/src/test/rustdoc/issue-56822.rs
+++ b/src/test/rustdoc/issue-56822.rs
@@ -17,7 +17,7 @@ impl<'a, T> MyTrait for Inner<'a, T> {
}
// @has issue_56822/struct.Parser.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<'a> Send for Parser<'a>"
pub struct Parser<'a> {
field: <Wrapper<Inner<'a, u8>> as MyTrait>::Output
diff --git a/src/test/rustdoc/issue-60726.rs b/src/test/rustdoc/issue-60726.rs
index 167f0f039..fbb0f82ae 100644
--- a/src/test/rustdoc/issue-60726.rs
+++ b/src/test/rustdoc/issue-60726.rs
@@ -26,9 +26,9 @@ where
{}
// @has issue_60726/struct.IntoIter.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Send for IntoIter<T>"
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Sync for IntoIter<T>"
pub struct IntoIter<T>{
hello:DynTrait<FooInterface<T>>,
diff --git a/src/test/rustdoc/issue-61592.rs b/src/test/rustdoc/issue-61592.rs
index aef038c07..4b6c37b94 100644
--- a/src/test/rustdoc/issue-61592.rs
+++ b/src/test/rustdoc/issue-61592.rs
@@ -5,11 +5,11 @@ extern crate foo;
// @has issue_61592/index.html
// @has - '//a[@href="#reexports"]' 'Re-exports'
// @has - '//code' 'pub use foo::FooTrait as _;'
-// @!has - '//a[@href="trait._.html"]'
+// @!has - '//a[@href="trait._.html"]' ''
pub use foo::FooTrait as _;
// @has issue_61592/index.html
// @has - '//a[@href="#reexports"]' 'Re-exports'
// @has - '//code' 'pub use foo::FooStruct as _;'
-// @!has - '//a[@href="struct._.html"]'
+// @!has - '//a[@href="struct._.html"]' ''
pub use foo::FooStruct as _;
diff --git a/src/test/rustdoc/issue-75588.rs b/src/test/rustdoc/issue-75588.rs
index ac97b94fb..3b11059a7 100644
--- a/src/test/rustdoc/issue-75588.rs
+++ b/src/test/rustdoc/issue-75588.rs
@@ -10,8 +10,8 @@ extern crate realcore;
extern crate real_gimli;
// issue #74672
-// @!has foo/trait.Deref.html '//*[@id="impl-Deref-for-EndianSlice"]//h3[@class="code-header in-band"]' 'impl Deref for EndianSlice'
+// @!has foo/trait.Deref.html '//*[@id="impl-Deref-for-EndianSlice"]//h3[@class="code-header"]' 'impl Deref for EndianSlice'
pub use realcore::Deref;
-// @has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//h3[@class="code-header in-band"]' 'impl Join for Foo'
+// @has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//h3[@class="code-header"]' 'impl Join for Foo'
pub use realcore::Join;
diff --git a/src/test/rustdoc/issue-80233-normalize-auto-trait.rs b/src/test/rustdoc/issue-80233-normalize-auto-trait.rs
index 515e617b4..62fbc2444 100644
--- a/src/test/rustdoc/issue-80233-normalize-auto-trait.rs
+++ b/src/test/rustdoc/issue-80233-normalize-auto-trait.rs
@@ -31,7 +31,7 @@ impl<T: Trait3> Trait3 for Vec<T> {
pub struct Struct1 {}
// @has issue_80233_normalize_auto_trait/struct.Question.html
-// @has - '//h3[@class="code-header in-band"]' 'impl<T> Send for Question<T>'
+// @has - '//h3[@class="code-header"]' 'impl<T> Send for Question<T>'
pub struct Question<T: Trait1> {
pub ins: <<Vec<T> as Trait3>::Type3 as Trait2>::Type2,
}
diff --git a/src/test/rustdoc/issue-82465-asref-for-and-of-local.rs b/src/test/rustdoc/issue-82465-asref-for-and-of-local.rs
index 8999e6a88..adf4d111a 100644
--- a/src/test/rustdoc/issue-82465-asref-for-and-of-local.rs
+++ b/src/test/rustdoc/issue-82465-asref-for-and-of-local.rs
@@ -1,14 +1,14 @@
use std::convert::AsRef;
pub struct Local;
-// @has issue_82465_asref_for_and_of_local/struct.Local.html '//h3[@class="code-header in-band"]' 'impl AsRef<str> for Local'
+// @has issue_82465_asref_for_and_of_local/struct.Local.html '//h3[@class="code-header"]' 'impl AsRef<str> for Local'
impl AsRef<str> for Local {
fn as_ref(&self) -> &str {
todo!()
}
}
-// @has - '//h3[@class="code-header in-band"]' 'impl AsRef<Local> for str'
+// @has - '//h3[@class="code-header"]' 'impl AsRef<Local> for str'
impl AsRef<Local> for str {
fn as_ref(&self) -> &Local {
todo!()
diff --git a/src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline-last-item.rs b/src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline-last-item.rs
new file mode 100644
index 000000000..d3a7a870b
--- /dev/null
+++ b/src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline-last-item.rs
@@ -0,0 +1,16 @@
+#![crate_name = "foo"]
+
+pub mod sub {
+ pub struct Item;
+
+ pub mod prelude {
+ pub use super::Item;
+ }
+}
+
+#[doc(inline)]
+pub use sub::*;
+
+// @count foo/index.html '//a[@class="mod"][@title="foo::prelude mod"]' 1
+// @count foo/prelude/index.html '//div[@class="item-row"]' 0
+pub mod prelude {}
diff --git a/src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline.rs b/src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline.rs
new file mode 100644
index 000000000..b83692509
--- /dev/null
+++ b/src/test/rustdoc/issue-83375-multiple-mods-w-same-name-doc-inline.rs
@@ -0,0 +1,16 @@
+#![crate_name = "foo"]
+
+pub mod sub {
+ pub struct Item;
+
+ pub mod prelude {
+ pub use super::Item;
+ }
+}
+
+// @count foo/index.html '//a[@class="mod"][@title="foo::prelude mod"]' 1
+// @count foo/prelude/index.html '//div[@class="item-row"]' 0
+pub mod prelude {}
+
+#[doc(inline)]
+pub use sub::*;
diff --git a/src/test/rustdoc/issue-89852.rs b/src/test/rustdoc/issue-89852.rs
index 45544dbee..4f2da5e07 100644
--- a/src/test/rustdoc/issue-89852.rs
+++ b/src/test/rustdoc/issue-89852.rs
@@ -3,8 +3,8 @@
#![no_core]
#![feature(no_core)]
-// @matches 'issue_89852/sidebar-items.js' '"repro"'
-// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"'
+// @matchesraw 'issue_89852/sidebar-items.js' '"repro"'
+// @!matchesraw 'issue_89852/sidebar-items.js' '"repro".*"repro"'
#[macro_export]
macro_rules! repro {
diff --git a/src/test/rustdoc/issue-98697.rs b/src/test/rustdoc/issue-98697.rs
index 83e08094c..d50268509 100644
--- a/src/test/rustdoc/issue-98697.rs
+++ b/src/test/rustdoc/issue-98697.rs
@@ -8,10 +8,10 @@
extern crate issue_98697_reexport_with_anonymous_lifetime;
-// @has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'fn repro<F>() where F: Fn(&str)'
+// @has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'fn repro<F>()where F: Fn(&str)'
// @!has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'for<'
pub use issue_98697_reexport_with_anonymous_lifetime::repro;
-// @has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header in-band"]' 'impl MyTrait<&Extra> for Extra'
-// @!has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header in-band"]' 'impl<'
+// @has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl MyTrait<&Extra> for Extra'
+// @!has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header"]' 'impl<'
pub use issue_98697_reexport_with_anonymous_lifetime::Extra;
diff --git a/src/test/rustdoc/keyword.rs b/src/test/rustdoc/keyword.rs
index 1cebe4c67..ea1273850 100644
--- a/src/test/rustdoc/keyword.rs
+++ b/src/test/rustdoc/keyword.rs
@@ -7,7 +7,7 @@
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Keywords'
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#keywords'
// @has foo/keyword.match.html '//a[@class="keyword"]' 'match'
-// @has foo/keyword.match.html '//span[@class="in-band"]' 'Keyword match'
+// @has foo/keyword.match.html '//h1[@class="fqn"]' 'Keyword match'
// @has foo/keyword.match.html '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has foo/index.html '//a/@href' '../foo/index.html'
// @!has foo/foo/index.html
diff --git a/src/test/rustdoc/link-title-escape.rs b/src/test/rustdoc/link-title-escape.rs
index 01aa8d00b..7a322ea6d 100644
--- a/src/test/rustdoc/link-title-escape.rs
+++ b/src/test/rustdoc/link-title-escape.rs
@@ -6,4 +6,4 @@
//!
//! [foo]: url 'title & <stuff> & "things"'
-// @has 'foo/index.html' 'title &amp; &lt;stuff&gt; &amp; &quot;things&quot;'
+// @hasraw 'foo/index.html' 'title &amp; &lt;stuff&gt; &amp; &quot;things&quot;'
diff --git a/src/test/rustdoc/logo-class-default.rs b/src/test/rustdoc/logo-class-default.rs
index a7016d227..d2d439199 100644
--- a/src/test/rustdoc/logo-class-default.rs
+++ b/src/test/rustdoc/logo-class-default.rs
@@ -1,4 +1,4 @@
// Note: this test is paired with logo-class.rs.
// @has logo_class_default/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' ''
-// @has logo_class_default/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
+// @has src/logo_class_default/logo-class-default.rs.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
pub struct SomeStruct;
diff --git a/src/test/rustdoc/logo-class.rs b/src/test/rustdoc/logo-class.rs
index f071f356a..d3aa446da 100644
--- a/src/test/rustdoc/logo-class.rs
+++ b/src/test/rustdoc/logo-class.rs
@@ -5,6 +5,6 @@
// @has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
// @!has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' ''
//
-// @has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
-// @!has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
+// @has src/logo_class/logo-class.rs.html '//*[@class="sub-logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
+// @!has src/logo_class/logo-class.rs.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
pub struct SomeStruct;
diff --git a/src/test/rustdoc/macro-document-private-duplicate.rs b/src/test/rustdoc/macro-document-private-duplicate.rs
index 7576c1326..d3cf7e140 100644
--- a/src/test/rustdoc/macro-document-private-duplicate.rs
+++ b/src/test/rustdoc/macro-document-private-duplicate.rs
@@ -4,21 +4,21 @@
// (yes, that's a thing), rustdoc lists both of them on the index page,
// but only documents the first one on the page for the macro.
// Fortunately, this can only happen in document private items mode,
-// but it still isn't ideal beahvior.
+// but it still isn't ideal behavior.
//
// See https://github.com/rust-lang/rust/pull/88019#discussion_r693920453
//
// compile-flags: --document-private-items
-// @has macro_document_private_duplicate/index.html 'Doc 1.'
-// @has macro_document_private_duplicate/macro.a_macro.html 'Doc 1.'
+// @hasraw macro_document_private_duplicate/index.html 'Doc 1.'
+// @hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 1.'
/// Doc 1.
macro_rules! a_macro {
() => ()
}
-// @has macro_document_private_duplicate/index.html 'Doc 2.'
-// @!has macro_document_private_duplicate/macro.a_macro.html 'Doc 2.'
+// @hasraw macro_document_private_duplicate/index.html 'Doc 2.'
+// @!hasraw macro_document_private_duplicate/macro.a_macro.html 'Doc 2.'
/// Doc 2.
macro_rules! a_macro {
() => ()
diff --git a/src/test/rustdoc/macro-higher-kinded-function.rs b/src/test/rustdoc/macro-higher-kinded-function.rs
index 02a430564..b8c52b7b7 100644
--- a/src/test/rustdoc/macro-higher-kinded-function.rs
+++ b/src/test/rustdoc/macro-higher-kinded-function.rs
@@ -11,8 +11,8 @@ macro_rules! gen {
}
// @has 'foo/struct.Providers.html'
-// @has - '//*[@class="docblock item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
-// @has - '//*[@class="docblock item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
+// @has - '//*[@class="item-decl"]//code' "pub a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8,"
+// @has - '//*[@class="item-decl"]//code' "pub b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16,"
// @has - '//*[@id="structfield.a"]/code' "a: for<'tcx> fn(_: TyCtxt<'tcx>, _: u8) -> i8"
// @has - '//*[@id="structfield.b"]/code' "b: for<'tcx> fn(_: TyCtxt<'tcx>, _: u16) -> i16"
gen! {
diff --git a/src/test/rustdoc/macro-private-not-documented.rs b/src/test/rustdoc/macro-private-not-documented.rs
index ae8b0e722..f135a3a9c 100644
--- a/src/test/rustdoc/macro-private-not-documented.rs
+++ b/src/test/rustdoc/macro-private-not-documented.rs
@@ -6,13 +6,13 @@
// This is a regression text for issue #88453.
#![feature(decl_macro)]
-// @!has macro_private_not_documented/index.html 'a_macro'
+// @!hasraw macro_private_not_documented/index.html 'a_macro'
// @!has macro_private_not_documented/macro.a_macro.html
macro_rules! a_macro {
() => ()
}
-// @!has macro_private_not_documented/index.html 'another_macro'
+// @!hasraw macro_private_not_documented/index.html 'another_macro'
// @!has macro_private_not_documented/macro.another_macro.html
macro another_macro {
() => ()
diff --git a/src/test/rustdoc/macro_rules-matchers.rs b/src/test/rustdoc/macro_rules-matchers.rs
index efc3b21e6..96f4126c7 100644
--- a/src/test/rustdoc/macro_rules-matchers.rs
+++ b/src/test/rustdoc/macro_rules-matchers.rs
@@ -5,32 +5,27 @@
// @has 'foo/macro.todo.html'
// @has - '//span[@class="macro"]' 'macro_rules!'
-// @has - '//span[@class="ident"]' 'todo'
-// Note: the only op is the `+`
-// @count - '//pre[@class="rust macro"]//span[@class="op"]' 1
+// @hasraw - ' todo {'
-// @has - '{ () =&gt; { ... }; ($('
+// @hasraw - '{ () =&gt; { ... }; ($('
// @has - '//span[@class="macro-nonterminal"]' '$'
// @has - '//span[@class="macro-nonterminal"]' 'arg'
-// @has - ':'
-// @has - '//span[@class="ident"]' 'tt'
-// @has - '),'
-// @has - '//span[@class="op"]' '+'
-// @has - ') =&gt; { ... }; }'
+// @hasraw - ':tt)+'
+// @hasraw - ') =&gt; { ... }; }'
pub use std::todo;
mod mod1 {
// @has 'foo/macro.macro1.html'
- // @has - 'macro_rules!'
- // @has - 'macro1'
- // @has - '{ () =&gt; { ... }; ($('
+ // @hasraw - 'macro_rules!'
+ // @hasraw - 'macro1'
+ // @hasraw - '{ () =&gt; { ... }; ($('
// @has - '//span[@class="macro-nonterminal"]' '$'
// @has - '//span[@class="macro-nonterminal"]' 'arg'
- // @has - ':'
- // @has - 'expr'
- // @has - '),'
- // @has - '+'
- // @has - ') =&gt; { ... }; }'
+ // @hasraw - ':'
+ // @hasraw - 'expr'
+ // @hasraw - '),'
+ // @hasraw - '+'
+ // @hasraw - ') =&gt; { ... }; }'
#[macro_export]
macro_rules! macro1 {
() => {};
diff --git a/src/test/rustdoc/markdown-summaries.rs b/src/test/rustdoc/markdown-summaries.rs
index b843e28e7..31e7072b5 100644
--- a/src/test/rustdoc/markdown-summaries.rs
+++ b/src/test/rustdoc/markdown-summaries.rs
@@ -7,21 +7,21 @@
//!
//! [link]: https://example.com
-// @has search-index.js 'This <em>summary</em> has a link and <code>code</code>.'
-// @!has - 'second paragraph'
+// @hasraw search-index.js 'This <em>summary</em> has a link and <code>code</code>.'
+// @!hasraw - 'second paragraph'
/// This `code` will be rendered in a code tag.
///
/// This text should not be rendered.
pub struct Sidebar;
-// @has search-index.js 'This <code>code</code> will be rendered in a code tag.'
-// @has summaries/sidebar-items.js 'This `code` will be rendered in a code tag.'
-// @!has - 'text should not be rendered'
+// @hasraw search-index.js 'This <code>code</code> will be rendered in a code tag.'
+// @hasraw summaries/sidebar-items.js 'This `code` will be rendered in a code tag.'
+// @!hasraw - 'text should not be rendered'
/// ```text
/// this block should not be rendered
/// ```
pub struct Sidebar2;
-// @!has summaries/sidebar-items.js 'block should not be rendered'
+// @!hasraw summaries/sidebar-items.js 'block should not be rendered'
diff --git a/src/test/rustdoc/masked.rs b/src/test/rustdoc/masked.rs
index c7ad690d6..80d5b99c0 100644
--- a/src/test/rustdoc/masked.rs
+++ b/src/test/rustdoc/masked.rs
@@ -7,24 +7,24 @@
#[doc(masked)]
extern crate masked;
-// @!has 'search-index.js' 'masked_method'
+// @!hasraw 'search-index.js' 'masked_method'
-// @!has 'foo/struct.String.html' 'MaskedTrait'
-// @!has 'foo/struct.String.html' 'masked_method'
+// @!hasraw 'foo/struct.String.html' 'MaskedTrait'
+// @!hasraw 'foo/struct.String.html' 'masked_method'
pub use std::string::String;
-// @!has 'foo/trait.Clone.html' 'MaskedStruct'
+// @!hasraw 'foo/trait.Clone.html' 'MaskedStruct'
pub use std::clone::Clone;
-// @!has 'foo/struct.MyStruct.html' 'MaskedTrait'
-// @!has 'foo/struct.MyStruct.html' 'masked_method'
+// @!hasraw 'foo/struct.MyStruct.html' 'MaskedTrait'
+// @!hasraw 'foo/struct.MyStruct.html' 'masked_method'
pub struct MyStruct;
impl masked::MaskedTrait for MyStruct {
fn masked_method() {}
}
-// @!has 'foo/trait.MyTrait.html' 'MaskedStruct'
+// @!hasraw 'foo/trait.MyTrait.html' 'MaskedStruct'
pub trait MyTrait {}
impl MyTrait for masked::MaskedStruct {}
diff --git a/src/test/rustdoc/module-impls.rs b/src/test/rustdoc/module-impls.rs
index 198b3446c..852f444e9 100644
--- a/src/test/rustdoc/module-impls.rs
+++ b/src/test/rustdoc/module-impls.rs
@@ -2,4 +2,4 @@
pub use std::marker::Send;
-// @!has foo/index.html 'Implementations'
+// @!hasraw foo/index.html 'Implementations'
diff --git a/src/test/rustdoc/negative-impl-sidebar.rs b/src/test/rustdoc/negative-impl-sidebar.rs
index b995fff1f..4af6d0084 100644
--- a/src/test/rustdoc/negative-impl-sidebar.rs
+++ b/src/test/rustdoc/negative-impl-sidebar.rs
@@ -4,6 +4,6 @@
pub struct Foo;
// @has foo/struct.Foo.html
-// @has - '//*[@class="sidebar-title"]/a[@href="#trait-implementations"]' 'Trait Implementations'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#trait-implementations"]' 'Trait Implementations'
// @has - '//*[@class="sidebar-elems"]//section//a' '!Sync'
impl !Sync for Foo {}
diff --git a/src/test/rustdoc/negative-impl.rs b/src/test/rustdoc/negative-impl.rs
index 61a239868..af19c784d 100644
--- a/src/test/rustdoc/negative-impl.rs
+++ b/src/test/rustdoc/negative-impl.rs
@@ -5,10 +5,10 @@ pub struct Alpha;
// @matches negative_impl/struct.Bravo.html '//pre' "pub struct Bravo<B>"
pub struct Bravo<B>(B);
-// @matches negative_impl/struct.Alpha.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @matches negative_impl/struct.Alpha.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl !Send for Alpha"
impl !Send for Alpha {}
-// @matches negative_impl/struct.Bravo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' "\
+// @matches negative_impl/struct.Bravo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' "\
// impl<B> !Send for Bravo<B>"
impl<B> !Send for Bravo<B> {}
diff --git a/src/test/rustdoc/nested-modules.rs b/src/test/rustdoc/nested-modules.rs
index 1596f4674..12234d2cf 100644
--- a/src/test/rustdoc/nested-modules.rs
+++ b/src/test/rustdoc/nested-modules.rs
@@ -7,22 +7,22 @@ mod a_module {
pub mod a_nested_module {
// @has aCrate/a_nested_module/index.html '//a[@href="fn.a_nested_public_function.html"]' 'a_nested_public_function'
- // @has aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
+ // @hasraw aCrate/a_nested_module/fn.a_nested_public_function.html 'pub fn a_nested_public_function()'
pub fn a_nested_public_function() {}
// @has aCrate/a_nested_module/index.html '//a[@href="fn.another_nested_public_function.html"]' 'another_nested_public_function'
- // @has aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
+ // @hasraw aCrate/a_nested_module/fn.another_nested_public_function.html 'pub fn another_nested_public_function()'
pub use a_nested_module::a_nested_public_function as another_nested_public_function;
}
- // @!has aCrate/a_nested_module/index.html 'yet_another_nested_public_function'
+ // @!hasraw aCrate/a_nested_module/index.html 'yet_another_nested_public_function'
pub use a_nested_module::a_nested_public_function as yet_another_nested_public_function;
- // @!has aCrate/a_nested_module/index.html 'one_last_nested_public_function'
+ // @!hasraw aCrate/a_nested_module/index.html 'one_last_nested_public_function'
pub use a_nested_module::another_nested_public_function as one_last_nested_public_function;
}
-// @!has aCrate/index.html 'a_module'
+// @!hasraw aCrate/index.html 'a_module'
// @has aCrate/index.html '//a[@href="a_nested_module/index.html"]' 'a_nested_module'
pub use a_module::a_nested_module;
@@ -36,7 +36,7 @@ pub use a_module::{
};
// @has aCrate/index.html '//a[@href="fn.private_function.html"]' 'private_function'
-// @!has aCrate/fn.private_function.html 'a_module'
+// @!hasraw aCrate/fn.private_function.html 'a_module'
// @has aCrate/index.html '//a[@href="fn.other_private_function.html"]' 'other_private_function'
-// @!has aCrate/fn.other_private_function.html 'a_module'
+// @!hasraw aCrate/fn.other_private_function.html 'a_module'
pub use a_module::{other_private_function, private_function};
diff --git a/src/test/rustdoc/no-crate-filter.rs b/src/test/rustdoc/no-crate-filter.rs
index c694d1456..b2f899064 100644
--- a/src/test/rustdoc/no-crate-filter.rs
+++ b/src/test/rustdoc/no-crate-filter.rs
@@ -2,5 +2,5 @@
// compile-flags: -Z unstable-options --disable-per-crate-search
-// @!has 'foo/struct.Foo.html' '//*[id="crate-search"]'
+// @!has 'foo/struct.Foo.html' '//*[id="crate-search"]' ''
pub struct Foo;
diff --git a/src/test/rustdoc/normalize-assoc-item.rs b/src/test/rustdoc/normalize-assoc-item.rs
index ad1a868ee..db56f6852 100644
--- a/src/test/rustdoc/normalize-assoc-item.rs
+++ b/src/test/rustdoc/normalize-assoc-item.rs
@@ -11,11 +11,24 @@ impl Trait for usize {
type X = isize;
}
+impl Trait for () {
+ type X = fn() -> i32;
+}
+
+impl Trait for isize {
+ type X = <() as Trait>::X;
+}
+
// @has 'normalize_assoc_item/fn.f.html' '//pre[@class="rust fn"]' 'pub fn f() -> isize'
pub fn f() -> <usize as Trait>::X {
0
}
+// @has 'normalize_assoc_item/fn.f2.html' '//pre[@class="rust fn"]' 'pub fn f2() -> fn() -> i32'
+pub fn f2() -> <isize as Trait>::X {
+ todo!()
+}
+
pub struct S {
// @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.box_me_up"]' 'box_me_up: Box<S, Global>'
pub box_me_up: <S as Trait>::X,
diff --git a/src/test/rustdoc/not-wf-ambiguous-normalization.rs b/src/test/rustdoc/not-wf-ambiguous-normalization.rs
new file mode 100644
index 000000000..1e9f925f8
--- /dev/null
+++ b/src/test/rustdoc/not-wf-ambiguous-normalization.rs
@@ -0,0 +1,24 @@
+// compile-flags: -Znormalize-docs
+
+#![feature(type_alias_impl_trait)]
+
+trait Allocator {
+ type Buffer;
+}
+
+struct DefaultAllocator;
+
+// This unconstrained impl parameter causes the normalization of
+// `<DefaultAllocator as Allocator>::Buffer` to be ambiguous,
+// which caused an ICE with `-Znormalize-docs`.
+impl<T> Allocator for DefaultAllocator {
+ type Buffer = ();
+}
+
+type A = impl Fn(<DefaultAllocator as Allocator>::Buffer);
+
+fn foo() -> A {
+ |_| ()
+}
+
+fn main() {}
diff --git a/src/test/rustdoc/primitive-reference.rs b/src/test/rustdoc/primitive-reference.rs
new file mode 100644
index 000000000..ea8d2d166
--- /dev/null
+++ b/src/test/rustdoc/primitive-reference.rs
@@ -0,0 +1,37 @@
+#![crate_name = "foo"]
+
+#![feature(rustdoc_internals)]
+
+// @has foo/index.html
+// @has - '//h2[@id="primitives"]' 'Primitive Types'
+// @has - '//a[@href="primitive.reference.html"]' 'reference'
+// @has - '//div[@class="sidebar-elems"]//li/a' 'Primitive Types'
+// @has - '//div[@class="sidebar-elems"]//li/a/@href' '#primitives'
+// @has foo/primitive.reference.html
+// @has - '//a[@class="primitive"]' 'reference'
+// @has - '//h1[@class="fqn"]' 'Primitive Type reference'
+// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
+
+// There should be only one implementation listed.
+// @count - '//*[@class="impl has-srclink"]' 1
+// @has - '//*[@id="impl-Foo%3C%26A%3E-for-%26B"]/*[@class="code-header"]' \
+// 'impl<A, B> Foo<&A> for &B'
+#[doc(primitive = "reference")]
+/// this is a test!
+mod reference {}
+
+pub struct Bar;
+
+// This implementation should **not** show up.
+impl<T> From<&T> for Bar {
+ fn from(s: &T) -> Self {
+ Bar
+ }
+}
+
+pub trait Foo<T> {
+ fn stuff(&self, other: &T) {}
+}
+
+// This implementation should show up.
+impl<A, B> Foo<&A> for &B {}
diff --git a/src/test/rustdoc/primitive-slice-auto-trait.rs b/src/test/rustdoc/primitive-slice-auto-trait.rs
index b3f511bc1..cdddd6b65 100644
--- a/src/test/rustdoc/primitive-slice-auto-trait.rs
+++ b/src/test/rustdoc/primitive-slice-auto-trait.rs
@@ -4,11 +4,11 @@
#![feature(rustdoc_internals)]
// @has foo/primitive.slice.html '//a[@class="primitive"]' 'slice'
-// @has - '//span[@class="in-band"]' 'Primitive Type slice'
+// @has - '//h1[@class="fqn"]' 'Primitive Type slice'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @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'
+// @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")]
/// this is a test!
mod slice_prim {}
diff --git a/src/test/rustdoc/primitive-tuple-auto-trait.rs b/src/test/rustdoc/primitive-tuple-auto-trait.rs
index a2fbbf078..df681457f 100644
--- a/src/test/rustdoc/primitive-tuple-auto-trait.rs
+++ b/src/test/rustdoc/primitive-tuple-auto-trait.rs
@@ -4,7 +4,7 @@
#![feature(rustdoc_internals)]
// @has foo/primitive.tuple.html '//a[@class="primitive"]' 'tuple'
-// @has - '//span[@class="in-band"]' 'Primitive Type tuple'
+// @has - '//h1[@class="fqn"]' 'Primitive Type tuple'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'Send'
diff --git a/src/test/rustdoc/primitive-unit-auto-trait.rs b/src/test/rustdoc/primitive-unit-auto-trait.rs
index 76182622e..391e33bea 100644
--- a/src/test/rustdoc/primitive-unit-auto-trait.rs
+++ b/src/test/rustdoc/primitive-unit-auto-trait.rs
@@ -4,7 +4,7 @@
#![feature(rustdoc_internals)]
// @has foo/primitive.unit.html '//a[@class="primitive"]' 'unit'
-// @has - '//span[@class="in-band"]' 'Primitive Type unit'
+// @has - '//h1[@class="fqn"]' 'Primitive Type unit'
// @has - '//section[@id="main-content"]//div[@class="docblock"]//p' 'this is a test!'
// @has - '//h2[@id="synthetic-implementations"]' 'Auto Trait Implementations'
// @has - '//div[@id="synthetic-implementations-list"]//h3' 'impl Send for ()'
diff --git a/src/test/rustdoc/primitive.rs b/src/test/rustdoc/primitive.rs
index 605ca4d17..6347fdac3 100644
--- a/src/test/rustdoc/primitive.rs
+++ b/src/test/rustdoc/primitive.rs
@@ -7,7 +7,7 @@
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a' 'Primitive Types'
// @has foo/index.html '//div[@class="sidebar-elems"]//li/a/@href' '#primitives'
// @has foo/primitive.i32.html '//a[@class="primitive"]' 'i32'
-// @has foo/primitive.i32.html '//span[@class="in-band"]' 'Primitive Type i32'
+// @has foo/primitive.i32.html '//h1[@class="fqn"]' 'Primitive Type i32'
// @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' '🔒'
diff --git a/src/test/rustdoc/primitive/primitive-generic-impl.rs b/src/test/rustdoc/primitive/primitive-generic-impl.rs
index eebb2cf5a..7b336b398 100644
--- a/src/test/rustdoc/primitive/primitive-generic-impl.rs
+++ b/src/test/rustdoc/primitive/primitive-generic-impl.rs
@@ -1,7 +1,7 @@
#![feature(rustdoc_internals)]
#![crate_name = "foo"]
-// @has foo/primitive.i32.html '//*[@id="impl-ToString-for-i32"]//h3[@class="code-header in-band"]' 'impl<T> ToString for T'
+// @has foo/primitive.i32.html '//*[@id="impl-ToString-for-i32"]//h3[@class="code-header"]' 'impl<T> ToString for T'
#[doc(primitive = "i32")]
/// Some useless docs, wouhou!
diff --git a/src/test/rustdoc/recursive-deref.rs b/src/test/rustdoc/recursive-deref.rs
index a7504fbcc..aa38485c4 100644
--- a/src/test/rustdoc/recursive-deref.rs
+++ b/src/test/rustdoc/recursive-deref.rs
@@ -9,7 +9,7 @@ impl C {
pub fn c(&self) {}
}
-// @has recursive_deref/struct.A.html '//h3[@class="code-header in-band"]' 'impl Deref for A'
+// @has recursive_deref/struct.A.html '//h3[@class="code-header"]' 'impl Deref for A'
// @has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)'
impl Deref for A {
type Target = B;
@@ -19,7 +19,7 @@ impl Deref for A {
}
}
-// @has recursive_deref/struct.B.html '//h3[@class="code-header in-band"]' 'impl Deref for B'
+// @has recursive_deref/struct.B.html '//h3[@class="code-header"]' 'impl Deref for B'
// @has '-' '//*[@class="impl-items"]//*[@id="method.c"]' 'pub fn c(&self)'
impl Deref for B {
type Target = C;
@@ -29,7 +29,7 @@ impl Deref for B {
}
}
-// @has recursive_deref/struct.C.html '//h3[@class="code-header in-band"]' 'impl Deref for C'
+// @has recursive_deref/struct.C.html '//h3[@class="code-header"]' 'impl Deref for C'
impl Deref for C {
type Target = B;
@@ -49,9 +49,9 @@ impl G {
pub fn g() {}
}
-// @has recursive_deref/struct.D.html '//h3[@class="code-header in-band"]' 'impl Deref for D'
+// @has recursive_deref/struct.D.html '//h3[@class="code-header"]' 'impl Deref for D'
// We also check that `G::g` method isn't rendered because there is no `self` argument.
-// @!has '-' '//*[@id="deref-methods-G"]'
+// @!has '-' '//*[@id="deref-methods-G"]' ''
impl Deref for D {
type Target = E;
@@ -60,9 +60,9 @@ impl Deref for D {
}
}
-// @has recursive_deref/struct.E.html '//h3[@class="code-header in-band"]' 'impl Deref for E'
+// @has recursive_deref/struct.E.html '//h3[@class="code-header"]' 'impl Deref for E'
// We also check that `G::g` method isn't rendered because there is no `self` argument.
-// @!has '-' '//*[@id="deref-methods-G"]'
+// @!has '-' '//*[@id="deref-methods-G"]' ''
impl Deref for E {
type Target = F;
@@ -71,9 +71,9 @@ impl Deref for E {
}
}
-// @has recursive_deref/struct.F.html '//h3[@class="code-header in-band"]' 'impl Deref for F'
+// @has recursive_deref/struct.F.html '//h3[@class="code-header"]' 'impl Deref for F'
// We also check that `G::g` method isn't rendered because there is no `self` argument.
-// @!has '-' '//*[@id="deref-methods-G"]'
+// @!has '-' '//*[@id="deref-methods-G"]' ''
impl Deref for F {
type Target = G;
@@ -82,7 +82,7 @@ impl Deref for F {
}
}
-// @has recursive_deref/struct.G.html '//h3[@class="code-header in-band"]' 'impl Deref for G'
+// @has recursive_deref/struct.G.html '//h3[@class="code-header"]' 'impl Deref for G'
impl Deref for G {
type Target = E;
@@ -100,8 +100,8 @@ impl I {
pub fn i() {}
}
-// @has recursive_deref/struct.H.html '//h3[@class="code-header in-band"]' 'impl Deref for H'
-// @!has '-' '//*[@id="deref-methods-I"]'
+// @has recursive_deref/struct.H.html '//h3[@class="code-header"]' 'impl Deref for H'
+// @!has '-' '//*[@id="deref-methods-I"]' ''
impl Deref for H {
type Target = I;
@@ -110,7 +110,7 @@ impl Deref for H {
}
}
-// @has recursive_deref/struct.I.html '//h3[@class="code-header in-band"]' 'impl Deref for I'
+// @has recursive_deref/struct.I.html '//h3[@class="code-header"]' 'impl Deref for I'
impl Deref for I {
type Target = H;
diff --git a/src/test/rustdoc/reexport-dep-foreign-fn.rs b/src/test/rustdoc/reexport-dep-foreign-fn.rs
index 6e1dc4539..6694c91d1 100644
--- a/src/test/rustdoc/reexport-dep-foreign-fn.rs
+++ b/src/test/rustdoc/reexport-dep-foreign-fn.rs
@@ -8,5 +8,5 @@
extern crate all_item_types;
// @has 'foo/fn.foo_ffn.html'
-// @has - '//*[@class="docblock item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
+// @has - '//*[@class="item-decl"]//code' 'pub unsafe extern "C" fn foo_ffn()'
pub use all_item_types::foo_ffn;
diff --git a/src/test/rustdoc/reexport-doc.rs b/src/test/rustdoc/reexport-doc.rs
new file mode 100644
index 000000000..df2c889b4
--- /dev/null
+++ b/src/test/rustdoc/reexport-doc.rs
@@ -0,0 +1,8 @@
+// aux-build:reexport-doc-aux.rs
+
+extern crate reexport_doc_aux as dep;
+
+// @has 'reexport_doc/struct.Foo.html'
+// @count - '//p' 'These are the docs for Foo.' 1
+/// These are the docs for Foo.
+pub use dep::Foo;
diff --git a/src/test/rustdoc/reexports-priv.rs b/src/test/rustdoc/reexports-priv.rs
index aea9b9f2b..11364e7f7 100644
--- a/src/test/rustdoc/reexports-priv.rs
+++ b/src/test/rustdoc/reexports-priv.rs
@@ -5,7 +5,7 @@
extern crate reexports;
-// @has 'foo/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+// @has 'foo/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
pub use reexports::addr_of;
// @!has 'foo/macro.addr_of_crate.html'
pub(crate) use reexports::addr_of_crate;
@@ -14,7 +14,7 @@ pub(self) use reexports::addr_of_self;
// @!has 'foo/macro.addr_of_local.html'
use reexports::addr_of_local;
-// @has 'foo/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+// @has 'foo/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
pub use reexports::Foo;
// @!has 'foo/struct.FooCrate.html'
pub(crate) use reexports::FooCrate;
@@ -23,7 +23,7 @@ pub(self) use reexports::FooSelf;
// @!has 'foo/struct.FooLocal.html'
use reexports::FooLocal;
-// @has 'foo/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+// @has 'foo/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
pub use reexports::Bar;
// @!has 'foo/enum.BarCrate.html'
pub(crate) use reexports::BarCrate;
@@ -50,7 +50,7 @@ pub(self) use reexports::TypeSelf;
// @!has 'foo/type.TypeLocal.html'
use reexports::TypeLocal;
-// @has 'foo/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+// @has 'foo/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
pub use reexports::Union;
// @!has 'foo/union.UnionCrate.html'
pub(crate) use reexports::UnionCrate;
@@ -61,33 +61,33 @@ use reexports::UnionLocal;
pub mod outer {
pub mod inner {
- // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+ // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
pub use reexports::addr_of;
- // @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="docblock item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
+ // @has 'foo/outer/inner/macro.addr_of_crate.html' '//*[@class="item-decl"]' 'pub(crate) macro addr_of_crate($place:expr) {'
pub(crate) use reexports::addr_of_crate;
- // @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="docblock item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
+ // @has 'foo/outer/inner/macro.addr_of_super.html' '//*[@class="item-decl"]' 'pub(in outer) macro addr_of_super($place:expr) {'
pub(super) use reexports::addr_of_super;
// @!has 'foo/outer/inner/macro.addr_of_self.html'
pub(self) use reexports::addr_of_self;
// @!has 'foo/outer/inner/macro.addr_of_local.html'
use reexports::addr_of_local;
- // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+ // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
pub use reexports::Foo;
- // @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) struct FooCrate;'
+ // @has 'foo/outer/inner/struct.FooCrate.html' '//*[@class="item-decl"]' 'pub(crate) struct FooCrate;'
pub(crate) use reexports::FooCrate;
- // @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) struct FooSuper;'
+ // @has 'foo/outer/inner/struct.FooSuper.html' '//*[@class="item-decl"]' 'pub(in outer) struct FooSuper;'
pub(super) use reexports::FooSuper;
// @!has 'foo/outer/inner/struct.FooSelf.html'
pub(self) use reexports::FooSelf;
// @!has 'foo/outer/inner/struct.FooLocal.html'
use reexports::FooLocal;
- // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+ // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
pub use reexports::Bar;
- // @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) enum BarCrate {'
+ // @has 'foo/outer/inner/enum.BarCrate.html' '//*[@class="item-decl"]' 'pub(crate) enum BarCrate {'
pub(crate) use reexports::BarCrate;
- // @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) enum BarSuper {'
+ // @has 'foo/outer/inner/enum.BarSuper.html' '//*[@class="item-decl"]' 'pub(in outer) enum BarSuper {'
pub(super) use reexports::BarSuper;
// @!has 'foo/outer/inner/enum.BarSelf.html'
pub(self) use reexports::BarSelf;
@@ -116,11 +116,11 @@ pub mod outer {
// @!has 'foo/outer/inner/type.TypeLocal.html'
use reexports::TypeLocal;
- // @has 'foo/outer/inner/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+ // @has 'foo/outer/inner/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
pub use reexports::Union;
- // @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="docblock item-decl"]' 'pub(crate) union UnionCrate {'
+ // @has 'foo/outer/inner/union.UnionCrate.html' '//*[@class="item-decl"]' 'pub(crate) union UnionCrate {'
pub(crate) use reexports::UnionCrate;
- // @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="docblock item-decl"]' 'pub(in outer) union UnionSuper {'
+ // @has 'foo/outer/inner/union.UnionSuper.html' '//*[@class="item-decl"]' 'pub(in outer) union UnionSuper {'
pub(super) use reexports::UnionSuper;
// @!has 'foo/outer/inner/union.UnionSelf.html'
pub(self) use reexports::UnionSelf;
diff --git a/src/test/rustdoc/reexports.rs b/src/test/rustdoc/reexports.rs
index 7abcbfb61..9aa6d7224 100644
--- a/src/test/rustdoc/reexports.rs
+++ b/src/test/rustdoc/reexports.rs
@@ -4,7 +4,7 @@
extern crate reexports;
-// @has 'foo/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+// @has 'foo/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
pub use reexports::addr_of;
// @!has 'foo/macro.addr_of_crate.html'
pub(crate) use reexports::addr_of_crate;
@@ -13,7 +13,7 @@ pub(self) use reexports::addr_of_self;
// @!has 'foo/macro.addr_of_local.html'
use reexports::addr_of_local;
-// @has 'foo/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+// @has 'foo/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
pub use reexports::Foo;
// @!has 'foo/struct.FooCrate.html'
pub(crate) use reexports::FooCrate;
@@ -22,7 +22,7 @@ pub(self) use reexports::FooSelf;
// @!has 'foo/struct.FooLocal.html'
use reexports::FooLocal;
-// @has 'foo/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+// @has 'foo/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
pub use reexports::Bar;
// @!has 'foo/enum.BarCrate.html'
pub(crate) use reexports::BarCrate;
@@ -49,7 +49,7 @@ pub(self) use reexports::TypeSelf;
// @!has 'foo/type.TypeLocal.html'
use reexports::TypeLocal;
-// @has 'foo/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+// @has 'foo/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
pub use reexports::Union;
// @!has 'foo/union.UnionCrate.html'
pub(crate) use reexports::UnionCrate;
@@ -60,7 +60,7 @@ use reexports::UnionLocal;
pub mod outer {
pub mod inner {
- // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="docblock item-decl"]' 'pub macro addr_of($place:expr) {'
+ // @has 'foo/outer/inner/macro.addr_of.html' '//*[@class="item-decl"]' 'pub macro addr_of($place:expr) {'
pub use reexports::addr_of;
// @!has 'foo/outer/inner/macro.addr_of_crate.html'
pub(crate) use reexports::addr_of_crate;
@@ -71,7 +71,7 @@ pub mod outer {
// @!has 'foo/outer/inner/macro.addr_of_local.html'
use reexports::addr_of_local;
- // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="docblock item-decl"]' 'pub struct Foo;'
+ // @has 'foo/outer/inner/struct.Foo.html' '//*[@class="item-decl"]' 'pub struct Foo;'
pub use reexports::Foo;
// @!has 'foo/outer/inner/struct.FooCrate.html'
pub(crate) use reexports::FooCrate;
@@ -82,7 +82,7 @@ pub mod outer {
// @!has 'foo/outer/inner/struct.FooLocal.html'
use reexports::FooLocal;
- // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="docblock item-decl"]' 'pub enum Bar {'
+ // @has 'foo/outer/inner/enum.Bar.html' '//*[@class="item-decl"]' 'pub enum Bar {'
pub use reexports::Bar;
// @!has 'foo/outer/inner/enum.BarCrate.html'
pub(crate) use reexports::BarCrate;
@@ -115,7 +115,7 @@ pub mod outer {
// @!has 'foo/outer/inner/type.TypeLocal.html'
use reexports::TypeLocal;
- // @has 'foo/outer/inner/union.Union.html' '//*[@class="docblock item-decl"]' 'pub union Union {'
+ // @has 'foo/outer/inner/union.Union.html' '//*[@class="item-decl"]' 'pub union Union {'
pub use reexports::Union;
// @!has 'foo/outer/inner/union.UnionCrate.html'
pub(crate) use reexports::UnionCrate;
diff --git a/src/test/rustdoc/remove-url-from-headings.rs b/src/test/rustdoc/remove-url-from-headings.rs
index e2b232a6e..599c429a6 100644
--- a/src/test/rustdoc/remove-url-from-headings.rs
+++ b/src/test/rustdoc/remove-url-from-headings.rs
@@ -1,7 +1,7 @@
#![crate_name = "foo"]
// @has foo/fn.foo.html
-// @!has - '//a[@href="http://a.a"]'
+// @!has - '//a[@href="http://a.a"]' ''
// @has - '//a[@href="#implementing-stuff-somewhere"]' 'Implementing stuff somewhere'
// @has - '//a[@href="#another-one-urg"]' 'Another one urg'
diff --git a/src/test/rustdoc/rfc-2632-const-trait-impl.rs b/src/test/rustdoc/rfc-2632-const-trait-impl.rs
index f3e211e30..602ee1b1b 100644
--- a/src/test/rustdoc/rfc-2632-const-trait-impl.rs
+++ b/src/test/rustdoc/rfc-2632-const-trait-impl.rs
@@ -18,10 +18,10 @@ pub struct S<T>(T);
// @has - '//pre[@class="rust trait"]/code/span[@class="where"]' ': Clone'
#[const_trait]
pub trait Tr<T> {
- // @!has - '//div[@id="method.a"]/h4[@class="code-header"]' '~const'
- // @has - '//div[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Clone'
- // @!has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const'
- // @has - '//div[@id="method.a"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone'
+ // @!has - '//section[@id="method.a"]/h4[@class="code-header"]' '~const'
+ // @has - '//section[@id="method.a"]/h4[@class="code-header"]/a[@class="trait"]' 'Clone'
+ // @!has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where"]' '~const'
+ // @has - '//section[@id="method.a"]/h4[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone'
fn a<A: ~const Clone + ~const Destruct>()
where
Option<A>: ~const Clone + ~const Destruct,
@@ -30,10 +30,10 @@ pub trait Tr<T> {
}
// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]' ''
-// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]' '~const'
-// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]/a[@class="trait"]' 'Clone'
-// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]/span[@class="where"]' '~const'
-// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header in-band"]/span[@class="where fmt-newline"]' ': Clone'
+// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]' '~const'
+// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/a[@class="trait"]' 'Clone'
+// @!has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where"]' '~const'
+// @has - '//section[@id="impl-Tr%3CT%3E-for-T"]/h3[@class="code-header"]/span[@class="where fmt-newline"]' ': Clone'
impl<T: ~const Clone + ~const Destruct> const Tr<T> for T
where
Option<T>: ~const Clone + ~const Destruct,
diff --git a/src/test/rustdoc/rustc-incoherent-impls.rs b/src/test/rustdoc/rustc-incoherent-impls.rs
new file mode 100644
index 000000000..3fdefbecc
--- /dev/null
+++ b/src/test/rustdoc/rustc-incoherent-impls.rs
@@ -0,0 +1,28 @@
+// aux-build:incoherent-impl-types.rs
+// build-aux-docs
+
+#![crate_name = "foo"]
+#![feature(rustc_attrs)]
+
+extern crate incoherent_impl_types;
+
+// The only way this actually shows up is if the type gets inlined.
+#[doc(inline)]
+pub use incoherent_impl_types::FooTrait;
+
+// @has foo/trait.FooTrait.html
+// @count - '//section[@id="method.do_something"]' 1
+impl dyn FooTrait {
+ #[rustc_allow_incoherent_impl]
+ pub fn do_something() {}
+}
+
+#[doc(inline)]
+pub use incoherent_impl_types::FooStruct;
+
+// @has foo/struct.FooStruct.html
+// @count - '//section[@id="method.do_something"]' 1
+impl FooStruct {
+ #[rustc_allow_incoherent_impl]
+ pub fn do_something() {}
+}
diff --git a/src/test/rustdoc/safe-intrinsic.rs b/src/test/rustdoc/safe-intrinsic.rs
index d3bb8514b..d08abdaeb 100644
--- a/src/test/rustdoc/safe-intrinsic.rs
+++ b/src/test/rustdoc/safe-intrinsic.rs
@@ -1,5 +1,6 @@
#![feature(intrinsics)]
#![feature(no_core)]
+#![feature(rustc_attrs)]
#![no_core]
#![crate_name = "foo"]
@@ -7,6 +8,7 @@
extern "rust-intrinsic" {
// @has 'foo/fn.abort.html'
// @has - '//pre[@class="rust fn"]' 'pub extern "rust-intrinsic" fn abort() -> !'
+ #[rustc_safe_intrinsic]
pub fn abort() -> !;
// @has 'foo/fn.unreachable.html'
// @has - '//pre[@class="rust fn"]' 'pub unsafe extern "rust-intrinsic" fn unreachable() -> !'
diff --git a/src/test/rustdoc/search-index-summaries.rs b/src/test/rustdoc/search-index-summaries.rs
index dd9c1a0b4..efd366405 100644
--- a/src/test/rustdoc/search-index-summaries.rs
+++ b/src/test/rustdoc/search-index-summaries.rs
@@ -1,8 +1,8 @@
#![crate_name = "foo"]
-// @has 'search-index.js' 'Foo short link.'
-// @!has - 'www.example.com'
-// @!has - 'More Foo.'
+// @hasraw 'search-index.js' 'Foo short link.'
+// @!hasraw - 'www.example.com'
+// @!hasraw - 'More Foo.'
/// Foo short [link](https://www.example.com/).
///
diff --git a/src/test/rustdoc/search-index.rs b/src/test/rustdoc/search-index.rs
index f1b78f172..d1d05eb88 100644
--- a/src/test/rustdoc/search-index.rs
+++ b/src/test/rustdoc/search-index.rs
@@ -2,25 +2,25 @@
use std::ops::Deref;
-// @has search-index.js Foo
+// @hasraw search-index.js Foo
pub use private::Foo;
mod private {
pub struct Foo;
impl Foo {
- pub fn test_method() {} // @has - test_method
- fn priv_method() {} // @!has - priv_method
+ pub fn test_method() {} // @hasraw - test_method
+ fn priv_method() {} // @!hasraw - priv_method
}
pub trait PrivateTrait {
- fn trait_method(&self) {} // @!has - priv_method
+ fn trait_method(&self) {} // @!hasraw - priv_method
}
}
pub struct Bar;
impl Deref for Bar {
- // @!has search-index.js Target
+ // @!hasraw search-index.js Target
type Target = Bar;
fn deref(&self) -> &Bar { self }
}
diff --git a/src/test/rustdoc/short-docblock-codeblock.rs b/src/test/rustdoc/short-docblock-codeblock.rs
index c6b318b06..3c5fa7b36 100644
--- a/src/test/rustdoc/short-docblock-codeblock.rs
+++ b/src/test/rustdoc/short-docblock-codeblock.rs
@@ -1,8 +1,6 @@
#![crate_name = "foo"]
-// @has foo/index.html '//*[@class="item-right docblock-short"]' ""
-// @!has foo/index.html '//*[@class="item-right docblock-short"]' "Some text."
-// @!has foo/index.html '//*[@class="item-right docblock-short"]' "let x = 12;"
+// @count foo/index.html '//*[@class="item-right docblock-short"]' 0
/// ```
/// let x = 12;
diff --git a/src/test/rustdoc/short-docblock.rs b/src/test/rustdoc/short-docblock.rs
index 17c44eab0..1a8a689be 100644
--- a/src/test/rustdoc/short-docblock.rs
+++ b/src/test/rustdoc/short-docblock.rs
@@ -1,7 +1,7 @@
#![crate_name = "foo"]
-// @has foo/index.html '//*[@class="item-right docblock-short"]/p' 'fooo'
-// @!has foo/index.html '//*[@class="item-right docblock-short"]/p/h1' 'fooo'
+// @has foo/index.html '//*[@class="item-right docblock-short"]' 'fooo'
+// @!has foo/index.html '//*[@class="item-right docblock-short"]/h1' 'fooo'
// @has foo/fn.foo.html '//h2[@id="fooo"]/a[@href="#fooo"]' 'fooo'
/// # fooo
@@ -9,8 +9,8 @@
/// foo
pub fn foo() {}
-// @has foo/index.html '//*[@class="item-right docblock-short"]/p' 'mooood'
-// @!has foo/index.html '//*[@class="item-right docblock-short"]/p/h2' 'mooood'
+// @has foo/index.html '//*[@class="item-right docblock-short"]' 'mooood'
+// @!has foo/index.html '//*[@class="item-right docblock-short"]/h2' 'mooood'
// @has foo/foo/index.html '//h3[@id="mooood"]/a[@href="#mooood"]' 'mooood'
/// ## mooood
@@ -18,7 +18,7 @@ pub fn foo() {}
/// foo mod
pub mod foo {}
-// @has foo/index.html '//*[@class="item-right docblock-short"]/p/a[@href=\
+// @has foo/index.html '//*[@class="item-right docblock-short"]/a[@href=\
// "https://nougat.world"]/code' 'nougat'
/// [`nougat`](https://nougat.world)
diff --git a/src/test/rustdoc/show-const-contents.rs b/src/test/rustdoc/show-const-contents.rs
index 48b608859..69e742ee7 100644
--- a/src/test/rustdoc/show-const-contents.rs
+++ b/src/test/rustdoc/show-const-contents.rs
@@ -1,57 +1,57 @@
// Test that the contents of constants are displayed as part of the
// documentation.
-// @has show_const_contents/constant.CONST_S.html 'show this'
-// @!has show_const_contents/constant.CONST_S.html '; //'
+// @hasraw show_const_contents/constant.CONST_S.html 'show this'
+// @!hasraw show_const_contents/constant.CONST_S.html '; //'
pub const CONST_S: &'static str = "show this";
-// @has show_const_contents/constant.CONST_I32.html '= 42;'
-// @!has show_const_contents/constant.CONST_I32.html '; //'
+// @hasraw show_const_contents/constant.CONST_I32.html '= 42;'
+// @!hasraw show_const_contents/constant.CONST_I32.html '; //'
pub const CONST_I32: i32 = 42;
-// @has show_const_contents/constant.CONST_I32_HEX.html '= 0x42;'
-// @!has show_const_contents/constant.CONST_I32_HEX.html '; //'
+// @hasraw show_const_contents/constant.CONST_I32_HEX.html '= 0x42;'
+// @!hasraw show_const_contents/constant.CONST_I32_HEX.html '; //'
pub const CONST_I32_HEX: i32 = 0x42;
-// @has show_const_contents/constant.CONST_NEG_I32.html '= -42;'
-// @!has show_const_contents/constant.CONST_NEG_I32.html '; //'
+// @hasraw show_const_contents/constant.CONST_NEG_I32.html '= -42;'
+// @!hasraw show_const_contents/constant.CONST_NEG_I32.html '; //'
pub const CONST_NEG_I32: i32 = -42;
-// @has show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;'
-// @!has show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '// 42i32'
+// @hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '= 42i32;'
+// @!hasraw show_const_contents/constant.CONST_EQ_TO_VALUE_I32.html '// 42i32'
pub const CONST_EQ_TO_VALUE_I32: i32 = 42i32;
-// @has show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32'
+// @hasraw show_const_contents/constant.CONST_CALC_I32.html '= _; // 43i32'
pub const CONST_CALC_I32: i32 = 42 + 1;
-// @!has show_const_contents/constant.CONST_REF_I32.html '= &42;'
-// @!has show_const_contents/constant.CONST_REF_I32.html '; //'
+// @!hasraw show_const_contents/constant.CONST_REF_I32.html '= &42;'
+// @!hasraw show_const_contents/constant.CONST_REF_I32.html '; //'
pub const CONST_REF_I32: &'static i32 = &42;
-// @has show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32'
+// @hasraw show_const_contents/constant.CONST_I32_MAX.html '= i32::MAX; // 2_147_483_647i32'
pub const CONST_I32_MAX: i32 = i32::MAX;
-// @!has show_const_contents/constant.UNIT.html '= ();'
-// @!has show_const_contents/constant.UNIT.html '; //'
+// @!hasraw show_const_contents/constant.UNIT.html '= ();'
+// @!hasraw show_const_contents/constant.UNIT.html '; //'
pub const UNIT: () = ();
pub struct MyType(i32);
-// @!has show_const_contents/constant.MY_TYPE.html '= MyType(42);'
-// @!has show_const_contents/constant.MY_TYPE.html '; //'
+// @!hasraw show_const_contents/constant.MY_TYPE.html '= MyType(42);'
+// @!hasraw show_const_contents/constant.MY_TYPE.html '; //'
pub const MY_TYPE: MyType = MyType(42);
pub struct MyTypeWithStr(&'static str);
-// @!has show_const_contents/constant.MY_TYPE_WITH_STR.html '= MyTypeWithStr("show this");'
-// @!has show_const_contents/constant.MY_TYPE_WITH_STR.html '; //'
+// @!hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '= MyTypeWithStr("show this");'
+// @!hasraw show_const_contents/constant.MY_TYPE_WITH_STR.html '; //'
pub const MY_TYPE_WITH_STR: MyTypeWithStr = MyTypeWithStr("show this");
-// @has show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288f32;'
-// @has show_const_contents/constant.PI.html '; // 3.14159274f32'
+// @hasraw show_const_contents/constant.PI.html '= 3.14159265358979323846264338327950288f32;'
+// @hasraw show_const_contents/constant.PI.html '; // 3.14159274f32'
pub use std::f32::consts::PI;
-// @has show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32'
+// @hasraw show_const_contents/constant.MAX.html '= i32::MAX; // 2_147_483_647i32'
#[allow(deprecated, deprecated_in_future)]
pub use std::i32::MAX;
@@ -61,7 +61,7 @@ macro_rules! int_module {
)
}
-// @has show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16'
+// @hasraw show_const_contents/constant.MIN.html '= i16::MIN; // -32_768i16'
int_module!(i16);
// @has show_const_contents/constant.ESCAPE.html //pre '= r#"<script>alert("ESCAPE");</script>"#;'
diff --git a/src/test/rustdoc/sidebar-all-page.rs b/src/test/rustdoc/sidebar-all-page.rs
new file mode 100644
index 000000000..e74b981de
--- /dev/null
+++ b/src/test/rustdoc/sidebar-all-page.rs
@@ -0,0 +1,35 @@
+#![crate_name = "foo"]
+
+#![feature(rustdoc_internals)]
+
+// @has 'foo/all.html'
+// @has - '//*[@class="sidebar-elems"]//li' 'Structs'
+// @has - '//*[@class="sidebar-elems"]//li' 'Enums'
+// @has - '//*[@class="sidebar-elems"]//li' 'Unions'
+// @has - '//*[@class="sidebar-elems"]//li' 'Functions'
+// @has - '//*[@class="sidebar-elems"]//li' 'Traits'
+// @has - '//*[@class="sidebar-elems"]//li' 'Macros'
+// @has - '//*[@class="sidebar-elems"]//li' 'Type Definitions'
+// @has - '//*[@class="sidebar-elems"]//li' 'Constants'
+// @has - '//*[@class="sidebar-elems"]//li' 'Statics'
+// @has - '//*[@class="sidebar-elems"]//li' 'Primitive Types'
+
+pub struct Foo;
+pub enum Enum {
+ A,
+}
+pub union Bar {
+ a: u8,
+ b: u16,
+}
+pub fn foo() {}
+pub trait Trait {}
+#[macro_export]
+macro_rules! foo {
+ () => {}
+}
+pub type Type = u8;
+pub const FOO: u8 = 0;
+pub static BAR: u8 = 0;
+#[doc(primitive = "u8")]
+mod u8 {}
diff --git a/src/test/rustdoc/sidebar-items.rs b/src/test/rustdoc/sidebar-items.rs
index b5b681ab0..6f7afa59b 100644
--- a/src/test/rustdoc/sidebar-items.rs
+++ b/src/test/rustdoc/sidebar-items.rs
@@ -2,17 +2,17 @@
#![crate_name = "foo"]
// @has foo/trait.Foo.html
-// @has - '//*[@class="sidebar-title"]/a[@href="#required-methods"]' 'Required Methods'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-methods"]' 'Required Methods'
// @has - '//*[@class="sidebar-elems"]//section//a' 'bar'
-// @has - '//*[@class="sidebar-title"]/a[@href="#provided-methods"]' 'Provided Methods'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-methods"]' 'Provided Methods'
// @has - '//*[@class="sidebar-elems"]//section//a' 'foo'
-// @has - '//*[@class="sidebar-title"]/a[@href="#required-associated-consts"]' 'Required Associated Constants'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-consts"]' 'Required Associated Constants'
// @has - '//*[@class="sidebar-elems"]//section//a' 'FOO'
-// @has - '//*[@class="sidebar-title"]/a[@href="#provided-associated-consts"]' 'Provided Associated Constants'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-consts"]' 'Provided Associated Constants'
// @has - '//*[@class="sidebar-elems"]//section//a' 'BAR'
-// @has - '//*[@class="sidebar-title"]/a[@href="#required-associated-types"]' 'Required Associated Types'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#required-associated-types"]' 'Required Associated Types'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Output'
-// @has - '//*[@class="sidebar-title"]/a[@href="#provided-associated-types"]' 'Provided Associated Types'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#provided-associated-types"]' 'Provided Associated Types'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Extra'
pub trait Foo {
const FOO: usize;
@@ -25,7 +25,7 @@ pub trait Foo {
}
// @has foo/struct.Bar.html
-// @has - '//*[@class="sidebar-title"]/a[@href="#fields"]' 'Fields'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f"]' 'f'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.u"]' 'u'
// @!has - '//*[@class="sidebar-elems"]//section//a' 'waza'
@@ -36,7 +36,7 @@ pub struct Bar {
}
// @has foo/enum.En.html
-// @has - '//*[@class="sidebar-title"]/a[@href="#variants"]' 'Variants'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#variants"]' 'Variants'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Foo'
// @has - '//*[@class="sidebar-elems"]//section//a' 'Bar'
pub enum En {
@@ -45,7 +45,7 @@ pub enum En {
}
// @has foo/union.MyUnion.html
-// @has - '//*[@class="sidebar-title"]/a[@href="#fields"]' 'Fields'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Fields'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f1"]' 'f1'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#structfield.f2"]' 'f2'
// @!has - '//*[@class="sidebar-elems"]//section//a' 'waza'
diff --git a/src/test/rustdoc/sidebar-links-to-foreign-impl.rs b/src/test/rustdoc/sidebar-links-to-foreign-impl.rs
index 155150396..11e946948 100644
--- a/src/test/rustdoc/sidebar-links-to-foreign-impl.rs
+++ b/src/test/rustdoc/sidebar-links-to-foreign-impl.rs
@@ -3,12 +3,12 @@
#![crate_name = "foo"]
// @has foo/trait.Foo.html
-// @has - '//*[@class="sidebar-title"]/a[@href="#foreign-impls"]' 'Implementations on Foreign Types'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#foreign-impls"]' 'Implementations on Foreign Types'
// @has - '//h2[@id="foreign-impls"]' 'Implementations on Foreign Types'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#impl-Foo-for-u32"]' 'u32'
-// @has - '//*[@id="impl-Foo-for-u32"]//h3[@class="code-header in-band"]' 'impl Foo for u32'
+// @has - '//*[@id="impl-Foo-for-u32"]//h3[@class="code-header"]' 'impl Foo for u32'
// @has - '//*[@class="sidebar-elems"]//section//a[@href="#impl-Foo-for-%26%27a%20str"]' "&'a str"
-// @has - '//*[@id="impl-Foo-for-%26%27a%20str"]//h3[@class="code-header in-band"]' "impl<'a> Foo for &'a str"
+// @has - '//*[@id="impl-Foo-for-%26%27a%20str"]//h3[@class="code-header"]' "impl<'a> Foo for &'a str"
pub trait Foo {}
impl Foo for u32 {}
diff --git a/src/test/rustdoc/sized_trait.rs b/src/test/rustdoc/sized_trait.rs
index 9d2c19677..feef4de8d 100644
--- a/src/test/rustdoc/sized_trait.rs
+++ b/src/test/rustdoc/sized_trait.rs
@@ -1,17 +1,17 @@
#![crate_name = "foo"]
// @has foo/struct.Bar.html
-// @!has - '//*[@id="impl-Sized"]'
+// @!has - '//*[@id="impl-Sized"]' ''
pub struct Bar {
a: u16,
}
// @has foo/struct.Foo.html
-// @!has - '//*[@id="impl-Sized"]'
+// @!has - '//*[@id="impl-Sized"]' ''
pub struct Foo<T: ?Sized>(T);
// @has foo/struct.Unsized.html
-// @has - '//*[@id="impl-Sized-for-Unsized"]//h3[@class="code-header in-band"]' 'impl !Sized for Unsized'
+// @has - '//*[@id="impl-Sized-for-Unsized"]//h3[@class="code-header"]' 'impl !Sized for Unsized'
pub struct Unsized {
data: [u8],
}
diff --git a/src/test/rustdoc/sort-modules-by-appearance.rs b/src/test/rustdoc/sort-modules-by-appearance.rs
index 5be6b9826..b5cc8bc83 100644
--- a/src/test/rustdoc/sort-modules-by-appearance.rs
+++ b/src/test/rustdoc/sort-modules-by-appearance.rs
@@ -9,5 +9,5 @@ pub mod module_c {}
pub mod module_a {}
-// @matches 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a'
-// @matches 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"'
+// @matchesraw 'sort_modules_by_appearance/index.html' '(?s)module_b.*module_c.*module_a'
+// @matchesraw 'sort_modules_by_appearance/sidebar-items.js' '"module_b".*"module_c".*"module_a"'
diff --git a/src/test/rustdoc/source-file.rs b/src/test/rustdoc/source-file.rs
index 968899dab..4e1664790 100644
--- a/src/test/rustdoc/source-file.rs
+++ b/src/test/rustdoc/source-file.rs
@@ -1,5 +1,5 @@
#![crate_name = "foo"]
-// @has source-files.js source-file.rs
+// @hasraw source-files.js source-file.rs
pub struct Foo;
diff --git a/src/test/rustdoc/src-links-auto-impls.rs b/src/test/rustdoc/src-links-auto-impls.rs
index 69be9aa8d..953563833 100644
--- a/src/test/rustdoc/src-links-auto-impls.rs
+++ b/src/test/rustdoc/src-links-auto-impls.rs
@@ -1,12 +1,12 @@
#![crate_name = "foo"]
// @has foo/struct.Unsized.html
-// @has - '//*[@id="impl-Sized-for-Unsized"]/h3[@class="code-header in-band"]' 'impl !Sized for Unsized'
+// @has - '//*[@id="impl-Sized-for-Unsized"]/h3[@class="code-header"]' 'impl !Sized for Unsized'
// @!has - '//*[@id="impl-Sized-for-Unsized"]//a[@class="srclink"]' 'source'
-// @has - '//*[@id="impl-Sync-for-Unsized"]/h3[@class="code-header in-band"]' 'impl Sync for Unsized'
+// @has - '//*[@id="impl-Sync-for-Unsized"]/h3[@class="code-header"]' 'impl Sync for Unsized'
// @!has - '//*[@id="impl-Sync-for-Unsized"]//a[@class="srclink"]' 'source'
-// @has - '//*[@id="impl-Any-for-Unsized"]/h3[@class="code-header in-band"]' 'impl<T> Any for T'
-// @has - '//*[@id="impl-Any-for-Unsized"]//a[@class="srclink"]' 'source'
+// @has - '//*[@id="impl-Any-for-Unsized"]/h3[@class="code-header"]' 'impl<T> Any for T'
+// @has - '//*[@id="impl-Any-for-Unsized"]//a[@class="srclink rightside"]' 'source'
pub struct Unsized {
data: [u8],
}
diff --git a/src/test/rustdoc/static-root-path.rs b/src/test/rustdoc/static-root-path.rs
index f1d49b9fc..08c055c5b 100644
--- a/src/test/rustdoc/static-root-path.rs
+++ b/src/test/rustdoc/static-root-path.rs
@@ -1,18 +1,18 @@
// compile-flags:-Z unstable-options --static-root-path /cache/
// @has static_root_path/struct.SomeStruct.html
-// @matches - '"/cache/main\.js"'
-// @!matches - '"\.\./main\.js"'
-// @matches - 'data-root-path="\.\./"'
-// @!matches - '"/cache/search-index\.js"'
+// @matchesraw - '"/cache/main\.js"'
+// @!matchesraw - '"\.\./main\.js"'
+// @matchesraw - 'data-root-path="\.\./"'
+// @!matchesraw - '"/cache/search-index\.js"'
pub struct SomeStruct;
// @has src/static_root_path/static-root-path.rs.html
-// @matches - '"/cache/source-script\.js"'
-// @!matches - '"\.\./\.\./source-script\.js"'
-// @matches - '"\.\./\.\./source-files.js"'
-// @!matches - '"/cache/source-files\.js"'
+// @matchesraw - '"/cache/source-script\.js"'
+// @!matchesraw - '"\.\./\.\./source-script\.js"'
+// @matchesraw - '"\.\./\.\./source-files.js"'
+// @!matchesraw - '"/cache/source-files\.js"'
// @has settings.html
-// @matches - '/cache/settings\.js'
-// @!matches - '\./settings\.js'
+// @matchesraw - '/cache/settings\.js'
+// @!matchesraw - '\./settings\.js'
diff --git a/src/test/rustdoc/strip-enum-variant.no-not-shown.html b/src/test/rustdoc/strip-enum-variant.no-not-shown.html
index c4ee1a991..782198956 100644
--- a/src/test/rustdoc/strip-enum-variant.no-not-shown.html
+++ b/src/test/rustdoc/strip-enum-variant.no-not-shown.html
@@ -1 +1 @@
-<ul><li><a href="#variant.Shown">Shown</a></li></ul> \ No newline at end of file
+<ul class="block"><li><a href="#variant.Shown">Shown</a></li></ul> \ No newline at end of file
diff --git a/src/test/rustdoc/strip-enum-variant.rs b/src/test/rustdoc/strip-enum-variant.rs
index f82ffdfed..8753a7dc6 100644
--- a/src/test/rustdoc/strip-enum-variant.rs
+++ b/src/test/rustdoc/strip-enum-variant.rs
@@ -3,7 +3,7 @@
// @!has - '//code' 'NotShown'
// @has - '//code' '// some variants omitted'
// Also check that `NotShown` isn't displayed in the sidebar.
-// @snapshot no-not-shown - '//*[@class="sidebar-elems"]/section/*[@class="block"][1]/ul'
+// @snapshot no-not-shown - '//*[@class="sidebar-elems"]/section/*[@class="block"][1]'
pub enum MyThing {
Shown,
#[doc(hidden)]
diff --git a/src/test/rustdoc/synthetic_auto/basic.rs b/src/test/rustdoc/synthetic_auto/basic.rs
index 54c54fdbf..7c6a38865 100644
--- a/src/test/rustdoc/synthetic_auto/basic.rs
+++ b/src/test/rustdoc/synthetic_auto/basic.rs
@@ -1,6 +1,6 @@
// @has basic/struct.Foo.html
-// @has - '//h3[@class="code-header in-band"]' 'impl<T> Send for Foo<T> where T: Send'
-// @has - '//h3[@class="code-header in-band"]' 'impl<T> Sync for Foo<T> where T: Sync'
+// @has - '//h3[@class="code-header"]' 'impl<T> Send for Foo<T>where T: Send'
+// @has - '//h3[@class="code-header"]' 'impl<T> Sync for Foo<T>where T: Sync'
// @count - '//*[@id="implementations-list"]//*[@class="impl has-srclink"]' 0
// @count - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]' 5
pub struct Foo<T> {
diff --git a/src/test/rustdoc/synthetic_auto/complex.rs b/src/test/rustdoc/synthetic_auto/complex.rs
index f9017b90c..43393c21f 100644
--- a/src/test/rustdoc/synthetic_auto/complex.rs
+++ b/src/test/rustdoc/synthetic_auto/complex.rs
@@ -20,8 +20,8 @@ mod foo {
}
// @has complex/struct.NotOuter.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<'a, T, K: ?Sized> Send for Outer<'a, T, K> where K: for<'b> Fn((&'b bool, &'a u8)) \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<'a, T, K: ?Sized> Send for Outer<'a, T, K>where K: for<'b> Fn((&'b bool, &'a u8)) \
// -> &'b i8, T: MyTrait<'a>, <T as MyTrait<'a>>::MyItem: Copy, 'a: 'static"
pub use foo::{Foo, Inner as NotInner, MyTrait as NotMyTrait, Outer as NotOuter};
diff --git a/src/test/rustdoc/synthetic_auto/crate-local.rs b/src/test/rustdoc/synthetic_auto/crate-local.rs
index 58b787dfa..ed01f63f9 100644
--- a/src/test/rustdoc/synthetic_auto/crate-local.rs
+++ b/src/test/rustdoc/synthetic_auto/crate-local.rs
@@ -3,7 +3,7 @@
pub auto trait Banana {}
// @has crate_local/struct.Peach.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Banana for Peach'
-// @has - '//h3[@class="code-header in-band"]' 'impl Send for Peach'
-// @has - '//h3[@class="code-header in-band"]' 'impl Sync for Peach'
+// @has - '//h3[@class="code-header"]' 'impl Banana for Peach'
+// @has - '//h3[@class="code-header"]' 'impl Send for Peach'
+// @has - '//h3[@class="code-header"]' 'impl Sync for Peach'
pub struct Peach;
diff --git a/src/test/rustdoc/synthetic_auto/lifetimes.rs b/src/test/rustdoc/synthetic_auto/lifetimes.rs
index ee1393f97..33170a844 100644
--- a/src/test/rustdoc/synthetic_auto/lifetimes.rs
+++ b/src/test/rustdoc/synthetic_auto/lifetimes.rs
@@ -9,11 +9,11 @@ where
{}
// @has lifetimes/struct.Foo.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<'c, K> Send for Foo<'c, K> where K: for<'b> Fn(&'b bool) -> &'c u8, 'c: 'static"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<'c, K> Send for Foo<'c, K>where K: for<'b> Fn(&'b bool) -> &'c u8, 'c: 'static"
//
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<'c, K> Sync for Foo<'c, K> where K: Sync"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<'c, K> Sync for Foo<'c, K>where K: Sync"
pub struct Foo<'c, K: 'c> {
inner_field: Inner<'c, K>,
}
diff --git a/src/test/rustdoc/synthetic_auto/manual.rs b/src/test/rustdoc/synthetic_auto/manual.rs
index 49bad1622..77c04ad2a 100644
--- a/src/test/rustdoc/synthetic_auto/manual.rs
+++ b/src/test/rustdoc/synthetic_auto/manual.rs
@@ -1,8 +1,8 @@
// @has manual/struct.Foo.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// 'impl<T> Sync for Foo<T> where T: Sync'
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// 'impl<T> Sync for Foo<T>where T: Sync'
//
-// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// 'impl<T> Send for Foo<T>'
//
// @count - '//*[@id="trait-implementations-list"]//*[@class="impl has-srclink"]' 1
diff --git a/src/test/rustdoc/synthetic_auto/negative.rs b/src/test/rustdoc/synthetic_auto/negative.rs
index 66e749ac3..2c2c848a5 100644
--- a/src/test/rustdoc/synthetic_auto/negative.rs
+++ b/src/test/rustdoc/synthetic_auto/negative.rs
@@ -3,10 +3,10 @@ pub struct Inner<T: Copy> {
}
// @has negative/struct.Outer.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Send for Outer<T>"
//
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
// "impl<T> !Sync for Outer<T>"
pub struct Outer<T: Copy> {
inner_field: Inner<T>,
diff --git a/src/test/rustdoc/synthetic_auto/nested.rs b/src/test/rustdoc/synthetic_auto/nested.rs
index 69edbee61..423bf115a 100644
--- a/src/test/rustdoc/synthetic_auto/nested.rs
+++ b/src/test/rustdoc/synthetic_auto/nested.rs
@@ -9,11 +9,11 @@ where
}
// @has nested/struct.Foo.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// 'impl<T> Send for Foo<T> where T: Copy'
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// 'impl<T> Send for Foo<T>where T: Copy'
//
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// 'impl<T> Sync for Foo<T> where T: Sync'
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// 'impl<T> Sync for Foo<T>where T: Sync'
pub struct Foo<T> {
inner_field: Inner<T>,
}
diff --git a/src/test/rustdoc/synthetic_auto/no-redundancy.rs b/src/test/rustdoc/synthetic_auto/no-redundancy.rs
index 16ab876e8..59f336233 100644
--- a/src/test/rustdoc/synthetic_auto/no-redundancy.rs
+++ b/src/test/rustdoc/synthetic_auto/no-redundancy.rs
@@ -9,8 +9,8 @@ where
}
// @has no_redundancy/struct.Outer.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<T> Send for Outer<T> where T: Send + Copy"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<T> Send for Outer<T>where T: Send + Copy"
pub struct Outer<T> {
inner_field: Inner<T>,
}
diff --git a/src/test/rustdoc/synthetic_auto/overflow.rs b/src/test/rustdoc/synthetic_auto/overflow.rs
index c132ab6fb..35a487c76 100644
--- a/src/test/rustdoc/synthetic_auto/overflow.rs
+++ b/src/test/rustdoc/synthetic_auto/overflow.rs
@@ -21,7 +21,7 @@ enum TyData<I: Interner> {
struct VariableKind<I: Interner>(I::InternedType);
// @has overflow/struct.BoundVarsCollector.html
-// @has - '//h3[@class="code-header in-band"]' "impl<'tcx> Send for BoundVarsCollector<'tcx>"
+// @has - '//h3[@class="code-header"]' "impl<'tcx> Send for BoundVarsCollector<'tcx>"
pub struct BoundVarsCollector<'tcx> {
val: VariableKind<RustInterner<'tcx>>
}
diff --git a/src/test/rustdoc/synthetic_auto/project.rs b/src/test/rustdoc/synthetic_auto/project.rs
index 8b0205825..558ff2add 100644
--- a/src/test/rustdoc/synthetic_auto/project.rs
+++ b/src/test/rustdoc/synthetic_auto/project.rs
@@ -23,11 +23,11 @@ where
}
// @has project/struct.Foo.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<'c, K> Send for Foo<'c, K> where K: MyTrait<MyItem = bool>, 'c: 'static"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<'c, K> Send for Foo<'c, K>where K: MyTrait<MyItem = bool>, 'c: 'static"
//
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<'c, K> Sync for Foo<'c, K> where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, \
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<'c, K> Sync for Foo<'c, K>where K: MyTrait, <K as MyTrait>::MyItem: OtherTrait, \
// 'c: 'static,"
pub struct Foo<'c, K: 'c> {
inner_field: Inner<'c, K>,
diff --git a/src/test/rustdoc/synthetic_auto/self-referential.rs b/src/test/rustdoc/synthetic_auto/self-referential.rs
index ccef901b1..c6ae96de7 100644
--- a/src/test/rustdoc/synthetic_auto/self-referential.rs
+++ b/src/test/rustdoc/synthetic_auto/self-referential.rs
@@ -23,7 +23,7 @@ impl<T> Pattern for Wrapper<T> {
// @has self_referential/struct.WriteAndThen.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<P1> Send for WriteAndThen<P1> where <P1 as Pattern>::Value: Send"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<P1> Send for WriteAndThen<P1>where <P1 as Pattern>::Value: Send"
pub struct WriteAndThen<P1>(pub P1::Value,pub <Constrain<P1, Wrapper<P1::Value>> as Pattern>::Value)
where P1: Pattern;
diff --git a/src/test/rustdoc/synthetic_auto/static-region.rs b/src/test/rustdoc/synthetic_auto/static-region.rs
index 36e985144..1a76cb919 100644
--- a/src/test/rustdoc/synthetic_auto/static-region.rs
+++ b/src/test/rustdoc/synthetic_auto/static-region.rs
@@ -3,8 +3,8 @@ pub trait OwnedTrait<'a> {
}
// @has static_region/struct.Owned.html
-// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<T> Send for Owned<T> where <T as OwnedTrait<'static>>::Reader: Send"
+// @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<T> Send for Owned<T>where <T as OwnedTrait<'static>>::Reader: Send"
pub struct Owned<T> where T: OwnedTrait<'static> {
marker: <T as OwnedTrait<'static>>::Reader,
}
diff --git a/src/test/rustdoc/table-in-docblock.rs b/src/test/rustdoc/table-in-docblock.rs
index 858b58919..194f49f16 100644
--- a/src/test/rustdoc/table-in-docblock.rs
+++ b/src/test/rustdoc/table-in-docblock.rs
@@ -2,7 +2,7 @@
// @has foo/struct.Foo.html
// @count - '//*[@class="docblock"]/div/table' 2
-// @!has - '//*[@class="docblock"]/table'
+// @!has - '//*[@class="docblock"]/table' ''
/// | hello | hello2 |
/// | ----- | ------ |
/// | data | data2 |
diff --git a/src/test/rustdoc/toggle-item-contents.rs b/src/test/rustdoc/toggle-item-contents.rs
index c1df4613e..47a1d62f5 100644
--- a/src/test/rustdoc/toggle-item-contents.rs
+++ b/src/test/rustdoc/toggle-item-contents.rs
@@ -55,14 +55,14 @@ pub union Union {
// @has 'toggle_item_contents/struct.PrivStruct.html'
// @count - '//details[@class="rustdoc-toggle type-contents-toggle"]' 0
-// @has - '//div[@class="docblock item-decl"]' '/* private fields */'
+// @has - '//div[@class="item-decl"]' '/* private fields */'
pub struct PrivStruct {
a: usize,
b: usize,
}
// @has 'toggle_item_contents/enum.Enum.html'
-// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]'
+// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]' ''
pub enum Enum {
A, B, C,
D {
@@ -72,7 +72,7 @@ pub enum Enum {
}
// @has 'toggle_item_contents/enum.EnumStructVariant.html'
-// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]'
+// @!has - '//details[@class="rustdoc-toggle type-contents-toggle"]' ''
pub enum EnumStructVariant {
A, B, C,
D {
diff --git a/src/test/rustdoc/toggle-trait-fn.rs b/src/test/rustdoc/toggle-trait-fn.rs
index 65e8daeb0..e41422ce7 100644
--- a/src/test/rustdoc/toggle-trait-fn.rs
+++ b/src/test/rustdoc/toggle-trait-fn.rs
@@ -4,12 +4,12 @@
// summary. Trait methods with no documentation should not be wrapped.
//
// @has foo/trait.Foo.html
-// @has - '//details[@class="rustdoc-toggle"]//summary//h4[@class="code-header"]' 'is_documented()'
-// @!has - '//details[@class="rustdoc-toggle"]//summary//h4[@class="code-header"]' 'not_documented()'
-// @has - '//details[@class="rustdoc-toggle"]//*[@class="docblock"]' 'is_documented is documented'
-// @has - '//details[@class="rustdoc-toggle"]//summary//h4[@class="code-header"]' 'is_documented_optional()'
-// @!has - '//details[@class="rustdoc-toggle"]//summary//h4[@class="code-header"]' 'not_documented_optional()'
-// @has - '//details[@class="rustdoc-toggle"]//*[@class="docblock"]' 'is_documented_optional is documented'
+// @has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented()'
+// @!has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented()'
+// @has - '//details[@class="rustdoc-toggle method-toggle"]//*[@class="docblock"]' 'is_documented is documented'
+// @has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'is_documented_optional()'
+// @!has - '//details[@class="rustdoc-toggle method-toggle"]//summary//h4[@class="code-header"]' 'not_documented_optional()'
+// @has - '//details[@class="rustdoc-toggle method-toggle"]//*[@class="docblock"]' 'is_documented_optional is documented'
pub trait Foo {
fn not_documented();
diff --git a/src/test/rustdoc/trait-impl-items-links-and-anchors.rs b/src/test/rustdoc/trait-impl-items-links-and-anchors.rs
index b5a97c610..fba594c38 100644
--- a/src/test/rustdoc/trait-impl-items-links-and-anchors.rs
+++ b/src/test/rustdoc/trait-impl-items-links-and-anchors.rs
@@ -59,7 +59,7 @@ pub struct MyStruct;
// We check that associated items with default values aren't generated in the implementors list.
impl MyTrait for (u8, u8) {
- // @!has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-4"]'
+ // @!has trait_impl_items_links_and_anchors/trait.MyTrait.html '//div[@id="associatedconstant.VALUE-4"]' ''
type Assoc = bool;
fn trait_function(&self) {}
}
diff --git a/src/test/rustdoc/trait-impl.rs b/src/test/rustdoc/trait-impl.rs
index 4f7e2dfe3..195cdf009 100644
--- a/src/test/rustdoc/trait-impl.rs
+++ b/src/test/rustdoc/trait-impl.rs
@@ -21,26 +21,26 @@ pub trait Trait {
pub struct Struct;
impl Trait for Struct {
- // @has trait_impl/struct.Struct.html '//*[@id="method.a"]/../../div[@class="docblock"]/p' 'Some long docs'
- // @!has - '//*[@id="method.a"]/../../div[@class="docblock"]/p' 'link will be added'
- // @has - '//*[@id="method.a"]/../../div[@class="docblock"]/p/a' 'Read more'
- // @has - '//*[@id="method.a"]/../../div[@class="docblock"]/p/a/@href' 'trait.Trait.html#tymethod.a'
+ // @has trait_impl/struct.Struct.html '//*[@id="method.a"]/../../div[@class="docblock"]' 'Some long docs'
+ // @!has - '//*[@id="method.a"]/../../div[@class="docblock"]' 'link will be added'
+ // @has - '//*[@id="method.a"]/../../div[@class="docblock"]/a' 'Read more'
+ // @has - '//*[@id="method.a"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.a'
fn a() {}
- // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p' 'These docs contain'
- // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a' 'reference link'
- // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a/@href' 'https://example.com'
- // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a' 'Read more'
- // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/p/a/@href' 'trait.Trait.html#tymethod.b'
+ // @has - '//*[@id="method.b"]/../../div[@class="docblock"]' 'These docs contain'
+ // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a' 'reference link'
+ // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a/@href' 'https://example.com'
+ // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a' 'Read more'
+ // @has - '//*[@id="method.b"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.b'
fn b() {}
- // @!has - '//*[@id="method.c"]/../../div[@class="docblock"]/p' 'code block'
+ // @!has - '//*[@id="method.c"]/../../div[@class="docblock"]' 'code block'
// @has - '//*[@id="method.c"]/../../div[@class="docblock"]/a' 'Read more'
// @has - '//*[@id="method.c"]/../../div[@class="docblock"]/a/@href' 'trait.Trait.html#tymethod.c'
fn c() {}
- // @has - '//*[@id="method.d"]/../../div[@class="docblock"]/p' 'Escaped formatting a*b*c* works'
- // @!has - '//*[@id="method.d"]/../../div[@class="docblock"]/p/em'
+ // @has - '//*[@id="method.d"]/../../div[@class="docblock"]' 'Escaped formatting a*b*c* works'
+ // @!has - '//*[@id="method.d"]/../../div[@class="docblock"]/em' ''
fn d() {}
// @has - '//*[@id="impl-Trait-for-Struct"]/h3//a/@href' 'trait.Trait.html'
diff --git a/src/test/rustdoc/trait_alias.rs b/src/test/rustdoc/trait_alias.rs
index a0c657d9a..791c099cc 100644
--- a/src/test/rustdoc/trait_alias.rs
+++ b/src/test/rustdoc/trait_alias.rs
@@ -14,13 +14,13 @@ use std::fmt::Debug;
// @has foo/index.html '//a[@class="traitalias"]' 'Foo'
// @has foo/traitalias.CopyAlias.html
-// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait CopyAlias = Copy;'
+// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait CopyAlias = Copy;'
pub trait CopyAlias = Copy;
// @has foo/traitalias.Alias2.html
-// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait Alias2 = Copy + Debug;'
+// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait Alias2 = Copy + Debug;'
pub trait Alias2 = Copy + Debug;
// @has foo/traitalias.Foo.html
-// @has - '//section[@id="main-content"]/div[@class="docblock item-decl"]/pre' 'trait Foo<T> = Into<T> + Debug;'
+// @has - '//section[@id="main-content"]/div[@class="item-decl"]/pre' 'trait Foo<T> = Into<T> + Debug;'
pub trait Foo<T> = Into<T> + Debug;
// @has foo/fn.bar.html '//a[@href="traitalias.Alias2.html"]' 'Alias2'
pub fn bar<T>() where T: Alias2 {}
diff --git a/src/test/rustdoc/traits-in-bodies.rs b/src/test/rustdoc/traits-in-bodies.rs
index 6d450a625..a65dd7a54 100644
--- a/src/test/rustdoc/traits-in-bodies.rs
+++ b/src/test/rustdoc/traits-in-bodies.rs
@@ -4,7 +4,7 @@
pub struct Bounded<T: Clone>(T);
// @has traits_in_bodies/struct.SomeStruct.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Clone for SomeStruct'
+// @has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct'
pub struct SomeStruct;
fn asdf() -> Bounded<SomeStruct> {
@@ -18,7 +18,7 @@ fn asdf() -> Bounded<SomeStruct> {
}
// @has traits_in_bodies/struct.Point.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Copy for Point'
+// @has - '//h3[@class="code-header"]' 'impl Copy for Point'
#[derive(Clone)]
pub struct Point {
x: i32,
@@ -31,7 +31,7 @@ const _FOO: () = {
};
// @has traits_in_bodies/struct.Inception.html
-// @has - '//h3[@class="code-header in-band"]' 'impl Clone for Inception'
+// @has - '//h3[@class="code-header"]' 'impl Clone for Inception'
pub struct Inception;
static _BAR: usize = {
diff --git a/src/test/rustdoc/tuple-struct-fields-doc.rs b/src/test/rustdoc/tuple-struct-fields-doc.rs
index 31426131b..8ab1143d1 100644
--- a/src/test/rustdoc/tuple-struct-fields-doc.rs
+++ b/src/test/rustdoc/tuple-struct-fields-doc.rs
@@ -2,10 +2,10 @@
// @has foo/struct.Foo.html
// @has - '//h2[@id="fields"]' 'Tuple Fields'
-// @has - '//h3[@class="sidebar-title"]/a[@href="#fields"]' 'Tuple Fields'
+// @has - '//div[@class="sidebar-elems"]//h3/a[@href="#fields"]' 'Tuple Fields'
// @has - '//*[@id="structfield.0"]' '0: u32'
// @has - '//*[@id="main-content"]/div[@class="docblock"]' 'hello'
-// @!has - '//*[@id="structfield.1"]'
+// @!has - '//*[@id="structfield.1"]' ''
// @has - '//*[@id="structfield.2"]' '2: char'
// @has - '//*[@id="structfield.3"]' '3: i8'
// @has - '//*[@id="main-content"]/div[@class="docblock"]' 'not hello'
diff --git a/src/test/rustdoc/type-layout-flag-required.rs b/src/test/rustdoc/type-layout-flag-required.rs
index a01fbd229..6bb5e10f8 100644
--- a/src/test/rustdoc/type-layout-flag-required.rs
+++ b/src/test/rustdoc/type-layout-flag-required.rs
@@ -1,4 +1,4 @@
// Tests that `--show-type-layout` is required in order to show layout info.
-// @!has type_layout_flag_required/struct.Foo.html 'Size: '
+// @!hasraw type_layout_flag_required/struct.Foo.html 'Size: '
pub struct Foo(usize);
diff --git a/src/test/rustdoc/type-layout.rs b/src/test/rustdoc/type-layout.rs
index e5c6e9dc3..5e0a0411a 100644
--- a/src/test/rustdoc/type-layout.rs
+++ b/src/test/rustdoc/type-layout.rs
@@ -1,84 +1,84 @@
// compile-flags: --show-type-layout -Z unstable-options
-// @has type_layout/struct.Foo.html 'Size: '
-// @has - ' bytes'
+// @hasraw type_layout/struct.Foo.html 'Size: '
+// @hasraw - ' bytes'
// @has - '//*[@id="layout"]/a[@href="#layout"]' ''
pub struct Foo {
pub a: usize,
b: Vec<String>,
}
-// @has type_layout/enum.Bar.html 'Size: '
-// @has - ' bytes'
+// @hasraw type_layout/enum.Bar.html 'Size: '
+// @hasraw - ' bytes'
pub enum Bar<'a> {
A(String),
B(&'a str, (std::collections::HashMap<String, usize>, Foo)),
}
-// @has type_layout/union.Baz.html 'Size: '
-// @has - ' bytes'
+// @hasraw type_layout/union.Baz.html 'Size: '
+// @hasraw - ' bytes'
pub union Baz {
a: &'static str,
b: usize,
c: &'static [u8],
}
-// @has type_layout/struct.X.html 'Size: '
-// @has - ' bytes'
+// @hasraw type_layout/struct.X.html 'Size: '
+// @hasraw - ' bytes'
pub struct X(usize);
-// @has type_layout/struct.Y.html 'Size: '
-// @has - '1 byte'
-// @!has - ' bytes'
+// @hasraw type_layout/struct.Y.html 'Size: '
+// @hasraw - '1 byte'
+// @!hasraw - ' bytes'
pub struct Y(u8);
-// @has type_layout/struct.Z.html 'Size: '
-// @has - '0 bytes'
+// @hasraw type_layout/struct.Z.html 'Size: '
+// @hasraw - '0 bytes'
pub struct Z;
// We can't compute layout for generic types.
-// @has type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters'
-// @!has - 'Size: '
+// @hasraw type_layout/struct.Generic.html 'Unable to compute type layout, possibly due to this type having generic parameters'
+// @!hasraw - 'Size: '
pub struct Generic<T>(T);
// We *can*, however, compute layout for types that are only generic over lifetimes,
// because lifetimes are a type-system construct.
-// @has type_layout/struct.GenericLifetimes.html 'Size: '
-// @has - ' bytes'
+// @hasraw type_layout/struct.GenericLifetimes.html 'Size: '
+// @hasraw - ' bytes'
pub struct GenericLifetimes<'a>(&'a str);
-// @has type_layout/struct.Unsized.html 'Size: '
-// @has - '(unsized)'
+// @hasraw type_layout/struct.Unsized.html 'Size: '
+// @hasraw - '(unsized)'
pub struct Unsized([u8]);
-// @has type_layout/type.TypeAlias.html 'Size: '
-// @has - ' bytes'
+// @hasraw type_layout/type.TypeAlias.html 'Size: '
+// @hasraw - ' bytes'
pub type TypeAlias = X;
-// @has type_layout/type.GenericTypeAlias.html 'Size: '
-// @has - '8 bytes'
+// @hasraw type_layout/type.GenericTypeAlias.html 'Size: '
+// @hasraw - '8 bytes'
pub type GenericTypeAlias = (Generic<(u32, ())>, Generic<u32>);
// Regression test for the rustdoc equivalent of #85103.
-// @has type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.'
+// @hasraw type_layout/type.Edges.html 'Encountered an error during type layout; the type failed to be normalized.'
pub type Edges<'a, E> = std::borrow::Cow<'a, [E]>;
-// @!has type_layout/trait.MyTrait.html 'Size: '
+// @!hasraw type_layout/trait.MyTrait.html 'Size: '
pub trait MyTrait {}
-// @has type_layout/enum.Variants.html 'Size: '
-// @has - '2 bytes'
-// @has - '<code>A</code>: 0 bytes'
-// @has - '<code>B</code>: 1 byte'
+// @hasraw type_layout/enum.Variants.html 'Size: '
+// @hasraw - '2 bytes'
+// @hasraw - '<code>A</code>: 0 bytes'
+// @hasraw - '<code>B</code>: 1 byte'
pub enum Variants {
A,
B(u8),
}
-// @has type_layout/enum.WithNiche.html 'Size: '
+// @hasraw type_layout/enum.WithNiche.html 'Size: '
// @has - //p '4 bytes'
-// @has - '<code>None</code>: 0 bytes'
-// @has - '<code>Some</code>: 4 bytes'
+// @hasraw - '<code>None</code>: 0 bytes'
+// @hasraw - '<code>Some</code>: 4 bytes'
pub enum WithNiche {
None,
Some(std::num::NonZeroU32),
diff --git a/src/test/rustdoc/typedef.rs b/src/test/rustdoc/typedef.rs
index 4ecd62cde..d5dfa9484 100644
--- a/src/test/rustdoc/typedef.rs
+++ b/src/test/rustdoc/typedef.rs
@@ -9,9 +9,9 @@ impl MyStruct {
}
// @has typedef/type.MyAlias.html
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyAlias'
-// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' 'impl MyTrait for MyAlias'
-// @has - 'Alias docstring'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'impl MyAlias'
+// @has - '//*[@class="impl has-srclink"]//h3[@class="code-header"]' 'impl MyTrait for MyAlias'
+// @hasraw - 'Alias docstring'
// @has - '//*[@class="sidebar"]//*[@class="location"]' 'MyAlias'
// @has - '//*[@class="sidebar"]//a[@href="#implementations"]' 'Methods'
// @has - '//*[@class="sidebar"]//a[@href="#trait-implementations"]' 'Trait Implementations'
diff --git a/src/test/rustdoc/universal-impl-trait.rs b/src/test/rustdoc/universal-impl-trait.rs
index b10b1b865..f5eabda59 100644
--- a/src/test/rustdoc/universal-impl-trait.rs
+++ b/src/test/rustdoc/universal-impl-trait.rs
@@ -5,15 +5,15 @@ use std::borrow::Borrow;
// @has foo/fn.foo.html
// @has - //pre 'foo('
-// @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"'
-// @matches - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html'
+// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Clone\.html"'
+// @matchesraw - '_z: .+impl.+trait\.Copy\.html.+, impl.+trait\.Clone\.html'
pub fn foo(_x: impl Clone, _y: i32, _z: (impl Copy, impl Clone)) {
}
pub trait Trait {
// @has foo/trait.Trait.html
- // @has - 'method</a>('
- // @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
+ // @hasraw - 'method</a>('
+ // @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
fn method(&self, _x: impl std::fmt::Debug) {
}
}
@@ -22,30 +22,30 @@ pub struct S<T>(T);
impl<T> S<T> {
// @has foo/struct.S.html
- // @has - 'bar</a>('
- // @matches - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"'
+ // @hasraw - 'bar</a>('
+ // @matchesraw - '_bar: impl <a class="trait" href="[^"]+/trait\.Copy\.html"'
pub fn bar(_bar: impl Copy) {
}
- // @has - 'baz</a>('
- // @matches - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html'
+ // @hasraw - 'baz</a>('
+ // @matchesraw - '_baz:.+struct\.S\.html.+impl .+trait\.Clone\.html'
pub fn baz(_baz: S<impl Clone>) {
}
- // @has - 'qux</a>('
- // @matches - 'trait\.Read\.html'
+ // @hasraw - 'qux</a>('
+ // @matchesraw - 'trait\.Read\.html'
pub fn qux(_qux: impl IntoIterator<Item = S<impl Read>>) {
}
}
-// @has - 'method</a>('
-// @matches - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
+// @hasraw - 'method</a>('
+// @matchesraw - '_x: impl <a class="trait" href="[^"]+/trait\.Debug\.html"'
impl<T> Trait for S<T> {}
// @has foo/fn.much_universe.html
-// @matches - 'T:.+Borrow.+impl .+trait\.Trait\.html'
-// @matches - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
-// @matches - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
+// @matchesraw - 'T:.+Borrow.+impl .+trait\.Trait\.html'
+// @matchesraw - 'U:.+IntoIterator.+= impl.+Iterator\.html.+= impl.+Clone\.html'
+// @matchesraw - '_: impl .+trait\.Read\.html.+ \+ .+trait\.Clone\.html'
pub fn much_universe<
T: Borrow<impl Trait>,
U: IntoIterator<Item = impl Iterator<Item = impl Clone>>,
diff --git a/src/test/rustdoc/version-separator-without-source.rs b/src/test/rustdoc/version-separator-without-source.rs
index ae866deba..04ea46a7f 100644
--- a/src/test/rustdoc/version-separator-without-source.rs
+++ b/src/test/rustdoc/version-separator-without-source.rs
@@ -16,7 +16,7 @@ pub fn foo() {}
pub struct Bar;
impl Bar {
- // @has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0'
+ // @has - '//*[@id="method.bar"]/*[@class="since rightside"]' '2.0'
// @!has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0 ·'
#[stable(feature = "foobar", since = "2.0")]
pub fn bar() {}
diff --git a/src/test/rustdoc/where-clause-order.rs b/src/test/rustdoc/where-clause-order.rs
index 3150a8ea0..b8502e10a 100644
--- a/src/test/rustdoc/where-clause-order.rs
+++ b/src/test/rustdoc/where-clause-order.rs
@@ -7,7 +7,7 @@ where
}
// @has 'foo/trait.SomeTrait.html'
-// @has - "//*[@id='impl-SomeTrait%3C(A%2C%20B%2C%20C%2C%20D%2C%20E)%3E-for-(A%2C%20B%2C%20C%2C%20D%2C%20E)']/h3" "impl<A, B, C, D, E> SomeTrait<(A, B, C, D, E)> for (A, B, C, D, E) where A: PartialOrd<A> + PartialEq<A>, B: PartialOrd<B> + PartialEq<B>, C: PartialOrd<C> + PartialEq<C>, D: PartialOrd<D> + PartialEq<D>, E: PartialOrd<E> + PartialEq<E> + ?Sized, "
+// @has - "//*[@id='impl-SomeTrait%3C(A%2C%20B%2C%20C%2C%20D%2C%20E)%3E-for-(A%2C%20B%2C%20C%2C%20D%2C%20E)']/h3" "impl<A, B, C, D, E> SomeTrait<(A, B, C, D, E)> for (A, B, C, D, E)where A: PartialOrd<A> + PartialEq<A>, B: PartialOrd<B> + PartialEq<B>, C: PartialOrd<C> + PartialEq<C>, D: PartialOrd<D> + PartialEq<D>, E: PartialOrd<E> + PartialEq<E> + ?Sized, "
impl<A, B, C, D, E> SomeTrait<(A, B, C, D, E)> for (A, B, C, D, E)
where
A: PartialOrd<A> + PartialEq<A>,
diff --git a/src/test/rustdoc/where.SWhere_Simd_item-decl.html b/src/test/rustdoc/where.SWhere_Simd_item-decl.html
index 0133bcaeb..6c1b5d315 100644
--- a/src/test/rustdoc/where.SWhere_Simd_item-decl.html
+++ b/src/test/rustdoc/where.SWhere_Simd_item-decl.html
@@ -1 +1 @@
-<div class="docblock item-decl"><pre class="rust struct"><code>pub struct Simd&lt;T&gt;(_) <br /><span class="where">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre></div> \ No newline at end of file
+<div class="item-decl"><pre class="rust struct"><code>pub struct Simd&lt;T&gt;(_)<br /><span class="where">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html b/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html
index 54026ff03..24ab77703 100644
--- a/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html
+++ b/src/test/rustdoc/where.SWhere_TraitWhere_item-decl.html
@@ -1,3 +1,8 @@
-<div class="docblock item-decl"><pre class="rust trait"><code>pub trait TraitWhere {
- type <a href="#associatedtype.Item" class="associatedtype">Item</a>&lt;'a&gt;<br />&#160;&#160;&#160; <span class="where">where<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Self: 'a</span>;
+<div class="item-decl"><pre class="rust trait"><code>pub trait TraitWhere {
+ type <a href="#associatedtype.Item" class="associatedtype">Item</a>&lt;'a&gt;<br />&#160;&#160;&#160;&#160;<span class="where">where<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Self: 'a</span>;
+
+ fn <a href="#method.func" class="fnname">func</a>(self)<br />&#160;&#160;&#160;&#160;<span class="where">where<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Self: <a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
+ { ... }
+<span class="item-spacer" /> fn <a href="#method.lines" class="fnname">lines</a>(self) -&gt; <a class="struct" href="{{channel}}/std/io/struct.Lines.html" title="struct std::io::Lines">Lines</a>&lt;Self&gt;<br />&#160;&#160;&#160;&#160;<span class="where">where<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Self: <a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a></span>,
+ { ... }
}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/where.rs b/src/test/rustdoc/where.rs
index 50a5722fb..8b5bce28f 100644
--- a/src/test/rustdoc/where.rs
+++ b/src/test/rustdoc/where.rs
@@ -1,19 +1,20 @@
-#![feature(generic_associated_types)]
#![crate_name = "foo"]
+use std::io::Lines;
+
pub trait MyTrait { fn dummy(&self) { } }
-// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait"
+// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_)where A: MyTrait"
pub struct Alpha<A>(A) where A: MyTrait;
-// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B> where B: MyTrait"
+// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B>where B: MyTrait"
pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
-// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>() where C: MyTrait"
+// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>()where C: MyTrait"
pub fn charlie<C>() where C: MyTrait {}
pub struct Delta<D>(D);
-// @has foo/struct.Delta.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<D> Delta<D> where D: MyTrait"
+// @has foo/struct.Delta.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<D> Delta<D>where D: MyTrait"
impl<D> Delta<D> where D: MyTrait {
pub fn delta() {}
}
@@ -21,31 +22,41 @@ impl<D> Delta<D> where D: MyTrait {
pub struct Echo<E>(E);
// @has 'foo/struct.Simd.html'
-// @snapshot SWhere_Simd_item-decl - '//div[@class="docblock item-decl"]'
+// @snapshot SWhere_Simd_item-decl - '//div[@class="item-decl"]'
pub struct Simd<T>([T; 1])
where
T: MyTrait;
// @has 'foo/trait.TraitWhere.html'
-// @snapshot SWhere_TraitWhere_item-decl - '//div[@class="docblock item-decl"]'
+// @snapshot SWhere_TraitWhere_item-decl - '//div[@class="item-decl"]'
pub trait TraitWhere {
type Item<'a> where Self: 'a;
+
+ fn func(self)
+ where
+ Self: Sized
+ {}
+
+ fn lines(self) -> Lines<Self>
+ where
+ Self: Sized,
+ { todo!() }
}
-// @has foo/struct.Echo.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<E> MyTrait for Echo<E> where E: MyTrait"
-// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
-// "impl<E> MyTrait for Echo<E> where E: MyTrait"
-impl<E> MyTrait for Echo<E> where E: MyTrait {}
+// @has foo/struct.Echo.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<E> MyTrait for Echo<E>where E: MyTrait"
+// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
+// "impl<E> MyTrait for Echo<E>where E: MyTrait"
+impl<E> MyTrait for Echo<E>where E: MyTrait {}
pub enum Foxtrot<F> { Foxtrot1(F) }
-// @has foo/enum.Foxtrot.html '//*[@class="impl has-srclink"]//h3[@class="code-header in-band"]' \
-// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
-// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header in-band"]' \
-// "impl<F> MyTrait for Foxtrot<F> where F: MyTrait"
-impl<F> MyTrait for Foxtrot<F> where F: MyTrait {}
+// @has foo/enum.Foxtrot.html '//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
+// "impl<F> MyTrait for Foxtrot<F>where F: MyTrait"
+// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//h3[@class="code-header"]' \
+// "impl<F> MyTrait for Foxtrot<F>where F: MyTrait"
+impl<F> MyTrait for Foxtrot<F>where F: MyTrait {}
// @has foo/type.Golf.html '//pre[@class="rust typedef"]' \
-// "type Golf<T> where T: Clone, = (T, T)"
+// "type Golf<T>where T: Clone, = (T, T)"
pub type Golf<T> where T: Clone = (T, T);
diff --git a/src/test/rustdoc/whitespace-after-where-clause.enum.html b/src/test/rustdoc/whitespace-after-where-clause.enum.html
index 9e5bf45ae..c74866f4a 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.enum.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.enum.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust enum"><code>pub enum Cow&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,&#160;</span>{
+<div class="item-decl"><pre class="rust enum"><code>pub enum Cow&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,</span>{
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B),
Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.enum2.html b/src/test/rustdoc/whitespace-after-where-clause.enum2.html
index 6bc47beae..ac7d77598 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.enum2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.enum2.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust enum"><code>pub enum Cow2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
+<div class="item-decl"><pre class="rust enum"><code>pub enum Cow2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
Borrowed(<a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B),
Whatever(<a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>),
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.rs b/src/test/rustdoc/whitespace-after-where-clause.rs
index c36386a2a..4b740b970 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.rs
+++ b/src/test/rustdoc/whitespace-after-where-clause.rs
@@ -4,7 +4,7 @@
#![crate_name = "foo"]
// @has 'foo/trait.ToOwned.html'
-// @snapshot trait - '//*[@class="docblock item-decl"]'
+// @snapshot trait - '//*[@class="item-decl"]'
pub trait ToOwned<T>
where T: Clone
{
@@ -14,7 +14,7 @@ where T: Clone
}
// @has 'foo/trait.ToOwned2.html'
-// @snapshot trait2 - '//*[@class="docblock item-decl"]'
+// @snapshot trait2 - '//*[@class="item-decl"]'
// There should be a whitespace before `{` in this case!
pub trait ToOwned2<T: Clone> {
type Owned;
@@ -23,7 +23,7 @@ pub trait ToOwned2<T: Clone> {
}
// @has 'foo/enum.Cow.html'
-// @snapshot enum - '//*[@class="docblock item-decl"]'
+// @snapshot enum - '//*[@class="item-decl"]'
pub enum Cow<'a, B: ?Sized + 'a>
where
B: ToOwned<Clone>,
@@ -33,7 +33,7 @@ where
}
// @has 'foo/enum.Cow2.html'
-// @snapshot enum2 - '//*[@class="docblock item-decl"]'
+// @snapshot enum2 - '//*[@class="item-decl"]'
// There should be a whitespace before `{` in this case!
pub enum Cow2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
Borrowed(&'a B),
@@ -41,7 +41,7 @@ pub enum Cow2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
}
// @has 'foo/struct.Struct.html'
-// @snapshot struct - '//*[@class="docblock item-decl"]'
+// @snapshot struct - '//*[@class="item-decl"]'
pub struct Struct<'a, B: ?Sized + 'a>
where
B: ToOwned<Clone>,
@@ -51,7 +51,7 @@ where
}
// @has 'foo/struct.Struct2.html'
-// @snapshot struct2 - '//*[@class="docblock item-decl"]'
+// @snapshot struct2 - '//*[@class="item-decl"]'
// There should be a whitespace before `{` in this case!
pub struct Struct2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
pub a: &'a B,
@@ -59,7 +59,7 @@ pub struct Struct2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
}
// @has 'foo/union.Union.html'
-// @snapshot union - '//*[@class="docblock item-decl"]'
+// @snapshot union - '//*[@class="item-decl"]'
pub union Union<'a, B: ?Sized + 'a>
where
B: ToOwned<Clone>,
@@ -69,7 +69,7 @@ where
}
// @has 'foo/union.Union2.html'
-// @snapshot union2 - '//*[@class="docblock item-decl"]'
+// @snapshot union2 - '//*[@class="item-decl"]'
// There should be a whitespace before `{` in this case!
pub union Union2<'a, B: ?Sized + ToOwned<Clone> + 'a> {
a: &'a B,
diff --git a/src/test/rustdoc/whitespace-after-where-clause.struct.html b/src/test/rustdoc/whitespace-after-where-clause.struct.html
index 236cc3b30..1ba1367d2 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.struct.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.struct.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust struct"><code>pub struct Struct&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,&#160;</span>{
+<div class="item-decl"><pre class="rust struct"><code>pub struct Struct&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,</span>{
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B,
pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.struct2.html b/src/test/rustdoc/whitespace-after-where-clause.struct2.html
index 47f5c6ba9..fb06b0f77 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.struct2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.struct2.html
@@ -1,4 +1,4 @@
-<div class="docblock item-decl"><pre class="rust struct"><code>pub struct Struct2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
+<div class="item-decl"><pre class="rust struct"><code>pub struct Struct2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
pub a: <a class="primitive" href="{{channel}}/std/primitive.reference.html">&amp;'a </a>B,
pub b: <a class="primitive" href="{{channel}}/std/primitive.u32.html">u32</a>,
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.trait.html b/src/test/rustdoc/whitespace-after-where-clause.trait.html
index 98f03b837..16b558237 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.trait.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.trait.html
@@ -1,6 +1,6 @@
-<div class="docblock item-decl"><pre class="rust trait"><code>pub trait ToOwned&lt;T&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,&#160;</span>{
+<div class="item-decl"><pre class="rust trait"><code>pub trait ToOwned&lt;T&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span>{
type <a href="#associatedtype.Owned" class="associatedtype">Owned</a>;
fn <a href="#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.ToOwned.html#associatedtype.Owned" title="type foo::ToOwned::Owned">Owned</a>;
<span class="item-spacer" /> fn <a href="#tymethod.whatever" class="fnname">whatever</a>(&amp;self) -&gt; T;
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.trait2.html b/src/test/rustdoc/whitespace-after-where-clause.trait2.html
index 35052869e..eeca6e1f5 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.trait2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.trait2.html
@@ -1,6 +1,6 @@
-<div class="docblock item-decl"><pre class="rust trait"><code>pub trait ToOwned2&lt;T:&#160;<a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; {
+<div class="item-decl"><pre class="rust trait"><code>pub trait ToOwned2&lt;T:&#160;<a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; {
type <a href="#associatedtype.Owned" class="associatedtype">Owned</a>;
fn <a href="#tymethod.to_owned" class="fnname">to_owned</a>(&amp;self) -&gt; Self::<a class="associatedtype" href="trait.ToOwned2.html#associatedtype.Owned" title="type foo::ToOwned2::Owned">Owned</a>;
<span class="item-spacer" /> fn <a href="#tymethod.whatever" class="fnname">whatever</a>(&amp;self) -&gt; T;
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.union.html b/src/test/rustdoc/whitespace-after-where-clause.union.html
index 97e1bbcf3..0dfb6407d 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.union.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.union.html
@@ -1,3 +1,3 @@
-<div class="docblock item-decl"><pre class="rust union"><code>pub union Union&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,&#160;</span>{
+<div class="item-decl"><pre class="rust union"><code>pub union Union&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt;<span class="where fmt-newline">where<br />&#160;&#160;&#160;&#160;B: <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt;,</span>{
/* private fields */
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/rustdoc/whitespace-after-where-clause.union2.html b/src/test/rustdoc/whitespace-after-where-clause.union2.html
index 6c752a8b4..0d237df53 100644
--- a/src/test/rustdoc/whitespace-after-where-clause.union2.html
+++ b/src/test/rustdoc/whitespace-after-where-clause.union2.html
@@ -1,3 +1,3 @@
-<div class="docblock item-decl"><pre class="rust union"><code>pub union Union2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
+<div class="item-decl"><pre class="rust union"><code>pub union Union2&lt;'a, B:&#160;?<a class="trait" href="{{channel}}/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="trait.ToOwned.html" title="trait foo::ToOwned">ToOwned</a>&lt;dyn <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; + 'a&gt; {
/* private fields */
-}</code></pre></div>
+}</code></pre></div> \ No newline at end of file
diff --git a/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs b/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs
index 802b867a3..c05443488 100644
--- a/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs
+++ b/src/test/ui-fulldeps/auxiliary/issue-40001-plugin.rs
@@ -21,7 +21,7 @@ use rustc_span::source_map;
#[no_mangle]
fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&MISSING_ALLOWED_ATTR]);
- reg.lint_store.register_late_pass(|| Box::new(MissingAllowedAttrPass));
+ reg.lint_store.register_late_pass(|_| Box::new(MissingAllowedAttrPass));
}
declare_lint! {
@@ -44,14 +44,16 @@ impl<'tcx> LateLintPass<'tcx> for MissingAllowedAttrPass {
) {
let item = match cx.tcx.hir().get(id) {
Node::Item(item) => item,
- _ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent_item(id)),
+ _ => cx.tcx.hir().expect_item(cx.tcx.hir().get_parent_item(id).def_id),
};
let allowed = |attr| pprust::attribute_to_string(attr).contains("allowed_attr");
if !cx.tcx.hir().attrs(item.hir_id()).iter().any(allowed) {
- cx.lint(MISSING_ALLOWED_ATTR, |lint| {
- lint.build("Missing 'allowed_attr' attribute").set_span(span).emit();
- });
+ cx.lint(
+ MISSING_ALLOWED_ATTR,
+ "Missing 'allowed_attr' attribute",
+ |lint| lint.set_span(span)
+ );
}
}
}
diff --git a/src/test/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs b/src/test/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs
index bc153faa8..a3b570ad8 100644
--- a/src/test/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs
+++ b/src/test/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs
@@ -74,7 +74,7 @@ fn __rustc_plugin_registrar(reg: &mut Registry) {
&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));
+ 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/src/test/ui-fulldeps/auxiliary/lint-for-crate.rs b/src/test/ui-fulldeps/auxiliary/lint-for-crate.rs
index 29d0abfbe..073da688c 100644
--- a/src/test/ui-fulldeps/auxiliary/lint-for-crate.rs
+++ b/src/test/ui-fulldeps/auxiliary/lint-for-crate.rs
@@ -29,9 +29,11 @@ impl<'tcx> LateLintPass<'tcx> for Pass {
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, |lint| {
- lint.build("crate is not marked with #![crate_okay]").set_span(span).emit();
- });
+ cx.lint(
+ CRATE_NOT_OKAY,
+ "crate is not marked with #![crate_okay]",
+ |lint| lint.set_span(span)
+ );
}
}
}
@@ -39,5 +41,5 @@ impl<'tcx> LateLintPass<'tcx> for Pass {
#[no_mangle]
fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&CRATE_NOT_OKAY]);
- reg.lint_store.register_late_pass(|| Box::new(Pass));
+ reg.lint_store.register_late_pass(|_| Box::new(Pass));
}
diff --git a/src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs b/src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs
index 691cfb97d..4a41e7fbb 100644
--- a/src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs
+++ b/src/test/ui-fulldeps/auxiliary/lint-group-plugin-test.rs
@@ -22,12 +22,10 @@ declare_lint_pass!(Pass => [TEST_LINT, PLEASE_LINT]);
impl<'tcx> LateLintPass<'tcx> for Pass {
fn check_item(&mut self, cx: &LateContext, it: &rustc_hir::Item) {
match it.ident.as_str() {
- "lintme" => cx.lint(TEST_LINT, |lint| {
- lint.build("item is named 'lintme'").set_span(it.span).emit();
- }),
- "pleaselintme" => cx.lint(PLEASE_LINT, |lint| {
- lint.build("item is named 'pleaselintme'").set_span(it.span).emit();
- }),
+ "lintme" => cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span)),
+ "pleaselintme" => {
+ cx.lint(PLEASE_LINT, "item is named 'pleaselintme'", |lint| lint.set_span(it.span))
+ }
_ => {}
}
}
@@ -36,7 +34,7 @@ impl<'tcx> LateLintPass<'tcx> for Pass {
#[no_mangle]
fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&TEST_LINT, &PLEASE_LINT]);
- reg.lint_store.register_late_pass(|| Box::new(Pass));
+ reg.lint_store.register_late_pass(|_| Box::new(Pass));
reg.lint_store.register_group(
true,
"lint_me",
diff --git a/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs b/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs
index 285754928..30956deb7 100644
--- a/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs
+++ b/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs
@@ -21,9 +21,7 @@ declare_lint_pass!(Pass => [TEST_LINT]);
impl EarlyLintPass for Pass {
fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) {
if it.ident.name.as_str() == "lintme" {
- cx.lint(TEST_LINT, |lint| {
- lint.build("item is named 'lintme'").set_span(it.span).emit();
- });
+ cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span));
}
}
}
diff --git a/src/test/ui-fulldeps/auxiliary/lint-tool-test.rs b/src/test/ui-fulldeps/auxiliary/lint-tool-test.rs
index 3d5dba42b..c2c024865 100644
--- a/src/test/ui-fulldeps/auxiliary/lint-tool-test.rs
+++ b/src/test/ui-fulldeps/auxiliary/lint-tool-test.rs
@@ -31,14 +31,10 @@ declare_lint_pass!(Pass => [TEST_LINT, TEST_GROUP, TEST_RUSTC_TOOL_LINT]);
impl EarlyLintPass for Pass {
fn check_item(&mut self, cx: &EarlyContext, it: &ast::Item) {
if it.ident.name.as_str() == "lintme" {
- cx.lint(TEST_LINT, |lint| {
- lint.build("item is named 'lintme'").set_span(it.span).emit();
- });
+ cx.lint(TEST_LINT, "item is named 'lintme'", |lint| lint.set_span(it.span));
}
if it.ident.name.as_str() == "lintmetoo" {
- cx.lint(TEST_GROUP, |lint| {
- lint.build("item is named 'lintmetoo'").set_span(it.span).emit();
- });
+ cx.lint(TEST_GROUP, "item is named 'lintmetoo'", |lint| lint.set_span(it.span));
}
}
}
diff --git a/src/test/ui-fulldeps/fluent-messages/duplicate-a-b.ftl b/src/test/ui-fulldeps/fluent-messages/duplicate-a-b.ftl
new file mode 100644
index 000000000..9407c5170
--- /dev/null
+++ b/src/test/ui-fulldeps/fluent-messages/duplicate-a-b.ftl
@@ -0,0 +1 @@
+a_b_key = Value
diff --git a/src/test/ui-fulldeps/fluent-messages/duplicate-a.ftl b/src/test/ui-fulldeps/fluent-messages/duplicate-a.ftl
index fd9976b5a..9407c5170 100644
--- a/src/test/ui-fulldeps/fluent-messages/duplicate-a.ftl
+++ b/src/test/ui-fulldeps/fluent-messages/duplicate-a.ftl
@@ -1 +1 @@
-key = Value
+a_b_key = Value
diff --git a/src/test/ui-fulldeps/fluent-messages/duplicate-b.ftl b/src/test/ui-fulldeps/fluent-messages/duplicate-b.ftl
deleted file mode 100644
index fd9976b5a..000000000
--- a/src/test/ui-fulldeps/fluent-messages/duplicate-b.ftl
+++ /dev/null
@@ -1 +0,0 @@
-key = Value
diff --git a/src/test/ui-fulldeps/fluent-messages/label-with-hyphens.ftl b/src/test/ui-fulldeps/fluent-messages/label-with-hyphens.ftl
new file mode 100644
index 000000000..016cbeef6
--- /dev/null
+++ b/src/test/ui-fulldeps/fluent-messages/label-with-hyphens.ftl
@@ -0,0 +1,2 @@
+label_with_hyphens_some_slug = hi
+ .label-has-hyphens = test
diff --git a/src/test/ui-fulldeps/fluent-messages/missing-crate-name.ftl b/src/test/ui-fulldeps/fluent-messages/missing-crate-name.ftl
new file mode 100644
index 000000000..9bd035c1b
--- /dev/null
+++ b/src/test/ui-fulldeps/fluent-messages/missing-crate-name.ftl
@@ -0,0 +1,2 @@
+with-hyphens = 1234
+test-crate_foo = abcd
diff --git a/src/test/ui-fulldeps/fluent-messages/missing-message.ftl b/src/test/ui-fulldeps/fluent-messages/missing-message.ftl
index 372b1a2e4..74b2aa1d4 100644
--- a/src/test/ui-fulldeps/fluent-messages/missing-message.ftl
+++ b/src/test/ui-fulldeps/fluent-messages/missing-message.ftl
@@ -1 +1 @@
-missing-message =
+missing_message =
diff --git a/src/test/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl b/src/test/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl
new file mode 100644
index 000000000..86ba9a268
--- /dev/null
+++ b/src/test/ui-fulldeps/fluent-messages/slug-with-hyphens.ftl
@@ -0,0 +1 @@
+slug_with_hyphens_this-slug-has-hyphens = hi
diff --git a/src/test/ui-fulldeps/fluent-messages/test.rs b/src/test/ui-fulldeps/fluent-messages/test.rs
index 0390a0785..4e8147e2b 100644
--- a/src/test/ui-fulldeps/fluent-messages/test.rs
+++ b/src/test/ui-fulldeps/fluent-messages/test.rs
@@ -49,9 +49,28 @@ mod duplicate {
use super::fluent_messages;
fluent_messages! {
+//~^ ERROR the name `a_b_key` is defined multiple times
a => "./duplicate-a.ftl",
- b => "./duplicate-b.ftl",
-//~^ ERROR overrides existing message: `key`
+ a_b => "./duplicate-a-b.ftl",
+//~^ ERROR overrides existing message: `a_b_key`
+ }
+}
+
+mod slug_with_hyphens {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ slug_with_hyphens => "./slug-with-hyphens.ftl",
+//~^ ERROR name `slug_with_hyphens_this-slug-has-hyphens` contains a '-' character
+ }
+}
+
+mod label_with_hyphens {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ label_with_hyphens => "./label-with-hyphens.ftl",
+//~^ ERROR attribute `label-has-hyphens` contains a '-' character
}
}
@@ -62,5 +81,18 @@ mod valid {
valid => "./valid.ftl",
}
- use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, valid::valid};
+ use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, valid_key};
+}
+
+mod missing_crate_name {
+ use super::fluent_messages;
+
+ fluent_messages! {
+ test_crate => "./missing-crate-name.ftl",
+//~^ ERROR name `test-crate_foo` contains a '-' character
+//~| ERROR name `with-hyphens` contains a '-' character
+//~| ERROR name `with-hyphens` does not start with the crate name
+ }
+
+ use self::fluent_generated::{DEFAULT_LOCALE_RESOURCES, test_crate_foo, with_hyphens};
}
diff --git a/src/test/ui-fulldeps/fluent-messages/test.stderr b/src/test/ui-fulldeps/fluent-messages/test.stderr
index 526bca43f..d1cd4fe26 100644
--- a/src/test/ui-fulldeps/fluent-messages/test.stderr
+++ b/src/test/ui-fulldeps/fluent-messages/test.stderr
@@ -22,24 +22,77 @@ LL | missing_message => "./missing-message.ftl",
|
= help: see additional errors emitted
-error: expected a message field for "missing-message"
+error: expected a message field for "missing_message"
--> ./missing-message.ftl:1:1
|
-1 | missing-message =
- | ^^^^^^^^^^^^^^^^^^
+1 | missing_message =
+ | ^^^^^^^^^^^^^^^^^
|
-error: overrides existing message: `key`
- --> $DIR/test.rs:53:9
+error: overrides existing message: `a_b_key`
+ --> $DIR/test.rs:54:16
|
-LL | b => "./duplicate-b.ftl",
- | ^
+LL | a_b => "./duplicate-a-b.ftl",
+ | ^^^^^^^^^^^^^^^^^^^^^
|
help: previously defined in this resource
- --> $DIR/test.rs:52:9
+ --> $DIR/test.rs:53:14
|
LL | a => "./duplicate-a.ftl",
- | ^
+ | ^^^^^^^^^^^^^^^^^^^
-error: aborting due to 4 previous errors
+error[E0428]: the name `a_b_key` is defined multiple times
+ --> $DIR/test.rs:51:5
+ |
+LL | fluent_messages! {
+ | ^^^^^^^^^^^^^^^^
+ | |
+ | `a_b_key` redefined here
+ | previous definition of the value `a_b_key` here
+ |
+ = note: os-specific message
+ = note: os-specific message
+
+error: name `slug_with_hyphens_this-slug-has-hyphens` contains a '-' character
+ --> $DIR/test.rs:63:30
+ |
+LL | slug_with_hyphens => "./slug-with-hyphens.ftl",
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: replace any '-'s with '_'s
+
+error: attribute `label-has-hyphens` contains a '-' character
+ --> $DIR/test.rs:72:31
+ |
+LL | label_with_hyphens => "./label-with-hyphens.ftl",
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: replace any '-'s with '_'s
+
+error: name `with-hyphens` contains a '-' character
+ --> $DIR/test.rs:91:23
+ |
+LL | test_crate => "./missing-crate-name.ftl",
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: replace any '-'s with '_'s
+
+error: name `with-hyphens` does not start with the crate name
+ --> $DIR/test.rs:91:23
+ |
+LL | test_crate => "./missing-crate-name.ftl",
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: prepend `test_crate_` to the slug name: `test_crate_with_hyphens`
+
+error: name `test-crate_foo` contains a '-' character
+ --> $DIR/test.rs:91:23
+ |
+LL | test_crate => "./missing-crate-name.ftl",
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: replace any '-'s with '_'s
+
+error: aborting due to 10 previous errors
+For more information about this error, try `rustc --explain E0428`.
diff --git a/src/test/ui-fulldeps/fluent-messages/valid.ftl b/src/test/ui-fulldeps/fluent-messages/valid.ftl
index 0eee4a02b..549274306 100644
--- a/src/test/ui-fulldeps/fluent-messages/valid.ftl
+++ b/src/test/ui-fulldeps/fluent-messages/valid.ftl
@@ -1 +1 @@
-valid = Valid!
+valid_key = Valid!
diff --git a/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr b/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr
index 9d13ee89b..3cb13082f 100644
--- a/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr
+++ b/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr
@@ -4,12 +4,12 @@ error: prefer `FxHashMap` over `HashMap`, it has better performance
LL | let _map: HashMap<String, String> = HashMap::default();
| ^^^^^^^
|
+ = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
note: the lint level is defined here
--> $DIR/default_hash_types.rs:4:9
|
LL | #![deny(rustc::default_hash_types)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
error: prefer `FxHashMap` over `HashMap`, it has better performance
--> $DIR/default_hash_types.rs:16:15
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.rs b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
index d6f63d44b..643e81d99 100644
--- a/src/test/ui-fulldeps/internal-lints/diagnostics.rs
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
@@ -1,6 +1,7 @@
// compile-flags: -Z unstable-options
#![crate_type = "lib"]
+#![feature(rustc_attrs)]
#![feature(rustc_private)]
#![deny(rustc::untranslatable_diagnostic)]
#![deny(rustc::diagnostic_outside_of_impl)]
@@ -10,64 +11,79 @@ extern crate rustc_macros;
extern crate rustc_session;
extern crate rustc_span;
-use rustc_errors::{AddSubdiagnostic, Diagnostic, DiagnosticBuilder, ErrorGuaranteed, fluent};
-use rustc_macros::{SessionDiagnostic, SessionSubdiagnostic};
-use rustc_session::{parse::ParseSess, SessionDiagnostic};
+use rustc_errors::{
+ AddToDiagnostic, IntoDiagnostic, Diagnostic, DiagnosticBuilder,
+ ErrorGuaranteed, Handler, fluent, SubdiagnosticMessage,
+};
+use rustc_macros::{Diagnostic, Subdiagnostic};
use rustc_span::Span;
-#[derive(SessionDiagnostic)]
-#[error(parser::expect_path)]
-struct DeriveSessionDiagnostic {
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct DeriveDiagnostic {
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[note(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[note(compiletest_example)]
struct Note {
#[primary_span]
span: Span,
}
-pub struct UntranslatableInSessionDiagnostic;
+pub struct UntranslatableInIntoDiagnostic;
-impl<'a> SessionDiagnostic<'a, ErrorGuaranteed> for UntranslatableInSessionDiagnostic {
- fn into_diagnostic(self, sess: &'a ParseSess) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
- sess.struct_err("untranslatable diagnostic")
+impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for UntranslatableInIntoDiagnostic {
+ fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
+ handler.struct_err("untranslatable diagnostic")
//~^ ERROR diagnostics should be created using translatable messages
}
}
-pub struct TranslatableInSessionDiagnostic;
+pub struct TranslatableInIntoDiagnostic;
-impl<'a> SessionDiagnostic<'a, ErrorGuaranteed> for TranslatableInSessionDiagnostic {
- fn into_diagnostic(self, sess: &'a ParseSess) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
- sess.struct_err(fluent::parser::expect_path)
+impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInIntoDiagnostic {
+ fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
+ handler.struct_err(fluent::compiletest_example)
}
}
-pub struct UntranslatableInAddSubdiagnostic;
+pub struct UntranslatableInAddToDiagnostic;
-impl AddSubdiagnostic for UntranslatableInAddSubdiagnostic {
- fn add_to_diagnostic(self, diag: &mut Diagnostic) {
+impl AddToDiagnostic for UntranslatableInAddToDiagnostic {
+ fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, _: F)
+ where
+ F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage,
+ {
diag.note("untranslatable diagnostic");
//~^ ERROR diagnostics should be created using translatable messages
}
}
-pub struct TranslatableInAddSubdiagnostic;
+pub struct TranslatableInAddToDiagnostic;
-impl AddSubdiagnostic for TranslatableInAddSubdiagnostic {
- fn add_to_diagnostic(self, diag: &mut Diagnostic) {
- diag.note(fluent::typeck::note);
+impl AddToDiagnostic for TranslatableInAddToDiagnostic {
+ fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, _: F)
+ where
+ F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage,
+ {
+ diag.note(fluent::note);
}
}
-pub fn make_diagnostics<'a>(sess: &'a ParseSess) {
- let _diag = sess.struct_err(fluent::parser::expect_path);
- //~^ ERROR diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
+pub fn make_diagnostics<'a>(handler: &'a Handler) {
+ let _diag = handler.struct_err(fluent::compiletest_example);
+ //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
- let _diag = sess.struct_err("untranslatable diagnostic");
- //~^ ERROR diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
+ let _diag = handler.struct_err("untranslatable diagnostic");
+ //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
//~^^ ERROR diagnostics should be created using translatable messages
}
+
+// Check that `rustc_lint_diagnostics`-annotated functions aren't themselves linted.
+
+#[rustc_lint_diagnostics]
+pub fn skipped_because_of_annotation<'a>(handler: &'a Handler) {
+ let _diag = handler.struct_err("untranslatable diagnostic"); // okay!
+}
diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
index bae78ffdc..510d6a171 100644
--- a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
+++ b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr
@@ -1,44 +1,44 @@
error: diagnostics should be created using translatable messages
- --> $DIR/diagnostics.rs:36:14
+ --> $DIR/diagnostics.rs:39:17
|
-LL | sess.struct_err("untranslatable diagnostic")
- | ^^^^^^^^^^
+LL | handler.struct_err("untranslatable diagnostic")
+ | ^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/diagnostics.rs:5:9
+ --> $DIR/diagnostics.rs:6:9
|
LL | #![deny(rustc::untranslatable_diagnostic)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: diagnostics should be created using translatable messages
- --> $DIR/diagnostics.rs:53:14
+ --> $DIR/diagnostics.rs:59:14
|
LL | diag.note("untranslatable diagnostic");
| ^^^^
-error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
- --> $DIR/diagnostics.rs:67:22
+error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
+ --> $DIR/diagnostics.rs:76:25
|
-LL | let _diag = sess.struct_err(fluent::parser::expect_path);
- | ^^^^^^^^^^
+LL | let _diag = handler.struct_err(fluent::compiletest_example);
+ | ^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/diagnostics.rs:6:9
+ --> $DIR/diagnostics.rs:7:9
|
LL | #![deny(rustc::diagnostic_outside_of_impl)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
- --> $DIR/diagnostics.rs:70:22
+error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls
+ --> $DIR/diagnostics.rs:79:25
|
-LL | let _diag = sess.struct_err("untranslatable diagnostic");
- | ^^^^^^^^^^
+LL | let _diag = handler.struct_err("untranslatable diagnostic");
+ | ^^^^^^^^^^
error: diagnostics should be created using translatable messages
- --> $DIR/diagnostics.rs:70:22
+ --> $DIR/diagnostics.rs:79:25
|
-LL | let _diag = sess.struct_err("untranslatable diagnostic");
- | ^^^^^^^^^^
+LL | let _diag = handler.struct_err("untranslatable diagnostic");
+ | ^^^^^^^^^^
error: aborting due to 5 previous errors
diff --git a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
index bc9fcdd7b..4e296fff6 100644
--- a/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
+++ b/src/test/ui-fulldeps/internal-lints/existing_doc_keyword.stderr
@@ -4,12 +4,12 @@ error: found non-existing keyword `tadam` used in `#[doc(keyword = \"...\")]`
LL | #[doc(keyword = "tadam")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
+ = help: only existing keywords are allowed in core/std
note: the lint level is defined here
--> $DIR/existing_doc_keyword.rs:8:9
|
LL | #![deny(rustc::existing_doc_keyword)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: only existing keywords are allowed in core/std
error: aborting due to previous error
diff --git a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr
index 9df6be65e..ad6e93334 100644
--- a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr
+++ b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.stderr
@@ -4,12 +4,12 @@ error: implementing `LintPass` by hand
LL | impl LintPass for Foo {
| ^^^^^^^^
|
+ = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
note: the lint level is defined here
--> $DIR/lint_pass_impl_without_macro.rs:4:9
|
LL | #![deny(rustc::lint_pass_impl_without_macro)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: try using `declare_lint_pass!` or `impl_lint_pass!` instead
error: implementing `LintPass` by hand
--> $DIR/lint_pass_impl_without_macro.rs:30:14
diff --git a/src/test/ui-fulldeps/internal-lints/query_stability.stderr b/src/test/ui-fulldeps/internal-lints/query_stability.stderr
index 7e8b448f4..ee4ef9982 100644
--- a/src/test/ui-fulldeps/internal-lints/query_stability.stderr
+++ b/src/test/ui-fulldeps/internal-lints/query_stability.stderr
@@ -4,12 +4,12 @@ error: using `drain` can result in unstable query results
LL | for _ in x.drain() {}
| ^^^^^
|
+ = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
note: the lint level is defined here
--> $DIR/query_stability.rs:4:9
|
LL | #![deny(rustc::potential_query_instability)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: if you believe this case to be fine, allow this lint and add a comment explaining your rationale
error: using `iter` can result in unstable query results
--> $DIR/query_stability.rs:16:16
diff --git a/src/test/ui-fulldeps/issue-15778-pass.rs b/src/test/ui-fulldeps/issue-15778-pass.rs
deleted file mode 100644
index c031dbc71..000000000
--- a/src/test/ui-fulldeps/issue-15778-pass.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// check-pass
-// aux-build:lint-for-crate-rpass.rs
-// ignore-stage1
-// compile-flags: -D crate-not-okay
-
-#![feature(plugin, register_attr, custom_inner_attributes)]
-
-#![register_attr(
- crate_okay,
- crate_blue,
- crate_red,
- crate_grey,
- crate_green,
-)]
-
-#![plugin(lint_for_crate_rpass)] //~ WARNING compiler plugins are deprecated
-#![crate_okay]
-#![crate_blue]
-#![crate_red]
-#![crate_grey]
-#![crate_green]
-
-fn main() {}
diff --git a/src/test/ui-fulldeps/issue-15778-pass.stderr b/src/test/ui-fulldeps/issue-15778-pass.stderr
deleted file mode 100644
index a9d9721ac..000000000
--- a/src/test/ui-fulldeps/issue-15778-pass.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-15778-pass.rs:16:1
- |
-LL | #![plugin(lint_for_crate_rpass)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
- |
- = note: `#[warn(deprecated)]` on by default
-
-warning: 1 warning emitted
-
diff --git a/src/test/ui-fulldeps/pprust-expr-roundtrip.rs b/src/test/ui-fulldeps/pprust-expr-roundtrip.rs
index a679b7b4e..117b79871 100644
--- a/src/test/ui-fulldeps/pprust-expr-roundtrip.rs
+++ b/src/test/ui-fulldeps/pprust-expr-roundtrip.rs
@@ -30,7 +30,6 @@ use rustc_ast::mut_visit::{self, visit_clobber, MutVisitor};
use rustc_ast::ptr::P;
use rustc_ast::*;
use rustc_ast_pretty::pprust;
-use rustc_data_structures::thin_vec::ThinVec;
use rustc_parse::new_parser_from_source_str;
use rustc_session::parse::ParseSess;
use rustc_span::source_map::FilePathMapping;
@@ -47,7 +46,7 @@ fn parse_expr(ps: &ParseSess, src: &str) -> Option<P<Expr>> {
// Helper functions for building exprs
fn expr(kind: ExprKind) -> P<Expr> {
- P(Expr { id: DUMMY_NODE_ID, kind, span: DUMMY_SP, attrs: ThinVec::new(), tokens: None })
+ P(Expr { id: DUMMY_NODE_ID, kind, span: DUMMY_SP, attrs: AttrVec::new(), tokens: None })
}
fn make_x() -> P<Expr> {
@@ -74,10 +73,10 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) {
2 => {
let seg = PathSegment::from_ident(Ident::from_str("x"));
iter_exprs(depth - 1, &mut |e| {
- g(ExprKind::MethodCall(seg.clone(), vec![e, make_x()], DUMMY_SP))
+ g(ExprKind::MethodCall(seg.clone(), e, vec![make_x()], DUMMY_SP))
});
iter_exprs(depth - 1, &mut |e| {
- g(ExprKind::MethodCall(seg.clone(), vec![make_x(), e], DUMMY_SP))
+ g(ExprKind::MethodCall(seg.clone(), make_x(), vec![e], DUMMY_SP))
});
}
3..=8 => {
@@ -196,7 +195,7 @@ impl MutVisitor for AddParens {
id: DUMMY_NODE_ID,
kind: ExprKind::Paren(e),
span: DUMMY_SP,
- attrs: ThinVec::new(),
+ attrs: AttrVec::new(),
tokens: None,
})
});
diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
index 0a210cbdc..ca77e483d 100644
--- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
+++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
@@ -1,10 +1,10 @@
// check-fail
-// Tests error conditions for specifying diagnostics using #[derive(SessionDiagnostic)]
+// Tests error conditions for specifying diagnostics using #[derive(Diagnostic)]
// normalize-stderr-test "the following other types implement trait `IntoDiagnosticArg`:(?:.*\n){0,9}\s+and \d+ others" -> "normalized in stderr"
-
+// normalize-stderr-test "diagnostic_builder\.rs:[0-9]+:[0-9]+" -> "diagnostic_builder.rs:LL:CC"
// The proc_macro2 crate handles spans differently when on beta/stable release rather than nightly,
-// changing the output of this test. Since SessionDiagnostic is strictly internal to the compiler
+// changing the output of this test. Since Diagnostic is strictly internal to the compiler
// the test is just ignored on stable and beta:
// ignore-beta
// ignore-stable
@@ -17,7 +17,7 @@ use rustc_span::symbol::Ident;
use rustc_span::Span;
extern crate rustc_macros;
-use rustc_macros::{SessionDiagnostic, LintDiagnostic, SessionSubdiagnostic};
+use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
extern crate rustc_middle;
use rustc_middle::ty::Ty;
@@ -27,125 +27,120 @@ use rustc_errors::{Applicability, MultiSpan};
extern crate rustc_session;
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct Hello {}
-#[derive(SessionDiagnostic)]
-#[warning(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct HelloWarn {}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-//~^ ERROR `#[derive(SessionDiagnostic)]` can only be used on structs
-enum SessionDiagnosticOnEnum {
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+//~^ ERROR unsupported type attribute for diagnostic derive enum
+enum DiagnosticOnEnum {
Foo,
+//~^ ERROR diagnostic slug not specified
Bar,
+//~^ ERROR diagnostic slug not specified
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-#[error = "E0123"]
-//~^ ERROR `#[error = ...]` is not a valid attribute
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[diag = "E0123"]
+//~^ ERROR `#[diag = ...]` is not a valid attribute
struct WrongStructAttrStyle {}
-#[derive(SessionDiagnostic)]
-#[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[nonsense(compiletest_example, code = "E0123")]
//~^ ERROR `#[nonsense(...)]` is not a valid attribute
-//~^^ ERROR diagnostic kind not specified
+//~^^ ERROR diagnostic slug not specified
//~^^^ ERROR cannot find attribute `nonsense` in this scope
struct InvalidStructAttr {}
-#[derive(SessionDiagnostic)]
-#[error("E0123")]
-//~^ ERROR `#[error("...")]` is not a valid attribute
+#[derive(Diagnostic)]
+#[diag("E0123")]
+//~^ ERROR `#[diag("...")]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified
struct InvalidLitNestedAttr {}
-#[derive(SessionDiagnostic)]
-#[error(nonsense, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(nonsense, code = "E0123")]
//~^ ERROR cannot find value `nonsense` in module `rustc_errors::fluent`
struct InvalidNestedStructAttr {}
-#[derive(SessionDiagnostic)]
-#[error(nonsense("foo"), code = "E0123", slug = "foo")]
-//~^ ERROR `#[error(nonsense(...))]` is not a valid attribute
+#[derive(Diagnostic)]
+#[diag(nonsense("foo"), code = "E0123", slug = "foo")]
+//~^ ERROR `#[diag(nonsense(...))]` is not a valid attribute
//~^^ ERROR diagnostic slug not specified
struct InvalidNestedStructAttr1 {}
-#[derive(SessionDiagnostic)]
-#[error(nonsense = "...", code = "E0123", slug = "foo")]
-//~^ ERROR `#[error(nonsense = ...)]` is not a valid attribute
-//~^^ ERROR diagnostic slug not specified
+#[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 diagnostic slug not specified
struct InvalidNestedStructAttr2 {}
-#[derive(SessionDiagnostic)]
-#[error(nonsense = 4, code = "E0123", slug = "foo")]
-//~^ ERROR `#[error(nonsense = ...)]` is not a valid attribute
-//~^^ ERROR diagnostic slug not specified
+#[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 diagnostic slug not specified
struct InvalidNestedStructAttr3 {}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")]
-//~^ ERROR `#[error(slug = ...)]` is not a valid attribute
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123", slug = "foo")]
+//~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
struct InvalidNestedStructAttr4 {}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct WrongPlaceField {
#[suggestion = "bar"]
//~^ ERROR `#[suggestion = ...]` is not a valid attribute
sp: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0456")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[diag(compiletest_example, code = "E0456")]
//~^ ERROR specified multiple times
//~^^ ERROR specified multiple times
-//~^^^ ERROR specified multiple times
-struct ErrorSpecifiedTwice {}
+struct DiagSpecifiedTwice {}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-#[warning(typeck::ambiguous_lifetime_bound, code = "E0293")]
-//~^ ERROR specified multiple times
-//~^^ ERROR specified multiple times
-//~^^^ ERROR specified multiple times
-struct WarnSpecifiedAfterError {}
-
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0456", code = "E0457")]
//~^ ERROR specified multiple times
struct CodeSpecifiedTwice {}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")]
-//~^ ERROR `#[error(typeck::ambiguous_lifetime_bound)]` is not a valid attribute
+#[derive(Diagnostic)]
+#[diag(compiletest_example, compiletest_example, code = "E0456")]
+//~^ ERROR `#[diag(compiletest_example)]` is not a valid attribute
struct SlugSpecifiedTwice {}
-#[derive(SessionDiagnostic)]
-struct KindNotProvided {} //~ ERROR diagnostic kind not specified
+#[derive(Diagnostic)]
+struct KindNotProvided {} //~ ERROR diagnostic slug not specified
-#[derive(SessionDiagnostic)]
-#[error(code = "E0456")]
+#[derive(Diagnostic)]
+#[diag(code = "E0456")]
//~^ ERROR diagnostic slug not specified
struct SlugNotProvided {}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound)]
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
struct CodeNotProvided {}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct MessageWrongType {
#[primary_span]
//~^ ERROR `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
foo: String,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct InvalidPathFieldAttr {
#[nonsense]
//~^ ERROR `#[nonsense]` is not a valid attribute
@@ -153,201 +148,204 @@ struct InvalidPathFieldAttr {
foo: String,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithField {
name: String,
- #[label(typeck::label)]
+ #[label(label)]
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithMessageAppliedToField {
- #[label(typeck::label)]
+ #[label(label)]
//~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
name: String,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithNonexistentField {
- #[suggestion(typeck::suggestion, code = "{name}")]
+ #[suggestion(suggestion, code = "{name}")]
//~^ ERROR `name` doesn't refer to a field on this type
suggestion: (Span, Applicability),
}
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
//~^ ERROR invalid format string: expected `'}'`
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorMissingClosingBrace {
- #[suggestion(typeck::suggestion, code = "{name")]
+ #[suggestion(suggestion, code = "{name")]
suggestion: (Span, Applicability),
name: String,
val: usize,
}
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
//~^ ERROR invalid format string: unmatched `}`
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorMissingOpeningBrace {
- #[suggestion(typeck::suggestion, code = "name}")]
+ #[suggestion(suggestion, code = "name}")]
suggestion: (Span, Applicability),
name: String,
val: usize,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct LabelOnSpan {
- #[label(typeck::label)]
+ #[label(label)]
sp: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct LabelOnNonSpan {
- #[label(typeck::label)]
+ #[label(label)]
//~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
id: u32,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct Suggest {
- #[suggestion(typeck::suggestion, code = "This is the suggested code")]
- #[suggestion_short(typeck::suggestion, code = "This is the suggested code")]
- #[suggestion_hidden(typeck::suggestion, code = "This is the suggested code")]
- #[suggestion_verbose(typeck::suggestion, code = "This is the suggested code")]
+ #[suggestion(suggestion, code = "This is the suggested code")]
+ #[suggestion_short(suggestion, code = "This is the suggested code")]
+ #[suggestion_hidden(suggestion, code = "This is the suggested code")]
+ #[suggestion_verbose(suggestion, code = "This is the suggested code")]
suggestion: (Span, Applicability),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithoutCode {
- #[suggestion(typeck::suggestion)]
+ #[suggestion(suggestion)]
+ //~^ ERROR suggestion without `code = "..."`
suggestion: (Span, Applicability),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithBadKey {
#[suggestion(nonsense = "bar")]
//~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute
+ //~| ERROR suggestion without `code = "..."`
suggestion: (Span, Applicability),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithShorthandMsg {
#[suggestion(msg = "bar")]
//~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute
+ //~| ERROR suggestion without `code = "..."`
suggestion: (Span, Applicability),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithoutMsg {
#[suggestion(code = "bar")]
suggestion: (Span, Applicability),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithTypesSwapped {
- #[suggestion(typeck::suggestion, code = "This is suggested code")]
+ #[suggestion(suggestion, code = "This is suggested code")]
suggestion: (Applicability, Span),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithWrongTypeApplicabilityOnly {
- #[suggestion(typeck::suggestion, code = "This is suggested code")]
+ #[suggestion(suggestion, code = "This is suggested code")]
//~^ ERROR wrong field type for suggestion
suggestion: Applicability,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithSpanOnly {
- #[suggestion(typeck::suggestion, code = "This is suggested code")]
+ #[suggestion(suggestion, code = "This is suggested code")]
suggestion: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithDuplicateSpanAndApplicability {
- #[suggestion(typeck::suggestion, code = "This is suggested code")]
- //~^ ERROR type of field annotated with `#[suggestion(...)]` contains more than one `Span`
+ #[suggestion(suggestion, code = "This is suggested code")]
suggestion: (Span, Span, Applicability),
+ //~^ ERROR specified multiple times
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct SuggestWithDuplicateApplicabilityAndSpan {
- #[suggestion(typeck::suggestion, code = "This is suggested code")]
- //~^ ERROR type of field annotated with `#[suggestion(...)]` contains more than one
+ #[suggestion(suggestion, code = "This is suggested code")]
suggestion: (Applicability, Applicability, Span),
+ //~^ ERROR specified multiple times
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct WrongKindOfAnnotation {
#[label = "bar"]
//~^ ERROR `#[label = ...]` is not a valid attribute
z: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct OptionsInErrors {
- #[label(typeck::label)]
+ #[label(label)]
label: Option<Span>,
- #[suggestion(typeck::suggestion)]
+ #[suggestion(suggestion, code = "...")]
opt_sugg: Option<(Span, Applicability)>,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0456")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0456")]
struct MoveOutOfBorrowError<'tcx> {
name: Ident,
ty: Ty<'tcx>,
#[primary_span]
- #[label(typeck::label)]
+ #[label(label)]
span: Span,
- #[label(typeck::label)]
+ #[label(label)]
other_span: Span,
- #[suggestion(typeck::suggestion, code = "{name}.clone()")]
+ #[suggestion(suggestion, code = "{name}.clone()")]
opt_sugg: Option<(Span, Applicability)>,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithLifetime<'a> {
- #[label(typeck::label)]
+ #[label(label)]
span: Span,
name: &'a str,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithDefaultLabelAttr<'a> {
#[label]
span: Span,
name: &'a str,
}
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
//~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
struct ArgFieldWithoutSkip {
#[primary_span]
span: Span,
other: Hello,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ArgFieldWithSkip {
#[primary_span]
span: Span,
@@ -357,212 +355,444 @@ struct ArgFieldWithSkip {
other: Hello,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithSpannedNote {
#[note]
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithSpannedNoteCustom {
- #[note(typeck::note)]
+ #[note(note)]
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
#[note]
struct ErrorWithNote {
val: String,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-#[note(typeck::note)]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[note(note)]
struct ErrorWithNoteCustom {
val: String,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithSpannedHelp {
#[help]
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithSpannedHelpCustom {
- #[help(typeck::help)]
+ #[help(help)]
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
#[help]
struct ErrorWithHelp {
val: String,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-#[help(typeck::help)]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[help(help)]
struct ErrorWithHelpCustom {
val: String,
}
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
#[help]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithHelpWrongOrder {
val: String,
}
-#[derive(SessionDiagnostic)]
-#[help(typeck::help)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[help(help)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithHelpCustomWrongOrder {
val: String,
}
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
#[note]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithNoteWrongOrder {
val: String,
}
-#[derive(SessionDiagnostic)]
-#[note(typeck::note)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[note(note)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithNoteCustomWrongOrder {
val: String,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ApplicabilityInBoth {
- #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
- //~^ ERROR applicability cannot be set in both the field and attribute
+ #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
+ //~^ ERROR specified multiple times
suggestion: (Span, Applicability),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct InvalidApplicability {
- #[suggestion(typeck::suggestion, code = "...", applicability = "batman")]
+ #[suggestion(suggestion, code = "...", applicability = "batman")]
//~^ ERROR invalid applicability
suggestion: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ValidApplicability {
- #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
+ #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
suggestion: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct NoApplicability {
- #[suggestion(typeck::suggestion, code = "...")]
+ #[suggestion(suggestion, code = "...")]
suggestion: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[note(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[note(parser_add_paren)]
struct Note;
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound)]
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
struct Subdiagnostic {
#[subdiagnostic]
note: Note,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct VecField {
#[primary_span]
#[label]
spans: Vec<Span>,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct UnitField {
#[primary_span]
spans: Span,
#[help]
foo: (),
- #[help(typeck::help)]
+ #[help(help)]
bar: (),
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct OptUnitField {
#[primary_span]
spans: Span,
#[help]
foo: Option<()>,
- #[help(typeck::help)]
+ #[help(help)]
bar: Option<()>,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct LabelWithTrailingPath {
- #[label(typeck::label, foo)]
- //~^ ERROR `#[label(...)]` is not a valid attribute
+ #[label(label, foo)]
+ //~^ ERROR `#[label(foo)]` is not a valid attribute
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct LabelWithTrailingNameValue {
- #[label(typeck::label, foo = "...")]
- //~^ ERROR `#[label(...)]` is not a valid attribute
+ #[label(label, foo = "...")]
+ //~^ ERROR `#[label(foo = ...)]` is not a valid attribute
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct LabelWithTrailingList {
- #[label(typeck::label, foo("..."))]
- //~^ ERROR `#[label(...)]` is not a valid attribute
+ #[label(label, foo("..."))]
+ //~^ ERROR `#[label(foo(...))]` is not a valid attribute
span: Span,
}
-#[derive(SessionDiagnostic)]
-#[lint(typeck::ambiguous_lifetime_bound)]
-//~^ ERROR only `#[error(..)]` and `#[warning(..)]` are supported
-struct LintsBad {
-}
-
#[derive(LintDiagnostic)]
-#[lint(typeck::ambiguous_lifetime_bound)]
+#[diag(compiletest_example)]
struct LintsGood {
}
#[derive(LintDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound)]
-//~^ ERROR only `#[lint(..)]` is supported
-struct ErrorsBad {
+#[diag(compiletest_example)]
+struct PrimarySpanOnLint {
+ #[primary_span]
+ //~^ ERROR `#[primary_span]` is not a valid attribute
+ span: Span,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
struct ErrorWithMultiSpan {
#[primary_span]
span: MultiSpan,
}
-#[derive(SessionDiagnostic)]
-#[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-#[warn_]
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[warning]
struct ErrorWithWarn {
val: String,
}
+
+#[derive(Diagnostic)]
+#[error(compiletest_example, code = "E0123")]
+//~^ ERROR `#[error(...)]` is not a valid attribute
+//~| ERROR diagnostic slug not specified
+//~| ERROR cannot find attribute `error` in this scope
+struct ErrorAttribute {}
+
+#[derive(Diagnostic)]
+#[warn_(compiletest_example, code = "E0123")]
+//~^ ERROR `#[warn_(...)]` is not a valid attribute
+//~| ERROR diagnostic slug not specified
+//~| ERROR cannot find attribute `warn_` in this scope
+struct WarnAttribute {}
+
+#[derive(Diagnostic)]
+#[lint(compiletest_example, code = "E0123")]
+//~^ ERROR `#[lint(...)]` is not a valid attribute
+//~| ERROR diagnostic slug not specified
+//~| ERROR cannot find attribute `lint` in this scope
+struct LintAttributeOnSessionDiag {}
+
+#[derive(LintDiagnostic)]
+#[lint(compiletest_example, code = "E0123")]
+//~^ ERROR `#[lint(...)]` is not a valid attribute
+//~| ERROR `#[lint(...)]` is not a valid attribute
+//~| ERROR diagnostic slug not specified
+//~| ERROR cannot find attribute `lint` in this scope
+struct LintAttributeOnLintDiag {}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+struct DuplicatedSuggestionCode {
+ #[suggestion(suggestion, code = "...", code = ",,,")]
+ //~^ ERROR specified multiple times
+ suggestion: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+struct InvalidTypeInSuggestionTuple {
+ #[suggestion(suggestion, code = "...")]
+ suggestion: (Span, usize),
+ //~^ ERROR wrong types for suggestion
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+struct MissingApplicabilityInSuggestionTuple {
+ #[suggestion(suggestion, code = "...")]
+ suggestion: (Span,),
+ //~^ ERROR wrong types for suggestion
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+struct MissingCodeInSuggestion {
+ #[suggestion(suggestion)]
+ //~^ ERROR suggestion without `code = "..."`
+ suggestion: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[multipart_suggestion(suggestion)]
+//~^ 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
+struct MultipartSuggestion {
+ #[multipart_suggestion(suggestion)]
+ //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
+ //~| ERROR cannot find attribute `multipart_suggestion` in this scope
+ suggestion: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[suggestion(suggestion, code = "...")]
+//~^ ERROR `#[suggestion(...)]` is not a valid attribute
+struct SuggestionOnStruct {
+ #[primary_span]
+ suggestion: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+#[label]
+//~^ ERROR `#[label]` is not a valid attribute
+struct LabelOnStruct {
+ #[primary_span]
+ suggestion: Span,
+}
+
+#[derive(Diagnostic)]
+enum ExampleEnum {
+ #[diag(compiletest_example)]
+ Foo {
+ #[primary_span]
+ sp: Span,
+ #[note]
+ note_sp: Span,
+ },
+ #[diag(compiletest_example)]
+ Bar {
+ #[primary_span]
+ sp: Span,
+ },
+ #[diag(compiletest_example)]
+ Baz,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+struct RawIdentDiagnosticArg {
+ pub r#type: String,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SubdiagnosticBad {
+ #[subdiagnostic(bad)]
+//~^ ERROR `#[subdiagnostic(bad)]` is not a valid attribute
+ note: Note,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SubdiagnosticBadStr {
+ #[subdiagnostic = "bad"]
+//~^ ERROR `#[subdiagnostic = ...]` is not a valid attribute
+ note: Note,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SubdiagnosticBadTwice {
+ #[subdiagnostic(bad, bad)]
+//~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
+ note: Note,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SubdiagnosticBadLitStr {
+ #[subdiagnostic("bad")]
+//~^ ERROR `#[subdiagnostic("...")]` is not a valid attribute
+ note: Note,
+}
+
+#[derive(LintDiagnostic)]
+#[diag(compiletest_example)]
+struct SubdiagnosticEagerLint {
+ #[subdiagnostic(eager)]
+//~^ ERROR `#[subdiagnostic(...)]` is not a valid attribute
+ note: Note,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SubdiagnosticEagerCorrect {
+ #[subdiagnostic(eager)]
+ note: Note,
+}
+
+// Check that formatting of `correct` in suggestion doesn't move the binding for that field, making
+// the `set_arg` call a compile error; and that isn't worked around by moving the `set_arg` call
+// after the `span_suggestion` call - which breaks eager translation.
+
+#[derive(Subdiagnostic)]
+#[suggestion_short(
+ use_instead,
+ applicability = "machine-applicable",
+ code = "{correct}"
+)]
+pub(crate) struct SubdiagnosticWithSuggestion {
+ #[primary_span]
+ span: Span,
+ invalid: String,
+ correct: String,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SubdiagnosticEagerSuggestion {
+ #[subdiagnostic(eager)]
+ sub: SubdiagnosticWithSuggestion,
+}
+
+/// with a doc comment on the type..
+#[derive(Diagnostic)]
+#[diag(compiletest_example, code = "E0123")]
+struct WithDocComment {
+ /// ..and the field
+ #[primary_span]
+ span: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SuggestionsGood {
+ #[suggestion(code("foo", "bar"))]
+ sub: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SuggestionsSingleItem {
+ #[suggestion(code("foo"))]
+ sub: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SuggestionsNoItem {
+ #[suggestion(code())]
+ //~^ ERROR expected at least one string literal for `code(...)`
+ sub: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SuggestionsInvalidItem {
+ #[suggestion(code(foo))]
+ //~^ ERROR `code(...)` must contain only string literals
+ sub: Span,
+}
+
+#[derive(Diagnostic)]
+#[diag(compiletest_example)]
+struct SuggestionsInvalidLiteral {
+ #[suggestion(code = 3)]
+ //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
+ sub: Span,
+}
diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
index c1080aa24..859c272b6 100644
--- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
+++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
@@ -1,423 +1,671 @@
-error: `#[derive(SessionDiagnostic)]` can only be used on structs
+error: unsupported type attribute for diagnostic derive enum
--> $DIR/diagnostic-derive.rs:39:1
|
-LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
-LL | |
-LL | | enum SessionDiagnosticOnEnum {
-LL | | Foo,
-LL | | Bar,
-LL | | }
- | |_^
+LL | #[diag(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: `#[error = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:48:1
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:42:5
+ |
+LL | Foo,
+ | ^^^
|
-LL | #[error = "E0123"]
- | ^^^^^^^^^^^^^^^^^^
+ = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[nonsense(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:53:1
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:44:5
+ |
+LL | Bar,
+ | ^^^
|
-LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = 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:50:1
+ |
+LL | #[diag = "E0123"]
+ | ^^^^^^^^^^^^^^^^^
+
+error: `#[nonsense(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:55:1
|
- = help: only `error`, `warning`, `help`, `note` and `warn_` are valid attributes
+LL | #[nonsense(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: diagnostic kind not specified
- --> $DIR/diagnostic-derive.rs:53:1
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:55:1
|
-LL | / #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
+LL | / #[nonsense(compiletest_example, code = "E0123")]
LL | |
LL | |
LL | |
LL | | struct InvalidStructAttr {}
| |___________________________^
|
- = help: use the `#[error(...)]` attribute to create an error
+ = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[error("...")]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:60:9
+error: `#[diag("...")]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:62:8
|
-LL | #[error("E0123")]
- | ^^^^^^^
+LL | #[diag("E0123")]
+ | ^^^^^^^
|
- = help: first argument of the attribute should be the diagnostic slug
+ = help: a diagnostic slug is required as the first argument
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:60:1
+ --> $DIR/diagnostic-derive.rs:62:1
|
-LL | / #[error("E0123")]
+LL | / #[diag("E0123")]
LL | |
LL | |
LL | | struct InvalidLitNestedAttr {}
| |______________________________^
|
- = help: specify the slug as the first argument to the attribute, such as `#[error(typeck::example_error)]`
+ = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[error(nonsense(...))]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:71:9
+error: `#[diag(nonsense(...))]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:73:8
|
-LL | #[error(nonsense("foo"), code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^^^^
+LL | #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
+ | ^^^^^^^^^^^^^^^
|
- = help: first argument of the attribute should be the diagnostic slug
+ = help: a diagnostic slug is required as the first argument
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:71:1
+ --> $DIR/diagnostic-derive.rs:73:1
|
-LL | / #[error(nonsense("foo"), code = "E0123", slug = "foo")]
+LL | / #[diag(nonsense("foo"), code = "E0123", slug = "foo")]
LL | |
LL | |
LL | | struct InvalidNestedStructAttr1 {}
| |__________________________________^
|
- = help: specify the slug as the first argument to the attribute, such as `#[error(typeck::example_error)]`
+ = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[error(nonsense = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:77:9
+error: `#[diag(nonsense = ...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:79:8
|
-LL | #[error(nonsense = "...", code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^^^^^
+LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
+ | ^^^^^^^^^^^^^^^^
|
- = help: first argument of the attribute should be the diagnostic slug
+ = help: only `code` is a valid nested attributes following the slug
+
+error: `#[diag(slug = ...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:79:42
+ |
+LL | #[diag(nonsense = "...", code = "E0123", slug = "foo")]
+ | ^^^^^^^^^^^^
+ |
+ = help: only `code` is a valid nested attributes following the slug
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:77:1
+ --> $DIR/diagnostic-derive.rs:79:1
|
-LL | / #[error(nonsense = "...", code = "E0123", slug = "foo")]
+LL | / #[diag(nonsense = "...", code = "E0123", slug = "foo")]
+LL | |
LL | |
LL | |
LL | | struct InvalidNestedStructAttr2 {}
| |__________________________________^
|
- = help: specify the slug as the first argument to the attribute, such as `#[error(typeck::example_error)]`
+ = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[error(nonsense = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:83:9
+error: `#[diag(nonsense = ...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:86:8
|
-LL | #[error(nonsense = 4, code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^
+LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
+ | ^^^^^^^^^^^^
+
+error: `#[diag(slug = ...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:86:38
|
- = help: first argument of the attribute should be the diagnostic slug
+LL | #[diag(nonsense = 4, code = "E0123", slug = "foo")]
+ | ^^^^^^^^^^^^
+ |
+ = help: only `code` is a valid nested attributes following the slug
error: diagnostic slug not specified
- --> $DIR/diagnostic-derive.rs:83:1
+ --> $DIR/diagnostic-derive.rs:86:1
|
-LL | / #[error(nonsense = 4, code = "E0123", slug = "foo")]
+LL | / #[diag(nonsense = 4, code = "E0123", slug = "foo")]
+LL | |
LL | |
LL | |
LL | | struct InvalidNestedStructAttr3 {}
| |__________________________________^
|
- = help: specify the slug as the first argument to the attribute, such as `#[error(typeck::example_error)]`
+ = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: `#[error(slug = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:89:59
+error: `#[diag(slug = ...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:93:45
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")]
- | ^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0123", slug = "foo")]
+ | ^^^^^^^^^^^^
|
= help: only `code` is a valid nested attributes following the slug
error: `#[suggestion = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:96:5
+ --> $DIR/diagnostic-derive.rs:100:5
|
LL | #[suggestion = "bar"]
| ^^^^^^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:103:1
+ --> $DIR/diagnostic-derive.rs:107:8
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0456")]
+ | ^^^^^^^^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:102:1
+ --> $DIR/diagnostic-derive.rs:106:8
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:103:1
+ --> $DIR/diagnostic-derive.rs:107:36
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0456")]
+ | ^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:102:1
+ --> $DIR/diagnostic-derive.rs:106:36
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[diag(compiletest_example, code = "E0123")]
+ | ^^^^^^^
error: specified multiple times
- --> $DIR/diagnostic-derive.rs:103:50
+ --> $DIR/diagnostic-derive.rs:113:52
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456")]
- | ^^^^^^^
- |
-note: previously specified here
- --> $DIR/diagnostic-derive.rs:102:50
- |
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
- | ^^^^^^^
-
-error: specified multiple times
- --> $DIR/diagnostic-derive.rs:111:1
- |
-LL | #[warning(typeck::ambiguous_lifetime_bound, code = "E0293")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: previously specified here
- --> $DIR/diagnostic-derive.rs:110:1
- |
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: specified multiple times
- --> $DIR/diagnostic-derive.rs:111:1
- |
-LL | #[warning(typeck::ambiguous_lifetime_bound, code = "E0293")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: previously specified here
- --> $DIR/diagnostic-derive.rs:110:1
- |
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: specified multiple times
- --> $DIR/diagnostic-derive.rs:111:52
- |
-LL | #[warning(typeck::ambiguous_lifetime_bound, code = "E0293")]
+LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
| ^^^^^^^
|
note: previously specified here
- --> $DIR/diagnostic-derive.rs:110:50
+ --> $DIR/diagnostic-derive.rs:113:36
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")]
- | ^^^^^^^
+LL | #[diag(compiletest_example, code = "E0456", code = "E0457")]
+ | ^^^^^^^
-error: specified multiple times
- --> $DIR/diagnostic-derive.rs:118:66
+error: `#[diag(compiletest_example)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:118:29
|
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
- | ^^^^^^^
+LL | #[diag(compiletest_example, compiletest_example, code = "E0456")]
+ | ^^^^^^^^^^^^^^^^^^^
|
-note: previously specified here
- --> $DIR/diagnostic-derive.rs:118:50
- |
-LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")]
- | ^^^^^^^
+ = help: diagnostic slug must be the first argument
-error: `#[error(typeck::ambiguous_lifetime_bound)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:123:43
- |
-LL | #[error(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: diagnostic kind not specified
- --> $DIR/diagnostic-derive.rs:128:1
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:123:1
|
LL | struct KindNotProvided {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: use the `#[error(...)]` attribute to create an error
+ = 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:131:1
+ --> $DIR/diagnostic-derive.rs:126:1
|
-LL | / #[error(code = "E0456")]
+LL | / #[diag(code = "E0456")]
LL | |
LL | | struct SlugNotProvided {}
| |_________________________^
|
- = help: specify the slug as the first argument to the attribute, such as `#[error(typeck::example_error)]`
+ = 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:142:5
+ --> $DIR/diagnostic-derive.rs:137:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: `#[nonsense]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:150:5
+ --> $DIR/diagnostic-derive.rs:145:5
|
LL | #[nonsense]
| ^^^^^^^^^^^
- |
- = help: only `skip_arg`, `primary_span`, `label`, `note`, `help` and `subdiagnostic` are valid field attributes
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/diagnostic-derive.rs:167:5
+ --> $DIR/diagnostic-derive.rs:162:5
|
-LL | #[label(typeck::label)]
- | ^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(label)]
+ | ^^^^^^^^^^^^^^^
error: `name` doesn't refer to a field on this type
- --> $DIR/diagnostic-derive.rs:175:45
+ --> $DIR/diagnostic-derive.rs:170:37
|
-LL | #[suggestion(typeck::suggestion, code = "{name}")]
- | ^^^^^^^^
+LL | #[suggestion(suggestion, code = "{name}")]
+ | ^^^^^^^^
error: invalid format string: expected `'}'` but string was terminated
- --> $DIR/diagnostic-derive.rs:180:16
+ --> $DIR/diagnostic-derive.rs:175:10
|
-LL | #[derive(SessionDiagnostic)]
- | - ^ expected `'}'` in format string
- | |
- | because of this opening brace
+LL | #[derive(Diagnostic)]
+ | ^^^^^^^^^^ expected `'}'` in format string
|
= note: if you intended to print `{`, you can escape it using `{{`
- = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
+ = 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:190:15
+ --> $DIR/diagnostic-derive.rs:185:10
|
-LL | #[derive(SessionDiagnostic)]
- | ^ unmatched `}` in format string
+LL | #[derive(Diagnostic)]
+ | ^^^^^^^^^^ unmatched `}` in format string
|
= note: if you intended to print `}`, you can escape it using `}}`
- = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
+ = 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:210:5
+ --> $DIR/diagnostic-derive.rs:205:5
|
-LL | #[label(typeck::label)]
- | ^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(label)]
+ | ^^^^^^^^^^^^^^^
+
+error: suggestion without `code = "..."`
+ --> $DIR/diagnostic-derive.rs:223:5
+ |
+LL | #[suggestion(suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion(nonsense = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:235:18
+ --> $DIR/diagnostic-derive.rs:231:18
|
LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^^^^^^^^^
|
- = help: only `message`, `code` and `applicability` are valid field attributes
+ = help: only `code` and `applicability` are valid nested attributes
+
+error: suggestion without `code = "..."`
+ --> $DIR/diagnostic-derive.rs:231:5
+ |
+LL | #[suggestion(nonsense = "bar")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `#[suggestion(msg = ...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:243:18
+ --> $DIR/diagnostic-derive.rs:240:18
|
LL | #[suggestion(msg = "bar")]
| ^^^^^^^^^^^
|
- = help: only `message`, `code` and `applicability` are valid field attributes
+ = help: only `code` and `applicability` are valid nested attributes
+
+error: suggestion without `code = "..."`
+ --> $DIR/diagnostic-derive.rs:240:5
+ |
+LL | #[suggestion(msg = "bar")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: wrong field type for suggestion
- --> $DIR/diagnostic-derive.rs:265:5
+ --> $DIR/diagnostic-derive.rs:263:5
|
-LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")]
+LL | / #[suggestion(suggestion, code = "This is suggested code")]
LL | |
LL | | suggestion: Applicability,
| |_____________________________^
|
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
-error: type of field annotated with `#[suggestion(...)]` contains more than one `Span`
- --> $DIR/diagnostic-derive.rs:280:5
+error: specified multiple times
+ --> $DIR/diagnostic-derive.rs:279:24
|
-LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")]
-LL | |
-LL | | suggestion: (Span, Span, Applicability),
- | |___________________________________________^
+LL | suggestion: (Span, Span, Applicability),
+ | ^^^^
+ |
+note: previously specified here
+ --> $DIR/diagnostic-derive.rs:279:18
+ |
+LL | suggestion: (Span, Span, Applicability),
+ | ^^^^
-error: type of field annotated with `#[suggestion(...)]` contains more than one Applicability
- --> $DIR/diagnostic-derive.rs:288:5
+error: specified multiple times
+ --> $DIR/diagnostic-derive.rs:287:33
|
-LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")]
-LL | |
-LL | | suggestion: (Applicability, Applicability, Span),
- | |____________________________________________________^
+LL | suggestion: (Applicability, Applicability, Span),
+ | ^^^^^^^^^^^^^
+ |
+note: previously specified here
+ --> $DIR/diagnostic-derive.rs:287:18
+ |
+LL | suggestion: (Applicability, Applicability, Span),
+ | ^^^^^^^^^^^^^
error: `#[label = ...]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:296:5
+ --> $DIR/diagnostic-derive.rs:294:5
|
LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^
-error: applicability cannot be set in both the field and attribute
- --> $DIR/diagnostic-derive.rs:447:52
+error: specified multiple times
+ --> $DIR/diagnostic-derive.rs:445:44
+ |
+LL | #[suggestion(suggestion, code = "...", applicability = "maybe-incorrect")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-LL | #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: previously specified here
+ --> $DIR/diagnostic-derive.rs:447:24
+ |
+LL | suggestion: (Span, Applicability),
+ | ^^^^^^^^^^^^^
error: invalid applicability
- --> $DIR/diagnostic-derive.rs:455:52
+ --> $DIR/diagnostic-derive.rs:453:44
|
-LL | #[suggestion(typeck::suggestion, code = "...", applicability = "batman")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[suggestion(suggestion, code = "...", applicability = "batman")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
-error: `#[label(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:518:5
+error: `#[label(foo)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:516:20
+ |
+LL | #[label(label, foo)]
+ | ^^^
|
-LL | #[label(typeck::label, foo)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = help: a diagnostic slug must be the first argument to the attribute
-error: `#[label(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:526:5
+error: `#[label(foo = ...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:524:20
|
-LL | #[label(typeck::label, foo = "...")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(label, foo = "...")]
+ | ^^^^^^^^^^^
-error: `#[label(...)]` is not a valid attribute
- --> $DIR/diagnostic-derive.rs:534:5
+error: `#[label(foo(...))]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:532:20
|
-LL | #[label(typeck::label, foo("..."))]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(label, foo("..."))]
+ | ^^^^^^^^^^
+
+error: `#[primary_span]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:545:5
+ |
+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:565:1
+ |
+LL | #[error(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: only `#[error(..)]` and `#[warning(..)]` are supported
- --> $DIR/diagnostic-derive.rs:540:1
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:565:1
|
-LL | / #[lint(typeck::ambiguous_lifetime_bound)]
+LL | / #[error(compiletest_example, code = "E0123")]
+LL | |
+LL | |
LL | |
-LL | | struct LintsBad {
-LL | | }
- | |_^
+LL | | struct ErrorAttribute {}
+ | |________________________^
|
- = help: use the `#[error(...)]` attribute to create a error
+ = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
-error: only `#[lint(..)]` is supported
- --> $DIR/diagnostic-derive.rs:551:1
+error: `#[warn_(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:572:1
|
-LL | / #[error(typeck::ambiguous_lifetime_bound)]
+LL | #[warn_(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:572:1
+ |
+LL | / #[warn_(compiletest_example, code = "E0123")]
+LL | |
+LL | |
LL | |
-LL | | struct ErrorsBad {
-LL | | }
- | |_^
+LL | | struct WarnAttribute {}
+ | |_______________________^
|
- = help: use the `#[lint(...)]` attribute to create a lint
+ = 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:579:1
+ |
+LL | #[lint(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:579:1
+ |
+LL | / #[lint(compiletest_example, code = "E0123")]
+LL | |
+LL | |
+LL | |
+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:586:1
+ |
+LL | #[lint(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `#[lint(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:586:1
+ |
+LL | #[lint(compiletest_example, code = "E0123")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: diagnostic slug not specified
+ --> $DIR/diagnostic-derive.rs:586:1
+ |
+LL | / #[lint(compiletest_example, code = "E0123")]
+LL | |
+LL | |
+LL | |
+LL | |
+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:596:44
+ |
+LL | #[suggestion(suggestion, code = "...", code = ",,,")]
+ | ^^^^^^^^^^^^
+ |
+note: previously specified here
+ --> $DIR/diagnostic-derive.rs:596:30
+ |
+LL | #[suggestion(suggestion, code = "...", code = ",,,")]
+ | ^^^^^^^^^^^^
+
+error: wrong types for suggestion
+ --> $DIR/diagnostic-derive.rs:605:24
+ |
+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:613:17
+ |
+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:620:5
+ |
+LL | #[suggestion(suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `#[multipart_suggestion(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:627:1
+ |
+LL | #[multipart_suggestion(suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: consider creating a `Subdiagnostic` instead
+
+error: `#[multipart_suggestion(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:630:1
+ |
+LL | #[multipart_suggestion()]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: consider creating a `Subdiagnostic` instead
+
+error: `#[multipart_suggestion(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:634:5
+ |
+LL | #[multipart_suggestion(suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: consider creating a `Subdiagnostic` instead
+
+error: `#[suggestion(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:642:1
+ |
+LL | #[suggestion(suggestion, code = "...")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: `#[label]` and `#[suggestion]` can only be applied to fields
+
+error: `#[label]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:651:1
+ |
+LL | #[label]
+ | ^^^^^^^^
+ |
+ = help: `#[label]` and `#[suggestion]` can only be applied to fields
+
+error: `#[subdiagnostic(bad)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:685:21
+ |
+LL | #[subdiagnostic(bad)]
+ | ^^^
+ |
+ = help: `eager` is the only supported nested attribute for `subdiagnostic`
+
+error: `#[subdiagnostic = ...]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:693:5
+ |
+LL | #[subdiagnostic = "bad"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: `eager` is the only supported nested attribute for `subdiagnostic`
+
+error: `#[subdiagnostic(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:701:5
+ |
+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:709:21
+ |
+LL | #[subdiagnostic("bad")]
+ | ^^^^^
+ |
+ = help: `eager` is the only supported nested attribute for `subdiagnostic`
+
+error: `#[subdiagnostic(...)]` is not a valid attribute
+ --> $DIR/diagnostic-derive.rs:717:5
+ |
+LL | #[subdiagnostic(eager)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: eager subdiagnostics are not supported on lints
+
+error: expected at least one string literal for `code(...)`
+ --> $DIR/diagnostic-derive.rs:779:18
+ |
+LL | #[suggestion(code())]
+ | ^^^^^^
+
+error: `code(...)` must contain only string literals
+ --> $DIR/diagnostic-derive.rs:787:23
+ |
+LL | #[suggestion(code(foo))]
+ | ^^^
+
+error: `code = "..."`/`code(...)` must contain only string literals
+ --> $DIR/diagnostic-derive.rs:795:18
+ |
+LL | #[suggestion(code = 3)]
+ | ^^^^^^^^
error: cannot find attribute `nonsense` in this scope
- --> $DIR/diagnostic-derive.rs:53:3
+ --> $DIR/diagnostic-derive.rs:55:3
|
-LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")]
+LL | #[nonsense(compiletest_example, code = "E0123")]
| ^^^^^^^^
error: cannot find attribute `nonsense` in this scope
- --> $DIR/diagnostic-derive.rs:150:7
+ --> $DIR/diagnostic-derive.rs:145:7
|
LL | #[nonsense]
| ^^^^^^^^
+error: cannot find attribute `error` in this scope
+ --> $DIR/diagnostic-derive.rs:565:3
+ |
+LL | #[error(compiletest_example, code = "E0123")]
+ | ^^^^^
+
+error: cannot find attribute `warn_` in this scope
+ --> $DIR/diagnostic-derive.rs:572:3
+ |
+LL | #[warn_(compiletest_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:579:3
+ |
+LL | #[lint(compiletest_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:586:3
+ |
+LL | #[lint(compiletest_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:627:3
+ |
+LL | #[multipart_suggestion(suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: cannot find attribute `multipart_suggestion` in this scope
+ --> $DIR/diagnostic-derive.rs:630:3
+ |
+LL | #[multipart_suggestion()]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: cannot find attribute `multipart_suggestion` in this scope
+ --> $DIR/diagnostic-derive.rs:634:7
+ |
+LL | #[multipart_suggestion(suggestion)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent`
- --> $DIR/diagnostic-derive.rs:66:9
+ --> $DIR/diagnostic-derive.rs:68:8
|
-LL | #[error(nonsense, code = "E0123")]
- | ^^^^^^^^ not found in `rustc_errors::fluent`
+LL | #[diag(nonsense, code = "E0123")]
+ | ^^^^^^^^ not found in `rustc_errors::fluent`
error[E0277]: the trait bound `Hello: IntoDiagnosticArg` is not satisfied
- --> $DIR/diagnostic-derive.rs:340:10
+ --> $DIR/diagnostic-derive.rs:338:10
|
-LL | #[derive(SessionDiagnostic)]
- | ^^^^^^^^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
+LL | #[derive(Diagnostic)]
+ | ^^^^^^^^^^ the trait `IntoDiagnosticArg` is not implemented for `Hello`
|
= help: normalized in stderr
note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg`
- --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:539:19
+ --> $COMPILER_DIR/rustc_errors/src/diagnostic_builder.rs:LL:CC
|
LL | arg: impl IntoDiagnosticArg,
| ^^^^^^^^^^^^^^^^^ required by this bound in `DiagnosticBuilder::<'a, G>::set_arg`
- = note: this error originates in the derive macro `SessionDiagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
+ = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 48 previous errors
+error: aborting due to 83 previous errors
Some errors have detailed explanations: E0277, E0425.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
index 16da25c40..efec85eb5 100644
--- a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
+++ b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
@@ -1,8 +1,8 @@
// check-fail
-// Tests error conditions for specifying subdiagnostics using #[derive(SessionSubdiagnostic)]
+// Tests error conditions for specifying subdiagnostics using #[derive(Subdiagnostic)]
// The proc_macro2 crate handles spans differently when on beta/stable release rather than nightly,
-// changing the output of this test. Since SessionSubdiagnostic is strictly internal to the compiler
+// changing the output of this test. Since Subdiagnostic is strictly internal to the compiler
// the test is just ignored on stable and beta:
// ignore-beta
// ignore-stable
@@ -17,25 +17,25 @@ extern crate rustc_macros;
use rustc_errors::Applicability;
use rustc_span::Span;
-use rustc_macros::SessionSubdiagnostic;
+use rustc_macros::Subdiagnostic;
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
struct A {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum B {
- #[label(parser::add_paren)]
+ #[label(parser_add_paren)]
A {
#[primary_span]
span: Span,
var: String,
},
- #[label(parser::add_paren)]
+ #[label(parser_add_paren)]
B {
#[primary_span]
span: Span,
@@ -43,23 +43,23 @@ enum B {
}
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
//~^ ERROR label without `#[primary_span]` field
struct C {
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label]
-//~^ ERROR `#[label]` is not a valid attribute
+//~^ ERROR diagnostic slug must be first argument
struct D {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[foo]
//~^ ERROR `#[foo]` is not a valid attribute
//~^^ ERROR cannot find attribute `foo` in this scope
@@ -69,7 +69,7 @@ struct E {
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label = "..."]
//~^ ERROR `#[label = ...]` is not a valid attribute
struct F {
@@ -78,43 +78,47 @@ struct F {
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label(bug = "...")]
//~^ ERROR `#[label(bug = ...)]` is not a valid attribute
+//~| ERROR diagnostic slug must be first argument
struct G {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label("...")]
//~^ ERROR `#[label("...")]` is not a valid attribute
+//~| ERROR diagnostic slug must be first argument
struct H {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label(slug = 4)]
//~^ ERROR `#[label(slug = ...)]` is not a valid attribute
+//~| ERROR diagnostic slug must be first argument
struct J {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label(slug("..."))]
//~^ ERROR `#[label(slug(...))]` is not a valid attribute
+//~| ERROR diagnostic slug must be first argument
struct K {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label(slug)]
//~^ ERROR cannot find value `slug` in module `rustc_errors::fluent`
//~^^ NOTE not found in `rustc_errors::fluent`
@@ -124,7 +128,7 @@ struct L {
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label()]
//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
struct M {
@@ -133,30 +137,30 @@ struct M {
var: String,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren, code = "...")]
-//~^ ERROR `code` is not a valid nested attribute of a `label` attribute
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren, code = "...")]
+//~^ ERROR `#[label(code = ...)]` is not a valid attribute
struct N {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren, applicability = "machine-applicable")]
-//~^ ERROR `applicability` is not a valid nested attribute of a `label` attribute
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren, applicability = "machine-applicable")]
+//~^ ERROR `#[label(applicability = ...)]` is not a valid attribute
struct O {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[foo]
//~^ ERROR cannot find attribute `foo` in this scope
//~^^ ERROR unsupported type attribute for subdiagnostic enum
enum P {
- #[label(parser::add_paren)]
+ #[label(parser_add_paren)]
A {
#[primary_span]
span: Span,
@@ -164,11 +168,11 @@ enum P {
}
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum Q {
#[bar]
-//~^ ERROR `#[bar]` is not a valid attribute
-//~^^ ERROR cannot find attribute `bar` in this scope
+ //~^ ERROR `#[bar]` is not a valid attribute
+ //~^^ ERROR cannot find attribute `bar` in this scope
A {
#[primary_span]
span: Span,
@@ -176,11 +180,11 @@ enum Q {
}
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum R {
#[bar = "..."]
-//~^ ERROR `#[bar = ...]` is not a valid attribute
-//~^^ ERROR cannot find attribute `bar` in this scope
+ //~^ ERROR `#[bar = ...]` is not a valid attribute
+ //~^^ ERROR cannot find attribute `bar` in this scope
A {
#[primary_span]
span: Span,
@@ -188,11 +192,11 @@ enum R {
}
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum S {
#[bar = 4]
-//~^ ERROR `#[bar = ...]` is not a valid attribute
-//~^^ ERROR cannot find attribute `bar` in this scope
+ //~^ ERROR `#[bar = ...]` is not a valid attribute
+ //~^^ ERROR cannot find attribute `bar` in this scope
A {
#[primary_span]
span: Span,
@@ -200,11 +204,11 @@ enum S {
}
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum T {
#[bar("...")]
-//~^ ERROR `#[bar("...")]` is not a valid attribute
-//~^^ ERROR cannot find attribute `bar` in this scope
+ //~^ ERROR `#[bar(...)]` is not a valid attribute
+ //~^^ ERROR cannot find attribute `bar` in this scope
A {
#[primary_span]
span: Span,
@@ -212,10 +216,11 @@ enum T {
}
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum U {
#[label(code = "...")]
-//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
+ //~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
+ //~| ERROR `#[label(code = ...)]` is not a valid attribute
A {
#[primary_span]
span: Span,
@@ -223,24 +228,23 @@ enum U {
}
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum V {
- #[label(parser::add_paren)]
+ #[label(parser_add_paren)]
A {
#[primary_span]
span: Span,
var: String,
},
B {
-//~^ ERROR subdiagnostic kind not specified
#[primary_span]
span: Span,
var: String,
}
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
//~^ ERROR label without `#[primary_span]` field
struct W {
#[primary_span]
@@ -248,8 +252,8 @@ struct W {
span: String,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
struct X {
#[primary_span]
span: Span,
@@ -258,8 +262,8 @@ struct X {
applicability: Applicability,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
struct Y {
#[primary_span]
span: Span,
@@ -269,8 +273,8 @@ struct Y {
bar: String,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
struct Z {
#[primary_span]
span: Span,
@@ -280,8 +284,8 @@ struct Z {
bar: String,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
struct AA {
#[primary_span]
span: Span,
@@ -291,8 +295,8 @@ struct AA {
bar: String,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
struct AB {
#[primary_span]
span: Span,
@@ -300,53 +304,49 @@ struct AB {
z: Z
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
union AC {
//~^ ERROR unexpected unsupported untagged union
span: u32,
b: u64
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
-//~^ NOTE previously specified here
-//~^^ NOTE previously specified here
-#[label(parser::add_paren)]
-//~^ ERROR specified multiple times
-//~^^ ERROR specified multiple times
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
+#[label(parser_add_paren)]
struct AD {
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren, parser::add_paren)]
-//~^ ERROR `#[label(parser::add_paren)]` is not a valid attribute
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren, parser_add_paren)]
+//~^ ERROR `#[label(parser_add_paren)]` is not a valid attribute
struct AE {
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[label(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
struct AF {
#[primary_span]
-//~^ NOTE previously specified here
+ //~^ NOTE previously specified here
span_a: Span,
#[primary_span]
-//~^ ERROR specified multiple times
+ //~^ ERROR specified multiple times
span_b: Span,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
struct AG {
-//~^ ERROR subdiagnostic kind not specified
+ //~^ ERROR subdiagnostic kind not specified
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code = "...")]
struct AH {
#[primary_span]
span: Span,
@@ -355,9 +355,9 @@ struct AH {
var: String,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum AI {
- #[suggestion(parser::add_paren, code = "...")]
+ #[suggestion(parser_add_paren, code = "...")]
A {
#[primary_span]
span: Span,
@@ -365,7 +365,7 @@ enum AI {
applicability: Applicability,
var: String,
},
- #[suggestion(parser::add_paren, code = "...")]
+ #[suggestion(parser_add_paren, code = "...")]
B {
#[primary_span]
span: Span,
@@ -375,8 +375,8 @@ enum AI {
}
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code = "...", code = "...")]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code = "...", code = "...")]
//~^ ERROR specified multiple times
//~^^ NOTE previously specified here
struct AJ {
@@ -386,40 +386,38 @@ struct AJ {
applicability: Applicability,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code = "...")]
struct AK {
#[primary_span]
span: Span,
#[applicability]
-//~^ NOTE previously specified here
+ //~^ NOTE previously specified here
applicability_a: Applicability,
#[applicability]
-//~^ ERROR specified multiple times
+ //~^ ERROR specified multiple times
applicability_b: Applicability,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
-//~^ ERROR suggestion without `applicability`
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code = "...")]
struct AL {
#[primary_span]
span: Span,
#[applicability]
-//~^ ERROR the `#[applicability]` attribute can only be applied to fields of type `Applicability`
+ //~^ ERROR the `#[applicability]` attribute can only be applied to fields of type `Applicability`
applicability: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
-//~^ ERROR suggestion without `applicability`
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code = "...")]
struct AM {
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren)]
//~^ ERROR suggestion without `code = "..."`
struct AN {
#[primary_span]
@@ -428,44 +426,43 @@ struct AN {
applicability: Applicability,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code ="...", applicability = "foo")]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code ="...", applicability = "foo")]
//~^ ERROR invalid applicability
struct AO {
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
-#[help(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[help(parser_add_paren)]
struct AP {
var: String
}
-#[derive(SessionSubdiagnostic)]
-#[note(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[note(parser_add_paren)]
struct AQ;
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code = "...")]
-//~^ ERROR suggestion without `applicability`
-//~^^ ERROR suggestion without `#[primary_span]` field
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code = "...")]
+//~^ ERROR suggestion without `#[primary_span]` field
struct AR {
var: String,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code ="...", applicability = "machine-applicable")]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code ="...", applicability = "machine-applicable")]
struct AS {
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
#[label]
//~^ ERROR unsupported type attribute for subdiagnostic enum
enum AT {
- #[label(parser::add_paren)]
+ #[label(parser_add_paren)]
A {
#[primary_span]
span: Span,
@@ -473,25 +470,25 @@ enum AT {
}
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
struct AU {
#[primary_span]
span: Span,
var: String,
}
-#[derive(SessionSubdiagnostic)]
-#[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
//~^ ERROR `var` doesn't refer to a field on this type
struct AV {
#[primary_span]
span: Span,
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum AW {
- #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+ #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
A {
#[primary_span]
span: Span,
@@ -499,9 +496,9 @@ enum AW {
}
}
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
enum AX {
- #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
+ #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
//~^ ERROR `var` doesn't refer to a field on this type
A {
#[primary_span]
@@ -509,14 +506,203 @@ enum AX {
}
}
-#[derive(SessionSubdiagnostic)]
-#[warn_(parser::add_paren)]
-struct AY {
-}
+#[derive(Subdiagnostic)]
+#[warning(parser_add_paren)]
+struct AY {}
-#[derive(SessionSubdiagnostic)]
-#[warn_(parser::add_paren)]
+#[derive(Subdiagnostic)]
+#[warning(parser_add_paren)]
struct AZ {
#[primary_span]
span: Span,
}
+
+#[derive(Subdiagnostic)]
+#[suggestion(parser_add_paren, code = "...")]
+//~^ ERROR suggestion without `#[primary_span]` field
+struct BA {
+ #[suggestion_part]
+ //~^ ERROR `#[suggestion_part]` is not a valid attribute
+ span: Span,
+ #[suggestion_part(code = "...")]
+ //~^ ERROR `#[suggestion_part(...)]` is not a valid attribute
+ span2: Span,
+ #[applicability]
+ applicability: Applicability,
+ var: String,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren, code = "...", applicability = "machine-applicable")]
+//~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
+//~| ERROR `#[multipart_suggestion(code = ...)]` is not a valid attribute
+struct BBa {
+ var: String,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
+struct BBb {
+ #[suggestion_part]
+ //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
+ span1: Span,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
+struct BBc {
+ #[suggestion_part()]
+ //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
+ span1: Span,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+//~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
+struct BC {
+ #[primary_span]
+ //~^ ERROR `#[primary_span]` is not a valid attribute
+ span: Span,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+struct BD {
+ #[suggestion_part]
+ //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
+ span1: Span,
+ #[suggestion_part()]
+ //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
+ span2: Span,
+ #[suggestion_part(foo = "bar")]
+ //~^ ERROR `#[suggestion_part(foo = ...)]` is not a valid attribute
+ span4: Span,
+ #[suggestion_part(code = "...")]
+ //~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
+ s1: String,
+ #[suggestion_part()]
+ //~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
+ s2: String,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
+struct BE {
+ #[suggestion_part(code = "...", code = ",,,")]
+ //~^ ERROR specified multiple times
+ //~| NOTE previously specified here
+ span: Span,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
+struct BF {
+ #[suggestion_part(code = "(")]
+ first: Span,
+ #[suggestion_part(code = ")")]
+ second: Span,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+struct BG {
+ #[applicability]
+ appl: Applicability,
+ #[suggestion_part(code = "(")]
+ first: Span,
+ #[suggestion_part(code = ")")]
+ second: Span,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
+struct BH {
+ #[applicability]
+ //~^ ERROR `#[applicability]` has no effect
+ appl: Applicability,
+ #[suggestion_part(code = "(")]
+ first: Span,
+ #[suggestion_part(code = ")")]
+ second: Span,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren, applicability = "machine-applicable")]
+struct BI {
+ #[suggestion_part(code = "")]
+ spans: Vec<Span>,
+}
+
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
+struct BJ {
+ #[primary_span]
+ span: Span,
+ r#type: String,
+}
+
+/// with a doc comment on the type..
+#[derive(Subdiagnostic)]
+#[label(parser_add_paren)]
+struct BK {
+ /// ..and the field
+ #[primary_span]
+ span: Span,
+}
+
+/// with a doc comment on the type..
+#[derive(Subdiagnostic)]
+enum BL {
+ /// ..and the variant..
+ #[label(parser_add_paren)]
+ Foo {
+ /// ..and the field
+ #[primary_span]
+ span: Span,
+ }
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+struct BM {
+ #[suggestion_part(code("foo"))]
+ //~^ ERROR expected exactly one string literal for `code = ...`
+ span: Span,
+ r#type: String,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+struct BN {
+ #[suggestion_part(code("foo", "bar"))]
+ //~^ ERROR expected exactly one string literal for `code = ...`
+ span: Span,
+ r#type: String,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+struct BO {
+ #[suggestion_part(code(3))]
+ //~^ ERROR expected exactly one string literal for `code = ...`
+ span: Span,
+ r#type: String,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+struct BP {
+ #[suggestion_part(code())]
+ //~^ ERROR expected exactly one string literal for `code = ...`
+ span: Span,
+ r#type: String,
+}
+
+#[derive(Subdiagnostic)]
+#[multipart_suggestion(parser_add_paren)]
+struct BQ {
+ #[suggestion_part(code = 3)]
+ //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
+ span: Span,
+ r#type: String,
+}
diff --git a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
index a289c4fff..a85a8711e 100644
--- a/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
+++ b/src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr
@@ -1,14 +1,14 @@
error: label without `#[primary_span]` field
--> $DIR/subdiagnostic-derive.rs:47:1
|
-LL | / #[label(parser::add_paren)]
+LL | / #[label(parser_add_paren)]
LL | |
LL | | struct C {
LL | | var: String,
LL | | }
| |_^
-error: `#[label]` is not a valid attribute
+error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:54:1
|
LL | #[label]
@@ -31,105 +31,119 @@ error: `#[label(bug = ...)]` is not a valid attribute
|
LL | #[label(bug = "...")]
| ^^^^^^^^^^^
+
+error: diagnostic slug must be first argument of a `#[label(...)]` attribute
+ --> $DIR/subdiagnostic-derive.rs:82:1
|
- = help: first argument of the attribute should be the diagnostic slug
+LL | #[label(bug = "...")]
+ | ^^^^^^^^^^^^^^^^^^^^^
error: `#[label("...")]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:91:9
+ --> $DIR/subdiagnostic-derive.rs:92:9
|
LL | #[label("...")]
| ^^^^^
+
+error: diagnostic slug must be first argument of a `#[label(...)]` attribute
+ --> $DIR/subdiagnostic-derive.rs:92:1
|
- = help: first argument of the attribute should be the diagnostic slug
+LL | #[label("...")]
+ | ^^^^^^^^^^^^^^^
error: `#[label(slug = ...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:100:9
+ --> $DIR/subdiagnostic-derive.rs:102:9
|
LL | #[label(slug = 4)]
| ^^^^^^^^
+
+error: diagnostic slug must be first argument of a `#[label(...)]` attribute
+ --> $DIR/subdiagnostic-derive.rs:102:1
|
- = help: first argument of the attribute should be the diagnostic slug
+LL | #[label(slug = 4)]
+ | ^^^^^^^^^^^^^^^^^^
error: `#[label(slug(...))]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:109:9
+ --> $DIR/subdiagnostic-derive.rs:112:9
|
LL | #[label(slug("..."))]
| ^^^^^^^^^^^
+
+error: diagnostic slug must be first argument of a `#[label(...)]` attribute
+ --> $DIR/subdiagnostic-derive.rs:112:1
|
- = help: first argument of the attribute should be the diagnostic slug
+LL | #[label(slug("..."))]
+ | ^^^^^^^^^^^^^^^^^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:128:1
+ --> $DIR/subdiagnostic-derive.rs:132:1
|
LL | #[label()]
| ^^^^^^^^^^
-error: `code` is not a valid nested attribute of a `label` attribute
- --> $DIR/subdiagnostic-derive.rs:137:1
+error: `#[label(code = ...)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:141:27
|
-LL | #[label(parser::add_paren, code = "...")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(parser_add_paren, code = "...")]
+ | ^^^^^^^^^^^^
-error: `applicability` is not a valid nested attribute of a `label` attribute
- --> $DIR/subdiagnostic-derive.rs:146:1
+error: `#[label(applicability = ...)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:150:27
|
-LL | #[label(parser::add_paren, applicability = "machine-applicable")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | #[label(parser_add_paren, applicability = "machine-applicable")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: unsupported type attribute for subdiagnostic enum
- --> $DIR/subdiagnostic-derive.rs:155:1
+ --> $DIR/subdiagnostic-derive.rs:159:1
|
LL | #[foo]
| ^^^^^^
error: `#[bar]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:169:5
+ --> $DIR/subdiagnostic-derive.rs:173:5
|
LL | #[bar]
| ^^^^^^
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:181:5
+ --> $DIR/subdiagnostic-derive.rs:185:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
error: `#[bar = ...]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:193:5
+ --> $DIR/subdiagnostic-derive.rs:197:5
|
LL | #[bar = 4]
| ^^^^^^^^^^
-error: `#[bar("...")]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:205:11
+error: `#[bar(...)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:209:5
|
LL | #[bar("...")]
- | ^^^^^
+ | ^^^^^^^^^^^^^
+
+error: `#[label(code = ...)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:221:13
|
- = help: first argument of the attribute should be the diagnostic slug
+LL | #[label(code = "...")]
+ | ^^^^^^^^^^^^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
- --> $DIR/subdiagnostic-derive.rs:217:5
+ --> $DIR/subdiagnostic-derive.rs:221:5
|
LL | #[label(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^
-error: subdiagnostic kind not specified
- --> $DIR/subdiagnostic-derive.rs:234:5
- |
-LL | B {
- | ^
-
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
- --> $DIR/subdiagnostic-derive.rs:246:5
+ --> $DIR/subdiagnostic-derive.rs:250:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
error: label without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:243:1
+ --> $DIR/subdiagnostic-derive.rs:247:1
|
-LL | / #[label(parser::add_paren)]
+LL | / #[label(parser_add_paren)]
LL | |
LL | | struct W {
LL | | #[primary_span]
@@ -139,13 +153,13 @@ LL | | }
| |_^
error: `#[applicability]` is only valid on suggestions
- --> $DIR/subdiagnostic-derive.rs:256:5
+ --> $DIR/subdiagnostic-derive.rs:260:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: `#[bar]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:266:5
+ --> $DIR/subdiagnostic-derive.rs:270:5
|
LL | #[bar]
| ^^^^^^
@@ -153,19 +167,21 @@ 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:277:5
+ --> $DIR/subdiagnostic-derive.rs:281:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
error: `#[bar(...)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:288:5
+ --> $DIR/subdiagnostic-derive.rs:292:5
|
LL | #[bar("...")]
| ^^^^^^^^^^^^^
+ |
+ = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
error: unexpected unsupported untagged union
- --> $DIR/subdiagnostic-derive.rs:304:1
+ --> $DIR/subdiagnostic-derive.rs:308:1
|
LL | / union AC {
LL | |
@@ -174,35 +190,11 @@ LL | | b: u64
LL | | }
| |_^
-error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:314:1
- |
-LL | #[label(parser::add_paren)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:311:1
- |
-LL | #[label(parser::add_paren)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:314:1
- |
-LL | #[label(parser::add_paren)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:311:1
- |
-LL | #[label(parser::add_paren)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: `#[label(parser::add_paren)]` is not a valid attribute
- --> $DIR/subdiagnostic-derive.rs:323:28
+error: `#[label(parser_add_paren)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:323:27
|
-LL | #[label(parser::add_paren, parser::add_paren)]
- | ^^^^^^^^^^^^^^^^^
+LL | #[label(parser_add_paren, parser_add_paren)]
+ | ^^^^^^^^^^^^^^^^
|
= help: a diagnostic slug must be the first argument to the attribute
@@ -225,16 +217,16 @@ LL | struct AG {
| ^^
error: specified multiple times
- --> $DIR/subdiagnostic-derive.rs:379:47
+ --> $DIR/subdiagnostic-derive.rs:379:46
|
-LL | #[suggestion(parser::add_paren, code = "...", code = "...")]
- | ^^^^^^^^^^^^
+LL | #[suggestion(parser_add_paren, code = "...", code = "...")]
+ | ^^^^^^^^^^^^
|
note: previously specified here
- --> $DIR/subdiagnostic-derive.rs:379:33
+ --> $DIR/subdiagnostic-derive.rs:379:32
|
-LL | #[suggestion(parser::add_paren, code = "...", code = "...")]
- | ^^^^^^^^^^^^
+LL | #[suggestion(parser_add_paren, code = "...", code = "...")]
+ | ^^^^^^^^^^^^
error: specified multiple times
--> $DIR/subdiagnostic-derive.rs:397:5
@@ -249,91 +241,209 @@ LL | #[applicability]
| ^^^^^^^^^^^^^^^^
error: the `#[applicability]` attribute can only be applied to fields of type `Applicability`
- --> $DIR/subdiagnostic-derive.rs:408:5
+ --> $DIR/subdiagnostic-derive.rs:407:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
-error: suggestion without `applicability`
- --> $DIR/subdiagnostic-derive.rs:403:1
+error: suggestion without `code = "..."`
+ --> $DIR/subdiagnostic-derive.rs:420:1
|
-LL | / #[suggestion(parser::add_paren, code = "...")]
-LL | |
-LL | | struct AL {
-LL | | #[primary_span]
-... |
-LL | | applicability: Span,
-LL | | }
- | |_^
+LL | #[suggestion(parser_add_paren)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: suggestion without `applicability`
- --> $DIR/subdiagnostic-derive.rs:414:1
+error: invalid applicability
+ --> $DIR/subdiagnostic-derive.rs:430:45
+ |
+LL | #[suggestion(parser_add_paren, code ="...", applicability = "foo")]
+ | ^^^^^^^^^^^^^^^^^^^^^
+
+error: suggestion without `#[primary_span]` field
+ --> $DIR/subdiagnostic-derive.rs:448:1
|
-LL | / #[suggestion(parser::add_paren, code = "...")]
+LL | / #[suggestion(parser_add_paren, code = "...")]
LL | |
-LL | | struct AM {
-LL | | #[primary_span]
-LL | | span: Span,
+LL | | struct AR {
+LL | | var: String,
LL | | }
| |_^
-error: suggestion without `code = "..."`
- --> $DIR/subdiagnostic-derive.rs:422:1
+error: unsupported type attribute for subdiagnostic enum
+ --> $DIR/subdiagnostic-derive.rs:462:1
+ |
+LL | #[label]
+ | ^^^^^^^^
+
+error: `var` doesn't refer to a field on this type
+ --> $DIR/subdiagnostic-derive.rs:482:38
+ |
+LL | #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
+ | ^^^^^^^
+
+error: `var` doesn't refer to a field on this type
+ --> $DIR/subdiagnostic-derive.rs:501:42
|
-LL | / #[suggestion(parser::add_paren)]
+LL | #[suggestion(parser_add_paren, code ="{var}", applicability = "machine-applicable")]
+ | ^^^^^^^
+
+error: `#[suggestion_part]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:524:5
+ |
+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:527:5
+ |
+LL | #[suggestion_part(code = "...")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = help: `#[suggestion_part(...)]` is only valid in multipart suggestions
+
+error: suggestion without `#[primary_span]` field
+ --> $DIR/subdiagnostic-derive.rs:521:1
+ |
+LL | / #[suggestion(parser_add_paren, code = "...")]
LL | |
-LL | | struct AN {
-LL | | #[primary_span]
+LL | | struct BA {
+LL | | #[suggestion_part]
... |
-LL | | applicability: Applicability,
+LL | | var: String,
LL | | }
| |_^
-error: invalid applicability
- --> $DIR/subdiagnostic-derive.rs:432:46
+error: `#[multipart_suggestion(code = ...)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:536:42
|
-LL | #[suggestion(parser::add_paren, code ="...", applicability = "foo")]
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | #[multipart_suggestion(parser_add_paren, code = "...", applicability = "machine-applicable")]
+ | ^^^^^^^^^^^^
+ |
+ = help: only `applicability` is a valid nested attributes
-error: suggestion without `applicability`
- --> $DIR/subdiagnostic-derive.rs:450:1
+error: multipart suggestion without any `#[suggestion_part(...)]` fields
+ --> $DIR/subdiagnostic-derive.rs:536:1
|
-LL | / #[suggestion(parser::add_paren, code = "...")]
+LL | / #[multipart_suggestion(parser_add_paren, code = "...", applicability = "machine-applicable")]
LL | |
LL | |
-LL | | struct AR {
+LL | | struct BBa {
LL | | var: String,
LL | | }
| |_^
-error: suggestion without `#[primary_span]` field
- --> $DIR/subdiagnostic-derive.rs:450:1
+error: `#[suggestion_part(...)]` attribute without `code = "..."`
+ --> $DIR/subdiagnostic-derive.rs:546:5
|
-LL | / #[suggestion(parser::add_paren, code = "...")]
+LL | #[suggestion_part]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: `#[suggestion_part(...)]` attribute without `code = "..."`
+ --> $DIR/subdiagnostic-derive.rs:554:5
+ |
+LL | #[suggestion_part()]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: `#[primary_span]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:563:5
+ |
+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:560:1
+ |
+LL | / #[multipart_suggestion(parser_add_paren)]
LL | |
+LL | | struct BC {
+LL | | #[primary_span]
LL | |
-LL | | struct AR {
-LL | | var: String,
+LL | | span: Span,
LL | | }
| |_^
-error: unsupported type attribute for subdiagnostic enum
- --> $DIR/subdiagnostic-derive.rs:465:1
+error: `#[suggestion_part(...)]` attribute without `code = "..."`
+ --> $DIR/subdiagnostic-derive.rs:571:5
|
-LL | #[label]
- | ^^^^^^^^
+LL | #[suggestion_part]
+ | ^^^^^^^^^^^^^^^^^^
-error: `var` doesn't refer to a field on this type
- --> $DIR/subdiagnostic-derive.rs:485:39
+error: `#[suggestion_part(...)]` attribute without `code = "..."`
+ --> $DIR/subdiagnostic-derive.rs:574:5
|
-LL | #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
- | ^^^^^^^
+LL | #[suggestion_part()]
+ | ^^^^^^^^^^^^^^^^^^^^
-error: `var` doesn't refer to a field on this type
- --> $DIR/subdiagnostic-derive.rs:504:43
+error: `#[suggestion_part(foo = ...)]` is not a valid attribute
+ --> $DIR/subdiagnostic-derive.rs:577: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:580:5
+ |
+LL | #[suggestion_part(code = "...")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
+ --> $DIR/subdiagnostic-derive.rs:583:5
+ |
+LL | #[suggestion_part()]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: specified multiple times
+ --> $DIR/subdiagnostic-derive.rs:591:37
+ |
+LL | #[suggestion_part(code = "...", code = ",,,")]
+ | ^^^^^^^^^^^^
+ |
+note: previously specified here
+ --> $DIR/subdiagnostic-derive.rs:591: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:620:5
+ |
+LL | #[applicability]
+ | ^^^^^^^^^^^^^^^^
+
+error: expected exactly one string literal for `code = ...`
+ --> $DIR/subdiagnostic-derive.rs:668:23
+ |
+LL | #[suggestion_part(code("foo"))]
+ | ^^^^^^^^^^^
+
+error: expected exactly one string literal for `code = ...`
+ --> $DIR/subdiagnostic-derive.rs:677:23
+ |
+LL | #[suggestion_part(code("foo", "bar"))]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: expected exactly one string literal for `code = ...`
+ --> $DIR/subdiagnostic-derive.rs:686:23
+ |
+LL | #[suggestion_part(code(3))]
+ | ^^^^^^^
+
+error: expected exactly one string literal for `code = ...`
+ --> $DIR/subdiagnostic-derive.rs:695:23
+ |
+LL | #[suggestion_part(code())]
+ | ^^^^^^
+
+error: `code = "..."`/`code(...)` must contain only string literals
+ --> $DIR/subdiagnostic-derive.rs:704:23
|
-LL | #[suggestion(parser::add_paren, code ="{var}", applicability = "machine-applicable")]
- | ^^^^^^^
+LL | #[suggestion_part(code = 3)]
+ | ^^^^^^^^
error: cannot find attribute `foo` in this scope
--> $DIR/subdiagnostic-derive.rs:63:3
@@ -342,59 +452,59 @@ LL | #[foo]
| ^^^
error: cannot find attribute `foo` in this scope
- --> $DIR/subdiagnostic-derive.rs:155:3
+ --> $DIR/subdiagnostic-derive.rs:159:3
|
LL | #[foo]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:169:7
+ --> $DIR/subdiagnostic-derive.rs:173:7
|
LL | #[bar]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:181:7
+ --> $DIR/subdiagnostic-derive.rs:185:7
|
LL | #[bar = "..."]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:193:7
+ --> $DIR/subdiagnostic-derive.rs:197:7
|
LL | #[bar = 4]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:205:7
+ --> $DIR/subdiagnostic-derive.rs:209:7
|
LL | #[bar("...")]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:266:7
+ --> $DIR/subdiagnostic-derive.rs:270:7
|
LL | #[bar]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:277:7
+ --> $DIR/subdiagnostic-derive.rs:281:7
|
LL | #[bar = "..."]
| ^^^
error: cannot find attribute `bar` in this scope
- --> $DIR/subdiagnostic-derive.rs:288:7
+ --> $DIR/subdiagnostic-derive.rs:292:7
|
LL | #[bar("...")]
| ^^^
error[E0425]: cannot find value `slug` in module `rustc_errors::fluent`
- --> $DIR/subdiagnostic-derive.rs:118:9
+ --> $DIR/subdiagnostic-derive.rs:122:9
|
LL | #[label(slug)]
| ^^^^ not found in `rustc_errors::fluent`
-error: aborting due to 52 previous errors
+error: aborting due to 72 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/abi/abi-sysv64-register-usage.rs b/src/test/ui/abi/abi-sysv64-register-usage.rs
index 9404e71d0..393306936 100644
--- a/src/test/ui/abi/abi-sysv64-register-usage.rs
+++ b/src/test/ui/abi/abi-sysv64-register-usage.rs
@@ -6,20 +6,30 @@
// ignore-arm
// ignore-aarch64
// needs-asm-support
-#![feature(asm_sym)]
#[cfg(target_arch = "x86_64")]
-pub extern "sysv64" fn all_the_registers(rdi: i64, rsi: i64, rdx: i64,
- rcx: i64, r8 : i64, r9 : i64,
- xmm0: f32, xmm1: f32, xmm2: f32,
- xmm3: f32, xmm4: f32, xmm5: f32,
- xmm6: f32, xmm7: f32) -> i64 {
+pub extern "sysv64" fn all_the_registers(
+ rdi: i64,
+ rsi: i64,
+ rdx: i64,
+ rcx: i64,
+ r8: i64,
+ r9: i64,
+ xmm0: f32,
+ xmm1: f32,
+ xmm2: f32,
+ xmm3: f32,
+ xmm4: f32,
+ xmm5: f32,
+ xmm6: f32,
+ xmm7: f32,
+) -> i64 {
assert_eq!(rdi, 1);
assert_eq!(rsi, 2);
assert_eq!(rdx, 3);
assert_eq!(rcx, 4);
- assert_eq!(r8, 5);
- assert_eq!(r9, 6);
+ assert_eq!(r8, 5);
+ assert_eq!(r9, 6);
assert_eq!(xmm0, 1.0f32);
assert_eq!(xmm1, 2.0f32);
assert_eq!(xmm2, 4.0f32);
diff --git a/src/test/ui/abi/abi-typo-unstable.rs b/src/test/ui/abi/abi-typo-unstable.rs
new file mode 100644
index 000000000..94991a5eb
--- /dev/null
+++ b/src/test/ui/abi/abi-typo-unstable.rs
@@ -0,0 +1,6 @@
+// rust-intrinsic is unstable and not enabled, so it should not be suggested as a fix
+extern "rust-intrinsec" fn rust_intrinsic() {} //~ ERROR invalid ABI
+
+fn main() {
+ rust_intrinsic();
+}
diff --git a/src/test/ui/abi/abi-typo-unstable.stderr b/src/test/ui/abi/abi-typo-unstable.stderr
new file mode 100644
index 000000000..3b346e002
--- /dev/null
+++ b/src/test/ui/abi/abi-typo-unstable.stderr
@@ -0,0 +1,11 @@
+error[E0703]: invalid ABI: found `rust-intrinsec`
+ --> $DIR/abi-typo-unstable.rs:2:8
+ |
+LL | extern "rust-intrinsec" fn rust_intrinsic() {}
+ | ^^^^^^^^^^^^^^^^ invalid ABI
+ |
+ = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions.
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0703`.
diff --git a/src/test/ui/abi/issues/issue-97463-broken-abi-leaked-uninit-data.rs b/src/test/ui/abi/issues/issue-97463-broken-abi-leaked-uninit-data.rs
new file mode 100644
index 000000000..fba880d4f
--- /dev/null
+++ b/src/test/ui/abi/issues/issue-97463-broken-abi-leaked-uninit-data.rs
@@ -0,0 +1,39 @@
+// run-pass
+// ignore-wasm
+#![allow(dead_code)]
+#![allow(improper_ctypes)]
+
+#[link(name = "rust_test_helpers", kind = "static")]
+extern "C" {
+ pub fn issue_97463_leak_uninit_data(a: u32, b: u32, c: u32) -> u16;
+}
+
+fn main() {
+ const C1: usize = 0x327b23c6;
+ const C2: usize = C1 & 0xFFFF;
+
+ let r1: usize = 0x0;
+ let r2: usize = C1;
+ let r3: usize = 0x0;
+ let value: u16 = unsafe { issue_97463_leak_uninit_data(r1 as u32, r2 as u32, r3 as u32) };
+
+ // NOTE: as an example of the sensitivity of this test to optimization choices,
+ // uncommenting this block of code makes the bug go away on pnkfelix's machine.
+ // (But observing via `dbg!` doesn't hide the bug. At least sometimes.)
+ /*
+ println!("{}", value);
+ println!("{}", value as usize);
+ println!("{}", usize::from(value));
+ println!("{}", (value as usize) & 0xFFFF);
+ */
+
+ let d1 = value;
+ let d2 = value as usize;
+ let d3 = usize::from(value);
+ let d4 = (value as usize) & 0xFFFF;
+
+ let d = (&d1, &d2, &d3, &d4);
+ let d_ = (d1, d2, d3, d4);
+
+ assert_eq!(((&(C2 as u16), &C2, &C2, &C2), (C2 as u16, C2, C2, C2)), (d, d_));
+}
diff --git a/src/test/ui/abi/segfault-no-out-of-stack.rs b/src/test/ui/abi/segfault-no-out-of-stack.rs
index ad4faf95a..ab2b30894 100644
--- a/src/test/ui/abi/segfault-no-out-of-stack.rs
+++ b/src/test/ui/abi/segfault-no-out-of-stack.rs
@@ -3,6 +3,7 @@
#![allow(unused_imports)]
// ignore-emscripten can't run commands
// ignore-sgx no processes
+// ignore-fuchsia must translate zircon signal to SIGSEGV/SIGBUS, FIXME (#58590)
#![feature(rustc_private)]
extern crate libc;
diff --git a/src/test/ui/abi/stack-probes-lto.rs b/src/test/ui/abi/stack-probes-lto.rs
index 90df1f3f5..6d934538f 100644
--- a/src/test/ui/abi/stack-probes-lto.rs
+++ b/src/test/ui/abi/stack-probes-lto.rs
@@ -3,8 +3,6 @@
// ignore-aarch64
// ignore-mips
// ignore-mips64
-// ignore-powerpc
-// ignore-s390x
// ignore-sparc
// ignore-sparc64
// ignore-wasm
@@ -12,6 +10,7 @@
// 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/src/test/ui/abi/stack-probes.rs b/src/test/ui/abi/stack-probes.rs
index e998dd0f8..e7b91644b 100644
--- a/src/test/ui/abi/stack-probes.rs
+++ b/src/test/ui/abi/stack-probes.rs
@@ -3,13 +3,12 @@
// ignore-aarch64
// ignore-mips
// ignore-mips64
-// ignore-powerpc
-// ignore-s390x
// ignore-sparc
// ignore-sparc64
// ignore-wasm
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia no exception handler registered for segfault
use std::env;
use std::mem::MaybeUninit;
@@ -26,8 +25,9 @@ fn main() {
let args = env::args().skip(1).collect::<Vec<_>>();
if args.len() > 0 {
match &args[0][..] {
- "main-thread" => recurse(&MaybeUninit::uninit()),
- "child-thread" => thread::spawn(|| recurse(&MaybeUninit::uninit())).join().unwrap(),
+ "main-recurse" => overflow_recurse(),
+ "child-recurse" => thread::spawn(overflow_recurse).join().unwrap(),
+ "child-frame" => overflow_frame(),
_ => panic!(),
}
return;
@@ -40,9 +40,10 @@ fn main() {
// that we report stack overflow on the main thread, see #43052 for some
// details
if cfg!(not(target_os = "linux")) {
- assert_overflow(Command::new(&me).arg("main-thread"));
+ assert_overflow(Command::new(&me).arg("main-recurse"));
}
- assert_overflow(Command::new(&me).arg("child-thread"));
+ assert_overflow(Command::new(&me).arg("child-recurse"));
+ assert_overflow(Command::new(&me).arg("child-frame"));
}
#[allow(unconditional_recursion)]
@@ -54,6 +55,23 @@ fn recurse(array: &MaybeUninit<[u64; 1024]>) {
recurse(&local);
}
+#[inline(never)]
+fn overflow_recurse() {
+ recurse(&MaybeUninit::uninit());
+}
+
+fn overflow_frame() {
+ // By using a 1MiB stack frame with only 512KiB stack, we'll jump over any
+ // guard page, even with 64K pages -- but stack probes should catch it.
+ const STACK_SIZE: usize = 512 * 1024;
+ thread::Builder::new().stack_size(STACK_SIZE).spawn(|| {
+ let local: MaybeUninit<[u8; 2 * STACK_SIZE]> = MaybeUninit::uninit();
+ unsafe {
+ black_box(local.as_ptr() as u64);
+ }
+ }).unwrap().join().unwrap();
+}
+
fn assert_overflow(cmd: &mut Command) {
let output = cmd.output().unwrap();
assert!(!output.status.success());
diff --git a/src/test/ui/abi/unsupported.aarch64.stderr b/src/test/ui/abi/unsupported.aarch64.stderr
index a948947db..e86a73ea6 100644
--- a/src/test/ui/abi/unsupported.aarch64.stderr
+++ b/src/test/ui/abi/unsupported.aarch64.stderr
@@ -52,9 +52,9 @@ warning: use of calling convention not supported on this target
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unsupported_calling_conventions)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
+ = note: `#[warn(unsupported_calling_conventions)]` on by default
error: aborting due to 8 previous errors; 1 warning emitted
diff --git a/src/test/ui/abi/unsupported.arm.stderr b/src/test/ui/abi/unsupported.arm.stderr
index 297354c28..f7569c8cd 100644
--- a/src/test/ui/abi/unsupported.arm.stderr
+++ b/src/test/ui/abi/unsupported.arm.stderr
@@ -46,9 +46,9 @@ warning: use of calling convention not supported on this target
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unsupported_calling_conventions)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
+ = note: `#[warn(unsupported_calling_conventions)]` on by default
error: aborting due to 7 previous errors; 1 warning emitted
diff --git a/src/test/ui/abi/unsupported.x64.stderr b/src/test/ui/abi/unsupported.x64.stderr
index 49b88cd3f..26023a458 100644
--- a/src/test/ui/abi/unsupported.x64.stderr
+++ b/src/test/ui/abi/unsupported.x64.stderr
@@ -46,9 +46,9 @@ warning: use of calling convention not supported on this target
LL | extern "stdcall" fn stdcall() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unsupported_calling_conventions)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #87678 <https://github.com/rust-lang/rust/issues/87678>
+ = note: `#[warn(unsupported_calling_conventions)]` on by default
error: aborting due to 7 previous errors; 1 warning emitted
diff --git a/src/test/ui/abi/x86stdcall.rs b/src/test/ui/abi/x86stdcall.rs
index 868923e59..d1cf1319f 100644
--- a/src/test/ui/abi/x86stdcall.rs
+++ b/src/test/ui/abi/x86stdcall.rs
@@ -1,17 +1,15 @@
// run-pass
-// ignore-wasm32-bare no libc to test ffi with
-// ignore-sgx no libc
+// only-windows
// GetLastError doesn't seem to work with stack switching
#[cfg(windows)]
mod kernel32 {
- extern "system" {
- pub fn SetLastError(err: usize);
- pub fn GetLastError() -> usize;
- }
+ extern "system" {
+ pub fn SetLastError(err: usize);
+ pub fn GetLastError() -> usize;
+ }
}
-
#[cfg(windows)]
pub fn main() {
unsafe {
@@ -22,17 +20,3 @@ pub fn main() {
assert_eq!(expected, actual);
}
}
-
-#[cfg(any(target_os = "android",
- target_os = "dragonfly",
- target_os = "emscripten",
- target_os = "freebsd",
- target_os = "fuchsia",
- target_os = "illumos",
- target_os = "linux",
- target_os = "macos",
- target_os = "netbsd",
- target_os = "openbsd",
- target_os = "solaris",
- target_os = "vxworks"))]
-pub fn main() { }
diff --git a/src/test/ui/abi/x86stdcall2.rs b/src/test/ui/abi/x86stdcall2.rs
index 563e3aba6..4d508ecb2 100644
--- a/src/test/ui/abi/x86stdcall2.rs
+++ b/src/test/ui/abi/x86stdcall2.rs
@@ -1,4 +1,5 @@
// run-pass
+// only-windows
#![allow(non_camel_case_types)]
pub type HANDLE = usize;
@@ -7,20 +8,16 @@ pub type SIZE_T = u32;
pub type LPVOID = usize;
pub type BOOL = u8;
-#[cfg(windows)]
mod kernel32 {
- use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL};
+ use super::{BOOL, DWORD, HANDLE, LPVOID, SIZE_T};
extern "system" {
pub fn GetProcessHeap() -> HANDLE;
- pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T)
- -> LPVOID;
+ pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID;
pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL;
}
}
-
-#[cfg(windows)]
pub fn main() {
let heap = unsafe { kernel32::GetProcessHeap() };
let mem = unsafe { kernel32::HeapAlloc(heap, 0, 100) };
@@ -28,6 +25,3 @@ pub fn main() {
let res = unsafe { kernel32::HeapFree(heap, 0, mem) };
assert!(res != 0);
}
-
-#[cfg(not(windows))]
-pub fn main() { }
diff --git a/src/test/ui/alloc-error/default-alloc-error-hook.rs b/src/test/ui/alloc-error/default-alloc-error-hook.rs
index 100e97497..8be09500f 100644
--- a/src/test/ui/alloc-error/default-alloc-error-hook.rs
+++ b/src/test/ui/alloc-error/default-alloc-error-hook.rs
@@ -15,5 +15,14 @@ fn main() {
let me = env::current_exe().unwrap();
let output = Command::new(&me).arg("next").output().unwrap();
assert!(!output.status.success(), "{:?} is a success", output.status);
- assert_eq!(str::from_utf8(&output.stderr).unwrap(), "memory allocation of 42 bytes failed\n");
+
+ let mut stderr = str::from_utf8(&output.stderr).unwrap();
+
+ // When running inside QEMU user-mode emulation, there will be an extra message printed by QEMU
+ // in the stderr whenever a core dump happens. Remove it before the check.
+ stderr = stderr
+ .strip_suffix("qemu: uncaught target signal 6 (Aborted) - core dumped\n")
+ .unwrap_or(stderr);
+
+ assert_eq!(stderr, "memory allocation of 42 bytes failed\n");
}
diff --git a/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs b/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs
index 54b7c8bb9..851da231a 100644
--- a/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs
+++ b/src/test/ui/allocator/no_std-alloc-error-handler-custom.rs
@@ -86,7 +86,7 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
// Because we are compiling this code with `-C panic=abort`, this wouldn't normally be needed.
// However, `core` and `alloc` are both compiled with `-C panic=unwind`, which means that functions
-// in these libaries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
+// in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
// unwind. So, for this test case we will define the symbol.
#[lang = "eh_personality"]
extern fn rust_eh_personality() {}
diff --git a/src/test/ui/allocator/no_std-alloc-error-handler-default.rs b/src/test/ui/allocator/no_std-alloc-error-handler-default.rs
index ffa331a99..30ce0f162 100644
--- a/src/test/ui/allocator/no_std-alloc-error-handler-default.rs
+++ b/src/test/ui/allocator/no_std-alloc-error-handler-default.rs
@@ -73,7 +73,7 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! {
// Because we are compiling this code with `-C panic=abort`, this wouldn't normally be needed.
// However, `core` and `alloc` are both compiled with `-C panic=unwind`, which means that functions
-// in these libaries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
+// in these libraries will refer to `rust_eh_personality` if LLVM can not *prove* the contents won't
// unwind. So, for this test case we will define the symbol.
#[lang = "eh_personality"]
extern fn rust_eh_personality() {}
diff --git a/src/test/ui/anon-params/anon-params-deprecated.stderr b/src/test/ui/anon-params/anon-params-deprecated.stderr
index 474b14f59..691e2c795 100644
--- a/src/test/ui/anon-params/anon-params-deprecated.stderr
+++ b/src/test/ui/anon-params/anon-params-deprecated.stderr
@@ -4,13 +4,13 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
LL | fn foo(i32);
| ^^^ help: try naming the parameter or explicitly ignoring it: `_: i32`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
note: the lint level is defined here
--> $DIR/anon-params-deprecated.rs:1:9
|
LL | #![warn(anonymous_parameters)]
| ^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
warning: anonymous parameters are deprecated and will be removed in the next edition
--> $DIR/anon-params-deprecated.rs:12:30
diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
index 1a0a5fdf4..bf5f642ca 100644
--- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr
+++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr
@@ -6,7 +6,7 @@ LL | f1(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'r, 's> fn(&'r (), &'s ()) -> _`
+ = note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f1`
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:25
@@ -22,7 +22,7 @@ LL | f2(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'a, 'r> fn(&'a (), &'r ()) -> _`
+ = note: expected closure signature `for<'a, 'b> fn(&'a (), &'b ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f2`
--> $DIR/anonymous-higher-ranked-lifetime.rs:17:25
@@ -38,7 +38,7 @@ LL | f3(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'r> fn(&(), &'r ()) -> _`
+ = note: expected closure signature `for<'a> fn(&(), &'a ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f3`
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:29
@@ -54,7 +54,7 @@ LL | f4(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'r, 's> fn(&'s (), &'r ()) -> _`
+ = note: expected closure signature `for<'r, 'a> fn(&'a (), &'r ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f4`
--> $DIR/anonymous-higher-ranked-lifetime.rs:19:25
@@ -86,7 +86,7 @@ LL | g1(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'r> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _`
+ = note: expected closure signature `for<'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g1`
--> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
@@ -102,7 +102,7 @@ LL | g2(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'r> fn(&'r (), for<'r> fn(&'r ())) -> _`
+ = note: expected closure signature `for<'a> fn(&'a (), for<'a> fn(&'a ())) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g2`
--> $DIR/anonymous-higher-ranked-lifetime.rs:24:25
@@ -118,7 +118,7 @@ LL | g3(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _`
+ = note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g3`
--> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
@@ -134,7 +134,7 @@ LL | g4(|_: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
+ = note: expected closure signature `for<'a> fn(&'a (), for<'r> fn(&'r ())) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g4`
--> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
@@ -150,7 +150,7 @@ LL | h1(|_: (), _: (), _: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'r, 's> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>, &'s (), for<'r, 's> fn(&'r (), &'s ())) -> _`
+ = note: expected closure signature `for<'a, 'b> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'b (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
found closure signature `fn((), (), (), ()) -> _`
note: required by a bound in `h1`
--> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
@@ -166,7 +166,7 @@ LL | h2(|_: (), _: (), _: (), _: ()| {});
| |
| expected due to this
|
- = note: expected closure signature `for<'t0, 'r> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>, &'t0 (), for<'r, 's> fn(&'r (), &'s ())) -> _`
+ = note: expected closure signature `for<'t0, 'a> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _`
found closure signature `fn((), (), (), ()) -> _`
note: required by a bound in `h2`
--> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
diff --git a/src/test/ui/argument-suggestions/basic.stderr b/src/test/ui/argument-suggestions/basic.stderr
index c495ad6b8..b118ce1bd 100644
--- a/src/test/ui/argument-suggestions/basic.stderr
+++ b/src/test/ui/argument-suggestions/basic.stderr
@@ -26,7 +26,7 @@ LL | fn extra() {}
help: remove the extra argument
|
LL | extra();
- | ~~~~~~~
+ | ~~
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/basic.rs:22:5
@@ -42,7 +42,7 @@ LL | fn missing(_i: u32) {}
help: provide the argument
|
LL | missing(/* u32 */);
- | ~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/basic.rs:23:5
@@ -60,7 +60,7 @@ LL | fn swapped(_i: u32, _s: &str) {}
help: swap these arguments
|
LL | swapped(1, "");
- | ~~~~~~~~~~~~~~
+ | ~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/basic.rs:24:5
@@ -79,7 +79,7 @@ LL | fn permuted(_x: X, _y: Y, _z: Z) {}
help: reorder these arguments
|
LL | permuted(X {}, Y {}, Z {});
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error[E0057]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/basic.rs:27:5
@@ -95,7 +95,7 @@ LL | let closure = |x| x;
help: provide the argument
|
LL | closure(/* value */);
- | ~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/argument-suggestions/complex.stderr b/src/test/ui/argument-suggestions/complex.stderr
index fa030a8f4..205a85298 100644
--- a/src/test/ui/argument-suggestions/complex.stderr
+++ b/src/test/ui/argument-suggestions/complex.stderr
@@ -8,11 +8,11 @@ note: function defined here
--> $DIR/complex.rs:11:4
|
LL | fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {}
- | ^^^^^^^ ------- -------- ----- ----- ----- ----- ----- ------
+ | ^^^^^^^ ------- -------- ----- ----- ----- ----- ----- -----
help: did you mean
|
LL | complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {});
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/argument-suggestions/exotic-calls.stderr b/src/test/ui/argument-suggestions/exotic-calls.stderr
index ca93ecc4e..0580e53c5 100644
--- a/src/test/ui/argument-suggestions/exotic-calls.stderr
+++ b/src/test/ui/argument-suggestions/exotic-calls.stderr
@@ -12,7 +12,7 @@ LL | fn foo<T: Fn()>(t: T) {
help: remove the extra argument
|
LL | t();
- | ~~~
+ | ~~
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:7:5
@@ -28,7 +28,7 @@ LL | fn bar(t: impl Fn()) {
help: remove the extra argument
|
LL | t();
- | ~~~
+ | ~~
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:16:5
@@ -44,7 +44,7 @@ LL | fn baz() -> impl Fn() {
help: remove the extra argument
|
LL | baz()()
- |
+ | ~~
error[E0057]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/exotic-calls.rs:22:5
@@ -60,7 +60,7 @@ LL | let x = || {};
help: remove the extra argument
|
LL | x();
- | ~~~
+ | ~~
error: aborting due to 4 previous errors
diff --git a/src/test/ui/argument-suggestions/extra_arguments.stderr b/src/test/ui/argument-suggestions/extra_arguments.stderr
index 32b1e1573..48787b0c3 100644
--- a/src/test/ui/argument-suggestions/extra_arguments.stderr
+++ b/src/test/ui/argument-suggestions/extra_arguments.stderr
@@ -12,7 +12,7 @@ LL | fn empty() {}
help: remove the extra argument
|
LL | empty();
- | ~~~~~~~
+ | ~~
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:9:3
@@ -28,7 +28,7 @@ LL | fn one_arg(_a: i32) {}
help: remove the extra argument
|
LL | one_arg(1);
- | ~~~~~~~~~~
+ | ~~~
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:10:3
@@ -44,7 +44,7 @@ LL | fn one_arg(_a: i32) {}
help: remove the extra argument
|
LL | one_arg(1);
- | ~~~~~~~~~~
+ | ~~~
error[E0061]: this function takes 1 argument but 3 arguments were supplied
--> $DIR/extra_arguments.rs:11:3
@@ -62,7 +62,7 @@ LL | fn one_arg(_a: i32) {}
help: remove the extra arguments
|
LL | one_arg(1);
- | ~~~~~~~~~~
+ | ~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:13:3
@@ -78,7 +78,7 @@ LL | fn two_arg_same(_a: i32, _b: i32) {}
help: remove the extra argument
|
LL | two_arg_same(1, 1);
- | ~~~~~~~~~~~~~~~~~~
+ | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:14:3
@@ -94,7 +94,7 @@ LL | fn two_arg_same(_a: i32, _b: i32) {}
help: remove the extra argument
|
LL | two_arg_same(1, 1);
- | ~~~~~~~~~~~~~~~~~~
+ | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:16:3
@@ -110,7 +110,7 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
help: remove the extra argument
|
LL | two_arg_diff(1, "");
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:17:3
@@ -126,7 +126,7 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
help: remove the extra argument
|
LL | two_arg_diff(1, "");
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
--> $DIR/extra_arguments.rs:18:3
@@ -144,7 +144,7 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
help: remove the extra arguments
|
LL | two_arg_diff(1, "");
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~
error[E0061]: this function takes 2 arguments but 4 arguments were supplied
--> $DIR/extra_arguments.rs:19:3
@@ -162,7 +162,7 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
help: remove the extra arguments
|
LL | two_arg_diff(1, "");
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:22:3
@@ -178,7 +178,7 @@ LL | fn two_arg_same(_a: i32, _b: i32) {}
help: remove the extra argument
|
LL | two_arg_same(1, 1);
- | ~~~~~~~~~~~~~~~~~~
+ | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:23:3
@@ -194,7 +194,7 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
help: remove the extra argument
|
LL | two_arg_diff(1, "");
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:24:3
@@ -213,7 +213,7 @@ LL | fn two_arg_same(_a: i32, _b: i32) {}
help: remove the extra argument
|
LL | two_arg_same(1, 1);
- | ~~~~~~~~~~~~~~~~~~
+ | ~~~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:30:3
@@ -232,7 +232,7 @@ LL | fn two_arg_diff(_a: i32, _b: &str) {}
help: remove the extra argument
|
LL | two_arg_diff(1, "");
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~
error: aborting due to 14 previous errors
diff --git a/src/test/ui/argument-suggestions/invalid_arguments.stderr b/src/test/ui/argument-suggestions/invalid_arguments.stderr
index 33f27d48f..303f08695 100644
--- a/src/test/ui/argument-suggestions/invalid_arguments.stderr
+++ b/src/test/ui/argument-suggestions/invalid_arguments.stderr
@@ -24,7 +24,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:6:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
- | ^^^^^^^^^^^^ ------- -------
+ | ^^^^^^^^^^^^ -------
error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:17:16
@@ -38,7 +38,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:6:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
- | ^^^^^^^^^^^^ ------- -------
+ | ^^^^^^^^^^^^ -------
error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:18:3
@@ -66,7 +66,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:7:4
|
LL | fn two_arg_diff(_a: i32, _b: f32) {}
- | ^^^^^^^^^^^^ ------- -------
+ | ^^^^^^^^^^^^ -------
error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:20:16
@@ -80,7 +80,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:7:4
|
LL | fn two_arg_diff(_a: i32, _b: f32) {}
- | ^^^^^^^^^^^^ ------- -------
+ | ^^^^^^^^^^^^ -------
error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:21:3
@@ -108,7 +108,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:8:4
|
LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
- | ^^^^^^^^^^^^^^ ------- ------- --------
+ | ^^^^^^^^^^^^^^ -------
error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:25:21
@@ -122,7 +122,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:8:4
|
LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
- | ^^^^^^^^^^^^^^ ------- ------- --------
+ | ^^^^^^^^^^^^^^ -------
error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:26:26
@@ -136,7 +136,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:8:4
|
LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
- | ^^^^^^^^^^^^^^ ------- ------- --------
+ | ^^^^^^^^^^^^^^ --------
error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:28:3
@@ -207,7 +207,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:9:4
|
LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
- | ^^^^^^^^^^^^^^^^ ------- ------- --------
+ | ^^^^^^^^^^^^^^^^ -------
error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:35:23
@@ -221,7 +221,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:9:4
|
LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
- | ^^^^^^^^^^^^^^^^ ------- ------- --------
+ | ^^^^^^^^^^^^^^^^ -------
error[E0308]: mismatched types
--> $DIR/invalid_arguments.rs:36:26
@@ -235,7 +235,7 @@ note: function defined here
--> $DIR/invalid_arguments.rs:9:4
|
LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
- | ^^^^^^^^^^^^^^^^ ------- ------- --------
+ | ^^^^^^^^^^^^^^^^ --------
error[E0308]: arguments to this function are incorrect
--> $DIR/invalid_arguments.rs:38:3
diff --git a/src/test/ui/argument-suggestions/issue-100478.rs b/src/test/ui/argument-suggestions/issue-100478.rs
new file mode 100644
index 000000000..6bef6ad10
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-100478.rs
@@ -0,0 +1,52 @@
+use std::sync::Arc;
+macro_rules! GenT {
+ ($name:tt) => {
+ #[derive(Default, Debug)]
+ struct $name {
+ #[allow(unused)]
+ val: i32,
+ }
+
+ impl $name {
+ #[allow(unused)]
+ fn new(val: i32) -> Self {
+ $name { val }
+ }
+ }
+ };
+}
+
+GenT!(T1);
+GenT!(T2);
+GenT!(T3);
+GenT!(T4);
+GenT!(T5);
+GenT!(T6);
+GenT!(T7);
+GenT!(T8);
+
+#[allow(unused)]
+fn foo(p1: T1, p2: Arc<T2>, p3: T3, p4: Arc<T4>, p5: T5, p6: T6, p7: T7, p8: Arc<T8>) {}
+fn three_diff(_a: T1, _b: T2, _c: T3) {}
+fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {}
+
+fn main() {
+ three_diff(T2::new(0)); //~ ERROR this function takes
+ four_shuffle(T3::default(), T4::default(), T1::default(), T2::default()); //~ ERROR 35:5: 35:17: arguments to this function are incorrect [E0308]
+ four_shuffle(T3::default(), T2::default(), T1::default(), T3::default()); //~ ERROR 36:5: 36:17: arguments to this function are incorrect [E0308]
+
+ let p1 = T1::new(0);
+ let p2 = Arc::new(T2::new(0));
+ let p3 = T3::new(0);
+ let p4 = Arc::new(T4::new(1));
+ let p5 = T5::new(0);
+ let p6 = T6::new(0);
+ let p7 = T7::new(0);
+ let p8 = Arc::default();
+
+ foo(
+ //~^ 47:5: 47:8: this function takes 8 arguments but 7 arguments were supplied [E0061]
+ p1, //p2,
+ p3, p4, p5, p6, p7, p8,
+ );
+}
diff --git a/src/test/ui/argument-suggestions/issue-100478.stderr b/src/test/ui/argument-suggestions/issue-100478.stderr
new file mode 100644
index 000000000..df02a312c
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-100478.stderr
@@ -0,0 +1,81 @@
+error[E0061]: this function takes 3 arguments but 1 argument was supplied
+ --> $DIR/issue-100478.rs:34:5
+ |
+LL | three_diff(T2::new(0));
+ | ^^^^^^^^^^------------
+ | ||
+ | |an argument of type `T1` is missing
+ | an argument of type `T3` is missing
+ |
+note: function defined here
+ --> $DIR/issue-100478.rs:30:4
+ |
+LL | fn three_diff(_a: T1, _b: T2, _c: T3) {}
+ | ^^^^^^^^^^ ------ ------ ------
+help: provide the arguments
+ |
+LL | three_diff(/* T1 */, T2::new(0), /* T3 */);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+ --> $DIR/issue-100478.rs:35:5
+ |
+LL | four_shuffle(T3::default(), T4::default(), T1::default(), T2::default());
+ | ^^^^^^^^^^^^ ------------- ------------- ------------- ------------- expected `T4`, found `T2`
+ | | | |
+ | | | expected `T3`, found `T1`
+ | | expected `T2`, found `T4`
+ | expected `T1`, found `T3`
+ |
+note: function defined here
+ --> $DIR/issue-100478.rs:31:4
+ |
+LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {}
+ | ^^^^^^^^^^^^ ------ ------ ------ ------
+help: did you mean
+ |
+LL | four_shuffle(T1::default(), T2::default(), T3::default(), T4::default());
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+ --> $DIR/issue-100478.rs:36:5
+ |
+LL | four_shuffle(T3::default(), T2::default(), T1::default(), T3::default());
+ | ^^^^^^^^^^^^ ------------- ------------- ------------- expected struct `T4`, found struct `T3`
+ | | |
+ | | expected `T3`, found `T1`
+ | expected `T1`, found `T3`
+ |
+note: function defined here
+ --> $DIR/issue-100478.rs:31:4
+ |
+LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {}
+ | ^^^^^^^^^^^^ ------ ------ ------ ------
+help: swap these arguments
+ |
+LL | four_shuffle(T1::default(), T2::default(), T3::default(), /* T4 */);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 8 arguments but 7 arguments were supplied
+ --> $DIR/issue-100478.rs:47:5
+ |
+LL | foo(
+ | ^^^
+...
+LL | p3, p4, p5, p6, p7, p8,
+ | -- an argument of type `Arc<T2>` is missing
+ |
+note: function defined here
+ --> $DIR/issue-100478.rs:29:4
+ |
+LL | fn foo(p1: T1, p2: Arc<T2>, p3: T3, p4: Arc<T4>, p5: T5, p6: T6, p7: T7, p8: Arc<T8>) {}
+ | ^^^ ------ ----------- ------ ----------- ------ ------ ------ -----------
+help: provide the argument
+ |
+LL | foo(p1, /* Arc<T2> */, p3, p4, p5, p6, p7, p8);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0061, E0308.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/src/test/ui/argument-suggestions/issue-101097.rs b/src/test/ui/argument-suggestions/issue-101097.rs
new file mode 100644
index 000000000..7994d3cd9
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-101097.rs
@@ -0,0 +1,21 @@
+struct A;
+struct B;
+struct C;
+struct D;
+
+fn f(
+ a1: A,
+ a2: A,
+ b1: B,
+ b2: B,
+ c1: C,
+ c2: C,
+) {}
+
+fn main() {
+ f(C, A, A, A, B, B, C); //~ ERROR this function takes 6 arguments but 7 arguments were supplied [E0061]
+ f(C, C, A, A, B, B); //~ ERROR arguments to this function are incorrect [E0308]
+ f(A, A, D, D, B, B); //~ arguments to this function are incorrect [E0308]
+ f(C, C, B, B, A, A); //~ arguments to this function are incorrect [E0308]
+ f(C, C, A, B, A, A); //~ arguments to this function are incorrect [E0308]
+}
diff --git a/src/test/ui/argument-suggestions/issue-101097.stderr b/src/test/ui/argument-suggestions/issue-101097.stderr
new file mode 100644
index 000000000..096f8c226
--- /dev/null
+++ b/src/test/ui/argument-suggestions/issue-101097.stderr
@@ -0,0 +1,160 @@
+error[E0061]: this function takes 6 arguments but 7 arguments were supplied
+ --> $DIR/issue-101097.rs:16:5
+ |
+LL | f(C, A, A, A, B, B, C);
+ | ^ - - - - expected `C`, found `B`
+ | | | |
+ | | | argument of type `A` unexpected
+ | | expected `B`, found `A`
+ | expected `A`, found `C`
+ |
+note: function defined here
+ --> $DIR/issue-101097.rs:6:4
+ |
+LL | fn f(
+ | ^
+LL | a1: A,
+ | -----
+LL | a2: A,
+ | -----
+LL | b1: B,
+ | -----
+LL | b2: B,
+ | -----
+LL | c1: C,
+ | -----
+LL | c2: C,
+ | -----
+help: did you mean
+ |
+LL | f(A, A, B, B, C, C);
+ | ~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+ --> $DIR/issue-101097.rs:17:5
+ |
+LL | f(C, C, A, A, B, B);
+ | ^
+ |
+note: function defined here
+ --> $DIR/issue-101097.rs:6:4
+ |
+LL | fn f(
+ | ^
+LL | a1: A,
+ | -----
+LL | a2: A,
+ | -----
+LL | b1: B,
+ | -----
+LL | b2: B,
+ | -----
+LL | c1: C,
+ | -----
+LL | c2: C,
+ | -----
+help: did you mean
+ |
+LL | f(A, A, B, B, C, C);
+ | ~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+ --> $DIR/issue-101097.rs:18:5
+ |
+LL | f(A, A, D, D, B, B);
+ | ^ - - ---- two arguments of type `C` and `C` are missing
+ | | |
+ | | argument of type `D` unexpected
+ | argument of type `D` unexpected
+ |
+note: function defined here
+ --> $DIR/issue-101097.rs:6:4
+ |
+LL | fn f(
+ | ^
+LL | a1: A,
+ | -----
+LL | a2: A,
+ | -----
+LL | b1: B,
+ | -----
+LL | b2: B,
+ | -----
+LL | c1: C,
+ | -----
+LL | c2: C,
+ | -----
+help: did you mean
+ |
+LL | f(A, A, B, B, /* C */, /* C */);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+ --> $DIR/issue-101097.rs:19:5
+ |
+LL | f(C, C, B, B, A, A);
+ | ^ - - - - expected `C`, found `A`
+ | | | |
+ | | | expected `C`, found `A`
+ | | expected `A`, found `C`
+ | expected `A`, found `C`
+ |
+note: function defined here
+ --> $DIR/issue-101097.rs:6:4
+ |
+LL | fn f(
+ | ^
+LL | a1: A,
+ | -----
+LL | a2: A,
+ | -----
+LL | b1: B,
+ | -----
+LL | b2: B,
+ | -----
+LL | c1: C,
+ | -----
+LL | c2: C,
+ | -----
+help: did you mean
+ |
+LL | f(A, A, B, B, C, C);
+ | ~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+ --> $DIR/issue-101097.rs:20:5
+ |
+LL | f(C, C, A, B, A, A);
+ | ^ - - - - - expected `C`, found `A`
+ | | | | |
+ | | | | expected `C`, found `A`
+ | | | expected struct `B`, found struct `A`
+ | | expected `A`, found `C`
+ | expected `A`, found `C`
+ |
+note: function defined here
+ --> $DIR/issue-101097.rs:6:4
+ |
+LL | fn f(
+ | ^
+LL | a1: A,
+ | -----
+LL | a2: A,
+ | -----
+LL | b1: B,
+ | -----
+LL | b2: B,
+ | -----
+LL | c1: C,
+ | -----
+LL | c2: C,
+ | -----
+help: did you mean
+ |
+LL | f(A, A, /* B */, B, C, C);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0061, E0308.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/src/test/ui/argument-suggestions/issue-96638.stderr b/src/test/ui/argument-suggestions/issue-96638.stderr
index 8af31b8b7..4d18b97c9 100644
--- a/src/test/ui/argument-suggestions/issue-96638.stderr
+++ b/src/test/ui/argument-suggestions/issue-96638.stderr
@@ -2,7 +2,9 @@ error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> $DIR/issue-96638.rs:8:5
|
LL | f(&x, "");
- | ^ -- an argument of type `usize` is missing
+ | ^ -- -- expected `usize`, found `&str`
+ | |
+ | an argument of type `usize` is missing
|
note: function defined here
--> $DIR/issue-96638.rs:1:4
@@ -12,7 +14,7 @@ LL | fn f(_: usize, _: &usize, _: usize) {}
help: provide the argument
|
LL | f(/* usize */, &x, /* usize */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/argument-suggestions/issue-97197.stderr b/src/test/ui/argument-suggestions/issue-97197.stderr
index ac54adc5e..de221ba1f 100644
--- a/src/test/ui/argument-suggestions/issue-97197.stderr
+++ b/src/test/ui/argument-suggestions/issue-97197.stderr
@@ -12,7 +12,7 @@ LL | pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {}
help: provide the arguments
|
LL | g((), /* bool */, /* bool */, /* bool */, /* bool */, ());
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/argument-suggestions/issue-97484.stderr b/src/test/ui/argument-suggestions/issue-97484.stderr
index 9589e919c..caa50f14b 100644
--- a/src/test/ui/argument-suggestions/issue-97484.stderr
+++ b/src/test/ui/argument-suggestions/issue-97484.stderr
@@ -2,8 +2,9 @@ error[E0061]: this function takes 4 arguments but 7 arguments were supplied
--> $DIR/issue-97484.rs:12:5
|
LL | foo(&&A, B, C, D, E, F, G);
- | ^^^ - - - argument of type `F` unexpected
- | | |
+ | ^^^ - - - - argument of type `F` unexpected
+ | | | |
+ | | | expected `&E`, found struct `E`
| | argument of type `C` unexpected
| argument of type `B` unexpected
|
@@ -19,7 +20,7 @@ LL | foo(&&A, B, C, D, &E, F, G);
help: remove the extra arguments
|
LL | foo(&&A, D, /* &E */, G);
- | ~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/argument-suggestions/issue-98894.stderr b/src/test/ui/argument-suggestions/issue-98894.stderr
index 0c8b94901..f64a83ab7 100644
--- a/src/test/ui/argument-suggestions/issue-98894.stderr
+++ b/src/test/ui/argument-suggestions/issue-98894.stderr
@@ -12,7 +12,7 @@ LL | (|_, ()| ())(if true {} else {return;});
help: provide the argument
|
LL | (|_, ()| ())(if true {} else {return;}, ());
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/argument-suggestions/issue-98897.stderr b/src/test/ui/argument-suggestions/issue-98897.stderr
index 8f0d98d09..f2c47d353 100644
--- a/src/test/ui/argument-suggestions/issue-98897.stderr
+++ b/src/test/ui/argument-suggestions/issue-98897.stderr
@@ -12,7 +12,7 @@ LL | (|_, ()| ())([return, ()]);
help: provide the argument
|
LL | (|_, ()| ())([return, ()], ());
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/argument-suggestions/issue-99482.stderr b/src/test/ui/argument-suggestions/issue-99482.stderr
index bc005e82a..bcf36e37c 100644
--- a/src/test/ui/argument-suggestions/issue-99482.stderr
+++ b/src/test/ui/argument-suggestions/issue-99482.stderr
@@ -12,7 +12,7 @@ LL | let f = |_: (), f: fn()| f;
help: provide the argument
|
LL | let _f = f((), main);
- | ~~~~~~~~~~~
+ | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/argument-suggestions/missing_arguments.stderr b/src/test/ui/argument-suggestions/missing_arguments.stderr
index 2509d22d7..ba9ece040 100644
--- a/src/test/ui/argument-suggestions/missing_arguments.stderr
+++ b/src/test/ui/argument-suggestions/missing_arguments.stderr
@@ -12,7 +12,7 @@ LL | fn one_arg(_a: i32) {}
help: provide the argument
|
LL | one_arg(/* i32 */);
- | ~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~
error[E0061]: this function takes 2 arguments but 0 arguments were supplied
--> $DIR/missing_arguments.rs:14:3
@@ -28,7 +28,7 @@ LL | fn two_same(_a: i32, _b: i32) {}
help: provide the arguments
|
LL | two_same(/* i32 */, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/missing_arguments.rs:15:3
@@ -44,7 +44,7 @@ LL | fn two_same(_a: i32, _b: i32) {}
help: provide the argument
|
LL | two_same(1, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~
error[E0061]: this function takes 2 arguments but 0 arguments were supplied
--> $DIR/missing_arguments.rs:16:3
@@ -60,7 +60,7 @@ LL | fn two_diff(_a: i32, _b: f32) {}
help: provide the arguments
|
LL | two_diff(/* i32 */, /* f32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/missing_arguments.rs:17:3
@@ -76,7 +76,7 @@ LL | fn two_diff(_a: i32, _b: f32) {}
help: provide the argument
|
LL | two_diff(1, /* f32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/missing_arguments.rs:18:3
@@ -92,7 +92,7 @@ LL | fn two_diff(_a: i32, _b: f32) {}
help: provide the argument
|
LL | two_diff(/* i32 */, 1.0);
- | ~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 0 arguments were supplied
--> $DIR/missing_arguments.rs:21:3
@@ -108,7 +108,7 @@ LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
help: provide the arguments
|
LL | three_same(/* i32 */, /* i32 */, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 1 argument was supplied
--> $DIR/missing_arguments.rs:22:3
@@ -124,7 +124,7 @@ LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
help: provide the arguments
|
LL | three_same(1, /* i32 */, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> $DIR/missing_arguments.rs:23:3
@@ -140,7 +140,7 @@ LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
help: provide the argument
|
LL | three_same(1, 1, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> $DIR/missing_arguments.rs:26:3
@@ -156,7 +156,7 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
help: provide the argument
|
LL | three_diff(/* i32 */, 1.0, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> $DIR/missing_arguments.rs:27:3
@@ -172,7 +172,7 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
help: provide the argument
|
LL | three_diff(1, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> $DIR/missing_arguments.rs:28:3
@@ -188,7 +188,7 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
help: provide the argument
|
LL | three_diff(1, 1.0, /* &str */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 1 argument was supplied
--> $DIR/missing_arguments.rs:29:3
@@ -204,7 +204,7 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
help: provide the arguments
|
LL | three_diff(/* i32 */, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 1 argument was supplied
--> $DIR/missing_arguments.rs:30:3
@@ -223,7 +223,7 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
help: provide the arguments
|
LL | three_diff(/* i32 */, 1.0, /* &str */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 1 argument was supplied
--> $DIR/missing_arguments.rs:31:3
@@ -239,7 +239,7 @@ LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
help: provide the arguments
|
LL | three_diff(1, /* f32 */, /* &str */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 4 arguments but 0 arguments were supplied
--> $DIR/missing_arguments.rs:34:3
@@ -255,7 +255,7 @@ LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {}
help: provide the arguments
|
LL | four_repeated(/* i32 */, /* f32 */, /* f32 */, /* &str */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 4 arguments but 2 arguments were supplied
--> $DIR/missing_arguments.rs:35:3
@@ -271,7 +271,7 @@ LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {}
help: provide the arguments
|
LL | four_repeated(1, /* f32 */, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 5 arguments but 0 arguments were supplied
--> $DIR/missing_arguments.rs:38:3
@@ -287,7 +287,7 @@ LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {}
help: provide the arguments
|
LL | complex(/* i32 */, /* f32 */, /* i32 */, /* f32 */, /* &str */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 5 arguments but 2 arguments were supplied
--> $DIR/missing_arguments.rs:39:3
@@ -303,7 +303,7 @@ LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {}
help: provide the arguments
|
LL | complex(1, /* f32 */, /* i32 */, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 19 previous errors
diff --git a/src/test/ui/argument-suggestions/mixed_cases.stderr b/src/test/ui/argument-suggestions/mixed_cases.stderr
index a52a30d78..8c525db1a 100644
--- a/src/test/ui/argument-suggestions/mixed_cases.stderr
+++ b/src/test/ui/argument-suggestions/mixed_cases.stderr
@@ -14,7 +14,7 @@ LL | fn two_args(_a: i32, _b: f32) {}
help: remove the extra argument
|
LL | two_args(1, /* f32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 4 arguments were supplied
--> $DIR/mixed_cases.rs:11:3
@@ -33,7 +33,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: did you mean
|
LL | three_args(1, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> $DIR/mixed_cases.rs:14:3
@@ -52,7 +52,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: provide the argument
|
LL | three_args(1, /* f32 */, /* &str */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/mixed_cases.rs:17:3
@@ -70,7 +70,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: did you mean
|
LL | three_args(1, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/mixed_cases.rs:20:3
@@ -89,7 +89,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: swap these arguments
|
LL | three_args(1, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 3 arguments but 2 arguments were supplied
--> $DIR/mixed_cases.rs:23:3
@@ -109,7 +109,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: did you mean
|
LL | three_args(1, /* f32 */, "");
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/argument-suggestions/permuted_arguments.stderr b/src/test/ui/argument-suggestions/permuted_arguments.stderr
index f16d22860..655807a7f 100644
--- a/src/test/ui/argument-suggestions/permuted_arguments.stderr
+++ b/src/test/ui/argument-suggestions/permuted_arguments.stderr
@@ -15,7 +15,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: reorder these arguments
|
LL | three_args(1, 1.0, "");
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/permuted_arguments.rs:12:3
@@ -36,7 +36,7 @@ LL | fn many_args(_a: i32, _b: f32, _c: &str, _d: X, _e: Y) {}
help: reorder these arguments
|
LL | many_args(1, 1.0, "", X {}, Y {});
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/argument-suggestions/swapped_arguments.stderr b/src/test/ui/argument-suggestions/swapped_arguments.stderr
index a90792d0c..dabf5e952 100644
--- a/src/test/ui/argument-suggestions/swapped_arguments.stderr
+++ b/src/test/ui/argument-suggestions/swapped_arguments.stderr
@@ -14,7 +14,7 @@ LL | fn two_args(_a: i32, _b: f32) {}
help: swap these arguments
|
LL | two_args(1, 1.0);
- | ~~~~~~~~~~~~~~~~
+ | ~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/swapped_arguments.rs:9:3
@@ -32,7 +32,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: swap these arguments
|
LL | three_args(1, 1.0, "");
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/swapped_arguments.rs:10:3
@@ -50,7 +50,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: swap these arguments
|
LL | three_args(1, 1.0, "");
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/swapped_arguments.rs:11:3
@@ -68,7 +68,7 @@ LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
help: swap these arguments
|
LL | three_args(1, 1.0, "");
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~
error[E0308]: arguments to this function are incorrect
--> $DIR/swapped_arguments.rs:13:3
@@ -88,7 +88,7 @@ LL | fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {}
help: did you mean
|
LL | four_args(1, 1.0, "", X {});
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
diff --git a/src/test/ui/argument-suggestions/too-long.rs b/src/test/ui/argument-suggestions/too-long.rs
new file mode 100644
index 000000000..7ec56afae
--- /dev/null
+++ b/src/test/ui/argument-suggestions/too-long.rs
@@ -0,0 +1,41 @@
+struct Qux;
+
+impl Qux {
+ fn foo(
+ &self,
+ a: i32,
+ b: i32,
+ c: i32,
+ d: i32,
+ e: i32,
+ f: i32,
+ g: i32,
+ h: i32,
+ i: i32,
+ j: i32,
+ k: i32,
+ l: i32,
+ ) {
+ }
+}
+
+fn what(
+ qux: &Qux,
+ a: i32,
+ b: i32,
+ c: i32,
+ d: i32,
+ e: i32,
+ f: &i32,
+ g: i32,
+ h: i32,
+ i: i32,
+ j: i32,
+ k: i32,
+ l: i32,
+) {
+ qux.foo(a, b, c, d, e, f, g, h, i, j, k, l);
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/argument-suggestions/too-long.stderr b/src/test/ui/argument-suggestions/too-long.stderr
new file mode 100644
index 000000000..bd430194c
--- /dev/null
+++ b/src/test/ui/argument-suggestions/too-long.stderr
@@ -0,0 +1,24 @@
+error[E0308]: mismatched types
+ --> $DIR/too-long.rs:37:28
+ |
+LL | qux.foo(a, b, c, d, e, f, g, h, i, j, k, l);
+ | --- ^ expected `i32`, found `&i32`
+ | |
+ | arguments to this function are incorrect
+ |
+note: associated function defined here
+ --> $DIR/too-long.rs:4:8
+ |
+LL | fn foo(
+ | ^^^
+...
+LL | f: i32,
+ | ------
+help: consider dereferencing the borrow
+ |
+LL | qux.foo(a, b, c, d, e, *f, g, h, i, j, k, l);
+ | +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/argument-suggestions/two-mismatch-notes.rs b/src/test/ui/argument-suggestions/two-mismatch-notes.rs
new file mode 100644
index 000000000..1309041ab
--- /dev/null
+++ b/src/test/ui/argument-suggestions/two-mismatch-notes.rs
@@ -0,0 +1,11 @@
+#[derive(Copy, Clone)]
+struct Wrapper<T>(T);
+
+fn foo(_: fn(i32), _: Wrapper<i32>) {}
+
+fn f(_: u32) {}
+
+fn main() {
+ let w = Wrapper::<isize>(1isize);
+ foo(f, w); //~ ERROR arguments to this function are incorrect
+}
diff --git a/src/test/ui/argument-suggestions/two-mismatch-notes.stderr b/src/test/ui/argument-suggestions/two-mismatch-notes.stderr
new file mode 100644
index 000000000..7873cf964
--- /dev/null
+++ b/src/test/ui/argument-suggestions/two-mismatch-notes.stderr
@@ -0,0 +1,29 @@
+error[E0308]: arguments to this function are incorrect
+ --> $DIR/two-mismatch-notes.rs:10:5
+ |
+LL | foo(f, w);
+ | ^^^
+ |
+note: expected `i32`, found `u32`
+ --> $DIR/two-mismatch-notes.rs:10:9
+ |
+LL | foo(f, w);
+ | ^
+ = note: expected fn pointer `fn(i32)`
+ found fn item `fn(u32) {f}`
+note: expected `i32`, found `isize`
+ --> $DIR/two-mismatch-notes.rs:10:12
+ |
+LL | foo(f, w);
+ | ^
+ = note: expected struct `Wrapper<i32>`
+ found struct `Wrapper<isize>`
+note: function defined here
+ --> $DIR/two-mismatch-notes.rs:4:4
+ |
+LL | fn foo(_: fn(i32), _: Wrapper<i32>) {}
+ | ^^^ ---------- ---------------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/array-slice-vec/array_const_index-0.rs b/src/test/ui/array-slice-vec/array_const_index-0.rs
index 9ff7e2c56..96755802e 100644
--- a/src/test/ui/array-slice-vec/array_const_index-0.rs
+++ b/src/test/ui/array-slice-vec/array_const_index-0.rs
@@ -1,8 +1,7 @@
const A: &'static [i32] = &[];
const B: i32 = (&A)[1];
//~^ index out of bounds: the length is 0 but the index is 1
-//~| ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~| ERROR evaluation of constant value failed
fn main() {
let _ = B;
diff --git a/src/test/ui/array-slice-vec/array_const_index-0.stderr b/src/test/ui/array-slice-vec/array_const_index-0.stderr
index 483239871..3b92cc766 100644
--- a/src/test/ui/array-slice-vec/array_const_index-0.stderr
+++ b/src/test/ui/array-slice-vec/array_const_index-0.stderr
@@ -1,23 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/array_const_index-0.rs:2:16
|
LL | const B: i32 = (&A)[1];
- | ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^ index out of bounds: the length is 0 but the index is 1
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/array_const_index-0.rs:2:16
- |
-LL | const B: i32 = (&A)[1];
- | ------------ ^^^^^^^ index out of bounds: the length is 0 but the index is 1
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/array-slice-vec/array_const_index-1.rs b/src/test/ui/array-slice-vec/array_const_index-1.rs
index f4326189c..625bf06a7 100644
--- a/src/test/ui/array-slice-vec/array_const_index-1.rs
+++ b/src/test/ui/array-slice-vec/array_const_index-1.rs
@@ -1,8 +1,7 @@
const A: [i32; 0] = [];
const B: i32 = A[1];
//~^ index out of bounds: the length is 0 but the index is 1
-//~| ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~| ERROR evaluation of constant value failed
fn main() {
let _ = B;
diff --git a/src/test/ui/array-slice-vec/array_const_index-1.stderr b/src/test/ui/array-slice-vec/array_const_index-1.stderr
index 361f518c0..591db268a 100644
--- a/src/test/ui/array-slice-vec/array_const_index-1.stderr
+++ b/src/test/ui/array-slice-vec/array_const_index-1.stderr
@@ -1,23 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/array_const_index-1.rs:2:16
|
LL | const B: i32 = A[1];
- | ------------ ^^^^ index out of bounds: the length is 0 but the index is 1
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^ index out of bounds: the length is 0 but the index is 1
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/array_const_index-1.rs:2:16
- |
-LL | const B: i32 = A[1];
- | ------------ ^^^^ index out of bounds: the length is 0 but the index is 1
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/array-slice-vec/suggest-array-length.fixed b/src/test/ui/array-slice-vec/suggest-array-length.fixed
new file mode 100644
index 000000000..867c18a7d
--- /dev/null
+++ b/src/test/ui/array-slice-vec/suggest-array-length.fixed
@@ -0,0 +1,26 @@
+// run-rustfix
+#![allow(unused_variables, dead_code, non_upper_case_globals)]
+
+fn main() {
+ const Foo: [i32; 3] = [1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ const REF_FOO: &[u8; 1] = &[1];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let foo: [i32; 3] = [1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let bar: [i32; 3] = [0; 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let ref_foo: &[i32; 3] = &[1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let ref_bar: &[i32; 3] = &[0; 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let multiple_ref_foo: &&[i32; 3] = &&[1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+}
diff --git a/src/test/ui/array-slice-vec/suggest-array-length.rs b/src/test/ui/array-slice-vec/suggest-array-length.rs
new file mode 100644
index 000000000..f66b3d4a8
--- /dev/null
+++ b/src/test/ui/array-slice-vec/suggest-array-length.rs
@@ -0,0 +1,26 @@
+// run-rustfix
+#![allow(unused_variables, dead_code, non_upper_case_globals)]
+
+fn main() {
+ const Foo: [i32; _] = [1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ const REF_FOO: &[u8; _] = &[1];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let foo: [i32; _] = [1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let bar: [i32; _] = [0; 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let ref_foo: &[i32; _] = &[1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let ref_bar: &[i32; _] = &[0; 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+ let multiple_ref_foo: &&[i32; _] = &&[1, 2, 3];
+ //~^ ERROR in expressions, `_` can only be used on the left-hand side of an assignment
+ //~| ERROR using `_` for array lengths is unstable
+}
diff --git a/src/test/ui/array-slice-vec/suggest-array-length.stderr b/src/test/ui/array-slice-vec/suggest-array-length.stderr
new file mode 100644
index 000000000..16c90a047
--- /dev/null
+++ b/src/test/ui/array-slice-vec/suggest-array-length.stderr
@@ -0,0 +1,108 @@
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/suggest-array-length.rs:11:20
+ |
+LL | let foo: [i32; _] = [1, 2, 3];
+ | ^ `_` not allowed here
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/suggest-array-length.rs:14:20
+ |
+LL | let bar: [i32; _] = [0; 3];
+ | ^ `_` not allowed here
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/suggest-array-length.rs:17:25
+ |
+LL | let ref_foo: &[i32; _] = &[1, 2, 3];
+ | ^ `_` not allowed here
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/suggest-array-length.rs:20:25
+ |
+LL | let ref_bar: &[i32; _] = &[0; 3];
+ | ^ `_` not allowed here
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/suggest-array-length.rs:23:35
+ |
+LL | let multiple_ref_foo: &&[i32; _] = &&[1, 2, 3];
+ | ^ `_` not allowed here
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/suggest-array-length.rs:5:22
+ |
+LL | const Foo: [i32; _] = [1, 2, 3];
+ | ^ `_` not allowed here
+
+error: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/suggest-array-length.rs:8:26
+ |
+LL | const REF_FOO: &[u8; _] = &[1];
+ | ^ `_` not allowed here
+
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/suggest-array-length.rs:5:22
+ |
+LL | const Foo: [i32; _] = [1, 2, 3];
+ | ^ help: consider specifying the array length: `3`
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/suggest-array-length.rs:8:26
+ |
+LL | const REF_FOO: &[u8; _] = &[1];
+ | ^ help: consider specifying the array length: `1`
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/suggest-array-length.rs:11:20
+ |
+LL | let foo: [i32; _] = [1, 2, 3];
+ | ^ help: consider specifying the array length: `3`
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/suggest-array-length.rs:14:20
+ |
+LL | let bar: [i32; _] = [0; 3];
+ | ^ help: consider specifying the array length: `3`
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/suggest-array-length.rs:17:25
+ |
+LL | let ref_foo: &[i32; _] = &[1, 2, 3];
+ | ^ help: consider specifying the array length: `3`
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/suggest-array-length.rs:20:25
+ |
+LL | let ref_bar: &[i32; _] = &[0; 3];
+ | ^ help: consider specifying the array length: `3`
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/suggest-array-length.rs:23:35
+ |
+LL | let multiple_ref_foo: &&[i32; _] = &&[1, 2, 3];
+ | ^ help: consider specifying the array length: `3`
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
+error: aborting due to 14 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/asm/aarch64/bad-reg.rs b/src/test/ui/asm/aarch64/bad-reg.rs
index 2b6a9b71c..9ccb8ed67 100644
--- a/src/test/ui/asm/aarch64/bad-reg.rs
+++ b/src/test/ui/asm/aarch64/bad-reg.rs
@@ -1,7 +1,7 @@
// only-aarch64
// compile-flags: -C target-feature=+neon
-#![feature(asm_const, asm_sym)]
+#![feature(asm_const)]
use std::arch::asm;
diff --git a/src/test/ui/asm/aarch64/may_unwind.rs b/src/test/ui/asm/aarch64/may_unwind.rs
index ac8cc6202..6af8728bb 100644
--- a/src/test/ui/asm/aarch64/may_unwind.rs
+++ b/src/test/ui/asm/aarch64/may_unwind.rs
@@ -1,9 +1,8 @@
-// min-llvm-version: 13.0.0
// only-aarch64
// run-pass
// needs-asm-support
-#![feature(asm_sym, asm_unwind)]
+#![feature(asm_unwind)]
use std::arch::asm;
use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe};
diff --git a/src/test/ui/asm/aarch64/sym.rs b/src/test/ui/asm/aarch64/sym.rs
index 3f659363c..6a6cdb00d 100644
--- a/src/test/ui/asm/aarch64/sym.rs
+++ b/src/test/ui/asm/aarch64/sym.rs
@@ -3,7 +3,7 @@
// needs-asm-support
// run-pass
-#![feature(thread_local, asm_sym)]
+#![feature(thread_local)]
use std::arch::asm;
diff --git a/src/test/ui/asm/aarch64/type-check-2-2.rs b/src/test/ui/asm/aarch64/type-check-2-2.rs
index aa12d4aa4..0ce1f1d8f 100644
--- a/src/test/ui/asm/aarch64/type-check-2-2.rs
+++ b/src/test/ui/asm/aarch64/type-check-2-2.rs
@@ -1,6 +1,6 @@
// only-aarch64
-#![feature(repr_simd, never_type, asm_sym)]
+#![feature(repr_simd, never_type)]
use std::arch::{asm, global_asm};
diff --git a/src/test/ui/asm/aarch64/type-check-2-2.stderr b/src/test/ui/asm/aarch64/type-check-2-2.stderr
index b2a695529..eef16a165 100644
--- a/src/test/ui/asm/aarch64/type-check-2-2.stderr
+++ b/src/test/ui/asm/aarch64/type-check-2-2.stderr
@@ -5,6 +5,11 @@ LL | let x: u64;
| - binding declared here but left uninitialized
LL | asm!("{}", in(reg) x);
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: u64 = 0;
+ | +++
error[E0381]: used binding `y` isn't initialized
--> $DIR/type-check-2-2.rs:22:9
@@ -13,6 +18,11 @@ LL | let mut y: u64;
| ----- binding declared here but left uninitialized
LL | asm!("{}", inout(reg) y);
| ^^^^^^^^^^^^^^^^^^^^^^^^ `y` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut y: u64 = 0;
+ | +++
error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable
--> $DIR/type-check-2-2.rs:30:29
diff --git a/src/test/ui/asm/aarch64/type-check-2.rs b/src/test/ui/asm/aarch64/type-check-2.rs
index fdafe63c7..1c71c1185 100644
--- a/src/test/ui/asm/aarch64/type-check-2.rs
+++ b/src/test/ui/asm/aarch64/type-check-2.rs
@@ -1,6 +1,6 @@
// only-aarch64
-#![feature(repr_simd, never_type, asm_sym)]
+#![feature(repr_simd, never_type)]
use std::arch::{asm, global_asm};
diff --git a/src/test/ui/asm/aarch64/type-check-3.stderr b/src/test/ui/asm/aarch64/type-check-3.stderr
index b320abdc0..f710df2dc 100644
--- a/src/test/ui/asm/aarch64/type-check-3.stderr
+++ b/src/test/ui/asm/aarch64/type-check-3.stderr
@@ -4,9 +4,9 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0u8);
| ^^ --- for this argument
|
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:50:15
@@ -14,8 +14,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0u16);
| ^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:52:15
@@ -23,8 +23,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0i32);
| ^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:54:15
@@ -32,8 +32,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0f32);
| ^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:57:15
@@ -41,8 +41,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg) 0i16);
| ^^ ---- for this argument
|
- = help: use the `h` modifier to have the register formatted as `h0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:h}` to have the register formatted as `h0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:59:15
@@ -50,8 +50,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg) 0f32);
| ^^ ---- for this argument
|
- = help: use the `s` modifier to have the register formatted as `s0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:s}` to have the register formatted as `s0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:61:15
@@ -59,8 +59,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg) 0f64);
| ^^ ---- for this argument
|
- = help: use the `d` modifier to have the register formatted as `d0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:d}` to have the register formatted as `d0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:63:15
@@ -68,8 +68,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(vreg_low16) 0f64);
| ^^ ---- for this argument
|
- = help: use the `d` modifier to have the register formatted as `d0`
- = help: or use the `v` modifier to keep the default formatting of `v0`
+ = help: use `{0:d}` to have the register formatted as `d0`
+ = help: or use `{0:v}` to keep the default formatting of `v0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:66:15
@@ -77,8 +77,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{0} {0}", in(reg) 0i16);
| ^^^ ^^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:68:15
@@ -86,8 +86,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{0} {0:x}", in(reg) 0i16);
| ^^^ ---- for this argument
|
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
error: type `i128` cannot be used with this register class
--> $DIR/type-check-3.rs:73:28
diff --git a/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr b/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
index 7ef93e15f..bb6a222b2 100644
--- a/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
@@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
|
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr b/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
index 7ef93e15f..bb6a222b2 100644
--- a/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
@@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
|
+ = help: use `{0:w}` to have the register formatted as `w0`
+ = help: or use `{0:x}` to keep the default formatting of `x0`
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `w` modifier to have the register formatted as `w0`
- = help: or use the `x` modifier to keep the default formatting of `x0`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr b/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
index 250bc3be4..903b5e959 100644
--- a/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
@@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
|
+ = help: use `{0:e}` to have the register formatted as `eax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `e` modifier to have the register formatted as `eax`
- = help: or use the `r` modifier to keep the default formatting of `rax`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr b/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
index 250bc3be4..903b5e959 100644
--- a/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
+++ b/src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
@@ -189,9 +189,9 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{:foo}", in(reg) foo);
| ^^^^^^ --- for this argument
|
+ = help: use `{0:e}` to have the register formatted as `eax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `e` modifier to have the register formatted as `eax`
- = help: or use the `r` modifier to keep the default formatting of `rax`
error: aborting due to 21 previous errors; 1 warning emitted
diff --git a/src/test/ui/asm/generic-const.rs b/src/test/ui/asm/generic-const.rs
index 55c558780..caa9b7dbc 100644
--- a/src/test/ui/asm/generic-const.rs
+++ b/src/test/ui/asm/generic-const.rs
@@ -1,7 +1,7 @@
// needs-asm-support
// build-pass
-#![feature(asm_const, asm_sym)]
+#![feature(asm_const)]
use std::arch::asm;
diff --git a/src/test/ui/asm/may_unwind.rs b/src/test/ui/asm/may_unwind.rs
index 117c0a63a..b9479c44b 100644
--- a/src/test/ui/asm/may_unwind.rs
+++ b/src/test/ui/asm/may_unwind.rs
@@ -1,4 +1,3 @@
-// min-llvm-version: 13.0.0
// run-pass
// needs-asm-support
diff --git a/src/test/ui/asm/naked-functions-ffi.stderr b/src/test/ui/asm/naked-functions-ffi.stderr
index ac7435513..908881b19 100644
--- a/src/test/ui/asm/naked-functions-ffi.stderr
+++ b/src/test/ui/asm/naked-functions-ffi.stderr
@@ -4,9 +4,9 @@ warning: `extern` fn uses type `char`, which is not FFI-safe
LL | pub extern "C" fn naked(p: char) -> u128 {
| ^^^^ not FFI-safe
|
- = note: `#[warn(improper_ctypes_definitions)]` on by default
= help: consider using `u32` or `libc::wchar_t` instead
= note: the `char` type has no C equivalent
+ = note: `#[warn(improper_ctypes_definitions)]` on by default
warning: `extern` fn uses type `u128`, which is not FFI-safe
--> $DIR/naked-functions-ffi.rs:9:37
diff --git a/src/test/ui/asm/naked-functions.rs b/src/test/ui/asm/naked-functions.rs
index 9e626f571..2f3716ca7 100644
--- a/src/test/ui/asm/naked-functions.rs
+++ b/src/test/ui/asm/naked-functions.rs
@@ -4,7 +4,7 @@
// ignore-wasm32
#![feature(naked_functions)]
-#![feature(asm_const, asm_sym, asm_unwind)]
+#![feature(asm_const, asm_unwind)]
#![crate_type = "lib"]
use std::arch::asm;
diff --git a/src/test/ui/asm/naked-functions.stderr b/src/test/ui/asm/naked-functions.stderr
index 1828066b6..f90967fbe 100644
--- a/src/test/ui/asm/naked-functions.stderr
+++ b/src/test/ui/asm/naked-functions.stderr
@@ -57,13 +57,11 @@ LL | a + 1
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:33:1
|
-LL | / pub unsafe extern "C" fn inc(a: u32) -> u32 {
-LL | |
-LL | | a + 1
- | | ----- non-asm is unsupported in naked functions
-LL | |
-LL | | }
- | |_^
+LL | pub unsafe extern "C" fn inc(a: u32) -> u32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | a + 1
+ | ----- non-asm is unsupported in naked functions
error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:42:31
@@ -82,12 +80,11 @@ LL | asm!("/* {0} */", in(reg) a, options(noreturn));
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:48:1
|
-LL | / pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
-LL | |
-LL | | (|| a + 1)()
- | | ------------ non-asm is unsupported in naked functions
-LL | | }
- | |_^
+LL | pub unsafe extern "C" fn inc_closure(a: u32) -> u32 {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | (|| a + 1)()
+ | ------------ non-asm is unsupported in naked functions
error[E0787]: only `const` and `sym` operands are supported in naked functions
--> $DIR/naked-functions.rs:65:10
@@ -124,30 +121,25 @@ LL | sym G, options(noreturn),
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:54:1
|
-LL | / pub unsafe extern "C" fn unsupported_operands() {
-LL | |
-LL | | let mut a = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut b = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut c = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut d = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-LL | | let mut e = 0usize;
- | | ------------------- non-asm is unsupported in naked functions
-... |
-LL | | );
-LL | | }
- | |_^
+LL | pub unsafe extern "C" fn unsupported_operands() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | let mut a = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut b = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut c = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut d = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
+LL | let mut e = 0usize;
+ | ------------------- non-asm is unsupported in naked functions
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:77:1
|
-LL | / pub extern "C" fn missing_assembly() {
-LL | |
-LL | | }
- | |_^
+LL | pub extern "C" fn missing_assembly() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0787]: asm in naked functions must use `noreturn` option
--> $DIR/naked-functions.rs:84:5
@@ -185,20 +177,17 @@ LL | asm!("", options(noreturn));
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:82:1
|
-LL | / pub extern "C" fn too_many_asm_blocks() {
-LL | |
-LL | | asm!("");
-LL | |
-LL | | asm!("");
- | | -------- multiple asm blocks are unsupported in naked functions
-LL | |
-LL | | asm!("");
- | | -------- multiple asm blocks are unsupported in naked functions
-LL | |
-LL | | asm!("", options(noreturn));
- | | --------------------------- multiple asm blocks are unsupported in naked functions
-LL | | }
- | |_^
+LL | pub extern "C" fn too_many_asm_blocks() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | asm!("");
+ | -------- multiple asm blocks are unsupported in naked functions
+LL |
+LL | asm!("");
+ | -------- multiple asm blocks are unsupported in naked functions
+LL |
+LL | asm!("", options(noreturn));
+ | --------------------------- multiple asm blocks are unsupported in naked functions
error: referencing function parameters is not allowed in naked functions
--> $DIR/naked-functions.rs:97:11
@@ -211,13 +200,11 @@ LL | *&y
error[E0787]: naked functions must contain a single asm block
--> $DIR/naked-functions.rs:95:5
|
-LL | / pub extern "C" fn inner(y: usize) -> usize {
-LL | |
-LL | | *&y
- | | --- non-asm is unsupported in naked functions
-LL | |
-LL | | }
- | |_____^
+LL | pub extern "C" fn inner(y: usize) -> usize {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | *&y
+ | --- non-asm is unsupported in naked functions
error[E0787]: asm options unsupported in naked functions: `nomem`, `preserves_flags`
--> $DIR/naked-functions.rs:105:5
@@ -249,18 +236,18 @@ LL | asm!("", options(noreturn, may_unwind));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: Rust ABI is unsupported in naked functions
- --> $DIR/naked-functions.rs:124:15
+ --> $DIR/naked-functions.rs:124:1
|
LL | pub unsafe fn default_abi() {
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(undefined_naked_function_abi)]` on by default
warning: Rust ABI is unsupported in naked functions
- --> $DIR/naked-functions.rs:130:15
+ --> $DIR/naked-functions.rs:130:1
|
LL | pub unsafe fn rust_abi() {
- | ^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
error: naked functions cannot be inlined
--> $DIR/naked-functions.rs:170:1
diff --git a/src/test/ui/asm/named-asm-labels.stderr b/src/test/ui/asm/named-asm-labels.stderr
index 001601497..c8380629e 100644
--- a/src/test/ui/asm/named-asm-labels.stderr
+++ b/src/test/ui/asm/named-asm-labels.stderr
@@ -4,9 +4,9 @@ error: avoid using named labels in inline assembly
LL | asm!("bar: nop");
| ^^^
|
- = note: `#[deny(named_asm_labels)]` on by default
= help: only local labels of the form `<number>:` should be used in inline asm
= note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
+ = note: `#[deny(named_asm_labels)]` on by default
error: avoid using named labels in inline assembly
--> $DIR/named-asm-labels.rs:27:15
@@ -259,13 +259,13 @@ warning: avoid using named labels in inline assembly
LL | asm!("warned: nop");
| ^^^^^^
|
+ = help: only local labels of the form `<number>:` should be used in inline asm
+ = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
note: the lint level is defined here
--> $DIR/named-asm-labels.rs:132:16
|
LL | #[warn(named_asm_labels)]
| ^^^^^^^^^^^^^^^^
- = help: only local labels of the form `<number>:` should be used in inline asm
- = note: see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
error: avoid using named labels in inline assembly
--> $DIR/named-asm-labels.rs:143:20
diff --git a/src/test/ui/asm/type-check-1.rs b/src/test/ui/asm/type-check-1.rs
index 50b369ae0..59f7b36af 100644
--- a/src/test/ui/asm/type-check-1.rs
+++ b/src/test/ui/asm/type-check-1.rs
@@ -3,7 +3,7 @@
// ignore-spirv
// ignore-wasm32
-#![feature(asm_const, asm_sym)]
+#![feature(asm_const)]
use std::arch::{asm, global_asm};
diff --git a/src/test/ui/asm/type-check-1.stderr b/src/test/ui/asm/type-check-1.stderr
index 162ff1d32..184513965 100644
--- a/src/test/ui/asm/type-check-1.stderr
+++ b/src/test/ui/asm/type-check-1.stderr
@@ -106,7 +106,7 @@ error[E0308]: mismatched types
--> $DIR/type-check-1.rs:60:26
|
LL | asm!("{}", const 0 as *mut u8);
- | ^^^^^^^^^^^^ expected integer, found *-ptr
+ | ^^^^^^^^^^^^ expected integer, found `*mut u8`
|
= note: expected type `{integer}`
found raw pointer `*mut u8`
@@ -133,7 +133,7 @@ error[E0308]: mismatched types
--> $DIR/type-check-1.rs:78:25
|
LL | global_asm!("{}", const 0 as *mut u8);
- | ^^^^^^^^^^^^ expected integer, found *-ptr
+ | ^^^^^^^^^^^^ expected integer, found `*mut u8`
|
= note: expected type `{integer}`
found raw pointer `*mut u8`
diff --git a/src/test/ui/asm/unpretty-expanded.rs b/src/test/ui/asm/unpretty-expanded.rs
new file mode 100644
index 000000000..25cf1c3d7
--- /dev/null
+++ b/src/test/ui/asm/unpretty-expanded.rs
@@ -0,0 +1,4 @@
+// needs-asm-support
+// check-pass
+// compile-flags: -Zunpretty=expanded
+core::arch::global_asm!("x: .byte 42");
diff --git a/src/test/ui/asm/unpretty-expanded.stdout b/src/test/ui/asm/unpretty-expanded.stdout
new file mode 100644
index 000000000..ab1b5f45e
--- /dev/null
+++ b/src/test/ui/asm/unpretty-expanded.stdout
@@ -0,0 +1,10 @@
+#![feature(prelude_import)]
+#![no_std]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// needs-asm-support
+// check-pass
+// compile-flags: -Zunpretty=expanded
+global_asm! ("x: .byte 42");
diff --git a/src/test/ui/asm/x86_64/bad-reg.rs b/src/test/ui/asm/x86_64/bad-reg.rs
index a4f50a534..f5728079a 100644
--- a/src/test/ui/asm/x86_64/bad-reg.rs
+++ b/src/test/ui/asm/x86_64/bad-reg.rs
@@ -1,7 +1,7 @@
// only-x86_64
// compile-flags: -C target-feature=+avx2
-#![feature(asm_const, asm_sym)]
+#![feature(asm_const)]
use std::arch::asm;
diff --git a/src/test/ui/asm/x86_64/issue-96797.rs b/src/test/ui/asm/x86_64/issue-96797.rs
index d3e0906f3..954f8c5cc 100644
--- a/src/test/ui/asm/x86_64/issue-96797.rs
+++ b/src/test/ui/asm/x86_64/issue-96797.rs
@@ -7,8 +7,6 @@
// regression test for #96797
-#![feature(asm_sym)]
-
use std::arch::global_asm;
#[no_mangle]
diff --git a/src/test/ui/asm/x86_64/may_unwind.rs b/src/test/ui/asm/x86_64/may_unwind.rs
index 9844d63f0..c11f0938d 100644
--- a/src/test/ui/asm/x86_64/may_unwind.rs
+++ b/src/test/ui/asm/x86_64/may_unwind.rs
@@ -1,9 +1,9 @@
-// min-llvm-version: 13.0.0
// only-x86_64
// run-pass
// needs-asm-support
+// needs-unwind
-#![feature(asm_sym, asm_unwind)]
+#![feature(asm_unwind)]
use std::arch::asm;
use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe};
diff --git a/src/test/ui/asm/x86_64/multiple-clobber-abi.rs b/src/test/ui/asm/x86_64/multiple-clobber-abi.rs
index 513eb270e..06589431a 100644
--- a/src/test/ui/asm/x86_64/multiple-clobber-abi.rs
+++ b/src/test/ui/asm/x86_64/multiple-clobber-abi.rs
@@ -4,8 +4,6 @@
// Checks that multiple clobber_abi options can be used
-#![feature(asm_sym)]
-
use std::arch::asm;
extern "sysv64" fn foo(x: i32) -> i32 {
diff --git a/src/test/ui/asm/x86_64/sym.rs b/src/test/ui/asm/x86_64/sym.rs
index 622365bc7..93ef4f090 100644
--- a/src/test/ui/asm/x86_64/sym.rs
+++ b/src/test/ui/asm/x86_64/sym.rs
@@ -1,10 +1,9 @@
-// min-llvm-version: 12.0.1
// only-x86_64
// only-linux
// needs-asm-support
// run-pass
-#![feature(thread_local, asm_sym)]
+#![feature(thread_local)]
use std::arch::asm;
diff --git a/src/test/ui/asm/x86_64/type-check-2.rs b/src/test/ui/asm/x86_64/type-check-2.rs
index 59d8cde3f..80b29ec87 100644
--- a/src/test/ui/asm/x86_64/type-check-2.rs
+++ b/src/test/ui/asm/x86_64/type-check-2.rs
@@ -1,6 +1,6 @@
// only-x86_64
-#![feature(repr_simd, never_type, asm_sym)]
+#![feature(repr_simd, never_type)]
use std::arch::{asm, global_asm};
diff --git a/src/test/ui/asm/x86_64/type-check-3.stderr b/src/test/ui/asm/x86_64/type-check-3.stderr
index b38ea8cc4..1baf50ff6 100644
--- a/src/test/ui/asm/x86_64/type-check-3.stderr
+++ b/src/test/ui/asm/x86_64/type-check-3.stderr
@@ -44,9 +44,9 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{0} {0}", in(reg) 0i16);
| ^^^ ^^^ ---- for this argument
|
+ = help: use `{0:x}` to have the register formatted as `ax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
= note: `#[warn(asm_sub_register)]` on by default
- = help: use the `x` modifier to have the register formatted as `ax`
- = help: or use the `r` modifier to keep the default formatting of `rax`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:36:15
@@ -54,8 +54,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{0} {0:x}", in(reg) 0i16);
| ^^^ ---- for this argument
|
- = help: use the `x` modifier to have the register formatted as `ax`
- = help: or use the `r` modifier to keep the default formatting of `rax`
+ = help: use `{0:x}` to have the register formatted as `ax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:38:15
@@ -63,8 +63,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(reg) 0i32);
| ^^ ---- for this argument
|
- = help: use the `e` modifier to have the register formatted as `eax`
- = help: or use the `r` modifier to keep the default formatting of `rax`
+ = help: use `{0:e}` to have the register formatted as `eax`
+ = help: or use `{0:r}` to keep the default formatting of `rax`
warning: formatting may not be suitable for sub-register argument
--> $DIR/type-check-3.rs:41:15
@@ -72,8 +72,8 @@ warning: formatting may not be suitable for sub-register argument
LL | asm!("{}", in(ymm_reg) 0i64);
| ^^ ---- for this argument
|
- = help: use the `x` modifier to have the register formatted as `xmm0`
- = help: or use the `y` modifier to keep the default formatting of `ymm0`
+ = help: use `{0:x}` to have the register formatted as `xmm0`
+ = help: or use `{0:y}` to keep the default formatting of `ymm0`
error: type `i8` cannot be used with this register class
--> $DIR/type-check-3.rs:52:28
diff --git a/src/test/ui/asm/x86_64/type-check-4.rs b/src/test/ui/asm/x86_64/type-check-4.rs
index da3b76c3d..3d5d3807c 100644
--- a/src/test/ui/asm/x86_64/type-check-4.rs
+++ b/src/test/ui/asm/x86_64/type-check-4.rs
@@ -1,14 +1,13 @@
// only-x86_64
// compile-flags: -C target-feature=+avx512f
-#![feature(asm_const, asm_sym)]
+#![feature(asm_const)]
use std::arch::{asm, global_asm};
use std::arch::x86_64::{_mm256_setzero_ps, _mm_setzero_ps};
-fn main() {
-}
+fn main() {}
// Constants must be... constant
diff --git a/src/test/ui/asm/x86_64/type-check-4.stderr b/src/test/ui/asm/x86_64/type-check-4.stderr
index 33f4638fb..3875bcc21 100644
--- a/src/test/ui/asm/x86_64/type-check-4.stderr
+++ b/src/test/ui/asm/x86_64/type-check-4.stderr
@@ -1,5 +1,5 @@
error[E0013]: constants cannot refer to statics
- --> $DIR/type-check-4.rs:22:25
+ --> $DIR/type-check-4.rs:21:25
|
LL | global_asm!("{}", const S);
| ^
@@ -7,7 +7,7 @@ LL | global_asm!("{}", const S);
= help: consider extracting the value of the `static` to a `const`, and referring to that
error[E0013]: constants cannot refer to statics
- --> $DIR/type-check-4.rs:25:35
+ --> $DIR/type-check-4.rs:24:35
|
LL | global_asm!("{}", const const_foo(S));
| ^
@@ -15,7 +15,7 @@ LL | global_asm!("{}", const const_foo(S));
= help: consider extracting the value of the `static` to a `const`, and referring to that
error[E0013]: constants cannot refer to statics
- --> $DIR/type-check-4.rs:28:35
+ --> $DIR/type-check-4.rs:27:35
|
LL | global_asm!("{}", const const_bar(S));
| ^
diff --git a/src/test/ui/asm/x86_64/type-check-5.rs b/src/test/ui/asm/x86_64/type-check-5.rs
index 6190e0b52..8198df910 100644
--- a/src/test/ui/asm/x86_64/type-check-5.rs
+++ b/src/test/ui/asm/x86_64/type-check-5.rs
@@ -1,6 +1,6 @@
// only-x86_64
-#![feature(repr_simd, never_type, asm_sym)]
+#![feature(repr_simd, never_type)]
use std::arch::asm;
diff --git a/src/test/ui/asm/x86_64/type-check-5.stderr b/src/test/ui/asm/x86_64/type-check-5.stderr
index e9c93fea5..bd90461e5 100644
--- a/src/test/ui/asm/x86_64/type-check-5.stderr
+++ b/src/test/ui/asm/x86_64/type-check-5.stderr
@@ -5,6 +5,11 @@ LL | let x: u64;
| - binding declared here but left uninitialized
LL | asm!("{}", in(reg) x);
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: u64 = 0;
+ | +++
error[E0381]: used binding `y` isn't initialized
--> $DIR/type-check-5.rs:18:9
@@ -13,6 +18,11 @@ LL | let mut y: u64;
| ----- binding declared here but left uninitialized
LL | asm!("{}", inout(reg) y);
| ^^^^^^^^^^^^^^^^^^^^^^^^ `y` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut y: u64 = 0;
+ | +++
error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable
--> $DIR/type-check-5.rs:26:29
diff --git a/src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.stderr b/src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.stderr
index de1d9589e..742b81535 100644
--- a/src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.stderr
+++ b/src/test/ui/associated-consts/associated-const-impl-wrong-lifetime.stderr
@@ -2,7 +2,7 @@ error[E0308]: const not compatible with trait
--> $DIR/associated-const-impl-wrong-lifetime.rs:7:5
|
LL | const NAME: &'a str = "unit";
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
+ | ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected reference `&'static str`
found reference `&'a str`
diff --git a/src/test/ui/associated-consts/defaults-cyclic-fail.stderr b/src/test/ui/associated-consts/defaults-cyclic-fail.stderr
index 582473905..c4cd9c2a4 100644
--- a/src/test/ui/associated-consts/defaults-cyclic-fail.stderr
+++ b/src/test/ui/associated-consts/defaults-cyclic-fail.stderr
@@ -2,13 +2,13 @@ error[E0391]: cycle detected when const-evaluating + checking `Tr::A`
--> $DIR/defaults-cyclic-fail.rs:5:5
|
LL | const A: u8 = Self::B;
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `Tr::B`...
--> $DIR/defaults-cyclic-fail.rs:8:5
|
LL | const B: u8 = Self::A;
- | ^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `Tr::A`, completing the cycle
note: cycle used when const-evaluating + checking `main::promoted[1]`
--> $DIR/defaults-cyclic-fail.rs:16:16
diff --git a/src/test/ui/associated-consts/defaults-not-assumed-fail.rs b/src/test/ui/associated-consts/defaults-not-assumed-fail.rs
index 3936e6a3b..6762d7583 100644
--- a/src/test/ui/associated-consts/defaults-not-assumed-fail.rs
+++ b/src/test/ui/associated-consts/defaults-not-assumed-fail.rs
@@ -6,8 +6,7 @@ trait Tr {
// This should not be a constant evaluation error (overflow). The value of
// `Self::A` must not be assumed to hold inside the trait.
const B: u8 = Self::A + 1;
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of `<() as Tr>::B` failed
}
// An impl that doesn't override any constant will NOT cause a const eval error
@@ -34,7 +33,6 @@ fn main() {
assert_eq!(<() as Tr>::B, 0); // causes the error above
//~^ ERROR evaluation of constant value failed
//~| ERROR erroneous constant used
- //~| WARN this was previously accepted by the compiler but is being phased out
assert_eq!(<u8 as Tr>::A, 254);
assert_eq!(<u8 as Tr>::B, 255);
diff --git a/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr b/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr
index 66ee6031c..aa130f438 100644
--- a/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr
+++ b/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr
@@ -1,52 +1,23 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of `<() as Tr>::B` failed
--> $DIR/defaults-not-assumed-fail.rs:8:19
|
LL | const B: u8 = Self::A + 1;
- | ----------- ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
error[E0080]: evaluation of constant value failed
- --> $DIR/defaults-not-assumed-fail.rs:34:16
+ --> $DIR/defaults-not-assumed-fail.rs:33:16
|
LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
| ^^^^^^^^^^^^^ referenced constant has errors
-error: erroneous constant used
- --> $DIR/defaults-not-assumed-fail.rs:34:5
+error[E0080]: erroneous constant used
+ --> $DIR/defaults-not-assumed-fail.rs:33:5
|
LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/defaults-not-assumed-fail.rs:8:19
- |
-LL | const B: u8 = Self::A + 1;
- | ----------- ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/defaults-not-assumed-fail.rs:34:5
- |
-LL | assert_eq!(<() as Tr>::B, 0); // causes the error above
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
-
diff --git a/src/test/ui/associated-consts/issue-102335-const.rs b/src/test/ui/associated-consts/issue-102335-const.rs
new file mode 100644
index 000000000..f60cb92da
--- /dev/null
+++ b/src/test/ui/associated-consts/issue-102335-const.rs
@@ -0,0 +1,12 @@
+#![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;
+}
+
+fn main() {}
diff --git a/src/test/ui/associated-consts/issue-102335-const.stderr b/src/test/ui/associated-consts/issue-102335-const.stderr
new file mode 100644
index 000000000..531d15c59
--- /dev/null
+++ b/src/test/ui/associated-consts/issue-102335-const.stderr
@@ -0,0 +1,9 @@
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-102335-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/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
index 51a50cfda..c8c57bccb 100644
--- a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
+++ b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
@@ -13,7 +13,7 @@ note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
|
LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
|
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
index b9d1808fe..76ed8d4a6 100644
--- a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
+++ b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
@@ -13,7 +13,7 @@ note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
|
LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `FooDefault::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
|
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
index 271e69206..6a98f08f3 100644
--- a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
+++ b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
@@ -13,7 +13,7 @@ note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
|
LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`...
--> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
|
diff --git a/src/test/ui/associated-consts/mismatched_impl_ty_1.rs b/src/test/ui/associated-consts/mismatched_impl_ty_1.rs
new file mode 100644
index 000000000..4dc6c2e47
--- /dev/null
+++ b/src/test/ui/associated-consts/mismatched_impl_ty_1.rs
@@ -0,0 +1,18 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait MyTrait {
+ type ArrayType;
+ const SIZE: usize;
+ const ARRAY: Self::ArrayType;
+}
+impl MyTrait for () {
+ type ArrayType = [u8; Self::SIZE];
+ const SIZE: usize = 4;
+ const ARRAY: [u8; Self::SIZE] = [1, 2, 3, 4];
+}
+
+fn main() {
+ let _ = <() as MyTrait>::ARRAY;
+}
diff --git a/src/test/ui/associated-consts/mismatched_impl_ty_2.rs b/src/test/ui/associated-consts/mismatched_impl_ty_2.rs
new file mode 100644
index 000000000..539becfdc
--- /dev/null
+++ b/src/test/ui/associated-consts/mismatched_impl_ty_2.rs
@@ -0,0 +1,11 @@
+// run-pass
+trait Trait {
+ const ASSOC: fn(&'static u32);
+}
+impl Trait for () {
+ const ASSOC: for<'a> fn(&'a u32) = |_| ();
+}
+
+fn main() {
+ let _ = <() as Trait>::ASSOC;
+}
diff --git a/src/test/ui/associated-consts/mismatched_impl_ty_3.rs b/src/test/ui/associated-consts/mismatched_impl_ty_3.rs
new file mode 100644
index 000000000..17bcc8fe5
--- /dev/null
+++ b/src/test/ui/associated-consts/mismatched_impl_ty_3.rs
@@ -0,0 +1,11 @@
+// run-pass
+trait Trait {
+ const ASSOC: for<'a, 'b> fn(&'a u32, &'b u32);
+}
+impl Trait for () {
+ const ASSOC: for<'a> fn(&'a u32, &'a u32) = |_, _| ();
+}
+
+fn main() {
+ let _ = <() as Trait>::ASSOC;
+}
diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr
index f4efd1312..0b96a6bd7 100644
--- a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr
+++ b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr
@@ -1,11 +1,11 @@
-error[E0201]: duplicate definitions with name `bar`:
+error[E0592]: duplicate definitions with name `bar`
--> $DIR/associated-item-duplicate-names-2.rs:5:5
|
LL | const bar: bool = true;
- | --------------- previous definition of `bar` here
+ | --------------- other definition for `bar`
LL | fn bar() {}
- | ^^^^^^^^ duplicate definition
+ | ^^^^^^^^ duplicate definitions for `bar`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0201`.
+For more information about this error, try `rustc --explain E0592`.
diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.rs b/src/test/ui/associated-item/associated-item-duplicate-names-3.rs
index 6aa1b483e..3a70a2f94 100644
--- a/src/test/ui/associated-item/associated-item-duplicate-names-3.rs
+++ b/src/test/ui/associated-item/associated-item-duplicate-names-3.rs
@@ -16,4 +16,5 @@ impl Foo for Baz {
fn main() {
let x: Baz::Bar = 5;
+ //~^ ERROR ambiguous associated type
}
diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr
index 03782f663..bf4bd634c 100644
--- a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr
+++ b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr
@@ -1,11 +1,21 @@
error[E0201]: duplicate definitions with name `Bar`:
--> $DIR/associated-item-duplicate-names-3.rs:14:5
|
+LL | type Bar;
+ | --------- item in trait
+...
LL | type Bar = i16;
- | -------- previous definition of `Bar` here
+ | --------------- previous definition here
LL | type Bar = u16;
- | ^^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^^^ duplicate definition
-error: aborting due to previous error
+error[E0223]: ambiguous associated type
+ --> $DIR/associated-item-duplicate-names-3.rs:18:12
+ |
+LL | let x: Baz::Bar = 5;
+ | ^^^^^^^^ help: use fully-qualified syntax: `<Baz as Trait>::Bar`
+
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0201`.
+Some errors have detailed explanations: E0201, E0223.
+For more information about an error, try `rustc --explain E0201`.
diff --git a/src/test/ui/associated-item/associated-item-duplicate-names.stderr b/src/test/ui/associated-item/associated-item-duplicate-names.stderr
index c9119c102..f89ea6e57 100644
--- a/src/test/ui/associated-item/associated-item-duplicate-names.stderr
+++ b/src/test/ui/associated-item/associated-item-duplicate-names.stderr
@@ -1,18 +1,24 @@
error[E0201]: duplicate definitions with name `Ty`:
--> $DIR/associated-item-duplicate-names.rs:11:5
|
+LL | type Ty;
+ | -------- item in trait
+...
LL | type Ty = ();
- | ------- previous definition of `Ty` here
+ | ------------- previous definition here
LL | type Ty = usize;
- | ^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^^^^ duplicate definition
error[E0201]: duplicate definitions with name `BAR`:
--> $DIR/associated-item-duplicate-names.rs:13:5
|
+LL | const BAR: u32;
+ | --------------- item in trait
+...
LL | const BAR: u32 = 7;
- | -------------- previous definition of `BAR` here
+ | ------------------- previous definition here
LL | const BAR: u32 = 8;
- | ^^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^^^^^^^ duplicate definition
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-duplicate-methods.rs b/src/test/ui/associated-item/impl-duplicate-methods.rs
index adb09d7f5..328d54d5a 100644
--- a/src/test/ui/impl-duplicate-methods.rs
+++ b/src/test/ui/associated-item/impl-duplicate-methods.rs
@@ -3,7 +3,7 @@ struct Foo;
impl Foo {
fn orange(&self) {}
fn orange(&self) {}
- //~^ ERROR duplicate definition
+ //~^ ERROR duplicate definitions with name `orange` [E0592]
}
fn main() {}
diff --git a/src/test/ui/associated-item/impl-duplicate-methods.stderr b/src/test/ui/associated-item/impl-duplicate-methods.stderr
new file mode 100644
index 000000000..6f753845a
--- /dev/null
+++ b/src/test/ui/associated-item/impl-duplicate-methods.stderr
@@ -0,0 +1,11 @@
+error[E0592]: duplicate definitions with name `orange`
+ --> $DIR/impl-duplicate-methods.rs:5:5
+ |
+LL | fn orange(&self) {}
+ | ---------------- other definition for `orange`
+LL | fn orange(&self) {}
+ | ^^^^^^^^^^^^^^^^ duplicate definitions for `orange`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0592`.
diff --git a/src/test/ui/associated-type-bounds/binder-on-bound.rs b/src/test/ui/associated-type-bounds/binder-on-bound.rs
index 0b4b24b98..6cba45129 100644
--- a/src/test/ui/associated-type-bounds/binder-on-bound.rs
+++ b/src/test/ui/associated-type-bounds/binder-on-bound.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Trait {
type Bound<'a>;
}
diff --git a/src/test/ui/associated-type-bounds/binder-on-bound.stderr b/src/test/ui/associated-type-bounds/binder-on-bound.stderr
index 3432672e0..f71f72bfb 100644
--- a/src/test/ui/associated-type-bounds/binder-on-bound.stderr
+++ b/src/test/ui/associated-type-bounds/binder-on-bound.stderr
@@ -1,5 +1,5 @@
error: `for<...>` is not allowed on associated type bounds
- --> $DIR/binder-on-bound.rs:7:22
+ --> $DIR/binder-on-bound.rs:5:22
|
LL | fn foo() where Trait<for<'a> Bound<'a> = &'a ()> {
| ^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/associated-type-bounds/elision.rs b/src/test/ui/associated-type-bounds/elision.rs
index 4a5339399..d00def571 100644
--- a/src/test/ui/associated-type-bounds/elision.rs
+++ b/src/test/ui/associated-type-bounds/elision.rs
@@ -1,7 +1,7 @@
#![feature(associated_type_bounds)]
#![feature(anonymous_lifetime_in_impl_trait)]
-// The same thing should happen for constaints in dyn trait.
+// The same thing should happen for constraints in dyn trait.
fn f(x: &mut dyn Iterator<Item: Iterator<Item = &'_ ()>>) -> Option<&'_ ()> { x.next() }
//~^ ERROR missing lifetime specifier
//~| ERROR mismatched types
diff --git a/src/test/ui/associated-type-bounds/inside-adt.rs b/src/test/ui/associated-type-bounds/inside-adt.rs
index f26037f07..8eb8c44bb 100644
--- a/src/test/ui/associated-type-bounds/inside-adt.rs
+++ b/src/test/ui/associated-type-bounds/inside-adt.rs
@@ -16,7 +16,7 @@ enum E2 { V(Box<dyn Iterator<Item: Copy>>) }
//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
enum E3 { V(dyn Iterator<Item: 'static>) }
//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
-//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)`
+//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
union U1 { f: ManuallyDrop<dyn Iterator<Item: Copy>> }
//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
@@ -25,6 +25,6 @@ union U2 { f: ManuallyDrop<Box<dyn Iterator<Item: Copy>>> }
//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
//~^ ERROR associated type bounds are not allowed within structs, enums, or unions
-//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)`
+//~| ERROR the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
fn main() {}
diff --git a/src/test/ui/associated-type-bounds/inside-adt.stderr b/src/test/ui/associated-type-bounds/inside-adt.stderr
index 978390fa7..dbfcfa580 100644
--- a/src/test/ui/associated-type-bounds/inside-adt.stderr
+++ b/src/test/ui/associated-type-bounds/inside-adt.stderr
@@ -70,13 +70,13 @@ help: the `Box` type always has a statically known size and allocates its conten
LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) }
| ++++ +
-error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:17:13
|
LL | enum E3 { V(dyn Iterator<Item: 'static>) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
- = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)`
+ = help: the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
= note: no field of an enum variant may have a dynamically sized type
= help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
@@ -107,14 +107,14 @@ help: the `Box` type always has a statically known size and allocates its conten
LL | union U1 { f: Box<ManuallyDrop<dyn Iterator<Item: Copy>>> }
| ++++ +
-error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
+error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized + 'static> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:26:15
|
LL | union U3 { f: ManuallyDrop<dyn Iterator<Item: 'static>> }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
- = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized> + 'static)`
- = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized> + 'static)>`
+ = help: within `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`, the trait `Sized` is not implemented for `(dyn Iterator<Item = impl Sized + 'static> + 'static)`
+ = note: required because it appears within the type `ManuallyDrop<(dyn Iterator<Item = impl Sized + 'static> + 'static)>`
= note: no field of a union may have a dynamically sized type
= help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
diff --git a/src/test/ui/associated-type-bounds/issue-102335-ty.rs b/src/test/ui/associated-type-bounds/issue-102335-ty.rs
new file mode 100644
index 000000000..363df73c1
--- /dev/null
+++ b/src/test/ui/associated-type-bounds/issue-102335-ty.rs
@@ -0,0 +1,12 @@
+trait T {
+ type A: S<C<i32 = u32> = ()>;
+ //~^ ERROR associated type bindings are not allowed here
+}
+
+trait Q {}
+
+trait S {
+ type C: Q;
+}
+
+fn main() {}
diff --git a/src/test/ui/associated-type-bounds/issue-102335-ty.stderr b/src/test/ui/associated-type-bounds/issue-102335-ty.stderr
new file mode 100644
index 000000000..8777b2965
--- /dev/null
+++ b/src/test/ui/associated-type-bounds/issue-102335-ty.stderr
@@ -0,0 +1,9 @@
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-102335-ty.rs:2:17
+ |
+LL | type A: S<C<i32 = u32> = ()>;
+ | ^^^^^^^^^ associated type not allowed here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0229`.
diff --git a/src/test/ui/associated-type-bounds/issue-79949.rs b/src/test/ui/associated-type-bounds/issue-79949.rs
index 9f924f1fd..9dd37f981 100644
--- a/src/test/ui/associated-type-bounds/issue-79949.rs
+++ b/src/test/ui/associated-type-bounds/issue-79949.rs
@@ -2,7 +2,6 @@
#![allow(incomplete_features)]
#![feature(associated_type_bounds)]
-#![feature(generic_associated_types)]
trait MP {
type T<'a>;
diff --git a/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr
index b904ad102..e761c6c62 100644
--- a/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr
@@ -10,7 +10,7 @@ note: function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:25:4
|
LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
- | ^^^^ ---- ---------------
+ | ^^^^ ---------------
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:28:23
@@ -24,7 +24,7 @@ note: function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:25:4
|
LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
- | ^^^^ ---- ---------------
+ | ^^^^ ---------------
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:32:28
@@ -38,7 +38,7 @@ note: associated function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
LL | fn chip_paint(&self, c: Self::Color) { }
- | ^^^^^^^^^^ ----- --------------
+ | ^^^^^^^^^^ --------------
error[E0308]: mismatched types
--> $DIR/associated-type-projection-from-supertrait.rs:33:28
@@ -52,7 +52,7 @@ note: associated function defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8
|
LL | fn chip_paint(&self, c: Self::Color) { }
- | ^^^^^^^^^^ ----- --------------
+ | ^^^^^^^^^^ --------------
error: aborting due to 4 previous errors
diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
index 0cccc6b38..a777e064f 100644
--- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:10
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:19
|
LL | fn b() { blue_car(ModelT); }
- | ^^^^^^^^ type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
+ | -------- ^^^^^^ type mismatch resolving `<ModelT as Vehicle>::Color == Blue`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Blue`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:16:40
@@ -16,10 +18,12 @@ LL | fn blue_car<C:Car<Color=Blue>>(c: C) {
| ^^^^^^^^^^ required by this bound in `blue_car`
error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black`
- --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10
+ --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:20
|
LL | fn c() { black_car(ModelU); }
- | ^^^^^^^^^ type mismatch resolving `<ModelU as Vehicle>::Color == Black`
+ | --------- ^^^^^^ type mismatch resolving `<ModelU as Vehicle>::Color == Black`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Black`
--> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:21:40
diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr
index bed63a5e6..fbe1a1ee8 100644
--- a/src/test/ui/associated-types/associated-types-eq-3.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-3.stderr
@@ -14,10 +14,12 @@ LL | fn foo2<I: Foo<A = Bar>>(x: I) {
| +++++++++
error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
- --> $DIR/associated-types-eq-3.rs:38:5
+ --> $DIR/associated-types-eq-3.rs:38:10
|
LL | foo1(a);
- | ^^^^ type mismatch resolving `<isize as Foo>::A == Bar`
+ | ---- ^ type mismatch resolving `<isize as Foo>::A == Bar`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Bar`
--> $DIR/associated-types-eq-3.rs:12:14
diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr
index b306ae273..6cff403b3 100644
--- a/src/test/ui/associated-types/associated-types-eq-hr.stderr
+++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr
@@ -1,8 +1,8 @@
error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
- --> $DIR/associated-types-eq-hr.rs:87:5
+ --> $DIR/associated-types-eq-hr.rs:87:11
|
LL | foo::<UintStruct>();
- | ^^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
+ | ^^^^^^^^^^ type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize`
|
note: expected this to be `&isize`
--> $DIR/associated-types-eq-hr.rs:26:14
@@ -21,10 +21,10 @@ LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>,
| ^^^^^^^^^^^^^ required by this bound in `foo`
error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
- --> $DIR/associated-types-eq-hr.rs:91:5
+ --> $DIR/associated-types-eq-hr.rs:91:11
|
LL | bar::<IntStruct>();
- | ^^^^^^^^^^^^^^^^ type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
+ | ^^^^^^^^^ type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize`
|
note: expected this to be `&usize`
--> $DIR/associated-types-eq-hr.rs:14:14
diff --git a/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr b/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
index 6552c8be7..389cc7bed 100644
--- a/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
+++ b/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-for-unimpl-trait.rs:10:40
+ --> $DIR/associated-types-for-unimpl-trait.rs:10:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr
index a67cf9928..b1708b96e 100644
--- a/src/test/ui/associated-types/associated-types-issue-20346.stderr
+++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr
@@ -1,11 +1,13 @@
error[E0271]: type mismatch resolving `<Adapter<I> as Iterator>::Item == Option<T>`
- --> $DIR/associated-types-issue-20346.rs:34:5
+ --> $DIR/associated-types-issue-20346.rs:34:36
|
LL | fn test_adapter<T, I: Iterator<Item=Option<T>>>(it: I) {
| - this type parameter
...
LL | is_iterator_of::<Option<T>, _>(&adapter);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Adapter<I> as Iterator>::Item == Option<T>`
+ | ------------------------------ ^^^^^^^^ type mismatch resolving `<Adapter<I> as Iterator>::Item == Option<T>`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `Option<T>`
--> $DIR/associated-types-issue-20346.rs:23:17
diff --git a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
index 922cf88a0..89cdba524 100644
--- a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
+++ b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
- --> $DIR/associated-types-multiple-types-one-trait.rs:13:5
+ --> $DIR/associated-types-multiple-types-one-trait.rs:13:12
|
LL | want_y(t);
- | ^^^^^^ expected `i32`, found associated type
+ | ------ ^ expected `i32`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected type `i32`
found associated type `<T as Foo>::Y`
@@ -17,10 +19,12 @@ LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
| +++++++++
error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
- --> $DIR/associated-types-multiple-types-one-trait.rs:18:5
+ --> $DIR/associated-types-multiple-types-one-trait.rs:18:12
|
LL | want_x(t);
- | ^^^^^^ expected `u32`, found associated type
+ | ------ ^ expected `u32`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected type `u32`
found associated type `<T as Foo>::X`
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr b/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
index b2ee1b5e6..1feaa612e 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `T: Get` is not satisfied
- --> $DIR/associated-types-no-suitable-bound.rs:11:21
+ --> $DIR/associated-types-no-suitable-bound.rs:11:5
|
LL | fn uhoh<T>(foo: <T as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
index 2e40dbd06..cc3ed5561 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-no-suitable-supertrait-2.rs:17:40
+ --> $DIR/associated-types-no-suitable-supertrait-2.rs:17:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
index bd3ee2abd..18f2830d8 100644
--- a/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
+++ b/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr
@@ -1,14 +1,14 @@
error[E0277]: the trait bound `(T, U): Get` is not satisfied
- --> $DIR/associated-types-no-suitable-supertrait.rs:22:40
+ --> $DIR/associated-types-no-suitable-supertrait.rs:22:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-no-suitable-supertrait.rs:17:40
+ --> $DIR/associated-types-no-suitable-supertrait.rs:17:5
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.rs b/src/test/ui/associated-types/associated-types-overridden-binding-2.rs
index 109feb8e9..26b9f4b3a 100644
--- a/src/test/ui/associated-types/associated-types-overridden-binding-2.rs
+++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.rs
@@ -4,5 +4,5 @@ trait I32Iterator = Iterator<Item = i32>;
fn main() {
let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
- //~^ ERROR type mismatch
+ //~^ ERROR expected `std::vec::IntoIter<u32>` to be an iterator that yields `i32`, but it yields `u32`
}
diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr
index dbd9a44ed..2d25f68de 100644
--- a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr
+++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as Iterator>::Item == i32`
+error[E0271]: expected `std::vec::IntoIter<u32>` to be an iterator that yields `i32`, but it yields `u32`
--> $DIR/associated-types-overridden-binding-2.rs:6:43
|
LL | let _: &dyn I32Iterator<Item = u32> = &vec![42].into_iter();
diff --git a/src/test/ui/associated-types/associated-types-path-2.rs b/src/test/ui/associated-types/associated-types-path-2.rs
index c993e1d27..00066efcc 100644
--- a/src/test/ui/associated-types/associated-types-path-2.rs
+++ b/src/test/ui/associated-types/associated-types-path-2.rs
@@ -29,12 +29,14 @@ pub fn f1_uint_uint() {
f1(2u32, 4u32);
//~^ ERROR `u32: Foo` is not satisfied
//~| ERROR `u32: Foo` is not satisfied
+ //~| ERROR `u32: Foo` is not satisfied
}
pub fn f1_uint_int() {
f1(2u32, 4i32);
//~^ ERROR `u32: Foo` is not satisfied
//~| ERROR `u32: Foo` is not satisfied
+ //~| ERROR `u32: Foo` is not satisfied
}
pub fn f2_int() {
diff --git a/src/test/ui/associated-types/associated-types-path-2.stderr b/src/test/ui/associated-types/associated-types-path-2.stderr
index 1d0b84d31..206f49024 100644
--- a/src/test/ui/associated-types/associated-types-path-2.stderr
+++ b/src/test/ui/associated-types/associated-types-path-2.stderr
@@ -10,17 +10,19 @@ note: function defined here
--> $DIR/associated-types-path-2.rs:13:8
|
LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
- | ^^ ---- -------
+ | ^^ -------
help: change the type of the numeric literal from `i32` to `u32`
|
LL | f1(2i32, 4u32);
| ~~~
error[E0277]: the trait bound `u32: Foo` is not satisfied
- --> $DIR/associated-types-path-2.rs:29:5
+ --> $DIR/associated-types-path-2.rs:29:8
|
LL | f1(2u32, 4u32);
- | ^^ the trait `Foo` is not implemented for `u32`
+ | -- ^^^^ the trait `Foo` is not implemented for `u32`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Foo` is implemented for `i32`
note: required by a bound in `f1`
@@ -30,6 +32,14 @@ LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
| ^^^ required by this bound in `f1`
error[E0277]: the trait bound `u32: Foo` is not satisfied
+ --> $DIR/associated-types-path-2.rs:29:5
+ |
+LL | f1(2u32, 4u32);
+ | ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`
+ |
+ = help: the trait `Foo` is implemented for `i32`
+
+error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:29:14
|
LL | f1(2u32, 4u32);
@@ -38,7 +48,7 @@ LL | f1(2u32, 4u32);
= help: the trait `Foo` is implemented for `i32`
error[E0277]: the trait bound `u32: Foo` is not satisfied
- --> $DIR/associated-types-path-2.rs:35:8
+ --> $DIR/associated-types-path-2.rs:36:8
|
LL | f1(2u32, 4i32);
| -- ^^^^ the trait `Foo` is not implemented for `u32`
@@ -53,7 +63,15 @@ LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
| ^^^ required by this bound in `f1`
error[E0277]: the trait bound `u32: Foo` is not satisfied
- --> $DIR/associated-types-path-2.rs:35:14
+ --> $DIR/associated-types-path-2.rs:36:5
+ |
+LL | f1(2u32, 4i32);
+ | ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`
+ |
+ = help: the trait `Foo` is implemented for `i32`
+
+error[E0277]: the trait bound `u32: Foo` is not satisfied
+ --> $DIR/associated-types-path-2.rs:36:14
|
LL | f1(2u32, 4i32);
| ^^^^ the trait `Foo` is not implemented for `u32`
@@ -61,7 +79,7 @@ LL | f1(2u32, 4i32);
= help: the trait `Foo` is implemented for `i32`
error[E0308]: mismatched types
- --> $DIR/associated-types-path-2.rs:41:18
+ --> $DIR/associated-types-path-2.rs:43:18
|
LL | let _: i32 = f2(2i32);
| --- ^^^^^^^^ expected `i32`, found `u32`
@@ -73,7 +91,7 @@ help: you can convert a `u32` to an `i32` and panic if the converted value doesn
LL | let _: i32 = f2(2i32).try_into().unwrap();
| ++++++++++++++++++++
-error: aborting due to 6 previous errors
+error: aborting due to 8 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr b/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
index 2e67c2194..66d59bccd 100644
--- a/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
+++ b/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Self: Get` is not satisfied
- --> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:10:40
+ --> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:10:5
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value);
- | ^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self`
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr
index cc1560162..77841780f 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr
@@ -15,19 +15,19 @@ LL | let a = bar(f, x);
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
error: lifetime may not live long enough
- --> $DIR/project-fn-ret-invariant.rs:40:13
+ --> $DIR/project-fn-ret-invariant.rs:42:13
|
LL | fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
| -- -- lifetime `'b` defined here
| |
| lifetime `'a` defined here
-LL | let f = foo; // <-- No consistent type can be inferred for `f` here.
-LL | let a = bar(f, x);
+...
+LL | let b = bar(f, y);
| ^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
= help: consider adding the following bound: `'b: 'a`
- = note: requirement occurs because of a function pointer to `foo`
- = note: the function `foo` is invariant over the parameter `'a`
+ = note: requirement occurs because of the type `Type<'_>`, which makes the generic argument `'_` invariant
+ = note: the struct `Type<'a>` is invariant over the parameter `'a`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
help: `'a` and `'b` must be the same: replace one with the other
diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs b/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs
index 1075fd6e0..e04337913 100644
--- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs
+++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.rs
@@ -39,8 +39,8 @@ fn baz<'a, 'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) {
let f = foo; // <-- No consistent type can be inferred for `f` here.
let a = bar(f, x);
//[oneuse]~^ ERROR lifetime may not live long enough
- //[oneuse]~| ERROR lifetime may not live long enough
let b = bar(f, y);
+ //[oneuse]~^ ERROR lifetime may not live long enough
(a, b)
}
diff --git a/src/test/ui/associated-types/defaults-specialization.stderr b/src/test/ui/associated-types/defaults-specialization.stderr
index 2d61b2a64..8df326351 100644
--- a/src/test/ui/associated-types/defaults-specialization.stderr
+++ b/src/test/ui/associated-types/defaults-specialization.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(associated_type_defaults, specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0053]: method `make` has an incompatible type for trait
--> $DIR/defaults-specialization.rs:19:18
diff --git a/src/test/ui/associated-types/defaults-suitability.stderr b/src/test/ui/associated-types/defaults-suitability.stderr
index 43541c5df..eadad4cd5 100644
--- a/src/test/ui/associated-types/defaults-suitability.stderr
+++ b/src/test/ui/associated-types/defaults-suitability.stderr
@@ -39,7 +39,7 @@ error[E0277]: the trait bound `T: Clone` is not satisfied
LL | type Bar: Clone = Vec<T>;
| ^^^^^^ the trait `Clone` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `Clone` for `Vec<T>`
+ = note: required for `Vec<T>` to implement `Clone`
note: required by a bound in `Foo::Bar`
--> $DIR/defaults-suitability.rs:28:15
|
@@ -83,7 +83,7 @@ error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`
|
- = note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo2<T>>::Baz>`
+ = note: required for `Vec<<Self as Foo2<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo2::Bar`
--> $DIR/defaults-suitability.rs:65:15
|
@@ -100,7 +100,7 @@ error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
LL | type Bar: Clone = Vec<Self::Baz>;
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`
|
- = note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo25<T>>::Baz>`
+ = note: required for `Vec<<Self as Foo25<T>>::Baz>` to implement `Clone`
note: required by a bound in `Foo25::Bar`
--> $DIR/defaults-suitability.rs:74:15
|
diff --git a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr b/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr
deleted file mode 100644
index 8b2b87223..000000000
--- a/src/test/ui/associated-types/higher-ranked-projection.badbase.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0308]: mismatched types
- --> $DIR/higher-ranked-projection.rs:25:5
- |
-LL | foo(());
- | ^^^^^^^ one type is more general than the other
- |
- = note: expected reference `&'a ()`
- found reference `&()`
-note: the lifetime requirement is introduced here
- --> $DIR/higher-ranked-projection.rs:16:33
- |
-LL | where for<'a> &'a T: Mirror<Image=U>
- | ^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr b/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr
deleted file mode 100644
index 217392aa3..000000000
--- a/src/test/ui/associated-types/higher-ranked-projection.badnll.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-error: unknown debugging option: `borrowck`
-
diff --git a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
index e007f5a16..a85edd7a0 100644
--- a/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
+++ b/src/test/ui/associated-types/hr-associated-type-bound-2.stderr
@@ -5,13 +5,13 @@ LL | impl X<'_> for u32
| ^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hr_associated_type_bound_2`)
-note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
+note: required for `u32` to implement `for<'b> X<'b>`
--> $DIR/hr-associated-type-bound-2.rs:11:6
|
LL | impl X<'_> for u32
| ^^^^^ ^^^
= note: 128 redundant requirements hidden
- = note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
+ = note: required for `u32` to implement `for<'b> X<'b>`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/impl-wf-cycle-1.stderr b/src/test/ui/associated-types/impl-wf-cycle-1.stderr
index 939c9bbdb..6661347e4 100644
--- a/src/test/ui/associated-types/impl-wf-cycle-1.stderr
+++ b/src/test/ui/associated-types/impl-wf-cycle-1.stderr
@@ -4,13 +4,13 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: required because of the requirements on the impl of `Grault` for `(T,)`
+note: required for `(T,)` to implement `Grault`
--> $DIR/impl-wf-cycle-1.rs:15:17
|
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^ ^^^^
= note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `Grault` for `(T,)`
+ = note: required for `(T,)` to implement `Grault`
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/impl-wf-cycle-2.stderr b/src/test/ui/associated-types/impl-wf-cycle-2.stderr
index d02ed2cac..ec4ffe27c 100644
--- a/src/test/ui/associated-types/impl-wf-cycle-2.stderr
+++ b/src/test/ui/associated-types/impl-wf-cycle-2.stderr
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
LL | impl<T: Grault> Grault for (T,)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: required because of the requirements on the impl of `Grault` for `(T,)`
+note: required for `(T,)` to implement `Grault`
--> $DIR/impl-wf-cycle-2.rs:7:17
|
LL | impl<T: Grault> Grault for (T,)
diff --git a/src/test/ui/associated-types/issue-22560.stderr b/src/test/ui/associated-types/issue-22560.stderr
index 700923c1b..2b88cf0b4 100644
--- a/src/test/ui/associated-types/issue-22560.stderr
+++ b/src/test/ui/associated-types/issue-22560.stderr
@@ -1,25 +1,3 @@
-error[E0393]: the type parameter `Rhs` must be explicitly specified
- --> $DIR/issue-22560.rs:9:23
- |
-LL | trait Sub<Rhs=Self> {
- | ------------------- type parameter `Rhs` must be specified for this
-...
-LL | type Test = dyn Add + Sub;
- | ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
- |
- = note: because of the default `Self` reference, type parameters must be specified on object types
-
-error[E0393]: the type parameter `Rhs` must be explicitly specified
- --> $DIR/issue-22560.rs:9:17
- |
-LL | trait Add<Rhs=Self> {
- | ------------------- type parameter `Rhs` must be specified for this
-...
-LL | type Test = dyn Add + Sub;
- | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
- |
- = note: because of the default `Self` reference, type parameters must be specified on object types
-
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/issue-22560.rs:9:23
|
@@ -28,7 +6,7 @@ LL | type Test = dyn Add + Sub;
| |
| first non-auto trait
|
- = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add<[type error]> + Sub<[type error]> {}`
+ = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Add + Sub {}`
= note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits>
error[E0191]: the value of the associated types `Output` (from trait `Add`), `Output` (from trait `Sub`) must be specified
@@ -50,6 +28,28 @@ help: specify the associated types
LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
| ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
+error[E0393]: the type parameter `Rhs` must be explicitly specified
+ --> $DIR/issue-22560.rs:9:17
+ |
+LL | trait Add<Rhs=Self> {
+ | ------------------- type parameter `Rhs` must be specified for this
+...
+LL | type Test = dyn Add + Sub;
+ | ^^^ help: set the type parameter to the desired type: `Add<Rhs>`
+ |
+ = note: because of the default `Self` reference, type parameters must be specified on object types
+
+error[E0393]: the type parameter `Rhs` must be explicitly specified
+ --> $DIR/issue-22560.rs:9:23
+ |
+LL | trait Sub<Rhs=Self> {
+ | ------------------- type parameter `Rhs` must be specified for this
+...
+LL | type Test = dyn Add + Sub;
+ | ^^^ help: set the type parameter to the desired type: `Sub<Rhs>`
+ |
+ = note: because of the default `Self` reference, type parameters must be specified on object types
+
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0191, E0225, E0393.
diff --git a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
index 22daaf329..a14a273b3 100644
--- a/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
+++ b/src/test/ui/associated-types/issue-27675-unchecked-bounds.stderr
@@ -1,10 +1,8 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-27675-unchecked-bounds.rs:15:31
+ --> $DIR/issue-27675-unchecked-bounds.rs:15:12
|
LL | copy::<dyn Setup<From=T>>(t)
- | ------------------------- ^ the trait `Copy` is not implemented for `T`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `T`
|
note: required by a bound in `copy`
--> $DIR/issue-27675-unchecked-bounds.rs:10:12
diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr
index 200efbe02..9c92f19d8 100644
--- a/src/test/ui/associated-types/issue-44153.stderr
+++ b/src/test/ui/associated-types/issue-44153.stderr
@@ -9,7 +9,7 @@ note: expected this to be `&()`
|
LL | type Element = ();
| ^^
-note: required because of the requirements on the impl of `Visit` for `()`
+note: required for `()` to implement `Visit`
--> $DIR/issue-44153.rs:13:10
|
LL | impl<'a> Visit for () where
diff --git a/src/test/ui/associated-types/issue-59324.rs b/src/test/ui/associated-types/issue-59324.rs
index 162f9e00e..9e68e9e77 100644
--- a/src/test/ui/associated-types/issue-59324.rs
+++ b/src/test/ui/associated-types/issue-59324.rs
@@ -15,9 +15,9 @@ pub trait ThriftService<Bug: NotFoo>:
{
fn get_service(
//~^ ERROR the trait bound `Bug: Foo` is not satisfied
+ //~| ERROR the trait bound `Bug: Foo` is not satisfied
&self,
) -> Self::AssocType;
- //~^ the trait bound `Bug: Foo` is not satisfied
}
fn with_factory<H>(factory: dyn ThriftService<()>) {}
diff --git a/src/test/ui/associated-types/issue-59324.stderr b/src/test/ui/associated-types/issue-59324.stderr
index a84b599b5..62cf1f37a 100644
--- a/src/test/ui/associated-types/issue-59324.stderr
+++ b/src/test/ui/associated-types/issue-59324.stderr
@@ -20,7 +20,7 @@ LL | |
LL | |
LL | | Service<AssocType = <Bug as Foo>::OnlyFoo>
... |
-LL | |
+LL | | ) -> Self::AssocType;
LL | | }
| |_^ the trait `Foo` is not implemented for `Bug`
|
@@ -34,6 +34,7 @@ error[E0277]: the trait bound `Bug: Foo` is not satisfied
|
LL | / fn get_service(
LL | |
+LL | |
LL | | &self,
LL | | ) -> Self::AssocType;
| |_________________________^ the trait `Foo` is not implemented for `Bug`
@@ -44,16 +45,20 @@ LL | pub trait ThriftService<Bug: NotFoo + Foo>:
| +++++
error[E0277]: the trait bound `(): Foo` is not satisfied
- --> $DIR/issue-59324.rs:23:29
+ --> $DIR/issue-59324.rs:23:1
|
LL | fn with_factory<H>(factory: dyn ThriftService<()>) {}
- | ^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
error[E0277]: the trait bound `Bug: Foo` is not satisfied
- --> $DIR/issue-59324.rs:19:10
+ --> $DIR/issue-59324.rs:16:5
|
-LL | ) -> Self::AssocType;
- | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `Bug`
+LL | / fn get_service(
+LL | |
+LL | |
+LL | | &self,
+LL | | ) -> Self::AssocType;
+ | |_________________________^ the trait `Foo` is not implemented for `Bug`
|
help: consider further restricting this bound
|
diff --git a/src/test/ui/associated-types/issue-62200.rs b/src/test/ui/associated-types/issue-62200.rs
index 9d18690e9..499bbd6b6 100644
--- a/src/test/ui/associated-types/issue-62200.rs
+++ b/src/test/ui/associated-types/issue-62200.rs
@@ -10,6 +10,7 @@ impl T<'_> for S {
fn foo(x: impl Fn(<S as T<'_>>::A) -> <S as T<'_>>::A) {}
//~^ ERROR binding for associated type `Output` references an anonymous lifetime
-//~^^ NOTE lifetimes appearing in an associated type are not considered constrained
+//~| NOTE lifetimes appearing in an associated or opaque type are not considered constrained
+//~| NOTE consider introducing a named lifetime parameter
fn main() {}
diff --git a/src/test/ui/associated-types/issue-62200.stderr b/src/test/ui/associated-types/issue-62200.stderr
index f14cd81fd..04f0728f5 100644
--- a/src/test/ui/associated-types/issue-62200.stderr
+++ b/src/test/ui/associated-types/issue-62200.stderr
@@ -4,7 +4,8 @@ error[E0582]: binding for associated type `Output` references an anonymous lifet
LL | fn foo(x: impl Fn(<S as T<'_>>::A) -> <S as T<'_>>::A) {}
| ^^^^^^^^^^^^^^^
|
- = note: lifetimes appearing in an associated type are not considered constrained
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
error: aborting due to previous error
diff --git a/src/test/ui/associated-types/issue-65774-1.stderr b/src/test/ui/associated-types/issue-65774-1.stderr
index 419de689c..3b294d65d 100644
--- a/src/test/ui/associated-types/issue-65774-1.stderr
+++ b/src/test/ui/associated-types/issue-65774-1.stderr
@@ -18,7 +18,7 @@ LL | let closure = |config: &mut <S as MPU>::MpuConfig| writer.my_write(
| ^^^^^^^ the trait `MyDisplay` is not implemented for `T`
|
= help: the trait `MyDisplay` is implemented for `&'a mut T`
-note: required because of the requirements on the impl of `MyDisplay` for `&mut T`
+note: required for `&mut T` to implement `MyDisplay`
--> $DIR/issue-65774-1.rs:5:24
|
LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { }
diff --git a/src/test/ui/associated-types/issue-85103.rs b/src/test/ui/associated-types/issue-85103.rs
index c5e138561..9c6a419e9 100644
--- a/src/test/ui/associated-types/issue-85103.rs
+++ b/src/test/ui/associated-types/issue-85103.rs
@@ -4,6 +4,6 @@ use std::borrow::Cow;
#[rustc_layout(debug)]
type Edges<'a, E> = Cow<'a, [E]>;
-//~^ ERROR layout error: NormalizationFailure
+//~^ 6:1: 6:18: unable to determine layout for `<[E] as ToOwned>::Owned` because `<[E] as ToOwned>::Owned` cannot be normalized
fn main() {}
diff --git a/src/test/ui/associated-types/issue-85103.stderr b/src/test/ui/associated-types/issue-85103.stderr
index bddd1dce8..17f714807 100644
--- a/src/test/ui/associated-types/issue-85103.stderr
+++ b/src/test/ui/associated-types/issue-85103.stderr
@@ -1,4 +1,4 @@
-error: layout error: NormalizationFailure(<[E] as std::borrow::ToOwned>::Owned, Type(<[E] as std::borrow::ToOwned>::Owned))
+error: unable to determine layout for `<[E] as ToOwned>::Owned` because `<[E] as ToOwned>::Owned` cannot be normalized
--> $DIR/issue-85103.rs:6:1
|
LL | type Edges<'a, E> = Cow<'a, [E]>;
diff --git a/src/test/ui/associated-types/issue-87261.rs b/src/test/ui/associated-types/issue-87261.rs
index 384561f8c..e8548d402 100644
--- a/src/test/ui/associated-types/issue-87261.rs
+++ b/src/test/ui/associated-types/issue-87261.rs
@@ -77,10 +77,10 @@ where
fn main() {
accepts_trait(returns_opaque());
- //~^ ERROR type mismatch resolving `<impl Trait as Trait>::Associated == ()`
+ //~^ ERROR type mismatch resolving `<impl Trait + 'static as Trait>::Associated == ()`
accepts_trait(returns_opaque_derived());
- //~^ ERROR type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
+ //~^ ERROR type mismatch resolving `<impl DerivedTrait + 'static as Trait>::Associated == ()`
accepts_trait(returns_opaque_foo());
//~^ ERROR type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
@@ -89,7 +89,7 @@ fn main() {
//~^ ERROR type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
accepts_generic_trait(returns_opaque_generic());
- //~^ ERROR type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
+ //~^ ERROR type mismatch resolving `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated == ()`
accepts_generic_trait(returns_opaque_generic_foo());
//~^ ERROR type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
diff --git a/src/test/ui/associated-types/issue-87261.stderr b/src/test/ui/associated-types/issue-87261.stderr
index 8db4a49da..2cce6b947 100644
--- a/src/test/ui/associated-types/issue-87261.stderr
+++ b/src/test/ui/associated-types/issue-87261.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<A as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:56:5
+ --> $DIR/issue-87261.rs:56:19
|
LL | accepts_trait(a);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<A as Trait>::Associated`
@@ -17,10 +19,12 @@ LL | A: Trait<Associated = ()> + 'static,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:59:5
+ --> $DIR/issue-87261.rs:59:19
|
LL | accepts_trait(b);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<B as Trait>::Associated`
@@ -33,10 +37,12 @@ LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
error[E0271]: type mismatch resolving `<C as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:62:5
+ --> $DIR/issue-87261.rs:62:19
|
LL | accepts_trait(c);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<C as Trait>::Associated`
@@ -51,10 +57,12 @@ LL | C: Trait<Associated = ()> + Foo,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:65:5
+ --> $DIR/issue-87261.rs:65:19
|
LL | accepts_trait(d);
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<D as Trait>::Associated`
@@ -67,10 +75,12 @@ LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
error[E0271]: type mismatch resolving `<E as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:68:5
+ --> $DIR/issue-87261.rs:68:27
|
LL | accepts_generic_trait(e);
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<E as GenericTrait<()>>::Associated`
@@ -85,10 +95,12 @@ LL | E: GenericTrait<(), Associated = ()> + 'static,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:71:5
+ --> $DIR/issue-87261.rs:71:27
|
LL | accepts_generic_trait(f);
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<F as GenericTrait<()>>::Associated`
@@ -103,10 +115,12 @@ LL | F: GenericTrait<(), Associated = ()> + Foo,
| +++++++++++++++++
error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:74:5
+ --> $DIR/issue-87261.rs:74:27
|
LL | accepts_generic_trait(g);
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<G as GenericTrait<()>>::Associated`
@@ -118,56 +132,62 @@ note: required by a bound in `accepts_generic_trait`
LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
-error[E0271]: type mismatch resolving `<impl Trait as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:79:5
+error[E0271]: type mismatch resolving `<impl Trait + 'static as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:79:19
|
LL | fn returns_opaque() -> impl Trait + 'static {
| -------------------- the found opaque type
...
LL | accepts_trait(returns_opaque());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
- found associated type `<impl Trait as Trait>::Associated`
+ found associated type `<impl Trait + 'static as Trait>::Associated`
note: required by a bound in `accepts_trait`
--> $DIR/issue-87261.rs:43:27
|
LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
-help: consider constraining the associated type `<impl Trait as Trait>::Associated` to `()`
+help: consider constraining the associated type `<impl Trait + 'static as Trait>::Associated` to `()`
|
LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
| +++++++++++++++++
-error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:82:5
+error[E0271]: type mismatch resolving `<impl DerivedTrait + 'static as Trait>::Associated == ()`
+ --> $DIR/issue-87261.rs:82:19
|
LL | fn returns_opaque_derived() -> impl DerivedTrait + 'static {
| --------------------------- the found opaque type
...
LL | accepts_trait(returns_opaque_derived());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
- found associated type `<impl DerivedTrait as Trait>::Associated`
+ found associated type `<impl DerivedTrait + 'static as Trait>::Associated`
note: required by a bound in `accepts_trait`
--> $DIR/issue-87261.rs:43:27
|
LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
-help: consider constraining the associated type `<impl DerivedTrait as Trait>::Associated` to `()`
+help: consider constraining the associated type `<impl DerivedTrait + 'static as Trait>::Associated` to `()`
|
LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl Trait + Foo as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:85:5
+ --> $DIR/issue-87261.rs:85:19
|
LL | fn returns_opaque_foo() -> impl Trait + Foo {
| ---------------- the found opaque type
...
LL | accepts_trait(returns_opaque_foo());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl Trait + Foo as Trait>::Associated`
@@ -182,13 +202,15 @@ LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl DerivedTrait + Foo as Trait>::Associated == ()`
- --> $DIR/issue-87261.rs:88:5
+ --> $DIR/issue-87261.rs:88:19
|
LL | fn returns_opaque_derived_foo() -> impl DerivedTrait + Foo {
| ----------------------- the found opaque type
...
LL | accepts_trait(returns_opaque_derived_foo());
- | ^^^^^^^^^^^^^ expected `()`, found associated type
+ | ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl DerivedTrait + Foo as Trait>::Associated`
@@ -200,35 +222,39 @@ note: required by a bound in `accepts_trait`
LL | fn accepts_trait<T: Trait<Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_trait`
-error[E0271]: type mismatch resolving `<impl GenericTrait<()> as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:91:5
+error[E0271]: type mismatch resolving `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated == ()`
+ --> $DIR/issue-87261.rs:91:27
|
LL | fn returns_opaque_generic() -> impl GenericTrait<()> + 'static {
| ------------------------------- the found opaque type
...
LL | accepts_generic_trait(returns_opaque_generic());
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
- found associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated`
+ found associated type `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated`
note: required by a bound in `accepts_generic_trait`
--> $DIR/issue-87261.rs:44:46
|
LL | fn accepts_generic_trait<T: GenericTrait<(), Associated = ()>>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `accepts_generic_trait`
-help: consider constraining the associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` to `()`
+help: consider constraining the associated type `<impl GenericTrait<()> + 'static as GenericTrait<()>>::Associated` to `()`
|
LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:94:5
+ --> $DIR/issue-87261.rs:94:27
|
LL | fn returns_opaque_generic_foo() -> impl GenericTrait<()> + Foo {
| --------------------------- the found opaque type
...
LL | accepts_generic_trait(returns_opaque_generic_foo());
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl GenericTrait<()> + Foo as GenericTrait<()>>::Associated`
@@ -243,13 +269,15 @@ LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> +
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
- --> $DIR/issue-87261.rs:97:5
+ --> $DIR/issue-87261.rs:97:27
|
LL | fn returns_opaque_generic_duplicate() -> impl GenericTrait<()> + GenericTrait<u8> {
| ---------------------------------------- the found opaque type
...
LL | accepts_generic_trait(returns_opaque_generic_duplicate());
- | ^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | --------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | |
+ | required by a bound introduced by this call
|
= note: expected unit type `()`
found associated type `<impl GenericTrait<()> + GenericTrait<u8> as GenericTrait<()>>::Associated`
diff --git a/src/test/ui/associated-types/substs-ppaux.normal.stderr b/src/test/ui/associated-types/substs-ppaux.normal.stderr
index 085c56870..3f180cf4f 100644
--- a/src/test/ui/associated-types/substs-ppaux.normal.stderr
+++ b/src/test/ui/associated-types/substs-ppaux.normal.stderr
@@ -11,7 +11,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
| ++
@@ -29,7 +29,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
| ++
@@ -47,7 +47,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
| ++
@@ -77,7 +77,7 @@ LL | <str as Foo<u8>>::bar;
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
-note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str`
+note: required for `str` to implement `Foo<'_, '_, u8>`
--> $DIR/substs-ppaux.rs:11:17
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
diff --git a/src/test/ui/associated-types/substs-ppaux.verbose.stderr b/src/test/ui/associated-types/substs-ppaux.verbose.stderr
index b831f3b7a..16dd29de2 100644
--- a/src/test/ui/associated-types/substs-ppaux.verbose.stderr
+++ b/src/test/ui/associated-types/substs-ppaux.verbose.stderr
@@ -11,7 +11,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
| ++
@@ -29,7 +29,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic>>::bar::<ReStatic, char>}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
| ++
@@ -47,7 +47,7 @@ LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
|
= note: expected unit type `()`
found fn item `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
| ++
@@ -77,7 +77,7 @@ LL | <str as Foo<u8>>::bar;
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
-note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str`
+note: required for `str` to implement `Foo<'_#0r, '_#1r, u8>`
--> $DIR/substs-ppaux.rs:11:17
|
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}
diff --git a/src/test/ui/async-await/async-await-let-else.drop-tracking.stderr b/src/test/ui/async-await/async-await-let-else.drop-tracking.stderr
new file mode 100644
index 000000000..3be7f370d
--- /dev/null
+++ b/src/test/ui/async-await/async-await-let-else.drop-tracking.stderr
@@ -0,0 +1,110 @@
+error: future cannot be sent between threads safely
+ --> $DIR/async-await-let-else.rs:48:13
+ |
+LL | is_send(foo(Some(true)));
+ | ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
+ |
+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
+note: future is not `Send` as this value is used across an await
+ --> $DIR/async-await-let-else.rs:11:14
+ |
+LL | let r = Rc::new(());
+ | - has type `Rc<()>` which is not `Send`
+LL | bar().await
+ | ^^^^^^ await occurs here, with `r` maybe used later
+LL | };
+ | - `r` is later dropped here
+note: required by a bound in `is_send`
+ --> $DIR/async-await-let-else.rs:19:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
+
+error[E0277]: `Rc<()>` cannot be sent between threads safely
+ --> $DIR/async-await-let-else.rs:50:13
+ |
+LL | async fn foo2(x: Option<bool>) {
+ | - within this `impl Future<Output = ()>`
+...
+LL | is_send(foo2(Some(true)));
+ | ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
+note: required because it's used within this `async fn` body
+ --> $DIR/async-await-let-else.rs:27:29
+ |
+LL | async fn bar2<T>(_: T) -> ! {
+ | _____________________________^
+LL | | panic!()
+LL | | }
+ | |_^
+ = note: required because it captures the following types: `ResumeTy`, `Option<bool>`, `impl Future<Output = !>`, `()`
+note: required because it's used within this `async fn` body
+ --> $DIR/async-await-let-else.rs:21:32
+ |
+LL | async fn foo2(x: Option<bool>) {
+ | ________________________________^
+LL | | let Some(_) = x else {
+LL | | bar2(Rc::new(())).await
+LL | | };
+LL | | }
+ | |_^
+note: required by a bound in `is_send`
+ --> $DIR/async-await-let-else.rs:19:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: future cannot be sent between threads safely
+ --> $DIR/async-await-let-else.rs:52:13
+ |
+LL | is_send(foo3(Some(true)));
+ | ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
+ |
+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
+note: future is not `Send` as this value is used across an await
+ --> $DIR/async-await-let-else.rs:33:28
+ |
+LL | (Rc::new(()), bar().await);
+ | ----------- ^^^^^^ await occurs here, with `Rc::new(())` maybe used later
+ | |
+ | has type `Rc<()>` which is not `Send`
+note: `Rc::new(())` is later dropped here
+ --> $DIR/async-await-let-else.rs:33:35
+ |
+LL | (Rc::new(()), bar().await);
+ | ^
+note: required by a bound in `is_send`
+ --> $DIR/async-await-let-else.rs:19:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: future cannot be sent between threads safely
+ --> $DIR/async-await-let-else.rs:54:13
+ |
+LL | is_send(foo4(Some(true)));
+ | ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
+ |
+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
+note: future is not `Send` as this value is used across an await
+ --> $DIR/async-await-let-else.rs:41:14
+ |
+LL | let r = Rc::new(());
+ | - has type `Rc<()>` which is not `Send`
+LL | bar().await;
+ | ^^^^^^ await occurs here, with `r` maybe used later
+...
+LL | };
+ | - `r` is later dropped here
+note: required by a bound in `is_send`
+ --> $DIR/async-await-let-else.rs:19:15
+ |
+LL | fn is_send<T: Send>(_: T) {}
+ | ^^^^ required by this bound in `is_send`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/async-await/async-await-let-else.stderr b/src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr
index 4d23e27c4..7f93563e2 100644
--- a/src/test/ui/async-await/async-await-let-else.stderr
+++ b/src/test/ui/async-await/async-await-let-else.no-drop-tracking.stderr
@@ -1,12 +1,12 @@
error: future cannot be sent between threads safely
- --> $DIR/async-await-let-else.rs:45:13
+ --> $DIR/async-await-let-else.rs:48:13
|
LL | is_send(foo(Some(true)));
| ^^^^^^^^^^^^^^^ future returned by `foo` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
- --> $DIR/async-await-let-else.rs:8:14
+ --> $DIR/async-await-let-else.rs:11:14
|
LL | let r = Rc::new(());
| - has type `Rc<()>` which is not `Send`
@@ -15,67 +15,67 @@ LL | bar().await
LL | };
| - `r` is later dropped here
note: required by a bound in `is_send`
- --> $DIR/async-await-let-else.rs:16:15
+ --> $DIR/async-await-let-else.rs:19:15
|
LL | fn is_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `is_send`
error: future cannot be sent between threads safely
- --> $DIR/async-await-let-else.rs:47:13
+ --> $DIR/async-await-let-else.rs:50:13
|
LL | is_send(foo2(Some(true)));
| ^^^^^^^^^^^^^^^^ future returned by `foo2` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
- --> $DIR/async-await-let-else.rs:20:26
+ --> $DIR/async-await-let-else.rs:23:26
|
LL | bar2(Rc::new(())).await
| ----------- ^^^^^^ await occurs here, with `Rc::new(())` maybe used later
| |
| has type `Rc<()>` which is not `Send`
LL | };
- | - `Rc::new(())` is later dropped here
+ | - `Rc::new(())` is later dropped here
note: required by a bound in `is_send`
- --> $DIR/async-await-let-else.rs:16:15
+ --> $DIR/async-await-let-else.rs:19:15
|
LL | fn is_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `is_send`
error: future cannot be sent between threads safely
- --> $DIR/async-await-let-else.rs:49:13
+ --> $DIR/async-await-let-else.rs:52:13
|
LL | is_send(foo3(Some(true)));
| ^^^^^^^^^^^^^^^^ future returned by `foo3` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
- --> $DIR/async-await-let-else.rs:30:28
+ --> $DIR/async-await-let-else.rs:33:28
|
LL | (Rc::new(()), bar().await);
| ----------- ^^^^^^ await occurs here, with `Rc::new(())` maybe used later
| |
| has type `Rc<()>` which is not `Send`
note: `Rc::new(())` is later dropped here
- --> $DIR/async-await-let-else.rs:30:35
+ --> $DIR/async-await-let-else.rs:33:35
|
LL | (Rc::new(()), bar().await);
| ^
note: required by a bound in `is_send`
- --> $DIR/async-await-let-else.rs:16:15
+ --> $DIR/async-await-let-else.rs:19:15
|
LL | fn is_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `is_send`
error: future cannot be sent between threads safely
- --> $DIR/async-await-let-else.rs:51:13
+ --> $DIR/async-await-let-else.rs:54:13
|
LL | is_send(foo4(Some(true)));
| ^^^^^^^^^^^^^^^^ future returned by `foo4` is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
- --> $DIR/async-await-let-else.rs:38:14
+ --> $DIR/async-await-let-else.rs:41:14
|
LL | let r = Rc::new(());
| - has type `Rc<()>` which is not `Send`
@@ -85,7 +85,7 @@ LL | bar().await;
LL | };
| - `r` is later dropped here
note: required by a bound in `is_send`
- --> $DIR/async-await-let-else.rs:16:15
+ --> $DIR/async-await-let-else.rs:19:15
|
LL | fn is_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `is_send`
diff --git a/src/test/ui/async-await/async-await-let-else.rs b/src/test/ui/async-await/async-await-let-else.rs
index 7ea07ae9a..3fb2142b9 100644
--- a/src/test/ui/async-await/async-await-let-else.rs
+++ b/src/test/ui/async-await/async-await-let-else.rs
@@ -1,5 +1,8 @@
// edition:2021
-#![feature(let_else)]
+// revisions: drop-tracking no-drop-tracking
+// [drop-tracking] compile-flags: -Zdrop-tracking=yes
+// [no-drop-tracking] compile-flags: -Zdrop-tracking=no
+
use std::rc::Rc;
async fn foo(x: Option<bool>) {
@@ -43,11 +46,11 @@ async fn foo4(x: Option<bool>) {
fn main() {
is_send(foo(Some(true)));
- //~^ ERROR future cannot be sent between threads safely
+ //~^ ERROR cannot be sent between threads safely
is_send(foo2(Some(true)));
- //~^ ERROR future cannot be sent between threads safely
+ //~^ ERROR cannot be sent between threads safely
is_send(foo3(Some(true)));
- //~^ ERROR future cannot be sent between threads safely
+ //~^ ERROR cannot be sent between threads safely
is_send(foo4(Some(true)));
- //~^ ERROR future cannot be sent between threads safely
+ //~^ ERROR cannot be sent between threads safely
}
diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.rs b/src/test/ui/async-await/async-block-control-flow-static-semantics.rs
index b831d6102..446212ca7 100644
--- a/src/test/ui/async-await/async-block-control-flow-static-semantics.rs
+++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.rs
@@ -15,7 +15,7 @@ fn return_targets_async_block_not_fn() -> u8 {
return 0u8;
};
let _: &dyn Future<Output = ()> = &block;
- //~^ ERROR type mismatch
+ //~^ ERROR expected `impl Future<Output = u8>` to be a future that resolves to `()`, but it resolves to `u8`
}
async fn return_targets_async_block_not_async_fn() -> u8 {
@@ -24,7 +24,7 @@ async fn return_targets_async_block_not_async_fn() -> u8 {
return 0u8;
};
let _: &dyn Future<Output = ()> = &block;
- //~^ ERROR type mismatch resolving `<impl Future<Output = u8> as Future>::Output == ()`
+ //~^ ERROR expected `impl Future<Output = u8>` to be a future that resolves to `()`, but it resolves to `u8`
}
fn no_break_in_async_block() {
@@ -42,7 +42,9 @@ fn no_break_in_async_block_even_with_outer_loop() {
}
struct MyErr;
-fn err() -> Result<u8, MyErr> { Err(MyErr) }
+fn err() -> Result<u8, MyErr> {
+ Err(MyErr)
+}
fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
//~^ ERROR mismatched types
diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr
index e58876896..2a08d5d6c 100644
--- a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr
+++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr
@@ -31,7 +31,7 @@ LL | |
LL | | }
| |_^ expected `u8`, found `()`
-error[E0271]: type mismatch resolving `<impl Future<Output = u8> as Future>::Output == ()`
+error[E0271]: expected `impl Future<Output = u8>` to be a future that resolves to `()`, but it resolves to `u8`
--> $DIR/async-block-control-flow-static-semantics.rs:26:39
|
LL | let _: &dyn Future<Output = ()> = &block;
@@ -47,7 +47,7 @@ LL | fn return_targets_async_block_not_fn() -> u8 {
| |
| implicitly returns `()` as its body has no tail or `return` expression
-error[E0271]: type mismatch resolving `<impl Future<Output = u8> as Future>::Output == ()`
+error[E0271]: expected `impl Future<Output = u8>` to be a future that resolves to `()`, but it resolves to `u8`
--> $DIR/async-block-control-flow-static-semantics.rs:17:39
|
LL | let _: &dyn Future<Output = ()> = &block;
@@ -56,7 +56,7 @@ LL | let _: &dyn Future<Output = ()> = &block;
= note: required for the cast from `impl Future<Output = u8>` to the object type `dyn Future<Output = ()>`
error[E0308]: mismatched types
- --> $DIR/async-block-control-flow-static-semantics.rs:47:44
+ --> $DIR/async-block-control-flow-static-semantics.rs:49:44
|
LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
| ---------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
@@ -67,7 +67,7 @@ LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
found unit type `()`
error[E0308]: mismatched types
- --> $DIR/async-block-control-flow-static-semantics.rs:56:50
+ --> $DIR/async-block-control-flow-static-semantics.rs:58:50
|
LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
| ---------------------------------------- ^^^^^^^^^^^^^^^^^ expected enum `Result`, found `()`
diff --git a/src/test/ui/async-await/async-fn-nonsend.stderr b/src/test/ui/async-await/async-fn-nonsend.stderr
index 40ad46b48..a7b872fe4 100644
--- a/src/test/ui/async-await/async-fn-nonsend.stderr
+++ b/src/test/ui/async-await/async-fn-nonsend.stderr
@@ -27,7 +27,7 @@ error: future cannot be sent between threads safely
LL | assert_send(non_sync_with_method_call());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
|
- = help: the trait `Send` is not implemented for `dyn std::fmt::Write`
+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
note: future is not `Send` as this value is used across an await
--> $DIR/async-fn-nonsend.rs:46:14
|
diff --git a/src/test/ui/async-await/async-fn-size-moved-locals.rs b/src/test/ui/async-await/async-fn-size-moved-locals.rs
index 155662566..79b7239f3 100644
--- a/src/test/ui/async-await/async-fn-size-moved-locals.rs
+++ b/src/test/ui/async-await/async-fn-size-moved-locals.rs
@@ -7,7 +7,7 @@
//
// See issue #59123 for a full explanation.
-// ignore-emscripten (sizes don't match)
+// needs-unwind Size of Futures change on panic=abort
// run-pass
// edition:2018
diff --git a/src/test/ui/async-await/async-fn-size-uninit-locals.rs b/src/test/ui/async-await/async-fn-size-uninit-locals.rs
index 31a086ba9..546172693 100644
--- a/src/test/ui/async-await/async-fn-size-uninit-locals.rs
+++ b/src/test/ui/async-await/async-fn-size-uninit-locals.rs
@@ -5,6 +5,7 @@
// being reflected in the size.
// ignore-emscripten (sizes don't match)
+// needs-unwind Size of Futures change on panic=abort
// run-pass
// edition:2018
@@ -67,9 +68,7 @@ async fn joined() {
let c = Big::new();
fut().await;
- noop();
joiner = Joiner { a: Some(a), b: Some(b), c: Some(c) };
- noop();
}
async fn joined_with_noop() {
@@ -97,7 +96,7 @@ async fn join_retval() -> Joiner {
fn main() {
assert_eq!(2, std::mem::size_of_val(&single()));
assert_eq!(3, std::mem::size_of_val(&single_with_noop()));
- assert_eq!(3078, std::mem::size_of_val(&joined()));
+ assert_eq!(3074, std::mem::size_of_val(&joined()));
assert_eq!(3078, std::mem::size_of_val(&joined_with_noop()));
assert_eq!(3074, std::mem::size_of_val(&join_retval()));
}
diff --git a/src/test/ui/async-await/async-trait-fn.stderr b/src/test/ui/async-await/async-trait-fn.stderr
index 1eb8969a8..afbe25cf7 100644
--- a/src/test/ui/async-await/async-trait-fn.stderr
+++ b/src/test/ui/async-await/async-trait-fn.stderr
@@ -2,39 +2,40 @@ error[E0706]: functions in traits cannot be declared `async`
--> $DIR/async-trait-fn.rs:3: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:4: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:5:5
|
-LL | async fn baz() {
- | ^----
- | |
- | _____`async` because of this
- | |
-LL | | // Nested item must not ICE.
-LL | | fn a() {}
-LL | | }
- | |_____^
+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
diff --git a/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr
index 50a82c08c..d99967eb2 100644
--- a/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr
+++ b/src/test/ui/async-await/await-keyword/2015-edition-error-various-positions.stderr
@@ -4,13 +4,13 @@ error: `await` is a keyword in the 2018 edition
LL | pub mod await {
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/2015-edition-error-various-positions.rs:2:9
|
LL | #![deny(keyword_idents)]
| ^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
error: `await` is a keyword in the 2018 edition
--> $DIR/2015-edition-error-various-positions.rs:7:20
diff --git a/src/test/ui/async-await/await-keyword/2015-edition-warning.stderr b/src/test/ui/async-await/await-keyword/2015-edition-warning.stderr
index 1c4c19ea4..bf5c4d8d6 100644
--- a/src/test/ui/async-await/await-keyword/2015-edition-warning.stderr
+++ b/src/test/ui/async-await/await-keyword/2015-edition-warning.stderr
@@ -4,13 +4,13 @@ error: `await` is a keyword in the 2018 edition
LL | pub mod await {
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#await`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/2015-edition-warning.rs:4:9
|
LL | #![deny(keyword_idents)]
| ^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
error: `await` is a keyword in the 2018 edition
--> $DIR/2015-edition-warning.rs:10:20
diff --git a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
index ccbaa1f2a..6bd8f671d 100644
--- a/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
+++ b/src/test/ui/async-await/await-keyword/2018-edition-error-in-non-macro-position.stderr
@@ -46,7 +46,9 @@ error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
|
LL | struct Foo { await: () }
- | ^^^^^ expected identifier, found keyword
+ | --- ^^^^^ expected identifier, found keyword
+ | |
+ | while parsing this struct
|
help: escape `await` to use it as an identifier
|
diff --git a/src/test/ui/async-await/edition-deny-async-fns-2015.rs b/src/test/ui/async-await/edition-deny-async-fns-2015.rs
index e5dc9c8a5..6bd6d879a 100644
--- a/src/test/ui/async-await/edition-deny-async-fns-2015.rs
+++ b/src/test/ui/async-await/edition-deny-async-fns-2015.rs
@@ -16,7 +16,7 @@ impl Foo {
trait Bar {
async fn foo() {} //~ ERROR `async fn` is not permitted in Rust 2015
- //~^ ERROR functions in traits cannot be declared `async`
+ //~^ ERROR functions in traits cannot be declared `async`
}
fn main() {
diff --git a/src/test/ui/async-await/edition-deny-async-fns-2015.stderr b/src/test/ui/async-await/edition-deny-async-fns-2015.stderr
index 35f9c581c..ba918eb28 100644
--- a/src/test/ui/async-await/edition-deny-async-fns-2015.stderr
+++ b/src/test/ui/async-await/edition-deny-async-fns-2015.stderr
@@ -83,12 +83,14 @@ error[E0706]: functions in traits cannot be declared `async`
--> $DIR/edition-deny-async-fns-2015.rs:18: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
diff --git a/src/test/ui/async-await/feature-gate-async_fn_in_trait.rs b/src/test/ui/async-await/feature-gate-async_fn_in_trait.rs
new file mode 100644
index 000000000..792f378cb
--- /dev/null
+++ b/src/test/ui/async-await/feature-gate-async_fn_in_trait.rs
@@ -0,0 +1,25 @@
+// edition:2021
+
+// RPITIT is not enough to allow use of async functions
+#![allow(incomplete_features)]
+#![feature(return_position_impl_trait_in_trait)]
+
+trait T {
+ async fn foo(); //~ ERROR functions in traits cannot be declared `async`
+}
+
+// Both return_position_impl_trait_in_trait and async_fn_in_trait are required for this (see also
+// feature-gate-return_position_impl_trait_in_trait.rs)
+trait T2 {
+ async fn foo() -> impl Sized; //~ ERROR functions in traits cannot be declared `async`
+}
+
+trait T3 {
+ fn foo() -> impl std::future::Future<Output = ()>;
+}
+
+impl T3 for () {
+ async fn foo() {} //~ ERROR functions in traits cannot be declared `async`
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr b/src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr
new file mode 100644
index 000000000..2a5fbd1ec
--- /dev/null
+++ b/src/test/ui/async-await/feature-gate-async_fn_in_trait.stderr
@@ -0,0 +1,42 @@
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/feature-gate-async_fn_in_trait.rs:8: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/feature-gate-async_fn_in_trait.rs:14:5
+ |
+LL | async fn foo() -> impl Sized;
+ | -----^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | `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/feature-gate-async_fn_in_trait.rs:22: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 3 previous errors
+
+For more information about this error, try `rustc --explain E0706`.
diff --git a/src/test/ui/async-await/generator-desc.stderr b/src/test/ui/async-await/generator-desc.stderr
index 3be8c5520..2494c3feb 100644
--- a/src/test/ui/async-await/generator-desc.stderr
+++ b/src/test/ui/async-await/generator-desc.stderr
@@ -42,7 +42,7 @@ note: function defined here
--> $DIR/generator-desc.rs:8:4
|
LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
- | ^^^ ----- -----
+ | ^^^ -----
error[E0308]: mismatched types
--> $DIR/generator-desc.rs:14:26
@@ -67,7 +67,7 @@ note: function defined here
--> $DIR/generator-desc.rs:8:4
|
LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
- | ^^^ ----- -----
+ | ^^^ -----
error: aborting due to 3 previous errors
diff --git a/src/test/ui/async-await/in-trait/async-associated-types.rs b/src/test/ui/async-await/in-trait/async-associated-types.rs
new file mode 100644
index 000000000..a6f928f3b
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-associated-types.rs
@@ -0,0 +1,24 @@
+// check-fail
+// known-bug: #102682
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+trait MyTrait<'a, 'b, T> where Self: 'a, T: Debug + Sized + 'b {
+ type MyAssoc;
+
+ async fn foo(&'a self, key: &'b T) -> Self::MyAssoc;
+}
+
+impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
+ type MyAssoc = (&'a U, &'b T);
+
+ async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ (self, key)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-associated-types.stderr b/src/test/ui/async-await/in-trait/async-associated-types.stderr
new file mode 100644
index 000000000..0985150ee
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-associated-types.stderr
@@ -0,0 +1,57 @@
+error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
+ --> $DIR/async-associated-types.rs:19:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ | ^^^^^^^^^^^^^^
+ |
+note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
+ --> $DIR/async-associated-types.rs:16:6
+ |
+LL | impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
+ | ^^
+note: ...so that the types are compatible
+ --> $DIR/async-associated-types.rs:19:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ | ^^^^^^^^^^^^^^
+ = note: expected `(&'a U, &'b T)`
+ found `(&U, &T)`
+ = note: but, the lifetime must be valid for the static lifetime...
+note: ...so that the types are compatible
+ --> $DIR/async-associated-types.rs:19:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ | ^^^^^^^^^^^^^^
+ = note: expected `MyTrait<'static, 'static, T>`
+ found `MyTrait<'_, '_, T>`
+
+error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements
+ --> $DIR/async-associated-types.rs:19:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ | ^^^^^^^^^^^^^^
+ |
+note: first, the lifetime cannot outlive the lifetime `'b` as defined here...
+ --> $DIR/async-associated-types.rs:16:10
+ |
+LL | impl<'a, 'b, T: Debug + Sized + 'b, U: 'a> MyTrait<'a, 'b, T> for U {
+ | ^^
+note: ...so that the types are compatible
+ --> $DIR/async-associated-types.rs:19:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ | ^^^^^^^^^^^^^^
+ = note: expected `(&'a U, &'b T)`
+ found `(&U, &T)`
+ = note: but, the lifetime must be valid for the static lifetime...
+note: ...so that the types are compatible
+ --> $DIR/async-associated-types.rs:19:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ | ^^^^^^^^^^^^^^
+ = note: expected `MyTrait<'static, 'static, T>`
+ found `MyTrait<'_, '_, T>`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0495`.
diff --git a/src/test/ui/async-await/in-trait/async-associated-types2.rs b/src/test/ui/async-await/in-trait/async-associated-types2.rs
new file mode 100644
index 000000000..e546a0579
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-associated-types2.rs
@@ -0,0 +1,30 @@
+// check-pass
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![feature(type_alias_impl_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+
+trait MyTrait {
+ type Fut<'a>: Future<Output = i32>
+ where
+ Self: 'a;
+
+ fn foo<'a>(&'a self) -> Self::Fut<'a>;
+}
+
+impl MyTrait for i32 {
+ type Fut<'a> = impl Future<Output = i32> + 'a
+ where
+ Self: 'a;
+
+ fn foo<'a>(&'a self) -> Self::Fut<'a> {
+ async {
+ *self
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs b/src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs
new file mode 100644
index 000000000..38ba29718
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.rs
@@ -0,0 +1,21 @@
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+use std::pin::Pin;
+
+trait MyTrait {
+ fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
+}
+
+impl MyTrait for i32 {
+ async fn foo(&self) -> i32 {
+ //~^ ERROR method `foo` has an incompatible type for trait
+ *self
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr b/src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
new file mode 100644
index 000000000..22d2928f2
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
@@ -0,0 +1,17 @@
+error[E0053]: method `foo` has an incompatible type for trait
+ --> $DIR/async-example-desugared-boxed-in-trait.rs:15:28
+ |
+LL | async fn foo(&self) -> i32 {
+ | ^^^ expected struct `Pin`, found opaque type
+ |
+note: type in trait
+ --> $DIR/async-example-desugared-boxed-in-trait.rs:11:22
+ |
+LL | fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: expected fn pointer `fn(&i32) -> Pin<Box<dyn Future<Output = i32>>>`
+ found fn pointer `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/src/test/ui/async-await/in-trait/async-example-desugared-boxed.rs b/src/test/ui/async-await/in-trait/async-example-desugared-boxed.rs
new file mode 100644
index 000000000..61d7e2520
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-example-desugared-boxed.rs
@@ -0,0 +1,24 @@
+// check-pass
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+use std::pin::Pin;
+
+trait MyTrait {
+ async fn foo(&self) -> i32;
+}
+
+impl MyTrait for i32 {
+ // This will break once a PR that implements #102745 is merged
+ fn foo(&self) -> Pin<Box<dyn Future<Output = i32> + '_>> {
+ Box::pin(async {
+ *self
+ })
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-example-desugared-in-trait.rs b/src/test/ui/async-await/in-trait/async-example-desugared-in-trait.rs
new file mode 100644
index 000000000..feeda719e
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-example-desugared-in-trait.rs
@@ -0,0 +1,21 @@
+// check-pass
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+
+trait MyTrait {
+ fn foo(&self) -> impl Future<Output = i32> + '_;
+}
+
+impl MyTrait for i32 {
+ // This will break once a PR that implements #102745 is merged
+ async fn foo(&self) -> i32 {
+ *self
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-example-desugared.rs b/src/test/ui/async-await/in-trait/async-example-desugared.rs
new file mode 100644
index 000000000..1313c9edd
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-example-desugared.rs
@@ -0,0 +1,23 @@
+// check-pass
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+
+trait MyTrait {
+ async fn foo(&self) -> i32;
+}
+
+impl MyTrait for i32 {
+ // This will break once a PR that implements #102745 is merged
+ fn foo(&self) -> impl Future<Output = i32> + '_ {
+ async {
+ *self
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-example.rs b/src/test/ui/async-await/in-trait/async-example.rs
new file mode 100644
index 000000000..abf94ef74
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-example.rs
@@ -0,0 +1,32 @@
+// check-pass
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait MyTrait {
+ async fn foo(&self) -> i32;
+ async fn bar(&self) -> i32;
+}
+
+impl MyTrait for i32 {
+ async fn foo(&self) -> i32 {
+ *self
+ }
+
+ async fn bar(&self) -> i32 {
+ self.foo().await
+ }
+}
+
+fn main() {
+ let x = 5;
+ // Calling from non-async context
+ let _ = x.foo();
+ let _ = x.bar();
+ // Calling from async block in non-async context
+ async {
+ let _: i32 = x.foo().await;
+ let _: i32 = x.bar().await;
+ };
+}
diff --git a/src/test/ui/async-await/in-trait/async-generics-and-bounds.rs b/src/test/ui/async-await/in-trait/async-generics-and-bounds.rs
new file mode 100644
index 000000000..a73d55adf
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-generics-and-bounds.rs
@@ -0,0 +1,21 @@
+// check-fail
+// known-bug: #102682
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+use std::hash::Hash;
+
+trait MyTrait<T, U> {
+ async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
+}
+
+impl<T, U> MyTrait<T, U> for (T, U) {
+ async fn foo(&self) -> &(T, U) {
+ self
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-generics-and-bounds.stderr b/src/test/ui/async-await/in-trait/async-generics-and-bounds.stderr
new file mode 100644
index 000000000..5c8d64fc6
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-generics-and-bounds.stderr
@@ -0,0 +1,37 @@
+error[E0311]: the parameter type `U` may not live long enough
+ --> $DIR/async-generics-and-bounds.rs:12: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 as defined here...
+ --> $DIR/async-generics-and-bounds.rs:12: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
+ |
+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
+ |
+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 as defined here...
+ --> $DIR/async-generics-and-bounds.rs:12: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
+ |
+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/src/test/ui/async-await/in-trait/async-generics.rs b/src/test/ui/async-await/in-trait/async-generics.rs
new file mode 100644
index 000000000..67000e577
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-generics.rs
@@ -0,0 +1,18 @@
+// check-fail
+// known-bug: #102682
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait MyTrait<T, U> {
+ async fn foo(&self) -> &(T, U);
+}
+
+impl<T, U> MyTrait<T, U> for (T, U) {
+ async fn foo(&self) -> &(T, U) {
+ self
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-generics.stderr b/src/test/ui/async-await/in-trait/async-generics.stderr
new file mode 100644
index 000000000..6ae73d9e3
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-generics.stderr
@@ -0,0 +1,37 @@
+error[E0311]: the parameter type `U` may not live long enough
+ --> $DIR/async-generics.rs:9:28
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^^^
+ |
+note: the parameter type `U` must be valid for the anonymous lifetime as defined here...
+ --> $DIR/async-generics.rs:9: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
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^^^
+
+error[E0311]: the parameter type `T` may not live long enough
+ --> $DIR/async-generics.rs:9:28
+ |
+LL | async fn foo(&self) -> &(T, U);
+ | ^^^^^^^
+ |
+note: the parameter type `T` must be valid for the anonymous lifetime as defined here...
+ --> $DIR/async-generics.rs:9: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
+ |
+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/src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.rs b/src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.rs
new file mode 100644
index 000000000..3f7448cec
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.rs
@@ -0,0 +1,20 @@
+// check-fail
+// known-bug: #102682
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+trait MyTrait<'a, 'b, T> {
+ async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T) where T: Debug + Sized;
+}
+
+impl<'a, 'b, T, U> MyTrait<'a, 'b, T> for U {
+ async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ (self, key)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.stderr b/src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.stderr
new file mode 100644
index 000000000..0f0242027
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-lifetimes-and-bounds.stderr
@@ -0,0 +1,23 @@
+error[E0309]: the parameter type `Self` may not live long enough
+ --> $DIR/async-lifetimes-and-bounds.rs:11:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T) where T: Debug + Sized;
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider adding an explicit lifetime bound `Self: 'a`...
+ = note: ...so that the reference type `&'a Self` does not outlive the data it points at
+
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/async-lifetimes-and-bounds.rs:11:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T) where T: Debug + Sized;
+ | ^^^^^^^^^^^^^^^^^ ...so that the reference type `&'b T` does not outlive the data it points at
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | trait MyTrait<'a, 'b, T: 'b> {
+ | ++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/async-await/in-trait/async-lifetimes.rs b/src/test/ui/async-await/in-trait/async-lifetimes.rs
new file mode 100644
index 000000000..acbac471c
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-lifetimes.rs
@@ -0,0 +1,18 @@
+// check-fail
+// known-bug: #102682
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait MyTrait<'a, 'b, T> {
+ async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
+}
+
+impl<'a, 'b, T, U> MyTrait<'a, 'b, T> for U {
+ async fn foo(&'a self, key: &'b T) -> (&'a U, &'b T) {
+ (self, key)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-lifetimes.stderr b/src/test/ui/async-await/in-trait/async-lifetimes.stderr
new file mode 100644
index 000000000..9a7d294bb
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-lifetimes.stderr
@@ -0,0 +1,23 @@
+error[E0309]: the parameter type `Self` may not live long enough
+ --> $DIR/async-lifetimes.rs:9:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = help: consider adding an explicit lifetime bound `Self: 'a`...
+ = note: ...so that the reference type `&'a Self` does not outlive the data it points at
+
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/async-lifetimes.rs:9:43
+ |
+LL | async fn foo(&'a self, key: &'b T) -> (&'a Self, &'b T);
+ | ^^^^^^^^^^^^^^^^^ ...so that the reference type `&'b T` does not outlive the data it points at
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | trait MyTrait<'a, 'b, T: 'b> {
+ | ++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/async-await/in-trait/async-recursive-generic.rs b/src/test/ui/async-await/in-trait/async-recursive-generic.rs
new file mode 100644
index 000000000..6839abd38
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-recursive-generic.rs
@@ -0,0 +1,21 @@
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait MyTrait<T> {
+ async fn foo_recursive(&self, n: usize) -> T;
+}
+
+impl<T> MyTrait<T> for T where T: Copy {
+ async fn foo_recursive(&self, n: usize) -> T {
+ //~^ ERROR recursion in an `async fn` requires boxing
+ if n > 0 {
+ self.foo_recursive(n - 1).await
+ } else {
+ *self
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-recursive-generic.stderr b/src/test/ui/async-await/in-trait/async-recursive-generic.stderr
new file mode 100644
index 000000000..cab173bdd
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-recursive-generic.stderr
@@ -0,0 +1,12 @@
+error[E0733]: recursion in an `async fn` requires boxing
+ --> $DIR/async-recursive-generic.rs:11: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/src/test/ui/async-await/in-trait/async-recursive.rs b/src/test/ui/async-await/in-trait/async-recursive.rs
new file mode 100644
index 000000000..61119f809
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-recursive.rs
@@ -0,0 +1,21 @@
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait MyTrait {
+ async fn foo_recursive(&self, n: usize) -> i32;
+}
+
+impl MyTrait for i32 {
+ async fn foo_recursive(&self, n: usize) -> i32 {
+ //~^ ERROR recursion in an `async fn` requires boxing
+ if n > 0 {
+ self.foo_recursive(n - 1).await
+ } else {
+ *self
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/async-recursive.stderr b/src/test/ui/async-await/in-trait/async-recursive.stderr
new file mode 100644
index 000000000..9feff37b3
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/async-recursive.stderr
@@ -0,0 +1,12 @@
+error[E0733]: recursion in an `async fn` requires boxing
+ --> $DIR/async-recursive.rs:11: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/src/test/ui/async-await/in-trait/fn-not-async-err.rs b/src/test/ui/async-await/in-trait/fn-not-async-err.rs
new file mode 100644
index 000000000..f94d32145
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/fn-not-async-err.rs
@@ -0,0 +1,17 @@
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait MyTrait {
+ async fn foo(&self) -> i32;
+}
+
+impl MyTrait for i32 {
+ fn foo(&self) -> i32 {
+ //~^ ERROR: `i32` is not a future [E0277]
+ *self
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/fn-not-async-err.stderr b/src/test/ui/async-await/in-trait/fn-not-async-err.stderr
new file mode 100644
index 000000000..03321dc5b
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/fn-not-async-err.stderr
@@ -0,0 +1,17 @@
+error[E0277]: `i32` is not a future
+ --> $DIR/fn-not-async-err.rs:11:22
+ |
+LL | fn foo(&self) -> i32 {
+ | ^^^ `i32` is not a future
+ |
+ = help: the trait `Future` is not implemented for `i32`
+ = note: i32 must be a future or must implement `IntoFuture` to be awaited
+note: required by a bound in `MyTrait::foo::{opaque#0}`
+ --> $DIR/fn-not-async-err.rs:7:28
+ |
+LL | async fn foo(&self) -> i32;
+ | ^^^ required by this bound in `MyTrait::foo::{opaque#0}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/async-await/in-trait/fn-not-async-err2.rs b/src/test/ui/async-await/in-trait/fn-not-async-err2.rs
new file mode 100644
index 000000000..594baa91a
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/fn-not-async-err2.rs
@@ -0,0 +1,21 @@
+// edition: 2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+
+trait MyTrait {
+ async fn foo(&self) -> i32;
+}
+
+impl MyTrait for i32 {
+ fn foo(&self) -> impl Future<Output = i32> {
+ //~^ ERROR `impl Trait` only allowed in function and inherent method return types, not in `impl` method return [E0562]
+ async {
+ *self
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/in-trait/fn-not-async-err2.stderr b/src/test/ui/async-await/in-trait/fn-not-async-err2.stderr
new file mode 100644
index 000000000..f591f1847
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/fn-not-async-err2.stderr
@@ -0,0 +1,12 @@
+error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return
+ --> $DIR/fn-not-async-err2.rs:13: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/src/test/ui/async-await/in-trait/issue-102138.rs b/src/test/ui/async-await/in-trait/issue-102138.rs
new file mode 100644
index 000000000..f61b34ed9
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/issue-102138.rs
@@ -0,0 +1,46 @@
+// check-pass
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+
+async fn yield_now() {}
+
+trait AsyncIterator {
+ type Item;
+ async fn next(&mut self) -> Option<Self::Item>;
+}
+
+struct YieldingRange {
+ counter: u32,
+ stop: u32,
+}
+
+impl AsyncIterator for YieldingRange {
+ type Item = u32;
+
+ async fn next(&mut self) -> Option<Self::Item> {
+ if self.counter == self.stop {
+ None
+ } else {
+ let c = self.counter;
+ self.counter += 1;
+ yield_now().await;
+ Some(c)
+ }
+ }
+}
+
+async fn async_main() {
+ let mut x = YieldingRange { counter: 0, stop: 10 };
+
+ while let Some(v) = x.next().await {
+ println!("Hi: {v}");
+ }
+}
+
+fn main() {
+ let _ = async_main();
+}
diff --git a/src/test/ui/async-await/in-trait/issue-102219.rs b/src/test/ui/async-await/in-trait/issue-102219.rs
new file mode 100644
index 000000000..9a35f6515
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/issue-102219.rs
@@ -0,0 +1,10 @@
+// compile-flags:--crate-type=lib
+// edition:2021
+// check-pass
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+trait T {
+ async fn foo();
+}
diff --git a/src/test/ui/async-await/in-trait/issue-102310.rs b/src/test/ui/async-await/in-trait/issue-102310.rs
new file mode 100644
index 000000000..49c3e9fee
--- /dev/null
+++ b/src/test/ui/async-await/in-trait/issue-102310.rs
@@ -0,0 +1,15 @@
+// check-pass
+// edition:2021
+
+#![feature(async_fn_in_trait)]
+#![allow(incomplete_features)]
+
+pub trait SpiDevice {
+ async fn transaction<F, R>(&mut self);
+}
+
+impl SpiDevice for () {
+ async fn transaction<F, R>(&mut self) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/issue-101715.rs b/src/test/ui/async-await/issue-101715.rs
new file mode 100644
index 000000000..1be5d0248
--- /dev/null
+++ b/src/test/ui/async-await/issue-101715.rs
@@ -0,0 +1,17 @@
+// edition:2018
+
+struct S;
+
+impl S {
+ fn very_long_method_name_the_longest_method_name_in_the_whole_universe(self) {}
+}
+
+async fn foo() {
+ S.very_long_method_name_the_longest_method_name_in_the_whole_universe()
+ .await
+ //~^ error: `()` is not a future
+ //~| help: remove the `.await`
+ //~| help: the trait `Future` is not implemented for `()`
+}
+
+fn main() {}
diff --git a/src/test/ui/async-await/issue-101715.stderr b/src/test/ui/async-await/issue-101715.stderr
new file mode 100644
index 000000000..a0e8d2a89
--- /dev/null
+++ b/src/test/ui/async-await/issue-101715.stderr
@@ -0,0 +1,16 @@
+error[E0277]: `()` is not a future
+ --> $DIR/issue-101715.rs:11:9
+ |
+LL | .await
+ | ^^^^^^
+ | |
+ | `()` is not a future
+ | help: remove the `.await`
+ |
+ = help: the trait `Future` is not implemented for `()`
+ = note: () must be a future or must implement `IntoFuture` to be awaited
+ = note: required for `()` to implement `IntoFuture`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/async-await/issue-64130-1-sync.rs b/src/test/ui/async-await/issue-64130-1-sync.rs
index af83f14bb..1714cec52 100644
--- a/src/test/ui/async-await/issue-64130-1-sync.rs
+++ b/src/test/ui/async-await/issue-64130-1-sync.rs
@@ -1,7 +1,7 @@
#![feature(negative_impls)]
// edition:2018
-// This tests the the specialized async-await-specific error when futures don't implement an
+// This tests the specialized async-await-specific error when futures don't implement an
// auto trait (which is specifically Sync) due to some type that was captured.
struct Foo;
diff --git a/src/test/ui/async-await/issue-64130-2-send.rs b/src/test/ui/async-await/issue-64130-2-send.rs
index 2362831d8..7a6e5952c 100644
--- a/src/test/ui/async-await/issue-64130-2-send.rs
+++ b/src/test/ui/async-await/issue-64130-2-send.rs
@@ -1,7 +1,7 @@
#![feature(negative_impls)]
// edition:2018
-// This tests the the specialized async-await-specific error when futures don't implement an
+// This tests the specialized async-await-specific error when futures don't implement an
// auto trait (which is specifically Send) due to some type that was captured.
struct Foo;
diff --git a/src/test/ui/async-await/issue-64130-3-other.rs b/src/test/ui/async-await/issue-64130-3-other.rs
index 52801c35b..630fb2c41 100644
--- a/src/test/ui/async-await/issue-64130-3-other.rs
+++ b/src/test/ui/async-await/issue-64130-3-other.rs
@@ -2,7 +2,7 @@
#![feature(negative_impls)]
// edition:2018
-// This tests the the unspecialized async-await-specific error when futures don't implement an
+// This tests the unspecialized async-await-specific error when futures don't implement an
// auto trait (which is not Send or Sync) due to some type that was captured.
auto trait Qux {}
diff --git a/src/test/ui/async-await/issue-64130-4-async-move.stderr b/src/test/ui/async-await/issue-64130-4-async-move.drop-tracking.stderr
index d631e6dc7..f609e3636 100644
--- a/src/test/ui/async-await/issue-64130-4-async-move.stderr
+++ b/src/test/ui/async-await/issue-64130-4-async-move.drop-tracking.stderr
@@ -1,12 +1,12 @@
error: future cannot be sent between threads safely
- --> $DIR/issue-64130-4-async-move.rs:15:17
+ --> $DIR/issue-64130-4-async-move.rs:19:17
|
LL | pub fn foo() -> impl Future + Send {
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
= help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
note: future is not `Send` as this value is used across an await
- --> $DIR/issue-64130-4-async-move.rs:21:31
+ --> $DIR/issue-64130-4-async-move.rs:25:31
|
LL | match client.status() {
| ------ has type `&Client` which is not `Send`
@@ -17,7 +17,7 @@ LL | let _x = get().await;
LL | }
| - `client` is later dropped here
help: consider moving this into a `let` binding to create a shorter lived borrow
- --> $DIR/issue-64130-4-async-move.rs:19:15
+ --> $DIR/issue-64130-4-async-move.rs:23:15
|
LL | match client.status() {
| ^^^^^^^^^^^^^^^
diff --git a/src/test/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr b/src/test/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr
new file mode 100644
index 000000000..f609e3636
--- /dev/null
+++ b/src/test/ui/async-await/issue-64130-4-async-move.no_drop_tracking.stderr
@@ -0,0 +1,26 @@
+error: future cannot be sent between threads safely
+ --> $DIR/issue-64130-4-async-move.rs:19:17
+ |
+LL | pub fn foo() -> impl Future + Send {
+ | ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
+ |
+ = help: the trait `Sync` is not implemented for `(dyn Any + Send + 'static)`
+note: future is not `Send` as this value is used across an await
+ --> $DIR/issue-64130-4-async-move.rs:25:31
+ |
+LL | match client.status() {
+ | ------ has type `&Client` which is not `Send`
+LL | 200 => {
+LL | let _x = get().await;
+ | ^^^^^^ await occurs here, with `client` maybe used later
+...
+LL | }
+ | - `client` is later dropped here
+help: consider moving this into a `let` binding to create a shorter lived borrow
+ --> $DIR/issue-64130-4-async-move.rs:23:15
+ |
+LL | match client.status() {
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/async-await/issue-64130-4-async-move.rs b/src/test/ui/async-await/issue-64130-4-async-move.rs
index 2538f3435..a38428fc0 100644
--- a/src/test/ui/async-await/issue-64130-4-async-move.rs
+++ b/src/test/ui/async-await/issue-64130-4-async-move.rs
@@ -1,4 +1,8 @@
// edition:2018
+// revisions: no_drop_tracking drop_tracking
+// [drop_tracking] check-pass
+// [drop_tracking] compile-flags: -Zdrop-tracking=yes
+// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
use std::any::Any;
use std::future::Future;
@@ -10,16 +14,16 @@ impl Client {
}
}
-async fn get() { }
+async fn get() {}
pub fn foo() -> impl Future + Send {
- //~^ ERROR future cannot be sent between threads safely
+ //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
let client = Client(Box::new(true));
async move {
match client.status() {
200 => {
let _x = get().await;
- },
+ }
_ => (),
}
}
diff --git a/src/test/ui/async-await/issue-66387-if-without-else.stderr b/src/test/ui/async-await/issue-66387-if-without-else.stderr
index e8e2a4898..8155fcb56 100644
--- a/src/test/ui/async-await/issue-66387-if-without-else.stderr
+++ b/src/test/ui/async-await/issue-66387-if-without-else.stderr
@@ -4,7 +4,7 @@ error[E0317]: `if` may be missing an `else` clause
LL | / if true {
LL | | return 0;
LL | | }
- | |_____^ expected `()`, found `i32`
+ | |_____^ expected `i32`, found `()`
|
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/async-await/issue-67252-unnamed-future.stderr b/src/test/ui/async-await/issue-67252-unnamed-future.stderr
index 01c0d3225..af99b608c 100644
--- a/src/test/ui/async-await/issue-67252-unnamed-future.stderr
+++ b/src/test/ui/async-await/issue-67252-unnamed-future.stderr
@@ -1,8 +1,12 @@
error: future cannot be sent between threads safely
- --> $DIR/issue-67252-unnamed-future.rs:18:5
+ --> $DIR/issue-67252-unnamed-future.rs:18:11
|
-LL | spawn(async {
- | ^^^^^ future created by async block is not `Send`
+LL | spawn(async {
+ | ___________^
+LL | | let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
+LL | | AFuture.await;
+LL | | });
+ | |_____^ future created by async block is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `*mut ()`
note: future is not `Send` as this value is used across an await
diff --git a/src/test/ui/async-await/issue-68112.drop_tracking.stderr b/src/test/ui/async-await/issue-68112.drop_tracking.stderr
new file mode 100644
index 000000000..c915164cf
--- /dev/null
+++ b/src/test/ui/async-await/issue-68112.drop_tracking.stderr
@@ -0,0 +1,79 @@
+error: future cannot be sent between threads safely
+ --> $DIR/issue-68112.rs:37:18
+ |
+LL | require_send(send_fut);
+ | ^^^^^^^^ future created by async block is not `Send`
+ |
+ = help: the trait `Sync` is not implemented for `RefCell<i32>`
+note: future is not `Send` as it awaits another future which is not `Send`
+ --> $DIR/issue-68112.rs:34:17
+ |
+LL | let _ = non_send_fut.await;
+ | ^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:14:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
+
+error: future cannot be sent between threads safely
+ --> $DIR/issue-68112.rs:46:18
+ |
+LL | require_send(send_fut);
+ | ^^^^^^^^ future created by async block is not `Send`
+ |
+ = help: the trait `Sync` is not implemented for `RefCell<i32>`
+note: future is not `Send` as it awaits another future which is not `Send`
+ --> $DIR/issue-68112.rs:43:17
+ |
+LL | let _ = make_non_send_future1().await;
+ | ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:14:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
+
+error[E0277]: `RefCell<i32>` cannot be shared between threads safely
+ --> $DIR/issue-68112.rs:65:18
+ |
+LL | require_send(send_fut);
+ | ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Sync` is not implemented for `RefCell<i32>`
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
+note: required because it's used within this `async fn` body
+ --> $DIR/issue-68112.rs:50:31
+ |
+LL | async fn ready2<T>(t: T) -> T {
+ | _______________________________^
+LL | | t
+LL | | }
+ | |_^
+note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
+ --> $DIR/issue-68112.rs:53:31
+ |
+LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: required because it captures the following types: `ResumeTy`, `impl Future<Output = Arc<RefCell<i32>>>`, `()`, `Ready<i32>`
+note: required because it's used within this `async` block
+ --> $DIR/issue-68112.rs:60:26
+ |
+LL | let send_fut = async {
+ | __________________________^
+LL | | let non_send_fut = make_non_send_future2();
+LL | | let _ = non_send_fut.await;
+LL | | ready(0).await;
+LL | | };
+ | |_____^
+note: required by a bound in `require_send`
+ --> $DIR/issue-68112.rs:14:25
+ |
+LL | fn require_send(_: impl Send) {}
+ | ^^^^ required by this bound in `require_send`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/async-await/issue-68112.stderr b/src/test/ui/async-await/issue-68112.no_drop_tracking.stderr
index 4285fbbec..11b7d1aaa 100644
--- a/src/test/ui/async-await/issue-68112.stderr
+++ b/src/test/ui/async-await/issue-68112.no_drop_tracking.stderr
@@ -1,60 +1,65 @@
error: future cannot be sent between threads safely
- --> $DIR/issue-68112.rs:34:5
+ --> $DIR/issue-68112.rs:37:18
|
LL | require_send(send_fut);
- | ^^^^^^^^^^^^ future created by async block is not `Send`
+ | ^^^^^^^^ future created by async block is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
note: future is not `Send` as it awaits another future which is not `Send`
- --> $DIR/issue-68112.rs:31:17
+ --> $DIR/issue-68112.rs:34:17
|
LL | let _ = non_send_fut.await;
| ^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
note: required by a bound in `require_send`
- --> $DIR/issue-68112.rs:11:25
+ --> $DIR/issue-68112.rs:14:25
|
LL | fn require_send(_: impl Send) {}
| ^^^^ required by this bound in `require_send`
error: future cannot be sent between threads safely
- --> $DIR/issue-68112.rs:43:5
+ --> $DIR/issue-68112.rs:46:18
|
LL | require_send(send_fut);
- | ^^^^^^^^^^^^ future created by async block is not `Send`
+ | ^^^^^^^^ future created by async block is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
note: future is not `Send` as it awaits another future which is not `Send`
- --> $DIR/issue-68112.rs:40:17
+ --> $DIR/issue-68112.rs:43:17
|
LL | let _ = make_non_send_future1().await;
| ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
note: required by a bound in `require_send`
- --> $DIR/issue-68112.rs:11:25
+ --> $DIR/issue-68112.rs:14:25
|
LL | fn require_send(_: impl Send) {}
| ^^^^ required by this bound in `require_send`
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
- --> $DIR/issue-68112.rs:60:5
+ --> $DIR/issue-68112.rs:65:18
|
LL | require_send(send_fut);
- | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
+ | ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
- = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>`
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it's used within this `async fn` body
- --> $DIR/issue-68112.rs:47:31
+ --> $DIR/issue-68112.rs:50:31
|
-LL | async fn ready2<T>(t: T) -> T { t }
- | ^^^^^
+LL | async fn ready2<T>(t: T) -> T {
+ | _______________________________^
+LL | | t
+LL | | }
+ | |_^
note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
- --> $DIR/issue-68112.rs:48:31
+ --> $DIR/issue-68112.rs:53:31
|
LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: required because it captures the following types: `ResumeTy`, `impl Future<Output = Arc<RefCell<i32>>>`, `()`, `i32`, `Ready<i32>`
note: required because it's used within this `async` block
- --> $DIR/issue-68112.rs:55:26
+ --> $DIR/issue-68112.rs:60:26
|
LL | let send_fut = async {
| __________________________^
@@ -64,7 +69,7 @@ LL | | ready(0).await;
LL | | };
| |_____^
note: required by a bound in `require_send`
- --> $DIR/issue-68112.rs:11:25
+ --> $DIR/issue-68112.rs:14:25
|
LL | fn require_send(_: impl Send) {}
| ^^^^ required by this bound in `require_send`
diff --git a/src/test/ui/async-await/issue-68112.rs b/src/test/ui/async-await/issue-68112.rs
index bfabf81d1..9c705137a 100644
--- a/src/test/ui/async-await/issue-68112.rs
+++ b/src/test/ui/async-await/issue-68112.rs
@@ -1,10 +1,13 @@
// edition:2018
+// revisions: no_drop_tracking drop_tracking
+// [drop_tracking] compile-flags: -Zdrop-tracking=yes
+// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
use std::{
- future::Future,
cell::RefCell,
- sync::Arc,
+ future::Future,
pin::Pin,
+ sync::Arc,
task::{Context, Poll},
};
@@ -44,7 +47,9 @@ fn test1_no_let() {
//~^ ERROR future cannot be sent between threads
}
-async fn ready2<T>(t: T) -> T { t }
+async fn ready2<T>(t: T) -> T {
+ t
+}
fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
ready2(Arc::new(RefCell::new(0)))
}
diff --git a/src/test/ui/async-await/issue-70594.stderr b/src/test/ui/async-await/issue-70594.stderr
index a88bce6cc..d3cf57d3b 100644
--- a/src/test/ui/async-await/issue-70594.stderr
+++ b/src/test/ui/async-await/issue-70594.stderr
@@ -22,16 +22,14 @@ error[E0277]: `()` is not a future
--> $DIR/issue-70594.rs:4:11
|
LL | [1; ().await];
- | ^^^^^^ `()` is not a future
+ | ^^^^^^
+ | |
+ | `()` is not a future
+ | help: remove the `.await`
|
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
- = note: required because of the requirements on the impl of `IntoFuture` for `()`
-help: remove the `.await`
- |
-LL - [1; ().await];
-LL + [1; ()];
- |
+ = note: required for `()` to implement `IntoFuture`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr b/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr
index 2ce7309e1..7fb881166 100644
--- a/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr
+++ b/src/test/ui/async-await/issue-70935-complex-spans.drop_tracking.stderr
@@ -1,26 +1,26 @@
error[E0277]: `Sender<i32>` cannot be shared between threads safely
- --> $DIR/issue-70935-complex-spans.rs:12:45
+ --> $DIR/issue-70935-complex-spans.rs:13:45
|
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
| ^^^^^^^^^^^^^^^^^^ `Sender<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Sender<i32>`
- = note: required because of the requirements on the impl of `Send` for `&Sender<i32>`
+ = note: required for `&Sender<i32>` to implement `Send`
note: required because it's used within this closure
- --> $DIR/issue-70935-complex-spans.rs:16:13
+ --> $DIR/issue-70935-complex-spans.rs:17:13
|
LL | baz(|| async{
| ^^
note: required because it's used within this `async fn` body
- --> $DIR/issue-70935-complex-spans.rs:9:67
+ --> $DIR/issue-70935-complex-spans.rs:10:67
|
LL | async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
| ___________________________________________________________________^
LL | | }
| |_^
- = note: required because it captures the following types: `ResumeTy`, `impl for<'r, 's, 't0> Future<Output = ()>`, `()`
+ = note: required because it captures the following types: `ResumeTy`, `impl Future<Output = ()>`, `()`
note: required because it's used within this `async` block
- --> $DIR/issue-70935-complex-spans.rs:15:16
+ --> $DIR/issue-70935-complex-spans.rs:16:16
|
LL | async move {
| ________________^
diff --git a/src/test/ui/async-await/issue-70935-complex-spans.normal.stderr b/src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr
index 2b81b4000..34b31198e 100644
--- a/src/test/ui/async-await/issue-70935-complex-spans.normal.stderr
+++ b/src/test/ui/async-await/issue-70935-complex-spans.no_drop_tracking.stderr
@@ -1,12 +1,12 @@
error: future cannot be sent between threads safely
- --> $DIR/issue-70935-complex-spans.rs:12:45
+ --> $DIR/issue-70935-complex-spans.rs:13:45
|
LL | fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
| ^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
= help: the trait `Sync` is not implemented for `Sender<i32>`
note: future is not `Send` as this value is used across an await
- --> $DIR/issue-70935-complex-spans.rs:18:11
+ --> $DIR/issue-70935-complex-spans.rs:19:11
|
LL | baz(|| async{
| _____________-
@@ -14,9 +14,9 @@ LL | | foo(tx.clone());
LL | | }).await;
| | - ^^^^^^ await occurs here, with the value maybe used later
| |_________|
- | has type `[closure@$DIR/issue-70935-complex-spans.rs:16:13: 16:15]` which is not `Send`
+ | has type `[closure@$DIR/issue-70935-complex-spans.rs:17:13: 17:15]` which is not `Send`
note: the value is later dropped here
- --> $DIR/issue-70935-complex-spans.rs:18:17
+ --> $DIR/issue-70935-complex-spans.rs:19:17
|
LL | }).await;
| ^
diff --git a/src/test/ui/async-await/issue-70935-complex-spans.rs b/src/test/ui/async-await/issue-70935-complex-spans.rs
index 48847cdf9..b6d17f93a 100644
--- a/src/test/ui/async-await/issue-70935-complex-spans.rs
+++ b/src/test/ui/async-await/issue-70935-complex-spans.rs
@@ -1,5 +1,6 @@
// edition:2018
-// revisions: normal drop_tracking
+// revisions: no_drop_tracking drop_tracking
+// [no_drop_tracking]compile-flags:-Zdrop-tracking=no
// [drop_tracking]compile-flags:-Zdrop-tracking
// #70935: Check if we do not emit snippet
// with newlines which lead complex diagnostics.
@@ -10,7 +11,7 @@ async fn baz<T>(_c: impl FnMut() -> T) where T: Future<Output=()> {
}
fn foo(tx: std::sync::mpsc::Sender<i32>) -> impl Future + Send {
- //[normal]~^ ERROR future cannot be sent between threads safely
+ //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
//[drop_tracking]~^^ ERROR `Sender<i32>` cannot be shared between threads
async move {
baz(|| async{
diff --git a/src/test/ui/async-await/issue-73137.rs b/src/test/ui/async-await/issue-73137.rs
index c43ce2cad..dcbe7765a 100644
--- a/src/test/ui/async-await/issue-73137.rs
+++ b/src/test/ui/async-await/issue-73137.rs
@@ -2,6 +2,9 @@
// run-pass
// edition:2018
+// revisions: normal drop-tracking
+// [normal]compile-flags: -Zdrop-tracking=no
+// [drop-tracking]compile-flags: -Zdrop-tracking
#![allow(dead_code)]
use std::future::Future;
diff --git a/src/test/ui/issues/issue-73541-3.rs b/src/test/ui/async-await/issue-73541-3.rs
index 02ca02da8..02ca02da8 100644
--- a/src/test/ui/issues/issue-73541-3.rs
+++ b/src/test/ui/async-await/issue-73541-3.rs
diff --git a/src/test/ui/issues/issue-73541-3.stderr b/src/test/ui/async-await/issue-73541-3.stderr
index 53487aaca..53487aaca 100644
--- a/src/test/ui/issues/issue-73541-3.stderr
+++ b/src/test/ui/async-await/issue-73541-3.stderr
diff --git a/src/test/ui/issues/issue-73541.rs b/src/test/ui/async-await/issue-73541.rs
index 399a07cd3..399a07cd3 100644
--- a/src/test/ui/issues/issue-73541.rs
+++ b/src/test/ui/async-await/issue-73541.rs
diff --git a/src/test/ui/issues/issue-73541.stderr b/src/test/ui/async-await/issue-73541.stderr
index 4bb466ff1..4bb466ff1 100644
--- a/src/test/ui/issues/issue-73541.stderr
+++ b/src/test/ui/async-await/issue-73541.stderr
diff --git a/src/test/ui/async-await/issue-98634.rs b/src/test/ui/async-await/issue-98634.rs
new file mode 100644
index 000000000..b0d38687f
--- /dev/null
+++ b/src/test/ui/async-await/issue-98634.rs
@@ -0,0 +1,50 @@
+// edition: 2021
+
+use std::{
+ future::Future,
+ pin::Pin,
+ task::{Context, Poll, Waker},
+};
+
+pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
+ pub callback: F,
+}
+
+impl<F> Future for StructAsync<F>
+where
+ F: Fn() -> Pin<Box<dyn Future<Output = ()>>>,
+{
+ type Output = ();
+
+ fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
+ Poll::Pending
+ }
+}
+
+async fn callback() {}
+
+struct Runtime;
+
+fn waker() -> &'static Waker {
+ todo!()
+}
+
+impl Runtime {
+ #[track_caller]
+ pub fn block_on<F: Future>(&self, mut future: F) -> F::Output {
+ loop {
+ unsafe {
+ Pin::new_unchecked(&mut future).poll(&mut Context::from_waker(waker()));
+ }
+ }
+ }
+}
+
+fn main() {
+ Runtime.block_on(async {
+ StructAsync { callback }.await;
+ //~^ ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+ //~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+ //~| ERROR expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+ });
+}
diff --git a/src/test/ui/async-await/issue-98634.stderr b/src/test/ui/async-await/issue-98634.stderr
new file mode 100644
index 000000000..5160e48d8
--- /dev/null
+++ b/src/test/ui/async-await/issue-98634.stderr
@@ -0,0 +1,60 @@
+error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+ --> $DIR/issue-98634.rs:45:23
+ |
+LL | StructAsync { callback }.await;
+ | ^^^^^^^^ expected struct `Pin`, found opaque type
+ |
+note: while checking the return type of the `async fn`
+ --> $DIR/issue-98634.rs:24:21
+ |
+LL | async fn callback() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
+ = note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
+ found opaque type `impl Future<Output = ()>`
+note: required by a bound in `StructAsync`
+ --> $DIR/issue-98634.rs:9:35
+ |
+LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
+
+error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+ --> $DIR/issue-98634.rs:45:9
+ |
+LL | StructAsync { callback }.await;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type
+ |
+note: while checking the return type of the `async fn`
+ --> $DIR/issue-98634.rs:24:21
+ |
+LL | async fn callback() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
+ = note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
+ found opaque type `impl Future<Output = ()>`
+note: required by a bound in `StructAsync`
+ --> $DIR/issue-98634.rs:9:35
+ |
+LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
+
+error[E0271]: expected `fn() -> impl Future<Output = ()> {callback}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+ --> $DIR/issue-98634.rs:45:33
+ |
+LL | StructAsync { callback }.await;
+ | ^^^^^^ expected struct `Pin`, found opaque type
+ |
+note: while checking the return type of the `async fn`
+ --> $DIR/issue-98634.rs:24:21
+ |
+LL | async fn callback() {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
+ = note: expected struct `Pin<Box<(dyn Future<Output = ()> + 'static)>>`
+ found opaque type `impl Future<Output = ()>`
+note: required by a bound in `StructAsync`
+ --> $DIR/issue-98634.rs:9:35
+ |
+LL | pub struct StructAsync<F: Fn() -> Pin<Box<dyn Future<Output = ()>>>> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `StructAsync`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/async-await/issues/issue-62009-1.stderr b/src/test/ui/async-await/issues/issue-62009-1.stderr
index 5cbbf89a2..222afb2c7 100644
--- a/src/test/ui/async-await/issues/issue-62009-1.stderr
+++ b/src/test/ui/async-await/issues/issue-62009-1.stderr
@@ -28,16 +28,14 @@ error[E0277]: `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
--> $DIR/issue-62009-1.rs:12:15
|
LL | (|_| 2333).await;
- | ^^^^^^ `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
+ | ^^^^^^
+ | |
+ | `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` is not a future
+ | help: remove the `.await`
|
- = help: the trait `Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
+ = help: the trait `Future` is not implemented for closure `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
= note: [closure@$DIR/issue-62009-1.rs:12:6: 12:9] must be a future or must implement `IntoFuture` to be awaited
- = note: required because of the requirements on the impl of `IntoFuture` for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]`
-help: remove the `.await`
- |
-LL - (|_| 2333).await;
-LL + (|_| 2333);
- |
+ = note: required for `[closure@$DIR/issue-62009-1.rs:12:6: 12:9]` to implement `IntoFuture`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs b/src/test/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs
index 5e71229be..b4ea4c9f6 100644
--- a/src/test/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs
+++ b/src/test/ui/async-await/issues/issue-65419/issue-65419-async-fn-resume-after-panic.rs
@@ -6,7 +6,6 @@
// error-pattern: thread 'main' panicked at '`async fn` resumed after panicking'
// edition:2018
// ignore-wasm no panic or subprocess support
-// ignore-emscripten no panic or subprocess support
#![feature(generators, generator_trait)]
diff --git a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr
index b23093001..a72350377 100644
--- a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr
+++ b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr
@@ -1,29 +1,33 @@
error: future cannot be sent between threads safely
- --> $DIR/issue-65436-raw-ptr-not-send.rs:12:5
+ --> $DIR/issue-65436-raw-ptr-not-send.rs:16:17
|
-LL | assert_send(async {
- | ^^^^^^^^^^^ future created by async block is not `Send`
+LL | assert_send(async {
+ | _________________^
+LL | |
+LL | | bar(Foo(std::ptr::null())).await;
+LL | | })
+ | |_____^ future created by async block is not `Send`
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `*const u8`
note: future is not `Send` as this value is used across an await
- --> $DIR/issue-65436-raw-ptr-not-send.rs:14:35
+ --> $DIR/issue-65436-raw-ptr-not-send.rs:18:35
|
LL | bar(Foo(std::ptr::null())).await;
| ---------------- ^^^^^^ await occurs here, with `std::ptr::null()` maybe used later
| |
| has type `*const u8` which is not `Send`
note: `std::ptr::null()` is later dropped here
- --> $DIR/issue-65436-raw-ptr-not-send.rs:14:41
+ --> $DIR/issue-65436-raw-ptr-not-send.rs:18:41
|
LL | bar(Foo(std::ptr::null())).await;
| ^
help: consider moving this into a `let` binding to create a shorter lived borrow
- --> $DIR/issue-65436-raw-ptr-not-send.rs:14:13
+ --> $DIR/issue-65436-raw-ptr-not-send.rs:18:13
|
LL | bar(Foo(std::ptr::null())).await;
| ^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `assert_send`
- --> $DIR/issue-65436-raw-ptr-not-send.rs:9:19
+ --> $DIR/issue-65436-raw-ptr-not-send.rs:13:19
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
diff --git a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs
index 3a814b475..91edbc10d 100644
--- a/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs
+++ b/src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.rs
@@ -1,4 +1,8 @@
// edition:2018
+// revisions: no_drop_tracking drop_tracking
+// [drop_tracking] check-pass
+// [drop_tracking] compile-flags: -Zdrop-tracking=yes
+// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
struct Foo(*const u8);
@@ -10,7 +14,7 @@ fn assert_send<T: Send>(_: T) {}
fn main() {
assert_send(async {
- //~^ ERROR future cannot be sent between threads safely
+ //[no_drop_tracking]~^ ERROR future cannot be sent between threads safely
bar(Foo(std::ptr::null())).await;
})
}
diff --git a/src/test/ui/async-await/issues/issue-95307.stderr b/src/test/ui/async-await/issues/issue-95307.stderr
index 60fca71eb..a497cebe3 100644
--- a/src/test/ui/async-await/issues/issue-95307.stderr
+++ b/src/test/ui/async-await/issues/issue-95307.stderr
@@ -8,6 +8,14 @@ LL | async fn new() -> [u8; _];
|
= 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: in expressions, `_` can only be used on the left-hand side of an assignment
+ --> $DIR/issue-95307.rs:7:28
+ |
+LL | async fn new() -> [u8; _];
+ | ^ `_` not allowed here
error[E0658]: using `_` for array lengths is unstable
--> $DIR/issue-95307.rs:7:28
@@ -18,12 +26,6 @@ LL | async fn new() -> [u8; _];
= note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
= help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
-error: in expressions, `_` can only be used on the left-hand side of an assignment
- --> $DIR/issue-95307.rs:7:28
- |
-LL | async fn new() -> [u8; _];
- | ^ `_` not allowed here
-
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0658, E0706.
diff --git a/src/test/ui/async-await/large_moves.attribute.stderr b/src/test/ui/async-await/large_moves.attribute.stderr
index 8d3f0b77f..da34f44b2 100644
--- a/src/test/ui/async-await/large_moves.attribute.stderr
+++ b/src/test/ui/async-await/large_moves.attribute.stderr
@@ -10,12 +10,12 @@ LL | | dbg!(y);
LL | | };
| |_____^ 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
--> $DIR/large_moves.rs:1:9
|
LL | #![deny(large_assignments)]
| ^^^^^^^^^^^^^^^^^
- = 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:18:14
diff --git a/src/test/ui/async-await/large_moves.option.stderr b/src/test/ui/async-await/large_moves.option.stderr
index 8d3f0b77f..da34f44b2 100644
--- a/src/test/ui/async-await/large_moves.option.stderr
+++ b/src/test/ui/async-await/large_moves.option.stderr
@@ -10,12 +10,12 @@ LL | | dbg!(y);
LL | | };
| |_____^ 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
--> $DIR/large_moves.rs:1:9
|
LL | #![deny(large_assignments)]
| ^^^^^^^^^^^^^^^^^
- = 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:18:14
diff --git a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
index 3128b4df4..ae4d0d585 100644
--- a/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
+++ b/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.stderr
@@ -25,7 +25,7 @@ LL | | (a, b)
LL | | }
| |_^
|
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
+help: to declare that `impl Trait<'a>` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | async fn async_ret_impl_trait1<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a> + 'b {
| ++++
diff --git a/src/test/ui/async-await/no-const-async.stderr b/src/test/ui/async-await/no-const-async.stderr
index e6f6e9e9f..c5bd520aa 100644
--- a/src/test/ui/async-await/no-const-async.stderr
+++ b/src/test/ui/async-await/no-const-async.stderr
@@ -18,7 +18,7 @@ note: ...which requires borrow-checking `x`...
|
LL | pub const async fn x() {}
| ^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing `x`...
+note: ...which requires processing MIR for `x`...
--> $DIR/no-const-async.rs:4:1
|
LL | pub const async fn x() {}
diff --git a/src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr b/src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr
new file mode 100644
index 000000000..17b4ef7bd
--- /dev/null
+++ b/src/test/ui/async-await/partial-drop-partial-reinit.drop_tracking.stderr
@@ -0,0 +1,35 @@
+error[E0277]: `NotSend` cannot be sent between threads safely
+ --> $DIR/partial-drop-partial-reinit.rs:9:16
+ |
+LL | gimme_send(foo());
+ | ---------- ^^^^^ `NotSend` cannot be sent between threads safely
+ | |
+ | required by a bound introduced by this call
+...
+LL | async fn foo() {
+ | - within this `impl Future<Output = ()>`
+ |
+ = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`
+ = note: required because it appears within the type `(NotSend,)`
+ = note: required because it captures the following types: `ResumeTy`, `(NotSend,)`, `()`, `impl Future<Output = ()>`
+note: required because it's used within this `async fn` body
+ --> $DIR/partial-drop-partial-reinit.rs:31:16
+ |
+LL | async fn foo() {
+ | ________________^
+LL | |
+LL | |
+LL | | let mut x = (NotSend {},);
+... |
+LL | | bar().await;
+LL | | }
+ | |_^
+note: required by a bound in `gimme_send`
+ --> $DIR/partial-drop-partial-reinit.rs:17:18
+ |
+LL | fn gimme_send<T: Send>(t: T) {
+ | ^^^^ required by this bound in `gimme_send`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/async-await/partial-drop-partial-reinit.stderr b/src/test/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr
index 05f535834..34d8a159f 100644
--- a/src/test/ui/async-await/partial-drop-partial-reinit.stderr
+++ b/src/test/ui/async-await/partial-drop-partial-reinit.no_drop_tracking.stderr
@@ -1,5 +1,5 @@
error[E0277]: `NotSend` cannot be sent between threads safely
- --> $DIR/partial-drop-partial-reinit.rs:6:16
+ --> $DIR/partial-drop-partial-reinit.rs:9:16
|
LL | gimme_send(foo());
| ---------- ^^^^^ `NotSend` cannot be sent between threads safely
@@ -13,7 +13,7 @@ LL | async fn foo() {
= note: required because it appears within the type `(NotSend,)`
= note: required because it captures the following types: `ResumeTy`, `(NotSend,)`, `impl Future<Output = ()>`, `()`
note: required because it's used within this `async fn` body
- --> $DIR/partial-drop-partial-reinit.rs:28:16
+ --> $DIR/partial-drop-partial-reinit.rs:31:16
|
LL | async fn foo() {
| ________________^
@@ -25,7 +25,7 @@ LL | | bar().await;
LL | | }
| |_^
note: required by a bound in `gimme_send`
- --> $DIR/partial-drop-partial-reinit.rs:14:18
+ --> $DIR/partial-drop-partial-reinit.rs:17:18
|
LL | fn gimme_send<T: Send>(t: T) {
| ^^^^ required by this bound in `gimme_send`
diff --git a/src/test/ui/async-await/partial-drop-partial-reinit.rs b/src/test/ui/async-await/partial-drop-partial-reinit.rs
index fe0fce7af..7d097e72f 100644
--- a/src/test/ui/async-await/partial-drop-partial-reinit.rs
+++ b/src/test/ui/async-await/partial-drop-partial-reinit.rs
@@ -1,4 +1,7 @@
// edition:2021
+// revisions: no_drop_tracking drop_tracking
+// [drop_tracking] compile-flags: -Zdrop-tracking=yes
+// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
#![feature(negative_impls)]
#![allow(unused)]
@@ -12,8 +15,8 @@ fn main() {
}
fn gimme_send<T: Send>(t: T) {
-//~^ NOTE required by this bound
-//~| NOTE required by a bound
+ //~^ NOTE required by this bound
+ //~| NOTE required by a bound
drop(t);
}
@@ -26,8 +29,8 @@ impl Drop for NotSend {
impl !Send for NotSend {}
async fn foo() {
-//~^ NOTE used within this `async fn` body
-//~| NOTE within this `impl Future
+ //~^ NOTE used within this `async fn` body
+ //~| NOTE within this `impl Future
let mut x = (NotSend {},);
drop(x.0);
x.0 = NotSend {};
diff --git a/src/test/ui/async-await/unnecessary-await.stderr b/src/test/ui/async-await/unnecessary-await.stderr
index e7e61c2ba..dc3089336 100644
--- a/src/test/ui/async-await/unnecessary-await.stderr
+++ b/src/test/ui/async-await/unnecessary-await.stderr
@@ -8,7 +8,7 @@ LL | boo().await;
|
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
- = note: required because of the requirements on the impl of `IntoFuture` for `()`
+ = note: required for `()` to implement `IntoFuture`
help: remove the `.await`
|
LL - boo().await;
diff --git a/src/test/ui/attempted-access-non-fatal.rs b/src/test/ui/attempted-access-non-fatal.rs
index e50c1f23c..15deb9e2f 100644
--- a/src/test/ui/attempted-access-non-fatal.rs
+++ b/src/test/ui/attempted-access-non-fatal.rs
@@ -3,4 +3,8 @@ fn main() {
let x = 0;
let _ = x.foo; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
let _ = x.bar; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
+ let _ = 0.f; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
+ let _ = 2.l; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
+ let _ = 12.F; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
+ let _ = 34.L; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610]
}
diff --git a/src/test/ui/attempted-access-non-fatal.stderr b/src/test/ui/attempted-access-non-fatal.stderr
index 5b7db0e9d..bff669727 100644
--- a/src/test/ui/attempted-access-non-fatal.stderr
+++ b/src/test/ui/attempted-access-non-fatal.stderr
@@ -10,6 +10,50 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | let _ = x.bar;
| ^^^
-error: aborting due to 2 previous errors
+error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
+ --> $DIR/attempted-access-non-fatal.rs:6:15
+ |
+LL | let _ = 0.f;
+ | ^
+ |
+help: if intended to be a floating point literal, consider adding a `0` after the period and a `f32` suffix
+ |
+LL | let _ = 0.0f32;
+ | ~~~~
+
+error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
+ --> $DIR/attempted-access-non-fatal.rs:7:15
+ |
+LL | let _ = 2.l;
+ | ^
+ |
+help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
+ |
+LL | let _ = 2.0f64;
+ | ~~~~
+
+error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
+ --> $DIR/attempted-access-non-fatal.rs:8:16
+ |
+LL | let _ = 12.F;
+ | ^
+ |
+help: if intended to be a floating point literal, consider adding a `0` after the period and a `f32` suffix
+ |
+LL | let _ = 12.0f32;
+ | ~~~~
+
+error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
+ --> $DIR/attempted-access-non-fatal.rs:9:16
+ |
+LL | let _ = 34.L;
+ | ^
+ |
+help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
+ |
+LL | let _ = 34.0f64;
+ | ~~~~
+
+error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0610`.
diff --git a/src/test/ui/attr-from-macro.rs b/src/test/ui/attr-from-macro.rs
new file mode 100644
index 000000000..bb3a5c94d
--- /dev/null
+++ b/src/test/ui/attr-from-macro.rs
@@ -0,0 +1,20 @@
+// aux-build:attr-from-macro.rs
+// run-pass
+
+extern crate attr_from_macro;
+
+attr_from_macro::creator! {
+ struct Foo;
+ enum Bar;
+ enum FooBar;
+}
+
+fn main() {
+ // Checking the `repr(u32)` on the enum.
+ assert_eq!(4, std::mem::size_of::<Bar>());
+ // Checking the `repr(u16)` on the enum.
+ assert_eq!(2, std::mem::size_of::<FooBar>());
+
+ // Checking the Debug impl on the types.
+ eprintln!("{:?} {:?} {:?}", Foo, Bar::A, FooBar::A);
+}
diff --git a/src/test/ui/attributes/collapse-debuginfo-invalid.rs b/src/test/ui/attributes/collapse-debuginfo-invalid.rs
new file mode 100644
index 000000000..42d8982c1
--- /dev/null
+++ b/src/test/ui/attributes/collapse-debuginfo-invalid.rs
@@ -0,0 +1,110 @@
+#![feature(collapse_debuginfo)]
+#![feature(stmt_expr_attributes)]
+#![feature(type_alias_impl_trait)]
+#![no_std]
+
+// Test that the `#[collapse_debuginfo]` attribute can only be used on macro definitions.
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+extern crate std;
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+use std::collections::HashMap;
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+static FOO: u32 = 3;
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+const BAR: u32 = 3;
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+fn foo() {
+ let _ = #[collapse_debuginfo] || { };
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ #[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ let _ = 3;
+ let _ = #[collapse_debuginfo] 3;
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ match (3, 4) {
+ #[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ _ => (),
+ }
+}
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+mod bar {
+}
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+type Map = HashMap<u32, u32>;
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+enum Foo {
+ #[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ Variant,
+}
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+struct Bar {
+ #[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ field: u32,
+}
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+union Qux {
+ a: u32,
+ b: u16
+}
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+trait Foobar {
+ #[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ type Bar;
+}
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+type AFoobar = impl Foobar;
+
+impl Foobar for Bar {
+ type Bar = u32;
+}
+
+fn constraining() -> AFoobar {
+ Bar { field: 3 }
+}
+
+#[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+impl Bar {
+ #[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ const FOO: u32 = 3;
+
+ #[collapse_debuginfo]
+//~^ ERROR `collapse_debuginfo` attribute should be applied to macro definitions
+ fn bar(&self) {}
+}
+
+#[collapse_debuginfo]
+macro_rules! finally {
+ ($e:expr) => { $e }
+}
+
+fn main() {}
diff --git a/src/test/ui/attributes/collapse-debuginfo-invalid.stderr b/src/test/ui/attributes/collapse-debuginfo-invalid.stderr
new file mode 100644
index 000000000..01c476091
--- /dev/null
+++ b/src/test/ui/attributes/collapse-debuginfo-invalid.stderr
@@ -0,0 +1,222 @@
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:8:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | extern crate std;
+ | ----------------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:12:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | use std::collections::HashMap;
+ | ------------------------------ not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:16:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | static FOO: u32 = 3;
+ | -------------------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:20:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | const BAR: u32 = 3;
+ | ------------------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:24:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | / fn foo() {
+LL | | let _ = #[collapse_debuginfo] || { };
+LL | |
+LL | | #[collapse_debuginfo]
+... |
+LL | | }
+LL | | }
+ | |_- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:27:13
+ |
+LL | let _ = #[collapse_debuginfo] || { };
+ | ^^^^^^^^^^^^^^^^^^^^^ ------ not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:29:5
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | let _ = 3;
+ | ---------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:32:13
+ |
+LL | let _ = #[collapse_debuginfo] 3;
+ | ^^^^^^^^^^^^^^^^^^^^^ - not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:35:9
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | _ => (),
+ | ------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:41:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | / mod bar {
+LL | | }
+ | |_- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:46:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | type Map = HashMap<u32, u32>;
+ | ----------------------------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:50:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | / enum Foo {
+LL | | #[collapse_debuginfo]
+LL | |
+LL | | Variant,
+LL | | }
+ | |_- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:53:5
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | Variant,
+ | ------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:58:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | / struct Bar {
+LL | | #[collapse_debuginfo]
+LL | |
+LL | | field: u32,
+LL | | }
+ | |_- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:61:5
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | field: u32,
+ | ---------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:66:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | / union Qux {
+LL | | a: u32,
+LL | | b: u16
+LL | | }
+ | |_- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:73:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | / trait Foobar {
+LL | | #[collapse_debuginfo]
+LL | |
+LL | | type Bar;
+LL | | }
+ | |_- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:81:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | type AFoobar = impl Foobar;
+ | --------------------------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:93:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | / impl Bar {
+LL | | #[collapse_debuginfo]
+LL | |
+LL | | const FOO: u32 = 3;
+... |
+LL | | fn bar(&self) {}
+LL | | }
+ | |_- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:76:5
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | type Bar;
+ | --------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:96:5
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | const FOO: u32 = 3;
+ | ------------------- not a macro definition
+
+error: `collapse_debuginfo` attribute should be applied to macro definitions
+ --> $DIR/collapse-debuginfo-invalid.rs:100:5
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+LL |
+LL | fn bar(&self) {}
+ | ---------------- not a macro definition
+
+error: aborting due to 22 previous errors
+
diff --git a/src/test/ui/attributes/doc-attr.stderr b/src/test/ui/attributes/doc-attr.stderr
index cc2494c92..68df2771f 100644
--- a/src/test/ui/attributes/doc-attr.stderr
+++ b/src/test/ui/attributes/doc-attr.stderr
@@ -4,14 +4,14 @@ error: unknown `doc` attribute `as_ptr`
LL | #[doc(as_ptr)]
| ^^^^^^
|
+ = 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-attr.rs:2:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
- = 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>
error: invalid `doc` attribute
--> $DIR/doc-attr.rs:12:7
diff --git a/src/test/ui/attributes/invalid-doc-attr.stderr b/src/test/ui/attributes/invalid-doc-attr.stderr
index a4fa38179..3c66e587b 100644
--- a/src/test/ui/attributes/invalid-doc-attr.stderr
+++ b/src/test/ui/attributes/invalid-doc-attr.stderr
@@ -4,15 +4,15 @@ error: this attribute can only be applied at the crate level
LL | #[doc(test(no_crate_inject))]
| ^^^^^^^^^^^^^^^^^^^^^
|
+ = 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: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
note: the lint level is defined here
--> $DIR/invalid-doc-attr.rs:2:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
- = 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: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
help: to apply to the crate, use an inner attribute
|
LL | #![doc(test(no_crate_inject))]
diff --git a/src/test/ui/attributes/issue-100631.rs b/src/test/ui/attributes/issue-100631.rs
new file mode 100644
index 000000000..0fefcf83f
--- /dev/null
+++ b/src/test/ui/attributes/issue-100631.rs
@@ -0,0 +1,8 @@
+// issue #100631, make sure `TyCtxt::get_attr` only called by case that compiler
+// can reasonably deal with multiple attributes.
+// `repr` will use `TyCtxt::get_attrs` since it's `DuplicatesOk`.
+#[repr(C)] //~ ERROR: unsupported representation for zero-variant enum [E0084]
+#[repr(C)]
+enum Foo {}
+
+fn main() {}
diff --git a/src/test/ui/attributes/issue-100631.stderr b/src/test/ui/attributes/issue-100631.stderr
new file mode 100644
index 000000000..caa5351dd
--- /dev/null
+++ b/src/test/ui/attributes/issue-100631.stderr
@@ -0,0 +1,12 @@
+error[E0084]: unsupported representation for zero-variant enum
+ --> $DIR/issue-100631.rs:4:1
+ |
+LL | #[repr(C)]
+ | ^^^^^^^^^^
+LL | #[repr(C)]
+LL | enum Foo {}
+ | -------- zero-variant enum
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0084`.
diff --git a/src/test/ui/attributes/issue-90873.stderr b/src/test/ui/attributes/issue-90873.stderr
index 0852bb7ca..894ec8341 100644
--- a/src/test/ui/attributes/issue-90873.stderr
+++ b/src/test/ui/attributes/issue-90873.stderr
@@ -34,10 +34,10 @@ LL | #![a={impl std::ops::Neg for i8 {}}]
| ^ consider adding a `main` function to `$DIR/issue-90873.rs`
error: missing type for `static` item
- --> $DIR/issue-90873.rs:1:16
+ --> $DIR/issue-90873.rs:1:17
|
LL | #![u=||{static d=||1;}]
- | ^ help: provide a type for the item: `d: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: aborting due to 6 previous errors
diff --git a/src/test/ui/attributes/register-attr-tool-fail.rs b/src/test/ui/attributes/register-attr-tool-fail.rs
deleted file mode 100644
index 84736be84..000000000
--- a/src/test/ui/attributes/register-attr-tool-fail.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-#![feature(register_attr)]
-#![feature(register_tool)]
-
-#![register_attr] //~ ERROR malformed `register_attr` attribute input
-#![register_tool] //~ ERROR malformed `register_tool` attribute input
-
-#![register_attr(a::b)] //~ ERROR `register_attr` only accepts identifiers
-#![register_tool(a::b)] //~ ERROR `register_tool` only accepts identifiers
-
-#![register_attr(attr, attr)] //~ ERROR attribute `attr` was already registered
-#![register_tool(tool, tool)] //~ ERROR tool `tool` was already registered
-
-fn main() {}
diff --git a/src/test/ui/attributes/register-attr-tool-fail.stderr b/src/test/ui/attributes/register-attr-tool-fail.stderr
deleted file mode 100644
index 8f6977cb5..000000000
--- a/src/test/ui/attributes/register-attr-tool-fail.stderr
+++ /dev/null
@@ -1,42 +0,0 @@
-error: `register_attr` only accepts identifiers
- --> $DIR/register-attr-tool-fail.rs:7:18
- |
-LL | #![register_attr(a::b)]
- | ^^^^ not an identifier
-
-error: attribute `attr` was already registered
- --> $DIR/register-attr-tool-fail.rs:10:24
- |
-LL | #![register_attr(attr, attr)]
- | ---- ^^^^
- | |
- | already registered here
-
-error: `register_tool` only accepts identifiers
- --> $DIR/register-attr-tool-fail.rs:8:18
- |
-LL | #![register_tool(a::b)]
- | ^^^^ not an identifier
-
-error: tool `tool` was already registered
- --> $DIR/register-attr-tool-fail.rs:11:24
- |
-LL | #![register_tool(tool, tool)]
- | ---- ^^^^
- | |
- | already registered here
-
-error: malformed `register_attr` attribute input
- --> $DIR/register-attr-tool-fail.rs:4:1
- |
-LL | #![register_attr]
- | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#![register_attr(attr1, attr2, ...)]`
-
-error: malformed `register_tool` attribute input
- --> $DIR/register-attr-tool-fail.rs:5:1
- |
-LL | #![register_tool]
- | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#![register_tool(tool1, tool2, ...)]`
-
-error: aborting due to 6 previous errors
-
diff --git a/src/test/ui/attributes/register-attr-tool-import.rs b/src/test/ui/attributes/register-attr-tool-import.rs
deleted file mode 100644
index d3502c71f..000000000
--- a/src/test/ui/attributes/register-attr-tool-import.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// edition:2018
-// compile-flags: -Zsave-analysis
-// ~^ Also regression test for #69588
-
-#![feature(register_attr)]
-#![feature(register_tool)]
-
-#![register_attr(attr)]
-#![register_tool(tool)]
-
-use attr as renamed_attr; // OK
-use tool as renamed_tool; // OK
-
-#[renamed_attr] //~ ERROR cannot use an explicitly registered attribute through an import
-#[renamed_tool::attr] //~ ERROR cannot use a tool module through an import
- //~| ERROR cannot use a tool module through an import
-fn main() {}
diff --git a/src/test/ui/attributes/register-attr-tool-import.stderr b/src/test/ui/attributes/register-attr-tool-import.stderr
deleted file mode 100644
index 90b7e169a..000000000
--- a/src/test/ui/attributes/register-attr-tool-import.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error: cannot use an explicitly registered attribute through an import
- --> $DIR/register-attr-tool-import.rs:14:3
- |
-LL | #[renamed_attr]
- | ^^^^^^^^^^^^
- |
-note: the explicitly registered attribute imported here
- --> $DIR/register-attr-tool-import.rs:11:5
- |
-LL | use attr as renamed_attr; // OK
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: cannot use a tool module through an import
- --> $DIR/register-attr-tool-import.rs:15:3
- |
-LL | #[renamed_tool::attr]
- | ^^^^^^^^^^^^
- |
-note: the tool module imported here
- --> $DIR/register-attr-tool-import.rs:12:5
- |
-LL | use tool as renamed_tool; // OK
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: cannot use a tool module through an import
- --> $DIR/register-attr-tool-import.rs:15:3
- |
-LL | #[renamed_tool::attr]
- | ^^^^^^^^^^^^
- |
-note: the tool module imported here
- --> $DIR/register-attr-tool-import.rs:12:5
- |
-LL | use tool as renamed_tool; // OK
- | ^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/attributes/register-attr-tool-prelude.rs b/src/test/ui/attributes/register-attr-tool-prelude.rs
deleted file mode 100644
index d217a8146..000000000
--- a/src/test/ui/attributes/register-attr-tool-prelude.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#![feature(register_attr)]
-#![feature(register_tool)]
-
-#![register_attr(attr)]
-#![register_tool(tool)]
-
-#[no_implicit_prelude]
-mod m {
- #[attr] //~ ERROR cannot find attribute `attr` in this scope
- #[tool::attr] //~ ERROR failed to resolve: use of undeclared crate or module `tool`
- fn check() {}
-}
-
-fn main() {}
diff --git a/src/test/ui/attributes/register-attr-tool-prelude.stderr b/src/test/ui/attributes/register-attr-tool-prelude.stderr
deleted file mode 100644
index 905b66120..000000000
--- a/src/test/ui/attributes/register-attr-tool-prelude.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0433]: failed to resolve: use of undeclared crate or module `tool`
- --> $DIR/register-attr-tool-prelude.rs:10:7
- |
-LL | #[tool::attr]
- | ^^^^ use of undeclared crate or module `tool`
-
-error: cannot find attribute `attr` in this scope
- --> $DIR/register-attr-tool-prelude.rs:9:7
- |
-LL | #[attr]
- | ^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0433`.
diff --git a/src/test/ui/attributes/register-attr-tool-unused.rs b/src/test/ui/attributes/register-attr-tool-unused.rs
deleted file mode 100644
index 680614656..000000000
--- a/src/test/ui/attributes/register-attr-tool-unused.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-#![deny(unused)]
-
-#![feature(register_attr)]
-#![feature(register_tool)]
-
-#[register_attr(attr)] //~ ERROR crate-level attribute should be an inner attribute
-#[register_tool(tool)] //~ ERROR crate-level attribute should be an inner attribute
-fn main() {}
diff --git a/src/test/ui/attributes/register-attr-tool-unused.stderr b/src/test/ui/attributes/register-attr-tool-unused.stderr
deleted file mode 100644
index 8d2e1b6bc..000000000
--- a/src/test/ui/attributes/register-attr-tool-unused.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/register-attr-tool-unused.rs:6:1
- |
-LL | #[register_attr(attr)]
- | ^^^^^^^^^^^^^^^^^^^^^^
- |
-note: the lint level is defined here
- --> $DIR/register-attr-tool-unused.rs:1:9
- |
-LL | #![deny(unused)]
- | ^^^^^^
- = note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]`
-
-error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/register-attr-tool-unused.rs:7:1
- |
-LL | #[register_tool(tool)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/attributes/register-attr-tool.rs b/src/test/ui/attributes/register-attr-tool.rs
deleted file mode 100644
index ee9da74d4..000000000
--- a/src/test/ui/attributes/register-attr-tool.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// check-pass
-// compile-flags: --cfg foo
-
-#![feature(register_attr)]
-#![feature(register_tool)]
-
-#![register_attr(attr)]
-#![register_tool(tool)]
-#![register_tool(rustfmt, clippy)] // OK
-#![cfg_attr(foo, register_attr(conditional_attr))]
-#![cfg_attr(foo, register_tool(conditional_tool))]
-
-#[attr]
-#[tool::attr]
-#[rustfmt::attr]
-#[clippy::attr]
-#[conditional_attr]
-#[conditional_tool::attr]
-fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs b/src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs
new file mode 100644
index 000000000..74fbae035
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/auxiliary/sigpipe-utils.rs
@@ -0,0 +1,33 @@
+#![feature(rustc_private)]
+extern crate libc;
+
+/// So tests don't have to bring libc in scope themselves
+pub enum SignalHandler {
+ Ignore,
+ Default,
+}
+
+/// Helper to assert that [`libc::SIGPIPE`] has the expected signal handler.
+pub fn assert_sigpipe_handler(expected_handler: SignalHandler) {
+ #[cfg(unix)]
+ #[cfg(not(any(
+ target_os = "emscripten",
+ target_os = "fuchsia",
+ target_os = "horizon",
+ target_os = "android",
+ )))]
+ {
+ let prev = unsafe { libc::signal(libc::SIGPIPE, libc::SIG_IGN) };
+
+ let expected = match expected_handler {
+ SignalHandler::Ignore => libc::SIG_IGN,
+ SignalHandler::Default => libc::SIG_DFL,
+ };
+ assert_eq!(prev, expected, "expected sigpipe value matches actual value");
+
+ // Unlikely to matter, but restore the old value anyway
+ unsafe {
+ libc::signal(libc::SIGPIPE, prev);
+ };
+ }
+}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.rs
new file mode 100644
index 000000000..d6d020c52
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.rs
@@ -0,0 +1,4 @@
+#![feature(unix_sigpipe)]
+#![unix_sigpipe = "inherit"] //~ error: `unix_sigpipe` attribute cannot be used at crate level
+
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.stderr
new file mode 100644
index 000000000..a1fb4d678
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-crate.stderr
@@ -0,0 +1,13 @@
+error: `unix_sigpipe` attribute cannot be used at crate level
+ --> $DIR/unix_sigpipe-crate.rs:2:1
+ |
+LL | #![unix_sigpipe = "inherit"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: perhaps you meant to use an outer attribute
+ |
+LL | #[unix_sigpipe = "inherit"]
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs
new file mode 100644
index 000000000..294cb3852
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.rs
@@ -0,0 +1,5 @@
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe = "sig_ign"]
+#[unix_sigpipe = "inherit"] //~ error: multiple `unix_sigpipe` attributes
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr
new file mode 100644
index 000000000..2362c17a0
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-duplicates.stderr
@@ -0,0 +1,14 @@
+error: multiple `unix_sigpipe` attributes
+ --> $DIR/unix_sigpipe-duplicates.rs:4:1
+ |
+LL | #[unix_sigpipe = "inherit"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+ |
+note: attribute also specified here
+ --> $DIR/unix_sigpipe-duplicates.rs:3:1
+ |
+LL | #[unix_sigpipe = "sig_ign"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-error.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-error.rs
new file mode 100644
index 000000000..0a42a5b5e
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-error.rs
@@ -0,0 +1,13 @@
+// run-pass
+// aux-build:sigpipe-utils.rs
+
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe = "sig_ign"]
+fn main() {
+ extern crate sigpipe_utils;
+
+ // #[unix_sigpipe = "sig_ign"] is active, so the legacy behavior of ignoring
+ // SIGPIPE shall be in effect
+ sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Ignore);
+}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs
new file mode 100644
index 000000000..4f8648077
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs
@@ -0,0 +1,14 @@
+// run-pass
+// aux-build:sigpipe-utils.rs
+
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe = "inherit"]
+fn main() {
+ extern crate sigpipe_utils;
+
+ // #[unix_sigpipe = "inherit"] is active, so SIGPIPE shall NOT be ignored,
+ // instead the default handler shall be installed. (We assume that the
+ // process that runs these tests have the default handler.)
+ sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Default);
+}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs
new file mode 100644
index 000000000..b5ebc07a0
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.rs
@@ -0,0 +1,4 @@
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe(inherit)] //~ error: malformed `unix_sigpipe` attribute input
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr
new file mode 100644
index 000000000..59a87e139
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-list.stderr
@@ -0,0 +1,15 @@
+error: malformed `unix_sigpipe` attribute input
+ --> $DIR/unix_sigpipe-list.rs:3:1
+ |
+LL | #[unix_sigpipe(inherit)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: the following are the possible correct uses
+ |
+LL | #[unix_sigpipe = "inherit|sig_ign|sig_dfl"]
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | #[unix_sigpipe]
+ | ~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.rs
new file mode 100644
index 000000000..cde6719fc
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.rs
@@ -0,0 +1,6 @@
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe = "inherit"] //~ error: `unix_sigpipe` attribute can only be used on `fn main()`
+fn f() {}
+
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.stderr
new file mode 100644
index 000000000..c4b81118c
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-main-fn.stderr
@@ -0,0 +1,8 @@
+error: `unix_sigpipe` attribute can only be used on `fn main()`
+ --> $DIR/unix_sigpipe-non-main-fn.rs:3:1
+ |
+LL | #[unix_sigpipe = "inherit"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.rs
new file mode 100644
index 000000000..16f727639
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.rs
@@ -0,0 +1,8 @@
+#![feature(unix_sigpipe)]
+
+mod m {
+ #[unix_sigpipe = "inherit"] //~ error: `unix_sigpipe` attribute can only be used on root `fn main()`
+ fn main() {}
+}
+
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.stderr
new file mode 100644
index 000000000..a04f605ed
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-non-root-main.stderr
@@ -0,0 +1,8 @@
+error: `unix_sigpipe` attribute can only be used on root `fn main()`
+ --> $DIR/unix_sigpipe-non-root-main.rs:4:5
+ |
+LL | #[unix_sigpipe = "inherit"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs
new file mode 100644
index 000000000..100b4ce9f
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-not-used.rs
@@ -0,0 +1,9 @@
+// run-pass
+// aux-build:sigpipe-utils.rs
+
+fn main() {
+ extern crate sigpipe_utils;
+
+ // SIGPIPE shall be ignored since #[unix_sigpipe = "..."] is not used
+ sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Ignore);
+}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs
new file mode 100644
index 000000000..b5adc2e55
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-only-feature.rs
@@ -0,0 +1,13 @@
+// run-pass
+// aux-build:sigpipe-utils.rs
+
+#![feature(unix_sigpipe)]
+
+fn main() {
+ extern crate sigpipe_utils;
+
+ // Only #![feature(unix_sigpipe)] is enabled, not #[unix_sigpipe = "..."].
+ // This shall not change any behavior, so we still expect SIGPIPE to be
+ // ignored
+ sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Ignore);
+}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-rustc_main.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-rustc_main.rs
new file mode 100644
index 000000000..6befb9e95
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-rustc_main.rs
@@ -0,0 +1,15 @@
+// run-pass
+// aux-build:sigpipe-utils.rs
+
+#![feature(unix_sigpipe)]
+#![feature(rustc_attrs)]
+
+#[unix_sigpipe = "sig_dfl"]
+#[rustc_main]
+fn rustc_main() {
+ extern crate sigpipe_utils;
+
+ // #[unix_sigpipe = "sig_dfl"] is active, so SIGPIPE handler shall be
+ // SIG_DFL. Note that we have a #[rustc_main], but it should still work.
+ sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Default);
+}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-sig_dfl.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-sig_dfl.rs
new file mode 100644
index 000000000..238c0d57a
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-sig_dfl.rs
@@ -0,0 +1,13 @@
+// run-pass
+// aux-build:sigpipe-utils.rs
+
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe = "sig_dfl"]
+fn main() {
+ extern crate sigpipe_utils;
+
+ // #[unix_sigpipe = "sig_dfl"] is active, so SIGPIPE shall NOT be ignored, instead
+ // the default handler shall be installed
+ sigpipe_utils::assert_sigpipe_handler(sigpipe_utils::SignalHandler::Default);
+}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.rs
new file mode 100644
index 000000000..64fd5ec4f
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.rs
@@ -0,0 +1,6 @@
+#![feature(start)]
+#![feature(unix_sigpipe)]
+
+#[start]
+#[unix_sigpipe = "inherit"] //~ error: `unix_sigpipe` attribute can only be used on `fn main()`
+fn custom_start(argc: isize, argv: *const *const u8) -> isize { 0 }
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.stderr
new file mode 100644
index 000000000..2c9ce479b
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-start.stderr
@@ -0,0 +1,8 @@
+error: `unix_sigpipe` attribute can only be used on `fn main()`
+ --> $DIR/unix_sigpipe-start.rs:5:1
+ |
+LL | #[unix_sigpipe = "inherit"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.rs
new file mode 100644
index 000000000..a5e47cfeb
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.rs
@@ -0,0 +1,6 @@
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe = "inherit"] //~ error: `unix_sigpipe` attribute can only be used on `fn main()`
+struct S;
+
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.stderr
new file mode 100644
index 000000000..c56ee60bb
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-struct.stderr
@@ -0,0 +1,8 @@
+error: `unix_sigpipe` attribute can only be used on `fn main()`
+ --> $DIR/unix_sigpipe-struct.rs:3:1
+ |
+LL | #[unix_sigpipe = "inherit"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.rs
new file mode 100644
index 000000000..4ec25de00
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.rs
@@ -0,0 +1,4 @@
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe = "wrong"] //~ error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.stderr
new file mode 100644
index 000000000..a66e45aa2
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe-wrong.stderr
@@ -0,0 +1,8 @@
+error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
+ --> $DIR/unix_sigpipe-wrong.rs:3:1
+ |
+LL | #[unix_sigpipe = "wrong"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe.rs b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe.rs
new file mode 100644
index 000000000..7bf1c7350
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe.rs
@@ -0,0 +1,4 @@
+#![feature(unix_sigpipe)]
+
+#[unix_sigpipe] //~ error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
+fn main() {}
diff --git a/src/test/ui/attributes/unix_sigpipe/unix_sigpipe.stderr b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe.stderr
new file mode 100644
index 000000000..1b1eda825
--- /dev/null
+++ b/src/test/ui/attributes/unix_sigpipe/unix_sigpipe.stderr
@@ -0,0 +1,8 @@
+error: valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
+ --> $DIR/unix_sigpipe.rs:3:1
+ |
+LL | #[unix_sigpipe]
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/auto-ref-slice-plus-ref.stderr b/src/test/ui/auto-ref-slice-plus-ref.stderr
index eb8447ff0..e28830507 100644
--- a/src/test/ui/auto-ref-slice-plus-ref.stderr
+++ b/src/test/ui/auto-ref-slice-plus-ref.stderr
@@ -2,7 +2,7 @@ error[E0599]: no method named `test_mut` found for struct `Vec<{integer}>` in th
--> $DIR/auto-ref-slice-plus-ref.rs:7:7
|
LL | a.test_mut();
- | ^^^^^^^^ help: there is an associated function with a similar name: `get_mut`
+ | ^^^^^^^^ help: there is a method with a similar name: `get_mut`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `MyIter` defines an item `test_mut`, perhaps you need to implement it
diff --git a/src/test/ui/auto-traits/suspicious-impls-lint.stderr b/src/test/ui/auto-traits/suspicious-impls-lint.stderr
index 97b2d7221..9cd4e79f8 100644
--- a/src/test/ui/auto-traits/suspicious-impls-lint.stderr
+++ b/src/test/ui/auto-traits/suspicious-impls-lint.stderr
@@ -4,11 +4,6 @@ error: cross-crate traits with a default impl, like `Send`, should not be specia
LL | unsafe impl<T: Send> Send for MayImplementSendErr<&T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: the lint level is defined here
- --> $DIR/suspicious-impls-lint.rs:1:9
- |
-LL | #![deny(suspicious_auto_trait_impls)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= 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: `&T` is not a generic parameter
@@ -17,6 +12,11 @@ note: try using the same sequence of generic parameters as the struct definition
|
LL | struct MayImplementSendErr<T>(T);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/suspicious-impls-lint.rs:1:9
+ |
+LL | #![deny(suspicious_auto_trait_impls)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cross-crate traits with a default impl, like `Send`, should not be specialized
--> $DIR/suspicious-impls-lint.rs:21:1
diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr
index 7d6bf58f5..0c4970a72 100644
--- a/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr
+++ b/src/test/ui/auto-traits/typeck-default-trait-impl-constituent-types-2.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied in `(MyS2, MyS)`
- --> $DIR/typeck-default-trait-impl-constituent-types-2.rs:17:5
+ --> $DIR/typeck-default-trait-impl-constituent-types-2.rs:17:18
|
LL | is_mytrait::<(MyS2, MyS)>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ within `(MyS2, MyS)`, the trait `MyTrait` is not implemented for `MyS2`
+ | ^^^^^^^^^^^ within `(MyS2, MyS)`, the trait `MyTrait` is not implemented for `MyS2`
|
= note: required because it appears within the type `(MyS2, MyS)`
note: required by a bound in `is_mytrait`
diff --git a/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr b/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr
index 985cdce12..ce7095664 100644
--- a/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr
+++ b/src/test/ui/auto-traits/typeck-default-trait-impl-precedence.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `u32: Signed` is not satisfied
- --> $DIR/typeck-default-trait-impl-precedence.rs:19:5
+ --> $DIR/typeck-default-trait-impl-precedence.rs:19:20
|
LL | is_defaulted::<&'static u32>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Signed` is not implemented for `u32`
+ | ^^^^^^^^^^^^ the trait `Signed` is not implemented for `u32`
|
= help: the trait `Signed` is implemented for `i32`
-note: required because of the requirements on the impl of `Defaulted` for `&'static u32`
+note: required for `&'static u32` to implement `Defaulted`
--> $DIR/typeck-default-trait-impl-precedence.rs:10:19
|
LL | impl<'a,T:Signed> Defaulted for &'a T { }
diff --git a/src/test/ui/auxiliary/attr-from-macro.rs b/src/test/ui/auxiliary/attr-from-macro.rs
new file mode 100644
index 000000000..9b388675c
--- /dev/null
+++ b/src/test/ui/auxiliary/attr-from-macro.rs
@@ -0,0 +1,15 @@
+#[macro_export]
+macro_rules! creator {
+ (struct $name1:ident; enum $name2:ident; enum $name3:ident;) => {
+ #[derive(Debug)]
+ pub struct $name1;
+
+ #[derive(Debug)]
+ #[repr(u32)]
+ pub enum $name2 { A }
+
+ #[derive(Debug)]
+ #[repr(u16)]
+ pub enum $name3 { A }
+ }
+}
diff --git a/src/test/ui/backtrace-apple-no-dsymutil.rs b/src/test/ui/backtrace-apple-no-dsymutil.rs
index d32ad11a1..3844ebcfd 100644
--- a/src/test/ui/backtrace-apple-no-dsymutil.rs
+++ b/src/test/ui/backtrace-apple-no-dsymutil.rs
@@ -4,8 +4,6 @@
// compile-flags:-g -Csplit-debuginfo=unpacked
// only-macos
-#![feature(backtrace)]
-
use std::process::Command;
use std::str;
diff --git a/src/test/ui/backtrace.rs b/src/test/ui/backtrace.rs
index e2ac43fff..dd73dd988 100644
--- a/src/test/ui/backtrace.rs
+++ b/src/test/ui/backtrace.rs
@@ -4,6 +4,7 @@
// ignore-openbsd no support for libbacktrace without filename
// ignore-sgx no processes
// ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
+// ignore-fuchsia Backtraces not symbolized
// compile-flags:-g
// compile-flags:-Cstrip=none
diff --git a/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs b/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs
index 684172ca6..0450fe8ab 100644
--- a/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs
+++ b/src/test/ui/binding/fn-arg-incomplete-pattern-drop-order.rs
@@ -3,7 +3,6 @@
// Check that partially moved from function parameters are dropped after the
// named bindings that move from them.
-// ignore-wasm32-bare compiled with panic=abort by default
use std::{panic, cell::RefCell};
diff --git a/src/test/ui/binding/issue-53114-safety-checks.stderr b/src/test/ui/binding/issue-53114-safety-checks.stderr
index f3840273c..57a065d6d 100644
--- a/src/test/ui/binding/issue-53114-safety-checks.stderr
+++ b/src/test/ui/binding/issue-53114-safety-checks.stderr
@@ -4,11 +4,11 @@ error: reference to packed field is unaligned
LL | let _ = &p.b;
| ^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
error: reference to packed field is unaligned
--> $DIR/issue-53114-safety-checks.rs:29:17
@@ -109,11 +109,11 @@ error: reference to packed field is unaligned
LL | let _ = &p.b;
| ^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -122,11 +122,11 @@ error: reference to packed field is unaligned
LL | let (_,) = (&p.b,);
| ^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -135,11 +135,11 @@ error: reference to packed field is unaligned
LL | match &p.b { _ => { } }
| ^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -148,9 +148,9 @@ error: reference to packed field is unaligned
LL | match (&p.b,) { (_,) => { } }
| ^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
diff --git a/src/test/ui/binop/binary-op-on-double-ref.stderr b/src/test/ui/binop/binary-op-on-double-ref.stderr
index 1651f70d5..34826d2f4 100644
--- a/src/test/ui/binop/binary-op-on-double-ref.stderr
+++ b/src/test/ui/binop/binary-op-on-double-ref.stderr
@@ -6,7 +6,7 @@ LL | x % 2 == 0
| |
| &&{integer}
|
-help: `%` can be used on `{integer}`, you can dereference `x`
+help: `%` can be used on `&{integer}` if you dereference the left-hand side
|
LL | *x % 2 == 0
| +
diff --git a/src/test/ui/binop/issue-77910-1.rs b/src/test/ui/binop/issue-77910-1.rs
index d786e3358..95bbd6a60 100644
--- a/src/test/ui/binop/issue-77910-1.rs
+++ b/src/test/ui/binop/issue-77910-1.rs
@@ -7,5 +7,5 @@ fn main() {
// we shouldn't ice with the bound var here.
assert_eq!(foo, y);
//~^ ERROR binary operation `==` cannot be applied to type
- //~| ERROR `for<'r> fn(&'r i32) -> &'r i32 {foo}` doesn't implement `Debug`
+ //~| ERROR `for<'a> fn(&'a i32) -> &'a i32 {foo}` doesn't implement `Debug`
}
diff --git a/src/test/ui/binop/issue-77910-1.stderr b/src/test/ui/binop/issue-77910-1.stderr
index 68303b842..263a35d98 100644
--- a/src/test/ui/binop/issue-77910-1.stderr
+++ b/src/test/ui/binop/issue-77910-1.stderr
@@ -1,25 +1,25 @@
-error[E0369]: binary operation `==` cannot be applied to type `for<'r> fn(&'r i32) -> &'r i32 {foo}`
+error[E0369]: binary operation `==` cannot be applied to type `for<'a> fn(&'a i32) -> &'a i32 {foo}`
--> $DIR/issue-77910-1.rs:8:5
|
LL | assert_eq!(foo, y);
| ^^^^^^^^^^^^^^^^^^
| |
- | for<'r> fn(&'r i32) -> &'r i32 {foo}
+ | for<'a> fn(&'a i32) -> &'a i32 {foo}
| _
|
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0277]: `for<'r> fn(&'r i32) -> &'r i32 {foo}` doesn't implement `Debug`
+error[E0277]: `for<'a> fn(&'a i32) -> &'a i32 {foo}` doesn't implement `Debug`
--> $DIR/issue-77910-1.rs:8:5
|
LL | fn foo(s: &i32) -> &i32 {
| --- consider calling this function
...
LL | assert_eq!(foo, y);
- | ^^^^^^^^^^^^^^^^^^ `for<'r> fn(&'r i32) -> &'r i32 {foo}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ | ^^^^^^^^^^^^^^^^^^ `for<'a> fn(&'a i32) -> &'a i32 {foo}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = help: the trait `Debug` is not implemented for `for<'r> fn(&'r i32) -> &'r i32 {foo}`
- = help: use parentheses to call the function: `foo(s)`
+ = help: the trait `Debug` is not implemented for fn item `for<'a> fn(&'a i32) -> &'a i32 {foo}`
+ = help: use parentheses to call this function: `foo(/* &i32 */)`
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
diff --git a/src/test/ui/binop/issue-77910-2.stderr b/src/test/ui/binop/issue-77910-2.stderr
index 5477a5762..b3856b6ae 100644
--- a/src/test/ui/binop/issue-77910-2.stderr
+++ b/src/test/ui/binop/issue-77910-2.stderr
@@ -1,10 +1,15 @@
-error[E0369]: binary operation `==` cannot be applied to type `for<'r> fn(&'r i32) -> &'r i32 {foo}`
+error[E0369]: binary operation `==` cannot be applied to type `for<'a> fn(&'a i32) -> &'a i32 {foo}`
--> $DIR/issue-77910-2.rs:7:12
|
LL | if foo == y {}
| --- ^^ - _
| |
- | for<'r> fn(&'r i32) -> &'r i32 {foo}
+ | for<'a> fn(&'a i32) -> &'a i32 {foo}
+ |
+help: use parentheses to call this function
+ |
+LL | if foo(/* &i32 */) == y {}
+ | ++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/block-result/consider-removing-last-semi.stderr b/src/test/ui/block-result/consider-removing-last-semi.stderr
index 2412dcd32..9be0367ae 100644
--- a/src/test/ui/block-result/consider-removing-last-semi.stderr
+++ b/src/test/ui/block-result/consider-removing-last-semi.stderr
@@ -7,7 +7,7 @@ LL | pub fn f() -> String {
| implicitly returns `()` as its body has no tail or `return` expression
LL | 0u8;
LL | "bla".to_string();
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error[E0308]: mismatched types
--> $DIR/consider-removing-last-semi.rs:8:15
@@ -18,7 +18,7 @@ LL | pub fn g() -> String {
| implicitly returns `()` as its body has no tail or `return` expression
LL | "this won't work".to_string();
LL | "removeme".to_string();
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error[E0308]: mismatched types
--> $DIR/consider-removing-last-semi.rs:13:25
@@ -29,7 +29,7 @@ LL | pub fn macro_tests() -> u32 {
| implicitly returns `()` as its body has no tail or `return` expression
...
LL | mac!();
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error: aborting due to 3 previous errors
diff --git a/src/test/ui/block-result/issue-11714.stderr b/src/test/ui/block-result/issue-11714.stderr
index 5b8d96fd4..42fb3d3d4 100644
--- a/src/test/ui/block-result/issue-11714.stderr
+++ b/src/test/ui/block-result/issue-11714.stderr
@@ -7,7 +7,7 @@ LL | fn blah() -> i32 {
| implicitly returns `()` as its body has no tail or `return` expression
...
LL | ;
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error: aborting due to previous error
diff --git a/src/test/ui/block-result/issue-13428.stderr b/src/test/ui/block-result/issue-13428.stderr
index a33448edf..2b386d10c 100644
--- a/src/test/ui/block-result/issue-13428.stderr
+++ b/src/test/ui/block-result/issue-13428.stderr
@@ -15,7 +15,7 @@ LL | fn bar() -> String {
| implicitly returns `()` as its body has no tail or `return` expression
LL | "foobar".to_string()
LL | ;
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error: aborting due to 2 previous errors
diff --git a/src/test/ui/block-result/issue-22645.stderr b/src/test/ui/block-result/issue-22645.stderr
index 31663e8e8..28debd60a 100644
--- a/src/test/ui/block-result/issue-22645.stderr
+++ b/src/test/ui/block-result/issue-22645.stderr
@@ -5,7 +5,7 @@ LL | b + 3
| ^ the trait `Scalar` is not implemented for `{integer}`
|
= help: the trait `Scalar` is implemented for `f64`
-note: required because of the requirements on the impl of `Add<{integer}>` for `Bob`
+note: required for `Bob` to implement `Add<{integer}>`
--> $DIR/issue-22645.rs:8:19
|
LL | impl<RHS: Scalar> Add <RHS> for Bob {
diff --git a/src/test/ui/block-result/issue-3563.stderr b/src/test/ui/block-result/issue-3563.stderr
index 5255e48be..be551f6e8 100644
--- a/src/test/ui/block-result/issue-3563.stderr
+++ b/src/test/ui/block-result/issue-3563.stderr
@@ -2,7 +2,7 @@ error[E0599]: no method named `b` found for reference `&Self` in the current sco
--> $DIR/issue-3563.rs:3:17
|
LL | || self.b()
- | ^ help: there is an associated function with a similar name: `a`
+ | ^ help: there is a method with a similar name: `a`
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/anonymous-region-in-apit.rs b/src/test/ui/borrowck/anonymous-region-in-apit.rs
new file mode 100644
index 000000000..7799a7cb1
--- /dev/null
+++ b/src/test/ui/borrowck/anonymous-region-in-apit.rs
@@ -0,0 +1,12 @@
+#![feature(anonymous_lifetime_in_impl_trait)]
+
+trait Foo<T> {
+ fn bar(self, baz: T);
+}
+
+fn qux(foo: impl Foo<&str>) {
+ |baz: &str| foo.bar(baz);
+ //~^ ERROR borrowed data escapes outside of closure
+}
+
+fn main() {}
diff --git a/src/test/ui/borrowck/anonymous-region-in-apit.stderr b/src/test/ui/borrowck/anonymous-region-in-apit.stderr
new file mode 100644
index 000000000..9e100f8ac
--- /dev/null
+++ b/src/test/ui/borrowck/anonymous-region-in-apit.stderr
@@ -0,0 +1,16 @@
+error[E0521]: borrowed data escapes outside of closure
+ --> $DIR/anonymous-region-in-apit.rs:8:17
+ |
+LL | fn qux(foo: impl Foo<&str>) {
+ | --- lifetime `'2` appears in the type of `foo`
+LL | |baz: &str| foo.bar(baz);
+ | --- - ^^^^^^^^^^^^
+ | | | |
+ | | | `baz` escapes the closure body here
+ | | | argument requires that `'1` must outlive `'2`
+ | | let's call the lifetime of this reference `'1`
+ | `baz` is a reference that is only valid in the closure body
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr b/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
index d4f819308..1fd1eb128 100644
--- a/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
+++ b/src/test/ui/borrowck/bindings-after-at-or-patterns-slice-patterns-box-patterns.stderr
@@ -23,7 +23,7 @@ LL | fn bindings_after_at_slice_patterns_move_binding(x: [String; 4]) {
| - move occurs because `x` has type `[String; 4]`, which does not implement the `Copy` trait
LL | match x {
LL | a @ [.., _] => (),
- | ----------- value moved here
+ | - value moved here
...
LL | &x;
| ^^ value borrowed here after move
@@ -32,7 +32,7 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as muta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:28:5
|
LL | ref mut foo @ [.., _] => Some(foo),
- | --------------------- mutable borrow occurs here
+ | ----------- mutable borrow occurs here
...
LL | &x;
| ^^ immutable borrow occurs here
@@ -44,7 +44,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:50:5
|
LL | [ref foo @ .., ref bar] => Some(foo),
- | ------------ immutable borrow occurs here
+ | ------- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -56,7 +56,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:62:5
|
LL | ref foo @ [.., ref bar] => Some(foo),
- | ----------------------- immutable borrow occurs here
+ | ------- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -71,7 +71,7 @@ LL | fn bindings_after_at_or_patterns_move(x: Option<Test>) {
| - move occurs because `x` has type `Option<Test>`, which does not implement the `Copy` trait
LL | match x {
LL | foo @ Some(Test::Foo | Test::Bar) => (),
- | ---------------------------------
+ | ---
| |
| value moved here
| value moved here
@@ -83,7 +83,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:86:5
|
LL | ref foo @ Some(Test::Foo | Test::Bar) => Some(foo),
- | ------------------------------------- immutable borrow occurs here
+ | ------- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -95,7 +95,7 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as muta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:98:5
|
LL | ref mut foo @ Some(Test::Foo | Test::Bar) => Some(foo),
- | ----------------------------------------- mutable borrow occurs here
+ | ----------- mutable borrow occurs here
...
LL | &x;
| ^^ immutable borrow occurs here
@@ -107,7 +107,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:112:5
|
LL | ref foo @ Some(box ref s) => Some(foo),
- | ------------------------- immutable borrow occurs here
+ | ------- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -122,7 +122,7 @@ LL | fn bindings_after_at_slice_patterns_or_patterns_moves(x: [Option<Test>; 4])
| - move occurs because `x` has type `[Option<Test>; 4]`, which does not implement the `Copy` trait
LL | match x {
LL | a @ [.., Some(Test::Foo | Test::Bar)] => (),
- | -------------------------------------
+ | -
| |
| value moved here
| value moved here
@@ -134,7 +134,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:144:5
|
LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(a),
- | ------------------------------------------------- immutable borrow occurs here
+ | ----- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -146,7 +146,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:156:5
|
LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(b),
- | ---------- immutable borrow occurs here
+ | ----- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -158,7 +158,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:170:5
|
LL | [_, ref a @ Some(box ref b), ..] => Some(a),
- | ----------------------- immutable borrow occurs here
+ | ----- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -170,7 +170,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:186:5
|
LL | [_, ref a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
- | ------------------------------------------- immutable borrow occurs here
+ | ----- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
@@ -182,7 +182,7 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as muta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:200:5
|
LL | [_, ref mut a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
- | ----------------------------------------------- mutable borrow occurs here
+ | --------- mutable borrow occurs here
...
LL | &x;
| ^^ immutable borrow occurs here
@@ -194,7 +194,7 @@ error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immuta
--> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:214:5
|
LL | ref a @ [_, ref b @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
- | ------------------------------------------------------------ immutable borrow occurs here
+ | ----- immutable borrow occurs here
...
LL | &mut x;
| ^^^^^^ mutable borrow occurs here
diff --git a/src/test/ui/borrowck/borrowck-block-unint.stderr b/src/test/ui/borrowck/borrowck-block-unint.stderr
index e720db1c6..f47921a97 100644
--- a/src/test/ui/borrowck/borrowck-block-unint.stderr
+++ b/src/test/ui/borrowck/borrowck-block-unint.stderr
@@ -7,6 +7,11 @@ LL | force(|| {
| ^^ `x` used here but it isn't initialized
LL | println!("{}", x);
| - borrow occurs due to use in closure
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-break-uninit-2.stderr b/src/test/ui/borrowck/borrowck-break-uninit-2.stderr
index 91038b3ad..ea93a8f40 100644
--- a/src/test/ui/borrowck/borrowck-break-uninit-2.stderr
+++ b/src/test/ui/borrowck/borrowck-break-uninit-2.stderr
@@ -8,6 +8,10 @@ LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= 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 assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-break-uninit.stderr b/src/test/ui/borrowck/borrowck-break-uninit.stderr
index 8d0c9582f..a7a8fc2ff 100644
--- a/src/test/ui/borrowck/borrowck-break-uninit.stderr
+++ b/src/test/ui/borrowck/borrowck-break-uninit.stderr
@@ -8,6 +8,10 @@ LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= 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 assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
index f909dbc40..2c1b9c10d 100644
--- a/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
+++ b/src/test/ui/borrowck/borrowck-describe-lvalue.stderr
@@ -36,6 +36,10 @@ LL | | }
|
= note: `FnMut` closures only have access to their captured variables while they are executing...
= note: ...therefore, they cannot allow references to captured variables to escape
+help: consider adding 'move' keyword before the nested closure
+ |
+LL | move || {
+ | ++++
error[E0503]: cannot use `f.x` because it was mutably borrowed
--> $DIR/borrowck-describe-lvalue.rs:37:9
@@ -196,7 +200,7 @@ LL | let x = &mut v;
| ------ borrow of `v` occurs here
LL | match v {
LL | &[x @ ..] => println!("{:?}", x),
- | ^^^^^^ use of borrowed `v`
+ | ^ use of borrowed `v`
...
LL | drop(x);
| - borrow later used here
@@ -208,7 +212,7 @@ LL | let x = &mut v;
| ------ borrow of `v` occurs here
...
LL | &[_, x @ ..] => println!("{:?}", x),
- | ^^^^^^ use of borrowed `v`
+ | ^ use of borrowed `v`
...
LL | drop(x);
| - borrow later used here
@@ -220,7 +224,7 @@ LL | let x = &mut v;
| ------ borrow of `v` occurs here
...
LL | &[x @ .., _] => println!("{:?}", x),
- | ^^^^^^ use of borrowed `v`
+ | ^ use of borrowed `v`
...
LL | drop(x);
| - borrow later used here
@@ -232,7 +236,7 @@ LL | let x = &mut v;
| ------ borrow of `v` occurs here
...
LL | &[_, x @ .., _] => println!("{:?}", x),
- | ^^^^^^ use of borrowed `v`
+ | ^ use of borrowed `v`
...
LL | drop(x);
| - borrow later used here
diff --git a/src/test/ui/borrowck/borrowck-init-in-called-fn-expr.stderr b/src/test/ui/borrowck/borrowck-init-in-called-fn-expr.stderr
index e8a2fbc91..1a22b5f09 100644
--- a/src/test/ui/borrowck/borrowck-init-in-called-fn-expr.stderr
+++ b/src/test/ui/borrowck/borrowck-init-in-called-fn-expr.stderr
@@ -5,6 +5,11 @@ LL | let i: isize;
| - binding declared here but left uninitialized
LL | i
| ^ `i` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let i: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-init-in-fn-expr.stderr b/src/test/ui/borrowck/borrowck-init-in-fn-expr.stderr
index 1e950d6a2..f1b9b9aa7 100644
--- a/src/test/ui/borrowck/borrowck-init-in-fn-expr.stderr
+++ b/src/test/ui/borrowck/borrowck-init-in-fn-expr.stderr
@@ -5,6 +5,11 @@ LL | let i: isize;
| - binding declared here but left uninitialized
LL | i
| ^ `i` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let i: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-init-in-fru.stderr b/src/test/ui/borrowck/borrowck-init-in-fru.stderr
index 83a3e3e0e..39b28811a 100644
--- a/src/test/ui/borrowck/borrowck-init-in-fru.stderr
+++ b/src/test/ui/borrowck/borrowck-init-in-fru.stderr
@@ -5,6 +5,11 @@ LL | let mut origin: Point;
| ---------- binding declared here but left uninitialized
LL | origin = Point { x: 10, ..origin };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ `origin.y` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut origin: Point = todo!();
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-init-op-equal.stderr b/src/test/ui/borrowck/borrowck-init-op-equal.stderr
index 74704b2ab..ef0fa6df4 100644
--- a/src/test/ui/borrowck/borrowck-init-op-equal.stderr
+++ b/src/test/ui/borrowck/borrowck-init-op-equal.stderr
@@ -5,6 +5,11 @@ LL | let v: isize;
| - binding declared here but left uninitialized
LL | v += 1;
| ^^^^^^ `v` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let v: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-init-plus-equal.stderr b/src/test/ui/borrowck/borrowck-init-plus-equal.stderr
index 7542576d6..cec053318 100644
--- a/src/test/ui/borrowck/borrowck-init-plus-equal.stderr
+++ b/src/test/ui/borrowck/borrowck-init-plus-equal.stderr
@@ -5,6 +5,11 @@ LL | let mut v: isize;
| ----- binding declared here but left uninitialized
LL | v = v + 1;
| ^ `v` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut v: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array-match.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array-match.stderr
index 3249aae8f..346b82a26 100644
--- a/src/test/ui/borrowck/borrowck-move-out-from-array-match.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-from-array-match.stderr
@@ -79,7 +79,7 @@ error[E0382]: use of moved value: `a[..].0`
--> $DIR/borrowck-move-out-from-array-match.rs:89:11
|
LL | [_y @ .., _, _] => {}
- | ------- value moved here
+ | -- value moved here
...
LL | [(_x, _), _, _] => {}
| ^^ value used here after move
@@ -90,7 +90,7 @@ error[E0382]: use of moved value: `a[..].0`
--> $DIR/borrowck-move-out-from-array-match.rs:99:15
|
LL | [_, _, _y @ ..] => {}
- | ------- value moved here
+ | -- value moved here
...
LL | [.., (_x, _)] => {}
| ^^ value used here after move
@@ -101,7 +101,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-match.rs:110:11
|
LL | [x @ .., _] => {}
- | ------ value partially moved here
+ | - value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array-no-overlap-match.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array-no-overlap-match.stderr
index c19800226..6c6a25c25 100644
--- a/src/test/ui/borrowck/borrowck-move-out-from-array-no-overlap-match.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-from-array-no-overlap-match.stderr
@@ -68,7 +68,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-no-overlap-match.rs:85:11
|
LL | [_, _y @ ..] => {}
- | ------- value partially moved here
+ | -- value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
@@ -79,7 +79,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-no-overlap-match.rs:96:11
|
LL | [_y @ .., _] => {}
- | ------- value partially moved here
+ | -- value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
@@ -90,7 +90,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-no-overlap-match.rs:109:11
|
LL | [x @ .., _, _] => {}
- | ------ value partially moved here
+ | - value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array-use-match.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array-use-match.stderr
index 8f2da9d20..77702e145 100644
--- a/src/test/ui/borrowck/borrowck-move-out-from-array-use-match.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-from-array-use-match.stderr
@@ -79,7 +79,7 @@ error[E0382]: borrow of moved value: `a[..]`
--> $DIR/borrowck-move-out-from-array-use-match.rs:89:11
|
LL | [_y @ .., _, _] => {}
- | ------- value moved here
+ | -- value moved here
...
LL | [(ref _x, _), _, _] => {}
| ^^^^^^ value borrowed here after move
@@ -90,7 +90,7 @@ error[E0382]: borrow of moved value: `a[..]`
--> $DIR/borrowck-move-out-from-array-use-match.rs:99:15
|
LL | [_, _, _y @ ..] => {}
- | ------- value moved here
+ | -- value moved here
...
LL | [.., (ref _x, _)] => {}
| ^^^^^^ value borrowed here after move
@@ -101,7 +101,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use-match.rs:110:11
|
LL | [x @ .., _] => {}
- | ------ value partially moved here
+ | - value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
@@ -134,7 +134,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use-match.rs:139:5
|
LL | [_, _, _x @ ..] => {}
- | ------- value partially moved here
+ | -- value partially moved here
LL | }
LL | a[0] = Default::default();
| ^^^^ value used here after partial move
@@ -145,7 +145,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use-match.rs:147:5
|
LL | [_, _, _x @ ..] => {}
- | ------- value partially moved here
+ | -- value partially moved here
LL | }
LL | a[0].1 = Default::default();
| ^^^^ value used here after partial move
diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array-use-no-overlap-match.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array-use-no-overlap-match.stderr
index 4b27f03dc..6cc2c2f7a 100644
--- a/src/test/ui/borrowck/borrowck-move-out-from-array-use-no-overlap-match.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-from-array-use-no-overlap-match.stderr
@@ -68,7 +68,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use-no-overlap-match.rs:85:11
|
LL | [_, _y @ ..] => {}
- | ------- value partially moved here
+ | -- value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
@@ -79,7 +79,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use-no-overlap-match.rs:96:11
|
LL | [_y @ .., _] => {}
- | ------- value partially moved here
+ | -- value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
@@ -90,7 +90,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use-no-overlap-match.rs:109:11
|
LL | [x @ .., _, _] => {}
- | ------ value partially moved here
+ | - value partially moved here
LL | }
LL | match a {
| ^ value used here after partial move
diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array-use.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array-use.stderr
index b0bad6e99..9add7553a 100644
--- a/src/test/ui/borrowck/borrowck-move-out-from-array-use.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-from-array-use.stderr
@@ -34,7 +34,7 @@ error[E0382]: borrow of partially moved value: `a`
LL | let [_x, _, _] = a;
| -- value partially moved here
LL | let [ref _y @ .., _, _] = a;
- | ^^^^^^^^^^^ value borrowed here after partial move
+ | ^^^^^^ value borrowed here after partial move
|
= note: partial move occurs because `a[..]` has type `(String, String)`, which does not implement the `Copy` trait
@@ -44,7 +44,7 @@ error[E0382]: borrow of partially moved value: `a`
LL | let [.., _x] = a;
| -- value partially moved here
LL | let [_, _, ref _y @ ..] = a;
- | ^^^^^^^^^^^ value borrowed here after partial move
+ | ^^^^^^ value borrowed here after partial move
|
= note: partial move occurs because `a[..]` has type `(String, String)`, which does not implement the `Copy` trait
@@ -54,7 +54,7 @@ error[E0382]: borrow of partially moved value: `a`
LL | let [(_x, _), _, _] = a;
| -- value partially moved here
LL | let [ref _y @ .., _, _] = a;
- | ^^^^^^^^^^^ value borrowed here after partial move
+ | ^^^^^^ value borrowed here after partial move
|
= note: partial move occurs because `a[..].0` has type `String`, which does not implement the `Copy` trait
@@ -64,7 +64,7 @@ error[E0382]: borrow of partially moved value: `a`
LL | let [.., (_x, _)] = a;
| -- value partially moved here
LL | let [_, _, ref _y @ ..] = a;
- | ^^^^^^^^^^^ value borrowed here after partial move
+ | ^^^^^^ value borrowed here after partial move
|
= note: partial move occurs because `a[..].0` has type `String`, which does not implement the `Copy` trait
@@ -72,7 +72,7 @@ error[E0382]: borrow of moved value: `a[..]`
--> $DIR/borrowck-move-out-from-array-use.rs:54:11
|
LL | let [_y @ .., _, _] = a;
- | ------- value moved here
+ | -- value moved here
LL | let [(ref _x, _), _, _] = a;
| ^^^^^^ value borrowed here after move
|
@@ -82,7 +82,7 @@ error[E0382]: borrow of moved value: `a[..]`
--> $DIR/borrowck-move-out-from-array-use.rs:60:15
|
LL | let [_, _, _y @ ..] = a;
- | ------- value moved here
+ | -- value moved here
LL | let [.., (ref _x, _)] = a;
| ^^^^^^ value borrowed here after move
|
@@ -92,9 +92,9 @@ error[E0382]: borrow of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use.rs:68:13
|
LL | let [x @ .., _] = a;
- | ------ value partially moved here
+ | - value partially moved here
LL | let [_, ref _y @ ..] = a;
- | ^^^^^^^^^^^ value borrowed here after partial move
+ | ^^^^^^ value borrowed here after partial move
|
= note: partial move occurs because `a[..]` has type `(String, String)`, which does not implement the `Copy` trait
@@ -122,7 +122,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use.rs:88:5
|
LL | let [_, _, _x @ ..] = a;
- | ------- value partially moved here
+ | -- value partially moved here
LL | a[0] = Default::default();
| ^^^^ value used here after partial move
|
@@ -132,7 +132,7 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array-use.rs:94:5
|
LL | let [_, _, _x @ ..] = a;
- | ------- value partially moved here
+ | -- value partially moved here
LL | a[0].1 = Default::default();
| ^^^^ value used here after partial move
|
diff --git a/src/test/ui/borrowck/borrowck-move-out-from-array.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array.stderr
index 1fc2b292b..363effcfe 100644
--- a/src/test/ui/borrowck/borrowck-move-out-from-array.stderr
+++ b/src/test/ui/borrowck/borrowck-move-out-from-array.stderr
@@ -34,7 +34,7 @@ error[E0382]: use of partially moved value: `a`
LL | let [_x, _, _] = a;
| -- value partially moved here
LL | let [_y @ .., _, _] = a;
- | ^^^^^^^ value used here after partial move
+ | ^^ value used here after partial move
|
= note: partial move occurs because `a[..]` has type `(String, String)`, which does not implement the `Copy` trait
@@ -44,7 +44,7 @@ error[E0382]: use of partially moved value: `a`
LL | let [.., _x] = a;
| -- value partially moved here
LL | let [_, _, _y @ ..] = a;
- | ^^^^^^^ value used here after partial move
+ | ^^ value used here after partial move
|
= note: partial move occurs because `a[..]` has type `(String, String)`, which does not implement the `Copy` trait
@@ -54,7 +54,7 @@ error[E0382]: use of partially moved value: `a`
LL | let [(_x, _), _, _] = a;
| -- value partially moved here
LL | let [_y @ .., _, _] = a;
- | ^^^^^^^ value used here after partial move
+ | ^^ value used here after partial move
|
= note: partial move occurs because `a[..].0` has type `String`, which does not implement the `Copy` trait
@@ -64,7 +64,7 @@ error[E0382]: use of partially moved value: `a`
LL | let [.., (_x, _)] = a;
| -- value partially moved here
LL | let [_, _, _y @ ..] = a;
- | ^^^^^^^ value used here after partial move
+ | ^^ value used here after partial move
|
= note: partial move occurs because `a[..].0` has type `String`, which does not implement the `Copy` trait
@@ -72,7 +72,7 @@ error[E0382]: use of moved value: `a[..].0`
--> $DIR/borrowck-move-out-from-array.rs:54:11
|
LL | let [_y @ .., _, _] = a;
- | ------- value moved here
+ | -- value moved here
LL | let [(_x, _), _, _] = a;
| ^^ value used here after move
|
@@ -82,7 +82,7 @@ error[E0382]: use of moved value: `a[..].0`
--> $DIR/borrowck-move-out-from-array.rs:60:15
|
LL | let [_, _, _y @ ..] = a;
- | ------- value moved here
+ | -- value moved here
LL | let [.., (_x, _)] = a;
| ^^ value used here after move
|
@@ -92,9 +92,9 @@ error[E0382]: use of partially moved value: `a`
--> $DIR/borrowck-move-out-from-array.rs:68:13
|
LL | let [x @ .., _] = a;
- | ------ value partially moved here
+ | - value partially moved here
LL | let [_, _y @ ..] = a;
- | ^^^^^^^ value used here after partial move
+ | ^^ value used here after partial move
|
= note: partial move occurs because `a[..]` has type `(String, String)`, which does not implement the `Copy` trait
diff --git a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr
index 15ac73760..d2b845619 100644
--- a/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr
+++ b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.stderr
@@ -25,7 +25,10 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/borrowck-mut-borrow-linear-errors.rs:12:30
|
LL | _ => { addr.push(&mut x); }
- | ^^^^^^ `x` was mutably borrowed here in the previous iteration of the loop
+ | ----------^^^^^^-
+ | | |
+ | | `x` was mutably borrowed here in the previous iteration of the loop
+ | first borrow used here, in later iteration of loop
error: aborting due to 3 previous errors
diff --git a/src/test/ui/borrowck/borrowck-return.stderr b/src/test/ui/borrowck/borrowck-return.stderr
index 1c916e223..9799357c9 100644
--- a/src/test/ui/borrowck/borrowck-return.stderr
+++ b/src/test/ui/borrowck/borrowck-return.stderr
@@ -5,6 +5,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | return x;
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-array.stderr b/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-array.stderr
index b8ac7a3a4..f4324110c 100644
--- a/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-array.stderr
+++ b/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-array.stderr
@@ -57,7 +57,7 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
LL | let [ref first, ref second, ..] = *s;
| ---------- immutable borrow occurs here
LL | let [_, ref mut tail @ ..] = *s;
- | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+ | ^^^^^^^^^^^^ mutable borrow occurs here
LL | nop(&[first, second]);
| ------ immutable borrow later used here
@@ -67,7 +67,7 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
LL | let [.., ref second, ref first] = *s;
| ---------- immutable borrow occurs here
LL | let [ref mut tail @ .., _] = *s;
- | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+ | ^^^^^^^^^^^^ mutable borrow occurs here
LL | nop(&[first, second]);
| ------ immutable borrow later used here
@@ -75,9 +75,9 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
--> $DIR/borrowck-slice-pattern-element-loan-array.rs:46:10
|
LL | let [_, ref s1 @ ..] = *s;
- | ----------- immutable borrow occurs here
+ | ------ immutable borrow occurs here
LL | let [ref mut s2 @ .., _, _] = *s;
- | ^^^^^^^^^^^^^^^ mutable borrow occurs here
+ | ^^^^^^^^^^ mutable borrow occurs here
LL | nop_subslice(s1);
| -- immutable borrow later used here
diff --git a/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr b/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr
index d3388e071..f9a63bd49 100644
--- a/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr
+++ b/src/test/ui/borrowck/borrowck-slice-pattern-element-loan-slice.stderr
@@ -88,7 +88,7 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
LL | if let [ref first, ref second, ..] = *s {
| ---------- immutable borrow occurs here
LL | if let [_, ref mut tail @ ..] = *s {
- | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+ | ^^^^^^^^^^^^ mutable borrow occurs here
LL | nop(&[first, second]);
| ------ immutable borrow later used here
@@ -98,7 +98,7 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
LL | if let [.., ref second, ref first] = *s {
| ---------- immutable borrow occurs here
LL | if let [ref mut tail @ .., _] = *s {
- | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
+ | ^^^^^^^^^^^^ mutable borrow occurs here
LL | nop(&[first, second]);
| ------ immutable borrow later used here
@@ -106,9 +106,9 @@ error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as im
--> $DIR/borrowck-slice-pattern-element-loan-slice.rs:65:17
|
LL | if let [_, _, _, ref s1 @ ..] = *s {
- | ----------- immutable borrow occurs here
+ | ------ immutable borrow occurs here
LL | if let [ref mut s2 @ .., _, _, _] = *s {
- | ^^^^^^^^^^^^^^^ mutable borrow occurs here
+ | ^^^^^^^^^^ mutable borrow occurs here
LL | nop_subslice(s1);
| -- immutable borrow later used here
diff --git a/src/test/ui/borrowck/borrowck-storage-dead.stderr b/src/test/ui/borrowck/borrowck-storage-dead.stderr
index 2cea4392d..3a413153a 100644
--- a/src/test/ui/borrowck/borrowck-storage-dead.stderr
+++ b/src/test/ui/borrowck/borrowck-storage-dead.stderr
@@ -5,6 +5,11 @@ LL | let x: i32;
| - binding declared here but left uninitialized
LL | let _ = x + 1;
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: i32 = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-uninit-after-item.stderr b/src/test/ui/borrowck/borrowck-uninit-after-item.stderr
index 588b1b0c9..071598b42 100644
--- a/src/test/ui/borrowck/borrowck-uninit-after-item.stderr
+++ b/src/test/ui/borrowck/borrowck-uninit-after-item.stderr
@@ -6,6 +6,11 @@ LL | let bar;
LL | fn baz(_x: isize) { }
LL | baz(bar);
| ^^^ `bar` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let bar = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-uninit-field-access.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.stderr
index 6a38a7989..f0f4ad704 100644
--- a/src/test/ui/borrowck/borrowck-uninit-field-access.stderr
+++ b/src/test/ui/borrowck/borrowck-uninit-field-access.stderr
@@ -5,6 +5,11 @@ LL | let mut a: Point;
| ----- binding declared here but left uninitialized
LL | let _ = a.x + 1;
| ^^^ `a.x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut a: Point = Default::default();
+ | ++++++++++++++++++++
error[E0382]: use of moved value: `line1.origin`
--> $DIR/borrowck-uninit-field-access.rs:25:13
diff --git a/src/test/ui/borrowck/borrowck-uninit-in-assignop.stderr b/src/test/ui/borrowck/borrowck-uninit-in-assignop.stderr
index 744cb14e6..fdbb451bd 100644
--- a/src/test/ui/borrowck/borrowck-uninit-in-assignop.stderr
+++ b/src/test/ui/borrowck/borrowck-uninit-in-assignop.stderr
@@ -5,6 +5,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x += 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:9:5
@@ -13,6 +18,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x -= 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:12:5
@@ -21,6 +31,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x *= 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:15:5
@@ -29,6 +44,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x /= 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:18:5
@@ -37,6 +57,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x %= 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:21:5
@@ -45,6 +70,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x ^= 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:24:5
@@ -53,6 +83,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x &= 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:27:5
@@ -61,6 +96,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x |= 1;
| ^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:30:5
@@ -69,6 +109,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x <<= 1;
| ^^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-in-assignop.rs:33:5
@@ -77,6 +122,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | x >>= 1;
| ^^^^^^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error: aborting due to 10 previous errors
diff --git a/src/test/ui/borrowck/borrowck-uninit-ref-chain.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.stderr
index c486cb6dd..73fded754 100644
--- a/src/test/ui/borrowck/borrowck-uninit-ref-chain.stderr
+++ b/src/test/ui/borrowck/borrowck-uninit-ref-chain.stderr
@@ -5,6 +5,11 @@ LL | let x: &&Box<i32>;
| - binding declared here but left uninitialized
LL | let _y = &**x;
| ^^^^ `**x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: &&Box<i32> = todo!();
+ | +++++++++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-ref-chain.rs:11:14
@@ -13,6 +18,11 @@ LL | let x: &&S<i32, i32>;
| - binding declared here but left uninitialized
LL | let _y = &**x;
| ^^^^ `**x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: &&S<i32, i32> = todo!();
+ | +++++++++
error[E0381]: used binding `x` isn't initialized
--> $DIR/borrowck-uninit-ref-chain.rs:14:14
@@ -21,6 +31,11 @@ LL | let x: &&i32;
| - binding declared here but left uninitialized
LL | let _y = &**x;
| ^^^^ `**x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: &&i32 = todo!();
+ | +++++++++
error[E0381]: partially assigned binding `a` isn't fully initialized
--> $DIR/borrowck-uninit-ref-chain.rs:18:5
diff --git a/src/test/ui/borrowck/borrowck-uninit.stderr b/src/test/ui/borrowck/borrowck-uninit.stderr
index d5566691a..eeafc4ce1 100644
--- a/src/test/ui/borrowck/borrowck-uninit.stderr
+++ b/src/test/ui/borrowck/borrowck-uninit.stderr
@@ -5,6 +5,11 @@ LL | let x: isize;
| - binding declared here but left uninitialized
LL | foo(x);
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: isize = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.stderr
index 459cf1398..18e808f10 100644
--- a/src/test/ui/borrowck/borrowck-use-in-index-lvalue.stderr
+++ b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.stderr
@@ -5,6 +5,11 @@ LL | let w: &mut [isize];
| - binding declared here but left uninitialized
LL | w[5] = 0;
| ^^^^ `*w` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let w: &mut [isize] = todo!();
+ | +++++++++
error[E0381]: used binding `w` isn't initialized
--> $DIR/borrowck-use-in-index-lvalue.rs:6:5
@@ -13,6 +18,11 @@ LL | let mut w: &mut [isize];
| ----- binding declared here but left uninitialized
LL | w[5] = 0;
| ^^^^ `*w` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut w: &mut [isize] = todo!();
+ | +++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.stderr
index 942ed4fc6..55f3ff553 100644
--- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.stderr
+++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.stderr
@@ -5,6 +5,11 @@ LL | let x: &i32;
| - binding declared here but left uninitialized
LL | let y = x as *const dyn Foo;
| ^ `*x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: &i32 = todo!();
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.stderr
index f3289e239..ea3d0d3ef 100644
--- a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.stderr
+++ b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.stderr
@@ -5,6 +5,11 @@ LL | let x: &i32;
| - binding declared here but left uninitialized
LL | let y = x as *const i32;
| ^ `*x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: &i32 = todo!();
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.stderr
index ff70ba9fc..0ac7df944 100644
--- a/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.stderr
+++ b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.stderr
@@ -2,7 +2,7 @@ error[E0506]: cannot assign to `a[_]` because it is borrowed
--> $DIR/borrowck-vec-pattern-move-tail.rs:8:5
|
LL | [1, 2, ref tail @ ..] => tail,
- | ------------- borrow of `a[_]` occurs here
+ | -------- borrow of `a[_]` occurs here
...
LL | a[2] = 0;
| ^^^^^^^^ assignment to borrowed `a[_]` occurs here
diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
index ddd89afe5..c3bcb7de6 100644
--- a/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
+++ b/src/test/ui/borrowck/borrowck-vec-pattern-nesting.stderr
@@ -14,7 +14,7 @@ error[E0506]: cannot assign to `vec[_]` because it is borrowed
--> $DIR/borrowck-vec-pattern-nesting.rs:23:13
|
LL | &mut [ref _b @ ..] => {
- | ----------- borrow of `vec[_]` occurs here
+ | ------ borrow of `vec[_]` occurs here
LL |
LL | vec[0] = Box::new(4);
| ^^^^^^ assignment to borrowed `vec[_]` occurs here
diff --git a/src/test/ui/borrowck/borrowck-while-cond.stderr b/src/test/ui/borrowck/borrowck-while-cond.stderr
index e41c1c55e..5d0194989 100644
--- a/src/test/ui/borrowck/borrowck-while-cond.stderr
+++ b/src/test/ui/borrowck/borrowck-while-cond.stderr
@@ -5,6 +5,11 @@ LL | let x: bool;
| - binding declared here but left uninitialized
LL | while x { }
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: bool = false;
+ | +++++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs b/src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs
new file mode 100644
index 000000000..524459291
--- /dev/null
+++ b/src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs
@@ -0,0 +1,8 @@
+fn main() {
+ let mut vec: Vec<i32> = Vec::new();
+ let closure = move || {
+ vec.clear();
+ let mut iter = vec.iter();
+ move || { iter.next() } //~ ERROR captured variable cannot escape `FnMut` closure bod
+ };
+}
diff --git a/src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.stderr b/src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.stderr
new file mode 100644
index 000000000..78ca090fe
--- /dev/null
+++ b/src/test/ui/borrowck/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.stderr
@@ -0,0 +1,18 @@
+error: captured variable cannot escape `FnMut` closure body
+ --> $DIR/do-not-suggest-adding-move-when-closure-is-already-marked-as-move.rs:6:9
+ |
+LL | let mut vec: Vec<i32> = Vec::new();
+ | ------- variable defined here
+LL | let closure = move || {
+ | - inferred to be a `FnMut` closure
+LL | vec.clear();
+ | --- variable captured here
+LL | let mut iter = vec.iter();
+LL | move || { iter.next() }
+ | ^^^^^^^^^^^^^^^^^^^^^^^ returns a closure that contains a reference to a captured variable, which then escapes the closure body
+ |
+ = note: `FnMut` closures only have access to their captured variables while they are executing...
+ = note: ...therefore, they cannot allow references to captured variables to escape
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/borrowck/index-mut-help.rs b/src/test/ui/borrowck/index-mut-help.rs
index d57ef975d..35266e113 100644
--- a/src/test/ui/borrowck/index-mut-help.rs
+++ b/src/test/ui/borrowck/index-mut-help.rs
@@ -1,10 +1,9 @@
// When mutably indexing a type that implements `Index` but not `IndexMut`, a
// special 'help' message is added to the output.
+use std::collections::HashMap;
fn main() {
- use std::collections::HashMap;
-
let mut map = HashMap::new();
map.insert("peter", "23".to_string());
diff --git a/src/test/ui/borrowck/index-mut-help.stderr b/src/test/ui/borrowck/index-mut-help.stderr
index 057c6ee15..f42d7e015 100644
--- a/src/test/ui/borrowck/index-mut-help.stderr
+++ b/src/test/ui/borrowck/index-mut-help.stderr
@@ -1,26 +1,39 @@
error[E0596]: cannot borrow data in an index of `HashMap<&str, String>` as mutable
- --> $DIR/index-mut-help.rs:11:5
+ --> $DIR/index-mut-help.rs:10:5
|
LL | map["peter"].clear();
| ^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
|
= help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>`
+help: to modify a `HashMap<&str, String>` use `.get_mut()`
+ |
+LL | map.get_mut("peter").map(|val| val.clear());
+ | ~~~~~~~~~ ~~~~~~~~~~~~~~~ +
error[E0594]: cannot assign to data in an index of `HashMap<&str, String>`
- --> $DIR/index-mut-help.rs:12:5
+ --> $DIR/index-mut-help.rs:11:5
|
LL | map["peter"] = "0".to_string();
| ^^^^^^^^^^^^ cannot assign
|
= help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>`
+help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API
+ |
+LL | map.insert("peter", "0".to_string());
+ | ~~~~~~~~ ~ +
+LL | map.get_mut("peter").map(|val| { *val = "0".to_string(); });
+ | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++
+LL | let val = map.entry("peter").or_insert("0".to_string());
+ | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ +
error[E0596]: cannot borrow data in an index of `HashMap<&str, String>` as mutable
- --> $DIR/index-mut-help.rs:13:13
+ --> $DIR/index-mut-help.rs:12:13
|
LL | let _ = &mut map["peter"];
| ^^^^^^^^^^^^^^^^^ cannot borrow as mutable
|
= help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>`
+ = help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API
error: aborting due to 3 previous errors
diff --git a/src/test/ui/borrowck/issue-101119.rs b/src/test/ui/borrowck/issue-101119.rs
new file mode 100644
index 000000000..64e52eaac
--- /dev/null
+++ b/src/test/ui/borrowck/issue-101119.rs
@@ -0,0 +1,16 @@
+struct State;
+
+fn once(_: impl FnOnce()) {}
+
+fn fill_memory_blocks_mt(state: &mut State) {
+ loop {
+ once(move || {
+ //~^ ERROR use of moved value: `state`
+ fill_segment(state);
+ });
+ }
+}
+
+fn fill_segment(_: &mut State) {}
+
+fn main() {}
diff --git a/src/test/ui/borrowck/issue-101119.stderr b/src/test/ui/borrowck/issue-101119.stderr
new file mode 100644
index 000000000..a22afdc67
--- /dev/null
+++ b/src/test/ui/borrowck/issue-101119.stderr
@@ -0,0 +1,15 @@
+error[E0382]: use of moved value: `state`
+ --> $DIR/issue-101119.rs:7:14
+ |
+LL | fn fill_memory_blocks_mt(state: &mut State) {
+ | ----- move occurs because `state` has type `&mut State`, which does not implement the `Copy` trait
+LL | loop {
+LL | once(move || {
+ | ^^^^^^^ value moved into closure here, in previous iteration of loop
+LL |
+LL | fill_segment(state);
+ | ----- use occurs due to use in closure
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/src/test/ui/borrowck/issue-102209.rs b/src/test/ui/borrowck/issue-102209.rs
new file mode 100644
index 000000000..37628bff7
--- /dev/null
+++ b/src/test/ui/borrowck/issue-102209.rs
@@ -0,0 +1,28 @@
+use std::marker::PhantomData;
+
+pub struct NfaBuilder<'brand> {
+ brand: PhantomData<&'brand mut &'brand mut ()>,
+}
+
+impl NfaBuilder<'_> {
+ pub fn with<R, F: FnOnce(NfaBuilder<'_>) -> R>(f: F) -> R {
+ Brand::with(|brand| {
+ f(Self { brand: brand.lt })
+ //~^ ERROR lifetime may not live long enough
+ //~| ERROR lifetime may not live long enough
+ })
+ }
+}
+
+#[derive(Clone, Copy)]
+pub struct Brand<'brand> {
+ lt: PhantomData<&'brand mut &'brand mut ()>,
+}
+
+impl Brand<'_> {
+ pub fn with<R, F: FnOnce(Brand<'_>) -> R>(f: F) -> R {
+ f(Self { lt: PhantomData })
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/borrowck/issue-102209.stderr b/src/test/ui/borrowck/issue-102209.stderr
new file mode 100644
index 000000000..351de8217
--- /dev/null
+++ b/src/test/ui/borrowck/issue-102209.stderr
@@ -0,0 +1,22 @@
+error: lifetime may not live long enough
+ --> $DIR/issue-102209.rs:10:29
+ |
+LL | impl NfaBuilder<'_> {
+ | -- lifetime `'2` appears in the `impl`'s self type
+LL | pub fn with<R, F: FnOnce(NfaBuilder<'_>) -> R>(f: F) -> R {
+LL | Brand::with(|brand| {
+ | ----- has type `Brand<'1>`
+LL | f(Self { brand: brand.lt })
+ | ^^^^^^^^ this usage requires that `'1` must outlive `'2`
+
+error: lifetime may not live long enough
+ --> $DIR/issue-102209.rs:10:29
+ |
+LL | impl NfaBuilder<'_> {
+ | -- lifetime `'1` appears in the `impl`'s self type
+...
+LL | f(Self { brand: brand.lt })
+ | ^^^^^^^^ this usage requires that `'1` must outlive `'static`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/borrowck/issue-103250.rs b/src/test/ui/borrowck/issue-103250.rs
new file mode 100644
index 000000000..46565f61c
--- /dev/null
+++ b/src/test/ui/borrowck/issue-103250.rs
@@ -0,0 +1,37 @@
+// edition:2021
+
+type TranslateFn = Box<dyn Fn(String, String) -> String>;
+
+pub struct DeviceCluster {
+ devices: Vec<Device>,
+}
+
+impl DeviceCluster {
+ pub async fn do_something(&mut self) -> Result<String, Box<dyn std::error::Error>> {
+ let mut last_error: Box<dyn std::error::Error>;
+
+ for device in &mut self.devices {
+ match device.do_something().await {
+ Ok(info) => {
+ return Ok(info);
+ }
+ Err(e) => {}
+ }
+ }
+
+ Err(last_error)
+ //~^ ERROR used binding `last_error` isn't initialized
+ }
+}
+
+pub struct Device {
+ translate_fn: Option<TranslateFn>,
+}
+
+impl Device {
+ pub async fn do_something(&mut self) -> Result<String, Box<dyn std::error::Error>> {
+ Ok(String::from(""))
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/borrowck/issue-103250.stderr b/src/test/ui/borrowck/issue-103250.stderr
new file mode 100644
index 000000000..4a2378352
--- /dev/null
+++ b/src/test/ui/borrowck/issue-103250.stderr
@@ -0,0 +1,17 @@
+error[E0381]: used binding `last_error` isn't initialized
+ --> $DIR/issue-103250.rs:22:13
+ |
+LL | let mut last_error: Box<dyn std::error::Error>;
+ | -------------- binding declared here but left uninitialized
+...
+LL | Err(last_error)
+ | ^^^^^^^^^^ `last_error` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut last_error: Box<dyn std::error::Error> = todo!();
+ | +++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0381`.
diff --git a/src/test/ui/borrowck/issue-103624.rs b/src/test/ui/borrowck/issue-103624.rs
new file mode 100644
index 000000000..f1fa95f92
--- /dev/null
+++ b/src/test/ui/borrowck/issue-103624.rs
@@ -0,0 +1,31 @@
+// edition:2021
+
+struct StructA {
+ b: StructB,
+}
+
+async fn spawn_blocking<T>(f: impl (Fn() -> T) + Send + Sync + 'static) -> T {
+ todo!()
+}
+
+impl StructA {
+ async fn foo(&self) {
+ let bar = self.b.bar().await;
+ spawn_blocking(move || {
+ //~^ ERROR borrowed data escapes outside of associated function
+ self.b;
+ //~^ ERROR cannot move out of `self.b`, as `self` is a captured variable in an `Fn` closure
+ })
+ .await;
+ }
+}
+
+struct StructB {}
+
+impl StructB {
+ async fn bar(&self) -> Option<u8> {
+ None
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/borrowck/issue-103624.stderr b/src/test/ui/borrowck/issue-103624.stderr
new file mode 100644
index 000000000..e6a35dd88
--- /dev/null
+++ b/src/test/ui/borrowck/issue-103624.stderr
@@ -0,0 +1,35 @@
+error[E0507]: cannot move out of `self.b`, as `self` is a captured variable in an `Fn` closure
+ --> $DIR/issue-103624.rs:16:13
+ |
+LL | async fn foo(&self) {
+ | ----- captured outer variable
+LL | let bar = self.b.bar().await;
+LL | spawn_blocking(move || {
+ | ------- captured by this `Fn` closure
+LL |
+LL | self.b;
+ | ^^^^^^ move occurs because `self.b` has type `StructB`, which does not implement the `Copy` trait
+
+error[E0521]: borrowed data escapes outside of associated function
+ --> $DIR/issue-103624.rs:14:9
+ |
+LL | async fn foo(&self) {
+ | -----
+ | |
+ | `self` is a reference that is only valid in the associated function body
+ | let's call the lifetime of this reference `'1`
+LL | let bar = self.b.bar().await;
+LL | / spawn_blocking(move || {
+LL | |
+LL | | self.b;
+LL | |
+LL | | })
+ | | ^
+ | | |
+ | |__________`self` escapes the associated function body here
+ | argument requires that `'1` must outlive `'static`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0507, E0521.
+For more information about an error, try `rustc --explain E0507`.
diff --git a/src/test/ui/issues/issue-17718-static-move.rs b/src/test/ui/borrowck/issue-17718-static-move.rs
index 015487a06..015487a06 100644
--- a/src/test/ui/issues/issue-17718-static-move.rs
+++ b/src/test/ui/borrowck/issue-17718-static-move.rs
diff --git a/src/test/ui/issues/issue-17718-static-move.stderr b/src/test/ui/borrowck/issue-17718-static-move.stderr
index 984534bfb..984534bfb 100644
--- a/src/test/ui/issues/issue-17718-static-move.stderr
+++ b/src/test/ui/borrowck/issue-17718-static-move.stderr
diff --git a/src/test/ui/issues/issue-23338-params-outlive-temps-of-body.rs b/src/test/ui/borrowck/issue-23338-params-outlive-temps-of-body.rs
index d45aaa843..d45aaa843 100644
--- a/src/test/ui/issues/issue-23338-params-outlive-temps-of-body.rs
+++ b/src/test/ui/borrowck/issue-23338-params-outlive-temps-of-body.rs
diff --git a/src/test/ui/borrowck/issue-24267-flow-exit.stderr b/src/test/ui/borrowck/issue-24267-flow-exit.stderr
index b85e8f216..58d1c8c0f 100644
--- a/src/test/ui/borrowck/issue-24267-flow-exit.stderr
+++ b/src/test/ui/borrowck/issue-24267-flow-exit.stderr
@@ -8,6 +8,10 @@ LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= 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 assigning a value
+ |
+LL | let x: i32 = 0;
+ | +++
error[E0381]: used binding `x` isn't initialized
--> $DIR/issue-24267-flow-exit.rs:18:20
@@ -19,6 +23,10 @@ LL | println!("{}", x);
| ^ `x` used here but it isn't initialized
|
= 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 assigning a value
+ |
+LL | let x: i32 = 0;
+ | +++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr
index d98b3bae4..f0b574846 100644
--- a/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr
+++ b/src/test/ui/borrowck/issue-53432-nested-closure-outlives-borrowed-value.stderr
@@ -10,6 +10,10 @@ LL | || f() // The `nested` closure
| ^^^^^^ returning this value requires that `'1` must outlive `'2`
|
= note: closure implements `Fn`, so references to captured variables can't escape the closure
+help: consider adding 'move' keyword before the nested closure
+ |
+LL | move || f() // The `nested` closure
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/issue-62107-match-arm-scopes.stderr b/src/test/ui/borrowck/issue-62107-match-arm-scopes.stderr
index f5d2eecfa..9683da919 100644
--- a/src/test/ui/borrowck/issue-62107-match-arm-scopes.stderr
+++ b/src/test/ui/borrowck/issue-62107-match-arm-scopes.stderr
@@ -5,6 +5,11 @@ LL | let e: i32;
| - binding declared here but left uninitialized
LL | match e {
| ^ `e` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let e: i32 = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/issue-64453.stderr b/src/test/ui/borrowck/issue-64453.stderr
index 1f8a1acb8..245c3a40e 100644
--- a/src/test/ui/borrowck/issue-64453.stderr
+++ b/src/test/ui/borrowck/issue-64453.stderr
@@ -14,6 +14,7 @@ LL | static settings_dir: String = format!("");
| ^^^^^^^^^^^
|
= 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 `format` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0507]: cannot move out of static item `settings_dir`
diff --git a/src/test/ui/borrowck/issue-81899.rs b/src/test/ui/borrowck/issue-81899.rs
index 9b6061203..24b20b650 100644
--- a/src/test/ui/borrowck/issue-81899.rs
+++ b/src/test/ui/borrowck/issue-81899.rs
@@ -2,8 +2,7 @@
// The `panic!()` below is important to trigger the fixed ICE.
const _CONST: &[u8] = &f(&[], |_| {});
-//~^ ERROR any use of this value
-//~| WARNING this was previously
+//~^ ERROR constant
const fn f<F>(_: &[u8], _: F) -> &[u8]
where
diff --git a/src/test/ui/borrowck/issue-81899.stderr b/src/test/ui/borrowck/issue-81899.stderr
index fd591c7b5..12e80b9df 100644
--- a/src/test/ui/borrowck/issue-81899.stderr
+++ b/src/test/ui/borrowck/issue-81899.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/issue-81899.rs:12:5
+ --> $DIR/issue-81899.rs:11:5
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
| -------------- inside `_CONST` at $DIR/issue-81899.rs:4:24
@@ -7,32 +7,17 @@ LL | const _CONST: &[u8] = &f(&[], |_| {});
LL | panic!()
| ^^^^^^^^
| |
- | the evaluated program panicked at 'explicit panic', $DIR/issue-81899.rs:12:5
+ | the evaluated program panicked at 'explicit panic', $DIR/issue-81899.rs:11:5
| inside `f::<[closure@$DIR/issue-81899.rs:4:31: 4:34]>` at $SRC_DIR/std/src/panic.rs:LL:COL
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/issue-81899.rs:4:23
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^ referenced constant has errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/issue-81899.rs:4:23
- |
-LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/borrowck/issue-88434-minimal-example.rs b/src/test/ui/borrowck/issue-88434-minimal-example.rs
index 7618d001e..983a02310 100644
--- a/src/test/ui/borrowck/issue-88434-minimal-example.rs
+++ b/src/test/ui/borrowck/issue-88434-minimal-example.rs
@@ -1,8 +1,7 @@
// Regression test related to issue 88434
const _CONST: &() = &f(&|_| {});
-//~^ ERROR any use of this value
-//~| WARNING this was previously
+//~^ ERROR constant
const fn f<F>(_: &F)
where
diff --git a/src/test/ui/borrowck/issue-88434-minimal-example.stderr b/src/test/ui/borrowck/issue-88434-minimal-example.stderr
index a3582e780..dc87c4c2b 100644
--- a/src/test/ui/borrowck/issue-88434-minimal-example.stderr
+++ b/src/test/ui/borrowck/issue-88434-minimal-example.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/issue-88434-minimal-example.rs:11:5
+ --> $DIR/issue-88434-minimal-example.rs:10:5
|
LL | const _CONST: &() = &f(&|_| {});
| ---------- inside `_CONST` at $DIR/issue-88434-minimal-example.rs:3:22
@@ -7,32 +7,17 @@ LL | const _CONST: &() = &f(&|_| {});
LL | panic!()
| ^^^^^^^^
| |
- | the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:11:5
+ | the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:10:5
| inside `f::<[closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28]>` at $SRC_DIR/std/src/panic.rs:LL:COL
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/issue-88434-minimal-example.rs:3:21
|
LL | const _CONST: &() = &f(&|_| {});
- | ----------------- ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^ referenced constant has errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/issue-88434-minimal-example.rs:3:21
- |
-LL | const _CONST: &() = &f(&|_| {});
- | ----------------- ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.rs b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.rs
index b1fc1615e..a99c5b76a 100644
--- a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.rs
+++ b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.rs
@@ -1,8 +1,7 @@
// Regression test for issue 88434
const _CONST: &[u8] = &f(&[], |_| {});
-//~^ ERROR any use of this value will cause an error
-//~| WARNING this was previously
+//~^ ERROR constant
const fn f<F>(_: &[u8], _: F) -> &[u8]
where
diff --git a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr
index a6c65b302..4b4a25d7b 100644
--- a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr
+++ b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/issue-88434-removal-index-should-be-less.rs:11:5
+ --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
| -------------- inside `_CONST` at $DIR/issue-88434-removal-index-should-be-less.rs:3:24
@@ -7,32 +7,17 @@ LL | const _CONST: &[u8] = &f(&[], |_| {});
LL | panic!()
| ^^^^^^^^
| |
- | the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:11:5
+ | the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:10:5
| inside `f::<[closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34]>` at $SRC_DIR/std/src/panic.rs:LL:COL
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/issue-88434-removal-index-should-be-less.rs:3:23
|
LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^ referenced constant has errors
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/issue-88434-removal-index-should-be-less.rs:3:23
- |
-LL | const _CONST: &[u8] = &f(&[], |_| {});
- | ------------------- ^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.rs b/src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.rs
new file mode 100644
index 000000000..95847d8d3
--- /dev/null
+++ b/src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.rs
@@ -0,0 +1,14 @@
+fn foo1(s: &str) -> impl Iterator<Item = String> + '_ {
+ None.into_iter()
+ .flat_map(move |()| s.chars().map(|c| format!("{}{}", c, s)))
+ //~^ ERROR captured variable cannot escape `FnMut` closure body
+ //~| HELP consider adding 'move' keyword before the nested closure
+}
+
+fn foo2(s: &str) -> impl Sized + '_ {
+ move |()| s.chars().map(|c| format!("{}{}", c, s))
+ //~^ ERROR lifetime may not live long enough
+ //~| HELP consider adding 'move' keyword before the nested closure
+}
+
+fn main() {}
diff --git a/src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.stderr b/src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.stderr
new file mode 100644
index 000000000..2eae614a2
--- /dev/null
+++ b/src/test/ui/borrowck/issue-95079-missing-move-in-nested-closure.stderr
@@ -0,0 +1,37 @@
+error: captured variable cannot escape `FnMut` closure body
+ --> $DIR/issue-95079-missing-move-in-nested-closure.rs:3:29
+ |
+LL | fn foo1(s: &str) -> impl Iterator<Item = String> + '_ {
+ | - variable defined here
+LL | None.into_iter()
+LL | .flat_map(move |()| s.chars().map(|c| format!("{}{}", c, s)))
+ | - -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | | |
+ | | returns a reference to a captured variable which escapes the closure body
+ | | variable captured here
+ | inferred to be a `FnMut` closure
+ |
+ = note: `FnMut` closures only have access to their captured variables while they are executing...
+ = note: ...therefore, they cannot allow references to captured variables to escape
+help: consider adding 'move' keyword before the nested closure
+ |
+LL | .flat_map(move |()| s.chars().map(move |c| format!("{}{}", c, s)))
+ | ++++
+
+error: lifetime may not live long enough
+ --> $DIR/issue-95079-missing-move-in-nested-closure.rs:9:15
+ |
+LL | move |()| s.chars().map(|c| format!("{}{}", c, s))
+ | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
+ | | |
+ | | return type of closure `Map<Chars<'_>, [closure@$DIR/issue-95079-missing-move-in-nested-closure.rs:9:29: 9:32]>` contains a lifetime `'2`
+ | lifetime `'1` represents this closure's body
+ |
+ = note: closure implements `Fn`, so references to captured variables can't escape the closure
+help: consider adding 'move' keyword before the nested closure
+ |
+LL | move |()| s.chars().map(move |c| format!("{}{}", c, s))
+ | ++++
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.rs b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.rs
new file mode 100644
index 000000000..31eba0740
--- /dev/null
+++ b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.rs
@@ -0,0 +1,26 @@
+// Tests the suggestion to reborrow the first move site
+// when we move then borrow a `&mut` ref.
+
+struct State;
+
+impl IntoIterator for &mut State {
+ type IntoIter = std::vec::IntoIter<()>;
+ type Item = ();
+
+ fn into_iter(self) -> Self::IntoIter {
+ vec![].into_iter()
+ }
+}
+
+fn once(f: impl FnOnce()) {}
+
+fn fill_memory_blocks_mt(state: &mut State) {
+ for _ in state {}
+ //~^ HELP consider creating a fresh reborrow of `state` here
+ fill_segment(state);
+ //~^ ERROR borrow of moved value: `state`
+}
+
+fn fill_segment(state: &mut State) {}
+
+fn main() {}
diff --git a/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr
new file mode 100644
index 000000000..13a2005e2
--- /dev/null
+++ b/src/test/ui/borrowck/reborrow-sugg-move-then-borrow.stderr
@@ -0,0 +1,24 @@
+error[E0382]: borrow of moved value: `state`
+ --> $DIR/reborrow-sugg-move-then-borrow.rs:20:18
+ |
+LL | fn fill_memory_blocks_mt(state: &mut State) {
+ | ----- move occurs because `state` has type `&mut State`, which does not implement the `Copy` trait
+LL | for _ in state {}
+ | ----- `state` moved due to this implicit call to `.into_iter()`
+LL |
+LL | fill_segment(state);
+ | ^^^^^ value borrowed here after move
+ |
+note: this function takes ownership of the receiver `self`, which moves `state`
+ --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+ |
+LL | fn into_iter(self) -> Self::IntoIter;
+ | ^^^^
+help: consider creating a fresh reborrow of `state` here
+ |
+LL | for _ in &mut *state {}
+ | ++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr
index af26169c8..b1af090ae 100644
--- a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr
+++ b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr
@@ -5,6 +5,7 @@ LL | cb.map(|cb| cb());
| ^^^--------------
| | |
| | `*cb` moved due to this method call
+ | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
| move occurs because `*cb` has type `Option<&mut dyn FnMut()>`, which does not implement the `Copy` trait
|
note: this function takes ownership of the receiver `self`, which moves `*cb`
@@ -12,10 +13,6 @@ note: this function takes ownership of the receiver `self`, which moves `*cb`
|
LL | pub const fn map<U, F>(self, f: F) -> Option<U>
| ^^^^
-help: consider calling `.as_ref()` to borrow the type's contents
- |
-LL | cb.as_ref().map(|cb| cb());
- | +++++++++
error[E0596]: cannot borrow `*cb` as mutable, as it is behind a `&` reference
--> $DIR/suggest-as-ref-on-mut-closure.rs:12:26
diff --git a/src/test/ui/borrowck/suggest-assign-rvalue.rs b/src/test/ui/borrowck/suggest-assign-rvalue.rs
new file mode 100644
index 000000000..aaca9d47f
--- /dev/null
+++ b/src/test/ui/borrowck/suggest-assign-rvalue.rs
@@ -0,0 +1,57 @@
+#![allow(dead_code)]
+#![feature(never_type)]
+
+#[derive(Debug, Default)]
+struct Demo {}
+
+#[derive(Debug)]
+struct DemoNoDef {}
+
+fn apple(_: u32) {}
+
+fn banana() {
+ let chaenomeles;
+ apple(chaenomeles);
+ //~^ ERROR used binding `chaenomeles` isn't initialized [E0381]
+}
+
+fn main() {
+ let my_bool: bool = bool::default();
+ println!("my_bool: {}", my_bool);
+
+ let my_float: f32;
+ println!("my_float: {}", my_float);
+ //~^ ERROR used binding `my_float` isn't initialized
+ let demo: Demo;
+ println!("demo: {:?}", demo);
+ //~^ ERROR used binding `demo` isn't initialized
+
+ let demo_no: DemoNoDef;
+ println!("demo_no: {:?}", demo_no);
+ //~^ ERROR used binding `demo_no` isn't initialized
+
+ let arr: [i32; 5];
+ println!("arr: {:?}", arr);
+ //~^ ERROR used binding `arr` isn't initialized
+ let foo: Vec<&str>;
+ println!("foo: {:?}", foo);
+ //~^ ERROR used binding `foo` isn't initialized
+
+ let my_string: String;
+ println!("my_string: {}", my_string);
+ //~^ ERROR used binding `my_string` isn't initialized
+
+ let my_int: &i32;
+ println!("my_int: {}", *my_int);
+ //~^ ERROR used binding `my_int` isn't initialized
+
+ let hello: &str;
+ println!("hello: {}", hello);
+ //~^ ERROR used binding `hello` isn't initialized
+
+ let never: !;
+ println!("never: {}", never);
+ //~^ ERROR used binding `never` isn't initialized [E0381]
+
+ banana();
+}
diff --git a/src/test/ui/borrowck/suggest-assign-rvalue.stderr b/src/test/ui/borrowck/suggest-assign-rvalue.stderr
new file mode 100644
index 000000000..92acba640
--- /dev/null
+++ b/src/test/ui/borrowck/suggest-assign-rvalue.stderr
@@ -0,0 +1,138 @@
+error[E0381]: used binding `chaenomeles` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:14:11
+ |
+LL | let chaenomeles;
+ | ----------- binding declared here but left uninitialized
+LL | apple(chaenomeles);
+ | ^^^^^^^^^^^ `chaenomeles` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let chaenomeles = 0;
+ | +++
+
+error[E0381]: used binding `my_float` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:23:30
+ |
+LL | let my_float: f32;
+ | -------- binding declared here but left uninitialized
+LL | println!("my_float: {}", my_float);
+ | ^^^^^^^^ `my_float` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let my_float: f32 = 0.0;
+ | +++++
+
+error[E0381]: used binding `demo` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:26:28
+ |
+LL | let demo: Demo;
+ | ---- binding declared here but left uninitialized
+LL | println!("demo: {:?}", demo);
+ | ^^^^ `demo` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let demo: Demo = Default::default();
+ | ++++++++++++++++++++
+
+error[E0381]: used binding `demo_no` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:30:31
+ |
+LL | let demo_no: DemoNoDef;
+ | ------- binding declared here but left uninitialized
+LL | println!("demo_no: {:?}", demo_no);
+ | ^^^^^^^ `demo_no` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let demo_no: DemoNoDef = todo!();
+ | +++++++++
+
+error[E0381]: used binding `arr` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:34:27
+ |
+LL | let arr: [i32; 5];
+ | --- binding declared here but left uninitialized
+LL | println!("arr: {:?}", arr);
+ | ^^^ `arr` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let arr: [i32; 5] = todo!();
+ | +++++++++
+
+error[E0381]: used binding `foo` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:37:27
+ |
+LL | let foo: Vec<&str>;
+ | --- binding declared here but left uninitialized
+LL | println!("foo: {:?}", foo);
+ | ^^^ `foo` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let foo: Vec<&str> = vec![];
+ | ++++++++
+
+error[E0381]: used binding `my_string` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:41:31
+ |
+LL | let my_string: String;
+ | --------- binding declared here but left uninitialized
+LL | println!("my_string: {}", my_string);
+ | ^^^^^^^^^ `my_string` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let my_string: String = Default::default();
+ | ++++++++++++++++++++
+
+error[E0381]: used binding `my_int` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:45:28
+ |
+LL | let my_int: &i32;
+ | ------ binding declared here but left uninitialized
+LL | println!("my_int: {}", *my_int);
+ | ^^^^^^^ `*my_int` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let my_int: &i32 = todo!();
+ | +++++++++
+
+error[E0381]: used binding `hello` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:49:27
+ |
+LL | let hello: &str;
+ | ----- binding declared here but left uninitialized
+LL | println!("hello: {}", hello);
+ | ^^^^^ `hello` used here but it isn't initialized
+ |
+ = 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 assigning a value
+ |
+LL | let hello: &str = todo!();
+ | +++++++++
+
+error[E0381]: used binding `never` isn't initialized
+ --> $DIR/suggest-assign-rvalue.rs:53:27
+ |
+LL | let never: !;
+ | ----- binding declared here but left uninitialized
+LL | println!("never: {}", never);
+ | ^^^^^ `never` used here but it isn't initialized
+ |
+ = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 10 previous errors
+
+For more information about this error, try `rustc --explain E0381`.
diff --git a/src/test/ui/borrowck/two-phase-across-loop.stderr b/src/test/ui/borrowck/two-phase-across-loop.stderr
index 95896c6bb..22f9b39df 100644
--- a/src/test/ui/borrowck/two-phase-across-loop.stderr
+++ b/src/test/ui/borrowck/two-phase-across-loop.stderr
@@ -2,7 +2,10 @@ error[E0499]: cannot borrow `foo` as mutable more than once at a time
--> $DIR/two-phase-across-loop.rs:17:22
|
LL | strings.push(foo.get_string());
- | ^^^^^^^^^^^^^^^^ `foo` was mutably borrowed here in the previous iteration of the loop
+ | -------------^^^^^^^^^^^^^^^^-
+ | | |
+ | | `foo` was mutably borrowed here in the previous iteration of the loop
+ | first borrow used here, in later iteration of loop
error: aborting due to previous error
diff --git a/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs b/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs
index 3d395d1f2..da238205b 100644
--- a/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs
+++ b/src/test/ui/borrowck/two-phase-nonrecv-autoref.rs
@@ -131,13 +131,13 @@ fn coerce_index_op() {
let mut i = I(10);
i[i[3]] = 4;
//~^ ERROR cannot borrow `i` as immutable because it is also borrowed as mutable [E0502]
- // Shoud be accepted with g2p
+ // Should be accepted with g2p
i[3] = i[4];
i[i[3]] = i[4];
//~^ ERROR cannot borrow `i` as immutable because it is also borrowed as mutable [E0502]
- // Shoud be accepted with g2p
+ // Should be accepted with g2p
}
fn main() {
diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs
index e0f4afa75..0463e22b3 100644
--- a/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs
+++ b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs
@@ -40,6 +40,6 @@ fn main() {
//
// (At least in theory; part of the reason this test fails is that
// the constructed MIR throws in extra &mut reborrows which
- // flummoxes our attmpt to delay the activation point here.)
+ // flummoxes our attempt to delay the activation point here.)
delay.push(2);
}
diff --git a/src/test/ui/box/issue-95036.rs b/src/test/ui/box/issue-95036.rs
index c2d4275aa..0611fabc1 100644
--- a/src/test/ui/box/issue-95036.rs
+++ b/src/test/ui/box/issue-95036.rs
@@ -1,7 +1,7 @@
// compile-flags: -O
// build-pass
-#![feature(allocator_api, bench_black_box)]
+#![feature(allocator_api)]
#[inline(never)]
pub fn by_ref(node: &mut Box<[u8; 1], &std::alloc::Global>) {
diff --git a/src/test/ui/btreemap/btreemap-index-mut.rs b/src/test/ui/btreemap/btreemap-index-mut.rs
new file mode 100644
index 000000000..62972acab
--- /dev/null
+++ b/src/test/ui/btreemap/btreemap-index-mut.rs
@@ -0,0 +1,6 @@
+use std::collections::BTreeMap;
+
+fn main() {
+ let mut map = BTreeMap::<u32, u32>::new();
+ map[&0] = 1; //~ ERROR cannot assign
+}
diff --git a/src/test/ui/btreemap/btreemap-index-mut.stderr b/src/test/ui/btreemap/btreemap-index-mut.stderr
new file mode 100644
index 000000000..26f2a4c4b
--- /dev/null
+++ b/src/test/ui/btreemap/btreemap-index-mut.stderr
@@ -0,0 +1,19 @@
+error[E0594]: cannot assign to data in an index of `BTreeMap<u32, u32>`
+ --> $DIR/btreemap-index-mut.rs:5:5
+ |
+LL | map[&0] = 1;
+ | ^^^^^^^^^^^ cannot assign
+ |
+ = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `BTreeMap<u32, u32>`
+help: to modify a `BTreeMap<u32, u32>`, use `.get_mut()`, `.insert()` or the entry API
+ |
+LL | map.insert(&0, 1);
+ | ~~~~~~~~ ~ +
+LL | map.get_mut(&0).map(|val| { *val = 1; });
+ | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++
+LL | let val = map.entry(&0).or_insert(1);
+ | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0594`.
diff --git a/src/test/ui/builtin-clone-unwind.rs b/src/test/ui/builtin-clone-unwind.rs
index 3623c4a4d..16add6ff2 100644
--- a/src/test/ui/builtin-clone-unwind.rs
+++ b/src/test/ui/builtin-clone-unwind.rs
@@ -3,7 +3,6 @@
#![allow(unused_variables)]
#![allow(unused_imports)]
-// ignore-wasm32-bare compiled with panic=abort by default
// Test that builtin implementations of `Clone` cleanup everything
// in case of unwinding.
diff --git a/src/test/ui/c-variadic/issue-86053-1.stderr b/src/test/ui/c-variadic/issue-86053-1.stderr
index 5d119bb85..60b379faf 100644
--- a/src/test/ui/c-variadic/issue-86053-1.stderr
+++ b/src/test/ui/c-variadic/issue-86053-1.stderr
@@ -44,19 +44,19 @@ error: `...` must be the last argument of a C-variadic function
--> $DIR/issue-86053-1.rs:11:12
|
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
- | ^^^^
+ | ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
--> $DIR/issue-86053-1.rs:11:12
|
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
- | ^^^^
+ | ^^^
error: only foreign or `unsafe extern "C"` functions may be C-variadic
--> $DIR/issue-86053-1.rs:11:36
|
LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) {
- | ^^^^
+ | ^^^
error[E0412]: cannot find type `F` in this scope
--> $DIR/issue-86053-1.rs:11:48
diff --git a/src/test/ui/c-variadic/variadic-ffi-1.stderr b/src/test/ui/c-variadic/variadic-ffi-1.stderr
index 176bec819..2ffb80f7e 100644
--- a/src/test/ui/c-variadic/variadic-ffi-1.stderr
+++ b/src/test/ui/c-variadic/variadic-ffi-1.stderr
@@ -18,7 +18,7 @@ LL | fn foo(f: isize, x: u8, ...);
help: provide the arguments
|
LL | foo(/* isize */, /* u8 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
--> $DIR/variadic-ffi-1.rs:21:9
@@ -34,7 +34,7 @@ LL | fn foo(f: isize, x: u8, ...);
help: provide the argument
|
LL | foo(1, /* u8 */);
- | ~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/variadic-ffi-1.rs:23:56
diff --git a/src/test/ui/cast/cast-rfc0401.rs b/src/test/ui/cast/cast-rfc0401.rs
index 996fa013f..9a9875416 100644
--- a/src/test/ui/cast/cast-rfc0401.rs
+++ b/src/test/ui/cast/cast-rfc0401.rs
@@ -159,11 +159,7 @@ fn main()
assert!(foo as usize != bar as usize);
// Taking a few bits of a function's address is totally pointless and we detect that
- // Disabling the lint to ensure that the assertion can still be run
- #[allow(const_err)]
- {
- assert_eq!(foo as i16, foo as usize as i16);
- }
+ assert_eq!(foo as i16, foo as usize as i16);
// fptr-ptr-cast
diff --git a/src/test/ui/cast/issue-88621.rs b/src/test/ui/cast/issue-88621.rs
index 9242b80e2..1679793ee 100644
--- a/src/test/ui/cast/issue-88621.rs
+++ b/src/test/ui/cast/issue-88621.rs
@@ -1,5 +1,3 @@
-#![feature(arbitrary_enum_discriminant)]
-
#[repr(u8)]
enum Kind2 {
Foo() = 1,
diff --git a/src/test/ui/cast/issue-88621.stderr b/src/test/ui/cast/issue-88621.stderr
index e96d86651..886145c1b 100644
--- a/src/test/ui/cast/issue-88621.stderr
+++ b/src/test/ui/cast/issue-88621.stderr
@@ -1,5 +1,5 @@
error[E0605]: non-primitive cast: `Kind2` as `u8`
- --> $DIR/issue-88621.rs:11:13
+ --> $DIR/issue-88621.rs:9:13
|
LL | let _ = Kind2::Foo() as u8;
| ^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
diff --git a/src/test/ui/catch-unwind-bang.rs b/src/test/ui/catch-unwind-bang.rs
index b31b5cab5..fb3503937 100644
--- a/src/test/ui/catch-unwind-bang.rs
+++ b/src/test/ui/catch-unwind-bang.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
fn worker() -> ! {
panic!()
diff --git a/src/test/ui/cenum_impl_drop_cast.stderr b/src/test/ui/cenum_impl_drop_cast.stderr
index 98c331057..b3f921c14 100644
--- a/src/test/ui/cenum_impl_drop_cast.stderr
+++ b/src/test/ui/cenum_impl_drop_cast.stderr
@@ -4,13 +4,13 @@ error: cannot cast enum `E` into integer `u32` because it implements `Drop`
LL | let i = e as u32;
| ^^^^^^^^
|
+ = 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 #73333 <https://github.com/rust-lang/rust/issues/73333>
note: the lint level is defined here
--> $DIR/cenum_impl_drop_cast.rs:1:9
|
LL | #![deny(cenum_impl_drop_cast)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #73333 <https://github.com/rust-lang/rust/issues/73333>
error: aborting due to previous error
@@ -21,11 +21,11 @@ error: cannot cast enum `E` into integer `u32` because it implements `Drop`
LL | let i = e as u32;
| ^^^^^^^^
|
+ = 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 #73333 <https://github.com/rust-lang/rust/issues/73333>
note: the lint level is defined here
--> $DIR/cenum_impl_drop_cast.rs:1:9
|
LL | #![deny(cenum_impl_drop_cast)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #73333 <https://github.com/rust-lang/rust/issues/73333>
diff --git a/src/test/ui/cfg/cfg-method-receiver-ok.rs b/src/test/ui/cfg/cfg-method-receiver-ok.rs
new file mode 100644
index 000000000..61ad3b8c1
--- /dev/null
+++ b/src/test/ui/cfg/cfg-method-receiver-ok.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+macro_rules! foo {
+ () => {
+ #[allow(unreachable_patterns)]
+ {
+ 123i32
+ }
+ };
+}
+
+fn main() {
+ let _ = foo!().abs();
+}
diff --git a/src/test/ui/cfg/cfg-method-receiver.rs b/src/test/ui/cfg/cfg-method-receiver.rs
new file mode 100644
index 000000000..71134ff17
--- /dev/null
+++ b/src/test/ui/cfg/cfg-method-receiver.rs
@@ -0,0 +1,11 @@
+macro_rules! cbor_map {
+ ($key:expr) => {
+ $key.signum();
+ //~^ ERROR can't call method `signum` on ambiguous numeric type `{integer}` [E0689]
+ };
+}
+
+fn main() {
+ cbor_map! { #[cfg(test)] 4};
+ //~^ ERROR removing an expression is not supported in this position
+}
diff --git a/src/test/ui/cfg/cfg-method-receiver.stderr b/src/test/ui/cfg/cfg-method-receiver.stderr
new file mode 100644
index 000000000..5767a7c1b
--- /dev/null
+++ b/src/test/ui/cfg/cfg-method-receiver.stderr
@@ -0,0 +1,24 @@
+error: removing an expression is not supported in this position
+ --> $DIR/cfg-method-receiver.rs:9:17
+ |
+LL | cbor_map! { #[cfg(test)] 4};
+ | ^^^^^^^^^^^^
+
+error[E0689]: can't call method `signum` on ambiguous numeric type `{integer}`
+ --> $DIR/cfg-method-receiver.rs:3:14
+ |
+LL | $key.signum();
+ | ^^^^^^
+...
+LL | cbor_map! { #[cfg(test)] 4};
+ | --------------------------- in this macro invocation
+ |
+ = note: this error originates in the macro `cbor_map` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: you must specify a concrete type for this numeric value, like `i32`
+ |
+LL | cbor_map! { #[cfg(test)] 4_i32};
+ | ~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0689`.
diff --git a/src/test/ui/cfg/cfg-panic.rs b/src/test/ui/cfg/cfg-panic.rs
index fb3e5059c..2de72d54a 100644
--- a/src/test/ui/cfg/cfg-panic.rs
+++ b/src/test/ui/cfg/cfg-panic.rs
@@ -1,9 +1,6 @@
// build-pass
// compile-flags: -C panic=unwind
// needs-unwind
-// ignore-emscripten no panic_unwind implementation
-// ignore-wasm32 no panic_unwind implementation
-// ignore-wasm64 no panic_unwind implementation
#[cfg(panic = "abort")]
diff --git a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs
index 6cb2ff9d8..1f23dadc4 100644
--- a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs
+++ b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.rs
@@ -1,7 +1,6 @@
// check-fail
// compile-flags:--cfg foo
-#![deny(warnings)]
#![cfg_attr(foo, crate_type="bin")]
//~^ERROR `crate_type` within
//~| WARN this was previously accepted
diff --git a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr
index 5609f8e9d..9ce4710d6 100644
--- a/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr
+++ b/src/test/ui/cfg/future-compat-crate-attributes-using-cfg_attr.stderr
@@ -1,20 +1,15 @@
error: `crate_type` within an `#![cfg_attr] attribute is deprecated`
- --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:5:18
+ --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:4:18
|
LL | #![cfg_attr(foo, crate_type="bin")]
| ^^^^^^^^^^^^^^^^
|
-note: the lint level is defined here
- --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:4:9
- |
-LL | #![deny(warnings)]
- | ^^^^^^^^
- = note: `#[deny(deprecated_cfg_attr_crate_type_name)]` implied by `#[deny(warnings)]`
= 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 #91632 <https://github.com/rust-lang/rust/issues/91632>
+ = note: `#[deny(deprecated_cfg_attr_crate_type_name)]` on by default
error: `crate_name` within an `#![cfg_attr] attribute is deprecated`
- --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:10:18
+ --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:9:18
|
LL | #![cfg_attr(foo, crate_name="bar")]
| ^^^^^^^^^^^^^^^^
@@ -23,7 +18,7 @@ LL | #![cfg_attr(foo, crate_name="bar")]
= note: for more information, see issue #91632 <https://github.com/rust-lang/rust/issues/91632>
error: `crate_type` within an `#![cfg_attr] attribute is deprecated`
- --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:5:18
+ --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:4:18
|
LL | #![cfg_attr(foo, crate_type="bin")]
| ^^^^^^^^^^^^^^^^
@@ -32,7 +27,7 @@ LL | #![cfg_attr(foo, crate_type="bin")]
= note: for more information, see issue #91632 <https://github.com/rust-lang/rust/issues/91632>
error: `crate_name` within an `#![cfg_attr] attribute is deprecated`
- --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:10:18
+ --> $DIR/future-compat-crate-attributes-using-cfg_attr.rs:9:18
|
LL | #![cfg_attr(foo, crate_name="bar")]
| ^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/chalkify/type_wf.rs b/src/test/ui/chalkify/type_wf.rs
index dd83a03fd..eeeefcfb7 100644
--- a/src/test/ui/chalkify/type_wf.rs
+++ b/src/test/ui/chalkify/type_wf.rs
@@ -15,8 +15,8 @@ fn main() {
x: 5,
};
- let s = S { //~ ERROR the trait bound `{float}: Foo` is not satisfied
- x: 5.0,
+ let s = S {
+ x: 5.0, //~ ERROR the trait bound `{float}: Foo` is not satisfied
};
let s = S {
diff --git a/src/test/ui/chalkify/type_wf.stderr b/src/test/ui/chalkify/type_wf.stderr
index 7f8566082..6e8daf635 100644
--- a/src/test/ui/chalkify/type_wf.stderr
+++ b/src/test/ui/chalkify/type_wf.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `{float}: Foo` is not satisfied
- --> $DIR/type_wf.rs:18:13
+ --> $DIR/type_wf.rs:19:12
|
-LL | let s = S {
- | ^ the trait `Foo` is not implemented for `{float}`
+LL | x: 5.0,
+ | ^^^ the trait `Foo` is not implemented for `{float}`
|
= help: the trait `Foo` is implemented for `i32`
note: required by a bound in `S`
diff --git a/src/test/ui/check-cfg/allow-at-crate-level.rs b/src/test/ui/check-cfg/allow-at-crate-level.rs
new file mode 100644
index 000000000..ce3383a29
--- /dev/null
+++ b/src/test/ui/check-cfg/allow-at-crate-level.rs
@@ -0,0 +1,8 @@
+// This test check that #![allow(unexpected_cfgs)] works with --cfg
+//
+// check-pass
+// compile-flags: --cfg=unexpected --check-cfg=names() -Z unstable-options
+
+#![allow(unexpected_cfgs)]
+
+fn main() {}
diff --git a/src/test/ui/check-cfg/compact-values.stderr b/src/test/ui/check-cfg/compact-values.stderr
index a196e1537..9864aa385 100644
--- a/src/test/ui/check-cfg/compact-values.stderr
+++ b/src/test/ui/check-cfg/compact-values.stderr
@@ -4,8 +4,8 @@ warning: unexpected `cfg` condition value
LL | #[cfg(target(os = "linux", arch = "X"))]
| ^^^^^^^^^^
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= 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: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/check-cfg/empty-values.stderr b/src/test/ui/check-cfg/empty-values.stderr
index 10dab5034..a0168b2ca 100644
--- a/src/test/ui/check-cfg/empty-values.stderr
+++ b/src/test/ui/check-cfg/empty-values.stderr
@@ -6,8 +6,8 @@ LL | #[cfg(test = "value")]
| |
| help: remove the value
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: no expected value for `test`
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr b/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr
index bdfbc3d54..8fadcc1f9 100644
--- a/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr
+++ b/src/test/ui/check-cfg/invalid-arguments.names_simple_ident.stderr
@@ -1,2 +1,2 @@
-error: invalid `--check-cfg` argument: `names("NOT_IDENT")` (`names()` arguments must be simple identifers)
+error: invalid `--check-cfg` argument: `names("NOT_IDENT")` (`names()` arguments must be simple identifiers)
diff --git a/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr b/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr
index b25882baa..061d3f0e9 100644
--- a/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr
+++ b/src/test/ui/check-cfg/invalid-arguments.values_simple_ident.stderr
@@ -1,2 +1,2 @@
-error: invalid `--check-cfg` argument: `values("NOT_IDENT")` (`values()` first argument must be a simple identifer)
+error: invalid `--check-cfg` argument: `values("NOT_IDENT")` (`values()` first argument must be a simple identifier)
diff --git a/src/test/ui/check-cfg/invalid-cfg-value.stderr b/src/test/ui/check-cfg/invalid-cfg-value.stderr
index 6cce31d33..60abcb188 100644
--- a/src/test/ui/check-cfg/invalid-cfg-value.stderr
+++ b/src/test/ui/check-cfg/invalid-cfg-value.stderr
@@ -4,8 +4,8 @@ warning: unexpected `cfg` condition value
LL | #[cfg(feature = "sedre")]
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: expected values for `feature` are: full, serde
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value
--> $DIR/invalid-cfg-value.rs:14:7
@@ -15,5 +15,9 @@ LL | #[cfg(feature = "rand")]
|
= note: expected values for `feature` are: full, serde
-warning: 2 warnings emitted
+warning: unexpected condition value `rand` for condition name `feature`
+ |
+ = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
+
+warning: 3 warnings emitted
diff --git a/src/test/ui/check-cfg/mix.rs b/src/test/ui/check-cfg/mix.rs
index 8e3d20d50..4e488fc03 100644
--- a/src/test/ui/check-cfg/mix.rs
+++ b/src/test/ui/check-cfg/mix.rs
@@ -3,7 +3,7 @@
// we correctly lint on the `cfg!` macro and `cfg_attr` attribute.
//
// check-pass
-// compile-flags: --check-cfg=names() --check-cfg=values(feature,"foo") --cfg feature="bar" -Z unstable-options
+// compile-flags: --check-cfg=names() --check-cfg=values(feature,"foo") --cfg feature="bar" --cfg unknown_name -Z unstable-options
#[cfg(windows)]
fn do_windows_stuff() {}
diff --git a/src/test/ui/check-cfg/mix.stderr b/src/test/ui/check-cfg/mix.stderr
index e51b75b3d..9cf887ec7 100644
--- a/src/test/ui/check-cfg/mix.stderr
+++ b/src/test/ui/check-cfg/mix.stderr
@@ -28,6 +28,14 @@ warning: unexpected `cfg` condition name
LL | #[cfg_attr(uu, test)]
| ^^
+warning: unexpected condition value `bar` for condition name `feature`
+ |
+ = help: was set with `--cfg` but isn't in the `--check-cfg` expected values
+
+warning: unexpected `unknown_name` as condition name
+ |
+ = help: was set with `--cfg` but isn't in the `--check-cfg` expected names
+
warning: unexpected `cfg` condition name
--> $DIR/mix.rs:35:10
|
@@ -170,5 +178,5 @@ LL | cfg!(all(feature = "zebra", feature = "zebra", feature = "zebra"));
|
= note: expected values for `feature` are: foo
-warning: 25 warnings emitted
+warning: 27 warnings emitted
diff --git a/src/test/ui/check-cfg/no-values.stderr b/src/test/ui/check-cfg/no-values.stderr
index 7025b4cd7..8c926d187 100644
--- a/src/test/ui/check-cfg/no-values.stderr
+++ b/src/test/ui/check-cfg/no-values.stderr
@@ -4,8 +4,8 @@ warning: unexpected `cfg` condition value
LL | #[cfg(feature = "foo")]
| ^^^^^^^^^^^^^^^
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: no expected value for `feature`
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value
--> $DIR/no-values.rs:10:7
diff --git a/src/test/ui/check-cfg/well-known-values.stderr b/src/test/ui/check-cfg/well-known-values.stderr
index 24ce2280c..4ec74494f 100644
--- a/src/test/ui/check-cfg/well-known-values.stderr
+++ b/src/test/ui/check-cfg/well-known-values.stderr
@@ -6,8 +6,8 @@ LL | #[cfg(target_os = "linuz")]
| |
| help: did you mean: `"linux"`
|
- = note: `#[warn(unexpected_cfgs)]` on by default
= note: expected values for `target_os` are: android, cuda, dragonfly, emscripten, espidf, freebsd, fuchsia, haiku, hermit, horizon, illumos, ios, l4re, linux, macos, netbsd, none, openbsd, psp, redox, solaris, solid_asp3, tvos, uefi, unknown, vxworks, wasi, watchos, windows, xous
+ = note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value
--> $DIR/well-known-values.rs:14:7
diff --git a/src/test/ui/check-static-values-constraints.rs b/src/test/ui/check-static-values-constraints.rs
index eb4ecd8ba..f6a577d0d 100644
--- a/src/test/ui/check-static-values-constraints.rs
+++ b/src/test/ui/check-static-values-constraints.rs
@@ -63,7 +63,7 @@ static STATIC8: SafeStruct = SafeStruct{field1: 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 destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
field2: SafeEnum::Variant1}};
struct UnsafeStruct;
diff --git a/src/test/ui/check-static-values-constraints.stderr b/src/test/ui/check-static-values-constraints.stderr
index b28cf0d6b..31939f7f6 100644
--- a/src/test/ui/check-static-values-constraints.stderr
+++ b/src/test/ui/check-static-values-constraints.stderr
@@ -1,4 +1,4 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `SafeStruct` cannot be evaluated at compile-time
--> $DIR/check-static-values-constraints.rs:65:43
|
LL | ..SafeStruct{field1: SafeEnum::Variant3(WithDtor),
@@ -7,7 +7,7 @@ LL | |
LL | | field2: SafeEnum::Variant1}};
| | ^- value is dropped here
| |________________________________________________________________________________|
- | statics cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in statics
error[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:79:33
@@ -22,6 +22,7 @@ LL | field2: SafeEnum::Variant4("str".to_string())
| ^^^^^^^^^^^
|
= 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[E0010]: allocations are not allowed in statics
--> $DIR/check-static-values-constraints.rs:94:5
diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
index 26f47eb68..e6ddc6068 100644
--- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
+++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
@@ -25,8 +25,8 @@ error[E0308]: mismatched types
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {});
| ^ one type is more general than the other
|
- = note: expected fn pointer `for<'r> fn(&'r u32)`
- found fn pointer `fn(&u32)`
+ = note: expected fn pointer `fn(&u32)`
+ found fn pointer `for<'a> fn(&'a u32)`
error[E0308]: mismatched types
--> $DIR/expect-fn-supply-fn.rs:39:50
@@ -34,8 +34,8 @@ error[E0308]: mismatched types
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {});
| ^ one type is more general than the other
|
- = note: expected fn pointer `fn(&'x u32)`
- found fn pointer `for<'r> fn(&'r u32)`
+ = note: expected fn pointer `for<'a> fn(&'a u32)`
+ found fn pointer `fn(&u32)`
error[E0308]: mismatched types
--> $DIR/expect-fn-supply-fn.rs:48:50
@@ -43,8 +43,8 @@ error[E0308]: mismatched types
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {
| ^ one type is more general than the other
|
- = note: expected fn pointer `fn(&u32)`
- found fn pointer `for<'r> fn(&'r u32)`
+ = note: expected fn pointer `for<'a> fn(&'a u32)`
+ found fn pointer `fn(&u32)`
error: aborting due to 5 previous errors
diff --git a/src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr b/src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr
index db7586bee..d5432755c 100644
--- a/src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr
+++ b/src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr
@@ -6,7 +6,7 @@ LL | with_closure(|x: u32, y| {});
|
help: consider giving this closure parameter an explicit type
|
-LL | with_closure(|x: u32, y: B| {});
+LL | with_closure(|x: u32, y: _| {});
| +++
error: aborting due to previous error
diff --git a/src/test/ui/closure_context/issue-26046-fn-mut.stderr b/src/test/ui/closure_context/issue-26046-fn-mut.stderr
index 74d3c4977..f744b71c2 100644
--- a/src/test/ui/closure_context/issue-26046-fn-mut.stderr
+++ b/src/test/ui/closure_context/issue-26046-fn-mut.stderr
@@ -8,6 +8,8 @@ LL | num += 1;
...
LL | Box::new(closure)
| ----------------- the requirement to implement `Fn` derives from here
+ |
+ = note: required for the cast from `[closure@$DIR/issue-26046-fn-mut.rs:4:19: 4:21]` to the object type `dyn Fn()`
error: aborting due to previous error
diff --git a/src/test/ui/closure_context/issue-26046-fn-once.stderr b/src/test/ui/closure_context/issue-26046-fn-once.stderr
index 473e8e841..34f94f9dc 100644
--- a/src/test/ui/closure_context/issue-26046-fn-once.stderr
+++ b/src/test/ui/closure_context/issue-26046-fn-once.stderr
@@ -8,6 +8,8 @@ LL | vec
...
LL | Box::new(closure)
| ----------------- the requirement to implement `Fn` derives from here
+ |
+ = note: required for the cast from `[closure@$DIR/issue-26046-fn-once.rs:4:19: 4:26]` to the object type `dyn Fn() -> Vec<u8>`
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs
index 93131b2ac..f97e60daf 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/arrays.rs
@@ -68,7 +68,7 @@ fn arrays_5() {
arr[1] += 10;
};
- // c will capture `arr` completely, therefore we cannot borrow other indecies
+ // c will capture `arr` completely, therefore we cannot borrow other indices
// into the array.
println!("{:#?}", &arr[3..2]);
//~^ ERROR: cannot borrow `arr` as immutable because it is also borrowed as mutable
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr
index bcde35983..309c63e52 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-array-diagnostics.stderr
@@ -7,7 +7,15 @@ LL | let [_, _s] = s;
| - closure is `FnOnce` because it moves the variable `s` out of its environment
LL | };
LL | expect_fn(c);
- | --------- the requirement to implement `Fn` derives from here
+ | --------- - the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `expect_fn`
+ --> $DIR/closure-origin-array-diagnostics.rs:5:17
+ |
+LL | fn expect_fn<F: Fn()>(_f: F) {}
+ | ^^^^ required by this bound in `expect_fn`
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr
index df33c4f1f..3e77635f9 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/closure-origin-tuple-diagnostics.stderr
@@ -7,7 +7,15 @@ LL | let s = s.1;
| --- closure is `FnOnce` because it moves the variable `s.1` out of its environment
LL | };
LL | expect_fn(c);
- | --------- the requirement to implement `Fn` derives from here
+ | --------- - the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `expect_fn`
+ --> $DIR/closure-origin-tuple-diagnostics.rs:5:17
+ |
+LL | fn expect_fn<F: Fn()>(_f: F) {}
+ | ^^^^ required by this bound in `expect_fn`
error: aborting due to previous error
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr
index 7e767cba3..cf414adc0 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness.stderr
@@ -4,13 +4,13 @@ warning: value captured by `a` is never read
LL | a = 1;
| ^
|
+ = help: did you mean to capture by reference instead?
note: the lint level is defined here
--> $DIR/liveness.rs:5:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
- = help: did you mean to capture by reference instead?
warning: unused variable: `a`
--> $DIR/liveness.rs:33:9
@@ -18,8 +18,8 @@ warning: unused variable: `a`
LL | a += 1;
| ^
|
- = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
= help: did you mean to capture by reference instead?
+ = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
warning: value assigned to `a` is never read
--> $DIR/liveness.rs:53:9
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr
index 2ac801b49..0410de4c7 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/liveness_unintentional_copy.stderr
@@ -4,13 +4,13 @@ warning: value assigned to `a` is never read
LL | a = s;
| ^
|
+ = help: maybe it is overwritten before being read?
note: the lint level is defined here
--> $DIR/liveness_unintentional_copy.rs:4:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
- = help: maybe it is overwritten before being read?
warning: unused variable: `a`
--> $DIR/liveness_unintentional_copy.rs:20:9
@@ -18,8 +18,8 @@ warning: unused variable: `a`
LL | a = s;
| ^
|
- = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
= help: did you mean to capture by reference instead?
+ = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
warning: unused variable: `a`
--> $DIR/liveness_unintentional_copy.rs:36:9
diff --git a/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr b/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr
index 93abbecf4..508c4b911 100644
--- a/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/diagnostics/repr_packed.stderr
@@ -4,11 +4,11 @@ error: reference to packed field is unaligned
LL | println!("{}", foo.x);
| ^^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
@@ -20,10 +20,10 @@ error: reference to packed field is unaligned
LL | println!("{}", foo.x);
| ^^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
= 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)
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr b/src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr
index 15689023d..b3cb558f9 100644
--- a/src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/issue-88118-2.stderr
@@ -4,9 +4,9 @@ warning: irrefutable `if let` guard pattern
LL | Registry if let _ = registry.try_find_description() => { }
| ^
|
- = note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this pattern will always match, so the guard is useless
= help: consider removing the guard and adding a `let` inside the match arm
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/closures/2229_closure_analysis/issue-90465.stderr b/src/test/ui/closures/2229_closure_analysis/issue-90465.stderr
index 3e921dc0f..c1679c6b6 100644
--- a/src/test/ui/closures/2229_closure_analysis/issue-90465.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/issue-90465.stderr
@@ -10,12 +10,12 @@ LL | let _ = f0;
LL | }
| - in Rust 2018, `f0` is dropped here along with the closure, but in Rust 2021 `f0` is not part of the closure
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/issue-90465.rs:3:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f0` to be fully captured
|
LL ~ let c0 = move || {
diff --git a/src/test/ui/closures/2229_closure_analysis/match/issue-87097.stderr b/src/test/ui/closures/2229_closure_analysis/match/issue-87097.stderr
index 2a49ed4b5..384010859 100644
--- a/src/test/ui/closures/2229_closure_analysis/match/issue-87097.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/match/issue-87097.stderr
@@ -18,8 +18,8 @@ LL | | Variant::B => (),
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: closures are lazy and do nothing unless called
+ = note: `#[warn(unused_must_use)]` on by default
warning: unused closure that must be used
--> $DIR/issue-87097.rs:26:5
diff --git a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
index 318673ef8..972c24c23 100644
--- a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
+++ b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.rs
@@ -24,7 +24,7 @@ fn main() {
let _a = || { match l1 { L1::A => (), L1::B => () } };
// (except if the match is already non-exhaustive)
let _b = || { match l1 { L1::A => () } };
- //~^ ERROR: non-exhaustive patterns: `B` not covered [E0004]
+ //~^ ERROR: non-exhaustive patterns: `L1::B` not covered [E0004]
// l2 should not be captured as it is a non-exhaustive SingleVariant
// defined in this crate
diff --git a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
index e0678bc71..3a5fad154 100644
--- a/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/match/non-exhaustive-match.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `B` not covered
+error[E0004]: non-exhaustive patterns: `L1::B` not covered
--> $DIR/non-exhaustive-match.rs:26:25
|
LL | let _b = || { match l1 { L1::A => () } };
- | ^^ pattern `B` not covered
+ | ^^ pattern `L1::B` not covered
|
note: `L1` defined here
--> $DIR/non-exhaustive-match.rs:12:14
@@ -12,8 +12,8 @@ LL | enum L1 { A, B }
= note: the matched value is of type `L1`
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 | let _b = || { match l1 { L1::A => (), B => todo!() } };
- | ++++++++++++++
+LL | let _b = || { match l1 { L1::A => (), L1::B => todo!() } };
+ | ++++++++++++++++++
error[E0004]: non-exhaustive patterns: type `E1` is non-empty
--> $DIR/non-exhaustive-match.rs:37:25
diff --git a/src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr b/src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
index fea5441ec..ad061d93c 100644
--- a/src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr
@@ -76,6 +76,11 @@ LL | let x: u8;
| - binding declared here but left uninitialized
LL | let c1 = || match x { };
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: u8 = 0;
+ | +++
error: aborting due to 8 previous errors
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
index d7104bafe..3a42cc8b8 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr
@@ -7,12 +7,12 @@ LL | thread::spawn(move || unsafe {
LL | *fptr.0 = 20;
| ------- in Rust 2018, this closure captures all of `fptr`, but in Rust 2021, it will only capture `fptr.0`
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/auto_traits.rs:2:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr` to be fully captured
|
LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr
index c611daf13..bb17e3a34 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/closure-body-macro-fragment.stderr
@@ -15,13 +15,13 @@ LL | | println!("{:?}", x);
LL | | });
| |______- in this macro invocation
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/closure-body-macro-fragment.rs:4:9
|
LL | #![warn(rust_2021_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(rust_2021_incompatible_closure_captures)]` implied by `#[warn(rust_2021_compatibility)]`
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
= note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
help: add a dummy let to cause `a` to be fully captured
|
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr
index 832a81711..a0795c129 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/insignificant_drop_attr_migrations.stderr
@@ -10,12 +10,12 @@ LL | let _t = t.0;
LL | }
| - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/insignificant_drop_attr_migrations.rs:3:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL ~ let c = || {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr
index 41b675f79..36a80e694 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/issue-78720.stderr
@@ -4,9 +4,9 @@ warning: irrefutable `if let` pattern
LL | if let a = "" {
| ^^^^^^^^^^
|
- = note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr
index 2d0c56aad..c17edce72 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/macro.stderr
@@ -7,12 +7,12 @@ LL | let _ = || dbg!(a.0);
LL | }
| - in Rust 2018, `a` is dropped here, but in Rust 2021, only `a.0` will be dropped here as part of the closure
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/macro.rs:5:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `a` to be fully captured
|
LL | let _ = || { let _ = &a; dbg!(a.0) };
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr
index 12760cc72..94526487e 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/migrations_rustfix.stderr
@@ -10,12 +10,12 @@ LL | let _t = t.0;
LL | }
| - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/migrations_rustfix.rs:2:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL ~ let c = || {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed
index 89f393141..ff2244a8e 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed
@@ -3,7 +3,6 @@
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(fn_traits)]
#![feature(never_type)]
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs
index 6b0b10521..52e96d013 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs
@@ -3,7 +3,6 @@
#![deny(rust_2021_incompatible_closure_captures)]
//~^ NOTE: the lint level is defined here
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(fn_traits)]
#![feature(never_type)]
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
index 2648b0043..e10898f98 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr
@@ -1,5 +1,5 @@
error: changes to closure capture in Rust 2021 will affect which traits the closure implements
- --> $DIR/mir_calls_to_shims.rs:21:38
+ --> $DIR/mir_calls_to_shims.rs:20:38
|
LL | let result = panic::catch_unwind(move || {
| ^^^^^^^
@@ -10,12 +10,12 @@ LL | let result = panic::catch_unwind(move || {
LL | f.0()
| --- in Rust 2018, this closure captures all of `f`, but in Rust 2021, it will only capture `f.0`
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/mir_calls_to_shims.rs:4:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f` to be fully captured
|
LL ~ let result = panic::catch_unwind(move || {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
index 96d5c936f..efb264447 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr
@@ -13,12 +13,12 @@ LL | let _f_2 = f2.1;
LL | }
| - in Rust 2018, `f2` is dropped here, but in Rust 2021, only `f2.1` will be dropped here as part of the closure
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/multi_diagnostics.rs:2:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1`, `f2` to be fully captured
|
LL ~ let c = || {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr
index aa9b8672a..eff26a4d6 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/precise.stderr
@@ -10,12 +10,12 @@ LL | let _t = t.0;
LL | }
| - in Rust 2018, `t` is dropped here, but in Rust 2021, only `t.0` will be dropped here as part of the closure
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/precise.rs:3:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL ~ let c = || {
diff --git a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr
index 0d9f09ee3..54ad20f89 100644
--- a/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/migrations/significant_drop.stderr
@@ -20,12 +20,12 @@ LL | }
| in Rust 2018, `t1` is dropped here, but in Rust 2021, only `t1.0` will be dropped here as part of the closure
| in Rust 2018, `t2` is dropped here, but in Rust 2021, only `t2.0` will be dropped here as part of the closure
|
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
note: the lint level is defined here
--> $DIR/significant_drop.rs:2:9
|
LL | #![deny(rust_2021_incompatible_closure_captures)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
|
LL ~ let c = || {
diff --git a/src/test/ui/closures/2229_closure_analysis/repr_packed.rs b/src/test/ui/closures/2229_closure_analysis/repr_packed.rs
index 3ed780f51..f23670f63 100644
--- a/src/test/ui/closures/2229_closure_analysis/repr_packed.rs
+++ b/src/test/ui/closures/2229_closure_analysis/repr_packed.rs
@@ -31,7 +31,7 @@ fn test_alignment_not_affected() {
c();
}
-// `String`, `u16` are not aligned at a one byte boundry and are thus affected by repr(packed).
+// `String`, `u16` are not aligned at a one byte boundary and are thus affected by repr(packed).
//
// Here we test that the closure doesn't capture a reference point to `foo.x` but
// rather capture `foo` entirely.
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs
index 2c828aed5..f8752fe1c 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/by_value.rs
@@ -1,8 +1,8 @@
// edition:2021
// run-pass
-// Test that ByValue captures compile sucessefully especially when the captures are
-// derefenced within the closure.
+// Test that ByValue captures compile successfully especially when the captures are
+// dereferenced within the closure.
#[derive(Debug, Default)]
struct SomeLargeType;
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr
index 40274c883..cf8bd7a0a 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr
@@ -1,8 +1,8 @@
-warning: unused variable: `t2`
- --> $DIR/destructure-pattern-closure-within-closure.rs:13:21
+warning: unused variable: `g2`
+ --> $DIR/destructure-pattern-closure-within-closure.rs:10:17
|
-LL | let (_, t2) = t;
- | ^^ help: if this is intentional, prefix it with an underscore: `_t2`
+LL | let (_, g2) = g;
+ | ^^ help: if this is intentional, prefix it with an underscore: `_g2`
|
note: the lint level is defined here
--> $DIR/destructure-pattern-closure-within-closure.rs:3:9
@@ -11,11 +11,11 @@ LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
-warning: unused variable: `g2`
- --> $DIR/destructure-pattern-closure-within-closure.rs:10:17
+warning: unused variable: `t2`
+ --> $DIR/destructure-pattern-closure-within-closure.rs:13:21
|
-LL | let (_, g2) = g;
- | ^^ help: if this is intentional, prefix it with an underscore: `_g2`
+LL | let (_, t2) = t;
+ | ^^ help: if this is intentional, prefix it with an underscore: `_t2`
warning: 2 warnings emitted
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
index 88a9816a0..03400e0ee 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/disjoint-capture-in-same-closure.rs
@@ -1,7 +1,7 @@
// edition:2021
// run-pass
-// Tests that if a closure uses indivual fields of the same object
+// Tests that if a closure uses individual fields of the same object
// then that case is handled properly.
#![allow(unused)]
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs
index b8e464031..624e0ff22 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-1.rs
@@ -1,10 +1,10 @@
// edition:2021
// run-pass
-// Test that closures can catpure paths that are more precise than just one level
+// Test that closures can capture paths that are more precise than just one level
// from the root variable.
//
-// If the closures can handle such precison we should be able to mutate one path in the closure
+// If the closures can handle such precision we should be able to mutate one path in the closure
// while being able to mutate another path outside the closure, where the two paths are disjoint
// after applying two projections on the root variable.
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs
index 11a324d8a..bd8addd37 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/multilevel-path-2.rs
@@ -3,7 +3,7 @@
#![allow(unused)]
-// If the closures can handle such precison we should be able to read one path in the closure
+// If the closures can handle such precision we should be able to read one path in the closure
// while being able mutate another path outside the closure, where the two paths are disjoint
// after applying two projections on the root variable.
diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs
index bb784774b..a85335438 100644
--- a/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs
+++ b/src/test/ui/closures/2229_closure_analysis/run_pass/mut_ref_struct_mem.rs
@@ -5,7 +5,7 @@
// that is captured by the closure
// More specifically we test that the if the mutable reference isn't root variable of a capture
-// but rather accessed while acessing the precise capture.
+// but rather accessed while accessing the precise capture.
fn mut_tuple() {
let mut t = (10, 10);
diff --git a/src/test/ui/closures/binder/disallow-const.rs b/src/test/ui/closures/binder/disallow-const.rs
new file mode 100644
index 000000000..72ad6185d
--- /dev/null
+++ b/src/test/ui/closures/binder/disallow-const.rs
@@ -0,0 +1,6 @@
+#![feature(closure_lifetime_binder)]
+
+fn main() {
+ for<const N: i32> || -> () {};
+ //~^ ERROR only lifetime parameters can be used in this context
+}
diff --git a/src/test/ui/closures/binder/disallow-const.stderr b/src/test/ui/closures/binder/disallow-const.stderr
new file mode 100644
index 000000000..3c3b43d8c
--- /dev/null
+++ b/src/test/ui/closures/binder/disallow-const.stderr
@@ -0,0 +1,8 @@
+error: only lifetime parameters can be used in this context
+ --> $DIR/disallow-const.rs:4:15
+ |
+LL | for<const N: i32> || -> () {};
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/closures/binder/disallow-ty.rs b/src/test/ui/closures/binder/disallow-ty.rs
new file mode 100644
index 000000000..bbe3d8488
--- /dev/null
+++ b/src/test/ui/closures/binder/disallow-ty.rs
@@ -0,0 +1,6 @@
+#![feature(closure_lifetime_binder)]
+
+fn main() {
+ for<T> || -> () {};
+ //~^ ERROR only lifetime parameters can be used in this context
+}
diff --git a/src/test/ui/closures/binder/disallow-ty.stderr b/src/test/ui/closures/binder/disallow-ty.stderr
new file mode 100644
index 000000000..51b6773ed
--- /dev/null
+++ b/src/test/ui/closures/binder/disallow-ty.stderr
@@ -0,0 +1,8 @@
+error: only lifetime parameters can be used in this context
+ --> $DIR/disallow-ty.rs:4:9
+ |
+LL | for<T> || -> () {};
+ | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/closures/closure-bounds-subtype.stderr b/src/test/ui/closures/closure-bounds-subtype.stderr
index 1a40326d9..8ad8273fc 100644
--- a/src/test/ui/closures/closure-bounds-subtype.stderr
+++ b/src/test/ui/closures/closure-bounds-subtype.stderr
@@ -11,6 +11,10 @@ note: required by a bound in `take_const_owned`
|
LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send {
| ^^^^ required by this bound in `take_const_owned`
+help: use parentheses to call this type parameter
+ |
+LL | take_const_owned(f());
+ | ++
help: consider further restricting this bound
|
LL | fn give_owned<F>(f: F) where F: FnOnce() + Send + std::marker::Sync {
diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr
index 1086cfa29..a2ca06b4e 100644
--- a/src/test/ui/closures/closure-move-sync.stderr
+++ b/src/test/ui/closures/closure-move-sync.stderr
@@ -1,11 +1,17 @@
error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
- --> $DIR/closure-move-sync.rs:6:13
+ --> $DIR/closure-move-sync.rs:6:27
|
-LL | let t = thread::spawn(|| {
- | ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
+LL | let t = thread::spawn(|| {
+ | _____________-------------_^
+ | | |
+ | | required by a bound introduced by this call
+LL | | recv.recv().unwrap();
+LL | |
+LL | | });
+ | |_____^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
- = note: required because of the requirements on the impl of `Send` for `&std::sync::mpsc::Receiver<()>`
+ = note: required for `&std::sync::mpsc::Receiver<()>` to implement `Send`
note: required because it's used within this closure
--> $DIR/closure-move-sync.rs:6:27
|
@@ -18,13 +24,15 @@ LL | F: Send + 'static,
| ^^^^ required by this bound in `spawn`
error[E0277]: `Sender<()>` cannot be shared between threads safely
- --> $DIR/closure-move-sync.rs:18:5
+ --> $DIR/closure-move-sync.rs:18:19
|
LL | thread::spawn(|| tx.send(()).unwrap());
- | ^^^^^^^^^^^^^ `Sender<()>` cannot be shared between threads safely
+ | ------------- ^^^^^^^^^^^^^^^^^^^^^^^ `Sender<()>` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `Sender<()>`
- = note: required because of the requirements on the impl of `Send` for `&Sender<()>`
+ = note: required for `&Sender<()>` to implement `Send`
note: required because it's used within this closure
--> $DIR/closure-move-sync.rs:18:19
|
diff --git a/src/test/ui/closures/closure-reform-bad.stderr b/src/test/ui/closures/closure-reform-bad.stderr
index 9dfff8499..4c40f70b9 100644
--- a/src/test/ui/closures/closure-reform-bad.stderr
+++ b/src/test/ui/closures/closure-reform-bad.stderr
@@ -8,7 +8,7 @@ LL | call_bare(f)
| |
| arguments to this function are incorrect
|
- = note: expected fn pointer `for<'r> fn(&'r str)`
+ = note: expected fn pointer `for<'a> fn(&'a str)`
found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:22]`
note: closures can only be coerced to `fn` types if they do not capture any variables
--> $DIR/closure-reform-bad.rs:10:43
diff --git a/src/test/ui/closures/closure-return-type-must-be-sized.rs b/src/test/ui/closures/closure-return-type-must-be-sized.rs
new file mode 100644
index 000000000..8cfa02912
--- /dev/null
+++ b/src/test/ui/closures/closure-return-type-must-be-sized.rs
@@ -0,0 +1,74 @@
+#![feature(unboxed_closures)]
+
+trait A {
+ fn a() where Self: Sized;
+}
+
+mod a {
+ use crate::A;
+
+ pub fn foo<F: FnOnce<()>>() where F::Output: A {
+ F::Output::a()
+ }
+
+ pub fn bar<F: FnOnce() -> R, R: ?Sized>() {}
+
+ pub fn baz<F: FnOnce<()>>() where F::Output: A, F::Output: Sized {
+ F::Output::a()
+ }
+}
+
+mod b {
+ use crate::A;
+
+ pub fn foo<F: Fn<()>>() where F::Output: A {
+ F::Output::a()
+ }
+
+ pub fn bar<F: Fn() -> R, R: ?Sized>() {}
+
+ pub fn baz<F: Fn<()>>() where F::Output: A, F::Output: Sized {
+ F::Output::a()
+ }
+}
+
+mod c {
+ use crate::A;
+
+ pub fn foo<F: FnMut<()>>() where F::Output: A {
+ F::Output::a()
+ }
+
+ pub fn bar<F: FnMut() -> R, R: ?Sized>() {}
+
+ pub fn baz<F: FnMut<()>>() where F::Output: A, F::Output: Sized {
+ F::Output::a()
+ }
+}
+
+impl A for Box<dyn A> {
+ fn a() {}
+}
+
+fn main() {
+ a::foo::<fn() -> dyn A>(); //~ ERROR E0277
+ a::bar::<fn() -> dyn A, _>(); //~ ERROR E0277
+ a::baz::<fn() -> dyn A>(); //~ ERROR E0277
+ a::foo::<fn() -> Box<dyn A>>(); // ok
+ a::bar::<fn() -> Box<dyn A>, _>(); // ok
+ a::baz::<fn() -> Box<dyn A>>(); // ok
+
+ b::foo::<fn() -> dyn A>(); //~ ERROR E0277
+ b::bar::<fn() -> dyn A, _>(); //~ ERROR E0277
+ b::baz::<fn() -> dyn A>(); //~ ERROR E0277
+ b::foo::<fn() -> Box<dyn A>>(); // ok
+ b::bar::<fn() -> Box<dyn A>, _>(); // ok
+ b::baz::<fn() -> Box<dyn A>>(); // ok
+
+ c::foo::<fn() -> dyn A>(); //~ ERROR E0277
+ c::bar::<fn() -> dyn A, _>(); //~ ERROR E0277
+ c::baz::<fn() -> dyn A>(); //~ ERROR E0277
+ c::foo::<fn() -> Box<dyn A>>(); // ok
+ c::bar::<fn() -> Box<dyn A>, _>(); // ok
+ c::baz::<fn() -> Box<dyn A>>(); // ok
+}
diff --git a/src/test/ui/closures/closure-return-type-must-be-sized.stderr b/src/test/ui/closures/closure-return-type-must-be-sized.stderr
new file mode 100644
index 000000000..b07425bd8
--- /dev/null
+++ b/src/test/ui/closures/closure-return-type-must-be-sized.stderr
@@ -0,0 +1,99 @@
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:54:5
+ |
+LL | a::foo::<fn() -> dyn A>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:55:14
+ |
+LL | a::bar::<fn() -> dyn A, _>();
+ | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+note: required by a bound in `a::bar`
+ --> $DIR/closure-return-type-must-be-sized.rs:14:19
+ |
+LL | pub fn bar<F: FnOnce() -> R, R: ?Sized>() {}
+ | ^^^^^^^^^^^^^ required by this bound in `a::bar`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:56:5
+ |
+LL | a::baz::<fn() -> dyn A>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:61:5
+ |
+LL | b::foo::<fn() -> dyn A>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:62:14
+ |
+LL | b::bar::<fn() -> dyn A, _>();
+ | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+note: required by a bound in `b::bar`
+ --> $DIR/closure-return-type-must-be-sized.rs:28:19
+ |
+LL | pub fn bar<F: Fn() -> R, R: ?Sized>() {}
+ | ^^^^^^^^^ required by this bound in `b::bar`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:63:5
+ |
+LL | b::baz::<fn() -> dyn A>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:68:5
+ |
+LL | c::foo::<fn() -> dyn A>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:69:14
+ |
+LL | c::bar::<fn() -> dyn A, _>();
+ | ^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+note: required by a bound in `c::bar`
+ --> $DIR/closure-return-type-must-be-sized.rs:42:19
+ |
+LL | pub fn bar<F: FnMut() -> R, R: ?Sized>() {}
+ | ^^^^^^^^^^^^ required by this bound in `c::bar`
+
+error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
+ --> $DIR/closure-return-type-must-be-sized.rs:70:5
+ |
+LL | c::baz::<fn() -> dyn A>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A`
+ = note: required because it appears within the type `fn() -> dyn A`
+
+error: aborting due to 9 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/closures/closure-wrong-kind.stderr b/src/test/ui/closures/closure-wrong-kind.stderr
index 35caf71a5..9ea55d764 100644
--- a/src/test/ui/closures/closure-wrong-kind.stderr
+++ b/src/test/ui/closures/closure-wrong-kind.stderr
@@ -6,7 +6,15 @@ LL | let closure = |_| foo(x);
| |
| this closure implements `FnOnce`, not `Fn`
LL | bar(closure);
- | --- the requirement to implement `Fn` derives from here
+ | --- ------- the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `bar`
+ --> $DIR/closure-wrong-kind.rs:6:11
+ |
+LL | fn bar<T: Fn(u32)>(_: T) {}
+ | ^^^^^^^ required by this bound in `bar`
error: aborting due to previous error
diff --git a/src/test/ui/closures/closure_promotion.rs b/src/test/ui/closures/closure_promotion.rs
index db36985af..47a8fc090 100644
--- a/src/test/ui/closures/closure_promotion.rs
+++ b/src/test/ui/closures/closure_promotion.rs
@@ -1,7 +1,5 @@
// build-pass (FIXME(62277): could be check-pass?)
-#![allow(const_err)]
-
fn main() {
let x: &'static _ = &|| { let z = 3; z };
}
diff --git a/src/test/ui/closures/coerce-unsafe-to-closure.stderr b/src/test/ui/closures/coerce-unsafe-to-closure.stderr
index bd095c2d8..6ce63e829 100644
--- a/src/test/ui/closures/coerce-unsafe-to-closure.stderr
+++ b/src/test/ui/closures/coerce-unsafe-to-closure.stderr
@@ -6,7 +6,7 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute);
| |
| required by a bound introduced by this call
|
- = help: the trait `FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
+ = help: the trait `FnOnce<(&str,)>` is not implemented for fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `Option::<T>::map`
--> $SRC_DIR/core/src/option.rs:LL:COL
diff --git a/src/test/ui/closures/issue-101696.rs b/src/test/ui/closures/issue-101696.rs
new file mode 100644
index 000000000..0a358bd16
--- /dev/null
+++ b/src/test/ui/closures/issue-101696.rs
@@ -0,0 +1,36 @@
+// check-pass
+
+use std::marker::PhantomData;
+
+#[derive(Default)]
+struct MyType<'a> {
+ field: usize,
+ _phantom: PhantomData<&'a ()>,
+}
+
+#[derive(Default)]
+struct MyTypeVariant<'a> {
+ field: usize,
+ _phantom: PhantomData<&'a ()>,
+}
+
+trait AsVariantTrait {
+ type Type;
+}
+
+impl<'a> AsVariantTrait for MyType<'a> {
+ type Type = MyTypeVariant<'a>;
+}
+
+type Variant<G> = <G as AsVariantTrait>::Type;
+
+fn foo<T: Default, F: FnOnce(T)>(f: F) {
+ let input = T::default();
+ f(input);
+}
+
+fn main() {
+ foo(|a: <MyType as AsVariantTrait>::Type| {
+ a.field;
+ });
+}
diff --git a/src/test/ui/closures/issue-102089-multiple-opaque-cast.rs b/src/test/ui/closures/issue-102089-multiple-opaque-cast.rs
new file mode 100644
index 000000000..043bf06a1
--- /dev/null
+++ b/src/test/ui/closures/issue-102089-multiple-opaque-cast.rs
@@ -0,0 +1,17 @@
+// edition:2021
+// check-pass
+
+pub struct Example<'a, T> {
+ a: T,
+ b: &'a T,
+}
+
+impl<'a, T> Example<'a, T> {
+ pub fn error_trying_to_destructure_self_in_closure(self) {
+ let closure = || {
+ let Self { a, b } = self;
+ };
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/issue-10398.rs b/src/test/ui/closures/issue-10398.rs
index 0405b2d01..f76d09cd0 100644
--- a/src/test/ui/closures/issue-10398.rs
+++ b/src/test/ui/closures/issue-10398.rs
@@ -1,7 +1,5 @@
-#![feature(box_syntax)]
-
fn main() {
- let x: Box<_> = box 1;
+ let x: Box<_> = Box::new(1);
let f = move|| {
let _a = x;
drop(x);
diff --git a/src/test/ui/closures/issue-10398.stderr b/src/test/ui/closures/issue-10398.stderr
index 8d9faf324..423b79daf 100644
--- a/src/test/ui/closures/issue-10398.stderr
+++ b/src/test/ui/closures/issue-10398.stderr
@@ -1,5 +1,5 @@
error[E0382]: use of moved value: `x`
- --> $DIR/issue-10398.rs:7:14
+ --> $DIR/issue-10398.rs:5:14
|
LL | let _a = x;
| - value moved here
diff --git a/src/test/ui/closures/issue-52437.rs b/src/test/ui/closures/issue-52437.rs
index f79a0bd35..6ac5380a5 100644
--- a/src/test/ui/closures/issue-52437.rs
+++ b/src/test/ui/closures/issue-52437.rs
@@ -2,5 +2,4 @@ fn main() {
[(); &(&'static: loop { |x| {}; }) as *const _ as usize]
//~^ ERROR: invalid label name `'static`
//~| ERROR: type annotations needed
- //~| ERROR mismatched types
}
diff --git a/src/test/ui/closures/issue-52437.stderr b/src/test/ui/closures/issue-52437.stderr
index 38d9d08ce..4c24a54bb 100644
--- a/src/test/ui/closures/issue-52437.stderr
+++ b/src/test/ui/closures/issue-52437.stderr
@@ -15,15 +15,6 @@ help: consider giving this closure parameter an explicit type
LL | [(); &(&'static: loop { |x: _| {}; }) as *const _ as usize]
| +++
-error[E0308]: mismatched types
- --> $DIR/issue-52437.rs:2:5
- |
-LL | fn main() {
- | - expected `()` because of default return type
-LL | [(); &(&'static: loop { |x| {}; }) as *const _ as usize]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[(); _]`
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0282, E0308.
-For more information about an error, try `rustc --explain E0282`.
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/closures/issue-6801.rs b/src/test/ui/closures/issue-6801.rs
index 694d86feb..cecb08f00 100644
--- a/src/test/ui/closures/issue-6801.rs
+++ b/src/test/ui/closures/issue-6801.rs
@@ -2,7 +2,7 @@
// transferring ownership of the box before invoking the stack
// closure results in a crash.
-#![feature(box_syntax)]
+
fn twice(x: Box<usize>) -> usize {
*x * 2
@@ -13,7 +13,7 @@ fn invoke<F>(f: F) where F: FnOnce() -> usize {
}
fn main() {
- let x : Box<usize> = box 9;
+ let x : Box<usize> = Box::new(9);
let sq = || { *x * *x };
twice(x); //~ ERROR: cannot move out of
diff --git a/src/test/ui/closures/issue-84128.rs b/src/test/ui/closures/issue-84128.rs
index f81d7cfaa..30733871b 100644
--- a/src/test/ui/closures/issue-84128.rs
+++ b/src/test/ui/closures/issue-84128.rs
@@ -1,5 +1,5 @@
// test for issue 84128
-// missing suggestion for similar ADT type with diffetent generic paramenter
+// missing suggestion for similar ADT type with diffetent generic parameter
// on closure ReturnNoExpression
struct Foo<T>(T);
diff --git a/src/test/ui/closures/issue-84128.stderr b/src/test/ui/closures/issue-84128.stderr
index 09c44d261..59607afec 100644
--- a/src/test/ui/closures/issue-84128.stderr
+++ b/src/test/ui/closures/issue-84128.stderr
@@ -6,11 +6,6 @@ LL | Foo(())
| |
| arguments to this struct are incorrect
|
-note: return type inferred to be `{integer}` here
- --> $DIR/issue-84128.rs:10:20
- |
-LL | return Foo(0);
- | ^^^^^^
note: tuple struct defined here
--> $DIR/issue-84128.rs:5:8
|
diff --git a/src/test/ui/closures/issue-97607.rs b/src/test/ui/closures/issue-97607.rs
new file mode 100644
index 000000000..74c910ad0
--- /dev/null
+++ b/src/test/ui/closures/issue-97607.rs
@@ -0,0 +1,12 @@
+// check-pass
+#[allow(unused)]
+
+fn test<T, F, U>(f: F) -> Box<dyn Fn(T) -> U + 'static>
+where
+ F: 'static + Fn(T) -> U,
+ for<'a> U: 'a, // < This is the problematic line, see #97607
+{
+ Box::new(move |t| f(t))
+}
+
+fn main() {}
diff --git a/src/test/ui/closures/multiple-fn-bounds.rs b/src/test/ui/closures/multiple-fn-bounds.rs
new file mode 100644
index 000000000..6bb4098e2
--- /dev/null
+++ b/src/test/ui/closures/multiple-fn-bounds.rs
@@ -0,0 +1,15 @@
+fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
+ //~^ NOTE required by a bound in `foo`
+ //~| NOTE required by this bound in `foo`
+ //~| NOTE closure inferred to have a different signature due to this bound
+ todo!();
+}
+
+fn main() {
+ let v = true;
+ foo(move |x| v);
+ //~^ ERROR type mismatch in closure arguments
+ //~| NOTE expected closure signature
+ //~| NOTE expected due to this
+ //~| NOTE found signature defined here
+}
diff --git a/src/test/ui/closures/multiple-fn-bounds.stderr b/src/test/ui/closures/multiple-fn-bounds.stderr
new file mode 100644
index 000000000..eefc123fe
--- /dev/null
+++ b/src/test/ui/closures/multiple-fn-bounds.stderr
@@ -0,0 +1,24 @@
+error[E0631]: type mismatch in closure arguments
+ --> $DIR/multiple-fn-bounds.rs:10:5
+ |
+LL | foo(move |x| v);
+ | ^^^ -------- found signature defined here
+ | |
+ | expected due to this
+ |
+ = note: expected closure signature `fn(char) -> _`
+ found closure signature `for<'a> fn(&'a char) -> _`
+note: closure inferred to have a different signature due to this bound
+ --> $DIR/multiple-fn-bounds.rs:1:11
+ |
+LL | fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
+ | ^^^^^^^^^^^^^^^^^
+note: required by a bound in `foo`
+ --> $DIR/multiple-fn-bounds.rs:1:31
+ |
+LL | fn foo<F: Fn(&char) -> bool + Fn(char) -> bool>(f: F) {
+ | ^^^^^^^^^^^^^^^^ required by this bound in `foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0631`.
diff --git a/src/test/ui/closures/old-closure-expression-remove-semicolon.fixed b/src/test/ui/closures/old-closure-expression-remove-semicolon.fixed
index 623e917da..8aa9e952b 100644
--- a/src/test/ui/closures/old-closure-expression-remove-semicolon.fixed
+++ b/src/test/ui/closures/old-closure-expression-remove-semicolon.fixed
@@ -7,6 +7,6 @@ fn foo() -> i32 {
fn main() {
let _x: i32 = {
//~^ ERROR mismatched types
- foo() //~ HELP remove this semicolon
+ foo() //~ HELP remove this semicolon to return this value
};
}
diff --git a/src/test/ui/closures/old-closure-expression-remove-semicolon.rs b/src/test/ui/closures/old-closure-expression-remove-semicolon.rs
index 4974b0866..912c7a331 100644
--- a/src/test/ui/closures/old-closure-expression-remove-semicolon.rs
+++ b/src/test/ui/closures/old-closure-expression-remove-semicolon.rs
@@ -7,6 +7,6 @@ fn foo() -> i32 {
fn main() {
let _x: i32 = {
//~^ ERROR mismatched types
- foo(); //~ HELP remove this semicolon
+ foo(); //~ HELP remove this semicolon to return this value
};
}
diff --git a/src/test/ui/closures/old-closure-expression-remove-semicolon.stderr b/src/test/ui/closures/old-closure-expression-remove-semicolon.stderr
index 9b73ce4fe..bc54ab4d5 100644
--- a/src/test/ui/closures/old-closure-expression-remove-semicolon.stderr
+++ b/src/test/ui/closures/old-closure-expression-remove-semicolon.stderr
@@ -5,7 +5,7 @@ LL | let _x: i32 = {
| ___________________^
LL | |
LL | | foo();
- | | - help: remove this semicolon
+ | | - help: remove this semicolon to return this value
LL | | };
| |_____^ expected `i32`, found `()`
diff --git a/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr b/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr
index fdaf353fe..3ab7c66d1 100644
--- a/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr
+++ b/src/test/ui/closures/print/closure-print-generic-verbose-1.stderr
@@ -2,7 +2,7 @@ error[E0382]: use of moved value: `c`
--> $DIR/closure-print-generic-verbose-1.rs:17:5
|
LL | let c = to_fn_once(move|| {
- | - move occurs because `c` has type `[f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'_#10r str>, T)]`, which does not implement the `Copy` trait
+ | - move occurs because `c` has type `[f<T>::{closure#0} closure_kind_ty=i32 closure_sig_as_fn_ptr_ty=extern "rust-call" fn(()) upvar_tys=(Foo<&'_#9r str>, T)]`, which does not implement the `Copy` trait
...
LL | c();
| --- `c` moved due to this call
diff --git a/src/test/ui/codegen/issue-101585-128bit-repeat.rs b/src/test/ui/codegen/issue-101585-128bit-repeat.rs
new file mode 100644
index 000000000..c6a686597
--- /dev/null
+++ b/src/test/ui/codegen/issue-101585-128bit-repeat.rs
@@ -0,0 +1,14 @@
+// Regression test for issue 101585.
+// run-pass
+
+fn main() {
+ fn min_array_ok() -> [i128; 1] {
+ [i128::MIN]
+ }
+ assert_eq!(min_array_ok(), [-170141183460469231731687303715884105728i128]);
+
+ fn min_array_nok() -> [i128; 1] {
+ [i128::MIN; 1]
+ }
+ assert_eq!(min_array_nok(), [-170141183460469231731687303715884105728i128]);
+}
diff --git a/src/test/ui/codegen/issue-99551.rs b/src/test/ui/codegen/issue-99551.rs
new file mode 100644
index 000000000..f24874c99
--- /dev/null
+++ b/src/test/ui/codegen/issue-99551.rs
@@ -0,0 +1,21 @@
+// build-pass
+#![feature(trait_upcasting)]
+#![allow(incomplete_features)]
+
+pub trait A {}
+pub trait B {}
+
+pub trait C: A + B {}
+impl<X: A + B> C for X {}
+
+pub fn test<'a, T>(view: T) -> Option<&'a mut dyn B>
+where
+ T: IntoIterator<Item = &'a mut dyn B>,
+{
+ return Some(view.into_iter().next().unwrap());
+}
+
+fn main() {
+ let mut a: Vec<Box<dyn C>> = Vec::new();
+ test(a.iter_mut().map(|c| c.as_mut() as &mut dyn B));
+}
diff --git a/src/test/ui/codemap_tests/unicode.normal.stderr b/src/test/ui/codemap_tests/unicode.normal.stderr
index 60f8cff84..05ceb6910 100644
--- a/src/test/ui/codemap_tests/unicode.normal.stderr
+++ b/src/test/ui/codemap_tests/unicode.normal.stderr
@@ -4,7 +4,7 @@ error[E0703]: invalid ABI: found `路濫狼á́́`
LL | extern "路濫狼á́́" fn foo() {}
| ^^^^^^^^^ invalid ABI
|
- = help: valid ABIs: Rust, C, C-unwind, cdecl, cdecl-unwind, stdcall, stdcall-unwind, fastcall, fastcall-unwind, vectorcall, vectorcall-unwind, thiscall, thiscall-unwind, aapcs, aapcs-unwind, win64, win64-unwind, sysv64, sysv64-unwind, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, wasm, system, system-unwind, rust-intrinsic, rust-call, platform-intrinsic, unadjusted, rust-cold
+ = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions.
error: aborting due to previous error
diff --git a/src/test/ui/coercion/coerce-reborrow-multi-arg-fail.stderr b/src/test/ui/coercion/coerce-reborrow-multi-arg-fail.stderr
index 36551e5af..5cbdef218 100644
--- a/src/test/ui/coercion/coerce-reborrow-multi-arg-fail.stderr
+++ b/src/test/ui/coercion/coerce-reborrow-multi-arg-fail.stderr
@@ -12,7 +12,7 @@ note: function defined here
--> $DIR/coerce-reborrow-multi-arg-fail.rs:1:4
|
LL | fn test<T>(_a: T, _b: T) {}
- | ^^^^ ----- -----
+ | ^^^^ -----
error: aborting due to previous error
diff --git a/src/test/ui/coercion/coerce-to-bang.stderr b/src/test/ui/coercion/coerce-to-bang.stderr
index add8f14cf..1207dc7e7 100644
--- a/src/test/ui/coercion/coerce-to-bang.stderr
+++ b/src/test/ui/coercion/coerce-to-bang.stderr
@@ -12,7 +12,7 @@ note: function defined here
--> $DIR/coerce-to-bang.rs:3:4
|
LL | fn foo(x: usize, y: !, z: usize) { }
- | ^^^ -------- ---- --------
+ | ^^^ ----
error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:18:13
@@ -28,7 +28,7 @@ note: function defined here
--> $DIR/coerce-to-bang.rs:3:4
|
LL | fn foo(x: usize, y: !, z: usize) { }
- | ^^^ -------- ---- --------
+ | ^^^ ----
error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:26:12
@@ -44,7 +44,7 @@ note: function defined here
--> $DIR/coerce-to-bang.rs:3:4
|
LL | fn foo(x: usize, y: !, z: usize) { }
- | ^^^ -------- ---- --------
+ | ^^^ ----
error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:36:12
@@ -60,7 +60,7 @@ note: function defined here
--> $DIR/coerce-to-bang.rs:3:4
|
LL | fn foo(x: usize, y: !, z: usize) { }
- | ^^^ -------- ---- --------
+ | ^^^ ----
error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:45:12
@@ -76,7 +76,7 @@ note: function defined here
--> $DIR/coerce-to-bang.rs:3:4
|
LL | fn foo(x: usize, y: !, z: usize) { }
- | ^^^ -------- ---- --------
+ | ^^^ ----
error[E0308]: mismatched types
--> $DIR/coerce-to-bang.rs:50:21
diff --git a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
index a4843bca5..4c04bb113 100644
--- a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
+++ b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr
@@ -6,7 +6,7 @@ LL | fn plus_one(x: i32) -> i32 {
| |
| implicitly returns `()` as its body has no tail or `return` expression
LL | x + 1;
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:8:13
@@ -16,7 +16,7 @@ LL | fn foo() -> Result<u8, u64> {
| |
| implicitly returns `()` as its body has no tail or `return` expression
LL | Ok(1);
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
|
= note: expected enum `Result<u8, u64>`
found unit type `()`
diff --git a/src/test/ui/coercion/issue-101066.rs b/src/test/ui/coercion/issue-101066.rs
new file mode 100644
index 000000000..b658ed1e9
--- /dev/null
+++ b/src/test/ui/coercion/issue-101066.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+use std::convert::TryFrom;
+
+pub trait FieldElement {
+ type Integer: TryFrom<usize, Error = std::num::TryFromIntError>;
+
+ fn valid_integer_try_from<N>(i: N) -> Result<Self::Integer, ()>
+ where
+ Self::Integer: TryFrom<N>,
+ {
+ Self::Integer::try_from(i).map_err(|_| ())
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/coercion/issue-36007.rs b/src/test/ui/coercion/issue-36007.rs
new file mode 100644
index 000000000..78812df87
--- /dev/null
+++ b/src/test/ui/coercion/issue-36007.rs
@@ -0,0 +1,20 @@
+// check-pass
+#![feature(coerce_unsized, unsize)]
+
+use std::marker::Unsize;
+use std::ops::CoerceUnsized;
+
+struct Foo<T: ?Sized>(Box<T>);
+
+impl<T> CoerceUnsized<Foo<dyn Baz>> for Foo<T> where T: Unsize<dyn Baz> {}
+
+struct Bar;
+
+trait Baz {}
+
+impl Baz for Bar {}
+
+fn main() {
+ let foo = Foo(Box::new(Bar));
+ let foobar: Foo<Bar> = foo;
+}
diff --git a/src/test/ui/coherence/auxiliary/trait-with-const-param.rs b/src/test/ui/coherence/auxiliary/trait-with-const-param.rs
new file mode 100644
index 000000000..a44eb14f8
--- /dev/null
+++ b/src/test/ui/coherence/auxiliary/trait-with-const-param.rs
@@ -0,0 +1 @@
+pub trait Trait<const N: usize, T> {}
diff --git a/src/test/ui/coherence/coherence-default-trait-impl.stderr b/src/test/ui/coherence/coherence-default-trait-impl.stderr
index b08ccb087..632018782 100644
--- a/src/test/ui/coherence/coherence-default-trait-impl.stderr
+++ b/src/test/ui/coherence/coherence-default-trait-impl.stderr
@@ -3,12 +3,24 @@ error[E0199]: implementing the trait `MySafeTrait` is not unsafe
|
LL | unsafe impl MySafeTrait for Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: remove `unsafe` from this trait implementation
+ |
+LL - unsafe impl MySafeTrait for Foo {}
+LL + impl MySafeTrait for Foo {}
+ |
error[E0200]: the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
--> $DIR/coherence-default-trait-impl.rs:13:1
|
LL | impl MyUnsafeTrait for Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the trait `MyUnsafeTrait` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
+help: add `unsafe` to this trait implementation
+ |
+LL | unsafe impl MyUnsafeTrait for Foo {}
+ | ++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
index cfcef9699..7dabd97b9 100644
--- a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
+++ b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
@@ -1,10 +1,10 @@
-error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(for<'r> fn(&'r ()))`
+error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))`
--> $DIR/coherence-fn-covariant-bound-vs-static.rs:17:1
|
LL | impl Trait for for<'r> fn(fn(&'r ())) {}
| ------------------------------------- first implementation here
LL | impl<'a> Trait for fn(fn(&'a ())) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'r> fn(for<'r> fn(&'r ()))`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'r> fn(fn(&'r ()))`
|
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
diff --git a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr b/src/test/ui/coherence/coherence-fn-implied-bounds.stderr
index 8612ce60d..201871204 100644
--- a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr
+++ b/src/test/ui/coherence/coherence-fn-implied-bounds.stderr
@@ -7,14 +7,14 @@ LL |
LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
|
+ = 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 #56105 <https://github.com/rust-lang/rust/issues/56105>
+ = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
note: the lint level is defined here
--> $DIR/coherence-fn-implied-bounds.rs:15:9
|
LL | #![deny(coherence_leak_check)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #56105 <https://github.com/rust-lang/rust/issues/56105>
- = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr b/src/test/ui/coherence/coherence-free-vs-bound-region.stderr
index af18655b0..e2d84b833 100644
--- a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr
+++ b/src/test/ui/coherence/coherence-free-vs-bound-region.stderr
@@ -7,14 +7,14 @@ LL |
LL | impl TheTrait for fn(&u8) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&u8)`
|
+ = 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 #56105 <https://github.com/rust-lang/rust/issues/56105>
+ = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
note: the lint level is defined here
--> $DIR/coherence-free-vs-bound-region.rs:10:9
|
LL | #![deny(coherence_leak_check)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #56105 <https://github.com/rust-lang/rust/issues/56105>
- = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
error: aborting due to previous error
diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
index 97f3c7593..7bd50649d 100644
--- a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
+++ b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0391]: cycle detected when building specialization graph of trait `Trait`
--> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1
diff --git a/src/test/ui/coherence/coherence-negative-impls-copy-bad.rs b/src/test/ui/coherence/coherence-negative-impls-copy-bad.rs
new file mode 100644
index 000000000..563f28e22
--- /dev/null
+++ b/src/test/ui/coherence/coherence-negative-impls-copy-bad.rs
@@ -0,0 +1,11 @@
+#![feature(negative_impls)]
+#![crate_type = "lib"]
+
+impl !Copy for str {}
+//~^ ERROR only traits defined in the current crate can be implemented
+
+impl !Copy for fn() {}
+//~^ ERROR only traits defined in the current crate can be implemented
+
+impl !Copy for () {}
+//~^ ERROR only traits defined in the current crate can be implemented
diff --git a/src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr b/src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr
new file mode 100644
index 000000000..2295d6315
--- /dev/null
+++ b/src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr
@@ -0,0 +1,36 @@
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+ --> $DIR/coherence-negative-impls-copy-bad.rs:4:1
+ |
+LL | impl !Copy for str {}
+ | ^^^^^^^^^^^^^^^---
+ | | |
+ | | `str` is not defined in the current crate
+ | impl doesn't use only types from inside the current crate
+ |
+ = note: define and implement a trait or new type instead
+
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+ --> $DIR/coherence-negative-impls-copy-bad.rs:7:1
+ |
+LL | impl !Copy for fn() {}
+ | ^^^^^^^^^^^^^^^----
+ | | |
+ | | `fn()` is not defined in the current crate
+ | impl doesn't use only types from inside the current crate
+ |
+ = note: define and implement a trait or new type instead
+
+error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
+ --> $DIR/coherence-negative-impls-copy-bad.rs:10:1
+ |
+LL | impl !Copy for () {}
+ | ^^^^^^^^^^^^^^^--
+ | | |
+ | | this is not defined in the current crate because tuples are always foreign
+ | impl doesn't use only types from inside the current crate
+ |
+ = note: define and implement a trait or new type instead
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0117`.
diff --git a/src/test/ui/coherence/coherence-negative-impls-copy.rs b/src/test/ui/coherence/coherence-negative-impls-copy.rs
new file mode 100644
index 000000000..7b29aade4
--- /dev/null
+++ b/src/test/ui/coherence/coherence-negative-impls-copy.rs
@@ -0,0 +1,29 @@
+// check-pass
+// regression test for issue #101836
+
+#![feature(negative_impls, extern_types)]
+#![crate_type = "lib"]
+
+struct NonCopy;
+struct NeverCopy(NonCopy);
+
+impl !Copy for NeverCopy {}
+
+
+struct WithDrop;
+impl Drop for WithDrop { fn drop(&mut self) {} }
+
+impl !Copy for WithDrop {}
+
+
+struct Type;
+trait Trait {}
+extern {
+ type ExternType;
+}
+
+impl !Copy for &mut Type {}
+
+impl !Copy for dyn Trait {}
+
+impl !Copy for ExternType {}
diff --git a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs
index 159788b1b..3acf0d8d3 100644
--- a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs
+++ b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs
@@ -1,12 +1,17 @@
-#![feature(negative_impls)]
+// revisions: stock with_negative_coherence
+//[with_negative_coherence] check-pass
-// FIXME: this should compile
+#![feature(negative_impls)]
+#![cfg_attr(with_negative_coherence, feature(with_negative_coherence))]
trait MyPredicate<'a> {}
-impl<'a, T> !MyPredicate<'a> for &T where T: 'a {}
+
+impl<'a, T> !MyPredicate<'a> for &'a T where T: 'a {}
+
trait MyTrait<'a> {}
+
impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
impl<'a, T> MyTrait<'a> for &'a T {}
-//~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_`
+//[stock]~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_`
fn main() {}
diff --git a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.stderr b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.stock.stderr
index 263bd19b4..097cc4e0f 100644
--- a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.stderr
+++ b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.stock.stderr
@@ -1,5 +1,5 @@
error[E0119]: conflicting implementations of trait `MyTrait<'_>` for type `&_`
- --> $DIR/coherence-negative-outlives-lifetimes.rs:9:1
+ --> $DIR/coherence-negative-outlives-lifetimes.rs:14:1
|
LL | impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
| ---------------------------------------------- first implementation here
diff --git a/src/test/ui/coherence/coherence-subtyping.stderr b/src/test/ui/coherence/coherence-subtyping.stderr
index 25d8c8756..9d90019a5 100644
--- a/src/test/ui/coherence/coherence-subtyping.stderr
+++ b/src/test/ui/coherence/coherence-subtyping.stderr
@@ -7,10 +7,10 @@ LL |
LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
|
- = note: `#[warn(coherence_leak_check)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
+ = note: `#[warn(coherence_leak_check)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/coherence/coherence-wasm-bindgen.stderr b/src/test/ui/coherence/coherence-wasm-bindgen.stderr
index aa74e2315..cfcc21240 100644
--- a/src/test/ui/coherence/coherence-wasm-bindgen.stderr
+++ b/src/test/ui/coherence/coherence-wasm-bindgen.stderr
@@ -7,15 +7,15 @@ LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b)
LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&dyn std::ops::Fn(&_) -> _`
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
+ = note: downstream crates may implement trait `FromWasmAbi` for type `&_`
+ = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
note: the lint level is defined here
--> $DIR/coherence-wasm-bindgen.rs:10:9
|
LL | #![deny(coherence_leak_check)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #56105 <https://github.com/rust-lang/rust/issues/56105>
- = note: downstream crates may implement trait `FromWasmAbi` for type `&_`
- = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
error: aborting due to previous error
diff --git a/src/test/ui/coherence/const-generics-orphan-check-ok.rs b/src/test/ui/coherence/const-generics-orphan-check-ok.rs
new file mode 100644
index 000000000..217e8aed2
--- /dev/null
+++ b/src/test/ui/coherence/const-generics-orphan-check-ok.rs
@@ -0,0 +1,28 @@
+// check-pass
+// aux-build:trait-with-const-param.rs
+extern crate trait_with_const_param;
+use trait_with_const_param::*;
+
+// Trivial case, const param after local type.
+struct Local1;
+impl<const N: usize, T> Trait<N, T> for Local1 {}
+
+// Concrete consts behave the same as foreign types,
+// so this also trivially works.
+impl Trait<3, Local1> for i32 {}
+
+// This case isn't as trivial as we would forbid type
+// parameters here, we do allow const parameters though.
+//
+// The reason that type parameters are forbidden for
+// `impl<T> Trait<T, LocalInA> for i32 {}` is that another
+// downstream crate can add `impl<T> Trait<LocalInB, T> for i32`.
+// As these two impls would overlap we forbid any impls which
+// have a type parameter in front of a local type.
+//
+// With const parameters this issue does not exist as there are no
+// constants local to another downstream crate.
+struct Local2;
+impl<const N: usize> Trait<N, Local2> for i32 {}
+
+fn main() {}
diff --git a/src/test/ui/coherence/deep-bad-copy-reason.stderr b/src/test/ui/coherence/deep-bad-copy-reason.stderr
index 295538cee..168ee5726 100644
--- a/src/test/ui/coherence/deep-bad-copy-reason.stderr
+++ b/src/test/ui/coherence/deep-bad-copy-reason.stderr
@@ -1,11 +1,11 @@
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/deep-bad-copy-reason.rs:33:15
+ --> $DIR/deep-bad-copy-reason.rs:33:24
|
LL | pub struct List<'tcx, T>(Interned<'tcx, ListS<T>>);
| ------------------------ this field does not implement `Copy`
...
LL | impl<'tcx, T> Copy for List<'tcx, T> {}
- | ^^^^
+ | ^^^^^^^^^^^^^
|
note: the `Copy` impl for `Interned<'tcx, ListS<T>>` requires that `OpaqueListContents: Sized`
--> $DIR/deep-bad-copy-reason.rs:23:26
diff --git a/src/test/ui/coherence/issue-100191-2.rs b/src/test/ui/coherence/issue-100191-2.rs
new file mode 100644
index 000000000..1c8316f87
--- /dev/null
+++ b/src/test/ui/coherence/issue-100191-2.rs
@@ -0,0 +1,12 @@
+//~ ERROR overflow evaluating the requirement `T: Trait<_>`
+
+#![feature(specialization, with_negative_coherence)]
+#![allow(incomplete_features)]
+
+pub trait Trait<T> {}
+
+default impl<T, U> Trait<T> for U {}
+
+impl<T> Trait<<T as Iterator>::Item> for T {}
+
+fn main() {}
diff --git a/src/test/ui/coherence/issue-100191-2.stderr b/src/test/ui/coherence/issue-100191-2.stderr
new file mode 100644
index 000000000..d50c220bc
--- /dev/null
+++ b/src/test/ui/coherence/issue-100191-2.stderr
@@ -0,0 +1,14 @@
+error[E0275]: overflow evaluating the requirement `T: Trait<_>`
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_100191_2`)
+note: required for `T` to implement `Trait<_>`
+ --> $DIR/issue-100191-2.rs:8:20
+ |
+LL | default impl<T, U> Trait<T> for U {}
+ | ^^^^^^^^ ^
+ = note: 128 redundant requirements hidden
+ = note: required for `T` to implement `Trait<_>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0275`.
diff --git a/src/test/ui/coherence/issue-100191.rs b/src/test/ui/coherence/issue-100191.rs
new file mode 100644
index 000000000..e8597fde5
--- /dev/null
+++ b/src/test/ui/coherence/issue-100191.rs
@@ -0,0 +1,21 @@
+#![crate_type = "lib"]
+#![feature(specialization, with_negative_coherence)]
+#![allow(incomplete_features)]
+
+trait X {}
+trait Y: X {}
+trait Z {
+ type Assoc: Y;
+}
+struct A<T>(T);
+
+impl<T> Y for T where T: X {}
+impl<T: X> Z for A<T> {
+ type Assoc = T;
+}
+
+// this impl is invalid, but causes an ICE anyway
+impl<T> From<<A<T> as Z>::Assoc> for T {}
+//~^ ERROR type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+
+fn main() {}
diff --git a/src/test/ui/coherence/issue-100191.stderr b/src/test/ui/coherence/issue-100191.stderr
new file mode 100644
index 000000000..1adb0f1e4
--- /dev/null
+++ b/src/test/ui/coherence/issue-100191.stderr
@@ -0,0 +1,12 @@
+error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)
+ --> $DIR/issue-100191.rs:18:6
+ |
+LL | impl<T> From<<A<T> as Z>::Assoc> for T {}
+ | ^ type parameter `T` must be used as the type parameter for some local type
+ |
+ = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
+ = note: only traits defined in the current crate can be implemented for a type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0210`.
diff --git a/src/test/ui/command/command-current-dir.rs b/src/test/ui/command/command-current-dir.rs
index 91d8e4f38..5d06fcdeb 100644
--- a/src/test/ui/command/command-current-dir.rs
+++ b/src/test/ui/command/command-current-dir.rs
@@ -1,6 +1,7 @@
// run-pass
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia Needs directory creation privilege
use std::env;
use std::fs;
@@ -18,7 +19,7 @@ fn main() {
let exe = me.file_name().unwrap();
let cwd = me.parent().unwrap();
eprintln!("cwd={:?}", cwd);
- // Change directory to where the exectuable is located, since this test
+ // Change directory to where the executable is located, since this test
// fundamentally needs to use relative paths. In some cases (like
// remote-test-server), the current_dir can be somewhere else, so make
// sure it is something we can use. We assume we can write to this
diff --git a/src/test/ui/command/command-exec.rs b/src/test/ui/command/command-exec.rs
index 0af87214f..032dad184 100644
--- a/src/test/ui/command/command-exec.rs
+++ b/src/test/ui/command/command-exec.rs
@@ -5,6 +5,7 @@
// ignore-pretty issue #37199
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia no execvp syscall provided
#![feature(process_exec)]
diff --git a/src/test/ui/command/command-pre-exec.rs b/src/test/ui/command/command-pre-exec.rs
index 61914e229..d366c5ffb 100644
--- a/src/test/ui/command/command-pre-exec.rs
+++ b/src/test/ui/command/command-pre-exec.rs
@@ -6,6 +6,7 @@
// ignore-windows - this is a unix-specific test
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia no execvp syscall
#![feature(process_exec, rustc_private)]
extern crate libc;
diff --git a/src/test/ui/command/command-uid-gid.rs b/src/test/ui/command/command-uid-gid.rs
index e1eb4b140..aa4e2f5b8 100644
--- a/src/test/ui/command/command-uid-gid.rs
+++ b/src/test/ui/command/command-uid-gid.rs
@@ -2,6 +2,7 @@
// ignore-android
// ignore-emscripten
// ignore-sgx
+// ignore-fuchsia no '/bin/sh', '/bin/ls'
#![feature(rustc_private)]
diff --git a/src/test/ui/compare-method/issue-90444.stderr b/src/test/ui/compare-method/issue-90444.stderr
index 84bbec062..ee63f34b7 100644
--- a/src/test/ui/compare-method/issue-90444.stderr
+++ b/src/test/ui/compare-method/issue-90444.stderr
@@ -5,10 +5,10 @@ LL | fn from(_: fn((), (), &mut ())) -> Self {
| ^^^^^^^^^^^^^^^^^^^
| |
| types differ in mutability
- | help: change the parameter type to match the trait: `for<'r> fn((), (), &'r ())`
+ | help: change the parameter type to match the trait: `for<'a> fn((), (), &'a ())`
|
- = note: expected fn pointer `fn(for<'r> fn((), (), &'r ())) -> A`
- found fn pointer `fn(for<'r> fn((), (), &'r mut ())) -> A`
+ = note: expected fn pointer `fn(for<'a> fn((), (), &'a ())) -> A`
+ found fn pointer `fn(for<'a> fn((), (), &'a mut ())) -> A`
error[E0053]: method `from` has an incompatible type for trait
--> $DIR/issue-90444.rs:11:16
diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
index a057fd19b..d4bd673b8 100644
--- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
+++ b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr
@@ -50,7 +50,9 @@ error[E0565]: literal in `cfg` predicate value must be a string
--> $DIR/cfg-attr-syntax-validation.rs:25:11
|
LL | #[cfg(a = b"hi")]
- | ^^^^^ help: consider removing the prefix: `"hi"`
+ | -^^^^
+ | |
+ | help: consider removing the prefix
error: expected unsuffixed literal or identifier, found `concat!("nonexistent")`
--> $DIR/cfg-attr-syntax-validation.rs:30:25
diff --git a/src/test/ui/conflicting-repr-hints.stderr b/src/test/ui/conflicting-repr-hints.stderr
index 0c7c50d67..4dcd8f4fc 100644
--- a/src/test/ui/conflicting-repr-hints.stderr
+++ b/src/test/ui/conflicting-repr-hints.stderr
@@ -4,9 +4,9 @@ error[E0566]: conflicting representation hints
LL | #[repr(C, u64)]
| ^ ^^^
|
- = note: `#[deny(conflicting_repr_hints)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/68585>
+ = note: `#[deny(conflicting_repr_hints)]` on by default
error[E0566]: conflicting representation hints
--> $DIR/conflicting-repr-hints.rs:19:8
diff --git a/src/test/ui/const-generics/argument_order.stderr b/src/test/ui/const-generics/argument_order.stderr
index 6b33dffb4..99122c6f5 100644
--- a/src/test/ui/const-generics/argument_order.stderr
+++ b/src/test/ui/const-generics/argument_order.stderr
@@ -1,4 +1,4 @@
-error: lifetime parameters must be declared prior to const parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/argument_order.rs:6:32
|
LL | struct AlsoBad<const N: usize, 'a, T, 'b, const M: usize, U> {
@@ -11,7 +11,7 @@ LL | let _: AlsoBad<7, 'static, u32, 'static, 17, u16>;
| ^^^^^^^
|
= note: lifetime arguments must be provided before type arguments
- = help: reorder the arguments: lifetimes, then consts: `<'a, 'b, N, T, M, U>`
+ = help: reorder the arguments: lifetimes, then type and consts: `<'a, 'b, N, T, M, U>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr b/src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr
index c62f1d1d2..0ed370b83 100644
--- a/src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr
+++ b/src/test/ui/const-generics/const-generic-default-wont-borrowck.stderr
@@ -5,6 +5,11 @@ LL | let s: &'static str; s.len()
| - ^^^^^^^ `*s` used here but it isn't initialized
| |
| binding declared here but left uninitialized
+ |
+help: consider assigning a value
+ |
+LL | let s: &'static str = todo!(); s.len()
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/const-param-before-other-params.rs b/src/test/ui/const-generics/const-param-before-other-params.rs
index da06aca30..cb1cebe1f 100644
--- a/src/test/ui/const-generics/const-param-before-other-params.rs
+++ b/src/test/ui/const-generics/const-param-before-other-params.rs
@@ -1,5 +1,5 @@
fn bar<const X: u8, 'a>(_: &'a ()) {
- //~^ ERROR lifetime parameters must be declared prior to const parameters
+ //~^ ERROR lifetime parameters must be declared prior to type and const parameters
}
fn foo<const X: u8, T>(_: &T) {}
diff --git a/src/test/ui/const-generics/const-param-before-other-params.stderr b/src/test/ui/const-generics/const-param-before-other-params.stderr
index 607d20c4a..2c7a47bbc 100644
--- a/src/test/ui/const-generics/const-param-before-other-params.stderr
+++ b/src/test/ui/const-generics/const-param-before-other-params.stderr
@@ -1,4 +1,4 @@
-error: lifetime parameters must be declared prior to const parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/const-param-before-other-params.rs:1:21
|
LL | fn bar<const X: u8, 'a>(_: &'a ()) {
diff --git a/src/test/ui/const-generics/const_trait_fn-issue-88433.rs b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs
index 8724fa698..6e04cfaec 100644
--- a/src/test/ui/const-generics/const_trait_fn-issue-88433.rs
+++ b/src/test/ui/const-generics/const_trait_fn-issue-88433.rs
@@ -2,6 +2,7 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Func<T> {
type Output;
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr
index e8826ce43..61b355118 100644
--- a/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr
+++ b/src/test/ui/const-generics/defaults/generic-expr-default-concrete.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | Foo::<10, 12>
| ^^^^^^^^^^^^^ expected `11`, found `12`
|
- = note: expected type `11`
- found type `12`
+ = note: expected constant `11`
+ found constant `12`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr
index d5a3071b7..e83f89a60 100644
--- a/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr
+++ b/src/test/ui/const-generics/defaults/generic-expr-default-mismatched-types.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | Foo::<N, { N + 2 }>
| ^^^^^^^^^^^^^^^^^^^ expected `{ N + 1 }`, found `{ N + 2 }`
|
- = note: expected type `{ N + 1 }`
- found type `{ N + 2 }`
+ = note: expected constant `{ N + 1 }`
+ found constant `{ N + 2 }`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs
index 578938db4..beaf7fc60 100644
--- a/src/test/ui/const-generics/defaults/intermixed-lifetime.rs
+++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.rs
@@ -1,9 +1,9 @@
// Checks that lifetimes cannot be interspersed between consts and types.
struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
-//~^ Error lifetime parameters must be declared prior to const parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
-//~^ Error lifetime parameters must be declared prior to type parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
fn main() {}
diff --git a/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr b/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr
index e27976deb..5cff61dd9 100644
--- a/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr
+++ b/src/test/ui/const-generics/defaults/intermixed-lifetime.stderr
@@ -1,10 +1,10 @@
-error: lifetime parameters must be declared prior to const parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/intermixed-lifetime.rs:3:28
|
LL | struct Foo<const N: usize, 'a, T = u32>(&'a (), T);
| -----------------^^---------- help: reorder the parameters: lifetimes, then consts and types: `<'a, const N: usize, T = u32>`
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/intermixed-lifetime.rs:6:37
|
LL | struct Bar<const N: usize, T = u32, 'a>(&'a (), T);
diff --git a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs b/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs
index da087ffc3..f928fc9e7 100644
--- a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs
+++ b/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.rs
@@ -1,4 +1,4 @@
struct Foo<const M: usize = 10, 'a>(&'a u32);
-//~^ Error lifetime parameters must be declared prior to const parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
fn main() {}
diff --git a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr b/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr
index 55f5a5353..ba08b4646 100644
--- a/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr
+++ b/src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.stderr
@@ -1,4 +1,4 @@
-error: lifetime parameters must be declared prior to const parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/param-order-err-pretty-prints-default.rs:1:33
|
LL | struct Foo<const M: usize = 10, 'a>(&'a u32);
diff --git a/src/test/ui/const-generics/defaults/trait_objects_fail.stderr b/src/test/ui/const-generics/defaults/trait_objects_fail.stderr
index a9c185e5f..0e8334d03 100644
--- a/src/test/ui/const-generics/defaults/trait_objects_fail.stderr
+++ b/src/test/ui/const-generics/defaults/trait_objects_fail.stderr
@@ -2,9 +2,7 @@ error[E0277]: the trait bound `u32: Trait` is not satisfied
--> $DIR/trait_objects_fail.rs:26:9
|
LL | foo(&10_u32);
- | --- ^^^^^^^ the trait `Trait` is not implemented for `u32`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^ the trait `Trait` is not implemented for `u32`
|
= help: the trait `Trait<2>` is implemented for `u32`
= note: required for the cast from `u32` to the object type `dyn Trait`
@@ -13,9 +11,7 @@ error[E0277]: the trait bound `bool: Traitor<_>` is not satisfied
--> $DIR/trait_objects_fail.rs:28:9
|
LL | bar(&true);
- | --- ^^^^^ the trait `Traitor<_>` is not implemented for `bool`
- | |
- | required by a bound introduced by this call
+ | ^^^^^ the trait `Traitor<_>` is not implemented for `bool`
|
= help: the trait `Traitor<2, 3>` is implemented for `bool`
= note: required for the cast from `bool` to the object type `dyn Traitor<_>`
diff --git a/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr
index a9f9787d8..e3bf38b70 100644
--- a/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr
+++ b/src/test/ui/const-generics/early/const-param-from-outer-fn.stderr
@@ -4,7 +4,7 @@ error[E0401]: can't use generic parameters from outer function
LL | fn foo<const X: u32>() {
| - const parameter from outer function
LL | fn bar() -> u32 {
- | --- try adding a local generic parameter in this method instead
+ | - help: try using a local generic parameter instead: `<X>`
LL | X
| ^ use of generic parameter from outer function
diff --git a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
index ababb27a8..ada1050d3 100644
--- a/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/abstract-const-as-cast-3.stderr
@@ -1,11 +1,11 @@
error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:17:5
+ --> $DIR/abstract-const-as-cast-3.rs:17:19
|
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>`
+note: required for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>` to implement `Trait`
--> $DIR/abstract-const-as-cast-3.rs:8:22
|
LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
@@ -22,17 +22,22 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }`
|
- = note: expected type `{ N as u128 }`
- found type `{ O as u128 }`
+ = note: expected constant `{ N as u128 }`
+ found constant `{ O as u128 }`
+note: required by a bound in `use_trait_impl::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:14:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:20:5
+ --> $DIR/abstract-const-as-cast-3.rs:20:19
|
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>`
+note: required for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>` to implement `Trait`
--> $DIR/abstract-const-as-cast-3.rs:8:22
|
LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
@@ -49,8 +54,13 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }`
|
- = note: expected type `{ N as _ }`
- found type `{ O as u128 }`
+ = note: expected constant `{ N as _ }`
+ found constant `{ O as u128 }`
+note: required by a bound in `use_trait_impl::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:14:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:23:5
@@ -58,8 +68,13 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12`, found `13`
|
- = note: expected type `12`
- found type `13`
+ = note: expected constant `12`
+ found constant `13`
+note: required by a bound in `use_trait_impl::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:14:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:25:5
@@ -67,17 +82,22 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<14, 13>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13`, found `14`
|
- = note: expected type `13`
- found type `14`
+ = note: expected constant `13`
+ found constant `14`
+note: required by a bound in `use_trait_impl::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:14:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl::assert_impl`
error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:35:5
+ --> $DIR/abstract-const-as-cast-3.rs:35:19
|
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>`
+note: required for `HasCastInTraitImpl<{ N + 1 }, { N as u128 }>` to implement `Trait`
--> $DIR/abstract-const-as-cast-3.rs:8:22
|
LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
@@ -94,17 +114,22 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as u128 }>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as u128 }`, found `{ O as u128 }`
|
- = note: expected type `{ N as u128 }`
- found type `{ O as u128 }`
+ = note: expected constant `{ N as u128 }`
+ found constant `{ O as u128 }`
+note: required by a bound in `use_trait_impl_2::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:32:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
error: unconstrained generic constant
- --> $DIR/abstract-const-as-cast-3.rs:38:5
+ --> $DIR/abstract-const-as-cast-3.rs:38:19
|
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try adding a `where` bound using this expression: `where [(); { O as u128 }]:`
-note: required because of the requirements on the impl of `Trait` for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>`
+note: required for `HasCastInTraitImpl<{ N + 1 }, { N as _ }>` to implement `Trait`
--> $DIR/abstract-const-as-cast-3.rs:8:22
|
LL | impl<const O: usize> Trait for HasCastInTraitImpl<O, { O as u128 }> {}
@@ -121,8 +146,13 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<{ N + 1 }, { N as _ }>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{ N as _ }`, found `{ O as u128 }`
|
- = note: expected type `{ N as _ }`
- found type `{ O as u128 }`
+ = note: expected constant `{ N as _ }`
+ found constant `{ O as u128 }`
+note: required by a bound in `use_trait_impl_2::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:32:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:41:5
@@ -130,8 +160,13 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<13, { 12 as u128 }>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `12`, found `13`
|
- = note: expected type `12`
- found type `13`
+ = note: expected constant `12`
+ found constant `13`
+note: required by a bound in `use_trait_impl_2::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:32:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:43:5
@@ -139,8 +174,13 @@ error[E0308]: mismatched types
LL | assert_impl::<HasCastInTraitImpl<14, 13>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `13`, found `14`
|
- = note: expected type `13`
- found type `14`
+ = note: expected constant `13`
+ found constant `14`
+note: required by a bound in `use_trait_impl_2::assert_impl`
+ --> $DIR/abstract-const-as-cast-3.rs:32:23
+ |
+LL | fn assert_impl<T: Trait>() {}
+ | ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
error: aborting due to 12 previous errors
diff --git a/src/test/ui/const-generics/generic_const_exprs/closures.stderr b/src/test/ui/const-generics/generic_const_exprs/closures.stderr
index a15dd2016..a7d891d77 100644
--- a/src/test/ui/const-generics/generic_const_exprs/closures.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/closures.stderr
@@ -1,4 +1,4 @@
-error[E0391]: cycle detected when building an abstract representation for test::{constant#0}
+error[E0391]: cycle detected when building an abstract representation for `test::{constant#0}`
--> $DIR/closures.rs:3:35
|
LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
@@ -14,7 +14,7 @@ note: ...which requires type-checking `test::{constant#0}`...
|
LL | fn test<const N: usize>() -> [u8; N + (|| 42)()] {}
| ^^^^^^^^^^^^^
- = note: ...which again requires building an abstract representation for test::{constant#0}, completing the cycle
+ = note: ...which again requires building an abstract representation for `test::{constant#0}`, completing the cycle
note: cycle used when checking that `test` is well-formed
--> $DIR/closures.rs:3:1
|
diff --git a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr
index 4cd86fecd..d674e3acd 100644
--- a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.full.stderr
@@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
- --> $DIR/dependence_lint.rs:13:32
+ --> $DIR/dependence_lint.rs:14:32
|
LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce
| ^ cannot perform const operation using `T`
@@ -8,7 +8,7 @@ LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/dependence_lint.rs:20:37
+ --> $DIR/dependence_lint.rs:21:37
|
LL | let _: [u8; if true { size_of::<T>() } else { 3 }]; // error on stable, error with gce
| ^ cannot perform const operation using `T`
@@ -17,17 +17,17 @@ LL | let _: [u8; if true { size_of::<T>() } else { 3 }]; // error on stable,
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
warning: cannot use constants which depend on generic parameters in types
- --> $DIR/dependence_lint.rs:9:9
+ --> $DIR/dependence_lint.rs:10:9
|
LL | [0; size_of::<*mut T>()]; // lint on stable, error with `generic_const_exprs`
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
+ = note: `#[warn(const_evaluatable_unchecked)]` on by default
warning: cannot use constants which depend on generic parameters in types
- --> $DIR/dependence_lint.rs:16:9
+ --> $DIR/dependence_lint.rs:17:9
|
LL | [0; if false { size_of::<T>() } else { 3 }]; // lint on stable, error with gce
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr
index b13bcdb2c..74111ef1d 100644
--- a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.gce.stderr
@@ -1,5 +1,5 @@
error: overly complex generic constant
- --> $DIR/dependence_lint.rs:16:9
+ --> $DIR/dependence_lint.rs:17:9
|
LL | [0; if false { size_of::<T>() } else { 3 }]; // lint on stable, error with gce
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants
@@ -7,7 +7,7 @@ LL | [0; if false { size_of::<T>() } else { 3 }]; // lint on stable, error w
= help: consider moving this anonymous constant into a `const` function
error: overly complex generic constant
- --> $DIR/dependence_lint.rs:20:17
+ --> $DIR/dependence_lint.rs:21:17
|
LL | let _: [u8; if true { size_of::<T>() } else { 3 }]; // error on stable, error with gce
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ control flow is not supported in generic constants
@@ -15,7 +15,7 @@ LL | let _: [u8; if true { size_of::<T>() } else { 3 }]; // error on stable,
= help: consider moving this anonymous constant into a `const` function
error: unconstrained generic constant
- --> $DIR/dependence_lint.rs:13:12
+ --> $DIR/dependence_lint.rs:14:12
|
LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | let _: [u8; size_of::<*mut T>()]; // error on stable, error with gce
= help: try adding a `where` bound using this expression: `where [(); size_of::<*mut T>()]:`
error: unconstrained generic constant
- --> $DIR/dependence_lint.rs:9:9
+ --> $DIR/dependence_lint.rs:10:9
|
LL | [0; size_of::<*mut T>()]; // lint on stable, error with `generic_const_exprs`
| ^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs
index dcdfd75de..b715e07f8 100644
--- a/src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs
+++ b/src/test/ui/const-generics/generic_const_exprs/dependence_lint.rs
@@ -1,4 +1,5 @@
// revisions: full gce
+// compile-flags: -Zdeduplicate-diagnostics=yes
#![cfg_attr(gce, feature(generic_const_exprs))]
#![allow(incomplete_features)]
diff --git a/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr b/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr
index 2aeb9b961..83a2f3740 100644
--- a/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/different-fn.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | [0; size_of::<Foo<T>>()]
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `size_of::<T>()`, found `size_of::<Foo<T>>()`
|
- = note: expected type `size_of::<T>()`
- found type `size_of::<Foo<T>>()`
+ = note: expected constant `size_of::<T>()`
+ found constant `size_of::<Foo<T>>()`
error: unconstrained generic constant
--> $DIR/different-fn.rs:10:9
diff --git a/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr b/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr
index b5719b3fe..8eb1fccc5 100644
--- a/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/eval-try-unify.stderr
@@ -4,8 +4,8 @@ warning: the feature `generic_const_exprs` is incomplete and may not be safe to
LL | #![feature(generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/const-generics/generic_const_exprs/function-call.rs b/src/test/ui/const-generics/generic_const_exprs/function-call.rs
index b5de66621..3c866333d 100644
--- a/src/test/ui/const-generics/generic_const_exprs/function-call.rs
+++ b/src/test/ui/const-generics/generic_const_exprs/function-call.rs
@@ -1,4 +1,5 @@
// check-pass
+// compile-flags: -Zdeduplicate-diagnostics=yes
const fn foo<T>() -> usize {
// We might instead branch on `std::mem::size_of::<*mut T>() < 8` here,
diff --git a/src/test/ui/const-generics/generic_const_exprs/function-call.stderr b/src/test/ui/const-generics/generic_const_exprs/function-call.stderr
index 0d8463714..84abfe578 100644
--- a/src/test/ui/const-generics/generic_const_exprs/function-call.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/function-call.stderr
@@ -1,12 +1,12 @@
warning: cannot use constants which depend on generic parameters in types
- --> $DIR/function-call.rs:14:17
+ --> $DIR/function-call.rs:15:17
|
LL | let _ = [0; foo::<T>()];
| ^^^^^^^^^^
|
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
+ = note: `#[warn(const_evaluatable_unchecked)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-100217.rs b/src/test/ui/const-generics/generic_const_exprs/issue-100217.rs
new file mode 100644
index 000000000..acdc348a3
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-100217.rs
@@ -0,0 +1,42 @@
+// build-pass
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+trait TraitOne {
+ const MY_NUM: usize;
+ type MyErr: std::fmt::Debug;
+
+ fn do_one_stuff(arr: [u8; Self::MY_NUM]) -> Result<(), Self::MyErr>;
+}
+
+trait TraitTwo {
+ fn do_two_stuff();
+}
+
+impl<O: TraitOne> TraitTwo for O
+where
+ [(); Self::MY_NUM]:,
+{
+ fn do_two_stuff() {
+ O::do_one_stuff([5; Self::MY_NUM]).unwrap()
+ }
+}
+
+struct Blargotron;
+
+#[derive(Debug)]
+struct ErrTy<const N: usize>([(); N]);
+
+impl TraitOne for Blargotron {
+ const MY_NUM: usize = 3;
+ type MyErr = ErrTy<{ Self::MY_NUM }>;
+
+ fn do_one_stuff(_arr: [u8; Self::MY_NUM]) -> Result<(), Self::MyErr> {
+ Ok(())
+ }
+}
+
+fn main() {
+ Blargotron::do_two_stuff();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-100360.rs b/src/test/ui/const-generics/generic_const_exprs/issue-100360.rs
new file mode 100644
index 000000000..5572f1f88
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-100360.rs
@@ -0,0 +1,13 @@
+// check-pass
+// (this requires debug assertions)
+
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
+
+fn foo<const B: &'static bool>(arg: &'static bool) -> bool {
+ B == arg
+}
+
+fn main() {
+ foo::<{ &true }>(&false);
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-102074.rs b/src/test/ui/const-generics/generic_const_exprs/issue-102074.rs
new file mode 100644
index 000000000..66d15cf12
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-102074.rs
@@ -0,0 +1,23 @@
+// check-pass
+// Checks that the NoopMethodCall lint doesn't call Instance::resolve on unresolved consts
+
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+#[derive(Debug, Clone)]
+pub struct Aes128CipherKey([u8; Aes128Cipher::KEY_LEN]);
+
+impl Aes128CipherKey {
+ pub fn new(key: &[u8; Aes128Cipher::KEY_LEN]) -> Self {
+ Self(key.clone())
+ }
+}
+
+#[derive(Debug, Clone)]
+pub struct Aes128Cipher;
+
+impl Aes128Cipher {
+ const KEY_LEN: usize = 16;
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-102768.rs b/src/test/ui/const-generics/generic_const_exprs/issue-102768.rs
new file mode 100644
index 000000000..7aea0d30d
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-102768.rs
@@ -0,0 +1,14 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait X {
+ type Y<'a>;
+}
+
+const _: () = {
+ fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
+ //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
+ //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
+};
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr
new file mode 100644
index 000000000..9deb9b265
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-102768.stderr
@@ -0,0 +1,33 @@
+error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+ --> $DIR/issue-102768.rs:9:30
+ |
+LL | fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
+ | ^ expected 1 lifetime argument
+ |
+note: associated type defined here, with 1 lifetime parameter: `'a`
+ --> $DIR/issue-102768.rs:5:10
+ |
+LL | type Y<'a>;
+ | ^ --
+help: add missing lifetime argument
+ |
+LL | fn f2<'a>(arg: Box<dyn X<Y<'a, 1> = &'a ()>>) {}
+ | +++
+
+error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/issue-102768.rs:9:30
+ |
+LL | fn f2<'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/issue-102768.rs:5: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/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr
index f2ae361dc..0742db398 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-62504.full.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | ArrayHolder([0; Self::SIZE])
| ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
|
- = note: expected type `X`
- found type `Self::SIZE`
+ = note: expected constant `X`
+ found constant `Self::SIZE`
error: unconstrained generic constant
--> $DIR/issue-62504.rs:18:25
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr
index 7a083733a..c3e2f8e16 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-69654.stderr
@@ -2,7 +2,9 @@ error[E0423]: expected value, found type parameter `T`
--> $DIR/issue-69654.rs:5:25
|
LL | impl<T> Bar<T> for [u8; T] {}
- | ^ not a value
+ | - ^ not a value
+ | |
+ | found this type parameter
error[E0599]: the function or associated item `foo` exists for struct `Foo<_>`, but its trait bounds were not satisfied
--> $DIR/issue-69654.rs:17:10
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr
index d536f6fd1..f2fddfbfb 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr
@@ -4,8 +4,15 @@ error[E0308]: mismatched types
LL | let x: Arr<{usize::MAX}> = Arr {};
| ^^^^^^^^^^^^^^^^^ expected `false`, found `true`
|
- = note: expected type `false`
- found type `true`
+ = note: expected constant `false`
+ found constant `true`
+note: required by a bound in `Arr`
+ --> $DIR/issue-72819-generic-in-const-eval.rs:8:39
+ |
+LL | struct Arr<const N: usize>
+ | --- required by a bound in this
+LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
+ | ^^^^^^ required by this bound in `Arr`
error[E0308]: mismatched types
--> $DIR/issue-72819-generic-in-const-eval.rs:20:32
@@ -13,8 +20,15 @@ error[E0308]: mismatched types
LL | let x: Arr<{usize::MAX}> = Arr {};
| ^^^ expected `false`, found `true`
|
- = note: expected type `false`
- found type `true`
+ = note: expected constant `false`
+ found constant `true`
+note: required by a bound in `Arr`
+ --> $DIR/issue-72819-generic-in-const-eval.rs:8:39
+ |
+LL | struct Arr<const N: usize>
+ | --- required by a bound in this
+LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
+ | ^^^^^^ required by this bound in `Arr`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-73298.rs b/src/test/ui/const-generics/generic_const_exprs/issue-73298.rs
new file mode 100644
index 000000000..3c59e1b79
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-73298.rs
@@ -0,0 +1,23 @@
+// build-pass
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+use std::convert::AsMut;
+use std::default::Default;
+
+trait Foo: Sized {
+ type Baz: Default + AsMut<[u8]>;
+ fn bar() {
+ Self::Baz::default().as_mut();
+ }
+}
+
+impl Foo for () {
+ type Baz = [u8; 1 * 1];
+ //type Baz = [u8; 1];
+}
+
+fn main() {
+ <() as Foo>::bar();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-82268.rs b/src/test/ui/const-generics/generic_const_exprs/issue-82268.rs
new file mode 100644
index 000000000..d08fc5beb
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-82268.rs
@@ -0,0 +1,73 @@
+// build-pass
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+trait Collate<Op> {
+ type Pass;
+ type Fail;
+
+ fn collate(self) -> (Self::Pass, Self::Fail);
+}
+
+impl<Op> Collate<Op> for () {
+ type Pass = ();
+ type Fail = ();
+
+ fn collate(self) -> ((), ()) {
+ ((), ())
+ }
+}
+
+trait CollateStep<X, Prev> {
+ type Pass;
+ type Fail;
+ fn collate_step(x: X, prev: Prev) -> (Self::Pass, Self::Fail);
+}
+
+impl<X, P, F> CollateStep<X, (P, F)> for () {
+ type Pass = (X, P);
+ type Fail = F;
+
+ fn collate_step(x: X, (p, f): (P, F)) -> ((X, P), F) {
+ ((x, p), f)
+ }
+}
+
+struct CollateOpImpl<const MASK: u32>;
+trait CollateOpStep {
+ type NextOp;
+ type Apply;
+}
+
+impl<const MASK: u32> CollateOpStep for CollateOpImpl<MASK>
+where
+ CollateOpImpl<{ MASK >> 1 }>: Sized,
+{
+ type NextOp = CollateOpImpl<{ MASK >> 1 }>;
+ type Apply = ();
+}
+
+impl<H, T, Op: CollateOpStep> Collate<Op> for (H, T)
+where
+ T: Collate<Op::NextOp>,
+ Op::Apply: CollateStep<H, (T::Pass, T::Fail)>,
+{
+ type Pass = <Op::Apply as CollateStep<H, (T::Pass, T::Fail)>>::Pass;
+ type Fail = <Op::Apply as CollateStep<H, (T::Pass, T::Fail)>>::Fail;
+
+ fn collate(self) -> (Self::Pass, Self::Fail) {
+ <Op::Apply as CollateStep<H, (T::Pass, T::Fail)>>::collate_step(self.0, self.1.collate())
+ }
+}
+
+fn collate<X, const MASK: u32>(x: X) -> (X::Pass, X::Fail)
+where
+ X: Collate<CollateOpImpl<MASK>>,
+{
+ x.collate()
+}
+
+fn main() {
+ dbg!(collate::<_, 5>(("Hello", (42, ('!', ())))));
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr
index 0332e82fe..b693023f1 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-83765.stderr
@@ -4,8 +4,8 @@ error[E0308]: method not compatible with trait
LL | fn size(&self) -> [usize; DIM] {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM`
|
- = note: expected type `Self::DIM`
- found type `DIM`
+ = note: expected constant `Self::DIM`
+ found constant `DIM`
error: unconstrained generic constant
--> $DIR/issue-83765.rs:32:24
@@ -26,8 +26,8 @@ error[E0308]: mismatched types
LL | self.reference.size()
| ^^^^^^^^^^^^^^^^^^^^^ expected `DIM`, found `Self::DIM`
|
- = note: expected type `DIM`
- found type `Self::DIM`
+ = note: expected constant `DIM`
+ found constant `Self::DIM`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-83972.rs b/src/test/ui/const-generics/generic_const_exprs/issue-83972.rs
new file mode 100644
index 000000000..0063719b8
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-83972.rs
@@ -0,0 +1,38 @@
+// build-pass
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+pub trait Foo {
+ fn foo(&self);
+}
+
+pub struct FooImpl<const N: usize>;
+impl<const N: usize> Foo for FooImpl<N> {
+ fn foo(&self) {}
+}
+
+pub trait Bar: 'static {
+ type Foo: Foo;
+ fn get() -> &'static Self::Foo;
+}
+
+struct BarImpl;
+impl Bar for BarImpl {
+ type Foo = FooImpl<
+ {
+ { 4 }
+ },
+ >;
+ fn get() -> &'static Self::Foo {
+ &FooImpl
+ }
+}
+
+pub fn boom<B: Bar>() {
+ B::get().foo();
+}
+
+fn main() {
+ boom::<BarImpl>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs b/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs
new file mode 100644
index 000000000..3933ff20a
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-84669.rs
@@ -0,0 +1,30 @@
+// build-pass
+
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Foo {
+ type Output;
+
+ fn foo() -> Self::Output;
+}
+
+impl Foo for [u8; 3] {
+ type Output = [u8; 1 + 2];
+
+ fn foo() -> [u8; 3] {
+ [1u8; 3]
+ }
+}
+
+fn bug<const N: usize>()
+where
+ [u8; N]: Foo,
+ <[u8; N] as Foo>::Output: AsRef<[u8]>,
+{
+ <[u8; N]>::foo().as_ref();
+}
+
+fn main() {
+ bug::<3>();
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
index d45dfde9a..09bcb0860 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-85848.stderr
@@ -7,12 +7,12 @@ LL | writes_to_specific_path(&cap);
| required by a bound introduced by this call
|
= help: the trait `Delegates<U>` is implemented for `T`
-note: required because of the requirements on the impl of `Contains<(), true>` for `&C`
+note: required for `&C` to implement `Contains<(), true>`
--> $DIR/issue-85848.rs:21:12
|
LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
-note: required because of the requirements on the impl of `Delegates<()>` for `&C`
+note: required for `&C` to implement `Delegates<()>`
--> $DIR/issue-85848.rs:12:12
|
LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
@@ -32,12 +32,12 @@ LL | writes_to_specific_path(&cap);
| required by a bound introduced by this call
|
= help: try adding a `where` bound using this expression: `where [(); { contains::<T, U>() }]:`
-note: required because of the requirements on the impl of `Contains<(), true>` for `&C`
+note: required for `&C` to implement `Contains<(), true>`
--> $DIR/issue-85848.rs:21:12
|
LL | impl<T, U> Contains<T, { contains::<T, U>() }> for U where T: _Contains<U> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
-note: required because of the requirements on the impl of `Delegates<()>` for `&C`
+note: required for `&C` to implement `Delegates<()>`
--> $DIR/issue-85848.rs:12:12
|
LL | impl<T, U> Delegates<U> for T where T: Contains<U, true> {}
@@ -54,8 +54,8 @@ error[E0308]: mismatched types
LL | writes_to_specific_path(&cap);
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `true`, found `{ contains::<T, U>() }`
|
- = note: expected type `true`
- found type `{ contains::<T, U>() }`
+ = note: expected constant `true`
+ found constant `{ contains::<T, U>() }`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-86710.rs b/src/test/ui/const-generics/generic_const_exprs/issue-86710.rs
new file mode 100644
index 000000000..bdd8a21b3
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-86710.rs
@@ -0,0 +1,73 @@
+// build-pass
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+use std::marker::PhantomData;
+
+fn main() {
+ let x = FooImpl::<BarImpl<1>> { phantom: PhantomData };
+ let _ = x.foo::<BarImpl<1>>();
+}
+
+trait Foo<T>
+where
+ T: Bar,
+{
+ fn foo<U>(&self)
+ where
+ T: Operation<U>,
+ <T as Operation<U>>::Output: Bar;
+}
+
+struct FooImpl<T>
+where
+ T: Bar,
+{
+ phantom: PhantomData<T>,
+}
+
+impl<T> Foo<T> for FooImpl<T>
+where
+ T: Bar,
+{
+ fn foo<U>(&self)
+ where
+ T: Operation<U>,
+ <T as Operation<U>>::Output: Bar,
+ {
+ <<T as Operation<U>>::Output as Bar>::error_occurs_here();
+ }
+}
+
+trait Bar {
+ fn error_occurs_here();
+}
+
+struct BarImpl<const N: usize>;
+
+impl<const N: usize> Bar for BarImpl<N> {
+ fn error_occurs_here() {}
+}
+
+trait Operation<Rhs> {
+ type Output;
+}
+
+//// Part-A: This causes error.
+impl<const M: usize, const N: usize> Operation<BarImpl<M>> for BarImpl<N>
+where
+ BarImpl<{ N + M }>: Sized,
+{
+ type Output = BarImpl<{ N + M }>;
+}
+
+//// Part-B: This doesn't cause error.
+// impl<const M: usize, const N: usize> Operation<BarImpl<M>> for BarImpl<N> {
+// type Output = BarImpl<M>;
+// }
+
+//// Part-C: This also doesn't cause error.
+// impl<const M: usize, const N: usize> Operation<BarImpl<M>> for BarImpl<N> {
+// type Output = BarImpl<{ M }>;
+// }
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-89851.rs b/src/test/ui/const-generics/generic_const_exprs/issue-89851.rs
new file mode 100644
index 000000000..cde849d90
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-89851.rs
@@ -0,0 +1,12 @@
+// check-pass
+// (this requires debug assertions)
+
+#![feature(adt_const_params)]
+#![allow(incomplete_features)]
+
+pub const BAR: () = ice::<"">();
+pub const fn ice<const N: &'static str>() {
+ &10;
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr
index b5b2b0e40..1cceaece7 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-1.stderr
@@ -4,8 +4,8 @@ warning: the feature `adt_const_params` is incomplete and may not be safe to use
LL | #![feature(adt_const_params, generic_const_exprs)]
| ^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-97047-ice-1.rs:3:30
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr
index 5dfbd87cc..774e842bc 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-97047-ice-2.stderr
@@ -4,8 +4,8 @@ warning: the feature `adt_const_params` is incomplete and may not be safe to use
LL | #![feature(adt_const_params, generic_const_exprs)]
| ^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-97047-ice-2.rs:3:30
diff --git a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr
index 45c7d835f..440cf457e 100644
--- a/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/object-safety-err-where-bounds.stderr
@@ -4,11 +4,6 @@ error: the trait `Foo` cannot be made into an object
LL | fn test(&self) where [u8; bar::<Self>()]: Sized;
| ^^^^
|
-note: the lint level is defined here
- --> $DIR/object-safety-err-where-bounds.rs:3:9
- |
-LL | #![deny(where_clauses_object_safety)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= 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 #51443 <https://github.com/rust-lang/rust/issues/51443>
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>
@@ -19,6 +14,11 @@ LL | trait Foo {
LL | fn test(&self) where [u8; bar::<Self>()]: Sized;
| ^^^^ ...because method `test` references the `Self` type in its `where` clause
= help: consider moving `test` to another trait
+note: the lint level is defined here
+ --> $DIR/object-safety-err-where-bounds.rs:3:9
+ |
+LL | #![deny(where_clauses_object_safety)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs b/src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs
new file mode 100644
index 000000000..e7c8e4f66
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs
@@ -0,0 +1,24 @@
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+trait True {}
+
+struct Is<const V: bool>;
+
+impl True for Is<true> {}
+
+fn g<T>()
+//~^ NOTE required by a bound in this
+where
+ Is<{ std::mem::size_of::<T>() == 0 }>: True,
+ //~^ NOTE required by a bound in `g`
+ //~| NOTE required by this bound in `g`
+{
+}
+
+fn main() {
+ g::<usize>();
+ //~^ ERROR mismatched types
+ //~| NOTE expected `false`, found `true`
+ //~| NOTE expected constant `false`
+}
diff --git a/src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr b/src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr
new file mode 100644
index 000000000..a253ec676
--- /dev/null
+++ b/src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr
@@ -0,0 +1,20 @@
+error[E0308]: mismatched types
+ --> $DIR/obligation-cause.rs:20:5
+ |
+LL | g::<usize>();
+ | ^^^^^^^^^^ expected `false`, found `true`
+ |
+ = note: expected constant `false`
+ found constant `true`
+note: required by a bound in `g`
+ --> $DIR/obligation-cause.rs:13:44
+ |
+LL | fn g<T>()
+ | - required by a bound in this
+...
+LL | Is<{ std::mem::size_of::<T>() == 0 }>: True,
+ | ^^^^ required by this bound in `g`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr b/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr
index b1b359619..d955b4f96 100644
--- a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr
+++ b/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr
@@ -2,15 +2,22 @@ error[E0107]: this associated function takes 0 generic arguments but 1 generic a
--> $DIR/invalid-const-arg-for-type-param.rs:6:23
|
LL | let _: u32 = 5i32.try_into::<32>().unwrap();
- | ^^^^^^^^------ help: remove these generics
- | |
- | expected 0 generic arguments
+ | ^^^^^^^^ expected 0 generic arguments
|
note: associated function defined here, with 0 generic parameters
--> $SRC_DIR/core/src/convert/mod.rs:LL:COL
|
LL | fn try_into(self) -> Result<T, Self::Error>;
| ^^^^^^^^
+help: consider moving this generic argument to the `TryInto` trait, which takes up to 1 argument
+ |
+LL | let _: u32 = TryInto::<32>::try_into(5i32).unwrap();
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+help: remove these generics
+ |
+LL - let _: u32 = 5i32.try_into::<32>().unwrap();
+LL + let _: u32 = 5i32.try_into().unwrap();
+ |
error[E0599]: no method named `f` found for struct `S` in the current scope
--> $DIR/invalid-const-arg-for-type-param.rs:9:7
diff --git a/src/test/ui/const-generics/invariant.stderr b/src/test/ui/const-generics/invariant.stderr
index ce0fad104..aabe4c93b 100644
--- a/src/test/ui/const-generics/invariant.stderr
+++ b/src/test/ui/const-generics/invariant.stderr
@@ -7,10 +7,10 @@ LL | impl SadBee for for<'a> fn(&'a ()) {
LL | impl SadBee for fn(&'static ()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a ())`
|
- = note: `#[warn(coherence_leak_check)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
+ = note: `#[warn(coherence_leak_check)]` on by default
error[E0308]: mismatched types
--> $DIR/invariant.rs:27:5
diff --git a/src/test/ui/const-generics/issue-102124.rs b/src/test/ui/const-generics/issue-102124.rs
new file mode 100644
index 000000000..a28f198e9
--- /dev/null
+++ b/src/test/ui/const-generics/issue-102124.rs
@@ -0,0 +1,20 @@
+// run-pass
+// compile-flags: -Zmir-opt-level=3
+
+// regression test for #102124
+
+const L: usize = 4;
+
+pub trait Print<const N: usize> {
+ fn print(&self) -> usize {
+ N
+ }
+}
+
+pub struct Printer;
+impl Print<L> for Printer {}
+
+fn main() {
+ let p = Printer;
+ assert_eq!(p.print(), 4);
+}
diff --git a/src/test/ui/const-generics/issue-80471.stderr b/src/test/ui/const-generics/issue-80471.stderr
index dbcc0b7b6..b89706710 100644
--- a/src/test/ui/const-generics/issue-80471.stderr
+++ b/src/test/ui/const-generics/issue-80471.stderr
@@ -4,8 +4,8 @@ warning: the feature `adt_const_params` is incomplete and may not be safe to use
LL | #![feature(adt_const_params)]
| ^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0741]: `Box<Nat>` must be annotated with `#[derive(PartialEq, Eq)]` to be used as the type of a const parameter
--> $DIR/issue-80471.rs:10:17
diff --git a/src/test/ui/const-generics/issue-93647.rs b/src/test/ui/const-generics/issue-93647.rs
index c1a6bf6e3..806540e17 100644
--- a/src/test/ui/const-generics/issue-93647.rs
+++ b/src/test/ui/const-generics/issue-93647.rs
@@ -1,6 +1,6 @@
struct X<const N: usize = {
(||1usize)()
- //~^ ERROR cannot call
+ //~^ ERROR cannot call non-const closure
}>;
fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-100313.rs b/src/test/ui/const-generics/issues/issue-100313.rs
new file mode 100644
index 000000000..4e9d3626a
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-100313.rs
@@ -0,0 +1,21 @@
+#![allow(incomplete_features)]
+#![feature(const_mut_refs)]
+#![feature(adt_const_params)]
+
+struct T<const B: &'static bool>;
+
+impl <const B: &'static bool> T<B> {
+ const fn set_false(&self) {
+ unsafe {
+ *(B as *const bool as *mut bool) = false;
+ //~^ ERROR evaluation of constant value failed [E0080]
+ }
+ }
+}
+
+const _: () = {
+ let x = T::<{&true}>;
+ x.set_false();
+};
+
+fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-100313.stderr b/src/test/ui/const-generics/issues/issue-100313.stderr
new file mode 100644
index 000000000..f3ce357c2
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-100313.stderr
@@ -0,0 +1,15 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/issue-100313.rs:10:13
+ |
+LL | *(B as *const bool as *mut bool) = false;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | writing to alloc7 which is read-only
+ | inside `T::<&true>::set_false` at $DIR/issue-100313.rs:10:13
+...
+LL | x.set_false();
+ | ------------- inside `_` at $DIR/issue-100313.rs:18:5
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/const-generics/issues/issue-73260.stderr b/src/test/ui/const-generics/issues/issue-73260.stderr
index f1fc50e6e..7670032e5 100644
--- a/src/test/ui/const-generics/issues/issue-73260.stderr
+++ b/src/test/ui/const-generics/issues/issue-73260.stderr
@@ -4,8 +4,16 @@ error[E0308]: mismatched types
LL | let x: Arr<{usize::MAX}> = Arr {};
| ^^^^^^^^^^^^^^^^^ expected `false`, found `true`
|
- = note: expected type `false`
- found type `true`
+ = note: expected constant `false`
+ found constant `true`
+note: required by a bound in `Arr`
+ --> $DIR/issue-73260.rs:6:37
+ |
+LL | struct Arr<const N: usize>
+ | --- required by a bound in this
+LL | where
+LL | Assert::<{N < usize::MAX / 2}>: IsTrue,
+ | ^^^^^^ required by this bound in `Arr`
error[E0308]: mismatched types
--> $DIR/issue-73260.rs:16:32
@@ -13,8 +21,16 @@ error[E0308]: mismatched types
LL | let x: Arr<{usize::MAX}> = Arr {};
| ^^^ expected `false`, found `true`
|
- = note: expected type `false`
- found type `true`
+ = note: expected constant `false`
+ found constant `true`
+note: required by a bound in `Arr`
+ --> $DIR/issue-73260.rs:6:37
+ |
+LL | struct Arr<const N: usize>
+ | --- required by a bound in this
+LL | where
+LL | Assert::<{N < usize::MAX / 2}>: IsTrue,
+ | ^^^^^^ required by this bound in `Arr`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/issues/issue-79674.stderr b/src/test/ui/const-generics/issues/issue-79674.stderr
index 8c029289c..02b48b55f 100644
--- a/src/test/ui/const-generics/issues/issue-79674.stderr
+++ b/src/test/ui/const-generics/issues/issue-79674.stderr
@@ -4,8 +4,16 @@ error[E0308]: mismatched types
LL | requires_distinct("str", 12);
| ^^^^^^^^^^^^^^^^^ expected `true`, found `false`
|
- = note: expected type `true`
- found type `false`
+ = note: expected constant `true`
+ found constant `false`
+note: required by a bound in `requires_distinct`
+ --> $DIR/issue-79674.rs:23:37
+ |
+LL | fn requires_distinct<A, B>(_a: A, _b: B) where
+ | ----------------- required by a bound in this
+LL | A: MiniTypeId, B: MiniTypeId,
+LL | Lift<{is_same_type::<A, B>()}>: IsFalse {}
+ | ^^^^^^^ required by this bound in `requires_distinct`
error: aborting due to previous error
diff --git a/src/test/ui/const-generics/issues/issue-83466.rs b/src/test/ui/const-generics/issues/issue-83466.rs
index c488a663f..73c930101 100644
--- a/src/test/ui/const-generics/issues/issue-83466.rs
+++ b/src/test/ui/const-generics/issues/issue-83466.rs
@@ -1,5 +1,5 @@
// regression test for #83466- tests that generic arg mismatch errors between
-// consts and types are not supressed when there are explicit late bound lifetimes
+// consts and types are not suppressed when there are explicit late bound lifetimes
struct S;
impl S {
diff --git a/src/test/ui/const-generics/issues/issue-83466.stderr b/src/test/ui/const-generics/issues/issue-83466.stderr
index a60f71ea6..bcfd70639 100644
--- a/src/test/ui/const-generics/issues/issue-83466.stderr
+++ b/src/test/ui/const-generics/issues/issue-83466.stderr
@@ -7,9 +7,9 @@ LL | fn func<'a, U>(self) -> U {
LL | S.func::<'a, 10_u32>()
| ^^
|
- = note: `#[warn(late_bound_lifetime_arguments)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>
+ = note: `#[warn(late_bound_lifetime_arguments)]` on by default
error[E0747]: constant provided when a type was expected
--> $DIR/issue-83466.rs:11:18
diff --git a/src/test/ui/const-generics/issues/issue-83765.stderr b/src/test/ui/const-generics/issues/issue-83765.stderr
index 28ddddf1b..4becf3a36 100644
--- a/src/test/ui/const-generics/issues/issue-83765.stderr
+++ b/src/test/ui/const-generics/issues/issue-83765.stderr
@@ -1,16 +1,16 @@
-error[E0391]: cycle detected when resolving instance `<LazyUpdim<T, { T::DIM }, DIM> as TensorDimension>::DIM`
+error[E0391]: cycle detected when resolving instance `<LazyUpdim<'_, T, { T::DIM }, DIM> as TensorDimension>::DIM`
--> $DIR/issue-83765.rs:5:5
|
LL | const DIM: usize;
| ^^^^^^^^^^^^^^^^
|
-note: ...which requires checking if `TensorDimension` fulfills its obligations...
+note: ...which requires computing candidate for `<LazyUpdim<'_, T, { T::DIM }, DIM> as TensorDimension>`...
--> $DIR/issue-83765.rs:4:1
|
LL | trait TensorDimension {
| ^^^^^^^^^^^^^^^^^^^^^
- = note: ...which again requires resolving instance `<LazyUpdim<T, { T::DIM }, DIM> as TensorDimension>::DIM`, completing the cycle
-note: cycle used when checking if `TensorDimension` fulfills its obligations
+ = note: ...which again requires resolving instance `<LazyUpdim<'_, T, { T::DIM }, DIM> as TensorDimension>::DIM`, completing the cycle
+note: cycle used when computing candidate for `<LazyUpdim<'_, T, { T::DIM }, DIM> as TensorDimension>`
--> $DIR/issue-83765.rs:4:1
|
LL | trait TensorDimension {
diff --git a/src/test/ui/const-generics/issues/issue-87493.stderr b/src/test/ui/const-generics/issues/issue-87493.stderr
index f998c1187..653afae21 100644
--- a/src/test/ui/const-generics/issues/issue-87493.stderr
+++ b/src/test/ui/const-generics/issues/issue-87493.stderr
@@ -13,15 +13,17 @@ error[E0107]: this trait takes 0 generic arguments but 1 generic argument was su
--> $DIR/issue-87493.rs:8:8
|
LL | T: MyTrait<Assoc == S::Assoc>,
- | ^^^^^^^ ----------------- help: replace the generic bound with the associated type: `Assoc = Assoc == S::Assoc`
- | |
- | expected 0 generic arguments
+ | ^^^^^^^ expected 0 generic arguments
|
note: trait defined here, with 0 generic parameters
--> $DIR/issue-87493.rs:1:11
|
LL | pub trait MyTrait {
| ^^^^^^^
+help: replace the generic bound with the associated type
+ |
+LL | T: MyTrait<Assoc = Assoc == S::Assoc>,
+ | +++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/const-generics/issues/issue-88119.rs b/src/test/ui/const-generics/issues/issue-88119.rs
index 70dfa7f70..647b0eea8 100644
--- a/src/test/ui/const-generics/issues/issue-88119.rs
+++ b/src/test/ui/const-generics/issues/issue-88119.rs
@@ -3,6 +3,7 @@
#![allow(incomplete_features)]
#![feature(const_trait_impl, generic_const_exprs)]
+#[const_trait]
trait ConstName {
const NAME_BYTES: &'static [u8];
}
diff --git a/src/test/ui/const-generics/issues/issue-98629.rs b/src/test/ui/const-generics/issues/issue-98629.rs
index fc8666bbc..1d2d3012a 100644
--- a/src/test/ui/const-generics/issues/issue-98629.rs
+++ b/src/test/ui/const-generics/issues/issue-98629.rs
@@ -1,5 +1,6 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Trait {
const N: usize;
}
diff --git a/src/test/ui/const-generics/issues/issue-98629.stderr b/src/test/ui/const-generics/issues/issue-98629.stderr
index 535702208..4a248be76 100644
--- a/src/test/ui/const-generics/issues/issue-98629.stderr
+++ b/src/test/ui/const-generics/issues/issue-98629.stderr
@@ -1,5 +1,5 @@
error[E0046]: not all trait items implemented, missing: `N`
- --> $DIR/issue-98629.rs:7:1
+ --> $DIR/issue-98629.rs:8:1
|
LL | const N: usize;
| -------------- `N` from trait
diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.rs b/src/test/ui/const-generics/min_const_generics/complex-expression.rs
index 7840989cb..8e667aeba 100644
--- a/src/test/ui/const-generics/min_const_generics/complex-expression.rs
+++ b/src/test/ui/const-generics/min_const_generics/complex-expression.rs
@@ -1,3 +1,4 @@
+// compile-flags: -Zdeduplicate-diagnostics=yes
use std::mem::size_of;
fn test<const N: usize>() {}
diff --git a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
index bf0d0f352..deabd05a6 100644
--- a/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
+++ b/src/test/ui/const-generics/min_const_generics/complex-expression.stderr
@@ -1,5 +1,5 @@
error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:9:38
+ --> $DIR/complex-expression.rs:10:38
|
LL | struct Break0<const N: usize>([u8; { N + 1 }]);
| ^ cannot perform const operation using `N`
@@ -8,7 +8,7 @@ LL | struct Break0<const N: usize>([u8; { N + 1 }]);
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:12:40
+ --> $DIR/complex-expression.rs:13:40
|
LL | struct Break1<const N: usize>([u8; { { N } }]);
| ^ cannot perform const operation using `N`
@@ -17,7 +17,7 @@ LL | struct Break1<const N: usize>([u8; { { N } }]);
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:16:17
+ --> $DIR/complex-expression.rs:17:17
|
LL | let _: [u8; N + 1];
| ^ cannot perform const operation using `N`
@@ -26,7 +26,7 @@ LL | let _: [u8; N + 1];
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:21:17
+ --> $DIR/complex-expression.rs:22:17
|
LL | let _ = [0; N + 1];
| ^ cannot perform const operation using `N`
@@ -35,7 +35,7 @@ LL | let _ = [0; N + 1];
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:25:45
+ --> $DIR/complex-expression.rs:26:45
|
LL | struct BreakTy0<T>(T, [u8; { size_of::<*mut T>() }]);
| ^ cannot perform const operation using `T`
@@ -44,7 +44,7 @@ LL | struct BreakTy0<T>(T, [u8; { size_of::<*mut T>() }]);
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:28:47
+ --> $DIR/complex-expression.rs:29:47
|
LL | struct BreakTy1<T>(T, [u8; { { size_of::<*mut T>() } }]);
| ^ cannot perform const operation using `T`
@@ -53,7 +53,7 @@ LL | struct BreakTy1<T>(T, [u8; { { size_of::<*mut T>() } }]);
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
error: generic parameters may not be used in const operations
- --> $DIR/complex-expression.rs:32:32
+ --> $DIR/complex-expression.rs:33:32
|
LL | let _: [u8; size_of::<*mut T>() + 1];
| ^ cannot perform const operation using `T`
@@ -62,14 +62,14 @@ LL | let _: [u8; size_of::<*mut T>() + 1];
= help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
warning: cannot use constants which depend on generic parameters in types
- --> $DIR/complex-expression.rs:37:17
+ --> $DIR/complex-expression.rs:38:17
|
LL | let _ = [0; size_of::<*mut T>() + 1];
| ^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
+ = note: `#[warn(const_evaluatable_unchecked)]` on by default
error: aborting due to 7 previous errors; 1 warning emitted
diff --git a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs
index 71d13ca61..e9d868093 100644
--- a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs
+++ b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.rs
@@ -1,4 +1,5 @@
// check-pass
+// compile-flags: -Zdeduplicate-diagnostics=yes
#![allow(dead_code)]
fn foo<T>() {
diff --git a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr
index f9f6660f6..8003dfa40 100644
--- a/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr
+++ b/src/test/ui/const-generics/min_const_generics/const-evaluatable-unchecked.stderr
@@ -1,15 +1,15 @@
warning: cannot use constants which depend on generic parameters in types
- --> $DIR/const-evaluatable-unchecked.rs:5:9
+ --> $DIR/const-evaluatable-unchecked.rs:6:9
|
LL | [0; std::mem::size_of::<*mut T>()];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(const_evaluatable_unchecked)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
+ = note: `#[warn(const_evaluatable_unchecked)]` on by default
warning: cannot use constants which depend on generic parameters in types
- --> $DIR/const-evaluatable-unchecked.rs:16:21
+ --> $DIR/const-evaluatable-unchecked.rs:17:21
|
LL | let _ = [0; Self::ASSOC];
| ^^^^^^^^^^^
@@ -18,7 +18,7 @@ LL | let _ = [0; Self::ASSOC];
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
warning: cannot use constants which depend on generic parameters in types
- --> $DIR/const-evaluatable-unchecked.rs:28:21
+ --> $DIR/const-evaluatable-unchecked.rs:29:21
|
LL | let _ = [0; Self::ASSOC];
| ^^^^^^^^^^^
diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr b/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
index f5396b838..be92429e3 100644
--- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
+++ b/src/test/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
@@ -22,19 +22,14 @@ error[E0308]: mismatched types
LL | get_flag::<42, 0x5ad>();
| ^^^^^ expected `char`, found `u8`
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:38:21
+error[E0080]: evaluation of constant value failed
+ --> $DIR/invalid-patterns.rs:38:32
|
LL | get_flag::<false, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:40:14
+ --> $DIR/invalid-patterns.rs:41:14
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -45,7 +40,7 @@ LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:42:14
+ --> $DIR/invalid-patterns.rs:43:14
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -55,16 +50,11 @@ LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character
42 │ B
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:42:47
+error[E0080]: evaluation of constant value failed
+ --> $DIR/invalid-patterns.rs:43:58
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to 8 previous errors
diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr b/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
index f5396b838..be92429e3 100644
--- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
+++ b/src/test/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
@@ -22,19 +22,14 @@ error[E0308]: mismatched types
LL | get_flag::<42, 0x5ad>();
| ^^^^^ expected `char`, found `u8`
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:38:21
+error[E0080]: evaluation of constant value failed
+ --> $DIR/invalid-patterns.rs:38:32
|
LL | get_flag::<false, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:40:14
+ --> $DIR/invalid-patterns.rs:41:14
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -45,7 +40,7 @@ LL | get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:42:14
+ --> $DIR/invalid-patterns.rs:43:14
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -55,16 +50,11 @@ LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character
42 │ B
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/invalid-patterns.rs:42:47
+error[E0080]: evaluation of constant value failed
+ --> $DIR/invalid-patterns.rs:43:58
|
LL | get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to 8 previous errors
diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs b/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs
index 682e0eced..13b2cca2f 100644
--- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs
+++ b/src/test/ui/const-generics/min_const_generics/invalid-patterns.rs
@@ -36,10 +36,12 @@ fn main() {
get_flag::<false, { unsafe { char_raw.character } }>();
- //~^ ERROR it is undefined behavior
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
//~^ ERROR it is undefined behavior
get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
- //~^ ERROR it is undefined behavior
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
//~| ERROR it is undefined behavior
}
diff --git a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr
index f9b56bd38..fe3f24a67 100644
--- a/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr
+++ b/src/test/ui/const-generics/occurs-check/unify-fixpoint.stderr
@@ -4,8 +4,8 @@ warning: the feature `generic_const_exprs` is incomplete and may not be safe to
LL | #![feature(generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs
index 9a73f1a53..9b1212694 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-2.rs
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-2.rs
@@ -1,7 +1,7 @@
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
-// The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
+// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
//
// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an
// artificial inference cycle.
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs
index 0d38bd393..d5aeab47e 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-3.rs
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-3.rs
@@ -1,7 +1,7 @@
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
-// The goal is is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
+// The goal is to get an unevaluated const `ct` with a `Ty::Infer(TyVar(_#1t)` subst.
//
// If we are then able to infer `ty::Infer(TyVar(_#1t) := Ty<ct>` we introduced an
// artificial inference cycle.
diff --git a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr
index 486506239..b6a22df74 100644
--- a/src/test/ui/const-generics/types-mismatch-const-args.full.stderr
+++ b/src/test/ui/const-generics/types-mismatch-const-args.full.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {2u32 + 2u32}, {3u32}> { data: PhantomData };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2`, found `4`
|
- = note: expected type `2`
- found type `4`
+ = note: expected constant `2`
+ found constant `4`
error[E0308]: mismatched types
--> $DIR/types-mismatch-const-args.rs:16:41
diff --git a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr b/src/test/ui/const-ptr/forbidden_slices.32bit.stderr
index 82a3c92e6..8978ab436 100644
--- a/src/test/ui/const-ptr/forbidden_slices.32bit.stderr
+++ b/src/test/ui/const-ptr/forbidden_slices.32bit.stderr
@@ -5,7 +5,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
- | inside `std::slice::from_raw_parts::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:18:34
|
@@ -19,7 +19,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
- | inside `std::slice::from_raw_parts::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:19:33
|
@@ -33,7 +33,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
- | inside `std::slice::from_raw_parts::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:22:34
|
@@ -92,7 +92,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
- | inside `std::slice::from_raw_parts::<u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:43:5
|
@@ -111,7 +111,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:46:34
|
@@ -130,7 +130,7 @@ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:47:33
|
@@ -230,7 +230,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:79:34
|
@@ -249,7 +249,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:80:35
|
diff --git a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr
index f88746af9..db42b7c98 100644
--- a/src/test/ui/const-ptr/forbidden_slices.64bit.stderr
+++ b/src/test/ui/const-ptr/forbidden_slices.64bit.stderr
@@ -5,7 +5,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
- | inside `std::slice::from_raw_parts::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:18:34
|
@@ -19,7 +19,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: null pointer is a dangling pointer (it has no provenance)
- | inside `std::slice::from_raw_parts::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:19:33
|
@@ -33,7 +33,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: ALLOC_ID has size 4, so pointer to 8 bytes starting at offset 0 is out-of-bounds
- | inside `std::slice::from_raw_parts::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:22:34
|
@@ -92,7 +92,7 @@ LL | &*ptr::slice_from_raw_parts(data, len)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| dereferencing pointer failed: ALLOC_ID has size 8, so pointer to 8 bytes starting at offset 1 is out-of-bounds
- | inside `std::slice::from_raw_parts::<u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | inside `std::slice::from_raw_parts::<'_, u64>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:43:5
|
@@ -111,7 +111,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:46:34
|
@@ -130,7 +130,7 @@ LL | assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, ()>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:47:33
|
@@ -230,7 +230,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:79:34
|
@@ -249,7 +249,7 @@ LL | unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) }
::: $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
LL | unsafe { from_raw_parts(range.start, range.end.sub_ptr(range.start)) }
- | ------------------------------ inside `from_ptr_range::<u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
+ | ------------------------------ inside `from_ptr_range::<'_, u32>` at $SRC_DIR/core/src/slice/raw.rs:LL:COL
|
::: $DIR/forbidden_slices.rs:80:35
|
diff --git a/src/test/ui/const_prop/issue-102553.rs b/src/test/ui/const_prop/issue-102553.rs
new file mode 100644
index 000000000..523a9d7ac
--- /dev/null
+++ b/src/test/ui/const_prop/issue-102553.rs
@@ -0,0 +1,24 @@
+// compile-flags: --crate-type=lib
+// check-pass
+
+pub trait Widget<E> {
+ fn boxed<'w>(self) -> Box<dyn WidgetDyn<E> + 'w>
+ where
+ Self: Sized + 'w;
+}
+
+pub trait WidgetDyn<E> {}
+
+impl<T, E> WidgetDyn<E> for T where T: Widget<E> {}
+
+impl<E> Widget<E> for dyn WidgetDyn<E> + '_ {
+ fn boxed<'w>(self) -> Box<dyn WidgetDyn<E> + 'w>
+ where
+ Self: Sized + 'w,
+ {
+ // Even though this is illegal to const evaluate, this should never
+ // trigger an ICE because it can never be called from actual code
+ // (due to the trivially false where-clause predicate).
+ Box::new(self)
+ }
+}
diff --git a/src/test/ui/consts/array-literal-index-oob.rs b/src/test/ui/consts/array-literal-index-oob.rs
index 9b3f735b1..67b49b1ba 100644
--- a/src/test/ui/consts/array-literal-index-oob.rs
+++ b/src/test/ui/consts/array-literal-index-oob.rs
@@ -1,7 +1,7 @@
// build-pass
// ignore-pass (test emits codegen-time warnings and verifies that they are not errors)
-#![warn(const_err, unconditional_panic)]
+#![warn(unconditional_panic)]
fn main() {
&{ [1, 2, 3][4] };
diff --git a/src/test/ui/consts/array-literal-index-oob.stderr b/src/test/ui/consts/array-literal-index-oob.stderr
index f96b8d48b..54bf3af81 100644
--- a/src/test/ui/consts/array-literal-index-oob.stderr
+++ b/src/test/ui/consts/array-literal-index-oob.stderr
@@ -5,10 +5,10 @@ LL | &{ [1, 2, 3][4] };
| ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
|
note: the lint level is defined here
- --> $DIR/array-literal-index-oob.rs:4:20
+ --> $DIR/array-literal-index-oob.rs:4:9
|
-LL | #![warn(const_err, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #![warn(unconditional_panic)]
+ | ^^^^^^^^^^^^^^^^^^^
warning: 1 warning emitted
diff --git a/src/test/ui/consts/assert-type-intrinsics.rs b/src/test/ui/consts/assert-type-intrinsics.rs
index 38e5c454e..263d1ae6a 100644
--- a/src/test/ui/consts/assert-type-intrinsics.rs
+++ b/src/test/ui/consts/assert-type-intrinsics.rs
@@ -1,5 +1,3 @@
-// error-pattern: any use of this value will cause an error
-
#![feature(never_type)]
#![feature(const_assert_type2)]
#![feature(core_intrinsics)]
@@ -12,11 +10,14 @@ fn main() {
const _BAD1: () = unsafe {
MaybeUninit::<!>::uninit().assume_init();
+ //~^ERROR: evaluation of constant value failed
};
- const _BAD2: () = unsafe {
- intrinsics::assert_uninit_valid::<bool>();
+ const _BAD2: () = {
+ intrinsics::assert_uninit_valid::<&'static i32>();
+ //~^ERROR: evaluation of constant value failed
};
- const _BAD3: () = unsafe {
+ const _BAD3: () = {
intrinsics::assert_zero_valid::<&'static i32>();
+ //~^ERROR: evaluation of constant value failed
};
}
diff --git a/src/test/ui/consts/assert-type-intrinsics.stderr b/src/test/ui/consts/assert-type-intrinsics.stderr
index f3b9170d4..f92f9fda0 100644
--- a/src/test/ui/consts/assert-type-intrinsics.stderr
+++ b/src/test/ui/consts/assert-type-intrinsics.stderr
@@ -1,75 +1,21 @@
-error: any use of this value will cause an error
- --> $DIR/assert-type-intrinsics.rs:14:9
+error[E0080]: evaluation of constant value failed
+ --> $DIR/assert-type-intrinsics.rs:12:9
|
-LL | const _BAD1: () = unsafe {
- | ---------------
LL | MaybeUninit::<!>::uninit().assume_init();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/assert-type-intrinsics.rs:17:9
- |
-LL | const _BAD2: () = unsafe {
- | ---------------
-LL | intrinsics::assert_uninit_valid::<bool>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid
+error[E0080]: evaluation of constant value failed
+ --> $DIR/assert-type-intrinsics.rs:16:9
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+LL | intrinsics::assert_uninit_valid::<&'static i32>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `&i32` uninitialized, which is invalid
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/assert-type-intrinsics.rs:20:9
|
-LL | const _BAD3: () = unsafe {
- | ---------------
LL | intrinsics::assert_zero_valid::<&'static i32>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 3 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/assert-type-intrinsics.rs:14:9
- |
-LL | const _BAD1: () = unsafe {
- | ---------------
-LL | MaybeUninit::<!>::uninit().assume_init();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/assert-type-intrinsics.rs:17:9
- |
-LL | const _BAD2: () = unsafe {
- | ---------------
-LL | intrinsics::assert_uninit_valid::<bool>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/assert-type-intrinsics.rs:20:9
- |
-LL | const _BAD3: () = unsafe {
- | ---------------
-LL | intrinsics::assert_zero_valid::<&'static i32>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/assoc_const_generic_impl.rs b/src/test/ui/consts/assoc_const_generic_impl.rs
index 71d947b0c..3475c862b 100644
--- a/src/test/ui/consts/assoc_const_generic_impl.rs
+++ b/src/test/ui/consts/assoc_const_generic_impl.rs
@@ -1,17 +1,14 @@
// build-fail
-#![warn(const_err)]
-
trait ZeroSized: Sized {
const I_AM_ZERO_SIZED: ();
fn requires_zero_size(self);
}
impl<T: Sized> ZeroSized for T {
- const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()]; //~ WARN any use of this value
- //~| WARN this was previously accepted by the compiler but is being phased out
+ const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()]; //~ ERROR evaluation of `<u32 as ZeroSized>::I_AM_ZERO_SIZED` failed
fn requires_zero_size(self) {
- let () = Self::I_AM_ZERO_SIZED; //~ ERROR erroneous constant encountered
+ let () = Self::I_AM_ZERO_SIZED;
println!("requires_zero_size called");
}
}
diff --git a/src/test/ui/consts/assoc_const_generic_impl.stderr b/src/test/ui/consts/assoc_const_generic_impl.stderr
index 17cbaef1f..854b9ce5b 100644
--- a/src/test/ui/consts/assoc_const_generic_impl.stderr
+++ b/src/test/ui/consts/assoc_const_generic_impl.stderr
@@ -1,37 +1,15 @@
-warning: any use of this value will cause an error
- --> $DIR/assoc_const_generic_impl.rs:11:34
+error[E0080]: evaluation of `<u32 as ZeroSized>::I_AM_ZERO_SIZED` failed
+ --> $DIR/assoc_const_generic_impl.rs:9:34
|
LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()];
- | ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4
- |
-note: the lint level is defined here
- --> $DIR/assoc_const_generic_impl.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4
-error: erroneous constant encountered
- --> $DIR/assoc_const_generic_impl.rs:14:18
+note: the above error was encountered while instantiating `fn <u32 as ZeroSized>::requires_zero_size`
+ --> $DIR/assoc_const_generic_impl.rs:18:5
|
-LL | let () = Self::I_AM_ZERO_SIZED;
- | ^^^^^^^^^^^^^^^^^^^^^
+LL | 42_u32.requires_zero_size();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/assoc_const_generic_impl.rs:11:34
- |
-LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::<Self>()];
- | ------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 4
- |
-note: the lint level is defined here
- --> $DIR/assoc_const_generic_impl.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/cast-discriminant-zst-enum.rs b/src/test/ui/consts/cast-discriminant-zst-enum.rs
index e59ae297d..2767f178f 100644
--- a/src/test/ui/consts/cast-discriminant-zst-enum.rs
+++ b/src/test/ui/consts/cast-discriminant-zst-enum.rs
@@ -1,6 +1,5 @@
// run-pass
// Test a ZST enum whose dicriminant is ~0i128. This caused an ICE when casting to an i32.
-#![feature(bench_black_box)]
use std::hint::black_box;
#[derive(Copy, Clone)]
diff --git a/src/test/ui/consts/const-block-const-bound.stderr b/src/test/ui/consts/const-block-const-bound.stderr
index 87ca771e5..b9c4d8866 100644
--- a/src/test/ui/consts/const-block-const-bound.stderr
+++ b/src/test/ui/consts/const-block-const-bound.stderr
@@ -2,7 +2,7 @@ error[E0277]: can't drop `UnconstDrop` in const contexts
--> $DIR/const-block-const-bound.rs:20:11
|
LL | f(UnconstDrop);
- | - ^^^^^^^^^^^ expected an implementor of trait `~const Destruct`
+ | - ^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `UnconstDrop`
| |
| required by a bound introduced by this call
|
@@ -23,7 +23,7 @@ error[E0277]: can't drop `NonDrop` in const contexts
--> $DIR/const-block-const-bound.rs:22:11
|
LL | f(NonDrop);
- | - ^^^^^^^ expected an implementor of trait `~const Destruct`
+ | - ^^^^^^^ the trait `~const Destruct` is not implemented for `NonDrop`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/consts/const-blocks/fn-call-in-non-const.stderr b/src/test/ui/consts/const-blocks/fn-call-in-non-const.stderr
index 5306fed22..ee352700c 100644
--- a/src/test/ui/consts/const-blocks/fn-call-in-non-const.stderr
+++ b/src/test/ui/consts/const-blocks/fn-call-in-non-const.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
LL | let _: [Option<Bar>; 2] = [no_copy(); 2];
| ^^^^^^^^^ the trait `Copy` is not implemented for `Bar`
|
- = note: required because of the requirements on the impl of `Copy` for `Option<Bar>`
+ = note: required for `Option<Bar>` to implement `Copy`
= note: the `Copy` trait is required because this value will be copied for each element of the array
= help: consider creating a new `const` item and initializing it with the result of the function call to be used in the repeat position, like `const VAL: Type = const_fn();` and `let x = [VAL; 42];`
= help: create an inline `const` block, see RFC #2920 <https://github.com/rust-lang/rfcs/pull/2920> for more information
diff --git a/src/test/ui/consts/const-blocks/migrate-fail.stderr b/src/test/ui/consts/const-blocks/migrate-fail.stderr
index 803281c07..928ffd083 100644
--- a/src/test/ui/consts/const-blocks/migrate-fail.stderr
+++ b/src/test/ui/consts/const-blocks/migrate-fail.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`
|
- = note: required because of the requirements on the impl of `Copy` for `Option<Bar>`
+ = note: required for `Option<Bar>` to implement `Copy`
= 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)]`
|
@@ -17,7 +17,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`
|
- = note: required because of the requirements on the impl of `Copy` for `Option<Bar>`
+ = note: required for `Option<Bar>` to implement `Copy`
= 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)]`
|
diff --git a/src/test/ui/consts/const-blocks/nll-fail.stderr b/src/test/ui/consts/const-blocks/nll-fail.stderr
index 8841af15d..fede00845 100644
--- a/src/test/ui/consts/const-blocks/nll-fail.stderr
+++ b/src/test/ui/consts/const-blocks/nll-fail.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`
|
- = note: required because of the requirements on the impl of `Copy` for `Option<Bar>`
+ = note: required for `Option<Bar>` to implement `Copy`
= 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)]`
|
@@ -17,7 +17,7 @@ error[E0277]: the trait bound `Bar: Copy` is not satisfied
LL | let arr: [Option<Bar>; 2] = [x; 2];
| ^ the trait `Copy` is not implemented for `Bar`
|
- = note: required because of the requirements on the impl of `Copy` for `Option<Bar>`
+ = note: required for `Option<Bar>` to implement `Copy`
= 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)]`
|
diff --git a/src/test/ui/consts/const-blocks/trait-error.stderr b/src/test/ui/consts/const-blocks/trait-error.stderr
index ece200ad1..b11dd4b80 100644
--- a/src/test/ui/consts/const-blocks/trait-error.stderr
+++ b/src/test/ui/consts/const-blocks/trait-error.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied
LL | [Foo(String::new()); 4];
| ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
|
-note: required because of the requirements on the impl of `Copy` for `Foo<String>`
+note: required for `Foo<String>` to implement `Copy`
--> $DIR/trait-error.rs:1:10
|
LL | #[derive(Copy, Clone)]
diff --git a/src/test/ui/consts/const-err-early.rs b/src/test/ui/consts/const-err-early.rs
index d8f7635fe..a3105b4fc 100644
--- a/src/test/ui/consts/const-err-early.rs
+++ b/src/test/ui/consts/const-err-early.rs
@@ -1,15 +1,8 @@
-#![deny(const_err)]
-
-pub const A: i8 = -i8::MIN; //~ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
-pub const B: u8 = 200u8 + 200u8; //~ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
-pub const C: u8 = 200u8 * 4; //~ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
-pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
-pub const E: u8 = [5u8][1]; //~ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
+pub const A: i8 = -i8::MIN; //~ ERROR constant
+pub const B: u8 = 200u8 + 200u8; //~ ERROR constant
+pub const C: u8 = 200u8 * 4; //~ ERROR constant
+pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR constant
+pub const E: u8 = [5u8][1]; //~ ERROR constant
fn main() {
let _a = A;
diff --git a/src/test/ui/consts/const-err-early.stderr b/src/test/ui/consts/const-err-early.stderr
index 1b94aa080..59bf637b7 100644
--- a/src/test/ui/consts/const-err-early.stderr
+++ b/src/test/ui/consts/const-err-early.stderr
@@ -1,127 +1,33 @@
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:3:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-early.rs:1:19
|
LL | pub const A: i8 = -i8::MIN;
- | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-err-early.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:5:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-early.rs:2:19
|
LL | pub const B: u8 = 200u8 + 200u8;
- | --------------- ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:7:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-early.rs:3:19
|
LL | pub const C: u8 = 200u8 * 4;
- | --------------- ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:9:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-early.rs:4:19
|
LL | pub const D: u8 = 42u8 - (42u8 + 1);
- | --------------- ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:11:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-early.rs:5:19
|
LL | pub const E: u8 = [5u8][1];
- | --------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
error: aborting due to 5 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:3:19
- |
-LL | pub const A: i8 = -i8::MIN;
- | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-err-early.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:5:19
- |
-LL | pub const B: u8 = 200u8 + 200u8;
- | --------------- ^^^^^^^^^^^^^ attempt to compute `200_u8 + 200_u8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-err-early.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:7:19
- |
-LL | pub const C: u8 = 200u8 * 4;
- | --------------- ^^^^^^^^^ attempt to compute `200_u8 * 4_u8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-err-early.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:9:19
- |
-LL | pub const D: u8 = 42u8 - (42u8 + 1);
- | --------------- ^^^^^^^^^^^^^^^^^ attempt to compute `42_u8 - 43_u8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-err-early.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-early.rs:11:19
- |
-LL | pub const E: u8 = [5u8][1];
- | --------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
- |
-note: the lint level is defined here
- --> $DIR/const-err-early.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-err-late.rs b/src/test/ui/consts/const-err-late.rs
new file mode 100644
index 000000000..a20ae7025
--- /dev/null
+++ b/src/test/ui/consts/const-err-late.rs
@@ -0,0 +1,22 @@
+// build-fail
+// compile-flags: -C overflow-checks=on
+
+#![allow(arithmetic_overflow, unconditional_panic)]
+
+fn black_box<T>(_: T) {
+ unimplemented!()
+}
+
+struct S<T>(T);
+
+impl<T> S<T> {
+ const FOO: u8 = [5u8][1];
+ //~^ ERROR evaluation of `S::<i32>::FOO` failed
+ //~| ERROR evaluation of `S::<u32>::FOO` failed
+}
+
+fn main() {
+ black_box((S::<i32>::FOO, S::<u32>::FOO));
+ //~^ ERROR erroneous constant
+ //~| ERROR erroneous constant
+}
diff --git a/src/test/ui/consts/const-err-late.stderr b/src/test/ui/consts/const-err-late.stderr
new file mode 100644
index 000000000..3a8b10317
--- /dev/null
+++ b/src/test/ui/consts/const-err-late.stderr
@@ -0,0 +1,27 @@
+error[E0080]: evaluation of `S::<i32>::FOO` failed
+ --> $DIR/const-err-late.rs:13:21
+ |
+LL | const FOO: u8 = [5u8][1];
+ | ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
+
+error[E0080]: erroneous constant used
+ --> $DIR/const-err-late.rs:19:16
+ |
+LL | black_box((S::<i32>::FOO, S::<u32>::FOO));
+ | ^^^^^^^^^^^^^ referenced constant has errors
+
+error[E0080]: evaluation of `S::<u32>::FOO` failed
+ --> $DIR/const-err-late.rs:13:21
+ |
+LL | const FOO: u8 = [5u8][1];
+ | ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
+
+error[E0080]: erroneous constant used
+ --> $DIR/const-err-late.rs:19:31
+ |
+LL | black_box((S::<i32>::FOO, S::<u32>::FOO));
+ | ^^^^^^^^^^^^^ referenced constant has errors
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-err-multi.rs b/src/test/ui/consts/const-err-multi.rs
index 62552e147..fb26e8aac 100644
--- a/src/test/ui/consts/const-err-multi.rs
+++ b/src/test/ui/consts/const-err-multi.rs
@@ -1,17 +1,11 @@
-#![deny(const_err)]
-
pub const A: i8 = -i8::MIN;
-//~^ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR constant
pub const B: i8 = A;
-//~^ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR constant
pub const C: u8 = A as u8;
-//~^ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR constant
pub const D: i8 = 50 - A;
-//~^ ERROR const_err
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR constant
fn main() {
let _ = (A, B, C, D);
diff --git a/src/test/ui/consts/const-err-multi.stderr b/src/test/ui/consts/const-err-multi.stderr
index f17984365..fca9e2270 100644
--- a/src/test/ui/consts/const-err-multi.stderr
+++ b/src/test/ui/consts/const-err-multi.stderr
@@ -1,103 +1,27 @@
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:3:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-multi.rs:1:19
|
LL | pub const A: i8 = -i8::MIN;
- | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-err-multi.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:6:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-multi.rs:3:19
|
LL | pub const B: i8 = A;
- | --------------- ^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^ referenced constant has errors
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:9:19
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-multi.rs:5:19
|
LL | pub const C: u8 = A as u8;
- | --------------- ^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^ referenced constant has errors
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:12:24
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err-multi.rs:7:24
|
LL | pub const D: i8 = 50 - A;
- | --------------- ^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^ referenced constant has errors
error: aborting due to 4 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:3:19
- |
-LL | pub const A: i8 = -i8::MIN;
- | --------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-err-multi.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:6:19
- |
-LL | pub const B: i8 = A;
- | --------------- ^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/const-err-multi.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:9:19
- |
-LL | pub const C: u8 = A as u8;
- | --------------- ^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/const-err-multi.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-err-multi.rs:12:24
- |
-LL | pub const D: i8 = 50 - A;
- | --------------- ^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/const-err-multi.rs:1:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-err-rpass.rs b/src/test/ui/consts/const-err-rpass.rs
index 9851f1c58..e7fa10a2a 100644
--- a/src/test/ui/consts/const-err-rpass.rs
+++ b/src/test/ui/consts/const-err-rpass.rs
@@ -2,8 +2,6 @@
#![allow(dead_code)]
// check for const_err regressions
-#![deny(const_err)]
-
const X: *const u8 = b"" as _;
const Y: bool = 'A' == 'B';
const Z: char = 'A';
diff --git a/src/test/ui/consts/const-err.rs b/src/test/ui/consts/const-err.rs
deleted file mode 100644
index a8633fd87..000000000
--- a/src/test/ui/consts/const-err.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// build-fail
-// compile-flags: -C overflow-checks=on
-
-#![allow(arithmetic_overflow)]
-#![warn(const_err)]
-
-fn black_box<T>(_: T) {
- unimplemented!()
-}
-
-const FOO: u8 = [5u8][1];
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
-
-fn main() {
- black_box((FOO, FOO));
- //~^ ERROR erroneous constant used
- //~| ERROR erroneous constant
-}
diff --git a/src/test/ui/consts/const-err.stderr b/src/test/ui/consts/const-err.stderr
deleted file mode 100644
index e3b0d29c8..000000000
--- a/src/test/ui/consts/const-err.stderr
+++ /dev/null
@@ -1,44 +0,0 @@
-warning: any use of this value will cause an error
- --> $DIR/const-err.rs:11:17
- |
-LL | const FOO: u8 = [5u8][1];
- | ------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
- |
-note: the lint level is defined here
- --> $DIR/const-err.rs:5:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-error[E0080]: erroneous constant used
- --> $DIR/const-err.rs:16:16
- |
-LL | black_box((FOO, FOO));
- | ^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
- --> $DIR/const-err.rs:16:21
- |
-LL | black_box((FOO, FOO));
- | ^^^ referenced constant has errors
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const-err.rs:11:17
- |
-LL | const FOO: u8 = [5u8][1];
- | ------------- ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
- |
-note: the lint level is defined here
- --> $DIR/const-err.rs:5:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-err4.32bit.stderr b/src/test/ui/consts/const-err4.32bit.stderr
index a55384783..1cbf78173 100644
--- a/src/test/ui/consts/const-err4.32bit.stderr
+++ b/src/test/ui/consts/const-err4.32bit.stderr
@@ -1,13 +1,8 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const-err4.rs:9:11
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err4.rs:9:21
|
LL | Boo = [unsafe { Foo { b: () }.a }; 4][3],
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to previous error
diff --git a/src/test/ui/consts/const-err4.64bit.stderr b/src/test/ui/consts/const-err4.64bit.stderr
index 66bfc30c3..1cbf78173 100644
--- a/src/test/ui/consts/const-err4.64bit.stderr
+++ b/src/test/ui/consts/const-err4.64bit.stderr
@@ -1,13 +1,8 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const-err4.rs:9:11
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-err4.rs:9:21
|
LL | Boo = [unsafe { Foo { b: () }.a }; 4][3],
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 8, align: 8) {
- __ __ __ __ __ __ __ __ │ ░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to previous error
diff --git a/src/test/ui/consts/const-err4.rs b/src/test/ui/consts/const-err4.rs
index f0625faa8..107dc3f82 100644
--- a/src/test/ui/consts/const-err4.rs
+++ b/src/test/ui/consts/const-err4.rs
@@ -7,7 +7,8 @@ union Foo {
enum Bar {
Boo = [unsafe { Foo { b: () }.a }; 4][3],
- //~^ ERROR it is undefined behavior to use this value
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
}
fn main() {
diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.rs b/src/test/ui/consts/const-eval/conditional_array_execution.rs
index bd517e568..27d5383d6 100644
--- a/src/test/ui/consts/const-eval/conditional_array_execution.rs
+++ b/src/test/ui/consts/const-eval/conditional_array_execution.rs
@@ -1,16 +1,8 @@
-// build-fail
-
-#![warn(const_err)]
-
const X: u32 = 5;
const Y: u32 = 6;
const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR constant
fn main() {
println!("{}", FOO);
- //~^ ERROR evaluation of constant value failed
- //~| WARN erroneous constant used [const_err]
- //~| WARN this was previously accepted by the compiler but is being phased out
}
diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.stderr
index 2953406ee..c3401fbae 100644
--- a/src/test/ui/consts/const-eval/conditional_array_execution.stderr
+++ b/src/test/ui/consts/const-eval/conditional_array_execution.stderr
@@ -1,64 +1,9 @@
-warning: any use of this value will cause an error
- --> $DIR/conditional_array_execution.rs:7:19
- |
-LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
- | -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/conditional_array_execution.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
error[E0080]: evaluation of constant value failed
- --> $DIR/conditional_array_execution.rs:12:20
- |
-LL | println!("{}", FOO);
- | ^^^ referenced constant has errors
-
-warning: erroneous constant used
- --> $DIR/conditional_array_execution.rs:12:20
- |
-LL | println!("{}", FOO);
- | ^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning 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; 2 warnings emitted
-
-For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/conditional_array_execution.rs:7:19
+ --> $DIR/conditional_array_execution.rs:3:19
|
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
- | -------------- ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/conditional_array_execution.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
-Future breakage diagnostic:
-warning: erroneous constant used
- --> $DIR/conditional_array_execution.rs:12:20
- |
-LL | println!("{}", FOO);
- | ^^^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/conditional_array_execution.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning 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/src/test/ui/consts/const-eval/const-eval-overflow-2.rs b/src/test/ui/consts/const-eval/const-eval-overflow-2.rs
index 9300d9576..535d91359 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-2.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-2.rs
@@ -1,14 +1,14 @@
// Evaluation of constants in refutable patterns goes through
// different compiler control-flow paths.
-#![allow(unused_imports, warnings, const_err)]
+#![allow(unused_imports, warnings)]
use std::fmt;
use std::{i8, i16, i32, i64, isize};
use std::{u8, u16, u32, u64, usize};
const NEG_128: i8 = -128;
-const NEG_NEG_128: i8 = -NEG_128;
+const NEG_NEG_128: i8 = -NEG_128; //~ ERROR constant
fn main() {
match -128i8 {
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr
index cf50c19ca..7b1fe49d4 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr
@@ -1,3 +1,9 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow-2.rs:11:25
+ |
+LL | const NEG_NEG_128: i8 = -NEG_128;
+ | ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
+
error: could not evaluate constant pattern
--> $DIR/const-eval-overflow-2.rs:15:9
|
@@ -10,20 +16,6 @@ error: could not evaluate constant pattern
LL | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^
-error: aborting due to 2 previous errors
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const-eval-overflow-2.rs:11:25
- |
-LL | const NEG_NEG_128: i8 = -NEG_128;
- | --------------------- ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow-2.rs:4:36
- |
-LL | #![allow(unused_imports, warnings, const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+error: aborting due to 3 previous errors
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr
index 0e6be6d01..c685922c4 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr
@@ -4,13 +4,13 @@ error[E0308]: mismatched types
LL | = [0; (i8::MAX + 1u8) as usize];
| ^^^ expected `i8`, found `u8`
-error[E0277]: cannot add `u8` to `i8`
+error[E0277]: cannot add `u8` to `i8` in const contexts
--> $DIR/const-eval-overflow-3b.rs:16:20
|
LL | = [0; (i8::MAX + 1u8) as usize];
| ^ no implementation for `i8 + u8`
|
- = help: the trait `Add<u8>` is not implemented for `i8`
+ = help: the trait `~const Add<u8>` is not implemented for `i8`
= help: the following other types implement trait `Add<Rhs>`:
<&'a f32 as Add<f32>>
<&'a f64 as Add<f64>>
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
index 4fa017e04..b39607924 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
@@ -4,13 +4,13 @@ error[E0308]: mismatched types
LL | : [u32; (i8::MAX as i8 + 1u8) as usize]
| ^^^ expected `i8`, found `u8`
-error[E0277]: cannot add `u8` to `i8`
+error[E0277]: cannot add `u8` to `i8` in const contexts
--> $DIR/const-eval-overflow-4b.rs:9:28
|
LL | : [u32; (i8::MAX as i8 + 1u8) as usize]
| ^ no implementation for `i8 + u8`
|
- = help: the trait `Add<u8>` is not implemented for `i8`
+ = help: the trait `~const Add<u8>` is not implemented for `i8`
= help: the following other types implement trait `Add<Rhs>`:
<&'a f32 as Add<f32>>
<&'a f64 as Add<f64>>
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.rs b/src/test/ui/consts/const-eval/const-eval-overflow2.rs
index b11f7d698..1676f7c2a 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2.rs
@@ -5,63 +5,53 @@
// change this warn to a deny, then the compiler will exit before
// those errors are detected.
-#![deny(const_err)]
-
use std::fmt;
const VALS_I8: (i8,) =
(
i8::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I16: (i16,) =
(
i16::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I32: (i32,) =
(
i32::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I64: (i64,) =
(
i64::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U8: (u8,) =
(
u8::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U16: (u16,) = (
u16::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U32: (u32,) = (
u32::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U64: (u64,) =
(
u64::MIN - 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
fn main() {
foo(VALS_I8);
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
index dab9a76c7..341c15daf 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr
@@ -1,243 +1,51 @@
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:14:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:12:6
|
-LL | const VALS_I8: (i8,) =
- | --------------------
-LL | (
LL | i8::MIN - 1,
| ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:21:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:18:6
|
-LL | const VALS_I16: (i16,) =
- | ----------------------
-LL | (
LL | i16::MIN - 1,
| ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:28:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:24:6
|
-LL | const VALS_I32: (i32,) =
- | ----------------------
-LL | (
LL | i32::MIN - 1,
| ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:35:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:30:6
|
-LL | const VALS_I64: (i64,) =
- | ----------------------
-LL | (
LL | i64::MIN - 1,
| ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:42:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:36:6
|
-LL | const VALS_U8: (u8,) =
- | --------------------
-LL | (
LL | u8::MIN - 1,
| ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:48:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:41:6
|
-LL | const VALS_U16: (u16,) = (
- | ----------------------
LL | u16::MIN - 1,
| ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:54:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:46:6
|
-LL | const VALS_U32: (u32,) = (
- | ----------------------
LL | u32::MIN - 1,
| ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:61:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2.rs:52:6
|
-LL | const VALS_U64: (u64,) =
- | ----------------------
-LL | (
LL | u64::MIN - 1,
| ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 8 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:14:6
- |
-LL | const VALS_I8: (i8,) =
- | --------------------
-LL | (
-LL | i8::MIN - 1,
- | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:21:6
- |
-LL | const VALS_I16: (i16,) =
- | ----------------------
-LL | (
-LL | i16::MIN - 1,
- | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:28:6
- |
-LL | const VALS_I32: (i32,) =
- | ----------------------
-LL | (
-LL | i32::MIN - 1,
- | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:35:6
- |
-LL | const VALS_I64: (i64,) =
- | ----------------------
-LL | (
-LL | i64::MIN - 1,
- | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:42:6
- |
-LL | const VALS_U8: (u8,) =
- | --------------------
-LL | (
-LL | u8::MIN - 1,
- | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:48:6
- |
-LL | const VALS_U16: (u16,) = (
- | ----------------------
-LL | u16::MIN - 1,
- | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:54:6
- |
-LL | const VALS_U32: (u32,) = (
- | ----------------------
-LL | u32::MIN - 1,
- | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2.rs:61:6
- |
-LL | const VALS_U64: (u64,) =
- | ----------------------
-LL | (
-LL | u64::MIN - 1,
- | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.rs b/src/test/ui/consts/const-eval/const-eval-overflow2b.rs
index 9c3ad8ef9..59d1df568 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2b.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.rs
@@ -5,63 +5,53 @@
// change this warn to a deny, then the compiler will exit before
// those errors are detected.
-#![deny(const_err)]
-
use std::fmt;
const VALS_I8: (i8,) =
(
i8::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I16: (i16,) =
(
i16::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I32: (i32,) =
(
i32::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I64: (i64,) =
(
i64::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U8: (u8,) =
(
u8::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U16: (u16,) = (
u16::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U32: (u32,) = (
u32::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U64: (u64,) =
(
u64::MAX + 1,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
fn main() {
foo(VALS_I8);
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
index 5fe991743..e661836b4 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr
@@ -1,243 +1,51 @@
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:14:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:12:6
|
-LL | const VALS_I8: (i8,) =
- | --------------------
-LL | (
LL | i8::MAX + 1,
| ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:21:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:18:6
|
-LL | const VALS_I16: (i16,) =
- | ----------------------
-LL | (
LL | i16::MAX + 1,
| ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:28:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:24:6
|
-LL | const VALS_I32: (i32,) =
- | ----------------------
-LL | (
LL | i32::MAX + 1,
| ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:35:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:30:6
|
-LL | const VALS_I64: (i64,) =
- | ----------------------
-LL | (
LL | i64::MAX + 1,
| ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:42:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:36:6
|
-LL | const VALS_U8: (u8,) =
- | --------------------
-LL | (
LL | u8::MAX + 1,
| ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:48:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:41:6
|
-LL | const VALS_U16: (u16,) = (
- | ----------------------
LL | u16::MAX + 1,
| ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:54:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:46:6
|
-LL | const VALS_U32: (u32,) = (
- | ----------------------
LL | u32::MAX + 1,
| ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:61:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2b.rs:52:6
|
-LL | const VALS_U64: (u64,) =
- | ----------------------
-LL | (
LL | u64::MAX + 1,
| ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 8 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:14:6
- |
-LL | const VALS_I8: (i8,) =
- | --------------------
-LL | (
-LL | i8::MAX + 1,
- | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:21:6
- |
-LL | const VALS_I16: (i16,) =
- | ----------------------
-LL | (
-LL | i16::MAX + 1,
- | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:28:6
- |
-LL | const VALS_I32: (i32,) =
- | ----------------------
-LL | (
-LL | i32::MAX + 1,
- | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:35:6
- |
-LL | const VALS_I64: (i64,) =
- | ----------------------
-LL | (
-LL | i64::MAX + 1,
- | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:42:6
- |
-LL | const VALS_U8: (u8,) =
- | --------------------
-LL | (
-LL | u8::MAX + 1,
- | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:48:6
- |
-LL | const VALS_U16: (u16,) = (
- | ----------------------
-LL | u16::MAX + 1,
- | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:54:6
- |
-LL | const VALS_U32: (u32,) = (
- | ----------------------
-LL | u32::MAX + 1,
- | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2b.rs:61:6
- |
-LL | const VALS_U64: (u64,) =
- | ----------------------
-LL | (
-LL | u64::MAX + 1,
- | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2b.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.rs b/src/test/ui/consts/const-eval/const-eval-overflow2c.rs
index bac4d042e..33b892601 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2c.rs
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.rs
@@ -5,63 +5,53 @@
// change this warn to a deny, then the compiler will exit before
// those errors are detected.
-#![deny(const_err)]
-
use std::fmt;
const VALS_I8: (i8,) =
(
i8::MIN * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I16: (i16,) =
(
i16::MIN * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I32: (i32,) =
(
i32::MIN * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_I64: (i64,) =
(
i64::MIN * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U8: (u8,) =
(
u8::MAX * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U16: (u16,) = (
u16::MAX * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U32: (u32,) = (
u32::MAX * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
const VALS_U64: (u64,) =
(
u64::MAX * 2,
);
- //~^^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^^ ERROR evaluation of constant value failed
fn main() {
foo(VALS_I8);
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
index d5f3a0fb1..1fad15492 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr
@@ -1,243 +1,51 @@
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:14:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:12:6
|
-LL | const VALS_I8: (i8,) =
- | --------------------
-LL | (
LL | i8::MIN * 2,
| ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:21:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:18:6
|
-LL | const VALS_I16: (i16,) =
- | ----------------------
-LL | (
LL | i16::MIN * 2,
| ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:28:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:24:6
|
-LL | const VALS_I32: (i32,) =
- | ----------------------
-LL | (
LL | i32::MIN * 2,
| ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:35:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:30:6
|
-LL | const VALS_I64: (i64,) =
- | ----------------------
-LL | (
LL | i64::MIN * 2,
| ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:42:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:36:6
|
-LL | const VALS_U8: (u8,) =
- | --------------------
-LL | (
LL | u8::MAX * 2,
| ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:48:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:41:6
|
-LL | const VALS_U16: (u16,) = (
- | ----------------------
LL | u16::MAX * 2,
| ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:54:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:46:6
|
-LL | const VALS_U32: (u32,) = (
- | ----------------------
LL | u32::MAX * 2,
| ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:61:6
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-eval-overflow2c.rs:52:6
|
-LL | const VALS_U64: (u64,) =
- | ----------------------
-LL | (
LL | u64::MAX * 2,
| ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 8 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:14:6
- |
-LL | const VALS_I8: (i8,) =
- | --------------------
-LL | (
-LL | i8::MIN * 2,
- | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:21:6
- |
-LL | const VALS_I16: (i16,) =
- | ----------------------
-LL | (
-LL | i16::MIN * 2,
- | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:28:6
- |
-LL | const VALS_I32: (i32,) =
- | ----------------------
-LL | (
-LL | i32::MIN * 2,
- | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:35:6
- |
-LL | const VALS_I64: (i64,) =
- | ----------------------
-LL | (
-LL | i64::MIN * 2,
- | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:42:6
- |
-LL | const VALS_U8: (u8,) =
- | --------------------
-LL | (
-LL | u8::MAX * 2,
- | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:48:6
- |
-LL | const VALS_U16: (u16,) = (
- | ----------------------
-LL | u16::MAX * 2,
- | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:54:6
- |
-LL | const VALS_U32: (u32,) = (
- | ----------------------
-LL | u32::MAX * 2,
- | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-eval-overflow2c.rs:61:6
- |
-LL | const VALS_U64: (u64,) =
- | ----------------------
-LL | (
-LL | u64::MAX * 2,
- | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/const-eval-overflow2c.rs:8:9
- |
-LL | #![deny(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const-eval-query-stack.rs b/src/test/ui/consts/const-eval/const-eval-query-stack.rs
index c94604989..8f8a8cee3 100644
--- a/src/test/ui/consts/const-eval/const-eval-query-stack.rs
+++ b/src/test/ui/consts/const-eval/const-eval-query-stack.rs
@@ -1,5 +1,4 @@
-// compile-flags: -Ztreat-err-as-bug=2
-// build-fail
+// compile-flags: -Ztreat-err-as-bug=1
// failure-status: 101
// rustc-env:RUST_BACKTRACE=1
// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
@@ -15,14 +14,9 @@
#![allow(unconditional_panic)]
-#[warn(const_err)]
-const X: i32 = 1 / 0; //~WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+const X: i32 = 1 / 0; //~ERROR constant
fn main() {
let x: &'static i32 = &X;
- //~^ ERROR evaluation of constant value failed
- //~| ERROR erroneous constant used
- //~| WARNING this was previously accepted by the compiler
println!("x={}", x);
}
diff --git a/src/test/ui/consts/const-eval/const-eval-query-stack.stderr b/src/test/ui/consts/const-eval/const-eval-query-stack.stderr
index 0ae7bfa86..b97975c4c 100644
--- a/src/test/ui/consts/const-eval/const-eval-query-stack.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-query-stack.stderr
@@ -1,61 +1,13 @@
-warning: any use of this value will cause an error
- --> $DIR/const-eval-query-stack.rs:19:16
- |
-LL | const X: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
- |
-note: the lint level is defined here
- --> $DIR/const-eval-query-stack.rs:18:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
error[E0080]: evaluation of constant value failed
- --> $DIR/const-eval-query-stack.rs:23:28
+ --> $DIR/const-eval-query-stack.rs:17:16
|
-LL | let x: &'static i32 = &X;
- | ^ referenced constant has errors
-
-error: erroneous constant used
- --> $DIR/const-eval-query-stack.rs:23:27
- |
-LL | let x: &'static i32 = &X;
- | ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+LL | const X: i32 = 1 / 0;
+ | ^^^^^ attempt to divide `1_i32` by zero
query stack during panic:
-#0 [mir_drops_elaborated_and_const_checked] elaborating drops for `main`
-#1 [optimized_mir] optimizing MIR for `main`
-#2 [collect_and_partition_mono_items] collect_and_partition_mono_items
+#0 [eval_to_allocation_raw] const-evaluating + checking `X`
+#1 [eval_to_const_value_raw] simplifying constant for the type system `X`
+#2 [eval_to_const_value_raw] simplifying constant for the type system `X`
+#3 [lint_mod] linting top-level module
+#4 [analysis] running analysis passes on this crate
end of query stack
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const-eval-query-stack.rs:19:16
- |
-LL | const X: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
- |
-note: the lint level is defined here
- --> $DIR/const-eval-query-stack.rs:18:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/const-eval-query-stack.rs:23:27
- |
-LL | let x: &'static i32 = &X;
- | ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
index b7b00f7d7..bf98d0394 100644
--- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
+++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
@@ -1,674 +1,258 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/const-pointer-values-in-various-types.rs:26:49
|
LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
- | -------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:30:43
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:29:43
|
LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:34:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:32:45
|
LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:38:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:35:45
|
LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:42:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:38:45
|
LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const-pointer-values-in-various-types.rs:46:5
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:41:47
|
LL | const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 16, align: 8) {
- __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:49:43
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:45:43
|
LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:53:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:48:45
|
LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:57:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:51:45
|
LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:61:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:54:45
|
LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const-pointer-values-in-various-types.rs:65:5
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:57:47
|
LL | const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 16, align: 8) {
- __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:68:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:61:45
|
LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:72:45
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:64:45
|
LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:76:47
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:67:47
|
LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
- | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:80:47
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:70:47
|
LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
- | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:84:39
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:73:39
|
LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
- | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:88:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:76:41
|
LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:92:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:79:41
|
LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:96:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:82:41
|
LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:100:43
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:85:43
|
LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:104:39
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:88:39
|
LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
- | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:108:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:91:41
|
LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:112:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:94:41
|
LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:116:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:97:41
|
LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:120:43
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:100:43
|
LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:124:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:103:41
|
LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:128:41
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:106:41
|
LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:132:43
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:109:43
|
LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:136:43
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-pointer-values-in-various-types.rs:112:43
|
LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error: aborting due to 29 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:26:49
- |
-LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
- | -------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:30:43
- |
-LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:34:45
- |
-LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:38:45
- |
-LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:42:45
- |
-LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:49:43
- |
-LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:53:45
- |
-LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:57:45
- |
-LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:61:45
- |
-LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:68:45
- |
-LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:72:45
- |
-LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
- | ---------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:76:47
- |
-LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
- | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:80:47
- |
-LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
- | ------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:84:39
- |
-LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
- | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:88:41
- |
-LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:92:41
- |
-LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:96:41
- |
-LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:100:43
- |
-LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:104:39
- |
-LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
- | ---------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:108:41
- |
-LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:112:41
- |
-LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:116:41
- |
-LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:120:43
- |
-LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:124:41
- |
-LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:128:41
- |
-LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
- | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:132:43
- |
-LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-pointer-values-in-various-types.rs:136:43
- |
-LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
- | -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
index f10a67392..45eed9d84 100644
--- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
+++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.rs
@@ -24,116 +24,91 @@ union Nonsense {
fn main() {
const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
- //~^ ERROR it is undefined behavior to use this value
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
- //~^ ERROR it is undefined behavior to use this value
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
}
diff --git a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.rs b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.rs
index 804ebf660..b873940c4 100644
--- a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.rs
+++ b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.rs
@@ -1,8 +1,5 @@
-// build-fail
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
-
fn double(x: usize) -> usize {
x * 2
}
@@ -10,6 +7,8 @@ const X: fn(usize) -> usize = double;
const fn bar(x: fn(usize) -> usize, y: usize) -> usize {
x(y)
+ //~^ ERROR evaluation of constant value failed
+ //~| ERROR evaluation of constant value failed
}
const Y: usize = bar(X, 2); // FIXME: should fail to typeck someday
@@ -17,7 +16,5 @@ const Z: usize = bar(double, 2); // FIXME: should fail to typeck someday
fn main() {
assert_eq!(Y, 4);
- //~^ ERROR evaluation of constant value failed
assert_eq!(Z, 4);
- //~^ ERROR evaluation of constant value failed
}
diff --git a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr
index f6ffa1ef2..3784a3861 100644
--- a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr
+++ b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr
@@ -1,99 +1,35 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/const_fn_ptr_fail2.rs:19:16
- |
-LL | assert_eq!(Y, 4);
- | ^ referenced constant has errors
-
-error[E0080]: evaluation of constant value failed
- --> $DIR/const_fn_ptr_fail2.rs:21:16
- |
-LL | assert_eq!(Z, 4);
- | ^ referenced constant has errors
-
-warning: skipping const checks
- |
-help: skipping check that does not even have a feature gate
- --> $DIR/const_fn_ptr_fail2.rs:12:5
- |
-LL | x(y)
- | ^^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_fn_ptr_fail2.rs:12:5
+ --> $DIR/const_fn_ptr_fail2.rs:9:5
|
LL | x(y)
| ^^^^
| |
| calling non-const function `double`
- | inside `bar` at $DIR/const_fn_ptr_fail2.rs:12:5
- | inside `Y` at $DIR/const_fn_ptr_fail2.rs:15:18
+ | inside `bar` at $DIR/const_fn_ptr_fail2.rs:9:5
...
LL | const Y: usize = bar(X, 2); // FIXME: should fail to typeck someday
- | --------------
- |
-note: the lint level is defined here
- --> $DIR/const_fn_ptr_fail2.rs:4:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | --------- inside `Y` at $DIR/const_fn_ptr_fail2.rs:14:18
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_fn_ptr_fail2.rs:12:5
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_fn_ptr_fail2.rs:9:5
|
LL | x(y)
| ^^^^
| |
| calling non-const function `double`
- | inside `bar` at $DIR/const_fn_ptr_fail2.rs:12:5
- | inside `Z` at $DIR/const_fn_ptr_fail2.rs:16:18
+ | inside `bar` at $DIR/const_fn_ptr_fail2.rs:9:5
...
LL | const Z: usize = bar(double, 2); // FIXME: should fail to typeck someday
- | --------------
- |
-note: the lint level is defined here
- --> $DIR/const_fn_ptr_fail2.rs:4:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | -------------- inside `Z` at $DIR/const_fn_ptr_fail2.rs:15:18
-Future breakage diagnostic:
-warning: erroneous constant used
- --> $DIR/const_fn_ptr_fail2.rs:19:5
- |
-LL | assert_eq!(Y, 4);
- | ^^^^^^^^^^^^^^^^ referenced constant has errors
+warning: skipping const checks
|
-note: the lint level is defined here
- --> $DIR/const_fn_ptr_fail2.rs:4:10
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_fn_ptr_fail2.rs:9:5
|
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+LL | x(y)
+ | ^^^^
-Future breakage diagnostic:
-warning: erroneous constant used
- --> $DIR/const_fn_ptr_fail2.rs:21:5
- |
-LL | assert_eq!(Z, 4);
- | ^^^^^^^^^^^^^^^^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/const_fn_ptr_fail2.rs:4:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+error: aborting due to 2 previous errors; 1 warning emitted
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/const_let.rs b/src/test/ui/consts/const-eval/const_let.rs
index 18692dbce..1e2bcc55b 100644
--- a/src/test/ui/consts/const-eval/const_let.rs
+++ b/src/test/ui/consts/const-eval/const_let.rs
@@ -14,16 +14,16 @@ const X2: FakeNeedsDrop = { let x; x = FakeNeedsDrop; x };
// error
const Y: FakeNeedsDrop = { let mut x = FakeNeedsDrop; x = FakeNeedsDrop; x };
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
// error
const Y2: FakeNeedsDrop = { let mut x; x = FakeNeedsDrop; x = FakeNeedsDrop; x };
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
// error
const Z: () = { let mut x = None; x = Some(FakeNeedsDrop); };
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
// error
const Z2: () = { let mut x; x = None; x = Some(FakeNeedsDrop); };
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
diff --git a/src/test/ui/consts/const-eval/const_let.stderr b/src/test/ui/consts/const-eval/const_let.stderr
index 47f39b703..63442f557 100644
--- a/src/test/ui/consts/const-eval/const_let.stderr
+++ b/src/test/ui/consts/const-eval/const_let.stderr
@@ -1,34 +1,34 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `FakeNeedsDrop` cannot be evaluated at compile-time
--> $DIR/const_let.rs:16:32
|
LL | const Y: FakeNeedsDrop = { let mut x = FakeNeedsDrop; x = FakeNeedsDrop; x };
| ^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `FakeNeedsDrop` cannot be evaluated at compile-time
--> $DIR/const_let.rs:20:33
|
LL | const Y2: FakeNeedsDrop = { let mut x; x = FakeNeedsDrop; x = FakeNeedsDrop; x };
| ^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<FakeNeedsDrop>` cannot be evaluated at compile-time
--> $DIR/const_let.rs:24:21
|
LL | const Z: () = { let mut x = None; x = Some(FakeNeedsDrop); };
| ^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<FakeNeedsDrop>` cannot be evaluated at compile-time
--> $DIR/const_let.rs:28:22
|
LL | const Z2: () = { let mut x; x = None; x = Some(FakeNeedsDrop); };
| ^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
error: aborting due to 4 previous errors
diff --git a/src/test/ui/consts/const-eval/const_panic_stability.e2018.stderr b/src/test/ui/consts/const-eval/const_panic_stability.e2018.stderr
index f06dedc22..3553a18d3 100644
--- a/src/test/ui/consts/const-eval/const_panic_stability.e2018.stderr
+++ b/src/test/ui/consts/const-eval/const_panic_stability.e2018.stderr
@@ -4,9 +4,9 @@ warning: panic message is not a string literal
LL | panic!({ "foo" });
| ^^^^^^^^^
|
- = note: `#[warn(non_fmt_panics)]` on by default
= note: this usage of `panic!()` is deprecated; it will be a hard error in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
+ = note: `#[warn(non_fmt_panics)]` on by default
help: add a "{}" format string to `Display` the message
|
LL | panic!("{}", { "foo" });
diff --git a/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr b/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
index 168fa0ad0..12244450e 100644
--- a/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
+++ b/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr
@@ -10,16 +10,6 @@ note: the trait `PartialEq<_>` is implemented for `*const i32`, but that impleme
|
LL | const X: bool = unsafe { &1 as *const i32 == &2 as *const i32 };
| ^^
- = help: the following other types implement trait `PartialEq<Rhs>`:
- f32
- f64
- i128
- i16
- i32
- i64
- i8
- isize
- and 6 others
error[E0277]: can't compare `*const i32` with `_` in const contexts
--> $DIR/const_raw_ptr_ops.rs:6:44
@@ -33,16 +23,6 @@ note: the trait `PartialEq<_>` is implemented for `*const i32`, but that impleme
|
LL | const X2: bool = unsafe { 42 as *const i32 == 43 as *const i32 };
| ^^
- = help: the following other types implement trait `PartialEq<Rhs>`:
- f32
- f64
- i128
- i16
- i32
- i64
- i8
- isize
- and 6 others
error: aborting due to 2 previous errors
diff --git a/src/test/ui/consts/const-eval/erroneous-const.rs b/src/test/ui/consts/const-eval/erroneous-const.rs
index bee5a7cb3..cf11531ba 100644
--- a/src/test/ui/consts/const-eval/erroneous-const.rs
+++ b/src/test/ui/consts/const-eval/erroneous-const.rs
@@ -1,11 +1,9 @@
//! Make sure we error on erroneous consts even if they are unused.
-#![warn(const_err, unconditional_panic)]
+#![allow(unconditional_panic)]
struct PrintName<T>(T);
impl<T> PrintName<T> {
- const VOID: () = [()][2]; //~WARN any use of this value will cause an error
- //~^ WARN this operation will panic at runtime
- //~| WARN this was previously accepted by the compiler but is being phased out
+ const VOID: () = [()][2]; //~ERROR evaluation of `PrintName::<i32>::VOID` failed
}
const fn no_codegen<T>() {
diff --git a/src/test/ui/consts/const-eval/erroneous-const.stderr b/src/test/ui/consts/const-eval/erroneous-const.stderr
index adfb4cc61..33579135d 100644
--- a/src/test/ui/consts/const-eval/erroneous-const.stderr
+++ b/src/test/ui/consts/const-eval/erroneous-const.stderr
@@ -1,56 +1,21 @@
-warning: this operation will panic at runtime
+error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
--> $DIR/erroneous-const.rs:6:22
|
LL | const VOID: () = [()][2];
| ^^^^^^^ index out of bounds: the length is 1 but the index is 2
- |
-note: the lint level is defined here
- --> $DIR/erroneous-const.rs:2:20
- |
-LL | #![warn(const_err, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: any use of this value will cause an error
- --> $DIR/erroneous-const.rs:6:22
- |
-LL | const VOID: () = [()][2];
- | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
- |
-note: the lint level is defined here
- --> $DIR/erroneous-const.rs:2:9
- |
-LL | #![warn(const_err, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error[E0080]: could not evaluate static initializer
- --> $DIR/erroneous-const.rs:15:17
+ --> $DIR/erroneous-const.rs:13:17
|
LL | let _ = PrintName::<T>::VOID;
| ^^^^^^^^^^^^^^^^^^^^
| |
| referenced constant has errors
- | inside `no_codegen::<i32>` at $DIR/erroneous-const.rs:15:17
+ | inside `no_codegen::<i32>` at $DIR/erroneous-const.rs:13:17
...
LL | pub static FOO: () = no_codegen::<i32>();
- | ------------------- inside `FOO` at $DIR/erroneous-const.rs:19:22
+ | ------------------- inside `FOO` at $DIR/erroneous-const.rs:17:22
-error: aborting due to previous error; 2 warnings emitted
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/erroneous-const.rs:6:22
- |
-LL | const VOID: () = [()][2];
- | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
- |
-note: the lint level is defined here
- --> $DIR/erroneous-const.rs:2:9
- |
-LL | #![warn(const_err, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/erroneous-const2.rs b/src/test/ui/consts/const-eval/erroneous-const2.rs
index aa0f093bf..2fbf7be88 100644
--- a/src/test/ui/consts/const-eval/erroneous-const2.rs
+++ b/src/test/ui/consts/const-eval/erroneous-const2.rs
@@ -1,11 +1,9 @@
//! Make sure we error on erroneous consts even if they are unused.
-#![warn(const_err, unconditional_panic)]
+#![allow(unconditional_panic)]
struct PrintName<T>(T);
impl<T> PrintName<T> {
- const VOID: () = [()][2]; //~WARN any use of this value will cause an error
- //~^ WARN this operation will panic at runtime
- //~| WARN this was previously accepted by the compiler but is being phased out
+ const VOID: () = [()][2]; //~ERROR evaluation of `PrintName::<i32>::VOID` failed
}
pub static FOO: () = {
diff --git a/src/test/ui/consts/const-eval/erroneous-const2.stderr b/src/test/ui/consts/const-eval/erroneous-const2.stderr
index e947d93e4..630b1cf16 100644
--- a/src/test/ui/consts/const-eval/erroneous-const2.stderr
+++ b/src/test/ui/consts/const-eval/erroneous-const2.stderr
@@ -1,50 +1,15 @@
-warning: this operation will panic at runtime
+error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
--> $DIR/erroneous-const2.rs:6:22
|
LL | const VOID: () = [()][2];
| ^^^^^^^ index out of bounds: the length is 1 but the index is 2
- |
-note: the lint level is defined here
- --> $DIR/erroneous-const2.rs:2:20
- |
-LL | #![warn(const_err, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: any use of this value will cause an error
- --> $DIR/erroneous-const2.rs:6:22
- |
-LL | const VOID: () = [()][2];
- | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
- |
-note: the lint level is defined here
- --> $DIR/erroneous-const2.rs:2:9
- |
-LL | #![warn(const_err, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error[E0080]: could not evaluate static initializer
- --> $DIR/erroneous-const2.rs:15:17
+ --> $DIR/erroneous-const2.rs:13:17
|
LL | let _ = PrintName::<i32>::VOID;
| ^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-error: aborting due to previous error; 2 warnings emitted
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/erroneous-const2.rs:6:22
- |
-LL | const VOID: () = [()][2];
- | -------------- ^^^^^^^ index out of bounds: the length is 1 but the index is 2
- |
-note: the lint level is defined here
- --> $DIR/erroneous-const2.rs:2:9
- |
-LL | #![warn(const_err, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/format.rs b/src/test/ui/consts/const-eval/format.rs
index e43633da3..3eef0d6c3 100644
--- a/src/test/ui/consts/const-eval/format.rs
+++ b/src/test/ui/consts/const-eval/format.rs
@@ -3,8 +3,6 @@ const fn failure() {
//~^ ERROR cannot call non-const formatting macro in constant functions
//~| ERROR erroneous constant used
//~| ERROR erroneous constant used
- //~| WARN this was previously accepted by the compiler
- //~| WARN this was previously accepted by the compiler
}
const fn print() {
@@ -14,8 +12,6 @@ const fn print() {
//~| ERROR cannot call non-const fn `_print` in constant functions
//~| ERROR erroneous constant used
//~| ERROR erroneous constant used
- //~| WARN this was previously accepted by the compiler
- //~| WARN this was previously accepted by the compiler
}
fn main() {}
diff --git a/src/test/ui/consts/const-eval/format.stderr b/src/test/ui/consts/const-eval/format.stderr
index a476b0f58..64c769648 100644
--- a/src/test/ui/consts/const-eval/format.stderr
+++ b/src/test/ui/consts/const-eval/format.stderr
@@ -8,7 +8,7 @@ LL | panic!("{:?}", 0);
= 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:11:22
+ --> $DIR/format.rs:9:22
|
LL | println!("{:?}", 0);
| ^
@@ -17,7 +17,7 @@ LL | println!("{:?}", 0);
= 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:11:5
+ --> $DIR/format.rs:9:5
|
LL | println!("{:?}", 0);
| ^^^^^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL | println!("{:?}", 0);
= 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:11:5
+ --> $DIR/format.rs:9:5
|
LL | println!("{:?}", 0);
| ^^^^^^^^^^^^^^^^^^^
@@ -34,91 +34,35 @@ 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 `println` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: erroneous constant used
+error[E0080]: erroneous constant used
--> $DIR/format.rs:2:12
|
LL | panic!("{:?}", 0);
| ^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: erroneous constant used
+error[E0080]: erroneous constant used
--> $DIR/format.rs:2:20
|
LL | panic!("{:?}", 0);
| ^ referenced constant has errors
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= 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: erroneous constant used
- --> $DIR/format.rs:11:14
+error[E0080]: erroneous constant used
+ --> $DIR/format.rs:9:14
|
LL | println!("{:?}", 0);
| ^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: erroneous constant used
- --> $DIR/format.rs:11:22
+error[E0080]: erroneous constant used
+ --> $DIR/format.rs:9:22
|
LL | println!("{:?}", 0);
| ^ referenced constant has errors
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 8 previous errors
-For more information about this error, try `rustc --explain E0015`.
-Future incompatibility report: Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/format.rs:2:12
- |
-LL | panic!("{:?}", 0);
- | ^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/format.rs:2:20
- |
-LL | panic!("{:?}", 0);
- | ^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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)
-
-Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/format.rs:11:14
- |
-LL | println!("{:?}", 0);
- | ^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/format.rs:11:22
- |
-LL | println!("{:?}", 0);
- | ^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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)
-
+Some errors have detailed explanations: E0015, E0080.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr
index f1a780926..a0f4519ea 100644
--- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr
+++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.32bit.stderr
@@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/alloc_intrinsic_uninit.rs:8:1
|
LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) };
- | ^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected an integer
|
= 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: 4, align: 4) {
diff --git a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr
index 2eb401226..d2bffa425 100644
--- a/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr
+++ b/src/test/ui/consts/const-eval/heap/alloc_intrinsic_uninit.64bit.stderr
@@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/alloc_intrinsic_uninit.rs:8:1
|
LL | const BAR: &i32 = unsafe { &*(intrinsics::const_allocate(4, 4) as *mut i32) };
- | ^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized bytes, but expected initialized bytes
+ | ^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected an integer
|
= 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: 8, align: 8) {
diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs
index 8064cc493..bc2ea3f18 100644
--- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs
+++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs
@@ -1,21 +1,19 @@
// build-fail
// Regression test for #66975
-#![warn(const_err, unconditional_panic)]
+#![warn(unconditional_panic)]
#![feature(never_type)]
struct PrintName<T>(T);
impl<T> PrintName<T> {
const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
- //~^ WARN any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of `PrintName::<()>::VOID` failed
}
fn f<T>() {
let _ = PrintName::<T>::VOID;
- //~^ ERROR erroneous constant encountered
}
pub fn main() {
diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr
index da4a21e08..8bcd03005 100644
--- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr
+++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr
@@ -1,37 +1,15 @@
-warning: any use of this value will cause an error
+error[E0080]: evaluation of `PrintName::<()>::VOID` failed
--> $DIR/index-out-of-bounds-never-type.rs:10:61
|
LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
- | ------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
- |
-note: the lint level is defined here
- --> $DIR/index-out-of-bounds-never-type.rs:4:9
- |
-LL | #![warn(const_err, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^ index out of bounds: the length is 0 but the index is 0
-error: erroneous constant encountered
- --> $DIR/index-out-of-bounds-never-type.rs:17:13
+note: the above error was encountered while instantiating `fn f::<()>`
+ --> $DIR/index-out-of-bounds-never-type.rs:20:5
|
-LL | let _ = PrintName::<T>::VOID;
- | ^^^^^^^^^^^^^^^^^^^^
+LL | f::<()>();
+ | ^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/index-out-of-bounds-never-type.rs:10:61
- |
-LL | const VOID: ! = { let x = 0 * std::mem::size_of::<T>(); [][x] };
- | ------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
- |
-note: the lint level is defined here
- --> $DIR/index-out-of-bounds-never-type.rs:4:9
- |
-LL | #![warn(const_err, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/infinite_loop.rs b/src/test/ui/consts/const-eval/infinite_loop.rs
index 14a573ccf..4babc9a28 100644
--- a/src/test/ui/consts/const-eval/infinite_loop.rs
+++ b/src/test/ui/consts/const-eval/infinite_loop.rs
@@ -4,8 +4,8 @@ fn main() {
let _ = [(); {
let mut n = 113383; // #20 in https://oeis.org/A006884
while n != 0 {
- n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
//~^ ERROR evaluation of constant value failed
+ n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
}
n
}];
diff --git a/src/test/ui/consts/const-eval/infinite_loop.stderr b/src/test/ui/consts/const-eval/infinite_loop.stderr
index 3b5a0f22f..8b58cb279 100644
--- a/src/test/ui/consts/const-eval/infinite_loop.stderr
+++ b/src/test/ui/consts/const-eval/infinite_loop.stderr
@@ -1,8 +1,8 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/infinite_loop.rs:7:20
+ --> $DIR/infinite_loop.rs:6:15
|
-LL | n = if n % 2 == 0 { n/2 } else { 3*n + 1 };
- | ^^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
+LL | while n != 0 {
+ | ^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
error: aborting due to previous error
diff --git a/src/test/ui/consts/const-eval/issue-100878.rs b/src/test/ui/consts/const-eval/issue-100878.rs
new file mode 100644
index 000000000..353ce5050
--- /dev/null
+++ b/src/test/ui/consts/const-eval/issue-100878.rs
@@ -0,0 +1,8 @@
+// This checks that the const-eval ICE in issue #100878 does not recur.
+//
+// build-pass
+pub fn bitshift_data(data: [u8; 1]) -> u8 {
+ data[0] << 8
+}
+
+fn main() {}
diff --git a/src/test/ui/consts/const-eval/issue-43197.rs b/src/test/ui/consts/const-eval/issue-43197.rs
index e15f8771d..145463f0a 100644
--- a/src/test/ui/consts/const-eval/issue-43197.rs
+++ b/src/test/ui/consts/const-eval/issue-43197.rs
@@ -1,23 +1,11 @@
-// build-fail
-
-#![warn(const_err)]
-
const fn foo(x: u32) -> u32 {
x
}
fn main() {
const X: u32 = 0 - 1;
- //~^ WARN any use of this value will cause
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR constant
const Y: u32 = foo(0 - 1);
- //~^ WARN any use of this value will cause
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR constant
println!("{} {}", X, Y);
- //~^ ERROR evaluation of constant value failed
- //~| ERROR evaluation of constant value failed
- //~| WARN erroneous constant used [const_err]
- //~| WARN erroneous constant used [const_err]
- //~| WARN this was previously accepted by the compiler but is being phased out
- //~| WARN this was previously accepted by the compiler but is being phased out
}
diff --git a/src/test/ui/consts/const-eval/issue-43197.stderr b/src/test/ui/consts/const-eval/issue-43197.stderr
index 3f67c38f8..c59f13e48 100644
--- a/src/test/ui/consts/const-eval/issue-43197.stderr
+++ b/src/test/ui/consts/const-eval/issue-43197.stderr
@@ -1,120 +1,15 @@
-warning: any use of this value will cause an error
- --> $DIR/issue-43197.rs:10:20
- |
-LL | const X: u32 = 0 - 1;
- | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/issue-43197.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: any use of this value will cause an error
- --> $DIR/issue-43197.rs:13:24
- |
-LL | const Y: u32 = foo(0 - 1);
- | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
error[E0080]: evaluation of constant value failed
- --> $DIR/issue-43197.rs:16:23
- |
-LL | println!("{} {}", X, Y);
- | ^ referenced constant has errors
-
-warning: erroneous constant used
- --> $DIR/issue-43197.rs:16:23
- |
-LL | println!("{} {}", X, Y);
- | ^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning 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[E0080]: evaluation of constant value failed
- --> $DIR/issue-43197.rs:16:26
- |
-LL | println!("{} {}", X, Y);
- | ^ referenced constant has errors
-
-warning: erroneous constant used
- --> $DIR/issue-43197.rs:16:26
- |
-LL | println!("{} {}", X, Y);
- | ^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to 2 previous errors; 4 warnings emitted
-
-For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/issue-43197.rs:10:20
+ --> $DIR/issue-43197.rs:6:20
|
LL | const X: u32 = 0 - 1;
- | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/issue-43197.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/issue-43197.rs:13:24
+error[E0080]: evaluation of constant value failed
+ --> $DIR/issue-43197.rs:8:24
|
LL | const Y: u32 = foo(0 - 1);
- | ------------ ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/issue-43197.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
-Future breakage diagnostic:
-warning: erroneous constant used
- --> $DIR/issue-43197.rs:16:23
- |
-LL | println!("{} {}", X, Y);
- | ^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/issue-43197.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning 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)
-
-Future breakage diagnostic:
-warning: erroneous constant used
- --> $DIR/issue-43197.rs:16:26
- |
-LL | println!("{} {}", X, Y);
- | ^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/issue-43197.rs:3:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+error: aborting due to 2 previous errors
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/issue-44578.rs b/src/test/ui/consts/const-eval/issue-44578.rs
index a88e21970..2dbe1c2bd 100644
--- a/src/test/ui/consts/const-eval/issue-44578.rs
+++ b/src/test/ui/consts/const-eval/issue-44578.rs
@@ -1,7 +1,5 @@
// build-fail
-#![allow(const_err)]
-
trait Foo {
const AMT: usize;
}
@@ -12,7 +10,7 @@ enum Bar<A, B> {
}
impl<A: Foo, B: Foo> Foo for Bar<A, B> {
- const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
+ const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize]; //~ERROR evaluation of `<Bar<u16, u8> as Foo>::AMT` failed
}
impl Foo for u8 {
@@ -26,4 +24,5 @@ impl Foo for u16 {
fn main() {
println!("{}", <Bar<u16, u8> as Foo>::AMT);
//~^ ERROR evaluation of constant value failed
+ //~| ERROR erroneous constant used
}
diff --git a/src/test/ui/consts/const-eval/issue-44578.stderr b/src/test/ui/consts/const-eval/issue-44578.stderr
index 4c27ceea1..963381b58 100644
--- a/src/test/ui/consts/const-eval/issue-44578.stderr
+++ b/src/test/ui/consts/const-eval/issue-44578.stderr
@@ -1,40 +1,23 @@
+error[E0080]: evaluation of `<Bar<u16, u8> as Foo>::AMT` failed
+ --> $DIR/issue-44578.rs:13:24
+ |
+LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
+
error[E0080]: evaluation of constant value failed
- --> $DIR/issue-44578.rs:27:20
+ --> $DIR/issue-44578.rs:25:20
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/issue-44578.rs:15:24
- |
-LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
- | ---------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
- |
-note: the lint level is defined here
- --> $DIR/issue-44578.rs:3:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: erroneous constant used
- --> $DIR/issue-44578.rs:27:20
+error[E0080]: erroneous constant used
+ --> $DIR/issue-44578.rs:25:20
|
LL | println!("{}", <Bar<u16, u8> as Foo>::AMT);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
-note: the lint level is defined here
- --> $DIR/issue-44578.rs:3:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this warning 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: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 3 previous errors
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/issue-50814-2.rs b/src/test/ui/consts/const-eval/issue-50814-2.rs
index 15f4de0ae..49d1d8ff0 100644
--- a/src/test/ui/consts/const-eval/issue-50814-2.rs
+++ b/src/test/ui/consts/const-eval/issue-50814-2.rs
@@ -11,8 +11,7 @@ trait Foo<T> {
struct A<T>(T);
impl<T: C> Foo<T> for A<T> {
- const BAR: usize = [5, 6, 7][T::BOO]; //~ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ const BAR: usize = [5, 6, 7][T::BOO]; //~ ERROR evaluation of `<A<()> as Foo<()>>::BAR` failed
}
fn foo<T: C>() -> &'static usize {
diff --git a/src/test/ui/consts/const-eval/issue-50814-2.stderr b/src/test/ui/consts/const-eval/issue-50814-2.stderr
index cc19caca7..6604f2b9f 100644
--- a/src/test/ui/consts/const-eval/issue-50814-2.stderr
+++ b/src/test/ui/consts/const-eval/issue-50814-2.stderr
@@ -1,21 +1,17 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of `<A<()> as Foo<()>>::BAR` failed
--> $DIR/issue-50814-2.rs:14:24
|
LL | const BAR: usize = [5, 6, 7][T::BOO];
- | ---------------- ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
error[E0080]: evaluation of `foo::<()>` failed
- --> $DIR/issue-50814-2.rs:19:6
+ --> $DIR/issue-50814-2.rs:18:6
|
LL | &<A<T> as Foo<T>>::BAR
| ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
note: the above error was encountered while instantiating `fn foo::<()>`
- --> $DIR/issue-50814-2.rs:31:22
+ --> $DIR/issue-50814-2.rs:30:22
|
LL | println!("{:x}", foo::<()>() as *const usize as usize);
| ^^^^^^^^^^^
@@ -23,14 +19,3 @@ LL | println!("{:x}", foo::<()>() as *const usize as usize);
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/issue-50814-2.rs:14:24
- |
-LL | const BAR: usize = [5, 6, 7][T::BOO];
- | ---------------- ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/issue-50814.rs b/src/test/ui/consts/const-eval/issue-50814.rs
index 98229f919..5a587701f 100644
--- a/src/test/ui/consts/const-eval/issue-50814.rs
+++ b/src/test/ui/consts/const-eval/issue-50814.rs
@@ -13,8 +13,7 @@ struct Sum<A,B>(A,B);
impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A,B> {
const MAX: u8 = A::MAX + B::MAX;
- //~^ ERROR any use of this value will cause an error [const_err]
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
}
fn foo<T>(_: T) -> &'static u8 {
diff --git a/src/test/ui/consts/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr
index 6ceef91a0..46dd2b89f 100644
--- a/src/test/ui/consts/const-eval/issue-50814.stderr
+++ b/src/test/ui/consts/const-eval/issue-50814.stderr
@@ -1,21 +1,17 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
--> $DIR/issue-50814.rs:15:21
|
LL | const MAX: u8 = A::MAX + B::MAX;
- | ------------- ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
error[E0080]: evaluation of `foo::<i32>` failed
- --> $DIR/issue-50814.rs:21:6
+ --> $DIR/issue-50814.rs:20:6
|
LL | &Sum::<U8,U8>::MAX
| ^^^^^^^^^^^^^^^^^ referenced constant has errors
note: the above error was encountered while instantiating `fn foo::<i32>`
- --> $DIR/issue-50814.rs:26:5
+ --> $DIR/issue-50814.rs:25:5
|
LL | foo(0);
| ^^^^^^
@@ -23,14 +19,3 @@ LL | foo(0);
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/issue-50814.rs:15:21
- |
-LL | const MAX: u8 = A::MAX + B::MAX;
- | ------------- ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/issue-65394.rs b/src/test/ui/consts/const-eval/issue-65394.rs
index 2518e4ed4..e6639826c 100644
--- a/src/test/ui/consts/const-eval/issue-65394.rs
+++ b/src/test/ui/consts/const-eval/issue-65394.rs
@@ -4,7 +4,7 @@
// We will likely have to change this behavior before we allow `&mut` in a `const`.
const _: Vec<i32> = {
- let mut x = Vec::<i32>::new(); //~ ERROR destructors cannot be evaluated at compile-time
+ let mut x = Vec::<i32>::new(); //~ ERROR destructor of
let r = &mut x; //~ ERROR mutable references are not allowed in constants
let y = x;
y
diff --git a/src/test/ui/consts/const-eval/issue-65394.stderr b/src/test/ui/consts/const-eval/issue-65394.stderr
index ec229d7f5..ae6f0e937 100644
--- a/src/test/ui/consts/const-eval/issue-65394.stderr
+++ b/src/test/ui/consts/const-eval/issue-65394.stderr
@@ -7,11 +7,11 @@ LL | let r = &mut 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[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Vec<i32>` cannot be evaluated at compile-time
--> $DIR/issue-65394.rs:7:9
|
LL | let mut x = Vec::<i32>::new();
- | ^^^^^ constants cannot evaluate destructors
+ | ^^^^^ the destructor for this type cannot be evaluated in constants
...
LL | };
| - value is dropped here
diff --git a/src/test/ui/consts/const-eval/issue-91827-extern-types.rs b/src/test/ui/consts/const-eval/issue-91827-extern-types.rs
index e1f5e8ae1..43c99799f 100644
--- a/src/test/ui/consts/const-eval/issue-91827-extern-types.rs
+++ b/src/test/ui/consts/const-eval/issue-91827-extern-types.rs
@@ -3,7 +3,6 @@
// Test that we can handle unsized types with an extern type tail part.
// Regression test for issue #91827.
-#![feature(const_ptr_offset_from)]
#![feature(extern_types)]
use std::ptr::addr_of;
diff --git a/src/test/ui/consts/const-eval/livedrop.rs b/src/test/ui/consts/const-eval/livedrop.rs
index 66b7d0580..543f1f0ec 100644
--- a/src/test/ui/consts/const-eval/livedrop.rs
+++ b/src/test/ui/consts/const-eval/livedrop.rs
@@ -1,6 +1,6 @@
const _: Option<Vec<i32>> = {
let mut never_returned = Some(Vec::new());
- let mut always_returned = None; //~ ERROR destructors cannot be evaluated at compile-time
+ let mut always_returned = None; //~ ERROR destructor of
let mut i = 0;
loop {
diff --git a/src/test/ui/consts/const-eval/livedrop.stderr b/src/test/ui/consts/const-eval/livedrop.stderr
index 1e8b4230c..d04fdb70e 100644
--- a/src/test/ui/consts/const-eval/livedrop.stderr
+++ b/src/test/ui/consts/const-eval/livedrop.stderr
@@ -1,8 +1,8 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time
--> $DIR/livedrop.rs:3:9
|
LL | let mut always_returned = None;
- | ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
+ | ^^^^^^^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
...
LL | always_returned = never_returned;
| --------------- value is dropped here
diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs
index 80b0a1432..d2a840932 100644
--- a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs
+++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs
@@ -1,7 +1,6 @@
// build-fail
// Regression test for #66975
-#![warn(const_err)]
#![feature(never_type)]
struct PrintName;
diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr
index b26286411..4204d302b 100644
--- a/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr
+++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.stderr
@@ -1,13 +1,13 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/panic-assoc-never-type.rs:10:21
+ --> $DIR/panic-assoc-never-type.rs:9:21
|
LL | const VOID: ! = panic!();
- | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:10:21
+ | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/panic-assoc-never-type.rs:9:21
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0080]: erroneous constant used
- --> $DIR/panic-assoc-never-type.rs:15:13
+ --> $DIR/panic-assoc-never-type.rs:14:13
|
LL | let _ = PrintName::VOID;
| ^^^^^^^^^^^^^^^ referenced constant has errors
diff --git a/src/test/ui/consts/const-eval/panic-never-type.rs b/src/test/ui/consts/const-eval/panic-never-type.rs
index a74d3ba29..a9e9026d9 100644
--- a/src/test/ui/consts/const-eval/panic-never-type.rs
+++ b/src/test/ui/consts/const-eval/panic-never-type.rs
@@ -1,5 +1,4 @@
// Regression test for #66975
-#![warn(const_err)]
#![feature(never_type)]
const VOID: ! = panic!();
diff --git a/src/test/ui/consts/const-eval/panic-never-type.stderr b/src/test/ui/consts/const-eval/panic-never-type.stderr
index 9728aed07..6bff14a45 100644
--- a/src/test/ui/consts/const-eval/panic-never-type.stderr
+++ b/src/test/ui/consts/const-eval/panic-never-type.stderr
@@ -1,8 +1,8 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/panic-never-type.rs:5:17
+ --> $DIR/panic-never-type.rs:4:17
|
LL | const VOID: ! = panic!();
- | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/panic-never-type.rs:5:17
+ | ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/panic-never-type.rs:4:17
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/consts/const-eval/partial_ptr_overwrite.rs b/src/test/ui/consts/const-eval/partial_ptr_overwrite.rs
index 07bca7d64..d6c768868 100644
--- a/src/test/ui/consts/const-eval/partial_ptr_overwrite.rs
+++ b/src/test/ui/consts/const-eval/partial_ptr_overwrite.rs
@@ -5,9 +5,8 @@ const PARTIAL_OVERWRITE: () = {
let mut p = &42;
unsafe {
let ptr: *mut _ = &mut p;
- *(ptr as *mut u8) = 123; //~ ERROR any use of this value
+ *(ptr as *mut u8) = 123; //~ ERROR constant
//~| unable to overwrite parts of a pointer
- //~| WARN previously accepted
}
let x = *p;
};
diff --git a/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr
index 75e50a27b..13ca4379b 100644
--- a/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr
+++ b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr
@@ -1,33 +1,12 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/partial_ptr_overwrite.rs:8:9
|
-LL | const PARTIAL_OVERWRITE: () = {
- | ---------------------------
-...
LL | *(ptr as *mut u8) = 123;
| ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/partial_ptr_overwrite.rs:8:9
- |
-LL | const PARTIAL_OVERWRITE: () = {
- | ---------------------------
-...
-LL | *(ptr as *mut u8) = 123;
- | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
index 1fc7af637..656dd33e1 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs
@@ -1,5 +1,3 @@
-#![allow(const_err)]
-
#[repr(C)]
union Bar {
a: &'static u8,
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr b/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
index c6ca30e09..596fa090d 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail.stderr
@@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promoted_const_fn_fail.rs:19:27
+ --> $DIR/promoted_const_fn_fail.rs:17:27
|
LL | let x: &'static u8 = &(bar() + 1);
| ----------- ^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
index c53424664..5009dbcb9 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.rs
@@ -1,5 +1,3 @@
-#![deny(const_err)]
-
#[repr(C)]
union Bar {
a: &'static u8,
diff --git a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
index c6275a835..63dc43a41 100644
--- a/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
+++ b/src/test/ui/consts/const-eval/promoted_const_fn_fail_deny_const_err.stderr
@@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
- --> $DIR/promoted_const_fn_fail_deny_const_err.rs:20:27
+ --> $DIR/promoted_const_fn_fail_deny_const_err.rs:18:27
|
LL | let x: &'static u8 = &(bar() + 1);
| ----------- ^^^^^^^^^^^ creates a temporary which is freed while still in use
diff --git a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr
index cfca8ef07..2a254bfde 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr
+++ b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr
@@ -5,111 +5,40 @@ LL | 0 - 1
| ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:20
+ --> $DIR/promoted_errors.rs:11:9
|
-LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #![warn(arithmetic_overflow, unconditional_panic)]
+ | ^^^^^^^^^^^^^^^^^^^
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:21:5
+ --> $DIR/promoted_errors.rs:19:5
|
LL | 1 / 0
| ^^^^^ attempt to divide `1_i32` by zero
|
note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:41
+ --> $DIR/promoted_errors.rs:11:30
|
-LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #![warn(arithmetic_overflow, unconditional_panic)]
+ | ^^^^^^^^^^^^^^^^^^^
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:27:5
+ --> $DIR/promoted_errors.rs:23:5
|
LL | 1 / (1 - 1)
| ^^^^^^^^^^^ attempt to divide `1_i32` by zero
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:31:5
+ --> $DIR/promoted_errors.rs:27:5
|
LL | 1 / (false as i32)
| ^^^^^^^^^^^^^^^^^^ attempt to divide `1_i32` by zero
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:35:5
+ --> $DIR/promoted_errors.rs:31:5
|
LL | [1, 2, 3][4]
| ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:15:5
- |
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
-...
-LL | const X: () = {
- | -----------
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:43:28
- |
-LL | const X: () = {
- | -----------
-LL | let _x: &'static u32 = &overflow();
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: 7 warnings emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:15:5
- |
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
-...
-LL | const X: () = {
- | -----------
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:43:28
- |
-LL | const X: () = {
- | -----------
-LL | let _x: &'static u32 = &overflow();
- | ^^^^^^^^^^^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+warning: 5 warnings emitted
diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr
index 984484a85..2a254bfde 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr
+++ b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr
@@ -5,113 +5,40 @@ LL | 0 - 1
| ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:20
+ --> $DIR/promoted_errors.rs:11:9
|
-LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #![warn(arithmetic_overflow, unconditional_panic)]
+ | ^^^^^^^^^^^^^^^^^^^
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:21:5
+ --> $DIR/promoted_errors.rs:19:5
|
LL | 1 / 0
| ^^^^^ attempt to divide `1_i32` by zero
|
note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:41
+ --> $DIR/promoted_errors.rs:11:30
|
-LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #![warn(arithmetic_overflow, unconditional_panic)]
+ | ^^^^^^^^^^^^^^^^^^^
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:27:5
+ --> $DIR/promoted_errors.rs:23:5
|
LL | 1 / (1 - 1)
| ^^^^^^^^^^^ attempt to divide `1_i32` by zero
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:31:5
+ --> $DIR/promoted_errors.rs:27:5
|
LL | 1 / (false as i32)
| ^^^^^^^^^^^^^^^^^^ attempt to divide `1_i32` by zero
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:35:5
+ --> $DIR/promoted_errors.rs:31:5
|
LL | [1, 2, 3][4]
| ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:21:5
- |
-LL | 1 / 0
- | ^^^^^
- | |
- | attempt to divide `1_i32` by zero
- | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5
- | inside `X` at $DIR/promoted_errors.rs:46:29
-...
-LL | const X: () = {
- | -----------
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:46:28
- |
-LL | const X: () = {
- | -----------
-...
-LL | let _x: &'static i32 = &div_by_zero1();
- | ^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: 7 warnings emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:21:5
- |
-LL | 1 / 0
- | ^^^^^
- | |
- | attempt to divide `1_i32` by zero
- | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5
- | inside `X` at $DIR/promoted_errors.rs:46:29
-...
-LL | const X: () = {
- | -----------
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:46:28
- |
-LL | const X: () = {
- | -----------
-...
-LL | let _x: &'static i32 = &div_by_zero1();
- | ^^^^^^^^^^^^^^^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+warning: 5 warnings emitted
diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr
index cfca8ef07..2a254bfde 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr
+++ b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr
@@ -5,111 +5,40 @@ LL | 0 - 1
| ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
|
note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:20
+ --> $DIR/promoted_errors.rs:11:9
|
-LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #![warn(arithmetic_overflow, unconditional_panic)]
+ | ^^^^^^^^^^^^^^^^^^^
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:21:5
+ --> $DIR/promoted_errors.rs:19:5
|
LL | 1 / 0
| ^^^^^ attempt to divide `1_i32` by zero
|
note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:41
+ --> $DIR/promoted_errors.rs:11:30
|
-LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)]
- | ^^^^^^^^^^^^^^^^^^^
+LL | #![warn(arithmetic_overflow, unconditional_panic)]
+ | ^^^^^^^^^^^^^^^^^^^
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:27:5
+ --> $DIR/promoted_errors.rs:23:5
|
LL | 1 / (1 - 1)
| ^^^^^^^^^^^ attempt to divide `1_i32` by zero
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:31:5
+ --> $DIR/promoted_errors.rs:27:5
|
LL | 1 / (false as i32)
| ^^^^^^^^^^^^^^^^^^ attempt to divide `1_i32` by zero
warning: this operation will panic at runtime
- --> $DIR/promoted_errors.rs:35:5
+ --> $DIR/promoted_errors.rs:31:5
|
LL | [1, 2, 3][4]
| ^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 4
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:15:5
- |
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
-...
-LL | const X: () = {
- | -----------
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:43:28
- |
-LL | const X: () = {
- | -----------
-LL | let _x: &'static u32 = &overflow();
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: 7 warnings emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:15:5
- |
-LL | 0 - 1
- | ^^^^^
- | |
- | attempt to compute `0_u32 - 1_u32`, which would overflow
- | inside `overflow` at $DIR/promoted_errors.rs:15:5
- | inside `X` at $DIR/promoted_errors.rs:43:29
-...
-LL | const X: () = {
- | -----------
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/promoted_errors.rs:43:28
- |
-LL | const X: () = {
- | -----------
-LL | let _x: &'static u32 = &overflow();
- | ^^^^^^^^^^^ referenced constant has errors
- |
-note: the lint level is defined here
- --> $DIR/promoted_errors.rs:11:9
- |
-LL | #![warn(const_err, arithmetic_overflow, unconditional_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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+warning: 5 warnings emitted
diff --git a/src/test/ui/consts/const-eval/promoted_errors.rs b/src/test/ui/consts/const-eval/promoted_errors.rs
index eb891de33..2c42d0356 100644
--- a/src/test/ui/consts/const-eval/promoted_errors.rs
+++ b/src/test/ui/consts/const-eval/promoted_errors.rs
@@ -8,20 +8,16 @@
//! This test ensures that when we promote code that fails to evaluate, the build still succeeds.
-#![warn(const_err, arithmetic_overflow, unconditional_panic)]
+#![warn(arithmetic_overflow, unconditional_panic)]
// The only way to have promoteds that fail is in `const fn` called from `const`/`static`.
const fn overflow() -> u32 {
0 - 1
- //[opt_with_overflow_checks,noopt]~^ WARN any use of this value will cause an error
- //[opt_with_overflow_checks,noopt]~| WARN this was previously accepted by the compiler
- //~^^^ WARN this arithmetic operation will overflow
+ //~^ WARN this arithmetic operation will overflow
}
const fn div_by_zero1() -> i32 {
1 / 0
- //[opt]~^ WARN any use of this value will cause an error
- //[opt]~| WARN this was previously accepted by the compiler but is being phased out
- //~^^^ WARN this operation will panic at runtime
+ //~^ WARN this operation will panic at runtime
}
const fn div_by_zero2() -> i32 {
1 / (1 - 1)
@@ -36,21 +32,6 @@ const fn oob() -> i32 {
//~^ WARN this operation will panic at runtime
}
-// An unused constant containing failing promoteds.
-// This should work as long as `const_err` can be turned into just a warning;
-// once it turns into a hard error, just remove `X`.
-const X: () = {
- let _x: &'static u32 = &overflow();
- //[opt_with_overflow_checks,noopt]~^ WARN any use of this value will cause an error
- //[opt_with_overflow_checks,noopt]~| WARN this was previously accepted by the compiler
- let _x: &'static i32 = &div_by_zero1();
- //[opt]~^ WARN any use of this value will cause an error
- //[opt]~| WARN this was previously accepted by the compiler but is being phased out
- let _x: &'static i32 = &div_by_zero2();
- let _x: &'static i32 = &div_by_zero3();
- let _x: &'static i32 = &oob();
-};
-
const fn mk_false() -> bool { false }
// An actually used constant referencing failing promoteds in dead code.
diff --git a/src/test/ui/consts/const-eval/pub_const_err.rs b/src/test/ui/consts/const-eval/pub_const_err.rs
deleted file mode 100644
index 5faacd556..000000000
--- a/src/test/ui/consts/const-eval/pub_const_err.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// check-pass
-#![warn(const_err)]
-
-#![crate_type = "lib"]
-
-pub const Z: u32 = 0 - 1;
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
-
-pub type Foo = [i32; 0 - 1];
diff --git a/src/test/ui/consts/const-eval/pub_const_err.stderr b/src/test/ui/consts/const-eval/pub_const_err.stderr
deleted file mode 100644
index 36197a7ab..000000000
--- a/src/test/ui/consts/const-eval/pub_const_err.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-warning: any use of this value will cause an error
- --> $DIR/pub_const_err.rs:6:20
- |
-LL | pub const Z: u32 = 0 - 1;
- | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/pub_const_err.rs:2:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: 1 warning emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/pub_const_err.rs:6:20
- |
-LL | pub const Z: u32 = 0 - 1;
- | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/pub_const_err.rs:2:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/pub_const_err_bin.rs b/src/test/ui/consts/const-eval/pub_const_err_bin.rs
deleted file mode 100644
index 82eae2512..000000000
--- a/src/test/ui/consts/const-eval/pub_const_err_bin.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// check-pass
-#![warn(const_err)]
-
-pub const Z: u32 = 0 - 1;
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
-
-pub type Foo = [i32; 0 - 1];
-
-fn main() {}
diff --git a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr
deleted file mode 100644
index 2eef3b8f5..000000000
--- a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr
+++ /dev/null
@@ -1,31 +0,0 @@
-warning: any use of this value will cause an error
- --> $DIR/pub_const_err_bin.rs:4:20
- |
-LL | pub const Z: u32 = 0 - 1;
- | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/pub_const_err_bin.rs:2:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-warning: 1 warning emitted
-
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/pub_const_err_bin.rs:4:20
- |
-LL | pub const Z: u32 = 0 - 1;
- | ---------------- ^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow
- |
-note: the lint level is defined here
- --> $DIR/pub_const_err_bin.rs:2:9
- |
-LL | #![warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
index 30935e415..032ceb246 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr
@@ -1,12 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/ref_to_int_match.rs:25:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= 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
@@ -24,16 +21,4 @@ LL | 10..=BAR => {},
error: aborting due to 3 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ref_to_int_match.rs:25:27
- |
-LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
index 30935e415..032ceb246 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr
@@ -1,12 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/ref_to_int_match.rs:25:27
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= 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
@@ -24,16 +21,4 @@ LL | 10..=BAR => {},
error: aborting due to 3 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ref_to_int_match.rs:25:27
- |
-LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
- | -------------- ^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.rs b/src/test/ui/consts/const-eval/ref_to_int_match.rs
index 3f342d916..70c6e7d94 100644
--- a/src/test/ui/consts/const-eval/ref_to_int_match.rs
+++ b/src/test/ui/consts/const-eval/ref_to_int_match.rs
@@ -23,5 +23,4 @@ type Int = u64;
type Int = u32;
const BAR: Int = unsafe { Foo { r: &42 }.f };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR constant
diff --git a/src/test/ui/consts/const-eval/ub-enum-overwrite.rs b/src/test/ui/consts/const-eval/ub-enum-overwrite.rs
index c56778492..086a1001d 100644
--- a/src/test/ui/consts/const-eval/ub-enum-overwrite.rs
+++ b/src/test/ui/consts/const-eval/ub-enum-overwrite.rs
@@ -6,12 +6,13 @@ enum E {
}
const _: u8 = {
- //~^ ERROR is undefined behavior
let mut e = E::A(1);
let p = if let E::A(x) = &mut e { x as *mut u8 } else { unreachable!() };
// Make sure overwriting `e` uninitializes other bytes
e = E::B;
unsafe { *p }
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
};
fn main() {}
diff --git a/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr b/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr
index 8560112ae..5750212b4 100644
--- a/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr
+++ b/src/test/ui/consts/const-eval/ub-enum-overwrite.stderr
@@ -1,13 +1,8 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum-overwrite.rs:8:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum-overwrite.rs:13:14
|
-LL | const _: u8 = {
- | ^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- __ │ ░
- }
+LL | unsafe { *p }
+ | ^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to previous error
diff --git a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr
index ce3bc9474..93bc96e67 100644
--- a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:23:1
+ --> $DIR/ub-enum.rs:24:1
|
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000001, but expected a valid enum tag
@@ -9,31 +9,26 @@ LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
01 00 00 00 │ ....
}
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:26:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:27:1
|
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/ub-enum.rs:30:1
|
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:43:1
+ --> $DIR/ub-enum.rs:42:1
|
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000000, but expected a valid enum tag
@@ -43,52 +38,41 @@ LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
00 00 00 00 │ ....
}
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:45:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:44:1
|
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:49:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:47:1
|
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:59:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:56:42
|
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:63:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:61:1
|
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:81:1
+ --> $DIR/ub-enum.rs:78:1
|
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
@@ -99,7 +83,7 @@ LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:83:1
+ --> $DIR/ub-enum.rs:80:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
@@ -110,7 +94,7 @@ LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:91:1
+ --> $DIR/ub-enum.rs:88:1
|
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -121,13 +105,13 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-enum.rs:96:77
+ --> $DIR/ub-enum.rs:93:77
|
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-enum.rs:98:77
+ --> $DIR/ub-enum.rs:95:77
|
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
@@ -135,68 +119,3 @@ LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe {
error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:26:1
- |
-LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:30:1
- |
-LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:45:1
- |
-LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:49:1
- |
-LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:63:1
- |
-LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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/src/test/ui/consts/const-eval/ub-enum.64bit.stderr b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr
index d8fc20c98..280ba25a8 100644
--- a/src/test/ui/consts/const-eval/ub-enum.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:23:1
+ --> $DIR/ub-enum.rs:24:1
|
LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
@@ -9,31 +9,26 @@ LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
01 00 00 00 00 00 00 00 │ ........
}
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:26:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:27:1
|
LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/ub-enum.rs:30:1
|
LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:43:1
+ --> $DIR/ub-enum.rs:42:1
|
LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
@@ -43,52 +38,41 @@ LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
00 00 00 00 00 00 00 00 │ ........
}
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:45:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:44:1
|
LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:49:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:47:1
|
LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:59:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:56:42
|
LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 8, align: 8) {
- __ __ __ __ __ __ __ __ │ ░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:63:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-enum.rs:61:1
|
LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:81:1
+ --> $DIR/ub-enum.rs:78:1
|
LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(B)>.0: encountered a value of the never type `!`
@@ -99,7 +83,7 @@ LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:83:1
+ --> $DIR/ub-enum.rs:80:1
|
LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(D)>.0: encountered a value of uninhabited type Never
@@ -110,7 +94,7 @@ LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-enum.rs:91:1
+ --> $DIR/ub-enum.rs:88:1
|
LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -121,13 +105,13 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-enum.rs:96:77
+ --> $DIR/ub-enum.rs:93:77
|
LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-enum.rs:98:77
+ --> $DIR/ub-enum.rs:95:77
|
LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
| ^^^^^^^^^^^^^^^^^^^^ transmuting to uninhabited type
@@ -135,68 +119,3 @@ LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe {
error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:26:1
- |
-LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:30:1
- |
-LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:45:1
- |
-LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:49:1
- |
-LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-enum.rs:63:1
- |
-LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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/src/test/ui/consts/const-eval/ub-enum.rs b/src/test/ui/consts/const-eval/ub-enum.rs
index d8d2a499b..6935be2f9 100644
--- a/src/test/ui/consts/const-eval/ub-enum.rs
+++ b/src/test/ui/consts/const-eval/ub-enum.rs
@@ -1,5 +1,6 @@
// stderr-per-bitwidth
#![feature(never_type)]
+#![allow(invalid_value)]
use std::mem;
@@ -24,12 +25,10 @@ const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
//~^ ERROR is undefined behavior
const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
// # simple enum with discriminant 2
@@ -43,12 +42,10 @@ enum Enum2 {
const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
//~^ ERROR is undefined behavior
const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
// something wrapping the enum so that we test layout first, not enum
const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
// Undef enum discriminant.
#[repr(C)]
@@ -57,12 +54,12 @@ union MaybeUninit<T: Copy> {
init: T,
}
const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
-//~^ ERROR is undefined behavior
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
// Pointer value in an enum with a niche that is not just 0.
const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
// # valid discriminant for uninhabited variant
@@ -92,7 +89,7 @@ const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute
//~^ ERROR is undefined behavior
// All variants are uninhabited but also have data.
-// Use `0` as constant to make behavior endianess-independent.
+// Use `0` as constant to make behavior endianness-independent.
const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
//~^ ERROR evaluation of constant value failed
const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
diff --git a/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr b/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr
index 8eece9e30..edcde13b0 100644
--- a/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-int-array.32bit.stderr
@@ -1,35 +1,20 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:14:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-int-array.rs:15:9
|
-LL | const UNINIT_INT_0: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized bytes
- |
- = 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: 12, align: 4) {
- __ __ __ __ 01 00 00 00 02 00 00 00 │ ░░░░........
- }
+LL | MaybeUninit { uninit: () }.init,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:23:1
- |
-LL | const UNINIT_INT_1: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized bytes
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-int-array.rs:30:13
|
- = 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: 12, align: 4) {
- 00 00 00 00 01 __ 01 01 02 02 __ 02 │ .....░....░.
- }
+LL | MaybeUninit { uninit: () }.init,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:43:1
- |
-LL | const UNINIT_INT_2: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized bytes
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-int-array.rs:56:13
|
- = 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: 12, align: 4) {
- 00 00 00 00 01 01 01 01 02 02 02 __ │ ...........░
- }
+LL | MaybeUninit { uninit: () }.init,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to 3 previous errors
diff --git a/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr b/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr
index 8eece9e30..edcde13b0 100644
--- a/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-int-array.64bit.stderr
@@ -1,35 +1,20 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:14:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-int-array.rs:15:9
|
-LL | const UNINIT_INT_0: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized bytes
- |
- = 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: 12, align: 4) {
- __ __ __ __ 01 00 00 00 02 00 00 00 │ ░░░░........
- }
+LL | MaybeUninit { uninit: () }.init,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:23:1
- |
-LL | const UNINIT_INT_1: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized bytes
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-int-array.rs:30:13
|
- = 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: 12, align: 4) {
- 00 00 00 00 01 __ 01 01 02 02 __ 02 │ .....░....░.
- }
+LL | MaybeUninit { uninit: () }.init,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-int-array.rs:43:1
- |
-LL | const UNINIT_INT_2: [u32; 3] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized bytes
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-int-array.rs:56:13
|
- = 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: 12, align: 4) {
- 00 00 00 00 01 01 01 01 02 02 02 __ │ ...........░
- }
+LL | MaybeUninit { uninit: () }.init,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to 3 previous errors
diff --git a/src/test/ui/consts/const-eval/ub-int-array.rs b/src/test/ui/consts/const-eval/ub-int-array.rs
index 1221f71d1..a68d3fb17 100644
--- a/src/test/ui/consts/const-eval/ub-int-array.rs
+++ b/src/test/ui/consts/const-eval/ub-int-array.rs
@@ -1,4 +1,3 @@
-#![allow(const_err)] // make sure we cannot allow away the errors tested here
// stderr-per-bitwidth
//! Test the "array of int" fast path in validity checking, and in particular whether it
//! points at the right array element.
@@ -12,17 +11,15 @@ union MaybeUninit<T: Copy> {
}
const UNINIT_INT_0: [u32; 3] = unsafe {
-//~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value at [0]: encountered uninitialized bytes
[
MaybeUninit { uninit: () }.init,
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
1,
2,
]
};
const UNINIT_INT_1: [u32; 3] = unsafe {
-//~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value at [1]: encountered uninitialized bytes
mem::transmute(
[
0u8,
@@ -31,6 +28,8 @@ const UNINIT_INT_1: [u32; 3] = unsafe {
0u8,
1u8,
MaybeUninit { uninit: () }.init,
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
1u8,
1u8,
2u8,
@@ -41,8 +40,6 @@ const UNINIT_INT_1: [u32; 3] = unsafe {
)
};
const UNINIT_INT_2: [u32; 3] = unsafe {
-//~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value at [2]: encountered uninitialized bytes
mem::transmute(
[
0u8,
@@ -57,6 +54,8 @@ const UNINIT_INT_2: [u32; 3] = unsafe {
2u8,
2u8,
MaybeUninit { uninit: () }.init,
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
]
)
};
diff --git a/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr b/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr
index d450a814c..dbd05b8f4 100644
--- a/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-nonnull.32bit.stderr
@@ -10,13 +10,13 @@ LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-nonnull.rs:19:30
+ --> $DIR/ub-nonnull.rs:18:30
|
LL | let out_of_bounds_ptr = &ptr[255];
| ^^^^^^^^ dereferencing pointer failed: alloc11 has size 1, so pointer to 256 bytes starting at offset 0 is out-of-bounds
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-nonnull.rs:23:1
+ --> $DIR/ub-nonnull.rs:22:1
|
LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -27,7 +27,7 @@ LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-nonnull.rs:25:1
+ --> $DIR/ub-nonnull.rs:24:1
|
LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -37,16 +37,11 @@ LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
00 00 00 00 │ ....
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-nonnull.rs:33:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-nonnull.rs:32:36
|
LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- __ │ ░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:41:1
diff --git a/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr b/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr
index ed0d91aab..5a1ac09bd 100644
--- a/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-nonnull.64bit.stderr
@@ -10,13 +10,13 @@ LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-nonnull.rs:19:30
+ --> $DIR/ub-nonnull.rs:18:30
|
LL | let out_of_bounds_ptr = &ptr[255];
| ^^^^^^^^ dereferencing pointer failed: alloc11 has size 1, so pointer to 256 bytes starting at offset 0 is out-of-bounds
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-nonnull.rs:23:1
+ --> $DIR/ub-nonnull.rs:22:1
|
LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -27,7 +27,7 @@ LL | const NULL_U8: NonZeroU8 = unsafe { mem::transmute(0u8) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-nonnull.rs:25:1
+ --> $DIR/ub-nonnull.rs:24:1
|
LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -37,16 +37,11 @@ LL | const NULL_USIZE: NonZeroUsize = unsafe { mem::transmute(0usize) };
00 00 00 00 00 00 00 00 │ ........
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-nonnull.rs:33:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-nonnull.rs:32:36
|
LL | const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered uninitialized bytes, but expected initialized bytes
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- __ │ ░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:41:1
diff --git a/src/test/ui/consts/const-eval/ub-nonnull.rs b/src/test/ui/consts/const-eval/ub-nonnull.rs
index 259707b80..d22a99cd0 100644
--- a/src/test/ui/consts/const-eval/ub-nonnull.rs
+++ b/src/test/ui/consts/const-eval/ub-nonnull.rs
@@ -1,6 +1,6 @@
// stderr-per-bitwidth
#![feature(rustc_attrs)]
-#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here
+#![allow(invalid_value)] // make sure we cannot allow away the errors tested here
use std::mem;
use std::ptr::NonNull;
@@ -12,7 +12,6 @@ const NON_NULL_PTR: NonNull<u8> = unsafe { mem::transmute(&1) };
const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
//~^ ERROR it is undefined behavior to use this value
-#[deny(const_err)] // this triggers a `const_err` so validation does not even happen
const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
// Use address-of-element for pointer arithmetic. This could wrap around to null!
@@ -31,7 +30,8 @@ union MaybeUninit<T: Copy> {
init: T,
}
const UNINIT: NonZeroU8 = unsafe { MaybeUninit { uninit: () }.init };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
// Also test other uses of rustc_layout_scalar_valid_range_start
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
index e86b37929..6f5c028cb 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr
@@ -42,60 +42,47 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
00 00 00 00 │ ....
}
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/ub-ref-ptr.rs:31:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:39
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:34:39
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:38
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:34:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:86
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:38:86
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:85
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:38:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:47:1
+ --> $DIR/ub-ref-ptr.rs:42:1
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
@@ -106,7 +93,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:50:1
+ --> $DIR/ub-ref-ptr.rs:45:1
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
@@ -116,19 +103,14 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
39 05 00 00 │ 9...
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:53:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:48:41
|
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:56:1
+ --> $DIR/ub-ref-ptr.rs:52:1
|
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
@@ -138,19 +120,14 @@ LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
00 00 00 00 │ ....
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:58:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:54:38
|
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value
- |
- = 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: 4, align: 4) {
- __ __ __ __ │ ░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:60:1
+ --> $DIR/ub-ref-ptr.rs:57:1
|
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
@@ -161,7 +138,7 @@ LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:62:1
+ --> $DIR/ub-ref-ptr.rs:59:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc41, but expected a function pointer
@@ -174,64 +151,3 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
error: aborting due to 16 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:31:1
- |
-LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:39
- |
-LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:38
- |
-LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:86
- |
-LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:85
- |
-LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
index eeec2dc4b..5ffb710d4 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr
@@ -42,60 +42,47 @@ LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
00 00 00 00 00 00 00 00 │ ........
}
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/ub-ref-ptr.rs:31:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:39
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:34:39
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:38
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:34:38
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:86
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:38:86
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:85
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:38:85
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:47:1
+ --> $DIR/ub-ref-ptr.rs:42:1
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x539 is unallocated)
@@ -106,7 +93,7 @@ LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:50:1
+ --> $DIR/ub-ref-ptr.rs:45:1
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (address 0x539 is unallocated)
@@ -116,19 +103,14 @@ LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
39 05 00 00 00 00 00 00 │ 9.......
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:53:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:48:41
|
LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
- |
- = 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: 8, align: 8) {
- __ __ __ __ __ __ __ __ │ ░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:56:1
+ --> $DIR/ub-ref-ptr.rs:52:1
|
LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
@@ -138,19 +120,14 @@ LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
00 00 00 00 00 00 00 00 │ ........
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:58:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-ref-ptr.rs:54:38
|
LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value
- |
- = 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: 8, align: 8) {
- __ __ __ __ __ __ __ __ │ ░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:60:1
+ --> $DIR/ub-ref-ptr.rs:57:1
|
LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
@@ -161,7 +138,7 @@ LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-ref-ptr.rs:62:1
+ --> $DIR/ub-ref-ptr.rs:59:1
|
LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered alloc41, but expected a function pointer
@@ -174,64 +151,3 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
error: aborting due to 16 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:31:1
- |
-LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:39
- |
-LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:35:38
- |
-LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
- | ---------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:86
- |
-LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-ref-ptr.rs:41:85
- |
-LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
- | ------------------------------------------ ^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.rs b/src/test/ui/consts/const-eval/ub-ref-ptr.rs
index d0216f746..92049d4c1 100644
--- a/src/test/ui/consts/const-eval/ub-ref-ptr.rs
+++ b/src/test/ui/consts/const-eval/ub-ref-ptr.rs
@@ -29,20 +29,15 @@ const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
// but that would fail to compile; so we ended up breaking user code that would
// have worked fine had we not promoted.
const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
-//~| ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
+//~| ERROR evaluation of constant value failed
const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
-//~| ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
+//~| ERROR evaluation of constant value failed
const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
//~^ ERROR it is undefined behavior to use this value
@@ -51,12 +46,14 @@ const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
//~^ ERROR it is undefined behavior to use this value
const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
//~^ ERROR it is undefined behavior to use this value
const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
//~^ ERROR it is undefined behavior to use this value
const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
diff --git a/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr b/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr
index 7f0feb130..7d3232257 100644
--- a/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-uninhabit.32bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:15:1
+ --> $DIR/ub-uninhabit.rs:14:1
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar
@@ -8,7 +8,7 @@ LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
= note: the raw bytes of the constant (size: 0, align: 1) {}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:18:1
+ --> $DIR/ub-uninhabit.rs:17:1
|
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
@@ -19,7 +19,7 @@ LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:21:1
+ --> $DIR/ub-uninhabit.rs:20:1
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar
diff --git a/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr b/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr
index 4dcbbc2f5..2b7659f5d 100644
--- a/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:15:1
+ --> $DIR/ub-uninhabit.rs:14:1
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type Bar
@@ -8,7 +8,7 @@ LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
= note: the raw bytes of the constant (size: 0, align: 1) {}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:18:1
+ --> $DIR/ub-uninhabit.rs:17:1
|
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
@@ -19,7 +19,7 @@ LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-uninhabit.rs:21:1
+ --> $DIR/ub-uninhabit.rs:20:1
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type Bar
diff --git a/src/test/ui/consts/const-eval/ub-uninhabit.rs b/src/test/ui/consts/const-eval/ub-uninhabit.rs
index 33fbd14c4..213f15b79 100644
--- a/src/test/ui/consts/const-eval/ub-uninhabit.rs
+++ b/src/test/ui/consts/const-eval/ub-uninhabit.rs
@@ -1,5 +1,4 @@
// stderr-per-bitwidth
-#![allow(const_err)] // make sure we cannot allow away the errors tested here
use std::mem;
diff --git a/src/test/ui/consts/const-eval/ub-upvars.rs b/src/test/ui/consts/const-eval/ub-upvars.rs
index 57dd7b9e5..ceac59870 100644
--- a/src/test/ui/consts/const-eval/ub-upvars.rs
+++ b/src/test/ui/consts/const-eval/ub-upvars.rs
@@ -1,5 +1,5 @@
// stderr-per-bitwidth
-#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here
+#![allow(invalid_value)] // make sure we cannot allow away the errors tested here
use std::mem;
diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr
index c4f0e3ab4..c8b46608d 100644
--- a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:37:1
+ --> $DIR/ub-wide-ptr.rs:36:1
|
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -10,7 +10,7 @@ LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:39:1
+ --> $DIR/ub-wide-ptr.rs:38:1
|
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -20,31 +20,26 @@ LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, us
╾─allocN─╼ ff ff ff ff │ ╾──╼....
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:42:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:41:1
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:46:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:44:1
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:49:1
+ --> $DIR/ub-wide-ptr.rs:46:1
|
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -55,7 +50,7 @@ LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize:
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:53:1
+ --> $DIR/ub-wide-ptr.rs:50:1
|
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
@@ -66,7 +61,7 @@ LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:56:1
+ --> $DIR/ub-wide-ptr.rs:53:1
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
@@ -76,19 +71,14 @@ LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUni
╾─allocN─╼ 01 00 00 00 │ ╾──╼....
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:63:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:60:1
|
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference
- |
- = 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: 8, align: 4) {
- 2a 00 00 00 __ __ __ __ │ *...░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:69:1
+ --> $DIR/ub-wide-ptr.rs:67:1
|
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -99,7 +89,7 @@ LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:72:1
+ --> $DIR/ub-wide-ptr.rs:70:1
|
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -109,19 +99,17 @@ LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, is
╾─allocN─╼ ff ff ff 7f │ ╾──╼....
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:75:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:73:1
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:79:1
+ --> $DIR/ub-wide-ptr.rs:76:1
|
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
@@ -131,19 +119,17 @@ LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999us
╾─allocN─╼ e7 03 00 00 │ ╾──╼....
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:82:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:79:1
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:87:1
+ --> $DIR/ub-wide-ptr.rs:83:1
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
@@ -153,17 +139,14 @@ LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
╾─allocN─╼ │ ╾──╼
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:87:40
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:83:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:95:1
+ --> $DIR/ub-wide-ptr.rs:90:1
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
@@ -173,17 +156,14 @@ LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3
╾allocN─╼ │ ╾──╼
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:95:42
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:90:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:100:1
+ --> $DIR/ub-wide-ptr.rs:94:1
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
@@ -193,28 +173,20 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran
╾allocN─╼ │ ╾──╼
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:100:42
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:94:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:109:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:102:1
|
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
- |
- = 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: 8, align: 4) {
- 2a 00 00 00 __ __ __ __ │ *...░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:117:1
+ --> $DIR/ub-wide-ptr.rs:111:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
@@ -225,7 +197,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:121:1
+ --> $DIR/ub-wide-ptr.rs:115:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
@@ -236,7 +208,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:125:1
+ --> $DIR/ub-wide-ptr.rs:119:1
|
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
@@ -247,25 +219,25 @@ LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:128:57
+ --> $DIR/ub-wide-ptr.rs:122:57
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:131:57
+ --> $DIR/ub-wide-ptr.rs:125:57
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:134:56
+ --> $DIR/ub-wide-ptr.rs:128:56
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:137:1
+ --> $DIR/ub-wide-ptr.rs:131:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
@@ -276,7 +248,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::trans
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:142:1
+ --> $DIR/ub-wide-ptr.rs:136:1
|
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
@@ -286,26 +258,36 @@ LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_,
╾allocN─╼ ╾allocN─╼ │ ╾──╼╾──╼
}
-error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:147:62
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/ub-wide-ptr.rs:141:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
+ |
+ = 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: 8, align: 4) {
+ ╾allocN─╼ 00 00 00 00 │ ╾──╼....
+ }
-error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:150:65
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/ub-wide-ptr.rs:143:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
+ |
+ = 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: 8, align: 4) {
+ ╾allocN─╼ ╾allocN─╼ │ ╾──╼╾──╼
+ }
error[E0080]: could not evaluate static initializer
- --> $DIR/ub-wide-ptr.rs:157:5
+ --> $DIR/ub-wide-ptr.rs:149:5
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
error[E0080]: could not evaluate static initializer
- --> $DIR/ub-wide-ptr.rs:161:5
+ --> $DIR/ub-wide-ptr.rs:153:5
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
@@ -313,88 +295,3 @@ LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
error: aborting due to 32 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:42:1
- |
-LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:46:1
- |
-LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:75:1
- |
-LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:82:1
- |
-LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:87:40
- |
-LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:95:42
- |
-LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:100:42
- |
-LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
index d6c612bb4..70574d2dc 100644
--- a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
+++ b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:37:1
+ --> $DIR/ub-wide-ptr.rs:36:1
|
LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -10,7 +10,7 @@ LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:39:1
+ --> $DIR/ub-wide-ptr.rs:38:1
|
LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -20,31 +20,26 @@ LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, us
╾───────allocN───────╼ ff ff ff ff ff ff ff ff │ ╾──────╼........
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:42:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:41:1
|
LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:46:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:44:1
|
LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:49:1
+ --> $DIR/ub-wide-ptr.rs:46:1
|
LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -55,7 +50,7 @@ LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize:
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:53:1
+ --> $DIR/ub-wide-ptr.rs:50:1
|
LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized data in `str`
@@ -66,7 +61,7 @@ LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit:
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:56:1
+ --> $DIR/ub-wide-ptr.rs:53:1
|
LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized data in `str`
@@ -76,19 +71,14 @@ LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUni
╾───────allocN───────╼ 01 00 00 00 00 00 00 00 │ ╾──────╼........
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:63:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:60:1
|
LL | const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized reference
- |
- = 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: 16, align: 8) {
- __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:69:1
+ --> $DIR/ub-wide-ptr.rs:67:1
|
LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -99,7 +89,7 @@ LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:72:1
+ --> $DIR/ub-wide-ptr.rs:70:1
|
LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -109,19 +99,17 @@ LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, is
╾───────allocN───────╼ ff ff ff ff ff ff ff 7f │ ╾──────╼........
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:75:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:73:1
|
LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:79:1
+ --> $DIR/ub-wide-ptr.rs:76:1
|
LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
@@ -131,19 +119,17 @@ LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999us
╾───────allocN───────╼ e7 03 00 00 00 00 00 00 │ ╾──────╼........
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:82:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:79:1
|
LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:87:1
+ --> $DIR/ub-wide-ptr.rs:83:1
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
@@ -153,17 +139,14 @@ LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
╾───────allocN───────╼ │ ╾──────╼
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:87:40
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:83:40
|
LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:95:1
+ --> $DIR/ub-wide-ptr.rs:90:1
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
@@ -173,17 +156,14 @@ LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3
╾──────allocN───────╼ │ ╾──────╼
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:95:42
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:90:42
|
LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:100:1
+ --> $DIR/ub-wide-ptr.rs:94:1
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
@@ -193,28 +173,20 @@ LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::tran
╾──────allocN───────╼ │ ╾──────╼
}
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:100:42
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:94:42
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:109:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ub-wide-ptr.rs:102:1
|
LL | const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized raw pointer
- |
- = 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: 16, align: 8) {
- __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ │ ░░░░░░░░░░░░░░░░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:117:1
+ --> $DIR/ub-wide-ptr.rs:111:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
@@ -225,7 +197,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:121:1
+ --> $DIR/ub-wide-ptr.rs:115:1
|
LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
@@ -236,7 +208,7 @@ LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:125:1
+ --> $DIR/ub-wide-ptr.rs:119:1
|
LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
@@ -247,25 +219,25 @@ LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u
}
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:128:57
+ --> $DIR/ub-wide-ptr.rs:122:57
|
LL | const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:131:57
+ --> $DIR/ub-wide-ptr.rs:125:57
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:134:56
+ --> $DIR/ub-wide-ptr.rs:128:56
|
LL | const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:137:1
+ --> $DIR/ub-wide-ptr.rs:131:1
|
LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered allocN, but expected a vtable pointer
@@ -276,7 +248,7 @@ LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::trans
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/ub-wide-ptr.rs:142:1
+ --> $DIR/ub-wide-ptr.rs:136:1
|
LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
@@ -286,26 +258,36 @@ LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_,
╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
}
-error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:147:62
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/ub-wide-ptr.rs:141:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
+ |
+ = 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: 16, align: 8) {
+ ╾──────allocN───────╼ 00 00 00 00 00 00 00 00 │ ╾──────╼........
+ }
-error[E0080]: evaluation of constant value failed
- --> $DIR/ub-wide-ptr.rs:150:65
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/ub-wide-ptr.rs:143:1
|
LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered allocN, but expected a vtable pointer
+ |
+ = 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: 16, align: 8) {
+ ╾──────allocN───────╼ ╾──────allocN───────╼ │ ╾──────╼╾──────╼
+ }
error[E0080]: could not evaluate static initializer
- --> $DIR/ub-wide-ptr.rs:157:5
+ --> $DIR/ub-wide-ptr.rs:149:5
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ out-of-bounds pointer use: null pointer is a dangling pointer (it has no provenance)
error[E0080]: could not evaluate static initializer
- --> $DIR/ub-wide-ptr.rs:161:5
+ --> $DIR/ub-wide-ptr.rs:153:5
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using allocN as vtable pointer but it does not point to a vtable
@@ -313,88 +295,3 @@ LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
error: aborting due to 32 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:42:1
- |
-LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:46:1
- |
-LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:75:1
- |
-LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:82:1
- |
-LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:87:40
- |
-LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
- | ------------------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:95:42
- |
-LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ub-wide-ptr.rs:100:42
- |
-LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
- | -------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.rs b/src/test/ui/consts/const-eval/ub-wide-ptr.rs
index a0377ab1e..65f6f0235 100644
--- a/src/test/ui/consts/const-eval/ub-wide-ptr.rs
+++ b/src/test/ui/consts/const-eval/ub-wide-ptr.rs
@@ -9,8 +9,7 @@ use std::mem;
// normalize-stderr-test "size \d+" -> "size N"
/// A newtype wrapper to prevent MIR generation from inserting reborrows that would affect the error
-/// message. Use this whenever the message is "any use of this value will cause an error" instead of
-/// "it is undefined behavior to use this value".
+/// message.
#[repr(transparent)]
struct W<T>(T);
@@ -40,12 +39,10 @@ const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::
//~^ ERROR it is undefined behavior to use this value
// bad str
const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
// bad str in user-defined unsized type
const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
//~^ ERROR it is undefined behavior to use this value
@@ -61,7 +58,8 @@ const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::
const SLICE_VALID: &[u8] = unsafe { mem::transmute((&42u8, 1usize)) };
// bad slice: length uninit
const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
let uninit_len = MaybeUninit::<usize> { uninit: () };
mem::transmute((42, uninit_len))
};
@@ -73,41 +71,37 @@ const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::
//~^ ERROR it is undefined behavior to use this value
// bad slice: length not an int
const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
// bad slice box: length too big
const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
//~^ ERROR it is undefined behavior to use this value
// bad slice box: length not an int
const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) };
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
// bad data *inside* the slice
const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
//~^ ERROR it is undefined behavior to use this value
-//~| ERROR any use of this value will cause an error
-//~| WARNING this was previously accepted
+//~| ERROR evaluation of constant value failed
// good MySliceBool
const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]);
// bad: sized field is not okay
const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
//~^ ERROR it is undefined behavior to use this value
-//~| ERROR any use of this value will cause an error
-//~| WARNING this was previously accepted
+//~| ERROR evaluation of constant value failed
// bad: unsized part is not okay
const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
//~^ ERROR it is undefined behavior to use this value
-//~| ERROR any use of this value will cause an error
-//~| WARNING this was previously accepted
+//~| ERROR evaluation of constant value failed
// # raw slice
const RAW_SLICE_VALID: *const [u8] = unsafe { mem::transmute((&42u8, 1usize)) }; // ok
const RAW_SLICE_TOO_LONG: *const [u8] = unsafe { mem::transmute((&42u8, 999usize)) }; // ok because raw
const RAW_SLICE_MUCH_TOO_LONG: *const [u8] = unsafe { mem::transmute((&42u8, usize::MAX)) }; // ok because raw
const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
let uninit_len = MaybeUninit::<usize> { uninit: () };
mem::transmute((42, uninit_len))
};
@@ -145,11 +139,9 @@ const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool
// # raw trait object
const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
-//~^ ERROR evaluation of constant value failed
-//~| null pointer
+//~^ ERROR it is undefined behavior to use this value
const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
-//~^ ERROR evaluation of constant value failed
-//~| does not point to a vtable
+//~^ ERROR it is undefined behavior to use this value
const RAW_TRAIT_OBJ_CONTENT_INVALID: *const dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) } as *const dyn Trait; // ok because raw
// Const eval fails for these, so they need to be statics to error.
diff --git a/src/test/ui/consts/const-eval/union-const-eval-field.rs b/src/test/ui/consts/const-eval/union-const-eval-field.rs
index a1e48cac4..d88bf2a84 100644
--- a/src/test/ui/consts/const-eval/union-const-eval-field.rs
+++ b/src/test/ui/consts/const-eval/union-const-eval-field.rs
@@ -26,7 +26,8 @@ const fn read_field2() -> Field2 {
const fn read_field3() -> Field3 {
const FIELD3: Field3 = unsafe { UNION.field3 };
- //~^ ERROR it is undefined behavior to use this value
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
FIELD3
//~^ ERROR erroneous constant used [E0080]
}
diff --git a/src/test/ui/consts/const-eval/union-const-eval-field.stderr b/src/test/ui/consts/const-eval/union-const-eval-field.stderr
index c512e6825..00964489e 100644
--- a/src/test/ui/consts/const-eval/union-const-eval-field.stderr
+++ b/src/test/ui/consts/const-eval/union-const-eval-field.stderr
@@ -1,16 +1,11 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-const-eval-field.rs:28:5
+error[E0080]: evaluation of constant value failed
+ --> $DIR/union-const-eval-field.rs:28:37
|
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
- | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 8, align: 8) {
- __ __ __ __ __ __ __ __ │ ░░░░░░░░
- }
+ | ^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error[E0080]: erroneous constant used
- --> $DIR/union-const-eval-field.rs:30:5
+ --> $DIR/union-const-eval-field.rs:31:5
|
LL | FIELD3
| ^^^^^^ referenced constant has errors
diff --git a/src/test/ui/consts/const-eval/union-ice.rs b/src/test/ui/consts/const-eval/union-ice.rs
index 4189619b2..dd970a355 100644
--- a/src/test/ui/consts/const-eval/union-ice.rs
+++ b/src/test/ui/consts/const-eval/union-ice.rs
@@ -11,11 +11,15 @@ union DummyUnion {
const UNION: DummyUnion = DummyUnion { field1: 1065353216 };
-const FIELD3: Field3 = unsafe { UNION.field3 }; //~ ERROR it is undefined behavior to use this value
+const FIELD3: Field3 = unsafe { UNION.field3 };
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
-const FIELD_PATH: Struct = Struct { //~ ERROR it is undefined behavior to use this value
+const FIELD_PATH: Struct = Struct {
a: 42,
b: unsafe { UNION.field3 },
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
};
struct Struct {
@@ -23,10 +27,12 @@ struct Struct {
b: Field3,
}
-const FIELD_PATH2: Struct2 = Struct2 { //~ ERROR it is undefined behavior to use this value
+const FIELD_PATH2: Struct2 = Struct2 {
b: [
21,
unsafe { UNION.field3 },
+ //~^ ERROR evaluation of constant value failed
+ //~| uninitialized
23,
24,
],
diff --git a/src/test/ui/consts/const-eval/union-ice.stderr b/src/test/ui/consts/const-eval/union-ice.stderr
index 21a545509..bd39a0551 100644
--- a/src/test/ui/consts/const-eval/union-ice.stderr
+++ b/src/test/ui/consts/const-eval/union-ice.stderr
@@ -1,37 +1,20 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-ice.rs:14:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/union-ice.rs:14:33
|
LL | const FIELD3: Field3 = unsafe { UNION.field3 };
- | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes
- |
- = 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: 8, align: 8) {
- __ __ __ __ __ __ __ __ │ ░░░░░░░░
- }
+ | ^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-ice.rs:16:1
- |
-LL | const FIELD_PATH: Struct = Struct {
- | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b: encountered uninitialized bytes, but expected initialized bytes
+error[E0080]: evaluation of constant value failed
+ --> $DIR/union-ice.rs:20:17
|
- = 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: 16, align: 8) {
- __ __ __ __ __ __ __ __ 2a __ __ __ __ __ __ __ │ ░░░░░░░░*░░░░░░░
- }
+LL | b: unsafe { UNION.field3 },
+ | ^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-ice.rs:26:1
- |
-LL | const FIELD_PATH2: Struct2 = Struct2 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .b[1]: encountered uninitialized bytes
+error[E0080]: evaluation of constant value failed
+ --> $DIR/union-ice.rs:33:18
|
- = 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: 40, align: 8) {
- 0x00 │ 15 00 00 00 00 00 00 00 __ __ __ __ __ __ __ __ │ ........░░░░░░░░
- 0x10 │ 17 00 00 00 00 00 00 00 18 00 00 00 00 00 00 00 │ ................
- 0x20 │ 2a __ __ __ __ __ __ __ │ *░░░░░░░
- }
+LL | unsafe { UNION.field3 },
+ | ^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to 3 previous errors
diff --git a/src/test/ui/consts/const-eval/union-ub.32bit.stderr b/src/test/ui/consts/const-eval/union-ub.32bit.stderr
index baf682596..e5c8f88be 100644
--- a/src/test/ui/consts/const-eval/union-ub.32bit.stderr
+++ b/src/test/ui/consts/const-eval/union-ub.32bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-ub.rs:33:1
+ --> $DIR/union-ub.rs:32:1
|
LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
@@ -9,16 +9,11 @@ LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
2a │ *
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-ub.rs:35:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/union-ub.rs:34:36
|
LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- __ │ ░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to 2 previous errors
diff --git a/src/test/ui/consts/const-eval/union-ub.64bit.stderr b/src/test/ui/consts/const-eval/union-ub.64bit.stderr
index baf682596..e5c8f88be 100644
--- a/src/test/ui/consts/const-eval/union-ub.64bit.stderr
+++ b/src/test/ui/consts/const-eval/union-ub.64bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-ub.rs:33:1
+ --> $DIR/union-ub.rs:32:1
|
LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
@@ -9,16 +9,11 @@ LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
2a │ *
}
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/union-ub.rs:35:1
+error[E0080]: evaluation of constant value failed
+ --> $DIR/union-ub.rs:34:36
|
LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
- | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean
- |
- = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
- = note: the raw bytes of the constant (size: 1, align: 1) {
- __ │ ░
- }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
error: aborting due to 2 previous errors
diff --git a/src/test/ui/consts/const-eval/union-ub.rs b/src/test/ui/consts/const-eval/union-ub.rs
index c1bfe69a7..043870c9c 100644
--- a/src/test/ui/consts/const-eval/union-ub.rs
+++ b/src/test/ui/consts/const-eval/union-ub.rs
@@ -1,5 +1,4 @@
// stderr-per-bitwidth
-#![allow(const_err)] // make sure we cannot allow away the errors tested here
#[repr(C)]
union DummyUnion {
@@ -33,7 +32,8 @@ union Bar {
const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
//~^ ERROR it is undefined behavior to use this value
const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
-//~^ ERROR it is undefined behavior to use this value
+//~^ ERROR evaluation of constant value failed
+//~| uninitialized
// The value is not valid for any union variant, but that's fine
// unions are just a convenient way to transmute bits around
diff --git a/src/test/ui/consts/const-eval/union_promotion.rs b/src/test/ui/consts/const-eval/union_promotion.rs
index 7167f88a1..18894c45f 100644
--- a/src/test/ui/consts/const-eval/union_promotion.rs
+++ b/src/test/ui/consts/const-eval/union_promotion.rs
@@ -1,5 +1,3 @@
-#![allow(const_err)]
-
#[repr(C)]
union Foo {
a: &'static u32,
diff --git a/src/test/ui/consts/const-eval/union_promotion.stderr b/src/test/ui/consts/const-eval/union_promotion.stderr
index ed186e3eb..70808c520 100644
--- a/src/test/ui/consts/const-eval/union_promotion.stderr
+++ b/src/test/ui/consts/const-eval/union_promotion.stderr
@@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
- --> $DIR/union_promotion.rs:10:29
+ --> $DIR/union_promotion.rs:8:29
|
LL | let x: &'static bool = &unsafe {
| ____________-------------____^
diff --git a/src/test/ui/consts/const-eval/unused-broken-const.rs b/src/test/ui/consts/const-eval/unused-broken-const.rs
index 3b4523681..0d2776bc2 100644
--- a/src/test/ui/consts/const-eval/unused-broken-const.rs
+++ b/src/test/ui/consts/const-eval/unused-broken-const.rs
@@ -3,7 +3,6 @@
// compile-flags: --emit=dep-info,metadata
const FOO: i32 = [][0];
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR evaluation of constant value failed
fn main() {}
diff --git a/src/test/ui/consts/const-eval/unused-broken-const.stderr b/src/test/ui/consts/const-eval/unused-broken-const.stderr
index df5bd524f..fbb10feb7 100644
--- a/src/test/ui/consts/const-eval/unused-broken-const.stderr
+++ b/src/test/ui/consts/const-eval/unused-broken-const.stderr
@@ -1,23 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/unused-broken-const.rs:5:18
|
LL | const FOO: i32 = [][0];
- | -------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^ index out of bounds: the length is 0 but the index is 0
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/unused-broken-const.rs:5:18
- |
-LL | const FOO: i32 = [][0];
- | -------------- ^^^^^ index out of bounds: the length is 0 but the index is 0
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-eval/valid-const.rs b/src/test/ui/consts/const-eval/valid-const.rs
index 9e4707182..5f47d1c4f 100644
--- a/src/test/ui/consts/const-eval/valid-const.rs
+++ b/src/test/ui/consts/const-eval/valid-const.rs
@@ -1,7 +1,6 @@
// check-pass
// Some constants that *are* valid
-#![deny(const_err)]
use std::mem;
use std::ptr::NonNull;
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
index bdaeb4a0f..63639729a 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.32bit.stderr
@@ -7,8 +7,8 @@ LL | unsafe { std::mem::transmute(()) }
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: `#[warn(invalid_value)]` on by default
= note: the `!` type has no valid value
+ = note: `#[warn(invalid_value)]` on by default
error[E0080]: evaluation of constant value failed
--> $DIR/validate_uninhabited_zsts.rs:4:14
@@ -20,10 +20,10 @@ LL | unsafe { std::mem::transmute(()) }
| inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
...
LL | const FOO: [empty::Empty; 3] = [foo(); 3];
- | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:20:33
+ | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:19:33
error[E0080]: it is undefined behavior to use this value
- --> $DIR/validate_uninhabited_zsts.rs:23:1
+ --> $DIR/validate_uninhabited_zsts.rs:21:1
|
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
@@ -32,7 +32,7 @@ LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
= note: the raw bytes of the constant (size: 0, align: 1) {}
warning: the type `empty::Empty` does not permit zero-initialization
- --> $DIR/validate_uninhabited_zsts.rs:23:42
+ --> $DIR/validate_uninhabited_zsts.rs:21:42
|
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,11 +40,11 @@ LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: enums with no variants have no valid value (in this struct field)
- --> $DIR/validate_uninhabited_zsts.rs:16:22
+note: enums with no inhabited variants have no valid value
+ --> $DIR/validate_uninhabited_zsts.rs:13:5
|
-LL | pub struct Empty(Void);
- | ^^^^
+LL | enum Void {}
+ | ^^^^^^^^^
error: aborting due to 2 previous errors; 2 warnings emitted
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
index bdaeb4a0f..63639729a 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.64bit.stderr
@@ -7,8 +7,8 @@ LL | unsafe { std::mem::transmute(()) }
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: `#[warn(invalid_value)]` on by default
= note: the `!` type has no valid value
+ = note: `#[warn(invalid_value)]` on by default
error[E0080]: evaluation of constant value failed
--> $DIR/validate_uninhabited_zsts.rs:4:14
@@ -20,10 +20,10 @@ LL | unsafe { std::mem::transmute(()) }
| inside `foo` at $DIR/validate_uninhabited_zsts.rs:4:14
...
LL | const FOO: [empty::Empty; 3] = [foo(); 3];
- | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:20:33
+ | ----- inside `FOO` at $DIR/validate_uninhabited_zsts.rs:19:33
error[E0080]: it is undefined behavior to use this value
- --> $DIR/validate_uninhabited_zsts.rs:23:1
+ --> $DIR/validate_uninhabited_zsts.rs:21:1
|
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
@@ -32,7 +32,7 @@ LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
= note: the raw bytes of the constant (size: 0, align: 1) {}
warning: the type `empty::Empty` does not permit zero-initialization
- --> $DIR/validate_uninhabited_zsts.rs:23:42
+ --> $DIR/validate_uninhabited_zsts.rs:21:42
|
LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,11 +40,11 @@ LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: enums with no variants have no valid value (in this struct field)
- --> $DIR/validate_uninhabited_zsts.rs:16:22
+note: enums with no inhabited variants have no valid value
+ --> $DIR/validate_uninhabited_zsts.rs:13:5
|
-LL | pub struct Empty(Void);
- | ^^^^
+LL | enum Void {}
+ | ^^^^^^^^^
error: aborting due to 2 previous errors; 2 warnings emitted
diff --git a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
index 96f331275..c0b326215 100644
--- a/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
+++ b/src/test/ui/consts/const-eval/validate_uninhabited_zsts.rs
@@ -16,10 +16,8 @@ pub mod empty {
pub struct Empty(Void);
}
-#[warn(const_err)]
const FOO: [empty::Empty; 3] = [foo(); 3];
-#[warn(const_err)]
const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
//~^ ERROR it is undefined behavior to use this value
//~| WARN the type `empty::Empty` does not permit zero-initialization
diff --git a/src/test/ui/consts/const-external-macro-const-err.rs b/src/test/ui/consts/const-external-macro-const-err.rs
index 440c42e32..5bd84330b 100644
--- a/src/test/ui/consts/const-external-macro-const-err.rs
+++ b/src/test/ui/consts/const-external-macro-const-err.rs
@@ -9,6 +9,5 @@ extern crate external_macro;
use external_macro::static_assert;
fn main() {
- static_assert!(2 + 2 == 5); //~ ERROR
- //~| WARN this was previously accepted by the compiler but is being phased out
+ static_assert!(2 + 2 == 5); //~ ERROR constant
}
diff --git a/src/test/ui/consts/const-external-macro-const-err.stderr b/src/test/ui/consts/const-external-macro-const-err.stderr
index 205ee92df..81f6c09ff 100644
--- a/src/test/ui/consts/const-external-macro-const-err.stderr
+++ b/src/test/ui/consts/const-external-macro-const-err.stderr
@@ -1,25 +1,11 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/const-external-macro-const-err.rs:12:5
|
LL | static_assert!(2 + 2 == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-external-macro-const-err.rs:12:5
- |
-LL | static_assert!(2 + 2 == 5);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info)
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-float-bits-reject-conv.rs b/src/test/ui/consts/const-float-bits-reject-conv.rs
index b156ded4a..5bf54fdbb 100644
--- a/src/test/ui/consts/const-float-bits-reject-conv.rs
+++ b/src/test/ui/consts/const-float-bits-reject-conv.rs
@@ -28,22 +28,18 @@ fn f32() {
const MASKED_NAN2: u32 = f32::NAN.to_bits() ^ 0x0055_5555;
const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
// LLVM does not guarantee that loads and stores of NaNs preserve their exact bit pattern.
// In practice, this seems to only cause a problem on x86, since the most widely used calling
// convention mandates that floating point values are returned on the x87 FPU stack. See #73328.
if !cfg!(target_arch = "x86") {
const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
}
}
@@ -55,20 +51,16 @@ fn f64() {
const MASKED_NAN2: u64 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555;
const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
// See comment above.
if !cfg!(target_arch = "x86") {
const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
- //~^ ERROR any use of this value will cause an error
- //~| WARNING this was previously accepted
+ //~^ ERROR evaluation of constant value failed
}
}
diff --git a/src/test/ui/consts/const-float-bits-reject-conv.stderr b/src/test/ui/consts/const-float-bits-reject-conv.stderr
index d6e993a10..b3575f641 100644
--- a/src/test/ui/consts/const-float-bits-reject-conv.stderr
+++ b/src/test/ui/consts/const-float-bits-reject-conv.stderr
@@ -10,16 +10,6 @@ LL | panic!("const-eval error: cannot use f32::to_bits on a
LL | unsafe { intrinsics::const_eval_select((self,), ct_f32_to_u32, rt_f32_to_u32) }
| -------------------------------------------------------------------- inside `core::f32::<impl f32>::to_bits` at $SRC_DIR/core/src/num/f32.rs:LL:COL
|
- ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
-LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
- | ------------------------------------------------------------------ inside `<fn(f32) -> u32 {core::f32::<impl f32>::to_bits::ct_f32_to_u32} as FnOnce<(f32,)>>::call_once - shim(fn(f32) -> u32 {core::f32::<impl f32>::to_bits::ct_f32_to_u32})` at $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
- ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
-LL | called_in_const.call_once(arg)
- | ------------------------------ inside `const_eval_select::<(f32,), fn(f32) -> u32 {core::f32::<impl f32>::to_bits::ct_f32_to_u32}, [closure@core::f32::<impl f32>::to_bits::{closure#0}], u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
::: $DIR/const-float-bits-reject-conv.rs:27:30
|
LL | const MASKED_NAN1: u32 = f32::NAN.to_bits() ^ 0x002A_AAAA;
@@ -39,16 +29,6 @@ LL | panic!("const-eval error: cannot use f32::to_bits on a
LL | unsafe { intrinsics::const_eval_select((self,), ct_f32_to_u32, rt_f32_to_u32) }
| -------------------------------------------------------------------- inside `core::f32::<impl f32>::to_bits` at $SRC_DIR/core/src/num/f32.rs:LL:COL
|
- ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
-LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
- | ------------------------------------------------------------------ inside `<fn(f32) -> u32 {core::f32::<impl f32>::to_bits::ct_f32_to_u32} as FnOnce<(f32,)>>::call_once - shim(fn(f32) -> u32 {core::f32::<impl f32>::to_bits::ct_f32_to_u32})` at $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
- ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
-LL | called_in_const.call_once(arg)
- | ------------------------------ inside `const_eval_select::<(f32,), fn(f32) -> u32 {core::f32::<impl f32>::to_bits::ct_f32_to_u32}, [closure@core::f32::<impl f32>::to_bits::{closure#0}], u32>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
::: $DIR/const-float-bits-reject-conv.rs:28:30
|
LL | const MASKED_NAN2: u32 = f32::NAN.to_bits() ^ 0x0055_5555;
@@ -56,54 +36,29 @@ LL | const MASKED_NAN2: u32 = f32::NAN.to_bits() ^ 0x0055_5555;
|
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/const-float-bits-reject-conv.rs:30:34
|
-LL | const _: () = assert!($a);
- | -----------
-...
LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:33:34
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-float-bits-reject-conv.rs:32:34
|
-LL | const _: () = assert!($a);
- | -----------
-...
LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:41:38
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-float-bits-reject-conv.rs:39:38
|
-LL | const _: () = assert!($a == $b);
- | -----------
-...
LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
| ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:44:38
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-float-bits-reject-conv.rs:41:38
|
-LL | const _: () = assert!($a == $b);
- | -----------
-...
LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
| ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/num/f64.rs:LL:COL
@@ -117,20 +72,10 @@ LL | panic!("const-eval error: cannot use f64::to_bits on a
LL | unsafe { intrinsics::const_eval_select((self,), ct_f64_to_u64, rt_f64_to_u64) }
| -------------------------------------------------------------------- inside `core::f64::<impl f64>::to_bits` at $SRC_DIR/core/src/num/f64.rs:LL:COL
|
- ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
-LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
- | ------------------------------------------------------------------ inside `<fn(f64) -> u64 {core::f64::<impl f64>::to_bits::ct_f64_to_u64} as FnOnce<(f64,)>>::call_once - shim(fn(f64) -> u64 {core::f64::<impl f64>::to_bits::ct_f64_to_u64})` at $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
- ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
-LL | called_in_const.call_once(arg)
- | ------------------------------ inside `const_eval_select::<(f64,), fn(f64) -> u64 {core::f64::<impl f64>::to_bits::ct_f64_to_u64}, [closure@core::f64::<impl f64>::to_bits::{closure#0}], u64>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
- ::: $DIR/const-float-bits-reject-conv.rs:54:30
+ ::: $DIR/const-float-bits-reject-conv.rs:50:30
|
LL | const MASKED_NAN1: u64 = f64::NAN.to_bits() ^ 0x000A_AAAA_AAAA_AAAA;
- | ------------------ inside `f64::MASKED_NAN1` at $DIR/const-float-bits-reject-conv.rs:54:30
+ | ------------------ inside `f64::MASKED_NAN1` at $DIR/const-float-bits-reject-conv.rs:50:30
|
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -146,183 +91,37 @@ LL | panic!("const-eval error: cannot use f64::to_bits on a
LL | unsafe { intrinsics::const_eval_select((self,), ct_f64_to_u64, rt_f64_to_u64) }
| -------------------------------------------------------------------- inside `core::f64::<impl f64>::to_bits` at $SRC_DIR/core/src/num/f64.rs:LL:COL
|
- ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
-LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
- | ------------------------------------------------------------------ inside `<fn(f64) -> u64 {core::f64::<impl f64>::to_bits::ct_f64_to_u64} as FnOnce<(f64,)>>::call_once - shim(fn(f64) -> u64 {core::f64::<impl f64>::to_bits::ct_f64_to_u64})` at $SRC_DIR/core/src/ops/function.rs:LL:COL
- |
- ::: $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
-LL | called_in_const.call_once(arg)
- | ------------------------------ inside `const_eval_select::<(f64,), fn(f64) -> u64 {core::f64::<impl f64>::to_bits::ct_f64_to_u64}, [closure@core::f64::<impl f64>::to_bits::{closure#0}], u64>` at $SRC_DIR/core/src/intrinsics.rs:LL:COL
- |
- ::: $DIR/const-float-bits-reject-conv.rs:55:30
+ ::: $DIR/const-float-bits-reject-conv.rs:51:30
|
LL | const MASKED_NAN2: u64 = f64::NAN.to_bits() ^ 0x0005_5555_5555_5555;
- | ------------------ inside `f64::MASKED_NAN2` at $DIR/const-float-bits-reject-conv.rs:55:30
+ | ------------------ inside `f64::MASKED_NAN2` at $DIR/const-float-bits-reject-conv.rs:51:30
|
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:57:34
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-float-bits-reject-conv.rs:53:34
|
-LL | const _: () = assert!($a);
- | -----------
-...
LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:60:34
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-float-bits-reject-conv.rs:55:34
|
-LL | const _: () = assert!($a);
- | -----------
-...
LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
| ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:66:38
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-float-bits-reject-conv.rs:60:38
|
-LL | const _: () = assert!($a == $b);
- | -----------
-...
LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
| ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:69:38
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-float-bits-reject-conv.rs:62:38
|
-LL | const _: () = assert!($a == $b);
- | -----------
-...
LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
| ^^^^^^^^^^^ referenced constant has errors
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 12 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:30:34
- |
-LL | const _: () = assert!($a);
- | -----------
-...
-LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:33:34
- |
-LL | const _: () = assert!($a);
- | -----------
-...
-LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan());
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:41:38
- |
-LL | const _: () = assert!($a == $b);
- | -----------
-...
-LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:44:38
- |
-LL | const _: () = assert!($a == $b);
- | -----------
-...
-LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:57:34
- |
-LL | const _: () = assert!($a);
- | -----------
-...
-LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:60:34
- |
-LL | const _: () = assert!($a);
- | -----------
-...
-LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan());
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:66:38
- |
-LL | const _: () = assert!($a == $b);
- | -----------
-...
-LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1);
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-float-bits-reject-conv.rs:69:38
- |
-LL | const _: () = assert!($a == $b);
- | -----------
-...
-LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2);
- | ^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-fn-error.rs b/src/test/ui/consts/const-fn-error.rs
index abe68c17a..50b7ce1f8 100644
--- a/src/test/ui/consts/const-fn-error.rs
+++ b/src/test/ui/consts/const-fn-error.rs
@@ -3,10 +3,10 @@ const X : usize = 2;
const fn f(x: usize) -> usize {
let mut sum = 0;
for i in 0..x {
- //~^ ERROR mutable references
- //~| ERROR cannot convert
- //~| ERROR cannot call non-const fn
+ //~^ ERROR cannot convert
//~| ERROR `for` is not allowed in a `const fn`
+ //~| ERROR mutable references are not allowed in constant functions
+ //~| ERROR cannot call non-const fn
sum += i;
}
sum
diff --git a/src/test/ui/consts/const-fn-error.stderr b/src/test/ui/consts/const-fn-error.stderr
index e36324f0b..02960b363 100644
--- a/src/test/ui/consts/const-fn-error.stderr
+++ b/src/test/ui/consts/const-fn-error.stderr
@@ -22,8 +22,8 @@ LL | for i in 0..x {
note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
-LL | impl<I: ~const Iterator> const IntoIterator for I {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | impl<I: Iterator> const IntoIterator for I {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
error[E0658]: mutable references are not allowed in constant functions
diff --git a/src/test/ui/consts/const-for.rs b/src/test/ui/consts/const-for.rs
index 58bcb5f74..8db248535 100644
--- a/src/test/ui/consts/const-for.rs
+++ b/src/test/ui/consts/const-for.rs
@@ -3,8 +3,8 @@
const _: () = {
for _ in 0..5 {}
- //~^ error: cannot convert
- //~| error: cannot call non-const fn
+ //~^ error: cannot call
+ //~| error: cannot convert
};
fn main() {}
diff --git a/src/test/ui/consts/const-for.stderr b/src/test/ui/consts/const-for.stderr
index f2e1c8a49..11e4ae309 100644
--- a/src/test/ui/consts/const-for.stderr
+++ b/src/test/ui/consts/const-for.stderr
@@ -7,8 +7,8 @@ LL | for _ in 0..5 {}
note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
-LL | impl<I: ~const Iterator> const IntoIterator for I {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | impl<I: Iterator> const IntoIterator for I {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
error[E0015]: cannot call non-const fn `<std::ops::Range<i32> as Iterator>::next` in constants
diff --git a/src/test/ui/consts/const-int-arithmetic-overflow.rs b/src/test/ui/consts/const-int-arithmetic-overflow.rs
index 99bbeaafd..6446e9451 100644
--- a/src/test/ui/consts/const-int-arithmetic-overflow.rs
+++ b/src/test/ui/consts/const-int-arithmetic-overflow.rs
@@ -1,6 +1,5 @@
// run-pass
// compile-flags: -O
-#![allow(const_err)]
// Make sure arithmetic unary/binary ops actually return the right result, even when overflowing.
// We have to put them in `const fn` and turn on optimizations to avoid overflow checks.
diff --git a/src/test/ui/consts/const-len-underflow-separate-spans.rs b/src/test/ui/consts/const-len-underflow-separate-spans.rs
index 7c3d1f320..478761aef 100644
--- a/src/test/ui/consts/const-len-underflow-separate-spans.rs
+++ b/src/test/ui/consts/const-len-underflow-separate-spans.rs
@@ -5,8 +5,7 @@
const ONE: usize = 1;
const TWO: usize = 2;
const LEN: usize = ONE - TWO;
-//~^ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~^ ERROR constant
fn main() {
let a: [i8; LEN] = unimplemented!();
diff --git a/src/test/ui/consts/const-len-underflow-separate-spans.stderr b/src/test/ui/consts/const-len-underflow-separate-spans.stderr
index d1bf4b92e..1416e695e 100644
--- a/src/test/ui/consts/const-len-underflow-separate-spans.stderr
+++ b/src/test/ui/consts/const-len-underflow-separate-spans.stderr
@@ -1,15 +1,11 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/const-len-underflow-separate-spans.rs:7:20
|
LL | const LEN: usize = ONE - TWO;
- | ---------------- ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
error[E0080]: evaluation of constant value failed
- --> $DIR/const-len-underflow-separate-spans.rs:12:17
+ --> $DIR/const-len-underflow-separate-spans.rs:11:17
|
LL | let a: [i8; LEN] = unimplemented!();
| ^^^ referenced constant has errors
@@ -17,14 +13,3 @@ LL | let a: [i8; LEN] = unimplemented!();
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-len-underflow-separate-spans.rs:7:20
- |
-LL | const LEN: usize = ONE - TWO;
- | ---------------- ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/const-negation.rs b/src/test/ui/consts/const-negation.rs
index 26c3c0b83..18bcdfb01 100644
--- a/src/test/ui/consts/const-negation.rs
+++ b/src/test/ui/consts/const-negation.rs
@@ -1,8 +1,6 @@
// run-pass
#![allow(overflowing_literals)]
-#[deny(const_err)]
-
fn main() {
#[cfg(target_pointer_width = "32")]
const I: isize = -2147483648isize;
diff --git a/src/test/ui/consts/const-points-to-static.32bit.stderr b/src/test/ui/consts/const-points-to-static.32bit.stderr
index 97825dd0e..c7a435a1e 100644
--- a/src/test/ui/consts/const-points-to-static.32bit.stderr
+++ b/src/test/ui/consts/const-points-to-static.32bit.stderr
@@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/const-points-to-static.rs:6:1
|
LL | const TEST: &u8 = &MY_STATIC;
- | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
|
= 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: 4, align: 4) {
diff --git a/src/test/ui/consts/const-points-to-static.64bit.stderr b/src/test/ui/consts/const-points-to-static.64bit.stderr
index 0d4a5a8ce..4d5b8eac5 100644
--- a/src/test/ui/consts/const-points-to-static.64bit.stderr
+++ b/src/test/ui/consts/const-points-to-static.64bit.stderr
@@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value
--> $DIR/const-points-to-static.rs:6:1
|
LL | const TEST: &u8 = &MY_STATIC;
- | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
|
= 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: 8, align: 8) {
diff --git a/src/test/ui/consts/const-prop-read-static-in-const.rs b/src/test/ui/consts/const-prop-read-static-in-const.rs
index a65b707f0..214262059 100644
--- a/src/test/ui/consts/const-prop-read-static-in-const.rs
+++ b/src/test/ui/consts/const-prop-read-static-in-const.rs
@@ -2,8 +2,7 @@
#![allow(dead_code)]
-const TEST: u8 = MY_STATIC; //~ ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+const TEST: u8 = MY_STATIC; //~ ERROR constant
static MY_STATIC: u8 = 4;
diff --git a/src/test/ui/consts/const-prop-read-static-in-const.stderr b/src/test/ui/consts/const-prop-read-static-in-const.stderr
index ea5ad24b0..793da6285 100644
--- a/src/test/ui/consts/const-prop-read-static-in-const.stderr
+++ b/src/test/ui/consts/const-prop-read-static-in-const.stderr
@@ -1,12 +1,8 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/const-prop-read-static-in-const.rs:5:18
|
LL | const TEST: u8 = MY_STATIC;
- | -------------- ^^^^^^^^^ constant accesses static
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^ constant accesses static
warning: skipping const checks
|
@@ -18,14 +14,4 @@ LL | const TEST: u8 = MY_STATIC;
error: aborting due to previous error; 1 warning emitted
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-prop-read-static-in-const.rs:5:18
- |
-LL | const TEST: u8 = MY_STATIC;
- | -------------- ^^^^^^^^^ constant accesses static
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs
index 665371777..4df3a793b 100644
--- a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs
+++ b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.rs
@@ -8,9 +8,7 @@ extern "C" {
type Opaque;
}
-const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR
-//~| WARN this was previously accepted by the compiler but is being phased out
-const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR
-//~| WARN this was previously accepted by the compiler but is being phased out
+const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR constant
+const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; //~ ERROR constant
fn main() {}
diff --git a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr
index d19a89378..ad2de0f4d 100644
--- a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr
+++ b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr
@@ -1,43 +1,15 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31
|
LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) };
- | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
-error: any use of this value will cause an error
- --> $DIR/const-size_of_val-align_of_val-extern-type.rs:13:32
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-size_of_val-align_of_val-extern-type.rs:12:32
|
LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) };
- | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
- |
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
error: aborting due to 2 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31
- |
-LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) };
- | ------------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-size_of_val-align_of_val-extern-type.rs:13:32
- |
-LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) };
- | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `extern type` does not have known layout
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const-slice-oob.rs b/src/test/ui/consts/const-slice-oob.rs
index 35e5a4d22..429b97821 100644
--- a/src/test/ui/consts/const-slice-oob.rs
+++ b/src/test/ui/consts/const-slice-oob.rs
@@ -1,10 +1,7 @@
-#[deny(const_err)]
-
const FOO: &'static[u32] = &[1, 2, 3];
const BAR: u32 = FOO[5];
//~^ index out of bounds: the length is 3 but the index is 5
-//~| ERROR any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler but is being phased out
+//~| ERROR evaluation of constant value failed
fn main() {
let _ = BAR;
diff --git a/src/test/ui/consts/const-slice-oob.stderr b/src/test/ui/consts/const-slice-oob.stderr
index 27c21e7af..746883a79 100644
--- a/src/test/ui/consts/const-slice-oob.stderr
+++ b/src/test/ui/consts/const-slice-oob.stderr
@@ -1,23 +1,9 @@
-error: any use of this value will cause an error
- --> $DIR/const-slice-oob.rs:4:18
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const-slice-oob.rs:2:18
|
LL | const BAR: u32 = FOO[5];
- | -------------- ^^^^^^ index out of bounds: the length is 3 but the index is 5
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ^^^^^^ index out of bounds: the length is 3 but the index is 5
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const-slice-oob.rs:4:18
- |
-LL | const BAR: u32 = FOO[5];
- | -------------- ^^^^^^ index out of bounds: the length is 3 but the index is 5
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const_discriminant.rs b/src/test/ui/consts/const_discriminant.rs
index f623c5101..79e68590e 100644
--- a/src/test/ui/consts/const_discriminant.rs
+++ b/src/test/ui/consts/const_discriminant.rs
@@ -1,6 +1,5 @@
// run-pass
#![feature(const_discriminant)]
-#![feature(bench_black_box)]
#![allow(dead_code)]
use std::mem::{discriminant, Discriminant};
diff --git a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr
index e51d6f916..223482722 100644
--- a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr
+++ b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr
@@ -4,9 +4,9 @@ warning: to use a constant of type `CustomEq` in a pattern, the constant's initi
LL | BAR_BAZ => panic!(),
| ^^^^^^^
|
- = note: `#[warn(nontrivial_structural_match)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #73448 <https://github.com/rust-lang/rust/issues/73448>
+ = note: `#[warn(nontrivial_structural_match)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/consts/const_in_pattern/incomplete-slice.rs b/src/test/ui/consts/const_in_pattern/incomplete-slice.rs
new file mode 100644
index 000000000..e1ccda71d
--- /dev/null
+++ b/src/test/ui/consts/const_in_pattern/incomplete-slice.rs
@@ -0,0 +1,15 @@
+#[derive(PartialEq)]
+enum E {
+ A,
+}
+
+const E_SL: &[E] = &[E::A];
+
+fn main() {
+ match &[][..] {
+ //~^ ERROR non-exhaustive patterns: `&_` not covered [E0004]
+ E_SL => {}
+ //~^ WARN to use a constant of type `E` in a pattern, `E` must be annotated with `#[derive(PartialEq, Eq)]`
+ //~| WARN this was previously accepted by the compiler but is being phased out
+ }
+}
diff --git a/src/test/ui/consts/const_in_pattern/incomplete-slice.stderr b/src/test/ui/consts/const_in_pattern/incomplete-slice.stderr
new file mode 100644
index 000000000..ddc576ced
--- /dev/null
+++ b/src/test/ui/consts/const_in_pattern/incomplete-slice.stderr
@@ -0,0 +1,26 @@
+warning: to use a constant of type `E` in a pattern, `E` must be annotated with `#[derive(PartialEq, Eq)]`
+ --> $DIR/incomplete-slice.rs:11:9
+ |
+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: `#[warn(indirect_structural_match)]` on by default
+
+error[E0004]: non-exhaustive patterns: `&_` not covered
+ --> $DIR/incomplete-slice.rs:9:11
+ |
+LL | match &[][..] {
+ | ^^^^^^^ pattern `&_` not covered
+ |
+ = 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 + &_ => todo!()
+ |
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0004`.
diff --git a/src/test/ui/consts/const_in_pattern/issue-44333.stderr b/src/test/ui/consts/const_in_pattern/issue-44333.stderr
index 8302b09e5..731ef509c 100644
--- a/src/test/ui/consts/const_in_pattern/issue-44333.stderr
+++ b/src/test/ui/consts/const_in_pattern/issue-44333.stderr
@@ -4,13 +4,13 @@ warning: function pointers and unsized pointers in patterns behave unpredictably
LL | FOO => println!("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 #62411 <https://github.com/rust-lang/rust/issues/70861>
note: the lint level is defined here
--> $DIR/issue-44333.rs:3:9
|
LL | #![warn(pointer_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
--> $DIR/issue-44333.rs:21:9
diff --git a/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr b/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr
index 56405a55d..660198349 100644
--- a/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr
+++ b/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr
@@ -64,13 +64,13 @@ warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be a
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 lint level is defined here
--> $DIR/reject_non_structural.rs:12:9
|
LL | #![warn(indirect_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
error: aborting due to 10 previous errors; 1 warning emitted
diff --git a/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr b/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr
index a24c8d181..e957a43a1 100644
--- a/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr
+++ b/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr
@@ -4,9 +4,9 @@ warning: to use a constant of type `NoDerive` in a pattern, the constant's initi
LL | match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
| ^^^^^
|
- = note: `#[warn(nontrivial_structural_match)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #73448 <https://github.com/rust-lang/rust/issues/73448>
+ = 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)]`
--> $DIR/warn_corner_cases.rs:32:47
diff --git a/src/test/ui/consts/const_limit/const_eval_limit_reached.rs b/src/test/ui/consts/const_limit/const_eval_limit_reached.rs
index 773640b72..3ce038c1d 100644
--- a/src/test/ui/consts/const_limit/const_eval_limit_reached.rs
+++ b/src/test/ui/consts/const_limit/const_eval_limit_reached.rs
@@ -4,8 +4,7 @@
const X: usize = {
let mut x = 0;
while x != 1000 {
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler but is being phased out
+ //~^ ERROR evaluation of constant value failed
x += 1;
}
diff --git a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr
index e450f4aa3..850aebdfb 100644
--- a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr
+++ b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr
@@ -1,29 +1,9 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/const_eval_limit_reached.rs:6:11
|
-LL | const X: usize = {
- | --------------
-LL | let mut x = 0;
LL | while x != 1000 {
| ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to previous error
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/const_eval_limit_reached.rs:6:11
- |
-LL | const X: usize = {
- | --------------
-LL | let mut x = 0;
-LL | while x != 1000 {
- | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`)
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
index ec6ce1f5d..f6de3699f 100644
--- a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
+++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr
@@ -1,11 +1,11 @@
error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/hint.rs:LL:COL
|
-LL | unsafe { intrinsics::unreachable() }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | entering unreachable code
- | inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL
+LL | intrinsics::unreachable()
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | entering unreachable code
+ | inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL
|
::: $DIR/const_unsafe_unreachable_ub.rs:6:18
|
diff --git a/src/test/ui/consts/constifconst-call-in-const-position.rs b/src/test/ui/consts/constifconst-call-in-const-position.rs
new file mode 100644
index 000000000..fcf01d5bc
--- /dev/null
+++ b/src/test/ui/consts/constifconst-call-in-const-position.rs
@@ -0,0 +1,22 @@
+// known-bug: #102498
+
+#![feature(const_trait_impl, generic_const_exprs)]
+
+#[const_trait]
+pub trait Tr {
+ fn a() -> usize;
+}
+
+impl Tr for () {
+ fn a() -> usize {
+ 1
+ }
+}
+
+const fn foo<T: ~const Tr>() -> [u8; T::a()] {
+ [0; T::a()]
+}
+
+fn main() {
+ foo::<()>();
+}
diff --git a/src/test/ui/consts/constifconst-call-in-const-position.stderr b/src/test/ui/consts/constifconst-call-in-const-position.stderr
new file mode 100644
index 000000000..d4a445120
--- /dev/null
+++ b/src/test/ui/consts/constifconst-call-in-const-position.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/constifconst-call-in-const-position.rs:3:30
+ |
+LL | #![feature(const_trait_impl, 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[E0080]: evaluation of `foo::<()>::{constant#0}` failed
+ --> $DIR/constifconst-call-in-const-position.rs:16:38
+ |
+LL | const fn foo<T: ~const Tr>() -> [u8; T::a()] {
+ | ^^^^^^ calling non-const function `<() as Tr>::a`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/control-flow/drop-fail.precise.stderr b/src/test/ui/consts/control-flow/drop-fail.precise.stderr
index 0b0b2443a..93b5f257e 100644
--- a/src/test/ui/consts/control-flow/drop-fail.precise.stderr
+++ b/src/test/ui/consts/control-flow/drop-fail.precise.stderr
@@ -1,14 +1,14 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time
--> $DIR/drop-fail.rs:8:9
|
LL | let x = Some(Vec::new());
- | ^ constants cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time
--> $DIR/drop-fail.rs:39:9
|
LL | let mut tmp = None;
- | ^^^^^^^ constants cannot evaluate destructors
+ | ^^^^^^^ the destructor for this type cannot be evaluated in constants
error: aborting due to 2 previous errors
diff --git a/src/test/ui/consts/control-flow/drop-fail.rs b/src/test/ui/consts/control-flow/drop-fail.rs
index efa5a11c9..41341f312 100644
--- a/src/test/ui/consts/control-flow/drop-fail.rs
+++ b/src/test/ui/consts/control-flow/drop-fail.rs
@@ -6,7 +6,7 @@
const _: Option<Vec<i32>> = {
let y: Option<Vec<i32>> = None;
let x = Some(Vec::new());
- //[stock,precise]~^ ERROR destructors cannot be evaluated at compile-time
+ //[stock,precise]~^ ERROR destructor of
if true {
x
@@ -19,7 +19,7 @@ const _: Option<Vec<i32>> = {
// existing analysis.
const _: Vec<i32> = {
let vec_tuple = (Vec::new(),);
- //[stock]~^ ERROR destructors cannot be evaluated at compile-time
+ //[stock]~^ ERROR destructor of
vec_tuple.0
};
@@ -27,7 +27,7 @@ const _: Vec<i32> = {
// This applies to single-field enum variants as well.
const _: Vec<i32> = {
let x: Result<_, Vec<i32>> = Ok(Vec::new());
- //[stock]~^ ERROR destructors cannot be evaluated at compile-time
+ //[stock]~^ ERROR destructor of
match x {
Ok(x) | Err(x) => x,
@@ -37,7 +37,7 @@ const _: Vec<i32> = {
const _: Option<Vec<i32>> = {
let mut some = Some(Vec::new());
let mut tmp = None;
- //[stock,precise]~^ ERROR destructors cannot be evaluated at compile-time
+ //[stock,precise]~^ ERROR destructor of
let mut i = 0;
while i < 10 {
diff --git a/src/test/ui/consts/control-flow/drop-fail.stock.stderr b/src/test/ui/consts/control-flow/drop-fail.stock.stderr
index 72ca4fa08..2cc856802 100644
--- a/src/test/ui/consts/control-flow/drop-fail.stock.stderr
+++ b/src/test/ui/consts/control-flow/drop-fail.stock.stderr
@@ -1,35 +1,35 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time
--> $DIR/drop-fail.rs:8:9
|
LL | let x = Some(Vec::new());
- | ^ constants cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constants
...
LL | };
| - value is dropped here
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(Vec<i32>,)` cannot be evaluated at compile-time
--> $DIR/drop-fail.rs:21:9
|
LL | let vec_tuple = (Vec::new(),);
- | ^^^^^^^^^ constants cannot evaluate destructors
+ | ^^^^^^^^^ the destructor for this type cannot be evaluated in constants
...
LL | };
| - value is dropped here
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Result<Vec<i32>, Vec<i32>>` cannot be evaluated at compile-time
--> $DIR/drop-fail.rs:29:9
|
LL | let x: Result<_, Vec<i32>> = Ok(Vec::new());
- | ^ constants cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constants
...
LL | };
| - value is dropped here
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<Vec<i32>>` cannot be evaluated at compile-time
--> $DIR/drop-fail.rs:39:9
|
LL | let mut tmp = None;
- | ^^^^^^^ constants cannot evaluate destructors
+ | ^^^^^^^ the destructor for this type cannot be evaluated in constants
...
LL | };
| - value is dropped here
diff --git a/src/test/ui/consts/control-flow/issue-50577.stderr b/src/test/ui/consts/control-flow/issue-50577.stderr
index b6e73f889..a931c89f4 100644
--- a/src/test/ui/consts/control-flow/issue-50577.stderr
+++ b/src/test/ui/consts/control-flow/issue-50577.stderr
@@ -2,7 +2,7 @@ error[E0317]: `if` may be missing an `else` clause
--> $DIR/issue-50577.rs:3:16
|
LL | Drop = assert_eq!(1, 1),
- | ^^^^^^^^^^^^^^^^ expected `()`, found `isize`
+ | ^^^^^^^^^^^^^^^^ expected `isize`, found `()`
|
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/consts/dangling-alloc-id-ice.rs b/src/test/ui/consts/dangling-alloc-id-ice.rs
index 95acacdb7..d591bfc73 100644
--- a/src/test/ui/consts/dangling-alloc-id-ice.rs
+++ b/src/test/ui/consts/dangling-alloc-id-ice.rs
@@ -1,5 +1,4 @@
// https://github.com/rust-lang/rust/issues/55223
-#![allow(const_err)]
union Foo<'a> {
y: &'a (),
diff --git a/src/test/ui/consts/dangling-alloc-id-ice.stderr b/src/test/ui/consts/dangling-alloc-id-ice.stderr
index 8410034c0..0a1cca4ca 100644
--- a/src/test/ui/consts/dangling-alloc-id-ice.stderr
+++ b/src/test/ui/consts/dangling-alloc-id-ice.stderr
@@ -1,5 +1,5 @@
error: encountered dangling pointer in final constant
- --> $DIR/dangling-alloc-id-ice.rs:9:1
+ --> $DIR/dangling-alloc-id-ice.rs:8:1
|
LL | const FOO: &() = {
| ^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/drop_box.rs b/src/test/ui/consts/drop_box.rs
index 58a373a96..679974130 100644
--- a/src/test/ui/consts/drop_box.rs
+++ b/src/test/ui/consts/drop_box.rs
@@ -1,4 +1,4 @@
const fn f<T>(_: Box<T>) {}
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
fn main() {}
diff --git a/src/test/ui/consts/drop_box.stderr b/src/test/ui/consts/drop_box.stderr
index b9d6581e8..62324939b 100644
--- a/src/test/ui/consts/drop_box.stderr
+++ b/src/test/ui/consts/drop_box.stderr
@@ -1,10 +1,10 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Box<T>` cannot be evaluated at compile-time
--> $DIR/drop_box.rs:1:15
|
LL | const fn f<T>(_: Box<T>) {}
| ^ - value is dropped here
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
error: aborting due to previous error
diff --git a/src/test/ui/consts/drop_zst.stderr b/src/test/ui/consts/drop_zst.stderr
index d4be5aa56..37758a4cb 100644
--- a/src/test/ui/consts/drop_zst.stderr
+++ b/src/test/ui/consts/drop_zst.stderr
@@ -1,8 +1,8 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `S` cannot be evaluated at compile-time
--> $DIR/drop_zst.rs:14:9
|
LL | let s = S;
- | ^ constant functions cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constant functions
error: aborting due to previous error
diff --git a/src/test/ui/consts/extra-const-ub/detect-extra-ub.rs b/src/test/ui/consts/extra-const-ub/detect-extra-ub.rs
new file mode 100644
index 000000000..159cdf257
--- /dev/null
+++ b/src/test/ui/consts/extra-const-ub/detect-extra-ub.rs
@@ -0,0 +1,42 @@
+// revisions: no_flag with_flag
+// [no_flag] check-pass
+// [with_flag] compile-flags: -Zextra-const-ub-checks
+#![feature(const_ptr_read)]
+
+use std::mem::transmute;
+
+const INVALID_BOOL: () = unsafe {
+ let _x: bool = transmute(3u8);
+ //[with_flag]~^ ERROR: evaluation of constant value failed
+ //[with_flag]~| invalid value
+};
+
+const INVALID_PTR_IN_INT: () = unsafe {
+ let _x: usize = transmute(&3u8);
+ //[with_flag]~^ ERROR: evaluation of constant value failed
+};
+
+const INVALID_SLICE_TO_USIZE_TRANSMUTE: () = unsafe {
+ let x: &[u8] = &[0; 32];
+ let _x: (usize, usize) = transmute(x);
+ //[with_flag]~^ ERROR: evaluation of constant value failed
+};
+
+const UNALIGNED_PTR: () = unsafe {
+ let _x: &u32 = transmute(&[0u8; 4]);
+ //[with_flag]~^ ERROR: evaluation of constant value failed
+ //[with_flag]~| invalid value
+};
+
+const UNALIGNED_READ: () = {
+ INNER; //[with_flag]~ERROR evaluation of constant value failed
+ // There is an error here but its span is in the standard library so we cannot match it...
+ // so we have this in a *nested* const, such that the *outer* const fails to use it.
+ const INNER: () = unsafe {
+ let x = &[0u8; 4];
+ let ptr = x.as_ptr().cast::<u32>();
+ ptr.read();
+ };
+};
+
+fn main() {}
diff --git a/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr b/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr
new file mode 100644
index 000000000..3e1195822
--- /dev/null
+++ b/src/test/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr
@@ -0,0 +1,58 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/detect-extra-ub.rs:9:20
+ |
+LL | let _x: bool = transmute(3u8);
+ | ^^^^^^^^^^^^^^ constructing invalid value: encountered 0x03, but expected a boolean
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/detect-extra-ub.rs:15:21
+ |
+LL | let _x: usize = transmute(&3u8);
+ | ^^^^^^^^^^^^^^^ 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
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/detect-extra-ub.rs:21:30
+ |
+LL | let _x: (usize, usize) = transmute(x);
+ | ^^^^^^^^^^^^ 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
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/detect-extra-ub.rs:26:20
+ |
+LL | let _x: &u32 = transmute(&[0u8; 4]);
+ | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 4 byte alignment but found 1)
+
+error[E0080]: evaluation of constant value failed
+ --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ |
+LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | accessing memory with alignment 1, but alignment 4 is required
+ | inside `std::ptr::read::<u32>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
+ |
+ ::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+ |
+LL | unsafe { read(self) }
+ | ---------- inside `ptr::const_ptr::<impl *const u32>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+ |
+ ::: $DIR/detect-extra-ub.rs:38:9
+ |
+LL | ptr.read();
+ | ---------- inside `INNER` at $DIR/detect-extra-ub.rs:38:9
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/detect-extra-ub.rs:32:5
+ |
+LL | INNER;
+ | ^^^^^ referenced constant has errors
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/extra-const-ub/issue-100771.rs b/src/test/ui/consts/extra-const-ub/issue-100771.rs
new file mode 100644
index 000000000..a32960328
--- /dev/null
+++ b/src/test/ui/consts/extra-const-ub/issue-100771.rs
@@ -0,0 +1,20 @@
+// check-pass
+// compile-flags: -Zextra-const-ub-checks
+
+#[derive(PartialEq, Eq, Copy, Clone)]
+#[repr(packed)]
+struct Foo {
+ field: (i64, u32, u32, u32),
+}
+
+const FOO: Foo = Foo {
+ field: (5, 6, 7, 8),
+};
+
+fn main() {
+ match FOO {
+ Foo { field: (5, 6, 7, 8) } => {},
+ FOO => unreachable!(),
+ _ => unreachable!(),
+ }
+}
diff --git a/src/test/ui/consts/extra-const-ub/issue-101034.rs b/src/test/ui/consts/extra-const-ub/issue-101034.rs
new file mode 100644
index 000000000..e0de705c4
--- /dev/null
+++ b/src/test/ui/consts/extra-const-ub/issue-101034.rs
@@ -0,0 +1,17 @@
+// check-pass
+// compile-flags: -Zextra-const-ub-checks
+
+#[repr(packed)]
+pub struct Foo {
+ bar: u8,
+ baa: [u32; 1],
+}
+
+const FOOMP: Foo = Foo {
+ bar: 0,
+ baa: [69; 1],
+};
+
+fn main() {
+ let _val = FOOMP;
+}
diff --git a/src/test/ui/consts/invalid-union.32bit.stderr b/src/test/ui/consts/invalid-union.32bit.stderr
index ae5f6b2ba..bad07989e 100644
--- a/src/test/ui/consts/invalid-union.32bit.stderr
+++ b/src/test/ui/consts/invalid-union.32bit.stderr
@@ -9,27 +9,12 @@ LL | fn main() {
╾─alloc7──╼ │ ╾──╼
}
-error: erroneous constant used
+error[E0080]: erroneous constant used
--> $DIR/invalid-union.rs:42:25
|
LL | let _: &'static _ = &C;
| ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/invalid-union.rs:42:25
- |
-LL | let _: &'static _ = &C;
- | ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/invalid-union.64bit.stderr b/src/test/ui/consts/invalid-union.64bit.stderr
index d50e74a16..a209f0038 100644
--- a/src/test/ui/consts/invalid-union.64bit.stderr
+++ b/src/test/ui/consts/invalid-union.64bit.stderr
@@ -9,27 +9,12 @@ LL | fn main() {
╾───────alloc7────────╼ │ ╾──────╼
}
-error: erroneous constant used
+error[E0080]: erroneous constant used
--> $DIR/invalid-union.rs:42:25
|
LL | let _: &'static _ = &C;
| ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/invalid-union.rs:42:25
- |
-LL | let _: &'static _ = &C;
- | ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/invalid-union.rs b/src/test/ui/consts/invalid-union.rs
index efeddf75c..435d26d6e 100644
--- a/src/test/ui/consts/invalid-union.rs
+++ b/src/test/ui/consts/invalid-union.rs
@@ -40,5 +40,4 @@ const C: S = {
fn main() { //~ ERROR it is undefined behavior to use this value
let _: &'static _ = &C; //~ ERROR erroneous constant used
- //~^ WARN this was previously accepted
}
diff --git a/src/test/ui/consts/issue-102117.rs b/src/test/ui/consts/issue-102117.rs
new file mode 100644
index 000000000..b77342c41
--- /dev/null
+++ b/src/test/ui/consts/issue-102117.rs
@@ -0,0 +1,30 @@
+#![feature(inline_const, const_type_id)]
+
+use std::alloc::Layout;
+use std::any::TypeId;
+use std::mem::transmute;
+use std::ptr::drop_in_place;
+
+pub struct VTable {
+ layout: Layout,
+ type_id: TypeId,
+ drop_in_place: unsafe fn(*mut ()),
+}
+
+impl VTable {
+ pub fn new<T>() -> &'static Self {
+ const {
+ //~^ ERROR the parameter type `T` may not live long enough
+ //~| ERROR the parameter type `T` may not live long enough
+ &VTable {
+ layout: Layout::new::<T>(),
+ type_id: TypeId::of::<T>(),
+ drop_in_place: unsafe {
+ transmute::<unsafe fn(*mut T), unsafe fn(*mut ())>(drop_in_place::<T>)
+ },
+ }
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/consts/issue-102117.stderr b/src/test/ui/consts/issue-102117.stderr
new file mode 100644
index 000000000..eb4b329bd
--- /dev/null
+++ b/src/test/ui/consts/issue-102117.stderr
@@ -0,0 +1,37 @@
+error[E0310]: the parameter type `T` may not live long enough
+ --> $DIR/issue-102117.rs:16:9
+ |
+LL | / const {
+LL | |
+LL | |
+LL | | &VTable {
+... |
+LL | | }
+LL | | }
+ | |_________^ ...so that the type `T` will meet its required lifetime bounds
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | pub fn new<T: 'static>() -> &'static Self {
+ | +++++++++
+
+error[E0310]: the parameter type `T` may not live long enough
+ --> $DIR/issue-102117.rs:16:9
+ |
+LL | / const {
+LL | |
+LL | |
+LL | | &VTable {
+... |
+LL | | }
+LL | | }
+ | |_________^ ...so that the type `T` will meet its required lifetime bounds
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | pub fn new<T: 'static>() -> &'static Self {
+ | +++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/consts/issue-104155.rs b/src/test/ui/consts/issue-104155.rs
new file mode 100644
index 000000000..1cc8f81b0
--- /dev/null
+++ b/src/test/ui/consts/issue-104155.rs
@@ -0,0 +1,5 @@
+// check-pass
+const _: () = core::mem::forget(Box::<u32>::default);
+const _: () = core::mem::forget(|| Box::<u32>::default());
+
+fn main() {}
diff --git a/src/test/ui/issues/issue-17718-constants-not-static.rs b/src/test/ui/consts/issue-17718-constants-not-static.rs
index 2e6aff161..2e6aff161 100644
--- a/src/test/ui/issues/issue-17718-constants-not-static.rs
+++ b/src/test/ui/consts/issue-17718-constants-not-static.rs
diff --git a/src/test/ui/issues/issue-17718-constants-not-static.stderr b/src/test/ui/consts/issue-17718-constants-not-static.stderr
index 8f3acae71..8f3acae71 100644
--- a/src/test/ui/issues/issue-17718-constants-not-static.stderr
+++ b/src/test/ui/consts/issue-17718-constants-not-static.stderr
diff --git a/src/test/ui/consts/issue-25826.stderr b/src/test/ui/consts/issue-25826.stderr
index b80befa26..905c5ee6e 100644
--- a/src/test/ui/consts/issue-25826.stderr
+++ b/src/test/ui/consts/issue-25826.stderr
@@ -10,10 +10,6 @@ note: the trait `PartialOrd` is implemented for `*const ()`, but that implementa
|
LL | const A: bool = unsafe { id::<u8> as *const () < id::<u16> as *const () };
| ^
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | fn main() where *const (): ~const PartialOrd {
- | ++++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/consts/issue-32829-2.stderr b/src/test/ui/consts/issue-32829-2.stderr
index b94bdc0e3..0fec35818 100644
--- a/src/test/ui/consts/issue-32829-2.stderr
+++ b/src/test/ui/consts/issue-32829-2.stderr
@@ -13,6 +13,7 @@ LL | invalid();
| ^^^^^^^^^
|
= 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[E0015]: cannot call non-const fn `invalid` in statics
--> $DIR/issue-32829-2.rs:54:9
@@ -21,6 +22,7 @@ LL | invalid();
| ^^^^^^^^^
|
= 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 3 previous errors
diff --git a/src/test/ui/consts/issue-36163.stderr b/src/test/ui/consts/issue-36163.stderr
index 4797d10b7..9ac6c984c 100644
--- a/src/test/ui/consts/issue-36163.stderr
+++ b/src/test/ui/consts/issue-36163.stderr
@@ -8,7 +8,7 @@ note: ...which requires const-evaluating + checking `A`...
--> $DIR/issue-36163.rs:1:1
|
LL | const A: isize = Foo::B as isize;
- | ^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `Foo::B::{constant#0}`, completing the cycle
note: cycle used when simplifying constant for the type system `Foo::B::{constant#0}`
--> $DIR/issue-36163.rs:4:9
diff --git a/src/test/ui/consts/issue-46553.rs b/src/test/ui/consts/issue-46553.rs
index 9438df193..abeaf10f2 100644
--- a/src/test/ui/consts/issue-46553.rs
+++ b/src/test/ui/consts/issue-46553.rs
@@ -1,5 +1,4 @@
// run-pass
-#![deny(const_err)]
pub struct Data<T> {
function: fn() -> T,
diff --git a/src/test/ui/consts/issue-56164.rs b/src/test/ui/consts/issue-56164.rs
index 094ca377e..df3e3bf90 100644
--- a/src/test/ui/consts/issue-56164.rs
+++ b/src/test/ui/consts/issue-56164.rs
@@ -1,11 +1,10 @@
const fn foo() { (||{})() }
//~^ ERROR cannot call non-const closure
-//~| ERROR erroneous constant used [const_err]
-//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+//~| ERROR erroneous constant used
const fn bad(input: fn()) {
input()
- //~^ ERROR function pointer
+ //~^ ERROR function pointer calls are not allowed
}
fn main() {
diff --git a/src/test/ui/consts/issue-56164.stderr b/src/test/ui/consts/issue-56164.stderr
index 73a0f8ec0..c5b2c57fb 100644
--- a/src/test/ui/consts/issue-56164.stderr
+++ b/src/test/ui/consts/issue-56164.stderr
@@ -8,32 +8,18 @@ LL | const fn foo() { (||{})() }
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
error: function pointer calls are not allowed in constant functions
- --> $DIR/issue-56164.rs:7:5
+ --> $DIR/issue-56164.rs:6:5
|
LL | input()
| ^^^^^^^
-error: erroneous constant used
+error[E0080]: erroneous constant used
--> $DIR/issue-56164.rs:1:18
|
LL | const fn foo() { (||{})() }
| ^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0015`.
-Future incompatibility report: Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/issue-56164.rs:1:18
- |
-LL | const fn foo() { (||{})() }
- | ^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+Some errors have detailed explanations: E0015, E0080.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/consts/issue-66693.rs b/src/test/ui/consts/issue-66693.rs
index 99d28eb77..1ff250be1 100644
--- a/src/test/ui/consts/issue-66693.rs
+++ b/src/test/ui/consts/issue-66693.rs
@@ -10,8 +10,7 @@ static _FOO: () = panic!(true);
const fn _foo() {
panic!(&1);
//~^ ERROR: argument to `panic!()` in a const context must have type `&str`
- //~| ERROR: erroneous constant used [const_err]
- //~| WARNING: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ //~| ERROR: erroneous constant used
}
// ensure that conforming panics don't cause an error
diff --git a/src/test/ui/consts/issue-66693.stderr b/src/test/ui/consts/issue-66693.stderr
index 5460cc1ee..911374f50 100644
--- a/src/test/ui/consts/issue-66693.stderr
+++ b/src/test/ui/consts/issue-66693.stderr
@@ -22,26 +22,12 @@ LL | panic!(&1);
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: erroneous constant used
+error[E0080]: erroneous constant used
--> $DIR/issue-66693.rs:11:12
|
LL | panic!(&1);
| ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 4 previous errors
-Future incompatibility report: Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/issue-66693.rs:11:12
- |
-LL | panic!(&1);
- | ^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/issue-78655.stderr b/src/test/ui/consts/issue-78655.stderr
index f5b1123e7..6b83fa0e5 100644
--- a/src/test/ui/consts/issue-78655.stderr
+++ b/src/test/ui/consts/issue-78655.stderr
@@ -5,6 +5,11 @@ LL | let x;
| - binding declared here but left uninitialized
LL | &x
| ^^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x = 0;
+ | +++
error: could not evaluate constant pattern
--> $DIR/issue-78655.rs:7:9
diff --git a/src/test/ui/consts/issue-88071.rs b/src/test/ui/consts/issue-88071.rs
index 1c38c43e6..f58cdb594 100644
--- a/src/test/ui/consts/issue-88071.rs
+++ b/src/test/ui/consts/issue-88071.rs
@@ -2,8 +2,6 @@
//
// regression test for #88071
-#![feature(const_btree_new)]
-
use std::collections::BTreeMap;
pub struct CustomMap<K, V>(BTreeMap<K, V>);
diff --git a/src/test/ui/consts/issue-94675.rs b/src/test/ui/consts/issue-94675.rs
index 0604aab3b..ce21ebdb9 100644
--- a/src/test/ui/consts/issue-94675.rs
+++ b/src/test/ui/consts/issue-94675.rs
@@ -7,9 +7,8 @@ struct Foo<'a> {
impl<'a> Foo<'a> {
const fn spam(&mut self, baz: &mut Vec<u32>) {
self.bar[0] = baz.len();
- //~^ ERROR cannot call non-const fn `Vec::<u32>::len` in constant functions
- //~| ERROR the trait bound `Vec<usize>: ~const IndexMut<usize>` is not satisfied
- //~| ERROR cannot call non-const operator in constant functions
+ //~^ the trait bound `Vec<usize>: ~const Index<_>` is not satisfied
+ //~| the trait bound `Vec<usize>: ~const IndexMut<usize>` is not satisfied
}
}
diff --git a/src/test/ui/consts/issue-94675.stderr b/src/test/ui/consts/issue-94675.stderr
index 6665e4283..f4683f7f5 100644
--- a/src/test/ui/consts/issue-94675.stderr
+++ b/src/test/ui/consts/issue-94675.stderr
@@ -1,10 +1,15 @@
-error[E0015]: cannot call non-const fn `Vec::<u32>::len` in constant functions
- --> $DIR/issue-94675.rs:9:27
+error[E0277]: the trait bound `Vec<usize>: ~const Index<_>` is not satisfied
+ --> $DIR/issue-94675.rs:9:9
|
LL | self.bar[0] = baz.len();
- | ^^^^^
+ | ^^^^^^^^^^^ vector indices are of type `usize` or ranges of `usize`
+ |
+ = help: the trait `~const Index<_>` is not implemented for `Vec<usize>`
+note: the trait `Index<_>` is implemented for `Vec<usize>`, but that implementation is not `const`
+ --> $DIR/issue-94675.rs:9:9
|
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+LL | self.bar[0] = baz.len();
+ | ^^^^^^^^^^^
error[E0277]: the trait bound `Vec<usize>: ~const IndexMut<usize>` is not satisfied
--> $DIR/issue-94675.rs:9:9
@@ -19,20 +24,6 @@ note: the trait `IndexMut<usize>` is implemented for `Vec<usize>`, but that impl
LL | self.bar[0] = baz.len();
| ^^^^^^^^^^^
-error[E0015]: cannot call non-const operator in constant functions
- --> $DIR/issue-94675.rs:9:9
- |
-LL | self.bar[0] = baz.len();
- | ^^^^^^^^^^^
- |
-note: impl defined here, but it is not `const`
- --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
- |
-LL | impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/consts/issue-miri-1910.rs b/src/test/ui/consts/issue-miri-1910.rs
index 2b23626e3..29e0ea950 100644
--- a/src/test/ui/consts/issue-miri-1910.rs
+++ b/src/test/ui/consts/issue-miri-1910.rs
@@ -1,4 +1,5 @@
// error-pattern unable to turn pointer into raw bytes
+// normalize-stderr-test: "alloc[0-9]+\+0x[a-z0-9]+" -> "ALLOC"
#![feature(const_ptr_read)]
const C: () = unsafe {
diff --git a/src/test/ui/consts/issue-miri-1910.stderr b/src/test/ui/consts/issue-miri-1910.stderr
index d953c7819..3872e3d4f 100644
--- a/src/test/ui/consts/issue-miri-1910.stderr
+++ b/src/test/ui/consts/issue-miri-1910.stderr
@@ -1,47 +1,25 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
- | unable to turn pointer into raw bytes
+ | unable to copy parts of a pointer from memory at ALLOC
| inside `std::ptr::read::<u8>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- | inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- | inside `C` at $DIR/issue-miri-1910.rs:7:5
|
- ::: $DIR/issue-miri-1910.rs:4:1
+ ::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
-LL | const C: () = unsafe {
- | -----------
+LL | unsafe { read(self) }
+ | ---------- inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = help: this code performed an operation that depends on the underlying bytes representing a pointer
- = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-
-error: aborting due to previous error
-
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- |
-LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | unable to turn pointer into raw bytes
- | inside `std::ptr::read::<u8>` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- | inside `ptr::const_ptr::<impl *const u8>::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
- | inside `C` at $DIR/issue-miri-1910.rs:7:5
+ ::: $DIR/issue-miri-1910.rs:8:5
|
- ::: $DIR/issue-miri-1910.rs:4:1
+LL | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read();
+ | ------------------------------------------------------------------- inside `C` at $DIR/issue-miri-1910.rs:8:5
|
-LL | const C: () = unsafe {
- | -----------
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.rs b/src/test/ui/consts/min_const_fn/min_const_fn.rs
index 0bafaf2e8..c2891488c 100644
--- a/src/test/ui/consts/min_const_fn/min_const_fn.rs
+++ b/src/test/ui/consts/min_const_fn/min_const_fn.rs
@@ -34,7 +34,7 @@ const fn foo35(a: bool, b: bool) -> bool { a ^ b }
struct Foo<T: ?Sized>(T);
impl<T> Foo<T> {
const fn new(t: T) -> Self { Foo(t) }
- const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated
+ const fn into_inner(self) -> T { self.0 } //~ destructor of
const fn get(&self) -> &T { &self.0 }
const fn get_mut(&mut self) -> &mut T { &mut self.0 }
//~^ mutable references
@@ -43,7 +43,7 @@ impl<T> Foo<T> {
}
impl<'a, T> Foo<T> {
const fn new_lt(t: T) -> Self { Foo(t) }
- const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated
+ const fn into_inner_lt(self) -> T { self.0 } //~ destructor of
const fn get_lt(&'a self) -> &T { &self.0 }
const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
//~^ mutable references
@@ -52,7 +52,7 @@ impl<'a, T> Foo<T> {
}
impl<T: Sized> Foo<T> {
const fn new_s(t: T) -> Self { Foo(t) }
- const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors
+ const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructor
const fn get_s(&self) -> &T { &self.0 }
const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
//~^ mutable references
diff --git a/src/test/ui/consts/min_const_fn/min_const_fn.stderr b/src/test/ui/consts/min_const_fn/min_const_fn.stderr
index 4ad17602c..11c79e8e2 100644
--- a/src/test/ui/consts/min_const_fn/min_const_fn.stderr
+++ b/src/test/ui/consts/min_const_fn/min_const_fn.stderr
@@ -1,10 +1,10 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:37:25
|
LL | const fn into_inner(self) -> T { self.0 }
| ^^^^ - value is dropped here
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
error[E0658]: mutable references are not allowed in constant functions
--> $DIR/min_const_fn.rs:39:22
@@ -33,13 +33,13 @@ LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:46:28
|
LL | const fn into_inner_lt(self) -> T { self.0 }
| ^^^^ - value is dropped here
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
error[E0658]: mutable references are not allowed in constant functions
--> $DIR/min_const_fn.rs:48:25
@@ -68,13 +68,13 @@ LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:55:27
|
LL | const fn into_inner_s(self) -> T { self.0 }
| ^^^^ - value is dropped here
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
error[E0658]: mutable references are not allowed in constant functions
--> $DIR/min_const_fn.rs:57:24
@@ -191,21 +191,21 @@ LL | const fn inc(x: &mut i32) { *x += 1 }
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `AlanTuring<impl std::fmt::Debug>` cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:122:19
|
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
| ^^ - value is dropped here
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `impl std::fmt::Debug` cannot be evaluated at compile-time
--> $DIR/min_const_fn.rs:124:18
|
LL | const fn no_apit(_x: impl std::fmt::Debug) {}
| ^^ - value is dropped here
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
error: aborting due to 24 previous errors
diff --git a/src/test/ui/consts/mir_check_nonconst.stderr b/src/test/ui/consts/mir_check_nonconst.stderr
index 2bac995ee..1e0652722 100644
--- a/src/test/ui/consts/mir_check_nonconst.stderr
+++ b/src/test/ui/consts/mir_check_nonconst.stderr
@@ -5,6 +5,7 @@ LL | static foo: Foo = bar();
| ^^^^^
|
= 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
diff --git a/src/test/ui/consts/miri_unleashed/abi-mismatch.rs b/src/test/ui/consts/miri_unleashed/abi-mismatch.rs
index 3360e9cac..205f7183b 100644
--- a/src/test/ui/consts/miri_unleashed/abi-mismatch.rs
+++ b/src/test/ui/consts/miri_unleashed/abi-mismatch.rs
@@ -2,7 +2,6 @@
// compile-flags: -Z unleash-the-miri-inside-of-you
#![feature(const_extern_fn)]
-#![allow(const_err)]
const extern "C" fn c_fn() {}
diff --git a/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr b/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr
index aaba19c2c..840d698eb 100644
--- a/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr
+++ b/src/test/ui/consts/miri_unleashed/abi-mismatch.stderr
@@ -1,19 +1,19 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/abi-mismatch.rs:10:5
+ --> $DIR/abi-mismatch.rs:9:5
|
LL | my_fn();
| ^^^^^^^
| |
| calling a function with calling convention C using calling convention Rust
- | inside `call_rust_fn` at $DIR/abi-mismatch.rs:10:5
+ | inside `call_rust_fn` at $DIR/abi-mismatch.rs:9:5
...
LL | static VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });
- | --------------------------------------------------------------------- inside `VAL` at $DIR/abi-mismatch.rs:16:18
+ | --------------------------------------------------------------------- inside `VAL` at $DIR/abi-mismatch.rs:15:18
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/abi-mismatch.rs:10:5
+ --> $DIR/abi-mismatch.rs:9:5
|
LL | my_fn();
| ^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/assoc_const.rs b/src/test/ui/consts/miri_unleashed/assoc_const.rs
index 5f520c2cf..76ed667a5 100644
--- a/src/test/ui/consts/miri_unleashed/assoc_const.rs
+++ b/src/test/ui/consts/miri_unleashed/assoc_const.rs
@@ -1,8 +1,6 @@
// build-fail
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
-
// a test demonstrating why we do need to run static const qualification on associated constants
// instead of just checking the final constant
diff --git a/src/test/ui/consts/miri_unleashed/assoc_const.stderr b/src/test/ui/consts/miri_unleashed/assoc_const.stderr
index 1f82ac827..519bd0748 100644
--- a/src/test/ui/consts/miri_unleashed/assoc_const.stderr
+++ b/src/test/ui/consts/miri_unleashed/assoc_const.stderr
@@ -1,22 +1,4 @@
-error[E0080]: erroneous constant used
- --> $DIR/assoc_const.rs:31:13
- |
-LL | let y = <String as Bar<Vec<u32>, String>>::F;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-
-warning: skipping const checks
- |
-help: skipping check that does not even have a feature gate
- --> $DIR/assoc_const.rs:14:20
- |
-LL | const F: u32 = (U::X, 42).1;
- | ^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
+error[E0080]: evaluation of `<std::string::String as Bar<std::vec::Vec<u32>, std::string::String>>::F` failed
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
@@ -25,18 +7,26 @@ LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
| calling non-const function `<Vec<u32> as Drop>::drop`
| inside `std::ptr::drop_in_place::<Vec<u32>> - shim(Some(Vec<u32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
| inside `std::ptr::drop_in_place::<(Vec<u32>, u32)> - shim(Some((Vec<u32>, u32)))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- | inside `<String as Bar<Vec<u32>, String>>::F` at $DIR/assoc_const.rs:14:31
|
- ::: $DIR/assoc_const.rs:14:5
+ ::: $DIR/assoc_const.rs:12:31
|
LL | const F: u32 = (U::X, 42).1;
- | ------------
+ | - inside `<String as Bar<Vec<u32>, String>>::F` at $DIR/assoc_const.rs:12:31
+
+error[E0080]: erroneous constant used
+ --> $DIR/assoc_const.rs:29:13
|
-note: the lint level is defined here
- --> $DIR/assoc_const.rs:4:10
+LL | let y = <String as Bar<Vec<u32>, String>>::F;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
+
+warning: skipping const checks
|
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+help: skipping check that does not even have a feature gate
+ --> $DIR/assoc_const.rs:12:20
+ |
+LL | const F: u32 = (U::X, 42).1;
+ | ^^^^^^^^^^
+
+error: aborting due to 2 previous errors; 1 warning emitted
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/assoc_const_2.rs b/src/test/ui/consts/miri_unleashed/assoc_const_2.rs
index 30dd2a515..8377141ea 100644
--- a/src/test/ui/consts/miri_unleashed/assoc_const_2.rs
+++ b/src/test/ui/consts/miri_unleashed/assoc_const_2.rs
@@ -1,7 +1,5 @@
// build-fail
-#![allow(const_err)]
-
// a test demonstrating that const qualification cannot prevent monomorphization time errors
trait Foo {
@@ -9,7 +7,7 @@ trait Foo {
}
trait Bar<U: Foo> {
- const F: u32 = 100 / U::X;
+ const F: u32 = 100 / U::X; //~ ERROR evaluation of `<std::string::String as Bar<std::string::String>>::F` failed
}
impl Foo for () {
diff --git a/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr b/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr
index cbf02199f..2bf753c2b 100644
--- a/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr
+++ b/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr
@@ -1,24 +1,15 @@
+error[E0080]: evaluation of `<std::string::String as Bar<std::string::String>>::F` failed
+ --> $DIR/assoc_const_2.rs:10:20
+ |
+LL | const F: u32 = 100 / U::X;
+ | ^^^^^^^^^^ attempt to divide `100_u32` by zero
+
error[E0080]: erroneous constant used
- --> $DIR/assoc_const_2.rs:29:13
+ --> $DIR/assoc_const_2.rs:27:13
|
LL | let y = <String as Bar<String>>::F;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/assoc_const_2.rs:12:20
- |
-LL | const F: u32 = 100 / U::X;
- | ------------ ^^^^^^^^^^ attempt to divide `100_u32` by zero
- |
-note: the lint level is defined here
- --> $DIR/assoc_const_2.rs:3:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/miri_unleashed/box.rs b/src/test/ui/consts/miri_unleashed/box.rs
index 32796c672..c2a260aa1 100644
--- a/src/test/ui/consts/miri_unleashed/box.rs
+++ b/src/test/ui/consts/miri_unleashed/box.rs
@@ -1,6 +1,5 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
#![feature(box_syntax)]
-#![allow(const_err)]
use std::mem::ManuallyDrop;
diff --git a/src/test/ui/consts/miri_unleashed/box.stderr b/src/test/ui/consts/miri_unleashed/box.stderr
index 05d9858dc..bc5d4a257 100644
--- a/src/test/ui/consts/miri_unleashed/box.stderr
+++ b/src/test/ui/consts/miri_unleashed/box.stderr
@@ -1,5 +1,5 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/box.rs:10:11
+ --> $DIR/box.rs:9:11
|
LL | &mut *(box 0)
| ^^^^^^^ calling non-const function `alloc::alloc::exchange_malloc`
@@ -7,22 +7,22 @@ LL | &mut *(box 0)
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/box.rs:10:11
+ --> $DIR/box.rs:9:11
|
LL | &mut *(box 0)
| ^^^^^^^
help: skipping check for `const_mut_refs` feature
- --> $DIR/box.rs:10:16
+ --> $DIR/box.rs:9:16
|
LL | &mut *(box 0)
| ^
help: skipping check for `const_mut_refs` feature
- --> $DIR/box.rs:10:5
+ --> $DIR/box.rs:9:5
|
LL | &mut *(box 0)
| ^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/box.rs:10:5
+ --> $DIR/box.rs:9:5
|
LL | &mut *(box 0)
| ^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr
new file mode 100644
index 000000000..a6f467b9e
--- /dev/null
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.32bit.stderr
@@ -0,0 +1,81 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static.rs:9:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static.rs:14:14
+ |
+LL | unsafe { *(&FOO as *const _ as *const usize) }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static.rs:18:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^ constant accesses static
+
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/const_refers_to_static.rs:20:1
+ |
+LL | const REF_INTERIOR_MUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
+ |
+ = 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: 4, align: 4) {
+ ╾─alloc4──╼ │ ╾──╼
+ }
+
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/const_refers_to_static.rs:27:1
+ |
+LL | const READ_IMMUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
+ |
+ = 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: 4, align: 4) {
+ ╾─alloc5──╼ │ ╾──╼
+ }
+
+warning: skipping const checks
+ |
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:9:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:9:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:14:17
+ |
+LL | unsafe { *(&FOO as *const _ as *const usize) }
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:18:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:18:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:23:18
+ |
+LL | unsafe { &*(&FOO as *const _ as *const usize) }
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:30:6
+ |
+LL | &FOO
+ | ^^^
+
+error: aborting due to 5 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr
new file mode 100644
index 000000000..cfaf31a6e
--- /dev/null
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.64bit.stderr
@@ -0,0 +1,81 @@
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static.rs:9:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static.rs:14:14
+ |
+LL | unsafe { *(&FOO as *const _ as *const usize) }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
+
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static.rs:18:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^ constant accesses static
+
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/const_refers_to_static.rs:20:1
+ |
+LL | const REF_INTERIOR_MUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
+ |
+ = 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: 8, align: 8) {
+ ╾───────alloc4────────╼ │ ╾──────╼
+ }
+
+error[E0080]: it is undefined behavior to use this value
+ --> $DIR/const_refers_to_static.rs:27:1
+ |
+LL | const READ_IMMUT: &usize = {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
+ |
+ = 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: 8, align: 8) {
+ ╾───────alloc5────────╼ │ ╾──────╼
+ }
+
+warning: skipping const checks
+ |
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:9:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:9:5
+ |
+LL | FOO.fetch_add(1, Ordering::Relaxed)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:14:17
+ |
+LL | unsafe { *(&FOO as *const _ as *const usize) }
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:18:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:18:32
+ |
+LL | const READ_MUT: u32 = unsafe { MUTABLE };
+ | ^^^^^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:23:18
+ |
+LL | unsafe { &*(&FOO as *const _ as *const usize) }
+ | ^^^
+help: skipping check that does not even have a feature gate
+ --> $DIR/const_refers_to_static.rs:30:6
+ |
+LL | &FOO
+ | ^^^
+
+error: aborting due to 5 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs b/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs
index c9dc1de51..7ed5a48d9 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.rs
@@ -1,31 +1,33 @@
-// build-fail
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
+// stderr-per-bitwidth
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
-// These fail during CTFE (as they read a static), so they only cause an error
-// when *using* the const.
-
const MUTATE_INTERIOR_MUT: usize = {
static FOO: AtomicUsize = AtomicUsize::new(0);
- FOO.fetch_add(1, Ordering::Relaxed)
+ FOO.fetch_add(1, Ordering::Relaxed) //~ERROR evaluation of constant value failed
};
const READ_INTERIOR_MUT: usize = {
static FOO: AtomicUsize = AtomicUsize::new(0);
- unsafe { *(&FOO as *const _ as *const usize) }
+ unsafe { *(&FOO as *const _ as *const usize) } //~ERROR evaluation of constant value failed
};
static mut MUTABLE: u32 = 0;
-const READ_MUT: u32 = unsafe { MUTABLE };
+const READ_MUT: u32 = unsafe { MUTABLE }; //~ERROR evaluation of constant value failed
+
+const REF_INTERIOR_MUT: &usize = { //~ ERROR undefined behavior to use this value
+//~| encountered a reference pointing to a static variable
+ static FOO: AtomicUsize = AtomicUsize::new(0);
+ unsafe { &*(&FOO as *const _ as *const usize) }
+};
+
+// ok some day perhaps
+const READ_IMMUT: &usize = { //~ ERROR it is undefined behavior to use this value
+//~| encountered a reference pointing to a static variable
+ static FOO: usize = 0;
+ &FOO
+};
-fn main() {
- MUTATE_INTERIOR_MUT;
- //~^ ERROR: erroneous constant used
- READ_INTERIOR_MUT;
- //~^ ERROR: erroneous constant used
- READ_MUT;
- //~^ ERROR: erroneous constant used
-}
+fn main() {}
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
deleted file mode 100644
index fa2088124..000000000
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr
+++ /dev/null
@@ -1,100 +0,0 @@
-error[E0080]: erroneous constant used
- --> $DIR/const_refers_to_static.rs:25:5
- |
-LL | MUTATE_INTERIOR_MUT;
- | ^^^^^^^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
- --> $DIR/const_refers_to_static.rs:27:5
- |
-LL | READ_INTERIOR_MUT;
- | ^^^^^^^^^^^^^^^^^ referenced constant has errors
-
-error[E0080]: erroneous constant used
- --> $DIR/const_refers_to_static.rs:29:5
- |
-LL | READ_MUT;
- | ^^^^^^^^ referenced constant has errors
-
-warning: skipping const checks
- |
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static.rs:13:5
- |
-LL | FOO.fetch_add(1, Ordering::Relaxed)
- | ^^^
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static.rs:13:5
- |
-LL | FOO.fetch_add(1, Ordering::Relaxed)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static.rs:18:17
- |
-LL | unsafe { *(&FOO as *const _ as *const usize) }
- | ^^^
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static.rs:22:32
- |
-LL | const READ_MUT: u32 = unsafe { MUTABLE };
- | ^^^^^^^
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static.rs:22:32
- |
-LL | const READ_MUT: u32 = unsafe { MUTABLE };
- | ^^^^^^^
-
-error: aborting due to 3 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static.rs:13:5
- |
-LL | const MUTATE_INTERIOR_MUT: usize = {
- | --------------------------------
-LL | static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | FOO.fetch_add(1, Ordering::Relaxed)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static.rs:3:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static.rs:18:14
- |
-LL | const READ_INTERIOR_MUT: usize = {
- | ------------------------------
-LL | static FOO: AtomicUsize = AtomicUsize::new(0);
-LL | unsafe { *(&FOO as *const _ as *const usize) }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static.rs:3:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static.rs:22:32
- |
-LL | const READ_MUT: u32 = unsafe { MUTABLE };
- | ------------------- ^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static.rs:3:10
- |
-LL | #![allow(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr
deleted file mode 100644
index b3ad81e49..000000000
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.32bit.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static2.rs:11:1
- |
-LL | const REF_INTERIOR_MUT: &usize = {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
- |
- = 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: 4, align: 4) {
- ╾─alloc1──╼ │ ╾──╼
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static2.rs:18:1
- |
-LL | const READ_IMMUT: &usize = {
- | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
- |
- = 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: 4, align: 4) {
- ╾─alloc2──╼ │ ╾──╼
- }
-
-warning: skipping const checks
- |
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static2.rs:14:18
- |
-LL | unsafe { &*(&FOO as *const _ as *const usize) }
- | ^^^
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static2.rs:21:6
- |
-LL | &FOO
- | ^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr
deleted file mode 100644
index 24bd07092..000000000
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.64bit.stderr
+++ /dev/null
@@ -1,38 +0,0 @@
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static2.rs:11:1
- |
-LL | const REF_INTERIOR_MUT: &usize = {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
- |
- = 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: 8, align: 8) {
- ╾───────alloc1────────╼ │ ╾──────╼
- }
-
-error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static2.rs:18:1
- |
-LL | const READ_IMMUT: &usize = {
- | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
- |
- = 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: 8, align: 8) {
- ╾───────alloc2────────╼ │ ╾──────╼
- }
-
-warning: skipping const checks
- |
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static2.rs:14:18
- |
-LL | unsafe { &*(&FOO as *const _ as *const usize) }
- | ^^^
-help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static2.rs:21:6
- |
-LL | &FOO
- | ^^^
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs b/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs
deleted file mode 100644
index 8b8e262fb..000000000
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// compile-flags: -Zunleash-the-miri-inside-of-you
-// stderr-per-bitwidth
-#![allow(const_err)]
-
-use std::sync::atomic::AtomicUsize;
-use std::sync::atomic::Ordering;
-
-// These only fail during validation (they do not use but just create a reference to a static),
-// so they cause an immediate error when *defining* the const.
-
-const REF_INTERIOR_MUT: &usize = { //~ ERROR undefined behavior to use this value
-//~| encountered a reference pointing to a static variable
- static FOO: AtomicUsize = AtomicUsize::new(0);
- unsafe { &*(&FOO as *const _ as *const usize) }
-};
-
-// ok some day perhaps
-const READ_IMMUT: &usize = { //~ ERROR it is undefined behavior to use this value
-//~| encountered a reference pointing to a static variable
- static FOO: usize = 0;
- &FOO
-};
-
-fn main() {}
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
index 20a96b57f..6df2fe3d0 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr
@@ -1,8 +1,8 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static_cross_crate.rs:12:1
+ --> $DIR/const_refers_to_static_cross_crate.rs:10:1
|
LL | const SLICE_MUT: &[u8; 1] = {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
|
= 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: 4, align: 4) {
@@ -10,16 +10,16 @@ LL | const SLICE_MUT: &[u8; 1] = {
}
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:40:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:34:9
|
LL | SLICE_MUT => true,
| ^^^^^^^^^
error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static_cross_crate.rs:17:1
+ --> $DIR/const_refers_to_static_cross_crate.rs:15:1
|
LL | const U8_MUT: &u8 = {
- | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
|
= 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: 4, align: 4) {
@@ -27,75 +27,55 @@ LL | const U8_MUT: &u8 = {
}
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:49:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:43:9
|
LL | U8_MUT => true,
| ^^^^^^
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:25:15
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static_cross_crate.rs:22:15
|
-LL | const U8_MUT2: &u8 = {
- | ------------------
LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:23:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:60:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:54:9
|
LL | U8_MUT2 => true,
| ^^^^^^^
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
-LL | const U8_MUT3: &u8 = {
- | ------------------
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:30:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:68:9
+ --> $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:40:9
+ --> $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:49:9
+ --> $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:60:9
+ --> $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:68:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:62:9
|
LL | U8_MUT3 => true,
| ^^^^^^^
@@ -103,90 +83,56 @@ LL | U8_MUT3 => true,
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:14:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:12:15
|
LL | unsafe { &static_cross_crate::ZERO }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:14:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:12:15
|
LL | unsafe { &static_cross_crate::ZERO }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:19:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:19:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:19:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:25:17
+ --> $DIR/const_refers_to_static_cross_crate.rs:22:17
|
LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 10 previous errors; 3 warnings emitted
+error: aborting due to 12 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:25:15
- |
-LL | const U8_MUT2: &u8 = {
- | ------------------
-LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:23:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
- |
-LL | const U8_MUT3: &u8 = {
- | ------------------
-LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:30:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
index dfa0f76ba..8802f3ada 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr
@@ -1,8 +1,8 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static_cross_crate.rs:12:1
+ --> $DIR/const_refers_to_static_cross_crate.rs:10:1
|
LL | const SLICE_MUT: &[u8; 1] = {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
|
= 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: 8, align: 8) {
@@ -10,16 +10,16 @@ LL | const SLICE_MUT: &[u8; 1] = {
}
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:40:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:34:9
|
LL | SLICE_MUT => true,
| ^^^^^^^^^
error[E0080]: it is undefined behavior to use this value
- --> $DIR/const_refers_to_static_cross_crate.rs:17:1
+ --> $DIR/const_refers_to_static_cross_crate.rs:15:1
|
LL | const U8_MUT: &u8 = {
- | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable
+ | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
|
= 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: 8, align: 8) {
@@ -27,75 +27,55 @@ LL | const U8_MUT: &u8 = {
}
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:49:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:43:9
|
LL | U8_MUT => true,
| ^^^^^^
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:25:15
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static_cross_crate.rs:22:15
|
-LL | const U8_MUT2: &u8 = {
- | ------------------
LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:23:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:60:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:54:9
|
LL | U8_MUT2 => true,
| ^^^^^^^
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+error[E0080]: evaluation of constant value failed
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
-LL | const U8_MUT3: &u8 = {
- | ------------------
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:30:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
error: could not evaluate constant pattern
- --> $DIR/const_refers_to_static_cross_crate.rs:68:9
+ --> $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:40:9
+ --> $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:49:9
+ --> $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:60:9
+ --> $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:68:9
+ --> $DIR/const_refers_to_static_cross_crate.rs:62:9
|
LL | U8_MUT3 => true,
| ^^^^^^^
@@ -103,90 +83,56 @@ LL | U8_MUT3 => true,
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:14:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:12:15
|
LL | unsafe { &static_cross_crate::ZERO }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:14:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:12:15
|
LL | unsafe { &static_cross_crate::ZERO }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:19:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:19:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:19:15
+ --> $DIR/const_refers_to_static_cross_crate.rs:17:15
|
LL | unsafe { &static_cross_crate::ZERO[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:25:17
+ --> $DIR/const_refers_to_static_cross_crate.rs:22:17
|
LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
+ --> $DIR/const_refers_to_static_cross_crate.rs:27:20
|
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 10 previous errors; 3 warnings emitted
+error: aborting due to 12 previous errors; 1 warning emitted
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:25:15
- |
-LL | const U8_MUT2: &u8 = {
- | ------------------
-LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:23:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
-Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/const_refers_to_static_cross_crate.rs:32:20
- |
-LL | const U8_MUT3: &u8 = {
- | ------------------
-LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static
- |
-note: the lint level is defined here
- --> $DIR/const_refers_to_static_cross_crate.rs:30:8
- |
-LL | #[warn(const_err)]
- | ^^^^^^^^^
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
index 4638d73fc..bf4f14f4d 100644
--- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
+++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
@@ -1,9 +1,7 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
// aux-build:static_cross_crate.rs
// stderr-per-bitwidth
-#![allow(const_err)]
-
-#![feature(exclusive_range_pattern, half_open_range_patterns)]
+#![feature(exclusive_range_pattern, half_open_range_patterns_in_slices)]
extern crate static_cross_crate;
@@ -19,20 +17,16 @@ const U8_MUT: &u8 = { //~ ERROR undefined behavior to use this value
unsafe { &static_cross_crate::ZERO[0] }
};
-// Also test indirection that reads from other static. This causes a const_err.
-#[warn(const_err)]
+// Also test indirection that reads from other static.
const U8_MUT2: &u8 = {
unsafe { &(*static_cross_crate::ZERO_REF)[0] }
- //~^ WARN [const_err]
+ //~^ ERROR evaluation of constant value failed
//~| constant accesses static
- //~| WARN this was previously accepted by the compiler but is being phased out
};
-#[warn(const_err)]
const U8_MUT3: &u8 = {
unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
- //~^ WARN [const_err]
+ //~^ ERROR evaluation of constant value failed
//~| constant accesses static
- //~| WARN this was previously accepted by the compiler but is being phased out
};
pub fn test(x: &[u8; 1]) -> bool {
diff --git a/src/test/ui/consts/miri_unleashed/drop.rs b/src/test/ui/consts/miri_unleashed/drop.rs
index 4afa954d9..3942e7ef7 100644
--- a/src/test/ui/consts/miri_unleashed/drop.rs
+++ b/src/test/ui/consts/miri_unleashed/drop.rs
@@ -1,6 +1,5 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
// error-pattern: calling non-const function `<Vec<i32> as Drop>::drop`
-#![allow(const_err)]
use std::mem::ManuallyDrop;
diff --git a/src/test/ui/consts/miri_unleashed/drop.stderr b/src/test/ui/consts/miri_unleashed/drop.stderr
index 36db6b786..a3a502723 100644
--- a/src/test/ui/consts/miri_unleashed/drop.stderr
+++ b/src/test/ui/consts/miri_unleashed/drop.stderr
@@ -7,15 +7,15 @@ LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
| calling non-const function `<Vec<i32> as Drop>::drop`
| inside `std::ptr::drop_in_place::<Vec<i32>> - shim(Some(Vec<i32>))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
|
- ::: $DIR/drop.rs:18:1
+ ::: $DIR/drop.rs:17:1
|
LL | };
- | - inside `TEST_BAD` at $DIR/drop.rs:18:1
+ | - inside `TEST_BAD` at $DIR/drop.rs:17:1
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/drop.rs:17:9
+ --> $DIR/drop.rs:16:9
|
LL | let _v: Vec<i32> = Vec::new();
| ^^
diff --git a/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.rs b/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.rs
index 8b17f6885..c24d3338e 100644
--- a/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.rs
+++ b/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.rs
@@ -1,5 +1,3 @@
-#![allow(const_err)]
-
// a test demonstrating why we do need to run static const qualification on associated constants
// instead of just checking the final constant
@@ -8,7 +6,7 @@ trait Foo<T> {
}
trait Bar<T, U: Foo<T>> {
- const F: u32 = (U::X, 42).1; //~ ERROR destructors cannot be evaluated at compile-time
+ const F: u32 = (U::X, 42).1; //~ ERROR destructor of
}
impl Foo<u32> for () {
diff --git a/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.stderr b/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.stderr
index 0b6cb2fab..45ed88b1b 100644
--- a/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.stderr
+++ b/src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.stderr
@@ -1,10 +1,10 @@
-error[E0493]: destructors cannot be evaluated at compile-time
- --> $DIR/feature-gate-unleash_the_miri_inside_of_you.rs:11:20
+error[E0493]: destructor of `(T, u32)` cannot be evaluated at compile-time
+ --> $DIR/feature-gate-unleash_the_miri_inside_of_you.rs:9:20
|
LL | const F: u32 = (U::X, 42).1;
| ^^^^^^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
error: aborting due to previous error
diff --git a/src/test/ui/consts/miri_unleashed/inline_asm.rs b/src/test/ui/consts/miri_unleashed/inline_asm.rs
index 697117033..6fd52ceb2 100644
--- a/src/test/ui/consts/miri_unleashed/inline_asm.rs
+++ b/src/test/ui/consts/miri_unleashed/inline_asm.rs
@@ -1,6 +1,5 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
// only-x86_64
-#![allow(const_err)]
use std::arch::asm;
diff --git a/src/test/ui/consts/miri_unleashed/inline_asm.stderr b/src/test/ui/consts/miri_unleashed/inline_asm.stderr
index 595b859cb..6317cd882 100644
--- a/src/test/ui/consts/miri_unleashed/inline_asm.stderr
+++ b/src/test/ui/consts/miri_unleashed/inline_asm.stderr
@@ -1,5 +1,5 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/inline_asm.rs:11:14
+ --> $DIR/inline_asm.rs:10:14
|
LL | unsafe { asm!("nop"); }
| ^^^^^^^^^^^ inline assembly is not supported
@@ -7,7 +7,7 @@ LL | unsafe { asm!("nop"); }
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/inline_asm.rs:11:14
+ --> $DIR/inline_asm.rs:10:14
|
LL | unsafe { asm!("nop"); }
| ^^^^^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/mutable_references.rs b/src/test/ui/consts/miri_unleashed/mutable_references.rs
index ca927ef4a..4e9964647 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_references.rs
+++ b/src/test/ui/consts/miri_unleashed/mutable_references.rs
@@ -1,5 +1,4 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
use std::cell::UnsafeCell;
diff --git a/src/test/ui/consts/miri_unleashed/mutable_references.stderr b/src/test/ui/consts/miri_unleashed/mutable_references.stderr
index c6180c1e0..3ed96701a 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_references.stderr
+++ b/src/test/ui/consts/miri_unleashed/mutable_references.stderr
@@ -1,5 +1,5 @@
error[E0594]: cannot assign to `*OH_YES`, as `OH_YES` is an immutable static item
- --> $DIR/mutable_references.rs:36:5
+ --> $DIR/mutable_references.rs:35:5
|
LL | *OH_YES = 99;
| ^^^^^^^^^^^^ cannot assign
@@ -7,27 +7,27 @@ LL | *OH_YES = 99;
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references.rs:9:26
+ --> $DIR/mutable_references.rs:8:26
|
LL | static FOO: &&mut u32 = &&mut 42;
| ^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references.rs:13:23
+ --> $DIR/mutable_references.rs:12:23
|
LL | static BAR: &mut () = &mut ();
| ^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references.rs:18:28
+ --> $DIR/mutable_references.rs:17:28
|
LL | static BOO: &mut Foo<()> = &mut Foo(());
| ^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references.rs:26:8
+ --> $DIR/mutable_references.rs:25:8
|
LL | x: &UnsafeCell::new(42),
| ^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references.rs:30:27
+ --> $DIR/mutable_references.rs:29:27
|
LL | static OH_YES: &mut i32 = &mut 42;
| ^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr b/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
index 7ea35f70d..0ea179240 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
+++ b/src/test/ui/consts/miri_unleashed/mutable_references_err.32bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/mutable_references_err.rs:17:1
+ --> $DIR/mutable_references_err.rs:15:1
|
LL | const MUH: Meh = Meh {
| ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
@@ -10,7 +10,7 @@ LL | const MUH: Meh = Meh {
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/mutable_references_err.rs:27:1
+ --> $DIR/mutable_references_err.rs:25:1
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
@@ -21,7 +21,7 @@ LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/mutable_references_err.rs:31:1
+ --> $DIR/mutable_references_err.rs:29:1
|
LL | const BLUNT: &mut i32 = &mut 42;
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
@@ -34,17 +34,17 @@ LL | const BLUNT: &mut i32 = &mut 42;
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references_err.rs:18:8
+ --> $DIR/mutable_references_err.rs:16:8
|
LL | x: &UnsafeCell::new(42),
| ^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references_err.rs:27:27
+ --> $DIR/mutable_references_err.rs:25:27
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references_err.rs:31:25
+ --> $DIR/mutable_references_err.rs:29:25
|
LL | const BLUNT: &mut i32 = &mut 42;
| ^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr b/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
index 5ad398930..67959d256 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
+++ b/src/test/ui/consts/miri_unleashed/mutable_references_err.64bit.stderr
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
- --> $DIR/mutable_references_err.rs:17:1
+ --> $DIR/mutable_references_err.rs:15:1
|
LL | const MUH: Meh = Meh {
| ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in a `const`
@@ -10,7 +10,7 @@ LL | const MUH: Meh = Meh {
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/mutable_references_err.rs:27:1
+ --> $DIR/mutable_references_err.rs:25:1
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in a `const`
@@ -21,7 +21,7 @@ LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
}
error[E0080]: it is undefined behavior to use this value
- --> $DIR/mutable_references_err.rs:31:1
+ --> $DIR/mutable_references_err.rs:29:1
|
LL | const BLUNT: &mut i32 = &mut 42;
| ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference in a `const`
@@ -34,17 +34,17 @@ LL | const BLUNT: &mut i32 = &mut 42;
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references_err.rs:18:8
+ --> $DIR/mutable_references_err.rs:16:8
|
LL | x: &UnsafeCell::new(42),
| ^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references_err.rs:27:27
+ --> $DIR/mutable_references_err.rs:25:27
|
LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: skipping check that does not even have a feature gate
- --> $DIR/mutable_references_err.rs:31:25
+ --> $DIR/mutable_references_err.rs:29:25
|
LL | const BLUNT: &mut i32 = &mut 42;
| ^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/mutable_references_err.rs b/src/test/ui/consts/miri_unleashed/mutable_references_err.rs
index 722b9cf94..6399b122b 100644
--- a/src/test/ui/consts/miri_unleashed/mutable_references_err.rs
+++ b/src/test/ui/consts/miri_unleashed/mutable_references_err.rs
@@ -1,8 +1,6 @@
// stderr-per-bitwidth
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
-
use std::cell::UnsafeCell;
// this test ensures that our mutability story is sound
diff --git a/src/test/ui/consts/miri_unleashed/mutating_global.rs b/src/test/ui/consts/miri_unleashed/mutating_global.rs
index 902fe0aa1..231f4af0a 100644
--- a/src/test/ui/consts/miri_unleashed/mutating_global.rs
+++ b/src/test/ui/consts/miri_unleashed/mutating_global.rs
@@ -1,5 +1,4 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
// Make sure we cannot mutate globals.
diff --git a/src/test/ui/consts/miri_unleashed/mutating_global.stderr b/src/test/ui/consts/miri_unleashed/mutating_global.stderr
index ba9dd5619..c8770c8d7 100644
--- a/src/test/ui/consts/miri_unleashed/mutating_global.stderr
+++ b/src/test/ui/consts/miri_unleashed/mutating_global.stderr
@@ -1,5 +1,5 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/mutating_global.rs:10:9
+ --> $DIR/mutating_global.rs:9:9
|
LL | GLOBAL = 99
| ^^^^^^^^^^^ modifying a static's initial value from another static's initializer
diff --git a/src/test/ui/consts/miri_unleashed/non_const_fn.rs b/src/test/ui/consts/miri_unleashed/non_const_fn.rs
index 70da94df7..44ab60dca 100644
--- a/src/test/ui/consts/miri_unleashed/non_const_fn.rs
+++ b/src/test/ui/consts/miri_unleashed/non_const_fn.rs
@@ -1,7 +1,5 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
-
// A test demonstrating that we prevent calling non-const fn during CTFE.
fn foo() {}
diff --git a/src/test/ui/consts/miri_unleashed/non_const_fn.stderr b/src/test/ui/consts/miri_unleashed/non_const_fn.stderr
index 3e9658ad8..57836f796 100644
--- a/src/test/ui/consts/miri_unleashed/non_const_fn.stderr
+++ b/src/test/ui/consts/miri_unleashed/non_const_fn.stderr
@@ -1,5 +1,5 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/non_const_fn.rs:9:16
+ --> $DIR/non_const_fn.rs:7:16
|
LL | static C: () = foo();
| ^^^^^ calling non-const function `foo`
@@ -7,7 +7,7 @@ LL | static C: () = foo();
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/non_const_fn.rs:9:16
+ --> $DIR/non_const_fn.rs:7:16
|
LL | static C: () = foo();
| ^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/ptr_arith.rs b/src/test/ui/consts/miri_unleashed/ptr_arith.rs
index 13e6af36e..4d12960b8 100644
--- a/src/test/ui/consts/miri_unleashed/ptr_arith.rs
+++ b/src/test/ui/consts/miri_unleashed/ptr_arith.rs
@@ -1,6 +1,5 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
#![feature(core_intrinsics)]
-#![allow(const_err)]
// During CTFE, we prevent pointer-to-int casts.
// Pointer comparisons are prevented in the trait system.
@@ -8,7 +7,7 @@
static PTR_INT_CAST: () = {
let x = &0 as *const _ as usize;
//~^ ERROR could not evaluate static initializer
- //~| "exposing pointers" needs an rfc before being allowed inside constants
+ //~| exposing pointers
let _v = x == x;
};
@@ -19,4 +18,7 @@ static PTR_INT_TRANSMUTE: () = unsafe {
//~| unable to turn pointer into raw bytes
};
+// I'd love to test pointer comparison, but that is not possible since
+// their `PartialEq` impl is non-`const`.
+
fn main() {}
diff --git a/src/test/ui/consts/miri_unleashed/ptr_arith.stderr b/src/test/ui/consts/miri_unleashed/ptr_arith.stderr
index f67ac4802..30fd3a55e 100644
--- a/src/test/ui/consts/miri_unleashed/ptr_arith.stderr
+++ b/src/test/ui/consts/miri_unleashed/ptr_arith.stderr
@@ -1,11 +1,11 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/ptr_arith.rs:9:13
+ --> $DIR/ptr_arith.rs:8:13
|
LL | let x = &0 as *const _ as usize;
- | ^^^^^^^^^^^^^^^^^^^^^^^ "exposing pointers" needs an rfc before being allowed inside constants
+ | ^^^^^^^^^^^^^^^^^^^^^^^ exposing pointers is not possible at compile-time
error[E0080]: could not evaluate static initializer
- --> $DIR/ptr_arith.rs:17:14
+ --> $DIR/ptr_arith.rs:16:14
|
LL | let _v = x + 0;
| ^ unable to turn pointer into raw bytes
@@ -16,7 +16,7 @@ LL | let _v = x + 0;
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/ptr_arith.rs:9:13
+ --> $DIR/ptr_arith.rs:8:13
|
LL | let x = &0 as *const _ as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/raw_mutable_const.rs b/src/test/ui/consts/miri_unleashed/raw_mutable_const.rs
index cabd754e0..5f8ec4e6e 100644
--- a/src/test/ui/consts/miri_unleashed/raw_mutable_const.rs
+++ b/src/test/ui/consts/miri_unleashed/raw_mutable_const.rs
@@ -1,7 +1,5 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
-#![allow(const_err)]
-
use std::cell::UnsafeCell;
const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
diff --git a/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr b/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr
index e145f6dd2..f8dc11d69 100644
--- a/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr
+++ b/src/test/ui/consts/miri_unleashed/raw_mutable_const.stderr
@@ -1,5 +1,5 @@
error: untyped pointers are not allowed in constant
- --> $DIR/raw_mutable_const.rs:7:1
+ --> $DIR/raw_mutable_const.rs:5:1
|
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *m
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/raw_mutable_const.rs:7:38
+ --> $DIR/raw_mutable_const.rs:5:38
|
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/miri_unleashed/slice_eq.rs b/src/test/ui/consts/miri_unleashed/slice_eq.rs
index fd843105d..83e10bf12 100644
--- a/src/test/ui/consts/miri_unleashed/slice_eq.rs
+++ b/src/test/ui/consts/miri_unleashed/slice_eq.rs
@@ -4,14 +4,10 @@
#![feature(const_raw_ptr_comparison)]
const EMPTY_SLICE: &[i32] = &[];
-const EMPTY_EQ: bool = EMPTY_SLICE.as_ptr().guaranteed_eq(&[] as *const _);
-const EMPTY_EQ2: bool = EMPTY_SLICE.as_ptr().guaranteed_ne(&[] as *const _);
-const EMPTY_NE: bool = EMPTY_SLICE.as_ptr().guaranteed_ne(&[1] as *const _);
-const EMPTY_NE2: bool = EMPTY_SLICE.as_ptr().guaranteed_eq(&[1] as *const _);
+const EMPTY_EQ: Option<bool> = EMPTY_SLICE.as_ptr().guaranteed_eq(&[] as *const _);
+const EMPTY_EQ2: Option<bool> = EMPTY_SLICE.as_ptr().guaranteed_eq(&[1] as *const _);
fn main() {
- assert!(!EMPTY_EQ);
- assert!(!EMPTY_EQ2);
- assert!(!EMPTY_NE);
- assert!(!EMPTY_NE2);
+ assert!(EMPTY_EQ.is_none());
+ assert!(EMPTY_EQ2.is_none());
}
diff --git a/src/test/ui/consts/miri_unleashed/tls.rs b/src/test/ui/consts/miri_unleashed/tls.rs
index 7d4f8962a..d06d7cf19 100644
--- a/src/test/ui/consts/miri_unleashed/tls.rs
+++ b/src/test/ui/consts/miri_unleashed/tls.rs
@@ -1,6 +1,5 @@
// compile-flags: -Zunleash-the-miri-inside-of-you
#![feature(thread_local)]
-#![allow(const_err)]
use std::thread;
diff --git a/src/test/ui/consts/miri_unleashed/tls.stderr b/src/test/ui/consts/miri_unleashed/tls.stderr
index a49e50a3e..436c51123 100644
--- a/src/test/ui/consts/miri_unleashed/tls.stderr
+++ b/src/test/ui/consts/miri_unleashed/tls.stderr
@@ -1,11 +1,11 @@
error[E0080]: could not evaluate static initializer
- --> $DIR/tls.rs:12:25
+ --> $DIR/tls.rs:11:25
|
LL | unsafe { let _val = A; }
| ^ cannot access thread local static (DefId(0:6 ~ tls[78b0]::A))
error[E0080]: could not evaluate static initializer
- --> $DIR/tls.rs:19:26
+ --> $DIR/tls.rs:18:26
|
LL | unsafe { let _val = &A; }
| ^ cannot access thread local static (DefId(0:6 ~ tls[78b0]::A))
@@ -13,12 +13,12 @@ LL | unsafe { let _val = &A; }
warning: skipping const checks
|
help: skipping check that does not even have a feature gate
- --> $DIR/tls.rs:12:25
+ --> $DIR/tls.rs:11:25
|
LL | unsafe { let _val = A; }
| ^
help: skipping check that does not even have a feature gate
- --> $DIR/tls.rs:19:26
+ --> $DIR/tls.rs:18:26
|
LL | unsafe { let _val = &A; }
| ^
diff --git a/src/test/ui/consts/offset.rs b/src/test/ui/consts/offset.rs
index f9ddda554..b2c663fe6 100644
--- a/src/test/ui/consts/offset.rs
+++ b/src/test/ui/consts/offset.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(const_ptr_offset_from)]
use std::ptr;
#[repr(C)]
diff --git a/src/test/ui/consts/offset_from.rs b/src/test/ui/consts/offset_from.rs
index b53718316..465147041 100644
--- a/src/test/ui/consts/offset_from.rs
+++ b/src/test/ui/consts/offset_from.rs
@@ -1,6 +1,5 @@
// run-pass
-#![feature(const_ptr_offset_from)]
#![feature(const_ptr_sub_ptr)]
#![feature(ptr_sub_ptr)]
diff --git a/src/test/ui/consts/offset_from_ub.rs b/src/test/ui/consts/offset_from_ub.rs
index 1f29a6905..51163e650 100644
--- a/src/test/ui/consts/offset_from_ub.rs
+++ b/src/test/ui/consts/offset_from_ub.rs
@@ -1,4 +1,4 @@
-#![feature(const_ptr_offset_from)]
+#![feature(const_ptr_sub_ptr)]
#![feature(core_intrinsics)]
use std::intrinsics::{ptr_offset_from, ptr_offset_from_unsigned};
diff --git a/src/test/ui/consts/promote-not.rs b/src/test/ui/consts/promote-not.rs
index 6830b23cf..907617052 100644
--- a/src/test/ui/consts/promote-not.rs
+++ b/src/test/ui/consts/promote-not.rs
@@ -1,6 +1,6 @@
// ignore-tidy-linelength
// Test various things that we do not want to promote.
-#![allow(unconditional_panic, const_err)]
+#![allow(unconditional_panic)]
use std::cell::Cell;
diff --git a/src/test/ui/consts/ptr_comparisons.rs b/src/test/ui/consts/ptr_comparisons.rs
index 20233db09..f442e6138 100644
--- a/src/test/ui/consts/ptr_comparisons.rs
+++ b/src/test/ui/consts/ptr_comparisons.rs
@@ -14,38 +14,30 @@ const FOO: &usize = &42;
macro_rules! check {
(eq, $a:expr, $b:expr) => {
pub const _: () =
- assert!(std::intrinsics::ptr_guaranteed_eq($a as *const u8, $b as *const u8));
+ assert!(std::intrinsics::ptr_guaranteed_cmp($a as *const u8, $b as *const u8) == 1);
};
(ne, $a:expr, $b:expr) => {
pub const _: () =
- assert!(std::intrinsics::ptr_guaranteed_ne($a as *const u8, $b as *const u8));
+ assert!(std::intrinsics::ptr_guaranteed_cmp($a as *const u8, $b as *const u8) == 0);
};
- (!eq, $a:expr, $b:expr) => {
+ (!, $a:expr, $b:expr) => {
pub const _: () =
- assert!(!std::intrinsics::ptr_guaranteed_eq($a as *const u8, $b as *const u8));
- };
- (!ne, $a:expr, $b:expr) => {
- pub const _: () =
- assert!(!std::intrinsics::ptr_guaranteed_ne($a as *const u8, $b as *const u8));
+ assert!(std::intrinsics::ptr_guaranteed_cmp($a as *const u8, $b as *const u8) == 2);
};
}
check!(eq, 0, 0);
check!(ne, 0, 1);
-check!(!eq, 0, 1);
-check!(!ne, 0, 0);
check!(ne, FOO as *const _, 0);
-check!(!eq, FOO as *const _, 0);
+check!(ne, unsafe { (FOO as *const usize).offset(1) }, 0);
+check!(ne, unsafe { (FOO as *const usize as *const u8).offset(3) }, 0);
+
// We want pointers to be equal to themselves, but aren't checking this yet because
// there are some open questions (e.g. whether function pointers to the same function
// compare equal, they don't necessarily at runtime).
// The case tested here should work eventually, but does not work yet.
-check!(!eq, FOO as *const _, FOO as *const _);
-check!(ne, unsafe { (FOO as *const usize).offset(1) }, 0);
-check!(!eq, unsafe { (FOO as *const usize).offset(1) }, 0);
+check!(!, FOO as *const _, FOO as *const _);
-check!(ne, unsafe { (FOO as *const usize as *const u8).offset(3) }, 0);
-check!(!eq, unsafe { (FOO as *const usize as *const u8).offset(3) }, 0);
///////////////////////////////////////////////////////////////////////////////
// If any of the below start compiling, make sure to add a `check` test for it.
@@ -63,11 +55,9 @@ const _: *const u8 =
//~| out-of-bounds
const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
-//~^ ERROR any use of this value will cause an error
+//~^ ERROR evaluation of constant value failed
//~| unable to turn pointer into raw bytes
-//~| WARN this was previously accepted by the compiler but is being phased out
const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
-//~^ ERROR any use of this value will cause an error
+//~^ ERROR evaluation of constant value failed
//~| unable to turn pointer into raw bytes
-//~| WARN this was previously accepted by the compiler but is being phased out
diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr
index 1d47f243f..b71964b92 100644
--- a/src/test/ui/consts/ptr_comparisons.stderr
+++ b/src/test/ui/consts/ptr_comparisons.stderr
@@ -7,66 +7,35 @@ LL | unsafe { intrinsics::offset(self, count) }
| out-of-bounds pointer arithmetic: alloc3 has size $WORD, so pointer to $TWO_WORDS bytes starting at offset 0 is out-of-bounds
| inside `ptr::const_ptr::<impl *const usize>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
|
- ::: $DIR/ptr_comparisons.rs:58:34
+ ::: $DIR/ptr_comparisons.rs:50:34
|
LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
- | ------------------------------- inside `_` at $DIR/ptr_comparisons.rs:58:34
+ | ------------------------------- inside `_` at $DIR/ptr_comparisons.rs:50:34
error[E0080]: evaluation of constant value failed
- --> $DIR/ptr_comparisons.rs:61:33
+ --> $DIR/ptr_comparisons.rs:53:33
|
LL | unsafe { std::ptr::addr_of!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereferencing pointer failed: alloc3 has size $WORD, so pointer to 1000 bytes starting at offset 0 is out-of-bounds
-error: any use of this value will cause an error
- --> $DIR/ptr_comparisons.rs:65:27
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ptr_comparisons.rs:57:27
|
LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
- | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
-error: any use of this value will cause an error
- --> $DIR/ptr_comparisons.rs:70:27
+error[E0080]: evaluation of constant value failed
+ --> $DIR/ptr_comparisons.rs:61:27
|
LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
- | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
|
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
= help: this code performed an operation that depends on the underlying bytes representing a pointer
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ptr_comparisons.rs:65:27
- |
-LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
- | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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
-
-Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/ptr_comparisons.rs:70:27
- |
-LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
- | -------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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/src/test/ui/consts/qualif-indirect-mutation-fail.rs b/src/test/ui/consts/qualif-indirect-mutation-fail.rs
index f74a25a34..a6d293404 100644
--- a/src/test/ui/consts/qualif-indirect-mutation-fail.rs
+++ b/src/test/ui/consts/qualif-indirect-mutation-fail.rs
@@ -6,13 +6,13 @@
// Mutable borrow of a field with drop impl.
pub const fn f() {
- let mut a: (u32, Option<String>) = (0, None); //~ ERROR destructors cannot be evaluated
+ let mut a: (u32, Option<String>) = (0, None); //~ ERROR destructor of
let _ = &mut a.1;
}
// Mutable borrow of a type with drop impl.
pub const A1: () = {
- let mut x = None; //~ ERROR destructors cannot be evaluated
+ let mut x = None; //~ ERROR destructor of
let mut y = Some(String::new());
let a = &mut x;
let b = &mut y;
@@ -28,12 +28,12 @@ pub const A2: () = {
let b = &mut y;
std::mem::swap(a, b);
std::mem::forget(y);
- let _z = x; //~ ERROR destructors cannot be evaluated
+ let _z = x; //~ ERROR destructor of
};
// Shared borrow of a type that might be !Freeze and Drop.
pub const fn g1<T>() {
- let x: Option<T> = None; //~ ERROR destructors cannot be evaluated
+ let x: Option<T> = None; //~ ERROR destructor of
let _ = x.is_some();
}
@@ -41,24 +41,24 @@ pub const fn g1<T>() {
pub const fn g2<T>() {
let x: Option<T> = None;
let _ = x.is_some();
- let _y = x; //~ ERROR destructors cannot be evaluated
+ let _y = x; //~ ERROR destructor of
}
// Mutable raw reference to a Drop type.
pub const fn address_of_mut() {
- let mut x: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let mut x: Option<String> = None; //~ ERROR destructor of
&raw mut x;
- let mut y: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let mut y: Option<String> = None; //~ ERROR destructor of
std::ptr::addr_of_mut!(y);
}
// Const raw reference to a Drop type. Conservatively assumed to allow mutation
// until resolution of https://github.com/rust-lang/rust/issues/56604.
pub const fn address_of_const() {
- let x: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let x: Option<String> = None; //~ ERROR destructor of
&raw const x;
- let y: Option<String> = None; //~ ERROR destructors cannot be evaluated
+ let y: Option<String> = None; //~ ERROR destructor of
std::ptr::addr_of!(y);
}
diff --git a/src/test/ui/consts/qualif-indirect-mutation-fail.stderr b/src/test/ui/consts/qualif-indirect-mutation-fail.stderr
index 713df12b7..6379c00e4 100644
--- a/src/test/ui/consts/qualif-indirect-mutation-fail.stderr
+++ b/src/test/ui/consts/qualif-indirect-mutation-fail.stderr
@@ -1,56 +1,56 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(u32, Option<String>)` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:9:9
|
LL | let mut a: (u32, Option<String>) = (0, None);
- | ^^^^^ constant functions cannot evaluate destructors
+ | ^^^^^ the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:15:9
|
LL | let mut x = None;
- | ^^^^^ constants cannot evaluate destructors
+ | ^^^^^ the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:31:9
|
LL | let _z = x;
- | ^^ constants cannot evaluate destructors
+ | ^^ the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:36:9
|
LL | let x: Option<T> = None;
- | ^ constant functions cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<T>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:44:9
|
LL | let _y = x;
- | ^^ constant functions cannot evaluate destructors
+ | ^^ the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:52:9
|
LL | let mut y: Option<String> = None;
- | ^^^^^ constant functions cannot evaluate destructors
+ | ^^^^^ the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:49:9
|
LL | let mut x: Option<String> = None;
- | ^^^^^ constant functions cannot evaluate destructors
+ | ^^^^^ the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:62:9
|
LL | let y: Option<String> = None;
- | ^ constant functions cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Option<String>` cannot be evaluated at compile-time
--> $DIR/qualif-indirect-mutation-fail.rs:59:9
|
LL | let x: Option<String> = None;
- | ^ constant functions cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constant functions
error: aborting due to 9 previous errors
diff --git a/src/test/ui/consts/raw-ptr-const.rs b/src/test/ui/consts/raw-ptr-const.rs
index 00fad046b..b9c542d03 100644
--- a/src/test/ui/consts/raw-ptr-const.rs
+++ b/src/test/ui/consts/raw-ptr-const.rs
@@ -1,5 +1,3 @@
-#![allow(const_err)] // make sure we hit the `delay_span_bug`
-
// This is a regression test for a `delay_span_bug` during interning when a constant
// evaluates to a (non-dangling) raw pointer. For now this errors; potentially it
// could also be allowed.
diff --git a/src/test/ui/consts/raw-ptr-const.stderr b/src/test/ui/consts/raw-ptr-const.stderr
index 0ebe1e95c..f7b53433b 100644
--- a/src/test/ui/consts/raw-ptr-const.stderr
+++ b/src/test/ui/consts/raw-ptr-const.stderr
@@ -1,5 +1,5 @@
error: untyped pointers are not allowed in constant
- --> $DIR/raw-ptr-const.rs:7:1
+ --> $DIR/raw-ptr-const.rs:5:1
|
LL | const CONST_RAW: *const Vec<i32> = &Vec::new() as *const _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/consts/recursive.rs b/src/test/ui/consts/recursive.rs
index 664940c52..5d736e31b 100644
--- a/src/test/ui/consts/recursive.rs
+++ b/src/test/ui/consts/recursive.rs
@@ -2,8 +2,7 @@
const fn f<T>(x: T) { //~ WARN function cannot return without recursing
f(x);
- //~^ ERROR any use of this value will cause an error
- //~| WARN this was previously accepted by the compiler
+ //~^ ERROR evaluation of constant value failed
}
const X: () = f(1);
diff --git a/src/test/ui/consts/recursive.stderr b/src/test/ui/consts/recursive.stderr
index 647ed1db2..14fa3da7a 100644
--- a/src/test/ui/consts/recursive.stderr
+++ b/src/test/ui/consts/recursive.stderr
@@ -6,10 +6,10 @@ LL | const fn f<T>(x: T) {
LL | f(x);
| ---- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
-error: any use of this value will cause an error
+error[E0080]: evaluation of constant value failed
--> $DIR/recursive.rs:4:5
|
LL | f(x);
@@ -18,33 +18,10 @@ LL | f(x);
| reached the configured maximum number of stack frames
| inside `f::<i32>` at $DIR/recursive.rs:4:5
| [... 126 additional calls inside `f::<i32>` at $DIR/recursive.rs:4:5 ...]
- | inside `X` at $DIR/recursive.rs:9:15
...
LL | const X: () = f(1);
- | -----------
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ---- inside `X` at $DIR/recursive.rs:8:15
error: aborting due to previous error; 1 warning emitted
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/recursive.rs:4:5
- |
-LL | f(x);
- | ^^^^
- | |
- | reached the configured maximum number of stack frames
- | inside `f::<i32>` at $DIR/recursive.rs:4:5
- | [... 126 additional calls inside `f::<i32>` at $DIR/recursive.rs:4:5 ...]
- | inside `X` at $DIR/recursive.rs:9:15
-...
-LL | const X: () = f(1);
- | -----------
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
+For more information about this error, try `rustc --explain E0080`.
diff --git a/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr b/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr
index 4f2f5e244..3855b5f2a 100644
--- a/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr
+++ b/src/test/ui/consts/refs_check_const_eq-issue-88384.stderr
@@ -4,8 +4,8 @@ warning: the feature `adt_const_params` is incomplete and may not be safe to use
LL | #![feature(adt_const_params)]
| ^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0741]: using function pointers as const generic parameters is forbidden
--> $DIR/refs_check_const_eq-issue-88384.rs:10:21
diff --git a/src/test/ui/consts/stable-precise-live-drops-in-libcore.rs b/src/test/ui/consts/stable-precise-live-drops-in-libcore.rs
index 2b970390f..7cd3dbec9 100644
--- a/src/test/ui/consts/stable-precise-live-drops-in-libcore.rs
+++ b/src/test/ui/consts/stable-precise-live-drops-in-libcore.rs
@@ -11,7 +11,7 @@ impl<T> Either<T, T> {
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "foo", since = "1.0.0")]
pub const fn unwrap(self) -> T {
- //~^ ERROR destructors cannot be evaluated at compile-time
+ //~^ ERROR destructor of
match self {
Self::Left(t) => t,
Self::Right(t) => t,
diff --git a/src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr b/src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr
index a3f513541..5f70391ee 100644
--- a/src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr
+++ b/src/test/ui/consts/stable-precise-live-drops-in-libcore.stderr
@@ -1,8 +1,8 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `Either<T, T>` cannot be evaluated at compile-time
--> $DIR/stable-precise-live-drops-in-libcore.rs:13:25
|
LL | pub const fn unwrap(self) -> T {
- | ^^^^ constant functions cannot evaluate destructors
+ | ^^^^ the destructor for this type cannot be evaluated in constant functions
...
LL | }
| - value is dropped here
diff --git a/src/test/ui/consts/trait_specialization.stderr b/src/test/ui/consts/trait_specialization.stderr
index e80821cf4..10bebe8eb 100644
--- a/src/test/ui/consts/trait_specialization.stderr
+++ b/src/test/ui/consts/trait_specialization.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/consts/uninhabited-const-issue-61744.rs b/src/test/ui/consts/uninhabited-const-issue-61744.rs
index 860628c39..a07c39882 100644
--- a/src/test/ui/consts/uninhabited-const-issue-61744.rs
+++ b/src/test/ui/consts/uninhabited-const-issue-61744.rs
@@ -1,8 +1,7 @@
// build-fail
pub const unsafe fn fake_type<T>() -> T {
- hint_unreachable() //~ ERROR any use of this value will cause an error [const_err]
- //~| WARN this was previously accepted by the compiler but is being phased out
+ hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
}
pub const unsafe fn hint_unreachable() -> ! {
diff --git a/src/test/ui/consts/uninhabited-const-issue-61744.stderr b/src/test/ui/consts/uninhabited-const-issue-61744.stderr
index d31777847..9c7cc8861 100644
--- a/src/test/ui/consts/uninhabited-const-issue-61744.stderr
+++ b/src/test/ui/consts/uninhabited-const-issue-61744.stderr
@@ -1,4 +1,4 @@
-error: any use of this value will cause an error
+error[E0080]: evaluation of `<i32 as Const>::CONSTANT` failed
--> $DIR/uninhabited-const-issue-61744.rs:4:5
|
LL | hint_unreachable()
@@ -6,143 +6,142 @@ LL | hint_unreachable()
| |
| reached the configured maximum number of stack frames
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
| inside `fake_type::<i32>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `<i32 as Const>::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:13:36
+...
+LL | fake_type()
+ | -----------
+ | |
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
+ | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:8:5
...
LL | const CONSTANT: i32 = unsafe { fake_type() };
- | -------------------
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
+ | ----------- inside `<i32 as Const>::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:12:36
error[E0080]: erroneous constant used
- --> $DIR/uninhabited-const-issue-61744.rs:19:10
+ --> $DIR/uninhabited-const-issue-61744.rs:18:10
|
LL | dbg!(i32::CONSTANT);
| ^^^^^^^^^^^^^ referenced constant has errors
@@ -150,147 +149,3 @@ LL | dbg!(i32::CONSTANT);
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: any use of this value will cause an error
- --> $DIR/uninhabited-const-issue-61744.rs:4:5
- |
-LL | hint_unreachable()
- | ^^^^^^^^^^^^^^^^^^
- | |
- | reached the configured maximum number of stack frames
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<!>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5
- | inside `fake_type::<i32>` at $DIR/uninhabited-const-issue-61744.rs:4:5
- | inside `<i32 as Const>::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:13:36
-...
-LL | const CONSTANT: i32 = unsafe { fake_type() };
- | -------------------
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/consts/unnormalized-param-env.rs b/src/test/ui/consts/unnormalized-param-env.rs
new file mode 100644
index 000000000..a7bbe4db9
--- /dev/null
+++ b/src/test/ui/consts/unnormalized-param-env.rs
@@ -0,0 +1,31 @@
+// check-pass
+
+pub trait CSpace<const N: usize> {
+ type Traj;
+}
+
+pub struct Const<const R: usize>;
+
+pub trait Obstacle<CS, const N: usize> {
+ fn trajectory_free<FT, S1>(&self, t: &FT)
+ where
+ CS::Traj: Sized,
+ CS: CSpace<N>;
+}
+
+// -----
+
+const N: usize = 4;
+
+struct ObstacleSpace2df32;
+
+impl<CS> Obstacle<CS, N> for ObstacleSpace2df32 {
+ fn trajectory_free<TF, S1>(&self, t: &TF)
+ where
+ CS::Traj: Sized,
+ CS: CSpace<N>,
+ {
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.rs b/src/test/ui/consts/unstable-const-fn-in-libcore.rs
index 16b36c8d5..ca4ed8f0b 100644
--- a/src/test/ui/consts/unstable-const-fn-in-libcore.rs
+++ b/src/test/ui/consts/unstable-const-fn-in-libcore.rs
@@ -4,7 +4,7 @@
// gate was not enabled in libcore.
#![stable(feature = "core", since = "1.6.0")]
-#![feature(staged_api)]
+#![feature(staged_api, const_trait_impl)]
enum Opt<T> {
Some(T),
@@ -14,12 +14,12 @@ enum Opt<T> {
impl<T> Opt<T> {
#[rustc_const_unstable(feature = "foo", issue = "none")]
#[stable(feature = "rust1", since = "1.0.0")]
- const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
- //~^ ERROR destructors cannot be evaluated at compile-time
- //~| ERROR destructors cannot be evaluated at compile-time
+ const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
+ //~^ ERROR destructor of
+ //~| ERROR destructor of
match self {
Opt::Some(t) => t,
- Opt::None => f(), //~ ERROR E0015
+ Opt::None => f(),
}
}
}
diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr
index 180f9f10c..e5b00dd07 100644
--- a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr
+++ b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr
@@ -1,34 +1,21 @@
-error[E0015]: cannot call non-const closure in constant functions
- --> $DIR/unstable-const-fn-in-libcore.rs:22:26
+error[E0493]: destructor of `F` cannot be evaluated at compile-time
+ --> $DIR/unstable-const-fn-in-libcore.rs:17:60
|
-LL | Opt::None => f(),
- | ^^^
- |
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-help: consider further restricting this bound
- |
-LL | const fn unwrap_or_else<F: FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T {
- | +++++++++++++++++++++++++++++
-
-error[E0493]: destructors cannot be evaluated at compile-time
- --> $DIR/unstable-const-fn-in-libcore.rs:17:53
- |
-LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
- | ^ constant functions cannot evaluate destructors
+LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
+ | ^ the destructor for this type cannot be evaluated in constant functions
...
LL | }
| - value is dropped here
-error[E0493]: destructors cannot be evaluated at compile-time
- --> $DIR/unstable-const-fn-in-libcore.rs:17:47
+error[E0493]: destructor of `Opt<T>` cannot be evaluated at compile-time
+ --> $DIR/unstable-const-fn-in-libcore.rs:17:54
|
-LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
- | ^^^^ constant functions cannot evaluate destructors
+LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
+ | ^^^^ the destructor for this type cannot be evaluated in constant functions
...
LL | }
| - value is dropped here
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0015, E0493.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0493`.
diff --git a/src/test/ui/consts/write_to_static_via_mut_ref.rs b/src/test/ui/consts/write_to_static_via_mut_ref.rs
index 665c305e9..39b830ae4 100644
--- a/src/test/ui/consts/write_to_static_via_mut_ref.rs
+++ b/src/test/ui/consts/write_to_static_via_mut_ref.rs
@@ -1,5 +1,4 @@
#![feature(const_mut_refs)]
-#![allow(const_err)]
static OH_NO: &mut i32 = &mut 42; //~ ERROR mutable references are not allowed
fn main() {
diff --git a/src/test/ui/consts/write_to_static_via_mut_ref.stderr b/src/test/ui/consts/write_to_static_via_mut_ref.stderr
index d19e998d6..f64f0db6b 100644
--- a/src/test/ui/consts/write_to_static_via_mut_ref.stderr
+++ b/src/test/ui/consts/write_to_static_via_mut_ref.stderr
@@ -1,11 +1,11 @@
error[E0764]: mutable references are not allowed in the final value of statics
- --> $DIR/write_to_static_via_mut_ref.rs:4:26
+ --> $DIR/write_to_static_via_mut_ref.rs:3:26
|
LL | static OH_NO: &mut i32 = &mut 42;
| ^^^^^^^
error[E0594]: cannot assign to `*OH_NO`, as `OH_NO` is an immutable static item
- --> $DIR/write_to_static_via_mut_ref.rs:7:5
+ --> $DIR/write_to_static_via_mut_ref.rs:6:5
|
LL | *OH_NO = 43;
| ^^^^^^^^^^^ cannot assign
diff --git a/src/test/ui/cycle-trait/cycle-trait-default-type-trait.rs b/src/test/ui/cycle-trait/cycle-trait-default-type-trait.rs
index b2edc1a1f..6175b7df1 100644
--- a/src/test/ui/cycle-trait/cycle-trait-default-type-trait.rs
+++ b/src/test/ui/cycle-trait/cycle-trait-default-type-trait.rs
@@ -3,7 +3,6 @@
trait Foo<X = Box<dyn Foo>> {
//~^ ERROR cycle detected
- //~| ERROR cycle detected
}
fn main() { }
diff --git a/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr b/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr
index d4976a0f9..9d715f494 100644
--- a/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr
+++ b/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr
@@ -10,30 +10,11 @@ note: cycle used when collecting item types in top-level module
|
LL | / trait Foo<X = Box<dyn Foo>> {
LL | |
-LL | |
-LL | | }
-LL | |
-LL | | fn main() { }
- | |_____________^
-
-error[E0391]: cycle detected when computing type of `Foo::X`
- --> $DIR/cycle-trait-default-type-trait.rs:4:23
- |
-LL | trait Foo<X = Box<dyn Foo>> {
- | ^^^
- |
- = note: ...which immediately requires computing type of `Foo::X` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/cycle-trait-default-type-trait.rs:4:1
- |
-LL | / trait Foo<X = Box<dyn Foo>> {
-LL | |
-LL | |
LL | | }
LL | |
LL | | fn main() { }
| |_____________^
-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/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs b/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs
index 043011b33..ff764015d 100644
--- a/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs
+++ b/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs
@@ -1,6 +1,7 @@
// build-pass
+// only-linux
//
-// compile-flags: -g --emit=llvm-ir -Zunstable-options -Csplit-debuginfo=unpacked
+// compile-flags: -g --emit=llvm-ir -Csplit-debuginfo=unpacked
//
// Make sure that we don't explode with an error if we don't actually end up emitting any `dwo`s,
// as would be the case if we don't actually codegen anything.
diff --git a/src/test/ui/deprecation/deprecation-lint.rs b/src/test/ui/deprecation/deprecation-lint.rs
index 65cc4e2ef..0417e952e 100644
--- a/src/test/ui/deprecation/deprecation-lint.rs
+++ b/src/test/ui/deprecation/deprecation-lint.rs
@@ -51,7 +51,7 @@ mod cross_crate {
let _ = nested::DeprecatedTupleStruct (1); //~ ERROR use of deprecated tuple struct `deprecation_lint::nested::DeprecatedTupleStruct`: text
- // At the moment, the lint checker only checks stability in
+ // At the moment, the lint checker only checks stability
// in the arguments of macros.
// Eventually, we will want to lint the contents of the
// macro in the module *defining* it. Also, stability levels
diff --git a/src/test/ui/deprecation/deprecation-sanity.stderr b/src/test/ui/deprecation/deprecation-sanity.stderr
index 973c672df..8b2b480d1 100644
--- a/src/test/ui/deprecation/deprecation-sanity.stderr
+++ b/src/test/ui/deprecation/deprecation-sanity.stderr
@@ -44,7 +44,9 @@ error[E0565]: literal in `deprecated` value must be a string
--> $DIR/deprecation-sanity.rs:19:25
|
LL | #[deprecated(note = b"test")]
- | ^^^^^^^ help: consider removing the prefix: `"test"`
+ | -^^^^^^
+ | |
+ | help: consider removing the prefix
error[E0565]: item in `deprecated` must be a key/value pair
--> $DIR/deprecation-sanity.rs:22:18
diff --git a/src/test/ui/derive-uninhabited-enum-38885.stderr b/src/test/ui/derive-uninhabited-enum-38885.stderr
index bd36a2568..dcdf8f843 100644
--- a/src/test/ui/derive-uninhabited-enum-38885.stderr
+++ b/src/test/ui/derive-uninhabited-enum-38885.stderr
@@ -7,8 +7,8 @@ LL | Bar(u8),
LL | Void(Void),
| ^^^^
|
- = note: `-W dead-code` implied by `-W unused`
= note: `Foo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
+ = note: `-W dead-code` implied by `-W unused`
warning: 1 warning emitted
diff --git a/src/test/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr b/src/test/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr
index baf34b46d..512b870fa 100644
--- a/src/test/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr
+++ b/src/test/ui/derives/clone-debug-dead-code-in-the-same-struct.stderr
@@ -13,12 +13,12 @@ LL | field3: (),
LL | field4: (),
| ^^^^^^
|
+ = note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
note: the lint level is defined here
--> $DIR/clone-debug-dead-code-in-the-same-struct.rs:1:11
|
LL | #![forbid(dead_code)]
| ^^^^^^^^^
- = note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
error: aborting due to previous error
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs
index d66faa086..67a27729d 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs
@@ -7,7 +7,6 @@ struct Error;
enum Enum {
A {
x: Error //~ ERROR
-//~^ ERROR
}
}
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
index f655600b7..9953154fd 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr
@@ -18,26 +18,6 @@ help: consider annotating `Error` with `#[derive(PartialEq)]`
LL | #[derive(PartialEq)]
|
-error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:9:6
- |
-LL | #[derive(PartialEq)]
- | --------- in this derive macro expansion
-...
-LL | x: Error
- | ^^^^^^^^
- |
-note: an implementation of `PartialEq<_>` might be missing for `Error`
- --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:4:1
- |
-LL | struct Error;
- | ^^^^^^^^^^^^ must implement `PartialEq<_>`
- = 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)]
- |
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum.rs b/src/test/ui/derives/derives-span-PartialEq-enum.rs
index 66edf460b..0becc7e0d 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-enum.rs
@@ -7,8 +7,7 @@ struct Error;
enum Enum {
A(
Error //~ ERROR
-//~^ ERROR
- )
+ )
}
fn main() {}
diff --git a/src/test/ui/derives/derives-span-PartialEq-enum.stderr b/src/test/ui/derives/derives-span-PartialEq-enum.stderr
index ce4b00bfb..7c1304523 100644
--- a/src/test/ui/derives/derives-span-PartialEq-enum.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-enum.stderr
@@ -18,26 +18,6 @@ help: consider annotating `Error` with `#[derive(PartialEq)]`
LL | #[derive(PartialEq)]
|
-error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-enum.rs:9:6
- |
-LL | #[derive(PartialEq)]
- | --------- in this derive macro expansion
-...
-LL | Error
- | ^^^^^
- |
-note: an implementation of `PartialEq<_>` might be missing for `Error`
- --> $DIR/derives-span-PartialEq-enum.rs:4:1
- |
-LL | struct Error;
- | ^^^^^^^^^^^^ must implement `PartialEq<_>`
- = 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)]
- |
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
diff --git a/src/test/ui/derives/derives-span-PartialEq-struct.rs b/src/test/ui/derives/derives-span-PartialEq-struct.rs
index ce5c67af7..c92ef5fad 100644
--- a/src/test/ui/derives/derives-span-PartialEq-struct.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-struct.rs
@@ -6,7 +6,6 @@ struct Error;
#[derive(PartialEq)]
struct Struct {
x: Error //~ ERROR
-//~^ ERROR
}
fn main() {}
diff --git a/src/test/ui/derives/derives-span-PartialEq-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-struct.stderr
index c5c8f255f..ba3d6ced3 100644
--- a/src/test/ui/derives/derives-span-PartialEq-struct.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-struct.stderr
@@ -18,26 +18,6 @@ help: consider annotating `Error` with `#[derive(PartialEq)]`
LL | #[derive(PartialEq)]
|
-error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-struct.rs:8:5
- |
-LL | #[derive(PartialEq)]
- | --------- in this derive macro expansion
-LL | struct Struct {
-LL | x: Error
- | ^^^^^^^^
- |
-note: an implementation of `PartialEq<_>` might be missing for `Error`
- --> $DIR/derives-span-PartialEq-struct.rs:4:1
- |
-LL | struct Error;
- | ^^^^^^^^^^^^ must implement `PartialEq<_>`
- = 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)]
- |
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
diff --git a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs
index eaa628311..10ac347aa 100644
--- a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs
+++ b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs
@@ -6,7 +6,6 @@ struct Error;
#[derive(PartialEq)]
struct Struct(
Error //~ ERROR
-//~^ ERROR
);
fn main() {}
diff --git a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr
index f5d609cb3..ab0b56a9e 100644
--- a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr
+++ b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr
@@ -18,26 +18,6 @@ help: consider annotating `Error` with `#[derive(PartialEq)]`
LL | #[derive(PartialEq)]
|
-error[E0369]: binary operation `!=` cannot be applied to type `Error`
- --> $DIR/derives-span-PartialEq-tuple-struct.rs:8:5
- |
-LL | #[derive(PartialEq)]
- | --------- in this derive macro expansion
-LL | struct Struct(
-LL | Error
- | ^^^^^
- |
-note: an implementation of `PartialEq<_>` might be missing for `Error`
- --> $DIR/derives-span-PartialEq-tuple-struct.rs:4:1
- |
-LL | struct Error;
- | ^^^^^^^^^^^^ must implement `PartialEq<_>`
- = 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)]
- |
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.
diff --git a/src/test/ui/derives/deriving-copyclone.stderr b/src/test/ui/derives/deriving-copyclone.stderr
index 13097edf0..80e2dd7fe 100644
--- a/src/test/ui/derives/deriving-copyclone.stderr
+++ b/src/test/ui/derives/deriving-copyclone.stderr
@@ -2,11 +2,11 @@ error[E0277]: the trait bound `B<C>: Copy` is not satisfied
--> $DIR/deriving-copyclone.rs:31:13
|
LL | is_copy(B { a: 1, b: C });
- | ------- ^^^^^^^^^^^^^^^^ expected an implementor of trait `Copy`
+ | ------- ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `B<C>`
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Copy` for `B<C>`
+note: required for `B<C>` to implement `Copy`
--> $DIR/deriving-copyclone.rs:9:10
|
LL | #[derive(Copy, Clone)]
@@ -26,11 +26,11 @@ error[E0277]: the trait bound `B<C>: Clone` is not satisfied
--> $DIR/deriving-copyclone.rs:32:14
|
LL | is_clone(B { a: 1, b: C });
- | -------- ^^^^^^^^^^^^^^^^ expected an implementor of trait `Clone`
+ | -------- ^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `B<C>`
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Clone` for `B<C>`
+note: required for `B<C>` to implement `Clone`
--> $DIR/deriving-copyclone.rs:9:16
|
LL | #[derive(Copy, Clone)]
@@ -50,11 +50,11 @@ error[E0277]: the trait bound `B<D>: Copy` is not satisfied
--> $DIR/deriving-copyclone.rs:35:13
|
LL | is_copy(B { a: 1, b: D });
- | ------- ^^^^^^^^^^^^^^^^ expected an implementor of trait `Copy`
+ | ------- ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `B<D>`
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Copy` for `B<D>`
+note: required for `B<D>` to implement `Copy`
--> $DIR/deriving-copyclone.rs:9:10
|
LL | #[derive(Copy, Clone)]
diff --git a/src/test/ui/derives/deriving-no-inner-impl-error-message.rs b/src/test/ui/derives/deriving-no-inner-impl-error-message.rs
index 39e41a59e..b3ce31bf0 100644
--- a/src/test/ui/derives/deriving-no-inner-impl-error-message.rs
+++ b/src/test/ui/derives/deriving-no-inner-impl-error-message.rs
@@ -3,7 +3,6 @@ struct NoCloneOrEq;
#[derive(PartialEq)]
struct E {
x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `NoCloneOrEq`
- //~^ ERROR binary operation `!=` cannot be applied to type `NoCloneOrEq`
}
#[derive(Clone)]
struct C {
diff --git a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr
index 7875f0723..ef8c44caa 100644
--- a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr
+++ b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr
@@ -18,28 +18,8 @@ help: consider annotating `NoCloneOrEq` with `#[derive(PartialEq)]`
LL | #[derive(PartialEq)]
|
-error[E0369]: binary operation `!=` cannot be applied to type `NoCloneOrEq`
- --> $DIR/deriving-no-inner-impl-error-message.rs:5:5
- |
-LL | #[derive(PartialEq)]
- | --------- in this derive macro expansion
-LL | struct E {
-LL | x: NoCloneOrEq
- | ^^^^^^^^^^^^^^
- |
-note: an implementation of `PartialEq<_>` might be missing for `NoCloneOrEq`
- --> $DIR/deriving-no-inner-impl-error-message.rs:1:1
- |
-LL | struct NoCloneOrEq;
- | ^^^^^^^^^^^^^^^^^^ must implement `PartialEq<_>`
- = 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)]
- |
-
error[E0277]: the trait bound `NoCloneOrEq: Clone` is not satisfied
- --> $DIR/deriving-no-inner-impl-error-message.rs:10:5
+ --> $DIR/deriving-no-inner-impl-error-message.rs:9:5
|
LL | #[derive(Clone)]
| ----- in this derive macro expansion
@@ -53,7 +33,7 @@ help: consider annotating `NoCloneOrEq` with `#[derive(Clone)]`
LL | #[derive(Clone)]
|
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0369.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/derives/deriving-with-repr-packed.stderr b/src/test/ui/derives/deriving-with-repr-packed.stderr
index d3fe550c3..0ad800c39 100644
--- a/src/test/ui/derives/deriving-with-repr-packed.stderr
+++ b/src/test/ui/derives/deriving-with-repr-packed.stderr
@@ -4,13 +4,13 @@ error: `Clone` can't be derived on this `#[repr(packed)]` struct with type or co
LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
| ^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
note: the lint level is defined here
--> $DIR/deriving-with-repr-packed.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `PartialEq` can't be derived on this `#[repr(packed)]` struct with type or const parameters
@@ -52,13 +52,13 @@ error: `Clone` can't be derived on this `#[repr(packed)]` struct with type or co
LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
| ^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
note: the lint level is defined here
--> $DIR/deriving-with-repr-packed.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -68,13 +68,13 @@ error: `PartialEq` can't be derived on this `#[repr(packed)]` struct with type o
LL | #[derive(Copy, Clone, Default, PartialEq, Eq)]
| ^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
note: the lint level is defined here
--> $DIR/deriving-with-repr-packed.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -84,13 +84,13 @@ error: `Hash` can't be derived on this `#[repr(packed)]` struct that does not de
LL | #[derive(Default, Hash)]
| ^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
note: the lint level is defined here
--> $DIR/deriving-with-repr-packed.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -100,12 +100,12 @@ error: `Debug` can't be derived on this `#[repr(packed)]` struct that does not d
LL | #[derive(Debug, Default)]
| ^^^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
note: the lint level is defined here
--> $DIR/deriving-with-repr-packed.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/deriving/deriving-all-codegen.rs b/src/test/ui/deriving/deriving-all-codegen.rs
index aef79ae8a..ba7809413 100644
--- a/src/test/ui/deriving/deriving-all-codegen.rs
+++ b/src/test/ui/deriving/deriving-all-codegen.rs
@@ -85,7 +85,7 @@ enum Mixed {
P,
Q,
R(u32),
- S { d1: u32, d2: u32 },
+ S { d1: Option<u32>, d2: Option<i32> },
}
// An enum with no fieldless variants. Note that `Default` cannot be derived
diff --git a/src/test/ui/deriving/deriving-all-codegen.stdout b/src/test/ui/deriving/deriving-all-codegen.stdout
index 21fe663f0..92fce6888 100644
--- a/src/test/ui/deriving/deriving-all-codegen.stdout
+++ b/src/test/ui/deriving/deriving-all-codegen.stdout
@@ -46,13 +46,15 @@ impl ::core::default::Default for Empty {
impl ::core::hash::Hash for Empty {
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
}
-impl ::core::marker::StructuralPartialEq for Empty {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Empty { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Empty {
#[inline]
fn eq(&self, other: &Empty) -> bool { true }
}
-impl ::core::marker::StructuralEq for Empty {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Empty { }
#[automatically_derived]
impl ::core::cmp::Eq for Empty {
#[inline]
@@ -115,19 +117,17 @@ impl ::core::hash::Hash for Point {
::core::hash::Hash::hash(&self.y, state)
}
}
-impl ::core::marker::StructuralPartialEq for Point {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Point { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Point {
#[inline]
fn eq(&self, other: &Point) -> bool {
self.x == other.x && self.y == other.y
}
- #[inline]
- fn ne(&self, other: &Point) -> bool {
- self.x != other.x || self.y != other.y
- }
}
-impl ::core::marker::StructuralEq for Point {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Point { }
#[automatically_derived]
impl ::core::cmp::Eq for Point {
#[inline]
@@ -229,7 +229,8 @@ impl ::core::hash::Hash for Big {
::core::hash::Hash::hash(&self.b8, state)
}
}
-impl ::core::marker::StructuralPartialEq for Big {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Big { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Big {
#[inline]
@@ -239,15 +240,9 @@ impl ::core::cmp::PartialEq for Big {
self.b6 == other.b6 && self.b7 == other.b7 &&
self.b8 == other.b8
}
- #[inline]
- fn ne(&self, other: &Big) -> bool {
- self.b1 != other.b1 || self.b2 != other.b2 || self.b3 != other.b3 ||
- self.b4 != other.b4 || self.b5 != other.b5 ||
- self.b6 != other.b6 || self.b7 != other.b7 ||
- self.b8 != other.b8
- }
}
-impl ::core::marker::StructuralEq for Big {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Big { }
#[automatically_derived]
impl ::core::cmp::Eq for Big {
#[inline]
@@ -356,15 +351,15 @@ impl ::core::hash::Hash for Unsized {
::core::hash::Hash::hash(&self.0, state)
}
}
-impl ::core::marker::StructuralPartialEq for Unsized {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Unsized { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Unsized {
#[inline]
fn eq(&self, other: &Unsized) -> bool { self.0 == other.0 }
- #[inline]
- fn ne(&self, other: &Unsized) -> bool { self.0 != other.0 }
}
-impl ::core::marker::StructuralEq for Unsized {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Unsized { }
#[automatically_derived]
impl ::core::cmp::Eq for Unsized {
#[inline]
@@ -423,15 +418,15 @@ impl ::core::hash::Hash for PackedCopy {
::core::hash::Hash::hash(&{ self.0 }, state)
}
}
-impl ::core::marker::StructuralPartialEq for PackedCopy {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for PackedCopy { }
#[automatically_derived]
impl ::core::cmp::PartialEq for PackedCopy {
#[inline]
fn eq(&self, other: &PackedCopy) -> bool { { self.0 } == { other.0 } }
- #[inline]
- fn ne(&self, other: &PackedCopy) -> bool { { self.0 } != { other.0 } }
}
-impl ::core::marker::StructuralEq for PackedCopy {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for PackedCopy { }
#[automatically_derived]
impl ::core::cmp::Eq for PackedCopy {
#[inline]
@@ -494,7 +489,8 @@ impl ::core::hash::Hash for PackedNonCopy {
::core::hash::Hash::hash(__self_0_0, state)
}
}
-impl ::core::marker::StructuralPartialEq for PackedNonCopy {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for PackedNonCopy { }
#[automatically_derived]
impl ::core::cmp::PartialEq for PackedNonCopy {
#[inline]
@@ -503,14 +499,9 @@ impl ::core::cmp::PartialEq for PackedNonCopy {
let Self(ref __self_1_0) = *other;
*__self_0_0 == *__self_1_0
}
- #[inline]
- fn ne(&self, other: &PackedNonCopy) -> bool {
- let Self(ref __self_0_0) = *self;
- let Self(ref __self_1_0) = *other;
- *__self_0_0 != *__self_1_0
- }
}
-impl ::core::marker::StructuralEq for PackedNonCopy {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for PackedNonCopy { }
#[automatically_derived]
impl ::core::cmp::Eq for PackedNonCopy {
#[inline]
@@ -561,7 +552,8 @@ impl ::core::hash::Hash for Enum0 {
unsafe { ::core::intrinsics::unreachable() }
}
}
-impl ::core::marker::StructuralPartialEq for Enum0 {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Enum0 { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Enum0 {
#[inline]
@@ -569,7 +561,8 @@ impl ::core::cmp::PartialEq for Enum0 {
unsafe { ::core::intrinsics::unreachable() }
}
}
-impl ::core::marker::StructuralEq for Enum0 {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Enum0 { }
#[automatically_derived]
impl ::core::cmp::Eq for Enum0 {
#[inline]
@@ -628,7 +621,8 @@ impl ::core::hash::Hash for Enum1 {
}
}
}
-impl ::core::marker::StructuralPartialEq for Enum1 {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Enum1 { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Enum1 {
#[inline]
@@ -638,15 +632,9 @@ impl ::core::cmp::PartialEq for Enum1 {
*__self_0 == *__arg1_0,
}
}
- #[inline]
- fn ne(&self, other: &Enum1) -> bool {
- match (self, other) {
- (Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg1_0 }) =>
- *__self_0 != *__arg1_0,
- }
- }
}
-impl ::core::marker::StructuralEq for Enum1 {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Enum1 { }
#[automatically_derived]
impl ::core::cmp::Eq for Enum1 {
#[inline]
@@ -704,13 +692,15 @@ impl ::core::default::Default for Fieldless1 {
impl ::core::hash::Hash for Fieldless1 {
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {}
}
-impl ::core::marker::StructuralPartialEq for Fieldless1 {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Fieldless1 { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Fieldless1 {
#[inline]
fn eq(&self, other: &Fieldless1) -> bool { true }
}
-impl ::core::marker::StructuralEq for Fieldless1 {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Fieldless1 { }
#[automatically_derived]
impl ::core::cmp::Eq for Fieldless1 {
#[inline]
@@ -771,7 +761,8 @@ impl ::core::hash::Hash for Fieldless {
::core::hash::Hash::hash(&__self_tag, state)
}
}
-impl ::core::marker::StructuralPartialEq for Fieldless {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Fieldless { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Fieldless {
#[inline]
@@ -781,7 +772,8 @@ impl ::core::cmp::PartialEq for Fieldless {
__self_tag == __arg1_tag
}
}
-impl ::core::marker::StructuralEq for Fieldless {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Fieldless { }
#[automatically_derived]
impl ::core::cmp::Eq for Fieldless {
#[inline]
@@ -817,8 +809,8 @@ enum Mixed {
Q,
R(u32),
S {
- d1: u32,
- d2: u32,
+ d1: Option<u32>,
+ d2: Option<i32>,
},
}
#[automatically_derived]
@@ -826,6 +818,8 @@ impl ::core::clone::Clone for Mixed {
#[inline]
fn clone(&self) -> Mixed {
let _: ::core::clone::AssertParamIsClone<u32>;
+ let _: ::core::clone::AssertParamIsClone<Option<u32>>;
+ let _: ::core::clone::AssertParamIsClone<Option<i32>>;
*self
}
}
@@ -866,7 +860,8 @@ impl ::core::hash::Hash for Mixed {
}
}
}
-impl ::core::marker::StructuralPartialEq for Mixed {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Mixed { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Mixed {
#[inline]
@@ -883,22 +878,9 @@ impl ::core::cmp::PartialEq for Mixed {
_ => true,
}
}
- #[inline]
- fn ne(&self, other: &Mixed) -> bool {
- let __self_tag = ::core::intrinsics::discriminant_value(self);
- let __arg1_tag = ::core::intrinsics::discriminant_value(other);
- __self_tag != __arg1_tag ||
- match (self, other) {
- (Mixed::R(__self_0), Mixed::R(__arg1_0)) =>
- *__self_0 != *__arg1_0,
- (Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
- d1: __arg1_0, d2: __arg1_1 }) =>
- *__self_0 != *__arg1_0 || *__self_1 != *__arg1_1,
- _ => false,
- }
- }
}
-impl ::core::marker::StructuralEq for Mixed {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Mixed { }
#[automatically_derived]
impl ::core::cmp::Eq for Mixed {
#[inline]
@@ -906,6 +888,8 @@ impl ::core::cmp::Eq for Mixed {
#[no_coverage]
fn assert_receiver_is_total_eq(&self) -> () {
let _: ::core::cmp::AssertParamIsEq<u32>;
+ let _: ::core::cmp::AssertParamIsEq<Option<u32>>;
+ let _: ::core::cmp::AssertParamIsEq<Option<i32>>;
}
}
#[automatically_derived]
@@ -1005,7 +989,8 @@ impl ::core::hash::Hash for Fielded {
}
}
}
-impl ::core::marker::StructuralPartialEq for Fielded {}
+#[automatically_derived]
+impl ::core::marker::StructuralPartialEq for Fielded { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Fielded {
#[inline]
@@ -1023,23 +1008,9 @@ impl ::core::cmp::PartialEq for Fielded {
_ => unsafe { ::core::intrinsics::unreachable() }
}
}
- #[inline]
- fn ne(&self, other: &Fielded) -> bool {
- let __self_tag = ::core::intrinsics::discriminant_value(self);
- let __arg1_tag = ::core::intrinsics::discriminant_value(other);
- __self_tag != __arg1_tag ||
- match (self, other) {
- (Fielded::X(__self_0), Fielded::X(__arg1_0)) =>
- *__self_0 != *__arg1_0,
- (Fielded::Y(__self_0), Fielded::Y(__arg1_0)) =>
- *__self_0 != *__arg1_0,
- (Fielded::Z(__self_0), Fielded::Z(__arg1_0)) =>
- *__self_0 != *__arg1_0,
- _ => unsafe { ::core::intrinsics::unreachable() }
- }
- }
}
-impl ::core::marker::StructuralEq for Fielded {}
+#[automatically_derived]
+impl ::core::marker::StructuralEq for Fielded { }
#[automatically_derived]
impl ::core::cmp::Eq for Fielded {
#[inline]
diff --git a/src/test/ui/deriving/deriving-default-enum.rs b/src/test/ui/deriving/deriving-default-enum.rs
index d1a81c72c..1c7a501ed 100644
--- a/src/test/ui/deriving/deriving-default-enum.rs
+++ b/src/test/ui/deriving/deriving-default-enum.rs
@@ -12,6 +12,16 @@ enum Foo {
Beta(NotDefault),
}
+// #[default] on a generic enum does not add `Default` bounds to the type params.
+#[derive(Default)]
+enum MyOption<T> {
+ #[default]
+ None,
+ #[allow(dead_code)]
+ Some(T),
+}
+
fn main() {
assert_eq!(Foo::default(), Foo::Alpha);
+ assert!(matches!(MyOption::<NotDefault>::default(), MyOption::None));
}
diff --git a/src/test/ui/deriving/deriving-hash.rs b/src/test/ui/deriving/deriving-hash.rs
index 8b51370bc..16738ec4a 100644
--- a/src/test/ui/deriving/deriving-hash.rs
+++ b/src/test/ui/deriving/deriving-hash.rs
@@ -44,6 +44,17 @@ fn fake_hash<A: Hash>(v: &mut Vec<u8>, a: A) {
a.hash(&mut FakeHasher(v));
}
+struct OnlyOneByteHasher;
+impl Hasher for OnlyOneByteHasher {
+ fn finish(&self) -> u64 {
+ unreachable!()
+ }
+
+ fn write(&mut self, bytes: &[u8]) {
+ assert_eq!(bytes.len(), 1);
+ }
+}
+
fn main() {
let person1 = Person {
id: 5,
@@ -73,4 +84,13 @@ fn main() {
let mut v = vec![];
fake_hash(&mut v, SingleVariantEnum::A(17));
assert_eq!(vec![17], v);
+
+ // issue #39137
+ #[repr(u8)]
+ #[derive(Hash)]
+ enum E {
+ A,
+ B,
+ }
+ E::A.hash(&mut OnlyOneByteHasher);
}
diff --git a/src/test/ui/deriving/issue-103157.rs b/src/test/ui/deriving/issue-103157.rs
new file mode 100644
index 000000000..52b4c7898
--- /dev/null
+++ b/src/test/ui/deriving/issue-103157.rs
@@ -0,0 +1,12 @@
+// check-fail
+
+#[derive(PartialEq, Eq)]
+pub enum Value {
+ Boolean(Option<bool>),
+ Float(Option<f64>), //~ ERROR the trait bound `f64: Eq` is not satisfied
+}
+
+fn main() {
+ let a = Value::Float(Some(f64::NAN));
+ assert!(a == a);
+}
diff --git a/src/test/ui/deriving/issue-103157.stderr b/src/test/ui/deriving/issue-103157.stderr
new file mode 100644
index 000000000..ee3528fe1
--- /dev/null
+++ b/src/test/ui/deriving/issue-103157.stderr
@@ -0,0 +1,30 @@
+error[E0277]: the trait bound `f64: Eq` is not satisfied
+ --> $DIR/issue-103157.rs:6:11
+ |
+LL | #[derive(PartialEq, Eq)]
+ | -- in this derive macro expansion
+...
+LL | Float(Option<f64>),
+ | ^^^^^^^^^^^ the trait `Eq` is not implemented for `f64`
+ |
+ = help: the following other types implement trait `Eq`:
+ i128
+ i16
+ i32
+ i64
+ i8
+ isize
+ u128
+ u16
+ and 4 others
+ = note: required for `Option<f64>` to implement `Eq`
+note: required by a bound in `AssertParamIsEq`
+ --> $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+LL | pub struct AssertParamIsEq<T: Eq + ?Sized> {
+ | ^^ required by this bound in `AssertParamIsEq`
+ = note: this error originates in the derive macro `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 E0277`.
diff --git a/src/test/ui/deriving/issue-89188-gat-hrtb.rs b/src/test/ui/deriving/issue-89188-gat-hrtb.rs
index abd85a616..e8118f0c6 100644
--- a/src/test/ui/deriving/issue-89188-gat-hrtb.rs
+++ b/src/test/ui/deriving/issue-89188-gat-hrtb.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait CallWithShim: Sized {
type Shim<'s>
where
diff --git a/src/test/ui/destructuring-assignment/warn-unused-duplication.stderr b/src/test/ui/destructuring-assignment/warn-unused-duplication.stderr
index 1df7a5f22..e16625136 100644
--- a/src/test/ui/destructuring-assignment/warn-unused-duplication.stderr
+++ b/src/test/ui/destructuring-assignment/warn-unused-duplication.stderr
@@ -4,12 +4,12 @@ warning: value assigned to `a` is never read
LL | (a, a) = (0, 1);
| ^
|
+ = help: maybe it is overwritten before being read?
note: the lint level is defined here
--> $DIR/warn-unused-duplication.rs:3:9
|
LL | #![warn(unused_assignments)]
| ^^^^^^^^^^^^^^^^^^
- = help: maybe it is overwritten before being read?
warning: 1 warning emitted
diff --git a/src/test/ui/did_you_mean/bad-assoc-ty.stderr b/src/test/ui/did_you_mean/bad-assoc-ty.stderr
index 2326af934..21f957ab5 100644
--- a/src/test/ui/did_you_mean/bad-assoc-ty.stderr
+++ b/src/test/ui/did_you_mean/bad-assoc-ty.stderr
@@ -105,9 +105,9 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | type H = Fn(u8) -> (u8)::Output;
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
LL | type H = <dyn Fn(u8) -> (u8)>::Output;
diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr
index 26764bc0e..b69fcd5d3 100644
--- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr
+++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
- --> $DIR/issue-21659-show-relevant-trait-impls-1.rs:24:8
+ --> $DIR/issue-21659-show-relevant-trait-impls-1.rs:24:12
|
LL | f1.foo(1usize);
- | ^^^ the trait `Foo<usize>` is not implemented for `Bar`
+ | --- ^^^^^^ the trait `Foo<usize>` is not implemented for `Bar`
+ | |
+ | required by a bound introduced by this call
|
= help: the following other types implement trait `Foo<A>`:
<Bar as Foo<i32>>
diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
index bb175367e..5e0e4a011 100644
--- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
+++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
- --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:28:8
+ --> $DIR/issue-21659-show-relevant-trait-impls-2.rs:28:12
|
LL | f1.foo(1usize);
- | ^^^ the trait `Foo<usize>` is not implemented for `Bar`
+ | --- ^^^^^^ the trait `Foo<usize>` is not implemented for `Bar`
+ | |
+ | required by a bound introduced by this call
|
= help: the following other types implement trait `Foo<A>`:
<Bar as Foo<i16>>
diff --git a/src/test/ui/did_you_mean/issue-31424.stderr b/src/test/ui/did_you_mean/issue-31424.stderr
index 886173812..8fe38bf69 100644
--- a/src/test/ui/did_you_mean/issue-31424.stderr
+++ b/src/test/ui/did_you_mean/issue-31424.stderr
@@ -24,8 +24,8 @@ LL | fn bar(self: &mut Self) {
LL | (&mut self).bar();
| ----------------- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
--> $DIR/issue-31424.rs:16:9
diff --git a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed
index 87debfece..e566ed488 100644
--- a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed
+++ b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.fixed
@@ -2,4 +2,9 @@
fn main() {
let _x = !1; //~ ERROR cannot be used as a unary operator
+ let _y = !1; //~ ERROR unexpected `1` after identifier
+ let _z = !false; //~ ERROR unexpected keyword `false` after identifier
+ let _a = !true; //~ ERROR unexpected keyword `true` after identifier
+ let v = 1 + 2;
+ let _v = !v; //~ ERROR unexpected `v` after identifier
}
diff --git a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs
index 015a8edce..1708a8050 100644
--- a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs
+++ b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.rs
@@ -2,4 +2,9 @@
fn main() {
let _x = ~1; //~ ERROR cannot be used as a unary operator
+ let _y = not 1; //~ ERROR unexpected `1` after identifier
+ let _z = not false; //~ ERROR unexpected keyword `false` after identifier
+ let _a = not true; //~ ERROR unexpected keyword `true` after identifier
+ let v = 1 + 2;
+ let _v = not v; //~ ERROR unexpected `v` after identifier
}
diff --git a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr
index 84b81d561..2a3242abe 100644
--- a/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr
+++ b/src/test/ui/did_you_mean/issue-41679-tilde-bitwise-negation-attempt.stderr
@@ -4,5 +4,37 @@ error: `~` cannot be used as a unary operator
LL | let _x = ~1;
| ^ help: use `!` to perform bitwise not
-error: aborting due to previous error
+error: unexpected `1` after identifier
+ --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:5:18
+ |
+LL | let _y = not 1;
+ | ----^
+ | |
+ | help: use `!` to perform bitwise not
+
+error: unexpected keyword `false` after identifier
+ --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:6:18
+ |
+LL | let _z = not false;
+ | ----^^^^^
+ | |
+ | help: use `!` to perform logical negation
+
+error: unexpected keyword `true` after identifier
+ --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:7:18
+ |
+LL | let _a = not true;
+ | ----^^^^
+ | |
+ | help: use `!` to perform logical negation
+
+error: unexpected `v` after identifier
+ --> $DIR/issue-41679-tilde-bitwise-negation-attempt.rs:9:18
+ |
+LL | let _v = not v;
+ | ----^
+ | |
+ | help: use `!` to perform logical negation or bitwise not
+
+error: aborting due to 5 previous errors
diff --git a/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
index bca493e67..9dde5b3eb 100644
--- a/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
+++ b/src/test/ui/did_you_mean/issue-43871-enum-instead-of-variant.stderr
@@ -1,11 +1,3 @@
-error[E0423]: expected function, tuple struct or tuple variant, found enum `Option`
- --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
- |
-LL | let x = Option(1);
- | ^^^^^^ help: try to construct one of the enum's variants: `std::option::Option::Some`
- |
- = help: you might have meant to construct the enum's non-tuple variant
-
error[E0532]: expected tuple struct or tuple variant, found enum `Option`
--> $DIR/issue-43871-enum-instead-of-variant.rs:21:12
|
@@ -27,6 +19,14 @@ note: the enum is defined here
LL | enum Example { Ex(String), NotEx }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error[E0423]: expected function, tuple struct or tuple variant, found enum `Option`
+ --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
+ |
+LL | let x = Option(1);
+ | ^^^^^^ help: try to construct one of the enum's variants: `std::option::Option::Some`
+ |
+ = help: you might have meant to construct the enum's non-tuple variant
+
error[E0423]: expected function, tuple struct or tuple variant, found enum `Void`
--> $DIR/issue-43871-enum-instead-of-variant.rs:31:13
|
diff --git a/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr b/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr
index 3ccc14bba..14918ba89 100644
--- a/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr
+++ b/src/test/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.stderr
@@ -4,7 +4,7 @@ error: unexpected `for_you` after identifier
LL | if not for_you {
| ----^^^^^^^
| |
- | help: use `!` to perform logical negation
+ | help: use `!` to perform logical negation or bitwise not
error: unexpected `the_worst` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:11:15
@@ -12,13 +12,13 @@ error: unexpected `the_worst` after identifier
LL | while not the_worst {
| ----^^^^^^^^^
| |
- | help: use `!` to perform logical negation
+ | help: use `!` to perform logical negation or bitwise not
error: unexpected `println` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:20:9
|
LL | if not // lack of braces is [sic]
- | ----- help: use `!` to perform logical negation
+ | ----- help: use `!` to perform logical negation or bitwise not
LL | println!("Then when?");
| ^^^^^^^
@@ -42,7 +42,7 @@ error: unexpected `2` after identifier
LL | let resource = not 2;
| ----^
| |
- | help: use `!` to perform logical negation
+ | help: use `!` to perform bitwise not
error: unexpected `be_smothered_out_before` after identifier
--> $DIR/issue-46836-identifier-not-instead-of-negation.rs:32:27
@@ -50,7 +50,7 @@ error: unexpected `be_smothered_out_before` after identifier
LL | let young_souls = not be_smothered_out_before;
| ----^^^^^^^^^^^^^^^^^^^^^^^
| |
- | help: use `!` to perform logical negation
+ | help: use `!` to perform logical negation or bitwise not
error: aborting due to 6 previous errors
diff --git a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
index 26986684f..81f3f2694 100644
--- a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
+++ b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
@@ -15,13 +15,13 @@ help: Unicode character '−' (Minus Sign) looks like '-' (Minus/Hyphen), but it
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²
| ~
-error[E0277]: cannot subtract `{integer}` from `{float}`
+error[E0277]: cannot subtract `{integer}` from `{float}` in const contexts
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:1:53
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹⋅s⁻²
| ^ no implementation for `{float} - {integer}`
|
- = help: the trait `Sub<{integer}>` is not implemented for `{float}`
+ = help: the trait `~const Sub<{integer}>` is not implemented for `{float}`
= help: the following other types implement trait `Sub<Rhs>`:
<&'a f32 as Sub<f32>>
<&'a f64 as Sub<f64>>
diff --git a/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr b/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr
index 528c62f50..cbe59e8e0 100644
--- a/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr
+++ b/src/test/ui/did_you_mean/issue-54109-and_instead_of_ampersands.stderr
@@ -4,7 +4,7 @@ error: `and` is not a logical operator
LL | let _ = a and b;
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
@@ -12,7 +12,7 @@ error: `and` is not a logical operator
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
@@ -20,7 +20,7 @@ error: `or` is not a logical operator
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
@@ -28,7 +28,7 @@ error: `or` is not a logical operator
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
@@ -36,7 +36,7 @@ error: `and` is not a logical operator
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
@@ -44,7 +44,7 @@ error: `or` is not a logical operator
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
@@ -52,7 +52,7 @@ error: `and` is not a logical operator
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
@@ -60,7 +60,7 @@ error: `or` is not a logical operator
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error[E0308]: mismatched types
--> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33
diff --git a/src/test/ui/did_you_mean/issue-54109-without-witness.stderr b/src/test/ui/did_you_mean/issue-54109-without-witness.stderr
index 0350890c1..6455b0863 100644
--- a/src/test/ui/did_you_mean/issue-54109-without-witness.stderr
+++ b/src/test/ui/did_you_mean/issue-54109-without-witness.stderr
@@ -4,7 +4,7 @@ error: `and` is not a logical operator
LL | let _ = a and b;
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:15:10
@@ -12,7 +12,7 @@ error: `and` is not a logical operator
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:24:15
@@ -20,7 +20,7 @@ error: `or` is not a logical operator
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:26:10
@@ -28,7 +28,7 @@ error: `or` is not a logical operator
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:34:11
@@ -36,7 +36,7 @@ error: `and` is not a logical operator
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:42:11
@@ -44,7 +44,7 @@ error: `or` is not a logical operator
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:50:13
@@ -52,7 +52,7 @@ error: `and` is not a logical operator
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-without-witness.rs:58:13
@@ -60,7 +60,7 @@ error: `or` is not a logical operator
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
|
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
+ = note: unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
error: aborting due to 8 previous errors
diff --git a/src/test/ui/did_you_mean/use_instead_of_import.fixed b/src/test/ui/did_you_mean/use_instead_of_import.fixed
index 87d453e15..a8aae76f4 100644
--- a/src/test/ui/did_you_mean/use_instead_of_import.fixed
+++ b/src/test/ui/did_you_mean/use_instead_of_import.fixed
@@ -6,10 +6,18 @@ use std::{
rc::Rc,
};
+use std::time::Duration;
+//~^ ERROR expected item, found `require`
+
+use std::time::Instant;
+//~^ ERROR expected item, found `include`
+
pub use std::io;
//~^ ERROR expected item, found `using`
fn main() {
let x = Rc::new(1);
let _ = write!(io::stdout(), "{:?}", x);
+ let _ = Duration::new(5, 0);
+ let _ = Instant::now();
}
diff --git a/src/test/ui/did_you_mean/use_instead_of_import.rs b/src/test/ui/did_you_mean/use_instead_of_import.rs
index 59e837323..2db7c2407 100644
--- a/src/test/ui/did_you_mean/use_instead_of_import.rs
+++ b/src/test/ui/did_you_mean/use_instead_of_import.rs
@@ -6,10 +6,18 @@ import std::{
rc::Rc,
};
+require std::time::Duration;
+//~^ ERROR expected item, found `require`
+
+include std::time::Instant;
+//~^ ERROR expected item, found `include`
+
pub using std::io;
//~^ ERROR expected item, found `using`
fn main() {
let x = Rc::new(1);
let _ = write!(io::stdout(), "{:?}", x);
+ let _ = Duration::new(5, 0);
+ let _ = Instant::now();
}
diff --git a/src/test/ui/did_you_mean/use_instead_of_import.stderr b/src/test/ui/did_you_mean/use_instead_of_import.stderr
index b22954af8..2aac8f68c 100644
--- a/src/test/ui/did_you_mean/use_instead_of_import.stderr
+++ b/src/test/ui/did_you_mean/use_instead_of_import.stderr
@@ -4,11 +4,23 @@ error: expected item, found `import`
LL | import std::{
| ^^^^^^ help: items are imported using the `use` keyword
+error: expected item, found `require`
+ --> $DIR/use_instead_of_import.rs:9:1
+ |
+LL | require std::time::Duration;
+ | ^^^^^^^ help: items are imported using the `use` keyword
+
+error: expected item, found `include`
+ --> $DIR/use_instead_of_import.rs:12:1
+ |
+LL | include std::time::Instant;
+ | ^^^^^^^ help: items are imported using the `use` keyword
+
error: expected item, found `using`
- --> $DIR/use_instead_of_import.rs:9:5
+ --> $DIR/use_instead_of_import.rs:15:5
|
LL | pub using std::io;
| ^^^^^ help: items are imported using the `use` keyword
-error: aborting due to 2 previous errors
+error: aborting due to 4 previous errors
diff --git a/src/test/ui/drop/drop-foreign-fundamental.rs b/src/test/ui/drop/drop-foreign-fundamental.rs
new file mode 100644
index 000000000..c43df40d6
--- /dev/null
+++ b/src/test/ui/drop/drop-foreign-fundamental.rs
@@ -0,0 +1,23 @@
+use std::ops::Deref;
+use std::pin::Pin;
+
+struct Whatever<T>(T);
+
+impl<T> Deref for Whatever<T> {
+ type Target = T;
+
+ fn deref(&self) -> &T {
+ &self.0
+ }
+}
+
+struct A;
+
+impl Drop for Pin<Whatever<A>> {
+ //~^ ERROR the `Drop` trait may only be implemented for local structs, enums, and unions
+ fn drop(&mut self) {}
+}
+
+fn main() {
+ let x = Pin::new(Whatever(1.0f32));
+}
diff --git a/src/test/ui/drop/drop-foreign-fundamental.stderr b/src/test/ui/drop/drop-foreign-fundamental.stderr
new file mode 100644
index 000000000..fbd1ba085
--- /dev/null
+++ b/src/test/ui/drop/drop-foreign-fundamental.stderr
@@ -0,0 +1,9 @@
+error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
+ --> $DIR/drop-foreign-fundamental.rs:16:15
+ |
+LL | impl Drop for Pin<Whatever<A>> {
+ | ^^^^^^^^^^^^^^^^ must be a struct, enum, or union in the current crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0120`.
diff --git a/src/test/ui/drop/drop_order.rs b/src/test/ui/drop/drop_order.rs
new file mode 100644
index 000000000..42385216a
--- /dev/null
+++ b/src/test/ui/drop/drop_order.rs
@@ -0,0 +1,209 @@
+// run-pass
+// compile-flags: -Z validate-mir
+#![feature(let_chains)]
+
+use std::cell::RefCell;
+use std::convert::TryInto;
+
+#[derive(Default)]
+struct DropOrderCollector(RefCell<Vec<u32>>);
+
+struct LoudDrop<'a>(&'a DropOrderCollector, u32);
+
+impl Drop for LoudDrop<'_> {
+ fn drop(&mut self) {
+ println!("{}", self.1);
+ self.0.0.borrow_mut().push(self.1);
+ }
+}
+
+impl DropOrderCollector {
+ fn option_loud_drop(&self, n: u32) -> Option<LoudDrop> {
+ Some(LoudDrop(self, n))
+ }
+
+ fn loud_drop(&self, n: u32) -> LoudDrop {
+ LoudDrop(self, n)
+ }
+
+ fn print(&self, n: u32) {
+ println!("{}", n);
+ self.0.borrow_mut().push(n)
+ }
+
+ fn if_(&self) {
+ if self.option_loud_drop(1).is_some() {
+ self.print(2);
+ }
+
+ if self.option_loud_drop(3).is_none() {
+ unreachable!();
+ } else if self.option_loud_drop(4).is_some() {
+ self.print(5);
+ }
+
+ if {
+ if self.option_loud_drop(7).is_some() && self.option_loud_drop(6).is_some() {
+ self.loud_drop(8);
+ true
+ } else {
+ false
+ }
+ } {
+ self.print(9);
+ }
+ }
+
+ fn if_let(&self) {
+ if let None = self.option_loud_drop(2) {
+ unreachable!();
+ } else {
+ self.print(1);
+ }
+
+ if let Some(_) = self.option_loud_drop(4) {
+ self.print(3);
+ }
+
+ if let Some(_d) = self.option_loud_drop(6) {
+ self.print(5);
+ }
+ }
+
+ fn match_(&self) {
+ match self.option_loud_drop(2) {
+ _any => self.print(1),
+ }
+
+ match self.option_loud_drop(4) {
+ _ => self.print(3),
+ }
+
+ match self.option_loud_drop(6) {
+ Some(_) => self.print(5),
+ _ => unreachable!(),
+ }
+
+ match {
+ let _ = self.loud_drop(7);
+ let _d = self.loud_drop(9);
+ self.print(8);
+ ()
+ } {
+ () => self.print(10),
+ }
+
+ match {
+ match self.option_loud_drop(14) {
+ _ => {
+ self.print(11);
+ self.option_loud_drop(13)
+ }
+ }
+ } {
+ _ => self.print(12),
+ }
+
+ match {
+ loop {
+ break match self.option_loud_drop(16) {
+ _ => {
+ self.print(15);
+ self.option_loud_drop(18)
+ }
+ };
+ }
+ } {
+ _ => self.print(17),
+ }
+ }
+
+ fn let_chain(&self) {
+ // take the "then" branch
+ if self.option_loud_drop(2).is_some() // 2
+ && self.option_loud_drop(1).is_some() // 1
+ && let Some(_d) = self.option_loud_drop(4) { // 4
+ self.print(3); // 3
+ }
+
+ // take the "else" branch
+ if self.option_loud_drop(6).is_some() // 2
+ && self.option_loud_drop(5).is_some() // 1
+ && let None = self.option_loud_drop(8) { // 4
+ unreachable!();
+ } else {
+ self.print(7); // 3
+ }
+
+ // let exprs interspersed
+ if self.option_loud_drop(9).is_some() // 1
+ && let Some(_d) = self.option_loud_drop(13) // 5
+ && self.option_loud_drop(10).is_some() // 2
+ && let Some(_e) = self.option_loud_drop(12) { // 4
+ self.print(11); // 3
+ }
+
+ // let exprs first
+ if let Some(_d) = self.option_loud_drop(18) // 5
+ && let Some(_e) = self.option_loud_drop(17) // 4
+ && self.option_loud_drop(14).is_some() // 1
+ && self.option_loud_drop(15).is_some() { // 2
+ self.print(16); // 3
+ }
+
+ // let exprs last
+ if self.option_loud_drop(20).is_some() // 2
+ && self.option_loud_drop(19).is_some() // 1
+ && let Some(_d) = self.option_loud_drop(23) // 5
+ && let Some(_e) = self.option_loud_drop(22) { // 4
+ self.print(21); // 3
+ }
+ }
+
+ fn while_(&self) {
+ let mut v = self.option_loud_drop(4);
+ while let Some(_d) = v
+ && self.option_loud_drop(1).is_some()
+ && self.option_loud_drop(2).is_some() {
+ self.print(3);
+ v = None;
+ }
+ }
+
+ fn assert_sorted(self) {
+ assert!(
+ self.0
+ .into_inner()
+ .into_iter()
+ .enumerate()
+ .all(|(idx, item)| idx + 1 == item.try_into().unwrap())
+ );
+ }
+}
+
+fn main() {
+ println!("-- if --");
+ let collector = DropOrderCollector::default();
+ collector.if_();
+ collector.assert_sorted();
+
+ println!("-- if let --");
+ let collector = DropOrderCollector::default();
+ collector.if_let();
+ collector.assert_sorted();
+
+ println!("-- match --");
+ let collector = DropOrderCollector::default();
+ collector.match_();
+ collector.assert_sorted();
+
+ println!("-- let chain --");
+ let collector = DropOrderCollector::default();
+ collector.let_chain();
+ collector.assert_sorted();
+
+ println!("-- while --");
+ let collector = DropOrderCollector::default();
+ collector.while_();
+ collector.assert_sorted();
+}
diff --git a/src/test/ui/drop/dropck_legal_cycles.rs b/src/test/ui/drop/dropck_legal_cycles.rs
index 27a599315..6a0fe7784 100644
--- a/src/test/ui/drop/dropck_legal_cycles.rs
+++ b/src/test/ui/drop/dropck_legal_cycles.rs
@@ -1017,7 +1017,7 @@ impl<'a> Children<'a> for HM<'a> {
where C: Context + PrePost<Self>, Self: Sized
{
if let Some(ref hm) = self.contents.get() {
- for (k, v) in hm.iter().nth(index / 2) {
+ if let Some((k, v)) = hm.iter().nth(index / 2) {
[k, v][index % 2].descend_into_self(context);
}
}
@@ -1032,7 +1032,7 @@ impl<'a> Children<'a> for VD<'a> {
where C: Context + PrePost<Self>, Self: Sized
{
if let Some(ref vd) = self.contents.get() {
- for r in vd.iter().nth(index) {
+ if let Some(r) = vd.iter().nth(index) {
r.descend_into_self(context);
}
}
@@ -1047,7 +1047,7 @@ impl<'a> Children<'a> for VM<'a> {
where C: Context + PrePost<VM<'a>>
{
if let Some(ref vd) = self.contents.get() {
- for (_idx, r) in vd.iter().nth(index) {
+ if let Some((_idx, r)) = vd.iter().nth(index) {
r.descend_into_self(context);
}
}
@@ -1062,7 +1062,7 @@ impl<'a> Children<'a> for LL<'a> {
where C: Context + PrePost<LL<'a>>
{
if let Some(ref ll) = self.contents.get() {
- for r in ll.iter().nth(index) {
+ if let Some(r) = ll.iter().nth(index) {
r.descend_into_self(context);
}
}
@@ -1077,7 +1077,7 @@ impl<'a> Children<'a> for BH<'a> {
where C: Context + PrePost<BH<'a>>
{
if let Some(ref bh) = self.contents.get() {
- for r in bh.iter().nth(index) {
+ if let Some(r) = bh.iter().nth(index) {
r.descend_into_self(context);
}
}
@@ -1092,7 +1092,7 @@ impl<'a> Children<'a> for BTM<'a> {
where C: Context + PrePost<BTM<'a>>
{
if let Some(ref bh) = self.contents.get() {
- for (k, v) in bh.iter().nth(index / 2) {
+ if let Some((k, v)) = bh.iter().nth(index / 2) {
[k, v][index % 2].descend_into_self(context);
}
}
@@ -1107,7 +1107,7 @@ impl<'a> Children<'a> for BTS<'a> {
where C: Context + PrePost<BTS<'a>>
{
if let Some(ref bh) = self.contents.get() {
- for r in bh.iter().nth(index) {
+ if let Some(r) = bh.iter().nth(index) {
r.descend_into_self(context);
}
}
diff --git a/src/test/ui/drop/dynamic-drop-async.rs b/src/test/ui/drop/dynamic-drop-async.rs
index 13bd71ecb..8f1cc6691 100644
--- a/src/test/ui/drop/dynamic-drop-async.rs
+++ b/src/test/ui/drop/dynamic-drop-async.rs
@@ -6,7 +6,6 @@
// run-pass
// needs-unwind
// edition:2018
-// ignore-wasm32-bare compiled with panic=abort by default
#![allow(unused)]
diff --git a/src/test/ui/drop/dynamic-drop.rs b/src/test/ui/drop/dynamic-drop.rs
index e70686774..9e51d3ada 100644
--- a/src/test/ui/drop/dynamic-drop.rs
+++ b/src/test/ui/drop/dynamic-drop.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
diff --git a/src/test/ui/drop/issue-100276.rs b/src/test/ui/drop/issue-100276.rs
new file mode 100644
index 000000000..6401a8d14
--- /dev/null
+++ b/src/test/ui/drop/issue-100276.rs
@@ -0,0 +1,12 @@
+// check-pass
+// compile-flags: -Z validate-mir
+#![feature(let_chains)]
+
+fn let_chains(entry: std::io::Result<std::fs::DirEntry>) {
+ if let Ok(entry) = entry
+ && let Some(s) = entry.file_name().to_str()
+ && s.contains("")
+ {}
+}
+
+fn main() {}
diff --git a/src/test/ui/issues/issue-17718-const-destructors.rs b/src/test/ui/drop/issue-17718-const-destructors.rs
index c9a729c7b..c9a729c7b 100644
--- a/src/test/ui/issues/issue-17718-const-destructors.rs
+++ b/src/test/ui/drop/issue-17718-const-destructors.rs
diff --git a/src/test/ui/issues/issue-23338-ensure-param-drop-order.rs b/src/test/ui/drop/issue-23338-ensure-param-drop-order.rs
index a99f260dd..a99f260dd 100644
--- a/src/test/ui/issues/issue-23338-ensure-param-drop-order.rs
+++ b/src/test/ui/drop/issue-23338-ensure-param-drop-order.rs
diff --git a/src/test/ui/issues/issue-48962.rs b/src/test/ui/drop/issue-48962.rs
index 80d815379..80d815379 100644
--- a/src/test/ui/issues/issue-48962.rs
+++ b/src/test/ui/drop/issue-48962.rs
diff --git a/src/test/ui/drop/repeat-drop-2.rs b/src/test/ui/drop/repeat-drop-2.rs
index 59d5ef202..3cfacea5e 100644
--- a/src/test/ui/drop/repeat-drop-2.rs
+++ b/src/test/ui/drop/repeat-drop-2.rs
@@ -5,7 +5,7 @@ fn borrowck_catch() {
}
const _: [String; 0] = [String::new(); 0];
-//~^ ERROR destructors cannot be evaluated at compile-time [E0493]
+//~^ ERROR destructor of `String` cannot be evaluated at compile-time [E0493]
fn must_be_init() {
let x: u8;
diff --git a/src/test/ui/drop/repeat-drop-2.stderr b/src/test/ui/drop/repeat-drop-2.stderr
index 48fa2bfa9..7357551c4 100644
--- a/src/test/ui/drop/repeat-drop-2.stderr
+++ b/src/test/ui/drop/repeat-drop-2.stderr
@@ -8,13 +8,13 @@ LL | let _bar = foo;
LL | let _baz = [foo; 0];
| ^^^ value used here after move
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `String` cannot be evaluated at compile-time
--> $DIR/repeat-drop-2.rs:7:25
|
LL | const _: [String; 0] = [String::new(); 0];
| -^^^^^^^^^^^^^----
| ||
- | |constants cannot evaluate destructors
+ | |the destructor for this type cannot be evaluated in constants
| value is dropped here
error[E0381]: used binding `x` isn't initialized
@@ -24,6 +24,11 @@ LL | let x: u8;
| - binding declared here but left uninitialized
LL | let _ = [x; 0];
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x: u8 = 0;
+ | +++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/drop/repeat-drop.rs b/src/test/ui/drop/repeat-drop.rs
index a43612e5d..8fd46ecaf 100644
--- a/src/test/ui/drop/repeat-drop.rs
+++ b/src/test/ui/drop/repeat-drop.rs
@@ -1,8 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare no unwinding panic
-// ignore-avr no unwinding panic
-// ignore-nvptx64 no unwinding panic
static mut CHECK: usize = 0;
diff --git a/src/test/ui/dropck/drop-on-non-struct.rs b/src/test/ui/dropck/drop-on-non-struct.rs
index ef5e18126..145eab126 100644
--- a/src/test/ui/dropck/drop-on-non-struct.rs
+++ b/src/test/ui/dropck/drop-on-non-struct.rs
@@ -1,5 +1,5 @@
impl<'a> Drop for &'a mut isize {
- //~^ ERROR the `Drop` trait may only be implemented for structs, enums, and unions
+ //~^ ERROR the `Drop` trait may only be implemented for local structs, enums, and unions
//~^^ ERROR E0117
fn drop(&mut self) {
println!("kaboom");
@@ -8,8 +8,7 @@ impl<'a> Drop for &'a mut isize {
impl Drop for Nonexistent {
//~^ ERROR cannot find type `Nonexistent`
- fn drop(&mut self) { }
+ fn drop(&mut self) {}
}
-fn main() {
-}
+fn main() {}
diff --git a/src/test/ui/dropck/drop-on-non-struct.stderr b/src/test/ui/dropck/drop-on-non-struct.stderr
index e52728f37..e8fbe5e97 100644
--- a/src/test/ui/dropck/drop-on-non-struct.stderr
+++ b/src/test/ui/dropck/drop-on-non-struct.stderr
@@ -15,11 +15,11 @@ LL | impl<'a> Drop for &'a mut isize {
|
= note: define and implement a trait or new type instead
-error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions
+error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
--> $DIR/drop-on-non-struct.rs:1:19
|
LL | impl<'a> Drop for &'a mut isize {
- | ^^^^^^^^^^^^^ must be a struct, enum, or union
+ | ^^^^^^^^^^^^^ must be a struct, enum, or union in the current crate
error: aborting due to 3 previous errors
diff --git a/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr b/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr
index 49e55be1b..82169ee01 100644
--- a/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr
+++ b/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr
@@ -8,6 +8,12 @@ LL | | // (unsafe to access self.1 due to #[may_dangle] on A)
LL | | fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
LL | | }
| |_^
+ |
+ = note: the trait `Drop` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
+help: add `unsafe` to this trait implementation
+ |
+LL | unsafe impl<#[may_dangle] A, B: fmt::Debug> Drop for Pt<A, B> {
+ | ++++++
error[E0569]: requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
--> $DIR/dropck-eyepatch-implies-unsafe-impl.rs:27:1
@@ -19,6 +25,12 @@ LL | | // (unsafe to access self.1 due to #[may_dangle] on 'a)
LL | | fn drop(&mut self) { println!("drop {} {:?}", self.0, self.2); }
LL | | }
| |_^
+ |
+ = note: the trait `Drop` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
+help: add `unsafe` to this trait implementation
+ |
+LL | unsafe impl<#[may_dangle] 'a, 'b, B: fmt::Debug> Drop for Pr<'a, 'b, B> {
+ | ++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-24805-dropck-itemless.rs b/src/test/ui/dropck/issue-24805-dropck-itemless.rs
index 45761b61c..45761b61c 100644
--- a/src/test/ui/issues/issue-24805-dropck-itemless.rs
+++ b/src/test/ui/dropck/issue-24805-dropck-itemless.rs
diff --git a/src/test/ui/dst/dst-bad-coercions.stderr b/src/test/ui/dst/dst-bad-coercions.stderr
index 01f862ed5..0d6f4d020 100644
--- a/src/test/ui/dst/dst-bad-coercions.stderr
+++ b/src/test/ui/dst/dst-bad-coercions.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:14:17
|
LL | let y: &S = x;
- | -- ^ expected `&S`, found *-ptr
+ | -- ^ expected `&S`, found `*const S`
| |
| expected due to this
|
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:15:21
|
LL | let y: &dyn T = x;
- | ------ ^ expected `&dyn T`, found *-ptr
+ | ------ ^ expected `&dyn T`, found `*const S`
| |
| expected due to this
|
@@ -24,7 +24,7 @@ error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:19:17
|
LL | let y: &S = x;
- | -- ^ expected `&S`, found *-ptr
+ | -- ^ expected `&S`, found `*mut S`
| |
| expected due to this
|
@@ -35,7 +35,7 @@ error[E0308]: mismatched types
--> $DIR/dst-bad-coercions.rs:20:21
|
LL | let y: &dyn T = x;
- | ------ ^ expected `&dyn T`, found *-ptr
+ | ------ ^ expected `&dyn T`, found `*mut S`
| |
| expected due to this
|
diff --git a/src/test/ui/dst/dst-rvalue.rs b/src/test/ui/dst/dst-rvalue.rs
index b52a95a70..fbb32cac1 100644
--- a/src/test/ui/dst/dst-rvalue.rs
+++ b/src/test/ui/dst/dst-rvalue.rs
@@ -1,12 +1,10 @@
// Check that dynamically sized rvalues are forbidden
-#![feature(box_syntax)]
-
pub fn main() {
- let _x: Box<str> = box *"hello world";
+ let _x: Box<str> = Box::new(*"hello world");
//~^ ERROR E0277
let array: &[isize] = &[1, 2, 3];
- let _x: Box<[isize]> = box *array;
+ let _x: Box<[isize]> = Box::new(*array);
//~^ ERROR E0277
}
diff --git a/src/test/ui/dst/dst-rvalue.stderr b/src/test/ui/dst/dst-rvalue.stderr
index 15830636b..727f4d843 100644
--- a/src/test/ui/dst/dst-rvalue.stderr
+++ b/src/test/ui/dst/dst-rvalue.stderr
@@ -1,20 +1,32 @@
error[E0277]: the size for values of type `str` cannot be known at compilation time
- --> $DIR/dst-rvalue.rs:6:28
+ --> $DIR/dst-rvalue.rs:4:33
|
-LL | let _x: Box<str> = box *"hello world";
- | ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+LL | let _x: Box<str> = Box::new(*"hello world");
+ | -------- ^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sized` is not implemented for `str`
- = note: the type of a box expression must have a statically known size
+note: required by a bound in `Box::<T>::new`
+ --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ |
+LL | impl<T> Box<T> {
+ | ^ required by this bound in `Box::<T>::new`
error[E0277]: the size for values of type `[isize]` cannot be known at compilation time
- --> $DIR/dst-rvalue.rs:10:32
+ --> $DIR/dst-rvalue.rs:8:37
|
-LL | let _x: Box<[isize]> = box *array;
- | ^^^^^^ doesn't have a size known at compile-time
+LL | let _x: Box<[isize]> = Box::new(*array);
+ | -------- ^^^^^^ doesn't have a size known at compile-time
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sized` is not implemented for `[isize]`
- = note: the type of a box expression must have a statically known size
+note: required by a bound in `Box::<T>::new`
+ --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
+ |
+LL | impl<T> Box<T> {
+ | ^ required by this bound in `Box::<T>::new`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr
index 3eb5bb7b2..89aded913 100644
--- a/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr
+++ b/src/test/ui/dyn-keyword/dyn-2015-edition-keyword-ident-lint.stderr
@@ -4,13 +4,13 @@ error: `dyn` is a keyword in the 2018 edition
LL | pub mod dyn {
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:11:9
|
LL | #![deny(keyword_idents)]
| ^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
error: `dyn` is a keyword in the 2018 edition
--> $DIR/dyn-2015-edition-keyword-ident-lint.rs:17:20
diff --git a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr
index 34699bb26..6bafff919 100644
--- a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr
+++ b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr
@@ -4,18 +4,17 @@ error: trait objects without an explicit `dyn` are deprecated
LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
| ^^^^^^^^^
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
--> $DIR/dyn-2018-edition-lint.rs:2:8
|
LL | #[deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
- |
+LL | fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:4:35
@@ -27,9 +26,8 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
- |
+LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:17:14
@@ -41,9 +39,8 @@ LL | let _x: &SomeTrait = todo!();
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - let _x: &SomeTrait = todo!();
-LL + let _x: &dyn SomeTrait = todo!();
- |
+LL | let _x: &dyn SomeTrait = todo!();
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:4:17
@@ -55,9 +52,8 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
- |
+LL | fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:4:17
@@ -69,9 +65,8 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
- |
+LL | fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:4:35
@@ -83,9 +78,8 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
- |
+LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:4:35
@@ -97,9 +91,8 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
- |
+LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
+ | +++
error: aborting due to 7 previous errors
diff --git a/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr b/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr
index 9e212c77d..08ee77116 100644
--- a/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr
+++ b/src/test/ui/dyn-keyword/dyn-2021-edition-error.stderr
@@ -6,9 +6,8 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
help: add `dyn` keyword before this trait
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
- |
+LL | fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
+ | +++
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/dyn-2021-edition-error.rs:3:35
@@ -18,9 +17,8 @@ LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
help: add `dyn` keyword before this trait
|
-LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
-LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
- |
+LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
+ | +++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr b/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr
index 9bc603fba..0bb764d71 100644
--- a/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr
+++ b/src/test/ui/dyn-keyword/dyn-angle-brackets.stderr
@@ -4,18 +4,17 @@ error: trait objects without an explicit `dyn` are deprecated
LL | <fmt::Debug>::fmt(self, f)
| ^^^^^^^^^^
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
--> $DIR/dyn-angle-brackets.rs:4:9
|
LL | #![deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - <fmt::Debug>::fmt(self, f)
-LL + <dyn fmt::Debug>::fmt(self, f)
- |
+LL | <dyn fmt::Debug>::fmt(self, f)
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/dyn-star/auxiliary/dyn-star-foreign.rs b/src/test/ui/dyn-star/auxiliary/dyn-star-foreign.rs
new file mode 100644
index 000000000..7673c7936
--- /dev/null
+++ b/src/test/ui/dyn-star/auxiliary/dyn-star-foreign.rs
@@ -0,0 +1,10 @@
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+use std::fmt::Display;
+
+pub fn require_dyn_star_display(_: dyn* Display) {}
+
+fn works_locally() {
+ require_dyn_star_display(1usize);
+}
diff --git a/src/test/ui/dyn-star/box.rs b/src/test/ui/dyn-star/box.rs
new file mode 100644
index 000000000..d1f1819d9
--- /dev/null
+++ b/src/test/ui/dyn-star/box.rs
@@ -0,0 +1,17 @@
+// run-pass
+// compile-flags: -C opt-level=0
+
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+use std::fmt::Display;
+
+fn make_dyn_star() -> dyn* Display {
+ Box::new(42) as dyn* Display
+}
+
+fn main() {
+ let x = make_dyn_star();
+
+ println!("{x}");
+}
diff --git a/src/test/ui/dyn-star/const.rs b/src/test/ui/dyn-star/const.rs
new file mode 100644
index 000000000..67e3ab7ab
--- /dev/null
+++ b/src/test/ui/dyn-star/const.rs
@@ -0,0 +1,14 @@
+// run-pass
+#![feature(dyn_star)]
+#![allow(unused, incomplete_features)]
+
+use std::fmt::Debug;
+
+fn make_dyn_star() {
+ let i = 42usize;
+ let dyn_i: dyn* Debug = i;
+}
+
+fn main() {
+ make_dyn_star();
+}
diff --git a/src/test/ui/dyn-star/drop.rs b/src/test/ui/dyn-star/drop.rs
new file mode 100644
index 000000000..1478498c0
--- /dev/null
+++ b/src/test/ui/dyn-star/drop.rs
@@ -0,0 +1,23 @@
+// run-pass
+// check-run-results
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+#[derive(Debug)]
+struct Foo(usize);
+
+impl Drop for Foo {
+ fn drop(&mut self) {
+ println!("destructor called");
+ }
+}
+
+fn make_dyn_star(i: Foo) {
+ let _dyn_i: dyn* Debug = i;
+}
+
+fn main() {
+ make_dyn_star(Foo(42));
+}
diff --git a/src/test/ui/dyn-star/drop.run.stdout b/src/test/ui/dyn-star/drop.run.stdout
new file mode 100644
index 000000000..dadb33ccf
--- /dev/null
+++ b/src/test/ui/dyn-star/drop.run.stdout
@@ -0,0 +1 @@
+destructor called
diff --git a/src/test/ui/dyn-star/error.rs b/src/test/ui/dyn-star/error.rs
new file mode 100644
index 000000000..d8261387e
--- /dev/null
+++ b/src/test/ui/dyn-star/error.rs
@@ -0,0 +1,13 @@
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+trait Foo {}
+
+fn make_dyn_star() {
+ let i = 42;
+ let dyn_i: dyn* Foo = i; //~ ERROR trait bound `{integer}: Foo` is not satisfied
+}
+
+fn main() {}
diff --git a/src/test/ui/dyn-star/error.stderr b/src/test/ui/dyn-star/error.stderr
new file mode 100644
index 000000000..ae54b9ca7
--- /dev/null
+++ b/src/test/ui/dyn-star/error.stderr
@@ -0,0 +1,9 @@
+error[E0277]: the trait bound `{integer}: Foo` is not satisfied
+ --> $DIR/error.rs:10:27
+ |
+LL | let dyn_i: dyn* Foo = i;
+ | ^ the trait `Foo` is not implemented for `{integer}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/dyn-star/feature-gate-dyn_star.rs b/src/test/ui/dyn-star/feature-gate-dyn_star.rs
new file mode 100644
index 000000000..4756661cf
--- /dev/null
+++ b/src/test/ui/dyn-star/feature-gate-dyn_star.rs
@@ -0,0 +1,9 @@
+// Feature gate test for dyn_star
+
+/// 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
+}
+
+fn main() {}
diff --git a/src/test/ui/dyn-star/feature-gate-dyn_star.stderr b/src/test/ui/dyn-star/feature-gate-dyn_star.stderr
new file mode 100644
index 000000000..2767e9478
--- /dev/null
+++ b/src/test/ui/dyn-star/feature-gate-dyn_star.stderr
@@ -0,0 +1,12 @@
+error[E0658]: dyn* trait objects are unstable
+ --> $DIR/feature-gate-dyn_star.rs:5:31
+ |
+LL | pub fn dyn_star_parameter(_: &dyn* Send) {
+ | ^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> 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/src/test/ui/dyn-star/make-dyn-star.rs b/src/test/ui/dyn-star/make-dyn-star.rs
new file mode 100644
index 000000000..e5255a64b
--- /dev/null
+++ b/src/test/ui/dyn-star/make-dyn-star.rs
@@ -0,0 +1,18 @@
+// run-pass
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+fn make_dyn_star(i: usize) {
+ let _dyn_i: dyn* Debug = i;
+}
+
+fn make_dyn_star_explicit(i: usize) {
+ let _dyn_i: dyn* Debug = i as dyn* Debug;
+}
+
+fn main() {
+ make_dyn_star(42);
+ make_dyn_star_explicit(42);
+}
diff --git a/src/test/ui/dyn-star/method.rs b/src/test/ui/dyn-star/method.rs
new file mode 100644
index 000000000..5a77640f0
--- /dev/null
+++ b/src/test/ui/dyn-star/method.rs
@@ -0,0 +1,27 @@
+// run-pass
+
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+trait Foo {
+ fn get(&self) -> usize;
+}
+
+impl Foo for usize {
+ fn get(&self) -> usize {
+ *self
+ }
+}
+
+fn invoke_dyn_star(i: dyn* Foo) -> usize {
+ i.get()
+}
+
+fn make_and_invoke_dyn_star(i: usize) -> usize {
+ let dyn_i: dyn* Foo = i;
+ invoke_dyn_star(dyn_i)
+}
+
+fn main() {
+ println!("{}", make_and_invoke_dyn_star(42));
+}
diff --git a/src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs b/src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs
new file mode 100644
index 000000000..67240c8e8
--- /dev/null
+++ b/src/test/ui/dyn-star/no-explicit-dyn-star-cast.rs
@@ -0,0 +1,13 @@
+use std::fmt::Debug;
+
+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
+}
+
+fn main() {
+ make_dyn_star();
+}
diff --git a/src/test/ui/dyn-star/no-explicit-dyn-star-cast.stderr b/src/test/ui/dyn-star/no-explicit-dyn-star-cast.stderr
new file mode 100644
index 000000000..687d7db04
--- /dev/null
+++ b/src/test/ui/dyn-star/no-explicit-dyn-star-cast.stderr
@@ -0,0 +1,28 @@
+error[E0658]: dyn* trait objects are unstable
+ --> $DIR/no-explicit-dyn-star-cast.rs:5:16
+ |
+LL | let dyn_i: dyn* Debug = i as dyn* Debug;
+ | ^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(dyn_star)]` to the crate attributes to enable
+
+error[E0658]: dyn* trait objects are unstable
+ --> $DIR/no-explicit-dyn-star-cast.rs:5:34
+ |
+LL | let dyn_i: dyn* Debug = i as dyn* Debug;
+ | ^^^^^^^^^^
+ |
+ = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
+ = help: add `#![feature(dyn_star)]` to the crate attributes to enable
+
+error[E0606]: casting `usize` as `dyn* Debug` is invalid
+ --> $DIR/no-explicit-dyn-star-cast.rs:5:29
+ |
+LL | let dyn_i: dyn* Debug = i as dyn* Debug;
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0606, E0658.
+For more information about an error, try `rustc --explain E0606`.
diff --git a/src/test/ui/dyn-star/no-explicit-dyn-star.rs b/src/test/ui/dyn-star/no-explicit-dyn-star.rs
new file mode 100644
index 000000000..4f726b7c6
--- /dev/null
+++ b/src/test/ui/dyn-star/no-explicit-dyn-star.rs
@@ -0,0 +1,8 @@
+// aux-build:dyn-star-foreign.rs
+
+extern crate dyn_star_foreign;
+
+fn main() {
+ dyn_star_foreign::require_dyn_star_display(1usize as _);
+ //~^ ERROR casting `usize` as `dyn* std::fmt::Display` is invalid
+}
diff --git a/src/test/ui/dyn-star/no-explicit-dyn-star.stderr b/src/test/ui/dyn-star/no-explicit-dyn-star.stderr
new file mode 100644
index 000000000..49706fae1
--- /dev/null
+++ b/src/test/ui/dyn-star/no-explicit-dyn-star.stderr
@@ -0,0 +1,9 @@
+error[E0606]: casting `usize` as `dyn* std::fmt::Display` is invalid
+ --> $DIR/no-explicit-dyn-star.rs:6:48
+ |
+LL | dyn_star_foreign::require_dyn_star_display(1usize as _);
+ | ^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0606`.
diff --git a/src/test/ui/dyn-star/no-implicit-dyn-star.rs b/src/test/ui/dyn-star/no-implicit-dyn-star.rs
new file mode 100644
index 000000000..d9470e284
--- /dev/null
+++ b/src/test/ui/dyn-star/no-implicit-dyn-star.rs
@@ -0,0 +1,8 @@
+// aux-build:dyn-star-foreign.rs
+
+extern crate dyn_star_foreign;
+
+fn main() {
+ dyn_star_foreign::require_dyn_star_display(1usize);
+ //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/dyn-star/no-implicit-dyn-star.stderr b/src/test/ui/dyn-star/no-implicit-dyn-star.stderr
new file mode 100644
index 000000000..e7c591862
--- /dev/null
+++ b/src/test/ui/dyn-star/no-implicit-dyn-star.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+ --> $DIR/no-implicit-dyn-star.rs:6:48
+ |
+LL | dyn_star_foreign::require_dyn_star_display(1usize);
+ | ------------------------------------------ ^^^^^^ expected trait object `dyn std::fmt::Display`, found `usize`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected trait object `(dyn* std::fmt::Display + 'static)`
+ found type `usize`
+note: function defined here
+ --> $DIR/auxiliary/dyn-star-foreign.rs:6:8
+ |
+LL | pub fn require_dyn_star_display(_: dyn* Display) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/dyn-star/syntax.rs b/src/test/ui/dyn-star/syntax.rs
new file mode 100644
index 000000000..618c72562
--- /dev/null
+++ b/src/test/ui/dyn-star/syntax.rs
@@ -0,0 +1,11 @@
+// Make sure we can parse the `dyn* Trait` syntax
+//
+// check-pass
+
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+pub fn dyn_star_parameter(_: dyn* Send) {
+}
+
+fn main() {}
diff --git a/src/test/ui/dyn-star/upcast.rs b/src/test/ui/dyn-star/upcast.rs
new file mode 100644
index 000000000..cee76ada7
--- /dev/null
+++ b/src/test/ui/dyn-star/upcast.rs
@@ -0,0 +1,33 @@
+// run-pass
+
+#![feature(dyn_star, trait_upcasting)]
+#![allow(incomplete_features)]
+
+trait Foo: Bar {
+ fn hello(&self);
+}
+
+trait Bar {
+ fn world(&self);
+}
+
+struct W(usize);
+
+impl Foo for W {
+ fn hello(&self) {
+ println!("hello!");
+ }
+}
+
+impl Bar for W {
+ fn world(&self) {
+ println!("world!");
+ }
+}
+
+fn main() {
+ let w: dyn* Foo = W(0);
+ w.hello();
+ let w: dyn* Bar = w;
+ w.world();
+}
diff --git a/src/test/ui/dynamically-sized-types/dst-struct.rs b/src/test/ui/dynamically-sized-types/dst-struct.rs
index 25ec07b88..5da9381f8 100644
--- a/src/test/ui/dynamically-sized-types/dst-struct.rs
+++ b/src/test/ui/dynamically-sized-types/dst-struct.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
struct Fat<T: ?Sized> {
f1: isize,
@@ -111,7 +110,7 @@ pub fn main() {
assert_eq!((*f2)[1], 2);
// Nested Box.
- let f1 : Box<Fat<[isize; 3]>> = box Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] };
+ let f1 : Box<Fat<[isize; 3]>> = Box::new(Fat { f1: 5, f2: "some str", ptr: [1, 2, 3] });
foo(&*f1);
let f2 : Box<Fat<[isize]>> = f1;
foo(&*f2);
diff --git a/src/test/ui/dynamically-sized-types/dst-trait.rs b/src/test/ui/dynamically-sized-types/dst-trait.rs
index ec6bc7219..7ac6f0392 100644
--- a/src/test/ui/dynamically-sized-types/dst-trait.rs
+++ b/src/test/ui/dynamically-sized-types/dst-trait.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
struct Fat<T: ?Sized> {
f1: isize,
diff --git a/src/test/ui/editions/edition-raw-pointer-method-2015.stderr b/src/test/ui/editions/edition-raw-pointer-method-2015.stderr
index 417daf36f..612dd17e7 100644
--- a/src/test/ui/editions/edition-raw-pointer-method-2015.stderr
+++ b/src/test/ui/editions/edition-raw-pointer-method-2015.stderr
@@ -4,14 +4,14 @@ error: type annotations needed
LL | let _ = y.is_null();
| ^^^^^^^
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
note: the lint level is defined here
--> $DIR/edition-raw-pointer-method-2015.rs:5:8
|
LL | #[deny(warnings)]
| ^^^^^^^^
= note: `#[deny(tyvar_behind_raw_pointer)]` implied by `#[deny(warnings)]`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
error: aborting due to previous error
diff --git a/src/test/ui/empty/empty-attributes.stderr b/src/test/ui/empty/empty-attributes.stderr
index 8653eaf5c..01d0d5a6b 100644
--- a/src/test/ui/empty/empty-attributes.stderr
+++ b/src/test/ui/empty/empty-attributes.stderr
@@ -4,12 +4,12 @@ error: unused attribute
LL | #[repr()]
| ^^^^^^^^^ help: remove this attribute
|
+ = note: attribute `repr` with an empty list has no effect
note: the lint level is defined here
--> $DIR/empty-attributes.rs:3:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = note: attribute `repr` with an empty list has no effect
error: unused attribute
--> $DIR/empty-attributes.rs:14:1
diff --git a/src/test/ui/empty/empty-never-array.rs b/src/test/ui/empty/empty-never-array.rs
index 01b99134a..3de2b1a78 100644
--- a/src/test/ui/empty/empty-never-array.rs
+++ b/src/test/ui/empty/empty-never-array.rs
@@ -8,7 +8,7 @@ enum Helper<T, U> {
fn transmute<T, U>(t: T) -> U {
let Helper::U(u) = Helper::T(t, []);
- //~^ ERROR refutable pattern in local binding: `T(_, _)` not covered
+ //~^ ERROR refutable pattern in local binding: `Helper::T(_, _)` not covered
u
}
diff --git a/src/test/ui/empty/empty-never-array.stderr b/src/test/ui/empty/empty-never-array.stderr
index 909aa73a7..adf782743 100644
--- a/src/test/ui/empty/empty-never-array.stderr
+++ b/src/test/ui/empty/empty-never-array.stderr
@@ -1,8 +1,8 @@
-error[E0005]: refutable pattern in local binding: `T(_, _)` not covered
+error[E0005]: refutable pattern in local binding: `Helper::T(_, _)` not covered
--> $DIR/empty-never-array.rs:10:9
|
LL | let Helper::U(u) = Helper::T(t, []);
- | ^^^^^^^^^^^^ pattern `T(_, _)` not covered
+ | ^^^^^^^^^^^^ pattern `Helper::T(_, _)` 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
@@ -18,7 +18,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let u = if let Helper::U(u) = Helper::T(t, []) { u } else { todo!() };
| ++++++++++ ++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+help: alternatively, you might want to use let else to handle the variant that isn't matched
|
LL | let Helper::U(u) = Helper::T(t, []) else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr
index 5fc0a916a..5b0ca613f 100644
--- a/src/test/ui/empty/empty-struct-braces-expr.stderr
+++ b/src/test/ui/empty/empty-struct-braces-expr.stderr
@@ -21,29 +21,6 @@ help: a unit struct with a similar name exists
LL | let e1 = XEmpty2;
| ~~~~~~~
-error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1`
- --> $DIR/empty-struct-braces-expr.rs:16:14
- |
-LL | struct Empty1 {}
- | ---------------- `Empty1` defined here
-...
-LL | let e1 = Empty1();
- | ^^^^^^^^
- |
- ::: $DIR/auxiliary/empty-struct.rs:2:1
- |
-LL | pub struct XEmpty2;
- | ------------------ similarly named unit struct `XEmpty2` defined here
- |
-help: use struct literal syntax instead
- |
-LL | let e1 = Empty1 {};
- | ~~~~~~~~~
-help: a unit struct with a similar name exists
- |
-LL | let e1 = XEmpty2();
- | ~~~~~~~
-
error[E0423]: expected value, found struct variant `E::Empty3`
--> $DIR/empty-struct-braces-expr.rs:18:14
|
@@ -84,6 +61,29 @@ help: a unit struct with a similar name exists
LL | let xe1 = XEmpty2;
| ~~~~~~~
+error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1`
+ --> $DIR/empty-struct-braces-expr.rs:16:14
+ |
+LL | struct Empty1 {}
+ | ---------------- `Empty1` defined here
+...
+LL | let e1 = Empty1();
+ | ^^^^^^^^
+ |
+ ::: $DIR/auxiliary/empty-struct.rs:2:1
+ |
+LL | pub struct XEmpty2;
+ | ------------------ similarly named unit struct `XEmpty2` defined here
+ |
+help: use struct literal syntax instead
+ |
+LL | let e1 = Empty1 {};
+ | ~~~~~~~~~
+help: a unit struct with a similar name exists
+ |
+LL | let e1 = XEmpty2();
+ | ~~~~~~~
+
error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1`
--> $DIR/empty-struct-braces-expr.rs:23:15
|
diff --git a/src/test/ui/empty_global_asm.rs b/src/test/ui/empty_global_asm.rs
index dbcc7be05..af13762d1 100644
--- a/src/test/ui/empty_global_asm.rs
+++ b/src/test/ui/empty_global_asm.rs
@@ -1,21 +1,8 @@
+// needs-asm-support
// run-pass
-#[allow(unused_imports)]
use std::arch::global_asm;
-#[cfg(target_arch = "x86")]
-global_asm!("");
-
-#[cfg(target_arch = "x86_64")]
-global_asm!("");
-
-#[cfg(target_arch = "arm")]
-global_asm!("");
-
-#[cfg(target_arch = "aarch64")]
-global_asm!("");
-
-#[cfg(target_arch = "mips")]
global_asm!("");
fn main() {}
diff --git a/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs b/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs
index 4da7b5ab2..a6e5f70fd 100644
--- a/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs
+++ b/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.rs
@@ -1,5 +1,4 @@
#![crate_type="lib"]
-#![feature(arbitrary_enum_discriminant)]
enum Enum {
//~^ ERROR `#[repr(inttype)]` must be specified
diff --git a/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr b/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr
index 803bb06fc..8cee74696 100644
--- a/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr
+++ b/src/test/ui/enum-discriminant/arbitrary_enum_discriminant-no-repr.stderr
@@ -1,5 +1,5 @@
error[E0732]: `#[repr(inttype)]` must be specified
- --> $DIR/arbitrary_enum_discriminant-no-repr.rs:4:1
+ --> $DIR/arbitrary_enum_discriminant-no-repr.rs:3:1
|
LL | enum Enum {
| ^^^^^^^^^
diff --git a/src/test/ui/enum-discriminant/arbitrary_enum_discriminant.rs b/src/test/ui/enum-discriminant/arbitrary_enum_discriminant.rs
index ccc423e4a..83e74a6e6 100644
--- a/src/test/ui/enum-discriminant/arbitrary_enum_discriminant.rs
+++ b/src/test/ui/enum-discriminant/arbitrary_enum_discriminant.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(arbitrary_enum_discriminant, test)]
+#![feature(test)]
extern crate test;
diff --git a/src/test/ui/enum-discriminant/discriminant_size.stderr b/src/test/ui/enum-discriminant/discriminant_size.stderr
index efc7d9984..9b1505b5c 100644
--- a/src/test/ui/enum-discriminant/discriminant_size.stderr
+++ b/src/test/ui/enum-discriminant/discriminant_size.stderr
@@ -4,8 +4,8 @@ warning: the feature `repr128` is incomplete and may not be safe to use and/or c
LL | #![feature(core_intrinsics, repr128)]
| ^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/enum-discriminant/discriminant_value.rs b/src/test/ui/enum-discriminant/discriminant_value.rs
index 65ab411db..f3dfac298 100644
--- a/src/test/ui/enum-discriminant/discriminant_value.rs
+++ b/src/test/ui/enum-discriminant/discriminant_value.rs
@@ -1,6 +1,6 @@
// run-pass
#![allow(stable_features)]
-#![feature(arbitrary_enum_discriminant, core, core_intrinsics)]
+#![feature(core, core_intrinsics)]
extern crate core;
use core::intrinsics::discriminant_value;
diff --git a/src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.rs b/src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.rs
deleted file mode 100644
index 3e90af4d3..000000000
--- a/src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-#![crate_type="lib"]
-
-enum Enum {
- Unit = 1,
- //~^ ERROR custom discriminant values are not allowed in enums with tuple or struct variants
- Tuple() = 2,
- //~^ ERROR discriminants on non-unit variants are experimental
- Struct{} = 3,
- //~^ ERROR discriminants on non-unit variants are experimental
-}
diff --git a/src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.stderr b/src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.stderr
deleted file mode 100644
index b5f61e6e9..000000000
--- a/src/test/ui/enum-discriminant/feature-gate-arbitrary_enum_discriminant.stderr
+++ /dev/null
@@ -1,36 +0,0 @@
-error[E0658]: discriminants on non-unit variants are experimental
- --> $DIR/feature-gate-arbitrary_enum_discriminant.rs:6:13
- |
-LL | Tuple() = 2,
- | ^
- |
- = note: see issue #60553 <https://github.com/rust-lang/rust/issues/60553> for more information
- = help: add `#![feature(arbitrary_enum_discriminant)]` to the crate attributes to enable
-
-error[E0658]: discriminants on non-unit variants are experimental
- --> $DIR/feature-gate-arbitrary_enum_discriminant.rs:8:14
- |
-LL | Struct{} = 3,
- | ^
- |
- = note: see issue #60553 <https://github.com/rust-lang/rust/issues/60553> for more information
- = help: add `#![feature(arbitrary_enum_discriminant)]` to the crate attributes to enable
-
-error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants
- --> $DIR/feature-gate-arbitrary_enum_discriminant.rs:4:10
- |
-LL | Unit = 1,
- | ^ disallowed custom discriminant
-LL |
-LL | Tuple() = 2,
- | ----------- tuple variant defined here
-LL |
-LL | Struct{} = 3,
- | ------------ struct variant defined here
- |
- = note: see issue #60553 <https://github.com/rust-lang/rust/issues/60553> for more information
- = help: add `#![feature(arbitrary_enum_discriminant)]` 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/src/test/ui/enum-discriminant/issue-43398.stderr b/src/test/ui/enum-discriminant/issue-43398.stderr
index 9a394153b..fc7bbd062 100644
--- a/src/test/ui/enum-discriminant/issue-43398.stderr
+++ b/src/test/ui/enum-discriminant/issue-43398.stderr
@@ -4,8 +4,8 @@ warning: the feature `repr128` is incomplete and may not be safe to use and/or c
LL | #![feature(repr128)]
| ^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.rs b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.rs
index f927dd189..ad9fcc25b 100644
--- a/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.rs
+++ b/src/test/ui/enum-discriminant/issue-70453-generics-in-discr-ice-2.rs
@@ -1,4 +1,4 @@
-#![feature(arbitrary_enum_discriminant, core_intrinsics)]
+#![feature(core_intrinsics)]
extern crate core;
use core::intrinsics::discriminant_value;
diff --git a/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.rs b/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.rs
index e62582fb5..42a062239 100644
--- a/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.rs
+++ b/src/test/ui/enum-discriminant/issue-70453-polymorphic-ctfe.rs
@@ -1,4 +1,4 @@
-#![feature(arbitrary_enum_discriminant, core_intrinsics)]
+#![feature(core_intrinsics)]
extern crate core;
use core::intrinsics::discriminant_value;
diff --git a/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs b/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs
index ae389e114..3adac7b72 100644
--- a/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs
+++ b/src/test/ui/enum-discriminant/issue-70509-partial_eq.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(repr128, arbitrary_enum_discriminant)]
+#![feature(repr128)]
//~^ WARN the feature `repr128` is incomplete
#[derive(PartialEq, Debug)]
diff --git a/src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr b/src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr
index 5bf6ea56e..2eef930c3 100644
--- a/src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr
+++ b/src/test/ui/enum-discriminant/issue-70509-partial_eq.stderr
@@ -1,11 +1,11 @@
warning: the feature `repr128` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/issue-70509-partial_eq.rs:2:12
|
-LL | #![feature(repr128, arbitrary_enum_discriminant)]
+LL | #![feature(repr128)]
| ^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/enum-discriminant/repr128.stderr b/src/test/ui/enum-discriminant/repr128.stderr
index 88adfb174..da8d75c11 100644
--- a/src/test/ui/enum-discriminant/repr128.stderr
+++ b/src/test/ui/enum-discriminant/repr128.stderr
@@ -4,8 +4,8 @@ warning: the feature `repr128` is incomplete and may not be safe to use and/or c
LL | #![feature(repr128, core_intrinsics, discriminant_kind)]
| ^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #56071 <https://github.com/rust-lang/rust/issues/56071> for more information
+ = note: `#[warn(incomplete_features)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/enum/enum-discrim-autosizing.rs b/src/test/ui/enum/enum-discrim-autosizing.rs
index 27fab1bb5..fc94d281c 100644
--- a/src/test/ui/enum/enum-discrim-autosizing.rs
+++ b/src/test/ui/enum/enum-discrim-autosizing.rs
@@ -6,9 +6,9 @@
enum Eu64 {
//~^ ERROR discriminant value `0` assigned more than once
Au64 = 0,
- //~^NOTE first assignment of `0`
+ //~^NOTE `0` assigned here
Bu64 = 0x8000_0000_0000_0000
- //~^NOTE second assignment of `0` (overflowed from `9223372036854775808`)
+ //~^NOTE `0` (overflowed from `9223372036854775808`) assigned here
}
fn main() {}
diff --git a/src/test/ui/enum/enum-discrim-autosizing.stderr b/src/test/ui/enum/enum-discrim-autosizing.stderr
index eacea86d6..be3d7c64e 100644
--- a/src/test/ui/enum/enum-discrim-autosizing.stderr
+++ b/src/test/ui/enum/enum-discrim-autosizing.stderr
@@ -5,10 +5,10 @@ LL | enum Eu64 {
| ^^^^^^^^^
LL |
LL | Au64 = 0,
- | - first assignment of `0`
+ | - `0` assigned here
LL |
LL | Bu64 = 0x8000_0000_0000_0000
- | --------------------- second assignment of `0` (overflowed from `9223372036854775808`)
+ | --------------------- `0` (overflowed from `9223372036854775808`) assigned here
error: aborting due to previous error
diff --git a/src/test/ui/enum/enum-discrim-too-small2.stderr b/src/test/ui/enum/enum-discrim-too-small2.stderr
index 438306795..f79f7a043 100644
--- a/src/test/ui/enum/enum-discrim-too-small2.stderr
+++ b/src/test/ui/enum/enum-discrim-too-small2.stderr
@@ -4,13 +4,13 @@ error: literal out of range for `i8`
LL | Ci8 = 223,
| ^^^
|
+ = note: the literal `223` does not fit into the type `i8` whose range is `-128..=127`
+ = help: consider using the type `u8` instead
note: the lint level is defined here
--> $DIR/enum-discrim-too-small2.rs:1:9
|
LL | #![deny(overflowing_literals)]
| ^^^^^^^^^^^^^^^^^^^^
- = note: the literal `223` does not fit into the type `i8` whose range is `-128..=127`
- = help: consider using the type `u8` instead
error: literal out of range for `i16`
--> $DIR/enum-discrim-too-small2.rs:15:12
diff --git a/src/test/ui/env-funky-keys.rs b/src/test/ui/env-funky-keys.rs
index 4548d3339..46e20d8c6 100644
--- a/src/test/ui/env-funky-keys.rs
+++ b/src/test/ui/env-funky-keys.rs
@@ -6,6 +6,7 @@
// ignore-emscripten no execve
// ignore-sgx no execve
// ignore-vxworks no execve
+// ignore-fuchsia no 'execve'
// no-prefer-dynamic
#![feature(rustc_private)]
diff --git a/src/test/ui/error-codes/E0004.stderr b/src/test/ui/error-codes/E0004.stderr
index 8ba151d9e..4ac8c904f 100644
--- a/src/test/ui/error-codes/E0004.stderr
+++ b/src/test/ui/error-codes/E0004.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `HastaLaVistaBaby` not covered
+error[E0004]: non-exhaustive patterns: `Terminator::HastaLaVistaBaby` not covered
--> $DIR/E0004.rs:9:11
|
LL | match x {
- | ^ pattern `HastaLaVistaBaby` not covered
+ | ^ pattern `Terminator::HastaLaVistaBaby` not covered
|
note: `Terminator` defined here
--> $DIR/E0004.rs:2:5
@@ -15,7 +15,7 @@ LL | HastaLaVistaBaby,
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 + HastaLaVistaBaby => todo!()
+LL + Terminator::HastaLaVistaBaby => todo!()
|
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr
index f01a77bd3..de8e6bac4 100644
--- a/src/test/ui/error-codes/E0005.stderr
+++ b/src/test/ui/error-codes/E0005.stderr
@@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let y = if let Some(y) = x { y } else { todo!() };
| ++++++++++ ++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+help: alternatively, you might want to use let else to handle the variant that isn't matched
|
LL | let Some(y) = x else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/error-codes/E0017.stderr b/src/test/ui/error-codes/E0017.stderr
index 830e4db34..6e48f9582 100644
--- a/src/test/ui/error-codes/E0017.stderr
+++ b/src/test/ui/error-codes/E0017.stderr
@@ -4,7 +4,6 @@ warning: taking a mutable reference to a `const` item
LL | const CR: &'static mut i32 = &mut C;
| ^^^^^^
|
- = note: `#[warn(const_item_mutation)]` on by default
= note: each usage of a `const` item creates a new temporary
= note: the mutable reference will refer to this temporary, not the original `const` item
note: `const` item defined here
@@ -12,6 +11,7 @@ note: `const` item defined here
|
LL | const C: i32 = 2;
| ^^^^^^^^^^^^
+ = note: `#[warn(const_item_mutation)]` on by default
error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/E0017.rs:5:30
diff --git a/src/test/ui/error-codes/E0057.stderr b/src/test/ui/error-codes/E0057.stderr
index 2307f52c9..bea226f09 100644
--- a/src/test/ui/error-codes/E0057.stderr
+++ b/src/test/ui/error-codes/E0057.stderr
@@ -12,7 +12,7 @@ LL | let f = |x| x * 3;
help: provide the argument
|
LL | let a = f(/* value */);
- | ~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error[E0057]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/E0057.rs:5:13
@@ -28,7 +28,7 @@ LL | let f = |x| x * 3;
help: remove the extra argument
|
LL | let c = f(2);
- | ~~~~
+ | ~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/error-codes/E0060.stderr b/src/test/ui/error-codes/E0060.stderr
index 644fd5983..934a18d89 100644
--- a/src/test/ui/error-codes/E0060.stderr
+++ b/src/test/ui/error-codes/E0060.stderr
@@ -12,7 +12,7 @@ LL | fn printf(_: *const u8, ...) -> u32;
help: provide the argument
|
LL | unsafe { printf(/* *const u8 */); }
- | ~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0061.stderr b/src/test/ui/error-codes/E0061.stderr
index fa55db092..fa4ccbe66 100644
--- a/src/test/ui/error-codes/E0061.stderr
+++ b/src/test/ui/error-codes/E0061.stderr
@@ -12,7 +12,7 @@ LL | fn f(a: u16, b: &str) {}
help: provide the argument
|
LL | f(0, /* &str */);
- | ~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/E0061.rs:9:5
@@ -28,7 +28,7 @@ LL | fn f2(a: u16) {}
help: provide the argument
|
LL | f2(/* u16 */);
- | ~~~~~~~~~~~~~
+ | ~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/error-codes/E0081.rs b/src/test/ui/error-codes/E0081.rs
index 5aa6a7863..f53fda864 100644
--- a/src/test/ui/error-codes/E0081.rs
+++ b/src/test/ui/error-codes/E0081.rs
@@ -1,9 +1,9 @@
enum Enum {
//~^ ERROR discriminant value `3` assigned more than once
P = 3,
- //~^ NOTE first assignment of `3`
+ //~^ NOTE `3` assigned here
X = 3,
- //~^ NOTE second assignment of `3`
+ //~^ NOTE `3` assigned here
Y = 5
}
@@ -11,20 +11,43 @@ enum Enum {
enum EnumOverflowRepr {
//~^ ERROR discriminant value `1` assigned more than once
P = 257,
- //~^ NOTE first assignment of `1` (overflowed from `257`)
+ //~^ NOTE `1` (overflowed from `257`) assigned here
X = 513,
- //~^ NOTE second assignment of `1` (overflowed from `513`)
+ //~^ NOTE `1` (overflowed from `513`) assigned here
}
#[repr(i8)]
enum NegDisEnum {
//~^ ERROR discriminant value `-1` assigned more than once
First = -1,
- //~^ NOTE first assignment of `-1`
+ //~^ NOTE `-1` assigned here
Second = -2,
- //~^ NOTE assigned discriminant for `Last` was incremented from this discriminant
+ //~^ NOTE discriminant for `Last` incremented from this startpoint (`Second` + 1 variant later => `Last` = -1)
Last,
- //~^ NOTE second assignment of `-1`
+ //~^ NOTE `-1` assigned here
+}
+
+enum MultipleDuplicates {
+ //~^ ERROR discriminant value `0` assigned more than once
+ //~^^ ERROR discriminant value `-2` assigned more than once
+ V0,
+ //~^ NOTE `0` assigned here
+ V1 = 0,
+ //~^ NOTE `0` assigned here
+ V2,
+ V3,
+ V4 = 0,
+ //~^ NOTE `0` assigned here
+ V5 = -2,
+ //~^ NOTE discriminant for `V7` incremented from this startpoint (`V5` + 2 variants later => `V7` = 0)
+ //~^^ NOTE `-2` assigned here
+ V6,
+ V7,
+ //~^ NOTE `0` assigned here
+ V8 = -3,
+ //~^ NOTE discriminant for `V9` incremented from this startpoint (`V8` + 1 variant later => `V9` = -2)
+ V9,
+ //~^ NOTE `-2` assigned here
}
fn main() {
diff --git a/src/test/ui/error-codes/E0081.stderr b/src/test/ui/error-codes/E0081.stderr
index ff6113646..64562fefc 100644
--- a/src/test/ui/error-codes/E0081.stderr
+++ b/src/test/ui/error-codes/E0081.stderr
@@ -5,10 +5,10 @@ LL | enum Enum {
| ^^^^^^^^^
LL |
LL | P = 3,
- | - first assignment of `3`
+ | - `3` assigned here
LL |
LL | X = 3,
- | - second assignment of `3`
+ | - `3` assigned here
error[E0081]: discriminant value `1` assigned more than once
--> $DIR/E0081.rs:11:1
@@ -17,10 +17,10 @@ LL | enum EnumOverflowRepr {
| ^^^^^^^^^^^^^^^^^^^^^
LL |
LL | P = 257,
- | --- first assignment of `1` (overflowed from `257`)
+ | --- `1` (overflowed from `257`) assigned here
LL |
LL | X = 513,
- | --- second assignment of `1` (overflowed from `513`)
+ | --- `1` (overflowed from `513`) assigned here
error[E0081]: discriminant value `-1` assigned more than once
--> $DIR/E0081.rs:20:1
@@ -29,14 +29,50 @@ LL | enum NegDisEnum {
| ^^^^^^^^^^^^^^^
LL |
LL | First = -1,
- | -- first assignment of `-1`
+ | -- `-1` assigned here
LL |
LL | Second = -2,
- | ----------- assigned discriminant for `Last` was incremented from this discriminant
+ | ----------- discriminant for `Last` incremented from this startpoint (`Second` + 1 variant later => `Last` = -1)
LL |
LL | Last,
- | ---- second assignment of `-1`
+ | ---- `-1` assigned here
-error: aborting due to 3 previous errors
+error[E0081]: discriminant value `0` assigned more than once
+ --> $DIR/E0081.rs:30:1
+ |
+LL | enum MultipleDuplicates {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | V0,
+ | -- `0` assigned here
+LL |
+LL | V1 = 0,
+ | - `0` assigned here
+...
+LL | V4 = 0,
+ | - `0` assigned here
+LL |
+LL | V5 = -2,
+ | ------- discriminant for `V7` incremented from this startpoint (`V5` + 2 variants later => `V7` = 0)
+...
+LL | V7,
+ | -- `0` assigned here
+
+error[E0081]: discriminant value `-2` assigned more than once
+ --> $DIR/E0081.rs:30:1
+ |
+LL | enum MultipleDuplicates {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+...
+LL | V5 = -2,
+ | -- `-2` assigned here
+...
+LL | V8 = -3,
+ | ------- discriminant for `V9` incremented from this startpoint (`V8` + 1 variant later => `V9` = -2)
+LL |
+LL | V9,
+ | -- `-2` assigned here
+
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0081`.
diff --git a/src/test/ui/error-codes/E0094.rs b/src/test/ui/error-codes/E0094.rs
index 0d58e5a28..a2ec932c1 100644
--- a/src/test/ui/error-codes/E0094.rs
+++ b/src/test/ui/error-codes/E0094.rs
@@ -1,5 +1,7 @@
#![feature(intrinsics)]
+
extern "rust-intrinsic" {
+ #[rustc_safe_intrinsic]
fn size_of<T, U>() -> usize; //~ ERROR E0094
}
diff --git a/src/test/ui/error-codes/E0094.stderr b/src/test/ui/error-codes/E0094.stderr
index da97f3a01..531cd4c78 100644
--- a/src/test/ui/error-codes/E0094.stderr
+++ b/src/test/ui/error-codes/E0094.stderr
@@ -1,5 +1,5 @@
error[E0094]: intrinsic has wrong number of type parameters: found 2, expected 1
- --> $DIR/E0094.rs:3:15
+ --> $DIR/E0094.rs:5:15
|
LL | fn size_of<T, U>() -> usize;
| ^^^^^^ expected 1 type parameter
diff --git a/src/test/ui/error-codes/E0107.stderr b/src/test/ui/error-codes/E0107.stderr
index 5ca03b45d..03430f8fa 100644
--- a/src/test/ui/error-codes/E0107.stderr
+++ b/src/test/ui/error-codes/E0107.stderr
@@ -142,7 +142,7 @@ LL | pub trait T {
help: replace the generic bounds with the associated types
|
LL | fn trait_bound_generic<I: T<A = u8, B = u16>>(_i: I) {
- | ~~~~~~ ~~~~~~~
+ | +++ +++
error: aborting due to 10 previous errors
diff --git a/src/test/ui/error-codes/E0117.rs b/src/test/ui/error-codes/E0117.rs
index 22b486573..406d24e36 100644
--- a/src/test/ui/error-codes/E0117.rs
+++ b/src/test/ui/error-codes/E0117.rs
@@ -1,4 +1,4 @@
impl Drop for u32 {} //~ ERROR E0117
-//~| ERROR the `Drop` trait may only be implemented for structs, enums, and unions
+//~| ERROR the `Drop` trait may only be implemented for local structs, enums, and unions
fn main() {}
diff --git a/src/test/ui/error-codes/E0117.stderr b/src/test/ui/error-codes/E0117.stderr
index 76d9f5cc0..f144aa9f7 100644
--- a/src/test/ui/error-codes/E0117.stderr
+++ b/src/test/ui/error-codes/E0117.stderr
@@ -9,11 +9,11 @@ LL | impl Drop for u32 {}
|
= note: define and implement a trait or new type instead
-error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions
+error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
--> $DIR/E0117.rs:1:15
|
LL | impl Drop for u32 {}
- | ^^^ must be a struct, enum, or union
+ | ^^^ must be a struct, enum, or union in the current crate
error: aborting due to 2 previous errors
diff --git a/src/test/ui/error-codes/E0120.stderr b/src/test/ui/error-codes/E0120.stderr
index 6c306455e..75778f1f9 100644
--- a/src/test/ui/error-codes/E0120.stderr
+++ b/src/test/ui/error-codes/E0120.stderr
@@ -1,8 +1,8 @@
-error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions
+error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
--> $DIR/E0120.rs:3:15
|
LL | impl Drop for dyn MyTrait {
- | ^^^^^^^^^^^ must be a struct, enum, or union
+ | ^^^^^^^^^^^ must be a struct, enum, or union in the current crate
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0199.stderr b/src/test/ui/error-codes/E0199.stderr
index 3632d26cd..99d808c0d 100644
--- a/src/test/ui/error-codes/E0199.stderr
+++ b/src/test/ui/error-codes/E0199.stderr
@@ -3,6 +3,12 @@ error[E0199]: implementing the trait `Bar` is not unsafe
|
LL | unsafe impl Bar for Foo { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: remove `unsafe` from this trait implementation
+ |
+LL - unsafe impl Bar for Foo { }
+LL + impl Bar for Foo { }
+ |
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0200.stderr b/src/test/ui/error-codes/E0200.stderr
index 677271aad..1fd86aece 100644
--- a/src/test/ui/error-codes/E0200.stderr
+++ b/src/test/ui/error-codes/E0200.stderr
@@ -3,6 +3,12 @@ error[E0200]: the trait `Bar` requires an `unsafe impl` declaration
|
LL | impl Bar for Foo { }
| ^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the trait `Bar` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
+help: add `unsafe` to this trait implementation
+ |
+LL | unsafe impl Bar for Foo { }
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0201.rs b/src/test/ui/error-codes/E0201.rs
index adefd4bcd..04b37091b 100644
--- a/src/test/ui/error-codes/E0201.rs
+++ b/src/test/ui/error-codes/E0201.rs
@@ -2,7 +2,7 @@ struct Foo(u8);
impl Foo {
fn bar(&self) -> bool { self.0 > 5 }
- fn bar() {} //~ ERROR E0201
+ fn bar() {} //~ ERROR E0592
}
trait Baz {
diff --git a/src/test/ui/error-codes/E0201.stderr b/src/test/ui/error-codes/E0201.stderr
index 94e068941..608ff6917 100644
--- a/src/test/ui/error-codes/E0201.stderr
+++ b/src/test/ui/error-codes/E0201.stderr
@@ -1,28 +1,35 @@
-error[E0201]: duplicate definitions with name `bar`:
- --> $DIR/E0201.rs:5:5
- |
-LL | fn bar(&self) -> bool { self.0 > 5 }
- | --------------------- previous definition of `bar` here
-LL | fn bar() {}
- | ^^^^^^^^ duplicate definition
-
error[E0201]: duplicate definitions with name `baz`:
--> $DIR/E0201.rs:17:5
|
+LL | fn baz(&self) -> bool;
+ | ---------------------- item in trait
+...
LL | fn baz(&self) -> bool { true }
- | --------------------- previous definition of `baz` here
+ | ------------------------------ previous definition here
LL | fn baz(&self) -> bool { self.0 > 5 }
- | ^^^^^^^^^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition
error[E0201]: duplicate definitions with name `Quux`:
--> $DIR/E0201.rs:18:5
|
+LL | type Quux;
+ | ---------- item in trait
+...
LL | type Quux = u32;
- | --------- previous definition of `Quux` here
+ | ---------------- previous definition here
...
LL | type Quux = u32;
- | ^^^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^^^^ duplicate definition
+
+error[E0592]: duplicate definitions with name `bar`
+ --> $DIR/E0201.rs:5:5
+ |
+LL | fn bar(&self) -> bool { self.0 > 5 }
+ | --------------------- other definition for `bar`
+LL | fn bar() {}
+ | ^^^^^^^^ duplicate definitions for `bar`
error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0201`.
+Some errors have detailed explanations: E0201, E0592.
+For more information about an error, try `rustc --explain E0201`.
diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr
index 9c9c7237d..1e2f43834 100644
--- a/src/test/ui/error-codes/E0271.stderr
+++ b/src/test/ui/error-codes/E0271.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
- --> $DIR/E0271.rs:10:5
+ --> $DIR/E0271.rs:10:9
|
LL | foo(3_i8);
- | ^^^ type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
+ | --- ^^^^ type mismatch resolving `<i8 as Trait>::AssociatedType == u32`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `u32`
--> $DIR/E0271.rs:7:43
diff --git a/src/test/ui/error-codes/E0275.stderr b/src/test/ui/error-codes/E0275.stderr
index dfffbb182..87cfaa489 100644
--- a/src/test/ui/error-codes/E0275.stderr
+++ b/src/test/ui/error-codes/E0275.stderr
@@ -5,13 +5,13 @@ LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`E0275`)
-note: required because of the requirements on the impl of `Foo` for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+note: required for `Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<Bar<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Foo`
--> $DIR/E0275.rs:5:9
|
LL | impl<T> Foo for T where Bar<T>: Foo {}
| ^^^ ^
= note: 127 redundant requirements hidden
- = note: required because of the requirements on the impl of `Foo` for `Bar<T>`
+ = note: required for `Bar<T>` to implement `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0277-2.stderr b/src/test/ui/error-codes/E0277-2.stderr
index ca2cb8842..a2abf3793 100644
--- a/src/test/ui/error-codes/E0277-2.stderr
+++ b/src/test/ui/error-codes/E0277-2.stderr
@@ -1,8 +1,8 @@
error[E0277]: `*const u8` cannot be sent between threads safely
- --> $DIR/E0277-2.rs:16:5
+ --> $DIR/E0277-2.rs:16:15
|
LL | is_send::<Foo>();
- | ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely
+ | ^^^ `*const u8` cannot be sent between threads safely
|
= help: within `Foo`, the trait `Send` is not implemented for `*const u8`
note: required because it appears within the type `Baz`
diff --git a/src/test/ui/error-codes/E0283.stderr b/src/test/ui/error-codes/E0283.stderr
index 90a28874e..90316c6e9 100644
--- a/src/test/ui/error-codes/E0283.stderr
+++ b/src/test/ui/error-codes/E0283.stderr
@@ -9,8 +9,8 @@ LL | let cont: u32 = Generator::create();
|
help: use a fully-qualified path to a specific available implementation (2 found)
|
-LL | let cont: u32 = <::Impl as Generator>::create();
- | ++++++++++ +
+LL | let cont: u32 = <Impl as Generator>::create();
+ | ++++++++ +
error[E0283]: type annotations needed
--> $DIR/E0283.rs:35:24
diff --git a/src/test/ui/error-codes/E0308.rs b/src/test/ui/error-codes/E0308.rs
index fa79bee57..dd9e0b284 100644
--- a/src/test/ui/error-codes/E0308.rs
+++ b/src/test/ui/error-codes/E0308.rs
@@ -1,6 +1,8 @@
#![feature(intrinsics)]
+#![feature(rustc_attrs)]
extern "rust-intrinsic" {
+ #[rustc_safe_intrinsic]
fn size_of<T>(); //~ ERROR E0308
}
diff --git a/src/test/ui/error-codes/E0308.stderr b/src/test/ui/error-codes/E0308.stderr
index b71fb95e7..187b775f9 100644
--- a/src/test/ui/error-codes/E0308.stderr
+++ b/src/test/ui/error-codes/E0308.stderr
@@ -1,5 +1,5 @@
error[E0308]: intrinsic has wrong type
- --> $DIR/E0308.rs:4:5
+ --> $DIR/E0308.rs:6:5
|
LL | fn size_of<T>();
| ^^^^^^^^^^^^^^^^ expected `()`, found `usize`
diff --git a/src/test/ui/error-codes/E0311.rs b/src/test/ui/error-codes/E0311.rs
new file mode 100644
index 000000000..566b518b4
--- /dev/null
+++ b/src/test/ui/error-codes/E0311.rs
@@ -0,0 +1,9 @@
+fn no_restriction<T>(x: &()) -> &() {
+ with_restriction::<T>(x) //~ ERROR E0311
+}
+
+fn with_restriction<'a, T: 'a>(x: &'a ()) -> &'a () {
+ x
+}
+
+fn main() {}
diff --git a/src/test/ui/error-codes/E0311.stderr b/src/test/ui/error-codes/E0311.stderr
new file mode 100644
index 000000000..9873b5ae6
--- /dev/null
+++ b/src/test/ui/error-codes/E0311.stderr
@@ -0,0 +1,24 @@
+error[E0311]: the parameter type `T` may not live long enough
+ --> $DIR/E0311.rs:2:5
+ |
+LL | with_restriction::<T>(x)
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the parameter type `T` must be valid for the anonymous lifetime defined here...
+ --> $DIR/E0311.rs:1:25
+ |
+LL | fn no_restriction<T>(x: &()) -> &() {
+ | ^^^
+note: ...so that the type `T` will meet its required lifetime bounds
+ --> $DIR/E0311.rs:2:5
+ |
+LL | with_restriction::<T>(x)
+ | ^^^^^^^^^^^^^^^^^^^^^
+help: consider adding an explicit lifetime bound...
+ |
+LL | fn no_restriction<'a, T: 'a>(x: &()) -> &() {
+ | +++ ++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0311`.
diff --git a/src/test/ui/error-codes/E0388.stderr b/src/test/ui/error-codes/E0388.stderr
index 106efc19a..b51aa263d 100644
--- a/src/test/ui/error-codes/E0388.stderr
+++ b/src/test/ui/error-codes/E0388.stderr
@@ -4,7 +4,6 @@ warning: taking a mutable reference to a `const` item
LL | const CR: &'static mut i32 = &mut C;
| ^^^^^^
|
- = note: `#[warn(const_item_mutation)]` on by default
= note: each usage of a `const` item creates a new temporary
= note: the mutable reference will refer to this temporary, not the original `const` item
note: `const` item defined here
@@ -12,6 +11,7 @@ note: `const` item defined here
|
LL | const C: i32 = 2;
| ^^^^^^^^^^^^
+ = note: `#[warn(const_item_mutation)]` on by default
error[E0764]: mutable references are not allowed in the final value of constants
--> $DIR/E0388.rs:4:30
diff --git a/src/test/ui/error-codes/E0401.stderr b/src/test/ui/error-codes/E0401.stderr
index 81715621d..b0e2ef5b6 100644
--- a/src/test/ui/error-codes/E0401.stderr
+++ b/src/test/ui/error-codes/E0401.stderr
@@ -4,9 +4,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn foo<T>(x: T) {
| - type parameter from outer function
LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
- | --------------------------- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `bfnr<U, V: Baz<U>, W: Fn(), T>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `T,`
error[E0401]: can't use generic parameters from outer function
--> $DIR/E0401.rs:9:16
@@ -15,7 +15,7 @@ LL | fn foo<T>(x: T) {
| - type parameter from outer function
...
LL | fn baz<U,
- | --- try adding a local generic parameter in this method instead
+ | - help: try using a local generic parameter instead: `T,`
...
LL | (y: T) {
| ^ use of generic parameter from outer function
diff --git a/src/test/ui/error-codes/E0423.stderr b/src/test/ui/error-codes/E0423.stderr
index 8f2ef8c8e..ac70d905d 100644
--- a/src/test/ui/error-codes/E0423.stderr
+++ b/src/test/ui/error-codes/E0423.stderr
@@ -26,6 +26,17 @@ help: surround the struct literal with parentheses
LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}
| + +
+error[E0423]: expected value, found struct `T`
+ --> $DIR/E0423.rs:14:8
+ |
+LL | if T {} == T {} { println!("Ok"); }
+ | ^ not a value
+ |
+help: surround the struct literal with parentheses
+ |
+LL | if (T {}) == T {} { println!("Ok"); }
+ | + +
+
error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo`
--> $DIR/E0423.rs:4:13
|
@@ -47,17 +58,6 @@ help: a function with a similar name exists
LL | let f = foo();
| ~~~
-error[E0423]: expected value, found struct `T`
- --> $DIR/E0423.rs:14:8
- |
-LL | if T {} == T {} { println!("Ok"); }
- | ^ not a value
- |
-help: surround the struct literal with parentheses
- |
-LL | if (T {}) == T {} { println!("Ok"); }
- | + +
-
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0423`.
diff --git a/src/test/ui/error-codes/E0520.stderr b/src/test/ui/error-codes/E0520.stderr
index 65ebfcdbe..12ecead13 100644
--- a/src/test/ui/error-codes/E0520.stderr
+++ b/src/test/ui/error-codes/E0520.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0520]: `fly` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/E0520.rs:17:5
diff --git a/src/test/ui/error-codes/E0565-2.stderr b/src/test/ui/error-codes/E0565-2.stderr
index bb30bd7be..097871bd3 100644
--- a/src/test/ui/error-codes/E0565-2.stderr
+++ b/src/test/ui/error-codes/E0565-2.stderr
@@ -2,7 +2,9 @@ error[E0565]: literal in `deprecated` value must be a string
--> $DIR/E0565-2.rs:2:22
|
LL | #[deprecated(since = b"1.29", note = "hi")]
- | ^^^^^^^ help: consider removing the prefix: `"1.29"`
+ | -^^^^^^
+ | |
+ | help: consider removing the prefix
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0585.stderr b/src/test/ui/error-codes/E0585.stderr
index 7a31c4896..53c82fb41 100644
--- a/src/test/ui/error-codes/E0585.stderr
+++ b/src/test/ui/error-codes/E0585.stderr
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// Hello! I'm useless...
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/error-codes/E0771.stderr b/src/test/ui/error-codes/E0771.stderr
index 3ab727f5f..b759399a9 100644
--- a/src/test/ui/error-codes/E0771.stderr
+++ b/src/test/ui/error-codes/E0771.stderr
@@ -12,8 +12,8 @@ warning: the feature `adt_const_params` is incomplete and may not be safe to use
LL | #![feature(adt_const_params)]
| ^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/error-codes/E0790.stderr b/src/test/ui/error-codes/E0790.stderr
index 6e173a968..f68c0e7d2 100644
--- a/src/test/ui/error-codes/E0790.stderr
+++ b/src/test/ui/error-codes/E0790.stderr
@@ -9,8 +9,8 @@ LL | MyTrait::my_fn();
|
help: use the fully-qualified path to the only available implementation
|
-LL | <::inner::MyStruct as MyTrait>::my_fn();
- | +++++++++++++++++++++ +
+LL | <MyStruct as MyTrait>::my_fn();
+ | ++++++++++++ +
error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
--> $DIR/E0790.rs:21:17
@@ -23,8 +23,8 @@ LL | let _ = MyTrait::MY_ASSOC_CONST;
|
help: use the fully-qualified path to the only available implementation
|
-LL | let _ = <::inner::MyStruct as MyTrait>::MY_ASSOC_CONST;
- | +++++++++++++++++++++ +
+LL | let _ = <MyStruct as MyTrait>::MY_ASSOC_CONST;
+ | ++++++++++++ +
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
--> $DIR/E0790.rs:26:5
@@ -37,8 +37,8 @@ LL | inner::MyTrait::my_fn();
|
help: use the fully-qualified path to the only available implementation
|
-LL | inner::<::inner::MyStruct as MyTrait>::my_fn();
- | +++++++++++++++++++++ +
+LL | inner::<MyStruct as MyTrait>::my_fn();
+ | ++++++++++++ +
error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
--> $DIR/E0790.rs:30:13
@@ -51,8 +51,8 @@ LL | let _ = inner::MyTrait::MY_ASSOC_CONST;
|
help: use the fully-qualified path to the only available implementation
|
-LL | let _ = inner::<::inner::MyStruct as MyTrait>::MY_ASSOC_CONST;
- | +++++++++++++++++++++ +
+LL | let _ = inner::<MyStruct as MyTrait>::MY_ASSOC_CONST;
+ | ++++++++++++ +
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
--> $DIR/E0790.rs:50:5
@@ -65,8 +65,8 @@ LL | MyTrait2::my_fn();
|
help: use a fully-qualified path to a specific available implementation (2 found)
|
-LL | <::Impl1 as MyTrait2>::my_fn();
- | +++++++++++ +
+LL | <Impl1 as MyTrait2>::my_fn();
+ | +++++++++ +
error: aborting due to 5 previous errors
diff --git a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr b/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
index 4ec78a298..08eb8cfac 100644
--- a/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
+++ b/src/test/ui/errors/issue-89280-emitter-overflow-splice-lines.stderr
@@ -8,9 +8,9 @@ LL | |
LL | | )) {}
| |_____^
|
- = note: `#[warn(anonymous_parameters)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
+ = note: `#[warn(anonymous_parameters)]` on by default
help: try naming the parameter or explicitly ignoring it
|
LL ~ fn test(x: u32, _: (
diff --git a/src/test/ui/explain.stdout b/src/test/ui/explain.stdout
index 62f1a7f98..ef1d866c3 100644
--- a/src/test/ui/explain.stdout
+++ b/src/test/ui/explain.stdout
@@ -47,8 +47,8 @@ unsafe {
```
Here, transmute is being used to convert the types of the fn arguments.
-This pattern is incorrect because, because the type of `foo` is a function
-**item** (`typeof(foo)`), which is zero-sized, and the target type (`fn()`)
+This pattern is incorrect because the type of `foo` is a function **item**
+(`typeof(foo)`), which is zero-sized, and the target type (`fn()`)
is a function pointer, which is not zero-sized.
This pattern should be rewritten. There are a few possible ways to do this:
diff --git a/src/test/ui/explore-issue-38412.stderr b/src/test/ui/explore-issue-38412.stderr
index e3f82137a..08dadb4db 100644
--- a/src/test/ui/explore-issue-38412.stderr
+++ b/src/test/ui/explore-issue-38412.stderr
@@ -43,19 +43,19 @@ LL | t.2;
= note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
-error[E0616]: field `3` of struct `Tuple` is private
+error[E0616]: field `3` of struct `pub_and_stability::Tuple` is private
--> $DIR/explore-issue-38412.rs:36:7
|
LL | t.3;
| ^ private field
-error[E0616]: field `4` of struct `Tuple` is private
+error[E0616]: field `4` of struct `pub_and_stability::Tuple` is private
--> $DIR/explore-issue-38412.rs:37:7
|
LL | t.4;
| ^ private field
-error[E0616]: field `5` of struct `Tuple` is private
+error[E0616]: field `5` of struct `pub_and_stability::Tuple` is private
--> $DIR/explore-issue-38412.rs:38:7
|
LL | t.5;
diff --git a/src/test/ui/expr/if/bad-if-let-suggestion.stderr b/src/test/ui/expr/if/bad-if-let-suggestion.stderr
index 60d286fed..3a53a20b4 100644
--- a/src/test/ui/expr/if/bad-if-let-suggestion.stderr
+++ b/src/test/ui/expr/if/bad-if-let-suggestion.stderr
@@ -62,6 +62,11 @@ error[E0308]: mismatched types
|
LL | if let x = 1 && i = 2 {}
| ^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: you might have meant to compare for equality
+ |
+LL | if let x = 1 && i == 2 {}
+ | +
error: aborting due to 8 previous errors
diff --git a/src/test/ui/expr/if/if-branch-types.stderr b/src/test/ui/expr/if/if-branch-types.stderr
index 14f02163a..d2bba8821 100644
--- a/src/test/ui/expr/if/if-branch-types.stderr
+++ b/src/test/ui/expr/if/if-branch-types.stderr
@@ -5,6 +5,11 @@ LL | let x = if true { 10i32 } else { 10u32 };
| ----- ^^^^^ expected `i32`, found `u32`
| |
| expected because of this
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | let x = if true { 10i32 } else { 10i32 };
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/expr/if/if-else-type-mismatch.stderr b/src/test/ui/expr/if/if-else-type-mismatch.stderr
index 9fa190d6c..f1fffdb1e 100644
--- a/src/test/ui/expr/if/if-else-type-mismatch.stderr
+++ b/src/test/ui/expr/if/if-else-type-mismatch.stderr
@@ -10,6 +10,11 @@ LL | | 2u32
| | ^^^^ expected `i32`, found `u32`
LL | | };
| |_____- `if` and `else` have incompatible types
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 2i32
+ | ~~~
error[E0308]: `if` and `else` have incompatible types
--> $DIR/if-else-type-mismatch.rs:8:38
@@ -18,6 +23,11 @@ LL | let _ = if true { 42i32 } else { 42u32 };
| ----- ^^^^^ expected `i32`, found `u32`
| |
| expected because of this
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | let _ = if true { 42i32 } else { 42i32 };
+ | ~~~
error[E0308]: `if` and `else` have incompatible types
--> $DIR/if-else-type-mismatch.rs:13:9
diff --git a/src/test/ui/expr/if/if-let.stderr b/src/test/ui/expr/if/if-let.stderr
index 8238b3f0e..c4bba3cb1 100644
--- a/src/test/ui/expr/if/if-let.stderr
+++ b/src/test/ui/expr/if/if-let.stderr
@@ -9,9 +9,9 @@ LL | | println!("irrefutable pattern");
LL | | });
| |______- in this macro invocation
|
- = note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this pattern will always match, so the `if let` is useless
= help: consider replacing the `if let` with a `let`
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `if let` pattern
diff --git a/src/test/ui/expr/if/if-without-else-result.rs b/src/test/ui/expr/if/if-without-else-result.rs
index cf84a99e5..95604758a 100644
--- a/src/test/ui/expr/if/if-without-else-result.rs
+++ b/src/test/ui/expr/if/if-without-else-result.rs
@@ -1,6 +1,6 @@
fn main() {
let a = if true { true };
//~^ ERROR `if` may be missing an `else` clause [E0317]
- //~| expected `()`, found `bool`
+ //~| expected `bool`, found `()`
println!("{}", a);
}
diff --git a/src/test/ui/expr/if/if-without-else-result.stderr b/src/test/ui/expr/if/if-without-else-result.stderr
index 821635d37..317faf7c6 100644
--- a/src/test/ui/expr/if/if-without-else-result.stderr
+++ b/src/test/ui/expr/if/if-without-else-result.stderr
@@ -5,7 +5,7 @@ LL | let a = if true { true };
| ^^^^^^^^^^----^^
| | |
| | found here
- | expected `()`, found `bool`
+ | expected `bool`, found `()`
|
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/expr/if/issue-4201.rs b/src/test/ui/expr/if/issue-4201.rs
index 1f292229f..59c465b9e 100644
--- a/src/test/ui/expr/if/issue-4201.rs
+++ b/src/test/ui/expr/if/issue-4201.rs
@@ -3,7 +3,7 @@ fn main() {
0
} else if false {
//~^ ERROR `if` may be missing an `else` clause
-//~| expected `()`, found integer
+//~| expected integer, found `()`
1
};
}
diff --git a/src/test/ui/expr/if/issue-4201.stderr b/src/test/ui/expr/if/issue-4201.stderr
index bc638ddf5..612fe7764 100644
--- a/src/test/ui/expr/if/issue-4201.stderr
+++ b/src/test/ui/expr/if/issue-4201.stderr
@@ -8,7 +8,7 @@ LL | |
LL | | 1
| | - found here
LL | | };
- | |_____^ expected `()`, found integer
+ | |_____^ expected integer, found `()`
|
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr
index 9db9cfc7f..759d79493 100644
--- a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr
+++ b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr
@@ -14,7 +14,7 @@ LL | let p = Some(45).and_then({
LL | |
LL | | |x| println!("doubling {}", x);
LL | | Some(x * 2)
- | | -----------
+ | | ----------- this tail expression is of type `std::option::Option<_>`
LL | |
LL | | });
| |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>`
diff --git a/src/test/ui/extenv/issue-55897.rs b/src/test/ui/extenv/issue-55897.rs
index 64c4107e8..b7533f413 100644
--- a/src/test/ui/extenv/issue-55897.rs
+++ b/src/test/ui/extenv/issue-55897.rs
@@ -14,7 +14,7 @@ mod nonexistent_env {
mod erroneous_literal {
include!(concat!("NON_EXISTENT"suffix, "/data.rs"));
- //~^ ERROR suffixes on a string literal are invalid
+ //~^ ERROR suffixes on string literals are invalid
}
fn main() {}
diff --git a/src/test/ui/extenv/issue-55897.stderr b/src/test/ui/extenv/issue-55897.stderr
index d2ac0b830..63797d4a7 100644
--- a/src/test/ui/extenv/issue-55897.stderr
+++ b/src/test/ui/extenv/issue-55897.stderr
@@ -6,7 +6,7 @@ LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs"));
|
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: suffixes on a string literal are invalid
+error: suffixes on string literals are invalid
--> $DIR/issue-55897.rs:16:22
|
LL | include!(concat!("NON_EXISTENT"suffix, "/data.rs"));
@@ -26,6 +26,11 @@ error[E0432]: unresolved import `env`
|
LL | use env;
| ^^^ no `env` in the root
+ |
+help: consider importing this module instead
+ |
+LL | use std::env;
+ | ~~~~~~~~~
error: cannot determine resolution for the macro `env`
--> $DIR/issue-55897.rs:6:22
diff --git a/src/test/ui/extern-flag/empty-extern-arg.rs b/src/test/ui/extern-flag/empty-extern-arg.rs
index 3170537b0..2f4ae7d8e 100644
--- a/src/test/ui/extern-flag/empty-extern-arg.rs
+++ b/src/test/ui/extern-flag/empty-extern-arg.rs
@@ -1,6 +1,6 @@
// compile-flags: --extern std=
// error-pattern: extern location for std does not exist
// needs-unwind since it affects the error output
-// ignore-emscripten compiled with panic=abort, personality not required
+// ignore-emscripten missing eh_catch_typeinfo lang item
fn main() {}
diff --git a/src/test/ui/extern/extern-no-mangle.stderr b/src/test/ui/extern/extern-no-mangle.stderr
index b56428141..f20ee158a 100644
--- a/src/test/ui/extern/extern-no-mangle.stderr
+++ b/src/test/ui/extern/extern-no-mangle.stderr
@@ -7,12 +7,12 @@ LL | #[no_mangle]
LL | let x = 0_u8;
| ------------- not a free function, impl method or static
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/extern-no-mangle.rs:1:9
|
LL | #![warn(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: `#[no_mangle]` has no effect on a foreign static
--> $DIR/extern-no-mangle.rs:11:5
diff --git a/src/test/ui/extern/extern-types-unsized.stderr b/src/test/ui/extern/extern-types-unsized.stderr
index 8d6713261..a79caced1 100644
--- a/src/test/ui/extern/extern-types-unsized.stderr
+++ b/src/test/ui/extern/extern-types-unsized.stderr
@@ -16,10 +16,10 @@ LL | fn assert_sized<T: ?Sized>() {}
| ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/extern-types-unsized.rs:25:5
+ --> $DIR/extern-types-unsized.rs:25:20
|
LL | assert_sized::<Foo>();
- | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | ^^^ doesn't have a size known at compile-time
|
= help: within `Foo`, the trait `Sized` is not implemented for `A`
note: required because it appears within the type `Foo`
@@ -38,10 +38,10 @@ LL | fn assert_sized<T: ?Sized>() {}
| ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/extern-types-unsized.rs:28:5
+ --> $DIR/extern-types-unsized.rs:28:20
|
LL | assert_sized::<Bar<A>>();
- | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | ^^^^^^ doesn't have a size known at compile-time
|
= help: within `Bar<A>`, the trait `Sized` is not implemented for `A`
note: required because it appears within the type `Bar<A>`
@@ -60,10 +60,10 @@ LL | fn assert_sized<T: ?Sized>() {}
| ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/extern-types-unsized.rs:31:5
+ --> $DIR/extern-types-unsized.rs:31:20
|
LL | assert_sized::<Bar<Bar<A>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | ^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `Bar<Bar<A>>`, the trait `Sized` is not implemented for `A`
note: required because it appears within the type `Bar<A>`
diff --git a/src/test/ui/extern/extern-with-type-bounds.rs b/src/test/ui/extern/extern-with-type-bounds.rs
index 8f9683e4a..a72aa4171 100644
--- a/src/test/ui/extern/extern-with-type-bounds.rs
+++ b/src/test/ui/extern/extern-with-type-bounds.rs
@@ -2,6 +2,7 @@
extern "rust-intrinsic" {
// Real example from libcore
+ #[rustc_safe_intrinsic]
fn type_id<T: ?Sized + 'static>() -> u64;
// Silent bounds made explicit to make sure they are actually
@@ -10,6 +11,7 @@ extern "rust-intrinsic" {
// Bounds aren't checked right now, so this should work
// even though it's incorrect.
+ #[rustc_safe_intrinsic]
fn size_of<T: Clone>() -> usize;
// Unresolved bounds should still error.
diff --git a/src/test/ui/extern/extern-with-type-bounds.stderr b/src/test/ui/extern/extern-with-type-bounds.stderr
index acd059642..88be1e5dd 100644
--- a/src/test/ui/extern/extern-with-type-bounds.stderr
+++ b/src/test/ui/extern/extern-with-type-bounds.stderr
@@ -1,5 +1,5 @@
error[E0405]: cannot find trait `NoSuchTrait` in this scope
- --> $DIR/extern-with-type-bounds.rs:16:20
+ --> $DIR/extern-with-type-bounds.rs:18:20
|
LL | fn align_of<T: NoSuchTrait>() -> usize;
| ^^^^^^^^^^^ not found in this scope
diff --git a/src/test/ui/extern/extern-wrong-value-type.stderr b/src/test/ui/extern/extern-wrong-value-type.stderr
index c6f0d5df9..ff2934a2b 100644
--- a/src/test/ui/extern/extern-wrong-value-type.stderr
+++ b/src/test/ui/extern/extern-wrong-value-type.stderr
@@ -6,7 +6,7 @@ LL | is_fn(f);
| |
| required by a bound introduced by this call
|
- = help: the trait `Fn<()>` is not implemented for `extern "C" fn() {f}`
+ = help: the trait `Fn<()>` is not implemented for fn item `extern "C" fn() {f}`
= note: wrap the `extern "C" fn() {f}` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `is_fn`
--> $DIR/extern-wrong-value-type.rs:4:28
diff --git a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
index 7a91cbdc2..233120c92 100644
--- a/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
+++ b/src/test/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten no threads support
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine
diff --git a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
index e84ff41b3..3b263e58c 100644
--- a/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
+++ b/src/test/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten no threads support
// rust-lang/rust#64655: with panic=unwind, a panic from a subroutine
diff --git a/src/test/ui/feature-gates/bench.stderr b/src/test/ui/feature-gates/bench.stderr
index 168ac9257..5f0aaf925 100644
--- a/src/test/ui/feature-gates/bench.stderr
+++ b/src/test/ui/feature-gates/bench.stderr
@@ -4,9 +4,9 @@ error: use of unstable library feature 'test': `bench` is a part of custom test
LL | #[bench]
| ^^^^^
|
- = note: `#[deny(soft_unstable)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>
+ = note: `#[deny(soft_unstable)]` on by default
error: use of unstable library feature 'test': `bench` is a part of custom test frameworks which are unstable
--> $DIR/bench.rs:7:5
diff --git a/src/test/ui/feature-gates/feature-gate-asm_sym.rs b/src/test/ui/feature-gates/feature-gate-asm_sym.rs
deleted file mode 100644
index 0de6b3abb..000000000
--- a/src/test/ui/feature-gates/feature-gate-asm_sym.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// only-x86_64
-
-use std::arch::asm;
-
-fn bar<const N: usize>() {}
-
-fn foo<const N: usize>() {
- unsafe {
- asm!("mov eax, {}", sym bar::<N>);
- //~^ ERROR sym operands for inline assembly are unstable
- }
-}
-
-fn main() {
- unsafe {
- asm!("mov eax, {}", sym foo::<0>);
- //~^ ERROR sym operands for inline assembly are unstable
- }
-}
diff --git a/src/test/ui/feature-gates/feature-gate-asm_sym.stderr b/src/test/ui/feature-gates/feature-gate-asm_sym.stderr
deleted file mode 100644
index d4b16f60b..000000000
--- a/src/test/ui/feature-gates/feature-gate-asm_sym.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0658]: sym operands for inline assembly are unstable
- --> $DIR/feature-gate-asm_sym.rs:9:29
- |
-LL | asm!("mov eax, {}", sym bar::<N>);
- | ^^^^^^^^^^^^
- |
- = note: see issue #93333 <https://github.com/rust-lang/rust/issues/93333> for more information
- = help: add `#![feature(asm_sym)]` to the crate attributes to enable
-
-error[E0658]: sym operands for inline assembly are unstable
- --> $DIR/feature-gate-asm_sym.rs:16:29
- |
-LL | asm!("mov eax, {}", sym foo::<0>);
- | ^^^^^^^^^^^^
- |
- = note: see issue #93333 <https://github.com/rust-lang/rust/issues/93333> for more information
- = help: add `#![feature(asm_sym)]` to the crate attributes to enable
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs
new file mode 100644
index 000000000..f73bf579f
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.rs
@@ -0,0 +1,7 @@
+#[collapse_debuginfo]
+//~^ ERROR the `#[collapse_debuginfo]` attribute is an experimental feature
+macro_rules! foo {
+ ($e:expr) => { $e }
+}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr
new file mode 100644
index 000000000..2cbde893a
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-collapse_debuginfo.stderr
@@ -0,0 +1,12 @@
+error[E0658]: the `#[collapse_debuginfo]` attribute is an experimental feature
+ --> $DIR/feature-gate-collapse_debuginfo.rs:1:1
+ |
+LL | #[collapse_debuginfo]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #100758 <https://github.com/rust-lang/rust/issues/100758> for more information
+ = help: add `#![feature(collapse_debuginfo)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr b/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr
index a7d5c7ac3..308de2692 100644
--- a/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr
+++ b/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr
@@ -4,9 +4,9 @@ error: defaults for type parameters are only allowed in `struct`, `enum`, `type`
LL | fn avg<T=i32>(_: T) {}
| ^^^^^
|
- = note: `#[deny(invalid_type_param_default)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
+ = 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/feature-gate-default_type_parameter_fallback.rs:8:6
diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
index f8349391a..5ced344f1 100644
--- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
+++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr
@@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let _x = if let Ok(_x) = foo() { _x } else { todo!() };
| +++++++++++ +++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+help: alternatively, you might want to use let else to handle the variant that isn't matched
|
LL | let Ok(_x) = foo() else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr
index 49eede479..56123a983 100644
--- a/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr
+++ b/src/test/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr
@@ -1,33 +1,24 @@
-error[E0658]: using `_` for array lengths is unstable
+error: in expressions, `_` can only be used on the left-hand side of an assignment
--> $DIR/feature-gate-generic_arg_infer.rs:11:27
|
LL | let _x: [u8; 3] = [0; _];
- | ^
- |
- = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
- = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+ | ^ `_` not allowed here
error: in expressions, `_` can only be used on the left-hand side of an assignment
- --> $DIR/feature-gate-generic_arg_infer.rs:11:27
+ --> $DIR/feature-gate-generic_arg_infer.rs:14:18
|
-LL | let _x: [u8; 3] = [0; _];
- | ^ `_` not allowed here
+LL | let _y: [u8; _] = [0; 3];
+ | ^ `_` not allowed here
error[E0658]: using `_` for array lengths is unstable
--> $DIR/feature-gate-generic_arg_infer.rs:14:18
|
LL | let _y: [u8; _] = [0; 3];
- | ^
+ | ^ help: consider specifying the array length: `3`
|
= note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
= help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
-error: in expressions, `_` can only be used on the left-hand side of an assignment
- --> $DIR/feature-gate-generic_arg_infer.rs:14:18
- |
-LL | let _y: [u8; _] = [0; 3];
- | ^ `_` not allowed here
-
error[E0747]: type provided when a constant was expected
--> $DIR/feature-gate-generic_arg_infer.rs:20:20
|
@@ -37,6 +28,15 @@ LL | let _x = foo::<_>([1,2]);
= help: const arguments cannot yet be inferred with `_`
= help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+error[E0658]: using `_` for array lengths is unstable
+ --> $DIR/feature-gate-generic_arg_infer.rs:11:27
+ |
+LL | let _x: [u8; 3] = [0; _];
+ | ^
+ |
+ = note: see issue #85077 <https://github.com/rust-lang/rust/issues/85077> for more information
+ = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable
+
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0658, E0747.
diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs b/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs
deleted file mode 100644
index c5c134514..000000000
--- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-use std::ops::Deref;
-
-trait PointerFamily<U> {
- type Pointer<T>: Deref<Target = T>;
- //~^ ERROR generic associated types are unstable
- type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone;
- //~^ ERROR generic associated types are unstable
- //~| ERROR where clauses on associated types are unstable
-}
-
-struct Foo;
-
-impl PointerFamily<u32> for Foo {
- type Pointer<Usize> = Box<Usize>;
- //~^ ERROR generic associated types are unstable
- type Pointer2<U32> = Box<U32>;
- //~^ ERROR generic associated types are unstable
- //~| ERROR the trait bound `U32: Clone` is not satisfied
-}
-
-trait Bar {
- type Assoc where Self: Sized;
- //~^ ERROR where clauses on associated types are unstable
-}
-
-impl Bar for Foo {
- type Assoc = Foo where Self: Sized;
- //~^ ERROR where clauses on associated types are unstable
-}
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr
deleted file mode 100644
index 12a40ff0a..000000000
--- a/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr
+++ /dev/null
@@ -1,78 +0,0 @@
-error[E0658]: generic associated types are unstable
- --> $DIR/feature-gate-generic_associated_types.rs:4:5
- |
-LL | type Pointer<T>: Deref<Target = T>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0658]: generic associated types are unstable
- --> $DIR/feature-gate-generic_associated_types.rs:6:5
- |
-LL | type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0658]: where clauses on associated types are unstable
- --> $DIR/feature-gate-generic_associated_types.rs:6:5
- |
-LL | type Pointer2<T>: Deref<Target = T> where T: Clone, U: Clone;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0658]: generic associated types are unstable
- --> $DIR/feature-gate-generic_associated_types.rs:14:5
- |
-LL | type Pointer<Usize> = Box<Usize>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0658]: generic associated types are unstable
- --> $DIR/feature-gate-generic_associated_types.rs:16:5
- |
-LL | type Pointer2<U32> = Box<U32>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0658]: where clauses on associated types are unstable
- --> $DIR/feature-gate-generic_associated_types.rs:22:5
- |
-LL | type Assoc where Self: Sized;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0658]: where clauses on associated types are unstable
- --> $DIR/feature-gate-generic_associated_types.rs:27:5
- |
-LL | type Assoc = Foo where Self: Sized;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0277]: the trait bound `U32: Clone` is not satisfied
- --> $DIR/feature-gate-generic_associated_types.rs:16:26
- |
-LL | type Pointer2<U32> = Box<U32>;
- | ^^^^^^^^ the trait `Clone` is not implemented for `U32`
- |
-help: consider restricting type parameter `U32`
- |
-LL | type Pointer2<U32: std::clone::Clone> = Box<U32>;
- | +++++++++++++++++++
-
-error: aborting due to 8 previous errors
-
-Some errors have detailed explanations: E0277, E0658.
-For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs
index 258b8cd35..7842d44ac 100644
--- a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs
+++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
// This feature doesn't *currently* fire on any specific code; it's just a
// behavior change. Future changes might.
#[rustc_error] //~ the
diff --git a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr
index 6a5eba38c..bb1622628 100644
--- a/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr
+++ b/src/test/ui/feature-gates/feature-gate-generic_associated_types_extended.stderr
@@ -1,5 +1,5 @@
error[E0658]: the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable
- --> $DIR/feature-gate-generic_associated_types_extended.rs:5:1
+ --> $DIR/feature-gate-generic_associated_types_extended.rs:3:1
|
LL | #[rustc_error]
| ^^^^^^^^^^^^^^
diff --git a/src/test/ui/feature-gates/feature-gate-label_break_value.rs b/src/test/ui/feature-gates/feature-gate-label_break_value.rs
deleted file mode 100644
index 6fc38f455..000000000
--- a/src/test/ui/feature-gates/feature-gate-label_break_value.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-pub fn main() {
- 'a: { //~ ERROR labels on blocks are unstable
- break 'a;
- }
-}
diff --git a/src/test/ui/feature-gates/feature-gate-label_break_value.stderr b/src/test/ui/feature-gates/feature-gate-label_break_value.stderr
deleted file mode 100644
index 4b43fdc59..000000000
--- a/src/test/ui/feature-gates/feature-gate-label_break_value.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: labels on blocks are unstable
- --> $DIR/feature-gate-label_break_value.rs:2:5
- |
-LL | 'a: {
- | ^^
- |
- = note: see issue #48594 <https://github.com/rust-lang/rust/issues/48594> for more information
- = help: add `#![feature(label_break_value)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-let_else.rs b/src/test/ui/feature-gates/feature-gate-let_else.rs
deleted file mode 100644
index 3f04a9dab..000000000
--- a/src/test/ui/feature-gates/feature-gate-let_else.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-fn main() {
- let Some(x) = Some(1) else { //~ ERROR `let...else` statements are unstable
- return;
- };
-}
diff --git a/src/test/ui/feature-gates/feature-gate-let_else.stderr b/src/test/ui/feature-gates/feature-gate-let_else.stderr
deleted file mode 100644
index 862526041..000000000
--- a/src/test/ui/feature-gates/feature-gate-let_else.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0658]: `let...else` statements are unstable
- --> $DIR/feature-gate-let_else.rs:2:5
- |
-LL | / let Some(x) = Some(1) else {
-LL | | return;
-LL | | };
- | |______^
- |
- = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information
- = help: add `#![feature(let_else)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs
index 29a6e1f8a..9b646060a 100644
--- a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs
+++ b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.rs
@@ -21,7 +21,7 @@ fn main() {
Foo::A => {}
Foo::B => {}
}
- //~^^^^ ERROR non-exhaustive patterns: `C` not covered
+ //~^^^^ ERROR non-exhaustive patterns: `Foo::C` not covered
match Foo::A {
Foo::A => {}
diff --git a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr
index dbeef6c2d..4d79ce3c6 100644
--- a/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr
+++ b/src/test/ui/feature-gates/feature-gate-non_exhaustive_omitted_patterns_lint.stderr
@@ -4,10 +4,10 @@ warning: unknown lint: `non_exhaustive_omitted_patterns`
LL | #![deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unknown_lints)]` on by default
= note: the `non_exhaustive_omitted_patterns` lint is unstable
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable
+ = note: `#[warn(unknown_lints)]` on by default
warning: unknown lint: `non_exhaustive_omitted_patterns`
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:6:1
@@ -99,11 +99,11 @@ LL | #[warn(non_exhaustive_omitted_patterns)]
= note: see issue #89554 <https://github.com/rust-lang/rust/issues/89554> for more information
= help: add `#![feature(non_exhaustive_omitted_patterns_lint)]` to the crate attributes to enable
-error[E0004]: non-exhaustive patterns: `C` not covered
+error[E0004]: non-exhaustive patterns: `Foo::C` not covered
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:20:11
|
LL | match Foo::A {
- | ^^^^^^ pattern `C` not covered
+ | ^^^^^^ pattern `Foo::C` not covered
|
note: `Foo` defined here
--> $DIR/feature-gate-non_exhaustive_omitted_patterns_lint.rs:12:15
@@ -116,7 +116,7 @@ LL | A, B, C,
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 + C => todo!()
+LL + Foo::C => todo!()
|
error: aborting due to previous error; 10 warnings emitted
diff --git a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
index 72cb4cc84..d76c697fe 100644
--- a/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
+++ b/src/test/ui/feature-gates/feature-gate-object_safe_for_dispatch.stderr
@@ -13,10 +13,10 @@ LL | trait NonObjectSafe1: Sized {}
| this trait cannot be made into an object...
error[E0038]: the trait `NonObjectSafe2` cannot be made into an object
- --> $DIR/feature-gate-object_safe_for_dispatch.rs:22:36
+ --> $DIR/feature-gate-object_safe_for_dispatch.rs:22:45
|
LL | fn return_non_object_safe_ref() -> &'static dyn NonObjectSafe2 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonObjectSafe2` cannot be made into an object
+ | ^^^^^^^^^^^^^^^^^^ `NonObjectSafe2` 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/feature-gate-object_safe_for_dispatch.rs:7:8
@@ -50,10 +50,10 @@ LL | fn foo<T>(&self);
= help: consider moving `foo` to another trait
error[E0038]: the trait `NonObjectSafe4` cannot be made into an object
- --> $DIR/feature-gate-object_safe_for_dispatch.rs:31:35
+ --> $DIR/feature-gate-object_safe_for_dispatch.rs:31:47
|
LL | fn return_non_object_safe_rc() -> std::rc::Rc<dyn NonObjectSafe4> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonObjectSafe4` cannot be made into an object
+ | ^^^^^^^^^^^^^^^^^^ `NonObjectSafe4` 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/feature-gate-object_safe_for_dispatch.rs:15:22
diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs
index 518aa20dd..fc47a9061 100644
--- a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs
+++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.rs
@@ -1,8 +1,12 @@
+// only-x86
#[link(name = "foo")]
extern "C" {
#[link_ordinal(42)]
- //~^ ERROR: the `#[link_ordinal]` attribute is an experimental feature
+ //~^ ERROR: `#[link_ordinal]` is unstable on x86
fn foo();
+ #[link_ordinal(5)]
+ //~^ ERROR: `#[link_ordinal]` is unstable on x86
+ static mut imported_variable: i32;
}
fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr
index dbee5f316..0e900760d 100644
--- a/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr
+++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-2.stderr
@@ -1,5 +1,5 @@
-error[E0658]: the `#[link_ordinal]` attribute is an experimental feature
- --> $DIR/feature-gate-raw-dylib-2.rs:3:5
+error[E0658]: `#[link_ordinal]` is unstable on x86
+ --> $DIR/feature-gate-raw-dylib-2.rs:4:5
|
LL | #[link_ordinal(42)]
| ^^^^^^^^^^^^^^^^^^^
@@ -7,6 +7,15 @@ LL | #[link_ordinal(42)]
= note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
= help: add `#![feature(raw_dylib)]` to the crate attributes to enable
-error: aborting due to previous error
+error[E0658]: `#[link_ordinal]` is unstable on x86
+ --> $DIR/feature-gate-raw-dylib-2.rs:7:5
+ |
+LL | #[link_ordinal(5)]
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+ = help: add `#![feature(raw_dylib)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs
new file mode 100644
index 000000000..295f502d6
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.rs
@@ -0,0 +1,8 @@
+// only-windows
+// only-x86
+#[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")]
+//~^ ERROR link kind `raw-dylib` is unstable on x86
+//~| ERROR import name type is unstable
+extern "C" {}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr
new file mode 100644
index 000000000..d6b165b76
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-raw-dylib-import-name-type.stderr
@@ -0,0 +1,21 @@
+error[E0658]: link kind `raw-dylib` is unstable on x86
+ --> $DIR/feature-gate-raw-dylib-import-name-type.rs:3:29
+ |
+LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")]
+ | ^^^^^^^^^^^
+ |
+ = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+ = help: add `#![feature(raw_dylib)]` to the crate attributes to enable
+
+error[E0658]: import name type is unstable
+ --> $DIR/feature-gate-raw-dylib-import-name-type.rs:3:61
+ |
+LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")]
+ | ^^^^^^^^^^^
+ |
+ = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+ = help: add `#![feature(raw_dylib)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib.rs b/src/test/ui/feature-gates/feature-gate-raw-dylib.rs
index f894f517b..291cca8fd 100644
--- a/src/test/ui/feature-gates/feature-gate-raw-dylib.rs
+++ b/src/test/ui/feature-gates/feature-gate-raw-dylib.rs
@@ -1,6 +1,7 @@
// only-windows
+// only-x86
#[link(name = "foo", kind = "raw-dylib")]
-//~^ ERROR: link kind `raw-dylib` is unstable
+//~^ ERROR: link kind `raw-dylib` is unstable on x86
extern "C" {}
fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr b/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr
index ca7a61f64..f02241e49 100644
--- a/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr
+++ b/src/test/ui/feature-gates/feature-gate-raw-dylib.stderr
@@ -1,5 +1,5 @@
-error[E0658]: link kind `raw-dylib` is unstable
- --> $DIR/feature-gate-raw-dylib.rs:2:29
+error[E0658]: link kind `raw-dylib` is unstable on x86
+ --> $DIR/feature-gate-raw-dylib.rs:3:29
|
LL | #[link(name = "foo", kind = "raw-dylib")]
| ^^^^^^^^^^^
diff --git a/src/test/ui/feature-gates/feature-gate-register_attr.rs b/src/test/ui/feature-gates/feature-gate-register_attr.rs
deleted file mode 100644
index 36dce2aa7..000000000
--- a/src/test/ui/feature-gates/feature-gate-register_attr.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-#![register_attr(attr)] //~ ERROR the `#[register_attr]` attribute is an experimental feature
-
-fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-register_attr.stderr b/src/test/ui/feature-gates/feature-gate-register_attr.stderr
deleted file mode 100644
index 8ca3845d2..000000000
--- a/src/test/ui/feature-gates/feature-gate-register_attr.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: the `#[register_attr]` attribute is an experimental feature
- --> $DIR/feature-gate-register_attr.rs:1:1
- |
-LL | #![register_attr(attr)]
- | ^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #66080 <https://github.com/rust-lang/rust/issues/66080> for more information
- = help: add `#![feature(register_attr)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-repr-simd.stderr b/src/test/ui/feature-gates/feature-gate-repr-simd.stderr
index ae44b8020..5b1270a19 100644
--- a/src/test/ui/feature-gates/feature-gate-repr-simd.stderr
+++ b/src/test/ui/feature-gates/feature-gate-repr-simd.stderr
@@ -25,9 +25,9 @@ LL |
LL | #[repr(simd)]
| ^^^^
|
- = note: `#[deny(conflicting_repr_hints)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/68585>
+ = note: `#[deny(conflicting_repr_hints)]` on by default
error: aborting due to 3 previous errors
diff --git a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs
new file mode 100644
index 000000000..637765fff
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.rs
@@ -0,0 +1,18 @@
+// edition:2021
+
+// async_fn_in_trait is not enough to allow use of RPITIT
+#![allow(incomplete_features)]
+#![feature(async_fn_in_trait)]
+
+trait Foo {
+ fn bar() -> impl Sized; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return
+ fn baz() -> Box<impl std::fmt::Display>; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return
+}
+
+// Both return_position_impl_trait_in_trait and async_fn_in_trait are required for this (see also
+// feature-gate-async_fn_in_trait.rs)
+trait AsyncFoo {
+ async fn bar() -> impl Sized; //~ ERROR `impl Trait` only allowed in function and inherent method return types, not in trait method return
+}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr
new file mode 100644
index 000000000..aeabed4a6
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-return_position_impl_trait_in_trait.stderr
@@ -0,0 +1,30 @@
+error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return
+ --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:8:17
+ |
+LL | fn bar() -> impl Sized;
+ | ^^^^^^^^^^
+ |
+ = 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[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return
+ --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:9:21
+ |
+LL | fn baz() -> Box<impl std::fmt::Display>;
+ | ^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return
+ --> $DIR/feature-gate-return_position_impl_trait_in_trait.rs:15:23
+ |
+LL | async fn bar() -> impl Sized;
+ | ^^^^^^^^^^
+ |
+ = 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 3 previous errors
+
+For more information about this error, try `rustc --explain E0562`.
diff --git a/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr b/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr
index 34bd240c3..751da87cc 100644
--- a/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr
+++ b/src/test/ui/feature-gates/feature-gate-strict_provenance.stderr
@@ -4,10 +4,10 @@ warning: unknown lint: `fuzzy_provenance_casts`
LL | #![deny(fuzzy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unknown_lints)]` on by default
= note: the `fuzzy_provenance_casts` lint is unstable
= note: see issue #95228 <https://github.com/rust-lang/rust/issues/95228> for more information
= help: add `#![feature(strict_provenance)]` to the crate attributes to enable
+ = note: `#[warn(unknown_lints)]` on by default
warning: unknown lint: `lossy_provenance_casts`
--> $DIR/feature-gate-strict_provenance.rs:7:1
diff --git a/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr b/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr
index a29322443..b4d6aa658 100644
--- a/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr
+++ b/src/test/ui/feature-gates/feature-gate-test_unstable_lint.stderr
@@ -4,9 +4,9 @@ warning: unknown lint: `test_unstable_lint`
LL | #![allow(test_unstable_lint)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unknown_lints)]` on by default
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+ = note: `#[warn(unknown_lints)]` on by default
warning: unknown lint: `test_unstable_lint`
--> $DIR/feature-gate-test_unstable_lint.rs:4:1
diff --git a/src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs
new file mode 100644
index 000000000..46dc3f6cc
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.rs
@@ -0,0 +1,4 @@
+#![crate_type = "bin"]
+
+#[unix_sigpipe = "inherit"] //~ the `#[unix_sigpipe]` attribute is an experimental feature
+fn main () {}
diff --git a/src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr
new file mode 100644
index 000000000..cf3284467
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-unix_sigpipe.stderr
@@ -0,0 +1,12 @@
+error[E0658]: the `#[unix_sigpipe]` attribute is an experimental feature
+ --> $DIR/feature-gate-unix_sigpipe.rs:3:1
+ |
+LL | #[unix_sigpipe = "inherit"]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #97889 <https://github.com/rust-lang/rust/issues/97889> for more information
+ = help: add `#![feature(unix_sigpipe)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
index f94ec7d47..5a645cf4e 100644
--- a/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
+++ b/src/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr
@@ -12,9 +12,9 @@ error: attribute must be of the form `#[inline]` or `#[inline(always|never)]`
LL | #[inline = "2100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(ill_formed_attribute_input)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
+ = note: `#[deny(ill_formed_attribute_input)]` on by default
error: `start` attribute can only be used on functions
--> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:119:1
diff --git a/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs
new file mode 100644
index 000000000..49f1cba71
--- /dev/null
+++ b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.rs
@@ -0,0 +1,30 @@
+// check-fail
+// This file is used to test the behavior of the early-pass syntax warnings.
+// If macro syntax is stabilized, replace with a different unstable syntax.
+
+macro a() {}
+//~^ ERROR: `macro` is experimental
+
+#[cfg(FALSE)]
+macro b() {}
+
+macro_rules! identity {
+ ($($x:tt)*) => ($($x)*);
+}
+
+identity! {
+ macro c() {}
+ //~^ ERROR: `macro` is experimental
+}
+
+#[cfg(FALSE)]
+identity! {
+ macro d() {} // No error
+}
+
+identity! {
+ #[cfg(FALSE)]
+ macro e() {}
+}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr
new file mode 100644
index 000000000..49550d811
--- /dev/null
+++ b/src/test/ui/feature-gates/soft-syntax-gates-with-errors.stderr
@@ -0,0 +1,21 @@
+error[E0658]: `macro` is experimental
+ --> $DIR/soft-syntax-gates-with-errors.rs:5:1
+ |
+LL | macro a() {}
+ | ^^^^^^^^^^^^
+ |
+ = 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
+
+error[E0658]: `macro` is experimental
+ --> $DIR/soft-syntax-gates-with-errors.rs:16:5
+ |
+LL | macro c() {}
+ | ^^^^^^^^^^^^
+ |
+ = 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
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/soft-syntax-gates-without-errors.rs b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.rs
new file mode 100644
index 000000000..ca4ad2320
--- /dev/null
+++ b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.rs
@@ -0,0 +1,26 @@
+// check-pass
+// This file is used to test the behavior of the early-pass syntax warnings.
+// If macro syntax is stabilized, replace with a different unstable syntax.
+
+#[cfg(FALSE)]
+macro b() {}
+//~^ WARN: `macro` is experimental
+//~| WARN: unstable syntax
+
+macro_rules! identity {
+ ($($x:tt)*) => ($($x)*);
+}
+
+#[cfg(FALSE)]
+identity! {
+ macro d() {} // No error
+}
+
+identity! {
+ #[cfg(FALSE)]
+ macro e() {}
+ //~^ WARN: `macro` is experimental
+ //~| WARN: unstable syntax
+}
+
+fn main() {}
diff --git a/src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr
new file mode 100644
index 000000000..3d9c22e54
--- /dev/null
+++ b/src/test/ui/feature-gates/soft-syntax-gates-without-errors.stderr
@@ -0,0 +1,24 @@
+warning: `macro` is experimental
+ --> $DIR/soft-syntax-gates-without-errors.rs:6:1
+ |
+LL | macro b() {}
+ | ^^^^^^^^^^^^
+ |
+ = 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: `macro` is experimental
+ --> $DIR/soft-syntax-gates-without-errors.rs:21:5
+ |
+LL | macro e() {}
+ | ^^^^^^^^^^^^
+ |
+ = 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: 2 warnings emitted
+
diff --git a/src/test/ui/fmt/auxiliary/format-string-proc-macro.rs b/src/test/ui/fmt/auxiliary/format-string-proc-macro.rs
new file mode 100644
index 000000000..e44a84776
--- /dev/null
+++ b/src/test/ui/fmt/auxiliary/format-string-proc-macro.rs
@@ -0,0 +1,28 @@
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::{Literal, Span, TokenStream, TokenTree};
+
+#[proc_macro]
+pub fn foo_with_input_span(input: TokenStream) -> TokenStream {
+ let span = input.into_iter().next().unwrap().span();
+
+ let mut lit = Literal::string("{foo}");
+ lit.set_span(span);
+
+ TokenStream::from(TokenTree::Literal(lit))
+}
+
+#[proc_macro]
+pub fn err_with_input_span(input: TokenStream) -> TokenStream {
+ let span = input.into_iter().next().unwrap().span();
+
+ let mut lit = Literal::string(" }");
+ lit.set_span(span);
+
+ TokenStream::from(TokenTree::Literal(lit))
+}
diff --git a/src/test/ui/fmt/format-args-capture-issue-102057.rs b/src/test/ui/fmt/format-args-capture-issue-102057.rs
new file mode 100644
index 000000000..b8089d49b
--- /dev/null
+++ b/src/test/ui/fmt/format-args-capture-issue-102057.rs
@@ -0,0 +1,19 @@
+fn main() {
+ format!("\x7Ba}");
+ //~^ ERROR cannot find value `a` in this scope
+ format!("\x7Ba\x7D");
+ //~^ ERROR cannot find value `a` in this scope
+
+ let a = 0;
+
+ format!("\x7Ba} {b}");
+ //~^ ERROR cannot find value `b` in this scope
+ format!("\x7Ba\x7D {b}");
+ //~^ ERROR cannot find value `b` in this scope
+ format!("\x7Ba} \x7Bb}");
+ //~^ ERROR cannot find value `b` in this scope
+ format!("\x7Ba\x7D \x7Bb}");
+ //~^ ERROR cannot find value `b` in this scope
+ format!("\x7Ba\x7D \x7Bb\x7D");
+ //~^ ERROR cannot find value `b` in this scope
+}
diff --git a/src/test/ui/fmt/format-args-capture-issue-102057.stderr b/src/test/ui/fmt/format-args-capture-issue-102057.stderr
new file mode 100644
index 000000000..f2d625e7f
--- /dev/null
+++ b/src/test/ui/fmt/format-args-capture-issue-102057.stderr
@@ -0,0 +1,45 @@
+error[E0425]: cannot find value `a` in this scope
+ --> $DIR/format-args-capture-issue-102057.rs:2:18
+ |
+LL | format!("\x7Ba}");
+ | ^ not found in this scope
+
+error[E0425]: cannot find value `a` in this scope
+ --> $DIR/format-args-capture-issue-102057.rs:4:18
+ |
+LL | format!("\x7Ba\x7D");
+ | ^ not found in this scope
+
+error[E0425]: cannot find value `b` in this scope
+ --> $DIR/format-args-capture-issue-102057.rs:9:22
+ |
+LL | format!("\x7Ba} {b}");
+ | ^ help: a local variable with a similar name exists: `a`
+
+error[E0425]: cannot find value `b` in this scope
+ --> $DIR/format-args-capture-issue-102057.rs:11:25
+ |
+LL | format!("\x7Ba\x7D {b}");
+ | ^ help: a local variable with a similar name exists: `a`
+
+error[E0425]: cannot find value `b` in this scope
+ --> $DIR/format-args-capture-issue-102057.rs:13:25
+ |
+LL | format!("\x7Ba} \x7Bb}");
+ | ^ help: a local variable with a similar name exists: `a`
+
+error[E0425]: cannot find value `b` in this scope
+ --> $DIR/format-args-capture-issue-102057.rs:15:28
+ |
+LL | format!("\x7Ba\x7D \x7Bb}");
+ | ^ help: a local variable with a similar name exists: `a`
+
+error[E0425]: cannot find value `b` in this scope
+ --> $DIR/format-args-capture-issue-102057.rs:17:28
+ |
+LL | format!("\x7Ba\x7D \x7Bb\x7D");
+ | ^ help: a local variable with a similar name exists: `a`
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/fmt/format-args-capture-issue-93378.rs b/src/test/ui/fmt/format-args-capture-issue-93378.rs
index 674444442..9d722a028 100644
--- a/src/test/ui/fmt/format-args-capture-issue-93378.rs
+++ b/src/test/ui/fmt/format-args-capture-issue-93378.rs
@@ -3,9 +3,9 @@ fn main() {
let b = "b";
println!("{a} {b} {} {} {c} {}", c = "c");
- //~^ ERROR: invalid reference to positional arguments 1 and 2 (there is 1 argument)
+ //~^ ERROR: 3 positional arguments in format string, but there is 1 argument
let n = 1;
println!("{a:.n$} {b:.*}");
- //~^ ERROR: invalid reference to positional argument 0 (no arguments were given)
+ //~^ ERROR: 1 positional argument in format string, but no arguments were given
}
diff --git a/src/test/ui/fmt/format-args-capture-issue-93378.stderr b/src/test/ui/fmt/format-args-capture-issue-93378.stderr
index b8e2b2afb..6429b0d46 100644
--- a/src/test/ui/fmt/format-args-capture-issue-93378.stderr
+++ b/src/test/ui/fmt/format-args-capture-issue-93378.stderr
@@ -1,19 +1,14 @@
-error: invalid reference to positional arguments 1 and 2 (there is 1 argument)
- --> $DIR/format-args-capture-issue-93378.rs:5:26
+error: 3 positional arguments in format string, but there is 1 argument
+ --> $DIR/format-args-capture-issue-93378.rs:5:23
|
LL | println!("{a} {b} {} {} {c} {}", c = "c");
- | ^^ ^^
- |
- = note: positional arguments are zero-based
+ | ^^ ^^ ^^ ---
-error: invalid reference to positional argument 0 (no arguments were given)
- --> $DIR/format-args-capture-issue-93378.rs:9:23
+error: 1 positional argument in format string, but no arguments were given
+ --> $DIR/format-args-capture-issue-93378.rs:9:26
|
LL | println!("{a:.n$} {b:.*}");
- | - ^^^--^
- | | |
- | | this precision flag adds an extra required argument at position 0, which is why there are 3 arguments expected
- | this parameter corresponds to the precision flag
+ | ^^ this precision flag adds an extra required argument at position 0, which is why there is 1 argument expected
|
= note: positional arguments are zero-based
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
diff --git a/src/test/ui/fmt/format-args-capture-macro-hygiene.rs b/src/test/ui/fmt/format-args-capture-macro-hygiene.rs
index fdbd93836..b04f80ba4 100644
--- a/src/test/ui/fmt/format-args-capture-macro-hygiene.rs
+++ b/src/test/ui/fmt/format-args-capture-macro-hygiene.rs
@@ -1,4 +1,22 @@
+// aux-build:format-string-proc-macro.rs
+
+#[macro_use]
+extern crate format_string_proc_macro;
+
+macro_rules! def_site {
+ () => { "{foo}" } //~ ERROR: there is no argument named `foo`
+}
+
+macro_rules! call_site {
+ ($fmt:literal) => { $fmt }
+}
+
fn main() {
format!(concat!("{foo}")); //~ ERROR: there is no argument named `foo`
format!(concat!("{ba", "r} {}"), 1); //~ ERROR: there is no argument named `bar`
+
+ format!(def_site!());
+ format!(call_site!("{foo}")); //~ ERROR: there is no argument named `foo`
+
+ format!(foo_with_input_span!("")); //~ ERROR: there is no argument named `foo`
}
diff --git a/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr b/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr
index 9423e8c81..1b5fbd2af 100644
--- a/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr
+++ b/src/test/ui/fmt/format-args-capture-macro-hygiene.stderr
@@ -1,5 +1,5 @@
error: there is no argument named `foo`
- --> $DIR/format-args-capture-macro-hygiene.rs:2:13
+ --> $DIR/format-args-capture-macro-hygiene.rs:15:13
|
LL | format!(concat!("{foo}"));
| ^^^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@ LL | format!(concat!("{foo}"));
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
error: there is no argument named `bar`
- --> $DIR/format-args-capture-macro-hygiene.rs:3:13
+ --> $DIR/format-args-capture-macro-hygiene.rs:16:13
|
LL | format!(concat!("{ba", "r} {}"), 1);
| ^^^^^^^^^^^^^^^^^^^^^^^
@@ -18,5 +18,36 @@ LL | format!(concat!("{ba", "r} {}"), 1);
= 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 2 previous errors
+error: there is no argument named `foo`
+ --> $DIR/format-args-capture-macro-hygiene.rs:7:13
+ |
+LL | () => { "{foo}" }
+ | ^^^^^^^
+...
+LL | format!(def_site!());
+ | ----------- in this macro invocation
+ |
+ = note: did you intend to capture a variable `foo` 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 `def_site` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: there is no argument named `foo`
+ --> $DIR/format-args-capture-macro-hygiene.rs:19:24
+ |
+LL | format!(call_site!("{foo}"));
+ | ^^^^^^^
+ |
+ = note: did you intend to capture a variable `foo` 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 `foo`
+ --> $DIR/format-args-capture-macro-hygiene.rs:21:34
+ |
+LL | format!(foo_with_input_span!(""));
+ | ^^
+ |
+ = note: did you intend to capture a variable `foo` from the surrounding scope?
+ = note: to avoid ambiguity, `format_args!` cannot capture variables when the format string is expanded from a macro
+
+error: aborting due to 5 previous errors
diff --git a/src/test/ui/fmt/format-concat-span.stderr b/src/test/ui/fmt/format-concat-span.stderr
deleted file mode 100644
index da46f40ab..000000000
--- a/src/test/ui/fmt/format-concat-span.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error: invalid format string: unmatched `}` found
- --> $DIR/format-concat-span.rs:13:13
- |
-LL | format!(concat!("abc}"));
- | ^^^^^^^^^^^^^^^ unmatched `}` 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 previous error
-
diff --git a/src/test/ui/fmt/format-concat-span.rs b/src/test/ui/fmt/format-expanded-string.rs
index ce92df0ad..4c716f08c 100644
--- a/src/test/ui/fmt/format-concat-span.rs
+++ b/src/test/ui/fmt/format-expanded-string.rs
@@ -1,3 +1,9 @@
+// aux-build:format-string-proc-macro.rs
+
+#[macro_use]
+extern crate format_string_proc_macro;
+
+
// If the format string is another macro invocation, rustc would previously
// compute nonsensical spans, such as:
//
@@ -12,4 +18,7 @@
fn main() {
format!(concat!("abc}"));
//~^ ERROR: invalid format string: unmatched `}` found
+
+ format!(err_with_input_span!(""));
+ //~^ ERROR: invalid format string: unmatched `}` found
}
diff --git a/src/test/ui/fmt/format-expanded-string.stderr b/src/test/ui/fmt/format-expanded-string.stderr
new file mode 100644
index 000000000..26ce7f269
--- /dev/null
+++ b/src/test/ui/fmt/format-expanded-string.stderr
@@ -0,0 +1,19 @@
+error: invalid format string: unmatched `}` found
+ --> $DIR/format-expanded-string.rs:19:13
+ |
+LL | format!(concat!("abc}"));
+ | ^^^^^^^^^^^^^^^ unmatched `}` 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: invalid format string: unmatched `}` found
+ --> $DIR/format-expanded-string.rs:22:34
+ |
+LL | format!(err_with_input_span!(""));
+ | ^^ unmatched `}` in format string
+ |
+ = note: if you intended to print `}`, you can escape it using `}}`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/fmt/ifmt-bad-arg.rs b/src/test/ui/fmt/ifmt-bad-arg.rs
index 84f4cc7f4..68861d7bf 100644
--- a/src/test/ui/fmt/ifmt-bad-arg.rs
+++ b/src/test/ui/fmt/ifmt-bad-arg.rs
@@ -20,9 +20,9 @@ fn main() {
//~^ ERROR: invalid reference to positional argument 2 (there are 2 arguments)
format!("{} {value} {} {}", 1, value=2);
- //~^ ERROR: invalid reference to positional argument 2 (there are 2 arguments)
+ //~^ ERROR: 3 positional arguments in format string, but there are 2 arguments
format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
- //~^ ERROR: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments)
+ //~^ ERROR: 6 positional arguments in format string, but there are 3 arguments
format!("{} {foo} {} {bar} {}", 1, 2, 3);
//~^ ERROR: cannot find value `foo` in this scope
@@ -79,7 +79,7 @@ tenth number: {}",
//~^ ERROR 4 positional arguments in format string, but there are 3 arguments
//~| ERROR mismatched types
println!("{} {:07$.*} {}", 1, 3.2, 4);
- //~^ ERROR 4 positional arguments in format string, but there are 3 arguments
+ //~^ ERROR invalid reference to positional arguments 3 and 7 (there are 3 arguments)
//~| ERROR mismatched types
println!("{} {:07$} {}", 1, 3.2, 4);
//~^ ERROR invalid reference to positional argument 7 (there are 3 arguments)
@@ -94,4 +94,6 @@ tenth number: {}",
// doesn't exist.
println!("{:.*}");
//~^ ERROR 2 positional arguments in format string, but no arguments were given
+ println!("{:.0$}");
+ //~^ ERROR invalid reference to positional argument 0 (no arguments were given)
}
diff --git a/src/test/ui/fmt/ifmt-bad-arg.stderr b/src/test/ui/fmt/ifmt-bad-arg.stderr
index 5439ee173..1b595a50e 100644
--- a/src/test/ui/fmt/ifmt-bad-arg.stderr
+++ b/src/test/ui/fmt/ifmt-bad-arg.stderr
@@ -5,10 +5,10 @@ LL | format!("{}");
| ^^
error: invalid reference to positional argument 1 (there is 1 argument)
- --> $DIR/ifmt-bad-arg.rs:9:14
+ --> $DIR/ifmt-bad-arg.rs:9:15
|
LL | format!("{1}", 1);
- | ^^^
+ | ^
|
= note: positional arguments are zero-based
@@ -27,36 +27,32 @@ LL | format!("{} {}");
| ^^ ^^
error: invalid reference to positional argument 1 (there is 1 argument)
- --> $DIR/ifmt-bad-arg.rs:16:18
+ --> $DIR/ifmt-bad-arg.rs:16:19
|
LL | format!("{0} {1}", 1);
- | ^^^
+ | ^
|
= note: positional arguments are zero-based
error: invalid reference to positional argument 2 (there are 2 arguments)
- --> $DIR/ifmt-bad-arg.rs:19:22
+ --> $DIR/ifmt-bad-arg.rs:19:23
|
LL | format!("{0} {1} {2}", 1, 2);
- | ^^^
+ | ^
|
= note: positional arguments are zero-based
-error: invalid reference to positional argument 2 (there are 2 arguments)
- --> $DIR/ifmt-bad-arg.rs:22:28
+error: 3 positional arguments in format string, but there are 2 arguments
+ --> $DIR/ifmt-bad-arg.rs:22:14
|
LL | format!("{} {value} {} {}", 1, value=2);
- | ^^
- |
- = note: positional arguments are zero-based
+ | ^^ ^^ ^^ - -
-error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments)
- --> $DIR/ifmt-bad-arg.rs:24:38
+error: 6 positional arguments in format string, but there are 3 arguments
+ --> $DIR/ifmt-bad-arg.rs:24:29
|
LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2);
- | ^^ ^^ ^^
- |
- = note: positional arguments are zero-based
+ | ^^ ^^ ^^ ^^ ^^ ^^ - - -
error: multiple unused formatting arguments
--> $DIR/ifmt-bad-arg.rs:32:17
@@ -117,20 +113,20 @@ LL | format!("{} {}", 1, 2, foo=1, bar=2);
| multiple missing formatting specifiers
error: duplicate argument named `foo`
- --> $DIR/ifmt-bad-arg.rs:40:33
+ --> $DIR/ifmt-bad-arg.rs:40:29
|
LL | format!("{foo}", foo=1, foo=2);
- | - ^ duplicate argument
- | |
- | previously here
+ | --- ^^^ duplicate argument
+ | |
+ | previously here
error: positional arguments cannot follow named arguments
--> $DIR/ifmt-bad-arg.rs:41:35
|
LL | format!("{foo} {} {}", foo=1, 2);
- | - ^ positional arguments must be before named arguments
- | |
- | named argument
+ | ----- ^ positional arguments must be before named arguments
+ | |
+ | named argument
error: named argument never used
--> $DIR/ifmt-bad-arg.rs:45:51
@@ -191,33 +187,26 @@ error: 4 positional arguments in format string, but there are 3 arguments
|
LL | println!("{} {:.*} {}", 1, 3.2, 4);
| ^^ ^^--^ ^^ - --- -
- | | |
- | | this parameter corresponds to the precision flag
+ | |
| this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
|
= note: positional arguments are zero-based
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
-error: 4 positional arguments in format string, but there are 3 arguments
- --> $DIR/ifmt-bad-arg.rs:81:15
+error: invalid reference to positional arguments 3 and 7 (there are 3 arguments)
+ --> $DIR/ifmt-bad-arg.rs:81:21
|
LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
- | ^^ ^^^----^ ^^ - --- -
- | | | |
- | | | this parameter corresponds to the precision flag
- | | this precision flag adds an extra required argument at position 1, which is why there are 4 arguments expected
- | this width flag expects an `usize` argument at position 7, but there are 3 arguments
+ | ^^ ^
|
= note: positional arguments are zero-based
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
error: invalid reference to positional argument 7 (there are 3 arguments)
- --> $DIR/ifmt-bad-arg.rs:84:18
+ --> $DIR/ifmt-bad-arg.rs:84:21
|
LL | println!("{} {:07$} {}", 1, 3.2, 4);
- | ^^^--^
- | |
- | this width flag expects an `usize` argument at position 7, but there are 3 arguments
+ | ^^
|
= note: positional arguments are zero-based
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
@@ -240,24 +229,19 @@ LL | println!("{:foo}", 1);
- `X`, which uses the `UpperHex` trait
error: invalid reference to positional arguments 4, 5, 6 and 7 (there is 1 argument)
- --> $DIR/ifmt-bad-arg.rs:87:15
+ --> $DIR/ifmt-bad-arg.rs:87:16
|
LL | println!("{5} {:4$} {6:7$}", 1);
- | ^^^ ^^--^ ^^^--^
- | | |
- | | this width flag expects an `usize` argument at position 7, but there is 1 argument
- | this width flag expects an `usize` argument at position 4, but there is 1 argument
+ | ^ ^^ ^ ^^
|
= note: positional arguments are zero-based
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
error: invalid reference to positional argument 0 (no arguments were given)
- --> $DIR/ifmt-bad-arg.rs:90:15
+ --> $DIR/ifmt-bad-arg.rs:90:20
|
LL | println!("{foo:0$}");
- | ^^^^^--^
- | |
- | this width flag expects an `usize` argument at position 0, but no arguments were given
+ | ^^
|
= note: positional arguments are zero-based
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
@@ -273,6 +257,15 @@ LL | println!("{:.*}");
= note: positional arguments are zero-based
= note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
+error: invalid reference to positional argument 0 (no arguments were given)
+ --> $DIR/ifmt-bad-arg.rs:97:16
+ |
+LL | println!("{:.0$}");
+ | ^^^^
+ |
+ = note: positional arguments are zero-based
+ = note: for information about formatting flags, visit https://doc.rust-lang.org/std/fmt/index.html
+
error[E0425]: cannot find value `foo` in this scope
--> $DIR/ifmt-bad-arg.rs:27:18
|
@@ -307,10 +300,10 @@ error[E0308]: mismatched types
--> $DIR/ifmt-bad-arg.rs:78:32
|
LL | println!("{} {:.*} {}", 1, 3.2, 4);
- | ---------------------------^^^----
- | | |
- | | expected `usize`, found floating-point number
- | arguments to this function are incorrect
+ | ^^^
+ | |
+ | expected `usize`, found floating-point number
+ | arguments to this function are incorrect
|
= note: expected reference `&usize`
found reference `&{float}`
@@ -325,10 +318,10 @@ error[E0308]: mismatched types
--> $DIR/ifmt-bad-arg.rs:81:35
|
LL | println!("{} {:07$.*} {}", 1, 3.2, 4);
- | ------------------------------^^^----
- | | |
- | | expected `usize`, found floating-point number
- | arguments to this function are incorrect
+ | ^^^
+ | |
+ | expected `usize`, found floating-point number
+ | arguments to this function are incorrect
|
= note: expected reference `&usize`
found reference `&{float}`
@@ -339,7 +332,7 @@ LL | pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
| ^^^^^^^^^^
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: aborting due to 37 previous errors
+error: aborting due to 38 previous errors
Some errors have detailed explanations: E0308, E0425.
For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/fmt/ifmt-unimpl.stderr b/src/test/ui/fmt/ifmt-unimpl.stderr
index dbcb2eb66..0e34f9135 100644
--- a/src/test/ui/fmt/ifmt-unimpl.stderr
+++ b/src/test/ui/fmt/ifmt-unimpl.stderr
@@ -14,7 +14,7 @@ LL | format!("{:X}", "3");
NonZeroI8
NonZeroIsize
and 21 others
- = note: required because of the requirements on the impl of `UpperHex` for `&str`
+ = note: required for `&str` to implement `UpperHex`
note: required by a bound in `ArgumentV1::<'a>::new_upper_hex`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
|
diff --git a/src/test/ui/fmt/send-sync.stderr b/src/test/ui/fmt/send-sync.stderr
index 7c7a3c884..3ed040c3a 100644
--- a/src/test/ui/fmt/send-sync.stderr
+++ b/src/test/ui/fmt/send-sync.stderr
@@ -1,14 +1,16 @@
error[E0277]: `core::fmt::Opaque` cannot be shared between threads safely
- --> $DIR/send-sync.rs:8:5
+ --> $DIR/send-sync.rs:8:10
|
LL | send(format_args!("{:?}", c));
- | ^^^^ `core::fmt::Opaque` cannot be shared between threads safely
+ | ---- ^^^^^^^^^^^^^^^^^^^^^^^ `core::fmt::Opaque` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
|
= help: within `[ArgumentV1<'_>]`, the trait `Sync` is not implemented for `core::fmt::Opaque`
= note: required because it appears within the type `&core::fmt::Opaque`
= note: required because it appears within the type `ArgumentV1<'_>`
= note: required because it appears within the type `[ArgumentV1<'_>]`
- = note: required because of the requirements on the impl of `Send` for `&[ArgumentV1<'_>]`
+ = note: required for `&[ArgumentV1<'_>]` to implement `Send`
= note: required because it appears within the type `Arguments<'_>`
note: required by a bound in `send`
--> $DIR/send-sync.rs:1:12
@@ -17,10 +19,12 @@ LL | fn send<T: Send>(_: T) {}
| ^^^^ required by this bound in `send`
error[E0277]: `core::fmt::Opaque` cannot be shared between threads safely
- --> $DIR/send-sync.rs:9:5
+ --> $DIR/send-sync.rs:9:10
|
LL | sync(format_args!("{:?}", c));
- | ^^^^ `core::fmt::Opaque` cannot be shared between threads safely
+ | ---- ^^^^^^^^^^^^^^^^^^^^^^^ `core::fmt::Opaque` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
|
= help: within `Arguments<'_>`, the trait `Sync` is not implemented for `core::fmt::Opaque`
= note: required because it appears within the type `&core::fmt::Opaque`
diff --git a/src/test/ui/fn/fn-compare-mismatch.stderr b/src/test/ui/fn/fn-compare-mismatch.stderr
index 096440225..df838cb11 100644
--- a/src/test/ui/fn/fn-compare-mismatch.stderr
+++ b/src/test/ui/fn/fn-compare-mismatch.stderr
@@ -6,14 +6,10 @@ LL | let x = f == g;
| |
| fn() {f}
|
-help: you might have forgotten to call this function
+help: use parentheses to call these
|
-LL | let x = f() == g;
- | ++
-help: you might have forgotten to call this function
- |
-LL | let x = f == g();
- | ++
+LL | let x = f() == g();
+ | ++ ++
error[E0308]: mismatched types
--> $DIR/fn-compare-mismatch.rs:4:18
diff --git a/src/test/ui/fn/fn-item-type.stderr b/src/test/ui/fn/fn-item-type.stderr
index ecc6485d6..f03a47d5c 100644
--- a/src/test/ui/fn/fn-item-type.stderr
+++ b/src/test/ui/fn/fn-item-type.stderr
@@ -15,7 +15,7 @@ note: function defined here
--> $DIR/fn-item-type.rs:7:4
|
LL | fn eq<T>(x: T, y: T) { }
- | ^^ ---- ----
+ | ^^ ----
error[E0308]: mismatched types
--> $DIR/fn-item-type.rs:22:19
@@ -34,7 +34,7 @@ note: function defined here
--> $DIR/fn-item-type.rs:7:4
|
LL | fn eq<T>(x: T, y: T) { }
- | ^^ ---- ----
+ | ^^ ----
error[E0308]: mismatched types
--> $DIR/fn-item-type.rs:29:23
@@ -53,7 +53,7 @@ note: function defined here
--> $DIR/fn-item-type.rs:7:4
|
LL | fn eq<T>(x: T, y: T) { }
- | ^^ ---- ----
+ | ^^ ----
error[E0308]: mismatched types
--> $DIR/fn-item-type.rs:38:26
@@ -72,7 +72,7 @@ note: function defined here
--> $DIR/fn-item-type.rs:7:4
|
LL | fn eq<T>(x: T, y: T) { }
- | ^^ ---- ----
+ | ^^ ----
error[E0308]: mismatched types
--> $DIR/fn-item-type.rs:45:19
@@ -90,7 +90,7 @@ note: function defined here
--> $DIR/fn-item-type.rs:7:4
|
LL | fn eq<T>(x: T, y: T) { }
- | ^^ ---- ----
+ | ^^ ----
error: aborting due to 5 previous errors
diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr
index ea88e401b..2a674d3c1 100644
--- a/src/test/ui/fn/fn-trait-formatting.stderr
+++ b/src/test/ui/fn/fn-trait-formatting.stderr
@@ -8,6 +8,10 @@ LL | let _: () = Box::new(|_: isize| {}) as Box<dyn FnOnce(isize)>;
|
= note: expected unit type `()`
found struct `Box<dyn FnOnce(isize)>`
+help: use parentheses to call this trait object
+ |
+LL | let _: () = (Box::new(|_: isize| {}) as Box<dyn FnOnce(isize)>)(/* isize */);
+ | + ++++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-trait-formatting.rs:10:17
@@ -19,6 +23,10 @@ LL | let _: () = Box::new(|_: isize, isize| {}) as Box<dyn Fn(isize, isize)>
|
= note: expected unit type `()`
found struct `Box<dyn Fn(isize, isize)>`
+help: use parentheses to call this trait object
+ |
+LL | let _: () = (Box::new(|_: isize, isize| {}) as Box<dyn Fn(isize, isize)>)(/* isize */, /* isize */);
+ | + +++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-trait-formatting.rs:14:17
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs
index 5a92bcd37..5d9245556 100644
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.rs
@@ -1,4 +1,4 @@
-// check-pass
+// check-fail
trait Trait {
type Type;
@@ -17,6 +17,7 @@ where
fn g<'a, 'b>() {
f::<'a, 'b>(());
+ //~^ ERROR lifetime may not live long enough
}
fn main() {}
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr
new file mode 100644
index 000000000..0c3df04ea
--- /dev/null
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-2.stderr
@@ -0,0 +1,17 @@
+error: lifetime may not live long enough
+ --> $DIR/implied-bounds-unnorm-associated-type-2.rs:19:5
+ |
+LL | fn g<'a, 'b>() {
+ | -- -- lifetime `'b` defined here
+ | |
+ | lifetime `'a` defined here
+LL | f::<'a, 'b>(());
+ | ^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a`
+ |
+ = help: consider adding the following bound: `'b: 'a`
+ = note: requirement occurs because of a function pointer to `f`
+ = note: the function `f` is invariant over the parameter `'a`
+ = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-3.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type-3.rs
index dc25ac086..888f74cf6 100644
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type-3.rs
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-3.rs
@@ -1,6 +1,4 @@
-// check-fail
-// See issue #91899. If we treat unnormalized args as WF, `Self` can also be a
-// source of unsoundness.
+// check-pass
pub trait Yokeable<'a>: 'static {
type Output: 'a;
@@ -17,7 +15,6 @@ pub trait ZeroCopyFrom<C: ?Sized>: for<'a> Yokeable<'a> {
impl<T> ZeroCopyFrom<[T]> for &'static [T] {
fn zero_copy_from<'b>(cart: &'b [T]) -> &'b [T] {
- //~^ the parameter
cart
}
}
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-3.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type-3.stderr
deleted file mode 100644
index 95cf4fb16..000000000
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type-3.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/implied-bounds-unnorm-associated-type-3.rs:19:5
- |
-LL | fn zero_copy_from<'b>(cart: &'b [T]) -> &'b [T] {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `[T]` will meet its required lifetime bounds
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | impl<T: 'static> ZeroCopyFrom<[T]> for &'static [T] {
- | +++++++++
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-4.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type-4.rs
new file mode 100644
index 000000000..12859252c
--- /dev/null
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-4.rs
@@ -0,0 +1,24 @@
+// A regression test for #98543
+
+trait Trait {
+ type Type;
+}
+
+impl<T> Trait for T {
+ type Type = ();
+}
+
+fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str
+where
+ &'a &'b (): Trait, // <- adding this bound is the change from #91068
+{
+ s
+}
+
+fn main() {
+ let x = String::from("Hello World!");
+ let y = f(&x, ());
+ drop(x);
+ //~^ ERROR cannot move out of `x` because it is borrowed
+ println!("{}", y);
+}
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-4.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type-4.stderr
new file mode 100644
index 000000000..fcbaa91d1
--- /dev/null
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-4.stderr
@@ -0,0 +1,14 @@
+error[E0505]: cannot move out of `x` because it is borrowed
+ --> $DIR/implied-bounds-unnorm-associated-type-4.rs:21:10
+ |
+LL | let y = f(&x, ());
+ | -- borrow of `x` occurs here
+LL | drop(x);
+ | ^ move out of `x` occurs here
+LL |
+LL | println!("{}", y);
+ | - borrow later used here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0505`.
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-5.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type-5.rs
new file mode 100644
index 000000000..2a9a6a8cc
--- /dev/null
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-5.rs
@@ -0,0 +1,23 @@
+trait Trait<'a>: 'a {
+ type Type;
+}
+
+// if the `T: 'a` bound gets implied we would probably get ub here again
+impl<'a, T> Trait<'a> for T {
+ //~^ ERROR the parameter type `T` may not live long enough
+ type Type = ();
+}
+
+fn f<'a, 'b>(s: &'b str, _: <&'b () as Trait<'a>>::Type) -> &'a str
+where
+ &'b (): Trait<'a>,
+{
+ s
+}
+
+fn main() {
+ let x = String::from("Hello World!");
+ let y = f(&x, ());
+ drop(x);
+ println!("{}", y);
+}
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type-5.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type-5.stderr
new file mode 100644
index 000000000..458756a3d
--- /dev/null
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type-5.stderr
@@ -0,0 +1,19 @@
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/implied-bounds-unnorm-associated-type-5.rs:6:13
+ |
+LL | impl<'a, T> Trait<'a> for T {
+ | ^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/implied-bounds-unnorm-associated-type-5.rs:1:18
+ |
+LL | trait Trait<'a>: 'a {
+ | ^^
+help: consider adding an explicit lifetime bound...
+ |
+LL | impl<'a, T: 'a> Trait<'a> for T {
+ | ++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs
index 04b6f4dd8..d58d25036 100644
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.rs
@@ -1,6 +1,6 @@
// check-fail
-// See issue #91068. Types in the substs of an associated type can't be implied
-// to be WF, since they don't actually have to be constructed.
+// See issue #91068. We check that the unnormalized associated types in
+// function signatures are implied
trait Trait {
type Type;
@@ -12,12 +12,12 @@ impl<T> Trait for T {
fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
s
- //~^ ERROR lifetime may not live long enough
}
fn main() {
let x = String::from("Hello World!");
let y = f(&x, ());
drop(x);
+ //~^ ERROR cannot move out of `x` because it is borrowed
println!("{}", y);
}
diff --git a/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr
index 8096f0838..e35f46e44 100644
--- a/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr
+++ b/src/test/ui/fn/implied-bounds-unnorm-associated-type.stderr
@@ -1,14 +1,14 @@
-error: lifetime may not live long enough
- --> $DIR/implied-bounds-unnorm-associated-type.rs:14:5
+error[E0505]: cannot move out of `x` because it is borrowed
+ --> $DIR/implied-bounds-unnorm-associated-type.rs:20:10
|
-LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
- | -- -- lifetime `'b` defined here
- | |
- | lifetime `'a` defined here
-LL | s
- | ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
- |
- = help: consider adding the following bound: `'b: 'a`
+LL | let y = f(&x, ());
+ | -- borrow of `x` occurs here
+LL | drop(x);
+ | ^ move out of `x` occurs here
+LL |
+LL | println!("{}", y);
+ | - borrow later used here
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0505`.
diff --git a/src/test/ui/for-loop-while/break-while-condition.stderr b/src/test/ui/for-loop-while/break-while-condition.stderr
index 6960c4fd8..e79f6a75f 100644
--- a/src/test/ui/for-loop-while/break-while-condition.stderr
+++ b/src/test/ui/for-loop-while/break-while-condition.stderr
@@ -31,6 +31,14 @@ LL | | }
|
= note: expected type `!`
found unit type `()`
+note: the function expects a value to always be returned, but loops might run zero times
+ --> $DIR/break-while-condition.rs:24:13
+ |
+LL | while false {
+ | ^^^^^^^^^^^ this might have zero elements to iterate on
+LL | return
+ | ------ if the loop doesn't execute, this value would never get returned
+ = help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
error: aborting due to 3 previous errors
diff --git a/src/test/ui/for-loop-while/label_break_value.rs b/src/test/ui/for-loop-while/label_break_value.rs
index ca9d71a7a..10992c505 100644
--- a/src/test/ui/for-loop-while/label_break_value.rs
+++ b/src/test/ui/for-loop-while/label_break_value.rs
@@ -1,7 +1,6 @@
// run-pass
#![allow(dead_code)]
#![allow(unused_assignments)]
-#![feature(label_break_value)]
// Test control flow to follow label_break_value semantics
fn label_break(a: bool, b: bool) -> u32 {
diff --git a/src/test/ui/for-loop-while/label_break_value_invalid.rs b/src/test/ui/for-loop-while/label_break_value_invalid.rs
index 149bf17b8..fcf2e0f29 100644
--- a/src/test/ui/for-loop-while/label_break_value_invalid.rs
+++ b/src/test/ui/for-loop-while/label_break_value_invalid.rs
@@ -1,5 +1,4 @@
#![crate_type = "lib"]
-#![feature(label_break_value)]
fn lbv_macro_test_hygiene_respected() {
macro_rules! mac2 {
diff --git a/src/test/ui/for-loop-while/label_break_value_invalid.stderr b/src/test/ui/for-loop-while/label_break_value_invalid.stderr
index 7182b8f59..f6999c4ab 100644
--- a/src/test/ui/for-loop-while/label_break_value_invalid.stderr
+++ b/src/test/ui/for-loop-while/label_break_value_invalid.stderr
@@ -1,5 +1,5 @@
error[E0426]: use of undeclared label `'a`
- --> $DIR/label_break_value_invalid.rs:7:19
+ --> $DIR/label_break_value_invalid.rs:6:19
|
LL | break 'a $val;
| ^^ undeclared label `'a`
@@ -10,7 +10,7 @@ LL | mac2!(2);
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0426]: use of undeclared label `'a`
- --> $DIR/label_break_value_invalid.rs:29:19
+ --> $DIR/label_break_value_invalid.rs:28:19
|
LL | let x: u8 = mac3!('b: {
| -- a label with a similar name is reachable
@@ -22,7 +22,7 @@ LL | break 'a 3;
| help: try using similarly named label: `'b`
error[E0426]: use of undeclared label `'a`
- --> $DIR/label_break_value_invalid.rs:34:29
+ --> $DIR/label_break_value_invalid.rs:33:29
|
LL | let x: u8 = mac3!(break 'a 4);
| ^^ undeclared label `'a`
diff --git a/src/test/ui/for-loop-while/while-let-2.stderr b/src/test/ui/for-loop-while/while-let-2.stderr
index 2d23a6373..1b1cf6792 100644
--- a/src/test/ui/for-loop-while/while-let-2.stderr
+++ b/src/test/ui/for-loop-while/while-let-2.stderr
@@ -9,9 +9,9 @@ LL | | println!("irrefutable pattern");
LL | | });
| |______- in this macro invocation
|
- = note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this pattern will always match, so the loop will never exit
= help: consider instead using a `loop { ... }` with a `let` inside it
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `while let` pattern
diff --git a/src/test/ui/for/for-c-in-str.rs b/src/test/ui/for/for-c-in-str.rs
index 86a1c1a34..b086128d2 100644
--- a/src/test/ui/for/for-c-in-str.rs
+++ b/src/test/ui/for/for-c-in-str.rs
@@ -5,7 +5,7 @@ fn main() {
//~^ ERROR `&str` is not an iterator
//~| NOTE `&str` is not an iterator
//~| HELP the trait `Iterator` is not implemented for `&str`
- //~| NOTE required because of the requirements on the impl of `IntoIterator` for `&str`
+ //~| NOTE required for `&str` to implement `IntoIterator`
//~| NOTE in this expansion of desugaring of `for` loop
//~| NOTE in this expansion of desugaring of `for` loop
//~| NOTE in this expansion of desugaring of `for` loop
diff --git a/src/test/ui/for/for-c-in-str.stderr b/src/test/ui/for/for-c-in-str.stderr
index 07ddc8ea7..959a7c43f 100644
--- a/src/test/ui/for/for-c-in-str.stderr
+++ b/src/test/ui/for/for-c-in-str.stderr
@@ -5,7 +5,7 @@ LL | for c in "asdf" {
| ^^^^^^ `&str` is not an iterator; try calling `.chars()` or `.bytes()`
|
= help: the trait `Iterator` is not implemented for `&str`
- = note: required because of the requirements on the impl of `IntoIterator` for `&str`
+ = note: required for `&str` to implement `IntoIterator`
error: aborting due to previous error
diff --git a/src/test/ui/for/for-loop-bogosity.stderr b/src/test/ui/for/for-loop-bogosity.stderr
index 0bdd75b35..9bf8056e8 100644
--- a/src/test/ui/for/for-loop-bogosity.stderr
+++ b/src/test/ui/for/for-loop-bogosity.stderr
@@ -5,7 +5,7 @@ LL | for x in bogus {
| ^^^^^ `MyStruct` is not an iterator
|
= help: the trait `Iterator` is not implemented for `MyStruct`
- = note: required because of the requirements on the impl of `IntoIterator` for `MyStruct`
+ = note: required for `MyStruct` to implement `IntoIterator`
error: aborting due to previous error
diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr
index aed7f72c6..a8f23f81d 100644
--- a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr
+++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr
@@ -5,6 +5,18 @@ LL | fn bar(x: x::Foo) -> y::Foo {
| ------ expected `y::Foo` because of return type
LL | return x;
| ^ expected enum `y::Foo`, found enum `x::Foo`
+ |
+ = note: enum `x::Foo` and enum `y::Foo` have similar names, but are actually distinct types
+note: enum `x::Foo` is defined in module `crate::x` of the current crate
+ --> $DIR/fully-qualified-type-name2.rs:4:5
+ |
+LL | pub enum Foo { }
+ | ^^^^^^^^^^^^
+note: enum `y::Foo` is defined in module `crate::y` of the current crate
+ --> $DIR/fully-qualified-type-name2.rs:8:5
+ |
+LL | pub enum Foo { }
+ | ^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/function-pointer/issue-102289.rs b/src/test/ui/function-pointer/issue-102289.rs
new file mode 100644
index 000000000..de394ca9a
--- /dev/null
+++ b/src/test/ui/function-pointer/issue-102289.rs
@@ -0,0 +1,54 @@
+// check-pass
+
+pub(crate) trait Parser: Sized {
+ type Output;
+ fn parse(&mut self, _input: &str) -> Result<(), ()> {
+ loop {}
+ }
+ fn map<F, B>(self, _f: F) -> Map<Self, F>
+ where
+ F: FnMut(Self::Output) -> B,
+ {
+ todo!()
+ }
+}
+
+pub(crate) struct Chainl1<P, Op>(P, Op);
+impl<P, Op> Parser for Chainl1<P, Op>
+where
+ P: Parser,
+ Op: Parser,
+ Op::Output: FnOnce(P::Output, P::Output) -> P::Output,
+{
+ type Output = P::Output;
+}
+pub(crate) fn chainl1<P, Op>(_parser: P, _op: Op) -> Chainl1<P, Op>
+where
+ P: Parser,
+ Op: Parser,
+ Op::Output: FnOnce(P::Output, P::Output) -> P::Output,
+{
+ loop {}
+}
+
+pub(crate) struct Map<P, F>(P, F);
+impl<A, B, P, F> Parser for Map<P, F>
+where
+ P: Parser<Output = A>,
+ F: FnMut(A) -> B,
+{
+ type Output = B;
+}
+
+impl Parser for u32 {
+ type Output = ();
+}
+
+pub fn chainl1_error_consume() {
+ fn first<T, U>(t: T, _: U) -> T {
+ t
+ }
+ let _ = chainl1(1, 1.map(|_| first)).parse("");
+}
+
+fn main() {}
diff --git a/src/test/ui/function-pointer/sized-ret-with-binder.rs b/src/test/ui/function-pointer/sized-ret-with-binder.rs
new file mode 100644
index 000000000..104ac4d22
--- /dev/null
+++ b/src/test/ui/function-pointer/sized-ret-with-binder.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+#![feature(unboxed_closures)]
+
+fn is_fn<T: for<'a> Fn<(&'a (),)>>() {}
+fn is_fn2<T: for<'a, 'b> Fn<(&'a &'b (),)>>() {}
+
+struct Outlives<'a, 'b>(std::marker::PhantomData<&'a &'b ()>);
+
+fn main() {
+ is_fn::<for<'a> fn(&'a ()) -> &'a ()>();
+ is_fn::<for<'a> fn(&'a ()) -> &'a dyn std::fmt::Debug>();
+ is_fn2::<for<'a, 'b> fn(&'a &'b ()) -> Outlives<'a, 'b>>();
+ is_fn2::<for<'a, 'b> fn(&'a &'b ()) -> (&'a (), &'a ())>();
+}
diff --git a/src/test/ui/function-pointer/unsized-ret.rs b/src/test/ui/function-pointer/unsized-ret.rs
new file mode 100644
index 000000000..60af5769d
--- /dev/null
+++ b/src/test/ui/function-pointer/unsized-ret.rs
@@ -0,0 +1,14 @@
+#![feature(fn_traits)]
+#![feature(unboxed_closures)]
+
+fn foo<F: Fn<T>, T>(f: Option<F>, t: T) {
+ let y = (f.unwrap()).call(t);
+}
+
+fn main() {
+ foo::<fn() -> str, _>(None, ());
+ //~^ ERROR the size for values of type `str` cannot be known at compilation time
+
+ foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&(),));
+ //~^ ERROR the size for values of type `(dyn std::fmt::Display + 'a)` cannot be known at compilation time
+}
diff --git a/src/test/ui/function-pointer/unsized-ret.stderr b/src/test/ui/function-pointer/unsized-ret.stderr
new file mode 100644
index 000000000..bec3e2aa3
--- /dev/null
+++ b/src/test/ui/function-pointer/unsized-ret.stderr
@@ -0,0 +1,35 @@
+error[E0277]: the size for values of type `str` cannot be known at compilation time
+ --> $DIR/unsized-ret.rs:9:27
+ |
+LL | foo::<fn() -> str, _>(None, ());
+ | --------------------- ^^^^ doesn't have a size known at compile-time
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: within `fn() -> str`, the trait `Sized` is not implemented for `str`
+ = note: required because it appears within the type `fn() -> str`
+note: required by a bound in `foo`
+ --> $DIR/unsized-ret.rs:4:11
+ |
+LL | fn foo<F: Fn<T>, T>(f: Option<F>, t: T) {
+ | ^^^^^ required by this bound in `foo`
+
+error[E0277]: the size for values of type `(dyn std::fmt::Display + 'a)` cannot be known at compilation time
+ --> $DIR/unsized-ret.rs:12:66
+ |
+LL | foo::<for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a), _>(None, (&(),));
+ | ------------------------------------------------------------ ^^^^ doesn't have a size known at compile-time
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: within `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`, the trait `for<'a> Sized` is not implemented for `(dyn std::fmt::Display + 'a)`
+ = note: required because it appears within the type `for<'a> fn(&'a ()) -> (dyn std::fmt::Display + 'a)`
+note: required by a bound in `foo`
+ --> $DIR/unsized-ret.rs:4:11
+ |
+LL | fn foo<F: Fn<T>, T>(f: Option<F>, t: T) {
+ | ^^^^^ required by this bound in `foo`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/functions-closures/fn-help-with-err.rs b/src/test/ui/functions-closures/fn-help-with-err.rs
index 3d2bcb8ad..49a514a8b 100644
--- a/src/test/ui/functions-closures/fn-help-with-err.rs
+++ b/src/test/ui/functions-closures/fn-help-with-err.rs
@@ -1,16 +1,28 @@
// This test case checks the behavior of typeck::check::method::suggest::is_fn on Ty::Error.
+
+struct Foo;
+
+trait Bar {
+ //~^ NOTE `Bar` defines an item `bar`, perhaps you need to implement it
+ //~| NOTE `Bar` defines an item `bar`, perhaps you need to implement it
+ fn bar(&self) {}
+}
+
+impl Bar for Foo {}
+
fn main() {
let arc = std::sync::Arc::new(oops);
//~^ ERROR cannot find value `oops` in this scope
//~| NOTE not found
- // The error "note: this is a function, perhaps you wish to call it" MUST NOT appear.
- arc.blablabla();
- //~^ ERROR no method named `blablabla`
+ arc.bar();
+ //~^ ERROR no method named `bar`
//~| NOTE method not found
- let arc2 = std::sync::Arc::new(|| 1);
- // The error "note: this is a function, perhaps you wish to call it" SHOULD appear
- arc2.blablabla();
- //~^ ERROR no method named `blablabla`
+ //~| HELP items from traits can only be used if the trait is implemented and in scope
+
+ let arc2 = std::sync::Arc::new(|| Foo);
+ arc2.bar();
+ //~^ ERROR no method named `bar`
//~| NOTE method not found
- //~| NOTE this is a function, perhaps you wish to call it
+ //~| HELP items from traits can only be used if the trait is implemented and in scope
+ //~| HELP use parentheses to call this closure
}
diff --git a/src/test/ui/functions-closures/fn-help-with-err.stderr b/src/test/ui/functions-closures/fn-help-with-err.stderr
index 06e29daef..229666621 100644
--- a/src/test/ui/functions-closures/fn-help-with-err.stderr
+++ b/src/test/ui/functions-closures/fn-help-with-err.stderr
@@ -1,22 +1,38 @@
error[E0425]: cannot find value `oops` in this scope
- --> $DIR/fn-help-with-err.rs:3:35
+ --> $DIR/fn-help-with-err.rs:14:35
|
LL | let arc = std::sync::Arc::new(oops);
| ^^^^ not found in this scope
-error[E0599]: no method named `blablabla` found for struct `Arc<_>` in the current scope
- --> $DIR/fn-help-with-err.rs:7:9
+error[E0599]: no method named `bar` found for struct `Arc<_>` in the current scope
+ --> $DIR/fn-help-with-err.rs:17:9
|
-LL | arc.blablabla();
- | ^^^^^^^^^ method not found in `Arc<_>`
+LL | arc.bar();
+ | ^^^ method not found in `Arc<_>`
+ |
+ = help: items from traits can only be used if the trait is implemented and in scope
+note: `Bar` defines an item `bar`, perhaps you need to implement it
+ --> $DIR/fn-help-with-err.rs:5:1
+ |
+LL | trait Bar {
+ | ^^^^^^^^^
-error[E0599]: no method named `blablabla` found for struct `Arc<[closure@$DIR/fn-help-with-err.rs:10:36: 10:38]>` in the current scope
- --> $DIR/fn-help-with-err.rs:12:10
+error[E0599]: no method named `bar` found for struct `Arc<[closure@$DIR/fn-help-with-err.rs:22:36: 22:38]>` in the current scope
+ --> $DIR/fn-help-with-err.rs:23:10
+ |
+LL | arc2.bar();
+ | ^^^ method not found in `Arc<[closure@$DIR/fn-help-with-err.rs:22:36: 22:38]>`
+ |
+ = help: items from traits can only be used if the trait is implemented and in scope
+note: `Bar` defines an item `bar`, perhaps you need to implement it
+ --> $DIR/fn-help-with-err.rs:5:1
+ |
+LL | trait Bar {
+ | ^^^^^^^^^
+help: use parentheses to call this closure
|
-LL | arc2.blablabla();
- | ---- ^^^^^^^^^ method not found in `Arc<[closure@$DIR/fn-help-with-err.rs:10:36: 10:38]>`
- | |
- | this is a function, perhaps you wish to call it
+LL | arc2().bar();
+ | ++
error: aborting due to 3 previous errors
diff --git a/src/test/ui/future-incompatible-lint-group.stderr b/src/test/ui/future-incompatible-lint-group.stderr
index 8f6dde665..a8fb100a7 100644
--- a/src/test/ui/future-incompatible-lint-group.stderr
+++ b/src/test/ui/future-incompatible-lint-group.stderr
@@ -4,9 +4,9 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
LL | fn f(u8) {}
| ^^ help: try naming the parameter or explicitly ignoring it: `_: u8`
|
- = note: `#[warn(anonymous_parameters)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
+ = note: `#[warn(anonymous_parameters)]` on by default
error: this attribute can only be applied at the crate level
--> $DIR/future-incompatible-lint-group.rs:13:12
@@ -14,15 +14,15 @@ error: this attribute can only be applied at the crate level
LL | #![doc(test(some_test))]
| ^^^^^^^^^^^^^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+ = note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
note: the lint level is defined here
--> $DIR/future-incompatible-lint-group.rs:3:9
|
LL | #![deny(future_incompatible)]
| ^^^^^^^^^^^^^^^^^^^
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(future_incompatible)]`
- = 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: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/generator/clone-impl-async.rs b/src/test/ui/generator/clone-impl-async.rs
new file mode 100644
index 000000000..83c51526b
--- /dev/null
+++ b/src/test/ui/generator/clone-impl-async.rs
@@ -0,0 +1,71 @@
+// edition:2021
+// gate-test-generator_clone
+// Verifies that feature(generator_clone) doesn't allow async blocks to be cloned/copied.
+
+#![feature(generators, generator_clone)]
+
+use std::future::ready;
+
+struct NonClone;
+
+fn main() {
+ let inner_non_clone = async {
+ let non_clone = NonClone;
+ let () = ready(()).await;
+ drop(non_clone);
+ };
+ check_copy(&inner_non_clone);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ check_clone(&inner_non_clone);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+
+ let non_clone = NonClone;
+ let outer_non_clone = async move {
+ drop(non_clone);
+ };
+ check_copy(&outer_non_clone);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ check_clone(&outer_non_clone);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+
+ let maybe_copy_clone = async move {};
+ check_copy(&maybe_copy_clone);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ check_clone(&maybe_copy_clone);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+
+ let inner_non_clone_fn = the_inner_non_clone_fn();
+ check_copy(&inner_non_clone_fn);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ check_clone(&inner_non_clone_fn);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+
+ let outer_non_clone_fn = the_outer_non_clone_fn(NonClone);
+ check_copy(&outer_non_clone_fn);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ check_clone(&outer_non_clone_fn);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+
+ let maybe_copy_clone_fn = the_maybe_copy_clone_fn();
+ check_copy(&maybe_copy_clone_fn);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ check_clone(&maybe_copy_clone_fn);
+ //~^ ERROR the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+}
+
+async fn the_inner_non_clone_fn() {
+ let non_clone = NonClone;
+ let () = ready(()).await;
+ drop(non_clone);
+}
+
+async fn the_outer_non_clone_fn(non_clone: NonClone) {
+ let () = ready(()).await;
+ drop(non_clone);
+}
+
+async fn the_maybe_copy_clone_fn() {
+}
+
+fn check_copy<T: Copy>(_x: &T) {}
+fn check_clone<T: Clone>(_x: &T) {}
diff --git a/src/test/ui/generator/clone-impl-async.stderr b/src/test/ui/generator/clone-impl-async.stderr
new file mode 100644
index 000000000..cbb58d2af
--- /dev/null
+++ b/src/test/ui/generator/clone-impl-async.stderr
@@ -0,0 +1,171 @@
+error[E0277]: the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ --> $DIR/clone-impl-async.rs:17:16
+ |
+LL | check_copy(&inner_non_clone);
+ | ---------- ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl-async.rs:70:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+ --> $DIR/clone-impl-async.rs:19:17
+ |
+LL | check_clone(&inner_non_clone);
+ | ----------- ^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl-async.rs:71:19
+ |
+LL | fn check_clone<T: Clone>(_x: &T) {}
+ | ^^^^^ required by this bound in `check_clone`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ --> $DIR/clone-impl-async.rs:26:16
+ |
+LL | check_copy(&outer_non_clone);
+ | ---------- ^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl-async.rs:70:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+ --> $DIR/clone-impl-async.rs:28:17
+ |
+LL | check_clone(&outer_non_clone);
+ | ----------- ^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl-async.rs:71:19
+ |
+LL | fn check_clone<T: Clone>(_x: &T) {}
+ | ^^^^^ required by this bound in `check_clone`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ --> $DIR/clone-impl-async.rs:32:16
+ |
+LL | check_copy(&maybe_copy_clone);
+ | ---------- ^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl-async.rs:70:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+ --> $DIR/clone-impl-async.rs:34:17
+ |
+LL | check_clone(&maybe_copy_clone);
+ | ----------- ^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl-async.rs:71:19
+ |
+LL | fn check_clone<T: Clone>(_x: &T) {}
+ | ^^^^^ required by this bound in `check_clone`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ --> $DIR/clone-impl-async.rs:38:16
+ |
+LL | check_copy(&inner_non_clone_fn);
+ | ---------- ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl-async.rs:70:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+ --> $DIR/clone-impl-async.rs:40:17
+ |
+LL | check_clone(&inner_non_clone_fn);
+ | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl-async.rs:71:19
+ |
+LL | fn check_clone<T: Clone>(_x: &T) {}
+ | ^^^^^ required by this bound in `check_clone`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ --> $DIR/clone-impl-async.rs:44:16
+ |
+LL | check_copy(&outer_non_clone_fn);
+ | ---------- ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl-async.rs:70:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+ --> $DIR/clone-impl-async.rs:46:17
+ |
+LL | check_clone(&outer_non_clone_fn);
+ | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl-async.rs:71:19
+ |
+LL | fn check_clone<T: Clone>(_x: &T) {}
+ | ^^^^^ required by this bound in `check_clone`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Copy` is not satisfied
+ --> $DIR/clone-impl-async.rs:50:16
+ |
+LL | check_copy(&maybe_copy_clone_fn);
+ | ---------- ^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl-async.rs:70:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `impl Future<Output = ()>: Clone` is not satisfied
+ --> $DIR/clone-impl-async.rs:52:17
+ |
+LL | check_clone(&maybe_copy_clone_fn);
+ | ----------- ^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `impl Future<Output = ()>`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl-async.rs:71:19
+ |
+LL | fn check_clone<T: Clone>(_x: &T) {}
+ | ^^^^^ required by this bound in `check_clone`
+
+error: aborting due to 12 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/generator/clone-impl-static.rs b/src/test/ui/generator/clone-impl-static.rs
new file mode 100644
index 000000000..55ed0f281
--- /dev/null
+++ b/src/test/ui/generator/clone-impl-static.rs
@@ -0,0 +1,17 @@
+// gate-test-generator_clone
+// Verifies that static generators cannot be cloned/copied.
+
+#![feature(generators, generator_clone)]
+
+fn main() {
+ let gen = static move || {
+ yield;
+ };
+ check_copy(&gen);
+ //~^ ERROR Copy` is not satisfied
+ check_clone(&gen);
+ //~^ ERROR Clone` is not satisfied
+}
+
+fn check_copy<T: Copy>(_x: &T) {}
+fn check_clone<T: Clone>(_x: &T) {}
diff --git a/src/test/ui/generator/clone-impl-static.stderr b/src/test/ui/generator/clone-impl-static.stderr
new file mode 100644
index 000000000..cbadf6f15
--- /dev/null
+++ b/src/test/ui/generator/clone-impl-static.stderr
@@ -0,0 +1,31 @@
+error[E0277]: the trait bound `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]: Copy` is not satisfied
+ --> $DIR/clone-impl-static.rs:10:16
+ |
+LL | check_copy(&gen);
+ | ---------- ^^^^ the trait `Copy` is not implemented for `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl-static.rs:16:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]: Clone` is not satisfied
+ --> $DIR/clone-impl-static.rs:12:17
+ |
+LL | check_clone(&gen);
+ | ----------- ^^^^ the trait `Clone` is not implemented for `[static generator@$DIR/clone-impl-static.rs:7:15: 7:29]`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl-static.rs:17:19
+ |
+LL | fn check_clone<T: Clone>(_x: &T) {}
+ | ^^^^^ required by this bound in `check_clone`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/generator/clone-impl.rs b/src/test/ui/generator/clone-impl.rs
new file mode 100644
index 000000000..cbfd65a53
--- /dev/null
+++ b/src/test/ui/generator/clone-impl.rs
@@ -0,0 +1,73 @@
+// gate-test-generator_clone
+// Verifies that non-static generators can be cloned/copied if all their upvars and locals held
+// across awaits can be cloned/copied.
+
+#![feature(generators, generator_clone)]
+
+struct NonClone;
+
+fn main() {
+ let copyable: u32 = 123;
+ let clonable_0: Vec<u32> = Vec::new();
+ let clonable_1: Vec<u32> = Vec::new();
+ let non_clonable: NonClone = NonClone;
+
+ let gen_copy_0 = move || {
+ yield;
+ drop(copyable);
+ };
+ check_copy(&gen_copy_0);
+ check_clone(&gen_copy_0);
+ let gen_copy_1 = move || {
+ /*
+ let v = vec!['a'];
+ let n = NonClone;
+ drop(v);
+ drop(n);
+ */
+ yield;
+ let v = vec!['a'];
+ let n = NonClone;
+ drop(n);
+ drop(copyable);
+ };
+ check_copy(&gen_copy_1);
+ check_clone(&gen_copy_1);
+ let gen_clone_0 = move || {
+ let v = vec!['a'];
+ yield;
+ drop(v);
+ drop(clonable_0);
+ };
+ check_copy(&gen_clone_0);
+ //~^ ERROR the trait bound `Vec<u32>: Copy` is not satisfied
+ //~| ERROR the trait bound `Vec<char>: Copy` is not satisfied
+ check_clone(&gen_clone_0);
+ let gen_clone_1 = move || {
+ let v = vec!['a'];
+ /*
+ let n = NonClone;
+ drop(n);
+ */
+ yield;
+ let n = NonClone;
+ drop(n);
+ drop(v);
+ drop(clonable_1);
+ };
+ check_copy(&gen_clone_1);
+ //~^ ERROR the trait bound `Vec<u32>: Copy` is not satisfied
+ //~| ERROR the trait bound `Vec<char>: Copy` is not satisfied
+ check_clone(&gen_clone_1);
+ let gen_non_clone = move || {
+ yield;
+ drop(non_clonable);
+ };
+ check_copy(&gen_non_clone);
+ //~^ ERROR the trait bound `NonClone: Copy` is not satisfied
+ check_clone(&gen_non_clone);
+ //~^ ERROR the trait bound `NonClone: Clone` is not satisfied
+}
+
+fn check_copy<T: Copy>(_x: &T) {}
+fn check_clone<T: Clone>(_x: &T) {}
diff --git a/src/test/ui/generator/clone-impl.stderr b/src/test/ui/generator/clone-impl.stderr
new file mode 100644
index 000000000..a92646b19
--- /dev/null
+++ b/src/test/ui/generator/clone-impl.stderr
@@ -0,0 +1,142 @@
+error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
+ --> $DIR/clone-impl.rs:42:16
+ |
+LL | let gen_clone_0 = move || {
+ | ------- within this `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
+...
+LL | check_copy(&gen_clone_0);
+ | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:36:23: 36:30]`, the trait `Copy` is not implemented for `Vec<u32>`
+ |
+note: captured value does not implement `Copy`
+ --> $DIR/clone-impl.rs:40:14
+ |
+LL | drop(clonable_0);
+ | ^^^^^^^^^^ has type `Vec<u32>` which does not implement `Copy`
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl.rs:72:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
+ --> $DIR/clone-impl.rs:42:16
+ |
+LL | let gen_clone_0 = move || {
+ | ------- within this `[generator@$DIR/clone-impl.rs:36:23: 36:30]`
+...
+LL | check_copy(&gen_clone_0);
+ | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:36:23: 36:30]`, the trait `Copy` is not implemented for `Vec<char>`
+ |
+note: generator does not implement `Copy` as this value is used across a yield
+ --> $DIR/clone-impl.rs:38:9
+ |
+LL | let v = vec!['a'];
+ | - has type `Vec<char>` which does not implement `Copy`
+LL | yield;
+ | ^^^^^ yield occurs here, with `v` maybe used later
+...
+LL | };
+ | - `v` is later dropped here
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl.rs:72:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `Vec<u32>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
+ --> $DIR/clone-impl.rs:58:16
+ |
+LL | let gen_clone_1 = move || {
+ | ------- within this `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
+...
+LL | check_copy(&gen_clone_1);
+ | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:46:23: 46:30]`, the trait `Copy` is not implemented for `Vec<u32>`
+ |
+note: captured value does not implement `Copy`
+ --> $DIR/clone-impl.rs:56:14
+ |
+LL | drop(clonable_1);
+ | ^^^^^^^^^^ has type `Vec<u32>` which does not implement `Copy`
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl.rs:72:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `Vec<char>: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
+ --> $DIR/clone-impl.rs:58:16
+ |
+LL | let gen_clone_1 = move || {
+ | ------- within this `[generator@$DIR/clone-impl.rs:46:23: 46:30]`
+...
+LL | check_copy(&gen_clone_1);
+ | ^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:46:23: 46:30]`, the trait `Copy` is not implemented for `Vec<char>`
+ |
+note: generator does not implement `Copy` as this value is used across a yield
+ --> $DIR/clone-impl.rs:52:9
+ |
+LL | let v = vec!['a'];
+ | - has type `Vec<char>` which does not implement `Copy`
+...
+LL | yield;
+ | ^^^^^ yield occurs here, with `v` maybe used later
+...
+LL | };
+ | - `v` is later dropped here
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl.rs:72:18
+ |
+LL | fn check_copy<T: Copy>(_x: &T) {}
+ | ^^^^ required by this bound in `check_copy`
+
+error[E0277]: the trait bound `NonClone: Copy` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
+ --> $DIR/clone-impl.rs:66:16
+ |
+LL | let gen_non_clone = move || {
+ | ------- within this `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
+...
+LL | check_copy(&gen_non_clone);
+ | ^^^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:62:25: 62:32]`, the trait `Copy` is not implemented for `NonClone`
+ |
+note: captured value does not implement `Copy`
+ --> $DIR/clone-impl.rs:64:14
+ |
+LL | drop(non_clonable);
+ | ^^^^^^^^^^^^ has type `NonClone` which does not implement `Copy`
+note: required by a bound in `check_copy`
+ --> $DIR/clone-impl.rs:72:18
+ |
+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)]
+ |
+
+error[E0277]: the trait bound `NonClone: Clone` is not satisfied in `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
+ --> $DIR/clone-impl.rs:68:17
+ |
+LL | let gen_non_clone = move || {
+ | ------- within this `[generator@$DIR/clone-impl.rs:62:25: 62:32]`
+...
+LL | check_clone(&gen_non_clone);
+ | ^^^^^^^^^^^^^^ within `[generator@$DIR/clone-impl.rs:62:25: 62:32]`, the trait `Clone` is not implemented for `NonClone`
+ |
+note: captured value does not implement `Clone`
+ --> $DIR/clone-impl.rs:64:14
+ |
+LL | drop(non_clonable);
+ | ^^^^^^^^^^^^ has type `NonClone` which does not implement `Clone`
+note: required by a bound in `check_clone`
+ --> $DIR/clone-impl.rs:73:19
+ |
+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)]
+ |
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/generator/drop-tracking-parent-expression.stderr b/src/test/ui/generator/drop-tracking-parent-expression.stderr
index 522a300b3..fbf5d6e07 100644
--- a/src/test/ui/generator/drop-tracking-parent-expression.stderr
+++ b/src/test/ui/generator/drop-tracking-parent-expression.stderr
@@ -1,8 +1,8 @@
error: generator cannot be sent between threads safely
- --> $DIR/drop-tracking-parent-expression.rs:24:13
+ --> $DIR/drop-tracking-parent-expression.rs:24:25
|
LL | assert_send(g);
- | ^^^^^^^^^^^ generator is not `Send`
+ | ^ generator is not `Send`
...
LL | / type_combinations!(
LL | | // OK
@@ -41,10 +41,10 @@ LL | fn assert_send<T: Send>(_thing: T) {}
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: generator cannot be sent between threads safely
- --> $DIR/drop-tracking-parent-expression.rs:24:13
+ --> $DIR/drop-tracking-parent-expression.rs:24:25
|
LL | assert_send(g);
- | ^^^^^^^^^^^ generator is not `Send`
+ | ^ generator is not `Send`
...
LL | / type_combinations!(
LL | | // OK
@@ -83,10 +83,10 @@ LL | fn assert_send<T: Send>(_thing: T) {}
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: generator cannot be sent between threads safely
- --> $DIR/drop-tracking-parent-expression.rs:24:13
+ --> $DIR/drop-tracking-parent-expression.rs:24:25
|
LL | assert_send(g);
- | ^^^^^^^^^^^ generator is not `Send`
+ | ^ generator is not `Send`
...
LL | / type_combinations!(
LL | | // OK
diff --git a/src/test/ui/generator/drop-yield-twice.stderr b/src/test/ui/generator/drop-yield-twice.stderr
index 5bc6ea560..0808a2c85 100644
--- a/src/test/ui/generator/drop-yield-twice.stderr
+++ b/src/test/ui/generator/drop-yield-twice.stderr
@@ -1,8 +1,14 @@
error: generator cannot be sent between threads safely
- --> $DIR/drop-yield-twice.rs:7:5
+ --> $DIR/drop-yield-twice.rs:7:17
|
-LL | assert_send(|| {
- | ^^^^^^^^^^^ generator is not `Send`
+LL | assert_send(|| {
+ | _________________^
+LL | | let guard = Foo(42);
+LL | | yield;
+LL | | drop(guard);
+LL | | yield;
+LL | | })
+ | |_____^ generator is not `Send`
|
= help: within `[generator@$DIR/drop-yield-twice.rs:7:17: 7:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield
diff --git a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr
index 2a39a08ee..8f5d2429a 100644
--- a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr
+++ b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr
@@ -1,8 +1,15 @@
error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36] as Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36]`
- --> $DIR/generator-yielding-or-returning-itself.rs:15:5
+ --> $DIR/generator-yielding-or-returning-itself.rs:15:34
|
-LL | want_cyclic_generator_return(|| {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
+LL | want_cyclic_generator_return(|| {
+ | _____----------------------------_^
+ | | |
+ | | required by a bound introduced by this call
+LL | |
+LL | | if false { yield None.unwrap(); }
+LL | | None.unwrap()
+LL | | })
+ | |_____^ cyclic type of infinite size
|
= note: closures cannot capture themselves or take themselves as argument;
this error may be the result of a recent compiler bug-fix,
@@ -17,10 +24,17 @@ LL | where T: Generator<Yield = (), Return = T>
| ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return`
error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35] as Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35]`
- --> $DIR/generator-yielding-or-returning-itself.rs:28:5
+ --> $DIR/generator-yielding-or-returning-itself.rs:28:33
|
-LL | want_cyclic_generator_yield(|| {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
+LL | want_cyclic_generator_yield(|| {
+ | _____---------------------------_^
+ | | |
+ | | required by a bound introduced by this call
+LL | |
+LL | | if false { yield None.unwrap(); }
+LL | | None.unwrap()
+LL | | })
+ | |_____^ cyclic type of infinite size
|
= note: closures cannot capture themselves or take themselves as argument;
this error may be the result of a recent compiler bug-fix,
diff --git a/src/test/ui/generator/issue-102645.rs b/src/test/ui/generator/issue-102645.rs
new file mode 100644
index 000000000..0589c5a00
--- /dev/null
+++ b/src/test/ui/generator/issue-102645.rs
@@ -0,0 +1,23 @@
+// compile-flags: -Zdrop-tracking
+
+#![feature(generators, generator_trait)]
+
+use std::ops::Generator;
+use std::pin::Pin;
+
+fn main() {
+ let mut a = 5;
+ let mut b = || {
+ let d = 6;
+ yield;
+ _zzz(); // #break
+ a = d;
+ };
+ Pin::new(&mut b).resume();
+ //~^ ERROR this function takes 1 argument but 0 arguments were supplied
+ // This type error is required to reproduce the ICE...
+}
+
+fn _zzz() {
+ ()
+}
diff --git a/src/test/ui/generator/issue-102645.stderr b/src/test/ui/generator/issue-102645.stderr
new file mode 100644
index 000000000..7b4d50213
--- /dev/null
+++ b/src/test/ui/generator/issue-102645.stderr
@@ -0,0 +1,19 @@
+error[E0061]: this function takes 1 argument but 0 arguments were supplied
+ --> $DIR/issue-102645.rs:16:22
+ |
+LL | Pin::new(&mut b).resume();
+ | ^^^^^^-- an argument of type `()` is missing
+ |
+note: associated function defined here
+ --> $SRC_DIR/core/src/ops/generator.rs:LL:COL
+ |
+LL | fn resume(self: Pin<&mut Self>, arg: R) -> GeneratorState<Self::Yield, Self::Return>;
+ | ^^^^^^
+help: provide the argument
+ |
+LL | Pin::new(&mut b).resume(());
+ | ~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/src/test/ui/generator/issue-52398.stderr b/src/test/ui/generator/issue-52398.stderr
index 3f8ebb5a7..30a6732f7 100644
--- a/src/test/ui/generator/issue-52398.stderr
+++ b/src/test/ui/generator/issue-52398.stderr
@@ -6,8 +6,8 @@ LL | | A.test(yield);
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: unused generator that must be used
--> $DIR/issue-52398.rs:24:5
diff --git a/src/test/ui/generator/issue-57084.stderr b/src/test/ui/generator/issue-57084.stderr
index 32a04f94d..29aca9440 100644
--- a/src/test/ui/generator/issue-57084.stderr
+++ b/src/test/ui/generator/issue-57084.stderr
@@ -9,8 +9,8 @@ LL | | }
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generator/issue-68112.rs b/src/test/ui/generator/issue-68112.rs
index 3fcef773b..21026f45c 100644
--- a/src/test/ui/generator/issue-68112.rs
+++ b/src/test/ui/generator/issue-68112.rs
@@ -63,7 +63,8 @@ fn test2() {
require_send(send_gen);
//~^ ERROR `RefCell<i32>` cannot be shared between threads safely
//~| NOTE `RefCell<i32>` cannot be shared between threads safely
- //~| NOTE requirements on the impl
+ //~| NOTE required for
+ //~| NOTE required by a bound introduced by this call
//~| NOTE captures the following types
}
diff --git a/src/test/ui/generator/issue-68112.stderr b/src/test/ui/generator/issue-68112.stderr
index 1d5b97e98..eb99d42c9 100644
--- a/src/test/ui/generator/issue-68112.stderr
+++ b/src/test/ui/generator/issue-68112.stderr
@@ -1,8 +1,8 @@
error: generator cannot be sent between threads safely
- --> $DIR/issue-68112.rs:40:5
+ --> $DIR/issue-68112.rs:40:18
|
LL | require_send(send_gen);
- | ^^^^^^^^^^^^ generator is not `Send`
+ | ^^^^^^^^ generator is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
note: generator is not `Send` as this value is used across a yield
@@ -23,13 +23,15 @@ LL | fn require_send(_: impl Send) {}
| ^^^^ required by this bound in `require_send`
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
- --> $DIR/issue-68112.rs:63:5
+ --> $DIR/issue-68112.rs:63:18
|
LL | require_send(send_gen);
- | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
+ | ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
- = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>`
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it's used within this generator
--> $DIR/issue-68112.rs:48:5
|
diff --git a/src/test/ui/generator/match-bindings.stderr b/src/test/ui/generator/match-bindings.stderr
index 4fd1e26f0..b911b6661 100644
--- a/src/test/ui/generator/match-bindings.stderr
+++ b/src/test/ui/generator/match-bindings.stderr
@@ -10,8 +10,8 @@ LL | | }
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generator/not-send-sync.stderr b/src/test/ui/generator/not-send-sync.stderr
index 0b31bb4fd..a821c57b9 100644
--- a/src/test/ui/generator/not-send-sync.stderr
+++ b/src/test/ui/generator/not-send-sync.stderr
@@ -1,11 +1,18 @@
error[E0277]: `Cell<i32>` cannot be shared between threads safely
- --> $DIR/not-send-sync.rs:16:5
+ --> $DIR/not-send-sync.rs:16:17
|
-LL | assert_send(|| {
- | ^^^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
+LL | assert_send(|| {
+ | _____-----------_^
+ | | |
+ | | required by a bound introduced by this call
+LL | |
+LL | | drop(&a);
+LL | | yield;
+LL | | });
+ | |_____^ `Cell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
- = note: required because of the requirements on the impl of `Send` for `&Cell<i32>`
+ = note: required for `&Cell<i32>` to implement `Send`
note: required because it's used within this generator
--> $DIR/not-send-sync.rs:16:17
|
@@ -18,10 +25,15 @@ LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: generator cannot be shared between threads safely
- --> $DIR/not-send-sync.rs:9:5
- |
-LL | assert_sync(|| {
- | ^^^^^^^^^^^ generator is not `Sync`
+ --> $DIR/not-send-sync.rs:9:17
+ |
+LL | assert_sync(|| {
+ | _________________^
+LL | |
+LL | | let a = Cell::new(2);
+LL | | yield;
+LL | | });
+ | |_____^ generator is not `Sync`
|
= help: within `[generator@$DIR/not-send-sync.rs:9:17: 9:19]`, the trait `Sync` is not implemented for `Cell<i32>`
note: generator is not `Sync` as this value is used across a yield
diff --git a/src/test/ui/generator/panic-drops-resume.rs b/src/test/ui/generator/panic-drops-resume.rs
index 8d8eb6a97..4c3caeb14 100644
--- a/src/test/ui/generator/panic-drops-resume.rs
+++ b/src/test/ui/generator/panic-drops-resume.rs
@@ -2,8 +2,6 @@
// run-pass
// needs-unwind
-// ignore-wasm no unwind support
-// ignore-emscripten no unwind support
#![feature(generators, generator_trait)]
diff --git a/src/test/ui/generator/panic-drops.rs b/src/test/ui/generator/panic-drops.rs
index a9de4e7fc..65001fd87 100644
--- a/src/test/ui/generator/panic-drops.rs
+++ b/src/test/ui/generator/panic-drops.rs
@@ -1,7 +1,6 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
diff --git a/src/test/ui/generator/panic-safe.rs b/src/test/ui/generator/panic-safe.rs
index 14a0c8dba..3db80bb58 100644
--- a/src/test/ui/generator/panic-safe.rs
+++ b/src/test/ui/generator/panic-safe.rs
@@ -1,7 +1,6 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
diff --git a/src/test/ui/generator/partial-drop.stderr b/src/test/ui/generator/partial-drop.stderr
index 1004fc64d..9baafe54e 100644
--- a/src/test/ui/generator/partial-drop.stderr
+++ b/src/test/ui/generator/partial-drop.stderr
@@ -1,8 +1,15 @@
error: generator cannot be sent between threads safely
- --> $DIR/partial-drop.rs:14:5
+ --> $DIR/partial-drop.rs:14:17
|
-LL | assert_send(|| {
- | ^^^^^^^^^^^ generator is not `Send`
+LL | assert_send(|| {
+ | _________________^
+LL | |
+LL | | // FIXME: it would be nice to make this work.
+LL | | let guard = Bar { foo: Foo, x: 42 };
+LL | | drop(guard.foo);
+LL | | yield;
+LL | | });
+ | |_____^ generator is not `Send`
|
= help: within `[generator@$DIR/partial-drop.rs:14:17: 14:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield
@@ -22,10 +29,17 @@ LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: generator cannot be sent between threads safely
- --> $DIR/partial-drop.rs:22:5
+ --> $DIR/partial-drop.rs:22:17
|
-LL | assert_send(|| {
- | ^^^^^^^^^^^ generator is not `Send`
+LL | assert_send(|| {
+ | _________________^
+LL | |
+LL | | // FIXME: it would be nice to make this work.
+LL | | let guard = Bar { foo: Foo, x: 42 };
+... |
+LL | | yield;
+LL | | });
+ | |_____^ generator is not `Send`
|
= help: within `[generator@$DIR/partial-drop.rs:22:17: 22:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield
@@ -45,10 +59,17 @@ LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: generator cannot be sent between threads safely
- --> $DIR/partial-drop.rs:32:5
+ --> $DIR/partial-drop.rs:32:17
|
-LL | assert_send(|| {
- | ^^^^^^^^^^^ generator is not `Send`
+LL | assert_send(|| {
+ | _________________^
+LL | |
+LL | | // FIXME: it would be nice to make this work.
+LL | | let guard = Bar { foo: Foo, x: 42 };
+... |
+LL | | yield;
+LL | | });
+ | |_____^ generator is not `Send`
|
= help: within `[generator@$DIR/partial-drop.rs:32:17: 32:19]`, the trait `Send` is not implemented for `Foo`
note: generator is not `Send` as this value is used across a yield
diff --git a/src/test/ui/generator/print/generator-print-verbose-1.stderr b/src/test/ui/generator/print/generator-print-verbose-1.stderr
index 5b61f1e8f..2e0207804 100644
--- a/src/test/ui/generator/print/generator-print-verbose-1.stderr
+++ b/src/test/ui/generator/print/generator-print-verbose-1.stderr
@@ -1,15 +1,15 @@
error: generator cannot be sent between threads safely
- --> $DIR/generator-print-verbose-1.rs:37:5
+ --> $DIR/generator-print-verbose-1.rs:37:18
|
LL | require_send(send_gen);
- | ^^^^^^^^^^^^ generator is not `Send`
+ | ^^^^^^^^ generator is not `Send`
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
note: generator is not `Send` as this value is used across a yield
--> $DIR/generator-print-verbose-1.rs:35:9
|
LL | let _non_send_gen = make_non_send_generator();
- | ------------- has type `Opaque(DefId(0:34 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
+ | ------------- has type `Opaque(DefId(0:44 ~ generator_print_verbose_1[749a]::make_non_send_generator::{opaque#0}), [])` which is not `Send`
LL | yield;
| ^^^^^ yield occurs here, with `_non_send_gen` maybe used later
LL | };
@@ -21,29 +21,31 @@ LL | fn require_send(_: impl Send) {}
| ^^^^ required by this bound in `require_send`
error[E0277]: `RefCell<i32>` cannot be shared between threads safely
- --> $DIR/generator-print-verbose-1.rs:56:5
+ --> $DIR/generator-print-verbose-1.rs:56:18
|
LL | require_send(send_gen);
- | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
+ | ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `RefCell<i32>`
- = note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>`
+ = note: required for `Arc<RefCell<i32>>` to implement `Send`
note: required because it's used within this generator
--> $DIR/generator-print-verbose-1.rs:42:5
|
LL | || {
| ^^
-note: required because it appears within the type `Opaque(DefId(0:39 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])`
+note: required because it appears within the type `Opaque(DefId(0:45 ~ generator_print_verbose_1[749a]::make_gen2::{opaque#0}), [std::sync::Arc<std::cell::RefCell<i32>>])`
--> $DIR/generator-print-verbose-1.rs:41:30
|
LL | pub fn make_gen2<T>(t: T) -> impl Generator<Return = T> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: required because it appears within the type `Opaque(DefId(0:42 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`
+note: required because it appears within the type `Opaque(DefId(0:46 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`
--> $DIR/generator-print-verbose-1.rs:47:34
|
LL | fn make_non_send_generator2() -> impl Generator<Return = Arc<RefCell<i32>>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: required because it captures the following types: `Opaque(DefId(0:42 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()`
+ = note: required because it captures the following types: `Opaque(DefId(0:46 ~ generator_print_verbose_1[749a]::make_non_send_generator2::{opaque#0}), [])`, `()`
note: required because it's used within this generator
--> $DIR/generator-print-verbose-1.rs:52:20
|
diff --git a/src/test/ui/generator/print/generator-print-verbose-2.stderr b/src/test/ui/generator/print/generator-print-verbose-2.stderr
index eb79d2e6e..909e49c38 100644
--- a/src/test/ui/generator/print/generator-print-verbose-2.stderr
+++ b/src/test/ui/generator/print/generator-print-verbose-2.stderr
@@ -1,11 +1,18 @@
error[E0277]: `Cell<i32>` cannot be shared between threads safely
- --> $DIR/generator-print-verbose-2.rs:19:5
+ --> $DIR/generator-print-verbose-2.rs:19:17
|
-LL | assert_send(|| {
- | ^^^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
+LL | assert_send(|| {
+ | _____-----------_^
+ | | |
+ | | required by a bound introduced by this call
+LL | |
+LL | | drop(&a);
+LL | | yield;
+LL | | });
+ | |_____^ `Cell<i32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
- = note: required because of the requirements on the impl of `Send` for `&'_#4r Cell<i32>`
+ = note: required for `&'_#4r Cell<i32>` to implement `Send`
note: required because it's used within this generator
--> $DIR/generator-print-verbose-2.rs:19:17
|
@@ -18,10 +25,15 @@ LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: generator cannot be shared between threads safely
- --> $DIR/generator-print-verbose-2.rs:12:5
- |
-LL | assert_sync(|| {
- | ^^^^^^^^^^^ generator is not `Sync`
+ --> $DIR/generator-print-verbose-2.rs:12:17
+ |
+LL | assert_sync(|| {
+ | _________________^
+LL | |
+LL | | let a = Cell::new(2);
+LL | | yield;
+LL | | });
+ | |_____^ generator is not `Sync`
|
= help: within `[main::{closure#0} upvar_tys=() {Cell<i32>, ()}]`, the trait `Sync` is not implemented for `Cell<i32>`
note: generator is not `Sync` as this value is used across a yield
diff --git a/src/test/ui/generator/reborrow-mut-upvar.stderr b/src/test/ui/generator/reborrow-mut-upvar.stderr
index ff511b766..e83dbf833 100644
--- a/src/test/ui/generator/reborrow-mut-upvar.stderr
+++ b/src/test/ui/generator/reborrow-mut-upvar.stderr
@@ -10,8 +10,8 @@ LL | | *bar = 2;
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generator/resume-after-return.rs b/src/test/ui/generator/resume-after-return.rs
index 538609b98..01a059a16 100644
--- a/src/test/ui/generator/resume-after-return.rs
+++ b/src/test/ui/generator/resume-after-return.rs
@@ -1,7 +1,6 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait)]
diff --git a/src/test/ui/generator/size-moved-locals.rs b/src/test/ui/generator/size-moved-locals.rs
index 3c756a86f..601a31418 100644
--- a/src/test/ui/generator/size-moved-locals.rs
+++ b/src/test/ui/generator/size-moved-locals.rs
@@ -12,6 +12,7 @@
// edition:2018
// ignore-wasm32 issue #62807
// ignore-asmjs issue #62807
+// needs-unwind Size of Closures change on panic=abort
#![feature(generators, generator_trait)]
diff --git a/src/test/ui/generator/too-live-local-in-immovable-gen.stderr b/src/test/ui/generator/too-live-local-in-immovable-gen.stderr
index 72a2bd4eb..5cb43067f 100644
--- a/src/test/ui/generator/too-live-local-in-immovable-gen.stderr
+++ b/src/test/ui/generator/too-live-local-in-immovable-gen.stderr
@@ -10,8 +10,8 @@ LL | | let _ = &a;
LL | | };
| |__________^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generator/type-mismatch-signature-deduction.stderr b/src/test/ui/generator/type-mismatch-signature-deduction.stderr
index 7938fc809..b98da1ed8 100644
--- a/src/test/ui/generator/type-mismatch-signature-deduction.stderr
+++ b/src/test/ui/generator/type-mismatch-signature-deduction.stderr
@@ -11,6 +11,12 @@ note: return type inferred to be `Result<{integer}, _>` here
|
LL | return Ok(6);
| ^^^^^
+help: try wrapping the expression in a variant of `Result`
+ |
+LL | Ok(5)
+ | +++ +
+LL | Err(5)
+ | ++++ +
error[E0271]: type mismatch resolving `<[generator@$DIR/type-mismatch-signature-deduction.rs:7:5: 7:7] as Generator>::Return == i32`
--> $DIR/type-mismatch-signature-deduction.rs:5:13
diff --git a/src/test/ui/generator/yield-in-args-rev.stderr b/src/test/ui/generator/yield-in-args-rev.stderr
index a575bf886..c9e1ab722 100644
--- a/src/test/ui/generator/yield-in-args-rev.stderr
+++ b/src/test/ui/generator/yield-in-args-rev.stderr
@@ -7,8 +7,8 @@ LL | | foo(yield, &b);
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generator/yield-in-box.stderr b/src/test/ui/generator/yield-in-box.stderr
index 7602e8039..8587e1dc6 100644
--- a/src/test/ui/generator/yield-in-box.stderr
+++ b/src/test/ui/generator/yield-in-box.stderr
@@ -10,8 +10,8 @@ LL | | }
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generator/yield-in-initializer.stderr b/src/test/ui/generator/yield-in-initializer.stderr
index e79047ae7..07de24662 100644
--- a/src/test/ui/generator/yield-in-initializer.stderr
+++ b/src/test/ui/generator/yield-in-initializer.stderr
@@ -10,8 +10,8 @@ LL | | }
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generator/yield-outside-generator-issue-78653.stderr b/src/test/ui/generator/yield-outside-generator-issue-78653.stderr
index ee1afbe5b..dcfb21174 100644
--- a/src/test/ui/generator/yield-outside-generator-issue-78653.stderr
+++ b/src/test/ui/generator/yield-outside-generator-issue-78653.stderr
@@ -12,7 +12,7 @@ LL | yield || for i in 0 { }
|
= help: the trait `Iterator` is not implemented for `{integer}`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `{integer}`
+ = note: required for `{integer}` to implement `IntoIterator`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/generator/yield-subtype.stderr b/src/test/ui/generator/yield-subtype.stderr
index bded36a4c..fe10477bf 100644
--- a/src/test/ui/generator/yield-subtype.stderr
+++ b/src/test/ui/generator/yield-subtype.stderr
@@ -7,8 +7,8 @@ LL | | yield b;
LL | | };
| |______^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/generic-associated-types/anonymize-bound-vars.rs b/src/test/ui/generic-associated-types/anonymize-bound-vars.rs
index 1ec9c6998..eb7a12412 100644
--- a/src/test/ui/generic-associated-types/anonymize-bound-vars.rs
+++ b/src/test/ui/generic-associated-types/anonymize-bound-vars.rs
@@ -1,7 +1,6 @@
// check-pass
//
// regression test for #98702
-#![feature(generic_associated_types)]
trait Foo {
type Assoc<T>;
diff --git a/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs b/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs
index 0e8e14852..21a9b3b89 100644
--- a/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs
+++ b/src/test/ui/generic-associated-types/auxiliary/foo_defn.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
use std::{future::Future, pin::Pin};
pub trait Foo {
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs
new file mode 100644
index 000000000..719d1bd5a
--- /dev/null
+++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.rs
@@ -0,0 +1,35 @@
+// check-fail
+// known-bug
+
+// This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for
+// all 'a where I::Item<'a> is WF", but really means "for all 'a possible"
+
+use std::fmt::Debug;
+
+pub trait LendingIterator {
+ type Item<'this>
+ where
+ Self: 'this;
+}
+
+pub struct WindowsMut<'x> {
+ slice: &'x (),
+}
+
+impl<'y> LendingIterator for WindowsMut<'y> {
+ type Item<'this> = &'this mut () where 'y: 'this;
+}
+
+fn print_items<I>(_iter: I)
+where
+ I: LendingIterator,
+ for<'a> I::Item<'a>: Debug,
+{
+}
+
+fn main() {
+ let slice = &mut ();
+ //~^ temporary value dropped while borrowed
+ let windows = WindowsMut { slice };
+ print_items::<WindowsMut<'_>>(windows);
+}
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr
new file mode 100644
index 000000000..414999881
--- /dev/null
+++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-1.stderr
@@ -0,0 +1,20 @@
+error[E0716]: temporary value dropped while borrowed
+ --> $DIR/hrtb-implied-1.rs:31:22
+ |
+LL | let slice = &mut ();
+ | ^^ creates a temporary which is freed while still in use
+...
+LL | print_items::<WindowsMut<'_>>(windows);
+ | -------------------------------------- argument requires that borrow lasts for `'static`
+LL | }
+ | - temporary value is freed at the end of this statement
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/hrtb-implied-1.rs:26:26
+ |
+LL | for<'a> I::Item<'a>: Debug,
+ | ^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs
new file mode 100644
index 000000000..8e6c5348e
--- /dev/null
+++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.rs
@@ -0,0 +1,40 @@
+// check-fail
+// known-bug
+
+// This gives us problems because `for<'a> I::Item<'a>: Debug` should mean "for
+// all 'a where I::Item<'a> is WF", but really means "for all 'a possible"
+
+trait LendingIterator: Sized {
+ type Item<'a>
+ where
+ Self: 'a;
+ fn next(&mut self) -> Self::Item<'_>;
+}
+fn fails<I: LendingIterator, F>(iter: &mut I, f: F) -> bool
+where
+ F: FnMut(I::Item<'_>),
+{
+ let mut iter2 = Eat(iter, f);
+ let _next = iter2.next();
+ //~^ borrowed data escapes
+ true
+}
+impl<I: LendingIterator> LendingIterator for &mut I {
+ type Item<'a> = I::Item<'a> where Self:'a;
+ fn next(&mut self) -> Self::Item<'_> {
+ (**self).next()
+ }
+}
+
+struct Eat<I, F>(I, F);
+impl<I: LendingIterator, F> Iterator for Eat<I, F>
+where
+ F: FnMut(I::Item<'_>),
+{
+ type Item = ();
+ fn next(&mut self) -> Option<Self::Item> {
+ None
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr
new file mode 100644
index 000000000..1ee270398
--- /dev/null
+++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-2.stderr
@@ -0,0 +1,22 @@
+error[E0521]: borrowed data escapes outside of function
+ --> $DIR/hrtb-implied-2.rs:18:17
+ |
+LL | fn fails<I: LendingIterator, F>(iter: &mut I, f: F) -> bool
+ | ---- - let's call the lifetime of this reference `'1`
+ | |
+ | `iter` is a reference that is only valid in the function body
+...
+LL | let _next = iter2.next();
+ | ^^^^^^^^^^^^
+ | |
+ | `iter` escapes the function body here
+ | argument requires that `'1` must outlive `'static`
+ |
+ = note: requirement occurs because of a mutable reference to `Eat<&mut I, F>`
+ = note: mutable references are invariant over their type parameter
+ = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
+ = note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs
new file mode 100644
index 000000000..bc9e6c8ae
--- /dev/null
+++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs
@@ -0,0 +1,23 @@
+trait LendingIterator {
+ type Item<'a>
+ where
+ Self: 'a;
+}
+
+impl LendingIterator for &str {
+ type Item<'a> = () where Self:'a;
+}
+
+fn trivial_bound<I>(_: I)
+where
+ I: LendingIterator,
+ for<'a> I::Item<'a>: Sized,
+{
+}
+
+fn fails(iter: &str) {
+ trivial_bound(iter);
+ //~^ borrowed data escapes
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr
new file mode 100644
index 000000000..c67e02437
--- /dev/null
+++ b/src/test/ui/generic-associated-types/bugs/hrtb-implied-3.stderr
@@ -0,0 +1,22 @@
+error[E0521]: borrowed data escapes outside of function
+ --> $DIR/hrtb-implied-3.rs:19:5
+ |
+LL | fn fails(iter: &str) {
+ | ---- - let's call the lifetime of this reference `'1`
+ | |
+ | `iter` is a reference that is only valid in the function body
+LL | trivial_bound(iter);
+ | ^^^^^^^^^^^^^^^^^^^
+ | |
+ | `iter` escapes the function body here
+ | argument requires that `'1` must outlive `'static`
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/hrtb-implied-3.rs:14:26
+ |
+LL | for<'a> I::Item<'a>: Sized,
+ | ^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0521`.
diff --git a/src/test/ui/generic-associated-types/bugs/issue-80626.rs b/src/test/ui/generic-associated-types/bugs/issue-80626.rs
index 14f27aff1..f6aa6b36e 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-80626.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-80626.rs
@@ -3,8 +3,6 @@
// This should pass, but it requires `Sized` to be coinductive.
-#![feature(generic_associated_types)]
-
trait Allocator {
type Allocated<T>;
}
diff --git a/src/test/ui/generic-associated-types/bugs/issue-80626.stderr b/src/test/ui/generic-associated-types/bugs/issue-80626.stderr
index 487b83dfa..9a0f332ed 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-80626.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-80626.stderr
@@ -1,11 +1,11 @@
error[E0275]: overflow evaluating the requirement `LinkedList<A>: Sized`
- --> $DIR/issue-80626.rs:14:10
+ --> $DIR/issue-80626.rs:12:10
|
LL | Next(A::Allocated<Self>)
| ^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `Allocator::Allocated`
- --> $DIR/issue-80626.rs:9:20
+ --> $DIR/issue-80626.rs:7:20
|
LL | type Allocated<T>;
| ^ required by this bound in `Allocator::Allocated`
diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr b/src/test/ui/generic-associated-types/bugs/issue-86218.stderr
deleted file mode 100644
index fbf1c8f95..000000000
--- a/src/test/ui/generic-associated-types/bugs/issue-86218.stderr
+++ /dev/null
@@ -1,23 +0,0 @@
-error[E0477]: the type `<() as Yay<&'a ()>>::InnerStream<'s>` does not fulfill the required lifetime
- --> $DIR/issue-86218.rs:23:28
- |
-LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
-note: type must outlive the lifetime `'s` as defined here as required by this binding
- --> $DIR/issue-86218.rs:23:22
- |
-LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
- | ^^
-
-error: unconstrained opaque type
- --> $DIR/issue-86218.rs:23:28
- |
-LL | type InnerStream<'s> = impl Stream<Item = i32> + 's;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `InnerStream` must be used in combination with a concrete type within the same module
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0477`.
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87735.rs b/src/test/ui/generic-associated-types/bugs/issue-87735.rs
index 0844d84c3..80737a798 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-87735.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-87735.rs
@@ -3,8 +3,6 @@
// This should pass, but we need an extension of implied bounds (probably).
-#![feature(generic_associated_types)]
-
pub trait AsRef2 {
type Output<'a> where Self: 'a;
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87735.stderr b/src/test/ui/generic-associated-types/bugs/issue-87735.stderr
index 0a18b5f0c..ebe2054ce 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-87735.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-87735.stderr
@@ -1,5 +1,5 @@
error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-87735.rs:27:13
+ --> $DIR/issue-87735.rs:25:13
|
LL | impl<'b, T, U> AsRef2 for Foo<T>
| ^ unconstrained type parameter
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87748.rs b/src/test/ui/generic-associated-types/bugs/issue-87748.rs
deleted file mode 100644
index a3d00ee03..000000000
--- a/src/test/ui/generic-associated-types/bugs/issue-87748.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-// check-fail
-// known-bug: #87748
-
-// This should pass, but unnormalized input args aren't treated as implied.
-
-#![feature(generic_associated_types)]
-
-trait MyTrait {
- type Assoc<'a, 'b> where 'b: 'a;
- fn do_sth(arg: Self::Assoc<'_, '_>);
-}
-
-struct Foo;
-
-impl MyTrait for Foo {
- type Assoc<'a, 'b> = u32 where 'b: 'a;
-
- fn do_sth(_: u32) {}
- // fn do_sth(_: Self::Assoc<'static, 'static>) {}
- // fn do_sth(_: Self::Assoc<'_, '_>) {}
-}
-
-fn main() {}
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87748.stderr b/src/test/ui/generic-associated-types/bugs/issue-87748.stderr
deleted file mode 100644
index ac197dfe6..000000000
--- a/src/test/ui/generic-associated-types/bugs/issue-87748.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error[E0478]: lifetime bound not satisfied
- --> $DIR/issue-87748.rs:18:5
- |
-LL | fn do_sth(_: u32) {}
- | ^^^^^^^^^^^^^^^^^
- |
-note: lifetime parameter instantiated with the anonymous lifetime as defined here
- --> $DIR/issue-87748.rs:18:5
- |
-LL | fn do_sth(_: u32) {}
- | ^^^^^^^^^^^^^^^^^
-note: but lifetime parameter must outlive the anonymous lifetime as defined here
- --> $DIR/issue-87748.rs:18:5
- |
-LL | fn do_sth(_: u32) {}
- | ^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0478`.
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87755.rs b/src/test/ui/generic-associated-types/bugs/issue-87755.rs
index efa487d62..cda722d2f 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-87755.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-87755.rs
@@ -3,8 +3,6 @@
// This should pass.
-#![feature(generic_associated_types)]
-
use std::fmt::Debug;
trait Foo {
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87755.stderr b/src/test/ui/generic-associated-types/bugs/issue-87755.stderr
index 5d1aff011..5e94db9b0 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-87755.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-87755.stderr
@@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `<Bar as Foo>::Ass == _`
- --> $DIR/issue-87755.rs:18:16
+ --> $DIR/issue-87755.rs:16:16
|
LL | type Ass = Bar;
| ^^^
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87803.rs b/src/test/ui/generic-associated-types/bugs/issue-87803.rs
index a8a111c99..56237e387 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-87803.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-87803.rs
@@ -4,8 +4,6 @@
// This should pass, but using a type alias vs a reference directly
// changes late-bound -> early-bound.
-#![feature(generic_associated_types)]
-
trait Scanner {
type Input<'a>;
type Token<'a>;
diff --git a/src/test/ui/generic-associated-types/bugs/issue-87803.stderr b/src/test/ui/generic-associated-types/bugs/issue-87803.stderr
index c81c051d3..fe2abdedb 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-87803.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-87803.stderr
@@ -1,5 +1,5 @@
error[E0195]: lifetime parameters or bounds on method `scan` do not match the trait declaration
- --> $DIR/issue-87803.rs:22:12
+ --> $DIR/issue-87803.rs:20:12
|
LL | fn scan<'a>(&mut self, i : Self::Input<'a>) -> Self::Token<'a>;
| ---- lifetimes in impl do not match this method in trait
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88382.rs b/src/test/ui/generic-associated-types/bugs/issue-88382.rs
index 5493b9b93..8f8cc4523 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88382.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-88382.rs
@@ -3,8 +3,6 @@
// This should pass, but has a missed normalization due to HRTB.
-#![feature(generic_associated_types)]
-
trait Iterable {
type Iterator<'a> where Self: 'a;
fn iter(&self) -> Self::Iterator<'_>;
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr
index 7210895b7..a9a70bb71 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88382.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-88382.stderr
@@ -1,5 +1,5 @@
error[E0631]: type mismatch in function arguments
- --> $DIR/issue-88382.rs:28:40
+ --> $DIR/issue-88382.rs:26:40
|
LL | do_something(SomeImplementation(), test);
| ------------ ^^^^ expected due to this
@@ -9,10 +9,10 @@ LL | do_something(SomeImplementation(), test);
LL | fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {}
| ------------------------------------------------- found signature defined here
|
- = note: expected function signature `for<'r> fn(&'r mut std::iter::Empty<usize>) -> _`
- found function signature `for<'a, 'r> fn(&'r mut <_ as Iterable>::Iterator<'a>) -> _`
+ = note: expected function signature `for<'a> fn(&'a mut std::iter::Empty<usize>) -> _`
+ found function signature `for<'a, 'b> fn(&'b mut <_ as Iterable>::Iterator<'a>) -> _`
note: required by a bound in `do_something`
- --> $DIR/issue-88382.rs:22:48
+ --> $DIR/issue-88382.rs:20:48
|
LL | fn do_something<I: Iterable>(i: I, mut f: impl for<'a> Fn(&mut I::Iterator<'a>)) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `do_something`
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88460.rs b/src/test/ui/generic-associated-types/bugs/issue-88460.rs
index f1c3b2269..224e696ad 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88460.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-88460.rs
@@ -3,8 +3,6 @@
// This should pass, but has a missed normalization due to HRTB.
-#![feature(generic_associated_types)]
-
pub trait Marker {}
pub trait Trait {
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88460.stderr b/src/test/ui/generic-associated-types/bugs/issue-88460.stderr
index 98c304cc9..6612c4b49 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88460.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-88460.stderr
@@ -1,12 +1,14 @@
error[E0277]: the trait bound `for<'a> <_ as Trait>::Assoc<'a>: Marker` is not satisfied
- --> $DIR/issue-88460.rs:30:5
+ --> $DIR/issue-88460.rs:28:10
|
LL | test(Foo);
- | ^^^^ the trait `for<'a> Marker` is not implemented for `<_ as Trait>::Assoc<'a>`
+ | ---- ^^^ the trait `for<'a> Marker` is not implemented for `<_ as Trait>::Assoc<'a>`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Marker` is implemented for `()`
note: required by a bound in `test`
- --> $DIR/issue-88460.rs:17:27
+ --> $DIR/issue-88460.rs:15:27
|
LL | fn test<T>(value: T)
| ---- required by a bound in this
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88526.rs b/src/test/ui/generic-associated-types/bugs/issue-88526.rs
index 15363ad04..99397744f 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88526.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-88526.rs
@@ -3,8 +3,6 @@
// This should pass, but requires more logic.
-#![feature(generic_associated_types)]
-
trait A {
type I<'a>;
}
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88526.stderr b/src/test/ui/generic-associated-types/bugs/issue-88526.stderr
index 127c889bf..56857c655 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88526.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-88526.stderr
@@ -1,5 +1,5 @@
error[E0207]: the type parameter `I` is not constrained by the impl trait, self type, or predicates
- --> $DIR/issue-88526.rs:27:13
+ --> $DIR/issue-88526.rs:25:13
|
LL | impl<'q, Q, I, F> A for TestB<Q, F>
| ^ unconstrained type parameter
diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr b/src/test/ui/generic-associated-types/bugs/issue-89008.stderr
deleted file mode 100644
index 50844fdc1..000000000
--- a/src/test/ui/generic-associated-types/bugs/issue-89008.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0271]: type mismatch resolving `<Empty<_> as Stream>::Item == Repr`
- --> $DIR/issue-89008.rs:39:43
- |
-LL | fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
- | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Empty<_> as Stream>::Item == Repr`
- | |
- | this type parameter
- |
-note: expected this to be `()`
- --> $DIR/issue-89008.rs:18:17
- |
-LL | type Item = ();
- | ^^
- = note: expected unit type `()`
- found type parameter `Repr`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0271`.
diff --git a/src/test/ui/generic-associated-types/issue-91762.rs b/src/test/ui/generic-associated-types/bugs/issue-91762.rs
index b259a3c6e..dec668bec 100644
--- a/src/test/ui/generic-associated-types/issue-91762.rs
+++ b/src/test/ui/generic-associated-types/bugs/issue-91762.rs
@@ -1,13 +1,12 @@
// check-fail
+// known-bug
-// FIXME(generic_associated_types): We almost certaintly want this to pass, but
+// We almost certainly want this to pass, but
// it's particularly difficult currently, because we need a way of specifying
// that `<Self::Base as Functor>::With<T> = Self` without using that when we have
// a `U`. See `https://github.com/rust-lang/rust/pull/92728` for a (hacky)
// solution. This might be better to just wait for Chalk.
-#![feature(generic_associated_types)]
-
pub trait Functor {
type With<T>;
diff --git a/src/test/ui/generic-associated-types/issue-91762.stderr b/src/test/ui/generic-associated-types/bugs/issue-91762.stderr
index c2785fee3..1272c8b8a 100644
--- a/src/test/ui/generic-associated-types/issue-91762.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-91762.stderr
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
- --> $DIR/issue-91762.rs:25:15
+ --> $DIR/issue-91762.rs:24:15
|
LL | ret = <Self::Base as Functor>::fmap(arg);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the associated function `fmap`
diff --git a/src/test/ui/generic-associated-types/collections-project-default.rs b/src/test/ui/generic-associated-types/collections-project-default.rs
index 157e1b1d2..e08aa18cf 100644
--- a/src/test/ui/generic-associated-types/collections-project-default.rs
+++ b/src/test/ui/generic-associated-types/collections-project-default.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
// A Collection trait and collection families. Based on
diff --git a/src/test/ui/generic-associated-types/collections-project-default.stderr b/src/test/ui/generic-associated-types/collections-project-default.stderr
index 22fbc0271..5701017dc 100644
--- a/src/test/ui/generic-associated-types/collections-project-default.stderr
+++ b/src/test/ui/generic-associated-types/collections-project-default.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/collections-project-default.rs:59:5
+ --> $DIR/collections-project-default.rs:58:5
|
LL | fn floatify_sibling<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
| ------------------------------------ expected `<C as Collection<i32>>::Sibling<f32>` because of return type
diff --git a/src/test/ui/generic-associated-types/collections.rs b/src/test/ui/generic-associated-types/collections.rs
index 1c00aa73f..15f429afb 100644
--- a/src/test/ui/generic-associated-types/collections.rs
+++ b/src/test/ui/generic-associated-types/collections.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
// A Collection trait and collection families. Based on
diff --git a/src/test/ui/generic-associated-types/collectivity-regression.rs b/src/test/ui/generic-associated-types/collectivity-regression.rs
index fb7368439..54154f9d1 100644
--- a/src/test/ui/generic-associated-types/collectivity-regression.rs
+++ b/src/test/ui/generic-associated-types/collectivity-regression.rs
@@ -1,7 +1,5 @@
// Regression test from https://github.com/rust-lang/rust/pull/98109
-#![feature(generic_associated_types)]
-
pub trait Get {
type Value<'a>
where
diff --git a/src/test/ui/generic-associated-types/collectivity-regression.stderr b/src/test/ui/generic-associated-types/collectivity-regression.stderr
index a858dd7fd..1dbe1e2cb 100644
--- a/src/test/ui/generic-associated-types/collectivity-regression.stderr
+++ b/src/test/ui/generic-associated-types/collectivity-regression.stderr
@@ -1,5 +1,5 @@
error: `T` does not live long enough
- --> $DIR/collectivity-regression.rs:15:5
+ --> $DIR/collectivity-regression.rs:13:5
|
LL | / || {
LL | |
diff --git a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs
index afde5f376..c5f9a25a6 100644
--- a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs
+++ b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-1.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(generic_associated_types)]
// This test unsures that with_opt_const_param returns the
// def_id of the N param in the Foo::Assoc GAT.
diff --git a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs
index 51046be79..cd7941ed9 100644
--- a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs
+++ b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-2.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(generic_associated_types)]
// This test unsures that with_opt_const_param returns the
// def_id of the N param in the Foo::Assoc GAT.
diff --git a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs
index 457fe27b3..db61fc080 100644
--- a/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs
+++ b/src/test/ui/generic-associated-types/const-generics-gat-in-trait-return-type-3.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(generic_associated_types)]
// This test unsures that with_opt_const_param returns the
// def_id of the N param in the Bar::Assoc GAT.
diff --git a/src/test/ui/generic-associated-types/const_params_have_right_type.rs b/src/test/ui/generic-associated-types/const_params_have_right_type.rs
index 6bed8e3af..d2cb12697 100644
--- a/src/test/ui/generic-associated-types/const_params_have_right_type.rs
+++ b/src/test/ui/generic-associated-types/const_params_have_right_type.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Trait {
type Foo<const N: u8>;
}
diff --git a/src/test/ui/generic-associated-types/const_params_have_right_type.stderr b/src/test/ui/generic-associated-types/const_params_have_right_type.stderr
index 89c993dee..fdedd3bf5 100644
--- a/src/test/ui/generic-associated-types/const_params_have_right_type.stderr
+++ b/src/test/ui/generic-associated-types/const_params_have_right_type.stderr
@@ -1,5 +1,5 @@
error[E0053]: type `Foo` has an incompatible generic parameter for trait `Trait`
- --> $DIR/const_params_have_right_type.rs:8:14
+ --> $DIR/const_params_have_right_type.rs:6:14
|
LL | trait Trait {
| -----
diff --git a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs
index e315ee842..c78a54997 100644
--- a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs
+++ b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.rs
@@ -1,7 +1,5 @@
// Test that correct syntax is used in suggestion to constrain associated type
-#![feature(generic_associated_types)]
-
trait X {
type Y<T>;
}
diff --git a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr
index 957ae5d29..96c4330fe 100644
--- a/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr
+++ b/src/test/ui/generic-associated-types/constraint-assoc-type-suggestion.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/constraint-assoc-type-suggestion.rs:12:23
+ --> $DIR/constraint-assoc-type-suggestion.rs:10:23
|
LL | let b: Vec<i32> = a;
| -------- ^ expected struct `Vec`, found associated type
diff --git a/src/test/ui/generic-associated-types/construct_with_other_type.rs b/src/test/ui/generic-associated-types/construct_with_other_type.rs
index 060804269..5cb07f558 100644
--- a/src/test/ui/generic-associated-types/construct_with_other_type.rs
+++ b/src/test/ui/generic-associated-types/construct_with_other_type.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
// check-pass
use std::ops::Deref;
diff --git a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr
index c4009dd96..c81cd7e77 100644
--- a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr
+++ b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr
@@ -5,7 +5,7 @@ LL | type Bar = ();
| ^^ the trait `AsRef<()>` is not implemented for `()`
|
note: required by a bound in `foo_defn::Foo::Bar`
- --> $DIR/auxiliary/foo_defn.rs:6:15
+ --> $DIR/auxiliary/foo_defn.rs:4:15
|
LL | type Bar: AsRef<()>;
| ^^^^^^^^^ required by this bound in `foo_defn::Foo::Bar`
diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.rs b/src/test/ui/generic-associated-types/elided-in-expr-position.rs
index 482d0d5c0..e40093305 100644
--- a/src/test/ui/generic-associated-types/elided-in-expr-position.rs
+++ b/src/test/ui/generic-associated-types/elided-in-expr-position.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![allow(unused)]
pub trait Trait {
diff --git a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
index b395a1cfd..20f35c3c1 100644
--- a/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
+++ b/src/test/ui/generic-associated-types/elided-in-expr-position.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `Trait::Assoc`
- --> $DIR/elided-in-expr-position.rs:10:26
+ --> $DIR/elided-in-expr-position.rs:9:26
|
LL | fn g(&self) -> Self::Assoc;
| ^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/elided-in-expr-position.rs:5:10
+ --> $DIR/elided-in-expr-position.rs:4:10
|
LL | type Assoc<'a> where Self: 'a;
| ^^^^^ --
@@ -15,13 +15,13 @@ LL | fn g(&self) -> Self::Assoc<'a>;
| ~~~~~~~~~
error[E0107]: missing generics for associated type `Trait::Assoc`
- --> $DIR/elided-in-expr-position.rs:32:26
+ --> $DIR/elided-in-expr-position.rs:31:26
|
LL | fn g(&self) -> Self::Assoc {
| ^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/elided-in-expr-position.rs:5:10
+ --> $DIR/elided-in-expr-position.rs:4:10
|
LL | type Assoc<'a> where Self: 'a;
| ^^^^^ --
diff --git a/src/test/ui/generic-associated-types/empty_generics.rs b/src/test/ui/generic-associated-types/empty_generics.rs
index 772b7f2b4..964c2972d 100644
--- a/src/test/ui/generic-associated-types/empty_generics.rs
+++ b/src/test/ui/generic-associated-types/empty_generics.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Foo {
type Bar<,>;
//~^ ERROR expected one of `#`, `>`, `const`, identifier, or lifetime, found `,`
diff --git a/src/test/ui/generic-associated-types/empty_generics.stderr b/src/test/ui/generic-associated-types/empty_generics.stderr
index ac22bfc08..b753181cf 100644
--- a/src/test/ui/generic-associated-types/empty_generics.stderr
+++ b/src/test/ui/generic-associated-types/empty_generics.stderr
@@ -1,5 +1,5 @@
error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `,`
- --> $DIR/empty_generics.rs:4:14
+ --> $DIR/empty_generics.rs:2:14
|
LL | trait Foo {
| - while parsing this item list starting here
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
index 3da7794b3..614c4a34c 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator.base.stderr
@@ -1,5 +1,5 @@
error[E0276]: impl has stricter requirements than trait
- --> $DIR/lending_iterator.rs:14:45
+ --> $DIR/lending_iterator.rs:13:45
|
LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
| ------------------------------------------------------------------------ definition of `from_iter` from trait
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator.rs b/src/test/ui/generic-associated-types/extended/lending_iterator.rs
index ede164766..247761dd0 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator.rs
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator.rs
@@ -2,7 +2,6 @@
//[base] check-fail
//[extended] check-pass
-#![feature(generic_associated_types)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr b/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr
index 6c2a624ca..f6b0b644e 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator_2.base.stderr
@@ -1,5 +1,5 @@
error[E0276]: impl has stricter requirements than trait
- --> $DIR/lending_iterator_2.rs:14:45
+ --> $DIR/lending_iterator_2.rs:13:45
|
LL | fn from_iter<T: for<'x> LendingIterator<Item<'x> = A>>(iter: T) -> Self;
| ------------------------------------------------------------------------ definition of `from_iter` from trait
diff --git a/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs b/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs
index 3c4a2184d..eb9c0456a 100644
--- a/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs
+++ b/src/test/ui/generic-associated-types/extended/lending_iterator_2.rs
@@ -2,7 +2,6 @@
//[base] check-fail
//[extended] check-pass
-#![feature(generic_associated_types)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs
deleted file mode 100644
index c1d68812e..000000000
--- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// rust-lang/rust#60654: Do not ICE on an attempt to use GATs that is
-// missing the feature gate.
-
-struct Foo;
-
-trait MyTrait {
- type Item<T>;
- //~^ ERROR generic associated types are unstable [E0658]
-}
-
-impl MyTrait for Foo {
- type Item<T> = T;
- //~^ ERROR generic associated types are unstable [E0658]
-}
-
-fn main() { }
diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr
deleted file mode 100644
index 34f536dbe..000000000
--- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature-2.stderr
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0658]: generic associated types are unstable
- --> $DIR/gat-dont-ice-on-absent-feature-2.rs:7:5
- |
-LL | type Item<T>;
- | ^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0658]: generic associated types are unstable
- --> $DIR/gat-dont-ice-on-absent-feature-2.rs:12:5
- |
-LL | type Item<T> = T;
- | ^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs
deleted file mode 100644
index e8fc47d2a..000000000
--- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// rust-lang/rust#60654: Do not ICE on an attempt to use GATs that is
-// missing the feature gate.
-
-struct Foo;
-
-impl Iterator for Foo {
- type Item<'b> = &'b Foo;
- //~^ ERROR generic associated types are unstable [E0658]
- //~| ERROR lifetime parameters or bounds on type `Item` do not match the trait declaration
-
- fn next(&mut self) -> Option<Self::Item> {
- None
- }
-}
-
-fn main() { }
diff --git a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr b/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr
deleted file mode 100644
index ec36886f7..000000000
--- a/src/test/ui/generic-associated-types/gat-dont-ice-on-absent-feature.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0658]: generic associated types are unstable
- --> $DIR/gat-dont-ice-on-absent-feature.rs:7:5
- |
-LL | type Item<'b> = &'b Foo;
- | ^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error[E0195]: lifetime parameters or bounds on type `Item` do not match the trait declaration
- --> $DIR/gat-dont-ice-on-absent-feature.rs:7:14
- |
-LL | type Item<'b> = &'b Foo;
- | ^^^^ lifetimes do not match type in trait
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0195, E0658.
-For more information about an error, try `rustc --explain E0195`.
diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs
index f542a7f54..86b164ba7 100644
--- a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs
+++ b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'x>;
}
diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr
index 1792d8db2..b77f10084 100644
--- a/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr
+++ b/src/test/ui/generic-associated-types/gat-in-trait-path-undeclared-lifetime.stderr
@@ -1,5 +1,5 @@
error[E0261]: use of undeclared lifetime name `'x`
- --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:8:35
+ --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:6:35
|
LL | fn _f(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {}
| ^^ undeclared lifetime
@@ -15,7 +15,7 @@ LL | fn _f<'x>(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {}
| ++++
error[E0582]: binding for associated type `Y` references lifetime `'a`, which does not appear in the trait input types
- --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:8:33
+ --> $DIR/gat-in-trait-path-undeclared-lifetime.rs:6:33
|
LL | fn _f(arg : Box<dyn for<'a> X<Y<'x> = &'a [u32]>>) {}
| ^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr b/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr
index c2054f64e..fd54faaf3 100644
--- a/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr
+++ b/src/test/ui/generic-associated-types/gat-in-trait-path.base.stderr
@@ -1,11 +1,11 @@
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/gat-in-trait-path.rs:27:17
+ --> $DIR/gat-in-trait-path.rs:26:17
|
LL | fn f(_arg : Box<dyn for<'a> Foo<A<'a> = &'a ()>>) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `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/gat-in-trait-path.rs:11:10
+ --> $DIR/gat-in-trait-path.rs:10:10
|
LL | trait Foo {
| --- this trait cannot be made into an object...
diff --git a/src/test/ui/generic-associated-types/gat-in-trait-path.rs b/src/test/ui/generic-associated-types/gat-in-trait-path.rs
index c82450ccf..c55f5a726 100644
--- a/src/test/ui/generic-associated-types/gat-in-trait-path.rs
+++ b/src/test/ui/generic-associated-types/gat-in-trait-path.rs
@@ -2,7 +2,6 @@
//[base] check-fail
//[extended] check-pass
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/gat-incomplete-warning.rs b/src/test/ui/generic-associated-types/gat-incomplete-warning.rs
deleted file mode 100644
index 607ea1759..000000000
--- a/src/test/ui/generic-associated-types/gat-incomplete-warning.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-// run-pass
-
-#![feature(generic_associated_types)]
-
-fn main() {}
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs
index dbf7e02ae..d00c036fb 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs
+++ b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Foo {
type F<'a>;
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr
index dad0dae6a..cb2b9f32b 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr
+++ b/src/test/ui/generic-associated-types/gat-trait-path-generic-type-arg.stderr
@@ -1,5 +1,5 @@
error[E0403]: the name `T1` is already used for a generic parameter in this item's generic parameters
- --> $DIR/gat-trait-path-generic-type-arg.rs:11:12
+ --> $DIR/gat-trait-path-generic-type-arg.rs:9:12
|
LL | impl <T, T1> Foo for T {
| -- first use of `T1`
@@ -8,13 +8,13 @@ LL | type F<T1> = &[u8];
| ^^ already used
error[E0637]: `&` without an explicit lifetime name cannot be used here
- --> $DIR/gat-trait-path-generic-type-arg.rs:11:18
+ --> $DIR/gat-trait-path-generic-type-arg.rs:9:18
|
LL | type F<T1> = &[u8];
| ^ explicit lifetime name needed here
error[E0207]: the type parameter `T1` is not constrained by the impl trait, self type, or predicates
- --> $DIR/gat-trait-path-generic-type-arg.rs:9:10
+ --> $DIR/gat-trait-path-generic-type-arg.rs:7:10
|
LL | impl <T, T1> Foo for T {
| ^^ unconstrained type parameter
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs
index 9864787f0..83b86f04a 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs
+++ b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a>;
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
index aeb9238de..452dfefd1 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
+++ b/src/test/ui/generic-associated-types/gat-trait-path-missing-lifetime.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `X::Y`
- --> $DIR/gat-trait-path-missing-lifetime.rs:10:20
+ --> $DIR/gat-trait-path-missing-lifetime.rs:8:20
|
LL | fn foo<'a, T1: X<Y = T1>>(t : T1) -> T1::Y<'a> {
| ^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/gat-trait-path-missing-lifetime.rs:4:8
+ --> $DIR/gat-trait-path-missing-lifetime.rs:2:8
|
LL | type Y<'a>;
| ^ --
@@ -15,13 +15,13 @@ LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> {
| ~~~~~
error[E0107]: missing generics for associated type `X::Y`
- --> $DIR/gat-trait-path-missing-lifetime.rs:10:20
+ --> $DIR/gat-trait-path-missing-lifetime.rs:8:20
|
LL | fn foo<'a, T1: X<Y = T1>>(t : T1) -> T1::Y<'a> {
| ^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/gat-trait-path-missing-lifetime.rs:4:8
+ --> $DIR/gat-trait-path-missing-lifetime.rs:2:8
|
LL | type Y<'a>;
| ^ --
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
index c55b0530c..9eb069637 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
+++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a>;
}
diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
index 162214063..e55a21e19 100644
--- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
+++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
@@ -1,11 +1,11 @@
error: lifetime in trait object type must be followed by `+`
- --> $DIR/gat-trait-path-parenthesised-args.rs:7:29
+ --> $DIR/gat-trait-path-parenthesised-args.rs:5:29
|
LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
| ^^
error: parenthesized generic arguments cannot be used in associated type constraints
- --> $DIR/gat-trait-path-parenthesised-args.rs:7:27
+ --> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
| ^^^^^
@@ -16,7 +16,7 @@ LL | fn foo<'a>(arg: Box<dyn X<Y<'a> = &'a ()>>) {}
| ~ ~
error: parenthesized generic arguments cannot be used in associated type constraints
- --> $DIR/gat-trait-path-parenthesised-args.rs:14:27
+ --> $DIR/gat-trait-path-parenthesised-args.rs:12:27
|
LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {}
| ^--
@@ -24,13 +24,13 @@ LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {}
| help: remove these parentheses
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
- --> $DIR/gat-trait-path-parenthesised-args.rs:7:27
+ --> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
| ^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/gat-trait-path-parenthesised-args.rs:4:8
+ --> $DIR/gat-trait-path-parenthesised-args.rs:2:8
|
LL | type Y<'a>;
| ^ --
@@ -40,7 +40,7 @@ LL | fn foo<'a>(arg: Box<dyn X<Y('a, 'a) = &'a ()>>) {}
| +++
error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
- --> $DIR/gat-trait-path-parenthesised-args.rs:7:27
+ --> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
| ^---- help: remove these generics
@@ -48,19 +48,19 @@ LL | fn foo<'a>(arg: Box<dyn X<Y('a) = &'a ()>>) {}
| expected 0 generic arguments
|
note: associated type defined here, with 0 generic parameters
- --> $DIR/gat-trait-path-parenthesised-args.rs:4:8
+ --> $DIR/gat-trait-path-parenthesised-args.rs:2:8
|
LL | type Y<'a>;
| ^
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
- --> $DIR/gat-trait-path-parenthesised-args.rs:14:27
+ --> $DIR/gat-trait-path-parenthesised-args.rs:12:27
|
LL | fn bar<'a>(arg: Box<dyn X<Y() = ()>>) {}
| ^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/gat-trait-path-parenthesised-args.rs:4:8
+ --> $DIR/gat-trait-path-parenthesised-args.rs:2:8
|
LL | type Y<'a>;
| ^ --
diff --git a/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs b/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs
index d7c4dbda2..fdc5a7267 100644
--- a/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs
+++ b/src/test/ui/generic-associated-types/generic-associated-type-bounds.rs
@@ -1,7 +1,5 @@
// run-pass
-#![feature(generic_associated_types)]
-
pub trait X {
type Y<'a> where Self: 'a;
fn m(&self) -> Self::Y<'_>;
diff --git a/src/test/ui/generic-associated-types/generic-associated-types-where.rs b/src/test/ui/generic-associated-types/generic-associated-types-where.rs
index 2ecbc8c59..bbdfffafe 100644
--- a/src/test/ui/generic-associated-types/generic-associated-types-where.rs
+++ b/src/test/ui/generic-associated-types/generic-associated-types-where.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
// Checking the interaction with this other feature
#![feature(associated_type_defaults)]
diff --git a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr
index e866b3bab..9a745c099 100644
--- a/src/test/ui/generic-associated-types/generic-associated-types-where.stderr
+++ b/src/test/ui/generic-associated-types/generic-associated-types-where.stderr
@@ -1,5 +1,5 @@
error[E0277]: `T` doesn't implement `std::fmt::Display`
- --> $DIR/generic-associated-types-where.rs:20:22
+ --> $DIR/generic-associated-types-where.rs:18:22
|
LL | type Assoc2<T> = Vec<T>;
| ^^^^^^ `T` cannot be formatted with the default formatter
@@ -11,7 +11,7 @@ LL | type Assoc2<T: std::fmt::Display> = Vec<T>;
| +++++++++++++++++++
error[E0276]: impl has stricter requirements than trait
- --> $DIR/generic-associated-types-where.rs:22:38
+ --> $DIR/generic-associated-types-where.rs:20:38
|
LL | type Assoc3<T>;
| -------------- definition of `Assoc3` from trait
diff --git a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs
index 43058f7eb..2cb218bf8 100644
--- a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs
+++ b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
use std::ops::Deref;
trait Iterable {
diff --git a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr
index a4bb36190..396ff15ab 100644
--- a/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr
+++ b/src/test/ui/generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr
@@ -1,5 +1,5 @@
error[E0261]: use of undeclared lifetime name `'b`
- --> $DIR/generic_associated_type_undeclared_lifetimes.rs:8:37
+ --> $DIR/generic_associated_type_undeclared_lifetimes.rs:6:37
|
LL | + Deref<Target = Self::Item<'b>>;
| ^^ undeclared lifetime
@@ -19,7 +19,7 @@ LL | trait Iterable<'b> {
| ++++
error[E0261]: use of undeclared lifetime name `'undeclared`
- --> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:41
+ --> $DIR/generic_associated_type_undeclared_lifetimes.rs:9:41
|
LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>;
| ^^^^^^^^^^^ undeclared lifetime
diff --git a/src/test/ui/generic-associated-types/impl_bounds.rs b/src/test/ui/generic-associated-types/impl_bounds.rs
index ec1d171c0..01165fceb 100644
--- a/src/test/ui/generic-associated-types/impl_bounds.rs
+++ b/src/test/ui/generic-associated-types/impl_bounds.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
trait Foo {
diff --git a/src/test/ui/generic-associated-types/impl_bounds.stderr b/src/test/ui/generic-associated-types/impl_bounds.stderr
index ce79c635a..442d4f336 100644
--- a/src/test/ui/generic-associated-types/impl_bounds.stderr
+++ b/src/test/ui/generic-associated-types/impl_bounds.stderr
@@ -1,5 +1,5 @@
error[E0276]: impl has stricter requirements than trait
- --> $DIR/impl_bounds.rs:15:39
+ --> $DIR/impl_bounds.rs:14:39
|
LL | type A<'a> where Self: 'a;
| ---------- definition of `A` from trait
@@ -8,7 +8,7 @@ LL | type A<'a> = (&'a ()) where Self: 'static;
| ^^^^^^^ impl has extra requirement `T: 'static`
error[E0276]: impl has stricter requirements than trait
- --> $DIR/impl_bounds.rs:17:48
+ --> $DIR/impl_bounds.rs:16:48
|
LL | type B<'a, 'b> where 'a: 'b;
| -------------- definition of `B` from trait
@@ -17,7 +17,7 @@ LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
| ^^ impl has extra requirement `'b: 'a`
error[E0478]: lifetime bound not satisfied
- --> $DIR/impl_bounds.rs:17:22
+ --> $DIR/impl_bounds.rs:16:22
|
LL | type B<'a, 'b> where 'a: 'b;
| -------------- definition of `B` from trait
@@ -26,29 +26,29 @@ LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
| ^^^^^^^^^^^^^^^ - help: try copying this clause from the trait: `, 'a: 'b`
|
note: lifetime parameter instantiated with the lifetime `'a` as defined here
- --> $DIR/impl_bounds.rs:17:12
+ --> $DIR/impl_bounds.rs:16:12
|
LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
| ^^
note: but lifetime parameter must outlive the lifetime `'b` as defined here
- --> $DIR/impl_bounds.rs:17:16
+ --> $DIR/impl_bounds.rs:16:16
|
LL | type B<'a, 'b> = (&'a(), &'b ()) where 'b: 'a;
| ^^
error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/impl_bounds.rs:20:33
+ --> $DIR/impl_bounds.rs:19:33
|
LL | type C = String where Self: Copy;
| ^^^^ the trait `Copy` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
- --> $DIR/impl_bounds.rs:11:10
+note: required for `Fooy<T>` to implement `Copy`
+ --> $DIR/impl_bounds.rs:10:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s associated type `C` but not on the corresponding trait's associated type
- --> $DIR/impl_bounds.rs:7:10
+ --> $DIR/impl_bounds.rs:6:10
|
LL | trait Foo {
| --- in this trait
@@ -62,18 +62,18 @@ LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
| +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/impl_bounds.rs:22:24
+ --> $DIR/impl_bounds.rs:21:24
|
LL | fn d() where Self: Copy {}
| ^^^^ the trait `Copy` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Copy` for `Fooy<T>`
- --> $DIR/impl_bounds.rs:11:10
+note: required for `Fooy<T>` to implement `Copy`
+ --> $DIR/impl_bounds.rs:10:10
|
LL | #[derive(Copy, Clone)]
| ^^^^
note: the requirement `Fooy<T>: Copy` appears on the `impl`'s method `d` but not on the corresponding trait's method
- --> $DIR/impl_bounds.rs:8:8
+ --> $DIR/impl_bounds.rs:7:8
|
LL | trait Foo {
| --- in this trait
diff --git a/src/test/ui/generic-associated-types/impl_bounds_ok.rs b/src/test/ui/generic-associated-types/impl_bounds_ok.rs
index 4df8235d9..88f829ea2 100644
--- a/src/test/ui/generic-associated-types/impl_bounds_ok.rs
+++ b/src/test/ui/generic-associated-types/impl_bounds_ok.rs
@@ -1,6 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
trait Foo {
diff --git a/src/test/ui/generic-associated-types/issue-101020.rs b/src/test/ui/generic-associated-types/issue-101020.rs
new file mode 100644
index 000000000..80d0fa5ad
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-101020.rs
@@ -0,0 +1,35 @@
+pub trait LendingIterator {
+ type Item<'a>
+ where
+ Self: 'a;
+
+ fn consume<F>(self, _f: F)
+ where
+ Self: Sized,
+ for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>,
+ {
+ }
+}
+
+impl<I: LendingIterator + ?Sized> LendingIterator for &mut I {
+ type Item<'a> = I::Item<'a> where Self: 'a;
+}
+struct EmptyIter;
+impl LendingIterator for EmptyIter {
+ type Item<'a> = &'a mut () where Self:'a;
+}
+pub trait FuncInput<'a, F>
+where
+ F: Foo<Self>,
+ Self: Sized,
+{
+}
+impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {}
+trait Foo<T> {}
+
+fn map_test() {
+ (&mut EmptyIter).consume(());
+ //~^ ERROR the trait bound `for<'a> &'a mut (): Foo<&'a mut ()>` is not satisfied
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-101020.stderr b/src/test/ui/generic-associated-types/issue-101020.stderr
new file mode 100644
index 000000000..b4e94cb83
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-101020.stderr
@@ -0,0 +1,25 @@
+error[E0277]: the trait bound `for<'a> &'a mut (): Foo<&'a mut ()>` is not satisfied
+ --> $DIR/issue-101020.rs:31:5
+ |
+LL | (&mut EmptyIter).consume(());
+ | ^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | the trait `for<'a> Foo<&'a mut ()>` is not implemented for `&'a mut ()`
+ |
+note: required for `&'a mut ()` to implement `for<'a> FuncInput<'a, &'a mut ()>`
+ --> $DIR/issue-101020.rs:27:20
+ |
+LL | impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {}
+ | ^^^^^^^^^^^^^^^^ ^
+note: required by a bound in `LendingIterator::consume`
+ --> $DIR/issue-101020.rs:9:33
+ |
+LL | fn consume<F>(self, _f: F)
+ | ------- required by a bound in this
+...
+LL | for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `LendingIterator::consume`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/generic-associated-types/issue-102114.rs b/src/test/ui/generic-associated-types/issue-102114.rs
new file mode 100644
index 000000000..de31737ef
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-102114.rs
@@ -0,0 +1,16 @@
+trait A {
+ type B<'b>;
+ fn a() -> Self::B<'static>;
+}
+
+struct C;
+
+struct Wrapper<T>(T);
+
+impl A for C {
+ type B<T> = Wrapper<T>;
+ //~^ ERROR type `B` has 1 type parameter but its trait declaration has 0 type parameters
+ fn a() -> Self::B<'static> {}
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-102114.stderr b/src/test/ui/generic-associated-types/issue-102114.stderr
new file mode 100644
index 000000000..8e41dee54
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-102114.stderr
@@ -0,0 +1,12 @@
+error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters
+ --> $DIR/issue-102114.rs:11:12
+ |
+LL | type B<'b>;
+ | -- expected 0 type parameters
+...
+LL | type B<T> = Wrapper<T>;
+ | ^ found 1 type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0049`.
diff --git a/src/test/ui/generic-associated-types/issue-102333.rs b/src/test/ui/generic-associated-types/issue-102333.rs
new file mode 100644
index 000000000..6c7256332
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-102333.rs
@@ -0,0 +1,15 @@
+// check-pass
+
+trait A {
+ type T: B<U<1i32> = ()>;
+}
+
+trait B {
+ type U<const C: i32>;
+}
+
+fn f<T: A>() {
+ let _: <<T as A>::T as B>::U<1i32> = ();
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-102335-gat.rs b/src/test/ui/generic-associated-types/issue-102335-gat.rs
new file mode 100644
index 000000000..a7255fdcb
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-102335-gat.rs
@@ -0,0 +1,12 @@
+trait T {
+ type A: S<C<(), i32 = ()> = ()>;
+ //~^ ERROR associated type bindings are not allowed here
+}
+
+trait Q {}
+
+trait S {
+ type C<T>: Q;
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-102335-gat.stderr b/src/test/ui/generic-associated-types/issue-102335-gat.stderr
new file mode 100644
index 000000000..7a7900a1e
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-102335-gat.stderr
@@ -0,0 +1,9 @@
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-102335-gat.rs:2:21
+ |
+LL | type A: S<C<(), i32 = ()> = ()>;
+ | ^^^^^^^^ associated type not allowed here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0229`.
diff --git a/src/test/ui/generic-associated-types/issue-47206-where-clause.rs b/src/test/ui/generic-associated-types/issue-47206-where-clause.rs
index d352c1948..3d1b88ddf 100644
--- a/src/test/ui/generic-associated-types/issue-47206-where-clause.rs
+++ b/src/test/ui/generic-associated-types/issue-47206-where-clause.rs
@@ -1,7 +1,5 @@
// Check that this program doesn't cause the compiler to error without output.
-#![feature(generic_associated_types)]
-
trait Foo {
type Assoc3<T>;
}
diff --git a/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr b/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr
index 31948a878..7006744df 100644
--- a/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr
+++ b/src/test/ui/generic-associated-types/issue-47206-where-clause.stderr
@@ -1,5 +1,5 @@
error[E0276]: impl has stricter requirements than trait
- --> $DIR/issue-47206-where-clause.rs:12:38
+ --> $DIR/issue-47206-where-clause.rs:10:38
|
LL | type Assoc3<T>;
| -------------- definition of `Assoc3` from trait
diff --git a/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs b/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs
index e87a76825..625ccfe89 100644
--- a/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs
+++ b/src/test/ui/generic-associated-types/issue-58694-parameter-out-of-range.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Cert {
type PublicKey<'a>: From<&'a [u8]>;
}
diff --git a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs
index d74d6d056..c1140bff8 100644
--- a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs
+++ b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
// check-pass
trait Iterator {
diff --git a/src/test/ui/generic-associated-types/issue-67424.rs b/src/test/ui/generic-associated-types/issue-67424.rs
index fa35a3e8b..b6c7c70cd 100644
--- a/src/test/ui/generic-associated-types/issue-67424.rs
+++ b/src/test/ui/generic-associated-types/issue-67424.rs
@@ -1,3 +1,4 @@
+// check-pass
// Fixed by #67160
trait Trait1 {
@@ -6,7 +7,6 @@ trait Trait1 {
trait Trait2 {
type Type1<B>: Trait1<A=B>;
- //~^ ERROR: generic associated types are unstable
}
fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-67424.stderr b/src/test/ui/generic-associated-types/issue-67424.stderr
deleted file mode 100644
index bbb7d56f5..000000000
--- a/src/test/ui/generic-associated-types/issue-67424.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: generic associated types are unstable
- --> $DIR/issue-67424.rs:8:5
- |
-LL | type Type1<B>: Trait1<A=B>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
- = help: add `#![feature(generic_associated_types)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr b/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr
index 74a616aaa..4cc68530e 100644
--- a/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr
+++ b/src/test/ui/generic-associated-types/issue-67510-pass.base.stderr
@@ -1,11 +1,11 @@
error[E0038]: the trait `X` cannot be made into an object
- --> $DIR/issue-67510-pass.rs:13:23
+ --> $DIR/issue-67510-pass.rs:12:23
|
LL | fn _func1<'a>(_x: Box<dyn X<Y<'a>=&'a ()>>) {}
| ^^^^^^^^^^^^^^^^^^^ `X` 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-67510-pass.rs:10:10
+ --> $DIR/issue-67510-pass.rs:9:10
|
LL | trait X {
| - this trait cannot be made into an object...
diff --git a/src/test/ui/generic-associated-types/issue-67510-pass.rs b/src/test/ui/generic-associated-types/issue-67510-pass.rs
index c5b02ff9a..66ce3e807 100644
--- a/src/test/ui/generic-associated-types/issue-67510-pass.rs
+++ b/src/test/ui/generic-associated-types/issue-67510-pass.rs
@@ -2,7 +2,6 @@
//[base] check-fail
//[extended] check-pass
-#![feature(generic_associated_types)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/issue-67510.rs b/src/test/ui/generic-associated-types/issue-67510.rs
index 5725b660a..ab5c25d74 100644
--- a/src/test/ui/generic-associated-types/issue-67510.rs
+++ b/src/test/ui/generic-associated-types/issue-67510.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a>;
}
diff --git a/src/test/ui/generic-associated-types/issue-67510.stderr b/src/test/ui/generic-associated-types/issue-67510.stderr
index 8aeda22ba..d25c5b0f3 100644
--- a/src/test/ui/generic-associated-types/issue-67510.stderr
+++ b/src/test/ui/generic-associated-types/issue-67510.stderr
@@ -1,5 +1,5 @@
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/issue-67510.rs:7:21
+ --> $DIR/issue-67510.rs:5:21
|
LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {}
| ^^ undeclared lifetime
@@ -15,7 +15,7 @@ LL | fn f<'a>(x: Box<dyn X<Y<'a> = &'a ()>>) {}
| ++++
error[E0261]: use of undeclared lifetime name `'a`
- --> $DIR/issue-67510.rs:7:28
+ --> $DIR/issue-67510.rs:5:28
|
LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {}
| ^^ undeclared lifetime
@@ -30,13 +30,13 @@ LL | fn f<'a>(x: Box<dyn X<Y<'a> = &'a ()>>) {}
| ++++
error[E0038]: the trait `X` cannot be made into an object
- --> $DIR/issue-67510.rs:7:13
+ --> $DIR/issue-67510.rs:5:13
|
LL | fn f(x: Box<dyn X<Y<'a> = &'a ()>>) {}
| ^^^^^^^^^^^^^^^^^^^^^ `X` 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-67510.rs:4:10
+ --> $DIR/issue-67510.rs:2:10
|
LL | trait X {
| - this trait cannot be made into an object...
diff --git a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs
index 617d985dc..f1e779fcb 100644
--- a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs
+++ b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.rs
@@ -1,7 +1,5 @@
// Regression test for #68641
-#![feature(generic_associated_types)]
-
trait UnsafeCopy {
type Item<'a>: Copy;
diff --git a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr
index 2e21b38cb..6bb7492af 100644
--- a/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr
+++ b/src/test/ui/generic-associated-types/issue-68641-check-gat-bounds.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-68641-check-gat-bounds.rs:14:21
+ --> $DIR/issue-68641-check-gat-bounds.rs:12:21
|
LL | type Item<'a> = T;
| ^ the trait `Copy` is not implemented for `T`
|
note: required by a bound in `UnsafeCopy::Item`
- --> $DIR/issue-68641-check-gat-bounds.rs:6:20
+ --> $DIR/issue-68641-check-gat-bounds.rs:4:20
|
LL | type Item<'a>: Copy;
| ^^^^ required by this bound in `UnsafeCopy::Item`
diff --git a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs
index def0ad18f..f5502adee 100644
--- a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs
+++ b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.rs
@@ -1,7 +1,5 @@
// Regression test for #68642
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>: Fn() -> u32;
diff --git a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr
index 713cc744f..07452137b 100644
--- a/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr
+++ b/src/test/ui/generic-associated-types/issue-68642-broken-llvm-ir.stderr
@@ -1,12 +1,12 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
- --> $DIR/issue-68642-broken-llvm-ir.rs:14:18
+ --> $DIR/issue-68642-broken-llvm-ir.rs:12:18
|
LL | type F<'a> = Self;
| ^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `Fun::F`
- --> $DIR/issue-68642-broken-llvm-ir.rs:6:17
+ --> $DIR/issue-68642-broken-llvm-ir.rs:4:17
|
LL | type F<'a>: Fn() -> u32;
| ^^^^^^^^^^^ required by this bound in `Fun::F`
diff --git a/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs b/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs
index 9af065b5d..6050a8bf5 100644
--- a/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs
+++ b/src/test/ui/generic-associated-types/issue-68643-broken-mir.rs
@@ -1,7 +1,5 @@
// Regression test for #68643
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>: Fn() -> u32;
diff --git a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr
index a7b7f64cd..31ded5dab 100644
--- a/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr
+++ b/src/test/ui/generic-associated-types/issue-68643-broken-mir.stderr
@@ -1,12 +1,12 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
- --> $DIR/issue-68643-broken-mir.rs:14:18
+ --> $DIR/issue-68643-broken-mir.rs:12:18
|
LL | type F<'a> = Self;
| ^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `Fun::F`
- --> $DIR/issue-68643-broken-mir.rs:6:17
+ --> $DIR/issue-68643-broken-mir.rs:4:17
|
LL | type F<'a>: Fn() -> u32;
| ^^^^^^^^^^^ required by this bound in `Fun::F`
diff --git a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs
index 1d2636c26..898cfa1e7 100644
--- a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs
+++ b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.rs
@@ -1,7 +1,5 @@
// Regression test for #68644
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>: Fn() -> u32;
diff --git a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr
index 5e921e053..e2f9930cc 100644
--- a/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr
+++ b/src/test/ui/generic-associated-types/issue-68644-codegen-selection.stderr
@@ -1,12 +1,12 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
- --> $DIR/issue-68644-codegen-selection.rs:14:18
+ --> $DIR/issue-68644-codegen-selection.rs:12:18
|
LL | type F<'a> = Self;
| ^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `Fun::F`
- --> $DIR/issue-68644-codegen-selection.rs:6:17
+ --> $DIR/issue-68644-codegen-selection.rs:4:17
|
LL | type F<'a>: Fn() -> u32;
| ^^^^^^^^^^^ required by this bound in `Fun::F`
diff --git a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs
index aa505064f..60b065bfc 100644
--- a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs
+++ b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.rs
@@ -1,7 +1,5 @@
// Regression test for #68645
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>: Fn() -> u32;
diff --git a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr
index 7edcdce62..0065368ad 100644
--- a/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr
+++ b/src/test/ui/generic-associated-types/issue-68645-codegen-fulfillment.stderr
@@ -1,12 +1,12 @@
error[E0277]: expected a `Fn<()>` closure, found `T`
- --> $DIR/issue-68645-codegen-fulfillment.rs:14:18
+ --> $DIR/issue-68645-codegen-fulfillment.rs:12:18
|
LL | type F<'a> = Self;
| ^^^^ expected an `Fn<()>` closure, found `T`
|
= note: wrap the `T` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `Fun::F`
- --> $DIR/issue-68645-codegen-fulfillment.rs:6:17
+ --> $DIR/issue-68645-codegen-fulfillment.rs:4:17
|
LL | type F<'a>: Fn() -> u32;
| ^^^^^^^^^^^ required by this bound in `Fun::F`
diff --git a/src/test/ui/generic-associated-types/issue-68648-1.rs b/src/test/ui/generic-associated-types/issue-68648-1.rs
index 17bc034b3..0df41bab3 100644
--- a/src/test/ui/generic-associated-types/issue-68648-1.rs
+++ b/src/test/ui/generic-associated-types/issue-68648-1.rs
@@ -1,8 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
-
trait Fun {
type F<'a>;
diff --git a/src/test/ui/generic-associated-types/issue-68648-2.rs b/src/test/ui/generic-associated-types/issue-68648-2.rs
index 6c9a0d126..0f963d58f 100644
--- a/src/test/ui/generic-associated-types/issue-68648-2.rs
+++ b/src/test/ui/generic-associated-types/issue-68648-2.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>;
diff --git a/src/test/ui/generic-associated-types/issue-68648-2.stderr b/src/test/ui/generic-associated-types/issue-68648-2.stderr
index 06c1efcd8..b2bef19eb 100644
--- a/src/test/ui/generic-associated-types/issue-68648-2.stderr
+++ b/src/test/ui/generic-associated-types/issue-68648-2.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-68648-2.rs:14:17
+ --> $DIR/issue-68648-2.rs:12:17
|
LL | fn bug<'a, T: Fun<F<'a> = T>>(t: T) -> T::F<'a> {
| - this type parameter
@@ -11,7 +11,7 @@ LL | T::identity(())
= note: expected type parameter `T`
found unit type `()`
note: associated function defined here
- --> $DIR/issue-68648-2.rs:6:8
+ --> $DIR/issue-68648-2.rs:4:8
|
LL | fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t }
| ^^^^^^^^ --------------
diff --git a/src/test/ui/generic-associated-types/issue-68649-pass.rs b/src/test/ui/generic-associated-types/issue-68649-pass.rs
index 33f08faff..772743877 100644
--- a/src/test/ui/generic-associated-types/issue-68649-pass.rs
+++ b/src/test/ui/generic-associated-types/issue-68649-pass.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>;
diff --git a/src/test/ui/generic-associated-types/issue-68653.rs b/src/test/ui/generic-associated-types/issue-68653.rs
index 1e84717e9..170b87cf2 100644
--- a/src/test/ui/generic-associated-types/issue-68653.rs
+++ b/src/test/ui/generic-associated-types/issue-68653.rs
@@ -2,8 +2,6 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a: 'a>;
}
diff --git a/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs b/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs
index c0d933362..607cfed0b 100644
--- a/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs
+++ b/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs
@@ -1,7 +1,5 @@
// Regression test for #68656
-#![feature(generic_associated_types)]
-
trait UnsafeCopy<T: Copy> {
type Item<'a>: std::ops::Deref<Target = T>;
diff --git a/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr b/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr
index 8e0f23716..e8770aedf 100644
--- a/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr
+++ b/src/test/ui/generic-associated-types/issue-68656-unsized-values.stderr
@@ -1,5 +1,5 @@
error[E0271]: type mismatch resolving `<T as Deref>::Target == T`
- --> $DIR/issue-68656-unsized-values.rs:15:21
+ --> $DIR/issue-68656-unsized-values.rs:13:21
|
LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T {
| - this type parameter
@@ -9,7 +9,7 @@ LL | type Item<'a> = T;
= note: expected type parameter `T`
found associated type `<T as Deref>::Target`
note: required by a bound in `UnsafeCopy::Item`
- --> $DIR/issue-68656-unsized-values.rs:6:36
+ --> $DIR/issue-68656-unsized-values.rs:4:36
|
LL | type Item<'a>: std::ops::Deref<Target = T>;
| ^^^^^^^^^^ required by this bound in `UnsafeCopy::Item`
diff --git a/src/test/ui/generic-associated-types/issue-70303.rs b/src/test/ui/generic-associated-types/issue-70303.rs
index 568996e1a..0edff5e4e 100644
--- a/src/test/ui/generic-associated-types/issue-70303.rs
+++ b/src/test/ui/generic-associated-types/issue-70303.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Document {
type Cursor<'a>: DocCursor<'a> where Self: 'a;
diff --git a/src/test/ui/generic-associated-types/issue-70304.rs b/src/test/ui/generic-associated-types/issue-70304.rs
index f778f985c..8898d4c7d 100644
--- a/src/test/ui/generic-associated-types/issue-70304.rs
+++ b/src/test/ui/generic-associated-types/issue-70304.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Document {
type Cursor<'a>: DocCursor<'a>;
//~^ ERROR: missing required bound on `Cursor`
diff --git a/src/test/ui/generic-associated-types/issue-70304.stderr b/src/test/ui/generic-associated-types/issue-70304.stderr
index bba7cab70..99339e968 100644
--- a/src/test/ui/generic-associated-types/issue-70304.stderr
+++ b/src/test/ui/generic-associated-types/issue-70304.stderr
@@ -1,11 +1,11 @@
error[E0637]: `'_` cannot be used here
- --> $DIR/issue-70304.rs:48:41
+ --> $DIR/issue-70304.rs:46:41
|
LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'_>> {
| ^^ `'_` is a reserved lifetime name
error[E0106]: missing lifetime specifier
- --> $DIR/issue-70304.rs:48:61
+ --> $DIR/issue-70304.rs:46:61
|
LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'_>> {
| ^^ expected named lifetime parameter
@@ -17,7 +17,7 @@ LL | fn create_doc() -> impl Document<Cursor<'_> = DocCursorImpl<'static>> {
| ~~~~~~~
error: missing required bound on `Cursor`
- --> $DIR/issue-70304.rs:4:5
+ --> $DIR/issue-70304.rs:2:5
|
LL | type Cursor<'a>: DocCursor<'a>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
diff --git a/src/test/ui/generic-associated-types/issue-71176.rs b/src/test/ui/generic-associated-types/issue-71176.rs
index c2f0d59f4..f0e162d82 100644
--- a/src/test/ui/generic-associated-types/issue-71176.rs
+++ b/src/test/ui/generic-associated-types/issue-71176.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Provider {
type A<'a>;
}
diff --git a/src/test/ui/generic-associated-types/issue-71176.stderr b/src/test/ui/generic-associated-types/issue-71176.stderr
index 08c8d4162..386c97161 100644
--- a/src/test/ui/generic-associated-types/issue-71176.stderr
+++ b/src/test/ui/generic-associated-types/issue-71176.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `Provider::A`
- --> $DIR/issue-71176.rs:12:27
+ --> $DIR/issue-71176.rs:10:27
|
LL | inner: Box<dyn Provider<A = B>>,
| ^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-71176.rs:4:10
+ --> $DIR/issue-71176.rs:2:10
|
LL | type A<'a>;
| ^ --
diff --git a/src/test/ui/generic-associated-types/issue-74684-1.rs b/src/test/ui/generic-associated-types/issue-74684-1.rs
index 0e3899a88..e9ec80074 100644
--- a/src/test/ui/generic-associated-types/issue-74684-1.rs
+++ b/src/test/ui/generic-associated-types/issue-74684-1.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>: ?Sized;
diff --git a/src/test/ui/generic-associated-types/issue-74684-1.stderr b/src/test/ui/generic-associated-types/issue-74684-1.stderr
index 2cd050ed8..cacc97307 100644
--- a/src/test/ui/generic-associated-types/issue-74684-1.stderr
+++ b/src/test/ui/generic-associated-types/issue-74684-1.stderr
@@ -1,5 +1,5 @@
error[E0597]: `a` does not live long enough
- --> $DIR/issue-74684-1.rs:15:26
+ --> $DIR/issue-74684-1.rs:13:26
|
LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(_ : Box<T>) -> &'static T::F<'a> {
| -- lifetime `'a` defined here
diff --git a/src/test/ui/generic-associated-types/issue-74684-2.rs b/src/test/ui/generic-associated-types/issue-74684-2.rs
index fca55070b..ff243af2c 100644
--- a/src/test/ui/generic-associated-types/issue-74684-2.rs
+++ b/src/test/ui/generic-associated-types/issue-74684-2.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Fun {
type F<'a>: ?Sized;
diff --git a/src/test/ui/generic-associated-types/issue-74684-2.stderr b/src/test/ui/generic-associated-types/issue-74684-2.stderr
index f0e03e73f..59b85abf5 100644
--- a/src/test/ui/generic-associated-types/issue-74684-2.stderr
+++ b/src/test/ui/generic-associated-types/issue-74684-2.stderr
@@ -1,16 +1,18 @@
error[E0271]: type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
- --> $DIR/issue-74684-2.rs:23:5
+ --> $DIR/issue-74684-2.rs:21:9
|
LL | bug(Box::new(x));
- | ^^^ type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
+ | --- ^^^^^^^^^^^ type mismatch resolving `<{integer} as Fun>::F<'_> == [u8]`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `[u8]`
- --> $DIR/issue-74684-2.rs:10:18
+ --> $DIR/issue-74684-2.rs:8:18
|
LL | type F<'a> = i32;
| ^^^
note: required by a bound in `bug`
- --> $DIR/issue-74684-2.rs:13:28
+ --> $DIR/issue-74684-2.rs:11:28
|
LL | fn bug<'a, T: ?Sized + Fun<F<'a> = [u8]>>(t: Box<T>) -> &'static T::F<'a> {
| ^^^^^^^^^^^^ required by this bound in `bug`
diff --git a/src/test/ui/generic-associated-types/issue-74816.rs b/src/test/ui/generic-associated-types/issue-74816.rs
index c932025d1..344afb87f 100644
--- a/src/test/ui/generic-associated-types/issue-74816.rs
+++ b/src/test/ui/generic-associated-types/issue-74816.rs
@@ -1,5 +1,4 @@
#![feature(associated_type_defaults)]
-#![feature(generic_associated_types)]
trait Trait1 {
fn foo();
diff --git a/src/test/ui/generic-associated-types/issue-74816.stderr b/src/test/ui/generic-associated-types/issue-74816.stderr
index 9eaa74e34..45018e697 100644
--- a/src/test/ui/generic-associated-types/issue-74816.stderr
+++ b/src/test/ui/generic-associated-types/issue-74816.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `Self: Trait1` is not satisfied
- --> $DIR/issue-74816.rs:9:31
+ --> $DIR/issue-74816.rs:8:31
|
LL | type Associated: Trait1 = Self;
| ^^^^ the trait `Trait1` is not implemented for `Self`
|
note: required by a bound in `Trait2::Associated`
- --> $DIR/issue-74816.rs:9:22
+ --> $DIR/issue-74816.rs:8:22
|
LL | type Associated: Trait1 = Self;
| ^^^^^^ required by this bound in `Trait2::Associated`
@@ -15,13 +15,13 @@ LL | trait Trait2: Trait1 {
| ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
- --> $DIR/issue-74816.rs:9:31
+ --> $DIR/issue-74816.rs:8:31
|
LL | type Associated: Trait1 = Self;
| ^^^^ doesn't have a size known at compile-time
|
note: required by a bound in `Trait2::Associated`
- --> $DIR/issue-74816.rs:9:5
+ --> $DIR/issue-74816.rs:8:5
|
LL | type Associated: Trait1 = Self;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Trait2::Associated`
diff --git a/src/test/ui/generic-associated-types/issue-74824.rs b/src/test/ui/generic-associated-types/issue-74824.rs
index 1bbf7aac5..10c45d133 100644
--- a/src/test/ui/generic-associated-types/issue-74824.rs
+++ b/src/test/ui/generic-associated-types/issue-74824.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
use std::ops::Deref;
diff --git a/src/test/ui/generic-associated-types/issue-74824.stderr b/src/test/ui/generic-associated-types/issue-74824.stderr
index 8517eb9fa..623adb1c2 100644
--- a/src/test/ui/generic-associated-types/issue-74824.stderr
+++ b/src/test/ui/generic-associated-types/issue-74824.stderr
@@ -1,24 +1,24 @@
error[E0277]: the trait bound `Box<T>: Copy` is not satisfied
- --> $DIR/issue-74824.rs:7:26
+ --> $DIR/issue-74824.rs:6:26
|
LL | type Copy<T>: Copy = Box<T>;
| ^^^^^^ the trait `Copy` is not implemented for `Box<T>`
|
note: required by a bound in `UnsafeCopy::Copy`
- --> $DIR/issue-74824.rs:7:19
+ --> $DIR/issue-74824.rs:6:19
|
LL | type Copy<T>: Copy = Box<T>;
| ^^^^ required by this bound in `UnsafeCopy::Copy`
error[E0277]: the trait bound `T: Clone` is not satisfied
- --> $DIR/issue-74824.rs:7:26
+ --> $DIR/issue-74824.rs:6:26
|
LL | type Copy<T>: Copy = Box<T>;
| ^^^^^^ the trait `Clone` is not implemented for `T`
|
- = note: required because of the requirements on the impl of `Clone` for `Box<T>`
+ = note: required for `Box<T>` to implement `Clone`
note: required by a bound in `UnsafeCopy::Copy`
- --> $DIR/issue-74824.rs:7:19
+ --> $DIR/issue-74824.rs:6:19
|
LL | type Copy<T>: Copy = Box<T>;
| ^^^^ required by this bound in `UnsafeCopy::Copy`
diff --git a/src/test/ui/generic-associated-types/issue-76407.rs b/src/test/ui/generic-associated-types/issue-76407.rs
index a8141829b..9556ec6da 100644
--- a/src/test/ui/generic-associated-types/issue-76407.rs
+++ b/src/test/ui/generic-associated-types/issue-76407.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Marker {}
impl Marker for u32 {}
diff --git a/src/test/ui/generic-associated-types/issue-76535.base.stderr b/src/test/ui/generic-associated-types/issue-76535.base.stderr
index 5decd58bb..088f69b09 100644
--- a/src/test/ui/generic-associated-types/issue-76535.base.stderr
+++ b/src/test/ui/generic-associated-types/issue-76535.base.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `SuperTrait::SubType`
- --> $DIR/issue-76535.rs:40:33
+ --> $DIR/issue-76535.rs:39:33
|
LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
| ^^^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-76535.rs:10:10
+ --> $DIR/issue-76535.rs:9:10
|
LL | type SubType<'a>: SubTrait where Self: 'a;
| ^^^^^^^ --
@@ -15,13 +15,13 @@ LL | let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperS
| ~~~~~~~~~~~
error[E0038]: the trait `SuperTrait` cannot be made into an object
- --> $DIR/issue-76535.rs:40:14
+ --> $DIR/issue-76535.rs:39:14
|
LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` 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-76535.rs:10:10
+ --> $DIR/issue-76535.rs:9:10
|
LL | pub trait SuperTrait {
| ---------- this trait cannot be made into an object...
@@ -30,20 +30,20 @@ LL | type SubType<'a>: SubTrait where Self: 'a;
= help: consider moving `SubType` to another trait
error[E0038]: the trait `SuperTrait` cannot be made into an object
- --> $DIR/issue-76535.rs:40:57
+ --> $DIR/issue-76535.rs:39:57
|
LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` 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-76535.rs:10:10
+ --> $DIR/issue-76535.rs:9:10
|
LL | pub trait SuperTrait {
| ---------- this trait cannot be made into an object...
LL | type SubType<'a>: SubTrait where Self: 'a;
| ^^^^^^^ ...because it contains the generic associated type `SubType`
= help: consider moving `SubType` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn SuperTrait<SubType = SubStruct<'_>>>>` for `Box<SuperStruct>`
+ = note: required for `Box<SuperStruct>` to implement `CoerceUnsized<Box<dyn SuperTrait<SubType = SubStruct<'_>>>>`
= note: required by cast to type `Box<dyn SuperTrait<SubType = SubStruct<'_>>>`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generic-associated-types/issue-76535.extended.stderr b/src/test/ui/generic-associated-types/issue-76535.extended.stderr
index 067d0489b..e79f0a73f 100644
--- a/src/test/ui/generic-associated-types/issue-76535.extended.stderr
+++ b/src/test/ui/generic-associated-types/issue-76535.extended.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `SuperTrait::SubType`
- --> $DIR/issue-76535.rs:40:33
+ --> $DIR/issue-76535.rs:39:33
|
LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
| ^^^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-76535.rs:10:10
+ --> $DIR/issue-76535.rs:9:10
|
LL | type SubType<'a>: SubTrait where Self: 'a;
| ^^^^^^^ --
diff --git a/src/test/ui/generic-associated-types/issue-76535.rs b/src/test/ui/generic-associated-types/issue-76535.rs
index 46f217ba0..2457a05a0 100644
--- a/src/test/ui/generic-associated-types/issue-76535.rs
+++ b/src/test/ui/generic-associated-types/issue-76535.rs
@@ -1,6 +1,5 @@
// revisions: base extended
-#![feature(generic_associated_types)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/issue-76826.rs b/src/test/ui/generic-associated-types/issue-76826.rs
index 28eb3b0e7..ead78453e 100644
--- a/src/test/ui/generic-associated-types/issue-76826.rs
+++ b/src/test/ui/generic-associated-types/issue-76826.rs
@@ -1,7 +1,5 @@
// run-pass
-#![feature(generic_associated_types)]
-
pub trait Iter {
type Item<'a> where Self: 'a;
diff --git a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs
index 850d83be6..fd3b967d9 100644
--- a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs
+++ b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.rs
@@ -1,9 +1,7 @@
-// Test for diagnostics when we have mismatched lifetime due to implict 'static lifetime in GATs
+// Test for diagnostics when we have mismatched lifetime due to implicit 'static lifetime in GATs
// check-fail
-#![feature(generic_associated_types)]
-
pub trait A {}
impl A for &dyn A {}
impl A for Box<dyn A> {}
diff --git a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
index d487f19ba..86e0f5745 100644
--- a/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
+++ b/src/test/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
@@ -1,22 +1,22 @@
error: incompatible lifetime on type
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:17:18
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:18
|
LL | type T<'a> = Box<dyn A + 'a>;
| ^^^^^^^^^^^^^^^
|
note: because this has an unmet lifetime requirement
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:12:17
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:10:17
|
LL | type T<'a>: A;
| ^ introduces a `'static` lifetime requirement
note: the lifetime `'a` as defined here...
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:17:12
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:12
|
LL | type T<'a> = Box<dyn A + 'a>;
| ^^
= note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
note: this has an implicit `'static` lifetime requirement
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:9:20
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:7:20
|
LL | impl A for Box<dyn A> {}
| ^
@@ -26,51 +26,51 @@ LL | impl A for Box<dyn A + '_> {}
| ++++
error: incompatible lifetime on type
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:18
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:18
|
LL | type T<'a> = Box<dyn A + 'a>;
| ^^^^^^^^^^^^^^^
|
note: because this has an unmet lifetime requirement
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:23:17
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:17
|
LL | type T<'a>: C;
| ^ introduces a `'static` lifetime requirement
note: the lifetime `'a` as defined here...
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:12
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:12
|
LL | type T<'a> = Box<dyn A + 'a>;
| ^^
note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:1
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:19:1
|
LL | impl C for Box<dyn A + 'static> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: incompatible lifetime on type
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:18
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:18
|
LL | type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: because this has an unmet lifetime requirement
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:33:17
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:17
|
LL | type T<'a>: E;
| ^ introduces a `'static` lifetime requirement
note: the lifetime `'a` as defined here...
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:37:12
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:12
|
LL | type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
| ^^
= note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
note: this has an implicit `'static` lifetime requirement
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:21
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:21
|
LL | impl E for (Box<dyn A>, Box<dyn A>) {}
| ^
note: this has an implicit `'static` lifetime requirement
- --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:33
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:33
|
LL | impl E for (Box<dyn A>, Box<dyn A>) {}
| ^
diff --git a/src/test/ui/generic-associated-types/issue-78671.base.stderr b/src/test/ui/generic-associated-types/issue-78671.base.stderr
index 6bcd004b1..514f8d45a 100644
--- a/src/test/ui/generic-associated-types/issue-78671.base.stderr
+++ b/src/test/ui/generic-associated-types/issue-78671.base.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `CollectionFamily::Member`
- --> $DIR/issue-78671.rs:11:47
+ --> $DIR/issue-78671.rs:10:47
|
LL | Box::new(Family) as &dyn CollectionFamily<Member=usize>
| ^^^^^^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-78671.rs:8:10
+ --> $DIR/issue-78671.rs:7:10
|
LL | type Member<T>;
| ^^^^^^ -
@@ -15,13 +15,13 @@ LL | Box::new(Family) as &dyn CollectionFamily<Member<T>=usize>
| ~~~~~~~~~
error[E0038]: the trait `CollectionFamily` cannot be made into an object
- --> $DIR/issue-78671.rs:11:25
+ --> $DIR/issue-78671.rs:10:25
|
LL | Box::new(Family) as &dyn CollectionFamily<Member=usize>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `CollectionFamily` 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-78671.rs:8:10
+ --> $DIR/issue-78671.rs:7:10
|
LL | trait CollectionFamily {
| ---------------- this trait cannot be made into an object...
diff --git a/src/test/ui/generic-associated-types/issue-78671.extended.stderr b/src/test/ui/generic-associated-types/issue-78671.extended.stderr
index f1b489335..6fa09a4c7 100644
--- a/src/test/ui/generic-associated-types/issue-78671.extended.stderr
+++ b/src/test/ui/generic-associated-types/issue-78671.extended.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `CollectionFamily::Member`
- --> $DIR/issue-78671.rs:11:47
+ --> $DIR/issue-78671.rs:10:47
|
LL | Box::new(Family) as &dyn CollectionFamily<Member=usize>
| ^^^^^^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-78671.rs:8:10
+ --> $DIR/issue-78671.rs:7:10
|
LL | type Member<T>;
| ^^^^^^ -
diff --git a/src/test/ui/generic-associated-types/issue-78671.rs b/src/test/ui/generic-associated-types/issue-78671.rs
index c09dac28b..327b0c14a 100644
--- a/src/test/ui/generic-associated-types/issue-78671.rs
+++ b/src/test/ui/generic-associated-types/issue-78671.rs
@@ -1,6 +1,5 @@
// revisions: base extended
-#![feature(generic_associated_types)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/issue-79422.base.stderr b/src/test/ui/generic-associated-types/issue-79422.base.stderr
index 404c975d6..3c1a29d48 100644
--- a/src/test/ui/generic-associated-types/issue-79422.base.stderr
+++ b/src/test/ui/generic-associated-types/issue-79422.base.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `MapLike::VRefCont`
- --> $DIR/issue-79422.rs:48:36
+ --> $DIR/issue-79422.rs:47:36
|
LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
| ^^^^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-79422.rs:24:10
+ --> $DIR/issue-79422.rs:23:10
|
LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
| ^^^^^^^^ --
@@ -15,13 +15,13 @@ LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>;
| ~~~~~~~~~~~~
error[E0038]: the trait `MapLike` cannot be made into an object
- --> $DIR/issue-79422.rs:48:12
+ --> $DIR/issue-79422.rs:47:12
|
LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` 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-79422.rs:24:10
+ --> $DIR/issue-79422.rs:23:10
|
LL | trait MapLike<K, V> {
| ------- this trait cannot be made into an object...
@@ -30,20 +30,20 @@ LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
= help: consider moving `VRefCont` to another trait
error[E0038]: the trait `MapLike` cannot be made into an object
- --> $DIR/issue-79422.rs:45:13
+ --> $DIR/issue-79422.rs:44:13
|
LL | let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` 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-79422.rs:24:10
+ --> $DIR/issue-79422.rs:23:10
|
LL | trait MapLike<K, V> {
| ------- this trait cannot be made into an object...
LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
| ^^^^^^^^ ...because it contains the generic associated type `VRefCont`
= help: consider moving `VRefCont` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>>` for `Box<BTreeMap<u8, u8>>`
+ = note: required for `Box<BTreeMap<u8, u8>>` to implement `CoerceUnsized<Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>>`
= note: required by cast to type `Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/generic-associated-types/issue-79422.extended.stderr b/src/test/ui/generic-associated-types/issue-79422.extended.stderr
index 9bcbd7471..58c921bf0 100644
--- a/src/test/ui/generic-associated-types/issue-79422.extended.stderr
+++ b/src/test/ui/generic-associated-types/issue-79422.extended.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `MapLike::VRefCont`
- --> $DIR/issue-79422.rs:48:36
+ --> $DIR/issue-79422.rs:47:36
|
LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
| ^^^^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-79422.rs:24:10
+ --> $DIR/issue-79422.rs:23:10
|
LL | type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
| ^^^^^^^^ --
@@ -15,13 +15,13 @@ LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>;
| ~~~~~~~~~~~~
error[E0271]: type mismatch resolving `<BTreeMap<u8, u8> as MapLike<u8, u8>>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)`
- --> $DIR/issue-79422.rs:45:13
+ --> $DIR/issue-79422.rs:44:13
|
LL | let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<BTreeMap<u8, u8> as MapLike<u8, u8>>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)`
|
note: expected this to be `(dyn RefCont<'_, u8> + 'static)`
- --> $DIR/issue-79422.rs:29:25
+ --> $DIR/issue-79422.rs:28:25
|
LL | type VRefCont<'a> = &'a V where Self: 'a;
| ^^^^^
diff --git a/src/test/ui/generic-associated-types/issue-79422.rs b/src/test/ui/generic-associated-types/issue-79422.rs
index 7749975e6..a52dd792d 100644
--- a/src/test/ui/generic-associated-types/issue-79422.rs
+++ b/src/test/ui/generic-associated-types/issue-79422.rs
@@ -1,6 +1,5 @@
// revisions: base extended
-#![feature(generic_associated_types)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/issue-79636-1.rs b/src/test/ui/generic-associated-types/issue-79636-1.rs
index 6d73fd68d..a89039b5c 100644
--- a/src/test/ui/generic-associated-types/issue-79636-1.rs
+++ b/src/test/ui/generic-associated-types/issue-79636-1.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Monad {
type Unwrapped;
type Wrapped<B>;
diff --git a/src/test/ui/generic-associated-types/issue-79636-1.stderr b/src/test/ui/generic-associated-types/issue-79636-1.stderr
index 1ecb86282..155477048 100644
--- a/src/test/ui/generic-associated-types/issue-79636-1.stderr
+++ b/src/test/ui/generic-associated-types/issue-79636-1.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `Monad::Wrapped`
- --> $DIR/issue-79636-1.rs:15:34
+ --> $DIR/issue-79636-1.rs:13:34
|
LL | MInner: Monad<Unwrapped = A, Wrapped = MOuter::Wrapped<A>>,
| ^^^^^^^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `B`
- --> $DIR/issue-79636-1.rs:5:10
+ --> $DIR/issue-79636-1.rs:3:10
|
LL | type Wrapped<B>;
| ^^^^^^^ -
diff --git a/src/test/ui/generic-associated-types/issue-79636-2.rs b/src/test/ui/generic-associated-types/issue-79636-2.rs
index cdaf2e483..ff5ff38c9 100644
--- a/src/test/ui/generic-associated-types/issue-79636-2.rs
+++ b/src/test/ui/generic-associated-types/issue-79636-2.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait SomeTrait {
type Wrapped<A>: SomeTrait;
diff --git a/src/test/ui/generic-associated-types/issue-79636-2.stderr b/src/test/ui/generic-associated-types/issue-79636-2.stderr
index ae61b7b10..6a36bfc37 100644
--- a/src/test/ui/generic-associated-types/issue-79636-2.stderr
+++ b/src/test/ui/generic-associated-types/issue-79636-2.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `SomeTrait::Wrapped`
- --> $DIR/issue-79636-2.rs:11:18
+ --> $DIR/issue-79636-2.rs:9:18
|
LL | W: SomeTrait<Wrapped = W>,
| ^^^^^^^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `A`
- --> $DIR/issue-79636-2.rs:4:10
+ --> $DIR/issue-79636-2.rs:2:10
|
LL | type Wrapped<A>: SomeTrait;
| ^^^^^^^ -
diff --git a/src/test/ui/generic-associated-types/issue-80433-reduced.rs b/src/test/ui/generic-associated-types/issue-80433-reduced.rs
index f15d4d8b1..44831a995 100644
--- a/src/test/ui/generic-associated-types/issue-80433-reduced.rs
+++ b/src/test/ui/generic-associated-types/issue-80433-reduced.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
struct E {}
trait TestMut {
diff --git a/src/test/ui/generic-associated-types/issue-80433.rs b/src/test/ui/generic-associated-types/issue-80433.rs
index 6a1fe7519..05ff82fa7 100644
--- a/src/test/ui/generic-associated-types/issue-80433.rs
+++ b/src/test/ui/generic-associated-types/issue-80433.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
#[derive(Default)]
struct E<T> {
data: T,
diff --git a/src/test/ui/generic-associated-types/issue-80433.stderr b/src/test/ui/generic-associated-types/issue-80433.stderr
index d8c210dcf..20a407dd4 100644
--- a/src/test/ui/generic-associated-types/issue-80433.stderr
+++ b/src/test/ui/generic-associated-types/issue-80433.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `TestMut::Output`
- --> $DIR/issue-80433.rs:23:47
+ --> $DIR/issue-80433.rs:21:47
|
LL | fn test_simpler<'a>(dst: &'a mut impl TestMut<Output = &'a mut f32>)
| ^^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-80433.rs:9:10
+ --> $DIR/issue-80433.rs:7:10
|
LL | type Output<'a>;
| ^^^^^^ --
diff --git a/src/test/ui/generic-associated-types/issue-81487.rs b/src/test/ui/generic-associated-types/issue-81487.rs
index 7f399c4f9..0d19a75bb 100644
--- a/src/test/ui/generic-associated-types/issue-81487.rs
+++ b/src/test/ui/generic-associated-types/issue-81487.rs
@@ -1,7 +1,5 @@
// build-pass
-#![feature(generic_associated_types)]
-
trait Trait {
type Ref<'a>;
}
diff --git a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs
index fa2f86242..a7cc9a605 100644
--- a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs
+++ b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs
@@ -1,7 +1,5 @@
// Regression test for #81712.
-#![feature(generic_associated_types)]
-
trait A {
type BType: B<AType = Self>;
}
diff --git a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr
index 86c99c32f..c8961e28e 100644
--- a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr
+++ b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `C::DType`
- --> $DIR/issue-81712-cyclic-traits.rs:16:19
+ --> $DIR/issue-81712-cyclic-traits.rs:14:19
|
LL | type CType: C<DType = Self>;
| ^^^^^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/issue-81712-cyclic-traits.rs:13:10
+ --> $DIR/issue-81712-cyclic-traits.rs:11:10
|
LL | type DType<T>: D<T, CType = Self>;
| ^^^^^ -
diff --git a/src/test/ui/generic-associated-types/issue-81862.rs b/src/test/ui/generic-associated-types/issue-81862.rs
index e457bca0c..bde828b77 100644
--- a/src/test/ui/generic-associated-types/issue-81862.rs
+++ b/src/test/ui/generic-associated-types/issue-81862.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait StreamingIterator {
type Item<'a>;
fn next(&mut self) -> Option<Self::Item>;
diff --git a/src/test/ui/generic-associated-types/issue-81862.stderr b/src/test/ui/generic-associated-types/issue-81862.stderr
index c664b3ee6..ba7980846 100644
--- a/src/test/ui/generic-associated-types/issue-81862.stderr
+++ b/src/test/ui/generic-associated-types/issue-81862.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `StreamingIterator::Item`
- --> $DIR/issue-81862.rs:5:40
+ --> $DIR/issue-81862.rs:3:40
|
LL | fn next(&mut self) -> Option<Self::Item>;
| ^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-81862.rs:4:10
+ --> $DIR/issue-81862.rs:2:10
|
LL | type Item<'a>;
| ^^^^ --
diff --git a/src/test/ui/generic-associated-types/issue-84931.rs b/src/test/ui/generic-associated-types/issue-84931.rs
index 9e247de16..4123ce9d4 100644
--- a/src/test/ui/generic-associated-types/issue-84931.rs
+++ b/src/test/ui/generic-associated-types/issue-84931.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
// check-fail
trait StreamingIter {
diff --git a/src/test/ui/generic-associated-types/issue-84931.stderr b/src/test/ui/generic-associated-types/issue-84931.stderr
index 11c3dffde..fffea98a4 100644
--- a/src/test/ui/generic-associated-types/issue-84931.stderr
+++ b/src/test/ui/generic-associated-types/issue-84931.stderr
@@ -1,5 +1,5 @@
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/issue-84931.rs:15:21
+ --> $DIR/issue-84931.rs:14:21
|
LL | type Item<'a> = &'a mut T;
| ^^^^^^^^^- help: consider adding a where clause: `where T: 'a`
diff --git a/src/test/ui/generic-associated-types/issue-85921.rs b/src/test/ui/generic-associated-types/issue-85921.rs
index df59f497d..d281ed9ee 100644
--- a/src/test/ui/generic-associated-types/issue-85921.rs
+++ b/src/test/ui/generic-associated-types/issue-85921.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Trait {
type Assoc<'a>;
diff --git a/src/test/ui/generic-associated-types/issue-86218-2.rs b/src/test/ui/generic-associated-types/issue-86218-2.rs
new file mode 100644
index 000000000..63c839ea8
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-86218-2.rs
@@ -0,0 +1,23 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+
+pub trait Stream {
+ type Item;
+}
+
+impl Stream for () {
+ type Item = i32;
+}
+
+trait Yay<AdditionalValue> {
+ type InnerStream<'s>: Stream<Item = i32> + 's;
+ fn foo<'s>() -> Self::InnerStream<'s>;
+}
+
+impl<T> Yay<T> for () {
+ type InnerStream<'s> = impl Stream<Item = i32> + 's;
+ fn foo<'s>() -> Self::InnerStream<'s> { () }
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/bugs/issue-86218.rs b/src/test/ui/generic-associated-types/issue-86218.rs
index fb62c10a9..b2c3071f0 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-86218.rs
+++ b/src/test/ui/generic-associated-types/issue-86218.rs
@@ -1,9 +1,5 @@
-// check-fail
-// known-bug: #86218
+// check-pass
-// This should pass, but seems to run into a TAIT issue.
-
-#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
pub trait Stream {
@@ -21,7 +17,8 @@ trait Yay<AdditionalValue> {
impl<'a> Yay<&'a ()> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
- fn foo<'s>() -> Self::InnerStream<'s> { todo!() }
+ //^ ERROR does not fulfill the required lifetime
+ fn foo<'s>() -> Self::InnerStream<'s> { () }
}
fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-86483.rs b/src/test/ui/generic-associated-types/issue-86483.rs
index 07dd0bffd..70267637a 100644
--- a/src/test/ui/generic-associated-types/issue-86483.rs
+++ b/src/test/ui/generic-associated-types/issue-86483.rs
@@ -4,8 +4,6 @@
//
// check-pass
-#![feature(generic_associated_types)]
-
pub trait IceIce<T>
where
for<'a> T: 'a,
diff --git a/src/test/ui/generic-associated-types/issue-86787.rs b/src/test/ui/generic-associated-types/issue-86787.rs
index 0f8096c8a..96075ca50 100644
--- a/src/test/ui/generic-associated-types/issue-86787.rs
+++ b/src/test/ui/generic-associated-types/issue-86787.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
// check-fail
enum Either<L, R> {
diff --git a/src/test/ui/generic-associated-types/issue-86787.stderr b/src/test/ui/generic-associated-types/issue-86787.stderr
index d4b2267d3..f34c63cf7 100644
--- a/src/test/ui/generic-associated-types/issue-86787.stderr
+++ b/src/test/ui/generic-associated-types/issue-86787.stderr
@@ -1,5 +1,5 @@
error: missing required bound on `TRef`
- --> $DIR/issue-86787.rs:11:5
+ --> $DIR/issue-86787.rs:10:5
|
LL | type TRef<'a>;
| ^^^^^^^^^^^^^-
diff --git a/src/test/ui/generic-associated-types/issue-87258_a.rs b/src/test/ui/generic-associated-types/issue-87258_a.rs
index c65f3fb2a..9ab683d3d 100644
--- a/src/test/ui/generic-associated-types/issue-87258_a.rs
+++ b/src/test/ui/generic-associated-types/issue-87258_a.rs
@@ -1,5 +1,4 @@
#![feature(type_alias_impl_trait)]
-#![feature(generic_associated_types)]
// See https://github.com/rust-lang/rust/issues/87258#issuecomment-883293367
diff --git a/src/test/ui/generic-associated-types/issue-87258_a.stderr b/src/test/ui/generic-associated-types/issue-87258_a.stderr
index db3a5c819..eae9bd9b1 100644
--- a/src/test/ui/generic-associated-types/issue-87258_a.stderr
+++ b/src/test/ui/generic-associated-types/issue-87258_a.stderr
@@ -1,10 +1,10 @@
error: unconstrained opaque type
- --> $DIR/issue-87258_a.rs:18:26
+ --> $DIR/issue-87258_a.rs:17:26
|
LL | type FooFuture<'a> = impl Trait1;
| ^^^^^^^^^^^
|
- = note: `FooFuture` must be used in combination with a concrete type within the same module
+ = note: `FooFuture` must be used in combination with a concrete type within the same impl
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-87258_b.rs b/src/test/ui/generic-associated-types/issue-87258_b.rs
index f59e0d766..7b7610b21 100644
--- a/src/test/ui/generic-associated-types/issue-87258_b.rs
+++ b/src/test/ui/generic-associated-types/issue-87258_b.rs
@@ -1,5 +1,4 @@
#![feature(type_alias_impl_trait)]
-#![feature(generic_associated_types)]
// See https://github.com/rust-lang/rust/issues/87258#issuecomment-883293367
diff --git a/src/test/ui/generic-associated-types/issue-87258_b.stderr b/src/test/ui/generic-associated-types/issue-87258_b.stderr
index 9faccc961..0ee665f38 100644
--- a/src/test/ui/generic-associated-types/issue-87258_b.stderr
+++ b/src/test/ui/generic-associated-types/issue-87258_b.stderr
@@ -1,5 +1,5 @@
error: unconstrained opaque type
- --> $DIR/issue-87258_b.rs:17:49
+ --> $DIR/issue-87258_b.rs:16:49
|
LL | type Helper<'xenon, 'yttrium, KABOOM: Trait2> = impl Trait1;
| ^^^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/issue-87429-2.rs b/src/test/ui/generic-associated-types/issue-87429-2.rs
index d35bb098a..feb43ee5a 100644
--- a/src/test/ui/generic-associated-types/issue-87429-2.rs
+++ b/src/test/ui/generic-associated-types/issue-87429-2.rs
@@ -4,8 +4,6 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Family {
type Member<'a, C: Eq>: for<'b> MyBound<'b, C>;
}
diff --git a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs
index 9ee07c2f1..2006f9bc7 100644
--- a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs
+++ b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.rs
@@ -1,7 +1,6 @@
// check-fail
#![feature(associated_type_defaults)]
-#![feature(generic_associated_types)]
trait Family {
// Fine, i32: PartialEq<i32>
diff --git a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr
index c6fa02cb9..b1abe012b 100644
--- a/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr
+++ b/src/test/ui/generic-associated-types/issue-87429-associated-type-default.stderr
@@ -1,12 +1,12 @@
error[E0277]: can't compare `Foo` with `Foo`
- --> $DIR/issue-87429-associated-type-default.rs:14:60
+ --> $DIR/issue-87429-associated-type-default.rs:13:60
|
LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
| ^^^ no implementation for `Foo == Foo`
|
= help: the trait `PartialEq` is not implemented for `Foo`
note: required by a bound in `Family2::Member`
- --> $DIR/issue-87429-associated-type-default.rs:14:22
+ --> $DIR/issue-87429-associated-type-default.rs:13:22
|
LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>> = Foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family2::Member`
diff --git a/src/test/ui/generic-associated-types/issue-87429-specialization.rs b/src/test/ui/generic-associated-types/issue-87429-specialization.rs
index b365e07fe..6e31f1b21 100644
--- a/src/test/ui/generic-associated-types/issue-87429-specialization.rs
+++ b/src/test/ui/generic-associated-types/issue-87429-specialization.rs
@@ -2,7 +2,6 @@
#![feature(specialization)]
//~^ WARN incomplete
-#![feature(generic_associated_types)]
trait Family {
type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
diff --git a/src/test/ui/generic-associated-types/issue-87429-specialization.stderr b/src/test/ui/generic-associated-types/issue-87429-specialization.stderr
index 015e0c779..11c4ebf60 100644
--- a/src/test/ui/generic-associated-types/issue-87429-specialization.stderr
+++ b/src/test/ui/generic-associated-types/issue-87429-specialization.stderr
@@ -4,19 +4,19 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0277]: can't compare `Foo` with `Foo`
- --> $DIR/issue-87429-specialization.rs:21:31
+ --> $DIR/issue-87429-specialization.rs:20:31
|
LL | default type Member<'a> = Foo;
| ^^^ no implementation for `Foo == Foo`
|
= help: the trait `PartialEq` is not implemented for `Foo`
note: required by a bound in `Family::Member`
- --> $DIR/issue-87429-specialization.rs:8:22
+ --> $DIR/issue-87429-specialization.rs:7:22
|
LL | type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Family::Member`
diff --git a/src/test/ui/generic-associated-types/issue-87429.rs b/src/test/ui/generic-associated-types/issue-87429.rs
index f905348ae..56394823c 100644
--- a/src/test/ui/generic-associated-types/issue-87429.rs
+++ b/src/test/ui/generic-associated-types/issue-87429.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Family {
type Member<'a>: for<'b> PartialEq<Self::Member<'b>>;
}
diff --git a/src/test/ui/generic-associated-types/issue-87748.rs b/src/test/ui/generic-associated-types/issue-87748.rs
new file mode 100644
index 000000000..6cbe3d902
--- /dev/null
+++ b/src/test/ui/generic-associated-types/issue-87748.rs
@@ -0,0 +1,21 @@
+// Checks that we properly add implied bounds from unnormalized projections in
+// inputs when typechecking functions.
+
+// check-pass
+
+trait MyTrait {
+ type Assoc<'a, 'b> where 'b: 'a;
+ fn do_sth(arg: Self::Assoc<'_, '_>);
+ fn do_sth2(arg: Self::Assoc<'_, '_>) {}
+}
+
+struct Foo;
+
+impl MyTrait for Foo {
+ type Assoc<'a, 'b> = u32 where 'b: 'a;
+
+ fn do_sth(_: u32) {}
+ fn do_sth2(_: Self::Assoc<'static, 'static>) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-87750.rs b/src/test/ui/generic-associated-types/issue-87750.rs
index 89bd79ac2..0a11a0f3a 100644
--- a/src/test/ui/generic-associated-types/issue-87750.rs
+++ b/src/test/ui/generic-associated-types/issue-87750.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait PointerFamily {
type Pointer<T>;
}
diff --git a/src/test/ui/generic-associated-types/issue-87750.stderr b/src/test/ui/generic-associated-types/issue-87750.stderr
index 854541f3d..b358ca273 100644
--- a/src/test/ui/generic-associated-types/issue-87750.stderr
+++ b/src/test/ui/generic-associated-types/issue-87750.stderr
@@ -1,5 +1,5 @@
error[E0275]: overflow evaluating the requirement `Node<i32, RcFamily>: Sized`
- --> $DIR/issue-87750.rs:20:16
+ --> $DIR/issue-87750.rs:18:16
|
LL | let _list: <RcFamily as PointerFamily>::Pointer<Node<i32, RcFamily>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/issue-88287.rs b/src/test/ui/generic-associated-types/issue-88287.rs
index 4952a0825..82188493d 100644
--- a/src/test/ui/generic-associated-types/issue-88287.rs
+++ b/src/test/ui/generic-associated-types/issue-88287.rs
@@ -1,6 +1,5 @@
// edition:2018
-#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
use std::future::Future;
diff --git a/src/test/ui/generic-associated-types/issue-88287.stderr b/src/test/ui/generic-associated-types/issue-88287.stderr
index 5241d85a5..1b84cce62 100644
--- a/src/test/ui/generic-associated-types/issue-88287.stderr
+++ b/src/test/ui/generic-associated-types/issue-88287.stderr
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `A` cannot be known at compilation time
- --> $DIR/issue-88287.rs:35:9
+ --> $DIR/issue-88287.rs:34:9
|
LL | type SearchFutureTy<'f, A, B: 'f>
| - this type parameter needs to be `std::marker::Sized`
@@ -8,7 +8,7 @@ LL | async move { todo!() }
| ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
note: required by a bound in `<T as SearchableResourceExt<Criteria>>`
- --> $DIR/issue-88287.rs:25:6
+ --> $DIR/issue-88287.rs:24:6
|
LL | impl<T, Criteria> SearchableResourceExt<Criteria> for T
| ^ required by this bound in `<T as SearchableResourceExt<Criteria>>`
diff --git a/src/test/ui/generic-associated-types/issue-88360.rs b/src/test/ui/generic-associated-types/issue-88360.rs
index 8ee98201a..c02690618 100644
--- a/src/test/ui/generic-associated-types/issue-88360.rs
+++ b/src/test/ui/generic-associated-types/issue-88360.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait GatTrait {
type Gat<'a> where Self: 'a;
diff --git a/src/test/ui/generic-associated-types/issue-88360.stderr b/src/test/ui/generic-associated-types/issue-88360.stderr
index 5f769d799..cd3750344 100644
--- a/src/test/ui/generic-associated-types/issue-88360.stderr
+++ b/src/test/ui/generic-associated-types/issue-88360.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-88360.rs:15:9
+ --> $DIR/issue-88360.rs:13:9
|
LL | trait SuperTrait<T>
| - this type parameter
diff --git a/src/test/ui/generic-associated-types/issue-88405.rs b/src/test/ui/generic-associated-types/issue-88405.rs
index 4a405bd36..8dad6a89f 100644
--- a/src/test/ui/generic-associated-types/issue-88405.rs
+++ b/src/test/ui/generic-associated-types/issue-88405.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait SomeTrait {}
trait OtherTrait {
type Item;
diff --git a/src/test/ui/generic-associated-types/issue-88459.rs b/src/test/ui/generic-associated-types/issue-88459.rs
index 3b26a1801..07d7bc06d 100644
--- a/src/test/ui/generic-associated-types/issue-88459.rs
+++ b/src/test/ui/generic-associated-types/issue-88459.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
trait Trait {
type Assoc<'a>;
}
diff --git a/src/test/ui/generic-associated-types/issue-88595.rs b/src/test/ui/generic-associated-types/issue-88595.rs
index e0796dfec..24641ee1f 100644
--- a/src/test/ui/generic-associated-types/issue-88595.rs
+++ b/src/test/ui/generic-associated-types/issue-88595.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
fn main() {}
diff --git a/src/test/ui/generic-associated-types/issue-88595.stderr b/src/test/ui/generic-associated-types/issue-88595.stderr
index 79d3479af..bcefc8066 100644
--- a/src/test/ui/generic-associated-types/issue-88595.stderr
+++ b/src/test/ui/generic-associated-types/issue-88595.stderr
@@ -1,11 +1,11 @@
error: non-defining opaque type use in defining scope
- --> $DIR/issue-88595.rs:21:35
+ --> $DIR/issue-88595.rs:20:35
|
LL | fn a(&'a self) -> Self::B<'a> {}
| ^^
|
note: lifetime used multiple times
- --> $DIR/issue-88595.rs:18:6
+ --> $DIR/issue-88595.rs:17:6
|
LL | impl<'a> A<'a> for C {
| ^^
diff --git a/src/test/ui/generic-associated-types/bugs/issue-89008.rs b/src/test/ui/generic-associated-types/issue-89008.rs
index 79c28b0d2..669dbafb5 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-89008.rs
+++ b/src/test/ui/generic-associated-types/issue-89008.rs
@@ -1,43 +1,36 @@
-// check-fail
+// check-pass
// edition:2021
-// known-bug: #88908
-
-// This should pass, but seems to run into a TAIT bug.
#![feature(type_alias_impl_trait)]
-#![feature(generic_associated_types)]
use std::future::Future;
+use std::marker::PhantomData;
trait Stream {
type Item;
}
-struct Empty<T>(T);
-impl<T> Stream for Empty<T> {
- type Item = ();
+struct Empty<T> {
+ _phantom: PhantomData<T>,
}
-fn empty<T>() -> Empty<T> {
- todo!()
+
+impl<T> Stream for Empty<T> {
+ type Item = T;
}
trait X {
type LineStream<'a, Repr>: Stream<Item = Repr> where Self: 'a;
-
- type LineStreamFut<'a,Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a;
-
- fn line_stream<'a,Repr>(&'a self) -> Self::LineStreamFut<'a,Repr>;
+ type LineStreamFut<'a, Repr>: Future<Output = Self::LineStream<'a, Repr>> where Self: 'a;
+ fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr>;
}
struct Y;
impl X for Y {
type LineStream<'a, Repr> = impl Stream<Item = Repr>;
-
- type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>> ;
-
+ type LineStreamFut<'a, Repr> = impl Future<Output = Self::LineStream<'a, Repr>>;
fn line_stream<'a, Repr>(&'a self) -> Self::LineStreamFut<'a, Repr> {
- async {empty()}
+ async { Empty { _phantom: PhantomData } }
}
}
diff --git a/src/test/ui/generic-associated-types/issue-89352.rs b/src/test/ui/generic-associated-types/issue-89352.rs
index d9c656d5f..1896d0c87 100644
--- a/src/test/ui/generic-associated-types/issue-89352.rs
+++ b/src/test/ui/generic-associated-types/issue-89352.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
use std::marker::PhantomData;
pub trait GenAssoc<T> {
diff --git a/src/test/ui/generic-associated-types/issue-90014.rs b/src/test/ui/generic-associated-types/issue-90014.rs
index f110b0693..55db95a6d 100644
--- a/src/test/ui/generic-associated-types/issue-90014.rs
+++ b/src/test/ui/generic-associated-types/issue-90014.rs
@@ -1,6 +1,5 @@
// edition:2018
-#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
use std::future::Future;
diff --git a/src/test/ui/generic-associated-types/issue-90014.stderr b/src/test/ui/generic-associated-types/issue-90014.stderr
index 457c582e8..2d3f4a6af 100644
--- a/src/test/ui/generic-associated-types/issue-90014.stderr
+++ b/src/test/ui/generic-associated-types/issue-90014.stderr
@@ -1,5 +1,5 @@
error[E0477]: the type `&mut ()` does not fulfill the required lifetime
- --> $DIR/issue-90014.rs:14:20
+ --> $DIR/issue-90014.rs:13:20
|
LL | type Fut<'a> where Self: 'a;
| ------------ definition of `Fut` from trait
@@ -8,7 +8,7 @@ LL | type Fut<'a> = impl Future<Output = ()>;
| ^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a`
|
note: type must outlive the lifetime `'a` as defined here
- --> $DIR/issue-90014.rs:14:14
+ --> $DIR/issue-90014.rs:13:14
|
LL | type Fut<'a> = impl Future<Output = ()>;
| ^^
diff --git a/src/test/ui/generic-associated-types/issue-90729.rs b/src/test/ui/generic-associated-types/issue-90729.rs
index 98295cce8..bcec2e321 100644
--- a/src/test/ui/generic-associated-types/issue-90729.rs
+++ b/src/test/ui/generic-associated-types/issue-90729.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
use std::marker::PhantomData;
pub trait Type {
diff --git a/src/test/ui/generic-associated-types/issue-91139.migrate.stderr b/src/test/ui/generic-associated-types/issue-91139.migrate.stderr
index b424d9a2f..690160577 100644
--- a/src/test/ui/generic-associated-types/issue-91139.migrate.stderr
+++ b/src/test/ui/generic-associated-types/issue-91139.migrate.stderr
@@ -1,13 +1,8 @@
-error[E0311]: the parameter type `T` may not live long enough
- --> $DIR/issue-91139.rs:27:12
+error: expected identifier, found `<<`
+ --> $DIR/issue-91139.rs:1:1
|
-LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
- |
-help: consider adding an explicit lifetime bound...
- |
-LL | fn foo<T: 'a>() {
- | ++++
+LL | <<<<<<< HEAD
+ | ^^ expected identifier
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/issue-91139.rs b/src/test/ui/generic-associated-types/issue-91139.rs
index 40eef11f0..5fc6071c9 100644
--- a/src/test/ui/generic-associated-types/issue-91139.rs
+++ b/src/test/ui/generic-associated-types/issue-91139.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Foo<T> {
type Type<'a>
where
diff --git a/src/test/ui/generic-associated-types/issue-91139.stderr b/src/test/ui/generic-associated-types/issue-91139.stderr
index b789b3a42..8bbe98fa1 100644
--- a/src/test/ui/generic-associated-types/issue-91139.stderr
+++ b/src/test/ui/generic-associated-types/issue-91139.stderr
@@ -1,41 +1,41 @@
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:12
+ --> $DIR/issue-91139.rs:14:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:12
+ --> $DIR/issue-91139.rs:14:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:12
+ --> $DIR/issue-91139.rs:14:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:12
+ --> $DIR/issue-91139.rs:14:12
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:58
+ --> $DIR/issue-91139.rs:14:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:58
+ --> $DIR/issue-91139.rs:14:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/issue-91139.rs:16:58
+ --> $DIR/issue-91139.rs:14:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
@@ -46,13 +46,13 @@ LL | fn foo<T: 'static>() {
| +++++++++
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:58
+ --> $DIR/issue-91139.rs:14:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
error: `T` does not live long enough
- --> $DIR/issue-91139.rs:16:58
+ --> $DIR/issue-91139.rs:14:58
|
LL | let _: for<'a> fn(<() as Foo<T>>::Type<'a>, &'a T) = |_, _| ();
| ^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/issue-91883.rs b/src/test/ui/generic-associated-types/issue-91883.rs
index 3d4585a44..e870e08a3 100644
--- a/src/test/ui/generic-associated-types/issue-91883.rs
+++ b/src/test/ui/generic-associated-types/issue-91883.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
use std::fmt::Debug;
use std::marker::PhantomData;
diff --git a/src/test/ui/generic-associated-types/issue-91883.stderr b/src/test/ui/generic-associated-types/issue-91883.stderr
index baf4889cc..1cfc2aaf1 100644
--- a/src/test/ui/generic-associated-types/issue-91883.stderr
+++ b/src/test/ui/generic-associated-types/issue-91883.stderr
@@ -1,5 +1,5 @@
error[E0478]: lifetime bound not satisfied
- --> $DIR/issue-91883.rs:32:24
+ --> $DIR/issue-91883.rs:30:24
|
LL | type Cursor<'tx>: Cursor<'tx>
| ----------------------------- definition of `Cursor` from trait
@@ -8,12 +8,12 @@ LL | type Cursor<'tx> = CursorImpl<'tx>;
| ^^^^^^^^^^^^^^^- help: try copying these clauses from the trait: `where 'db: 'tx, Self: 'tx`
|
note: lifetime parameter instantiated with the lifetime `'db` as defined here
- --> $DIR/issue-91883.rs:31:6
+ --> $DIR/issue-91883.rs:29:6
|
LL | impl<'db> Transaction<'db> for TransactionImpl<'db> {
| ^^^
note: but lifetime parameter must outlive the lifetime `'tx` as defined here
- --> $DIR/issue-91883.rs:32:17
+ --> $DIR/issue-91883.rs:30:17
|
LL | type Cursor<'tx> = CursorImpl<'tx>;
| ^^^
diff --git a/src/test/ui/generic-associated-types/issue-92033.rs b/src/test/ui/generic-associated-types/issue-92033.rs
index 1d5f7d5c0..d111580b8 100644
--- a/src/test/ui/generic-associated-types/issue-92033.rs
+++ b/src/test/ui/generic-associated-types/issue-92033.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
struct Texture;
trait Surface {
diff --git a/src/test/ui/generic-associated-types/issue-92033.stderr b/src/test/ui/generic-associated-types/issue-92033.stderr
index 6dd901027..cd7eed254 100644
--- a/src/test/ui/generic-associated-types/issue-92033.stderr
+++ b/src/test/ui/generic-associated-types/issue-92033.stderr
@@ -1,5 +1,5 @@
error[E0477]: the type `&'s Texture` does not fulfill the required lifetime
- --> $DIR/issue-92033.rs:22:28
+ --> $DIR/issue-92033.rs:20:28
|
LL | type TextureIter<'a>: Iterator<Item = &'a Texture>
| -------------------------------------------------- definition of `TextureIter` from trait
@@ -8,7 +8,7 @@ LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: try copying this clause from the trait: `where Self: 'a`
|
note: type must outlive the lifetime `'a` as defined here
- --> $DIR/issue-92033.rs:22:22
+ --> $DIR/issue-92033.rs:20:22
|
LL | type TextureIter<'a> = std::option::IntoIter<&'a Texture>;
| ^^
diff --git a/src/test/ui/generic-associated-types/issue-92096.migrate.stderr b/src/test/ui/generic-associated-types/issue-92096.migrate.stderr
index c74161cd3..ce1fd6dd9 100644
--- a/src/test/ui/generic-associated-types/issue-92096.migrate.stderr
+++ b/src/test/ui/generic-associated-types/issue-92096.migrate.stderr
@@ -1,5 +1,5 @@
error[E0311]: the parameter type `C` may not live long enough
- --> $DIR/issue-92096.rs:20:33
+ --> $DIR/issue-92096.rs:19:33
|
LL | fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
| ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds
@@ -10,7 +10,7 @@ LL | C: Client + Send + Sync + 'a,
| ++++
error[E0311]: the parameter type `C` may not live long enough
- --> $DIR/issue-92096.rs:20:33
+ --> $DIR/issue-92096.rs:19:33
|
LL | fn call_connect<C>(c: &'_ C) -> impl '_ + Future + Send
| ^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `C` will meet its required lifetime bounds
diff --git a/src/test/ui/generic-associated-types/issue-92096.rs b/src/test/ui/generic-associated-types/issue-92096.rs
index 377b8164a..e285af666 100644
--- a/src/test/ui/generic-associated-types/issue-92096.rs
+++ b/src/test/ui/generic-associated-types/issue-92096.rs
@@ -1,7 +1,5 @@
// edition:2018
-#![feature(generic_associated_types)]
-
use std::future::Future;
trait Client {
diff --git a/src/test/ui/generic-associated-types/issue-92096.stderr b/src/test/ui/generic-associated-types/issue-92096.stderr
index ca61a0f43..91a06d5ac 100644
--- a/src/test/ui/generic-associated-types/issue-92096.stderr
+++ b/src/test/ui/generic-associated-types/issue-92096.stderr
@@ -1,5 +1,5 @@
error: `C` does not live long enough
- --> $DIR/issue-92096.rs:19:5
+ --> $DIR/issue-92096.rs:17:5
|
LL | async move { c.connect().await }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/issue-92280.rs b/src/test/ui/generic-associated-types/issue-92280.rs
index 81d000f10..9284beea3 100644
--- a/src/test/ui/generic-associated-types/issue-92280.rs
+++ b/src/test/ui/generic-associated-types/issue-92280.rs
@@ -1,6 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
#![allow(non_camel_case_types)]
trait HasAssoc {
diff --git a/src/test/ui/generic-associated-types/issue-92954.rs b/src/test/ui/generic-associated-types/issue-92954.rs
index 95c090ff4..22ce8f9fe 100644
--- a/src/test/ui/generic-associated-types/issue-92954.rs
+++ b/src/test/ui/generic-associated-types/issue-92954.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
pub trait Foo {
type Assoc<'c>;
fn function() -> for<'x> fn(Self::Assoc<'x>);
diff --git a/src/test/ui/generic-associated-types/issue-93141.rs b/src/test/ui/generic-associated-types/issue-93141.rs
index 39ca77d13..48c78b9c0 100644
--- a/src/test/ui/generic-associated-types/issue-93141.rs
+++ b/src/test/ui/generic-associated-types/issue-93141.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
pub trait Fooey: Sized {
type Context<'c> where Self: 'c;
}
diff --git a/src/test/ui/generic-associated-types/issue-93262.rs b/src/test/ui/generic-associated-types/issue-93262.rs
index adc6aa8fa..a7bcd111d 100644
--- a/src/test/ui/generic-associated-types/issue-93262.rs
+++ b/src/test/ui/generic-associated-types/issue-93262.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
pub trait Trait {
type Assoc<'a> where Self: 'a;
}
diff --git a/src/test/ui/generic-associated-types/issue-93340.rs b/src/test/ui/generic-associated-types/issue-93340.rs
index d065bde88..4662fda53 100644
--- a/src/test/ui/generic-associated-types/issue-93340.rs
+++ b/src/test/ui/generic-associated-types/issue-93340.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
pub trait Scalar: 'static {
type RefType<'a>: ScalarRef<'a>;
}
diff --git a/src/test/ui/generic-associated-types/issue-93341.rs b/src/test/ui/generic-associated-types/issue-93341.rs
index e96a768ec..737b2bbdb 100644
--- a/src/test/ui/generic-associated-types/issue-93341.rs
+++ b/src/test/ui/generic-associated-types/issue-93341.rs
@@ -1,6 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
use std::marker::PhantomData;
pub struct Id<'id>(PhantomData<fn(&'id ()) -> &'id ()>);
diff --git a/src/test/ui/generic-associated-types/issue-93342.rs b/src/test/ui/generic-associated-types/issue-93342.rs
index d8d7adac9..d4422d5d1 100644
--- a/src/test/ui/generic-associated-types/issue-93342.rs
+++ b/src/test/ui/generic-associated-types/issue-93342.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
use std::marker::PhantomData;
pub trait Scalar: 'static {
diff --git a/src/test/ui/generic-associated-types/issue-93874.rs b/src/test/ui/generic-associated-types/issue-93874.rs
index f403d7516..30956655a 100644
--- a/src/test/ui/generic-associated-types/issue-93874.rs
+++ b/src/test/ui/generic-associated-types/issue-93874.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
pub trait Build {
type Output<O>;
fn build<O>(self, input: O) -> Self::Output<O>;
diff --git a/src/test/ui/generic-associated-types/issue-95305.rs b/src/test/ui/generic-associated-types/issue-95305.rs
index e2f1710fa..6c3ec20e7 100644
--- a/src/test/ui/generic-associated-types/issue-95305.rs
+++ b/src/test/ui/generic-associated-types/issue-95305.rs
@@ -2,7 +2,6 @@
// Forbid it for now but proper support might be added
// at some point in the future.
-#![feature(generic_associated_types)]
#![feature(anonymous_lifetime_in_impl_trait)]
trait Foo {
type Item<'a>;
diff --git a/src/test/ui/generic-associated-types/issue-95305.stderr b/src/test/ui/generic-associated-types/issue-95305.stderr
index d8557525f..eb15cbc62 100644
--- a/src/test/ui/generic-associated-types/issue-95305.stderr
+++ b/src/test/ui/generic-associated-types/issue-95305.stderr
@@ -1,5 +1,5 @@
error[E0637]: `'_` cannot be used here
- --> $DIR/issue-95305.rs:11:26
+ --> $DIR/issue-95305.rs:10:26
|
LL | fn foo(x: &impl Foo<Item<'_> = u32>) { }
| ^^ `'_` is a reserved lifetime name
diff --git a/src/test/ui/generic-associated-types/iterable.rs b/src/test/ui/generic-associated-types/iterable.rs
index af0049891..8ad351bd3 100644
--- a/src/test/ui/generic-associated-types/iterable.rs
+++ b/src/test/ui/generic-associated-types/iterable.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
// run-pass
trait Iterable {
diff --git a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs
index 655abd18d..36974b3df 100644
--- a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs
+++ b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.rs
@@ -1,8 +1,6 @@
// Test that the predicate printed in an unresolved method error prints the
// generics for a generic associated type.
-#![feature(generic_associated_types)]
-
trait X {
type Y<T>;
}
diff --git a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr
index d9dc77ac8..baef38f6b 100644
--- a/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr
+++ b/src/test/ui/generic-associated-types/method-unsatified-assoc-type-predicate.stderr
@@ -1,5 +1,5 @@
error[E0599]: the method `f` exists for struct `S`, but its trait bounds were not satisfied
- --> $DIR/method-unsatified-assoc-type-predicate.rs:30:7
+ --> $DIR/method-unsatified-assoc-type-predicate.rs:28:7
|
LL | struct S;
| --------
@@ -12,7 +12,7 @@ LL | a.f();
| ^ method cannot be called on `S` due to unsatisfied trait bounds
|
note: trait bound `<S as X>::Y<i32> = i32` was not satisfied
- --> $DIR/method-unsatified-assoc-type-predicate.rs:14:11
+ --> $DIR/method-unsatified-assoc-type-predicate.rs:12:11
|
LL | impl<T: X<Y<i32> = i32>> M for T {}
| ^^^^^^^^^^^^ - -
diff --git a/src/test/ui/generic-associated-types/missing-bounds.fixed b/src/test/ui/generic-associated-types/missing-bounds.fixed
index 2315810a4..ee758f19e 100644
--- a/src/test/ui/generic-associated-types/missing-bounds.fixed
+++ b/src/test/ui/generic-associated-types/missing-bounds.fixed
@@ -24,7 +24,7 @@ impl<B: Add + Add<Output = B>> Add for C<B> {
struct D<B>(B);
-impl<B: std::ops::Add<Output=B>> Add for D<B> {
+impl<B: std::ops::Add<Output = B>> Add for D<B> {
type Output = Self;
fn add(self, rhs: Self) -> Self {
diff --git a/src/test/ui/generic-associated-types/missing-bounds.stderr b/src/test/ui/generic-associated-types/missing-bounds.stderr
index 138c642dd..c913483a8 100644
--- a/src/test/ui/generic-associated-types/missing-bounds.stderr
+++ b/src/test/ui/generic-associated-types/missing-bounds.stderr
@@ -66,8 +66,8 @@ LL | Self(self.0 + rhs.0)
|
help: consider restricting type parameter `B`
|
-LL | impl<B: std::ops::Add<Output=B>> Add for D<B> {
- | +++++++++++++++++++++++++
+LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
+ | +++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/missing-bounds.rs:42:14
diff --git a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs
index 8171dc0ae..de9cad308 100644
--- a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs
+++ b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.rs
@@ -1,7 +1,5 @@
// check-fail
-#![feature(generic_associated_types)]
-
trait Foo {
type Assoc<'a, 'b>;
}
diff --git a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr
index edd1f9367..ffdba6676 100644
--- a/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr
+++ b/src/test/ui/generic-associated-types/missing-where-clause-on-trait.stderr
@@ -1,5 +1,5 @@
error[E0276]: impl has stricter requirements than trait
- --> $DIR/missing-where-clause-on-trait.rs:9:39
+ --> $DIR/missing-where-clause-on-trait.rs:7:39
|
LL | type Assoc<'a, 'b>;
| ------------------ definition of `Assoc` from trait
diff --git a/src/test/ui/generic-associated-types/missing_lifetime_args.rs b/src/test/ui/generic-associated-types/missing_lifetime_args.rs
index cd918157f..78def8092 100644
--- a/src/test/ui/generic-associated-types/missing_lifetime_args.rs
+++ b/src/test/ui/generic-associated-types/missing_lifetime_args.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a, 'b>;
}
diff --git a/src/test/ui/generic-associated-types/missing_lifetime_args.stderr b/src/test/ui/generic-associated-types/missing_lifetime_args.stderr
index 7cf3f4b73..0ad1f1f8c 100644
--- a/src/test/ui/generic-associated-types/missing_lifetime_args.stderr
+++ b/src/test/ui/generic-associated-types/missing_lifetime_args.stderr
@@ -1,11 +1,11 @@
error[E0107]: missing generics for associated type `X::Y`
- --> $DIR/missing_lifetime_args.rs:13:32
+ --> $DIR/missing_lifetime_args.rs:11:32
|
LL | fn foo<'c, 'd>(_arg: Box<dyn X<Y = (&'c u32, &'d u32)>>) {}
| ^ expected 2 lifetime arguments
|
note: associated type defined here, with 2 lifetime parameters: `'a`, `'b`
- --> $DIR/missing_lifetime_args.rs:4:10
+ --> $DIR/missing_lifetime_args.rs:2:10
|
LL | type Y<'a, 'b>;
| ^ -- --
@@ -15,7 +15,7 @@ LL | fn foo<'c, 'd>(_arg: Box<dyn X<Y<'c, 'd> = (&'c u32, &'d u32)>>) {}
| ~~~~~~~~~
error[E0107]: this struct takes 3 lifetime arguments but 2 lifetime arguments were supplied
- --> $DIR/missing_lifetime_args.rs:16:26
+ --> $DIR/missing_lifetime_args.rs:14:26
|
LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b>) {}
| ^^^ -- -- supplied 2 lifetime arguments
@@ -23,7 +23,7 @@ LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b>) {}
| expected 3 lifetime arguments
|
note: struct defined here, with 3 lifetime parameters: `'a`, `'b`, `'c`
- --> $DIR/missing_lifetime_args.rs:7:8
+ --> $DIR/missing_lifetime_args.rs:5:8
|
LL | struct Foo<'a, 'b, 'c> {
| ^^^ -- -- --
@@ -33,7 +33,7 @@ LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b, 'a>) {}
| ++++
error[E0107]: this struct takes 3 lifetime arguments but 1 lifetime argument was supplied
- --> $DIR/missing_lifetime_args.rs:19:16
+ --> $DIR/missing_lifetime_args.rs:17:16
|
LL | fn f<'a>(_arg: Foo<'a>) {}
| ^^^ -- supplied 1 lifetime argument
@@ -41,7 +41,7 @@ LL | fn f<'a>(_arg: Foo<'a>) {}
| expected 3 lifetime arguments
|
note: struct defined here, with 3 lifetime parameters: `'a`, `'b`, `'c`
- --> $DIR/missing_lifetime_args.rs:7:8
+ --> $DIR/missing_lifetime_args.rs:5:8
|
LL | struct Foo<'a, 'b, 'c> {
| ^^^ -- -- --
diff --git a/src/test/ui/generic-associated-types/missing_lifetime_const.rs b/src/test/ui/generic-associated-types/missing_lifetime_const.rs
index e3e78dd96..8b174b9e9 100644
--- a/src/test/ui/generic-associated-types/missing_lifetime_const.rs
+++ b/src/test/ui/generic-associated-types/missing_lifetime_const.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Foo {
type Assoc<'a, const N: usize>;
}
diff --git a/src/test/ui/generic-associated-types/missing_lifetime_const.stderr b/src/test/ui/generic-associated-types/missing_lifetime_const.stderr
index 5d50637bd..62d2e9f49 100644
--- a/src/test/ui/generic-associated-types/missing_lifetime_const.stderr
+++ b/src/test/ui/generic-associated-types/missing_lifetime_const.stderr
@@ -1,11 +1,11 @@
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
- --> $DIR/missing_lifetime_const.rs:8:24
+ --> $DIR/missing_lifetime_const.rs:6:24
|
LL | let _: <T as Foo>::Assoc<3>;
| ^^^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/missing_lifetime_const.rs:4:10
+ --> $DIR/missing_lifetime_const.rs:2:10
|
LL | type Assoc<'a, const N: usize>;
| ^^^^^ --
diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind.rs b/src/test/ui/generic-associated-types/parameter_number_and_kind.rs
index 0508cc2da..8428e7763 100644
--- a/src/test/ui/generic-associated-types/parameter_number_and_kind.rs
+++ b/src/test/ui/generic-associated-types/parameter_number_and_kind.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
trait Foo {
diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr b/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr
index 53d76fd22..c20b9669e 100644
--- a/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr
+++ b/src/test/ui/generic-associated-types/parameter_number_and_kind.stderr
@@ -1,5 +1,5 @@
error[E0107]: this associated type takes 1 lifetime argument but 2 lifetime arguments were supplied
- --> $DIR/parameter_number_and_kind.rs:12:24
+ --> $DIR/parameter_number_and_kind.rs:11:24
|
LL | type FErr1 = Self::E<'static, 'static>;
| ^ ------- help: remove this lifetime argument
@@ -7,19 +7,19 @@ LL | type FErr1 = Self::E<'static, 'static>;
| expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/parameter_number_and_kind.rs:9:10
+ --> $DIR/parameter_number_and_kind.rs:8:10
|
LL | type E<'a, T>;
| ^ --
error[E0107]: this associated type takes 1 generic argument but 0 generic arguments were supplied
- --> $DIR/parameter_number_and_kind.rs:12:24
+ --> $DIR/parameter_number_and_kind.rs:11:24
|
LL | type FErr1 = Self::E<'static, 'static>;
| ^ expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/parameter_number_and_kind.rs:9:10
+ --> $DIR/parameter_number_and_kind.rs:8:10
|
LL | type E<'a, T>;
| ^ -
@@ -29,7 +29,7 @@ LL | type FErr1 = Self::E<'static, 'static, T>;
| +++
error[E0107]: this associated type takes 1 generic argument but 2 generic arguments were supplied
- --> $DIR/parameter_number_and_kind.rs:15:27
+ --> $DIR/parameter_number_and_kind.rs:14:27
|
LL | type FErr2<T> = Self::E<'static, T, u32>;
| ^ --- help: remove this generic argument
@@ -37,7 +37,7 @@ LL | type FErr2<T> = Self::E<'static, T, u32>;
| expected 1 generic argument
|
note: associated type defined here, with 1 generic parameter: `T`
- --> $DIR/parameter_number_and_kind.rs:9:10
+ --> $DIR/parameter_number_and_kind.rs:8:10
|
LL | type E<'a, T>;
| ^ -
diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs
index 6ca0bc6dd..c1381025a 100644
--- a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs
+++ b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.rs
@@ -1,4 +1,3 @@
-#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
// FIXME(#44265) add tests for type-generic and const-genertic associated types.
diff --git a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr
index 1458bf0c4..fdd6d305a 100644
--- a/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr
+++ b/src/test/ui/generic-associated-types/parameter_number_and_kind_impl.stderr
@@ -1,5 +1,5 @@
error[E0195]: lifetime parameters or bounds on type `A` do not match the trait declaration
- --> $DIR/parameter_number_and_kind_impl.rs:15:11
+ --> $DIR/parameter_number_and_kind_impl.rs:14:11
|
LL | type A<'a>;
| ---- lifetimes in impl do not match this type in trait
@@ -8,7 +8,7 @@ LL | type A = u32;
| ^ lifetimes do not match type in trait
error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters
- --> $DIR/parameter_number_and_kind_impl.rs:17:12
+ --> $DIR/parameter_number_and_kind_impl.rs:16:12
|
LL | type B<'a, 'b>;
| -- --
@@ -21,7 +21,7 @@ LL | type B<'a, T> = Vec<T>;
| found 1 type parameter
error[E0195]: lifetime parameters or bounds on type `C` do not match the trait declaration
- --> $DIR/parameter_number_and_kind_impl.rs:19:11
+ --> $DIR/parameter_number_and_kind_impl.rs:18:11
|
LL | type C;
| - lifetimes in impl do not match this type in trait
@@ -30,7 +30,7 @@ LL | type C<'a> = u32;
| ^^^^ lifetimes do not match type in trait
error[E0049]: type `A` has 1 type parameter but its trait declaration has 0 type parameters
- --> $DIR/parameter_number_and_kind_impl.rs:26:12
+ --> $DIR/parameter_number_and_kind_impl.rs:25:12
|
LL | type A<'a>;
| -- expected 0 type parameters
@@ -39,7 +39,7 @@ LL | type A<T> = u32;
| ^ found 1 type parameter
error[E0195]: lifetime parameters or bounds on type `B` do not match the trait declaration
- --> $DIR/parameter_number_and_kind_impl.rs:28:11
+ --> $DIR/parameter_number_and_kind_impl.rs:27:11
|
LL | type B<'a, 'b>;
| -------- lifetimes in impl do not match this type in trait
@@ -48,7 +48,7 @@ LL | type B<'a> = u32;
| ^^^^ lifetimes do not match type in trait
error[E0049]: type `C` has 1 type parameter but its trait declaration has 0 type parameters
- --> $DIR/parameter_number_and_kind_impl.rs:30:12
+ --> $DIR/parameter_number_and_kind_impl.rs:29:12
|
LL | type C;
| - expected 0 type parameters
diff --git a/src/test/ui/generic-associated-types/parse/in-trait-impl.rs b/src/test/ui/generic-associated-types/parse/in-trait-impl.rs
index 7f4775ddb..767098835 100644
--- a/src/test/ui/generic-associated-types/parse/in-trait-impl.rs
+++ b/src/test/ui/generic-associated-types/parse/in-trait-impl.rs
@@ -1,8 +1,6 @@
// check-pass
// compile-flags: -Z parse-only
-#![feature(generic_associated_types)]
-
impl<T> Baz for T where T: Foo {
type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
}
diff --git a/src/test/ui/generic-associated-types/parse/in-trait.rs b/src/test/ui/generic-associated-types/parse/in-trait.rs
index d438795eb..6628aac37 100644
--- a/src/test/ui/generic-associated-types/parse/in-trait.rs
+++ b/src/test/ui/generic-associated-types/parse/in-trait.rs
@@ -1,8 +1,6 @@
// check-pass
// compile-flags: -Z parse-only
-#![feature(generic_associated_types)]
-
use std::ops::Deref;
use std::fmt::Debug;
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs
index be85598b7..cbb051892 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs
+++ b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a>;
}
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr
index 2b265e921..53d5f9de6 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-expected-token.stderr
@@ -1,5 +1,5 @@
error: expected one of `!`, `(`, `+`, `,`, `::`, `<`, or `>`, found `=`
- --> $DIR/trait-path-expected-token.rs:7:33
+ --> $DIR/trait-path-expected-token.rs:5:33
|
LL | fn f1<'a>(arg : Box<dyn X<Y = B = &'a ()>>) {}
| - ^ expected one of 7 possible tokens
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs b/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs
index d57c2813b..9183ec497 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs
+++ b/src/test/ui/generic-associated-types/parse/trait-path-expressions.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
mod error1 {
trait X {
type Y<'a>;
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr b/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr
index 272afc10b..cf2b1763f 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-expressions.stderr
@@ -1,5 +1,5 @@
error: expected expression, found `)`
- --> $DIR/trait-path-expressions.rs:8:39
+ --> $DIR/trait-path-expressions.rs:6:39
|
LL | fn f1<'a>(arg : Box<dyn X< 1 = 32 >>) {}
| - ^ expected expression
@@ -7,7 +7,7 @@ LL | fn f1<'a>(arg : Box<dyn X< 1 = 32 >>) {}
| while parsing a const generic argument starting here
error: expected one of `,`, `:`, or `>`, found `=`
- --> $DIR/trait-path-expressions.rs:18:36
+ --> $DIR/trait-path-expressions.rs:16:36
|
LL | fn f2<'a>(arg : Box<dyn X< { 1 } = 32 >>) {}
| - ^ expected one of `,`, `:`, or `>`
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs
index 791486480..ecabf8943 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs
+++ b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a>;
}
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr
index 3ace774a0..10ceccedc 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-missing-gen_arg.stderr
@@ -1,5 +1,5 @@
error: expected one of `>`, a const expression, lifetime, or type, found `:`
- --> $DIR/trait-path-missing-gen_arg.rs:8:30
+ --> $DIR/trait-path-missing-gen_arg.rs:6:30
|
LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {}
| ^ expected one of `>`, a const expression, lifetime, or type
@@ -10,13 +10,13 @@ LL | fn f1<'a>(arg : Box<{ dyn X< : 32 } >>) {}
| + +
error: expected parameter name, found `>`
- --> $DIR/trait-path-missing-gen_arg.rs:8:36
+ --> $DIR/trait-path-missing-gen_arg.rs:6:36
|
LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {}
| ^ expected parameter name
error: expected one of `!`, `)`, `+`, `,`, or `::`, found `>`
- --> $DIR/trait-path-missing-gen_arg.rs:8:36
+ --> $DIR/trait-path-missing-gen_arg.rs:6:36
|
LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {}
| ^
@@ -25,7 +25,7 @@ LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {}
| help: missing `,`
error: expected one of `>`, a const expression, lifetime, or type, found `=`
- --> $DIR/trait-path-missing-gen_arg.rs:16:30
+ --> $DIR/trait-path-missing-gen_arg.rs:14:30
|
LL | fn f1<'a>(arg : Box<dyn X< = 32 >>) {}
| - ^ expected one of `>`, a const expression, lifetime, or type
@@ -33,7 +33,7 @@ LL | fn f1<'a>(arg : Box<dyn X< = 32 >>) {}
| maybe try to close unmatched angle bracket
error[E0747]: constant provided when a type was expected
- --> $DIR/trait-path-missing-gen_arg.rs:8:23
+ --> $DIR/trait-path-missing-gen_arg.rs:6:23
|
LL | fn f1<'a>(arg : Box<dyn X< : 32 >>) {}
| ^^^^^^^^^^^
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-segments.rs b/src/test/ui/generic-associated-types/parse/trait-path-segments.rs
index e943f075f..458e203eb 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-segments.rs
+++ b/src/test/ui/generic-associated-types/parse/trait-path-segments.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
const _: () = {
trait X {
type Y<'a>;
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr b/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr
index 7394393c0..8bc737d67 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-segments.stderr
@@ -1,5 +1,5 @@
error: expected one of `!`, `(`, `+`, `,`, `::`, `:`, `<`, or `>`, found `=`
- --> $DIR/trait-path-segments.rs:8:36
+ --> $DIR/trait-path-segments.rs:6:36
|
LL | fn f1<'a>(arg : Box<dyn X<X::Y = u32>>) {}
| - ^ expected one of 8 possible tokens
@@ -12,7 +12,7 @@ LL | fn f1<'a>(arg : Box<dyn X<X::Y> = u32>>) {}
| +
error: expected one of `,`, `::`, `:`, or `>`, found `=`
- --> $DIR/trait-path-segments.rs:19:35
+ --> $DIR/trait-path-segments.rs:17:35
|
LL | impl<T : X<<Self as X>::Y<'a> = &'a u32>> Z for T {}
| - ^ expected one of `,`, `::`, `:`, or `>`
@@ -25,7 +25,7 @@ LL | impl<T : X<<Self as X>::Y<'a>> = &'a u32>> Z for T {}
| +
error: expected one of `!`, `+`, `,`, `::`, `:`, or `>`, found `=`
- --> $DIR/trait-path-segments.rs:30:25
+ --> $DIR/trait-path-segments.rs:28:25
|
LL | impl<T : X<X::Y<'a> = &'a u32>> Z for T {}
| - ^ expected one of `!`, `+`, `,`, `::`, `:`, or `>`
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
index 4846af96d..1622b92aa 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
+++ b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a>;
}
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
index 46ddcb635..e00a414ef 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
@@ -1,11 +1,11 @@
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
- --> $DIR/trait-path-type-error-once-implemented.rs:8:29
+ --> $DIR/trait-path-type-error-once-implemented.rs:6:29
|
LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
| ^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/trait-path-type-error-once-implemented.rs:4:10
+ --> $DIR/trait-path-type-error-once-implemented.rs:2:10
|
LL | type Y<'a>;
| ^ --
@@ -15,7 +15,7 @@ LL | fn f2<'a>(arg : Box<dyn X<Y<'a, 1> = &'a ()>>) {}
| +++
error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
- --> $DIR/trait-path-type-error-once-implemented.rs:8:29
+ --> $DIR/trait-path-type-error-once-implemented.rs:6:29
|
LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
| ^--- help: remove these generics
@@ -23,7 +23,7 @@ LL | fn f2<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
| expected 0 generic arguments
|
note: associated type defined here, with 0 generic parameters
- --> $DIR/trait-path-type-error-once-implemented.rs:4:10
+ --> $DIR/trait-path-type-error-once-implemented.rs:2:10
|
LL | type Y<'a>;
| ^
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-types.rs b/src/test/ui/generic-associated-types/parse/trait-path-types.rs
index 856253cc7..74a00342f 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-types.rs
+++ b/src/test/ui/generic-associated-types/parse/trait-path-types.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait X {
type Y<'a>;
}
diff --git a/src/test/ui/generic-associated-types/parse/trait-path-types.stderr b/src/test/ui/generic-associated-types/parse/trait-path-types.stderr
index fe9ed579e..8f7a73c95 100644
--- a/src/test/ui/generic-associated-types/parse/trait-path-types.stderr
+++ b/src/test/ui/generic-associated-types/parse/trait-path-types.stderr
@@ -1,5 +1,5 @@
error: expected one of `,`, `:`, or `>`, found `=`
- --> $DIR/trait-path-types.rs:8:37
+ --> $DIR/trait-path-types.rs:6:37
|
LL | fn f<'a>(arg : Box<dyn X< [u8; 1] = u32>>) {}
| - ^ expected one of `,`, `:`, or `>`
@@ -12,7 +12,7 @@ LL | fn f<'a>(arg : Box<dyn X< [u8; 1]> = u32>>) {}
| +
error: expected one of `,`, `:`, or `>`, found `=`
- --> $DIR/trait-path-types.rs:13:37
+ --> $DIR/trait-path-types.rs:11:37
|
LL | fn f1<'a>(arg : Box<dyn X<(Y<'a>) = &'a ()>>) {}
| - ^ expected one of `,`, `:`, or `>`
@@ -25,7 +25,7 @@ LL | fn f1<'a>(arg : Box<dyn X<(Y<'a>)> = &'a ()>>) {}
| +
error: expected one of `,`, `:`, or `>`, found `=`
- --> $DIR/trait-path-types.rs:18:33
+ --> $DIR/trait-path-types.rs:16:33
|
LL | fn f1<'a>(arg : Box<dyn X< 'a = u32 >>) {}
| -- ^ expected one of `,`, `:`, or `>`
diff --git a/src/test/ui/generic-associated-types/pointer_family.rs b/src/test/ui/generic-associated-types/pointer_family.rs
index da86e7f27..80827cd56 100644
--- a/src/test/ui/generic-associated-types/pointer_family.rs
+++ b/src/test/ui/generic-associated-types/pointer_family.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
// check-pass
use std::rc::Rc;
diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs
index 794d677c8..58d57df63 100644
--- a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs
+++ b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.rs
@@ -1,8 +1,6 @@
// Like `projection-bound-cycle.rs` but this avoids using
// `feature(trivial_bounds)`.
-#![feature(generic_associated_types)]
-
trait Print {
fn print();
}
diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
index 2b57c439f..27c1a8299 100644
--- a/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
+++ b/src/test/ui/generic-associated-types/projection-bound-cycle-generic.stderr
@@ -1,11 +1,11 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
- --> $DIR/projection-bound-cycle-generic.rs:44:18
+ --> $DIR/projection-bound-cycle-generic.rs:42:18
|
LL | type Assoc = OnlySized<<T as Foo>::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `OnlySized`
- --> $DIR/projection-bound-cycle-generic.rs:28:18
+ --> $DIR/projection-bound-cycle-generic.rs:26:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| ^ required by this bound in `OnlySized`
diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle.rs b/src/test/ui/generic-associated-types/projection-bound-cycle.rs
index 6564a3608..4cad1f613 100644
--- a/src/test/ui/generic-associated-types/projection-bound-cycle.rs
+++ b/src/test/ui/generic-associated-types/projection-bound-cycle.rs
@@ -2,7 +2,6 @@
// Make sure that we make sure that we don't allow arbitrary bounds to be
// proven when a bound and a where clause of an associated type are the same.
-#![feature(generic_associated_types)]
#![feature(trivial_bounds)]
trait Print {
diff --git a/src/test/ui/generic-associated-types/projection-bound-cycle.stderr b/src/test/ui/generic-associated-types/projection-bound-cycle.stderr
index d9d0bf427..a46518c80 100644
--- a/src/test/ui/generic-associated-types/projection-bound-cycle.stderr
+++ b/src/test/ui/generic-associated-types/projection-bound-cycle.stderr
@@ -1,11 +1,11 @@
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
- --> $DIR/projection-bound-cycle.rs:46:18
+ --> $DIR/projection-bound-cycle.rs:45:18
|
LL | type Assoc = OnlySized<<T as Foo>::Item>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `OnlySized`
- --> $DIR/projection-bound-cycle.rs:30:18
+ --> $DIR/projection-bound-cycle.rs:29:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| ^ required by this bound in `OnlySized`
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
index a40c0c2c4..8e4d5ca5e 100644
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
+++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
pub trait X {
type Y<'a> where Self: 'a;
fn m(&self) -> Self::Y<'_>;
diff --git a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr
index 4620aa34e..753ead48b 100644
--- a/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr
+++ b/src/test/ui/generic-associated-types/projection-type-lifetime-mismatch.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
- --> $DIR/projection-type-lifetime-mismatch.rs:17:5
+ --> $DIR/projection-type-lifetime-mismatch.rs:15:5
|
LL | fn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {
| - let's call the lifetime of this reference `'1`
@@ -7,7 +7,7 @@ LL | x.m()
| ^^^^^ returning this value requires that `'1` must outlive `'static`
error: lifetime may not live long enough
- --> $DIR/projection-type-lifetime-mismatch.rs:22:5
+ --> $DIR/projection-type-lifetime-mismatch.rs:20:5
|
LL | fn g<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {
| - let's call the lifetime of this reference `'1`
@@ -15,7 +15,7 @@ LL | x.m()
| ^^^^^ returning this value requires that `'1` must outlive `'static`
error: lifetime may not live long enough
- --> $DIR/projection-type-lifetime-mismatch.rs:27:5
+ --> $DIR/projection-type-lifetime-mismatch.rs:25:5
|
LL | fn h(x: &()) -> &'static () {
| - let's call the lifetime of this reference `'1`
diff --git a/src/test/ui/generic-associated-types/self-outlives-lint.rs b/src/test/ui/generic-associated-types/self-outlives-lint.rs
index 300907adb..673891fc3 100644
--- a/src/test/ui/generic-associated-types/self-outlives-lint.rs
+++ b/src/test/ui/generic-associated-types/self-outlives-lint.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
// check-fail
use std::fmt::Debug;
@@ -210,4 +208,17 @@ trait StaticReturnAndTakes<'a> {
fn bar<'b>(&self, arg: Self::Y<'b>);
}
+// We require bounds when the GAT appears in the inputs
+trait Input {
+ type Item<'a>;
+ //~^ missing required
+ fn takes_item<'a>(&'a self, item: Self::Item<'a>);
+}
+
+// We don't require bounds when the GAT appears in the where clauses
+trait WhereClause {
+ type Item<'a>;
+ fn takes_item<'a>(&'a self) where Self::Item<'a>: ;
+}
+
fn main() {}
diff --git a/src/test/ui/generic-associated-types/self-outlives-lint.stderr b/src/test/ui/generic-associated-types/self-outlives-lint.stderr
index fdb1f50a7..58172bf06 100644
--- a/src/test/ui/generic-associated-types/self-outlives-lint.stderr
+++ b/src/test/ui/generic-associated-types/self-outlives-lint.stderr
@@ -1,5 +1,5 @@
error: missing required bound on `Item`
- --> $DIR/self-outlives-lint.rs:9:5
+ --> $DIR/self-outlives-lint.rs:7:5
|
LL | type Item<'x>;
| ^^^^^^^^^^^^^-
@@ -10,7 +10,7 @@ LL | type Item<'x>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
- --> $DIR/self-outlives-lint.rs:25:5
+ --> $DIR/self-outlives-lint.rs:23:5
|
LL | type Out<'x>;
| ^^^^^^^^^^^^-
@@ -21,7 +21,7 @@ LL | type Out<'x>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
- --> $DIR/self-outlives-lint.rs:39:5
+ --> $DIR/self-outlives-lint.rs:37:5
|
LL | type Out<'x>;
| ^^^^^^^^^^^^-
@@ -32,7 +32,7 @@ LL | type Out<'x>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bounds on `Out`
- --> $DIR/self-outlives-lint.rs:46:5
+ --> $DIR/self-outlives-lint.rs:44:5
|
LL | type Out<'x, 'y>;
| ^^^^^^^^^^^^^^^^-
@@ -43,7 +43,7 @@ LL | type Out<'x, 'y>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
- --> $DIR/self-outlives-lint.rs:61:5
+ --> $DIR/self-outlives-lint.rs:59:5
|
LL | type Out<'x, D>;
| ^^^^^^^^^^^^^^^-
@@ -54,7 +54,7 @@ LL | type Out<'x, D>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
- --> $DIR/self-outlives-lint.rs:77:5
+ --> $DIR/self-outlives-lint.rs:75:5
|
LL | type Out<'x, D>;
| ^^^^^^^^^^^^^^^-
@@ -65,7 +65,7 @@ LL | type Out<'x, D>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Out`
- --> $DIR/self-outlives-lint.rs:92:5
+ --> $DIR/self-outlives-lint.rs:90:5
|
LL | type Out<'x, D>;
| ^^^^^^^^^^^^^^^-
@@ -76,7 +76,7 @@ LL | type Out<'x, D>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bounds on `Bar`
- --> $DIR/self-outlives-lint.rs:114:5
+ --> $DIR/self-outlives-lint.rs:112:5
|
LL | type Bar<'b>;
| ^^^^^^^^^^^^-
@@ -87,7 +87,7 @@ LL | type Bar<'b>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar`
- --> $DIR/self-outlives-lint.rs:122:5
+ --> $DIR/self-outlives-lint.rs:120:5
|
LL | type Bar<'b>;
| ^^^^^^^^^^^^-
@@ -98,7 +98,7 @@ LL | type Bar<'b>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar`
- --> $DIR/self-outlives-lint.rs:129:5
+ --> $DIR/self-outlives-lint.rs:127:5
|
LL | type Bar<'b>;
| ^^^^^^^^^^^^-
@@ -109,7 +109,7 @@ LL | type Bar<'b>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Item`
- --> $DIR/self-outlives-lint.rs:142:5
+ --> $DIR/self-outlives-lint.rs:140:5
|
LL | type Item<'a>;
| ^^^^^^^^^^^^^-
@@ -120,7 +120,7 @@ LL | type Item<'a>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Iterator`
- --> $DIR/self-outlives-lint.rs:144:5
+ --> $DIR/self-outlives-lint.rs:142:5
|
LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
@@ -131,7 +131,7 @@ LL | type Iterator<'a>: Iterator<Item = Self::Item<'a>>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Item`
- --> $DIR/self-outlives-lint.rs:150:5
+ --> $DIR/self-outlives-lint.rs:148:5
|
LL | type Item<'a>;
| ^^^^^^^^^^^^^-
@@ -142,7 +142,7 @@ LL | type Item<'a>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Bar`
- --> $DIR/self-outlives-lint.rs:159:5
+ --> $DIR/self-outlives-lint.rs:157:5
|
LL | type Bar<'a, 'b>;
| ^^^^^^^^^^^^^^^^-
@@ -153,7 +153,7 @@ LL | type Bar<'a, 'b>;
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
error: missing required bound on `Fut`
- --> $DIR/self-outlives-lint.rs:175:5
+ --> $DIR/self-outlives-lint.rs:173:5
|
LL | type Fut<'out>;
| ^^^^^^^^^^^^^^-
@@ -163,5 +163,16 @@ LL | type Fut<'out>;
= note: this bound is currently required to ensure that impls have maximum flexibility
= note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
-error: aborting due to 15 previous errors
+error: missing required bound on `Item`
+ --> $DIR/self-outlives-lint.rs:213:5
+ |
+LL | type Item<'a>;
+ | ^^^^^^^^^^^^^-
+ | |
+ | help: add the required where clause: `where Self: 'a`
+ |
+ = note: this bound is currently required to ensure that impls have maximum flexibility
+ = note: we are soliciting feedback, see issue #87479 <https://github.com/rust-lang/rust/issues/87479> for more information
+
+error: aborting due to 16 previous errors
diff --git a/src/test/ui/generic-associated-types/shadowing.rs b/src/test/ui/generic-associated-types/shadowing.rs
index 2a9763457..a05d6e143 100644
--- a/src/test/ui/generic-associated-types/shadowing.rs
+++ b/src/test/ui/generic-associated-types/shadowing.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Shadow<'a> {
type Bar<'a>;
//~^ ERROR lifetime name `'a` shadows a lifetime name that is already in scope
diff --git a/src/test/ui/generic-associated-types/shadowing.stderr b/src/test/ui/generic-associated-types/shadowing.stderr
index be7659209..bb32684bc 100644
--- a/src/test/ui/generic-associated-types/shadowing.stderr
+++ b/src/test/ui/generic-associated-types/shadowing.stderr
@@ -1,5 +1,5 @@
error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
- --> $DIR/shadowing.rs:4:14
+ --> $DIR/shadowing.rs:2:14
|
LL | trait Shadow<'a> {
| -- first declared here
@@ -7,7 +7,7 @@ LL | type Bar<'a>;
| ^^ lifetime `'a` already in scope
error[E0496]: lifetime name `'a` shadows a lifetime name that is already in scope
- --> $DIR/shadowing.rs:13:14
+ --> $DIR/shadowing.rs:11:14
|
LL | impl<'a> NoShadow<'a> for &'a u32 {
| -- first declared here
@@ -15,7 +15,7 @@ LL | type Bar<'a> = i32;
| ^^ lifetime `'a` already in scope
error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
- --> $DIR/shadowing.rs:18:14
+ --> $DIR/shadowing.rs:16:14
|
LL | trait ShadowT<T> {
| - first use of `T`
@@ -23,7 +23,7 @@ LL | type Bar<T>;
| ^ already used
error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
- --> $DIR/shadowing.rs:27:14
+ --> $DIR/shadowing.rs:25:14
|
LL | impl<T> NoShadowT<T> for Option<T> {
| - first use of `T`
diff --git a/src/test/ui/generic-associated-types/streaming_iterator.rs b/src/test/ui/generic-associated-types/streaming_iterator.rs
index e71b6805a..408b8dc99 100644
--- a/src/test/ui/generic-associated-types/streaming_iterator.rs
+++ b/src/test/ui/generic-associated-types/streaming_iterator.rs
@@ -1,7 +1,5 @@
// run-pass
-#![feature(generic_associated_types)]
-
use std::fmt::Display;
trait StreamingIterator {
diff --git a/src/test/ui/generic-associated-types/trait-objects.base.stderr b/src/test/ui/generic-associated-types/trait-objects.base.stderr
index 1df76a21b..556422c27 100644
--- a/src/test/ui/generic-associated-types/trait-objects.base.stderr
+++ b/src/test/ui/generic-associated-types/trait-objects.base.stderr
@@ -1,11 +1,11 @@
error[E0038]: the trait `StreamingIterator` cannot be made into an object
- --> $DIR/trait-objects.rs:14:21
+ --> $DIR/trait-objects.rs:13:21
|
LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `StreamingIterator` 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/trait-objects.rs:8:10
+ --> $DIR/trait-objects.rs:7:10
|
LL | trait StreamingIterator {
| ----------------- this trait cannot be made into an object...
diff --git a/src/test/ui/generic-associated-types/trait-objects.extended.stderr b/src/test/ui/generic-associated-types/trait-objects.extended.stderr
index 52d48d578..45b64d2b0 100644
--- a/src/test/ui/generic-associated-types/trait-objects.extended.stderr
+++ b/src/test/ui/generic-associated-types/trait-objects.extended.stderr
@@ -1,5 +1,5 @@
error[E0521]: borrowed data escapes outside of function
- --> $DIR/trait-objects.rs:16:5
+ --> $DIR/trait-objects.rs:15:5
|
LL | fn min_size(x: &mut dyn for<'a> StreamingIterator<Item<'a> = &'a i32>) -> usize {
| - - let's call the lifetime of this reference `'1`
@@ -11,6 +11,8 @@ LL | x.size_hint().0
| |
| `x` escapes the function body here
| argument requires that `'1` must outlive `'static`
+ |
+ = note: due to current limitations in the borrow checker, this implies a `'static` lifetime
error: aborting due to previous error
diff --git a/src/test/ui/generic-associated-types/trait-objects.rs b/src/test/ui/generic-associated-types/trait-objects.rs
index c1da1e0a3..17fed11ba 100644
--- a/src/test/ui/generic-associated-types/trait-objects.rs
+++ b/src/test/ui/generic-associated-types/trait-objects.rs
@@ -1,6 +1,5 @@
// revisions: base extended
-#![feature(generic_associated_types)]
#![cfg_attr(extended, feature(generic_associated_types_extended))]
#![cfg_attr(extended, allow(incomplete_features))]
diff --git a/src/test/ui/generic-associated-types/type-param-defaults.rs b/src/test/ui/generic-associated-types/type-param-defaults.rs
new file mode 100644
index 000000000..f034076b0
--- /dev/null
+++ b/src/test/ui/generic-associated-types/type-param-defaults.rs
@@ -0,0 +1,34 @@
+// Check that we disallow GAT param defaults, even with `invalid_type_param_default` allowed
+
+#![allow(invalid_type_param_default)]
+
+trait Trait {
+ type Assoc<T = u32>;
+ //~^ defaults for type parameters are only allowed
+}
+
+impl Trait for () {
+ type Assoc<T = u32> = u64;
+ //~^ defaults for type parameters are only allowed
+}
+
+impl Trait for u32 {
+ type Assoc<T = u32> = T;
+ //~^ defaults for type parameters are only allowed
+}
+
+trait Other {}
+impl Other for u32 {}
+
+fn foo<T>()
+where
+ T: Trait<Assoc = u32>,
+ T::Assoc: Other {
+ }
+
+fn main() {
+ // errors
+ foo::<()>();
+ // works
+ foo::<u32>();
+}
diff --git a/src/test/ui/generic-associated-types/type-param-defaults.stderr b/src/test/ui/generic-associated-types/type-param-defaults.stderr
new file mode 100644
index 000000000..85ccaba0e
--- /dev/null
+++ b/src/test/ui/generic-associated-types/type-param-defaults.stderr
@@ -0,0 +1,20 @@
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ --> $DIR/type-param-defaults.rs:6:16
+ |
+LL | type Assoc<T = u32>;
+ | ^^^^^^^
+
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ --> $DIR/type-param-defaults.rs:11:16
+ |
+LL | type Assoc<T = u32> = u64;
+ | ^^^^^^^
+
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ --> $DIR/type-param-defaults.rs:16:16
+ |
+LL | type Assoc<T = u32> = T;
+ | ^^^^^^^
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs
index 8b40dac57..1cc09aa6d 100644
--- a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs
+++ b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
pub trait X {
type Y<'a: 'static>;
//~^ WARNING unnecessary lifetime parameter
diff --git a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr
index ae52010cc..fbd79879d 100644
--- a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr
+++ b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.stderr
@@ -1,5 +1,5 @@
warning: unnecessary lifetime parameter `'a`
- --> $DIR/unsatified-item-lifetime-bound.rs:4:12
+ --> $DIR/unsatified-item-lifetime-bound.rs:2:12
|
LL | type Y<'a: 'static>;
| ^^
@@ -7,39 +7,39 @@ LL | type Y<'a: 'static>;
= help: you can use the `'static` lifetime directly, in place of `'a`
error[E0478]: lifetime bound not satisfied
- --> $DIR/unsatified-item-lifetime-bound.rs:13:8
+ --> $DIR/unsatified-item-lifetime-bound.rs:11:8
|
LL | f: <T as X>::Y<'a>,
| ^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime `'a` as defined here
- --> $DIR/unsatified-item-lifetime-bound.rs:12:10
+ --> $DIR/unsatified-item-lifetime-bound.rs:10:10
|
LL | struct B<'a, T: for<'r> X<Y<'r> = &'r ()>> {
| ^^
= note: but lifetime parameter must outlive the static lifetime
error[E0478]: lifetime bound not satisfied
- --> $DIR/unsatified-item-lifetime-bound.rs:18:8
+ --> $DIR/unsatified-item-lifetime-bound.rs:16:8
|
LL | f: <T as X>::Y<'a>,
| ^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime `'a` as defined here
- --> $DIR/unsatified-item-lifetime-bound.rs:17:10
+ --> $DIR/unsatified-item-lifetime-bound.rs:15:10
|
LL | struct C<'a, T: X> {
| ^^
= note: but lifetime parameter must outlive the static lifetime
error[E0478]: lifetime bound not satisfied
- --> $DIR/unsatified-item-lifetime-bound.rs:23:8
+ --> $DIR/unsatified-item-lifetime-bound.rs:21:8
|
LL | f: <() as X>::Y<'a>,
| ^^^^^^^^^^^^^^^^
|
note: lifetime parameter instantiated with the lifetime `'a` as defined here
- --> $DIR/unsatified-item-lifetime-bound.rs:22:10
+ --> $DIR/unsatified-item-lifetime-bound.rs:20:10
|
LL | struct D<'a> {
| ^^
diff --git a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs
index 6466bf98d..7137d9237 100644
--- a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs
+++ b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait ATy {
type Item<'a>: 'a;
}
diff --git a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr
index 7ec9386ca..1c9ac01ec 100644
--- a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr
+++ b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.stderr
@@ -1,23 +1,23 @@
error[E0477]: the type `&'b ()` does not fulfill the required lifetime
- --> $DIR/unsatisfied-outlives-bound.rs:8:21
+ --> $DIR/unsatisfied-outlives-bound.rs:6:21
|
LL | type Item<'a> = &'b ();
| ^^^^^^
|
note: type must outlive the lifetime `'a` as defined here as required by this binding
- --> $DIR/unsatisfied-outlives-bound.rs:8:15
+ --> $DIR/unsatisfied-outlives-bound.rs:6:15
|
LL | type Item<'a> = &'b ();
| ^^
error[E0477]: the type `&'a ()` does not fulfill the required lifetime
- --> $DIR/unsatisfied-outlives-bound.rs:17:21
+ --> $DIR/unsatisfied-outlives-bound.rs:15:21
|
LL | type Item<'a> = &'a ();
| ^^^^^^
|
note: type must satisfy the static lifetime as required by this binding
- --> $DIR/unsatisfied-outlives-bound.rs:13:20
+ --> $DIR/unsatisfied-outlives-bound.rs:11:20
|
LL | type Item<'a>: 'static;
| ^^^^^^^
diff --git a/src/test/ui/generic-associated-types/variance_constraints.rs b/src/test/ui/generic-associated-types/variance_constraints.rs
index 7d0f7638a..0e9dbb8b1 100644
--- a/src/test/ui/generic-associated-types/variance_constraints.rs
+++ b/src/test/ui/generic-associated-types/variance_constraints.rs
@@ -1,6 +1,5 @@
// check-pass
// issue #69184
-#![feature(generic_associated_types)]
trait A {
type B<'a> where Self: 'a;
diff --git a/src/test/ui/generics/issue-59508-1.rs b/src/test/ui/generics/issue-59508-1.rs
index 7e1dd7707..8e27749e8 100644
--- a/src/test/ui/generics/issue-59508-1.rs
+++ b/src/test/ui/generics/issue-59508-1.rs
@@ -8,7 +8,7 @@ struct A;
impl A {
pub fn do_things<T, 'a, 'b: 'a>() {
- //~^ ERROR lifetime parameters must be declared prior to type parameters
+ //~^ ERROR lifetime parameters must be declared prior to type and const parameters
println!("panic");
}
}
diff --git a/src/test/ui/generics/issue-59508-1.stderr b/src/test/ui/generics/issue-59508-1.stderr
index d162365ea..1c510044f 100644
--- a/src/test/ui/generics/issue-59508-1.stderr
+++ b/src/test/ui/generics/issue-59508-1.stderr
@@ -1,4 +1,4 @@
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/issue-59508-1.rs:10:25
|
LL | pub fn do_things<T, 'a, 'b: 'a>() {
diff --git a/src/test/ui/generics/issue-59508.fixed b/src/test/ui/generics/issue-59508.fixed
index b5c60a162..de8f47d4c 100644
--- a/src/test/ui/generics/issue-59508.fixed
+++ b/src/test/ui/generics/issue-59508.fixed
@@ -8,7 +8,7 @@ struct A;
impl A {
pub fn do_things<'a, 'b: 'a, T>() {
- //~^ ERROR lifetime parameters must be declared prior to type parameters
+ //~^ ERROR lifetime parameters must be declared prior to type and const parameters
println!("panic");
}
}
diff --git a/src/test/ui/generics/issue-59508.rs b/src/test/ui/generics/issue-59508.rs
index 0b39c5d8f..a4c7d4ff2 100644
--- a/src/test/ui/generics/issue-59508.rs
+++ b/src/test/ui/generics/issue-59508.rs
@@ -8,7 +8,7 @@ struct A;
impl A {
pub fn do_things<T, 'a, 'b: 'a>() {
- //~^ ERROR lifetime parameters must be declared prior to type parameters
+ //~^ ERROR lifetime parameters must be declared prior to type and const parameters
println!("panic");
}
}
diff --git a/src/test/ui/generics/issue-59508.stderr b/src/test/ui/generics/issue-59508.stderr
index c52ae4182..fd23b6276 100644
--- a/src/test/ui/generics/issue-59508.stderr
+++ b/src/test/ui/generics/issue-59508.stderr
@@ -1,4 +1,4 @@
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/issue-59508.rs:10:25
|
LL | pub fn do_things<T, 'a, 'b: 'a>() {
diff --git a/src/test/ui/generics/issue-80512-param-reordering-with-defaults.rs b/src/test/ui/generics/issue-80512-param-reordering-with-defaults.rs
index fe3e4fbc7..0e208818e 100644
--- a/src/test/ui/generics/issue-80512-param-reordering-with-defaults.rs
+++ b/src/test/ui/generics/issue-80512-param-reordering-with-defaults.rs
@@ -1,4 +1,4 @@
#![crate_type = "lib"]
struct S<T = (), 'a>(&'a T);
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
diff --git a/src/test/ui/generics/issue-80512-param-reordering-with-defaults.stderr b/src/test/ui/generics/issue-80512-param-reordering-with-defaults.stderr
index 119b1a0d2..70793a9c9 100644
--- a/src/test/ui/generics/issue-80512-param-reordering-with-defaults.stderr
+++ b/src/test/ui/generics/issue-80512-param-reordering-with-defaults.stderr
@@ -1,4 +1,4 @@
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/issue-80512-param-reordering-with-defaults.rs:3:18
|
LL | struct S<T = (), 'a>(&'a T);
diff --git a/src/test/ui/generics/issue-94923.rs b/src/test/ui/generics/issue-94923.rs
new file mode 100644
index 000000000..d337a5dff
--- /dev/null
+++ b/src/test/ui/generics/issue-94923.rs
@@ -0,0 +1,49 @@
+// run-pass
+// regression test for issue #94923
+// min-llvm-version: 15.0.0
+// compile-flags: -C opt-level=3
+
+fn f0<T>(mut x: usize) -> usize {
+ for _ in 0..1000 {
+ x *= 123;
+ x %= 99
+ }
+ x + 321 // function composition is not just longer iteration
+}
+
+fn f1<T>(x: usize) -> usize {
+ f0::<(i8, T)>(f0::<(u8, T)>(x))
+}
+
+fn f2<T>(x: usize) -> usize {
+ f1::<(i8, T)>(f1::<(u8, T)>(x))
+}
+
+fn f3<T>(x: usize) -> usize {
+ f2::<(i8, T)>(f2::<(u8, T)>(x))
+}
+
+fn f4<T>(x: usize) -> usize {
+ f3::<(i8, T)>(f3::<(u8, T)>(x))
+}
+
+fn f5<T>(x: usize) -> usize {
+ f4::<(i8, T)>(f4::<(u8, T)>(x))
+}
+
+fn f6<T>(x: usize) -> usize {
+ f5::<(i8, T)>(f5::<(u8, T)>(x))
+}
+
+fn f7<T>(x: usize) -> usize {
+ f6::<(i8, T)>(f6::<(u8, T)>(x))
+}
+
+fn f8<T>(x: usize) -> usize {
+ f7::<(i8, T)>(f7::<(u8, T)>(x))
+}
+
+fn main() {
+ let y = f8::<()>(1);
+ assert_eq!(y, 348);
+}
diff --git a/src/test/ui/generics/issue-98432.stderr b/src/test/ui/generics/issue-98432.stderr
index afa67b63b..c7b5c3361 100644
--- a/src/test/ui/generics/issue-98432.stderr
+++ b/src/test/ui/generics/issue-98432.stderr
@@ -5,9 +5,9 @@ LL | impl<T> Struct<T> {
| - type parameter from outer function
LL | const CONST: fn() = || {
LL | struct _Obligation where T:;
- | ^ use of generic parameter from outer function
- |
- = help: try using a local generic parameter instead
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<T>`
error: aborting due to previous error
diff --git a/src/test/ui/generics/lifetime-before-type-params.rs b/src/test/ui/generics/lifetime-before-type-params.rs
index 5a71d6efe..d64b1b0b4 100644
--- a/src/test/ui/generics/lifetime-before-type-params.rs
+++ b/src/test/ui/generics/lifetime-before-type-params.rs
@@ -1,11 +1,11 @@
#![allow(unused)]
fn first<T, 'a, 'b>() {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
fn second<'a, T, 'b>() {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
fn third<T, U, 'a>() {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
fn fourth<'a, T, 'b, U, 'c, V>() {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
fn main() {}
diff --git a/src/test/ui/generics/lifetime-before-type-params.stderr b/src/test/ui/generics/lifetime-before-type-params.stderr
index 62d95e453..84825eb4c 100644
--- a/src/test/ui/generics/lifetime-before-type-params.stderr
+++ b/src/test/ui/generics/lifetime-before-type-params.stderr
@@ -1,22 +1,22 @@
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/lifetime-before-type-params.rs:2:13
|
LL | fn first<T, 'a, 'b>() {}
| ----^^--^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/lifetime-before-type-params.rs:4:18
|
LL | fn second<'a, T, 'b>() {}
| --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/lifetime-before-type-params.rs:6:16
|
LL | fn third<T, U, 'a>() {}
| -------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T, U>`
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/lifetime-before-type-params.rs:8:18
|
LL | fn fourth<'a, T, 'b, U, 'c, V>() {}
diff --git a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.rs b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.rs
index 3f4c17836..b2e9ffb57 100644
--- a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.rs
+++ b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision.rs
@@ -1,4 +1,4 @@
-#![feature(half_open_range_patterns)]
+#![feature(half_open_range_patterns_in_slices)]
#![feature(exclusive_range_pattern)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.rs b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.rs
index dedc85491..20f4d8f88 100644
--- a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.rs
+++ b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision2.rs
@@ -1,4 +1,4 @@
-#![feature(half_open_range_patterns)]
+#![feature(half_open_range_patterns_in_slices)]
#![feature(exclusive_range_pattern)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.rs b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.rs
index 6a9b562cc..14ca07d0a 100644
--- a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.rs
+++ b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.rs
@@ -1,4 +1,3 @@
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr
index 665eef2fc..790a13372 100644
--- a/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr
+++ b/src/test/ui/half-open-range-patterns/exclusive_range_pattern_syntax_collision3.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:12
+ --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:12
|
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
@@ -10,7 +10,7 @@ LL | [..9, 99..100, _] => {},
found type `{integer}`
error[E0308]: mismatched types
- --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:15
+ --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:15
|
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
@@ -23,7 +23,7 @@ LL | [..9, 99..100, _] => {},
found type `{integer}`
error[E0308]: mismatched types
- --> $DIR/exclusive_range_pattern_syntax_collision3.rs:6:19
+ --> $DIR/exclusive_range_pattern_syntax_collision3.rs:5:19
|
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
diff --git a/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs b/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs
new file mode 100644
index 000000000..dac973473
--- /dev/null
+++ b/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.rs
@@ -0,0 +1,7 @@
+#![feature(exclusive_range_pattern)]
+
+fn main() {
+ let xs = [13, 1, 5, 2, 3, 1, 21, 8];
+ let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
+ //~^ `X..` patterns in slices are experimental
+}
diff --git a/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr b/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr
new file mode 100644
index 000000000..ee5b0e11c
--- /dev/null
+++ b/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns-in-slices.stderr
@@ -0,0 +1,12 @@
+error[E0658]: `X..` patterns in slices are experimental
+ --> $DIR/feature-gate-half-open-range-patterns-in-slices.rs:5:10
+ |
+LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
+ | ^^^^^^^
+ |
+ = 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: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.rs b/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.rs
deleted file mode 100644
index 9281dda67..000000000
--- a/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-#![feature(exclusive_range_pattern)]
-
-fn main() {}
-
-#[cfg(FALSE)]
-fn foo() {
- if let ..=5 = 0 {}
- //~^ ERROR half-open range patterns are unstable
- if let ...5 = 0 {}
- //~^ ERROR half-open range patterns are unstable
- //~| ERROR range-to patterns with `...` are not allowed
- if let ..5 = 0 {}
- //~^ ERROR half-open range patterns are unstable
- if let 5..= = 0 {}
- //~^ ERROR inclusive range with no end
- if let 5... = 0 {}
- //~^ ERROR inclusive range with no end
-}
diff --git a/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.stderr b/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.stderr
deleted file mode 100644
index a04883ae1..000000000
--- a/src/test/ui/half-open-range-patterns/feature-gate-half-open-range-patterns.stderr
+++ /dev/null
@@ -1,53 +0,0 @@
-error: range-to patterns with `...` are not allowed
- --> $DIR/feature-gate-half-open-range-patterns.rs:9:12
- |
-LL | if let ...5 = 0 {}
- | ^^^ help: use `..=` instead
-
-error[E0586]: inclusive range with no end
- --> $DIR/feature-gate-half-open-range-patterns.rs:14:13
- |
-LL | if let 5..= = 0 {}
- | ^^^ help: use `..` instead
- |
- = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
-
-error[E0586]: inclusive range with no end
- --> $DIR/feature-gate-half-open-range-patterns.rs:16:13
- |
-LL | if let 5... = 0 {}
- | ^^^ help: use `..` instead
- |
- = note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
-
-error[E0658]: half-open range patterns are unstable
- --> $DIR/feature-gate-half-open-range-patterns.rs:7:12
- |
-LL | if let ..=5 = 0 {}
- | ^^^^
- |
- = note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
- = help: add `#![feature(half_open_range_patterns)]` to the crate attributes to enable
-
-error[E0658]: half-open range patterns are unstable
- --> $DIR/feature-gate-half-open-range-patterns.rs:9:12
- |
-LL | if let ...5 = 0 {}
- | ^^^^
- |
- = note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
- = help: add `#![feature(half_open_range_patterns)]` to the crate attributes to enable
-
-error[E0658]: half-open range patterns are unstable
- --> $DIR/feature-gate-half-open-range-patterns.rs:12:12
- |
-LL | if let ..5 = 0 {}
- | ^^^
- |
- = note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
- = help: add `#![feature(half_open_range_patterns)]` to the crate attributes to enable
-
-error: aborting due to 6 previous errors
-
-Some errors have detailed explanations: E0586, E0658.
-For more information about an error, try `rustc --explain E0586`.
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs
index b08732219..17ea2b13f 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.rs
@@ -1,4 +1,3 @@
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr
index df0dae569..f7c59a196 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-bad-types.stderr
@@ -1,17 +1,17 @@
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/half-open-range-pats-bad-types.rs:5:9
+ --> $DIR/half-open-range-pats-bad-types.rs:4:9
|
LL | let "a".. = "a";
| ^^^ this is of type `&'static str` but it should be `char` or numeric
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/half-open-range-pats-bad-types.rs:6:11
+ --> $DIR/half-open-range-pats-bad-types.rs:5:11
|
LL | let .."a" = "a";
| ^^^ this is of type `&'static str` but it should be `char` or numeric
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/half-open-range-pats-bad-types.rs:7:12
+ --> $DIR/half-open-range-pats-bad-types.rs:6:12
|
LL | let ..="a" = "a";
| ^^^ this is of type `&'static str` but it should be `char` or numeric
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.rs
index be225359b..a2a4c62fa 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.rs
@@ -1,6 +1,5 @@
// Test various non-exhaustive matches for `X..`, `..=X` and `..X` ranges.
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
#![allow(illegal_floating_point_literal_pattern)]
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.stderr
index d429b4e8e..6b20a820b 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.stderr
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-fail.stderr
@@ -1,5 +1,5 @@
error[E0004]: non-exhaustive patterns: `_` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:16:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:15:8
|
LL | m!(0f32, f32::NEG_INFINITY..);
| ^^^^ pattern `_` not covered
@@ -11,7 +11,7 @@ LL | match $s { $($t)+ => {}, _ => todo!() }
| ++++++++++++++
error[E0004]: non-exhaustive patterns: `_` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:17:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:16:8
|
LL | m!(0f32, ..f32::INFINITY);
| ^^^^ pattern `_` not covered
@@ -23,7 +23,7 @@ LL | match $s { $($t)+ => {}, _ => todo!() }
| ++++++++++++++
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:25:8
|
LL | m!('a', ..core::char::MAX);
| ^^^ pattern `'\u{10ffff}'` not covered
@@ -35,7 +35,7 @@ LL | match $s { $($t)+ => {}, '\u{10ffff}' => todo!() }
| +++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `'\u{10fffe}'..='\u{10ffff}'` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:26:8
|
LL | m!('a', ..ALMOST_MAX);
| ^^^ pattern `'\u{10fffe}'..='\u{10ffff}'` not covered
@@ -47,7 +47,7 @@ LL | match $s { $($t)+ => {}, '\u{10fffe}'..='\u{10ffff}' => todo!() }
| ++++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `'\0'` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:27:8
|
LL | m!('a', ALMOST_MIN..);
| ^^^ pattern `'\0'` not covered
@@ -59,7 +59,7 @@ LL | match $s { $($t)+ => {}, '\0' => todo!() }
| +++++++++++++++++
error[E0004]: non-exhaustive patterns: `'\u{10ffff}'` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:28:8
|
LL | m!('a', ..=ALMOST_MAX);
| ^^^ pattern `'\u{10ffff}'` not covered
@@ -71,7 +71,7 @@ LL | match $s { $($t)+ => {}, '\u{10ffff}' => todo!() }
| +++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `'b'` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:30:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:29:8
|
LL | m!('a', ..=VAL | VAL_2..);
| ^^^ pattern `'b'` not covered
@@ -83,7 +83,7 @@ LL | match $s { $($t)+ => {}, 'b' => todo!() }
| ++++++++++++++++
error[E0004]: non-exhaustive patterns: `'b'` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:31:8
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:30:8
|
LL | m!('a', ..VAL_1 | VAL_2..);
| ^^^ pattern `'b'` not covered
@@ -95,7 +95,7 @@ LL | match $s { $($t)+ => {}, 'b' => todo!() }
| ++++++++++++++++
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:40:12
|
LL | m!(0, ..u8::MAX);
| ^ pattern `u8::MAX` not covered
@@ -107,7 +107,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `254_u8..=u8::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:41:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `254_u8..=u8::MAX` not covered
@@ -119,7 +119,7 @@ LL | match $s { $($t)+ => {}, 254_u8..=u8::MAX => todo!() }
| +++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `0_u8` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:42:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u8` not covered
@@ -131,7 +131,7 @@ LL | match $s { $($t)+ => {}, 0_u8 => todo!() }
| +++++++++++++++++
error[E0004]: non-exhaustive patterns: `u8::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:43:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u8::MAX` not covered
@@ -143,7 +143,7 @@ LL | match $s { $($t)+ => {}, u8::MAX => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u8` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:45:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:44:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u8` not covered
@@ -155,7 +155,7 @@ LL | match $s { $($t)+ => {}, 43_u8 => todo!() }
| ++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u8` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:46:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:45:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u8` not covered
@@ -167,7 +167,7 @@ LL | match $s { $($t)+ => {}, 43_u8 => todo!() }
| ++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:53:12
|
LL | m!(0, ..u16::MAX);
| ^ pattern `u16::MAX` not covered
@@ -179,7 +179,7 @@ LL | match $s { $($t)+ => {}, u16::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `65534_u16..=u16::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:54:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `65534_u16..=u16::MAX` not covered
@@ -191,7 +191,7 @@ LL | match $s { $($t)+ => {}, 65534_u16..=u16::MAX => todo!() }
| +++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `0_u16` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:55:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u16` not covered
@@ -203,7 +203,7 @@ LL | match $s { $($t)+ => {}, 0_u16 => todo!() }
| ++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u16::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:56:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u16::MAX` not covered
@@ -215,7 +215,7 @@ LL | match $s { $($t)+ => {}, u16::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u16` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:58:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:57:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u16` not covered
@@ -227,7 +227,7 @@ LL | match $s { $($t)+ => {}, 43_u16 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u16` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:59:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:58:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u16` not covered
@@ -239,7 +239,7 @@ LL | match $s { $($t)+ => {}, 43_u16 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:66:12
|
LL | m!(0, ..u32::MAX);
| ^ pattern `u32::MAX` not covered
@@ -251,7 +251,7 @@ LL | match $s { $($t)+ => {}, u32::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `4294967294_u32..=u32::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:67:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `4294967294_u32..=u32::MAX` not covered
@@ -263,7 +263,7 @@ LL | match $s { $($t)+ => {}, 4294967294_u32..=u32::MAX => todo!() }
| ++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `0_u32` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:68:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u32` not covered
@@ -275,7 +275,7 @@ LL | match $s { $($t)+ => {}, 0_u32 => todo!() }
| ++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u32::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:69:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u32::MAX` not covered
@@ -287,7 +287,7 @@ LL | match $s { $($t)+ => {}, u32::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u32` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:71:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:70:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u32` not covered
@@ -299,7 +299,7 @@ LL | match $s { $($t)+ => {}, 43_u32 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u32` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:72:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:71:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u32` not covered
@@ -311,7 +311,7 @@ LL | match $s { $($t)+ => {}, 43_u32 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:79:12
|
LL | m!(0, ..u64::MAX);
| ^ pattern `u64::MAX` not covered
@@ -323,7 +323,7 @@ LL | match $s { $($t)+ => {}, u64::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `18446744073709551614_u64..=u64::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:80:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `18446744073709551614_u64..=u64::MAX` not covered
@@ -335,7 +335,7 @@ LL | match $s { $($t)+ => {}, 18446744073709551614_u64..=u64::MAX => tod
| ++++++++++++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `0_u64` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:81:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u64` not covered
@@ -347,7 +347,7 @@ LL | match $s { $($t)+ => {}, 0_u64 => todo!() }
| ++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u64::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:82:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u64::MAX` not covered
@@ -359,7 +359,7 @@ LL | match $s { $($t)+ => {}, u64::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u64` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:84:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:83:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u64` not covered
@@ -371,7 +371,7 @@ LL | match $s { $($t)+ => {}, 43_u64 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u64` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:85:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:84:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u64` not covered
@@ -383,7 +383,7 @@ LL | match $s { $($t)+ => {}, 43_u64 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:92:12
|
LL | m!(0, ..u128::MAX);
| ^ pattern `u128::MAX` not covered
@@ -395,7 +395,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
| ++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `340282366920938463463374607431768211454_u128..=u128::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:93:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `340282366920938463463374607431768211454_u128..=u128::MAX` not covered
@@ -407,7 +407,7 @@ LL | match $s { $($t)+ => {}, 340282366920938463463374607431768211454_u1
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `0_u128` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:94:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `0_u128` not covered
@@ -419,7 +419,7 @@ LL | match $s { $($t)+ => {}, 0_u128 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `u128::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:95:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `u128::MAX` not covered
@@ -431,7 +431,7 @@ LL | match $s { $($t)+ => {}, u128::MAX => todo!() }
| ++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u128` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:97:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:96:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_u128` not covered
@@ -443,7 +443,7 @@ LL | match $s { $($t)+ => {}, 43_u128 => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_u128` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:98:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:97:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_u128` not covered
@@ -455,7 +455,7 @@ LL | match $s { $($t)+ => {}, 43_u128 => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:108:12
|
LL | m!(0, ..i8::MAX);
| ^ pattern `i8::MAX` not covered
@@ -467,7 +467,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `126_i8..=i8::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:109:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `126_i8..=i8::MAX` not covered
@@ -479,7 +479,7 @@ LL | match $s { $($t)+ => {}, 126_i8..=i8::MAX => todo!() }
| +++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i8::MIN` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:110:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `i8::MIN` not covered
@@ -491,7 +491,7 @@ LL | match $s { $($t)+ => {}, i8::MIN => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i8::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:111:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i8::MAX` not covered
@@ -503,7 +503,7 @@ LL | match $s { $($t)+ => {}, i8::MAX => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i8` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:113:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:112:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i8` not covered
@@ -515,7 +515,7 @@ LL | match $s { $($t)+ => {}, 43_i8 => todo!() }
| ++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i8` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:114:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:113:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i8` not covered
@@ -527,7 +527,7 @@ LL | match $s { $($t)+ => {}, 43_i8 => todo!() }
| ++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:121:12
|
LL | m!(0, ..i16::MAX);
| ^ pattern `i16::MAX` not covered
@@ -539,7 +539,7 @@ LL | match $s { $($t)+ => {}, i16::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `32766_i16..=i16::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:122:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `32766_i16..=i16::MAX` not covered
@@ -551,7 +551,7 @@ LL | match $s { $($t)+ => {}, 32766_i16..=i16::MAX => todo!() }
| +++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i16::MIN` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:123:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `i16::MIN` not covered
@@ -563,7 +563,7 @@ LL | match $s { $($t)+ => {}, i16::MIN => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i16::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:124:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i16::MAX` not covered
@@ -575,7 +575,7 @@ LL | match $s { $($t)+ => {}, i16::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i16` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:126:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:125:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i16` not covered
@@ -587,7 +587,7 @@ LL | match $s { $($t)+ => {}, 43_i16 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i16` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:127:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:126:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i16` not covered
@@ -599,7 +599,7 @@ LL | match $s { $($t)+ => {}, 43_i16 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:134:12
|
LL | m!(0, ..i32::MAX);
| ^ pattern `i32::MAX` not covered
@@ -611,7 +611,7 @@ LL | match $s { $($t)+ => {}, i32::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `2147483646_i32..=i32::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:135:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `2147483646_i32..=i32::MAX` not covered
@@ -623,7 +623,7 @@ LL | match $s { $($t)+ => {}, 2147483646_i32..=i32::MAX => todo!() }
| ++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i32::MIN` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:136:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `i32::MIN` not covered
@@ -635,7 +635,7 @@ LL | match $s { $($t)+ => {}, i32::MIN => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i32::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:137:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i32::MAX` not covered
@@ -647,7 +647,7 @@ LL | match $s { $($t)+ => {}, i32::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i32` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:139:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:138:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i32` not covered
@@ -659,7 +659,7 @@ LL | match $s { $($t)+ => {}, 43_i32 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i32` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:140:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:139:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i32` not covered
@@ -671,7 +671,7 @@ LL | match $s { $($t)+ => {}, 43_i32 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:147:12
|
LL | m!(0, ..i64::MAX);
| ^ pattern `i64::MAX` not covered
@@ -683,7 +683,7 @@ LL | match $s { $($t)+ => {}, i64::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `9223372036854775806_i64..=i64::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:148:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `9223372036854775806_i64..=i64::MAX` not covered
@@ -695,7 +695,7 @@ LL | match $s { $($t)+ => {}, 9223372036854775806_i64..=i64::MAX => todo
| +++++++++++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i64::MIN` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:149:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `i64::MIN` not covered
@@ -707,7 +707,7 @@ LL | match $s { $($t)+ => {}, i64::MIN => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i64::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:150:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i64::MAX` not covered
@@ -719,7 +719,7 @@ LL | match $s { $($t)+ => {}, i64::MAX => todo!() }
| +++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i64` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:152:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:151:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i64` not covered
@@ -731,7 +731,7 @@ LL | match $s { $($t)+ => {}, 43_i64 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i64` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:153:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:152:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i64` not covered
@@ -743,7 +743,7 @@ LL | match $s { $($t)+ => {}, 43_i64 => todo!() }
| +++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:160:12
|
LL | m!(0, ..i128::MAX);
| ^ pattern `i128::MAX` not covered
@@ -755,7 +755,7 @@ LL | match $s { $($t)+ => {}, i128::MAX => todo!() }
| ++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `170141183460469231731687303715884105726_i128..=i128::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:161:12
|
LL | m!(0, ..ALMOST_MAX);
| ^ pattern `170141183460469231731687303715884105726_i128..=i128::MAX` not covered
@@ -767,7 +767,7 @@ LL | match $s { $($t)+ => {}, 170141183460469231731687303715884105726_i1
| +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i128::MIN` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:162:12
|
LL | m!(0, ALMOST_MIN..);
| ^ pattern `i128::MIN` not covered
@@ -779,7 +779,7 @@ LL | match $s { $($t)+ => {}, i128::MIN => todo!() }
| ++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `i128::MAX` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:163:12
|
LL | m!(0, ..=ALMOST_MAX);
| ^ pattern `i128::MAX` not covered
@@ -791,7 +791,7 @@ LL | match $s { $($t)+ => {}, i128::MAX => todo!() }
| ++++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i128` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:165:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:164:12
|
LL | m!(0, ..=VAL | VAL_2..);
| ^ pattern `43_i128` not covered
@@ -803,7 +803,7 @@ LL | match $s { $($t)+ => {}, 43_i128 => todo!() }
| ++++++++++++++++++++
error[E0004]: non-exhaustive patterns: `43_i128` not covered
- --> $DIR/half-open-range-pats-exhaustive-fail.rs:166:12
+ --> $DIR/half-open-range-pats-exhaustive-fail.rs:165:12
|
LL | m!(0, ..VAL_1 | VAL_2..);
| ^ pattern `43_i128` not covered
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
index d3a59e4df..4b7eee134 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-exhaustive-pass.rs
@@ -2,7 +2,6 @@
// Test various exhaustive matches for `X..`, `..=X` and `..X` ranges.
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
fn main() {}
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs
index daed775cf..526a797e9 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs
@@ -7,8 +7,6 @@
// there's a potential confusion factor here, and we would prefer to keep patterns
// and expressions in-sync. As such, we do not allow `...X` in patterns either.
-#![feature(half_open_range_patterns)]
-
fn main() {}
#[cfg(FALSE)]
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr
index da37ff301..ddffeaf97 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-dotdotdot-bad-syntax.stderr
@@ -1,29 +1,29 @@
error: range-to patterns with `...` are not allowed
- --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9
+ --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:15:9
|
LL | ...X => {}
| ^^^ help: use `..=` instead
error: range-to patterns with `...` are not allowed
- --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9
+ --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:16:9
|
LL | ...0 => {}
| ^^^ help: use `..=` instead
error: range-to patterns with `...` are not allowed
- --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:19:9
+ --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:17:9
|
LL | ...'a' => {}
| ^^^ help: use `..=` instead
error: range-to patterns with `...` are not allowed
- --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:20:9
+ --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:18:9
|
LL | ...0.0f32 => {}
| ^^^ help: use `..=` instead
error: range-to patterns with `...` are not allowed
- --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:27:17
+ --> $DIR/half-open-range-pats-inclusive-dotdotdot-bad-syntax.rs:25:17
|
LL | let ...$e;
| ^^^ help: use `..=` instead
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs
index 9ace0c357..6567c8cc6 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.rs
@@ -1,8 +1,6 @@
// Test `X...` and `X..=` range patterns not being allowed syntactically.
// FIXME(Centril): perhaps these should be semantic restrictions.
-#![feature(half_open_range_patterns)]
-
fn main() {}
#[cfg(FALSE)]
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr
index 5a504a90b..3ad84b0ef 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-inclusive-no-end.stderr
@@ -1,5 +1,5 @@
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-inclusive-no-end.rs:10:13
+ --> $DIR/half-open-range-pats-inclusive-no-end.rs:8:13
|
LL | if let 0... = 1 {}
| ^^^ help: use `..` instead
@@ -7,7 +7,7 @@ LL | if let 0... = 1 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-inclusive-no-end.rs:11:13
+ --> $DIR/half-open-range-pats-inclusive-no-end.rs:9:13
|
LL | if let 0..= = 1 {}
| ^^^ help: use `..` instead
@@ -15,7 +15,7 @@ LL | if let 0..= = 1 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-inclusive-no-end.rs:13:13
+ --> $DIR/half-open-range-pats-inclusive-no-end.rs:11:13
|
LL | if let X... = 1 {}
| ^^^ help: use `..` instead
@@ -23,7 +23,7 @@ LL | if let X... = 1 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-inclusive-no-end.rs:14:13
+ --> $DIR/half-open-range-pats-inclusive-no-end.rs:12:13
|
LL | if let X..= = 1 {}
| ^^^ help: use `..` instead
@@ -31,7 +31,7 @@ LL | if let X..= = 1 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-inclusive-no-end.rs:20:19
+ --> $DIR/half-open-range-pats-inclusive-no-end.rs:18:19
|
LL | let $e...;
| ^^^ help: use `..` instead
@@ -43,7 +43,7 @@ LL | mac!(0);
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-inclusive-no-end.rs:21:19
+ --> $DIR/half-open-range-pats-inclusive-no-end.rs:19:19
|
LL | let $e..=;
| ^^^ help: use `..` instead
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.rs
index f054bbea4..2d63fe078 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.rs
@@ -1,5 +1,3 @@
-#![feature(half_open_range_patterns)]
-
fn main() {}
#[cfg(FALSE)]
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr
index 93b73c57e..111e81799 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-ref-ambiguous-interp.stderr
@@ -1,11 +1,11 @@
error: the range pattern here has ambiguous interpretation
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:10
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:6:10
|
LL | &0.. | _ => {}
| ^^^ help: add parentheses to clarify the precedence: `(0..)`
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:10:11
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:11
|
LL | &0..= | _ => {}
| ^^^ help: use `..` instead
@@ -13,13 +13,13 @@ LL | &0..= | _ => {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: the range pattern here has ambiguous interpretation
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:10:10
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:8:10
|
LL | &0..= | _ => {}
| ^^^^ help: add parentheses to clarify the precedence: `(0..=)`
error[E0586]: inclusive range with no end
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:13:11
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:11:11
|
LL | &0... | _ => {}
| ^^^ help: use `..` instead
@@ -27,25 +27,25 @@ LL | &0... | _ => {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: the range pattern here has ambiguous interpretation
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:18:10
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:16:10
|
LL | &..0 | _ => {}
| ^^^ help: add parentheses to clarify the precedence: `(..0)`
error: the range pattern here has ambiguous interpretation
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:18:10
|
LL | &..=0 | _ => {}
| ^^^^ help: add parentheses to clarify the precedence: `(..=0)`
error: range-to patterns with `...` are not allowed
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:22:10
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
LL | &...0 | _ => {}
| ^^^ help: use `..=` instead
error: the range pattern here has ambiguous interpretation
- --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:22:10
+ --> $DIR/half-open-range-pats-ref-ambiguous-interp.rs:20:10
|
LL | &...0 | _ => {}
| ^^^^ help: add parentheses to clarify the precedence: `(..=0)`
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-semantics.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-semantics.rs
index ae532d935..6c6ba9319 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-semantics.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-semantics.rs
@@ -3,7 +3,6 @@
// Test half-open range patterns against their expression equivalents
// via `.contains(...)` and make sure the dynamic semantics match.
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
#![allow(illegal_floating_point_literal_pattern)]
#![allow(unreachable_patterns)]
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-syntactic-pass.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-syntactic-pass.rs
index 8bb98d3b5..9a73e8906 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-syntactic-pass.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-syntactic-pass.rs
@@ -3,7 +3,6 @@
// Test the parsing of half-open ranges.
#![feature(exclusive_range_pattern)]
-#![feature(half_open_range_patterns)]
fn main() {}
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs b/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs
index 2c8e554b2..f55566602 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.rs
@@ -1,4 +1,3 @@
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
#![allow(illegal_floating_point_literal_pattern)]
diff --git a/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr b/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr
index 4931ddfac..56b224a85 100644
--- a/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr
+++ b/src/test/ui/half-open-range-patterns/half-open-range-pats-thir-lower-empty.stderr
@@ -1,155 +1,155 @@
error[E0579]: lower range bound must be less than upper
- --> $DIR/half-open-range-pats-thir-lower-empty.rs:12:11
+ --> $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:15:11
+ --> $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:18:11
+ --> $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:21:11
+ --> $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:24:11
+ --> $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:28:11
+ --> $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:31:11
+ --> $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:34:11
+ --> $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:37:11
+ --> $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:40:11
+ --> $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:44:14
+ --> $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:47:14
+ --> $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:51:13
+ --> $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:12:11
+ --> $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:15:11
+ --> $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:18:11
+ --> $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:21:11
+ --> $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:24:11
+ --> $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:28:11
+ --> $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:31:11
+ --> $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:34:11
+ --> $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:37:11
+ --> $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:40:11
+ --> $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:44:14
+ --> $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:47:14
+ --> $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:51:13
+ --> $DIR/half-open-range-pats-thir-lower-empty.rs:50:13
|
LL | m!('a', ..'\u{0}');
| ^^^^^^^^^
diff --git a/src/test/ui/half-open-range-patterns/pat-tuple-4.rs b/src/test/ui/half-open-range-patterns/pat-tuple-4.rs
index bd7953682..11c4ab9c5 100644
--- a/src/test/ui/half-open-range-patterns/pat-tuple-4.rs
+++ b/src/test/ui/half-open-range-patterns/pat-tuple-4.rs
@@ -1,6 +1,5 @@
// check-pass
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/pat-tuple-5.rs b/src/test/ui/half-open-range-patterns/pat-tuple-5.rs
index 613d907cf..995ef03c8 100644
--- a/src/test/ui/half-open-range-patterns/pat-tuple-5.rs
+++ b/src/test/ui/half-open-range-patterns/pat-tuple-5.rs
@@ -1,4 +1,3 @@
-#![feature(half_open_range_patterns)]
#![feature(exclusive_range_pattern)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/pat-tuple-5.stderr b/src/test/ui/half-open-range-patterns/pat-tuple-5.stderr
index 307ad711b..c60842638 100644
--- a/src/test/ui/half-open-range-patterns/pat-tuple-5.stderr
+++ b/src/test/ui/half-open-range-patterns/pat-tuple-5.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/pat-tuple-5.rs:8:10
+ --> $DIR/pat-tuple-5.rs:7:10
|
LL | match (0, 1) {
| ------ this expression has type `({integer}, {integer})`
diff --git a/src/test/ui/half-open-range-patterns/range_pat_interactions0.rs b/src/test/ui/half-open-range-patterns/range_pat_interactions0.rs
index 8f745e810..acb7feac1 100644
--- a/src/test/ui/half-open-range-patterns/range_pat_interactions0.rs
+++ b/src/test/ui/half-open-range-patterns/range_pat_interactions0.rs
@@ -1,7 +1,6 @@
// run-pass
#![allow(incomplete_features)]
#![feature(exclusive_range_pattern)]
-#![feature(half_open_range_patterns)]
#![feature(inline_const_pat)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/range_pat_interactions3.rs b/src/test/ui/half-open-range-patterns/range_pat_interactions3.rs
index 41c7e46df..446ed45f9 100644
--- a/src/test/ui/half-open-range-patterns/range_pat_interactions3.rs
+++ b/src/test/ui/half-open-range-patterns/range_pat_interactions3.rs
@@ -16,8 +16,7 @@ fn main() {
//~| exclusive range pattern syntax is experimental
y @ -5.. => range_from.push(y),
y @ ..-7 => assert_eq!(y, -8),
- //~^ half-open range patterns are unstable
- //~| exclusive range pattern syntax is experimental
+ //~^ exclusive range pattern syntax is experimental
y => bottom.push(y),
}
}
diff --git a/src/test/ui/half-open-range-patterns/range_pat_interactions3.stderr b/src/test/ui/half-open-range-patterns/range_pat_interactions3.stderr
index 5e36996a4..f7fda6775 100644
--- a/src/test/ui/half-open-range-patterns/range_pat_interactions3.stderr
+++ b/src/test/ui/half-open-range-patterns/range_pat_interactions3.stderr
@@ -1,12 +1,3 @@
-error[E0658]: half-open range patterns are unstable
- --> $DIR/range_pat_interactions3.rs:18:17
- |
-LL | y @ ..-7 => assert_eq!(y, -8),
- | ^^^^
- |
- = note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
- = help: add `#![feature(half_open_range_patterns)]` to the crate attributes to enable
-
error[E0658]: inline-const in pattern position is experimental
--> $DIR/range_pat_interactions3.rs:14:20
|
@@ -52,6 +43,6 @@ LL | y @ ..-7 => assert_eq!(y, -8),
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem0.rs b/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem0.rs
index 2884a2734..d54cbfbf4 100644
--- a/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem0.rs
+++ b/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem0.rs
@@ -1,4 +1,4 @@
-#![feature(half_open_range_patterns)]
+#![feature(half_open_range_patterns_in_slices)]
#![feature(exclusive_range_pattern)]
fn main() {
diff --git a/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs b/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs
index 9e289b591..c37af75b8 100644
--- a/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs
+++ b/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.rs
@@ -3,7 +3,6 @@ fn main() {
let xs = [13, 1, 5, 2, 3, 1, 21, 8];
let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
//~^ `X..` patterns in slices are experimental
- //~| half-open range patterns are unstable
//~| exclusive range pattern syntax is experimental
//~| exclusive range pattern syntax is experimental
}
diff --git a/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr b/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr
index eadaf8776..3bca554b1 100644
--- a/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr
+++ b/src/test/ui/half-open-range-patterns/slice_pattern_syntax_problem1.stderr
@@ -1,12 +1,3 @@
-error[E0658]: half-open range patterns are unstable
- --> $DIR/slice_pattern_syntax_problem1.rs:4:23
- |
-LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
- | ^^^
- |
- = note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
- = help: add `#![feature(half_open_range_patterns)]` to the crate attributes to enable
-
error[E0658]: `X..` patterns in slices are experimental
--> $DIR/slice_pattern_syntax_problem1.rs:4:10
|
@@ -14,7 +5,7 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
| ^^^^^^^
|
= note: see issue #67264 <https://github.com/rust-lang/rust/issues/67264> for more information
- = help: add `#![feature(half_open_range_patterns)]` to the crate attributes to enable
+ = help: add `#![feature(half_open_range_patterns_in_slices)]` to the crate attributes to enable
error[E0658]: exclusive range pattern syntax is experimental
--> $DIR/slice_pattern_syntax_problem1.rs:4:23
@@ -34,6 +25,6 @@ LL | let [a @ 3.., b @ ..3, c @ 4..6, ..] = xs;
= note: see issue #37854 <https://github.com/rust-lang/rust/issues/37854> for more information
= help: add `#![feature(exclusive_range_pattern)]` to the crate attributes to enable
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/hashmap/hashmap-index-mut.rs b/src/test/ui/hashmap/hashmap-index-mut.rs
new file mode 100644
index 000000000..98448e9d5
--- /dev/null
+++ b/src/test/ui/hashmap/hashmap-index-mut.rs
@@ -0,0 +1,6 @@
+use std::collections::HashMap;
+
+fn main() {
+ let mut map = HashMap::<u32, u32>::new();
+ map[&0] = 1; //~ ERROR cannot assign
+}
diff --git a/src/test/ui/hashmap/hashmap-index-mut.stderr b/src/test/ui/hashmap/hashmap-index-mut.stderr
new file mode 100644
index 000000000..c1948ab62
--- /dev/null
+++ b/src/test/ui/hashmap/hashmap-index-mut.stderr
@@ -0,0 +1,19 @@
+error[E0594]: cannot assign to data in an index of `HashMap<u32, u32>`
+ --> $DIR/hashmap-index-mut.rs:5:5
+ |
+LL | map[&0] = 1;
+ | ^^^^^^^^^^^ cannot assign
+ |
+ = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<u32, u32>`
+help: to modify a `HashMap<u32, u32>`, use `.get_mut()`, `.insert()` or the entry API
+ |
+LL | map.insert(&0, 1);
+ | ~~~~~~~~ ~ +
+LL | map.get_mut(&0).map(|val| { *val = 1; });
+ | ~~~~~~~~~ ~~~~~~~~~~~~~~~~~~ ++++
+LL | let val = map.entry(&0).or_insert(1);
+ | +++++++++ ~~~~~~~ ~~~~~~~~~~~~ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0594`.
diff --git a/src/test/ui/hrtb/complex.rs b/src/test/ui/higher-rank-trait-bounds/complex.rs
index 8cdfe247e..8cdfe247e 100644
--- a/src/test/ui/hrtb/complex.rs
+++ b/src/test/ui/higher-rank-trait-bounds/complex.rs
diff --git a/src/test/ui/hrtb/due-to-where-clause.rs b/src/test/ui/higher-rank-trait-bounds/due-to-where-clause.rs
index 1afd15613..1afd15613 100644
--- a/src/test/ui/hrtb/due-to-where-clause.rs
+++ b/src/test/ui/higher-rank-trait-bounds/due-to-where-clause.rs
diff --git a/src/test/ui/hrtb/due-to-where-clause.stderr b/src/test/ui/higher-rank-trait-bounds/due-to-where-clause.stderr
index 520938a63..520938a63 100644
--- a/src/test/ui/hrtb/due-to-where-clause.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/due-to-where-clause.stderr
diff --git a/src/test/ui/hrtb/hrtb-cache-issue-54302.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.rs
index a20d03c77..a20d03c77 100644
--- a/src/test/ui/hrtb/hrtb-cache-issue-54302.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.rs
diff --git a/src/test/ui/hrtb/hrtb-cache-issue-54302.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.stderr
index f014eab86..f014eab86 100644
--- a/src/test/ui/hrtb/hrtb-cache-issue-54302.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-cache-issue-54302.stderr
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-conflate-regions.rs
index e83686404..e83686404 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-conflate-regions.rs
diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-conflate-regions.stderr
index 46f5308dd..46f5308dd 100644
--- a/src/test/ui/hrtb/hrtb-conflate-regions.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-conflate-regions.stderr
diff --git a/src/test/ui/hrtb/hrtb-debruijn-in-receiver.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.rs
index 05d3e1a43..05d3e1a43 100644
--- a/src/test/ui/hrtb/hrtb-debruijn-in-receiver.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.rs
diff --git a/src/test/ui/hrtb/hrtb-debruijn-in-receiver.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.stderr
index fa391ecba..fa391ecba 100644
--- a/src/test/ui/hrtb/hrtb-debruijn-in-receiver.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-debruijn-in-receiver.stderr
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-fn.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.rs
index 567802376..567802376 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-fn.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.rs
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.stderr
index 9914783d9..9914783d9 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-fn.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-fn.stderr
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.rs
index 921061916..921061916 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.rs
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.stderr
index 364b613fc..364b613fc 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-contravariant.stderr
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-covariant.rs
index f95496a6c..f95496a6c 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-covariant.rs
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.rs
index 9b9e4496a..9b9e4496a 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.rs
diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.stderr
index cb2ce8a41..cb2ce8a41 100644
--- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-exists-forall-trait-invariant.stderr
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs
index f9ae1429e..f9ae1429e 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.rs
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
index 8cda76b94..8cda76b94 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.rs
index 48ebe5017..48ebe5017 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.rs
diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.stderr
index 88793a152..88793a152 100644
--- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits.stderr
diff --git a/src/test/ui/hrtb/hrtb-identity-fn-borrows.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.rs
index 89fc4705a..89fc4705a 100644
--- a/src/test/ui/hrtb/hrtb-identity-fn-borrows.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.rs
diff --git a/src/test/ui/hrtb/hrtb-identity-fn-borrows.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.stderr
index 4886a3c8b..4886a3c8b 100644
--- a/src/test/ui/hrtb/hrtb-identity-fn-borrows.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-identity-fn-borrows.stderr
diff --git a/src/test/ui/hrtb/hrtb-just-for-static.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-just-for-static.rs
index 8fb4218f8..8fb4218f8 100644
--- a/src/test/ui/hrtb/hrtb-just-for-static.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-just-for-static.rs
diff --git a/src/test/ui/hrtb/hrtb-just-for-static.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-just-for-static.stderr
index b4312091e..31e11e128 100644
--- a/src/test/ui/hrtb/hrtb-just-for-static.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-just-for-static.stderr
@@ -14,6 +14,12 @@ LL | fn give_some<'a>() {
| -- lifetime `'a` defined here
LL | want_hrtb::<&'a u32>()
| ^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/hrtb-just-for-static.rs:9:15
+ |
+LL | where T : for<'a> Foo<&'a isize>
+ | ^^^^^^^^^^^^^^^^^^^^^^
error: implementation of `Foo` is not general enough
--> $DIR/hrtb-just-for-static.rs:30:5
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.polonius.stderr
index a94c80eb3..a94c80eb3 100644
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.polonius.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.polonius.stderr
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.rs b/src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.rs
index d45fa183c..d45fa183c 100644
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.rs
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.rs
diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr b/src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.stderr
index 1461e7fd2..727b9e6be 100644
--- a/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/hrtb-perfect-forwarding.stderr
@@ -9,8 +9,8 @@ LL | | T: Bar<&'b isize>,
LL | no_hrtb(&mut t);
| --------------- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
warning: function cannot return without recursing
--> $DIR/hrtb-perfect-forwarding.rs:25:1
@@ -46,6 +46,12 @@ LL | fn foo_hrtb_bar_not<'b, T>(mut t: T)
...
LL | foo_hrtb_bar_not(&mut t);
| ^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static`
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/hrtb-perfect-forwarding.rs:37:8
+ |
+LL | T: for<'a> Foo<&'a isize> + Bar<&'b isize>,
+ | ^^^^^^^^^^^^^^^^^^^^^^
error: implementation of `Bar` is not general enough
--> $DIR/hrtb-perfect-forwarding.rs:43:5
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-100689.rs b/src/test/ui/higher-rank-trait-bounds/issue-100689.rs
new file mode 100644
index 000000000..2db7f8a35
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/issue-100689.rs
@@ -0,0 +1,29 @@
+// check-pass
+
+struct Foo<'a> {
+ foo: &'a mut usize,
+}
+
+trait Bar<'a> {
+ type FooRef<'b>
+ where
+ 'a: 'b;
+ fn uwu(foo: Foo<'a>, f: impl for<'b> FnMut(Self::FooRef<'b>));
+}
+impl<'a> Bar<'a> for () {
+ type FooRef<'b>
+ =
+ &'b Foo<'a>
+ where
+ 'a : 'b,
+ ;
+
+ fn uwu(
+ foo: Foo<'a>,
+ mut f: impl for<'b> FnMut(&'b Foo<'a>), //relevant part
+ ) {
+ f(&foo);
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/higher-rank-trait-bounds/issue-102899.rs b/src/test/ui/higher-rank-trait-bounds/issue-102899.rs
new file mode 100644
index 000000000..952b81584
--- /dev/null
+++ b/src/test/ui/higher-rank-trait-bounds/issue-102899.rs
@@ -0,0 +1,32 @@
+// check-pass
+
+pub trait BufferTrait<'buffer> {
+ type Subset<'channel>
+ where
+ 'buffer: 'channel;
+
+ fn for_each_subset<F>(&self, f: F)
+ where
+ F: for<'channel> Fn(Self::Subset<'channel>);
+}
+
+pub struct SomeBuffer<'buffer> {
+ samples: &'buffer [()],
+}
+
+impl<'buffer> BufferTrait<'buffer> for SomeBuffer<'buffer> {
+ type Subset<'subset> = Subset<'subset> where 'buffer: 'subset;
+
+ fn for_each_subset<F>(&self, _f: F)
+ where
+ F: for<'subset> Fn(Subset<'subset>),
+ {
+ todo!()
+ }
+}
+
+pub struct Subset<'subset> {
+ buffer: &'subset [()],
+}
+
+fn main() {}
diff --git a/src/test/ui/hrtb/issue-30786.rs b/src/test/ui/higher-rank-trait-bounds/issue-30786.rs
index e5f46f711..e5f46f711 100644
--- a/src/test/ui/hrtb/issue-30786.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-30786.rs
diff --git a/src/test/ui/hrtb/issue-30786.stderr b/src/test/ui/higher-rank-trait-bounds/issue-30786.stderr
index bc7b5e914..c1e235441 100644
--- a/src/test/ui/hrtb/issue-30786.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-30786.stderr
@@ -18,12 +18,8 @@ note: the following trait bounds were not satisfied:
|
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
| --------- - ^^^^^^ unsatisfied trait bound introduced here
-help: one of the expressions' fields has a method of the same name
- |
-LL | let filter = map.stream.filterx(|x: &_| true);
- | +++++++
-error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>`, but its trait bounds were not satisfied
+error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>`, but its trait bounds were not satisfied
--> $DIR/issue-30786.rs:130:24
|
LL | pub struct Filter<S, F> {
@@ -33,20 +29,16 @@ LL | pub struct Filter<S, F> {
| doesn't satisfy `_: StreamExt`
...
LL | let count = filter.countx();
- | ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>` due to unsatisfied trait bounds
+ | ^^^^^^ method cannot be called on `Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>` due to unsatisfied trait bounds
|
note: the following trait bounds were not satisfied:
- `&'a mut &Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
- `&'a mut &mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
- `&'a mut Filter<Map<Repeat, for<'r> fn(&'r u64) -> &'r u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
+ `&'a mut &Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
+ `&'a mut &mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
+ `&'a mut Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, [closure@$DIR/issue-30786.rs:129:30: 129:37]>: Stream`
--> $DIR/issue-30786.rs:96:50
|
LL | impl<T> StreamExt for T where for<'a> &'a mut T: Stream {}
| --------- - ^^^^^^ unsatisfied trait bound introduced here
-help: one of the expressions' fields has a method of the same name
- |
-LL | let count = filter.stream.countx();
- | +++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/hrtb/issue-46989.rs b/src/test/ui/higher-rank-trait-bounds/issue-46989.rs
index 4a09f4be1..4a09f4be1 100644
--- a/src/test/ui/hrtb/issue-46989.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-46989.rs
diff --git a/src/test/ui/hrtb/issue-46989.stderr b/src/test/ui/higher-rank-trait-bounds/issue-46989.stderr
index 309e1a676..3f874220a 100644
--- a/src/test/ui/hrtb/issue-46989.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-46989.stderr
@@ -4,7 +4,7 @@ error: implementation of `Foo` is not general enough
LL | assert_foo::<fn(&i32)>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
- = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r i32)`
+ = note: `Foo` would have to be implemented for the type `for<'a> fn(&'a i32)`
= note: ...but `Foo` is actually implemented for the type `fn(&'0 i32)`, for some specific lifetime `'0`
error: aborting due to previous error
diff --git a/src/test/ui/hrtb/issue-57639.rs b/src/test/ui/higher-rank-trait-bounds/issue-57639.rs
index 392e7233b..392e7233b 100644
--- a/src/test/ui/hrtb/issue-57639.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-57639.rs
diff --git a/src/test/ui/hrtb/issue-58451.rs b/src/test/ui/higher-rank-trait-bounds/issue-58451.rs
index f36d549e4..f36d549e4 100644
--- a/src/test/ui/hrtb/issue-58451.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-58451.rs
diff --git a/src/test/ui/hrtb/issue-58451.stderr b/src/test/ui/higher-rank-trait-bounds/issue-58451.stderr
index 22ba63c3e..09e25f4dc 100644
--- a/src/test/ui/hrtb/issue-58451.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-58451.stderr
@@ -12,7 +12,7 @@ LL | fn f<I>(i: I)
help: provide the argument
|
LL | f(&[f(/* value */)]);
- | ~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.rs b/src/test/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.rs
index 80f099ce3..e70f6fc34 100644
--- a/src/test/ui/hrtb/issue-62203-hrtb-ice.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.rs
@@ -36,11 +36,15 @@ trait Ty<'a> {
fn main() {
let v = Unit2.m(
- //~^ ERROR type mismatch
L {
- //~^ ERROR type mismatch
- f : |x| { drop(x); Unit4 }
- });
+ //~^ ERROR to be a closure that returns `Unit3`, but it returns `Unit4`
+ //~| ERROR type mismatch
+ f: |x| {
+ drop(x);
+ Unit4
+ },
+ },
+ );
}
impl<'a> Ty<'a> for Unit2 {
diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr b/src/test/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr
index 79ef56b9f..ab5598e36 100644
--- a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/issue-62203-hrtb-ice.stderr
@@ -1,8 +1,16 @@
-error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V`
- --> $DIR/issue-62203-hrtb-ice.rs:38:19
+error[E0271]: type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:16: 42:19]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V`
+ --> $DIR/issue-62203-hrtb-ice.rs:39:9
|
-LL | let v = Unit2.m(
- | ^ type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V`
+LL | let v = Unit2.m(
+ | - required by a bound introduced by this call
+LL | / L {
+LL | |
+LL | |
+LL | | f: |x| {
+... |
+LL | | },
+LL | | },
+ | |_________^ type mismatch resolving `for<'r> <L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:16: 42:19]> as T0<'r, (&'r u8,)>>::O == <_ as Ty<'r>>::V`
|
note: expected this to be `<_ as Ty<'_>>::V`
--> $DIR/issue-62203-hrtb-ice.rs:21:14
@@ -22,19 +30,21 @@ LL | where
LL | F: for<'r> T0<'r, (<Self as Ty<'r>>::V,), O = <B as Ty<'r>>::V>,
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `T1::m`
-error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20] as FnOnce<((&'r u8,),)>>::Output == Unit3`
- --> $DIR/issue-62203-hrtb-ice.rs:40:9
+error[E0271]: expected `[closure@$DIR/issue-62203-hrtb-ice.rs:42:16: 42:19]` to be a closure that returns `Unit3`, but it returns `Unit4`
+ --> $DIR/issue-62203-hrtb-ice.rs:39:9
|
LL | let v = Unit2.m(
| - required by a bound introduced by this call
-LL |
LL | / L {
LL | |
-LL | | f : |x| { drop(x); Unit4 }
-LL | | });
+LL | |
+LL | | f: |x| {
+... |
+LL | | },
+LL | | },
| |_________^ expected struct `Unit3`, found struct `Unit4`
|
-note: required because of the requirements on the impl of `for<'r> T0<'r, (&'r u8,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:20]>`
+note: required for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:16: 42:19]>` to implement `for<'r> T0<'r, (&'r u8,)>`
--> $DIR/issue-62203-hrtb-ice.rs:17:16
|
LL | impl<'a, A, T> T0<'a, A> for L<T>
diff --git a/src/test/ui/hrtb/issue-88446.rs b/src/test/ui/higher-rank-trait-bounds/issue-88446.rs
index 571b85317..571b85317 100644
--- a/src/test/ui/hrtb/issue-88446.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-88446.rs
diff --git a/src/test/ui/hrtb/issue-90177.rs b/src/test/ui/higher-rank-trait-bounds/issue-90177.rs
index b151a9d3a..b151a9d3a 100644
--- a/src/test/ui/hrtb/issue-90177.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-90177.rs
diff --git a/src/test/ui/hrtb/issue-95034.rs b/src/test/ui/higher-rank-trait-bounds/issue-95034.rs
index d8edbe7e5..af4946a18 100644
--- a/src/test/ui/hrtb/issue-95034.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-95034.rs
@@ -1,23 +1,5 @@
-// known-bug: #95034
-// failure-status: 101
+// check-pass
// compile-flags: --edition=2021 --crate-type=lib
-// rustc-env:RUST_BACKTRACE=0
-
-// normalize-stderr-test "thread 'rustc' panicked.*" -> "thread 'rustc' panicked"
-// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
-// 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" -> ""
-// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
-// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""
-// normalize-stderr-test "query stack during panic:\n" -> ""
-// normalize-stderr-test "we're just showing a limited slice of the query stack\n" -> ""
-// normalize-stderr-test "end of query stack\n" -> ""
-// normalize-stderr-test "#.*\n" -> ""
-
-// This should not ICE.
-
-// Refer to the issue for more minimized versions.
use std::{
future::Future,
diff --git a/src/test/ui/hrtb/issue-95230.rs b/src/test/ui/higher-rank-trait-bounds/issue-95230.rs
index 92c506eab..92c506eab 100644
--- a/src/test/ui/hrtb/issue-95230.rs
+++ b/src/test/ui/higher-rank-trait-bounds/issue-95230.rs
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr
index 066bf431a..b30dd36d2 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-62529-3.stderr
@@ -1,8 +1,10 @@
error[E0277]: expected a `Fn<(<_ as ATC<'a>>::Type,)>` closure, found `F`
- --> $DIR/issue-62529-3.rs:25:9
+ --> $DIR/issue-62529-3.rs:25:14
|
LL | call(f, ());
- | ^^^^ expected an `Fn<(<_ as ATC<'a>>::Type,)>` closure, found `F`
+ | ---- ^ expected an `Fn<(<_ as ATC<'a>>::Type,)>` closure, found `F`
+ | |
+ | required by a bound introduced by this call
|
= note: expected a closure with arguments `((),)`
found a closure with arguments `(<_ as ATC<'a>>::Type,)`
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr
index eebce827d..4ef96cd95 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | foo(bar, "string", |s| s.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r, 's> FnOnce<(&'r &'s str,)>`
- found trait `for<'r> FnOnce<(&'r &str,)>`
+ = note: expected trait `for<'a, 'b> FnOnce<(&'a &'b str,)>`
+ found trait `for<'a> FnOnce<(&'a &str,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:45:24
|
@@ -23,8 +23,8 @@ error[E0308]: mismatched types
LL | foo(bar, "string", |s| s.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r, 's> FnOnce<(&'r &'s str,)>`
- found trait `for<'r> FnOnce<(&'r &str,)>`
+ = note: expected trait `for<'a, 'b> FnOnce<(&'a &'b str,)>`
+ found trait `for<'a> FnOnce<(&'a &str,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:45:24
|
@@ -42,8 +42,8 @@ error[E0308]: mismatched types
LL | foo(baz, "string", |s| s.0.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
- found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
+ = note: expected trait `for<'a, 'b> FnOnce<(&'a Wrapper<'b>,)>`
+ found trait `for<'a> FnOnce<(&'a Wrapper<'_>,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:48:24
|
@@ -61,8 +61,8 @@ error[E0308]: mismatched types
LL | foo(baz, "string", |s| s.0.len() == 5);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r, 's> FnOnce<(&'r Wrapper<'s>,)>`
- found trait `for<'r> FnOnce<(&'r Wrapper<'_>,)>`
+ = note: expected trait `for<'a, 'b> FnOnce<(&'a Wrapper<'b>,)>`
+ found trait `for<'a> FnOnce<(&'a Wrapper<'_>,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-71955.rs:48:24
|
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs
index 172bf218c..c10a0888a 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.rs
@@ -6,8 +6,7 @@ trait SomeTrait<'a> {
fn give_me_ice<T>() {
callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
- //~^ ERROR the trait bound `for<'r> T: SomeTrait<'r>` is not satisfied [E0277]
- //~| ERROR the trait bound `for<'r> T: SomeTrait<'r>` is not satisfied [E0277]
+ //~^ ERROR the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied [E0277]
}
fn callee<T: Fn<(&'static (),)>>() {
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr
index ecca4b999..25a4f6088 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-85455.stderr
@@ -1,25 +1,14 @@
-error[E0277]: the trait bound `for<'r> T: SomeTrait<'r>` is not satisfied
+error[E0277]: the trait bound `for<'a> T: SomeTrait<'a>` is not satisfied
--> $DIR/issue-85455.rs:8:5
|
LL | callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'r> SomeTrait<'r>` is not implemented for `T`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> SomeTrait<'a>` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
-LL | fn give_me_ice<T: for<'r> SomeTrait<'r>>() {
+LL | fn give_me_ice<T: for<'a> SomeTrait<'a>>() {
| +++++++++++++++++++++++
-error[E0277]: the trait bound `for<'r> T: SomeTrait<'r>` is not satisfied
- --> $DIR/issue-85455.rs:8:14
- |
-LL | callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'r> SomeTrait<'r>` is not implemented for `T`
- |
-help: consider restricting type parameter `T`
- |
-LL | fn give_me_ice<T: for<'r> SomeTrait<'r>>() {
- | +++++++++++++++++++++++
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr
index a6858154d..14fe1803b 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-89118.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `for<'a> &'a (): BufferMut` is not satisfied
LL | C: StackContext,
| ^^^^^^^^^^^^ the trait `for<'a> BufferMut` is not implemented for `&'a ()`
|
-note: required because of the requirements on the impl of `for<'a> BufferUdpStateContext<&'a ()>` for `Ctx<()>`
+note: required for `Ctx<()>` to implement `for<'a> BufferUdpStateContext<&'a ()>`
--> $DIR/issue-89118.rs:5:23
|
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {}
@@ -24,7 +24,7 @@ error[E0277]: the trait bound `for<'a> &'a (): BufferMut` is not satisfied
LL | impl<C> EthernetWorker<C> {}
| ^^^^^^^^^^^^^^^^^ the trait `for<'a> BufferMut` is not implemented for `&'a ()`
|
-note: required because of the requirements on the impl of `for<'a> BufferUdpStateContext<&'a ()>` for `Ctx<()>`
+note: required for `Ctx<()>` to implement `for<'a> BufferUdpStateContext<&'a ()>`
--> $DIR/issue-89118.rs:5:23
|
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {}
@@ -44,7 +44,7 @@ error[E0277]: the trait bound `for<'a> &'a (): BufferMut` is not satisfied
LL | type Handler = Ctx<C::Dispatcher>;
| ^^^^^^^^^^^^^^^^^^ the trait `for<'a> BufferMut` is not implemented for `&'a ()`
|
-note: required because of the requirements on the impl of `for<'a> BufferUdpStateContext<&'a ()>` for `Ctx<()>`
+note: required for `Ctx<()>` to implement `for<'a> BufferUdpStateContext<&'a ()>`
--> $DIR/issue-89118.rs:5:23
|
LL | impl<B: BufferMut, C> BufferUdpStateContext<B> for C {}
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs
index e150ecfe9..effc32945 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90612.rs
@@ -1,7 +1,5 @@
// check-pass
-#![feature(generic_associated_types)]
-
use std::marker::PhantomData;
trait Family: Sized {
diff --git a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs
index 18b7f3834..628b5cba1 100644
--- a/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs
+++ b/src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-90638.rs
@@ -1,7 +1,5 @@
//check-pass
-#![feature(generic_associated_types)]
-
trait Yokeable<'a>: 'static {
type Output: 'a;
}
diff --git a/src/test/ui/hrtb/issue-95034.stderr b/src/test/ui/hrtb/issue-95034.stderr
deleted file mode 100644
index 1d8329142..000000000
--- a/src/test/ui/hrtb/issue-95034.stderr
+++ /dev/null
@@ -1 +0,0 @@
-thread 'rustc' panicked
diff --git a/src/test/ui/hygiene/globs.stderr b/src/test/ui/hygiene/globs.stderr
index bcfcc28ad..1f2a96a4c 100644
--- a/src/test/ui/hygiene/globs.stderr
+++ b/src/test/ui/hygiene/globs.stderr
@@ -1,9 +1,16 @@
error[E0425]: cannot find function `f` in this scope
--> $DIR/globs.rs:22:9
|
+LL | pub fn g() {}
+ | ---------- similarly named function `g` defined here
+...
LL | f();
- | ^ not found in this scope
+ | ^
+ |
+help: a function with a similar name exists
|
+LL | g();
+ | ~
help: consider importing this function
|
LL | use foo::f;
@@ -12,8 +19,11 @@ LL | use foo::f;
error[E0425]: cannot find function `g` in this scope
--> $DIR/globs.rs:15:5
|
+LL | pub fn f() {}
+ | ---------- similarly named function `f` defined here
+...
LL | g();
- | ^ not found in this scope
+ | ^
...
LL | / m! {
LL | | use bar::*;
@@ -23,6 +33,10 @@ LL | | }
| |_____- in this macro invocation
|
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: a function with a similar name exists
+ |
+LL | f();
+ | ~
help: consider importing this function
|
LL | use bar::g;
diff --git a/src/test/ui/hygiene/impl_items-2.rs b/src/test/ui/hygiene/impl_items-2.rs
new file mode 100644
index 000000000..465e444ae
--- /dev/null
+++ b/src/test/ui/hygiene/impl_items-2.rs
@@ -0,0 +1,26 @@
+#![feature(decl_macro)]
+
+trait Trait {
+ fn foo() {}
+}
+
+macro trait_impl() {
+ fn foo() {}
+}
+
+// Check that we error on multiple impl items that resolve to the same trait item.
+impl Trait for i32 {
+ trait_impl!();
+ fn foo() {}
+ //~^ ERROR duplicate definitions with name `foo`: [E0201]
+}
+
+struct Type;
+
+// Check that we do not error with inherent impls.
+impl Type {
+ trait_impl!();
+ fn foo() {}
+}
+
+fn main() {}
diff --git a/src/test/ui/hygiene/impl_items-2.stderr b/src/test/ui/hygiene/impl_items-2.stderr
new file mode 100644
index 000000000..3c0ffeb10
--- /dev/null
+++ b/src/test/ui/hygiene/impl_items-2.stderr
@@ -0,0 +1,15 @@
+error[E0201]: duplicate definitions with name `foo`:
+ --> $DIR/impl_items-2.rs:14:5
+ |
+LL | fn foo() {}
+ | ----------- item in trait
+...
+LL | fn foo() {}
+ | ----------- previous definition here
+...
+LL | fn foo() {}
+ | ^^^^^^^^^^^ duplicate definition
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0201`.
diff --git a/src/test/ui/hygiene/impl_items.rs b/src/test/ui/hygiene/impl_items.rs
index 37794c6e0..ddb25c06b 100644
--- a/src/test/ui/hygiene/impl_items.rs
+++ b/src/test/ui/hygiene/impl_items.rs
@@ -9,7 +9,7 @@ mod foo {
}
pub macro m() {
- let _: () = S.f(); //~ ERROR type `for<'r> fn(&'r foo::S) {foo::S::f}` is private
+ let _: () = S.f(); //~ ERROR type `for<'a> fn(&'a foo::S) {foo::S::f}` is private
}
}
diff --git a/src/test/ui/hygiene/impl_items.stderr b/src/test/ui/hygiene/impl_items.stderr
index 523309f43..46a250038 100644
--- a/src/test/ui/hygiene/impl_items.stderr
+++ b/src/test/ui/hygiene/impl_items.stderr
@@ -1,4 +1,4 @@
-error: type `for<'r> fn(&'r foo::S) {foo::S::f}` is private
+error: type `for<'a> fn(&'a foo::S) {foo::S::f}` is private
--> $DIR/impl_items.rs:12:23
|
LL | let _: () = S.f();
diff --git a/src/test/ui/hygiene/rustc-macro-transparency.stderr b/src/test/ui/hygiene/rustc-macro-transparency.stderr
index 17d05dd09..1d2a1e124 100644
--- a/src/test/ui/hygiene/rustc-macro-transparency.stderr
+++ b/src/test/ui/hygiene/rustc-macro-transparency.stderr
@@ -19,14 +19,8 @@ LL | semitransparent;
error[E0423]: expected value, found macro `opaque`
--> $DIR/rustc-macro-transparency.rs:30:5
|
-LL | struct Opaque;
- | -------------- similarly named unit struct `Opaque` defined here
-...
LL | opaque;
- | ^^^^^^
- | |
- | not a value
- | help: a unit struct with a similar name exists (notice the capitalization): `Opaque`
+ | ^^^^^^ not a value
error: aborting due to 3 previous errors
diff --git a/src/test/ui/impl-duplicate-methods.stderr b/src/test/ui/impl-duplicate-methods.stderr
deleted file mode 100644
index c19702a5b..000000000
--- a/src/test/ui/impl-duplicate-methods.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0201]: duplicate definitions with name `orange`:
- --> $DIR/impl-duplicate-methods.rs:5:5
- |
-LL | fn orange(&self) {}
- | ---------------- previous definition of `orange` here
-LL | fn orange(&self) {}
- | ^^^^^^^^^^^^^^^^ duplicate definition
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0201`.
diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr
index 634ff1486..feedfc40a 100644
--- a/src/test/ui/impl-trait/auto-trait-leak.stderr
+++ b/src/test/ui/impl-trait/auto-trait-leak.stderr
@@ -9,12 +9,12 @@ note: ...which requires borrow-checking `cycle1`...
|
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing `cycle1`...
+note: ...which requires processing MIR for `cycle1`...
--> $DIR/auto-trait-leak.rs:12:1
|
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `cycle1`...
+note: ...which requires preparing `cycle1` for borrow checking...
--> $DIR/auto-trait-leak.rs:12:1
|
LL | fn cycle1() -> impl Clone {
@@ -29,6 +29,11 @@ note: ...which requires building MIR for `cycle1`...
|
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires building THIR for `cycle1`...
+ --> $DIR/auto-trait-leak.rs:12:1
+ |
+LL | fn cycle1() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires type-checking `cycle1`...
--> $DIR/auto-trait-leak.rs:14:5
|
@@ -45,12 +50,12 @@ note: ...which requires borrow-checking `cycle2`...
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing `cycle2`...
+note: ...which requires processing MIR for `cycle2`...
--> $DIR/auto-trait-leak.rs:19:1
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `cycle2`...
+note: ...which requires preparing `cycle2` for borrow checking...
--> $DIR/auto-trait-leak.rs:19:1
|
LL | fn cycle2() -> impl Clone {
@@ -65,6 +70,11 @@ note: ...which requires building MIR for `cycle2`...
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires building THIR for `cycle2`...
+ --> $DIR/auto-trait-leak.rs:19:1
+ |
+LL | fn cycle2() -> impl Clone {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires type-checking `cycle2`...
--> $DIR/auto-trait-leak.rs:20:5
|
diff --git a/src/test/ui/impl-trait/equality-rpass.stderr b/src/test/ui/impl-trait/equality-rpass.stderr
index 11eeceba0..bde8362fd 100644
--- a/src/test/ui/impl-trait/equality-rpass.stderr
+++ b/src/test/ui/impl-trait/equality-rpass.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/impl-trait/equality.stderr b/src/test/ui/impl-trait/equality.stderr
index f14b447b0..1841b8e5d 100644
--- a/src/test/ui/impl-trait/equality.stderr
+++ b/src/test/ui/impl-trait/equality.stderr
@@ -4,18 +4,23 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0308]: mismatched types
--> $DIR/equality.rs:15:5
|
LL | fn two(x: bool) -> impl Foo {
- | -------- expected `_` because of return type
+ | -------- expected `i32` because of return type
...
LL | 0_u32
| ^^^^^ expected `i32`, found `u32`
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 0_i32
+ | ~~~
error[E0277]: cannot add `impl Foo` to `u32`
--> $DIR/equality.rs:24:11
diff --git a/src/test/ui/impl-trait/equality2.stderr b/src/test/ui/impl-trait/equality2.stderr
index 46053c6e7..e399a6102 100644
--- a/src/test/ui/impl-trait/equality2.stderr
+++ b/src/test/ui/impl-trait/equality2.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0308]: mismatched types
--> $DIR/equality2.rs:25:18
diff --git a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr
index fd2e454e7..edf3911e2 100644
--- a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr
+++ b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2015.stderr
@@ -1,8 +1,8 @@
-error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied
+error[E0277]: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13
|
LL | fn ice() -> impl AsRef<Fn(&())> {
- | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()`
+ | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()`
error: aborting due to previous error
diff --git a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr
index c01c33a89..88e2520bf 100644
--- a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr
+++ b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr
@@ -6,15 +6,14 @@ LL | fn ice() -> impl AsRef<Fn(&())> {
|
help: add `dyn` keyword before this trait
|
-LL - fn ice() -> impl AsRef<Fn(&())> {
-LL + fn ice() -> impl AsRef<dyn Fn(&())> {
- |
+LL | fn ice() -> impl AsRef<dyn Fn(&())> {
+ | +++
-error[E0277]: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied
+error[E0277]: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13
|
LL | fn ice() -> impl AsRef<Fn(&())> {
- | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not implemented for `()`
+ | ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs
index 856dc7a3f..5a922697f 100644
--- a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs
+++ b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs
@@ -4,7 +4,7 @@
#![allow(warnings)]
fn ice() -> impl AsRef<Fn(&())> {
- //~^ ERROR: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied [E0277]
+ //~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277]
//[edition2021]~| ERROR: trait objects must include the `dyn` keyword [E0782]
todo!()
}
diff --git a/src/test/ui/impl-trait/hidden-lifetimes.stderr b/src/test/ui/impl-trait/hidden-lifetimes.stderr
index efc228de5..3cc47e1e8 100644
--- a/src/test/ui/impl-trait/hidden-lifetimes.stderr
+++ b/src/test/ui/impl-trait/hidden-lifetimes.stderr
@@ -1,4 +1,4 @@
-error[E0700]: hidden type for `impl Swap` captures lifetime that does not appear in bounds
+error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
--> $DIR/hidden-lifetimes.rs:29:5
|
LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
@@ -6,12 +6,12 @@ LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a {
LL | x
| ^
|
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
+help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | fn hide_ref<'a, 'b, T: 'static>(x: &'a mut &'b T) -> impl Swap + 'a + 'b {
| ++++
-error[E0700]: hidden type for `impl Swap` captures lifetime that does not appear in bounds
+error[E0700]: hidden type for `impl Swap + 'a` captures lifetime that does not appear in bounds
--> $DIR/hidden-lifetimes.rs:46:5
|
LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a {
@@ -19,7 +19,7 @@ LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl S
LL | x
| ^
|
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
+help: to declare that `impl Swap + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | fn hide_rc_refcell<'a, 'b: 'a, T: 'static>(x: Rc<RefCell<&'b T>>) -> impl Swap + 'a + 'b {
| ++++
diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.rs b/src/test/ui/impl-trait/impl-generic-mismatch.rs
index ba678bb03..fb8bde0d0 100644
--- a/src/test/ui/impl-trait/impl-generic-mismatch.rs
+++ b/src/test/ui/impl-trait/impl-generic-mismatch.rs
@@ -18,6 +18,15 @@ impl Bar for () {
//~^ Error method `bar` has incompatible signature for trait
}
+trait Baz {
+ fn baz<U: Debug, T: Debug>(&self, _: &U, _: &T);
+}
+
+impl Baz for () {
+ fn baz<T: Debug>(&self, _: &impl Debug, _: &T) { }
+ //~^ Error method `baz` has incompatible signature for trait
+}
+
// With non-local trait (#49841):
use std::hash::{Hash, Hasher};
diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.stderr b/src/test/ui/impl-trait/impl-generic-mismatch.stderr
index 489afd761..542f02d7e 100644
--- a/src/test/ui/impl-trait/impl-generic-mismatch.stderr
+++ b/src/test/ui/impl-trait/impl-generic-mismatch.stderr
@@ -27,8 +27,22 @@ help: try changing the `impl Trait` argument to a generic parameter
LL | fn bar<U: Debug>(&self, _: &U) { }
| ++++++++++ ~
+error[E0643]: method `baz` has incompatible signature for trait
+ --> $DIR/impl-generic-mismatch.rs:26:33
+ |
+LL | fn baz<U: Debug, T: Debug>(&self, _: &U, _: &T);
+ | - declaration in trait here
+...
+LL | fn baz<T: Debug>(&self, _: &impl Debug, _: &T) { }
+ | ^^^^^^^^^^ expected generic parameter, found `impl Trait`
+ |
+help: try changing the `impl Trait` argument to a generic parameter
+ |
+LL | fn baz<U: Debug, T: Debug>(&self, _: &T, _: &T) { }
+ | ~~~~~~~~~~~~~~~~~~~~ ~
+
error[E0643]: method `hash` has incompatible signature for trait
- --> $DIR/impl-generic-mismatch.rs:28:33
+ --> $DIR/impl-generic-mismatch.rs:37:33
|
LL | fn hash(&self, hasher: &mut impl Hasher) {}
| ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
@@ -38,6 +52,6 @@ LL | fn hash(&self, hasher: &mut impl Hasher) {}
LL | fn hash<H: Hasher>(&self, state: &mut H);
| - declaration in trait here
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0643`.
diff --git a/src/test/ui/impl-trait/in-trait/auxiliary/rpitit.rs b/src/test/ui/impl-trait/in-trait/auxiliary/rpitit.rs
new file mode 100644
index 000000000..74df300f8
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/auxiliary/rpitit.rs
@@ -0,0 +1,11 @@
+#![feature(return_position_impl_trait_in_trait)]
+
+pub trait Foo {
+ fn bar() -> impl Sized;
+}
+
+pub struct Foreign;
+
+impl Foo for Foreign {
+ fn bar() {}
+}
diff --git a/src/test/ui/impl-trait/in-trait/deep-match-works.rs b/src/test/ui/impl-trait/in-trait/deep-match-works.rs
new file mode 100644
index 000000000..772da845e
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/deep-match-works.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+struct Wrapper<T>(T);
+
+trait Foo {
+ fn bar() -> Wrapper<impl Sized>;
+}
+
+impl Foo for () {
+ fn bar() -> Wrapper<i32> { Wrapper(0) }
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/deep-match.rs b/src/test/ui/impl-trait/in-trait/deep-match.rs
new file mode 100644
index 000000000..a6385147c
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/deep-match.rs
@@ -0,0 +1,15 @@
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+struct Wrapper<T>(T);
+
+trait Foo {
+ fn bar() -> Wrapper<impl Sized>;
+}
+
+impl Foo for () {
+ fn bar() -> i32 { 0 }
+ //~^ ERROR method `bar` has an incompatible return type for trait
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/deep-match.stderr b/src/test/ui/impl-trait/in-trait/deep-match.stderr
new file mode 100644
index 000000000..034ee5ea4
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/deep-match.stderr
@@ -0,0 +1,15 @@
+error[E0053]: method `bar` has an incompatible return type for trait
+ --> $DIR/deep-match.rs:11:17
+ |
+LL | fn bar() -> i32 { 0 }
+ | ^^^
+ | |
+ | expected struct `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/src/test/ui/impl-trait/in-trait/default-body-type-err-2.rs b/src/test/ui/impl-trait/in-trait/default-body-type-err-2.rs
new file mode 100644
index 000000000..45ae2b8ad
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/default-body-type-err-2.rs
@@ -0,0 +1,13 @@
+// edition:2021
+
+#![allow(incomplete_features)]
+#![feature(async_fn_in_trait)]
+
+pub trait Foo {
+ async fn woopsie_async(&self) -> String {
+ 42
+ //~^ ERROR mismatched types
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/default-body-type-err-2.stderr b/src/test/ui/impl-trait/in-trait/default-body-type-err-2.stderr
new file mode 100644
index 000000000..142b1bff1
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/default-body-type-err-2.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/default-body-type-err-2.rs:8:9
+ |
+LL | 42
+ | ^^- help: try using a conversion method: `.to_string()`
+ | |
+ | expected struct `String`, found integer
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/impl-trait/in-trait/default-body-type-err.rs b/src/test/ui/impl-trait/in-trait/default-body-type-err.rs
new file mode 100644
index 000000000..ac9baf91c
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/default-body-type-err.rs
@@ -0,0 +1,13 @@
+#![allow(incomplete_features)]
+#![feature(return_position_impl_trait_in_trait)]
+
+use std::ops::Deref;
+
+pub trait Foo {
+ fn lol(&self) -> impl Deref<Target = String> {
+ //~^ type mismatch resolving `<&i32 as Deref>::Target == String`
+ &1i32
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/default-body-type-err.stderr b/src/test/ui/impl-trait/in-trait/default-body-type-err.stderr
new file mode 100644
index 000000000..461247a3e
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/default-body-type-err.stderr
@@ -0,0 +1,12 @@
+error[E0271]: type mismatch resolving `<&i32 as Deref>::Target == String`
+ --> $DIR/default-body-type-err.rs:7:22
+ |
+LL | fn lol(&self) -> impl Deref<Target = String> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `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/src/test/ui/impl-trait/in-trait/default-body-with-rpit.rs b/src/test/ui/impl-trait/in-trait/default-body-with-rpit.rs
new file mode 100644
index 000000000..ad3cc7c25
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/default-body-with-rpit.rs
@@ -0,0 +1,21 @@
+// check-pass
+// edition:2021
+
+#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+trait Foo {
+ async fn baz(&self) -> impl Debug {
+ ""
+ }
+}
+
+struct Bar;
+
+impl Foo for Bar {}
+
+fn main() {
+ let _ = Bar.baz();
+}
diff --git a/src/test/ui/impl-trait/in-trait/default-body.rs b/src/test/ui/impl-trait/in-trait/default-body.rs
new file mode 100644
index 000000000..b0baf5bb1
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/default-body.rs
@@ -0,0 +1,21 @@
+// check-pass
+// edition:2021
+
+#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+trait Foo {
+ async fn baz(&self) -> &str {
+ ""
+ }
+}
+
+struct Bar;
+
+impl Foo for Bar {}
+
+fn main() {
+ let _ = Bar.baz();
+}
diff --git a/src/test/ui/impl-trait/in-trait/doesnt-satisfy.rs b/src/test/ui/impl-trait/in-trait/doesnt-satisfy.rs
new file mode 100644
index 000000000..bb4e0d44f
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/doesnt-satisfy.rs
@@ -0,0 +1,13 @@
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+trait Foo {
+ fn bar() -> impl std::fmt::Display;
+}
+
+impl Foo for () {
+ fn bar() -> () {}
+ //~^ ERROR `()` doesn't implement `std::fmt::Display`
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/doesnt-satisfy.stderr b/src/test/ui/impl-trait/in-trait/doesnt-satisfy.stderr
new file mode 100644
index 000000000..aa5492d28
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/doesnt-satisfy.stderr
@@ -0,0 +1,17 @@
+error[E0277]: `()` doesn't implement `std::fmt::Display`
+ --> $DIR/doesnt-satisfy.rs:9: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::bar::{opaque#0}`
+ --> $DIR/doesnt-satisfy.rs:5:22
+ |
+LL | fn bar() -> impl std::fmt::Display;
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `Foo::bar::{opaque#0}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/impl-trait/in-trait/early.rs b/src/test/ui/impl-trait/in-trait/early.rs
new file mode 100644
index 000000000..9c1c2b503
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/early.rs
@@ -0,0 +1,23 @@
+// check-pass
+// edition:2021
+
+#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+pub trait Foo {
+ async fn bar<'a: 'a>(&'a mut self);
+}
+
+impl Foo for () {
+ async fn bar<'a: 'a>(&'a mut self) {}
+}
+
+pub trait Foo2 {
+ fn bar<'a: 'a>(&'a mut self) -> impl Sized + 'a;
+}
+
+impl Foo2 for () {
+ fn bar<'a: 'a>(&'a mut self) -> impl Sized + 'a {}
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/encode.rs b/src/test/ui/impl-trait/in-trait/encode.rs
new file mode 100644
index 000000000..efb9f6498
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/encode.rs
@@ -0,0 +1,9 @@
+// build-pass
+// compile-flags: --crate-type=lib
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+trait Foo {
+ fn bar() -> impl Sized;
+}
diff --git a/src/test/ui/impl-trait/in-trait/foreign.rs b/src/test/ui/impl-trait/in-trait/foreign.rs
new file mode 100644
index 000000000..6341f5b42
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/foreign.rs
@@ -0,0 +1,9 @@
+// check-pass
+// aux-build: rpitit.rs
+
+extern crate rpitit;
+
+fn main() {
+ // Witness an RPITIT from another crate
+ let () = <rpitit::Foreign as rpitit::Foo>::bar();
+}
diff --git a/src/test/ui/impl-trait/in-trait/issue-102140.rs b/src/test/ui/impl-trait/in-trait/issue-102140.rs
new file mode 100644
index 000000000..be1e012ac
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/issue-102140.rs
@@ -0,0 +1,30 @@
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+trait Marker {}
+impl Marker for u32 {}
+
+trait MyTrait {
+ fn foo(&self) -> impl Marker
+ where
+ Self: Sized;
+}
+
+struct Outer;
+
+impl MyTrait for Outer {
+ fn foo(&self) -> impl Marker {
+ 42
+ }
+}
+
+impl dyn MyTrait {
+ fn other(&self) -> impl Marker {
+ MyTrait::foo(&self)
+ //~^ ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
+ //~| ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
+ //~| ERROR the trait bound `&dyn MyTrait: MyTrait` is not satisfied
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/issue-102140.stderr b/src/test/ui/impl-trait/in-trait/issue-102140.stderr
new file mode 100644
index 000000000..08602185f
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/issue-102140.stderr
@@ -0,0 +1,29 @@
+error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
+ --> $DIR/issue-102140.rs:23:22
+ |
+LL | MyTrait::foo(&self)
+ | ------------ -^^^^
+ | | |
+ | | the trait `MyTrait` is not implemented for `&dyn MyTrait`
+ | | help: consider removing the leading `&`-reference
+ | required by a bound introduced by this call
+
+error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
+ --> $DIR/issue-102140.rs:23: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:23: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/src/test/ui/impl-trait/in-trait/issue-102301.rs b/src/test/ui/impl-trait/in-trait/issue-102301.rs
new file mode 100644
index 000000000..a93714a65
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/issue-102301.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+trait Foo<T> {
+ fn foo<F2: Foo<T>>(self) -> impl Foo<T>;
+}
+
+struct Bar;
+
+impl Foo<u8> for Bar {
+ fn foo<F2: Foo<u8>>(self) -> impl Foo<u8> {
+ self
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/issue-102571.rs b/src/test/ui/impl-trait/in-trait/issue-102571.rs
new file mode 100644
index 000000000..61c91e644
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/issue-102571.rs
@@ -0,0 +1,24 @@
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Display;
+use std::ops::Deref;
+
+trait Foo {
+ fn bar(self) -> impl Deref<Target = impl Display + ?Sized>;
+}
+
+struct A;
+
+impl Foo for A {
+ fn bar(self) -> &'static str {
+ "Hello, world"
+ }
+}
+
+fn foo<T: Foo>(t: T) {
+ let () = t.bar();
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/issue-102571.stderr b/src/test/ui/impl-trait/in-trait/issue-102571.stderr
new file mode 100644
index 000000000..87219941d
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/issue-102571.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-102571.rs:20: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/src/test/ui/impl-trait/in-trait/nested-rpitit.rs b/src/test/ui/impl-trait/in-trait/nested-rpitit.rs
new file mode 100644
index 000000000..65285e3a3
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/nested-rpitit.rs
@@ -0,0 +1,32 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Display;
+use std::ops::Deref;
+
+trait Foo {
+ fn bar(self) -> impl Deref<Target = impl Display + ?Sized>;
+}
+
+struct A;
+
+impl Foo for A {
+ fn bar(self) -> &'static str {
+ "Hello, world"
+ }
+}
+
+struct B;
+
+impl Foo for B {
+ fn bar(self) -> Box<i32> {
+ Box::new(42)
+ }
+}
+
+fn main() {
+ println!("Message for you: {:?}", &*A.bar());
+ println!("Another for you: {:?}", &*B.bar());
+}
diff --git a/src/test/ui/impl-trait/in-trait/object-safety.rs b/src/test/ui/impl-trait/in-trait/object-safety.rs
new file mode 100644
index 000000000..dd35b9a2d
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/object-safety.rs
@@ -0,0 +1,22 @@
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+trait Foo {
+ fn baz(&self) -> impl Debug;
+}
+
+impl Foo for u32 {
+ fn baz(&self) -> u32 {
+ 32
+ }
+}
+
+fn main() {
+ let i = Box::new(42_u32) as Box<dyn Foo>;
+ //~^ ERROR the trait `Foo` cannot be made into an object
+ //~| ERROR the trait `Foo` cannot be made into an object
+ let s = i.baz();
+ //~^ ERROR the trait `Foo` cannot be made into an object
+}
diff --git a/src/test/ui/impl-trait/in-trait/object-safety.stderr b/src/test/ui/impl-trait/in-trait/object-safety.stderr
new file mode 100644
index 000000000..9a1554b5e
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/object-safety.stderr
@@ -0,0 +1,50 @@
+error[E0038]: the trait `Foo` cannot be made into an object
+ --> $DIR/object-safety.rs:17: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:8
+ |
+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 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:8
+ |
+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:17: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:8
+ |
+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/src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs b/src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
new file mode 100644
index 000000000..3ac264e8e
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.rs
@@ -0,0 +1,19 @@
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Display;
+
+trait Foo {
+ fn bar(&self) -> impl Display;
+}
+
+impl Foo for () {
+ fn bar(&self) -> impl Display {
+ "Hello, world"
+ }
+}
+
+fn main() {
+ let x: &str = ().bar();
+ //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr b/src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr
new file mode 100644
index 000000000..15edda483
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/opaque-in-impl-is-opaque.stderr
@@ -0,0 +1,17 @@
+error[E0308]: mismatched types
+ --> $DIR/opaque-in-impl-is-opaque.rs:17: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/src/test/ui/impl-trait/in-trait/opaque-in-impl.rs b/src/test/ui/impl-trait/in-trait/opaque-in-impl.rs
new file mode 100644
index 000000000..2e0662969
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/opaque-in-impl.rs
@@ -0,0 +1,48 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Debug;
+
+trait Foo {
+ fn foo(&self) -> impl Debug;
+}
+
+impl Foo for () {
+ fn foo(&self) -> impl Debug {
+ "Hello, world"
+ }
+}
+
+impl<T: Default + Debug> Foo for std::marker::PhantomData<T> {
+ fn foo(&self) -> impl Debug {
+ T::default()
+ }
+}
+
+trait Bar {
+ fn bar<T>(&self) -> impl Debug;
+}
+
+impl Bar for () {
+ fn bar<T>(&self) -> impl Debug {
+ format!("Hello with generic {}", std::any::type_name::<T>())
+ }
+}
+
+trait Baz {
+ fn baz(&self) -> impl Debug + '_;
+}
+
+impl Baz for String {
+ fn baz(&self) -> impl Debug + '_ {
+ (self,)
+ }
+}
+
+fn main() {
+ println!("{:?}", ().foo());
+ println!("{:?}", ().bar::<u64>());
+ println!("{:?}", "hi".to_string().baz());
+}
diff --git a/src/test/ui/impl-trait/in-trait/reveal.rs b/src/test/ui/impl-trait/in-trait/reveal.rs
new file mode 100644
index 000000000..d6ede1cc4
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/reveal.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+trait Foo {
+ fn f() -> Box<impl Sized>;
+}
+
+impl Foo for () {
+ fn f() -> Box<String> {
+ Box::new(String::new())
+ }
+}
+
+fn main() {
+ let x: Box<String> = <() as Foo>::f();
+}
diff --git a/src/test/ui/impl-trait/in-trait/signature-mismatch.rs b/src/test/ui/impl-trait/in-trait/signature-mismatch.rs
new file mode 100644
index 000000000..90682631a
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/signature-mismatch.rs
@@ -0,0 +1,21 @@
+// edition:2021
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::future::Future;
+
+pub trait AsyncTrait {
+ fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
+}
+
+pub struct Struct;
+
+impl AsyncTrait for Struct {
+ fn async_fn<'a>(&self, buff: &'a [u8]) -> impl Future<Output = Vec<u8>> + 'a {
+ //~^ ERROR `impl` item signature doesn't match `trait` item signature
+ async move { buff.to_vec() }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/signature-mismatch.stderr b/src/test/ui/impl-trait/in-trait/signature-mismatch.stderr
new file mode 100644
index 000000000..6663d7faa
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/signature-mismatch.stderr
@@ -0,0 +1,16 @@
+error: `impl` item signature doesn't match `trait` item signature
+ --> $DIR/signature-mismatch.rs:15:5
+ |
+LL | fn async_fn(&self, buff: &[u8]) -> impl Future<Output = Vec<u8>>;
+ | ----------------------------------------------------------------- expected `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + 'static`
+...
+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 `fn(&'1 Struct, &'2 [u8]) -> impl Future<Output = Vec<u8>> + 'static`
+ found `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/src/test/ui/impl-trait/in-trait/success.rs b/src/test/ui/impl-trait/in-trait/success.rs
new file mode 100644
index 000000000..4cbe682b4
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/success.rs
@@ -0,0 +1,40 @@
+// check-pass
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+use std::fmt::Display;
+
+trait Foo {
+ fn bar(&self) -> impl Display;
+}
+
+impl Foo for i32 {
+ fn bar(&self) -> i32 {
+ *self
+ }
+}
+
+impl Foo for &'static str {
+ fn bar(&self) -> &'static str {
+ *self
+ }
+}
+
+struct Yay;
+
+impl Foo for Yay {
+ fn bar(&self) -> String {
+ String::from(":^)")
+ }
+}
+
+fn foo_generically<T: Foo>(t: T) {
+ println!("{}", t.bar());
+}
+
+fn main() {
+ println!("{}", "Hello, world.".bar());
+ println!("The answer is {}!", 42.bar());
+ foo_generically(Yay);
+}
diff --git a/src/test/ui/impl-trait/in-trait/wf-bounds.rs b/src/test/ui/impl-trait/in-trait/wf-bounds.rs
new file mode 100644
index 000000000..2c71583b3
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/wf-bounds.rs
@@ -0,0 +1,16 @@
+// issue #101663
+
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+trait Wf<T> {}
+
+trait Uwu {
+ fn nya() -> impl Wf<Vec<[u8]>>;
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+
+ fn nya2() -> impl Wf<[u8]>;
+ //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/in-trait/wf-bounds.stderr b/src/test/ui/impl-trait/in-trait/wf-bounds.stderr
new file mode 100644
index 000000000..92e36841b
--- /dev/null
+++ b/src/test/ui/impl-trait/in-trait/wf-bounds.stderr
@@ -0,0 +1,33 @@
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/wf-bounds.rs:9: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
+ |
+LL | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
+ | ^ required by this bound in `Vec`
+
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+ --> $DIR/wf-bounds.rs:12: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
+ |
+LL | trait Wf<T> {}
+ | ^ required by this bound in `Wf`
+help: consider relaxing the implicit `Sized` restriction
+ |
+LL | trait Wf<T: ?Sized> {}
+ | ++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/impl-trait/issue-100075-2.rs b/src/test/ui/impl-trait/issue-100075-2.rs
new file mode 100644
index 000000000..cf059af19
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-100075-2.rs
@@ -0,0 +1,8 @@
+fn opaque<T>(t: T) -> impl Sized {
+ //~^ ERROR cannot resolve opaque type
+ //~| WARNING function cannot return without recursing
+ opaque(Some(t))
+}
+
+#[allow(dead_code)]
+fn main() {}
diff --git a/src/test/ui/impl-trait/issue-100075-2.stderr b/src/test/ui/impl-trait/issue-100075-2.stderr
new file mode 100644
index 000000000..d2dbd8c62
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-100075-2.stderr
@@ -0,0 +1,24 @@
+warning: function cannot return without recursing
+ --> $DIR/issue-100075-2.rs:1:1
+ |
+LL | fn opaque<T>(t: T) -> impl Sized {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
+...
+LL | opaque(Some(t))
+ | --------------- recursive call site
+ |
+ = help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
+
+error[E0720]: cannot resolve opaque type
+ --> $DIR/issue-100075-2.rs:1:23
+ |
+LL | fn opaque<T>(t: T) -> impl Sized {
+ | ^^^^^^^^^^ recursive opaque type
+...
+LL | opaque(Some(t))
+ | --------------- returning here with type `impl Sized`
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/src/test/ui/impl-trait/issue-100075.rs b/src/test/ui/impl-trait/issue-100075.rs
new file mode 100644
index 000000000..ea30abb48
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-100075.rs
@@ -0,0 +1,21 @@
+trait Marker {}
+impl<T> Marker for T {}
+
+fn maybe<T>(
+ _t: T,
+) -> Option<
+ //removing the line below makes it compile
+ &'static T,
+> {
+ None
+}
+
+fn _g<T>(t: &'static T) -> &'static impl Marker {
+ //~^ ERROR cannot resolve opaque type
+ if let Some(t) = maybe(t) {
+ return _g(t);
+ }
+ todo!()
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/issue-100075.stderr b/src/test/ui/impl-trait/issue-100075.stderr
new file mode 100644
index 000000000..267ecfdae
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-100075.stderr
@@ -0,0 +1,12 @@
+error[E0720]: cannot resolve opaque type
+ --> $DIR/issue-100075.rs:13:37
+ |
+LL | fn _g<T>(t: &'static T) -> &'static impl Marker {
+ | ^^^^^^^^^^^ recursive opaque type
+...
+LL | return _g(t);
+ | ----- returning here with type `&impl Marker`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/src/test/ui/impl-trait/issue-102605.rs b/src/test/ui/impl-trait/issue-102605.rs
new file mode 100644
index 000000000..3bbdf35af
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-102605.rs
@@ -0,0 +1,15 @@
+// edition:2021
+
+async fn foo() -> Result<(), String> {
+ Ok(())
+}
+
+fn convert_result<T, E>(r: Result<T, E>) -> Option<T> {
+ None
+}
+
+fn main() -> Option<()> {
+ //~^ ERROR `main` has invalid return type `Option<()>`
+ convert_result(foo())
+ //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/impl-trait/issue-102605.stderr b/src/test/ui/impl-trait/issue-102605.stderr
new file mode 100644
index 000000000..d4aba9149
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-102605.stderr
@@ -0,0 +1,41 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-102605.rs:13:20
+ |
+LL | convert_result(foo())
+ | -------------- ^^^^^ expected enum `Result`, found opaque type
+ | |
+ | arguments to this function are incorrect
+ |
+note: while checking the return type of the `async fn`
+ --> $DIR/issue-102605.rs:3:19
+ |
+LL | async fn foo() -> Result<(), String> {
+ | ^^^^^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, found opaque type
+ = note: expected enum `Result<(), _>`
+ found opaque type `impl Future<Output = Result<(), String>>`
+note: function defined here
+ --> $DIR/issue-102605.rs:7:4
+ |
+LL | fn convert_result<T, E>(r: Result<T, E>) -> Option<T> {
+ | ^^^^^^^^^^^^^^ ---------------
+help: consider `await`ing on the `Future`
+ |
+LL | convert_result(foo().await)
+ | ++++++
+help: try wrapping the expression in `Err`
+ |
+LL | convert_result(Err(foo()))
+ | ++++ +
+
+error[E0277]: `main` has invalid return type `Option<()>`
+ --> $DIR/issue-102605.rs:11:14
+ |
+LL | fn main() -> Option<()> {
+ | ^^^^^^^^^^ `main` can only return types that implement `Termination`
+ |
+ = help: consider using `()`, or a `Result`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/impl-trait/issue-103181-1.rs b/src/test/ui/impl-trait/issue-103181-1.rs
new file mode 100644
index 000000000..197aedf9d
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103181-1.rs
@@ -0,0 +1,85 @@
+// edition:2021
+
+mod hyper {
+ use std::{fmt::Debug, future::Future, marker::PhantomData, pin::Pin, task::Poll};
+
+ pub trait HttpBody {
+ type Error;
+ }
+ impl HttpBody for () {
+ //~^ ERROR not all trait items implemented, missing: `Error`
+ // don't implement `Error` here for the ICE
+ }
+
+ pub struct Server<I, S>(I, S);
+
+ pub fn serve<I, S>(_: S) -> Server<I, S> {
+ todo!()
+ }
+
+ impl<S, B> Future for Server<(), S>
+ where
+ S: MakeServiceRef<(), (), ResBody = B>,
+ B: HttpBody,
+ B::Error: Debug,
+ {
+ type Output = ();
+
+ fn poll(self: Pin<&mut Self>, _: &mut std::task::Context<'_>) -> Poll<Self::Output> {
+ todo!()
+ }
+ }
+
+ pub trait MakeServiceRef<Target, ReqBody> {
+ type ResBody;
+ }
+
+ impl<T, S> MakeServiceRef<(), ()> for T
+ where
+ T: for<'a> Service<&'a (), Response = S>,
+ S: Service<()>,
+ {
+ type ResBody = ();
+ }
+
+ pub struct MakeServiceFn<F>(pub F);
+ pub struct ServiceFn<F, R>(pub PhantomData<(F, R)>);
+
+ pub trait Service<Request> {
+ type Response;
+ }
+
+ impl<'t, F, Ret, Target, Svc> Service<&'t Target> for MakeServiceFn<F>
+ where
+ F: Fn() -> Ret,
+ Ret: Future<Output = Result<Svc, ()>>,
+ {
+ type Response = Svc;
+ }
+
+ impl<F, ReqBody, Ret, ResBody, E> Service<ReqBody> for ServiceFn<F, ReqBody>
+ where
+ F: Fn() -> Ret,
+ Ret: Future<Output = Result<ResBody, E>>,
+ {
+ type Response = ResBody;
+ }
+}
+
+async fn smarvice() -> Result<(), ()> {
+ Ok(())
+}
+
+fn service_fn<F, R, S>(f: F) -> hyper::ServiceFn<F, R>
+where
+ F: Fn() -> S,
+{
+ hyper::ServiceFn(std::marker::PhantomData)
+}
+
+async fn iceice() {
+ let service = hyper::MakeServiceFn(|| async { Ok::<_, ()>(service_fn(|| smarvice())) });
+ hyper::serve::<(), _>(service).await;
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/issue-103181-1.stderr b/src/test/ui/impl-trait/issue-103181-1.stderr
new file mode 100644
index 000000000..cd026607d
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103181-1.stderr
@@ -0,0 +1,12 @@
+error[E0046]: not all trait items implemented, missing: `Error`
+ --> $DIR/issue-103181-1.rs:9:5
+ |
+LL | type Error;
+ | ---------- `Error` from trait
+LL | }
+LL | impl HttpBody for () {
+ | ^^^^^^^^^^^^^^^^^^^^ missing `Error` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/src/test/ui/impl-trait/issue-103181-2.rs b/src/test/ui/impl-trait/issue-103181-2.rs
new file mode 100644
index 000000000..b43ac4507
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103181-2.rs
@@ -0,0 +1,29 @@
+// edition:2021
+
+trait SendFuture: Send {
+ type Output;
+}
+
+impl<Fut: Send> SendFuture for Fut {
+ type Output = ();
+}
+
+async fn broken_fut() {
+ ident_error;
+ //~^ ERROR cannot find value `ident_error` in this scope
+}
+
+// triggers normalization of `<Fut as SendFuture>::Output`,
+// which requires `Fut: Send`.
+fn normalize<Fut: SendFuture>(_: Fut, _: Fut::Output) {}
+
+async fn iceice<A, B>()
+// <- async fn is necessary
+where
+ A: Send,
+ B: Send, // <- a second bound
+{
+ normalize(broken_fut(), ());
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/issue-103181-2.stderr b/src/test/ui/impl-trait/issue-103181-2.stderr
new file mode 100644
index 000000000..5eb2dd918
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103181-2.stderr
@@ -0,0 +1,9 @@
+error[E0425]: cannot find value `ident_error` in this scope
+ --> $DIR/issue-103181-2.rs:12:5
+ |
+LL | ident_error;
+ | ^^^^^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/impl-trait/issue-103599.rs b/src/test/ui/impl-trait/issue-103599.rs
new file mode 100644
index 000000000..043ae67f2
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103599.rs
@@ -0,0 +1,10 @@
+// check-pass
+
+trait T {}
+
+fn wrap(x: impl T) -> impl T {
+ //~^ WARN function cannot return without recursing
+ wrap(wrap(x))
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/issue-103599.stderr b/src/test/ui/impl-trait/issue-103599.stderr
new file mode 100644
index 000000000..82038c1dc
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-103599.stderr
@@ -0,0 +1,14 @@
+warning: function cannot return without recursing
+ --> $DIR/issue-103599.rs:5:1
+ |
+LL | fn wrap(x: impl T) -> impl T {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
+LL |
+LL | wrap(wrap(x))
+ | ------- recursive call site
+ |
+ = help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/impl-trait/issue-86465.rs b/src/test/ui/impl-trait/issue-86465.rs
index a79bb6474..8c7b41d73 100644
--- a/src/test/ui/impl-trait/issue-86465.rs
+++ b/src/test/ui/impl-trait/issue-86465.rs
@@ -1,6 +1,10 @@
#![feature(type_alias_impl_trait)]
-type X<'a, 'b> = impl std::fmt::Debug;
+pub trait Captures<'a> {}
+
+impl<'a, T: ?Sized> Captures<'a> for T {}
+
+type X<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
fn f<'t, 'u>(a: &'t u32, b: &'u u32) -> (X<'t, 'u>, X<'u, 't>) {
(a, a)
diff --git a/src/test/ui/impl-trait/issue-86465.stderr b/src/test/ui/impl-trait/issue-86465.stderr
index 90d6904ed..b949b2b42 100644
--- a/src/test/ui/impl-trait/issue-86465.stderr
+++ b/src/test/ui/impl-trait/issue-86465.stderr
@@ -1,5 +1,5 @@
error: concrete type differs from previous defining opaque type use
- --> $DIR/issue-86465.rs:6:5
+ --> $DIR/issue-86465.rs:10:5
|
LL | (a, a)
| ^^^^^^
diff --git a/src/test/ui/impl-trait/issue-87450.stderr b/src/test/ui/impl-trait/issue-87450.stderr
index 5019e544b..173fca63f 100644
--- a/src/test/ui/impl-trait/issue-87450.stderr
+++ b/src/test/ui/impl-trait/issue-87450.stderr
@@ -7,8 +7,8 @@ LL | fn foo() -> impl Fn() {
LL | wrap(wrap(wrap(wrap(wrap(wrap(wrap(foo())))))))
| ----- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
error[E0720]: cannot resolve opaque type
--> $DIR/issue-87450.rs:5:13
diff --git a/src/test/ui/impl-trait/issue-99914.rs b/src/test/ui/impl-trait/issue-99914.rs
new file mode 100644
index 000000000..4324a0229
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-99914.rs
@@ -0,0 +1,13 @@
+// edition:2021
+
+fn main() {}
+
+struct Error;
+struct Okay;
+
+fn foo(t: Result<Okay, Error>) {
+ t.and_then(|t| -> _ { bar(t) });
+ //~^ ERROR mismatched types
+}
+
+async fn bar(t: Okay) {}
diff --git a/src/test/ui/impl-trait/issue-99914.stderr b/src/test/ui/impl-trait/issue-99914.stderr
new file mode 100644
index 000000000..074d5d58d
--- /dev/null
+++ b/src/test/ui/impl-trait/issue-99914.stderr
@@ -0,0 +1,21 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-99914.rs:9:27
+ |
+LL | t.and_then(|t| -> _ { bar(t) });
+ | ^^^^^^ expected enum `Result`, found opaque type
+ |
+note: while checking the return type of the `async fn`
+ --> $DIR/issue-99914.rs:13:23
+ |
+LL | async fn bar(t: Okay) {}
+ | ^ checked the `Output` of this `async fn`, found opaque type
+ = note: expected enum `Result<_, Error>`
+ found opaque type `impl Future<Output = ()>`
+help: try wrapping the expression in `Ok`
+ |
+LL | t.and_then(|t| -> _ { Ok(bar(t)) });
+ | +++ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/impl-trait/issues/issue-78722.rs b/src/test/ui/impl-trait/issues/issue-78722.rs
index 002e4cde4..9ee1ba3d3 100644
--- a/src/test/ui/impl-trait/issues/issue-78722.rs
+++ b/src/test/ui/impl-trait/issues/issue-78722.rs
@@ -7,12 +7,12 @@ type F = impl core::future::Future<Output = u8>;
struct Bug {
V1: [(); {
fn concrete_use() -> F {
- //~^ ERROR type mismatch
+ //~^ ERROR expected `impl Future<Output = ()>` to be a future that resolves to `u8`, but it resolves to `()`
async {}
}
let f: F = async { 1 };
//~^ ERROR `async` blocks are not allowed in constants
- //~| ERROR destructors cannot be evaluated at compile-time
+ //~| ERROR destructor of
1
}],
}
diff --git a/src/test/ui/impl-trait/issues/issue-78722.stderr b/src/test/ui/impl-trait/issues/issue-78722.stderr
index 690d6abc7..a96994f5a 100644
--- a/src/test/ui/impl-trait/issues/issue-78722.stderr
+++ b/src/test/ui/impl-trait/issues/issue-78722.stderr
@@ -7,16 +7,16 @@ 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]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `F` cannot be evaluated at compile-time
--> $DIR/issue-78722.rs:13:13
|
LL | let f: F = async { 1 };
- | ^ constants cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in constants
...
LL | }],
| - value is dropped here
-error[E0271]: type mismatch resolving `<impl Future<Output = ()> as Future>::Output == u8`
+error[E0271]: expected `impl Future<Output = ()>` to be a future that resolves to `u8`, but it resolves to `()`
--> $DIR/issue-78722.rs:9:30
|
LL | fn concrete_use() -> F {
diff --git a/src/test/ui/impl-trait/issues/issue-86800.stderr b/src/test/ui/impl-trait/issues/issue-86800.stderr
index 135d06d44..6c4aa3567 100644
--- a/src/test/ui/impl-trait/issues/issue-86800.stderr
+++ b/src/test/ui/impl-trait/issues/issue-86800.stderr
@@ -1,3 +1,11 @@
+error: unconstrained opaque type
+ --> $DIR/issue-86800.rs:33:34
+ |
+LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ =
+
stack backtrace:
@@ -12,8 +20,7 @@ error: internal compiler error: unexpected panic
query stack during panic:
-#0 [mir_borrowck] borrow-checking `execute_transaction_fut`
-#1 [type_of] computing type of `TransactionFuture::{opaque#0}`
-#2 [check_mod_item_types] checking item types in top-level module
-#3 [analysis] running analysis passes on this crate
+#0 [type_of] computing type of `TransactionFuture::{opaque#0}`
+#1 [check_mod_item_types] checking item types in top-level module
+#2 [analysis] running analysis passes on this crate
end of query stack
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr
index cb1dc0b7d..ec49a6179 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unrelated.stderr
@@ -7,7 +7,7 @@ LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> im
LL | if condition() { a } else { b }
| ^
|
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
+help: to declare that `impl Trait<'d, 'e>` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | fn upper_bounds<'a, 'b, 'c, 'd, 'e>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'d, 'e> + 'b
| ++++
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr
index 4388e6601..c36f9bc69 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.stderr
@@ -7,7 +7,7 @@ LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a,
LL | if condition() { a } else { b }
| ^
|
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
+help: to declare that `impl Trait<'a, 'b>` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b> + 'b
| ++++
diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
index 16767abd7..9c81791fb 100644
--- a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
+++ b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr
@@ -6,7 +6,7 @@ LL | fn elided(x: &i32) -> impl Copy { x }
| |
| hidden type `&i32` captures the anonymous lifetime defined here
|
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl Copy` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
| ++++
@@ -19,7 +19,7 @@ LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x }
| |
| hidden type `&'a i32` captures the lifetime `'a` as defined here
|
-help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
+help: to declare that `impl Copy` captures `'a`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
| ++++
@@ -32,7 +32,7 @@ LL | fn elided2(x: &i32) -> impl Copy + 'static { x }
| |
| let's call the lifetime of this reference `'1`
|
-help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
+help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
| ~~
@@ -47,7 +47,7 @@ error: lifetime may not live long enough
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'static { x }
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
|
-help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
+help: consider changing `impl Copy + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
| ~~
@@ -76,7 +76,7 @@ help: to declare that the trait object captures data from argument `x`, you can
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
| ++++
-help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl Debug` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
| ++++
@@ -87,7 +87,7 @@ error: lifetime may not live long enough
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x }
| -- lifetime `'a` defined here ^ returning this value requires that `'a` must outlive `'static`
|
-help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
+help: consider changing `impl LifetimeTrait<'a> + 'static`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
| ~~
@@ -104,7 +104,7 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
LL | move |_| println!("{}", y)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-help: to declare that the `impl Trait` captures `'b`, you can add an explicit `'b` lifetime bound
+help: to declare that `impl Fn(&'a u32)` captures `'b`, you can add an explicit `'b` lifetime bound
|
LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) + 'b {
| ++++
diff --git a/src/test/ui/impl-trait/nested-return-type2-tait.rs b/src/test/ui/impl-trait/nested-return-type2-tait.rs
index 42613d5cc..089018a1c 100644
--- a/src/test/ui/impl-trait/nested-return-type2-tait.rs
+++ b/src/test/ui/impl-trait/nested-return-type2-tait.rs
@@ -26,6 +26,7 @@ type Sendable = impl Send;
// var to make it uphold the `: Duh` bound on `Trait::Assoc`. The opaque
// type does not implement `Duh`, but if its hidden type does.
fn foo() -> impl Trait<Assoc = Sendable> {
+ //~^ WARN opaque type `impl Trait<Assoc = Sendable>` does not satisfy its associated type bounds
|| 42
}
diff --git a/src/test/ui/impl-trait/nested-return-type2-tait.stderr b/src/test/ui/impl-trait/nested-return-type2-tait.stderr
new file mode 100644
index 000000000..a8eb69cfc
--- /dev/null
+++ b/src/test/ui/impl-trait/nested-return-type2-tait.stderr
@@ -0,0 +1,17 @@
+warning: opaque type `impl Trait<Assoc = Sendable>` does not satisfy its associated type bounds
+ --> $DIR/nested-return-type2-tait.rs:28:24
+ |
+LL | type Assoc: Duh;
+ | --- this associated type bound is unsatisfied for `Sendable`
+...
+LL | fn foo() -> impl Trait<Assoc = Sendable> {
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(opaque_hidden_inferred_bound)]` on by default
+help: add this bound
+ |
+LL | type Sendable = impl Send + Duh;
+ | +++++
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/impl-trait/nested-return-type2-tait2.stderr b/src/test/ui/impl-trait/nested-return-type2-tait2.stderr
index fe1ae4fcb..348c737b0 100644
--- a/src/test/ui/impl-trait/nested-return-type2-tait2.stderr
+++ b/src/test/ui/impl-trait/nested-return-type2-tait2.stderr
@@ -5,7 +5,7 @@ LL | || 42
| ^^^^^ the trait `Duh` is not implemented for `Sendable`
|
= help: the trait `Duh` is implemented for `i32`
-note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait2.rs:27:5: 27:7]`
+note: required for `[closure@$DIR/nested-return-type2-tait2.rs:27:5: 27:7]` to implement `Trait`
--> $DIR/nested-return-type2-tait2.rs:14:31
|
LL | impl<R: Duh, F: FnMut() -> R> Trait for F {
diff --git a/src/test/ui/impl-trait/nested-return-type2-tait3.stderr b/src/test/ui/impl-trait/nested-return-type2-tait3.stderr
index c0695d627..6ac671415 100644
--- a/src/test/ui/impl-trait/nested-return-type2-tait3.stderr
+++ b/src/test/ui/impl-trait/nested-return-type2-tait3.stderr
@@ -5,7 +5,7 @@ LL | || 42
| ^^^^^ the trait `Duh` is not implemented for `impl Send`
|
= help: the trait `Duh` is implemented for `i32`
-note: required because of the requirements on the impl of `Trait` for `[closure@$DIR/nested-return-type2-tait3.rs:26:5: 26:7]`
+note: required for `[closure@$DIR/nested-return-type2-tait3.rs:26:5: 26:7]` to implement `Trait`
--> $DIR/nested-return-type2-tait3.rs:14:31
|
LL | impl<R: Duh, F: FnMut() -> R> Trait for F {
diff --git a/src/test/ui/impl-trait/nested-return-type2.rs b/src/test/ui/impl-trait/nested-return-type2.rs
index 39928d543..cc1f1f4ec 100644
--- a/src/test/ui/impl-trait/nested-return-type2.rs
+++ b/src/test/ui/impl-trait/nested-return-type2.rs
@@ -23,6 +23,7 @@ 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/src/test/ui/impl-trait/nested-return-type2.stderr b/src/test/ui/impl-trait/nested-return-type2.stderr
new file mode 100644
index 000000000..3aed05ca1
--- /dev/null
+++ b/src/test/ui/impl-trait/nested-return-type2.stderr
@@ -0,0 +1,17 @@
+warning: opaque type `impl Trait<Assoc = impl Send>` does not satisfy its associated type bounds
+ --> $DIR/nested-return-type2.rs:25: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/src/test/ui/impl-trait/nested-return-type3-tait.rs b/src/test/ui/impl-trait/nested-return-type3-tait.rs
index 3936f4dbb..3a97e35b4 100644
--- a/src/test/ui/impl-trait/nested-return-type3-tait.rs
+++ b/src/test/ui/impl-trait/nested-return-type3-tait.rs
@@ -17,6 +17,7 @@ impl<F: Duh> Trait for F {
type Sendable = impl Send;
fn foo() -> impl Trait<Assoc = Sendable> {
+ //~^ WARN opaque type `impl Trait<Assoc = Sendable>` does not satisfy its associated type bounds
42
}
diff --git a/src/test/ui/impl-trait/nested-return-type3-tait.stderr b/src/test/ui/impl-trait/nested-return-type3-tait.stderr
new file mode 100644
index 000000000..5f58c8dca
--- /dev/null
+++ b/src/test/ui/impl-trait/nested-return-type3-tait.stderr
@@ -0,0 +1,17 @@
+warning: opaque type `impl Trait<Assoc = Sendable>` does not satisfy its associated type bounds
+ --> $DIR/nested-return-type3-tait.rs:19:24
+ |
+LL | type Assoc: Duh;
+ | --- this associated type bound is unsatisfied for `Sendable`
+...
+LL | fn foo() -> impl Trait<Assoc = Sendable> {
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(opaque_hidden_inferred_bound)]` on by default
+help: add this bound
+ |
+LL | type Sendable = impl Send + Duh;
+ | +++++
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/impl-trait/nested-return-type3-tait2.rs b/src/test/ui/impl-trait/nested-return-type3-tait2.rs
index 56778ed90..5b6f78a98 100644
--- a/src/test/ui/impl-trait/nested-return-type3-tait2.rs
+++ b/src/test/ui/impl-trait/nested-return-type3-tait2.rs
@@ -16,6 +16,7 @@ impl<F: Duh> Trait for F {
type Sendable = impl Send;
type Traitable = impl Trait<Assoc = Sendable>;
+//~^ WARN opaque type `Traitable` does not satisfy its associated type bounds
fn foo() -> Traitable {
42
diff --git a/src/test/ui/impl-trait/nested-return-type3-tait2.stderr b/src/test/ui/impl-trait/nested-return-type3-tait2.stderr
new file mode 100644
index 000000000..c07f6ead7
--- /dev/null
+++ b/src/test/ui/impl-trait/nested-return-type3-tait2.stderr
@@ -0,0 +1,17 @@
+warning: opaque type `Traitable` does not satisfy its associated type bounds
+ --> $DIR/nested-return-type3-tait2.rs:18:29
+ |
+LL | type Assoc: Duh;
+ | --- this associated type bound is unsatisfied for `Sendable`
+...
+LL | type Traitable = impl Trait<Assoc = Sendable>;
+ | ^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(opaque_hidden_inferred_bound)]` on by default
+help: add this bound
+ |
+LL | type Sendable = impl Send + Duh;
+ | +++++
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/impl-trait/nested-return-type3-tait3.rs b/src/test/ui/impl-trait/nested-return-type3-tait3.rs
index 04c6c92b1..394d8f581 100644
--- a/src/test/ui/impl-trait/nested-return-type3-tait3.rs
+++ b/src/test/ui/impl-trait/nested-return-type3-tait3.rs
@@ -15,6 +15,7 @@ impl<F: Duh> Trait for F {
}
type Traitable = impl Trait<Assoc = impl Send>;
+//~^ WARN opaque type `Traitable` does not satisfy its associated type bounds
fn foo() -> Traitable {
42
diff --git a/src/test/ui/impl-trait/nested-return-type3-tait3.stderr b/src/test/ui/impl-trait/nested-return-type3-tait3.stderr
new file mode 100644
index 000000000..d98ad8922
--- /dev/null
+++ b/src/test/ui/impl-trait/nested-return-type3-tait3.stderr
@@ -0,0 +1,17 @@
+warning: opaque type `Traitable` does not satisfy its associated type bounds
+ --> $DIR/nested-return-type3-tait3.rs:17:29
+ |
+LL | type Assoc: Duh;
+ | --- this associated type bound is unsatisfied for `impl Send`
+...
+LL | type Traitable = impl Trait<Assoc = impl Send>;
+ | ^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(opaque_hidden_inferred_bound)]` on by default
+help: add this bound
+ |
+LL | type Traitable = impl Trait<Assoc = impl Send + Duh>;
+ | +++++
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/impl-trait/nested-return-type3.rs b/src/test/ui/impl-trait/nested-return-type3.rs
index 74b4dae22..5a764fc4c 100644
--- a/src/test/ui/impl-trait/nested-return-type3.rs
+++ b/src/test/ui/impl-trait/nested-return-type3.rs
@@ -13,6 +13,7 @@ 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/src/test/ui/impl-trait/nested-return-type3.stderr b/src/test/ui/impl-trait/nested-return-type3.stderr
new file mode 100644
index 000000000..632de71aa
--- /dev/null
+++ b/src/test/ui/impl-trait/nested-return-type3.stderr
@@ -0,0 +1,17 @@
+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/src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs b/src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs
new file mode 100644
index 000000000..287a030cf
--- /dev/null
+++ b/src/test/ui/impl-trait/nested-rpit-with-anonymous-lifetimes.rs
@@ -0,0 +1,23 @@
+// check-pass
+
+pub struct VecNumber<'s> {
+ pub vec_number: Vec<Number<'s>>,
+ pub auxiliary_object: &'s Vec<usize>,
+}
+
+pub struct Number<'s> {
+ pub number: &'s usize,
+}
+
+impl<'s> VecNumber<'s> {
+ pub fn vec_number_iterable_per_item_in_auxiliary_object(
+ &self,
+ ) -> impl Iterator<Item = (&'s usize, impl Iterator<Item = &Number<'s>>)> {
+ self.auxiliary_object.iter().map(move |n| {
+ let iter_number = self.vec_number.iter();
+ (n, iter_number)
+ })
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/nested_impl_trait.stderr b/src/test/ui/impl-trait/nested_impl_trait.stderr
index bb4ae5e82..3291cad68 100644
--- a/src/test/ui/impl-trait/nested_impl_trait.stderr
+++ b/src/test/ui/impl-trait/nested_impl_trait.stderr
@@ -53,7 +53,7 @@ LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
| ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
|
= help: the trait `Into<U>` is implemented for `T`
- = note: required because of the requirements on the impl of `Into<impl Debug>` for `impl Into<u32>`
+ = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
--> $DIR/nested_impl_trait.rs:18:34
@@ -62,7 +62,7 @@ LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
| ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
|
= help: the trait `Into<U>` is implemented for `T`
- = note: required because of the requirements on the impl of `Into<impl Debug>` for `impl Into<u32>`
+ = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
error: aborting due to 8 previous errors
diff --git a/src/test/ui/impl-trait/normalize-tait-in-const.rs b/src/test/ui/impl-trait/normalize-tait-in-const.rs
new file mode 100644
index 000000000..020bcbb83
--- /dev/null
+++ b/src/test/ui/impl-trait/normalize-tait-in-const.rs
@@ -0,0 +1,39 @@
+// known-bug: #103507
+// failure-status: 101
+// normalize-stderr-test "note: .*\n\n" -> ""
+// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
+// rustc-env:RUST_BACKTRACE=0
+
+#![feature(type_alias_impl_trait)]
+#![feature(const_trait_impl)]
+#![feature(const_refs_to_cell)]
+#![feature(inline_const)]
+
+use std::marker::Destruct;
+
+trait T {
+ type Item;
+}
+
+type Alias<'a> = impl T<Item = &'a ()>;
+
+struct S;
+impl<'a> T for &'a S {
+ type Item = &'a ();
+}
+
+const fn filter_positive<'a>() -> &'a Alias<'a> {
+ &&S
+}
+
+const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
+ fun(filter_positive());
+}
+
+const fn foo(_: &Alias<'_>) {}
+
+const BAR: () = {
+ with_positive(foo);
+};
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/normalize-tait-in-const.stderr b/src/test/ui/impl-trait/normalize-tait-in-const.stderr
new file mode 100644
index 000000000..b9fc8726f
--- /dev/null
+++ b/src/test/ui/impl-trait/normalize-tait-in-const.stderr
@@ -0,0 +1,8 @@
+error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:198:90: Failed to normalize <for<'a, 'b> fn(&'a Alias<'b>) {foo} as std::ops::FnOnce<(&&S,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead
+
+query stack during panic:
+#0 [eval_to_allocation_raw] const-evaluating + checking `BAR`
+#1 [eval_to_const_value_raw] simplifying constant for the type system `BAR`
+end of query stack
+error: aborting due to previous error
+
diff --git a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
index 365ecd9fc..687dbe65e 100644
--- a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
+++ b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-dyn-trait.stderr
@@ -21,10 +21,10 @@ LL | fn foo() -> Self where Self: Sized;
| +++++++++++++++++
error[E0038]: the trait `NotObjectSafe` cannot be made into an object
- --> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:28:13
+ --> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:28:17
|
LL | fn cat() -> Box<dyn NotObjectSafe> {
- | ^^^^^^^^^^^^^^^^^^^^^^ `NotObjectSafe` cannot be made into an object
+ | ^^^^^^^^^^^^^^^^^ `NotObjectSafe` 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-unsafe-trait-in-return-position-dyn-trait.rs:3:8
diff --git a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr
index 5ca01a593..d6f5a1ac2 100644
--- a/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr
+++ b/src/test/ui/impl-trait/object-unsafe-trait-in-return-position-impl-trait.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/object-unsafe-trait-in-return-position-impl-trait.rs:36:5
|
LL | fn can() -> impl NotObjectSafe {
- | ------------------ expected `_` because of return type
+ | ------------------ expected `A` because of return type
...
LL | B
| ^ expected struct `A`, found struct `B`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
--> $DIR/object-unsafe-trait-in-return-position-impl-trait.rs:43:5
|
LL | fn cat() -> impl ObjectSafe {
- | --------------- expected `_` because of return type
+ | --------------- expected `A` because of return type
...
LL | B
| ^ expected struct `A`, found struct `B`
diff --git a/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr b/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr
index 10510c175..3c65fd998 100644
--- a/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr
+++ b/src/test/ui/impl-trait/point-to-type-err-cause-on-impl-trait-return.stderr
@@ -2,28 +2,43 @@ error[E0308]: mismatched types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:5:5
|
LL | fn foo() -> impl std::fmt::Display {
- | ---------------------- expected `_` because of return type
+ | ---------------------- expected `i32` because of return type
...
LL | 1u32
| ^^^^ expected `i32`, found `u32`
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 1i32
+ | ~~~
error[E0308]: mismatched types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:12:16
|
LL | fn bar() -> impl std::fmt::Display {
- | ---------------------- expected `_` because of return type
+ | ---------------------- expected `i32` because of return type
...
LL | return 1u32;
| ^^^^ expected `i32`, found `u32`
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | return 1i32;
+ | ~~~
error[E0308]: mismatched types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:20:9
|
LL | fn baz() -> impl std::fmt::Display {
- | ---------------------- expected `_` because of return type
+ | ---------------------- expected `i32` because of return type
...
LL | 1u32
| ^^^^ expected `i32`, found `u32`
+ |
+help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
+ |
+LL | }.try_into().unwrap()
+ | ++++++++++++++++++++
error[E0308]: `if` and `else` have incompatible types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:28:9
@@ -36,36 +51,66 @@ LL | | 1u32
| | ^^^^ expected `i32`, found `u32`
LL | | }
| |_____- `if` and `else` have incompatible types
+ |
+help: you could change the return type to be a boxed trait object
+ |
+LL | fn qux() -> Box<dyn std::fmt::Display> {
+ | ~~~~~~~ +
+help: if you change the return type to expect trait objects, box the returned expressions
+ |
+LL ~ Box::new(0i32)
+LL | } else {
+LL ~ Box::new(1u32)
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 1i32
+ | ~~~
error[E0308]: mismatched types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:35:14
|
LL | fn bat() -> impl std::fmt::Display {
- | ---------------------- expected `_` because of return type
+ | ---------------------- expected `i32` because of return type
...
LL | _ => 1u32,
| ^^^^ expected `i32`, found `u32`
+ |
+help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
+ |
+LL | }.try_into().unwrap()
+ | ++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:40:5
|
LL | fn can() -> impl std::fmt::Display {
- | ---------------------- expected `_` because of return type
+ | ---------------------- expected `i32` because of return type
LL | / match 13 {
LL | | 0 => return 0i32,
LL | | 1 => 1u32,
LL | | _ => 2u32,
LL | | }
| |_____^ expected `i32`, found `u32`
+ |
+help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
+ |
+LL | }.try_into().unwrap()
+ | ++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:53:13
|
LL | fn cat() -> impl std::fmt::Display {
- | ---------------------- expected `_` because of return type
+ | ---------------------- expected `i32` because of return type
...
LL | 1u32
| ^^^^ expected `i32`, found `u32`
+ |
+help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
+ |
+LL | }.try_into().unwrap()
+ | ++++++++++++++++++++
error[E0308]: `match` arms have incompatible types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:61:14
@@ -78,6 +123,20 @@ LL | | 1 => 1u32,
LL | | _ => 2u32,
LL | | }
| |_____- `match` arms have incompatible types
+ |
+help: you could change the return type to be a boxed trait object
+ |
+LL | fn dog() -> Box<dyn std::fmt::Display> {
+ | ~~~~~~~ +
+help: if you change the return type to expect trait objects, box the returned expressions
+ |
+LL ~ 0 => Box::new(0i32),
+LL ~ 1 => Box::new(1u32),
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 1 => 1i32,
+ | ~~~
error[E0308]: `if` and `else` have incompatible types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:97:9
@@ -90,6 +149,21 @@ LL | | 1u32
| | ^^^^ expected `i32`, found `u32`
LL | | }
| |_____- `if` and `else` have incompatible types
+ |
+help: you could change the return type to be a boxed trait object
+ |
+LL | fn apt() -> Box<dyn std::fmt::Display> {
+ | ~~~~~~~ +
+help: if you change the return type to expect trait objects, box the returned expressions
+ |
+LL ~ Box::new(0i32)
+LL | } else {
+LL ~ Box::new(1u32)
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 1i32
+ | ~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:66:13
@@ -125,6 +199,11 @@ LL | | 1 => 1u32,
LL | | _ => 2u32,
LL | | }
| |_____- `match` arms have incompatible types
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 1 => 1i32,
+ | ~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:77:13
@@ -164,6 +243,11 @@ LL | | 1u32
| | ^^^^ expected `i32`, found `u32`
LL | | }
| |_____- `if` and `else` have incompatible types
+ |
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | 1i32
+ | ~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:85:13
diff --git a/src/test/ui/impl-trait/projection-mismatch-in-impl-where-clause.stderr b/src/test/ui/impl-trait/projection-mismatch-in-impl-where-clause.stderr
index ade0dfa1b..cf2998bbf 100644
--- a/src/test/ui/impl-trait/projection-mismatch-in-impl-where-clause.stderr
+++ b/src/test/ui/impl-trait/projection-mismatch-in-impl-where-clause.stderr
@@ -9,7 +9,7 @@ note: expected this to be `u8`
|
LL | type Assoc = u8;
| ^^
-note: required because of the requirements on the impl of `Test` for `()`
+note: required for `()` to implement `Test`
--> $DIR/projection-mismatch-in-impl-where-clause.rs:11:9
|
LL | impl<T> Test for T where T: Super<Assoc = ()> {}
diff --git a/src/test/ui/impl-trait/region-escape-via-bound.stderr b/src/test/ui/impl-trait/region-escape-via-bound.stderr
index fdb2fe022..44a790cb1 100644
--- a/src/test/ui/impl-trait/region-escape-via-bound.stderr
+++ b/src/test/ui/impl-trait/region-escape-via-bound.stderr
@@ -7,7 +7,7 @@ LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y>
LL | x
| ^
|
-help: to declare that the `impl Trait` captures `'x`, you can add an explicit `'x` lifetime bound
+help: to declare that `impl Trait<'y>` captures `'x`, you can add an explicit `'x` lifetime bound
|
LL | fn foo<'x, 'y>(x: Cell<&'x u32>) -> impl Trait<'y> + 'x
| ++++
diff --git a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
index b86815231..b365bd884 100644
--- a/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
+++ b/src/test/ui/impl-trait/static-return-lifetime-infered.stderr
@@ -6,7 +6,7 @@ LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl Iterator<Item = u32>` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
| ++++
@@ -19,7 +19,7 @@ LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> {
LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl Iterator<Item = u32>` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
| ++++
@@ -32,7 +32,7 @@ LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
+help: to declare that `impl Iterator<Item = u32>` captures `'a`, you can add an explicit `'a` lifetime bound
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
| ++++
@@ -45,7 +45,7 @@ LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> {
LL | self.x.iter().map(|a| a.0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
-help: to declare that the `impl Trait` captures `'a`, you can add an explicit `'a` lifetime bound
+help: to declare that `impl Iterator<Item = u32>` captures `'a`, you can add an explicit `'a` lifetime bound
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
| ++++
diff --git a/src/test/ui/impl-trait/suggest-calling-rpit-closure.stderr b/src/test/ui/impl-trait/suggest-calling-rpit-closure.stderr
index 2a328a0e6..c10a856d8 100644
--- a/src/test/ui/impl-trait/suggest-calling-rpit-closure.stderr
+++ b/src/test/ui/impl-trait/suggest-calling-rpit-closure.stderr
@@ -11,7 +11,7 @@ LL | fn opaque() -> impl Fn() -> i32 {
|
= note: expected type `i32`
found opaque type `impl Fn() -> i32`
-help: use parentheses to call this closure
+help: use parentheses to call this opaque type
|
LL | opaque()()
| ++
diff --git a/src/test/ui/impl-trait/unactionable_diagnostic.fixed b/src/test/ui/impl-trait/unactionable_diagnostic.fixed
new file mode 100644
index 000000000..6c2505177
--- /dev/null
+++ b/src/test/ui/impl-trait/unactionable_diagnostic.fixed
@@ -0,0 +1,25 @@
+// run-rustfix
+
+pub trait Trait {}
+
+pub struct Foo;
+
+impl Trait for Foo {}
+
+fn foo<'x, P>(
+ _post: P,
+ x: &'x Foo,
+) -> &'x impl Trait {
+ x
+}
+
+pub fn bar<'t, T: 't>(
+ //~^ HELP: consider adding an explicit lifetime bound...
+ post: T,
+ x: &'t Foo,
+) -> &'t impl Trait {
+ foo(post, x)
+ //~^ ERROR: the parameter type `T` may not live long enough
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/unactionable_diagnostic.rs b/src/test/ui/impl-trait/unactionable_diagnostic.rs
new file mode 100644
index 000000000..bce35cbdd
--- /dev/null
+++ b/src/test/ui/impl-trait/unactionable_diagnostic.rs
@@ -0,0 +1,25 @@
+// run-rustfix
+
+pub trait Trait {}
+
+pub struct Foo;
+
+impl Trait for Foo {}
+
+fn foo<'x, P>(
+ _post: P,
+ x: &'x Foo,
+) -> &'x impl Trait {
+ x
+}
+
+pub fn bar<'t, T>(
+ //~^ HELP: consider adding an explicit lifetime bound...
+ post: T,
+ x: &'t Foo,
+) -> &'t impl Trait {
+ foo(post, x)
+ //~^ ERROR: the parameter type `T` may not live long enough
+}
+
+fn main() {}
diff --git a/src/test/ui/impl-trait/unactionable_diagnostic.stderr b/src/test/ui/impl-trait/unactionable_diagnostic.stderr
new file mode 100644
index 000000000..a32004cda
--- /dev/null
+++ b/src/test/ui/impl-trait/unactionable_diagnostic.stderr
@@ -0,0 +1,14 @@
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/unactionable_diagnostic.rs:21:5
+ |
+LL | foo(post, x)
+ | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | pub fn bar<'t, T: 't>(
+ | ++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0309`.
diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr
index 58a2f79ef..2e7c7ca40 100644
--- a/src/test/ui/impl-trait/where-allowed.stderr
+++ b/src/test/ui/impl-trait/where-allowed.stderr
@@ -162,12 +162,18 @@ error[E0562]: `impl Trait` only allowed in function and inherent method return t
|
LL | fn in_return() -> impl Debug;
| ^^^^^^^^^^
+ |
+ = 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[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `impl` method return
--> $DIR/where-allowed.rs:125:34
|
LL | fn in_trait_impl_return() -> impl Debug { () }
| ^^^^^^^^^^
+ |
+ = 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[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `extern fn` param
--> $DIR/where-allowed.rs:138:33
@@ -295,9 +301,9 @@ error: defaults for type parameters are only allowed in `struct`, `enum`, `type`
LL | impl <T = impl Debug> T {}
| ^^^^^^^^^^^^^^
|
- = note: `#[deny(invalid_type_param_default)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
+ = 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:241:36
diff --git a/src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.rs b/src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.rs
new file mode 100644
index 000000000..33b746c5e
--- /dev/null
+++ b/src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.rs
@@ -0,0 +1,27 @@
+// Test for a less than ideal interaction of implied bounds and normalization.
+trait Tr {
+ type Ty;
+}
+
+impl<T: 'static> Tr for T {
+ type Ty = &'static T;
+}
+
+// `<&'a u8 as Tr>::Ty` should cause an error because `&'a u8: Tr` doesn't hold for
+// all possible 'a. However, we consider normalized types for implied bounds.
+//
+// We normalize this projection to `&'static &'a u8` and add a nested `&'a u8: 'static`
+// bound. This bound is then proven using the implied bounds for `&'static &'a u8` which
+// we only get by normalizing in the first place.
+fn test<'a>(x: &'a u8, _wf: <&'a u8 as Tr>::Ty) -> &'static u8 { x }
+
+fn main() {
+ // This works as we have 'static references due to promotion.
+ let _: &'static u8 = test(&3, &&3);
+ // This causes an error because the projection requires 'a to be 'static.
+ // It would be unsound if this compiled.
+ let x: u8 = 3;
+ let _: &'static u8 = test(&x, &&3);
+ //~^ ERROR `x` does not live long enough
+
+}
diff --git a/src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.stderr b/src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.stderr
new file mode 100644
index 000000000..d0249e74f
--- /dev/null
+++ b/src/test/ui/implied-bounds/assoc-ty-wf-used-to-get-assoc-ty.stderr
@@ -0,0 +1,15 @@
+error[E0597]: `x` does not live long enough
+ --> $DIR/assoc-ty-wf-used-to-get-assoc-ty.rs:24:31
+ |
+LL | let _: &'static u8 = test(&x, &&3);
+ | -----^^------
+ | | |
+ | | borrowed value does not live long enough
+ | argument requires that `x` is borrowed for `'static`
+...
+LL | }
+ | - `x` dropped here while still borrowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/implied-bounds/impl-header-unnormalized-types.rs b/src/test/ui/implied-bounds/impl-header-unnormalized-types.rs
new file mode 100644
index 000000000..d84539f8a
--- /dev/null
+++ b/src/test/ui/implied-bounds/impl-header-unnormalized-types.rs
@@ -0,0 +1,28 @@
+struct Foo<T>(T);
+
+trait GoodBye {
+ type Forget;
+}
+impl<T> GoodBye for T {
+ type Forget = ();
+}
+
+trait NeedsWf<'a, 'b> {
+ type Assoc;
+}
+
+impl<'a, 'b> NeedsWf<'a, 'b> for Foo<<&'a &'b () as GoodBye>::Forget> {
+ type Assoc = &'a &'b ();
+ //~^ ERROR in type `&'a &'b ()`, reference has a longer lifetime than the data it references
+}
+
+fn needs_wf<'a, 'b, T: NeedsWf<'a, 'b>>() {}
+
+fn foo<'a: 'a, 'b: 'b>(_: &'b String) {
+ needs_wf::<'a, 'b, Foo<()>>();
+}
+
+fn main() {
+ let x = String::from("hello");
+ foo::<'static, '_>(&x);
+}
diff --git a/src/test/ui/implied-bounds/impl-header-unnormalized-types.stderr b/src/test/ui/implied-bounds/impl-header-unnormalized-types.stderr
new file mode 100644
index 000000000..88abd5f54
--- /dev/null
+++ b/src/test/ui/implied-bounds/impl-header-unnormalized-types.stderr
@@ -0,0 +1,20 @@
+error[E0491]: in type `&'a &'b ()`, reference has a longer lifetime than the data it references
+ --> $DIR/impl-header-unnormalized-types.rs:15:18
+ |
+LL | type Assoc = &'a &'b ();
+ | ^^^^^^^^^^
+ |
+note: the pointer is valid for the lifetime `'a` as defined here
+ --> $DIR/impl-header-unnormalized-types.rs:14:6
+ |
+LL | impl<'a, 'b> NeedsWf<'a, 'b> for Foo<<&'a &'b () as GoodBye>::Forget> {
+ | ^^
+note: but the referenced data is only valid for the lifetime `'b` as defined here
+ --> $DIR/impl-header-unnormalized-types.rs:14:10
+ |
+LL | impl<'a, 'b> NeedsWf<'a, 'b> for Foo<<&'a &'b () as GoodBye>::Forget> {
+ | ^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0491`.
diff --git a/src/test/ui/implied-bounds/issue-100690.rs b/src/test/ui/implied-bounds/issue-100690.rs
new file mode 100644
index 000000000..5599cd410
--- /dev/null
+++ b/src/test/ui/implied-bounds/issue-100690.rs
@@ -0,0 +1,45 @@
+// This code (probably) _should_ compile, but it currently does not because we
+// are not smart enough about implied bounds.
+
+use std::io;
+
+fn real_dispatch<T, F>(f: F) -> Result<(), io::Error>
+//~^ NOTE required by a bound in this
+where
+ F: FnOnce(&mut UIView<T>) -> Result<(), io::Error> + Send + 'static,
+ //~^ NOTE required by this bound in `real_dispatch`
+ //~| NOTE required by a bound in `real_dispatch`
+{
+ todo!()
+}
+
+#[derive(Debug)]
+struct UIView<'a, T: 'a> {
+ _phantom: std::marker::PhantomData<&'a mut T>,
+}
+
+trait Handle<'a, T: 'a, V, R> {
+ fn dispatch<F>(&self, f: F) -> Result<(), io::Error>
+ where
+ F: FnOnce(&mut V) -> R + Send + 'static;
+}
+
+#[derive(Debug, Clone)]
+struct TUIHandle<T> {
+ _phantom: std::marker::PhantomData<T>,
+}
+
+impl<'a, T: 'a> Handle<'a, T, UIView<'a, T>, Result<(), io::Error>> for TUIHandle<T> {
+ fn dispatch<F>(&self, f: F) -> Result<(), io::Error>
+ where
+ F: FnOnce(&mut UIView<'a, T>) -> Result<(), io::Error> + Send + 'static,
+ {
+ real_dispatch(f)
+ //~^ ERROR expected a `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F`
+ //~| NOTE expected an `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F`
+ //~| NOTE expected a closure with arguments
+ //~| NOTE required by a bound introduced by this call
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/implied-bounds/issue-100690.stderr b/src/test/ui/implied-bounds/issue-100690.stderr
new file mode 100644
index 000000000..3f6af70d8
--- /dev/null
+++ b/src/test/ui/implied-bounds/issue-100690.stderr
@@ -0,0 +1,22 @@
+error[E0277]: expected a `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F`
+ --> $DIR/issue-100690.rs:37:23
+ |
+LL | real_dispatch(f)
+ | ------------- ^ expected an `FnOnce<(&mut UIView<'_, T>,)>` closure, found `F`
+ | |
+ | required by a bound introduced by this call
+ |
+ = note: expected a closure with arguments `(&mut UIView<'a, T>,)`
+ found a closure with arguments `(&mut UIView<'_, T>,)`
+note: required by a bound in `real_dispatch`
+ --> $DIR/issue-100690.rs:9:8
+ |
+LL | fn real_dispatch<T, F>(f: F) -> Result<(), io::Error>
+ | ------------- required by a bound in this
+...
+LL | F: FnOnce(&mut UIView<T>) -> Result<(), io::Error> + Send + 'static,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `real_dispatch`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/implied-bounds/issue-101951.rs b/src/test/ui/implied-bounds/issue-101951.rs
new file mode 100644
index 000000000..108fef8a1
--- /dev/null
+++ b/src/test/ui/implied-bounds/issue-101951.rs
@@ -0,0 +1,50 @@
+// Taken directly from that issue.
+//
+// This test detected that we didn't correctly resolve
+// inference variables when computing implied bounds.
+//
+// check-pass
+pub trait BuilderFn<'a> {
+ type Output;
+}
+
+impl<'a, F, Out> BuilderFn<'a> for F
+where
+ F: FnOnce(&'a mut ()) -> Out,
+{
+ type Output = Out;
+}
+
+pub trait ConstructionFirm {
+ type Builder: for<'a> BuilderFn<'a>;
+}
+
+pub trait Campus<T>
+where
+ T: ConstructionFirm,
+{
+ fn add_building(
+ &mut self,
+ building: &mut <<T as ConstructionFirm>::Builder as BuilderFn<'_>>::Output,
+ );
+}
+
+struct ArchitectsInc {}
+
+impl ConstructionFirm for ArchitectsInc {
+ type Builder = fn(&mut ()) -> PrettyCondo<'_>;
+}
+
+struct PrettyCondo<'a> {
+ _marker: &'a mut (),
+}
+
+struct CondoEstate {}
+
+impl Campus<ArchitectsInc> for CondoEstate {
+ fn add_building(&mut self, _building: &mut PrettyCondo<'_>) {
+ todo!()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/imports/issue-56125.stderr b/src/test/ui/imports/issue-56125.stderr
index 2e4ba8623..059ca9680 100644
--- a/src/test/ui/imports/issue-56125.stderr
+++ b/src/test/ui/imports/issue-56125.stderr
@@ -3,6 +3,18 @@ error[E0432]: unresolved import `empty::issue_56125`
|
LL | use empty::issue_56125;
| ^^^^^^^^^^^^^^^^^^ no `issue_56125` in `m3::empty`
+ |
+help: consider importing one of these items instead
+ |
+LL | use crate::m3::last_segment::issue_56125;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | use crate::m3::non_last_segment::non_last_segment::issue_56125;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | use issue_56125::issue_56125;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
+LL | use issue_56125::last_segment::issue_56125;
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ and 1 other candidate
error[E0659]: `issue_56125` is ambiguous
--> $DIR/issue-56125.rs:6:9
diff --git a/src/test/ui/imports/issue-57015.stderr b/src/test/ui/imports/issue-57015.stderr
index d200d23ab..3b72d57fe 100644
--- a/src/test/ui/imports/issue-57015.stderr
+++ b/src/test/ui/imports/issue-57015.stderr
@@ -3,6 +3,11 @@ error[E0432]: unresolved import `single_err::something`
|
LL | use single_err::something;
| ^^^^^^^^^^^^^^^^^^^^^ no `something` in `single_err`
+ |
+help: consider importing this module instead
+ |
+LL | use glob_ok::something;
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/imports/local-modularized-tricky-fail-2.stderr b/src/test/ui/imports/local-modularized-tricky-fail-2.stderr
index 3c20f552f..2c1965ac0 100644
--- a/src/test/ui/imports/local-modularized-tricky-fail-2.stderr
+++ b/src/test/ui/imports/local-modularized-tricky-fail-2.stderr
@@ -4,7 +4,6 @@ error: macro-expanded `macro_export` macros from the current crate cannot be ref
LL | use exported;
| ^^^^^^^^
|
- = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
note: the macro is defined here
@@ -17,6 +16,7 @@ LL | | }
...
LL | define_exported!();
| ------------------ in this macro invocation
+ = note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
= note: this error originates in the macro `define_exported` (in Nightly builds, run with -Z macro-backtrace for more info)
error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
diff --git a/src/test/ui/index-help.stderr b/src/test/ui/index-help.stderr
index b36f4dab8..e020d0298 100644
--- a/src/test/ui/index-help.stderr
+++ b/src/test/ui/index-help.stderr
@@ -6,7 +6,7 @@ LL | x[0i32];
|
= help: the trait `SliceIndex<[{integer}]>` is not implemented for `i32`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<i32>` for `Vec<{integer}>`
+ = note: required for `Vec<{integer}>` to implement `Index<i32>`
error: aborting due to previous error
diff --git a/src/test/ui/indexing-requires-a-uint.stderr b/src/test/ui/indexing-requires-a-uint.stderr
index fbff20f8d..7a741cfc7 100644
--- a/src/test/ui/indexing-requires-a-uint.stderr
+++ b/src/test/ui/indexing-requires-a-uint.stderr
@@ -6,7 +6,7 @@ LL | [0][0u8];
|
= help: the trait `SliceIndex<[{integer}]>` is not implemented for `u8`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<u8>` for `[{integer}]`
+ = note: required for `[{integer}]` to implement `Index<u8>`
error[E0308]: mismatched types
--> $DIR/indexing-requires-a-uint.rs:12:18
diff --git a/src/test/ui/inference/char-as-str-single.fixed b/src/test/ui/inference/char-as-str-single.fixed
index e401492a8..bab1854dc 100644
--- a/src/test/ui/inference/char-as-str-single.fixed
+++ b/src/test/ui/inference/char-as-str-single.fixed
@@ -8,4 +8,5 @@
fn main() {
let _: char = 'a'; //~ ERROR mismatched types
let _: char = '人'; //~ ERROR mismatched types
+ let _: char = '\''; //~ ERROR mismatched types
}
diff --git a/src/test/ui/inference/char-as-str-single.rs b/src/test/ui/inference/char-as-str-single.rs
index 4f23cea53..736920643 100644
--- a/src/test/ui/inference/char-as-str-single.rs
+++ b/src/test/ui/inference/char-as-str-single.rs
@@ -8,4 +8,5 @@
fn main() {
let _: char = "a"; //~ ERROR mismatched types
let _: char = "人"; //~ ERROR mismatched types
+ let _: char = "'"; //~ ERROR mismatched types
}
diff --git a/src/test/ui/inference/char-as-str-single.stderr b/src/test/ui/inference/char-as-str-single.stderr
index 29075c154..3375ec6ac 100644
--- a/src/test/ui/inference/char-as-str-single.stderr
+++ b/src/test/ui/inference/char-as-str-single.stderr
@@ -24,6 +24,19 @@ help: if you meant to write a `char` literal, use single quotes
LL | let _: char = '人';
| ~~~~
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+ --> $DIR/char-as-str-single.rs:11:19
+ |
+LL | let _: char = "'";
+ | ---- ^^^ expected `char`, found `&str`
+ | |
+ | expected due to this
+ |
+help: if you meant to write a `char` literal, use single quotes
+ |
+LL | let _: char = '\'';
+ | ~~~~
+
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/inference/inference-variable-behind-raw-pointer.stderr b/src/test/ui/inference/inference-variable-behind-raw-pointer.stderr
index c38f57912..3dea09e7f 100644
--- a/src/test/ui/inference/inference-variable-behind-raw-pointer.stderr
+++ b/src/test/ui/inference/inference-variable-behind-raw-pointer.stderr
@@ -4,9 +4,9 @@ warning: type annotations needed
LL | if data.is_null() {}
| ^^^^^^^
|
- = note: `#[warn(tyvar_behind_raw_pointer)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906>
+ = note: `#[warn(tyvar_behind_raw_pointer)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/inference/inference_unstable.stderr b/src/test/ui/inference/inference_unstable.stderr
index df7a09686..ecbf2641b 100644
--- a/src/test/ui/inference/inference_unstable.stderr
+++ b/src/test/ui/inference/inference_unstable.stderr
@@ -4,11 +4,11 @@ warning: an associated function with this name may be added to the standard libr
LL | assert_eq!('x'.ipu_flatten(), 1);
| ^^^^^^^^^^^
|
- = note: `#[warn(unstable_name_collisions)]` on by default
= warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_flatten(...)` to keep using the current method
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`
+ = note: `#[warn(unstable_name_collisions)]` on by default
warning: an associated function with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:19:20
diff --git a/src/test/ui/issues/issue-36053.rs b/src/test/ui/inference/issue-36053.rs
index 5c6d07804..5c6d07804 100644
--- a/src/test/ui/issues/issue-36053.rs
+++ b/src/test/ui/inference/issue-36053.rs
diff --git a/src/test/ui/inference/issue-71732.stderr b/src/test/ui/inference/issue-71732.stderr
index 04673a375..79bee3328 100644
--- a/src/test/ui/inference/issue-71732.stderr
+++ b/src/test/ui/inference/issue-71732.stderr
@@ -2,7 +2,9 @@ error[E0283]: type annotations needed
--> $DIR/issue-71732.rs:18:10
|
LL | .get(&"key".into())
- | ^^^ cannot infer type of the type parameter `Q` declared on the associated function `get`
+ | ^^^ ------------- type must be known at this point
+ | |
+ | cannot infer type of the type parameter `Q` declared on the associated function `get`
|
= note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
- impl Borrow<str> for String;
@@ -13,7 +15,7 @@ note: required by a bound in `HashMap::<K, V, S>::get`
|
LL | K: Borrow<Q>,
| ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get`
-help: consider specifying the type argument in the function call
+help: consider specifying the generic argument
|
LL | .get::<Q>(&"key".into())
| +++++
diff --git a/src/test/ui/inference/issue-86162-1.stderr b/src/test/ui/inference/issue-86162-1.stderr
index e395e65fa..4f621b82d 100644
--- a/src/test/ui/inference/issue-86162-1.stderr
+++ b/src/test/ui/inference/issue-86162-1.stderr
@@ -4,7 +4,7 @@ error[E0283]: type annotations needed
LL | foo(gen()); //<- Do not suggest `foo::<impl Clone>()`!
| --- ^^^ cannot infer type of the type parameter `T` declared on the function `gen`
| |
- | type must be known at this point
+ | required by a bound introduced by this call
|
= note: cannot satisfy `_: Clone`
note: required by a bound in `foo`
diff --git a/src/test/ui/inference/issue-86162-2.stderr b/src/test/ui/inference/issue-86162-2.stderr
index 30e6e10ea..9aff2cec1 100644
--- a/src/test/ui/inference/issue-86162-2.stderr
+++ b/src/test/ui/inference/issue-86162-2.stderr
@@ -4,7 +4,7 @@ error[E0283]: type annotations needed
LL | Foo::bar(gen()); //<- Do not suggest `Foo::bar::<impl Clone>()`!
| -------- ^^^ cannot infer type of the type parameter `T` declared on the function `gen`
| |
- | type must be known at this point
+ | required by a bound introduced by this call
|
= note: cannot satisfy `_: Clone`
note: required by a bound in `Foo::bar`
diff --git a/src/test/ui/inference/need_type_info/concrete-impl.stderr b/src/test/ui/inference/need_type_info/concrete-impl.stderr
index b79d34aff..aa3296995 100644
--- a/src/test/ui/inference/need_type_info/concrete-impl.stderr
+++ b/src/test/ui/inference/need_type_info/concrete-impl.stderr
@@ -3,11 +3,6 @@ error[E0282]: type annotations needed
|
LL | <Struct as Ambiguous<_>>::method();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `Self` declared on the trait `Ambiguous`
- |
-help: consider specifying the generic argument
- |
-LL | <Struct as Ambiguous::<_>>::method();
- | ~~~~~
error[E0283]: type annotations needed
--> $DIR/concrete-impl.rs:13:5
@@ -22,10 +17,6 @@ LL | impl Ambiguous<One> for Struct {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | impl Ambiguous<Two> for Struct {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-help: consider specifying the generic argument
- |
-LL | <Struct as Ambiguous::<_>>::method();
- | ~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs
new file mode 100644
index 000000000..3084f6eac
--- /dev/null
+++ b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.rs
@@ -0,0 +1,11 @@
+enum OhNo<T, U> {
+ A(T),
+ B(U),
+ C,
+}
+
+fn uwu() {
+ OhNo::C::<u32, _>; //~ ERROR type annotations needed
+}
+
+fn main() {}
diff --git a/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr
new file mode 100644
index 000000000..2ad35ab03
--- /dev/null
+++ b/src/test/ui/inference/need_type_info/do-not-suggest-generic-arguments-for-turbofish.stderr
@@ -0,0 +1,9 @@
+error[E0282]: type annotations needed
+ --> $DIR/do-not-suggest-generic-arguments-for-turbofish.rs:8:5
+ |
+LL | OhNo::C::<u32, _>;
+ | ^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `U` declared on the enum `OhNo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs
index bcd29bb4e..b0c0d3397 100644
--- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs
+++ b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Foo {
type Output<T>;
diff --git a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr
index 65a75b68c..cbc2477de 100644
--- a/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr
+++ b/src/test/ui/inference/need_type_info/expr-struct-type-relative-gat.stderr
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
- --> $DIR/expr-struct-type-relative-gat.rs:17:9
+ --> $DIR/expr-struct-type-relative-gat.rs:15:9
|
LL | Self::Output::Simple {};
| ^^^^^^^^^^^^ cannot infer type for type parameter `T` declared on the associated type `Output`
diff --git a/src/test/ui/inference/need_type_info/issue-103053.rs b/src/test/ui/inference/need_type_info/issue-103053.rs
new file mode 100644
index 000000000..05169666f
--- /dev/null
+++ b/src/test/ui/inference/need_type_info/issue-103053.rs
@@ -0,0 +1,18 @@
+trait TypeMapper {
+ type MapType;
+}
+
+type Mapped<T> = <T as TypeMapper>::MapType;
+
+struct Test {}
+
+impl TypeMapper for () {
+ type MapType = Test;
+}
+
+fn test() {
+ Mapped::<()> {};
+ None; //~ ERROR type annotations needed
+}
+
+fn main() {}
diff --git a/src/test/ui/inference/need_type_info/issue-103053.stderr b/src/test/ui/inference/need_type_info/issue-103053.stderr
new file mode 100644
index 000000000..84f0475d8
--- /dev/null
+++ b/src/test/ui/inference/need_type_info/issue-103053.stderr
@@ -0,0 +1,14 @@
+error[E0282]: type annotations needed
+ --> $DIR/issue-103053.rs:15:5
+ |
+LL | None;
+ | ^^^^ cannot infer type of the type parameter `T` declared on the enum `Option`
+ |
+help: consider specifying the generic argument
+ |
+LL | None::<T>;
+ | +++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/inference/str-as-char.fixed b/src/test/ui/inference/str-as-char.fixed
index 09f3dec5a..6aea809cb 100644
--- a/src/test/ui/inference/str-as-char.fixed
+++ b/src/test/ui/inference/str-as-char.fixed
@@ -4,5 +4,7 @@
// run-rustfix
fn main() {
- let _: &str = "a"; //~ ERROR mismatched types
+ let _: &str = "a"; //~ ERROR mismatched types
+ let _: &str = "\"\"\""; //~ ERROR character literal may only contain one codepoint
+ let _: &str = "\"\"\""; //~ ERROR character literal may only contain one codepoint
}
diff --git a/src/test/ui/inference/str-as-char.rs b/src/test/ui/inference/str-as-char.rs
index 7092a6124..eaa8d788c 100644
--- a/src/test/ui/inference/str-as-char.rs
+++ b/src/test/ui/inference/str-as-char.rs
@@ -4,5 +4,7 @@
// run-rustfix
fn main() {
- let _: &str = 'a'; //~ ERROR mismatched types
+ let _: &str = 'a'; //~ ERROR mismatched types
+ let _: &str = '"""'; //~ ERROR character literal may only contain one codepoint
+ let _: &str = '\"\"\"'; //~ ERROR character literal may only contain one codepoint
}
diff --git a/src/test/ui/inference/str-as-char.stderr b/src/test/ui/inference/str-as-char.stderr
index ebbe7c80f..2c84dac8e 100644
--- a/src/test/ui/inference/str-as-char.stderr
+++ b/src/test/ui/inference/str-as-char.stderr
@@ -1,3 +1,25 @@
+error: character literal may only contain one codepoint
+ --> $DIR/str-as-char.rs:8:19
+ |
+LL | let _: &str = '"""';
+ | ^^^^^
+ |
+help: if you meant to write a `str` literal, use double quotes
+ |
+LL | let _: &str = "\"\"\"";
+ | ~~~~~~~~
+
+error: character literal may only contain one codepoint
+ --> $DIR/str-as-char.rs:9:19
+ |
+LL | let _: &str = '\"\"\"';
+ | ^^^^^^^^
+ |
+help: if you meant to write a `str` literal, use double quotes
+ |
+LL | let _: &str = "\"\"\"";
+ | ~~~~~~~~
+
error[E0308]: mismatched types
--> $DIR/str-as-char.rs:7:19
|
@@ -11,6 +33,6 @@ help: if you meant to write a `str` literal, use double quotes
LL | let _: &str = "a";
| ~~~
-error: aborting due to previous error
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/infinite/infinite-struct.rs b/src/test/ui/infinite/infinite-struct.rs
index 74185dc59..f08e10f6b 100644
--- a/src/test/ui/infinite/infinite-struct.rs
+++ b/src/test/ui/infinite/infinite-struct.rs
@@ -6,4 +6,11 @@ fn foo() -> Take {
Take(loop {})
}
+// mutually infinite structs
+struct Foo { //~ ERROR has infinite size
+ x: Bar<Foo>,
+}
+
+struct Bar<T>([T; 1]);
+
fn main() {}
diff --git a/src/test/ui/infinite/infinite-struct.stderr b/src/test/ui/infinite/infinite-struct.stderr
index 5a6d13786..b6c72b1de 100644
--- a/src/test/ui/infinite/infinite-struct.stderr
+++ b/src/test/ui/infinite/infinite-struct.stderr
@@ -3,14 +3,25 @@ error[E0072]: recursive type `Take` has infinite size
|
LL | struct Take(Take);
| ^^^^^^^^^^^ ---- recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Take` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | struct Take(Box<Take>);
| ++++ +
-error: aborting due to previous error
+error[E0072]: recursive type `Foo` has infinite size
+ --> $DIR/infinite-struct.rs:10:1
+ |
+LL | struct Foo {
+ | ^^^^^^^^^^
+LL | x: Bar<Foo>,
+ | --- recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL | x: Bar<Box<Foo>>,
+ | ++++ +
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/infinite/infinite-tag-type-recursion.stderr b/src/test/ui/infinite/infinite-tag-type-recursion.stderr
index d2dad4b91..513bbfc1b 100644
--- a/src/test/ui/infinite/infinite-tag-type-recursion.stderr
+++ b/src/test/ui/infinite/infinite-tag-type-recursion.stderr
@@ -3,10 +3,8 @@ error[E0072]: recursive type `MList` has infinite size
|
LL | enum MList { Cons(isize, MList), Nil }
| ^^^^^^^^^^ ----- recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `MList` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | enum MList { Cons(isize, Box<MList>), Nil }
| ++++ +
diff --git a/src/test/ui/inline-const/const-match-pat-range.rs b/src/test/ui/inline-const/const-match-pat-range.rs
index 7dc8c1135..73d6334c3 100644
--- a/src/test/ui/inline-const/const-match-pat-range.rs
+++ b/src/test/ui/inline-const/const-match-pat-range.rs
@@ -1,7 +1,8 @@
// build-pass
#![allow(incomplete_features)]
-#![feature(inline_const_pat, half_open_range_patterns, exclusive_range_pattern)]
+#![feature(inline_const_pat, exclusive_range_pattern)]
+
fn main() {
const N: u32 = 10;
let x: u32 = 3;
diff --git a/src/test/ui/integral-indexing.stderr b/src/test/ui/integral-indexing.stderr
index 3f9094d12..bbbb2a86a 100644
--- a/src/test/ui/integral-indexing.stderr
+++ b/src/test/ui/integral-indexing.stderr
@@ -6,7 +6,7 @@ LL | v[3u8];
|
= help: the trait `SliceIndex<[isize]>` is not implemented for `u8`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<u8>` for `Vec<isize>`
+ = note: required for `Vec<isize>` to implement `Index<u8>`
error[E0277]: the type `[isize]` cannot be indexed by `i8`
--> $DIR/integral-indexing.rs:7:7
@@ -16,7 +16,7 @@ LL | v[3i8];
|
= help: the trait `SliceIndex<[isize]>` is not implemented for `i8`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<i8>` for `Vec<isize>`
+ = note: required for `Vec<isize>` to implement `Index<i8>`
error[E0277]: the type `[isize]` cannot be indexed by `u32`
--> $DIR/integral-indexing.rs:8:7
@@ -26,7 +26,7 @@ LL | v[3u32];
|
= help: the trait `SliceIndex<[isize]>` is not implemented for `u32`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<u32>` for `Vec<isize>`
+ = note: required for `Vec<isize>` to implement `Index<u32>`
error[E0277]: the type `[isize]` cannot be indexed by `i32`
--> $DIR/integral-indexing.rs:9:7
@@ -36,7 +36,7 @@ LL | v[3i32];
|
= help: the trait `SliceIndex<[isize]>` is not implemented for `i32`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<i32>` for `Vec<isize>`
+ = note: required for `Vec<isize>` to implement `Index<i32>`
error[E0277]: the type `[u8]` cannot be indexed by `u8`
--> $DIR/integral-indexing.rs:12:18
@@ -46,7 +46,7 @@ LL | s.as_bytes()[3u8];
|
= help: the trait `SliceIndex<[u8]>` is not implemented for `u8`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<u8>` for `[u8]`
+ = note: required for `[u8]` to implement `Index<u8>`
error[E0277]: the type `[u8]` cannot be indexed by `i8`
--> $DIR/integral-indexing.rs:13:18
@@ -56,7 +56,7 @@ LL | s.as_bytes()[3i8];
|
= help: the trait `SliceIndex<[u8]>` is not implemented for `i8`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<i8>` for `[u8]`
+ = note: required for `[u8]` to implement `Index<i8>`
error[E0277]: the type `[u8]` cannot be indexed by `u32`
--> $DIR/integral-indexing.rs:14:18
@@ -66,7 +66,7 @@ LL | s.as_bytes()[3u32];
|
= help: the trait `SliceIndex<[u8]>` is not implemented for `u32`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<u32>` for `[u8]`
+ = note: required for `[u8]` to implement `Index<u32>`
error[E0277]: the type `[u8]` cannot be indexed by `i32`
--> $DIR/integral-indexing.rs:15:18
@@ -76,7 +76,7 @@ LL | s.as_bytes()[3i32];
|
= help: the trait `SliceIndex<[u8]>` is not implemented for `i32`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<i32>` for `[u8]`
+ = note: required for `[u8]` to implement `Index<i32>`
error: aborting due to 8 previous errors
diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr
index 349fb6daf..94f41c925 100644
--- a/src/test/ui/interior-mutability/interior-mutability.stderr
+++ b/src/test/ui/interior-mutability/interior-mutability.stderr
@@ -1,12 +1,14 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/interior-mutability.rs:5:5
+ --> $DIR/interior-mutability.rs:5:18
|
LL | catch_unwind(|| { x.set(23); });
- | ^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ------------ ^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | |
+ | required by a bound introduced by this call
|
= help: within `Cell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `Cell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `&Cell<i32>`
+ = note: required for `&Cell<i32>` to implement `UnwindSafe`
note: required because it's used within this closure
--> $DIR/interior-mutability.rs:5:18
|
diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs b/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs
new file mode 100644
index 000000000..1164a3a5b
--- /dev/null
+++ b/src/test/ui/intrinsics/const-eval-select-backtrace-std.rs
@@ -0,0 +1,7 @@
+// See issue #100696.
+// run-fail
+// check-run-results
+// exec-env:RUST_BACKTRACE=0
+fn main() {
+ &""[1..];
+}
diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr b/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr
new file mode 100644
index 000000000..463cd52c5
--- /dev/null
+++ b/src/test/ui/intrinsics/const-eval-select-backtrace-std.run.stderr
@@ -0,0 +1,2 @@
+thread 'main' panicked at 'byte index 1 is out of bounds of ``', $DIR/const-eval-select-backtrace-std.rs:6:6
+note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace.rs b/src/test/ui/intrinsics/const-eval-select-backtrace.rs
new file mode 100644
index 000000000..ef1c7c419
--- /dev/null
+++ b/src/test/ui/intrinsics/const-eval-select-backtrace.rs
@@ -0,0 +1,19 @@
+#![feature(core_intrinsics)]
+// See issue #100696.
+// run-fail
+// check-run-results
+// exec-env:RUST_BACKTRACE=0
+
+#[track_caller]
+fn uhoh() {
+ panic!("Aaah!")
+}
+
+const fn c() {}
+
+fn main() {
+ // safety: this is unsound and just used to test
+ unsafe {
+ std::intrinsics::const_eval_select((), c, uhoh);
+ }
+}
diff --git a/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr b/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr
new file mode 100644
index 000000000..54e28db5e
--- /dev/null
+++ b/src/test/ui/intrinsics/const-eval-select-backtrace.run.stderr
@@ -0,0 +1,2 @@
+thread 'main' panicked at 'Aaah!', $DIR/const-eval-select-backtrace.rs:17:9
+note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/src/test/ui/intrinsics/const-eval-select-bad.rs b/src/test/ui/intrinsics/const-eval-select-bad.rs
index 52f4e594f..fa14efad7 100644
--- a/src/test/ui/intrinsics/const-eval-select-bad.rs
+++ b/src/test/ui/intrinsics/const-eval-select-bad.rs
@@ -5,10 +5,13 @@ use std::intrinsics::const_eval_select;
const fn not_fn_items() {
const_eval_select((), || {}, || {});
- //~^ ERROR the trait bound
+ //~^ ERROR this argument must be a function item
+ //~| ERROR this argument must be a function item
const_eval_select((), 42, 0xDEADBEEF);
- //~^ ERROR the trait bound
+ //~^ ERROR expected a `FnOnce<()>` closure
//~| ERROR expected a `FnOnce<()>` closure
+ //~| ERROR this argument must be a function item
+ //~| ERROR this argument must be a function item
}
const fn foo(n: i32) -> i32 {
@@ -27,7 +30,7 @@ fn baz(n: bool) -> i32 {
const fn return_ty_mismatch() {
const_eval_select((1,), foo, bar);
- //~^ ERROR type mismatch
+ //~^ ERROR expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool`
}
const fn args_ty_mismatch() {
@@ -35,4 +38,9 @@ const fn args_ty_mismatch() {
//~^ ERROR type mismatch
}
+const fn non_const_fn() {
+ const_eval_select((1,), bar, bar);
+ //~^ ERROR this argument must be a `const fn`
+}
+
fn main() {}
diff --git a/src/test/ui/intrinsics/const-eval-select-bad.stderr b/src/test/ui/intrinsics/const-eval-select-bad.stderr
index 89dba12c8..3720528ad 100644
--- a/src/test/ui/intrinsics/const-eval-select-bad.stderr
+++ b/src/test/ui/intrinsics/const-eval-select-bad.stderr
@@ -1,42 +1,57 @@
-error[E0277]: the trait bound `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]: FnOnce<()>` is not satisfied
+error: this argument must be a function item
--> $DIR/const-eval-select-bad.rs:7:27
|
LL | const_eval_select((), || {}, || {});
- | ----------------- ^^^^^ expected an `FnOnce<()>` closure, found `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`
- | |
- | required by a bound introduced by this call
+ | ^^^^^
|
- = help: the trait `~const FnOnce<()>` is not implemented for `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`
-note: the trait `FnOnce<()>` is implemented for `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]`, but that implementation is not `const`
- --> $DIR/const-eval-select-bad.rs:7:27
+ = note: expected a function item, found [closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]
+ = help: consult the documentation on `const_eval_select` for more information
+
+error: this argument must be a function item
+ --> $DIR/const-eval-select-bad.rs:7:34
|
LL | const_eval_select((), || {}, || {});
- | ^^^^^
- = note: wrap the `[closure@$DIR/const-eval-select-bad.rs:7:27: 7:29]` in a closure with no arguments: `|| { /* code */ }`
-note: required by a bound in `const_eval_select`
- --> $SRC_DIR/core/src/intrinsics.rs:LL:COL
+ | ^^^^^
|
-LL | F: ~const FnOnce<ARG, Output = RET>,
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
+ = note: expected a function item, found [closure@$DIR/const-eval-select-bad.rs:7:34: 7:36]
+ = help: consult the documentation on `const_eval_select` for more information
-error[E0277]: the trait bound `{integer}: FnOnce<()>` is not satisfied
- --> $DIR/const-eval-select-bad.rs:9:27
+error: this argument must be a function item
+ --> $DIR/const-eval-select-bad.rs:10:27
+ |
+LL | const_eval_select((), 42, 0xDEADBEEF);
+ | ^^
+ |
+ = note: expected a function item, found {integer}
+ = help: consult the documentation on `const_eval_select` for more information
+
+error[E0277]: expected a `FnOnce<()>` closure, found `{integer}`
+ --> $DIR/const-eval-select-bad.rs:10:27
|
LL | const_eval_select((), 42, 0xDEADBEEF);
| ----------------- ^^ expected an `FnOnce<()>` closure, found `{integer}`
| |
| required by a bound introduced by this call
|
- = help: the trait `~const FnOnce<()>` is not implemented for `{integer}`
+ = help: the trait `FnOnce<()>` is not implemented for `{integer}`
= note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }`
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
-LL | F: ~const FnOnce<ARG, Output = RET>,
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
+LL | F: FnOnce<ARG, Output = RET>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
+
+error: this argument must be a function item
+ --> $DIR/const-eval-select-bad.rs:10:31
+ |
+LL | const_eval_select((), 42, 0xDEADBEEF);
+ | ^^^^^^^^^^
+ |
+ = note: expected a function item, found {integer}
+ = help: consult the documentation on `const_eval_select` for more information
error[E0277]: expected a `FnOnce<()>` closure, found `{integer}`
- --> $DIR/const-eval-select-bad.rs:9:31
+ --> $DIR/const-eval-select-bad.rs:10:31
|
LL | const_eval_select((), 42, 0xDEADBEEF);
| ----------------- ^^^^^^^^^^ expected an `FnOnce<()>` closure, found `{integer}`
@@ -48,23 +63,25 @@ LL | const_eval_select((), 42, 0xDEADBEEF);
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
-LL | G: FnOnce<ARG, Output = RET> + ~const Destruct,
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
+LL | G: FnOnce<ARG, Output = RET>,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
-error[E0271]: type mismatch resolving `<fn(i32) -> bool {bar} as FnOnce<(i32,)>>::Output == i32`
- --> $DIR/const-eval-select-bad.rs:29:5
+error[E0271]: expected `fn(i32) -> bool {bar}` to be a fn item that returns `i32`, but it returns `bool`
+ --> $DIR/const-eval-select-bad.rs:32:34
|
LL | const_eval_select((1,), foo, bar);
- | ^^^^^^^^^^^^^^^^^ expected `i32`, found `bool`
+ | ----------------- ^^^ expected `i32`, found `bool`
+ | |
+ | required by a bound introduced by this call
|
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
-LL | G: FnOnce<ARG, Output = RET> + ~const Destruct,
- | ^^^^^^^^^^^^ required by this bound in `const_eval_select`
+LL | G: FnOnce<ARG, Output = RET>,
+ | ^^^^^^^^^^^^ required by this bound in `const_eval_select`
error[E0631]: type mismatch in function arguments
- --> $DIR/const-eval-select-bad.rs:34:32
+ --> $DIR/const-eval-select-bad.rs:37:32
|
LL | const fn foo(n: i32) -> i32 {
| --------------------------- found signature defined here
@@ -79,10 +96,18 @@ LL | const_eval_select((true,), foo, baz);
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
-LL | F: ~const FnOnce<ARG, Output = RET>,
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
+LL | F: FnOnce<ARG, Output = RET>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `const_eval_select`
+
+error: this argument must be a `const fn`
+ --> $DIR/const-eval-select-bad.rs:42:29
+ |
+LL | const_eval_select((1,), bar, bar);
+ | ^^^
+ |
+ = help: consult the documentation on `const_eval_select` for more information
-error: aborting due to 5 previous errors
+error: aborting due to 9 previous errors
Some errors have detailed explanations: E0271, E0277, E0631.
For more information about an error, try `rustc --explain E0271`.
diff --git a/src/test/ui/intrinsics/intrinsic-alignment.rs b/src/test/ui/intrinsics/intrinsic-alignment.rs
index 6007eba8c..c8b1ff1db 100644
--- a/src/test/ui/intrinsics/intrinsic-alignment.rs
+++ b/src/test/ui/intrinsics/intrinsic-alignment.rs
@@ -6,6 +6,7 @@
mod rusti {
extern "rust-intrinsic" {
pub fn pref_align_of<T>() -> usize;
+ #[rustc_safe_intrinsic]
pub fn min_align_of<T>() -> usize;
}
}
diff --git a/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.rs b/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.rs
index a205a8730..a93d777d2 100644
--- a/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.rs
+++ b/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.rs
@@ -1,6 +1,5 @@
#![feature(core_intrinsics)]
#![feature(const_intrinsic_raw_eq)]
-#![deny(const_err)]
const BAD_RAW_EQ_CALL: bool = unsafe {
std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
diff --git a/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr b/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr
index 9322654b2..56d5a4857 100644
--- a/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr
+++ b/src/test/ui/intrinsics/intrinsic-raw_eq-const-padding.stderr
@@ -1,5 +1,5 @@
error[E0080]: evaluation of constant value failed
- --> $DIR/intrinsic-raw_eq-const-padding.rs:6:5
+ --> $DIR/intrinsic-raw_eq-const-padding.rs:5:5
|
LL | std::intrinsics::raw_eq(&(1_u8, 2_u16), &(1_u8, 2_u16))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ reading memory at alloc3[0x0..0x4], but memory is uninitialized at [0x1..0x2], and this operation requires initialized memory
diff --git a/src/test/ui/intrinsics/intrinsic-raw_eq-const.rs b/src/test/ui/intrinsics/intrinsic-raw_eq-const.rs
index 8ea954673..32841f531 100644
--- a/src/test/ui/intrinsics/intrinsic-raw_eq-const.rs
+++ b/src/test/ui/intrinsics/intrinsic-raw_eq-const.rs
@@ -2,7 +2,6 @@
#![feature(core_intrinsics)]
#![feature(const_intrinsic_raw_eq)]
-#![deny(const_err)]
pub fn main() {
use std::intrinsics::raw_eq;
diff --git a/src/test/ui/intrinsics/intrinsics-integer.rs b/src/test/ui/intrinsics/intrinsics-integer.rs
index bac6c8d87..88bf42b68 100644
--- a/src/test/ui/intrinsics/intrinsics-integer.rs
+++ b/src/test/ui/intrinsics/intrinsics-integer.rs
@@ -1,15 +1,21 @@
// run-pass
#![feature(intrinsics)]
+#![feature(rustc_attrs)]
mod rusti {
extern "rust-intrinsic" {
+ #[rustc_safe_intrinsic]
pub fn ctpop<T>(x: T) -> T;
+ #[rustc_safe_intrinsic]
pub fn ctlz<T>(x: T) -> T;
pub fn ctlz_nonzero<T>(x: T) -> T;
+ #[rustc_safe_intrinsic]
pub fn cttz<T>(x: T) -> T;
pub fn cttz_nonzero<T>(x: T) -> T;
+ #[rustc_safe_intrinsic]
pub fn bswap<T>(x: T) -> T;
+ #[rustc_safe_intrinsic]
pub fn bitreverse<T>(x: T) -> T;
}
}
diff --git a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs
index 255151a96..ec3860a32 100644
--- a/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs
+++ b/src/test/ui/intrinsics/panic-uninitialized-zeroed.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// revisions: mir thir strict
// [thir]compile-flags: -Zthir-unsafeck
// [strict]compile-flags: -Zstrict-init-checks
@@ -8,7 +7,7 @@
// This test checks panic emitted from `mem::{uninitialized,zeroed}`.
-#![feature(never_type, arbitrary_enum_discriminant)]
+#![feature(never_type)]
#![allow(deprecated, invalid_value)]
use std::{
@@ -35,6 +34,12 @@ enum OneVariant_NonZero {
DeadVariant(Bar),
}
+#[allow(dead_code, non_camel_case_types)]
+enum OneVariant_Ref {
+ Variant(&'static i32),
+ DeadVariant(Bar),
+}
+
// An `Aggregate` abi enum where 0 is not a valid discriminant.
#[allow(dead_code)]
#[repr(i32)]
@@ -64,6 +69,7 @@ enum ZeroIsValid {
One(NonNull<()>) = 1,
}
+#[track_caller]
fn test_panic_msg<T>(op: impl (FnOnce() -> T) + panic::UnwindSafe, msg: &str) {
let err = panic::catch_unwind(op).err();
assert_eq!(
@@ -72,6 +78,15 @@ fn test_panic_msg<T>(op: impl (FnOnce() -> T) + panic::UnwindSafe, msg: &str) {
);
}
+#[track_caller]
+fn test_panic_msg_only_if_strict<T>(op: impl (FnOnce() -> T) + panic::UnwindSafe, msg: &str) {
+ let err = panic::catch_unwind(op).err();
+ assert_eq!(
+ err.as_ref().and_then(|a| a.downcast_ref::<&str>()),
+ if cfg!(strict) { Some(&msg) } else { None },
+ );
+}
+
fn main() {
unsafe {
// Uninhabited types
@@ -140,92 +155,216 @@ fn main() {
"attempted to instantiate uninhabited type `[Bar; 2]`"
);
- // Types that do not like zero-initialziation
+ // Types that don't allow either.
test_panic_msg(
- || mem::uninitialized::<fn()>(),
- "attempted to leave type `fn()` uninitialized, which is invalid"
+ || mem::zeroed::<&i32>(),
+ "attempted to zero-initialize type `&i32`, which is invalid"
);
test_panic_msg(
- || mem::zeroed::<fn()>(),
- "attempted to zero-initialize type `fn()`, which is invalid"
+ || mem::uninitialized::<&i32>(),
+ "attempted to leave type `&i32` uninitialized, which is invalid"
);
test_panic_msg(
- || mem::uninitialized::<*const dyn Send>(),
- "attempted to leave type `*const dyn core::marker::Send` uninitialized, which is invalid"
+ || mem::zeroed::<Box<[i32; 0]>>(),
+ "attempted to zero-initialize type `alloc::boxed::Box<[i32; 0]>`, which is invalid"
+ );
+ test_panic_msg(
+ || mem::uninitialized::<Box<[i32; 0]>>(),
+ "attempted to leave type `alloc::boxed::Box<[i32; 0]>` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<Box<u8>>(),
+ "attempted to zero-initialize type `alloc::boxed::Box<u8>`, which is invalid"
);
test_panic_msg(
+ || mem::uninitialized::<Box<u8>>(),
+ "attempted to leave type `alloc::boxed::Box<u8>` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<&[i32]>(),
+ "attempted to zero-initialize type `&[i32]`, which is invalid"
+ );
+ test_panic_msg(
+ || mem::uninitialized::<&[i32]>(),
+ "attempted to leave type `&[i32]` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<&(u8, [u8])>(),
+ "attempted to zero-initialize type `&(u8, [u8])`, which is invalid"
+ );
+ test_panic_msg(
+ || mem::uninitialized::<&(u8, [u8])>(),
+ "attempted to leave type `&(u8, [u8])` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<&dyn Send>(),
+ "attempted to zero-initialize type `&dyn core::marker::Send`, which is invalid"
+ );
+ test_panic_msg(
+ || mem::uninitialized::<&dyn Send>(),
+ "attempted to leave type `&dyn core::marker::Send` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
|| mem::zeroed::<*const dyn Send>(),
"attempted to zero-initialize type `*const dyn core::marker::Send`, which is invalid"
);
+ test_panic_msg(
+ || mem::uninitialized::<*const dyn Send>(),
+ "attempted to leave type `*const dyn core::marker::Send` uninitialized, which is invalid"
+ );
test_panic_msg(
- || mem::uninitialized::<(NonNull<u32>, u32, u32)>(),
- "attempted to leave type `(core::ptr::non_null::NonNull<u32>, u32, u32)` uninitialized, \
+ || mem::uninitialized::<NoNullVariant>(),
+ "attempted to leave type `NoNullVariant` uninitialized, \
+ which is invalid"
+ );
+ test_panic_msg(
+ || mem::zeroed::<NoNullVariant>(),
+ "attempted to zero-initialize type `NoNullVariant`, \
which is invalid"
);
test_panic_msg(
- || mem::zeroed::<(NonNull<u32>, u32, u32)>(),
- "attempted to zero-initialize type `(core::ptr::non_null::NonNull<u32>, u32, u32)`, \
+ || mem::zeroed::<OneVariant_Ref>(),
+ "attempted to zero-initialize type `OneVariant_Ref`, \
which is invalid"
);
+ test_panic_msg(
+ || mem::uninitialized::<OneVariant_Ref>(),
+ "attempted to leave type `OneVariant_Ref` uninitialized, which is invalid"
+ );
+ // Types where both are invalid, but we allow uninit since the 0x01-filling is not LLVM UB.
test_panic_msg(
- || mem::uninitialized::<OneVariant_NonZero>(),
- "attempted to leave type `OneVariant_NonZero` uninitialized, \
+ || mem::zeroed::<fn()>(),
+ "attempted to zero-initialize type `fn()`, which is invalid"
+ );
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<fn()>(),
+ "attempted to leave type `fn()` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<&()>(),
+ "attempted to zero-initialize type `&()`, which is invalid"
+ );
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<&()>(),
+ "attempted to leave type `&()` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<&[u8]>(),
+ "attempted to zero-initialize type `&[u8]`, which is invalid"
+ );
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<&[u8]>(),
+ "attempted to leave type `&[u8]` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<&str>(),
+ "attempted to zero-initialize type `&str`, which is invalid"
+ );
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<&str>(),
+ "attempted to leave type `&str` uninitialized, which is invalid"
+ );
+
+ test_panic_msg(
+ || mem::zeroed::<(NonNull<u32>, u32, u32)>(),
+ "attempted to zero-initialize type `(core::ptr::non_null::NonNull<u32>, u32, u32)`, \
which is invalid"
);
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<(NonNull<u32>, u32, u32)>(),
+ "attempted to leave type `(core::ptr::non_null::NonNull<u32>, u32, u32)` uninitialized, which is invalid"
+ );
+
test_panic_msg(
|| mem::zeroed::<OneVariant_NonZero>(),
"attempted to zero-initialize type `OneVariant_NonZero`, \
which is invalid"
);
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<OneVariant_NonZero>(),
+ "attempted to leave type `OneVariant_NonZero` uninitialized, which is invalid"
+ );
+ // Types where both are invalid but we allow the zeroed form since it is not LLVM UB.
+ test_panic_msg_only_if_strict(
+ || mem::zeroed::<LR_NonZero>(),
+ "attempted to zero-initialize type `LR_NonZero`, which is invalid"
+ );
test_panic_msg(
|| mem::uninitialized::<LR_NonZero>(),
"attempted to leave type `LR_NonZero` uninitialized, which is invalid"
);
+ test_panic_msg_only_if_strict(
+ || mem::zeroed::<ManuallyDrop<LR_NonZero>>(),
+ "attempted to zero-initialize type `core::mem::manually_drop::ManuallyDrop<LR_NonZero>`, \
+ which is invalid"
+ );
test_panic_msg(
|| mem::uninitialized::<ManuallyDrop<LR_NonZero>>(),
"attempted to leave type `core::mem::manually_drop::ManuallyDrop<LR_NonZero>` uninitialized, \
which is invalid"
);
- test_panic_msg(
- || mem::uninitialized::<NoNullVariant>(),
- "attempted to leave type `NoNullVariant` uninitialized, \
- which is invalid"
+ // Some strict-only things
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<i32>(),
+ "attempted to leave type `i32` uninitialized, which is invalid"
);
- test_panic_msg(
- || mem::zeroed::<NoNullVariant>(),
- "attempted to zero-initialize type `NoNullVariant`, \
- which is invalid"
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<*const ()>(),
+ "attempted to leave type `*const ()` uninitialized, which is invalid"
);
- // Types that can be zero, but not uninit.
- test_panic_msg(
- || mem::uninitialized::<bool>(),
- "attempted to leave type `bool` uninitialized, which is invalid"
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<[i32; 1]>(),
+ "attempted to leave type `[i32; 1]` uninitialized, which is invalid"
);
+ test_panic_msg_only_if_strict(
+ || mem::zeroed::<[NonNull<()>; 1]>(),
+ "attempted to zero-initialize type `[core::ptr::non_null::NonNull<()>; 1]`, which is invalid"
+ );
+
+ // Types that can be zero, but not uninit (though some are mitigated).
+ let _val = mem::zeroed::<LR>();
test_panic_msg(
|| mem::uninitialized::<LR>(),
"attempted to leave type `LR` uninitialized, which is invalid"
);
+ let _val = mem::zeroed::<ManuallyDrop<LR>>();
test_panic_msg(
|| mem::uninitialized::<ManuallyDrop<LR>>(),
"attempted to leave type `core::mem::manually_drop::ManuallyDrop<LR>` uninitialized, which is invalid"
);
- // Some things that should work.
let _val = mem::zeroed::<bool>();
- let _val = mem::zeroed::<LR>();
- let _val = mem::zeroed::<ManuallyDrop<LR>>();
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<bool>(),
+ "attempted to leave type `bool` uninitialized, which is invalid"
+ );
+
let _val = mem::zeroed::<OneVariant>();
+ test_panic_msg_only_if_strict(
+ || mem::uninitialized::<OneVariant>(),
+ "attempted to leave type `OneVariant` uninitialized, which is invalid"
+ );
+
+ // Some things that are actually allowed.
let _val = mem::zeroed::<Option<&'static i32>>();
let _val = mem::zeroed::<MaybeUninit<NonNull<u32>>>();
let _val = mem::zeroed::<[!; 0]>();
@@ -234,59 +373,5 @@ fn main() {
let _val = mem::uninitialized::<[!; 0]>();
let _val = mem::uninitialized::<()>();
let _val = mem::uninitialized::<ZeroSized>();
-
- if cfg!(strict) {
- test_panic_msg(
- || mem::uninitialized::<i32>(),
- "attempted to leave type `i32` uninitialized, which is invalid"
- );
-
- test_panic_msg(
- || mem::uninitialized::<*const ()>(),
- "attempted to leave type `*const ()` uninitialized, which is invalid"
- );
-
- test_panic_msg(
- || mem::uninitialized::<[i32; 1]>(),
- "attempted to leave type `[i32; 1]` uninitialized, which is invalid"
- );
-
- test_panic_msg(
- || mem::zeroed::<NonNull<()>>(),
- "attempted to zero-initialize type `core::ptr::non_null::NonNull<()>`, which is invalid"
- );
-
- test_panic_msg(
- || mem::zeroed::<[NonNull<()>; 1]>(),
- "attempted to zero-initialize type `[core::ptr::non_null::NonNull<()>; 1]`, which is invalid"
- );
-
- // FIXME(#66151) we conservatively do not error here yet (by default).
- test_panic_msg(
- || mem::zeroed::<LR_NonZero>(),
- "attempted to zero-initialize type `LR_NonZero`, which is invalid"
- );
-
- test_panic_msg(
- || mem::zeroed::<ManuallyDrop<LR_NonZero>>(),
- "attempted to zero-initialize type `core::mem::manually_drop::ManuallyDrop<LR_NonZero>`, \
- which is invalid"
- );
- } else {
- // These are UB because they have not been officially blessed, but we await the resolution
- // of <https://github.com/rust-lang/unsafe-code-guidelines/issues/71> before doing
- // anything about that.
- let _val = mem::uninitialized::<i32>();
- let _val = mem::uninitialized::<*const ()>();
-
- // These are UB, but best to test them to ensure we don't become unintentionally
- // stricter.
-
- // It's currently unchecked to create invalid enums and values inside arrays.
- let _val = mem::zeroed::<LR_NonZero>();
- let _val = mem::zeroed::<[LR_NonZero; 1]>();
- let _val = mem::zeroed::<[NonNull<()>; 1]>();
- let _val = mem::uninitialized::<[NonNull<()>; 1]>();
- }
}
}
diff --git a/src/test/ui/intrinsics/safe-intrinsic-mismatch.rs b/src/test/ui/intrinsics/safe-intrinsic-mismatch.rs
new file mode 100644
index 000000000..50e12eaeb
--- /dev/null
+++ b/src/test/ui/intrinsics/safe-intrinsic-mismatch.rs
@@ -0,0 +1,11 @@
+#![feature(intrinsics)]
+#![feature(rustc_attrs)]
+
+extern "rust-intrinsic" {
+ fn size_of<T>() -> usize; //~ ERROR intrinsic safety mismatch
+
+ #[rustc_safe_intrinsic]
+ fn assume(b: bool); //~ ERROR intrinsic safety mismatch
+}
+
+fn main() {}
diff --git a/src/test/ui/intrinsics/safe-intrinsic-mismatch.stderr b/src/test/ui/intrinsics/safe-intrinsic-mismatch.stderr
new file mode 100644
index 000000000..0c2f3be49
--- /dev/null
+++ b/src/test/ui/intrinsics/safe-intrinsic-mismatch.stderr
@@ -0,0 +1,14 @@
+error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `size_of`
+ --> $DIR/safe-intrinsic-mismatch.rs:5:5
+ |
+LL | fn size_of<T>() -> usize;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: intrinsic safety mismatch between list of intrinsics within the compiler and core library intrinsics for intrinsic `assume`
+ --> $DIR/safe-intrinsic-mismatch.rs:8:5
+ |
+LL | fn assume(b: bool);
+ | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/invalid/invalid-inline.rs b/src/test/ui/invalid/invalid-inline.rs
index 8aa8f99f5..2501b1e23 100644
--- a/src/test/ui/invalid/invalid-inline.rs
+++ b/src/test/ui/invalid/invalid-inline.rs
@@ -1,19 +1,14 @@
#![allow(dead_code)]
-#[inline(please_no)] //~ ERROR invalid argument
-fn a() {
-}
-
#[inline(please,no)] //~ ERROR expected one argument
-fn b() {
+fn a() {
}
#[inline()] //~ ERROR expected one argument
-fn c() {
+fn b() {
}
fn main() {
a();
b();
- c();
}
diff --git a/src/test/ui/invalid/invalid-inline.stderr b/src/test/ui/invalid/invalid-inline.stderr
index f3d042641..7edbf936b 100644
--- a/src/test/ui/invalid/invalid-inline.stderr
+++ b/src/test/ui/invalid/invalid-inline.stderr
@@ -1,22 +1,15 @@
-error[E0535]: invalid argument
- --> $DIR/invalid-inline.rs:3:10
- |
-LL | #[inline(please_no)]
- | ^^^^^^^^^
-
error[E0534]: expected one argument
- --> $DIR/invalid-inline.rs:7:1
+ --> $DIR/invalid-inline.rs:3:1
|
LL | #[inline(please,no)]
| ^^^^^^^^^^^^^^^^^^^^
error[E0534]: expected one argument
- --> $DIR/invalid-inline.rs:11:1
+ --> $DIR/invalid-inline.rs:7:1
|
LL | #[inline()]
| ^^^^^^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
-Some errors have detailed explanations: E0534, E0535.
-For more information about an error, try `rustc --explain E0534`.
+For more information about this error, try `rustc --explain E0534`.
diff --git a/src/test/ui/invalid/invalid-llvm-passes.rs b/src/test/ui/invalid/invalid-llvm-passes.rs
index ca3c6230a..ee28f5eb6 100644
--- a/src/test/ui/invalid/invalid-llvm-passes.rs
+++ b/src/test/ui/invalid/invalid-llvm-passes.rs
@@ -1,4 +1,4 @@
// build-fail
-// compile-flags: -Cpasses=unknown-pass -Z new-llvm-pass-manager=yes
+// compile-flags: -Cpasses=unknown-pass
fn main() {}
diff --git a/src/test/ui/issue-94866.stderr b/src/test/ui/issue-94866.stderr
index 5477d83f4..b3c17ce89 100644
--- a/src/test/ui/issue-94866.stderr
+++ b/src/test/ui/issue-94866.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `B` not covered
+error[E0004]: non-exhaustive patterns: `Enum::B` not covered
--> $DIR/issue-94866.rs:10:11
|
LL | match Enum::A {
- | ^^^^^^^ pattern `B` not covered
+ | ^^^^^^^ pattern `Enum::B` not covered
|
note: `Enum` defined here
--> $DIR/issue-94866.rs:7:16
@@ -13,7 +13,7 @@ LL | enum Enum { A, B }
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 ~ Enum::A => m!(),
-LL + B => todo!()
+LL + Enum::B => todo!()
|
error: aborting due to previous error
diff --git a/src/test/ui/issues/auxiliary/issue-2380.rs b/src/test/ui/issues/auxiliary/issue-2380.rs
index 9a51a73c9..79fd62d16 100644
--- a/src/test/ui/issues/auxiliary/issue-2380.rs
+++ b/src/test/ui/issues/auxiliary/issue-2380.rs
@@ -1,8 +1,6 @@
#![crate_name="a"]
#![crate_type = "lib"]
-#![feature(box_syntax)]
-
pub trait i<T>
{
fn dummy(&self, t: T) -> T { panic!() }
@@ -11,5 +9,5 @@ pub trait i<T>
pub fn f<T>() -> Box<i<T>+'static> {
impl<T> i<T> for () { }
- box () as Box<i<T>+'static>
+ Box::new(()) as Box<i<T>+'static>
}
diff --git a/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs b/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs
deleted file mode 100644
index 2ed50d709..000000000
--- a/src/test/ui/issues/issue-100550-normalization-ice-exposed-by-mir-inlining.rs
+++ /dev/null
@@ -1,39 +0,0 @@
-// check-pass
-
-// compile-flags: --emit=mir,link -O
-
-// There is an ICE somewhere in type normalization, and we are hitting it during
-// the MIR inlining pass on this code.
-//
-// Long term, we should fix that ICE and change the compile-flags for this test
-// to explicitly enable MIR inlining.
-//
-// Short term, we are diabling MIR inlining for Rust 1.64-beta, so that we avoid
-// this ICE in this instance.
-
-pub trait Trait {
- type Associated;
-}
-impl<T> Trait for T {
- type Associated = T;
-}
-
-pub struct Struct<T>(<T as Trait>::Associated);
-
-pub fn foo<T>() -> Struct<T>
-where
- T: Trait,
-{
- bar()
-}
-
-#[inline]
-fn bar<T>() -> Struct<T> {
- Struct(baz())
-}
-
-fn baz<T>() -> T {
- unimplemented!()
-}
-
-fn main() { }
diff --git a/src/test/ui/issues/issue-100605.rs b/src/test/ui/issues/issue-100605.rs
new file mode 100644
index 000000000..917a45c15
--- /dev/null
+++ b/src/test/ui/issues/issue-100605.rs
@@ -0,0 +1,9 @@
+fn takes_option(_arg: Option<&String>) {}
+
+fn main() {
+ takes_option(&None); //~ ERROR 4:18: 4:23: mismatched types [E0308]
+
+ let x = String::from("x");
+ let res = Some(x);
+ takes_option(&res); //~ ERROR 8:18: 8:22: mismatched types [E0308]
+}
diff --git a/src/test/ui/issues/issue-100605.stderr b/src/test/ui/issues/issue-100605.stderr
new file mode 100644
index 000000000..886e3cd6b
--- /dev/null
+++ b/src/test/ui/issues/issue-100605.stderr
@@ -0,0 +1,46 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-100605.rs:4:18
+ |
+LL | takes_option(&None);
+ | ------------ ^^^^^ expected enum `Option`, found `&Option<_>`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected enum `Option<&String>`
+ found reference `&Option<_>`
+note: function defined here
+ --> $DIR/issue-100605.rs:1:4
+ |
+LL | fn takes_option(_arg: Option<&String>) {}
+ | ^^^^^^^^^^^^ ---------------------
+help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`
+ |
+LL | takes_option(None.as_ref());
+ | ~~~~~~~~~~~~~
+help: consider removing the borrow
+ |
+LL - takes_option(&None);
+LL + takes_option(None);
+ |
+
+error[E0308]: mismatched types
+ --> $DIR/issue-100605.rs:8:18
+ |
+LL | takes_option(&res);
+ | ------------ ^^^^
+ | | |
+ | | expected enum `Option`, found `&Option<String>`
+ | | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `res.as_ref()`
+ | arguments to this function are incorrect
+ |
+ = note: expected enum `Option<&String>`
+ found reference `&Option<String>`
+note: function defined here
+ --> $DIR/issue-100605.rs:1:4
+ |
+LL | fn takes_option(_arg: Option<&String>) {}
+ | ^^^^^^^^^^^^ ---------------------
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/issues/issue-102964.rs b/src/test/ui/issues/issue-102964.rs
new file mode 100644
index 000000000..43ff23600
--- /dev/null
+++ b/src/test/ui/issues/issue-102964.rs
@@ -0,0 +1,10 @@
+use std::rc::Rc;
+type Foo<'a, T> = &'a dyn Fn(&T);
+type RcFoo<'a, T> = Rc<Foo<'a, T>>;
+
+fn bar_function<T>(function: Foo<T>) -> RcFoo<T> {
+ //~^ ERROR mismatched types
+ let rc = Rc::new(function);
+}
+
+fn main() {}
diff --git a/src/test/ui/issues/issue-102964.stderr b/src/test/ui/issues/issue-102964.stderr
new file mode 100644
index 000000000..450403909
--- /dev/null
+++ b/src/test/ui/issues/issue-102964.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-102964.rs:5:41
+ |
+LL | fn bar_function<T>(function: Foo<T>) -> RcFoo<T> {
+ | ------------ ^^^^^^^^ expected struct `Rc`, found `()`
+ | |
+ | implicitly returns `()` as its body has no tail or `return` expression
+ |
+ = note: expected struct `Rc<&dyn for<'a> Fn(&'a T)>`
+ found unit type `()`
+help: consider returning the local binding `rc`
+ |
+LL ~ let rc = Rc::new(function);
+LL + rc
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/issues/issue-10682.rs b/src/test/ui/issues/issue-10682.rs
index afaa90f05..72e4559d3 100644
--- a/src/test/ui/issues/issue-10682.rs
+++ b/src/test/ui/issues/issue-10682.rs
@@ -4,12 +4,10 @@
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
fn work(_: Box<isize>) {}
fn foo<F:FnOnce()>(_: F) {}
pub fn main() {
- let a = box 1;
+ let a = Box::new(1);
foo(move|| { foo(move|| { work(a) }) })
}
diff --git a/src/test/ui/issues/issue-10767.rs b/src/test/ui/issues/issue-10767.rs
index f40815fdb..5670cd458 100644
--- a/src/test/ui/issues/issue-10767.rs
+++ b/src/test/ui/issues/issue-10767.rs
@@ -1,10 +1,8 @@
// run-pass
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
pub fn main() {
fn f() {
}
- let _: Box<fn()> = box (f as fn());
+ let _: Box<fn()> = Box::new(f as fn());
}
diff --git a/src/test/ui/issues/issue-10802.rs b/src/test/ui/issues/issue-10802.rs
index f1d6b37a6..99e1a92df 100644
--- a/src/test/ui/issues/issue-10802.rs
+++ b/src/test/ui/issues/issue-10802.rs
@@ -1,6 +1,5 @@
// run-pass
#![allow(dead_code)]
-#![feature(box_syntax)]
struct DroppableStruct;
enum DroppableEnum {
@@ -33,14 +32,14 @@ impl Whatever {
fn main() {
{
- let f: Box<_> = box DroppableStruct;
- let _a = Whatever::new(box f as Box<dyn MyTrait>);
+ let f: Box<_> = Box::new(DroppableStruct);
+ let _a = Whatever::new(Box::new(f) as Box<dyn MyTrait>);
}
assert!(unsafe { DROPPED });
unsafe { DROPPED = false; }
{
- let f: Box<_> = box DroppableEnum::DroppableVariant1;
- let _a = Whatever::new(box f as Box<dyn MyTrait>);
+ let f: Box<_> = Box::new(DroppableEnum::DroppableVariant1);
+ let _a = Whatever::new(Box::new(f) as Box<dyn MyTrait>);
}
assert!(unsafe { DROPPED });
}
diff --git a/src/test/ui/issues/issue-11192.rs b/src/test/ui/issues/issue-11192.rs
index 3bf91675e..1a3d8c9fe 100644
--- a/src/test/ui/issues/issue-11192.rs
+++ b/src/test/ui/issues/issue-11192.rs
@@ -1,20 +1,20 @@
-#![feature(box_syntax)]
-
struct Foo {
x: isize
}
+
impl Drop for Foo {
fn drop(&mut self) {
println!("drop {}", self.x);
}
}
+
fn main() {
- let mut ptr: Box<_> = box Foo { x: 0 };
+ let mut ptr: Box<_> = Box::new(Foo { x: 0 });
let mut test = |foo: &Foo| {
println!("access {}", foo.x);
- ptr = box Foo { x: ptr.x + 1 };
+ ptr = Box::new(Foo { x: ptr.x + 1 });
println!("access {}", foo.x);
};
test(&*ptr);
diff --git a/src/test/ui/issues/issue-11192.stderr b/src/test/ui/issues/issue-11192.stderr
index 2a9d91317..fc1548013 100644
--- a/src/test/ui/issues/issue-11192.stderr
+++ b/src/test/ui/issues/issue-11192.stderr
@@ -4,7 +4,7 @@ error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as m
LL | let mut test = |foo: &Foo| {
| ----------- mutable borrow occurs here
LL | println!("access {}", foo.x);
-LL | ptr = box Foo { x: ptr.x + 1 };
+LL | ptr = Box::new(Foo { x: ptr.x + 1 });
| --- first borrow occurs due to use of `ptr` in closure
...
LL | test(&*ptr);
diff --git a/src/test/ui/issues/issue-11374.stderr b/src/test/ui/issues/issue-11374.stderr
index 3a1d43310..15b2bbeb7 100644
--- a/src/test/ui/issues/issue-11374.stderr
+++ b/src/test/ui/issues/issue-11374.stderr
@@ -14,7 +14,7 @@ note: associated function defined here
--> $DIR/issue-11374.rs:13:12
|
LL | pub fn read_to(&mut self, vec: &mut [u8]) {
- | ^^^^^^^ --------- --------------
+ | ^^^^^^^ --------------
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-11515.rs b/src/test/ui/issues/issue-11515.rs
index 2072f9c47..b5c942f96 100644
--- a/src/test/ui/issues/issue-11515.rs
+++ b/src/test/ui/issues/issue-11515.rs
@@ -1,10 +1,10 @@
-#![feature(box_syntax)]
-
struct Test {
func: Box<dyn FnMut() + 'static>,
}
+
+
fn main() {
let closure: Box<dyn Fn() + 'static> = Box::new(|| ());
- let test = box Test { func: closure }; //~ ERROR trait upcasting coercion is experimental [E0658]
+ let test = Box::new(Test { func: closure }); //~ ERROR trait upcasting coercion is experimental [E0658]
}
diff --git a/src/test/ui/issues/issue-11515.stderr b/src/test/ui/issues/issue-11515.stderr
index 17bfae2a4..accd47f0f 100644
--- a/src/test/ui/issues/issue-11515.stderr
+++ b/src/test/ui/issues/issue-11515.stderr
@@ -1,8 +1,8 @@
error[E0658]: cannot cast `dyn Fn()` to `dyn FnMut()`, trait upcasting coercion is experimental
- --> $DIR/issue-11515.rs:9:33
+ --> $DIR/issue-11515.rs:9:38
|
-LL | let test = box Test { func: closure };
- | ^^^^^^^
+LL | let test = Box::new(Test { func: closure });
+ | ^^^^^^^
|
= note: see issue #65991 <https://github.com/rust-lang/rust/issues/65991> for more information
= help: add `#![feature(trait_upcasting)]` to the crate attributes to enable
diff --git a/src/test/ui/issues/issue-11552.rs b/src/test/ui/issues/issue-11552.rs
index bae12375d..9fb9f3d2e 100644
--- a/src/test/ui/issues/issue-11552.rs
+++ b/src/test/ui/issues/issue-11552.rs
@@ -1,6 +1,5 @@
// run-pass
#![feature(box_patterns)]
-#![feature(box_syntax)]
#[derive(Clone)]
enum Noun
@@ -18,5 +17,8 @@ fn fas(n: &Noun) -> Noun
}
pub fn main() {
- fas(&Noun::Cell(box Noun::Atom(2), box Noun::Cell(box Noun::Atom(2), box Noun::Atom(3))));
+ fas(
+ &Noun::Cell(Box::new(Noun::Atom(2)),
+ Box::new(Noun::Cell(Box::new(Noun::Atom(2)), Box::new(Noun::Atom(3)))))
+ );
}
diff --git a/src/test/ui/issues/issue-11844.rs b/src/test/ui/issues/issue-11844.rs
index bb06f00d5..f974a4702 100644
--- a/src/test/ui/issues/issue-11844.rs
+++ b/src/test/ui/issues/issue-11844.rs
@@ -1,7 +1,5 @@
-#![feature(box_syntax)]
-
fn main() {
- let a = Some(box 1);
+ let a = Some(Box::new(1));
match a {
Ok(a) => //~ ERROR: mismatched types
println!("{}",a),
diff --git a/src/test/ui/issues/issue-11844.stderr b/src/test/ui/issues/issue-11844.stderr
index 9d7470e7a..81cf918a1 100644
--- a/src/test/ui/issues/issue-11844.stderr
+++ b/src/test/ui/issues/issue-11844.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/issue-11844.rs:6:9
+ --> $DIR/issue-11844.rs:4:9
|
LL | match a {
| - this expression has type `Option<Box<{integer}>>`
diff --git a/src/test/ui/issues/issue-11958.stderr b/src/test/ui/issues/issue-11958.stderr
index 25de6ff4c..5dca4c2f0 100644
--- a/src/test/ui/issues/issue-11958.stderr
+++ b/src/test/ui/issues/issue-11958.stderr
@@ -4,8 +4,8 @@ warning: value assigned to `x` is never read
LL | let _thunk = Box::new(move|| { x = 2; });
| ^
|
- = note: `#[warn(unused_assignments)]` on by default
= help: maybe it is overwritten before being read?
+ = note: `#[warn(unused_assignments)]` on by default
warning: unused variable: `x`
--> $DIR/issue-11958.rs:8:36
@@ -13,8 +13,8 @@ warning: unused variable: `x`
LL | let _thunk = Box::new(move|| { x = 2; });
| ^
|
- = note: `#[warn(unused_variables)]` on by default
= help: did you mean to capture by reference instead?
+ = note: `#[warn(unused_variables)]` on by default
warning: 2 warnings emitted
diff --git a/src/test/ui/issues/issue-12127.rs b/src/test/ui/issues/issue-12127.rs
index bb2c27345..8b30ddc2d 100644
--- a/src/test/ui/issues/issue-12127.rs
+++ b/src/test/ui/issues/issue-12127.rs
@@ -1,10 +1,10 @@
-#![feature(box_syntax, unboxed_closures)]
+#![feature(unboxed_closures)]
fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
fn do_it(x: &isize) { }
fn main() {
- let x: Box<_> = box 22;
+ let x: Box<_> = Box::new(22);
let f = to_fn_once(move|| do_it(&*x));
to_fn_once(move|| {
f();
diff --git a/src/test/ui/issues/issue-13323.rs b/src/test/ui/issues/issue-13323.rs
index 26847ee7a..71e14d4da 100644
--- a/src/test/ui/issues/issue-13323.rs
+++ b/src/test/ui/issues/issue-13323.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
struct StrWrap {
s: String
@@ -48,7 +47,7 @@ impl<T: Eq> Matcher<T> for EqualTo<T> {
}
fn equal_to<T: Eq>(expected: T) -> Box<EqualTo<T>> {
- box EqualTo { expected: expected }
+ Box::new(EqualTo { expected: expected })
}
pub fn main() {
diff --git a/src/test/ui/issues/issue-14399.rs b/src/test/ui/issues/issue-14399.rs
index 6bf8a5899..7b32bf8e4 100644
--- a/src/test/ui/issues/issue-14399.rs
+++ b/src/test/ui/issues/issue-14399.rs
@@ -6,8 +6,6 @@
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
#[derive(Clone)]
struct B1;
@@ -15,6 +13,6 @@ trait A { fn foo(&self) {} }
impl A for B1 {}
fn main() {
- let v: Box<_> = box B1;
+ let v: Box<_> = Box::new(B1);
let _c: Box<dyn A> = v.clone();
}
diff --git a/src/test/ui/issues/issue-1460.stderr b/src/test/ui/issues/issue-1460.stderr
index 26f95f5af..f0ff2cafd 100644
--- a/src/test/ui/issues/issue-1460.stderr
+++ b/src/test/ui/issues/issue-1460.stderr
@@ -4,8 +4,8 @@ warning: unused closure that must be used
LL | {|i: u32| if 1 == i { }};
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: closures are lazy and do nothing unless called
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/issues/issue-14875.rs b/src/test/ui/issues/issue-14875.rs
index aaef2aab9..fca330915 100644
--- a/src/test/ui/issues/issue-14875.rs
+++ b/src/test/ui/issues/issue-14875.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// Check that values are not leaked when a dtor panics (#14875)
diff --git a/src/test/ui/issues/issue-14915.rs b/src/test/ui/issues/issue-14915.rs
index 909540355..127b909dd 100644
--- a/src/test/ui/issues/issue-14915.rs
+++ b/src/test/ui/issues/issue-14915.rs
@@ -1,7 +1,5 @@
-#![feature(box_syntax)]
-
fn main() {
- let x: Box<isize> = box 0;
+ let x: Box<isize> = Box::new(0);
println!("{}", x + 1);
//~^ ERROR cannot add `{integer}` to `Box<isize>`
diff --git a/src/test/ui/issues/issue-14915.stderr b/src/test/ui/issues/issue-14915.stderr
index bd0b1d39a..6e6326929 100644
--- a/src/test/ui/issues/issue-14915.stderr
+++ b/src/test/ui/issues/issue-14915.stderr
@@ -1,5 +1,5 @@
error[E0369]: cannot add `{integer}` to `Box<isize>`
- --> $DIR/issue-14915.rs:6:22
+ --> $DIR/issue-14915.rs:4:22
|
LL | println!("{}", x + 1);
| - ^ - {integer}
diff --git a/src/test/ui/issues/issue-15524.rs b/src/test/ui/issues/issue-15524.rs
deleted file mode 100644
index 565db2d0f..000000000
--- a/src/test/ui/issues/issue-15524.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-const N: isize = 1;
-
-enum Foo {
- //~^ ERROR discriminant value `1` assigned more than once
- //~| ERROR discriminant value `1` assigned more than once
- //~| ERROR discriminant value `1` assigned more than once
- A = 1,
- B = 1,
- C = 0,
- D,
-
- E = N,
-
-}
-
-fn main() {}
diff --git a/src/test/ui/issues/issue-15524.stderr b/src/test/ui/issues/issue-15524.stderr
deleted file mode 100644
index 1195e0a34..000000000
--- a/src/test/ui/issues/issue-15524.stderr
+++ /dev/null
@@ -1,40 +0,0 @@
-error[E0081]: discriminant value `1` assigned more than once
- --> $DIR/issue-15524.rs:3:1
- |
-LL | enum Foo {
- | ^^^^^^^^
-...
-LL | A = 1,
- | - first assignment of `1`
-LL | B = 1,
- | - second assignment of `1`
-
-error[E0081]: discriminant value `1` assigned more than once
- --> $DIR/issue-15524.rs:3:1
- |
-LL | enum Foo {
- | ^^^^^^^^
-...
-LL | A = 1,
- | - first assignment of `1`
-LL | B = 1,
-LL | C = 0,
- | ----- assigned discriminant for `D` was incremented from this discriminant
-LL | D,
- | - second assignment of `1`
-
-error[E0081]: discriminant value `1` assigned more than once
- --> $DIR/issue-15524.rs:3:1
- |
-LL | enum Foo {
- | ^^^^^^^^
-...
-LL | A = 1,
- | - first assignment of `1`
-...
-LL | E = N,
- | - second assignment of `1`
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0081`.
diff --git a/src/test/ui/issues/issue-15571.rs b/src/test/ui/issues/issue-15571.rs
index 5381d6523..5f228b286 100644
--- a/src/test/ui/issues/issue-15571.rs
+++ b/src/test/ui/issues/issue-15571.rs
@@ -1,8 +1,7 @@
// run-pass
-#![feature(box_syntax)]
fn match_on_local() {
- let mut foo: Option<Box<_>> = Some(box 5);
+ let mut foo: Option<Box<_>> = Some(Box::new(5));
match foo {
None => {},
Some(x) => {
@@ -37,7 +36,7 @@ fn match_on_binding() {
}
fn match_on_upvar() {
- let mut foo: Option<Box<_>> = Some(box 8);
+ let mut foo: Option<Box<_>> = Some(Box::new(8));
let f = move|| {
match foo {
None => {},
@@ -52,7 +51,7 @@ fn match_on_upvar() {
fn main() {
match_on_local();
- match_on_arg(Some(box 6));
+ match_on_arg(Some(Box::new(6)));
match_on_binding();
match_on_upvar();
}
diff --git a/src/test/ui/issues/issue-15763.rs b/src/test/ui/issues/issue-15763.rs
index 9ceffff2e..ae0863615 100644
--- a/src/test/ui/issues/issue-15763.rs
+++ b/src/test/ui/issues/issue-15763.rs
@@ -1,6 +1,5 @@
// run-pass
#![allow(unreachable_code)]
-#![feature(box_syntax)]
#[derive(PartialEq, Debug)]
struct Bar {
@@ -78,12 +77,12 @@ fn main() {
assert_eq!(cc().unwrap(), 3);
assert_eq!(dd().unwrap(), 3);
- let i = box 32isize as Box<dyn A>;
+ let i = Box::new(32isize) as Box<dyn A>;
assert_eq!(i.aaa(), 3);
- let i = box 32isize as Box<dyn A>;
+ let i = Box::new(32isize) as Box<dyn A>;
assert_eq!(i.bbb(), 3);
- let i = box 32isize as Box<dyn A>;
+ let i = Box::new(32isize) as Box<dyn A>;
assert_eq!(i.ccc().unwrap(), 3);
- let i = box 32isize as Box<dyn A>;
+ let i = Box::new(32isize) as Box<dyn A>;
assert_eq!(i.ddd().unwrap(), 3);
}
diff --git a/src/test/ui/issues/issue-16250.stderr b/src/test/ui/issues/issue-16250.stderr
index ae3b7f334..5eb5e0864 100644
--- a/src/test/ui/issues/issue-16250.stderr
+++ b/src/test/ui/issues/issue-16250.stderr
@@ -4,12 +4,6 @@ error: `extern` block uses type `Foo`, which is not FFI-safe
LL | pub fn foo(x: (Foo));
| ^^^ not FFI-safe
|
-note: the lint level is defined here
- --> $DIR/issue-16250.rs:1:9
- |
-LL | #![deny(warnings)]
- | ^^^^^^^^
- = note: `#[deny(improper_ctypes)]` implied by `#[deny(warnings)]`
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
@@ -17,6 +11,12 @@ note: the type is defined here
|
LL | pub struct Foo;
| ^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/issue-16250.rs:1:9
+ |
+LL | #![deny(warnings)]
+ | ^^^^^^^^
+ = note: `#[deny(improper_ctypes)]` implied by `#[deny(warnings)]`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-16256.stderr b/src/test/ui/issues/issue-16256.stderr
index 9c7312461..ca8e9a1be 100644
--- a/src/test/ui/issues/issue-16256.stderr
+++ b/src/test/ui/issues/issue-16256.stderr
@@ -4,8 +4,8 @@ warning: unused closure that must be used
LL | |c: u8| buf.push(c);
| ^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: closures are lazy and do nothing unless called
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/issues/issue-16538.mir.stderr b/src/test/ui/issues/issue-16538.mir.stderr
index 7dab7de76..e320df4b7 100644
--- a/src/test/ui/issues/issue-16538.mir.stderr
+++ b/src/test/ui/issues/issue-16538.mir.stderr
@@ -5,6 +5,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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[E0133]: use of extern static is unsafe and requires unsafe function or block
--> $DIR/issue-16538.rs:14:30
diff --git a/src/test/ui/issues/issue-16538.thir.stderr b/src/test/ui/issues/issue-16538.thir.stderr
index a18b0197d..4a8628692 100644
--- a/src/test/ui/issues/issue-16538.thir.stderr
+++ b/src/test/ui/issues/issue-16538.thir.stderr
@@ -21,6 +21,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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 3 previous errors
diff --git a/src/test/ui/issues/issue-16739.rs b/src/test/ui/issues/issue-16739.rs
index 94da2ca5c..b21ea4bcd 100644
--- a/src/test/ui/issues/issue-16739.rs
+++ b/src/test/ui/issues/issue-16739.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
#![feature(unboxed_closures, fn_traits)]
// Test that unboxing shim for calling rust-call ABI methods through a
@@ -35,12 +34,12 @@ impl FnOnce<(u32,u32)> for Foo {
}
fn main() {
- let mut f = box Foo { foo: 42 } as Box<dyn FnMut() -> u32>;
+ let mut f = Box::new(Foo { foo: 42 }) as Box<dyn FnMut() -> u32>;
assert_eq!(f.call_mut(()), 42);
- let mut f = box Foo { foo: 40 } as Box<dyn FnMut(u32) -> u32>;
+ let mut f = Box::new(Foo { foo: 40 }) as Box<dyn FnMut(u32) -> u32>;
assert_eq!(f.call_mut((2,)), 42);
- let mut f = box Foo { foo: 40 } as Box<dyn FnMut(u32, u32) -> u32>;
+ let mut f = Box::new(Foo { foo: 40 }) as Box<dyn FnMut(u32, u32) -> u32>;
assert_eq!(f.call_mut((1, 1)), 42);
}
diff --git a/src/test/ui/issues/issue-16774.rs b/src/test/ui/issues/issue-16774.rs
index 9e9b84034..2b308ef76 100644
--- a/src/test/ui/issues/issue-16774.rs
+++ b/src/test/ui/issues/issue-16774.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
#![feature(box_patterns)]
use std::ops::{Deref, DerefMut};
@@ -35,7 +34,7 @@ impl DerefMut for X {
fn main() {
{
- let mut test = X(box 5);
+ let mut test = X(Box::new(5));
{
let mut change = || { *test = 10 };
change();
diff --git a/src/test/ui/issues/issue-16939.stderr b/src/test/ui/issues/issue-16939.stderr
index aaa3c49b3..766456454 100644
--- a/src/test/ui/issues/issue-16939.stderr
+++ b/src/test/ui/issues/issue-16939.stderr
@@ -12,7 +12,7 @@ LL | fn _foo<F: Fn()> (f: F) {
help: remove the extra argument
|
LL | |t| f();
- | ~~~
+ | ~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17252.stderr b/src/test/ui/issues/issue-17252.stderr
index 3a629e1eb..4856418ed 100644
--- a/src/test/ui/issues/issue-17252.stderr
+++ b/src/test/ui/issues/issue-17252.stderr
@@ -2,7 +2,7 @@ error[E0391]: cycle detected when const-evaluating + checking `FOO`
--> $DIR/issue-17252.rs:1:1
|
LL | const FOO: usize = FOO;
- | ^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: ...which immediately requires const-evaluating + checking `FOO` again
note: cycle used when const-evaluating + checking `main::{constant#0}`
diff --git a/src/test/ui/issues/issue-17322.rs b/src/test/ui/issues/issue-17322.rs
index 20a8d1361..b4fc40c3f 100644
--- a/src/test/ui/issues/issue-17322.rs
+++ b/src/test/ui/issues/issue-17322.rs
@@ -1,8 +1,6 @@
// run-pass
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
use std::io::{self, Write};
fn f(wr: &mut dyn Write) {
@@ -10,6 +8,6 @@ fn f(wr: &mut dyn Write) {
}
fn main() {
- let mut wr = box io::stdout() as Box<dyn Write>;
+ let mut wr = Box::new(io::stdout()) as Box<dyn Write>;
f(&mut wr);
}
diff --git a/src/test/ui/issues/issue-17431-1.stderr b/src/test/ui/issues/issue-17431-1.stderr
index db32eb952..e3af8976c 100644
--- a/src/test/ui/issues/issue-17431-1.stderr
+++ b/src/test/ui/issues/issue-17431-1.stderr
@@ -2,14 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-17431-1.rs:1:1
|
LL | struct Foo { foo: Option<Option<Foo>> }
- | ^^^^^^^^^^ ------------------- recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^^^ --- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | struct Foo { foo: Option<Box<Option<Foo>>> }
- | ++++ +
+LL | struct Foo { foo: Option<Option<Box<Foo>>> }
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-2.rs b/src/test/ui/issues/issue-17431-2.rs
index 9ed97f631..f7b9c6a55 100644
--- a/src/test/ui/issues/issue-17431-2.rs
+++ b/src/test/ui/issues/issue-17431-2.rs
@@ -1,8 +1,7 @@
struct Baz { q: Option<Foo> }
-//~^ ERROR recursive type `Baz` has infinite size
+//~^ ERROR recursive types `Baz` and `Foo` have infinite size
struct Foo { q: Option<Baz> }
-//~^ ERROR recursive type `Foo` has infinite size
impl Foo { fn bar(&self) {} }
diff --git a/src/test/ui/issues/issue-17431-2.stderr b/src/test/ui/issues/issue-17431-2.stderr
index d23fd1474..39a99ec1e 100644
--- a/src/test/ui/issues/issue-17431-2.stderr
+++ b/src/test/ui/issues/issue-17431-2.stderr
@@ -1,29 +1,20 @@
-error[E0072]: recursive type `Baz` has infinite size
+error[E0072]: recursive types `Baz` and `Foo` have infinite size
--> $DIR/issue-17431-2.rs:1:1
|
LL | struct Baz { q: Option<Foo> }
- | ^^^^^^^^^^ ----------- recursive without indirection
- | |
- | recursive type has infinite size
- |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Baz` representable
- |
-LL | struct Baz { q: Option<Box<Foo>> }
- | ++++ +
-
-error[E0072]: recursive type `Foo` has infinite size
- --> $DIR/issue-17431-2.rs:4:1
- |
+ | ^^^^^^^^^^ --- recursive without indirection
+...
LL | struct Foo { q: Option<Baz> }
- | ^^^^^^^^^^ ----------- recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^^^ --- recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+LL ~ struct Baz { q: Option<Box<Foo>> }
+LL |
+LL |
+LL ~ struct Foo { q: Option<Box<Baz>> }
|
-LL | struct Foo { q: Option<Box<Baz>> }
- | ++++ +
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/issues/issue-17431-3.stderr b/src/test/ui/issues/issue-17431-3.stderr
index 0dde6f382..394134c78 100644
--- a/src/test/ui/issues/issue-17431-3.stderr
+++ b/src/test/ui/issues/issue-17431-3.stderr
@@ -2,14 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-17431-3.rs:3:1
|
LL | struct Foo { foo: Mutex<Option<Foo>> }
- | ^^^^^^^^^^ ------------------ recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^^^ --- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | struct Foo { foo: Box<Mutex<Option<Foo>>> }
- | ++++ +
+LL | struct Foo { foo: Mutex<Option<Box<Foo>>> }
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-4.stderr b/src/test/ui/issues/issue-17431-4.stderr
index ddf669b8f..3d141e44b 100644
--- a/src/test/ui/issues/issue-17431-4.stderr
+++ b/src/test/ui/issues/issue-17431-4.stderr
@@ -2,14 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-17431-4.rs:3:1
|
LL | struct Foo<T> { foo: Option<Option<Foo<T>>>, marker: marker::PhantomData<T> }
- | ^^^^^^^^^^^^^ ---------------------- recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^^^^^^ ------ recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | struct Foo<T> { foo: Option<Box<Option<Foo<T>>>>, marker: marker::PhantomData<T> }
- | ++++ +
+LL | struct Foo<T> { foo: Option<Option<Box<Foo<T>>>>, marker: marker::PhantomData<T> }
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-5.stderr b/src/test/ui/issues/issue-17431-5.stderr
index a379598c2..44a90a6fe 100644
--- a/src/test/ui/issues/issue-17431-5.stderr
+++ b/src/test/ui/issues/issue-17431-5.stderr
@@ -3,10 +3,8 @@ error[E0072]: recursive type `Bar` has infinite size
|
LL | struct Bar<T> { x: Bar<Foo> , marker: marker::PhantomData<T> }
| ^^^^^^^^^^^^^ -------- recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | struct Bar<T> { x: Box<Bar<Foo>> , marker: marker::PhantomData<T> }
| ++++ +
diff --git a/src/test/ui/issues/issue-17431-6.stderr b/src/test/ui/issues/issue-17431-6.stderr
index fcac420b2..e0a822550 100644
--- a/src/test/ui/issues/issue-17431-6.stderr
+++ b/src/test/ui/issues/issue-17431-6.stderr
@@ -2,14 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-17431-6.rs:3:1
|
LL | enum Foo { X(Mutex<Option<Foo>>) }
- | ^^^^^^^^ ------------------ recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^ --- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | enum Foo { X(Box<Mutex<Option<Foo>>>) }
- | ++++ +
+LL | enum Foo { X(Mutex<Option<Box<Foo>>>) }
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-17431-7.stderr b/src/test/ui/issues/issue-17431-7.stderr
index 6f8a7e386..ecf072b8e 100644
--- a/src/test/ui/issues/issue-17431-7.stderr
+++ b/src/test/ui/issues/issue-17431-7.stderr
@@ -2,14 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-17431-7.rs:1:1
|
LL | enum Foo { Voo(Option<Option<Foo>>) }
- | ^^^^^^^^ ------------------- recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^ --- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | enum Foo { Voo(Option<Box<Option<Foo>>>) }
- | ++++ +
+LL | enum Foo { Voo(Option<Option<Box<Foo>>>) }
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-18611.stderr b/src/test/ui/issues/issue-18611.stderr
index bd18d4622..22c3470b6 100644
--- a/src/test/ui/issues/issue-18611.stderr
+++ b/src/test/ui/issues/issue-18611.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `isize: HasState` is not satisfied
- --> $DIR/issue-18611.rs:1:18
+ --> $DIR/issue-18611.rs:1:1
|
-LL | fn add_state(op: <isize as HasState>::State) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize`
+LL | / fn add_state(op: <isize as HasState>::State) {
+LL | |
+LL | | }
+ | |_^ the trait `HasState` is not implemented for `isize`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-18819.stderr b/src/test/ui/issues/issue-18819.stderr
index 6499dd0d8..767fdd5ca 100644
--- a/src/test/ui/issues/issue-18819.stderr
+++ b/src/test/ui/issues/issue-18819.stderr
@@ -2,11 +2,13 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/issue-18819.rs:16:5
|
LL | print_x(X);
- | ^^^^^^^---
- | ||
- | |expected reference, found struct `X`
- | an argument of type `&str` is missing
+ | ^^^^^^^--- an argument of type `&str` is missing
|
+note: expected reference, found struct `X`
+ --> $DIR/issue-18819.rs:16:13
+ |
+LL | print_x(X);
+ | ^
= note: expected reference `&dyn Foo<Item = bool>`
found struct `X`
note: function defined here
@@ -21,7 +23,7 @@ LL | print_x(&X);
help: provide the argument
|
LL | print_x(/* &dyn Foo<Item = bool> */, /* &str */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-18919.stderr b/src/test/ui/issues/issue-18919.stderr
index d7dbb8299..b0b03a0ee 100644
--- a/src/test/ui/issues/issue-18919.stderr
+++ b/src/test/ui/issues/issue-18919.stderr
@@ -1,10 +1,10 @@
-error[E0277]: the size for values of type `dyn for<'r> Fn(&'r isize) -> isize` cannot be known at compilation time
+error[E0277]: the size for values of type `dyn for<'a> Fn(&'a isize) -> isize` cannot be known at compilation time
--> $DIR/issue-18919.rs:3:15
|
LL | fn ho_func(f: Option<FuncType>) {
| ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
- = help: the trait `Sized` is not implemented for `dyn for<'r> Fn(&'r isize) -> isize`
+ = help: the trait `Sized` is not implemented for `dyn for<'a> Fn(&'a isize) -> isize`
note: required by a bound in `Option`
--> $DIR/issue-18919.rs:7:13
|
diff --git a/src/test/ui/issues/issue-19991.rs b/src/test/ui/issues/issue-19991.rs
index 1f3b73f96..dd0efa972 100644
--- a/src/test/ui/issues/issue-19991.rs
+++ b/src/test/ui/issues/issue-19991.rs
@@ -3,7 +3,7 @@
fn main() {
if let Some(homura) = Some("madoka") { //~ ERROR missing an `else` clause
- //~| expected `()`, found integer
+ //~| expected integer, found `()`
765
};
}
diff --git a/src/test/ui/issues/issue-19991.stderr b/src/test/ui/issues/issue-19991.stderr
index 6e92be87a..57b0882b6 100644
--- a/src/test/ui/issues/issue-19991.stderr
+++ b/src/test/ui/issues/issue-19991.stderr
@@ -6,7 +6,7 @@ LL | |
LL | | 765
| | --- found here
LL | | };
- | |_____^ expected `()`, found integer
+ | |_____^ expected integer, found `()`
|
= note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type
diff --git a/src/test/ui/issues/issue-20162.stderr b/src/test/ui/issues/issue-20162.stderr
index d70bf6e1d..3f9b3be98 100644
--- a/src/test/ui/issues/issue-20162.stderr
+++ b/src/test/ui/issues/issue-20162.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `X: Ord` is not satisfied
- --> $DIR/issue-20162.rs:5:7
+ --> $DIR/issue-20162.rs:5:5
|
LL | b.sort();
- | ^^^^ the trait `Ord` is not implemented for `X`
+ | ^ ---- required by a bound introduced by this call
+ | |
+ | the trait `Ord` is not implemented for `X`
|
note: required by a bound in `slice::<impl [T]>::sort`
--> $SRC_DIR/alloc/src/slice.rs:LL:COL
diff --git a/src/test/ui/issues/issue-20413.stderr b/src/test/ui/issues/issue-20413.stderr
index ea493c58a..2db60b641 100644
--- a/src/test/ui/issues/issue-20413.stderr
+++ b/src/test/ui/issues/issue-20413.stderr
@@ -14,13 +14,13 @@ LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_20413`)
-note: required because of the requirements on the impl of `Foo` for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+note: required for `NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<NoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Foo`
--> $DIR/issue-20413.rs:8:9
|
LL | impl<T> Foo for T where NoData<T>: Foo {
| ^^^ ^
= note: 127 redundant requirements hidden
- = note: required because of the requirements on the impl of `Foo` for `NoData<T>`
+ = note: required for `NoData<T>` to implement `Foo`
error[E0275]: overflow evaluating the requirement `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Baz`
--> $DIR/issue-20413.rs:27:42
@@ -29,18 +29,18 @@ 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 because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Bar`
--> $DIR/issue-20413.rs:27:9
|
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^ ^
-note: required because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Baz`
--> $DIR/issue-20413.rs:34:9
|
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^ ^
= note: 126 redundant requirements hidden
- = note: required because of the requirements on the impl of `Baz` for `EvenLessData<T>`
+ = note: required for `EvenLessData<T>` to implement `Baz`
error[E0275]: overflow evaluating the requirement `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>: Bar`
--> $DIR/issue-20413.rs:34:42
@@ -49,18 +49,18 @@ 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 because of the requirements on the impl of `Baz` for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+note: required for `EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Baz`
--> $DIR/issue-20413.rs:34:9
|
LL | impl<T> Baz for T where AlmostNoData<T>: Bar {
| ^^^ ^
-note: required because of the requirements on the impl of `Bar` for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+note: required for `AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<EvenLessData<AlmostNoData<T>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Bar`
--> $DIR/issue-20413.rs:27:9
|
LL | impl<T> Bar for T where EvenLessData<T>: Baz {
| ^^^ ^
= note: 126 redundant requirements hidden
- = note: required because of the requirements on the impl of `Bar` for `AlmostNoData<T>`
+ = note: required for `AlmostNoData<T>` to implement `Bar`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/issues/issue-20605.stderr b/src/test/ui/issues/issue-20605.stderr
index 41eefe3f8..e1858b639 100644
--- a/src/test/ui/issues/issue-20605.stderr
+++ b/src/test/ui/issues/issue-20605.stderr
@@ -2,10 +2,10 @@ error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cann
--> $DIR/issue-20605.rs:2:17
|
LL | for item in *things { *item = 0 }
- | ^^^^^^^ expected an implementor of trait `IntoIterator`
+ | ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
|
= note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
- = note: required because of the requirements on the impl of `IntoIterator` for `dyn Iterator<Item = &'a mut u8>`
+ = note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator`
help: consider mutably borrowing here
|
LL | for item in &mut *things { *item = 0 }
diff --git a/src/test/ui/issues/issue-20831-debruijn.stderr b/src/test/ui/issues/issue-20831-debruijn.stderr
index 57f9575bd..ef62dece8 100644
--- a/src/test/ui/issues/issue-20831-debruijn.stderr
+++ b/src/test/ui/issues/issue-20831-debruijn.stderr
@@ -1,8 +1,14 @@
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
- --> $DIR/issue-20831-debruijn.rs:28:8
+ --> $DIR/issue-20831-debruijn.rs:28:5
|
-LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
- | ^^^^^^^^^
+LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
+LL | | // Not obvious, but there is an implicit lifetime here -------^
+LL | |
+LL | | //
+... |
+LL | | self.sub = t;
+LL | | }
+ | |_____^
|
note: first, the lifetime cannot outlive the anonymous lifetime defined here...
--> $DIR/issue-20831-debruijn.rs:28:58
@@ -15,10 +21,16 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined he
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
| ^^
note: ...so that the types are compatible
- --> $DIR/issue-20831-debruijn.rs:28:8
+ --> $DIR/issue-20831-debruijn.rs:28:5
|
-LL | fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
- | ^^^^^^^^^
+LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
+LL | | // Not obvious, but there is an implicit lifetime here -------^
+LL | |
+LL | | //
+... |
+LL | | self.sub = t;
+LL | | }
+ | |_____^
= note: expected `<MyStruct<'a> as Publisher<'_>>`
found `<MyStruct<'_> as Publisher<'_>>`
diff --git a/src/test/ui/issues/issue-21033.rs b/src/test/ui/issues/issue-21033.rs
index 86cc7707e..91f72eb36 100644
--- a/src/test/ui/issues/issue-21033.rs
+++ b/src/test/ui/issues/issue-21033.rs
@@ -4,7 +4,6 @@
// pretty-expanded FIXME #23616
#![feature(box_patterns)]
-#![feature(box_syntax)]
enum E {
StructVar { boxed: Box<i32> }
@@ -13,7 +12,7 @@ enum E {
fn main() {
// Test matching each shorthand notation for field patterns.
- let mut a = E::StructVar { boxed: box 3 };
+ let mut a = E::StructVar { boxed: Box::new(3) };
match a {
E::StructVar { box boxed } => { }
}
@@ -38,7 +37,7 @@ fn main() {
// Test matching non shorthand notation. Recreate a since last test
// moved `boxed`
- let mut a = E::StructVar { boxed: box 3 };
+ let mut a = E::StructVar { boxed: Box::new(3) };
match a {
E::StructVar { boxed: box ref mut num } => { }
}
diff --git a/src/test/ui/issues/issue-21174.stderr b/src/test/ui/issues/issue-21174.stderr
index 09402c3d8..5981d9dc7 100644
--- a/src/test/ui/issues/issue-21174.stderr
+++ b/src/test/ui/issues/issue-21174.stderr
@@ -4,8 +4,8 @@ error[E0512]: cannot transmute between types of different sizes, or dependently-
LL | let new: T::B = unsafe { std::mem::transmute(value) };
| ^^^^^^^^^^^^^^^^^^^
|
- = note: source type: `<T as Trait>::A` (this type does not have a fixed size)
- = note: target type: `<T as Trait>::B` (this type does not have a fixed size)
+ = note: source type: `<T as Trait<'_>>::A` (this type does not have a fixed size)
+ = note: target type: `<T as Trait<'_>>::B` (this type does not have a fixed size)
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-21763.stderr b/src/test/ui/issues/issue-21763.stderr
index b8b38c0a7..72c650297 100644
--- a/src/test/ui/issues/issue-21763.stderr
+++ b/src/test/ui/issues/issue-21763.stderr
@@ -1,12 +1,12 @@
error[E0277]: `Rc<()>` cannot be sent between threads safely
- --> $DIR/issue-21763.rs:9:5
+ --> $DIR/issue-21763.rs:9:11
|
LL | foo::<HashMap<Rc<()>, Rc<()>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
+ | ^^^^^^^^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
|
= help: within `(Rc<()>, Rc<()>)`, the trait `Send` is not implemented for `Rc<()>`
= note: required because it appears within the type `(Rc<()>, Rc<()>)`
- = note: required because of the requirements on the impl of `Send` for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>`
+ = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
= note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
= note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
note: required by a bound in `foo`
diff --git a/src/test/ui/issues/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr
index 4909398bb..731615a6b 100644
--- a/src/test/ui/issues/issue-21950.stderr
+++ b/src/test/ui/issues/issue-21950.stderr
@@ -1,3 +1,12 @@
+error[E0191]: the value of the associated type `Output` (from trait `Add`) must be specified
+ --> $DIR/issue-21950.rs:10:25
+ |
+LL | type Output;
+ | ----------- `Output` defined here
+...
+LL | let x = &10 as &dyn Add;
+ | ^^^ help: specify the associated type: `Add<Output = Type>`
+
error[E0393]: the type parameter `Rhs` must be explicitly specified
--> $DIR/issue-21950.rs:10:25
|
@@ -9,15 +18,6 @@ LL | let x = &10 as &dyn Add;
|
= note: because of the default `Self` reference, type parameters must be specified on object types
-error[E0191]: the value of the associated type `Output` (from trait `Add`) must be specified
- --> $DIR/issue-21950.rs:10:25
- |
-LL | type Output;
- | ----------- `Output` defined here
-...
-LL | let x = &10 as &dyn Add;
- | ^^^ help: specify the associated type: `Add<Output = Type>`
-
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0191, E0393.
diff --git a/src/test/ui/issues/issue-22644.rs b/src/test/ui/issues/issue-22644.rs
index 9244ff593..b1d69dcd8 100644
--- a/src/test/ui/issues/issue-22644.rs
+++ b/src/test/ui/issues/issue-22644.rs
@@ -29,7 +29,7 @@ fn main() {
< //~ ERROR `<` is interpreted as a start of generic
5);
- println!("{}", a as usize << long_name); //~ ERROR `<` is interpreted as a start of generic
+ println!("{}", a as usize << long_name); //~ ERROR `<<` is interpreted as a start of generic
println!("{}", a: &mut 4); //~ ERROR expected type, found `4`
}
diff --git a/src/test/ui/issues/issue-22644.stderr b/src/test/ui/issues/issue-22644.stderr
index 039ffbfd3..45027afa7 100644
--- a/src/test/ui/issues/issue-22644.stderr
+++ b/src/test/ui/issues/issue-22644.stderr
@@ -95,7 +95,7 @@ LL |
LL ~ usize)
|
-error: `<` is interpreted as a start of generic arguments for `usize`, not a shift
+error: `<<` is interpreted as a start of generic arguments for `usize`, not a shift
--> $DIR/issue-22644.rs:32:31
|
LL | println!("{}", a as usize << long_name);
diff --git a/src/test/ui/issues/issue-22872.stderr b/src/test/ui/issues/issue-22872.stderr
index a84cb7d8c..7382d40c0 100644
--- a/src/test/ui/issues/issue-22872.stderr
+++ b/src/test/ui/issues/issue-22872.stderr
@@ -5,7 +5,7 @@ LL | let _: Box<dyn for<'b> Wrap<'b>> = Box::new(Wrapper(process));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `<P as Process<'_>>::Item` is not an iterator
|
= help: the trait `Iterator` is not implemented for `<P as Process<'_>>::Item`
-note: required because of the requirements on the impl of `for<'b> Wrap<'b>` for `Wrapper<P>`
+note: required for `Wrapper<P>` to implement `for<'b> Wrap<'b>`
--> $DIR/issue-22872.rs:7:13
|
LL | impl<'b, P> Wrap<'b> for Wrapper<P>
diff --git a/src/test/ui/issues/issue-2288.rs b/src/test/ui/issues/issue-2288.rs
index c74e53fca..6fd690a4d 100644
--- a/src/test/ui/issues/issue-2288.rs
+++ b/src/test/ui/issues/issue-2288.rs
@@ -1,8 +1,6 @@
// run-pass
#![allow(non_camel_case_types)]
-#![feature(box_syntax)]
-
trait clam<A> {
fn chowder(&self, y: A);
}
@@ -30,6 +28,6 @@ fn f<A>(x: Box<dyn clam<A>>, a: A) {
pub fn main() {
let c = foo(42);
- let d: Box<dyn clam<isize>> = box c as Box<dyn clam<isize>>;
+ let d: Box<dyn clam<isize>> = Box::new(c) as Box<dyn clam<isize>>;
f(d, c.x);
}
diff --git a/src/test/ui/issues/issue-23024.rs b/src/test/ui/issues/issue-23024.rs
index e92273bd4..010281ee3 100644
--- a/src/test/ui/issues/issue-23024.rs
+++ b/src/test/ui/issues/issue-23024.rs
@@ -1,11 +1,10 @@
-#![feature(box_syntax)]
use std::any::Any;
fn main()
{
fn h(x:i32) -> i32 {3*x}
let mut vfnfer:Vec<Box<dyn Any>> = vec![];
- vfnfer.push(box h);
+ vfnfer.push(Box::new(h));
println!("{:?}",(vfnfer[0] as dyn Fn)(3));
//~^ ERROR the precise format of `Fn`-family traits'
//~| ERROR missing generics for trait `Fn`
diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr
index 7a4d90b44..73f93c51d 100644
--- a/src/test/ui/issues/issue-23024.stderr
+++ b/src/test/ui/issues/issue-23024.stderr
@@ -1,5 +1,5 @@
error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change
- --> $DIR/issue-23024.rs:9:39
+ --> $DIR/issue-23024.rs:8:39
|
LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3));
| ^^ help: use parenthetical notation instead: `Fn() -> ()`
@@ -8,7 +8,7 @@ LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3));
= help: add `#![feature(unboxed_closures)]` to the crate attributes to enable
error[E0107]: missing generics for trait `Fn`
- --> $DIR/issue-23024.rs:9:39
+ --> $DIR/issue-23024.rs:8:39
|
LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3));
| ^^ expected 1 generic argument
@@ -24,7 +24,7 @@ LL | println!("{:?}",(vfnfer[0] as dyn Fn<Args>)(3));
| ~~~~~~~~
error[E0191]: the value of the associated type `Output` (from trait `FnOnce`) must be specified
- --> $DIR/issue-23024.rs:9:39
+ --> $DIR/issue-23024.rs:8:39
|
LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3));
| ^^ help: specify the associated type: `Fn<Output = Type>`
diff --git a/src/test/ui/issues/issue-23122-2.rs b/src/test/ui/issues/issue-23122-2.rs
index 95e1f60d8..338789c2e 100644
--- a/src/test/ui/issues/issue-23122-2.rs
+++ b/src/test/ui/issues/issue-23122-2.rs
@@ -1,3 +1,4 @@
+// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
trait Next {
type Next: Next;
}
diff --git a/src/test/ui/issues/issue-23122-2.stderr b/src/test/ui/issues/issue-23122-2.stderr
index 7519e632d..0111cf569 100644
--- a/src/test/ui/issues/issue-23122-2.stderr
+++ b/src/test/ui/issues/issue-23122-2.stderr
@@ -1,12 +1,12 @@
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized`
- --> $DIR/issue-23122-2.rs:10:17
+ --> $DIR/issue-23122-2.rs:11:17
|
LL | type Next = <GetNext<T::Next> as Next>::Next;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_23122_2`)
-note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>`
- --> $DIR/issue-23122-2.rs:9:15
+note: required for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>` to implement `Next`
+ --> $DIR/issue-23122-2.rs:10:15
|
LL | impl<T: Next> Next for GetNext<T> {
| ^^^^ ^^^^^^^^^^
diff --git a/src/test/ui/issues/issue-23302-3.stderr b/src/test/ui/issues/issue-23302-3.stderr
index dcb99605d..074939f68 100644
--- a/src/test/ui/issues/issue-23302-3.stderr
+++ b/src/test/ui/issues/issue-23302-3.stderr
@@ -2,13 +2,13 @@ error[E0391]: cycle detected when const-evaluating + checking `A`
--> $DIR/issue-23302-3.rs:1:1
|
LL | const A: i32 = B;
- | ^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `B`...
--> $DIR/issue-23302-3.rs:3:1
|
LL | const B: i32 = A;
- | ^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^
= note: ...which again requires const-evaluating + checking `A`, completing the cycle
note: cycle used when simplifying constant for the type system `A`
--> $DIR/issue-23302-3.rs:1:1
diff --git a/src/test/ui/issues/issue-23491.rs b/src/test/ui/issues/issue-23491.rs
index 1cb969731..e5f9dd3ef 100644
--- a/src/test/ui/issues/issue-23491.rs
+++ b/src/test/ui/issues/issue-23491.rs
@@ -1,9 +1,8 @@
// run-pass
#![allow(unused_variables)]
-#![feature(box_syntax)]
struct Node<T: ?Sized>(#[allow(unused_tuple_struct_fields)] T);
fn main() {
- let x: Box<Node<[isize]>> = box Node([]);
+ let x: Box<Node<[isize]>> = Box::new(Node([]));
}
diff --git a/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs b/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs
index 403cf970b..cdb130d60 100644
--- a/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs
+++ b/src/test/ui/issues/issue-23611-enum-swap-in-drop.rs
@@ -97,7 +97,7 @@ pub fn main() {
// ever hands f_A off to instances of GaspA, and thus one should
// be able to prove the invariant that f_A is *only* invoked from
// from an instance of GaspA (either via the GaspA drop
- // implementation or the E drop implementaton). Yet the old (bad)
+ // implementation or the E drop implementation). Yet the old (bad)
// behavior allowed a call to f_A to leak in while we are tearing
// down a value of type GaspB.
}
diff --git a/src/test/ui/issues/issue-24013.stderr b/src/test/ui/issues/issue-24013.stderr
index 995dce552..72102f460 100644
--- a/src/test/ui/issues/issue-24013.stderr
+++ b/src/test/ui/issues/issue-24013.stderr
@@ -3,11 +3,6 @@ error[E0282]: type annotations needed
|
LL | unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
| ^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `swap`
- |
-help: consider specifying the generic argument
- |
-LL | unsafe {swap::<&mut _>(transmute(&a), transmute(&b))};
- | ~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-24322.stderr b/src/test/ui/issues/issue-24322.stderr
index 1a4fab165..1e4c8ac7c 100644
--- a/src/test/ui/issues/issue-24322.stderr
+++ b/src/test/ui/issues/issue-24322.stderr
@@ -6,8 +6,8 @@ LL | let x: &fn(&B) -> u32 = &B::func;
| |
| expected due to this
|
- = note: expected reference `&for<'r> fn(&'r B) -> u32`
- found reference `&for<'r> fn(&'r B) -> u32 {B::func}`
+ = note: expected reference `&for<'a> fn(&'a B) -> u32`
+ found reference `&for<'a> fn(&'a B) -> u32 {B::func}`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-25901.rs b/src/test/ui/issues/issue-25901.rs
index ba12e1ad0..1f7b341a9 100644
--- a/src/test/ui/issues/issue-25901.rs
+++ b/src/test/ui/issues/issue-25901.rs
@@ -2,7 +2,7 @@ struct A;
struct B;
static S: &'static B = &A;
-//~^ ERROR cannot perform deref coercion on `A` in statics
+//~^ ERROR the trait bound
use std::ops::Deref;
diff --git a/src/test/ui/issues/issue-25901.stderr b/src/test/ui/issues/issue-25901.stderr
index e933745c4..b9cac3222 100644
--- a/src/test/ui/issues/issue-25901.stderr
+++ b/src/test/ui/issues/issue-25901.stderr
@@ -1,22 +1,15 @@
-error[E0015]: cannot perform deref coercion on `A` in statics
+error[E0277]: the trait bound `A: Deref` is not satisfied
--> $DIR/issue-25901.rs:4:24
|
LL | static S: &'static B = &A;
- | ^^
- |
- = note: attempting to deref into `B`
-note: deref defined here
- --> $DIR/issue-25901.rs:10:5
+ | ^^ the trait `~const Deref` is not implemented for `A`
|
-LL | type Target = B;
- | ^^^^^^^^^^^
-note: impl defined here, but it is not `const`
- --> $DIR/issue-25901.rs:9:1
+note: the trait `Deref` is implemented for `A`, but that implementation is not `const`
+ --> $DIR/issue-25901.rs:4:24
|
-LL | impl Deref for A {
- | ^^^^^^^^^^^^^^^^
- = note: calls in statics are limited to constant functions, tuple structs and tuple variants
+LL | static S: &'static B = &A;
+ | ^^
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/issues/issue-26217.stderr b/src/test/ui/issues/issue-26217.stderr
index c7601caac..73c772205 100644
--- a/src/test/ui/issues/issue-26217.stderr
+++ b/src/test/ui/issues/issue-26217.stderr
@@ -5,6 +5,12 @@ LL | fn bar<'a>() {
| -- lifetime `'a` defined here
LL | foo::<&'a i32>();
| ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/issue-26217.rs:1:30
+ |
+LL | fn foo<T>() where for<'a> T: 'a {}
+ | ^^
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-2708.rs b/src/test/ui/issues/issue-2708.rs
index abd5e9507..4e53b9d14 100644
--- a/src/test/ui/issues/issue-2708.rs
+++ b/src/test/ui/issues/issue-2708.rs
@@ -4,7 +4,7 @@
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
+
struct Font {
fontbuf: usize,
@@ -26,5 +26,5 @@ fn Font() -> Font {
}
pub fn main() {
- let _f: Box<_> = box Font();
+ let _f: Box<_> = Box::new(Font());
}
diff --git a/src/test/ui/issues/issue-2734.rs b/src/test/ui/issues/issue-2734.rs
index d449f6449..df4f394dc 100644
--- a/src/test/ui/issues/issue-2734.rs
+++ b/src/test/ui/issues/issue-2734.rs
@@ -4,21 +4,19 @@
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
trait hax {
fn dummy(&self) { }
}
impl<A> hax for A { }
fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> {
- box x as Box<dyn hax+'static>
+ Box::new(x) as Box<dyn hax+'static>
}
fn deadcode() {
- perform_hax(box "deadcode".to_string());
+ perform_hax(Box::new("deadcode".to_string()));
}
pub fn main() {
- let _ = perform_hax(box 42);
+ let _ = perform_hax(Box::new(42));
}
diff --git a/src/test/ui/issues/issue-2735.rs b/src/test/ui/issues/issue-2735.rs
index 794c7d4ed..20d3949a9 100644
--- a/src/test/ui/issues/issue-2735.rs
+++ b/src/test/ui/issues/issue-2735.rs
@@ -4,21 +4,19 @@
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
trait hax {
fn dummy(&self) { }
}
impl<A> hax for A { }
fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> {
- box x as Box<dyn hax+'static>
+ Box::new(x) as Box<dyn hax+'static>
}
fn deadcode() {
- perform_hax(box "deadcode".to_string());
+ perform_hax(Box::new("deadcode".to_string()));
}
pub fn main() {
- perform_hax(box 42);
+ perform_hax(Box::new(42));
}
diff --git a/src/test/ui/issues/issue-28344.stderr b/src/test/ui/issues/issue-28344.stderr
index b1d1c01b2..f398a5da3 100644
--- a/src/test/ui/issues/issue-28344.stderr
+++ b/src/test/ui/issues/issue-28344.stderr
@@ -4,9 +4,9 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
| ^^^^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
LL | let x: u8 = <dyn BitXor>::bitor(0 as u8, 0 as u8);
@@ -25,7 +25,7 @@ LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
| ^^^^^
| |
| function or associated item not found in `dyn BitXor<_>`
- | help: there is an associated function with a similar name: `bitxor`
+ | help: there is a method with a similar name: `bitxor`
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-28344.rs:10:13
@@ -53,7 +53,7 @@ LL | let g = BitXor::bitor;
| ^^^^^
| |
| function or associated item not found in `dyn BitXor<_>`
- | help: there is an associated function with a similar name: `bitxor`
+ | help: there is a method with a similar name: `bitxor`
error: aborting due to 4 previous errors; 2 warnings emitted
diff --git a/src/test/ui/issues/issue-2935.rs b/src/test/ui/issues/issue-2935.rs
index 11641ca73..37f818199 100644
--- a/src/test/ui/issues/issue-2935.rs
+++ b/src/test/ui/issues/issue-2935.rs
@@ -1,7 +1,6 @@
// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
-#![feature(box_syntax)]
//type t = { a: isize };
// type t = { a: bool };
@@ -20,7 +19,7 @@ pub fn main() {
// let y = box ({a: 4});
// let z = box ({a: 4} as it);
// let z = box ({a: true} as it);
- let z: Box<_> = box (box true as Box<dyn it>);
+ let z: Box<_> = Box::new(Box::new(true) as Box<dyn it>);
// x.f();
// y.f();
// (*z).f();
diff --git a/src/test/ui/issues/issue-29746.rs b/src/test/ui/issues/issue-29746.rs
index 428cc637f..3470a7e09 100644
--- a/src/test/ui/issues/issue-29746.rs
+++ b/src/test/ui/issues/issue-29746.rs
@@ -7,7 +7,7 @@ macro_rules! zip {
zip!([$($rest),*], $a.zip($b), (x,y), [x,y])
};
- // Intermediate steps to build the zipped expression, the match pattern, and
+ // Intermediate steps to build the zipped expression, the match pattern
// and the output tuple of the closure, using macro hygiene to repeatedly
// introduce new variables named 'x'.
([$a:expr, $($rest:expr),*], $zip:expr, $pat:pat, [$($flat:expr),*]) => {
diff --git a/src/test/ui/issues/issue-29948.rs b/src/test/ui/issues/issue-29948.rs
index 01c3ec648..3ed701480 100644
--- a/src/test/ui/issues/issue-29948.rs
+++ b/src/test/ui/issues/issue-29948.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
use std::panic;
diff --git a/src/test/ui/issues/issue-3008-1.stderr b/src/test/ui/issues/issue-3008-1.stderr
index e49d8e6aa..be25b9091 100644
--- a/src/test/ui/issues/issue-3008-1.stderr
+++ b/src/test/ui/issues/issue-3008-1.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `Bar` has infinite size
--> $DIR/issue-3008-1.rs:5:1
|
LL | enum Bar {
- | ^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^
...
LL | BarSome(Bar)
| --- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | BarSome(Box<Bar>)
| ++++ +
diff --git a/src/test/ui/issues/issue-3008-2.stderr b/src/test/ui/issues/issue-3008-2.stderr
index b3ce6e420..858a8fd6a 100644
--- a/src/test/ui/issues/issue-3008-2.stderr
+++ b/src/test/ui/issues/issue-3008-2.stderr
@@ -3,10 +3,8 @@ error[E0072]: recursive type `Bar` has infinite size
|
LL | struct Bar { x: Bar }
| ^^^^^^^^^^ --- recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | struct Bar { x: Box<Bar> }
| ++++ +
diff --git a/src/test/ui/issues/issue-3008-3.stderr b/src/test/ui/issues/issue-3008-3.stderr
index c1c043e21..a1a81e293 100644
--- a/src/test/ui/issues/issue-3008-3.stderr
+++ b/src/test/ui/issues/issue-3008-3.stderr
@@ -3,10 +3,8 @@ error[E0072]: recursive type `E2` has infinite size
|
LL | enum E2<T> { V2(E2<E1>, marker::PhantomData<T>), }
| ^^^^^^^^^^ ------ recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `E2` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | enum E2<T> { V2(Box<E2<E1>>, marker::PhantomData<T>), }
| ++++ +
diff --git a/src/test/ui/issues/issue-3026.rs b/src/test/ui/issues/issue-3026.rs
index 1dea8134f..4619a3fe7 100644
--- a/src/test/ui/issues/issue-3026.rs
+++ b/src/test/ui/issues/issue-3026.rs
@@ -1,13 +1,11 @@
// run-pass
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
use std::collections::HashMap;
pub fn main() {
let x: Box<_>;
let mut buggy_map: HashMap<usize, &usize> = HashMap::new();
- x = box 1;
+ x = Box::new(1);
buggy_map.insert(42, &*x);
}
diff --git a/src/test/ui/issues/issue-30371.rs b/src/test/ui/issues/issue-30371.rs
index a1ae9a36b..eea548c48 100644
--- a/src/test/ui/issues/issue-30371.rs
+++ b/src/test/ui/issues/issue-30371.rs
@@ -1,5 +1,6 @@
// run-pass
#![allow(unreachable_code)]
+#![allow(for_loops_over_fallibles)]
#![deny(unused_variables)]
fn main() {
diff --git a/src/test/ui/issues/issue-30490.rs b/src/test/ui/issues/issue-30490.rs
index 47c17e362..68d9c4de4 100644
--- a/src/test/ui/issues/issue-30490.rs
+++ b/src/test/ui/issues/issue-30490.rs
@@ -1,6 +1,7 @@
// run-pass
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia Child I/O swaps not privileged
// Previously libstd would set stdio descriptors of a child process
// by `dup`ing the requested descriptors to inherit directly into the
diff --git a/src/test/ui/issues/issue-31173.rs b/src/test/ui/issues/issue-31173.rs
index 48061ae54..04efa2718 100644
--- a/src/test/ui/issues/issue-31173.rs
+++ b/src/test/ui/issues/issue-31173.rs
@@ -3,12 +3,13 @@ use std::vec::IntoIter;
pub fn get_tok(it: &mut IntoIter<u8>) {
let mut found_e = false;
- let temp: Vec<u8> = it.take_while(|&x| {
- found_e = true;
- false
- })
+ let temp: Vec<u8> = it
+ //~^ ERROR to be an iterator that yields `&_`, but it yields `u8`
+ .take_while(|&x| {
+ found_e = true;
+ false
+ })
.cloned()
- //~^ ERROR type mismatch resolving
.collect(); //~ ERROR the method
}
diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr
index 68337a715..e3334eef3 100644
--- a/src/test/ui/issues/issue-31173.stderr
+++ b/src/test/ui/issues/issue-31173.stderr
@@ -1,8 +1,16 @@
-error[E0271]: type mismatch resolving `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]> as Iterator>::Item == &_`
- --> $DIR/issue-31173.rs:10:10
- |
-LL | .cloned()
- | ^^^^^^ expected reference, found `u8`
+error[E0271]: expected `TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>` to be an iterator that yields `&_`, but it yields `u8`
+ --> $DIR/issue-31173.rs:6:25
+ |
+LL | let temp: Vec<u8> = it
+ | _________________________^
+LL | |
+LL | | .take_while(|&x| {
+LL | | found_e = true;
+LL | | false
+LL | | })
+ | |__________^ expected reference, found `u8`
+LL | .cloned()
+ | ------ required by a bound introduced by this call
|
= note: expected reference `&_`
found type `u8`
@@ -12,27 +20,27 @@ note: required by a bound in `cloned`
LL | Self: Sized + Iterator<Item = &'a T>,
| ^^^^^^^^^^^^ required by this bound in `cloned`
-error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>`, but its trait bounds were not satisfied
- --> $DIR/issue-31173.rs:12:10
+error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>`, but its trait bounds were not satisfied
+ --> $DIR/issue-31173.rs:13:10
|
LL | .collect();
- | ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>` due to unsatisfied trait bounds
- |
- ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
- |
-LL | pub struct Cloned<I> {
- | -------------------- doesn't satisfy `_: Iterator`
+ | ^^^^^^^ method cannot be called on `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>` due to unsatisfied trait bounds
|
::: $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL
|
LL | pub struct TakeWhile<I, P> {
| -------------------------- doesn't satisfy `<_ as Iterator>::Item = &_`
|
+ ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL
+ |
+LL | pub struct Cloned<I> {
+ | -------------------- doesn't satisfy `_: Iterator`
+ |
= note: the following trait bounds were not satisfied:
- `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]> as Iterator>::Item = &_`
- which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
- `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
- which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:6:39: 6:43]>>: Iterator`
+ `<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]> as Iterator>::Item = &_`
+ which is required by `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>: Iterator`
+ `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>: Iterator`
+ which is required by `&mut Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>: Iterator`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-3121.rs b/src/test/ui/issues/issue-3121.rs
index f7bbfa9f6..4bf5b9b60 100644
--- a/src/test/ui/issues/issue-3121.rs
+++ b/src/test/ui/issues/issue-3121.rs
@@ -1,7 +1,6 @@
// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
-#![feature(box_syntax)]
#[derive(Copy, Clone)]
enum side { mayo, catsup, vinegar }
@@ -21,5 +20,5 @@ fn foo(m: Box<meal>, cond: bool) {
}
pub fn main() {
- foo(box meal::for_here(order::hamburger), true)
+ foo(Box::new(meal::for_here(order::hamburger)), true)
}
diff --git a/src/test/ui/issues/issue-3214.stderr b/src/test/ui/issues/issue-3214.stderr
index 4d8eb6360..aa0b5ce64 100644
--- a/src/test/ui/issues/issue-3214.stderr
+++ b/src/test/ui/issues/issue-3214.stderr
@@ -2,10 +2,9 @@ error[E0401]: can't use generic parameters from outer function
--> $DIR/issue-3214.rs:3:12
|
LL | fn foo<T>() {
- | --- - type parameter from outer function
- | |
- | try adding a local generic parameter in this method instead
+ | - type parameter from outer function
LL | struct Foo {
+ | - help: try using a local generic parameter instead: `<T>`
LL | x: T,
| ^ use of generic parameter from outer function
diff --git a/src/test/ui/issues/issue-32326.stderr b/src/test/ui/issues/issue-32326.stderr
index cea765850..dc51198d9 100644
--- a/src/test/ui/issues/issue-32326.stderr
+++ b/src/test/ui/issues/issue-32326.stderr
@@ -2,16 +2,14 @@ error[E0072]: recursive type `Expr` has infinite size
--> $DIR/issue-32326.rs:5:1
|
LL | enum Expr {
- | ^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^
LL | Plus(Expr, Expr),
- | ---- ---- recursive without indirection
- | |
- | recursive without indirection
+ | ---- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Expr` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | Plus(Box<Expr>, Box<Expr>),
- | ++++ + ++++ +
+LL | Plus(Box<Expr>, Expr),
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-32709.stderr b/src/test/ui/issues/issue-32709.stderr
index 112cb3359..1d595ca56 100644
--- a/src/test/ui/issues/issue-32709.stderr
+++ b/src/test/ui/issues/issue-32709.stderr
@@ -10,7 +10,7 @@ LL | Err(5)?;
= help: the following other types implement trait `FromResidual<R>`:
<Result<T, F> as FromResidual<Result<Infallible, E>>>
<Result<T, F> as FromResidual<Yeet<E>>>
- = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, {integer}>>` for `Result<i32, ()>`
+ = note: required for `Result<i32, ()>` to implement `FromResidual<Result<Infallible, {integer}>>`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-3290.rs b/src/test/ui/issues/issue-3290.rs
index 840c7ff83..7014d517f 100644
--- a/src/test/ui/issues/issue-3290.rs
+++ b/src/test/ui/issues/issue-3290.rs
@@ -1,9 +1,8 @@
// run-pass
-#![feature(box_syntax)]
#![allow(dead_code)]
pub fn main() {
- let mut x: Box<_> = box 3;
+ let mut x: Box<_> = Box::new(3);
x = x;
assert_eq!(*x, 3);
}
diff --git a/src/test/ui/issues/issue-33941.rs b/src/test/ui/issues/issue-33941.rs
index a1213623e..8430e85df 100644
--- a/src/test/ui/issues/issue-33941.rs
+++ b/src/test/ui/issues/issue-33941.rs
@@ -3,7 +3,7 @@
use std::collections::HashMap;
fn main() {
- for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
- //~^ ERROR type mismatch
- //~| ERROR type mismatch
+ for _ in HashMap::new().iter().cloned() {} //~ ERROR expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
+ //~^ ERROR expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
+ //~| ERROR expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
}
diff --git a/src/test/ui/issues/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr
index e1ce6eed9..691b8f88f 100644
--- a/src/test/ui/issues/issue-33941.stderr
+++ b/src/test/ui/issues/issue-33941.stderr
@@ -1,8 +1,10 @@
-error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
- --> $DIR/issue-33941.rs:6:36
+error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
+ --> $DIR/issue-33941.rs:6:14
|
LL | for _ in HashMap::new().iter().cloned() {}
- | ^^^^^^ expected reference, found tuple
+ | ^^^^^^^^^^^^^^^^^^^^^ ------ required by a bound introduced by this call
+ | |
+ | expected reference, found tuple
|
= note: expected reference `&_`
found tuple `(&_, &_)`
@@ -12,7 +14,7 @@ note: required by a bound in `cloned`
LL | Self: Sized + Iterator<Item = &'a T>,
| ^^^^^^^^^^^^ required by this bound in `cloned`
-error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
+error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:6:14
|
LL | for _ in HashMap::new().iter().cloned() {}
@@ -20,10 +22,10 @@ LL | for _ in HashMap::new().iter().cloned() {}
|
= note: expected tuple `(&_, &_)`
found reference `&_`
- = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
- = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
+ = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `Iterator`
+ = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `IntoIterator`
-error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
+error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:6:14
|
LL | for _ in HashMap::new().iter().cloned() {}
@@ -31,7 +33,7 @@ LL | for _ in HashMap::new().iter().cloned() {}
|
= note: expected tuple `(&_, &_)`
found reference `&_`
- = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
+ = note: required for `Cloned<std::collections::hash_map::Iter<'_, _, _>>` to implement `Iterator`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr
index 48ae2df69..72082f0cd 100644
--- a/src/test/ui/issues/issue-34334.stderr
+++ b/src/test/ui/issues/issue-34334.stderr
@@ -13,10 +13,12 @@ LL | let sr: Vec<(u32, _, _)> = vec![];
| +
error[E0277]: a value of type `Vec<(u32, _, _)>` cannot be built from an iterator over elements of type `()`
- --> $DIR/issue-34334.rs:5:87
+ --> $DIR/issue-34334.rs:5:33
|
LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect();
- | ^^^^^^^ value of type `Vec<(u32, _, _)>` cannot be built from `std::iter::Iterator<Item=()>`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | value of type `Vec<(u32, _, _)>` cannot be built from `std::iter::Iterator<Item=()>`
|
= help: the trait `FromIterator<()>` is not implemented for `Vec<(u32, _, _)>`
= help: the trait `FromIterator<T>` is implemented for `Vec<T>`
diff --git a/src/test/ui/issues/issue-34349.stderr b/src/test/ui/issues/issue-34349.stderr
index d0b51961b..8e9a16619 100644
--- a/src/test/ui/issues/issue-34349.stderr
+++ b/src/test/ui/issues/issue-34349.stderr
@@ -7,7 +7,15 @@ LL | farewell.push_str("!!!");
| -------- closure is `FnMut` because it mutates the variable `farewell` here
...
LL | apply(diary);
- | ----- the requirement to implement `Fn` derives from here
+ | ----- ----- the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `apply`
+ --> $DIR/issue-34349.rs:11:32
+ |
+LL | fn apply<F>(f: F) where F: Fn() {
+ | ^^^^ required by this bound in `apply`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-3447.rs b/src/test/ui/issues/issue-3447.rs
index 1e329d152..ee5b22778 100644
--- a/src/test/ui/issues/issue-3447.rs
+++ b/src/test/ui/issues/issue-3447.rs
@@ -2,7 +2,6 @@
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
-#![feature(box_syntax)]
use std::cell::RefCell;
@@ -20,7 +19,7 @@ impl<T:'static> list<T> {
next: None
};
- self.next = Some(box RefCell::new(newList));
+ self.next = Some(Box::new(RefCell::new(newList)));
}
}
diff --git a/src/test/ui/issues/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr
index a66289a1c..42a78ed97 100644
--- a/src/test/ui/issues/issue-35241.stderr
+++ b/src/test/ui/issues/issue-35241.stderr
@@ -11,10 +11,10 @@ LL | fn test() -> Foo { Foo }
|
= note: expected struct `Foo`
found fn item `fn(u32) -> Foo {Foo}`
-help: use parentheses to instantiate this tuple struct
+help: use parentheses to construct this tuple struct
|
-LL | fn test() -> Foo { Foo(_) }
- | +++
+LL | fn test() -> Foo { Foo(/* u32 */) }
+ | +++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-35570.rs b/src/test/ui/issues/issue-35570.rs
index 42cef9a47..a2b0222d4 100644
--- a/src/test/ui/issues/issue-35570.rs
+++ b/src/test/ui/issues/issue-35570.rs
@@ -6,7 +6,8 @@ trait Trait2<'a> {
}
fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
-//~^ the trait bound `for<'a> (): Trait2<'a>` is not satisfied
+ //~^ ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied
+ //~| ERROR the trait bound `for<'a> (): Trait2<'a>` is not satisfied
let _e: (usize, usize) = unsafe{mem::transmute(param)};
}
diff --git a/src/test/ui/issues/issue-35570.stderr b/src/test/ui/issues/issue-35570.stderr
index 2697d46bd..ebc40f678 100644
--- a/src/test/ui/issues/issue-35570.stderr
+++ b/src/test/ui/issues/issue-35570.stderr
@@ -1,9 +1,19 @@
error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
+ --> $DIR/issue-35570.rs:8:1
+ |
+LL | / fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
+LL | |
+LL | |
+LL | | let _e: (usize, usize) = unsafe{mem::transmute(param)};
+LL | | }
+ | |_^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
+
+error[E0277]: the trait bound `for<'a> (): Trait2<'a>` is not satisfied
--> $DIR/issue-35570.rs:8:40
|
LL | fn _ice(param: Box<dyn for <'a> Trait1<<() as Trait2<'a>>::Ty>>) {
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Trait2<'a>` is not implemented for `()`
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/issues/issue-3563-2.rs b/src/test/ui/issues/issue-3563-2.rs
deleted file mode 100644
index 88a449b85..000000000
--- a/src/test/ui/issues/issue-3563-2.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-// check-pass
-// pretty-expanded FIXME #23616
-
-trait Canvas {
- fn add_point(&self, point: &isize);
- fn add_points(&self, shapes: &[isize]) {
- for pt in shapes {
- self.add_point(pt)
- }
- }
-
-}
-
-pub fn main() {}
diff --git a/src/test/ui/issues/issue-3779.stderr b/src/test/ui/issues/issue-3779.stderr
index e853d0f8c..a0dbcc920 100644
--- a/src/test/ui/issues/issue-3779.stderr
+++ b/src/test/ui/issues/issue-3779.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `S` has infinite size
--> $DIR/issue-3779.rs:1:1
|
LL | struct S {
- | ^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^
LL |
LL | element: Option<S>
- | --------- recursive without indirection
+ | - recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `S` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | element: Option<Box<S>>
| ++++ +
diff --git a/src/test/ui/issues/issue-3794.rs b/src/test/ui/issues/issue-3794.rs
index 1809e822c..b1f028fbc 100644
--- a/src/test/ui/issues/issue-3794.rs
+++ b/src/test/ui/issues/issue-3794.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
#![allow(dead_code)]
trait T {
@@ -26,7 +25,7 @@ fn print_s(s: &S) {
}
pub fn main() {
- let s: Box<S> = box S { s: 5 };
+ let s: Box<S> = Box::new(S { s: 5 });
print_s(&*s);
let t: Box<dyn T> = s as Box<dyn T>;
print_t(&*t);
diff --git a/src/test/ui/issues/issue-3878.rs b/src/test/ui/issues/issue-3878.rs
index a121f0ba8..6de3405af 100644
--- a/src/test/ui/issues/issue-3878.rs
+++ b/src/test/ui/issues/issue-3878.rs
@@ -2,9 +2,8 @@
// pretty-expanded FIXME #23616
#![allow(path_statements)]
-#![feature(box_syntax)]
pub fn main() {
- let y: Box<_> = box 1;
+ let y: Box<_> = Box::new(1);
y;
}
diff --git a/src/test/ui/issues/issue-38821.stderr b/src/test/ui/issues/issue-38821.stderr
index cdf1f0dfc..9abd2436b 100644
--- a/src/test/ui/issues/issue-38821.stderr
+++ b/src/test/ui/issues/issue-38821.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not sat
LL | #[derive(Debug, Copy, Clone)]
| ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType`
|
-note: required because of the requirements on the impl of `IntoNullable` for `<Col as Expression>::SqlType`
+note: required for `<Col as Expression>::SqlType` to implement `IntoNullable`
--> $DIR/issue-38821.rs:9:18
|
LL | impl<T: NotNull> IntoNullable for T {
diff --git a/src/test/ui/issues/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr
index 1f64a90bc..774575d1d 100644
--- a/src/test/ui/issues/issue-39970.stderr
+++ b/src/test/ui/issues/issue-39970.stderr
@@ -9,7 +9,7 @@ note: expected this to be `()`
|
LL | type Element = &'a ();
| ^^^^^^
-note: required because of the requirements on the impl of `Visit` for `()`
+note: required for `()` to implement `Visit`
--> $DIR/issue-39970.rs:13:6
|
LL | impl Visit for () where
diff --git a/src/test/ui/issues/issue-40000.stderr b/src/test/ui/issues/issue-40000.stderr
index e6f0b5fbf..c41fbb9d2 100644
--- a/src/test/ui/issues/issue-40000.stderr
+++ b/src/test/ui/issues/issue-40000.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | foo(bar);
| ^^^ one type is more general than the other
|
- = note: expected trait object `dyn for<'r> Fn(&'r i32)`
+ = note: expected trait object `dyn for<'a> Fn(&'a i32)`
found trait object `dyn Fn(&i32)`
error[E0308]: mismatched types
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
LL | foo(bar);
| ^^^ one type is more general than the other
|
- = note: expected trait object `dyn for<'r> Fn(&'r i32)`
+ = note: expected trait object `dyn for<'a> Fn(&'a i32)`
found trait object `dyn Fn(&i32)`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-40510-3.stderr b/src/test/ui/issues/issue-40510-3.stderr
index 22186ba9a..eb077415e 100644
--- a/src/test/ui/issues/issue-40510-3.stderr
+++ b/src/test/ui/issues/issue-40510-3.stderr
@@ -14,6 +14,10 @@ LL | | }
|
= note: `FnMut` closures only have access to their captured variables while they are executing...
= note: ...therefore, they cannot allow references to captured variables to escape
+help: consider adding 'move' keyword before the nested closure
+ |
+LL | move || {
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-40827.stderr b/src/test/ui/issues/issue-40827.stderr
index 11c23e5b6..7f5c578ae 100644
--- a/src/test/ui/issues/issue-40827.stderr
+++ b/src/test/ui/issues/issue-40827.stderr
@@ -12,7 +12,7 @@ note: required because it appears within the type `Bar`
|
LL | enum Bar {
| ^^^
- = note: required because of the requirements on the impl of `Send` for `Arc<Bar>`
+ = note: required for `Arc<Bar>` to implement `Send`
note: required because it appears within the type `Foo`
--> $DIR/issue-40827.rs:4:8
|
@@ -38,7 +38,7 @@ note: required because it appears within the type `Bar`
|
LL | enum Bar {
| ^^^
- = note: required because of the requirements on the impl of `Send` for `Arc<Bar>`
+ = note: required for `Arc<Bar>` to implement `Send`
note: required because it appears within the type `Foo`
--> $DIR/issue-40827.rs:4:8
|
diff --git a/src/test/ui/issues/issue-41139.stderr b/src/test/ui/issues/issue-41139.stderr
index 48b22bca2..97492e6e0 100644
--- a/src/test/ui/issues/issue-41139.stderr
+++ b/src/test/ui/issues/issue-41139.stderr
@@ -5,9 +5,7 @@ LL | fn get_function<'a>() -> &'a dyn Fn() -> dyn Trait {
| -------------------------------------------------- `get_function` defined here returns `&dyn Fn() -> (dyn Trait + 'static)`
...
LL | let t: &dyn Trait = &get_function()();
- | ^^^^^^^^^^^^^^--
- | |
- | call expression requires function
+ | ^^^^^^^^^^^^^^ this trait object returns an unsized value `(dyn Trait + 'static)`, so it cannot be called
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-41726.stderr b/src/test/ui/issues/issue-41726.stderr
index 22631e7c2..b05c1fb14 100644
--- a/src/test/ui/issues/issue-41726.stderr
+++ b/src/test/ui/issues/issue-41726.stderr
@@ -5,6 +5,10 @@ LL | things[src.as_str()].sort();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable
|
= help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<String, Vec<String>>`
+help: to modify a `HashMap<String, Vec<String>>` use `.get_mut()`
+ |
+LL | things.get_mut(src.as_str()).map(|val| val.sort());
+ | ~~~~~~~~~ ~~~~~~~~~~~~~~~ +
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-41974.stderr b/src/test/ui/issues/issue-41974.stderr
index fcbb40140..e249db9df 100644
--- a/src/test/ui/issues/issue-41974.stderr
+++ b/src/test/ui/issues/issue-41974.stderr
@@ -7,11 +7,11 @@ LL | impl<T> Drop for T where T: A {
= note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
= note: only traits defined in the current crate can be implemented for a type parameter
-error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions
+error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions
--> $DIR/issue-41974.rs:7:18
|
LL | impl<T> Drop for T where T: A {
- | ^ must be a struct, enum, or union
+ | ^ must be a struct, enum, or union in the current crate
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-4265.stderr b/src/test/ui/issues/issue-4265.stderr
index 27e83d495..8c7303f3c 100644
--- a/src/test/ui/issues/issue-4265.stderr
+++ b/src/test/ui/issues/issue-4265.stderr
@@ -1,12 +1,12 @@
-error[E0201]: duplicate definitions with name `bar`:
+error[E0592]: duplicate definitions with name `bar`
--> $DIR/issue-4265.rs:10:5
|
LL | fn bar() {
- | -------- previous definition of `bar` here
+ | -------- other definition for `bar`
...
LL | fn bar() {
- | ^^^^^^^^ duplicate definition
+ | ^^^^^^^^ duplicate definitions for `bar`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0201`.
+For more information about this error, try `rustc --explain E0592`.
diff --git a/src/test/ui/issues/issue-43853.rs b/src/test/ui/issues/issue-43853.rs
index 3162c091c..dd42c1e3c 100644
--- a/src/test/ui/issues/issue-43853.rs
+++ b/src/test/ui/issues/issue-43853.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
use std::panic;
diff --git a/src/test/ui/issues/issue-43988.stderr b/src/test/ui/issues/issue-43988.stderr
index 03aa37f52..02c5dd5bf 100644
--- a/src/test/ui/issues/issue-43988.stderr
+++ b/src/test/ui/issues/issue-43988.stderr
@@ -31,12 +31,16 @@ error[E0552]: unrecognized representation hint
|
LL | #[repr(nothing)]
| ^^^^^^^
+ |
+ = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
error[E0552]: unrecognized representation hint
--> $DIR/issue-43988.rs:18:12
|
LL | #[repr(something_not_real)]
| ^^^^^^^^^^^^^^^^^^
+ |
+ = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
error[E0518]: attribute should be applied to function or closure
--> $DIR/issue-43988.rs:30:5
diff --git a/src/test/ui/issues/issue-46519.rs b/src/test/ui/issues/issue-46519.rs
index 9bd3c0948..0567923b7 100644
--- a/src/test/ui/issues/issue-46519.rs
+++ b/src/test/ui/issues/issue-46519.rs
@@ -2,7 +2,6 @@
// compile-flags:--test -O
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#[test]
#[should_panic(expected = "creating inhabited type")]
diff --git a/src/test/ui/issues/issue-47094.stderr b/src/test/ui/issues/issue-47094.stderr
index e323ce660..970e31847 100644
--- a/src/test/ui/issues/issue-47094.stderr
+++ b/src/test/ui/issues/issue-47094.stderr
@@ -4,9 +4,9 @@ error[E0566]: conflicting representation hints
LL | #[repr(C, u8)]
| ^ ^^
|
- = note: `#[deny(conflicting_repr_hints)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #68585 <https://github.com/rust-lang/rust/issues/68585>
+ = note: `#[deny(conflicting_repr_hints)]` on by default
error[E0566]: conflicting representation hints
--> $DIR/issue-47094.rs:8:8
diff --git a/src/test/ui/issues/issue-47486.stderr b/src/test/ui/issues/issue-47486.stderr
index b45f57b7b..2bd24f08c 100644
--- a/src/test/ui/issues/issue-47486.stderr
+++ b/src/test/ui/issues/issue-47486.stderr
@@ -9,11 +9,6 @@ error[E0282]: type annotations needed
|
LL | [0u8; std::mem::size_of::<_>()];
| ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `size_of`
- |
-help: consider specifying the generic argument
- |
-LL | [0u8; std::mem::size_of::<_>()];
- | ~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-47511.stderr b/src/test/ui/issues/issue-47511.stderr
index 5b84f7ed6..9998ee0e8 100644
--- a/src/test/ui/issues/issue-47511.stderr
+++ b/src/test/ui/issues/issue-47511.stderr
@@ -4,7 +4,8 @@ error[E0581]: return type references an anonymous lifetime, which is not constra
LL | fn f(_: X) -> X {
| ^
|
- = note: lifetimes appearing in an associated type are not considered constrained
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types
--> $DIR/issue-47511.rs:12:23
diff --git a/src/test/ui/issues/issue-4759.rs b/src/test/ui/issues/issue-4759.rs
index 53785af09..e5b9e2ed5 100644
--- a/src/test/ui/issues/issue-4759.rs
+++ b/src/test/ui/issues/issue-4759.rs
@@ -2,8 +2,6 @@
// pretty-expanded FIXME #23616
#![allow(non_shorthand_field_patterns)]
-#![feature(box_syntax)]
-
struct T { a: Box<isize> }
trait U {
@@ -15,6 +13,6 @@ impl U for Box<isize> {
}
pub fn main() {
- let T { a: a } = T { a: box 0 };
+ let T { a: a } = T { a: Box::new(0) };
a.f();
}
diff --git a/src/test/ui/issues/issue-47725.stderr b/src/test/ui/issues/issue-47725.stderr
index c7a9bfe31..7143fb4d6 100644
--- a/src/test/ui/issues/issue-47725.stderr
+++ b/src/test/ui/issues/issue-47725.stderr
@@ -13,12 +13,12 @@ LL | #[link_name = "foo"]
LL | struct Foo;
| ----------- not a foreign function or static
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/issue-47725.rs:1:9
|
LL | #![warn(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
--> $DIR/issue-47725.rs:8:1
diff --git a/src/test/ui/issues/issue-4935.stderr b/src/test/ui/issues/issue-4935.stderr
index aab19a699..bb45fa083 100644
--- a/src/test/ui/issues/issue-4935.stderr
+++ b/src/test/ui/issues/issue-4935.stderr
@@ -12,7 +12,7 @@ LL | fn foo(a: usize) {}
help: remove the extra argument
|
LL | fn main() { foo(5) }
- | ~~~~~~
+ | ~~~
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-4972.rs b/src/test/ui/issues/issue-4972.rs
index fab258f13..3f1c6f855 100644
--- a/src/test/ui/issues/issue-4972.rs
+++ b/src/test/ui/issues/issue-4972.rs
@@ -1,5 +1,4 @@
#![feature(box_patterns)]
-#![feature(box_syntax)]
trait MyTrait {
fn dummy(&self) {}
diff --git a/src/test/ui/issues/issue-4972.stderr b/src/test/ui/issues/issue-4972.stderr
index 40db50278..83daded7e 100644
--- a/src/test/ui/issues/issue-4972.stderr
+++ b/src/test/ui/issues/issue-4972.stderr
@@ -1,5 +1,5 @@
error[E0033]: type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced
- --> $DIR/issue-4972.rs:14:25
+ --> $DIR/issue-4972.rs:13:25
|
LL | TraitWrapper::A(box ref map) => map,
| ^^^^^^^^^^^ type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced
diff --git a/src/test/ui/issues/issue-49824.stderr b/src/test/ui/issues/issue-49824.stderr
index 2fec48254..14beadece 100644
--- a/src/test/ui/issues/issue-49824.stderr
+++ b/src/test/ui/issues/issue-49824.stderr
@@ -14,6 +14,10 @@ LL | | }
|
= note: `FnMut` closures only have access to their captured variables while they are executing...
= note: ...therefore, they cannot allow references to captured variables to escape
+help: consider adding 'move' keyword before the nested closure
+ |
+LL | move || {
+ | ++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-50582.stderr b/src/test/ui/issues/issue-50582.stderr
index 3d527eb6b..53ecc6112 100644
--- a/src/test/ui/issues/issue-50582.stderr
+++ b/src/test/ui/issues/issue-50582.stderr
@@ -7,13 +7,13 @@ LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
= help: add `#![feature(const_for)]` to the crate attributes to enable
-error[E0277]: cannot add `()` to `{integer}`
+error[E0277]: cannot add `()` to `{integer}` in const contexts
--> $DIR/issue-50582.rs:2:18
|
LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
| ^ no implementation for `{integer} + ()`
|
- = help: the trait `Add<()>` is not implemented for `{integer}`
+ = help: the trait `~const Add<()>` is not implemented for `{integer}`
= help: the following other types implement trait `Add<Rhs>`:
<&'a f32 as Add<f32>>
<&'a f64 as Add<f64>>
diff --git a/src/test/ui/issues/issue-50781.stderr b/src/test/ui/issues/issue-50781.stderr
index 93bd951d3..e185ecdda 100644
--- a/src/test/ui/issues/issue-50781.stderr
+++ b/src/test/ui/issues/issue-50781.stderr
@@ -4,11 +4,6 @@ error: the trait `X` cannot be made into an object
LL | fn foo(&self) where Self: Trait;
| ^^^
|
-note: the lint level is defined here
- --> $DIR/issue-50781.rs:1:9
- |
-LL | #![deny(where_clauses_object_safety)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= 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 #51443 <https://github.com/rust-lang/rust/issues/51443>
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>
@@ -19,6 +14,11 @@ LL | trait X {
LL | fn foo(&self) where Self: Trait;
| ^^^ ...because method `foo` references the `Self` type in its `where` clause
= help: consider moving `foo` to another trait
+note: the lint level is defined here
+ --> $DIR/issue-50781.rs:1:9
+ |
+LL | #![deny(where_clauses_object_safety)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-5100.rs b/src/test/ui/issues/issue-5100.rs
index 5e926fabe..69ed4b0e4 100644
--- a/src/test/ui/issues/issue-5100.rs
+++ b/src/test/ui/issues/issue-5100.rs
@@ -1,5 +1,5 @@
#![feature(box_patterns)]
-#![feature(box_syntax)]
+
enum A { B, C }
diff --git a/src/test/ui/issues/issue-5192.rs b/src/test/ui/issues/issue-5192.rs
index 5a83d1c2f..e2f835c19 100644
--- a/src/test/ui/issues/issue-5192.rs
+++ b/src/test/ui/issues/issue-5192.rs
@@ -2,8 +2,6 @@
#![allow(dead_code)]
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
pub trait EventLoop {
fn dummy(&self) { }
}
@@ -37,5 +35,5 @@ impl Scheduler {
}
pub fn main() {
- let _sched = Scheduler::new(box UvEventLoop::new() as Box<dyn EventLoop>);
+ let _sched = Scheduler::new(Box::new(UvEventLoop::new()) as Box<dyn EventLoop>);
}
diff --git a/src/test/ui/issues/issue-54044.stderr b/src/test/ui/issues/issue-54044.stderr
index 100965de1..8bd94a041 100644
--- a/src/test/ui/issues/issue-54044.stderr
+++ b/src/test/ui/issues/issue-54044.stderr
@@ -7,12 +7,12 @@ LL | #[cold]
LL | struct Foo;
| ----------- not a function definition
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/issue-54044.rs:1:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error: attribute should be applied to a function definition
--> $DIR/issue-54044.rs:9:5
diff --git a/src/test/ui/issues/issue-5439.rs b/src/test/ui/issues/issue-5439.rs
index cd039506f..852b264dc 100644
--- a/src/test/ui/issues/issue-5439.rs
+++ b/src/test/ui/issues/issue-5439.rs
@@ -1,5 +1,3 @@
-#![feature(box_syntax)]
-
struct Foo {
foo: isize,
}
@@ -10,7 +8,7 @@ struct Bar {
impl Bar {
fn make_foo (&self, i: isize) -> Box<Foo> {
- return box Foo { nonexistent: self, foo: i }; //~ ERROR: no field named
+ return Box::new(Foo { nonexistent: self, foo: i }); //~ ERROR: no field named
}
}
diff --git a/src/test/ui/issues/issue-5439.stderr b/src/test/ui/issues/issue-5439.stderr
index bd0cb670b..dc8f8b878 100644
--- a/src/test/ui/issues/issue-5439.stderr
+++ b/src/test/ui/issues/issue-5439.stderr
@@ -1,8 +1,8 @@
error[E0560]: struct `Foo` has no field named `nonexistent`
- --> $DIR/issue-5439.rs:13:26
+ --> $DIR/issue-5439.rs:11:31
|
-LL | return box Foo { nonexistent: self, foo: i };
- | ^^^^^^^^^^^ `Foo` does not have this field
+LL | return Box::new(Foo { nonexistent: self, foo: i });
+ | ^^^^^^^^^^^ `Foo` does not have this field
|
= note: available fields are: `foo`
diff --git a/src/test/ui/issues/issue-55380.stderr b/src/test/ui/issues/issue-55380.stderr
index 65e94d796..403844c72 100644
--- a/src/test/ui/issues/issue-55380.stderr
+++ b/src/test/ui/issues/issue-55380.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/issues/issue-5666.rs b/src/test/ui/issues/issue-5666.rs
index aa5132778..810895b1b 100644
--- a/src/test/ui/issues/issue-5666.rs
+++ b/src/test/ui/issues/issue-5666.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
struct Dog {
name : String
@@ -17,8 +16,8 @@ impl Barks for Dog {
pub fn main() {
- let snoopy = box Dog{name: "snoopy".to_string()};
- let bubbles = box Dog{name: "bubbles".to_string()};
+ let snoopy = Box::new(Dog{name: "snoopy".to_string()});
+ let bubbles = Box::new(Dog{name: "bubbles".to_string()});
let barker = [snoopy as Box<dyn Barks>, bubbles as Box<dyn Barks>];
for pup in &barker {
diff --git a/src/test/ui/issues/issue-5718.rs b/src/test/ui/issues/issue-5718.rs
index 63efec953..f29a1e2a0 100644
--- a/src/test/ui/issues/issue-5718.rs
+++ b/src/test/ui/issues/issue-5718.rs
@@ -1,14 +1,12 @@
// run-pass
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
struct Element;
macro_rules! foo {
($tag: expr, $string: expr) => {
if $tag == $string {
- let element: Box<_> = box Element;
+ let element: Box<_> = Box::new(Element);
unsafe {
return std::mem::transmute::<_, usize>(element);
}
diff --git a/src/test/ui/issues/issue-57271.rs b/src/test/ui/issues/issue-57271.rs
index 9940fecbe..f74222e3e 100644
--- a/src/test/ui/issues/issue-57271.rs
+++ b/src/test/ui/issues/issue-57271.rs
@@ -4,7 +4,7 @@ extern crate issue_57271_lib;
use issue_57271_lib::BaseType;
-pub enum ObjectType { //~ ERROR recursive type `ObjectType` has infinite size
+pub enum ObjectType { //~ ERROR recursive types `ObjectType` and `TypeSignature` have infinite size
Class(ClassTypeSignature),
Array(TypeSignature),
TypeVariable(()),
@@ -16,7 +16,7 @@ pub struct ClassTypeSignature {
pub inner: (),
}
-pub enum TypeSignature { //~ ERROR recursive type `TypeSignature` has infinite size
+pub enum TypeSignature {
Base(BaseType),
Object(ObjectType),
}
diff --git a/src/test/ui/issues/issue-57271.stderr b/src/test/ui/issues/issue-57271.stderr
index 825009665..391e69c91 100644
--- a/src/test/ui/issues/issue-57271.stderr
+++ b/src/test/ui/issues/issue-57271.stderr
@@ -1,31 +1,27 @@
-error[E0072]: recursive type `ObjectType` has infinite size
+error[E0072]: recursive types `ObjectType` and `TypeSignature` have infinite size
--> $DIR/issue-57271.rs:7:1
|
LL | pub enum ObjectType {
- | ^^^^^^^^^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^^^^^^^^^
LL | Class(ClassTypeSignature),
LL | Array(TypeSignature),
| ------------- recursive without indirection
- |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ObjectType` representable
- |
-LL | Array(Box<TypeSignature>),
- | ++++ +
-
-error[E0072]: recursive type `TypeSignature` has infinite size
- --> $DIR/issue-57271.rs:19:1
- |
+...
LL | pub enum TypeSignature {
- | ^^^^^^^^^^^^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^^^^^^^^^^^^
LL | Base(BaseType),
LL | Object(ObjectType),
| ---------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `TypeSignature` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL ~ Array(Box<TypeSignature>),
+LL | TypeVariable(()),
+ ...
+LL | Base(BaseType),
+LL ~ Object(Box<ObjectType>),
|
-LL | Object(Box<ObjectType>),
- | ++++ +
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/issues/issue-57362-1.stderr b/src/test/ui/issues/issue-57362-1.stderr
index 8e19f1400..b10273f14 100644
--- a/src/test/ui/issues/issue-57362-1.stderr
+++ b/src/test/ui/issues/issue-57362-1.stderr
@@ -2,9 +2,7 @@ error[E0599]: no method named `f` found for fn pointer `fn(&u8)` in the current
--> $DIR/issue-57362-1.rs:20:7
|
LL | a.f();
- | - ^ method not found in `fn(&u8)`
- | |
- | this is a function, perhaps you wish to call it
+ | ^ method not found in `fn(&u8)`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `Trait` defines an item `f`, perhaps you need to implement it
diff --git a/src/test/ui/issues/issue-57362-2.stderr b/src/test/ui/issues/issue-57362-2.stderr
index 3b6cffeaf..7d08c4643 100644
--- a/src/test/ui/issues/issue-57362-2.stderr
+++ b/src/test/ui/issues/issue-57362-2.stderr
@@ -1,11 +1,11 @@
-error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'r> fn(&'r ())`, but its trait bounds were not satisfied
+error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied
--> $DIR/issue-57362-2.rs:22:25
|
LL | let x = <fn (&())>::make_g();
- | ^^^^^^ function or associated item cannot be called on `for<'r> fn(&'r ())` due to unsatisfied trait bounds
+ | ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
- `for<'r> fn(&'r ()): X`
+ `for<'a> fn(&'a ()): X`
= help: items from traits can only be used if the trait is implemented and in scope
note: `X` defines an item `make_g`, perhaps you need to implement it
--> $DIR/issue-57362-2.rs:8:1
diff --git a/src/test/ui/issues/issue-58022.stderr b/src/test/ui/issues/issue-58022.stderr
index 6d24209ad..56d85c066 100644
--- a/src/test/ui/issues/issue-58022.stderr
+++ b/src/test/ui/issues/issue-58022.stderr
@@ -1,9 +1,3 @@
-error[E0423]: expected function, tuple struct or tuple variant, found trait `Foo`
- --> $DIR/issue-58022.rs:14:9
- |
-LL | Foo(Box::new(*slice))
- | ^^^ not a function, tuple struct or tuple variant
-
error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
--> $DIR/issue-58022.rs:4:25
|
@@ -13,6 +7,12 @@ LL |
LL | fn new(slice: &[u8; Foo::SIZE]) -> Self;
| ^^^^^^^^^ cannot refer to the associated constant of trait
+error[E0423]: expected function, tuple struct or tuple variant, found trait `Foo`
+ --> $DIR/issue-58022.rs:14:9
+ |
+LL | Foo(Box::new(*slice))
+ | ^^^ not a function, tuple struct or tuple variant
+
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0423, E0790.
diff --git a/src/test/ui/issues/issue-58734.stderr b/src/test/ui/issues/issue-58734.stderr
index a91a1b377..d2314626d 100644
--- a/src/test/ui/issues/issue-58734.stderr
+++ b/src/test/ui/issues/issue-58734.stderr
@@ -4,9 +4,9 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | Trait::nonexistent(());
| ^^^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
LL | <dyn Trait>::nonexistent(());
diff --git a/src/test/ui/issues/issue-5884.rs b/src/test/ui/issues/issue-5884.rs
index 2f64342a6..991c52321 100644
--- a/src/test/ui/issues/issue-5884.rs
+++ b/src/test/ui/issues/issue-5884.rs
@@ -2,8 +2,6 @@
#![allow(dead_code)]
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
pub struct Foo {
a: isize,
}
@@ -14,7 +12,7 @@ struct Bar<'a> {
}
fn check(a: Box<Foo>) {
- let _ic = Bar{ b: &*a, a: box None };
+ let _ic = Bar{ b: &*a, a: Box::new(None) };
}
pub fn main(){}
diff --git a/src/test/ui/issues/issue-59488.rs b/src/test/ui/issues/issue-59488.rs
index 922b59393..384501e3e 100644
--- a/src/test/ui/issues/issue-59488.rs
+++ b/src/test/ui/issues/issue-59488.rs
@@ -30,4 +30,5 @@ fn main() {
assert_eq!(Foo::Bar, i);
//~^ ERROR binary operation `==` cannot be applied to type `fn(usize) -> Foo {Foo::Bar}` [E0369]
//~| ERROR `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug` [E0277]
+ //~| ERROR `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug` [E0277]
}
diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr
index 7ce3dedaa..f9846b62a 100644
--- a/src/test/ui/issues/issue-59488.stderr
+++ b/src/test/ui/issues/issue-59488.stderr
@@ -6,7 +6,7 @@ LL | foo > 12;
| |
| fn() -> i32 {foo}
|
-help: you might have forgotten to call this function
+help: use parentheses to call this function
|
LL | foo() > 12;
| ++
@@ -28,10 +28,10 @@ LL | bar > 13;
| |
| fn(i64) -> i64 {bar}
|
-help: you might have forgotten to call this function
+help: use parentheses to call this function
|
-LL | bar( /* arguments */ ) > 13;
- | +++++++++++++++++++
+LL | bar(/* i64 */) > 13;
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/issue-59488.rs:18:11
@@ -50,14 +50,10 @@ LL | foo > foo;
| |
| fn() -> i32 {foo}
|
-help: you might have forgotten to call this function
+help: use parentheses to call these
|
-LL | foo() > foo;
- | ++
-help: you might have forgotten to call this function
- |
-LL | foo > foo();
- | ++
+LL | foo() > foo();
+ | ++ ++
error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
--> $DIR/issue-59488.rs:25:9
@@ -93,7 +89,26 @@ error[E0277]: `fn(usize) -> Foo {Foo::Bar}` doesn't implement `Debug`
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(usize) -> Foo {Foo::Bar}`
+ = 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`
+ --> $DIR/issue-59488.rs:30:5
+ |
+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
@@ -103,10 +118,10 @@ LL | assert_eq!(Foo::Bar, i);
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 68 others
+ 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 9 previous errors
+error: aborting due to 10 previous errors
Some errors have detailed explanations: E0277, E0308, E0369.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/issues/issue-5997-enum.stderr b/src/test/ui/issues/issue-5997-enum.stderr
index 1c58b9c39..3a79215d3 100644
--- a/src/test/ui/issues/issue-5997-enum.stderr
+++ b/src/test/ui/issues/issue-5997-enum.stderr
@@ -2,11 +2,11 @@ error[E0401]: can't use generic parameters from outer function
--> $DIR/issue-5997-enum.rs:2:16
|
LL | fn f<Z>() -> bool {
- | - - type parameter from outer function
- | |
- | try adding a local generic parameter in this method instead
+ | - type parameter from outer function
LL | enum E { V(Z) }
- | ^ use of generic parameter from outer function
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<Z>`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-5997-struct.stderr b/src/test/ui/issues/issue-5997-struct.stderr
index 5b388d16d..d2e97f767 100644
--- a/src/test/ui/issues/issue-5997-struct.stderr
+++ b/src/test/ui/issues/issue-5997-struct.stderr
@@ -2,11 +2,11 @@ error[E0401]: can't use generic parameters from outer function
--> $DIR/issue-5997-struct.rs:2:14
|
LL | fn f<T>() -> bool {
- | - - type parameter from outer function
- | |
- | try adding a local generic parameter in this method instead
+ | - type parameter from outer function
LL | struct S(T);
- | ^ use of generic parameter from outer function
+ | -^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<T>`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-60218.stderr b/src/test/ui/issues/issue-60218.stderr
index 870b25014..dd72b6515 100644
--- a/src/test/ui/issues/issue-60218.stderr
+++ b/src/test/ui/issues/issue-60218.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `&u32: Foo` is not satisfied
- --> $DIR/issue-60218.rs:18:27
+ --> $DIR/issue-60218.rs:18:19
|
LL | trigger_error(vec![], |x: &u32| x)
- | ------------- ^^^^^^^^^^^ the trait `Foo` is not implemented for `&u32`
+ | ------------- ^^^^^^ the trait `Foo` is not implemented for `&u32`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/issues/issue-60622.stderr b/src/test/ui/issues/issue-60622.stderr
index b305cc785..ecf1ae758 100644
--- a/src/test/ui/issues/issue-60622.stderr
+++ b/src/test/ui/issues/issue-60622.stderr
@@ -7,14 +7,14 @@ LL | fn a(&self) {}
LL | b.a::<'_, T>();
| ^^
|
+ = 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 #42868 <https://github.com/rust-lang/rust/issues/42868>
note: the lint level is defined here
--> $DIR/issue-60622.rs:1:9
|
LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(late_bound_lifetime_arguments)]` implied by `#[deny(warnings)]`
- = 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 #42868 <https://github.com/rust-lang/rust/issues/42868>
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-60622.rs:10:7
diff --git a/src/test/ui/issues/issue-62480.rs b/src/test/ui/issues/issue-62480.rs
index 5c3be3e64..94a9c2ab8 100644
--- a/src/test/ui/issues/issue-62480.rs
+++ b/src/test/ui/issues/issue-62480.rs
@@ -1,5 +1,3 @@
-#![feature(label_break_value)]
-
fn main() {
// This used to ICE during liveness check because `target_id` passed to
// `propagate_through_expr` would be the closure and not the `loop`, which wouldn't be found in
diff --git a/src/test/ui/issues/issue-62480.stderr b/src/test/ui/issues/issue-62480.stderr
index 17085ef90..db2305370 100644
--- a/src/test/ui/issues/issue-62480.stderr
+++ b/src/test/ui/issues/issue-62480.stderr
@@ -1,5 +1,5 @@
error[E0767]: use of unreachable label `'a`
- --> $DIR/issue-62480.rs:8:18
+ --> $DIR/issue-62480.rs:6:18
|
LL | 'a: {
| -- unreachable label defined here
@@ -9,7 +9,7 @@ LL | || break 'a
= note: labels are unreachable through functions, closures, async blocks and modules
error[E0267]: `break` inside of a closure
- --> $DIR/issue-62480.rs:8:12
+ --> $DIR/issue-62480.rs:6:12
|
LL | || break 'a
| -- ^^^^^^^^ cannot `break` inside of a closure
diff --git a/src/test/ui/issues/issue-6318.rs b/src/test/ui/issues/issue-6318.rs
index d8bd83f0d..e5f245f6f 100644
--- a/src/test/ui/issues/issue-6318.rs
+++ b/src/test/ui/issues/issue-6318.rs
@@ -1,8 +1,6 @@
// run-pass
// pretty-expanded FIXME #23616
-#![feature(box_syntax)]
-
pub enum Thing {
A(Box<dyn Foo+'static>)
}
@@ -16,7 +14,7 @@ pub struct Struct;
impl Foo for Struct {}
pub fn main() {
- match Thing::A(box Struct as Box<dyn Foo + 'static>) {
+ match Thing::A(Box::new(Struct) as Box<dyn Foo + 'static>) {
Thing::A(_a) => 0,
};
}
diff --git a/src/test/ui/issues/issue-6458-3.stderr b/src/test/ui/issues/issue-6458-3.stderr
index 2c3ec1a33..520efccae 100644
--- a/src/test/ui/issues/issue-6458-3.stderr
+++ b/src/test/ui/issues/issue-6458-3.stderr
@@ -2,12 +2,12 @@ error[E0282]: type annotations needed
--> $DIR/issue-6458-3.rs:4:5
|
LL | mem::transmute(0);
- | ^^^^^^^^^^^^^^ cannot infer type of the type parameter `U` declared on the function `transmute`
+ | ^^^^^^^^^^^^^^ cannot infer type of the type parameter `Dst` declared on the function `transmute`
|
help: consider specifying the generic arguments
|
-LL | mem::transmute::<i32, U>(0);
- | ++++++++++
+LL | mem::transmute::<i32, Dst>(0);
+ | ++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-6458-4.stderr b/src/test/ui/issues/issue-6458-4.stderr
index d6e74d10e..168ececac 100644
--- a/src/test/ui/issues/issue-6458-4.stderr
+++ b/src/test/ui/issues/issue-6458-4.stderr
@@ -6,7 +6,7 @@ LL | fn foo(b: bool) -> Result<bool,String> {
| |
| implicitly returns `()` as its body has no tail or `return` expression
LL | Err("bar".to_string());
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
|
= note: expected enum `Result<bool, String>`
found unit type `()`
diff --git a/src/test/ui/issues/issue-6557.rs b/src/test/ui/issues/issue-6557.rs
index e066aa529..757e9608f 100644
--- a/src/test/ui/issues/issue-6557.rs
+++ b/src/test/ui/issues/issue-6557.rs
@@ -3,7 +3,6 @@
// pretty-expanded FIXME #23616
#![feature(box_patterns)]
-#![feature(box_syntax)]
fn foo(box (_x, _y): Box<(isize, isize)>) {}
diff --git a/src/test/ui/issues/issue-66706.rs b/src/test/ui/issues/issue-66706.rs
index 4585bcc8c..835fdfae8 100644
--- a/src/test/ui/issues/issue-66706.rs
+++ b/src/test/ui/issues/issue-66706.rs
@@ -2,7 +2,6 @@ fn a() {
[0; [|_: _ &_| ()].len()]
//~^ ERROR expected `,`, found `&`
//~| ERROR type annotations needed
- //~| ERROR mismatched types
}
fn b() {
@@ -13,13 +12,11 @@ fn b() {
fn c() {
[0; [|&_: _ &_| {}; 0 ].len()]
//~^ ERROR expected `,`, found `&`
- //~| ERROR mismatched types
}
fn d() {
[0; match [|f @ &ref _| () ] {} ]
//~^ ERROR expected identifier, found reserved identifier `_`
- //~| ERROR mismatched types
}
fn main() {}
diff --git a/src/test/ui/issues/issue-66706.stderr b/src/test/ui/issues/issue-66706.stderr
index 1c55560cb..8a30c0cad 100644
--- a/src/test/ui/issues/issue-66706.stderr
+++ b/src/test/ui/issues/issue-66706.stderr
@@ -7,13 +7,13 @@ LL | [0; [|_: _ &_| ()].len()]
| help: missing `,`
error: expected identifier, found reserved identifier `_`
- --> $DIR/issue-66706.rs:9:20
+ --> $DIR/issue-66706.rs:8:20
|
LL | [0; [|f @ &ref _| {} ; 0 ].len() ];
| ^ expected identifier, found reserved identifier
error: expected `,`, found `&`
- --> $DIR/issue-66706.rs:14:17
+ --> $DIR/issue-66706.rs:13:17
|
LL | [0; [|&_: _ &_| {}; 0 ].len()]
| -^ expected `,`
@@ -21,7 +21,7 @@ LL | [0; [|&_: _ &_| {}; 0 ].len()]
| help: missing `,`
error: expected identifier, found reserved identifier `_`
- --> $DIR/issue-66706.rs:20:26
+ --> $DIR/issue-66706.rs:18:26
|
LL | [0; match [|f @ &ref _| () ] {} ]
| ^ expected identifier, found reserved identifier
@@ -32,31 +32,6 @@ error[E0282]: type annotations needed
LL | [0; [|_: _ &_| ()].len()]
| ^ cannot infer type
-error[E0308]: mismatched types
- --> $DIR/issue-66706.rs:2:5
- |
-LL | fn a() {
- | - help: try adding a return type: `-> [i32; _]`
-LL | [0; [|_: _ &_| ()].len()]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]`
-
-error[E0308]: mismatched types
- --> $DIR/issue-66706.rs:14:5
- |
-LL | fn c() {
- | - help: try adding a return type: `-> [i32; _]`
-LL | [0; [|&_: _ &_| {}; 0 ].len()]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]`
-
-error[E0308]: mismatched types
- --> $DIR/issue-66706.rs:20:5
- |
-LL | fn d() {
- | - help: try adding a return type: `-> [i32; _]`
-LL | [0; match [|f @ &ref _| () ] {} ]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found array `[{integer}; _]`
-
-error: aborting due to 8 previous errors
+error: aborting due to 5 previous errors
-Some errors have detailed explanations: E0282, E0308.
-For more information about an error, try `rustc --explain E0282`.
+For more information about this error, try `rustc --explain E0282`.
diff --git a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr
index d6e392516..2de150376 100644
--- a/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr
+++ b/src/test/ui/issues/issue-66923-show-error-for-correct-call.stderr
@@ -1,8 +1,10 @@
error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64`
- --> $DIR/issue-66923-show-error-for-correct-call.rs:8:39
+ --> $DIR/issue-66923-show-error-for-correct-call.rs:8:24
|
LL | let x2: Vec<f64> = x1.into_iter().collect();
- | ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
+ | ^^^^^^^^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
|
= help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>`
= help: the trait `FromIterator<T>` is implemented for `Vec<T>`
@@ -13,10 +15,12 @@ LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64`
- --> $DIR/issue-66923-show-error-for-correct-call.rs:12:29
+ --> $DIR/issue-66923-show-error-for-correct-call.rs:12:14
|
LL | let x3 = x1.into_iter().collect::<Vec<f64>>();
- | ^^^^^^^ value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
+ | ^^^^^^^^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | value of type `Vec<f64>` cannot be built from `std::iter::Iterator<Item=&f64>`
|
= help: the trait `FromIterator<&f64>` is not implemented for `Vec<f64>`
= help: the trait `FromIterator<T>` is implemented for `Vec<T>`
diff --git a/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr b/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr
index 733456a1a..37e2c3bdd 100644
--- a/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr
+++ b/src/test/ui/issues/issue-67039-unsound-pin-partialeq.stderr
@@ -6,7 +6,7 @@ LL | let _ = Pin::new(Apple) == Rc::pin(Apple);
|
= note: expected struct `Apple`
found struct `Rc<Apple>`
- = note: required because of the requirements on the impl of `PartialEq<Pin<Rc<Apple>>>` for `Pin<Apple>`
+ = note: required for `Pin<Apple>` to implement `PartialEq<Pin<Rc<Apple>>>`
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr b/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr
index e5ab65169..f581429a2 100644
--- a/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr
+++ b/src/test/ui/issues/issue-69396-const-no-type-in-macro.stderr
@@ -17,10 +17,10 @@ LL | | }
= note: this error originates in the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
error: missing type for `const` item
- --> $DIR/issue-69396-const-no-type-in-macro.rs:4:19
+ --> $DIR/issue-69396-const-no-type-in-macro.rs:4:20
|
LL | const A = "A".$fn();
- | ^ help: provide a type for the constant: `A: usize`
+ | ^ help: provide a type for the constant: `: usize`
...
LL | / suite! {
LL | | len;
@@ -31,13 +31,13 @@ LL | | }
= note: this error originates in the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants
- --> $DIR/issue-69396-const-no-type-in-macro.rs:4:19
+ --> $DIR/issue-69396-const-no-type-in-macro.rs:4:20
|
LL | const A = "A".$fn();
- | ^
- | |
- | not allowed in type signatures
- | help: replace with the correct type: `bool`
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `bool`
...
LL | / suite! {
LL | | len;
diff --git a/src/test/ui/issues/issue-69455.stderr b/src/test/ui/issues/issue-69455.stderr
index b732df764..9d11cf19e 100644
--- a/src/test/ui/issues/issue-69455.stderr
+++ b/src/test/ui/issues/issue-69455.stderr
@@ -16,7 +16,7 @@ error[E0283]: type annotations needed
LL | println!("{}", 23u64.test(xs.iter().sum()));
| ---- ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum`
| |
- | type must be known at this point
+ | required by a bound introduced by this call
|
note: multiple `impl`s satisfying `u64: Test<_>` found
--> $DIR/issue-69455.rs:11:1
diff --git a/src/test/ui/issues/issue-7013.rs b/src/test/ui/issues/issue-7013.rs
index c1f400b33..1fb01303c 100644
--- a/src/test/ui/issues/issue-7013.rs
+++ b/src/test/ui/issues/issue-7013.rs
@@ -1,5 +1,3 @@
-#![feature(box_syntax)]
-
use std::cell::RefCell;
use std::rc::Rc;
@@ -23,6 +21,6 @@ struct A {
}
fn main() {
- let a = A {v: box B{v: None} as Box<dyn Foo + Send>};
+ let a = A {v: Box::new(B{v: None}) as Box<dyn Foo + Send>};
//~^ ERROR `Rc<RefCell<A>>` cannot be sent between threads safely
}
diff --git a/src/test/ui/issues/issue-7013.stderr b/src/test/ui/issues/issue-7013.stderr
index f6cb1cbdc..4575f4dba 100644
--- a/src/test/ui/issues/issue-7013.stderr
+++ b/src/test/ui/issues/issue-7013.stderr
@@ -1,13 +1,13 @@
error[E0277]: `Rc<RefCell<A>>` cannot be sent between threads safely
- --> $DIR/issue-7013.rs:26:19
+ --> $DIR/issue-7013.rs:24:19
|
-LL | let a = A {v: box B{v: None} as Box<dyn Foo + Send>};
- | ^^^^^^^^^^^^^^ `Rc<RefCell<A>>` cannot be sent between threads safely
+LL | let a = A {v: Box::new(B{v: None}) as Box<dyn Foo + Send>};
+ | ^^^^^^^^^^^^^^^^^^^^ `Rc<RefCell<A>>` cannot be sent between threads safely
|
= help: within `B`, the trait `Send` is not implemented for `Rc<RefCell<A>>`
= note: required because it appears within the type `Option<Rc<RefCell<A>>>`
note: required because it appears within the type `B`
- --> $DIR/issue-7013.rs:10:8
+ --> $DIR/issue-7013.rs:8:8
|
LL | struct B {
| ^
diff --git a/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr b/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr
index c6e6ea1e0..b30bcfb77 100644
--- a/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr
+++ b/src/test/ui/issues/issue-70724-add_type_neq_err_label-unwrap.stderr
@@ -8,11 +8,6 @@ LL | assert_eq!(a, 0);
| {integer}
|
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: you might have forgotten to call this function
- --> $SRC_DIR/core/src/macros/mod.rs:LL:COL
- |
-LL | if !(*left_val() == *right_val) {
- | ++
error[E0308]: mismatched types
--> $DIR/issue-70724-add_type_neq_err_label-unwrap.rs:6:5
@@ -21,7 +16,7 @@ LL | assert_eq!(a, 0);
| ^^^^^^^^^^^^^^^^ expected fn item, found integer
|
= note: expected fn item `fn() -> i32 {a}`
- found type `i32`
+ found type `{integer}`
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: `fn() -> i32 {a}` doesn't implement `Debug`
@@ -33,8 +28,8 @@ LL | fn a() -> i32 {
LL | assert_eq!(a, 0);
| ^^^^^^^^^^^^^^^^ `fn() -> i32 {a}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = help: the trait `Debug` is not implemented for `fn() -> i32 {a}`
- = help: use parentheses to call the function: `a()`
+ = help: the trait `Debug` is not implemented for fn item `fn() -> i32 {a}`
+ = help: use parentheses to call this function: `a()`
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors
diff --git a/src/test/ui/issues/issue-72278.stderr b/src/test/ui/issues/issue-72278.stderr
index 41dff686b..5468837a3 100644
--- a/src/test/ui/issues/issue-72278.stderr
+++ b/src/test/ui/issues/issue-72278.stderr
@@ -7,9 +7,9 @@ LL | fn func<'a, U>(&'a self) -> U {
LL | S.func::<'a, U>()
| ^^
|
- = note: `#[warn(late_bound_lifetime_arguments)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>
+ = note: `#[warn(late_bound_lifetime_arguments)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/issues/issue-72554.rs b/src/test/ui/issues/issue-72554.rs
index 7287639c6..54f7e9ac5 100644
--- a/src/test/ui/issues/issue-72554.rs
+++ b/src/test/ui/issues/issue-72554.rs
@@ -3,7 +3,6 @@ use std::collections::BTreeSet;
#[derive(Hash)]
pub enum ElemDerived {
//~^ ERROR recursive type `ElemDerived` has infinite size
- //~| ERROR cycle detected when computing drop-check constraints for `ElemDerived`
A(ElemDerived)
}
diff --git a/src/test/ui/issues/issue-72554.stderr b/src/test/ui/issues/issue-72554.stderr
index 3e5adcae1..d12be539f 100644
--- a/src/test/ui/issues/issue-72554.stderr
+++ b/src/test/ui/issues/issue-72554.stderr
@@ -2,30 +2,16 @@ error[E0072]: recursive type `ElemDerived` has infinite size
--> $DIR/issue-72554.rs:4:1
|
LL | pub enum ElemDerived {
- | ^^^^^^^^^^^^^^^^^^^^ recursive type has infinite size
-...
+ | ^^^^^^^^^^^^^^^^^^^^
+LL |
LL | A(ElemDerived)
| ----------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ElemDerived` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | A(Box<ElemDerived>)
| ++++ +
-error[E0391]: cycle detected when computing drop-check constraints for `ElemDerived`
- --> $DIR/issue-72554.rs:4:1
- |
-LL | pub enum ElemDerived {
- | ^^^^^^^^^^^^^^^^^^^^
- |
- = note: ...which immediately requires computing drop-check constraints for `ElemDerived` again
-note: cycle used when computing drop-check constraints for `Elem`
- --> $DIR/issue-72554.rs:11:1
- |
-LL | pub enum Elem {
- | ^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0072, E0391.
-For more information about an error, try `rustc --explain E0072`.
+For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/issues/issue-7364.rs b/src/test/ui/issues/issue-7364.rs
index 83c52d286..79642bd41 100644
--- a/src/test/ui/issues/issue-7364.rs
+++ b/src/test/ui/issues/issue-7364.rs
@@ -1,9 +1,7 @@
-#![feature(box_syntax)]
-
use std::cell::RefCell;
// Regression test for issue 7364
-static boxed: Box<RefCell<isize>> = box RefCell::new(0);
+static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
//~^ ERROR `RefCell<isize>` cannot be shared between threads safely [E0277]
fn main() { }
diff --git a/src/test/ui/issues/issue-7364.stderr b/src/test/ui/issues/issue-7364.stderr
index f2e80f451..5dc8c2b60 100644
--- a/src/test/ui/issues/issue-7364.stderr
+++ b/src/test/ui/issues/issue-7364.stderr
@@ -1,11 +1,11 @@
error[E0277]: `RefCell<isize>` cannot be shared between threads safely
- --> $DIR/issue-7364.rs:6:15
+ --> $DIR/issue-7364.rs:4:15
|
-LL | static boxed: Box<RefCell<isize>> = box RefCell::new(0);
+LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
| ^^^^^^^^^^^^^^^^^^^ `RefCell<isize>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `RefCell<isize>`
- = note: required because of the requirements on the impl of `Sync` for `Unique<RefCell<isize>>`
+ = note: required for `Unique<RefCell<isize>>` to implement `Sync`
= note: required because it appears within the type `Box<RefCell<isize>>`
= note: shared static variables must have a type that implements `Sync`
diff --git a/src/test/ui/issues/issue-75307.rs b/src/test/ui/issues/issue-75307.rs
index 2fe112a3b..cffa6bea8 100644
--- a/src/test/ui/issues/issue-75307.rs
+++ b/src/test/ui/issues/issue-75307.rs
@@ -1,3 +1,3 @@
fn main() {
- format!(r"{}{}{}", named_arg=1); //~ ERROR invalid reference to positional arguments 1 and 2
+ format!(r"{}{}{}", named_arg=1); //~ ERROR 3 positional arguments in format string, but there is 1 argument
}
diff --git a/src/test/ui/issues/issue-75307.stderr b/src/test/ui/issues/issue-75307.stderr
index 10c952006..c5b0b11e7 100644
--- a/src/test/ui/issues/issue-75307.stderr
+++ b/src/test/ui/issues/issue-75307.stderr
@@ -1,10 +1,8 @@
-error: invalid reference to positional arguments 1 and 2 (there is 1 argument)
- --> $DIR/issue-75307.rs:2:17
+error: 3 positional arguments in format string, but there is 1 argument
+ --> $DIR/issue-75307.rs:2:15
|
LL | format!(r"{}{}{}", named_arg=1);
- | ^^^^
- |
- = note: positional arguments are zero-based
+ | ^^^^^^ -
error: aborting due to previous error
diff --git a/src/test/ui/issues/issue-75907.rs b/src/test/ui/issues/issue-75907.rs
index 1534b6d07..6da99cf64 100644
--- a/src/test/ui/issues/issue-75907.rs
+++ b/src/test/ui/issues/issue-75907.rs
@@ -1,4 +1,4 @@
-// Test for for diagnostic improvement issue #75907
+// Test for diagnostic improvement issue #75907
mod foo {
pub(crate) struct Foo(u8);
diff --git a/src/test/ui/issues/issue-75907_b.rs b/src/test/ui/issues/issue-75907_b.rs
index e30747782..fdfc5907c 100644
--- a/src/test/ui/issues/issue-75907_b.rs
+++ b/src/test/ui/issues/issue-75907_b.rs
@@ -1,4 +1,4 @@
-// Test for for diagnostic improvement issue #75907, extern crate
+// Test for diagnostic improvement issue #75907, extern crate
// aux-build:issue-75907.rs
extern crate issue_75907 as a;
diff --git a/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs
index 2961dc79f..c089c3308 100644
--- a/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs
+++ b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs
@@ -8,8 +8,6 @@
*/
-#![feature(box_syntax)]
-
pub fn main() {}
trait A {
@@ -19,4 +17,4 @@ trait A {
impl<T: 'static> A for T {}
fn owned2<T: 'static>(a: Box<T>) { a as Box<dyn A>; }
-fn owned3<T: 'static>(a: Box<T>) { box a as Box<dyn A>; }
+fn owned3<T: 'static>(a: Box<T>) { Box::new(a) as Box<dyn A>; }
diff --git a/src/test/ui/issues/issue-77993-1.rs b/src/test/ui/issues/issue-77993-1.rs
deleted file mode 100644
index 515b3bc09..000000000
--- a/src/test/ui/issues/issue-77993-1.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-#[derive(Clone)]
-struct InGroup<F> {
- it: It,
- //~^ ERROR cannot find type `It` in this scope
- f: F,
-}
-fn dates_in_year() -> impl Clone {
- InGroup { f: |d| d }
- //~^ ERROR missing field `it` in initializer of `InGroup<_>`
-}
-
-fn main() {}
diff --git a/src/test/ui/issues/issue-77993-1.stderr b/src/test/ui/issues/issue-77993-1.stderr
deleted file mode 100644
index 3dc78ba6f..000000000
--- a/src/test/ui/issues/issue-77993-1.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0412]: cannot find type `It` in this scope
- --> $DIR/issue-77993-1.rs:3:9
- |
-LL | it: It,
- | ^^ not found in this scope
-
-error[E0063]: missing field `it` in initializer of `InGroup<_>`
- --> $DIR/issue-77993-1.rs:8:5
- |
-LL | InGroup { f: |d| d }
- | ^^^^^^^ missing `it`
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0063, E0412.
-For more information about an error, try `rustc --explain E0063`.
diff --git a/src/test/ui/issues/issue-78957.stderr b/src/test/ui/issues/issue-78957.stderr
index 45fa69d6f..6de22d6bf 100644
--- a/src/test/ui/issues/issue-78957.stderr
+++ b/src/test/ui/issues/issue-78957.stderr
@@ -10,12 +10,12 @@ error: attribute should be applied to a function definition
LL | pub struct Bar<#[cold] const N: usize>;
| ^^^^^^^ -------------- not a function definition
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: the lint level is defined here
--> $DIR/issue-78957.rs:1:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
error[E0517]: attribute should be applied to a struct, enum, or union
--> $DIR/issue-78957.rs:10:23
diff --git a/src/test/ui/issues/issue-86756.stderr b/src/test/ui/issues/issue-86756.stderr
index 399c940ca..693cfeced 100644
--- a/src/test/ui/issues/issue-86756.stderr
+++ b/src/test/ui/issues/issue-86756.stderr
@@ -20,14 +20,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | eq::<dyn, Foo>
| ^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
-LL - eq::<dyn, Foo>
-LL + eq::<dyn, dyn Foo>
- |
+LL | eq::<dyn, dyn Foo>
+ | +++
error[E0107]: missing generics for trait `Foo`
--> $DIR/issue-86756.rs:5:15
diff --git a/src/test/ui/issues/issue-8727.stderr b/src/test/ui/issues/issue-8727.stderr
index 10daba5ef..5e1fdad60 100644
--- a/src/test/ui/issues/issue-8727.stderr
+++ b/src/test/ui/issues/issue-8727.stderr
@@ -6,8 +6,8 @@ LL | fn generic<T>() {
LL | generic::<Option<T>>();
| ---------------------- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
error: reached the recursion limit while instantiating `generic::<Option<Option<Option<O...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
--> $DIR/issue-8727.rs:8:5
diff --git a/src/test/ui/issues/issue-87707.rs b/src/test/ui/issues/issue-87707.rs
index 26e9e2c8f..c14e52dfe 100644
--- a/src/test/ui/issues/issue-87707.rs
+++ b/src/test/ui/issues/issue-87707.rs
@@ -3,6 +3,7 @@
// run-fail
// exec-env:RUST_BACKTRACE=0
// check-run-results
+// needs-unwind uses catch_unwind
use std::sync::Once;
use std::panic;
diff --git a/src/test/ui/issues/issue-87707.run.stderr b/src/test/ui/issues/issue-87707.run.stderr
index e6c9ea0eb..527c78ba8 100644
--- a/src/test/ui/issues/issue-87707.run.stderr
+++ b/src/test/ui/issues/issue-87707.run.stderr
@@ -1,3 +1,3 @@
-thread 'main' panicked at 'Here Once instance is poisoned.', $DIR/issue-87707.rs:13:24
+thread 'main' panicked at 'Here Once instance is poisoned.', $DIR/issue-87707.rs:14:24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-thread 'main' panicked at 'Once instance has previously been poisoned', $DIR/issue-87707.rs:15:7
+thread 'main' panicked at 'Once instance has previously been poisoned', $DIR/issue-87707.rs:16:7
diff --git a/src/test/ui/issues/issue-9129.rs b/src/test/ui/issues/issue-9129.rs
index 780a6419c..04110b3ae 100644
--- a/src/test/ui/issues/issue-9129.rs
+++ b/src/test/ui/issues/issue-9129.rs
@@ -4,8 +4,6 @@
#![allow(non_snake_case)]
// ignore-pretty unreported
-#![feature(box_syntax)]
-
pub trait bomb { fn boom(&self, _: Ident); }
pub struct S;
impl bomb for S { fn boom(&self, _: Ident) { } }
@@ -29,6 +27,6 @@ pub fn light_fuse(fld: Box<dyn bomb>) {
}
pub fn main() {
- let b = box S as Box<dyn bomb>;
+ let b = Box::new(S) as Box<dyn bomb>;
light_fuse(b);
}
diff --git a/src/test/ui/issues/issue-9382.rs b/src/test/ui/issues/issue-9382.rs
index dbb0fa524..65718343f 100644
--- a/src/test/ui/issues/issue-9382.rs
+++ b/src/test/ui/issues/issue-9382.rs
@@ -3,7 +3,6 @@
// run-pass
#![allow(dead_code)]
-#![feature(box_syntax)]
// Tests for a previous bug that occurred due to an interaction
// between struct field initialization and the auto-coercion
@@ -24,11 +23,11 @@ struct Thing2<'a> {
pub fn main() {
let _t1_fixed = Thing1 {
baz: &[],
- bar: box 32,
+ bar: Box::new(32),
};
Thing1 {
baz: &Vec::new(),
- bar: box 32,
+ bar: Box::new(32),
};
let _t2_fixed = Thing2 {
baz: &[],
diff --git a/src/test/ui/issues/issue-99838.rs b/src/test/ui/issues/issue-99838.rs
index eaeeac72b..2e81d5e82 100644
--- a/src/test/ui/issues/issue-99838.rs
+++ b/src/test/ui/issues/issue-99838.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(bench_black_box)]
+
use std::hint;
struct U16(u16);
diff --git a/src/test/ui/issues/issue-99875.rs b/src/test/ui/issues/issue-99875.rs
new file mode 100644
index 000000000..cf73fd8d3
--- /dev/null
+++ b/src/test/ui/issues/issue-99875.rs
@@ -0,0 +1,16 @@
+struct Argument;
+struct Return;
+
+fn function(_: Argument) -> Return { todo!() }
+
+trait Trait {}
+impl Trait for fn(Argument) -> Return {}
+
+fn takes(_: impl Trait) {}
+
+fn main() {
+ takes(function);
+ //~^ ERROR the trait bound
+ takes(|_: Argument| -> Return { todo!() });
+ //~^ ERROR the trait bound
+}
diff --git a/src/test/ui/issues/issue-99875.stderr b/src/test/ui/issues/issue-99875.stderr
new file mode 100644
index 000000000..3ff8f12f1
--- /dev/null
+++ b/src/test/ui/issues/issue-99875.stderr
@@ -0,0 +1,33 @@
+error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied
+ --> $DIR/issue-99875.rs:12:11
+ |
+LL | takes(function);
+ | ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
+note: required by a bound in `takes`
+ --> $DIR/issue-99875.rs:9:18
+ |
+LL | fn takes(_: impl Trait) {}
+ | ^^^^^ required by this bound in `takes`
+
+error[E0277]: the trait bound `[closure@$DIR/issue-99875.rs:14:11: 14:34]: Trait` is not satisfied
+ --> $DIR/issue-99875.rs:14:11
+ |
+LL | takes(|_: Argument| -> Return { todo!() });
+ | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for closure `[closure@$DIR/issue-99875.rs:14:11: 14:34]`
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`
+note: required by a bound in `takes`
+ --> $DIR/issue-99875.rs:9:18
+ |
+LL | fn takes(_: impl Trait) {}
+ | ^^^^^ required by this bound in `takes`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/iterators/collect-into-array.rs b/src/test/ui/iterators/collect-into-array.rs
index a1144c8cb..7d35da825 100644
--- a/src/test/ui/iterators/collect-into-array.rs
+++ b/src/test/ui/iterators/collect-into-array.rs
@@ -4,4 +4,5 @@ fn main() {
//~^ ERROR an array of type `[u32; 10]` cannot be built directly from an iterator
//~| NOTE try collecting into a `Vec<{integer}>`, then using `.try_into()`
//~| NOTE required by a bound in `collect`
+ //~| NOTE required by a bound introduced by this call
}
diff --git a/src/test/ui/iterators/collect-into-array.stderr b/src/test/ui/iterators/collect-into-array.stderr
index 7be53a487..7fe9707e6 100644
--- a/src/test/ui/iterators/collect-into-array.stderr
+++ b/src/test/ui/iterators/collect-into-array.stderr
@@ -1,8 +1,10 @@
error[E0277]: an array of type `[u32; 10]` cannot be built directly from an iterator
- --> $DIR/collect-into-array.rs:3:39
+ --> $DIR/collect-into-array.rs:3:31
|
LL | let whatever: [u32; 10] = (0..10).collect();
- | ^^^^^^^ try collecting into a `Vec<{integer}>`, then using `.try_into()`
+ | ^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | try collecting into a `Vec<{integer}>`, then using `.try_into()`
|
= help: the trait `FromIterator<{integer}>` is not implemented for `[u32; 10]`
note: required by a bound in `collect`
diff --git a/src/test/ui/iterators/collect-into-slice.rs b/src/test/ui/iterators/collect-into-slice.rs
index aafa6bc8b..5eade0756 100644
--- a/src/test/ui/iterators/collect-into-slice.rs
+++ b/src/test/ui/iterators/collect-into-slice.rs
@@ -1,15 +1,20 @@
fn process_slice(data: &[i32]) {
//~^ NOTE required by a bound in this
+ //~| NOTE required by a bound in this
todo!()
}
fn main() {
let some_generated_vec = (0..10).collect();
//~^ ERROR the size for values of type `[i32]` cannot be known at compilation time
+ //~| ERROR the size for values of type `[i32]` cannot be known at compilation time
//~| ERROR a slice of type `[i32]` cannot be built since `[i32]` has no definite size
//~| NOTE try explicitly collecting into a `Vec<{integer}>`
//~| NOTE required by a bound in `collect`
+ //~| NOTE required by a bound in `collect`
//~| NOTE all local variables must have a statically known size
//~| NOTE doesn't have a size known at compile-time
+ //~| NOTE doesn't have a size known at compile-time
+ //~| NOTE required by a bound introduced by this call
process_slice(&some_generated_vec);
}
diff --git a/src/test/ui/iterators/collect-into-slice.stderr b/src/test/ui/iterators/collect-into-slice.stderr
index 4842e65fe..bce40118b 100644
--- a/src/test/ui/iterators/collect-into-slice.stderr
+++ b/src/test/ui/iterators/collect-into-slice.stderr
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
- --> $DIR/collect-into-slice.rs:7:9
+ --> $DIR/collect-into-slice.rs:8:9
|
LL | let some_generated_vec = (0..10).collect();
| ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -8,11 +8,26 @@ LL | let some_generated_vec = (0..10).collect();
= note: all local variables must have a statically known size
= help: unsized locals are gated as an unstable feature
+error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
+ --> $DIR/collect-into-slice.rs:8:38
+ |
+LL | let some_generated_vec = (0..10).collect();
+ | ^^^^^^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `Sized` is not implemented for `[i32]`
+note: required by a bound in `collect`
+ --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
+ |
+LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
+ | ^ required by this bound in `collect`
+
error[E0277]: a slice of type `[i32]` cannot be built since `[i32]` has no definite size
- --> $DIR/collect-into-slice.rs:7:38
+ --> $DIR/collect-into-slice.rs:8:30
|
LL | let some_generated_vec = (0..10).collect();
- | ^^^^^^^ try explicitly collecting into a `Vec<{integer}>`
+ | ^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | try explicitly collecting into a `Vec<{integer}>`
|
= help: the trait `FromIterator<{integer}>` is not implemented for `[i32]`
note: required by a bound in `collect`
@@ -21,6 +36,6 @@ note: required by a bound in `collect`
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/iterators/integral.stderr b/src/test/ui/iterators/integral.stderr
index 5e2744bab..047a71f98 100644
--- a/src/test/ui/iterators/integral.stderr
+++ b/src/test/ui/iterators/integral.stderr
@@ -6,7 +6,7 @@ LL | for _ in 42 {}
|
= help: the trait `Iterator` is not implemented for `{integer}`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `{integer}`
+ = note: required for `{integer}` to implement `IntoIterator`
error[E0277]: `u8` is not an iterator
--> $DIR/integral.rs:4:14
@@ -16,7 +16,7 @@ LL | for _ in 42 as u8 {}
|
= help: the trait `Iterator` is not implemented for `u8`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `u8`
+ = note: required for `u8` to implement `IntoIterator`
error[E0277]: `i8` is not an iterator
--> $DIR/integral.rs:6:14
@@ -26,7 +26,7 @@ LL | for _ in 42 as i8 {}
|
= help: the trait `Iterator` is not implemented for `i8`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `i8`
+ = note: required for `i8` to implement `IntoIterator`
error[E0277]: `u16` is not an iterator
--> $DIR/integral.rs:8:14
@@ -36,7 +36,7 @@ LL | for _ in 42 as u16 {}
|
= help: the trait `Iterator` is not implemented for `u16`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `u16`
+ = note: required for `u16` to implement `IntoIterator`
error[E0277]: `i16` is not an iterator
--> $DIR/integral.rs:10:14
@@ -46,7 +46,7 @@ LL | for _ in 42 as i16 {}
|
= help: the trait `Iterator` is not implemented for `i16`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `i16`
+ = note: required for `i16` to implement `IntoIterator`
error[E0277]: `u32` is not an iterator
--> $DIR/integral.rs:12:14
@@ -56,7 +56,7 @@ LL | for _ in 42 as u32 {}
|
= help: the trait `Iterator` is not implemented for `u32`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `u32`
+ = note: required for `u32` to implement `IntoIterator`
error[E0277]: `i32` is not an iterator
--> $DIR/integral.rs:14:14
@@ -66,7 +66,7 @@ LL | for _ in 42 as i32 {}
|
= help: the trait `Iterator` is not implemented for `i32`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `i32`
+ = note: required for `i32` to implement `IntoIterator`
error[E0277]: `u64` is not an iterator
--> $DIR/integral.rs:16:14
@@ -76,7 +76,7 @@ LL | for _ in 42 as u64 {}
|
= help: the trait `Iterator` is not implemented for `u64`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `u64`
+ = note: required for `u64` to implement `IntoIterator`
error[E0277]: `i64` is not an iterator
--> $DIR/integral.rs:18:14
@@ -86,7 +86,7 @@ LL | for _ in 42 as i64 {}
|
= help: the trait `Iterator` is not implemented for `i64`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `i64`
+ = note: required for `i64` to implement `IntoIterator`
error[E0277]: `usize` is not an iterator
--> $DIR/integral.rs:20:14
@@ -96,7 +96,7 @@ LL | for _ in 42 as usize {}
|
= help: the trait `Iterator` is not implemented for `usize`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `usize`
+ = note: required for `usize` to implement `IntoIterator`
error[E0277]: `isize` is not an iterator
--> $DIR/integral.rs:22:14
@@ -106,7 +106,7 @@ LL | for _ in 42 as isize {}
|
= help: the trait `Iterator` is not implemented for `isize`
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `isize`
+ = note: required for `isize` to implement `IntoIterator`
error[E0277]: `{float}` is not an iterator
--> $DIR/integral.rs:24:14
@@ -115,7 +115,7 @@ LL | for _ in 42.0 {}
| ^^^^ `{float}` is not an iterator
|
= help: the trait `Iterator` is not implemented for `{float}`
- = note: required because of the requirements on the impl of `IntoIterator` for `{float}`
+ = note: required for `{float}` to implement `IntoIterator`
error: aborting due to 12 previous errors
diff --git a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
index 9b3125058..2378476e5 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
+++ b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr
@@ -4,9 +4,9 @@ warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (du
LL | let _: Iter<'_, i32> = array.into_iter();
| ^^^^^^^^^
|
- = note: `#[warn(array_into_iter)]` on by default
= warning: this changes meaning in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+ = note: `#[warn(array_into_iter)]` on by default
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | let _: Iter<'_, i32> = array.iter();
diff --git a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
index e32d35d86..2fde276fa 100644
--- a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
+++ b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr
@@ -4,9 +4,9 @@ warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (du
LL | small.into_iter();
| ^^^^^^^^^
|
- = note: `#[warn(array_into_iter)]` on by default
= warning: this changes meaning in Rust 2021
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
+ = note: `#[warn(array_into_iter)]` on by default
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | small.iter();
diff --git a/src/test/ui/iterators/issue-28098.rs b/src/test/ui/iterators/issue-28098.rs
index 62a90d90d..80c77edae 100644
--- a/src/test/ui/iterators/issue-28098.rs
+++ b/src/test/ui/iterators/issue-28098.rs
@@ -2,12 +2,14 @@ fn main() {
let _ = Iterator::next(&mut ());
//~^ ERROR `()` is not an iterator
//~| ERROR `()` is not an iterator
+ //~| ERROR `()` is not an iterator
for _ in false {}
//~^ ERROR `bool` is not an iterator
let _ = Iterator::next(&mut ());
//~^ ERROR `()` is not an iterator
+ //~| ERROR `()` is not an iterator
other()
}
@@ -18,9 +20,11 @@ pub fn other() {
let _ = Iterator::next(&mut ());
//~^ ERROR `()` is not an iterator
//~| ERROR `()` is not an iterator
+ //~| ERROR `()` is not an iterator
let _ = Iterator::next(&mut ());
//~^ ERROR `()` is not an iterator
+ //~| ERROR `()` is not an iterator
for _ in false {}
//~^ ERROR `bool` is not an iterator
diff --git a/src/test/ui/iterators/issue-28098.stderr b/src/test/ui/iterators/issue-28098.stderr
index 3beb99292..3256e57d4 100644
--- a/src/test/ui/iterators/issue-28098.stderr
+++ b/src/test/ui/iterators/issue-28098.stderr
@@ -8,17 +8,25 @@ LL | let _ = Iterator::next(&mut ());
|
= help: the trait `Iterator` is not implemented for `()`
+error[E0277]: `()` is not an iterator
+ --> $DIR/issue-28098.rs:2:13
+ |
+LL | let _ = Iterator::next(&mut ());
+ | ^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator
+ |
+ = help: the trait `Iterator` is not implemented for `()`
+
error[E0277]: `bool` is not an iterator
- --> $DIR/issue-28098.rs:6:14
+ --> $DIR/issue-28098.rs:7:14
|
LL | for _ in false {}
| ^^^^^ `bool` is not an iterator
|
= help: the trait `Iterator` is not implemented for `bool`
- = note: required because of the requirements on the impl of `IntoIterator` for `bool`
+ = note: required for `bool` to implement `IntoIterator`
error[E0277]: `()` is not an iterator
- --> $DIR/issue-28098.rs:9:28
+ --> $DIR/issue-28098.rs:10:28
|
LL | let _ = Iterator::next(&mut ());
| -------------- ^^^^^^^ `()` is not an iterator
@@ -28,6 +36,14 @@ LL | let _ = Iterator::next(&mut ());
= help: the trait `Iterator` is not implemented for `()`
error[E0277]: `()` is not an iterator
+ --> $DIR/issue-28098.rs:10:13
+ |
+LL | let _ = Iterator::next(&mut ());
+ | ^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator
+ |
+ = help: the trait `Iterator` is not implemented for `()`
+
+error[E0277]: `()` is not an iterator
--> $DIR/issue-28098.rs:2:13
|
LL | let _ = Iterator::next(&mut ());
@@ -36,7 +52,7 @@ LL | let _ = Iterator::next(&mut ());
= help: the trait `Iterator` is not implemented for `()`
error[E0277]: `()` is not an iterator
- --> $DIR/issue-28098.rs:18:28
+ --> $DIR/issue-28098.rs:20:28
|
LL | let _ = Iterator::next(&mut ());
| -------------- ^^^^^^^ `()` is not an iterator
@@ -46,7 +62,15 @@ LL | let _ = Iterator::next(&mut ());
= help: the trait `Iterator` is not implemented for `()`
error[E0277]: `()` is not an iterator
- --> $DIR/issue-28098.rs:22:28
+ --> $DIR/issue-28098.rs:20:13
+ |
+LL | let _ = Iterator::next(&mut ());
+ | ^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator
+ |
+ = help: the trait `Iterator` is not implemented for `()`
+
+error[E0277]: `()` is not an iterator
+ --> $DIR/issue-28098.rs:25:28
|
LL | let _ = Iterator::next(&mut ());
| -------------- ^^^^^^^ `()` is not an iterator
@@ -55,23 +79,31 @@ LL | let _ = Iterator::next(&mut ());
|
= help: the trait `Iterator` is not implemented for `()`
+error[E0277]: `()` is not an iterator
+ --> $DIR/issue-28098.rs:25:13
+ |
+LL | let _ = Iterator::next(&mut ());
+ | ^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator
+ |
+ = help: the trait `Iterator` is not implemented for `()`
+
error[E0277]: `bool` is not an iterator
- --> $DIR/issue-28098.rs:25:14
+ --> $DIR/issue-28098.rs:29:14
|
LL | for _ in false {}
| ^^^^^ `bool` is not an iterator
|
= help: the trait `Iterator` is not implemented for `bool`
- = note: required because of the requirements on the impl of `IntoIterator` for `bool`
+ = note: required for `bool` to implement `IntoIterator`
error[E0277]: `()` is not an iterator
- --> $DIR/issue-28098.rs:18:13
+ --> $DIR/issue-28098.rs:20:13
|
LL | let _ = Iterator::next(&mut ());
| ^^^^^^^^^^^^^^ `()` is not an iterator
|
= help: the trait `Iterator` is not implemented for `()`
-error: aborting due to 8 previous errors
+error: aborting due to 12 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/iterators/issue-58952-filter-type-length.rs b/src/test/ui/iterators/issue-58952-filter-type-length.rs
index ffbe89a14..6d12db8d1 100644
--- a/src/test/ui/iterators/issue-58952-filter-type-length.rs
+++ b/src/test/ui/iterators/issue-58952-filter-type-length.rs
@@ -1,6 +1,6 @@
// run-pass
//! This snippet causes the type length to blowup exponentially,
-//! so check that we don't accidentially exceed the type length limit.
+//! so check that we don't accidentally exceed the type length limit.
// FIXME: Once the size of iterator adaptors is further reduced,
// increase the complexity of this test.
use std::collections::VecDeque;
diff --git a/src/test/ui/iterators/iter-count-overflow-debug.rs b/src/test/ui/iterators/iter-count-overflow-debug.rs
index 15f25f1ca..8e59c11e9 100644
--- a/src/test/ui/iterators/iter-count-overflow-debug.rs
+++ b/src/test/ui/iterators/iter-count-overflow-debug.rs
@@ -1,7 +1,6 @@
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3
use std::panic;
diff --git a/src/test/ui/iterators/iter-position-overflow-debug.rs b/src/test/ui/iterators/iter-position-overflow-debug.rs
index 65124c282..7a871e744 100644
--- a/src/test/ui/iterators/iter-position-overflow-debug.rs
+++ b/src/test/ui/iterators/iter-position-overflow-debug.rs
@@ -1,7 +1,6 @@
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3
use std::panic;
diff --git a/src/test/ui/iterators/iter-step-overflow-debug.rs b/src/test/ui/iterators/iter-step-overflow-debug.rs
index e16f984de..6aa349ebe 100644
--- a/src/test/ui/iterators/iter-step-overflow-debug.rs
+++ b/src/test/ui/iterators/iter-step-overflow-debug.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes
use std::panic;
diff --git a/src/test/ui/iterators/iter-sum-overflow-debug.rs b/src/test/ui/iterators/iter-sum-overflow-debug.rs
index d8ce43848..24c764ff9 100644
--- a/src/test/ui/iterators/iter-sum-overflow-debug.rs
+++ b/src/test/ui/iterators/iter-sum-overflow-debug.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes
use std::panic;
diff --git a/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs b/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
index bc8dcbdbb..be45c075d 100644
--- a/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
+++ b/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C overflow-checks
use std::panic;
diff --git a/src/test/ui/iterators/ranges.stderr b/src/test/ui/iterators/ranges.stderr
index 440a8960a..b9fbcd530 100644
--- a/src/test/ui/iterators/ranges.stderr
+++ b/src/test/ui/iterators/ranges.stderr
@@ -6,7 +6,7 @@ LL | for _ in ..10 {}
|
= help: the trait `Iterator` is not implemented for `RangeTo<{integer}>`
= note: `..end` is a `RangeTo`, which cannot be iterated on; you might have meant to have a bounded `Range`: `0..end`
- = note: required because of the requirements on the impl of `IntoIterator` for `RangeTo<{integer}>`
+ = note: required for `RangeTo<{integer}>` to implement `IntoIterator`
error[E0277]: `RangeToInclusive<{integer}>` is not an iterator
--> $DIR/ranges.rs:4:14
@@ -16,7 +16,7 @@ LL | for _ in ..=10 {}
|
= help: the trait `Iterator` is not implemented for `RangeToInclusive<{integer}>`
= note: `..=end` is a `RangeToInclusive`, which cannot be iterated on; you might have meant to have a bounded `RangeInclusive`: `0..=end`
- = note: required because of the requirements on the impl of `IntoIterator` for `RangeToInclusive<{integer}>`
+ = note: required for `RangeToInclusive<{integer}>` to implement `IntoIterator`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/iterators/string.stderr b/src/test/ui/iterators/string.stderr
index d9c40fe1b..ddfe0169b 100644
--- a/src/test/ui/iterators/string.stderr
+++ b/src/test/ui/iterators/string.stderr
@@ -5,7 +5,7 @@ LL | for _ in "".to_owned() {}
| ^^^^^^^^^^^^^ `String` is not an iterator; try calling `.chars()` or `.bytes()`
|
= help: the trait `Iterator` is not implemented for `String`
- = note: required because of the requirements on the impl of `IntoIterator` for `String`
+ = note: required for `String` to implement `IntoIterator`
error[E0277]: `&str` is not an iterator
--> $DIR/string.rs:4:14
@@ -14,7 +14,7 @@ LL | for _ in "" {}
| ^^ `&str` is not an iterator; try calling `.chars()` or `.bytes()`
|
= help: the trait `Iterator` is not implemented for `&str`
- = note: required because of the requirements on the impl of `IntoIterator` for `&str`
+ = note: required for `&str` to implement `IntoIterator`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/json-multiple.stderr b/src/test/ui/json-multiple.stderr
deleted file mode 100644
index 7ed345113..000000000
--- a/src/test/ui/json-multiple.stderr
+++ /dev/null
@@ -1 +0,0 @@
-{"artifact":"$TEST_BUILD_DIR/json-multiple/libjson_multiple.rlib","emit":"link"}
diff --git a/src/test/ui/json-options.stderr b/src/test/ui/json-options.stderr
deleted file mode 100644
index 24977731d..000000000
--- a/src/test/ui/json-options.stderr
+++ /dev/null
@@ -1 +0,0 @@
-{"artifact":"$TEST_BUILD_DIR/json-options/libjson_options.rlib","emit":"link"}
diff --git a/src/test/ui/json-and-color.rs b/src/test/ui/json/json-and-color.rs
index 6f8326fe2..6f8326fe2 100644
--- a/src/test/ui/json-and-color.rs
+++ b/src/test/ui/json/json-and-color.rs
diff --git a/src/test/ui/json-and-color.stderr b/src/test/ui/json/json-and-color.stderr
index 1cda6af09..1cda6af09 100644
--- a/src/test/ui/json-and-color.stderr
+++ b/src/test/ui/json/json-and-color.stderr
diff --git a/src/test/ui/json-and-error-format.rs b/src/test/ui/json/json-and-error-format.rs
index 6e2d73c76..6e2d73c76 100644
--- a/src/test/ui/json-and-error-format.rs
+++ b/src/test/ui/json/json-and-error-format.rs
diff --git a/src/test/ui/json-and-error-format.stderr b/src/test/ui/json/json-and-error-format.stderr
index 80e022137..80e022137 100644
--- a/src/test/ui/json-and-error-format.stderr
+++ b/src/test/ui/json/json-and-error-format.stderr
diff --git a/src/test/ui/json-bom-plus-crlf-multifile-aux.rs b/src/test/ui/json/json-bom-plus-crlf-multifile-aux.rs
index 991ea1d85..991ea1d85 100644
--- a/src/test/ui/json-bom-plus-crlf-multifile-aux.rs
+++ b/src/test/ui/json/json-bom-plus-crlf-multifile-aux.rs
diff --git a/src/test/ui/json-bom-plus-crlf-multifile.rs b/src/test/ui/json/json-bom-plus-crlf-multifile.rs
index 9290e0104..9290e0104 100644
--- a/src/test/ui/json-bom-plus-crlf-multifile.rs
+++ b/src/test/ui/json/json-bom-plus-crlf-multifile.rs
diff --git a/src/test/ui/json-bom-plus-crlf-multifile.stderr b/src/test/ui/json/json-bom-plus-crlf-multifile.stderr
index 02f3bc687..02f3bc687 100644
--- a/src/test/ui/json-bom-plus-crlf-multifile.stderr
+++ b/src/test/ui/json/json-bom-plus-crlf-multifile.stderr
diff --git a/src/test/ui/json-bom-plus-crlf.rs b/src/test/ui/json/json-bom-plus-crlf.rs
index be5b7dd2a..be5b7dd2a 100644
--- a/src/test/ui/json-bom-plus-crlf.rs
+++ b/src/test/ui/json/json-bom-plus-crlf.rs
diff --git a/src/test/ui/json-bom-plus-crlf.stderr b/src/test/ui/json/json-bom-plus-crlf.stderr
index df6bd7286..df6bd7286 100644
--- a/src/test/ui/json-bom-plus-crlf.stderr
+++ b/src/test/ui/json/json-bom-plus-crlf.stderr
diff --git a/src/test/ui/json-invalid.rs b/src/test/ui/json/json-invalid.rs
index 54d0dd184..54d0dd184 100644
--- a/src/test/ui/json-invalid.rs
+++ b/src/test/ui/json/json-invalid.rs
diff --git a/src/test/ui/json-invalid.stderr b/src/test/ui/json/json-invalid.stderr
index 18bc76ab7..18bc76ab7 100644
--- a/src/test/ui/json-invalid.stderr
+++ b/src/test/ui/json/json-invalid.stderr
diff --git a/src/test/ui/json-multiple.polonius.stderr b/src/test/ui/json/json-multiple.polonius.stderr
index 0e4d442f2..0e4d442f2 100644
--- a/src/test/ui/json-multiple.polonius.stderr
+++ b/src/test/ui/json/json-multiple.polonius.stderr
diff --git a/src/test/ui/json-multiple.rs b/src/test/ui/json/json-multiple.rs
index fb126339d..fb126339d 100644
--- a/src/test/ui/json-multiple.rs
+++ b/src/test/ui/json/json-multiple.rs
diff --git a/src/test/ui/json/json-multiple.stderr b/src/test/ui/json/json-multiple.stderr
new file mode 100644
index 000000000..55ccfd5fa
--- /dev/null
+++ b/src/test/ui/json/json-multiple.stderr
@@ -0,0 +1 @@
+{"artifact":"$TEST_BUILD_DIR/json/json-multiple/libjson_multiple.rlib","emit":"link"}
diff --git a/src/test/ui/json-options.polonius.stderr b/src/test/ui/json/json-options.polonius.stderr
index e21f6f85d..e21f6f85d 100644
--- a/src/test/ui/json-options.polonius.stderr
+++ b/src/test/ui/json/json-options.polonius.stderr
diff --git a/src/test/ui/json-options.rs b/src/test/ui/json/json-options.rs
index 8b6ba131e..8b6ba131e 100644
--- a/src/test/ui/json-options.rs
+++ b/src/test/ui/json/json-options.rs
diff --git a/src/test/ui/json/json-options.stderr b/src/test/ui/json/json-options.stderr
new file mode 100644
index 000000000..645a26f5a
--- /dev/null
+++ b/src/test/ui/json/json-options.stderr
@@ -0,0 +1 @@
+{"artifact":"$TEST_BUILD_DIR/json/json-options/libjson_options.rlib","emit":"link"}
diff --git a/src/test/ui/json-short.rs b/src/test/ui/json/json-short.rs
index 7414a5586..7414a5586 100644
--- a/src/test/ui/json-short.rs
+++ b/src/test/ui/json/json-short.rs
diff --git a/src/test/ui/json-short.stderr b/src/test/ui/json/json-short.stderr
index 3bd85b083..3bd85b083 100644
--- a/src/test/ui/json-short.stderr
+++ b/src/test/ui/json/json-short.stderr
diff --git a/src/test/ui/keyword/keyword-self-as-type-param.stderr b/src/test/ui/keyword/keyword-self-as-type-param.stderr
index 419652e13..5aef94754 100644
--- a/src/test/ui/keyword/keyword-self-as-type-param.stderr
+++ b/src/test/ui/keyword/keyword-self-as-type-param.stderr
@@ -19,10 +19,8 @@ error[E0072]: recursive type `Foo` has infinite size
|
LL | struct Foo<Self>(Self);
| ^^^^^^^^^^^^^^^^ ---- recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | struct Foo<Self>(Box<Self>);
| ++++ +
diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.rs b/src/test/ui/kindck/kindck-impl-type-params-2.rs
index 8b0771985..8950fc51e 100644
--- a/src/test/ui/kindck/kindck-impl-type-params-2.rs
+++ b/src/test/ui/kindck/kindck-impl-type-params-2.rs
@@ -11,5 +11,5 @@ fn take_param<T:Foo>(foo: &T) { }
fn main() {
let x: Box<_> = Box::new(3);
take_param(&x);
- //~^ ERROR the trait bound `Box<{integer}>: Foo` is not satisfied
+ //~^ ERROR the trait bound `Box<{integer}>: Copy` is not satisfied
}
diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.stderr b/src/test/ui/kindck/kindck-impl-type-params-2.stderr
index 89975e968..930d96375 100644
--- a/src/test/ui/kindck/kindck-impl-type-params-2.stderr
+++ b/src/test/ui/kindck/kindck-impl-type-params-2.stderr
@@ -1,4 +1,4 @@
-error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
+error[E0277]: the trait bound `Box<{integer}>: Copy` is not satisfied
--> $DIR/kindck-impl-type-params-2.rs:13:16
|
LL | take_param(&x);
@@ -6,7 +6,7 @@ LL | take_param(&x);
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Foo` for `Box<{integer}>`
+note: required for `Box<{integer}>` to implement `Foo`
--> $DIR/kindck-impl-type-params-2.rs:6:14
|
LL | impl<T:Copy> Foo for T {
diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr
index 902349135..8dbe0c38c 100644
--- a/src/test/ui/kindck/kindck-impl-type-params.stderr
+++ b/src/test/ui/kindck/kindck-impl-type-params.stderr
@@ -4,7 +4,7 @@ error[E0277]: `T` cannot be sent between threads safely
LL | let a = &t as &dyn Gettable<T>;
| ^^ `T` cannot be sent between threads safely
|
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
+note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
@@ -21,7 +21,7 @@ error[E0277]: the trait bound `T: Copy` is not satisfied
LL | let a = &t as &dyn Gettable<T>;
| ^^ the trait `Copy` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
+note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
@@ -38,7 +38,7 @@ error[E0277]: `T` cannot be sent between threads safely
LL | let a: &dyn Gettable<T> = &t;
| ^^ `T` cannot be sent between threads safely
|
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
+note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
@@ -55,7 +55,7 @@ error[E0277]: the trait bound `T: Copy` is not satisfied
LL | let a: &dyn Gettable<T> = &t;
| ^^ the trait `Copy` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`
+note: required for `S<T>` to implement `Gettable<T>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
@@ -73,7 +73,7 @@ LL | let a = t as Box<dyn Gettable<String>>;
| ^ the trait `Copy` is not implemented for `String`
|
= help: the trait `Gettable<T>` is implemented for `S<T>`
-note: required because of the requirements on the impl of `Gettable<String>` for `S<String>`
+note: required for `S<String>` to implement `Gettable<String>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
@@ -87,7 +87,7 @@ LL | let a: Box<dyn Gettable<Foo>> = t;
| ^ the trait `Copy` is not implemented for `Foo`
|
= help: the trait `Gettable<T>` is implemented for `S<T>`
-note: required because of the requirements on the impl of `Gettable<Foo>` for `S<Foo>`
+note: required for `S<Foo>` to implement `Gettable<Foo>`
--> $DIR/kindck-impl-type-params.rs:12:32
|
LL | impl<T: Send + Copy + 'static> Gettable<T> for S<T> {}
diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr
index 016cd393c..e81d2441e 100644
--- a/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr
+++ b/src/test/ui/kindck/kindck-inherited-copy-bound.curr.stderr
@@ -1,4 +1,4 @@
-error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
+error[E0277]: the trait bound `Box<{integer}>: Copy` is not satisfied
--> $DIR/kindck-inherited-copy-bound.rs:21:16
|
LL | take_param(&x);
@@ -6,7 +6,7 @@ LL | take_param(&x);
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Foo` for `Box<{integer}>`
+note: required for `Box<{integer}>` to implement `Foo`
--> $DIR/kindck-inherited-copy-bound.rs:14:14
|
LL | impl<T:Copy> Foo for T {
@@ -44,7 +44,7 @@ LL | trait Foo : Copy {
| --- ^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Foo>` for `&Box<{integer}>`
+ = note: required for `&Box<{integer}>` to implement `CoerceUnsized<&dyn Foo>`
= note: required by cast to type `&dyn Foo`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
index eaf34dff4..2380533b9 100644
--- a/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
+++ b/src/test/ui/kindck/kindck-inherited-copy-bound.object_safe_for_dispatch.stderr
@@ -1,4 +1,4 @@
-error[E0277]: the trait bound `Box<{integer}>: Foo` is not satisfied
+error[E0277]: the trait bound `Box<{integer}>: Copy` is not satisfied
--> $DIR/kindck-inherited-copy-bound.rs:21:16
|
LL | take_param(&x);
@@ -6,7 +6,7 @@ LL | take_param(&x);
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Foo` for `Box<{integer}>`
+note: required for `Box<{integer}>` to implement `Foo`
--> $DIR/kindck-inherited-copy-bound.rs:14:14
|
LL | impl<T:Copy> Foo for T {
@@ -30,7 +30,7 @@ LL | trait Foo : Copy {
| --- ^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Foo>` for `&Box<i32>`
+ = note: required for `&Box<i32>` to implement `CoerceUnsized<&dyn Foo>`
= note: required by cast to type `&dyn Foo`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/kindck/kindck-nonsendable-1.stderr b/src/test/ui/kindck/kindck-nonsendable-1.stderr
index eab003a11..cc6e1f59c 100644
--- a/src/test/ui/kindck/kindck-nonsendable-1.stderr
+++ b/src/test/ui/kindck/kindck-nonsendable-1.stderr
@@ -1,10 +1,12 @@
error[E0277]: `Rc<usize>` cannot be sent between threads safely
- --> $DIR/kindck-nonsendable-1.rs:9:5
+ --> $DIR/kindck-nonsendable-1.rs:9:9
|
LL | bar(move|| foo(x));
- | ^^^ ------ within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:15]`
- | |
- | `Rc<usize>` cannot be sent between threads safely
+ | --- ------^^^^^^^
+ | | |
+ | | `Rc<usize>` cannot be sent between threads safely
+ | | within this `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:15]`
+ | required by a bound introduced by this call
|
= help: within `[closure@$DIR/kindck-nonsendable-1.rs:9:9: 9:15]`, the trait `Send` is not implemented for `Rc<usize>`
note: required because it's used within this closure
diff --git a/src/test/ui/kindck/kindck-send-object.stderr b/src/test/ui/kindck/kindck-send-object.stderr
index f14983a51..e9bbeeacd 100644
--- a/src/test/ui/kindck/kindck-send-object.stderr
+++ b/src/test/ui/kindck/kindck-send-object.stderr
@@ -1,11 +1,11 @@
error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely
- --> $DIR/kindck-send-object.rs:12:5
+ --> $DIR/kindck-send-object.rs:12:19
|
LL | assert_send::<&'static (dyn Dummy + 'static)>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)`
- = note: required because of the requirements on the impl of `Send` for `&'static (dyn Dummy + 'static)`
+ = note: required for `&'static (dyn Dummy + 'static)` to implement `Send`
note: required by a bound in `assert_send`
--> $DIR/kindck-send-object.rs:5:18
|
@@ -13,13 +13,13 @@ LL | fn assert_send<T:Send>() { }
| ^^^^ required by this bound in `assert_send`
error[E0277]: `dyn Dummy` cannot be sent between threads safely
- --> $DIR/kindck-send-object.rs:17:5
+ --> $DIR/kindck-send-object.rs:17:19
|
LL | assert_send::<Box<dyn Dummy>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
+ | ^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `dyn Dummy`
- = note: required because of the requirements on the impl of `Send` for `Unique<dyn Dummy>`
+ = note: required for `Unique<dyn Dummy>` to implement `Send`
= note: required because it appears within the type `Box<dyn Dummy>`
note: required by a bound in `assert_send`
--> $DIR/kindck-send-object.rs:5:18
diff --git a/src/test/ui/kindck/kindck-send-object1.stderr b/src/test/ui/kindck/kindck-send-object1.stderr
index 1f5e21cbf..11f597fee 100644
--- a/src/test/ui/kindck/kindck-send-object1.stderr
+++ b/src/test/ui/kindck/kindck-send-object1.stderr
@@ -1,11 +1,11 @@
error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely
- --> $DIR/kindck-send-object1.rs:10:5
+ --> $DIR/kindck-send-object1.rs:10:19
|
LL | assert_send::<&'a dyn Dummy>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
+ | ^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)`
- = note: required because of the requirements on the impl of `Send` for `&'a (dyn Dummy + 'a)`
+ = note: required for `&'a (dyn Dummy + 'a)` to implement `Send`
note: required by a bound in `assert_send`
--> $DIR/kindck-send-object1.rs:5:18
|
@@ -13,13 +13,13 @@ LL | fn assert_send<T:Send+'static>() { }
| ^^^^ required by this bound in `assert_send`
error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely
- --> $DIR/kindck-send-object1.rs:28:5
+ --> $DIR/kindck-send-object1.rs:28:19
|
LL | assert_send::<Box<dyn Dummy + 'a>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely
+ | ^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `(dyn Dummy + 'a)`
- = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Dummy + 'a)>`
+ = note: required for `Unique<(dyn Dummy + 'a)>` to implement `Send`
= note: required because it appears within the type `Box<(dyn Dummy + 'a)>`
note: required by a bound in `assert_send`
--> $DIR/kindck-send-object1.rs:5:18
diff --git a/src/test/ui/kindck/kindck-send-object2.stderr b/src/test/ui/kindck/kindck-send-object2.stderr
index 527127e95..b8af33d0d 100644
--- a/src/test/ui/kindck/kindck-send-object2.stderr
+++ b/src/test/ui/kindck/kindck-send-object2.stderr
@@ -1,11 +1,11 @@
error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely
- --> $DIR/kindck-send-object2.rs:7:5
+ --> $DIR/kindck-send-object2.rs:7:19
|
LL | assert_send::<&'static dyn Dummy>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
+ | ^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)`
- = note: required because of the requirements on the impl of `Send` for `&'static (dyn Dummy + 'static)`
+ = note: required for `&'static (dyn Dummy + 'static)` to implement `Send`
note: required by a bound in `assert_send`
--> $DIR/kindck-send-object2.rs:3:18
|
@@ -13,13 +13,13 @@ LL | fn assert_send<T:Send>() { }
| ^^^^ required by this bound in `assert_send`
error[E0277]: `dyn Dummy` cannot be sent between threads safely
- --> $DIR/kindck-send-object2.rs:12:5
+ --> $DIR/kindck-send-object2.rs:12:19
|
LL | assert_send::<Box<dyn Dummy>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
+ | ^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `dyn Dummy`
- = note: required because of the requirements on the impl of `Send` for `Unique<dyn Dummy>`
+ = note: required for `Unique<dyn Dummy>` to implement `Send`
= note: required because it appears within the type `Box<dyn Dummy>`
note: required by a bound in `assert_send`
--> $DIR/kindck-send-object2.rs:3:18
diff --git a/src/test/ui/kindck/kindck-send-owned.stderr b/src/test/ui/kindck/kindck-send-owned.stderr
index 454291aa9..b03f56465 100644
--- a/src/test/ui/kindck/kindck-send-owned.stderr
+++ b/src/test/ui/kindck/kindck-send-owned.stderr
@@ -1,11 +1,11 @@
error[E0277]: `*mut u8` cannot be sent between threads safely
- --> $DIR/kindck-send-owned.rs:12:5
+ --> $DIR/kindck-send-owned.rs:12:19
|
LL | assert_send::<Box<*mut u8>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut u8` cannot be sent between threads safely
+ | ^^^^^^^^^^^^ `*mut u8` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `*mut u8`
- = note: required because of the requirements on the impl of `Send` for `Unique<*mut u8>`
+ = note: required for `Unique<*mut u8>` to implement `Send`
= note: required because it appears within the type `Box<*mut u8>`
note: required by a bound in `assert_send`
--> $DIR/kindck-send-owned.rs:3:18
diff --git a/src/test/ui/label/label_break_value_continue.rs b/src/test/ui/label/label_break_value_continue.rs
index e0deb30c9..22172f4fd 100644
--- a/src/test/ui/label/label_break_value_continue.rs
+++ b/src/test/ui/label/label_break_value_continue.rs
@@ -1,4 +1,3 @@
-#![feature(label_break_value)]
#![allow(unused_labels)]
// Simple continue pointing to an unlabeled break should yield in an error
diff --git a/src/test/ui/label/label_break_value_continue.stderr b/src/test/ui/label/label_break_value_continue.stderr
index 9b8693dc5..284d213d6 100644
--- a/src/test/ui/label/label_break_value_continue.stderr
+++ b/src/test/ui/label/label_break_value_continue.stderr
@@ -1,11 +1,11 @@
error[E0695]: unlabeled `continue` inside of a labeled block
- --> $DIR/label_break_value_continue.rs:7:9
+ --> $DIR/label_break_value_continue.rs:6:9
|
LL | continue;
| ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label
error[E0696]: `continue` pointing to a labeled block
- --> $DIR/label_break_value_continue.rs:14:9
+ --> $DIR/label_break_value_continue.rs:13:9
|
LL | / 'b: {
LL | | continue 'b;
@@ -14,7 +14,7 @@ LL | | }
| |_____- labeled block the `continue` points to
error[E0695]: unlabeled `continue` inside of a labeled block
- --> $DIR/label_break_value_continue.rs:22:13
+ --> $DIR/label_break_value_continue.rs:21:13
|
LL | continue;
| ^^^^^^^^ `continue` statements that would diverge to or through a labeled block need to bear a label
diff --git a/src/test/ui/label/label_break_value_desugared_break.rs b/src/test/ui/label/label_break_value_desugared_break.rs
index de883b611..70227d869 100644
--- a/src/test/ui/label/label_break_value_desugared_break.rs
+++ b/src/test/ui/label/label_break_value_desugared_break.rs
@@ -1,5 +1,5 @@
// compile-flags: --edition 2018
-#![feature(label_break_value, try_blocks)]
+#![feature(try_blocks)]
// run-pass
fn main() {
@@ -9,4 +9,11 @@ fn main() {
break 'foo;
}
};
+
+ 'foo: {
+ let _: Result<(), ()> = try {
+ Err(())?;
+ break 'foo;
+ };
+ }
}
diff --git a/src/test/ui/label/label_break_value_illegal_uses.fixed b/src/test/ui/label/label_break_value_illegal_uses.fixed
index c1d2023a2..fb75276b4 100644
--- a/src/test/ui/label/label_break_value_illegal_uses.fixed
+++ b/src/test/ui/label/label_break_value_illegal_uses.fixed
@@ -1,5 +1,4 @@
// run-rustfix
-#![feature(label_break_value)]
// These are forbidden occurrences of label-break-value
diff --git a/src/test/ui/label/label_break_value_illegal_uses.rs b/src/test/ui/label/label_break_value_illegal_uses.rs
index 5b20c95e5..3cbf41380 100644
--- a/src/test/ui/label/label_break_value_illegal_uses.rs
+++ b/src/test/ui/label/label_break_value_illegal_uses.rs
@@ -1,5 +1,4 @@
// run-rustfix
-#![feature(label_break_value)]
// These are forbidden occurrences of label-break-value
diff --git a/src/test/ui/label/label_break_value_illegal_uses.stderr b/src/test/ui/label/label_break_value_illegal_uses.stderr
index 24b733fec..15016ffd5 100644
--- a/src/test/ui/label/label_break_value_illegal_uses.stderr
+++ b/src/test/ui/label/label_break_value_illegal_uses.stderr
@@ -1,23 +1,23 @@
error: block label not supported here
- --> $DIR/label_break_value_illegal_uses.rs:8:12
+ --> $DIR/label_break_value_illegal_uses.rs:7:12
|
LL | unsafe 'b: {}
| ^^^ not supported here
error: block label not supported here
- --> $DIR/label_break_value_illegal_uses.rs:12:13
+ --> $DIR/label_break_value_illegal_uses.rs:11:13
|
LL | if true 'b: {}
| ^^^ not supported here
error: block label not supported here
- --> $DIR/label_break_value_illegal_uses.rs:16:21
+ --> $DIR/label_break_value_illegal_uses.rs:15:21
|
LL | if true {} else 'b: {}
| ^^^ not supported here
error: block label not supported here
- --> $DIR/label_break_value_illegal_uses.rs:20:17
+ --> $DIR/label_break_value_illegal_uses.rs:19:17
|
LL | match false 'b: {
| ^^^ not supported here
diff --git a/src/test/ui/label/label_break_value_unlabeled_break.rs b/src/test/ui/label/label_break_value_unlabeled_break.rs
index fa0c70edc..2a4f5d574 100644
--- a/src/test/ui/label/label_break_value_unlabeled_break.rs
+++ b/src/test/ui/label/label_break_value_unlabeled_break.rs
@@ -1,4 +1,3 @@
-#![feature(label_break_value)]
#![allow(unused_labels)]
// Simple unlabeled break should yield in an error
diff --git a/src/test/ui/label/label_break_value_unlabeled_break.stderr b/src/test/ui/label/label_break_value_unlabeled_break.stderr
index 0c4f573d2..a2ccd27b8 100644
--- a/src/test/ui/label/label_break_value_unlabeled_break.stderr
+++ b/src/test/ui/label/label_break_value_unlabeled_break.stderr
@@ -1,11 +1,11 @@
error[E0695]: unlabeled `break` inside of a labeled block
- --> $DIR/label_break_value_unlabeled_break.rs:7:9
+ --> $DIR/label_break_value_unlabeled_break.rs:6:9
|
LL | break;
| ^^^^^ `break` statements that would diverge to or through a labeled block need to bear a label
error[E0695]: unlabeled `break` inside of a labeled block
- --> $DIR/label_break_value_unlabeled_break.rs:15:13
+ --> $DIR/label_break_value_unlabeled_break.rs:14:13
|
LL | break;
| ^^^^^ `break` statements that would diverge to or through a labeled block need to bear a label
diff --git a/src/test/ui/lang-items/issue-83471.stderr b/src/test/ui/lang-items/issue-83471.stderr
index 6d796fe7f..b315df179 100644
--- a/src/test/ui/lang-items/issue-83471.stderr
+++ b/src/test/ui/lang-items/issue-83471.stderr
@@ -4,12 +4,6 @@ error[E0573]: expected type, found built-in attribute `export_name`
LL | fn call(export_name);
| ^^^^^^^^^^^ not a type
-error[E0425]: cannot find function `a` in this scope
- --> $DIR/issue-83471.rs:21:5
- |
-LL | a()
- | ^ not found in this scope
-
error[E0658]: language items are subject to change
--> $DIR/issue-83471.rs:7:1
|
@@ -32,9 +26,9 @@ warning: anonymous parameters are deprecated and will be removed in the next edi
LL | fn call(export_name);
| ^^^^^^^^^^^ help: try naming the parameter or explicitly ignoring it: `_: export_name`
|
- = note: `#[warn(anonymous_parameters)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686>
+ = note: `#[warn(anonymous_parameters)]` on by default
error[E0718]: `fn` language item must be applied to a trait with 1 generic argument
--> $DIR/issue-83471.rs:11:1
@@ -45,6 +39,12 @@ LL | #[lang = "fn"]
LL | trait Fn {
| - this trait has 0 generic arguments
+error[E0425]: cannot find function `a` in this scope
+ --> $DIR/issue-83471.rs:21:5
+ |
+LL | a()
+ | ^ not found in this scope
+
error: aborting due to 5 previous errors; 1 warning emitted
Some errors have detailed explanations: E0425, E0573, E0658, E0718.
diff --git a/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr b/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr
index 6deb1f271..bfabe2d12 100644
--- a/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr
+++ b/src/test/ui/layout/issue-96158-scalarpair-payload-might-be-uninit.stderr
@@ -411,7 +411,7 @@ error: layout_of(NicheFirst) = Layout {
valid_range: 0..=4,
},
tag_encoding: Niche {
- dataful_variant: 0,
+ untagged_variant: 0,
niche_variants: 1..=2,
niche_start: 3,
},
@@ -555,7 +555,7 @@ error: layout_of(NicheSecond) = Layout {
valid_range: 0..=4,
},
tag_encoding: Niche {
- dataful_variant: 0,
+ untagged_variant: 0,
niche_variants: 1..=2,
niche_start: 3,
},
diff --git a/src/test/ui/layout/zero-sized-array-enum-niche.stderr b/src/test/ui/layout/zero-sized-array-enum-niche.stderr
index 56d3a52bb..a3e82070e 100644
--- a/src/test/ui/layout/zero-sized-array-enum-niche.stderr
+++ b/src/test/ui/layout/zero-sized-array-enum-niche.stderr
@@ -353,7 +353,7 @@ error: layout_of(std::result::Result<[u32; 0], Packed<U16IsZero>>) = Layout {
valid_range: 0..=1,
},
tag_encoding: Niche {
- dataful_variant: 1,
+ untagged_variant: 1,
niche_variants: 0..=0,
niche_start: 1,
},
diff --git a/src/test/ui/lazy-type-alias-impl-trait/branches.stderr b/src/test/ui/lazy-type-alias-impl-trait/branches.stderr
index 6b87da0c0..33f82448d 100644
--- a/src/test/ui/lazy-type-alias-impl-trait/branches.stderr
+++ b/src/test/ui/lazy-type-alias-impl-trait/branches.stderr
@@ -1,8 +1,10 @@
error[E0277]: a value of type `Bar` cannot be built from an iterator over elements of type `_`
- --> $DIR/branches.rs:19:28
+ --> $DIR/branches.rs:19:9
|
LL | std::iter::empty().collect()
- | ^^^^^^^ value of type `Bar` cannot be built from `std::iter::Iterator<Item=_>`
+ | ^^^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | value of type `Bar` cannot be built from `std::iter::Iterator<Item=_>`
|
= help: the trait `FromIterator<_>` is not implemented for `Bar`
note: required by a bound in `collect`
diff --git a/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr b/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr
index 42a1f782d..57978edf2 100644
--- a/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr
+++ b/src/test/ui/lazy-type-alias-impl-trait/recursion4.stderr
@@ -1,8 +1,10 @@
error[E0277]: a value of type `Foo` cannot be built from an iterator over elements of type `_`
- --> $DIR/recursion4.rs:10:28
+ --> $DIR/recursion4.rs:10:9
|
LL | x = std::iter::empty().collect();
- | ^^^^^^^ value of type `Foo` cannot be built from `std::iter::Iterator<Item=_>`
+ | ^^^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | value of type `Foo` cannot be built from `std::iter::Iterator<Item=_>`
|
= help: the trait `FromIterator<_>` is not implemented for `Foo`
note: required by a bound in `collect`
@@ -12,10 +14,12 @@ LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
error[E0277]: a value of type `impl Debug` cannot be built from an iterator over elements of type `_`
- --> $DIR/recursion4.rs:19:28
+ --> $DIR/recursion4.rs:19:9
|
LL | x = std::iter::empty().collect();
- | ^^^^^^^ value of type `impl Debug` cannot be built from `std::iter::Iterator<Item=_>`
+ | ^^^^^^^^^^^^^^^^^^ ------- required by a bound introduced by this call
+ | |
+ | value of type `impl Debug` cannot be built from `std::iter::Iterator<Item=_>`
|
= help: the trait `FromIterator<_>` is not implemented for `impl Debug`
note: required by a bound in `collect`
diff --git a/src/test/ui/let-else/const-fn.rs b/src/test/ui/let-else/const-fn.rs
new file mode 100644
index 000000000..a3921b803
--- /dev/null
+++ b/src/test/ui/let-else/const-fn.rs
@@ -0,0 +1,18 @@
+// run-pass
+// issue #101932
+
+
+const fn foo(a: Option<i32>) -> i32 {
+ let Some(a) = a else {
+ return 42
+ };
+
+ a + 1
+}
+
+fn main() {
+ const A: i32 = foo(None);
+ const B: i32 = foo(Some(1));
+
+ println!("{} {}", A, B);
+}
diff --git a/src/test/ui/let-else/issue-100103.rs b/src/test/ui/let-else/issue-100103.rs
new file mode 100644
index 000000000..f5f9b2f5f
--- /dev/null
+++ b/src/test/ui/let-else/issue-100103.rs
@@ -0,0 +1,15 @@
+// edition:2021
+// check-pass
+
+#![feature(try_blocks)]
+
+
+fn main() {
+ let _: Result<i32, i32> = try {
+ let Some(x) = Some(0) else {
+ Err(1)?
+ };
+
+ x
+ };
+}
diff --git a/src/test/ui/let-else/issue-102317.rs b/src/test/ui/let-else/issue-102317.rs
new file mode 100644
index 000000000..7369b4938
--- /dev/null
+++ b/src/test/ui/let-else/issue-102317.rs
@@ -0,0 +1,20 @@
+// issue #102317
+// build-pass
+// compile-flags: --edition 2021 -C opt-level=3 -Zvalidate-mir
+
+struct SegmentJob;
+
+impl Drop for SegmentJob {
+ fn drop(&mut self) {}
+}
+
+pub async fn run() -> Result<(), ()> {
+ let jobs = Vec::<SegmentJob>::new();
+ let Some(_job) = jobs.into_iter().next() else {
+ return Ok(())
+ };
+
+ Ok(())
+}
+
+fn main() {}
diff --git a/src/test/ui/let-else/issue-94176.rs b/src/test/ui/let-else/issue-94176.rs
new file mode 100644
index 000000000..f76dfc15b
--- /dev/null
+++ b/src/test/ui/let-else/issue-94176.rs
@@ -0,0 +1,10 @@
+// Issue #94176: wrong span for the error message of a mismatched type error,
+// if the function uses a `let else` construct.
+
+
+pub fn test(a: Option<u32>) -> Option<u32> { //~ ERROR mismatched types
+ let Some(_) = a else { return None; };
+ println!("Foo");
+}
+
+fn main() {}
diff --git a/src/test/ui/let-else/issue-94176.stderr b/src/test/ui/let-else/issue-94176.stderr
new file mode 100644
index 000000000..0cb97acee
--- /dev/null
+++ b/src/test/ui/let-else/issue-94176.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-94176.rs:5:32
+ |
+LL | pub fn test(a: Option<u32>) -> Option<u32> {
+ | ---- ^^^^^^^^^^^ expected enum `Option`, found `()`
+ | |
+ | implicitly returns `()` as its body has no tail or `return` expression
+ |
+ = note: expected enum `Option<u32>`
+ found unit type `()`
+help: consider returning the local binding `a`
+ |
+LL ~ println!("Foo");
+LL + a
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/let-else/issue-99975.rs b/src/test/ui/let-else/issue-99975.rs
new file mode 100644
index 000000000..5b164f347
--- /dev/null
+++ b/src/test/ui/let-else/issue-99975.rs
@@ -0,0 +1,20 @@
+// run-pass
+// compile-flags: -C opt-level=3 -Zvalidate-mir
+
+
+
+fn return_result() -> Option<String> {
+ Some("ok".to_string())
+}
+
+fn start() -> String {
+ let Some(content) = return_result() else {
+ return "none".to_string()
+ };
+
+ content
+}
+
+fn main() {
+ start();
+}
diff --git a/src/test/ui/let-else/let-else-allow-in-expr.rs b/src/test/ui/let-else/let-else-allow-in-expr.rs
index 39f4c9060..33acb6c6a 100644
--- a/src/test/ui/let-else/let-else-allow-in-expr.rs
+++ b/src/test/ui/let-else/let-else-allow-in-expr.rs
@@ -1,5 +1,3 @@
-#![feature(let_else)]
-
#![deny(unused_variables)]
fn main() {
diff --git a/src/test/ui/let-else/let-else-allow-in-expr.stderr b/src/test/ui/let-else/let-else-allow-in-expr.stderr
index e86bcbc85..3b2b9066c 100644
--- a/src/test/ui/let-else/let-else-allow-in-expr.stderr
+++ b/src/test/ui/let-else/let-else-allow-in-expr.stderr
@@ -1,17 +1,17 @@
error: unused variable: `x`
- --> $DIR/let-else-allow-in-expr.rs:7:13
+ --> $DIR/let-else-allow-in-expr.rs:5:13
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
note: the lint level is defined here
- --> $DIR/let-else-allow-in-expr.rs:3:9
+ --> $DIR/let-else-allow-in-expr.rs:1:9
|
LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^
error: unused variable: `x`
- --> $DIR/let-else-allow-in-expr.rs:29:9
+ --> $DIR/let-else-allow-in-expr.rs:27:9
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
diff --git a/src/test/ui/let-else/let-else-allow-unused.rs b/src/test/ui/let-else/let-else-allow-unused.rs
index 86ebacfa7..bbb1c7bea 100644
--- a/src/test/ui/let-else/let-else-allow-unused.rs
+++ b/src/test/ui/let-else/let-else-allow-unused.rs
@@ -1,6 +1,6 @@
// issue #89807
-#![feature(let_else)]
+
#[deny(unused_variables)]
diff --git a/src/test/ui/let-else/let-else-binding-explicit-mut-annotated.rs b/src/test/ui/let-else/let-else-binding-explicit-mut-annotated.rs
index b65fa13c1..955f33ee1 100644
--- a/src/test/ui/let-else/let-else-binding-explicit-mut-annotated.rs
+++ b/src/test/ui/let-else/let-else-binding-explicit-mut-annotated.rs
@@ -1,6 +1,6 @@
// from rfc2005 test suite
-#![feature(let_else)]
+
// Verify the binding mode shifts - only when no `&` are auto-dereferenced is the
// final default binding mode mutable.
diff --git a/src/test/ui/let-else/let-else-binding-explicit-mut-borrow.rs b/src/test/ui/let-else/let-else-binding-explicit-mut-borrow.rs
index 63b35df76..1524d0102 100644
--- a/src/test/ui/let-else/let-else-binding-explicit-mut-borrow.rs
+++ b/src/test/ui/let-else/let-else-binding-explicit-mut-borrow.rs
@@ -1,8 +1,8 @@
-#![feature(let_else)]
-
// Slightly different from explicit-mut-annotated -- this won't show an error until borrowck.
// Should it show a type error instead?
+
+
fn main() {
let Some(n): &mut Option<i32> = &mut &Some(5i32) else {
//~^ ERROR cannot borrow data in a `&` reference as mutable
diff --git a/src/test/ui/let-else/let-else-binding-explicit-mut-pass.rs b/src/test/ui/let-else/let-else-binding-explicit-mut-pass.rs
index 305be9221..b0a6264a1 100644
--- a/src/test/ui/let-else/let-else-binding-explicit-mut-pass.rs
+++ b/src/test/ui/let-else/let-else-binding-explicit-mut-pass.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(let_else)]
+
fn main() {
let Some(n) = &mut &mut Some(5i32) else { return; };
diff --git a/src/test/ui/let-else/let-else-binding-explicit-mut.rs b/src/test/ui/let-else/let-else-binding-explicit-mut.rs
index dbe4715b1..a153b3af0 100644
--- a/src/test/ui/let-else/let-else-binding-explicit-mut.rs
+++ b/src/test/ui/let-else/let-else-binding-explicit-mut.rs
@@ -1,6 +1,6 @@
// from rfc2005 test suite
-#![feature(let_else)]
+
// Verify the binding mode shifts - only when no `&` are auto-dereferenced is the
// final default binding mode mutable.
diff --git a/src/test/ui/let-else/let-else-binding-immutable.rs b/src/test/ui/let-else/let-else-binding-immutable.rs
index 96de0ffe2..ff2d9f240 100644
--- a/src/test/ui/let-else/let-else-binding-immutable.rs
+++ b/src/test/ui/let-else/let-else-binding-immutable.rs
@@ -1,6 +1,6 @@
// from rfc2005 test suite
-#![feature(let_else)]
+
pub fn main() {
let Some(x) = &Some(3) else {
diff --git a/src/test/ui/let-else/let-else-bindings.rs b/src/test/ui/let-else/let-else-bindings.rs
index d5121e744..7d2cad978 100644
--- a/src/test/ui/let-else/let-else-bindings.rs
+++ b/src/test/ui/let-else/let-else-bindings.rs
@@ -1,6 +1,6 @@
// run-pass
// adapted from src/test/ui/binding/if-let.rs
-#![feature(let_else)]
+
#![allow(dead_code)]
fn none() -> bool {
diff --git a/src/test/ui/let-else/let-else-bool-binop-init.fixed b/src/test/ui/let-else/let-else-bool-binop-init.fixed
index e47f7f23d..20e558ca9 100644
--- a/src/test/ui/let-else/let-else-bool-binop-init.fixed
+++ b/src/test/ui/let-else/let-else-bool-binop-init.fixed
@@ -1,6 +1,6 @@
// run-rustfix
-#![feature(let_else)]
+
fn main() {
let true = (true && false) else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else`
diff --git a/src/test/ui/let-else/let-else-bool-binop-init.rs b/src/test/ui/let-else/let-else-bool-binop-init.rs
index e443fb0d6..f88179a94 100644
--- a/src/test/ui/let-else/let-else-bool-binop-init.rs
+++ b/src/test/ui/let-else/let-else-bool-binop-init.rs
@@ -1,6 +1,6 @@
// run-rustfix
-#![feature(let_else)]
+
fn main() {
let true = true && false else { return }; //~ ERROR a `&&` expression cannot be directly assigned in `let...else`
diff --git a/src/test/ui/let-else/let-else-brace-before-else.fixed b/src/test/ui/let-else/let-else-brace-before-else.fixed
index fb4fd7779..a75c770dd 100644
--- a/src/test/ui/let-else/let-else-brace-before-else.fixed
+++ b/src/test/ui/let-else/let-else-brace-before-else.fixed
@@ -1,6 +1,6 @@
// run-rustfix
-#![feature(let_else)]
+
fn main() {
let Some(1) = ({ Some(1) }) else {
diff --git a/src/test/ui/let-else/let-else-brace-before-else.rs b/src/test/ui/let-else/let-else-brace-before-else.rs
index c4c5a1ca2..5603b946f 100644
--- a/src/test/ui/let-else/let-else-brace-before-else.rs
+++ b/src/test/ui/let-else/let-else-brace-before-else.rs
@@ -1,6 +1,6 @@
// run-rustfix
-#![feature(let_else)]
+
fn main() {
let Some(1) = { Some(1) } else {
diff --git a/src/test/ui/let-else/let-else-brace-before-else.stderr b/src/test/ui/let-else/let-else-brace-before-else.stderr
index 51051bbd4..cb01e4c18 100644
--- a/src/test/ui/let-else/let-else-brace-before-else.stderr
+++ b/src/test/ui/let-else/let-else-brace-before-else.stderr
@@ -4,7 +4,7 @@ error: right curly brace `}` before `else` in a `let...else` statement not allow
LL | let Some(1) = { Some(1) } else {
| ^
|
-help: try wrapping the expression in parentheses
+help: wrap the expression in parentheses
|
LL | let Some(1) = ({ Some(1) }) else {
| + +
@@ -15,7 +15,7 @@ error: right curly brace `}` before `else` in a `let...else` statement not allow
LL | let Some(1) = loop { break Some(1) } else {
| ^
|
-help: try wrapping the expression in parentheses
+help: wrap the expression in parentheses
|
LL | let Some(1) = (loop { break Some(1) }) else {
| + +
@@ -26,7 +26,7 @@ error: right curly brace `}` before `else` in a `let...else` statement not allow
LL | let 2 = 1 + match 1 { n => n } else {
| ^
|
-help: try wrapping the expression in parentheses
+help: wrap the expression in parentheses
|
LL | let 2 = 1 + (match 1 { n => n }) else {
| + +
@@ -37,7 +37,7 @@ error: right curly brace `}` before `else` in a `let...else` statement not allow
LL | let Some(1) = unsafe { unsafe_fn() } else {
| ^
|
-help: try wrapping the expression in parentheses
+help: wrap the expression in parentheses
|
LL | let Some(1) = (unsafe { unsafe_fn() }) else {
| + +
diff --git a/src/test/ui/let-else/let-else-check.rs b/src/test/ui/let-else/let-else-check.rs
index 9e32cbef7..713fd986e 100644
--- a/src/test/ui/let-else/let-else-check.rs
+++ b/src/test/ui/let-else/let-else-check.rs
@@ -1,5 +1,3 @@
-#![feature(let_else)]
-
#![deny(unused_variables)]
fn main() {
diff --git a/src/test/ui/let-else/let-else-check.stderr b/src/test/ui/let-else/let-else-check.stderr
index 3d647a4c0..bdecbf708 100644
--- a/src/test/ui/let-else/let-else-check.stderr
+++ b/src/test/ui/let-else/let-else-check.stderr
@@ -1,17 +1,17 @@
error: unused variable: `x`
- --> $DIR/let-else-check.rs:14:13
+ --> $DIR/let-else-check.rs:12:13
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
note: the lint level is defined here
- --> $DIR/let-else-check.rs:3:9
+ --> $DIR/let-else-check.rs:1:9
|
LL | #![deny(unused_variables)]
| ^^^^^^^^^^^^^^^^
error: unused variable: `x`
- --> $DIR/let-else-check.rs:18:9
+ --> $DIR/let-else-check.rs:16:9
|
LL | let x = 1;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
diff --git a/src/test/ui/let-else/let-else-deref-coercion-annotated.rs b/src/test/ui/let-else/let-else-deref-coercion-annotated.rs
index 65d88a6d8..60fdf825a 100644
--- a/src/test/ui/let-else/let-else-deref-coercion-annotated.rs
+++ b/src/test/ui/let-else/let-else-deref-coercion-annotated.rs
@@ -6,7 +6,7 @@
// Deref/DerefMut to Bar. You can do this with an irrefutable binding, so it should work with
// let-else too.
-#![feature(let_else)]
+
use std::ops::{Deref, DerefMut};
struct Foo(Bar);
diff --git a/src/test/ui/let-else/let-else-deref-coercion.rs b/src/test/ui/let-else/let-else-deref-coercion.rs
index 87489d84b..052a5a8c7 100644
--- a/src/test/ui/let-else/let-else-deref-coercion.rs
+++ b/src/test/ui/let-else/let-else-deref-coercion.rs
@@ -3,7 +3,7 @@
// We attempt to `let Bar::Present(_) = foo else { ... }` where foo is meant to Deref/DerefMut to
// Bar. This fails, you must add a type annotation like `let _: &mut Bar = _ else { ... }`
-#![feature(let_else)]
+
use std::ops::{Deref, DerefMut};
struct Foo(Bar);
diff --git a/src/test/ui/let-else/let-else-destructuring.rs b/src/test/ui/let-else/let-else-destructuring.rs
index 9a09c414a..d1f1a69bf 100644
--- a/src/test/ui/let-else/let-else-destructuring.rs
+++ b/src/test/ui/let-else/let-else-destructuring.rs
@@ -1,4 +1,3 @@
-#![feature(let_else)]
#[derive(Debug)]
enum Foo {
Done,
diff --git a/src/test/ui/let-else/let-else-destructuring.stderr b/src/test/ui/let-else/let-else-destructuring.stderr
index 95efb7116..7d6cb2386 100644
--- a/src/test/ui/let-else/let-else-destructuring.stderr
+++ b/src/test/ui/let-else/let-else-destructuring.stderr
@@ -1,11 +1,11 @@
error: <assignment> ... else { ... } is not allowed
- --> $DIR/let-else-destructuring.rs:11:9
+ --> $DIR/let-else-destructuring.rs:10:9
|
LL | &Foo::Nested(Some(value)) = value else { break };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0070]: invalid left-hand side of assignment
- --> $DIR/let-else-destructuring.rs:11:35
+ --> $DIR/let-else-destructuring.rs:10:35
|
LL | &Foo::Nested(Some(value)) = value else { break };
| ------------------------- ^
diff --git a/src/test/ui/let-else/let-else-drop-order.rs b/src/test/ui/let-else/let-else-drop-order.rs
new file mode 100644
index 000000000..e91e5de84
--- /dev/null
+++ b/src/test/ui/let-else/let-else-drop-order.rs
@@ -0,0 +1,270 @@
+// run-pass
+// edition:2021
+// check-run-results
+//
+// Drop order tests for let else
+//
+// Mostly this ensures two things:
+// 1. That let and let else temporary drop order is the same.
+// This is a specific design request: https://github.com/rust-lang/rust/pull/93628#issuecomment-1047140316
+// 2. That the else block truly only runs after the
+// temporaries have dropped.
+//
+// We also print some nice tables for an overview by humans.
+// Changes in those tables are considered breakages, but the
+// important properties 1 and 2 are also enforced by the code.
+// This is important as it's easy to update the stdout file
+// with a --bless and miss the impact of that change.
+
+
+#![allow(irrefutable_let_patterns)]
+
+use std::cell::RefCell;
+use std::rc::Rc;
+
+#[derive(Clone)]
+struct DropAccountant(Rc<RefCell<Vec<Vec<String>>>>);
+
+impl DropAccountant {
+ fn new() -> Self {
+ Self(Default::default())
+ }
+ fn build_droppy(&self, v: u32) -> Droppy<u32> {
+ Droppy(self.clone(), v)
+ }
+ fn build_droppy_enum_none(&self, _v: u32) -> ((), DroppyEnum<u32>) {
+ ((), DroppyEnum::None(self.clone()))
+ }
+ fn new_list(&self, s: impl ToString) {
+ self.0.borrow_mut().push(vec![s.to_string()]);
+ }
+ fn push(&self, s: impl ToString) {
+ let s = s.to_string();
+ let mut accounts = self.0.borrow_mut();
+ accounts.last_mut().unwrap().push(s);
+ }
+ fn print_table(&self) {
+ println!();
+
+ let accounts = self.0.borrow();
+ let before_last = &accounts[accounts.len() - 2];
+ let last = &accounts[accounts.len() - 1];
+ let before_last = get_comma_list(before_last);
+ let last = get_comma_list(last);
+ const LINES: &[&str] = &[
+ "vanilla",
+ "&",
+ "&mut",
+ "move",
+ "fn(this)",
+ "tuple",
+ "array",
+ "ref &",
+ "ref mut &mut",
+ ];
+ let max_len = LINES.iter().map(|v| v.len()).max().unwrap();
+ let max_len_before = before_last.iter().map(|v| v.len()).max().unwrap();
+ let max_len_last = last.iter().map(|v| v.len()).max().unwrap();
+
+ println!(
+ "| {: <max_len$} | {: <max_len_before$} | {: <max_len_last$} |",
+ "construct", before_last[0], last[0]
+ );
+ println!("| {:-<max_len$} | {:-<max_len_before$} | {:-<max_len_last$} |", "", "", "");
+
+ for ((l, l_before), l_last) in
+ LINES.iter().zip(before_last[1..].iter()).zip(last[1..].iter())
+ {
+ println!(
+ "| {: <max_len$} | {: <max_len_before$} | {: <max_len_last$} |",
+ l, l_before, l_last,
+ );
+ }
+ }
+ #[track_caller]
+ fn assert_all_equal_to(&self, st: &str) {
+ let accounts = self.0.borrow();
+ let last = &accounts[accounts.len() - 1];
+ let last = get_comma_list(last);
+ for line in last[1..].iter() {
+ assert_eq!(line.trim(), st.trim());
+ }
+ }
+ #[track_caller]
+ fn assert_equality_last_two_lists(&self) {
+ let accounts = self.0.borrow();
+ let last = &accounts[accounts.len() - 1];
+ let before_last = &accounts[accounts.len() - 2];
+ for (l, b) in last[1..].iter().zip(before_last[1..].iter()) {
+ if !(l == b || l == "n/a" || b == "n/a") {
+ panic!("not equal: '{last:?}' != '{before_last:?}'");
+ }
+ }
+ }
+}
+
+fn get_comma_list(sl: &[String]) -> Vec<String> {
+ std::iter::once(sl[0].clone())
+ .chain(sl[1..].chunks(2).map(|c| c.join(",")))
+ .collect::<Vec<String>>()
+}
+
+struct Droppy<T>(DropAccountant, T);
+
+impl<T> Drop for Droppy<T> {
+ fn drop(&mut self) {
+ self.0.push("drop");
+ }
+}
+
+#[allow(dead_code)]
+enum DroppyEnum<T> {
+ Some(DropAccountant, T),
+ None(DropAccountant),
+}
+
+impl<T> Drop for DroppyEnum<T> {
+ fn drop(&mut self) {
+ match self {
+ DroppyEnum::Some(acc, _inner) => acc,
+ DroppyEnum::None(acc) => acc,
+ }
+ .push("drop");
+ }
+}
+
+macro_rules! nestings_with {
+ ($construct:ident, $binding:pat, $exp:expr) => {
+ // vanilla:
+ $construct!($binding, $exp.1);
+
+ // &:
+ $construct!(&$binding, &$exp.1);
+
+ // &mut:
+ $construct!(&mut $binding, &mut ($exp.1));
+
+ {
+ // move:
+ let w = $exp;
+ $construct!(
+ $binding,
+ {
+ let w = w;
+ w
+ }
+ .1
+ );
+ }
+
+ // fn(this):
+ $construct!($binding, std::convert::identity($exp).1);
+ };
+}
+
+macro_rules! nestings {
+ ($construct:ident, $binding:pat, $exp:expr) => {
+ nestings_with!($construct, $binding, $exp);
+
+ // tuple:
+ $construct!(($binding, 77), ($exp.1, 77));
+
+ // array:
+ $construct!([$binding], [$exp.1]);
+ };
+}
+
+macro_rules! let_else {
+ ($acc:expr, $v:expr, $binding:pat, $build:ident) => {
+ let acc = $acc;
+ let v = $v;
+
+ macro_rules! let_else_construct {
+ ($arg:pat, $exp:expr) => {
+ loop {
+ let $arg = $exp else {
+ acc.push("else");
+ break;
+ };
+ acc.push("body");
+ break;
+ }
+ };
+ }
+ nestings!(let_else_construct, $binding, acc.$build(v));
+ // ref &:
+ let_else_construct!($binding, &acc.$build(v).1);
+
+ // ref mut &mut:
+ let_else_construct!($binding, &mut acc.$build(v).1);
+ };
+}
+
+macro_rules! let_ {
+ ($acc:expr, $binding:tt) => {
+ let acc = $acc;
+
+ macro_rules! let_construct {
+ ($arg:pat, $exp:expr) => {{
+ let $arg = $exp;
+ acc.push("body");
+ }};
+ }
+ let v = 0;
+ {
+ nestings_with!(let_construct, $binding, acc.build_droppy(v));
+ }
+ acc.push("n/a");
+ acc.push("n/a");
+ acc.push("n/a");
+ acc.push("n/a");
+
+ // ref &:
+ let_construct!($binding, &acc.build_droppy(v).1);
+
+ // ref mut &mut:
+ let_construct!($binding, &mut acc.build_droppy(v).1);
+ };
+}
+
+fn main() {
+ let acc = DropAccountant::new();
+
+ println!(" --- matching cases ---");
+
+ // Ensure that let and let else have the same behaviour
+ acc.new_list("let _");
+ let_!(&acc, _);
+ acc.new_list("let else _");
+ let_else!(&acc, 0, _, build_droppy);
+ acc.assert_equality_last_two_lists();
+ acc.print_table();
+
+ // Ensure that let and let else have the same behaviour
+ acc.new_list("let _v");
+ let_!(&acc, _v);
+ acc.new_list("let else _v");
+ let_else!(&acc, 0, _v, build_droppy);
+ acc.assert_equality_last_two_lists();
+ acc.print_table();
+
+ println!();
+
+ println!(" --- mismatching cases ---");
+
+ acc.new_list("let else _ mismatch");
+ let_else!(&acc, 1, DroppyEnum::Some(_, _), build_droppy_enum_none);
+ acc.new_list("let else _v mismatch");
+ let_else!(&acc, 1, DroppyEnum::Some(_, _v), build_droppy_enum_none);
+ acc.print_table();
+ // This ensures that we always drop before visiting the else case
+ acc.assert_all_equal_to("drop,else");
+
+ acc.new_list("let else 0 mismatch");
+ let_else!(&acc, 1, 0, build_droppy);
+ acc.new_list("let else 0 mismatch");
+ let_else!(&acc, 1, 0, build_droppy);
+ acc.print_table();
+ // This ensures that we always drop before visiting the else case
+ acc.assert_all_equal_to("drop,else");
+}
diff --git a/src/test/ui/let-else/let-else-drop-order.run.stdout b/src/test/ui/let-else/let-else-drop-order.run.stdout
new file mode 100644
index 000000000..01cf2f73e
--- /dev/null
+++ b/src/test/ui/let-else/let-else-drop-order.run.stdout
@@ -0,0 +1,51 @@
+ --- matching cases ---
+
+| construct | let _ | let else _ |
+| ------------ | --------- | ---------- |
+| vanilla | drop,body | drop,body |
+| & | body,drop | body,drop |
+| &mut | body,drop | body,drop |
+| move | drop,body | drop,body |
+| fn(this) | drop,body | drop,body |
+| tuple | n/a,n/a | drop,body |
+| array | n/a,n/a | drop,body |
+| ref & | body,drop | body,drop |
+| ref mut &mut | body,drop | body,drop |
+
+| construct | let _v | let else _v |
+| ------------ | --------- | ----------- |
+| vanilla | drop,body | drop,body |
+| & | body,drop | body,drop |
+| &mut | body,drop | body,drop |
+| move | drop,body | drop,body |
+| fn(this) | drop,body | drop,body |
+| tuple | n/a,n/a | drop,body |
+| array | n/a,n/a | drop,body |
+| ref & | body,drop | body,drop |
+| ref mut &mut | body,drop | body,drop |
+
+ --- mismatching cases ---
+
+| construct | let else _ mismatch | let else _v mismatch |
+| ------------ | ------------------- | -------------------- |
+| vanilla | drop,else | drop,else |
+| & | drop,else | drop,else |
+| &mut | drop,else | drop,else |
+| move | drop,else | drop,else |
+| fn(this) | drop,else | drop,else |
+| tuple | drop,else | drop,else |
+| array | drop,else | drop,else |
+| ref & | drop,else | drop,else |
+| ref mut &mut | drop,else | drop,else |
+
+| construct | let else 0 mismatch | let else 0 mismatch |
+| ------------ | ------------------- | ------------------- |
+| vanilla | drop,else | drop,else |
+| & | drop,else | drop,else |
+| &mut | drop,else | drop,else |
+| move | drop,else | drop,else |
+| fn(this) | drop,else | drop,else |
+| tuple | drop,else | drop,else |
+| array | drop,else | drop,else |
+| ref & | drop,else | drop,else |
+| ref mut &mut | drop,else | drop,else |
diff --git a/src/test/ui/let-else/let-else-if.rs b/src/test/ui/let-else/let-else-if.rs
index c3a17330d..e8c54ca7a 100644
--- a/src/test/ui/let-else/let-else-if.rs
+++ b/src/test/ui/let-else/let-else-if.rs
@@ -1,5 +1,3 @@
-#![feature(let_else)]
-
fn main() {
let Some(_) = Some(()) else if true {
//~^ ERROR conditional `else if` is not supported for `let...else`
diff --git a/src/test/ui/let-else/let-else-if.stderr b/src/test/ui/let-else/let-else-if.stderr
index 746738bbd..c63fd61c5 100644
--- a/src/test/ui/let-else/let-else-if.stderr
+++ b/src/test/ui/let-else/let-else-if.stderr
@@ -1,5 +1,5 @@
error: conditional `else if` is not supported for `let...else`
- --> $DIR/let-else-if.rs:4:33
+ --> $DIR/let-else-if.rs:2:33
|
LL | let Some(_) = Some(()) else if true {
| ^^ expected `{`
diff --git a/src/test/ui/let-else/let-else-irrefutable.rs b/src/test/ui/let-else/let-else-irrefutable.rs
index b1e09a124..1cb68ecb8 100644
--- a/src/test/ui/let-else/let-else-irrefutable.rs
+++ b/src/test/ui/let-else/let-else-irrefutable.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(let_else)]
+
fn main() {
let x = 1 else { return }; //~ WARN irrefutable `let...else` pattern
diff --git a/src/test/ui/let-else/let-else-irrefutable.stderr b/src/test/ui/let-else/let-else-irrefutable.stderr
index e030c50d4..e0581f4d9 100644
--- a/src/test/ui/let-else/let-else-irrefutable.stderr
+++ b/src/test/ui/let-else/let-else-irrefutable.stderr
@@ -4,9 +4,9 @@ warning: irrefutable `let...else` pattern
LL | let x = 1 else { return };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(irrefutable_let_patterns)]` on by default
= note: this pattern will always match, so the `else` clause is useless
= help: consider removing the `else` clause
+ = note: `#[warn(irrefutable_let_patterns)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/let-else/let-else-missing-semicolon.rs b/src/test/ui/let-else/let-else-missing-semicolon.rs
index ed9d79f1e..d87ac90c1 100644
--- a/src/test/ui/let-else/let-else-missing-semicolon.rs
+++ b/src/test/ui/let-else/let-else-missing-semicolon.rs
@@ -1,5 +1,3 @@
-#![feature(let_else)]
-
fn main() {
let Some(x) = Some(1) else {
return;
diff --git a/src/test/ui/let-else/let-else-missing-semicolon.stderr b/src/test/ui/let-else/let-else-missing-semicolon.stderr
index 1818a0b12..99029ff33 100644
--- a/src/test/ui/let-else/let-else-missing-semicolon.stderr
+++ b/src/test/ui/let-else/let-else-missing-semicolon.stderr
@@ -1,5 +1,5 @@
error: expected `;`, found keyword `let`
- --> $DIR/let-else-missing-semicolon.rs:6:6
+ --> $DIR/let-else-missing-semicolon.rs:4:6
|
LL | }
| ^ help: add `;` here
@@ -7,7 +7,7 @@ LL | let _ = "";
| --- unexpected token
error: expected `;`, found `}`
- --> $DIR/let-else-missing-semicolon.rs:10:6
+ --> $DIR/let-else-missing-semicolon.rs:8:6
|
LL | }
| ^ help: add `;` here
diff --git a/src/test/ui/let-else/let-else-no-double-error.rs b/src/test/ui/let-else/let-else-no-double-error.rs
index 35dcdd3f6..91fcc5d7e 100644
--- a/src/test/ui/let-else/let-else-no-double-error.rs
+++ b/src/test/ui/let-else/let-else-no-double-error.rs
@@ -1,6 +1,6 @@
// from rfc2005 test suite
-#![feature(let_else)]
+
// Without caching type lookups in FnCtxt.resolve_ty_and_def_ufcs
// the error below would be reported twice (once when checking
diff --git a/src/test/ui/let-else/let-else-non-copy.rs b/src/test/ui/let-else/let-else-non-copy.rs
index 79ed82dd1..08c07dd1a 100644
--- a/src/test/ui/let-else/let-else-non-copy.rs
+++ b/src/test/ui/let-else/let-else-non-copy.rs
@@ -10,7 +10,7 @@
//
// The move was due to mir::Place being Copy, but mir::VarDebugInfoContents not being Copy.
-#![feature(let_else)]
+
#[derive(Copy, Clone)]
struct Copyable;
diff --git a/src/test/ui/let-else/let-else-non-diverging.rs b/src/test/ui/let-else/let-else-non-diverging.rs
index a1cee335a..a5442dd82 100644
--- a/src/test/ui/let-else/let-else-non-diverging.rs
+++ b/src/test/ui/let-else/let-else-non-diverging.rs
@@ -1,5 +1,3 @@
-#![feature(let_else)]
-
fn main() {
let Some(x) = Some(1) else { //~ ERROR does not diverge
Some(2)
@@ -10,4 +8,15 @@ fn main() {
}
};
let Some(x) = Some(1) else { Some(2) }; //~ ERROR does not diverge
+
+ // Ensure that uninhabited types do not "diverge".
+ // This might be relaxed in the future, but when it is,
+ // it should be an explicitly wanted decision.
+ let Some(x) = Some(1) else { foo::<Uninhabited>() }; //~ ERROR does not diverge
+}
+
+enum Uninhabited {}
+
+fn foo<T>() -> T {
+ panic!()
}
diff --git a/src/test/ui/let-else/let-else-non-diverging.stderr b/src/test/ui/let-else/let-else-non-diverging.stderr
index 05e45f689..78551fcc4 100644
--- a/src/test/ui/let-else/let-else-non-diverging.stderr
+++ b/src/test/ui/let-else/let-else-non-diverging.stderr
@@ -1,5 +1,5 @@
error[E0308]: `else` clause of `let...else` does not diverge
- --> $DIR/let-else-non-diverging.rs:4:32
+ --> $DIR/let-else-non-diverging.rs:2:32
|
LL | let Some(x) = Some(1) else {
| ________________________________^
@@ -13,7 +13,7 @@ LL | | };
= help: ...or use `match` instead of `let...else`
error[E0308]: `else` clause of `let...else` does not diverge
- --> $DIR/let-else-non-diverging.rs:7:32
+ --> $DIR/let-else-non-diverging.rs:5:32
|
LL | let Some(x) = Some(1) else {
| ________________________________^
@@ -29,7 +29,7 @@ LL | | };
= help: ...or use `match` instead of `let...else`
error[E0308]: `else` clause of `let...else` does not diverge
- --> $DIR/let-else-non-diverging.rs:12:32
+ --> $DIR/let-else-non-diverging.rs:10:32
|
LL | let Some(x) = Some(1) else { Some(2) };
| ^^^^^^^^^^^ expected `!`, found enum `Option`
@@ -39,6 +39,17 @@ LL | let Some(x) = Some(1) else { Some(2) };
= help: try adding a diverging expression, such as `return` or `panic!(..)`
= help: ...or use `match` instead of `let...else`
-error: aborting due to 3 previous errors
+error[E0308]: `else` clause of `let...else` does not diverge
+ --> $DIR/let-else-non-diverging.rs:15:32
+ |
+LL | let Some(x) = Some(1) else { foo::<Uninhabited>() };
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `!`, found enum `Uninhabited`
+ |
+ = note: expected type `!`
+ found enum `Uninhabited`
+ = help: try adding a diverging expression, such as `return` or `panic!(..)`
+ = help: ...or use `match` instead of `let...else`
+
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/let-else/let-else-ref-bindings-pass.rs b/src/test/ui/let-else/let-else-ref-bindings-pass.rs
index f4abd6cc2..62fc65731 100644
--- a/src/test/ui/let-else/let-else-ref-bindings-pass.rs
+++ b/src/test/ui/let-else/let-else-ref-bindings-pass.rs
@@ -1,6 +1,6 @@
// check-pass
-#![feature(let_else)]
+
#![allow(unused_variables)]
fn ref_() {
diff --git a/src/test/ui/let-else/let-else-ref-bindings.rs b/src/test/ui/let-else/let-else-ref-bindings.rs
index a4cd8e8c4..687e235d4 100644
--- a/src/test/ui/let-else/let-else-ref-bindings.rs
+++ b/src/test/ui/let-else/let-else-ref-bindings.rs
@@ -1,6 +1,6 @@
-#![feature(let_else)]
#![allow(unused_variables)]
+
fn ref_() {
let bytes: Vec<u8> = b"Hello"[..].to_vec();
let some = Some(bytes);
diff --git a/src/test/ui/let-else/let-else-run-pass.rs b/src/test/ui/let-else/let-else-run-pass.rs
index 5d9662323..a0fb6c683 100644
--- a/src/test/ui/let-else/let-else-run-pass.rs
+++ b/src/test/ui/let-else/let-else-run-pass.rs
@@ -1,6 +1,6 @@
// run-pass
-#![feature(let_else)]
+
fn main() {
#[allow(dead_code)]
diff --git a/src/test/ui/let-else/let-else-scope.rs b/src/test/ui/let-else/let-else-scope.rs
index f17682db4..78a67769e 100644
--- a/src/test/ui/let-else/let-else-scope.rs
+++ b/src/test/ui/let-else/let-else-scope.rs
@@ -1,5 +1,3 @@
-#![feature(let_else)]
-
fn main() {
let Some(x) = Some(2) else {
panic!("{}", x); //~ ERROR cannot find value `x` in this scope
diff --git a/src/test/ui/let-else/let-else-scope.stderr b/src/test/ui/let-else/let-else-scope.stderr
index 4b3936eac..3b4f09829 100644
--- a/src/test/ui/let-else/let-else-scope.stderr
+++ b/src/test/ui/let-else/let-else-scope.stderr
@@ -1,5 +1,5 @@
error[E0425]: cannot find value `x` in this scope
- --> $DIR/let-else-scope.rs:5:22
+ --> $DIR/let-else-scope.rs:3:22
|
LL | panic!("{}", x);
| ^ not found in this scope
diff --git a/src/test/ui/let-else/let-else-slicing-error.rs b/src/test/ui/let-else/let-else-slicing-error.rs
index 4022656a8..25770094b 100644
--- a/src/test/ui/let-else/let-else-slicing-error.rs
+++ b/src/test/ui/let-else/let-else-slicing-error.rs
@@ -1,5 +1,5 @@
// issue #92069
-#![feature(let_else)]
+
fn main() {
let nums = vec![5, 4, 3, 2, 1];
diff --git a/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs b/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs
index 2aa17ae8c..ee378abcf 100644
--- a/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs
+++ b/src/test/ui/let-else/let-else-source-expr-nomove-pass.rs
@@ -1,7 +1,7 @@
// run-pass
// issue #89688
-#![feature(let_else)]
+
fn example_let_else(value: Option<String>) {
let Some(inner) = value else {
diff --git a/src/test/ui/let-else/let-else-temp-borrowck.rs b/src/test/ui/let-else/let-else-temp-borrowck.rs
index 3910d35e7..6b4642d2f 100644
--- a/src/test/ui/let-else/let-else-temp-borrowck.rs
+++ b/src/test/ui/let-else/let-else-temp-borrowck.rs
@@ -3,7 +3,7 @@
// from issue #93951, where borrowck complained the temporary that `foo(&x)` was stored in was to
// be dropped sometime after `x` was. It then suggested adding a semicolon that was already there.
-#![feature(let_else)]
+
use std::fmt::Debug;
fn foo<'a>(x: &'a str) -> Result<impl Debug + 'a, ()> {
diff --git a/src/test/ui/let-else/let-else-temporary-lifetime.rs b/src/test/ui/let-else/let-else-temporary-lifetime.rs
index 9c86901b9..c23eaa997 100644
--- a/src/test/ui/let-else/let-else-temporary-lifetime.rs
+++ b/src/test/ui/let-else/let-else-temporary-lifetime.rs
@@ -1,5 +1,5 @@
// run-pass
-#![feature(let_else)]
+// compile-flags: -Zvalidate-mir
use std::fmt::Display;
use std::rc::Rc;
@@ -75,6 +75,17 @@ fn main() {
}
}
{
+ fn must_pass() {
+ let rc = Rc::new(());
+ let &None = &Some(Rc::clone(&rc)) else {
+ Rc::try_unwrap(rc).unwrap();
+ return;
+ };
+ unreachable!();
+ }
+ must_pass();
+ }
+ {
// test let-else drops temps before else block
// NOTE: this test has to be the last block in the `main`
// body.
diff --git a/src/test/ui/let-else/let-else-then-diverge.rs b/src/test/ui/let-else/let-else-then-diverge.rs
new file mode 100644
index 000000000..1a75310c9
--- /dev/null
+++ b/src/test/ui/let-else/let-else-then-diverge.rs
@@ -0,0 +1,17 @@
+// popped up in #94012, where an alternative desugaring was
+// causing unreachable code errors
+
+#![deny(unused_variables)]
+#![deny(unreachable_code)]
+
+fn let_else_diverge() -> bool {
+ let Some(_) = Some("test") else {
+ let x = 5; //~ ERROR unused variable: `x`
+ return false;
+ };
+ return true;
+}
+
+fn main() {
+ let_else_diverge();
+}
diff --git a/src/test/ui/let-else/let-else-then-diverge.stderr b/src/test/ui/let-else/let-else-then-diverge.stderr
new file mode 100644
index 000000000..470a11d47
--- /dev/null
+++ b/src/test/ui/let-else/let-else-then-diverge.stderr
@@ -0,0 +1,14 @@
+error: unused variable: `x`
+ --> $DIR/let-else-then-diverge.rs:9:13
+ |
+LL | let x = 5;
+ | ^ help: if this is intentional, prefix it with an underscore: `_x`
+ |
+note: the lint level is defined here
+ --> $DIR/let-else-then-diverge.rs:4:9
+ |
+LL | #![deny(unused_variables)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/let-else/let-else.rs b/src/test/ui/let-else/let-else.rs
new file mode 100644
index 000000000..3505533e6
--- /dev/null
+++ b/src/test/ui/let-else/let-else.rs
@@ -0,0 +1,8 @@
+// run-pass
+
+fn main() {
+ let Some(x) = Some(1) else {
+ return;
+ };
+ assert_eq!(x, 1);
+}
diff --git a/src/test/ui/lexer/lex-emoji-identifiers.rs b/src/test/ui/lexer/lex-emoji-identifiers.rs
new file mode 100644
index 000000000..91b5929c0
--- /dev/null
+++ b/src/test/ui/lexer/lex-emoji-identifiers.rs
@@ -0,0 +1,17 @@
+fn invalid_emoji_usages() {
+ let arrow↔️ = "basic emoji"; //~ ERROR: identifiers cannot contain emoji
+ // FIXME
+ let planet🪐 = "basic emoji"; //~ ERROR: unknown start of token
+ // FIXME
+ let wireless🛜 = "basic emoji"; //~ ERROR: unknown start of token
+ // FIXME
+ let key1️⃣ = "keycap sequence"; //~ ERROR: unknown start of token
+ //~^ WARN: identifier contains uncommon Unicode codepoints
+ let flag🇺🇳 = "flag sequence"; //~ ERROR: identifiers cannot contain emoji
+ let wales🏴 = "tag sequence"; //~ ERROR: identifiers cannot contain emoji
+ let folded🙏🏿 = "modifier sequence"; //~ ERROR: identifiers cannot contain emoji
+}
+
+fn main() {
+ invalid_emoji_usages();
+}
diff --git a/src/test/ui/lexer/lex-emoji-identifiers.stderr b/src/test/ui/lexer/lex-emoji-identifiers.stderr
new file mode 100644
index 000000000..6237c5d02
--- /dev/null
+++ b/src/test/ui/lexer/lex-emoji-identifiers.stderr
@@ -0,0 +1,52 @@
+error: unknown start of token: \u{1fa90}
+ --> $DIR/lex-emoji-identifiers.rs:4:15
+ |
+LL | let planet🪐 = "basic emoji";
+ | ^^
+
+error: unknown start of token: \u{1f6dc}
+ --> $DIR/lex-emoji-identifiers.rs:6:17
+ |
+LL | let wireless🛜 = "basic emoji";
+ | ^^
+
+error: unknown start of token: \u{20e3}
+ --> $DIR/lex-emoji-identifiers.rs:8:14
+ |
+LL | let key1️⃣ = "keycap sequence";
+ | ^
+
+error: identifiers cannot contain emoji: `arrow↔️`
+ --> $DIR/lex-emoji-identifiers.rs:2:9
+ |
+LL | let arrow↔️ = "basic emoji";
+ | ^^^^^^
+
+error: identifiers cannot contain emoji: `flag🇺🇳`
+ --> $DIR/lex-emoji-identifiers.rs:10:9
+ |
+LL | let flag🇺🇳 = "flag sequence";
+ | ^^^^^^
+
+error: identifiers cannot contain emoji: `wales🏴`
+ --> $DIR/lex-emoji-identifiers.rs:11:9
+ |
+LL | let wales🏴 = "tag sequence";
+ | ^^^^^^^
+
+error: identifiers cannot contain emoji: `folded🙏🏿`
+ --> $DIR/lex-emoji-identifiers.rs:12:9
+ |
+LL | let folded🙏🏿 = "modifier sequence";
+ | ^^^^^^^^^^
+
+warning: identifier contains uncommon Unicode codepoints
+ --> $DIR/lex-emoji-identifiers.rs:8:9
+ |
+LL | let key1️⃣ = "keycap sequence";
+ | ^^^^
+ |
+ = note: `#[warn(uncommon_codepoints)]` on by default
+
+error: aborting due to 7 previous errors; 1 warning emitted
+
diff --git a/src/test/ui/lexical-scopes.stderr b/src/test/ui/lexical-scopes.stderr
index 3b2a062c1..535985452 100644
--- a/src/test/ui/lexical-scopes.stderr
+++ b/src/test/ui/lexical-scopes.stderr
@@ -1,6 +1,10 @@
error[E0574]: expected struct, variant or union type, found type parameter `T`
--> $DIR/lexical-scopes.rs:3:13
|
+LL | struct T { i: i32 }
+ | ------------------- you might have meant to refer to this struct
+LL | fn f<T>() {
+ | - found this type parameter
LL | let t = T { i: 0 };
| ^ not a struct, variant or union type
diff --git a/src/test/ui/lifetimes/elided-lifetime-in-param-pat.rs b/src/test/ui/lifetimes/elided-lifetime-in-param-pat.rs
new file mode 100644
index 000000000..c1425fa42
--- /dev/null
+++ b/src/test/ui/lifetimes/elided-lifetime-in-param-pat.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+struct S<T> {
+ _t: T,
+}
+
+fn f(S::<&i8> { .. }: S<&i8>) {}
+
+fn main() {
+ f(S { _t: &42_i8 });
+}
diff --git a/src/test/ui/lifetimes/fullwidth-ampersand.rs b/src/test/ui/lifetimes/fullwidth-ampersand.rs
new file mode 100644
index 000000000..7d8948bd8
--- /dev/null
+++ b/src/test/ui/lifetimes/fullwidth-ampersand.rs
@@ -0,0 +1,7 @@
+// Verify that we do not ICE when the user uses a multubyte ampersand.
+
+fn f(_: &&()) -> &() { todo!() }
+//~^ ERROR unknown start of token: \u{ff06}
+//~| ERROR missing lifetime specifier [E0106]
+
+fn main() {}
diff --git a/src/test/ui/lifetimes/fullwidth-ampersand.stderr b/src/test/ui/lifetimes/fullwidth-ampersand.stderr
new file mode 100644
index 000000000..4645254f4
--- /dev/null
+++ b/src/test/ui/lifetimes/fullwidth-ampersand.stderr
@@ -0,0 +1,26 @@
+error: unknown start of token: \u{ff06}
+ --> $DIR/fullwidth-ampersand.rs:3:10
+ |
+LL | fn f(_: &&()) -> &() { todo!() }
+ | ^^
+ |
+help: Unicode character '&' (Fullwidth Ampersand) looks like '&' (Ampersand), but it is not
+ |
+LL | fn f(_: &&()) -> &() { todo!() }
+ | ~
+
+error[E0106]: missing lifetime specifier
+ --> $DIR/fullwidth-ampersand.rs:3:18
+ |
+LL | fn f(_: &&()) -> &() { todo!() }
+ | ----- ^ expected named lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value, but the signature does not say which one of argument 1's 2 lifetimes it is borrowed from
+help: consider introducing a named lifetime parameter
+ |
+LL | fn f<'a>(_: &'a &'a ()) -> &'a () { todo!() }
+ | ++++ ++ ++ ++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/lifetimes/issue-26638.stderr b/src/test/ui/lifetimes/issue-26638.stderr
index f3af5cf5a..98d39d614 100644
--- a/src/test/ui/lifetimes/issue-26638.stderr
+++ b/src/test/ui/lifetimes/issue-26638.stderr
@@ -54,7 +54,7 @@ LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
help: provide the argument
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter(/* &u8 */) }
- | ~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-26638.rs:5:47
diff --git a/src/test/ui/lifetimes/issue-79187-2.stderr b/src/test/ui/lifetimes/issue-79187-2.stderr
index 9322e6171..c5f654b37 100644
--- a/src/test/ui/lifetimes/issue-79187-2.stderr
+++ b/src/test/ui/lifetimes/issue-79187-2.stderr
@@ -31,7 +31,7 @@ error[E0308]: mismatched types
LL | take_foo(|a| a);
| ^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r> Fn<(&'r i32,)>`
+ = note: expected trait `for<'a> Fn<(&'a i32,)>`
found trait `Fn<(&i32,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-79187-2.rs:8:14
diff --git a/src/test/ui/lifetimes/issue-79187.stderr b/src/test/ui/lifetimes/issue-79187.stderr
index 3e75e7fed..ee6e7b89d 100644
--- a/src/test/ui/lifetimes/issue-79187.stderr
+++ b/src/test/ui/lifetimes/issue-79187.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | thing(f);
| ^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r> FnOnce<(&'r u32,)>`
+ = note: expected trait `for<'a> FnOnce<(&'a u32,)>`
found trait `FnOnce<(&u32,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-79187.rs:4:13
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs
index 7a2eba518..d0a8fe795 100644
--- a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs
+++ b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs
@@ -42,4 +42,10 @@ fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
panic!()
}
+fn l<'a>(_: &'a str, _: &'a str) -> &str { "" }
+//~^ ERROR missing lifetime specifier
+
+// This is ok because both `'a` are for the same parameter.
+fn m<'a>(_: &'a Foo<'a>) -> &str { "" }
+
fn main() {}
diff --git a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
index d07754879..5eee953ef 100644
--- a/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
+++ b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr
@@ -70,6 +70,18 @@ help: consider using the `'a` lifetime
LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
| ++
-error: aborting due to 6 previous errors
+error[E0106]: missing lifetime specifier
+ --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:45:37
+ |
+LL | fn l<'a>(_: &'a str, _: &'a str) -> &str { "" }
+ | ------- ------- ^ expected named lifetime parameter
+ |
+ = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
+help: consider using the `'a` lifetime
+ |
+LL | fn l<'a>(_: &'a str, _: &'a str) -> &'a str { "" }
+ | ++
+
+error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0106`.
diff --git a/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr
index d82b2684c..7049f28e2 100644
--- a/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr
+++ b/src/test/ui/lifetimes/lifetime-errors/issue_74400.stderr
@@ -15,7 +15,7 @@ error[E0308]: mismatched types
LL | f(data, identity)
| ^^^^^^^^^^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r> Fn<(&'r T,)>`
+ = note: expected trait `for<'a> Fn<(&'a T,)>`
found trait `Fn<(&T,)>`
note: the lifetime requirement is introduced here
--> $DIR/issue_74400.rs:8:34
diff --git a/src/test/ui/lifetimes/missing-lifetime-in-alias.rs b/src/test/ui/lifetimes/missing-lifetime-in-alias.rs
index af7b64127..51c564c01 100644
--- a/src/test/ui/lifetimes/missing-lifetime-in-alias.rs
+++ b/src/test/ui/lifetimes/missing-lifetime-in-alias.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
trait Trait<'a> {
type Foo;
diff --git a/src/test/ui/lifetimes/missing-lifetime-in-alias.stderr b/src/test/ui/lifetimes/missing-lifetime-in-alias.stderr
index b8c68a460..428b8f14b 100644
--- a/src/test/ui/lifetimes/missing-lifetime-in-alias.stderr
+++ b/src/test/ui/lifetimes/missing-lifetime-in-alias.stderr
@@ -1,5 +1,5 @@
error[E0106]: missing lifetime specifier
- --> $DIR/missing-lifetime-in-alias.rs:22:24
+ --> $DIR/missing-lifetime-in-alias.rs:20:24
|
LL | type B<'a> = <A<'a> as Trait>::Foo;
| ^^^^^ expected named lifetime parameter
@@ -10,13 +10,13 @@ LL | type B<'a> = <A<'a> as Trait<'a>>::Foo;
| ++++
error[E0106]: missing lifetime specifier
- --> $DIR/missing-lifetime-in-alias.rs:26:28
+ --> $DIR/missing-lifetime-in-alias.rs:24:28
|
LL | type C<'a, 'b> = <A<'a> as Trait>::Bar;
| ^^^^^ expected named lifetime parameter
|
note: these named lifetimes are available to use
- --> $DIR/missing-lifetime-in-alias.rs:26:8
+ --> $DIR/missing-lifetime-in-alias.rs:24:8
|
LL | type C<'a, 'b> = <A<'a> as Trait>::Bar;
| ^^ ^^
@@ -26,13 +26,13 @@ LL | type C<'a, 'b> = <A<'a> as Trait<'lifetime>>::Bar;
| +++++++++++
error[E0107]: missing generics for associated type `Trait::Bar`
- --> $DIR/missing-lifetime-in-alias.rs:26:36
+ --> $DIR/missing-lifetime-in-alias.rs:24:36
|
LL | type C<'a, 'b> = <A<'a> as Trait>::Bar;
| ^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'b`
- --> $DIR/missing-lifetime-in-alias.rs:6:10
+ --> $DIR/missing-lifetime-in-alias.rs:4:10
|
LL | type Bar<'b>
| ^^^ --
diff --git a/src/test/ui/lifetimes/nested-binder-print.rs b/src/test/ui/lifetimes/nested-binder-print.rs
new file mode 100644
index 000000000..f97f349fd
--- /dev/null
+++ b/src/test/ui/lifetimes/nested-binder-print.rs
@@ -0,0 +1,10 @@
+struct TwoLt<'a, 'b>(&'a (), &'b ());
+type Foo<'a> = fn(TwoLt<'_, 'a>);
+
+fn foo() {
+ let y: for<'a> fn(Foo<'a>);
+ let x: u32 = y;
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/lifetimes/nested-binder-print.stderr b/src/test/ui/lifetimes/nested-binder-print.stderr
new file mode 100644
index 000000000..32dd89693
--- /dev/null
+++ b/src/test/ui/lifetimes/nested-binder-print.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/nested-binder-print.rs:6:18
+ |
+LL | let x: u32 = y;
+ | --- ^ expected `u32`, found fn pointer
+ | |
+ | expected due to this
+ |
+ = note: expected type `u32`
+ found fn pointer `for<'a> fn(for<'b> fn(TwoLt<'b, 'a>))`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/lifetimes/re-empty-in-error.stderr b/src/test/ui/lifetimes/re-empty-in-error.stderr
index 72bb0782f..c35d8ecec 100644
--- a/src/test/ui/lifetimes/re-empty-in-error.stderr
+++ b/src/test/ui/lifetimes/re-empty-in-error.stderr
@@ -4,7 +4,7 @@ error: higher-ranked lifetime error
LL | foo(&10);
| ^^^^^^^^
|
- = note: could not prove `for<'b, 'r> &'b (): 'r`
+ = note: could not prove `for<'b> &'b (): 'a`
error: aborting due to previous error
diff --git a/src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.rs b/src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.rs
new file mode 100644
index 000000000..645bc7db0
--- /dev/null
+++ b/src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.rs
@@ -0,0 +1,9 @@
+fn no_restriction<T>(x: &()) -> &() {
+ with_restriction::<T>(x) //~ ERROR the parameter type `T` may not live long enough
+}
+
+fn with_restriction<'b, T: 'b>(x: &'b ()) -> &'b () {
+ x
+}
+
+fn main() {}
diff --git a/src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.stderr b/src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.stderr
new file mode 100644
index 000000000..31fd8a4d6
--- /dev/null
+++ b/src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.stderr
@@ -0,0 +1,24 @@
+error[E0311]: the parameter type `T` may not live long enough
+ --> $DIR/suggest-introducing-and-adding-missing-lifetime.rs:2:5
+ |
+LL | with_restriction::<T>(x)
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the parameter type `T` must be valid for the anonymous lifetime defined here...
+ --> $DIR/suggest-introducing-and-adding-missing-lifetime.rs:1:25
+ |
+LL | fn no_restriction<T>(x: &()) -> &() {
+ | ^^^
+note: ...so that the type `T` will meet its required lifetime bounds
+ --> $DIR/suggest-introducing-and-adding-missing-lifetime.rs:2:5
+ |
+LL | with_restriction::<T>(x)
+ | ^^^^^^^^^^^^^^^^^^^^^
+help: consider adding an explicit lifetime bound...
+ |
+LL | fn no_restriction<'a, T: 'a>(x: &()) -> &() {
+ | +++ ++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0311`.
diff --git a/src/test/ui/lifetimes/unusual-rib-combinations.rs b/src/test/ui/lifetimes/unusual-rib-combinations.rs
new file mode 100644
index 000000000..b4c86aab8
--- /dev/null
+++ b/src/test/ui/lifetimes/unusual-rib-combinations.rs
@@ -0,0 +1,28 @@
+#![feature(inline_const)]
+
+struct S<'a>(&'a u8);
+fn foo() {}
+
+// Paren generic args in AnonConst
+fn a() -> [u8; foo::()] {
+//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
+//~| ERROR mismatched types
+ panic!()
+}
+
+// Paren generic args in ConstGeneric
+fn b<const C: u8()>() {}
+//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
+
+// Paren generic args in AnonymousReportError
+fn c<T = u8()>() {}
+//~^ ERROR parenthesized type parameters may only be used with a `Fn` trait
+//~| ERROR defaults for type parameters are only allowed in
+//~| WARN this was previously accepted
+
+// Elided lifetime in path in ConstGeneric
+fn d<const C: S>() {}
+//~^ ERROR missing lifetime specifier
+//~| ERROR `S<'static>` is forbidden as the type of a const generic parameter
+
+fn main() {}
diff --git a/src/test/ui/lifetimes/unusual-rib-combinations.stderr b/src/test/ui/lifetimes/unusual-rib-combinations.stderr
new file mode 100644
index 000000000..6d7b42506
--- /dev/null
+++ b/src/test/ui/lifetimes/unusual-rib-combinations.stderr
@@ -0,0 +1,61 @@
+error[E0106]: missing lifetime specifier
+ --> $DIR/unusual-rib-combinations.rs:24:15
+ |
+LL | fn d<const C: S>() {}
+ | ^ expected named lifetime parameter
+ |
+help: consider introducing a named lifetime parameter
+ |
+LL | fn d<'a, const C: S<'a>>() {}
+ | +++ ++++
+
+error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
+ --> $DIR/unusual-rib-combinations.rs:7:16
+ |
+LL | fn a() -> [u8; foo::()] {
+ | ^^^^^^^ only `Fn` traits may use parentheses
+
+error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
+ --> $DIR/unusual-rib-combinations.rs:14:15
+ |
+LL | fn b<const C: u8()>() {}
+ | ^^^^ only `Fn` traits may use parentheses
+
+error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
+ --> $DIR/unusual-rib-combinations.rs:18:10
+ |
+LL | fn c<T = u8()>() {}
+ | ^^^^ only `Fn` traits may use parentheses
+
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+ --> $DIR/unusual-rib-combinations.rs:18:6
+ |
+LL | fn c<T = u8()>() {}
+ | ^^^^^^^^
+ |
+ = 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 #36887 <https://github.com/rust-lang/rust/issues/36887>
+ = note: `#[deny(invalid_type_param_default)]` on by default
+
+error[E0308]: mismatched types
+ --> $DIR/unusual-rib-combinations.rs:7:16
+ |
+LL | fn a() -> [u8; foo::()] {
+ | ^^^^^^^ expected `usize`, found fn item
+ |
+ = note: expected type `usize`
+ found fn item `fn() {foo}`
+
+error: `S<'static>` is forbidden as the type of a const generic parameter
+ --> $DIR/unusual-rib-combinations.rs:24:15
+ |
+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
+
+Some errors have detailed explanations: E0106, E0214, E0308.
+For more information about an error, try `rustc --explain E0106`.
diff --git a/src/test/ui/limits/issue-17913.rs b/src/test/ui/limits/issue-17913.rs
index ca13b9bd6..8d4cbe201 100644
--- a/src/test/ui/limits/issue-17913.rs
+++ b/src/test/ui/limits/issue-17913.rs
@@ -6,18 +6,16 @@
// normalize-stderr-test "thread.*panicked.*Metadata module not compiled.*\n" -> ""
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
-#![feature(box_syntax)]
-
#[cfg(target_pointer_width = "64")]
fn main() {
let n = 0_usize;
- let a: Box<_> = box [&n; 0xF000000000000000_usize];
+ let a: Box<_> = Box::new([&n; 0xF000000000000000_usize]);
println!("{}", a[0xFFFFFF_usize]);
}
#[cfg(target_pointer_width = "32")]
fn main() {
let n = 0_usize;
- let a: Box<_> = box [&n; 0xFFFFFFFF_usize];
+ let a: Box<_> = Box::new([&n; 0xFFFFFFFF_usize]);
println!("{}", a[0xFFFFFF_usize]);
}
diff --git a/src/test/ui/limits/issue-55878.stderr b/src/test/ui/limits/issue-55878.stderr
index 6c3683d78..ee6aab748 100644
--- a/src/test/ui/limits/issue-55878.stderr
+++ b/src/test/ui/limits/issue-55878.stderr
@@ -9,29 +9,14 @@ LL | intrinsics::size_of::<T>()
LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
| ---------------------------------------------- inside `main` at $DIR/issue-55878.rs:7:26
-error: erroneous constant used
+error[E0080]: erroneous constant used
--> $DIR/issue-55878.rs:7:26
|
LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
|
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.
-Future incompatibility report: Future breakage diagnostic:
-error: erroneous constant used
- --> $DIR/issue-55878.rs:7:26
- |
-LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors
- |
- = note: `#[deny(const_err)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
- = 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)
-
diff --git a/src/test/ui/linkage-attr/link-attr-validation-early.stderr b/src/test/ui/linkage-attr/link-attr-validation-early.stderr
index d36601ed0..24ad9d825 100644
--- a/src/test/ui/linkage-attr/link-attr-validation-early.stderr
+++ b/src/test/ui/linkage-attr/link-attr-validation-early.stderr
@@ -1,14 +1,14 @@
-error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...")]`
+error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated")]`
--> $DIR/link-attr-validation-early.rs:2:1
|
LL | #[link]
| ^^^^^^^
|
- = note: `#[deny(ill_formed_attribute_input)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
+ = note: `#[deny(ill_formed_attribute_input)]` on by default
-error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...")]`
+error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated")]`
--> $DIR/link-attr-validation-early.rs:4:1
|
LL | #[link = "foo"]
diff --git a/src/test/ui/linkage-attr/link-attr-validation-late.stderr b/src/test/ui/linkage-attr/link-attr-validation-late.stderr
index bb08f9a4c..dd0f1dba2 100644
--- a/src/test/ui/linkage-attr/link-attr-validation-late.stderr
+++ b/src/test/ui/linkage-attr/link-attr-validation-late.stderr
@@ -1,10 +1,10 @@
-error: unexpected `#[link]` argument, expected one of: name, kind, modifiers, cfg, wasm_import_module
+error: unexpected `#[link]` argument, expected one of: name, kind, modifiers, cfg, wasm_import_module, import_name_type
--> $DIR/link-attr-validation-late.rs:5:22
|
LL | #[link(name = "...", "literal")]
| ^^^^^^^^^
-error: unexpected `#[link]` argument, expected one of: name, kind, modifiers, cfg, wasm_import_module
+error: unexpected `#[link]` argument, expected one of: name, kind, modifiers, cfg, wasm_import_module, import_name_type
--> $DIR/link-attr-validation-late.rs:6:22
|
LL | #[link(name = "...", unknown)]
diff --git a/src/test/ui/lint/auxiliary/trivial-cast-ice.rs b/src/test/ui/lint/auxiliary/trivial-cast-ice.rs
new file mode 100644
index 000000000..ab2332d06
--- /dev/null
+++ b/src/test/ui/lint/auxiliary/trivial-cast-ice.rs
@@ -0,0 +1,7 @@
+#[macro_export]
+macro_rules! foo {
+ () => {
+ let x: &Option<i32> = &Some(1);
+ let _y = x as *const Option<i32>;
+ }
+}
diff --git a/src/test/ui/lint/bare-trait-objects-path.stderr b/src/test/ui/lint/bare-trait-objects-path.stderr
index 4b8c2b539..8ed303ca6 100644
--- a/src/test/ui/lint/bare-trait-objects-path.stderr
+++ b/src/test/ui/lint/bare-trait-objects-path.stderr
@@ -4,9 +4,9 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | let _: Dyn::Ty;
| ^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
LL | let _: <dyn Dyn>::Ty;
diff --git a/src/test/ui/lint/clashing-extern-fn.stderr b/src/test/ui/lint/clashing-extern-fn.stderr
index 4607f6849..217eed6c9 100644
--- a/src/test/ui/lint/clashing-extern-fn.stderr
+++ b/src/test/ui/lint/clashing-extern-fn.stderr
@@ -7,13 +7,13 @@ LL | fn clash(x: u8);
LL | fn clash(x: u64);
| ^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
|
+ = note: expected `unsafe extern "C" fn(u8)`
+ found `unsafe extern "C" fn(u64)`
note: the lint level is defined here
--> $DIR/clashing-extern-fn.rs:4:9
|
LL | #![warn(clashing_extern_declarations)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: expected `unsafe extern "C" fn(u8)`
- found `unsafe extern "C" fn(u64)`
warning: `extern_link_name` redeclared with a different signature
--> $DIR/clashing-extern-fn.rs:52:9
@@ -219,9 +219,9 @@ warning: `extern` block uses type `Option<TransparentNoNiche>`, which is not FFI
LL | fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
- = note: `#[warn(improper_ctypes)]` on by default
= help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
= note: enum has no representation hint
+ = 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
diff --git a/src/test/ui/lint/cli-lint-override.forbid_warn.stderr b/src/test/ui/lint/cli-lint-override.forbid_warn.stderr
index ff4dc4abc..d1c66a81c 100644
--- a/src/test/ui/lint/cli-lint-override.forbid_warn.stderr
+++ b/src/test/ui/lint/cli-lint-override.forbid_warn.stderr
@@ -4,8 +4,8 @@ error: extern declarations without an explicit ABI are deprecated
LL | extern fn foo() {}
| ^^^^^^^^^^^^^^^ ABI should be specified here
|
- = note: requested on the command line with `-F missing-abi`
= help: the default ABI is C
+ = note: requested on the command line with `-F missing-abi`
error: aborting due to previous error
diff --git a/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr b/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr
index 74e7823e1..779c24c93 100644
--- a/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr
+++ b/src/test/ui/lint/cli-lint-override.force_warn_deny.stderr
@@ -4,8 +4,8 @@ warning: extern declarations without an explicit ABI are deprecated
LL | extern fn foo() {}
| ^^^^^^^^^^^^^^^ ABI should be specified here
|
- = note: requested on the command line with `--force-warn missing-abi`
= help: the default ABI is C
+ = note: requested on the command line with `--force-warn missing-abi`
warning: 1 warning emitted
diff --git a/src/test/ui/lint/cli-lint-override.warn_deny.stderr b/src/test/ui/lint/cli-lint-override.warn_deny.stderr
index 2d869adfd..f034cfa93 100644
--- a/src/test/ui/lint/cli-lint-override.warn_deny.stderr
+++ b/src/test/ui/lint/cli-lint-override.warn_deny.stderr
@@ -4,8 +4,8 @@ error: extern declarations without an explicit ABI are deprecated
LL | extern fn foo() {}
| ^^^^^^^^^^^^^^^ ABI should be specified here
|
- = note: requested on the command line with `-D missing-abi`
= help: the default ABI is C
+ = note: requested on the command line with `-D missing-abi`
error: aborting due to previous error
diff --git a/src/test/ui/lint/dead-code/issue-85071-2.stderr b/src/test/ui/lint/dead-code/issue-85071-2.stderr
index 86fbd1d75..5e963183d 100644
--- a/src/test/ui/lint/dead-code/issue-85071-2.stderr
+++ b/src/test/ui/lint/dead-code/issue-85071-2.stderr
@@ -7,16 +7,16 @@ LL |
LL | let _y = x;
| ^^ unreachable definition
|
-note: the lint level is defined here
- --> $DIR/issue-85071-2.rs:7:26
- |
-LL | #![warn(unused_variables,unreachable_code)]
- | ^^^^^^^^^^^^^^^^
note: this expression has type `Foo`, which is uninhabited
--> $DIR/issue-85071-2.rs:18:13
|
LL | let x = s.f();
| ^^^^^
+note: the lint level is defined here
+ --> $DIR/issue-85071-2.rs:7:26
+ |
+LL | #![warn(unused_variables,unreachable_code)]
+ | ^^^^^^^^^^^^^^^^
warning: unused variable: `x`
--> $DIR/issue-85071-2.rs:18:9
diff --git a/src/test/ui/lint/dead-code/issue-85071.stderr b/src/test/ui/lint/dead-code/issue-85071.stderr
index 49555fdaa..721fb8148 100644
--- a/src/test/ui/lint/dead-code/issue-85071.stderr
+++ b/src/test/ui/lint/dead-code/issue-85071.stderr
@@ -7,16 +7,16 @@ LL |
LL | let _ = x;
| ^ unreachable expression
|
-note: the lint level is defined here
- --> $DIR/issue-85071.rs:9:26
- |
-LL | #![warn(unused_variables,unreachable_code)]
- | ^^^^^^^^^^^^^^^^
note: this expression has type `Foo`, which is uninhabited
--> $DIR/issue-85071.rs:15:13
|
LL | let x = f();
| ^^^
+note: the lint level is defined here
+ --> $DIR/issue-85071.rs:9:26
+ |
+LL | #![warn(unused_variables,unreachable_code)]
+ | ^^^^^^^^^^^^^^^^
warning: unused variable: `x`
--> $DIR/issue-85071.rs:15:9
diff --git a/src/test/ui/lint/dead-code/unused-variant.stderr b/src/test/ui/lint/dead-code/unused-variant.stderr
index a68f64775..6029bf268 100644
--- a/src/test/ui/lint/dead-code/unused-variant.stderr
+++ b/src/test/ui/lint/dead-code/unused-variant.stderr
@@ -6,12 +6,12 @@ LL | enum Enum {
LL | Variant1,
| ^^^^^^^^
|
+ = note: `Enum` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
note: the lint level is defined here
--> $DIR/unused-variant.rs:1:9
|
LL | #![deny(dead_code)]
| ^^^^^^^^^
- = note: `Enum` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
error: aborting due to previous error
diff --git a/src/test/ui/lint/deny-overflowing-literals.stderr b/src/test/ui/lint/deny-overflowing-literals.stderr
index 127dd4127..beb0ad795 100644
--- a/src/test/ui/lint/deny-overflowing-literals.stderr
+++ b/src/test/ui/lint/deny-overflowing-literals.stderr
@@ -4,8 +4,8 @@ error: literal out of range for `u8`
LL | let x: u8 = 256;
| ^^^
|
- = note: `#[deny(overflowing_literals)]` on by default
= note: the literal `256` does not fit into the type `u8` whose range is `0..=255`
+ = note: `#[deny(overflowing_literals)]` on by default
error: range endpoint is out of range for `u8`
--> $DIR/deny-overflowing-literals.rs:5:14
diff --git a/src/test/ui/lint/expansion-time.stderr b/src/test/ui/lint/expansion-time.stderr
index b0fc1f8e5..064ee5fad 100644
--- a/src/test/ui/lint/expansion-time.stderr
+++ b/src/test/ui/lint/expansion-time.stderr
@@ -18,13 +18,13 @@ warning: missing fragment specifier
LL | macro_rules! m { ($i) => {} }
| ^^
|
+ = 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 #40107 <https://github.com/rust-lang/rust/issues/40107>
note: the lint level is defined here
--> $DIR/expansion-time.rs:8:8
|
LL | #[warn(missing_fragment_specifier)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #40107 <https://github.com/rust-lang/rust/issues/40107>
warning: use of unstable library feature 'test': `bench` is a part of custom test frameworks which are unstable
--> $DIR/expansion-time.rs:14:7
@@ -32,13 +32,13 @@ warning: use of unstable library feature 'test': `bench` is a part of custom tes
LL | #[bench]
| ^^^^^
|
+ = 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 #64266 <https://github.com/rust-lang/rust/issues/64266>
note: the lint level is defined here
--> $DIR/expansion-time.rs:12:8
|
LL | #[warn(soft_unstable)]
| ^^^^^^^^^^^^^
- = 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 #64266 <https://github.com/rust-lang/rust/issues/64266>
warning: include macro expected single expression in source
--> $DIR/expansion-time-include.rs:4:1
diff --git a/src/test/ui/lint/fn_must_use.stderr b/src/test/ui/lint/fn_must_use.stderr
index 61b7993d2..2805720f0 100644
--- a/src/test/ui/lint/fn_must_use.stderr
+++ b/src/test/ui/lint/fn_must_use.stderr
@@ -4,12 +4,12 @@ warning: unused return value of `need_to_use_this_value` that must be used
LL | need_to_use_this_value();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
+ = note: it's important
note: the lint level is defined here
--> $DIR/fn_must_use.rs:3:9
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: it's important
warning: unused return value of `MyStruct::need_to_use_this_method_value` that must be used
--> $DIR/fn_must_use.rs:60:5
diff --git a/src/test/ui/lint/for_loop_over_fallibles.rs b/src/test/ui/lint/for_loop_over_fallibles.rs
new file mode 100644
index 000000000..43d71c2e8
--- /dev/null
+++ b/src/test/ui/lint/for_loop_over_fallibles.rs
@@ -0,0 +1,43 @@
+// check-pass
+
+fn main() {
+ // Common
+ for _ in Some(1) {}
+ //~^ WARN for loop over an `Option`. This is more readably written as an `if let` statement
+ //~| HELP to check pattern in a loop use `while let`
+ //~| HELP consider using `if let` to clear intent
+ for _ in Ok::<_, ()>(1) {}
+ //~^ WARN for loop over a `Result`. This is more readably written as an `if let` statement
+ //~| HELP to check pattern in a loop use `while let`
+ //~| HELP consider using `if let` to clear intent
+
+ // `Iterator::next` specific
+ for _ in [0; 0].iter().next() {}
+ //~^ WARN for loop over an `Option`. This is more readably written as an `if let` statement
+ //~| HELP to iterate over `[0; 0].iter()` remove the call to `next`
+ //~| HELP consider using `if let` to clear intent
+
+ // `Result<impl Iterator, _>`, but function doesn't return `Result`
+ for _ in Ok::<_, ()>([0; 0].iter()) {}
+ //~^ WARN for loop over a `Result`. This is more readably written as an `if let` statement
+ //~| HELP to check pattern in a loop use `while let`
+ //~| HELP consider using `if let` to clear intent
+}
+
+fn _returns_result() -> Result<(), ()> {
+ // `Result<impl Iterator, _>`
+ for _ in Ok::<_, ()>([0; 0].iter()) {}
+ //~^ WARN for loop over a `Result`. This is more readably written as an `if let` statement
+ //~| HELP to check pattern in a loop use `while let`
+ //~| HELP consider unwrapping the `Result` with `?` to iterate over its contents
+ //~| HELP consider using `if let` to clear intent
+
+ // `Result<impl IntoIterator>`
+ for _ in Ok::<_, ()>([0; 0]) {}
+ //~^ WARN for loop over a `Result`. This is more readably written as an `if let` statement
+ //~| HELP to check pattern in a loop use `while let`
+ //~| HELP consider unwrapping the `Result` with `?` to iterate over its contents
+ //~| HELP consider using `if let` to clear intent
+
+ Ok(())
+}
diff --git a/src/test/ui/lint/for_loop_over_fallibles.stderr b/src/test/ui/lint/for_loop_over_fallibles.stderr
new file mode 100644
index 000000000..96efdf85c
--- /dev/null
+++ b/src/test/ui/lint/for_loop_over_fallibles.stderr
@@ -0,0 +1,101 @@
+warning: for loop over an `Option`. This is more readably written as an `if let` statement
+ --> $DIR/for_loop_over_fallibles.rs:5:14
+ |
+LL | for _ in Some(1) {}
+ | ^^^^^^^
+ |
+ = note: `#[warn(for_loops_over_fallibles)]` on by default
+help: to check pattern in a loop use `while let`
+ |
+LL | while let Some(_) = Some(1) {}
+ | ~~~~~~~~~~~~~~~ ~~~
+help: consider using `if let` to clear intent
+ |
+LL | if let Some(_) = Some(1) {}
+ | ~~~~~~~~~~~~ ~~~
+
+warning: for loop over a `Result`. This is more readably written as an `if let` statement
+ --> $DIR/for_loop_over_fallibles.rs:9:14
+ |
+LL | for _ in Ok::<_, ()>(1) {}
+ | ^^^^^^^^^^^^^^
+ |
+help: to check pattern in a loop use `while let`
+ |
+LL | while let Ok(_) = Ok::<_, ()>(1) {}
+ | ~~~~~~~~~~~~~ ~~~
+help: consider using `if let` to clear intent
+ |
+LL | if let Ok(_) = Ok::<_, ()>(1) {}
+ | ~~~~~~~~~~ ~~~
+
+warning: for loop over an `Option`. This is more readably written as an `if let` statement
+ --> $DIR/for_loop_over_fallibles.rs:15:14
+ |
+LL | for _ in [0; 0].iter().next() {}
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+help: to iterate over `[0; 0].iter()` remove the call to `next`
+ |
+LL | for _ in [0; 0].iter().by_ref() {}
+ | ~~~~~~~~~
+help: consider using `if let` to clear intent
+ |
+LL | if let Some(_) = [0; 0].iter().next() {}
+ | ~~~~~~~~~~~~ ~~~
+
+warning: for loop over a `Result`. This is more readably written as an `if let` statement
+ --> $DIR/for_loop_over_fallibles.rs:21:14
+ |
+LL | for _ in Ok::<_, ()>([0; 0].iter()) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: to check pattern in a loop use `while let`
+ |
+LL | while let Ok(_) = Ok::<_, ()>([0; 0].iter()) {}
+ | ~~~~~~~~~~~~~ ~~~
+help: consider using `if let` to clear intent
+ |
+LL | if let Ok(_) = Ok::<_, ()>([0; 0].iter()) {}
+ | ~~~~~~~~~~ ~~~
+
+warning: for loop over a `Result`. This is more readably written as an `if let` statement
+ --> $DIR/for_loop_over_fallibles.rs:29:14
+ |
+LL | for _ in Ok::<_, ()>([0; 0].iter()) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: to check pattern in a loop use `while let`
+ |
+LL | while let Ok(_) = Ok::<_, ()>([0; 0].iter()) {}
+ | ~~~~~~~~~~~~~ ~~~
+help: consider unwrapping the `Result` with `?` to iterate over its contents
+ |
+LL | for _ in Ok::<_, ()>([0; 0].iter())? {}
+ | +
+help: consider using `if let` to clear intent
+ |
+LL | if let Ok(_) = Ok::<_, ()>([0; 0].iter()) {}
+ | ~~~~~~~~~~ ~~~
+
+warning: for loop over a `Result`. This is more readably written as an `if let` statement
+ --> $DIR/for_loop_over_fallibles.rs:36:14
+ |
+LL | for _ in Ok::<_, ()>([0; 0]) {}
+ | ^^^^^^^^^^^^^^^^^^^
+ |
+help: to check pattern in a loop use `while let`
+ |
+LL | while let Ok(_) = Ok::<_, ()>([0; 0]) {}
+ | ~~~~~~~~~~~~~ ~~~
+help: consider unwrapping the `Result` with `?` to iterate over its contents
+ |
+LL | for _ in Ok::<_, ()>([0; 0])? {}
+ | +
+help: consider using `if let` to clear intent
+ |
+LL | if let Ok(_) = Ok::<_, ()>([0; 0]) {}
+ | ~~~~~~~~~~ ~~~
+
+warning: 6 warnings emitted
+
diff --git a/src/test/ui/lint/forbid-group-group-2.stderr b/src/test/ui/lint/forbid-group-group-2.stderr
index 214e949c1..b2e2bcea1 100644
--- a/src/test/ui/lint/forbid-group-group-2.stderr
+++ b/src/test/ui/lint/forbid-group-group-2.stderr
@@ -7,13 +7,13 @@ LL | #![forbid(warnings)]
LL | #[allow(nonstandard_style)]
| ^^^^^^^^^^^^^^^^^ overruled by previous forbid
|
+ = 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 #81670 <https://github.com/rust-lang/rust/issues/81670>
note: the lint level is defined here
--> $DIR/forbid-group-group-2.rs:5:9
|
LL | #![deny(forbidden_lint_groups)]
| ^^^^^^^^^^^^^^^^^^^^^
- = 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 #81670 <https://github.com/rust-lang/rust/issues/81670>
error: allow(nonstandard_style) incompatible with previous forbid
--> $DIR/forbid-group-group-2.rs:7:9
diff --git a/src/test/ui/lint/forbid-group-member.stderr b/src/test/ui/lint/forbid-group-member.stderr
index 891fa9885..47336d4d8 100644
--- a/src/test/ui/lint/forbid-group-member.stderr
+++ b/src/test/ui/lint/forbid-group-member.stderr
@@ -7,9 +7,9 @@ LL |
LL | #[allow(unused_variables)]
| ^^^^^^^^^^^^^^^^ overruled by previous forbid
|
- = note: `#[warn(forbidden_lint_groups)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+ = note: `#[warn(forbidden_lint_groups)]` on by default
warning: allow(unused_variables) incompatible with previous forbid
--> $DIR/forbid-group-member.rs:8:9
diff --git a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs
index 3a3d81176..257df13ef 100644
--- a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs
+++ b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.rs
@@ -1,10 +1,10 @@
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
// despite $LINT being allowed on command line
-// compile-flags: -A const_err --force-warn const_err
+// compile-flags: -A mutable_transmutes --force-warn mutable_transmutes
// check-pass
-const C: i32 = 1 / 0;
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler
-
-fn main() {}
+fn main() {
+ unsafe {
+ let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior
+ }
+}
diff --git a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr
index 915b3b86f..6a1fc76e1 100644
--- a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr
+++ b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr
@@ -1,23 +1,10 @@
-warning: any use of this value will cause an error
- --> $DIR/allowed-cli-deny-by-default-lint.rs:6:16
+warning: transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell
+ --> $DIR/allowed-cli-deny-by-default-lint.rs:8:17
|
-LL | const C: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
+LL | let y = std::mem::transmute::<&i32, &mut i32>(&5);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: requested on the command line with `--force-warn const-err`
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ = note: requested on the command line with `--force-warn mutable-transmutes`
warning: 1 warning emitted
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/allowed-cli-deny-by-default-lint.rs:6:16
- |
-LL | const C: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
- |
- = note: requested on the command line with `--force-warn const-err`
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs
index 08e75a775..0d4b468c2 100644
--- a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs
+++ b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.rs
@@ -1,11 +1,11 @@
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
// despite $LINT being allowed in module
-// compile-flags: --force-warn const_err
+// compile-flags: --force-warn mutable_transmutes
// check-pass
-#![allow(const_err)]
-const C: i32 = 1 / 0;
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler
-
-fn main() {}
+#![allow(mutable_transmutes)]
+fn main() {
+ unsafe {
+ let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior
+ }
+}
diff --git a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr
index 3b36d1d02..9ef53d47e 100644
--- a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr
+++ b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr
@@ -1,23 +1,10 @@
-warning: any use of this value will cause an error
- --> $DIR/allowed-deny-by-default-lint.rs:7:16
+warning: transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell
+ --> $DIR/allowed-deny-by-default-lint.rs:9:17
|
-LL | const C: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
+LL | let y = std::mem::transmute::<&i32, &mut i32>(&5);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: requested on the command line with `--force-warn const-err`
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ = note: requested on the command line with `--force-warn mutable-transmutes`
warning: 1 warning emitted
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/allowed-deny-by-default-lint.rs:7:16
- |
-LL | const C: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
- |
- = note: requested on the command line with `--force-warn const-err`
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr
index 8d826bd14..0f58953a5 100644
--- a/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr
+++ b/src/test/ui/lint/force-warn/allowed-group-warn-by-default-lint.stderr
@@ -4,14 +4,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | pub fn function(_x: Box<SomeTrait>) {}
| ^^^^^^^^^
|
- = note: requested on the command line with `--force-warn bare-trait-objects`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: requested on the command line with `--force-warn bare-trait-objects`
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/allowed-group-warn-by-default-lint.rs:10:25
@@ -23,9 +22,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/allowed-group-warn-by-default-lint.rs:10:25
@@ -37,9 +35,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: 3 warnings emitted
diff --git a/src/test/ui/lint/force-warn/cap-lints-allow.stderr b/src/test/ui/lint/force-warn/cap-lints-allow.stderr
index 978270872..03a32fa6f 100644
--- a/src/test/ui/lint/force-warn/cap-lints-allow.stderr
+++ b/src/test/ui/lint/force-warn/cap-lints-allow.stderr
@@ -4,14 +4,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | pub fn function(_x: Box<SomeTrait>) {}
| ^^^^^^^^^
|
- = note: requested on the command line with `--force-warn bare-trait-objects`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: requested on the command line with `--force-warn bare-trait-objects`
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/cap-lints-allow.rs:8:25
@@ -23,9 +22,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/cap-lints-allow.rs:8:25
@@ -37,9 +35,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: 3 warnings emitted
diff --git a/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
index 3dafaf705..d1b764b34 100644
--- a/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
+++ b/src/test/ui/lint/force-warn/cap-lints-warn-allowed-warn-by-default-lint.stderr
@@ -4,9 +4,9 @@ warning: `...` range patterns are deprecated
LL | 0...100 => true,
| ^^^ help: use `..=` for an inclusive range
|
- = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility`
warning: 1 warning emitted
diff --git a/src/test/ui/lint/force-warn/deny-by-default-lint.rs b/src/test/ui/lint/force-warn/deny-by-default-lint.rs
index e37102903..c2e9377e9 100644
--- a/src/test/ui/lint/force-warn/deny-by-default-lint.rs
+++ b/src/test/ui/lint/force-warn/deny-by-default-lint.rs
@@ -1,9 +1,9 @@
// --force-warn $LINT causes $LINT (which is deny-by-default) to warn
-// compile-flags: --force-warn const_err
+// compile-flags: --force-warn mutable_transmutes
// check-pass
-const C: i32 = 1 / 0;
-//~^ WARN any use of this value will cause an error
-//~| WARN this was previously accepted by the compiler
-
-fn main() {}
+fn main() {
+ unsafe {
+ let y = std::mem::transmute::<&i32, &mut i32>(&5); //~WARN: undefined behavior
+ }
+}
diff --git a/src/test/ui/lint/force-warn/deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr
index a2e5baa8b..c644d0fe7 100644
--- a/src/test/ui/lint/force-warn/deny-by-default-lint.stderr
+++ b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr
@@ -1,23 +1,10 @@
-warning: any use of this value will cause an error
- --> $DIR/deny-by-default-lint.rs:5:16
+warning: transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell
+ --> $DIR/deny-by-default-lint.rs:7:17
|
-LL | const C: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
+LL | let y = std::mem::transmute::<&i32, &mut i32>(&5);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: requested on the command line with `--force-warn const-err`
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
+ = note: requested on the command line with `--force-warn mutable-transmutes`
warning: 1 warning emitted
-Future incompatibility report: Future breakage diagnostic:
-warning: any use of this value will cause an error
- --> $DIR/deny-by-default-lint.rs:5:16
- |
-LL | const C: i32 = 1 / 0;
- | ------------ ^^^^^ attempt to divide `1_i32` by zero
- |
- = note: requested on the command line with `--force-warn const-err`
- = 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 #71800 <https://github.com/rust-lang/rust/issues/71800>
-
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
index 6e67ebf27..e17630fd3 100644
--- a/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-cli-warn-by-default-lint.stderr
@@ -4,14 +4,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | pub fn function(_x: Box<SomeTrait>) {}
| ^^^^^^^^^
|
- = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/lint-group-allowed-cli-warn-by-default-lint.rs:8:25
@@ -23,9 +22,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/lint-group-allowed-cli-warn-by-default-lint.rs:8:25
@@ -37,9 +35,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: 3 warnings emitted
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr b/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
index c5dea84b8..72198541a 100644
--- a/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-lint-group.stderr
@@ -4,14 +4,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | pub fn function(_x: Box<SomeTrait>) {}
| ^^^^^^^^^
|
- = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/lint-group-allowed-lint-group.rs:10:25
@@ -23,9 +22,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/lint-group-allowed-lint-group.rs:10:25
@@ -37,9 +35,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: 3 warnings emitted
diff --git a/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr b/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
index acd0c503d..52c870ac2 100644
--- a/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
+++ b/src/test/ui/lint/force-warn/lint-group-allowed-warn-by-default-lint.stderr
@@ -4,14 +4,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | pub fn function(_x: Box<SomeTrait>) {}
| ^^^^^^^^^
|
- = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/lint-group-allowed-warn-by-default-lint.rs:10:25
@@ -23,9 +22,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/lint-group-allowed-warn-by-default-lint.rs:10:25
@@ -37,9 +35,8 @@ LL | pub fn function(_x: Box<SomeTrait>) {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub fn function(_x: Box<SomeTrait>) {}
-LL + pub fn function(_x: Box<dyn SomeTrait>) {}
- |
+LL | pub fn function(_x: Box<dyn SomeTrait>) {}
+ | +++
warning: 3 warnings emitted
diff --git a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr
index 91b8d2b5a..ed9fa0d41 100644
--- a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr
+++ b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr
@@ -4,13 +4,13 @@ warning: `...` range patterns are deprecated
LL | 1...2 => {}
| ^^^ help: use `..=` for an inclusive range
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
--> $DIR/inclusive-range-pattern-syntax.rs:4:9
|
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: `...` range patterns are deprecated
--> $DIR/inclusive-range-pattern-syntax.rs:16:9
diff --git a/src/test/ui/lint/inert-attr-macro.stderr b/src/test/ui/lint/inert-attr-macro.stderr
index 3b3aa5d0b..5ccb4ffe7 100644
--- a/src/test/ui/lint/inert-attr-macro.stderr
+++ b/src/test/ui/lint/inert-attr-macro.stderr
@@ -4,17 +4,17 @@ warning: unused attribute `inline`
LL | #[inline] foo!();
| ^^^^^^^^^
|
+note: the built-in attribute `inline` will be ignored, since it's applied to the macro invocation `foo`
+ --> $DIR/inert-attr-macro.rs:10:15
+ |
+LL | #[inline] foo!();
+ | ^^^
note: the lint level is defined here
--> $DIR/inert-attr-macro.rs:3:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_attributes)]` implied by `#[warn(unused)]`
-note: the built-in attribute `inline` will be ignored, since it's applied to the macro invocation `foo`
- --> $DIR/inert-attr-macro.rs:10:15
- |
-LL | #[inline] foo!();
- | ^^^
warning: unused attribute `allow`
--> $DIR/inert-attr-macro.rs:14:5
diff --git a/src/test/ui/lint/inline-trait-and-foreign-items.stderr b/src/test/ui/lint/inline-trait-and-foreign-items.stderr
index fc7e89e4f..2f1fb4c46 100644
--- a/src/test/ui/lint/inline-trait-and-foreign-items.stderr
+++ b/src/test/ui/lint/inline-trait-and-foreign-items.stderr
@@ -4,13 +4,13 @@ warning: `#[inline]` is ignored on constants
LL | #[inline]
| ^^^^^^^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
note: the lint level is defined here
--> $DIR/inline-trait-and-foreign-items.rs:4:9
|
LL | #![warn(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: see issue #65833 <https://github.com/rust-lang/rust/issues/65833> for more information
error[E0518]: attribute should be applied to function or closure
--> $DIR/inline-trait-and-foreign-items.rs:11:5
@@ -67,7 +67,7 @@ error: unconstrained opaque type
LL | type U = impl Trait;
| ^^^^^^^^^^
|
- = note: `U` must be used in combination with a concrete type within the same module
+ = note: `U` must be used in combination with a concrete type within the same impl
error: aborting due to 6 previous errors; 2 warnings emitted
diff --git a/src/test/ui/lint/uninitialized-zeroed.rs b/src/test/ui/lint/invalid_value.rs
index 5cd323c01..57d8cbe7c 100644
--- a/src/test/ui/lint/uninitialized-zeroed.rs
+++ b/src/test/ui/lint/invalid_value.rs
@@ -34,6 +34,20 @@ enum OneFruit {
Banana,
}
+enum OneFruitNonZero {
+ Apple(!),
+ Banana(NonZeroU32),
+}
+
+enum TwoUninhabited {
+ A(!),
+ B(Void),
+}
+
+#[rustc_layout_scalar_valid_range_start(254)]
+#[rustc_layout_scalar_valid_range_end(1)]
+pub(crate) struct WrapAroundRange(u8);
+
#[allow(unused)]
fn generic<T: 'static>() {
unsafe {
@@ -78,12 +92,21 @@ fn main() {
let _val: NonNull<i32> = mem::zeroed(); //~ ERROR: does not permit zero-initialization
let _val: NonNull<i32> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+ let _val: (NonZeroU32, i32) = mem::zeroed(); //~ ERROR: does not permit zero-initialization
+ let _val: (NonZeroU32, i32) = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
let _val: *const dyn Send = mem::zeroed(); //~ ERROR: does not permit zero-initialization
let _val: *const dyn Send = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
let _val: [fn(); 2] = mem::zeroed(); //~ ERROR: does not permit zero-initialization
let _val: [fn(); 2] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+ let _val: TwoUninhabited = mem::zeroed(); //~ ERROR: does not permit zero-initialization
+ let _val: TwoUninhabited = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
+ let _val: OneFruitNonZero = mem::zeroed(); //~ ERROR: does not permit zero-initialization
+ let _val: OneFruitNonZero = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
// Things that can be zero, but not uninit.
let _val: bool = mem::zeroed();
let _val: bool = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
@@ -100,6 +123,31 @@ fn main() {
let _val: [bool; 2] = mem::zeroed();
let _val: [bool; 2] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+ let _val: i32 = mem::zeroed();
+ let _val: i32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
+ let _val: f32 = mem::zeroed();
+ let _val: f32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
+ let _val: *const () = mem::zeroed();
+ let _val: *const () = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
+ let _val: *const [()] = mem::zeroed();
+ let _val: *const [()] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
+ let _val: WrapAroundRange = mem::zeroed();
+ let _val: WrapAroundRange = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
+ // Things where 0 is okay due to rustc implementation details,
+ // but that are not guaranteed to keep working.
+ let _val: Result<i32, i32> = mem::zeroed();
+ let _val: Result<i32, i32> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
+
+ // Some things that happen to be UB-free due to rustc implementation details,
+ // but are not guaranteed to keep working.
+ let _val: OneFruit = mem::zeroed();
+ let _val: OneFruit = mem::uninitialized();
+
// Transmute-from-0
let _val: &'static i32 = mem::transmute(0usize); //~ ERROR: does not permit zero-initialization
let _val: &'static [i32] = mem::transmute((0usize, 0usize)); //~ ERROR: does not permit zero-initialization
@@ -114,13 +162,8 @@ fn main() {
let _val: Option<&'static i32> = mem::zeroed();
let _val: Option<fn()> = mem::zeroed();
let _val: MaybeUninit<&'static i32> = mem::zeroed();
- let _val: i32 = mem::zeroed();
let _val: bool = MaybeUninit::zeroed().assume_init();
let _val: [bool; 0] = MaybeUninit::uninit().assume_init();
let _val: [!; 0] = MaybeUninit::zeroed().assume_init();
- // Some things that happen to work due to rustc implementation details,
- // but are not guaranteed to keep working.
- let _val: i32 = mem::uninitialized();
- let _val: OneFruit = mem::uninitialized();
}
}
diff --git a/src/test/ui/lint/uninitialized-zeroed.stderr b/src/test/ui/lint/invalid_value.stderr
index 88121a183..76afb765f 100644
--- a/src/test/ui/lint/uninitialized-zeroed.stderr
+++ b/src/test/ui/lint/invalid_value.stderr
@@ -1,5 +1,5 @@
error: the type `&T` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:40:32
+ --> $DIR/invalid_value.rs:54:32
|
LL | let _val: &'static T = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -7,15 +7,15 @@ LL | let _val: &'static T = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
+ = note: references must be non-null
note: the lint level is defined here
- --> $DIR/uninitialized-zeroed.rs:6:9
+ --> $DIR/invalid_value.rs:6:9
|
LL | #![deny(invalid_value)]
| ^^^^^^^^^^^^^
- = note: references must be non-null
error: the type `&T` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:41:32
+ --> $DIR/invalid_value.rs:55:32
|
LL | let _val: &'static T = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL | let _val: &'static T = mem::uninitialized();
= note: references must be non-null
error: the type `Wrap<&T>` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:43:38
+ --> $DIR/invalid_value.rs:57:38
|
LL | let _val: Wrap<&'static T> = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -35,13 +35,13 @@ LL | let _val: Wrap<&'static T> = mem::zeroed();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: references must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:17:18
+ --> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
| ^^^^^^^^^^
error: the type `Wrap<&T>` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:44:38
+ --> $DIR/invalid_value.rs:58:38
|
LL | let _val: Wrap<&'static T> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -50,13 +50,13 @@ LL | let _val: Wrap<&'static T> = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: references must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:17:18
+ --> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
| ^^^^^^^^^^
error: the type `!` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:51:23
+ --> $DIR/invalid_value.rs:65:23
|
LL | let _val: ! = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -67,7 +67,7 @@ LL | let _val: ! = mem::zeroed();
= note: the `!` type has no valid value
error: the type `!` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:52:23
+ --> $DIR/invalid_value.rs:66:23
|
LL | let _val: ! = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -78,7 +78,7 @@ LL | let _val: ! = mem::uninitialized();
= note: the `!` type has no valid value
error: the type `(i32, !)` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:54:30
+ --> $DIR/invalid_value.rs:68:30
|
LL | let _val: (i32, !) = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -89,7 +89,7 @@ LL | let _val: (i32, !) = mem::zeroed();
= note: the `!` type has no valid value
error: the type `(i32, !)` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:55:30
+ --> $DIR/invalid_value.rs:69:30
|
LL | let _val: (i32, !) = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -97,10 +97,10 @@ LL | let _val: (i32, !) = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: the `!` type has no valid value
+ = note: integers must not be uninitialized
error: the type `Void` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:57:26
+ --> $DIR/invalid_value.rs:71:26
|
LL | let _val: Void = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -108,10 +108,14 @@ LL | let _val: Void = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: enums with no variants have no valid value
+note: enums with no inhabited variants have no valid value
+ --> $DIR/invalid_value.rs:12:1
+ |
+LL | enum Void {}
+ | ^^^^^^^^^
error: the type `Void` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:58:26
+ --> $DIR/invalid_value.rs:72:26
|
LL | let _val: Void = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -119,10 +123,14 @@ LL | let _val: Void = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: enums with no variants have no valid value
+note: enums with no inhabited variants have no valid value
+ --> $DIR/invalid_value.rs:12:1
+ |
+LL | enum Void {}
+ | ^^^^^^^^^
error: the type `&i32` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:60:34
+ --> $DIR/invalid_value.rs:74:34
|
LL | let _val: &'static i32 = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -133,7 +141,7 @@ LL | let _val: &'static i32 = mem::zeroed();
= note: references must be non-null
error: the type `&i32` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:61:34
+ --> $DIR/invalid_value.rs:75:34
|
LL | let _val: &'static i32 = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -144,7 +152,7 @@ LL | let _val: &'static i32 = mem::uninitialized();
= note: references must be non-null
error: the type `Ref` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:63:25
+ --> $DIR/invalid_value.rs:77:25
|
LL | let _val: Ref = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -153,13 +161,13 @@ LL | let _val: Ref = mem::zeroed();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: references must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:14:12
+ --> $DIR/invalid_value.rs:14:12
|
LL | struct Ref(&'static i32);
| ^^^^^^^^^^^^
error: the type `Ref` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:64:25
+ --> $DIR/invalid_value.rs:78:25
|
LL | let _val: Ref = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -168,13 +176,13 @@ LL | let _val: Ref = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: references must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:14:12
+ --> $DIR/invalid_value.rs:14:12
|
LL | struct Ref(&'static i32);
| ^^^^^^^^^^^^
error: the type `fn()` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:66:26
+ --> $DIR/invalid_value.rs:80:26
|
LL | let _val: fn() = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -185,7 +193,7 @@ LL | let _val: fn() = mem::zeroed();
= note: function pointers must be non-null
error: the type `fn()` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:67:26
+ --> $DIR/invalid_value.rs:81:26
|
LL | let _val: fn() = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -196,7 +204,7 @@ LL | let _val: fn() = mem::uninitialized();
= note: function pointers must be non-null
error: the type `Wrap<fn()>` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:69:32
+ --> $DIR/invalid_value.rs:83:32
|
LL | let _val: Wrap<fn()> = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -205,13 +213,13 @@ LL | let _val: Wrap<fn()> = mem::zeroed();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: function pointers must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:17:18
+ --> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
| ^^^^^^^^^^
error: the type `Wrap<fn()>` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:70:32
+ --> $DIR/invalid_value.rs:84:32
|
LL | let _val: Wrap<fn()> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -220,13 +228,13 @@ LL | let _val: Wrap<fn()> = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: function pointers must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:17:18
+ --> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
| ^^^^^^^^^^
error: the type `WrapEnum<fn()>` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:72:36
+ --> $DIR/invalid_value.rs:86:36
|
LL | let _val: WrapEnum<fn()> = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -234,14 +242,14 @@ LL | let _val: WrapEnum<fn()> = mem::zeroed();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: function pointers must be non-null (in this enum field)
- --> $DIR/uninitialized-zeroed.rs:18:28
+note: function pointers must be non-null (in this field of the only potentially inhabited enum variant)
+ --> $DIR/invalid_value.rs:18:28
|
LL | enum WrapEnum<T> { Wrapped(T) }
| ^
error: the type `WrapEnum<fn()>` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:73:36
+ --> $DIR/invalid_value.rs:87:36
|
LL | let _val: WrapEnum<fn()> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -249,14 +257,14 @@ LL | let _val: WrapEnum<fn()> = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: function pointers must be non-null (in this enum field)
- --> $DIR/uninitialized-zeroed.rs:18:28
+note: function pointers must be non-null (in this field of the only potentially inhabited enum variant)
+ --> $DIR/invalid_value.rs:18:28
|
LL | enum WrapEnum<T> { Wrapped(T) }
| ^
error: the type `Wrap<(RefPair, i32)>` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:75:42
+ --> $DIR/invalid_value.rs:89:42
|
LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -265,13 +273,13 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: references must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:15:16
+ --> $DIR/invalid_value.rs:15:16
|
LL | struct RefPair((&'static i32, i32));
| ^^^^^^^^^^^^^^^^^^^
error: the type `Wrap<(RefPair, i32)>` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:76:42
+ --> $DIR/invalid_value.rs:90:42
|
LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -280,13 +288,13 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: references must be non-null (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:15:16
+ --> $DIR/invalid_value.rs:15:16
|
LL | struct RefPair((&'static i32, i32));
| ^^^^^^^^^^^^^^^^^^^
error: the type `NonNull<i32>` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:78:34
+ --> $DIR/invalid_value.rs:92:34
|
LL | let _val: NonNull<i32> = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -297,7 +305,7 @@ LL | let _val: NonNull<i32> = mem::zeroed();
= note: `std::ptr::NonNull<i32>` must be non-null
error: the type `NonNull<i32>` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:79:34
+ --> $DIR/invalid_value.rs:93:34
|
LL | let _val: NonNull<i32> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -307,8 +315,30 @@ LL | let _val: NonNull<i32> = mem::uninitialized();
|
= note: `std::ptr::NonNull<i32>` must be non-null
+error: the type `(NonZeroU32, i32)` does not permit zero-initialization
+ --> $DIR/invalid_value.rs:95:39
+ |
+LL | let _val: (NonZeroU32, i32) = mem::zeroed();
+ | ^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+ = note: `std::num::NonZeroU32` must be non-null
+
+error: the type `(NonZeroU32, i32)` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:96:39
+ |
+LL | let _val: (NonZeroU32, i32) = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+ = note: `std::num::NonZeroU32` must be non-null
+
error: the type `*const dyn Send` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:81:37
+ --> $DIR/invalid_value.rs:98:37
|
LL | let _val: *const dyn Send = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -319,7 +349,7 @@ LL | let _val: *const dyn Send = mem::zeroed();
= note: the vtable of a wide raw pointer must be non-null
error: the type `*const dyn Send` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:82:37
+ --> $DIR/invalid_value.rs:99:37
|
LL | let _val: *const dyn Send = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -330,7 +360,7 @@ LL | let _val: *const dyn Send = mem::uninitialized();
= note: the vtable of a wide raw pointer must be non-null
error: the type `[fn(); 2]` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:84:31
+ --> $DIR/invalid_value.rs:101:31
|
LL | let _val: [fn(); 2] = mem::zeroed();
| ^^^^^^^^^^^^^
@@ -341,7 +371,7 @@ LL | let _val: [fn(); 2] = mem::zeroed();
= note: function pointers must be non-null
error: the type `[fn(); 2]` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:85:31
+ --> $DIR/invalid_value.rs:102:31
|
LL | let _val: [fn(); 2] = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -351,8 +381,68 @@ LL | let _val: [fn(); 2] = mem::uninitialized();
|
= note: function pointers must be non-null
+error: the type `TwoUninhabited` does not permit zero-initialization
+ --> $DIR/invalid_value.rs:104:36
+ |
+LL | let _val: TwoUninhabited = mem::zeroed();
+ | ^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+note: enums with no inhabited variants have no valid value
+ --> $DIR/invalid_value.rs:42:1
+ |
+LL | enum TwoUninhabited {
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: the type `TwoUninhabited` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:105:36
+ |
+LL | let _val: TwoUninhabited = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+note: enums with no inhabited variants have no valid value
+ --> $DIR/invalid_value.rs:42:1
+ |
+LL | enum TwoUninhabited {
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: the type `OneFruitNonZero` does not permit zero-initialization
+ --> $DIR/invalid_value.rs:107:37
+ |
+LL | let _val: OneFruitNonZero = mem::zeroed();
+ | ^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+note: `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
+ --> $DIR/invalid_value.rs:39:12
+ |
+LL | Banana(NonZeroU32),
+ | ^^^^^^^^^^
+
+error: the type `OneFruitNonZero` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:108:37
+ |
+LL | let _val: OneFruitNonZero = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+note: `std::num::NonZeroU32` must be non-null (in this field of the only potentially inhabited enum variant)
+ --> $DIR/invalid_value.rs:39:12
+ |
+LL | Banana(NonZeroU32),
+ | ^^^^^^^^^^
+
error: the type `bool` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:89:26
+ --> $DIR/invalid_value.rs:112:26
|
LL | let _val: bool = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -363,7 +453,7 @@ LL | let _val: bool = mem::uninitialized();
= note: booleans must be either `true` or `false`
error: the type `Wrap<char>` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:92:32
+ --> $DIR/invalid_value.rs:115:32
|
LL | let _val: Wrap<char> = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -372,13 +462,13 @@ LL | let _val: Wrap<char> = mem::uninitialized();
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
note: characters must be a valid Unicode codepoint (in this struct field)
- --> $DIR/uninitialized-zeroed.rs:17:18
+ --> $DIR/invalid_value.rs:17:18
|
LL | struct Wrap<T> { wrapped: T }
| ^^^^^^^^^^
error: the type `NonBig` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:95:28
+ --> $DIR/invalid_value.rs:118:28
|
LL | let _val: NonBig = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -389,7 +479,7 @@ LL | let _val: NonBig = mem::uninitialized();
= note: `NonBig` must be initialized inside its custom valid range
error: the type `Fruit` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:98:27
+ --> $DIR/invalid_value.rs:121:27
|
LL | let _val: Fruit = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -397,14 +487,14 @@ LL | let _val: Fruit = mem::uninitialized();
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
-note: enums have to be initialized to a variant
- --> $DIR/uninitialized-zeroed.rs:26:1
+note: enums with multiple inhabited variants have to be initialized to a variant
+ --> $DIR/invalid_value.rs:26:1
|
LL | enum Fruit {
| ^^^^^^^^^^
error: the type `[bool; 2]` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:101:31
+ --> $DIR/invalid_value.rs:124:31
|
LL | let _val: [bool; 2] = mem::uninitialized();
| ^^^^^^^^^^^^^^^^^^^^
@@ -414,8 +504,78 @@ LL | let _val: [bool; 2] = mem::uninitialized();
|
= note: booleans must be either `true` or `false`
+error: the type `i32` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:127:25
+ |
+LL | let _val: i32 = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+ = note: integers must not be uninitialized
+
+error: the type `f32` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:130:25
+ |
+LL | let _val: f32 = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+ = note: floats must not be uninitialized
+
+error: the type `*const ()` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:133:31
+ |
+LL | let _val: *const () = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+ = note: raw pointers must not be uninitialized
+
+error: the type `*const [()]` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:136:33
+ |
+LL | let _val: *const [()] = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+ = note: raw pointers must not be uninitialized
+
+error: the type `WrapAroundRange` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:139:37
+ |
+LL | let _val: WrapAroundRange = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+ = note: `WrapAroundRange` must be initialized inside its custom valid range
+
+error: the type `Result<i32, i32>` does not permit being left uninitialized
+ --> $DIR/invalid_value.rs:144:38
+ |
+LL | let _val: Result<i32, i32> = mem::uninitialized();
+ | ^^^^^^^^^^^^^^^^^^^^
+ | |
+ | this code causes undefined behavior when executed
+ | help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
+ |
+note: enums with multiple inhabited variants have to be initialized to a variant
+ --> $SRC_DIR/core/src/result.rs:LL:COL
+ |
+LL | pub enum Result<T, E> {
+ | ^^^^^^^^^^^^^^^^^^^^^
+
error: the type `&i32` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:104:34
+ --> $DIR/invalid_value.rs:152:34
|
LL | let _val: &'static i32 = mem::transmute(0usize);
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -426,7 +586,7 @@ LL | let _val: &'static i32 = mem::transmute(0usize);
= note: references must be non-null
error: the type `&[i32]` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:105:36
+ --> $DIR/invalid_value.rs:153:36
|
LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -437,7 +597,7 @@ LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize));
= note: references must be non-null
error: the type `NonZeroU32` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:106:32
+ --> $DIR/invalid_value.rs:154:32
|
LL | let _val: NonZeroU32 = mem::transmute(0);
| ^^^^^^^^^^^^^^^^^
@@ -448,7 +608,7 @@ LL | let _val: NonZeroU32 = mem::transmute(0);
= note: `std::num::NonZeroU32` must be non-null
error: the type `NonNull<i32>` does not permit zero-initialization
- --> $DIR/uninitialized-zeroed.rs:109:34
+ --> $DIR/invalid_value.rs:157:34
|
LL | let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -459,7 +619,7 @@ LL | let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init();
= note: `std::ptr::NonNull<i32>` must be non-null
error: the type `NonNull<i32>` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:110:34
+ --> $DIR/invalid_value.rs:158:34
|
LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -470,7 +630,7 @@ LL | let _val: NonNull<i32> = MaybeUninit::uninit().assume_init();
= note: `std::ptr::NonNull<i32>` must be non-null
error: the type `bool` does not permit being left uninitialized
- --> $DIR/uninitialized-zeroed.rs:111:26
+ --> $DIR/invalid_value.rs:159:26
|
LL | let _val: bool = MaybeUninit::uninit().assume_init();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -480,5 +640,5 @@ LL | let _val: bool = MaybeUninit::uninit().assume_init();
|
= note: booleans must be either `true` or `false`
-error: aborting due to 39 previous errors
+error: aborting due to 51 previous errors
diff --git a/src/test/ui/lint/issue-101284.rs b/src/test/ui/lint/issue-101284.rs
new file mode 100644
index 000000000..1381d4f17
--- /dev/null
+++ b/src/test/ui/lint/issue-101284.rs
@@ -0,0 +1,15 @@
+// check-pass
+// edition:2021
+#![deny(rust_2021_compatibility)]
+
+pub struct Warns {
+ // `Arc` has significant drop
+ _significant_drop: std::sync::Arc<()>,
+ field: String,
+}
+
+pub fn test(w: Warns) {
+ _ = || drop(w.field);
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/issue-102705.rs b/src/test/ui/lint/issue-102705.rs
new file mode 100644
index 000000000..5bcc8950a
--- /dev/null
+++ b/src/test/ui/lint/issue-102705.rs
@@ -0,0 +1,22 @@
+// check-pass
+
+#![allow(opaque_hidden_inferred_bound)]
+#![allow(dead_code)]
+
+trait Duh {}
+
+impl Duh for i32 {}
+
+trait Trait {
+ type Assoc: Duh;
+}
+
+impl<R: Duh, F: FnMut() -> R> Trait for F {
+ type Assoc = R;
+}
+
+fn foo() -> impl Trait<Assoc = impl Send> {
+ || 42
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/issue-14309.stderr b/src/test/ui/lint/issue-14309.stderr
index a9538b5e3..9ce62a6b8 100644
--- a/src/test/ui/lint/issue-14309.stderr
+++ b/src/test/ui/lint/issue-14309.stderr
@@ -4,11 +4,6 @@ error: `extern` block uses type `A`, which is not FFI-safe
LL | fn foo(x: A);
| ^ not FFI-safe
|
-note: the lint level is defined here
- --> $DIR/issue-14309.rs:1:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
@@ -16,6 +11,11 @@ note: the type is defined here
|
LL | struct A {
| ^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/issue-14309.rs:1:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
error: `extern` block uses type `A`, which is not FFI-safe
--> $DIR/issue-14309.rs:31:15
diff --git a/src/test/ui/lint/issue-1866.stderr b/src/test/ui/lint/issue-1866.stderr
index 5edae48a1..d19a13496 100644
--- a/src/test/ui/lint/issue-1866.stderr
+++ b/src/test/ui/lint/issue-1866.stderr
@@ -7,13 +7,13 @@ LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
LL | pub fn rust_task_is_unwinding(rt: *const rust_task) -> bool;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
|
+ = note: expected `unsafe extern "C" fn(*const usize) -> bool`
+ found `unsafe extern "C" fn(*const bool) -> bool`
note: the lint level is defined here
--> $DIR/issue-1866.rs:4:9
|
LL | #![warn(clashing_extern_declarations)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: expected `unsafe extern "C" fn(*const usize) -> bool`
- found `unsafe extern "C" fn(*const bool) -> bool`
warning: 1 warning emitted
diff --git a/src/test/ui/lint/issue-63364.stderr b/src/test/ui/lint/issue-63364.stderr
index 0375359ae..9b5453fa8 100644
--- a/src/test/ui/lint/issue-63364.stderr
+++ b/src/test/ui/lint/issue-63364.stderr
@@ -4,8 +4,8 @@ error: literal out of range for `u16`
LL | for n in 100_000.. {
| ^^^^^^^
|
- = note: `#[deny(overflowing_literals)]` on by default
= note: the literal `100_000` does not fit into the type `u16` whose range is `0..=65535`
+ = note: `#[deny(overflowing_literals)]` on by default
error: aborting due to previous error
diff --git a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs
index c66037e9a..b4fc33174 100644
--- a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs
+++ b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.rs
@@ -5,7 +5,7 @@
// If you turn off deduplicate diagnostics (which rustc turns on by default but
// compiletest turns off when it runs ui tests), then the errors are
// (unfortunately) repeated here because the checking is done as we read in the
-// errors, and curretly that happens two or three different times, depending on
+// errors, and currently that happens two or three different times, depending on
// compiler flags.
//
// I decided avoiding the redundant output was not worth the time in engineering
diff --git a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr
index 5093715de..cc44f8aa5 100644
--- a/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr
+++ b/src/test/ui/lint/issue-70819-dont-override-forbid-in-same-scope.stderr
@@ -6,13 +6,13 @@ LL | #![forbid(unused)]
LL | #![deny(unused)]
| ^^^^^^ overruled by previous forbid
|
+ = 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 #81670 <https://github.com/rust-lang/rust/issues/81670>
note: the lint level is defined here
--> $DIR/issue-70819-dont-override-forbid-in-same-scope.rs:17:11
|
LL | #![forbid(forbidden_lint_groups)]
| ^^^^^^^^^^^^^^^^^^^^^
- = 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 #81670 <https://github.com/rust-lang/rust/issues/81670>
error: aborting due to previous error
diff --git a/src/test/ui/lint/issue-79744.stderr b/src/test/ui/lint/issue-79744.stderr
index 6f6dd44d2..c1b56250d 100644
--- a/src/test/ui/lint/issue-79744.stderr
+++ b/src/test/ui/lint/issue-79744.stderr
@@ -4,9 +4,9 @@ error: literal out of range for `i8`
LL | let e2 = 230;
| ^^^
|
- = note: `#[deny(overflowing_literals)]` on by default
= note: the literal `230` does not fit into the type `i8` whose range is `-128..=127`
= help: consider using the type `u8` instead
+ = note: `#[deny(overflowing_literals)]` on by default
error: aborting due to previous error
diff --git a/src/test/ui/lint/issue-80988.stderr b/src/test/ui/lint/issue-80988.stderr
index 1d397f431..73e27ffda 100644
--- a/src/test/ui/lint/issue-80988.stderr
+++ b/src/test/ui/lint/issue-80988.stderr
@@ -7,9 +7,9 @@ LL |
LL | #[deny(warnings)]
| ^^^^^^^^ overruled by previous forbid
|
- = note: `#[warn(forbidden_lint_groups)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #81670 <https://github.com/rust-lang/rust/issues/81670>
+ = note: `#[warn(forbidden_lint_groups)]` on by default
warning: deny(warnings) incompatible with previous forbid
--> $DIR/issue-80988.rs:7:8
diff --git a/src/test/ui/lint/issue-83477.stderr b/src/test/ui/lint/issue-83477.stderr
index e619bcfe2..f824fc09e 100644
--- a/src/test/ui/lint/issue-83477.stderr
+++ b/src/test/ui/lint/issue-83477.stderr
@@ -18,13 +18,13 @@ warning: prefer `FxHashMap` over `HashMap`, it has better performance
LL | let _ = std::collections::HashMap::<String, String>::new();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
+ = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
note: the lint level is defined here
--> $DIR/issue-83477.rs:3:9
|
LL | #![warn(rustc::internal)]
| ^^^^^^^^^^^^^^^
= note: `#[warn(rustc::default_hash_types)]` implied by `#[warn(rustc::internal)]`
- = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
warning: 3 warnings emitted
diff --git a/src/test/ui/lint/issue-86600-lint-twice.stderr b/src/test/ui/lint/issue-86600-lint-twice.stderr
index 8da3fb5a8..5a65c6121 100644
--- a/src/test/ui/lint/issue-86600-lint-twice.stderr
+++ b/src/test/ui/lint/issue-86600-lint-twice.stderr
@@ -4,9 +4,9 @@ warning: floating-point types cannot be used in patterns
LL | 5.0 => {}
| ^^^
|
- = note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
+ = note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/lint/let_underscore/let_underscore_drop.rs b/src/test/ui/lint/let_underscore/let_underscore_drop.rs
new file mode 100644
index 000000000..f298871f1
--- /dev/null
+++ b/src/test/ui/lint/let_underscore/let_underscore_drop.rs
@@ -0,0 +1,14 @@
+// check-pass
+#![warn(let_underscore_drop)]
+
+struct NontrivialDrop;
+
+impl Drop for NontrivialDrop {
+ fn drop(&mut self) {
+ println!("Dropping!");
+ }
+}
+
+fn main() {
+ let _ = NontrivialDrop; //~WARNING non-binding let on a type that implements `Drop`
+}
diff --git a/src/test/ui/lint/let_underscore/let_underscore_drop.stderr b/src/test/ui/lint/let_underscore/let_underscore_drop.stderr
new file mode 100644
index 000000000..7b7de202e
--- /dev/null
+++ b/src/test/ui/lint/let_underscore/let_underscore_drop.stderr
@@ -0,0 +1,22 @@
+warning: non-binding let on a type that implements `Drop`
+ --> $DIR/let_underscore_drop.rs:13:5
+ |
+LL | let _ = NontrivialDrop;
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/let_underscore_drop.rs:2:9
+ |
+LL | #![warn(let_underscore_drop)]
+ | ^^^^^^^^^^^^^^^^^^^
+help: consider binding to an unused variable to avoid immediately dropping the value
+ |
+LL | let _unused = NontrivialDrop;
+ | ~~~~~~~
+help: consider immediately dropping the value
+ |
+LL | drop(NontrivialDrop);
+ | ~~~~~ +
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/lint/let_underscore/let_underscore_lock.rs b/src/test/ui/lint/let_underscore/let_underscore_lock.rs
new file mode 100644
index 000000000..7423862cd
--- /dev/null
+++ b/src/test/ui/lint/let_underscore/let_underscore_lock.rs
@@ -0,0 +1,7 @@
+// check-fail
+use std::sync::{Arc, Mutex};
+
+fn main() {
+ let data = Arc::new(Mutex::new(0));
+ let _ = data.lock().unwrap(); //~ERROR non-binding let on a synchronization lock
+}
diff --git a/src/test/ui/lint/let_underscore/let_underscore_lock.stderr b/src/test/ui/lint/let_underscore/let_underscore_lock.stderr
new file mode 100644
index 000000000..fb58af0a4
--- /dev/null
+++ b/src/test/ui/lint/let_underscore/let_underscore_lock.stderr
@@ -0,0 +1,20 @@
+error: non-binding let on a synchronization lock
+ --> $DIR/let_underscore_lock.rs:6:9
+ |
+LL | let _ = data.lock().unwrap();
+ | ^ ^^^^^^^^^^^^^^^^^^^^ this binding will immediately drop the value assigned to it
+ | |
+ | this lock is not assigned to a binding and is immediately dropped
+ |
+ = note: `#[deny(let_underscore_lock)]` on by default
+help: consider binding to an unused variable to avoid immediately dropping the value
+ |
+LL | let _unused = data.lock().unwrap();
+ | ~~~~~~~
+help: consider immediately dropping the value
+ |
+LL | drop(data.lock().unwrap());
+ | ~~~~~ +
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/lint-attr-everywhere-early.rs b/src/test/ui/lint/lint-attr-everywhere-early.rs
new file mode 100644
index 000000000..fd0c4b43e
--- /dev/null
+++ b/src/test/ui/lint/lint-attr-everywhere-early.rs
@@ -0,0 +1,176 @@
+// Tests that lint levels can be set for early lints.
+#![allow(non_camel_case_types, unsafe_code, while_true, unused_parens)]
+
+// The following is a check of the lints used here to verify they do not warn
+// when allowed.
+fn verify_no_warnings() {
+ type non_camel_type = i32; // non_camel_case_types
+ struct NON_CAMEL_IS_ALLOWED; // non_camel_case_types
+ unsafe {} // unsafe_code
+ enum Enum {
+ VARIANT_CAMEL // non_camel_case_types
+ }
+ fn generics<foo>() {} // non_camel_case_types
+ while true {} // while_true
+ type T = (i32); // unused_parens
+}
+
+
+// ################## Types
+
+#[deny(non_camel_case_types)]
+type type_outer = i32; //~ ERROR type `type_outer` should have an upper camel case name
+
+type BareFnPtr = fn(#[deny(unused_parens)](i32)); //~ ERROR unnecessary parentheses around type
+// There aren't any early lints that currently apply to the variadic spot.
+// type BareFnPtrVariadic = extern "C" fn(i32, #[deny()]...);
+
+// ################## Items
+#[deny(non_camel_case_types)]
+struct ITEM_OUTER; //~ ERROR type `ITEM_OUTER` should have an upper camel case name
+
+mod module_inner {
+ #![deny(unsafe_code)]
+ fn f() {
+ unsafe {} //~ ERROR usage of an `unsafe` block
+ }
+}
+
+struct Associated;
+impl Associated {
+ #![deny(unsafe_code)]
+
+ fn inherent_denied_from_inner() { unsafe {} } //~ usage of an `unsafe` block
+
+ #[deny(while_true)]
+ fn inherent_fn() { while true {} } //~ ERROR denote infinite loops with
+
+ #[deny(while_true)]
+ const INHERENT_CONST: i32 = {while true {} 1}; //~ ERROR denote infinite loops with
+}
+
+trait trait_inner { //~ ERROR trait `trait_inner` should have an upper camel case name
+ #![deny(non_camel_case_types)]
+}
+
+trait AssociatedTrait {
+ #![deny(unsafe_code)]
+
+ fn denied_from_inner() { unsafe {} } //~ ERROR usage of an `unsafe` block
+
+ #[deny(while_true)]
+ fn assoc_fn() { while true {} } //~ ERROR denote infinite loops with
+
+ #[deny(while_true)]
+ const ASSOC_CONST: i32 = {while true {} 1}; //~ ERROR denote infinite loops with
+
+ #[deny(non_camel_case_types)]
+ type assoc_type; //~ ERROR associated type `assoc_type` should have an upper camel case name
+}
+
+impl AssociatedTrait for Associated {
+ #![deny(unsafe_code)]
+
+ fn denied_from_inner() { unsafe {} } //~ ERROR usage of an `unsafe` block
+
+ #[deny(while_true)]
+ fn assoc_fn() { while true {} } //~ ERROR denote infinite loops with
+
+ #[deny(while_true)]
+ const ASSOC_CONST: i32 = {while true {} 1}; //~ ERROR denote infinite loops with
+
+ #[deny(unused_parens)]
+ type assoc_type = (i32); //~ ERROR unnecessary parentheses around type
+}
+
+struct StructFields {
+ #[deny(unused_parens)]f1: (i32), //~ ERROR unnecessary parentheses around type
+}
+struct StructTuple(#[deny(unused_parens)](i32)); //~ ERROR unnecessary parentheses around type
+
+enum Enum {
+ #[deny(non_camel_case_types)]
+ VARIANT_CAMEL, //~ ERROR variant `VARIANT_CAMEL` should have an upper camel case name
+}
+
+extern "C" {
+ #![deny(unused_parens)]
+
+ fn foreign_denied_from_inner(x: (i32)); //~ ERROR unnecessary parentheses around type
+}
+
+extern "C" {
+ #[deny(unused_parens)]
+ fn foreign_denied_from_outer(x: (i32)); //~ ERROR unnecessary parentheses around type
+}
+
+fn function(#[deny(unused_parens)] param: (i32)) {} //~ ERROR unnecessary parentheses around type
+
+fn generics<#[deny(non_camel_case_types)]foo>() {} //~ ERROR type parameter `foo` should have an upper camel case name
+
+
+// ################## Statements
+fn statements() {
+ #[deny(unused_parens)]
+ let x = (1); //~ ERROR unnecessary parentheses around assigned value
+}
+
+
+// ################## Expressions
+fn expressions() {
+ let closure = |#[deny(unused_parens)] param: (i32)| {}; //~ ERROR unnecessary parentheses around type
+
+ struct Match{f1: i32}
+ // Strangely unused_parens doesn't fire with {f1: (123)}
+ let f = Match{#[deny(unused_parens)]f1: {(123)}}; //~ ERROR unnecessary parentheses around block return value
+
+ match f {
+ #![deny(unsafe_code)]
+
+ #[deny(while_true)]
+ Match{f1} => {
+ unsafe {} //~ ERROR usage of an `unsafe` block
+ while true {} //~ ERROR denote infinite loops with
+ }
+ }
+
+ // Statement Block
+ {
+ #![deny(unsafe_code)]
+ unsafe {} //~ ERROR usage of an `unsafe` block
+ }
+ let block_tail = {
+ #[deny(unsafe_code)]
+ unsafe {} //~ ERROR usage of an `unsafe` block
+ };
+
+ // Before expression as a statement.
+ #[deny(unsafe_code)]
+ unsafe {}; //~ ERROR usage of an `unsafe` block
+
+ [#[deny(unsafe_code)] unsafe {123}]; //~ ERROR usage of an `unsafe` block
+ (#[deny(unsafe_code)] unsafe {123},); //~ ERROR usage of an `unsafe` block
+ fn call(p: i32) {}
+ call(#[deny(unsafe_code)] unsafe {123}); //~ ERROR usage of an `unsafe` block
+ struct TupleStruct(i32);
+ TupleStruct(#[deny(unsafe_code)] unsafe {123}); //~ ERROR usage of an `unsafe` block
+}
+
+
+// ################## Patterns
+fn patterns() {
+ struct PatField{f1: i32, f2: i32};
+ let f = PatField{f1: 1, f2: 2};
+ match f {
+ PatField {
+ #[deny(ellipsis_inclusive_range_patterns)]
+ f1: 0...100,
+ //~^ ERROR range patterns are deprecated
+ //~| WARNING this is accepted in the current edition
+ ..
+ } => {}
+ _ => {}
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/lint-attr-everywhere-early.stderr b/src/test/ui/lint/lint-attr-everywhere-early.stderr
new file mode 100644
index 000000000..d6c6d5fae
--- /dev/null
+++ b/src/test/ui/lint/lint-attr-everywhere-early.stderr
@@ -0,0 +1,486 @@
+error: type `type_outer` should have an upper camel case name
+ --> $DIR/lint-attr-everywhere-early.rs:22:6
+ |
+LL | type type_outer = i32;
+ | ^^^^^^^^^^ help: convert the identifier to upper camel case: `TypeOuter`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:21:8
+ |
+LL | #[deny(non_camel_case_types)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:24:43
+ |
+LL | type BareFnPtr = fn(#[deny(unused_parens)](i32));
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:24:28
+ |
+LL | type BareFnPtr = fn(#[deny(unused_parens)](i32));
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - type BareFnPtr = fn(#[deny(unused_parens)](i32));
+LL + type BareFnPtr = fn(#[deny(unused_parens)]i32);
+ |
+
+error: type `ITEM_OUTER` should have an upper camel case name
+ --> $DIR/lint-attr-everywhere-early.rs:30:8
+ |
+LL | struct ITEM_OUTER;
+ | ^^^^^^^^^^ help: convert the identifier to upper camel case: `ItemOuter`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:29:8
+ |
+LL | #[deny(non_camel_case_types)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:35:9
+ |
+LL | unsafe {}
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:33:13
+ |
+LL | #![deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:43:39
+ |
+LL | fn inherent_denied_from_inner() { unsafe {} }
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:41:13
+ |
+LL | #![deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/lint-attr-everywhere-early.rs:46:24
+ |
+LL | fn inherent_fn() { while true {} }
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:45:12
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/lint-attr-everywhere-early.rs:49:34
+ |
+LL | const INHERENT_CONST: i32 = {while true {} 1};
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:48:12
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+error: trait `trait_inner` should have an upper camel case name
+ --> $DIR/lint-attr-everywhere-early.rs:52:7
+ |
+LL | trait trait_inner {
+ | ^^^^^^^^^^^ help: convert the identifier to upper camel case: `TraitInner`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:53:13
+ |
+LL | #![deny(non_camel_case_types)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:59:30
+ |
+LL | fn denied_from_inner() { unsafe {} }
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:57:13
+ |
+LL | #![deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/lint-attr-everywhere-early.rs:62:21
+ |
+LL | fn assoc_fn() { while true {} }
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:61:12
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/lint-attr-everywhere-early.rs:65:31
+ |
+LL | const ASSOC_CONST: i32 = {while true {} 1};
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:64:12
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+error: associated type `assoc_type` should have an upper camel case name
+ --> $DIR/lint-attr-everywhere-early.rs:68:10
+ |
+LL | type assoc_type;
+ | ^^^^^^^^^^ help: convert the identifier to upper camel case: `AssocType`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:67:12
+ |
+LL | #[deny(non_camel_case_types)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:74:30
+ |
+LL | fn denied_from_inner() { unsafe {} }
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:72:13
+ |
+LL | #![deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/lint-attr-everywhere-early.rs:77:21
+ |
+LL | fn assoc_fn() { while true {} }
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:76:12
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/lint-attr-everywhere-early.rs:80:31
+ |
+LL | const ASSOC_CONST: i32 = {while true {} 1};
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:79:12
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:83:23
+ |
+LL | type assoc_type = (i32);
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:82:12
+ |
+LL | #[deny(unused_parens)]
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - type assoc_type = (i32);
+LL + type assoc_type = i32;
+ |
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:87:31
+ |
+LL | #[deny(unused_parens)]f1: (i32),
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:87:12
+ |
+LL | #[deny(unused_parens)]f1: (i32),
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - #[deny(unused_parens)]f1: (i32),
+LL + #[deny(unused_parens)]f1: i32,
+ |
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:89:42
+ |
+LL | struct StructTuple(#[deny(unused_parens)](i32));
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:89:27
+ |
+LL | struct StructTuple(#[deny(unused_parens)](i32));
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - struct StructTuple(#[deny(unused_parens)](i32));
+LL + struct StructTuple(#[deny(unused_parens)]i32);
+ |
+
+error: variant `VARIANT_CAMEL` should have an upper camel case name
+ --> $DIR/lint-attr-everywhere-early.rs:93:5
+ |
+LL | VARIANT_CAMEL,
+ | ^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `VariantCamel`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:92:12
+ |
+LL | #[deny(non_camel_case_types)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:99:37
+ |
+LL | fn foreign_denied_from_inner(x: (i32));
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:97:13
+ |
+LL | #![deny(unused_parens)]
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - fn foreign_denied_from_inner(x: (i32));
+LL + fn foreign_denied_from_inner(x: i32);
+ |
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:104:37
+ |
+LL | fn foreign_denied_from_outer(x: (i32));
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:103:12
+ |
+LL | #[deny(unused_parens)]
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - fn foreign_denied_from_outer(x: (i32));
+LL + fn foreign_denied_from_outer(x: i32);
+ |
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:107:43
+ |
+LL | fn function(#[deny(unused_parens)] param: (i32)) {}
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:107:20
+ |
+LL | fn function(#[deny(unused_parens)] param: (i32)) {}
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - fn function(#[deny(unused_parens)] param: (i32)) {}
+LL + fn function(#[deny(unused_parens)] param: i32) {}
+ |
+
+error: type parameter `foo` should have an upper camel case name
+ --> $DIR/lint-attr-everywhere-early.rs:109:42
+ |
+LL | fn generics<#[deny(non_camel_case_types)]foo>() {}
+ | ^^^ help: convert the identifier to upper camel case (notice the capitalization): `Foo`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:109:20
+ |
+LL | fn generics<#[deny(non_camel_case_types)]foo>() {}
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: unnecessary parentheses around assigned value
+ --> $DIR/lint-attr-everywhere-early.rs:115:13
+ |
+LL | let x = (1);
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:114:12
+ |
+LL | #[deny(unused_parens)]
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - let x = (1);
+LL + let x = 1;
+ |
+
+error: unnecessary parentheses around type
+ --> $DIR/lint-attr-everywhere-early.rs:121:50
+ |
+LL | let closure = |#[deny(unused_parens)] param: (i32)| {};
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:121:27
+ |
+LL | let closure = |#[deny(unused_parens)] param: (i32)| {};
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - let closure = |#[deny(unused_parens)] param: (i32)| {};
+LL + let closure = |#[deny(unused_parens)] param: i32| {};
+ |
+
+error: unnecessary parentheses around block return value
+ --> $DIR/lint-attr-everywhere-early.rs:125:46
+ |
+LL | let f = Match{#[deny(unused_parens)]f1: {(123)}};
+ | ^ ^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:125:26
+ |
+LL | let f = Match{#[deny(unused_parens)]f1: {(123)}};
+ | ^^^^^^^^^^^^^
+help: remove these parentheses
+ |
+LL - let f = Match{#[deny(unused_parens)]f1: {(123)}};
+LL + let f = Match{#[deny(unused_parens)]f1: {123}};
+ |
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:132:13
+ |
+LL | unsafe {}
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:128:17
+ |
+LL | #![deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: denote infinite loops with `loop { ... }`
+ --> $DIR/lint-attr-everywhere-early.rs:133:13
+ |
+LL | while true {}
+ | ^^^^^^^^^^ help: use `loop`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:130:16
+ |
+LL | #[deny(while_true)]
+ | ^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:140:9
+ |
+LL | unsafe {}
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:139:17
+ |
+LL | #![deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:144:9
+ |
+LL | unsafe {}
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:143:16
+ |
+LL | #[deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:149:5
+ |
+LL | unsafe {};
+ | ^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:148:12
+ |
+LL | #[deny(unsafe_code)]
+ | ^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:151:27
+ |
+LL | [#[deny(unsafe_code)] unsafe {123}];
+ | ^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:151:13
+ |
+LL | [#[deny(unsafe_code)] unsafe {123}];
+ | ^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:152:27
+ |
+LL | (#[deny(unsafe_code)] unsafe {123},);
+ | ^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:152:13
+ |
+LL | (#[deny(unsafe_code)] unsafe {123},);
+ | ^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:154:31
+ |
+LL | call(#[deny(unsafe_code)] unsafe {123});
+ | ^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:154:17
+ |
+LL | call(#[deny(unsafe_code)] unsafe {123});
+ | ^^^^^^^^^^^
+
+error: usage of an `unsafe` block
+ --> $DIR/lint-attr-everywhere-early.rs:156:38
+ |
+LL | TupleStruct(#[deny(unsafe_code)] unsafe {123});
+ | ^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:156:24
+ |
+LL | TupleStruct(#[deny(unsafe_code)] unsafe {123});
+ | ^^^^^^^^^^^
+
+error: `...` range patterns are deprecated
+ --> $DIR/lint-attr-everywhere-early.rs:167:18
+ |
+LL | f1: 0...100,
+ | ^^^ help: use `..=` for an inclusive range
+ |
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-early.rs:166:20
+ |
+LL | #[deny(ellipsis_inclusive_range_patterns)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 36 previous errors
+
diff --git a/src/test/ui/lint/lint-attr-everywhere-late.rs b/src/test/ui/lint/lint-attr-everywhere-late.rs
new file mode 100644
index 000000000..1055157d6
--- /dev/null
+++ b/src/test/ui/lint/lint-attr-everywhere-late.rs
@@ -0,0 +1,197 @@
+// Tests that lint levels can be set for late lints.
+#![allow(
+ non_snake_case,
+ overflowing_literals,
+ missing_docs,
+ dyn_drop,
+ enum_intrinsics_non_enums,
+ clashing_extern_declarations
+)]
+
+extern crate core;
+use core::mem::{Discriminant, discriminant};
+
+// The following is a check of the lints used here to verify they do not warn
+// when allowed.
+pub fn missing_docs_allowed() {} // missing_docs
+fn dyn_drop_allowed(_x: Box<dyn Drop>) {} // dyn_drop
+fn verify_no_warnings() {
+ discriminant::<i32>(&123); // enum_intrinsics_non_enums
+ let x: u8 = 1000; // overflowing_literals
+ let NON_SNAKE_CASE = 1; // non_snake_case
+}
+mod clashing_extern_allowed {
+ extern "C" {
+ fn extern_allowed();
+ }
+}
+extern "C" {
+ fn extern_allowed(_: i32); // clashing_extern_declarations
+}
+
+// ################## Types
+
+#[deny(missing_docs)]
+pub type MissingDocType = i32; //~ ERROR missing documentation for a type alias
+
+// There aren't any late lints that I can find that can be easily used with types.
+// type BareFnPtr = fn(#[deny()]i32);
+// type BareFnPtrVariadic = extern "C" fn(i32, #[deny()]...);
+
+// ################## Items
+#[deny(missing_docs)]
+pub struct ItemOuter; //~ ERROR missing documentation for a struct
+
+pub mod module_inner { //~ ERROR missing documentation for a module
+ #![deny(missing_docs)]
+ pub fn missing_inner() {} //~ ERROR missing documentation for a function
+}
+
+pub struct Associated;
+impl Associated {
+ #![deny(missing_docs)]
+
+ pub fn inherent_denied_from_inner() {} //~ ERROR missing documentation for an associated function
+}
+
+impl Associated {
+ #[deny(missing_docs)]
+ pub fn inherent_fn() {} //~ ERROR missing documentation for an associated function
+
+ #[deny(missing_docs)]
+ pub const INHERENT_CONST: i32 = 1; //~ ERROR missing documentation for an associated constant
+}
+
+pub trait TraitInner { //~ ERROR missing documentation for a trait
+ #![deny(missing_docs)]
+}
+
+pub trait AssociatedTraitInner { //~ ERROR missing documentation for a trait
+ #![deny(missing_docs)]
+
+ fn denied_from_inner() {} //~ ERROR missing documentation for an associated function
+}
+
+pub trait AssociatedTrait {
+ fn denied_from_inner(_x: Box<dyn Drop>) {} // Used below
+
+ #[deny(missing_docs)]
+ fn assoc_fn() {} //~ ERROR missing documentation for an associated function
+
+ #[deny(missing_docs)]
+ const ASSOC_CONST: u8 = 1; //~ ERROR missing documentation for an associated constant
+
+ #[deny(missing_docs)]
+ type AssocType; //~ ERROR missing documentation for an associated type
+}
+
+struct Foo;
+
+impl AssociatedTrait for Associated {
+ #![deny(dyn_drop)]
+
+ fn denied_from_inner(_x: Box<dyn Drop>) {} //~ ERROR types that do not implement `Drop`
+
+ #[deny(enum_intrinsics_non_enums)]
+ fn assoc_fn() { discriminant::<i32>(&123); } //~ ERROR the return value of
+
+ #[deny(overflowing_literals)] const ASSOC_CONST: u8 = 1000; //~ ERROR literal out of range
+ type AssocType = i32;
+}
+
+
+// There aren't any late lints that can apply to a field that I can find.
+// non_snake_case doesn't work on fields
+// struct StructFields {
+// #[deny()]f1: i32,
+// }
+// struct StructTuple(#[deny()]i32);
+
+pub enum Enum {
+ #[deny(missing_docs)]
+ Variant1, //~ ERROR missing documentation for a variant
+}
+
+mod clashing_extern {
+ extern "C" {
+ fn clashing1();
+ fn clashing2();
+ }
+}
+extern "C" {
+ #![deny(clashing_extern_declarations)]
+ fn clashing1(_: i32); //~ ERROR `clashing1` redeclared with a different signature
+}
+
+extern "C" {
+ #[deny(clashing_extern_declarations)]
+ fn clashing2(_: i32); //~ ERROR `clashing2` redeclared with a different signature
+}
+
+fn function(#[deny(non_snake_case)] PARAM: i32) {} //~ ERROR variable `PARAM` should have a snake case name
+// There aren't any late lints that can apply to generics that I can find.
+// fn generics<#[deny()]T>() {}
+
+
+// ################## Statements
+fn statements() {
+ #[deny(enum_intrinsics_non_enums)]
+ let _ = discriminant::<i32>(&123); //~ ERROR the return value of
+}
+
+
+// ################## Expressions
+fn expressions() {
+ let closure = |#[deny(non_snake_case)] PARAM: i32| {}; //~ ERROR variable `PARAM` should have a snake case name
+
+ struct Match{f1: i32}
+ // I can't find any late lints for patterns.
+ // let f = Match{#[deny()]f1: 123};
+
+ let f = Match{f1: 123};
+ match f {
+ #![deny(enum_intrinsics_non_enums)]
+ Match{f1} => {
+ discriminant::<i32>(&123); //~ ERROR the return value of
+ }
+ }
+ match f {
+ #[deny(enum_intrinsics_non_enums)]
+ Match{f1} => {
+ discriminant::<i32>(&123); //~ ERROR the return value of
+ }
+ }
+
+ // Statement Block
+ {
+ #![deny(enum_intrinsics_non_enums)]
+ discriminant::<i32>(&123); //~ ERROR the return value of
+ }
+ let block_tail = {
+ #[deny(enum_intrinsics_non_enums)]
+ discriminant::<i32>(&123); //~ ERROR the return value of
+ };
+
+ // Before expression as a statement.
+ #[deny(enum_intrinsics_non_enums)]
+ discriminant::<i32>(&123); //~ ERROR the return value of
+
+ [#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123)]; //~ ERROR the return value of
+ (#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123),); //~ ERROR the return value of
+ fn call(p: Discriminant<i32>) {}
+ call(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123)); //~ ERROR the return value of
+ struct TupleStruct(Discriminant<i32>);
+ TupleStruct(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123)); //~ ERROR the return value of
+}
+
+
+// ################## Patterns
+fn patterns() {
+ // There aren't any late lints that I can find that apply to pattern fields.
+ //
+ // struct PatField{f1: i32, f2: i32};
+ // let f = PatField{f1: 1, f2: 2};
+ // let PatField{#[deny()]f1, #[deny()]..} = f;
+}
+
+fn main() {}
diff --git a/src/test/ui/lint/lint-attr-everywhere-late.stderr b/src/test/ui/lint/lint-attr-everywhere-late.stderr
new file mode 100644
index 000000000..a69c2e0ef
--- /dev/null
+++ b/src/test/ui/lint/lint-attr-everywhere-late.stderr
@@ -0,0 +1,428 @@
+error: missing documentation for a type alias
+ --> $DIR/lint-attr-everywhere-late.rs:35:1
+ |
+LL | pub type MissingDocType = i32;
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:34:8
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for a struct
+ --> $DIR/lint-attr-everywhere-late.rs:43:1
+ |
+LL | pub struct ItemOuter;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:42:8
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for a module
+ --> $DIR/lint-attr-everywhere-late.rs:45:1
+ |
+LL | pub mod module_inner {
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:46:13
+ |
+LL | #![deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for a function
+ --> $DIR/lint-attr-everywhere-late.rs:47:5
+ |
+LL | pub fn missing_inner() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: missing documentation for an associated function
+ --> $DIR/lint-attr-everywhere-late.rs:54:5
+ |
+LL | pub fn inherent_denied_from_inner() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:52:13
+ |
+LL | #![deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for an associated function
+ --> $DIR/lint-attr-everywhere-late.rs:59:5
+ |
+LL | pub fn inherent_fn() {}
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:58:12
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for an associated constant
+ --> $DIR/lint-attr-everywhere-late.rs:62:5
+ |
+LL | pub const INHERENT_CONST: i32 = 1;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:61:12
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for a trait
+ --> $DIR/lint-attr-everywhere-late.rs:65:1
+ |
+LL | pub trait TraitInner {
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:66:13
+ |
+LL | #![deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for a trait
+ --> $DIR/lint-attr-everywhere-late.rs:69:1
+ |
+LL | pub trait AssociatedTraitInner {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:70:13
+ |
+LL | #![deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for an associated function
+ --> $DIR/lint-attr-everywhere-late.rs:72:5
+ |
+LL | fn denied_from_inner() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: missing documentation for an associated function
+ --> $DIR/lint-attr-everywhere-late.rs:79:5
+ |
+LL | fn assoc_fn() {}
+ | ^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:78:12
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for an associated constant
+ --> $DIR/lint-attr-everywhere-late.rs:82:5
+ |
+LL | const ASSOC_CONST: u8 = 1;
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:81:12
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for an associated type
+ --> $DIR/lint-attr-everywhere-late.rs:85:5
+ |
+LL | type AssocType;
+ | ^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:84:12
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: missing documentation for a variant
+ --> $DIR/lint-attr-everywhere-late.rs:112:5
+ |
+LL | Variant1,
+ | ^^^^^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:111:12
+ |
+LL | #[deny(missing_docs)]
+ | ^^^^^^^^^^^^
+
+error: `clashing1` redeclared with a different signature
+ --> $DIR/lint-attr-everywhere-late.rs:123:5
+ |
+LL | fn clashing1();
+ | --------------- `clashing1` previously declared here
+...
+LL | fn clashing1(_: i32);
+ | ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
+ |
+ = note: expected `unsafe extern "C" fn()`
+ found `unsafe extern "C" fn(i32)`
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:122:13
+ |
+LL | #![deny(clashing_extern_declarations)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: `clashing2` redeclared with a different signature
+ --> $DIR/lint-attr-everywhere-late.rs:128:5
+ |
+LL | fn clashing2();
+ | --------------- `clashing2` previously declared here
+...
+LL | fn clashing2(_: i32);
+ | ^^^^^^^^^^^^^^^^^^^^^ this signature doesn't match the previous declaration
+ |
+ = note: expected `unsafe extern "C" fn()`
+ found `unsafe extern "C" fn(i32)`
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:127:12
+ |
+LL | #[deny(clashing_extern_declarations)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped
+ --> $DIR/lint-attr-everywhere-late.rs:93:38
+ |
+LL | fn denied_from_inner(_x: Box<dyn Drop>) {}
+ | ^^^^
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:91:13
+ |
+LL | #![deny(dyn_drop)]
+ | ^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:96:21
+ |
+LL | fn assoc_fn() { discriminant::<i32>(&123); }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:96:41
+ |
+LL | fn assoc_fn() { discriminant::<i32>(&123); }
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:95:12
+ |
+LL | #[deny(enum_intrinsics_non_enums)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: literal out of range for `u8`
+ --> $DIR/lint-attr-everywhere-late.rs:98:59
+ |
+LL | #[deny(overflowing_literals)] const ASSOC_CONST: u8 = 1000;
+ | ^^^^
+ |
+ = note: the literal `1000` does not fit into the type `u8` whose range is `0..=255`
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:98:12
+ |
+LL | #[deny(overflowing_literals)] const ASSOC_CONST: u8 = 1000;
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: variable `PARAM` should have a snake case name
+ --> $DIR/lint-attr-everywhere-late.rs:131:37
+ |
+LL | fn function(#[deny(non_snake_case)] PARAM: i32) {}
+ | ^^^^^ help: convert the identifier to snake case: `param`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:131:20
+ |
+LL | fn function(#[deny(non_snake_case)] PARAM: i32) {}
+ | ^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:139:13
+ |
+LL | let _ = discriminant::<i32>(&123);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:139:33
+ |
+LL | let _ = discriminant::<i32>(&123);
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:138:12
+ |
+LL | #[deny(enum_intrinsics_non_enums)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: variable `PARAM` should have a snake case name
+ --> $DIR/lint-attr-everywhere-late.rs:145:44
+ |
+LL | let closure = |#[deny(non_snake_case)] PARAM: i32| {};
+ | ^^^^^ help: convert the identifier to snake case: `param`
+ |
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:145:27
+ |
+LL | let closure = |#[deny(non_snake_case)] PARAM: i32| {};
+ | ^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:155:13
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:155:33
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:153:17
+ |
+LL | #![deny(enum_intrinsics_non_enums)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:161:13
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:161:33
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:159:16
+ |
+LL | #[deny(enum_intrinsics_non_enums)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:168:9
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:168:29
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:167:17
+ |
+LL | #![deny(enum_intrinsics_non_enums)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:172:9
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:172:29
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:171:16
+ |
+LL | #[deny(enum_intrinsics_non_enums)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:177:5
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:177:25
+ |
+LL | discriminant::<i32>(&123);
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:176:12
+ |
+LL | #[deny(enum_intrinsics_non_enums)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:179:41
+ |
+LL | [#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123)];
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:179:61
+ |
+LL | [#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123)];
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:179:13
+ |
+LL | [#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123)];
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:180:41
+ |
+LL | (#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123),);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:180:61
+ |
+LL | (#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123),);
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:180:13
+ |
+LL | (#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123),);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:182:45
+ |
+LL | call(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:182:65
+ |
+LL | call(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123));
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:182:17
+ |
+LL | call(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
+ --> $DIR/lint-attr-everywhere-late.rs:184:52
+ |
+LL | TupleStruct(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `i32`, which is not an enum.
+ --> $DIR/lint-attr-everywhere-late.rs:184:72
+ |
+LL | TupleStruct(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123));
+ | ^^^^
+note: the lint level is defined here
+ --> $DIR/lint-attr-everywhere-late.rs:184:24
+ |
+LL | TupleStruct(#[deny(enum_intrinsics_non_enums)] discriminant::<i32>(&123));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 31 previous errors
+
diff --git a/src/test/ui/lint/lint-const-item-mutation.stderr b/src/test/ui/lint/lint-const-item-mutation.stderr
index 94d876423..9f4360e67 100644
--- a/src/test/ui/lint/lint-const-item-mutation.stderr
+++ b/src/test/ui/lint/lint-const-item-mutation.stderr
@@ -4,13 +4,13 @@ warning: attempting to modify a `const` item
LL | ARRAY[0] = 5;
| ^^^^^^^^^^^^
|
- = note: `#[warn(const_item_mutation)]` on by default
= note: each usage of a `const` item creates a new temporary; the original `const` item will not be modified
note: `const` item defined here
--> $DIR/lint-const-item-mutation.rs:26:1
|
LL | const ARRAY: [u8; 1] = [25];
| ^^^^^^^^^^^^^^^^^^^^
+ = note: `#[warn(const_item_mutation)]` on by default
warning: attempting to modify a `const` item
--> $DIR/lint-const-item-mutation.rs:38:5
diff --git a/src/test/ui/lint/lint-ctypes-73249-2.stderr b/src/test/ui/lint/lint-ctypes-73249-2.stderr
index 7c85e9fa8..8073c33dd 100644
--- a/src/test/ui/lint/lint-ctypes-73249-2.stderr
+++ b/src/test/ui/lint/lint-ctypes-73249-2.stderr
@@ -4,12 +4,12 @@ error: `extern` block uses type `Qux`, which is not FFI-safe
LL | pub fn lint_me() -> A<()>;
| ^^^^^ not FFI-safe
|
+ = note: opaque types have no C equivalent
note: the lint level is defined here
--> $DIR/lint-ctypes-73249-2.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-ctypes-73249-3.stderr b/src/test/ui/lint/lint-ctypes-73249-3.stderr
index 83e2a233c..c41ce666d 100644
--- a/src/test/ui/lint/lint-ctypes-73249-3.stderr
+++ b/src/test/ui/lint/lint-ctypes-73249-3.stderr
@@ -4,12 +4,12 @@ error: `extern` block uses type `Qux`, which is not FFI-safe
LL | pub fn lint_me() -> A;
| ^ not FFI-safe
|
+ = note: opaque types have no C equivalent
note: the lint level is defined here
--> $DIR/lint-ctypes-73249-3.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-ctypes-73249-5.stderr b/src/test/ui/lint/lint-ctypes-73249-5.stderr
index 37781d78c..98245c4f1 100644
--- a/src/test/ui/lint/lint-ctypes-73249-5.stderr
+++ b/src/test/ui/lint/lint-ctypes-73249-5.stderr
@@ -4,12 +4,12 @@ error: `extern` block uses type `Qux`, which is not FFI-safe
LL | pub fn lint_me() -> A;
| ^ not FFI-safe
|
+ = note: opaque types have no C equivalent
note: the lint level is defined here
--> $DIR/lint-ctypes-73249-5.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-ctypes-73251-1.stderr b/src/test/ui/lint/lint-ctypes-73251-1.stderr
index 76b19d37e..9f43576ad 100644
--- a/src/test/ui/lint/lint-ctypes-73251-1.stderr
+++ b/src/test/ui/lint/lint-ctypes-73251-1.stderr
@@ -4,12 +4,12 @@ error: `extern` block uses type `Qux`, which is not FFI-safe
LL | pub fn lint_me() -> <u32 as Foo>::Assoc;
| ^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
+ = note: opaque types have no C equivalent
note: the lint level is defined here
--> $DIR/lint-ctypes-73251-1.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-ctypes-73251-2.stderr b/src/test/ui/lint/lint-ctypes-73251-2.stderr
index 64f0fb2d8..0b3de379c 100644
--- a/src/test/ui/lint/lint-ctypes-73251-2.stderr
+++ b/src/test/ui/lint/lint-ctypes-73251-2.stderr
@@ -4,12 +4,12 @@ error: `extern` block uses type `AliasA`, which is not FFI-safe
LL | pub fn lint_me() -> <AliasB as TraitB>::Assoc;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
+ = note: opaque types have no C equivalent
note: the lint level is defined here
--> $DIR/lint-ctypes-73251-2.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-ctypes-enum.stderr b/src/test/ui/lint/lint-ctypes-enum.stderr
index de532f69a..8554e2617 100644
--- a/src/test/ui/lint/lint-ctypes-enum.stderr
+++ b/src/test/ui/lint/lint-ctypes-enum.stderr
@@ -4,11 +4,6 @@ error: `extern` block uses type `U`, which is not FFI-safe
LL | fn uf(x: U);
| ^ not FFI-safe
|
-note: the lint level is defined here
- --> $DIR/lint-ctypes-enum.rs:3:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
= help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
= note: enum has no representation hint
note: the type is defined here
@@ -16,6 +11,11 @@ note: the type is defined here
|
LL | enum U {
| ^^^^^^
+note: the lint level is defined here
+ --> $DIR/lint-ctypes-enum.rs:3:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
error: `extern` block uses type `B`, which is not FFI-safe
--> $DIR/lint-ctypes-enum.rs:61:13
diff --git a/src/test/ui/lint/lint-ctypes-fn.stderr b/src/test/ui/lint/lint-ctypes-fn.stderr
index 6f8d76411..a05206bf1 100644
--- a/src/test/ui/lint/lint-ctypes-fn.stderr
+++ b/src/test/ui/lint/lint-ctypes-fn.stderr
@@ -4,13 +4,13 @@ error: `extern` fn uses type `[u32]`, which is not FFI-safe
LL | pub extern "C" fn slice_type(p: &[u32]) { }
| ^^^^^^ not FFI-safe
|
+ = help: consider using a raw pointer instead
+ = note: slices have no C equivalent
note: the lint level is defined here
--> $DIR/lint-ctypes-fn.rs:4:9
|
LL | #![deny(improper_ctypes_definitions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: consider using a raw pointer instead
- = note: slices have no C equivalent
error: `extern` fn uses type `str`, which is not FFI-safe
--> $DIR/lint-ctypes-fn.rs:76:31
diff --git a/src/test/ui/lint/lint-ctypes.stderr b/src/test/ui/lint/lint-ctypes.stderr
index bfec40e19..121ad0ce8 100644
--- a/src/test/ui/lint/lint-ctypes.stderr
+++ b/src/test/ui/lint/lint-ctypes.stderr
@@ -4,11 +4,6 @@ error: `extern` block uses type `Foo`, which is not FFI-safe
LL | pub fn ptr_type1(size: *const Foo);
| ^^^^^^^^^^ not FFI-safe
|
-note: the lint level is defined here
- --> $DIR/lint-ctypes.rs:4:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
@@ -16,6 +11,11 @@ note: the type is defined here
|
LL | pub struct Foo;
| ^^^^^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/lint-ctypes.rs:4:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
error: `extern` block uses type `Foo`, which is not FFI-safe
--> $DIR/lint-ctypes.rs:49:28
diff --git a/src/test/ui/lint/lint-enum-intrinsics-non-enums.stderr b/src/test/ui/lint/lint-enum-intrinsics-non-enums.stderr
index bec9fb62e..63ed2503c 100644
--- a/src/test/ui/lint/lint-enum-intrinsics-non-enums.stderr
+++ b/src/test/ui/lint/lint-enum-intrinsics-non-enums.stderr
@@ -4,12 +4,12 @@ error: the return value of `mem::discriminant` is unspecified when called with a
LL | discriminant(&());
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(enum_intrinsics_non_enums)]` on by default
note: the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `()`, which is not an enum.
--> $DIR/lint-enum-intrinsics-non-enums.rs:26:18
|
LL | discriminant(&());
| ^^^
+ = note: `#[deny(enum_intrinsics_non_enums)]` on by default
error: the return value of `mem::discriminant` is unspecified when called with a non-enum type
--> $DIR/lint-enum-intrinsics-non-enums.rs:29:5
diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr b/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr
index d7fd51461..3a84c6c1f 100644
--- a/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr
+++ b/src/test/ui/lint/lint-exceeding-bitshifts.noopt.stderr
@@ -7,7 +7,7 @@ LL | const N: i32 = T::N << 42;
note: the lint level is defined here
--> $DIR/lint-exceeding-bitshifts.rs:10:9
|
-LL | #![warn(arithmetic_overflow, const_err)]
+LL | #![warn(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
warning: this arithmetic operation will overflow
diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr b/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr
index d7fd51461..3a84c6c1f 100644
--- a/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr
+++ b/src/test/ui/lint/lint-exceeding-bitshifts.opt.stderr
@@ -7,7 +7,7 @@ LL | const N: i32 = T::N << 42;
note: the lint level is defined here
--> $DIR/lint-exceeding-bitshifts.rs:10:9
|
-LL | #![warn(arithmetic_overflow, const_err)]
+LL | #![warn(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
warning: this arithmetic operation will overflow
diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr b/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr
index d7fd51461..3a84c6c1f 100644
--- a/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr
+++ b/src/test/ui/lint/lint-exceeding-bitshifts.opt_with_overflow_checks.stderr
@@ -7,7 +7,7 @@ LL | const N: i32 = T::N << 42;
note: the lint level is defined here
--> $DIR/lint-exceeding-bitshifts.rs:10:9
|
-LL | #![warn(arithmetic_overflow, const_err)]
+LL | #![warn(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
warning: this arithmetic operation will overflow
diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.rs b/src/test/ui/lint/lint-exceeding-bitshifts.rs
index d8774cb4d..048c1aff8 100644
--- a/src/test/ui/lint/lint-exceeding-bitshifts.rs
+++ b/src/test/ui/lint/lint-exceeding-bitshifts.rs
@@ -7,7 +7,7 @@
// normalize-stderr-test "shift left by `(64|32)_usize`, which" -> "shift left by `%BITS%`, which"
#![crate_type="lib"]
-#![warn(arithmetic_overflow, const_err)]
+#![warn(arithmetic_overflow)]
pub trait Foo {
diff --git a/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr b/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr
index afbab9896..2cc4d382d 100644
--- a/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr
+++ b/src/test/ui/lint/lint-incoherent-auto-trait-objects.stderr
@@ -7,9 +7,9 @@ LL |
LL | impl Foo for dyn Send + Send {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
|
- = note: `#[deny(order_dependent_trait_objects)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #56484 <https://github.com/rust-lang/rust/issues/56484>
+ = note: `#[deny(order_dependent_trait_objects)]` on by default
error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
--> $DIR/lint-incoherent-auto-trait-objects.rs:11:1
@@ -37,3 +37,45 @@ LL | impl Foo for dyn Send + Sync + Send {}
error: aborting due to 3 previous errors
+Future incompatibility report: Future breakage diagnostic:
+error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + 'static)`: (E0119)
+ --> $DIR/lint-incoherent-auto-trait-objects.rs:5:1
+ |
+LL | impl Foo for dyn Send {}
+ | --------------------- first implementation here
+LL |
+LL | impl Foo for dyn Send + Send {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
+ |
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
+ = note: `#[deny(order_dependent_trait_objects)]` on by default
+
+Future breakage diagnostic:
+error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
+ --> $DIR/lint-incoherent-auto-trait-objects.rs:11:1
+ |
+LL | impl Foo for dyn Send + Sync {}
+ | ---------------------------- first implementation here
+LL |
+LL | impl Foo for dyn Sync + Send {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
+ |
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
+ = note: `#[deny(order_dependent_trait_objects)]` on by default
+
+Future breakage diagnostic:
+error: conflicting implementations of trait `Foo` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
+ --> $DIR/lint-incoherent-auto-trait-objects.rs:15:1
+ |
+LL | impl Foo for dyn Sync + Send {}
+ | ---------------------------- first implementation here
+...
+LL | impl Foo for dyn Send + Sync + Send {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
+ |
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
+ = note: `#[deny(order_dependent_trait_objects)]` on by default
+
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr
index 2a1847b98..9f38dcb0b 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-bool.stderr
@@ -4,8 +4,8 @@ error: atomic loads cannot have `Release` or `AcqRel` ordering
LL | let _ = x.load(Ordering::Release);
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: atomic loads cannot have `Release` or `AcqRel` ordering
--> $DIR/lint-invalid-atomic-ordering-bool.rs:15:20
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr
index 021654cf3..cc075ce9e 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange-weak.stderr
@@ -4,8 +4,8 @@ error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRe
LL | let _ = x.compare_exchange_weak(ptr2, ptr, Ordering::Relaxed, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using `Acquire` or `Relaxed` failure ordering instead
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: `compare_exchange_weak`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange_weak` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange-weak.rs:30:67
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr
index f6f8f88e8..fe6c7e55c 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-exchange.stderr
@@ -4,8 +4,8 @@ error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, s
LL | let _ = x.compare_exchange(0, 0, Ordering::Relaxed, Ordering::AcqRel);
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using `Acquire` or `Relaxed` failure ordering instead
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: `compare_exchange`'s failure ordering may not be `Release` or `AcqRel`, since a failed `compare_exchange` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-exchange.rs:28:57
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr
index e0741ffed..38327d607 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-fence.stderr
@@ -4,8 +4,8 @@ error: memory fences cannot have `Relaxed` ordering
LL | fence(Ordering::Relaxed);
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using ordering modes `Acquire`, `Release`, `AcqRel` or `SeqCst`
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: memory fences cannot have `Relaxed` ordering
--> $DIR/lint-invalid-atomic-ordering-fence.rs:19:20
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr
index 267b1c706..33829d68f 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-fetch-update.stderr
@@ -4,8 +4,8 @@ error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since
LL | let _ = x.fetch_update(Ordering::Relaxed, Ordering::AcqRel, |old| Some(old + 1));
| ^^^^^^^^^^^^^^^^ invalid failure ordering
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using `Acquire` or `Relaxed` failure ordering instead
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: `fetch_update`'s failure ordering may not be `Release` or `AcqRel`, since a failed `fetch_update` does not result in a write
--> $DIR/lint-invalid-atomic-ordering-fetch-update.rs:28:47
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr
index dfd999045..36930e2f4 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-int.stderr
@@ -4,8 +4,8 @@ error: atomic loads cannot have `Release` or `AcqRel` ordering
LL | let _ = x.load(Ordering::Release);
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: atomic loads cannot have `Release` or `AcqRel` ordering
--> $DIR/lint-invalid-atomic-ordering-int.rs:22:20
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr
index f00cb8e40..12f4cad90 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-ptr.stderr
@@ -4,8 +4,8 @@ error: atomic loads cannot have `Release` or `AcqRel` ordering
LL | let _ = x.load(Ordering::Release);
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: atomic loads cannot have `Release` or `AcqRel` ordering
--> $DIR/lint-invalid-atomic-ordering-ptr.rs:17:20
diff --git a/src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr b/src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr
index 36672e434..d26621f2a 100644
--- a/src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr
+++ b/src/test/ui/lint/lint-invalid-atomic-ordering-uint.stderr
@@ -4,8 +4,8 @@ error: atomic loads cannot have `Release` or `AcqRel` ordering
LL | let _ = x.load(Ordering::Release);
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(invalid_atomic_ordering)]` on by default
= help: consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
+ = note: `#[deny(invalid_atomic_ordering)]` on by default
error: atomic loads cannot have `Release` or `AcqRel` ordering
--> $DIR/lint-invalid-atomic-ordering-uint.rs:21:20
diff --git a/src/test/ui/lint/lint-non-snake-case-crate-2.stderr b/src/test/ui/lint/lint-non-snake-case-crate-2.stderr
index e29511293..4b42145bb 100644
--- a/src/test/ui/lint/lint-non-snake-case-crate-2.stderr
+++ b/src/test/ui/lint/lint-non-snake-case-crate-2.stderr
@@ -1,11 +1,11 @@
error: crate `NonSnakeCase` should have a snake case name
|
+ = help: convert the identifier to snake case: `non_snake_case`
note: the lint level is defined here
--> $DIR/lint-non-snake-case-crate-2.rs:4:9
|
LL | #![deny(non_snake_case)]
| ^^^^^^^^^^^^^^
- = help: convert the identifier to snake case: `non_snake_case`
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-output-format.rs b/src/test/ui/lint/lint-output-format.rs
index 169a98c94..67e8ec8f1 100644
--- a/src/test/ui/lint/lint-output-format.rs
+++ b/src/test/ui/lint/lint-output-format.rs
@@ -5,6 +5,7 @@
extern crate lint_output_format; //~ ERROR use of unstable library feature
use lint_output_format::{foo, bar}; //~ ERROR use of unstable library feature
+//~| ERROR use of unstable library feature
fn main() {
let _x = foo();
diff --git a/src/test/ui/lint/lint-output-format.stderr b/src/test/ui/lint/lint-output-format.stderr
index 3bc1d6fc1..0db79a156 100644
--- a/src/test/ui/lint/lint-output-format.stderr
+++ b/src/test/ui/lint/lint-output-format.stderr
@@ -7,6 +7,14 @@ LL | extern crate lint_output_format;
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_test_feature'
+ --> $DIR/lint-output-format.rs:7:26
+ |
+LL | use lint_output_format::{foo, bar};
+ | ^^^
+ |
+ = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+
+error[E0658]: use of unstable library feature 'unstable_test_feature'
--> $DIR/lint-output-format.rs:7:31
|
LL | use lint_output_format::{foo, bar};
@@ -15,13 +23,13 @@ LL | use lint_output_format::{foo, bar};
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
error[E0658]: use of unstable library feature 'unstable_test_feature'
- --> $DIR/lint-output-format.rs:11:14
+ --> $DIR/lint-output-format.rs:12:14
|
LL | let _y = bar();
| ^^^
|
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/lint/lint-pre-expansion-extern-module.stderr b/src/test/ui/lint/lint-pre-expansion-extern-module.stderr
index 3355bb4e4..ce3e8806a 100644
--- a/src/test/ui/lint/lint-pre-expansion-extern-module.stderr
+++ b/src/test/ui/lint/lint-pre-expansion-extern-module.stderr
@@ -4,9 +4,9 @@ warning: `try` is a keyword in the 2018 edition
LL | pub fn try() {}
| ^^^ help: you can use a raw identifier to stay compatible: `r#try`
|
- = note: `-W keyword-idents` implied by `-W rust-2018-compatibility`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
= note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
+ = note: `-W keyword-idents` implied by `-W rust-2018-compatibility`
warning: 1 warning emitted
diff --git a/src/test/ui/lint/lint-stability-deprecated.rs b/src/test/ui/lint/lint-stability-deprecated.rs
index bdc66e830..74c35083e 100644
--- a/src/test/ui/lint/lint-stability-deprecated.rs
+++ b/src/test/ui/lint/lint-stability-deprecated.rs
@@ -130,7 +130,7 @@ mod cross_crate {
let _ = UnstableTupleStruct (1);
let _ = StableTupleStruct (1);
- // At the moment, the lint checker only checks stability in
+ // At the moment, the lint checker only checks stability
// in the arguments of macros.
// Eventually, we will want to lint the contents of the
// macro in the module *defining* it. Also, stability levels
diff --git a/src/test/ui/lint/lint-strict-provenance-fuzzy-casts.stderr b/src/test/ui/lint/lint-strict-provenance-fuzzy-casts.stderr
index c85934aa3..383623b48 100644
--- a/src/test/ui/lint/lint-strict-provenance-fuzzy-casts.stderr
+++ b/src/test/ui/lint/lint-strict-provenance-fuzzy-casts.stderr
@@ -4,12 +4,12 @@ error: strict provenance disallows casting integer `usize` to pointer `*const u8
LL | let dangling = 16_usize as *const u8;
| ^^^^^^^^^^^^^^^^^^^^^
|
+ = help: if you can't comply with strict provenance and don't have a pointer with the correct provenance you can use `std::ptr::from_exposed_addr()` instead
note: the lint level is defined here
--> $DIR/lint-strict-provenance-fuzzy-casts.rs:2:9
|
LL | #![deny(fuzzy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = help: if you can't comply with strict provenance and don't have a pointer with the correct provenance you can use `std::ptr::from_exposed_addr()` instead
help: use `.with_addr()` to adjust a valid pointer in the same allocation, to this address
|
LL | let dangling = (...).with_addr(16_usize);
diff --git a/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr b/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr
index 05178b34b..aa151fe2d 100644
--- a/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr
+++ b/src/test/ui/lint/lint-strict-provenance-lossy-casts.stderr
@@ -4,12 +4,12 @@ error: under strict provenance it is considered bad style to cast pointer `*cons
LL | let addr: usize = &x as *const u8 as usize;
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
+ = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
note: the lint level is defined here
--> $DIR/lint-strict-provenance-lossy-casts.rs:2:9
|
LL | #![deny(lossy_provenance_casts)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = help: if you can't comply with strict provenance and need to expose the pointer provenance you can use `.expose_addr()` instead
help: use `.addr()` to obtain the address of a pointer
|
LL | let addr: usize = (&x as *const u8).addr();
diff --git a/src/test/ui/lint/lint-temporary-cstring-as-param.stderr b/src/test/ui/lint/lint-temporary-cstring-as-param.stderr
index 0a9e5a4bf..838b3bc13 100644
--- a/src/test/ui/lint/lint-temporary-cstring-as-param.stderr
+++ b/src/test/ui/lint/lint-temporary-cstring-as-param.stderr
@@ -6,13 +6,13 @@ LL | some_function(CString::new("").unwrap().as_ptr());
| |
| this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
|
+ = 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: the lint level is defined here
--> $DIR/lint-temporary-cstring-as-param.rs:1:9
|
LL | #![deny(temporary_cstring_as_ptr)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = 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
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-temporary-cstring-as-ptr.stderr b/src/test/ui/lint/lint-temporary-cstring-as-ptr.stderr
index e69d2dd53..79ef57dd1 100644
--- a/src/test/ui/lint/lint-temporary-cstring-as-ptr.stderr
+++ b/src/test/ui/lint/lint-temporary-cstring-as-ptr.stderr
@@ -6,13 +6,13 @@ LL | let s = CString::new("some text").unwrap().as_ptr();
| |
| this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
|
+ = 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: the lint level is defined here
--> $DIR/lint-temporary-cstring-as-ptr.rs:2:9
|
LL | #![deny(temporary_cstring_as_ptr)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = 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
error: aborting due to previous error
diff --git a/src/test/ui/lint/lint-type-limits2.stderr b/src/test/ui/lint/lint-type-limits2.stderr
index 3562cb440..b3420ad8a 100644
--- a/src/test/ui/lint/lint-type-limits2.stderr
+++ b/src/test/ui/lint/lint-type-limits2.stderr
@@ -12,13 +12,13 @@ warning: literal out of range for `i8`
LL | 128 > bar()
| ^^^
|
+ = note: the literal `128` does not fit into the type `i8` whose range is `-128..=127`
+ = help: consider using the type `u8` instead
note: the lint level is defined here
--> $DIR/lint-type-limits2.rs:2:9
|
LL | #![warn(overflowing_literals)]
| ^^^^^^^^^^^^^^^^^^^^
- = note: the literal `128` does not fit into the type `i8` whose range is `-128..=127`
- = help: consider using the type `u8` instead
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/lint/lint-type-limits3.stderr b/src/test/ui/lint/lint-type-limits3.stderr
index 823d1a4c7..db46e7ae7 100644
--- a/src/test/ui/lint/lint-type-limits3.stderr
+++ b/src/test/ui/lint/lint-type-limits3.stderr
@@ -12,13 +12,13 @@ warning: literal out of range for `i8`
LL | while 200 != i {
| ^^^
|
+ = note: the literal `200` does not fit into the type `i8` whose range is `-128..=127`
+ = help: consider using the type `u8` instead
note: the lint level is defined here
--> $DIR/lint-type-limits3.rs:2:9
|
LL | #![warn(overflowing_literals)]
| ^^^^^^^^^^^^^^^^^^^^
- = note: the literal `200` does not fit into the type `i8` whose range is `-128..=127`
- = help: consider using the type `u8` instead
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/lint/lint-type-overflow.stderr b/src/test/ui/lint/lint-type-overflow.stderr
index 1bb1ec547..48d8228b8 100644
--- a/src/test/ui/lint/lint-type-overflow.stderr
+++ b/src/test/ui/lint/lint-type-overflow.stderr
@@ -4,12 +4,12 @@ error: literal out of range for `u8`
LL | let x1: u8 = 256;
| ^^^
|
+ = note: the literal `256` does not fit into the type `u8` whose range is `0..=255`
note: the lint level is defined here
--> $DIR/lint-type-overflow.rs:1:9
|
LL | #![deny(overflowing_literals)]
| ^^^^^^^^^^^^^^^^^^^^
- = note: the literal `256` does not fit into the type `u8` whose range is `0..=255`
error: literal out of range for `u8`
--> $DIR/lint-type-overflow.rs:13:14
diff --git a/src/test/ui/lint/lint-type-overflow2.rs b/src/test/ui/lint/lint-type-overflow2.rs
index c1f874c07..9b1eb510b 100644
--- a/src/test/ui/lint/lint-type-overflow2.rs
+++ b/src/test/ui/lint/lint-type-overflow2.rs
@@ -1,7 +1,6 @@
// compile-flags: -O
#![deny(overflowing_literals)]
-#![deny(const_err)]
fn main() {
let x2: i8 = --128; //~ ERROR literal out of range for `i8`
diff --git a/src/test/ui/lint/lint-type-overflow2.stderr b/src/test/ui/lint/lint-type-overflow2.stderr
index 3d40cdf96..eb593d062 100644
--- a/src/test/ui/lint/lint-type-overflow2.stderr
+++ b/src/test/ui/lint/lint-type-overflow2.stderr
@@ -1,19 +1,19 @@
error: literal out of range for `i8`
- --> $DIR/lint-type-overflow2.rs:7:20
+ --> $DIR/lint-type-overflow2.rs:6:20
|
LL | let x2: i8 = --128;
| ^^^
|
+ = note: the literal `128` does not fit into the type `i8` whose range is `-128..=127`
+ = help: consider using the type `u8` instead
note: the lint level is defined here
--> $DIR/lint-type-overflow2.rs:3:9
|
LL | #![deny(overflowing_literals)]
| ^^^^^^^^^^^^^^^^^^^^
- = note: the literal `128` does not fit into the type `i8` whose range is `-128..=127`
- = help: consider using the type `u8` instead
error: literal out of range for `f32`
- --> $DIR/lint-type-overflow2.rs:9:14
+ --> $DIR/lint-type-overflow2.rs:8:14
|
LL | let x = -3.40282357e+38_f32;
| ^^^^^^^^^^^^^^^^^^
@@ -21,7 +21,7 @@ LL | let x = -3.40282357e+38_f32;
= note: the literal `3.40282357e+38_f32` does not fit into the type `f32` and will be converted to `f32::INFINITY`
error: literal out of range for `f32`
- --> $DIR/lint-type-overflow2.rs:10:14
+ --> $DIR/lint-type-overflow2.rs:9:14
|
LL | let x = 3.40282357e+38_f32;
| ^^^^^^^^^^^^^^^^^^
@@ -29,7 +29,7 @@ LL | let x = 3.40282357e+38_f32;
= note: the literal `3.40282357e+38_f32` does not fit into the type `f32` and will be converted to `f32::INFINITY`
error: literal out of range for `f64`
- --> $DIR/lint-type-overflow2.rs:11:14
+ --> $DIR/lint-type-overflow2.rs:10:14
|
LL | let x = -1.7976931348623159e+308_f64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL | let x = -1.7976931348623159e+308_f64;
= note: the literal `1.7976931348623159e+308_f64` does not fit into the type `f64` and will be converted to `f64::INFINITY`
error: literal out of range for `f64`
- --> $DIR/lint-type-overflow2.rs:12:14
+ --> $DIR/lint-type-overflow2.rs:11:14
|
LL | let x = 1.7976931348623159e+308_f64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/lint/lint-unconditional-recursion.stderr b/src/test/ui/lint/lint-unconditional-recursion.stderr
index c11b73f41..9d200a789 100644
--- a/src/test/ui/lint/lint-unconditional-recursion.stderr
+++ b/src/test/ui/lint/lint-unconditional-recursion.stderr
@@ -6,12 +6,12 @@ LL | fn foo() {
LL | foo();
| ----- recursive call site
|
+ = help: a `loop` may express intention better if this is on purpose
note: the lint level is defined here
--> $DIR/lint-unconditional-recursion.rs:1:9
|
LL | #![deny(unconditional_recursion)]
| ^^^^^^^^^^^^^^^^^^^^^^^
- = help: a `loop` may express intention better if this is on purpose
error: function cannot return without recursing
--> $DIR/lint-unconditional-recursion.rs:14:1
diff --git a/src/test/ui/lint/lint-unsafe-code.stderr b/src/test/ui/lint/lint-unsafe-code.stderr
index 8dde05fc4..037f0a832 100644
--- a/src/test/ui/lint/lint-unsafe-code.stderr
+++ b/src/test/ui/lint/lint-unsafe-code.stderr
@@ -4,12 +4,12 @@ error: declaration of a `no_mangle` function
LL | #[no_mangle] fn foo() {}
| ^^^^^^^^^^^^
|
+ = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
note: the lint level is defined here
--> $DIR/lint-unsafe-code.rs:3:9
|
LL | #![deny(unsafe_code)]
| ^^^^^^^^^^^
- = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
error: declaration of a `no_mangle` static
--> $DIR/lint-unsafe-code.rs:32:1
diff --git a/src/test/ui/lint/must_not_suspend/boxed.stderr b/src/test/ui/lint/must_not_suspend/boxed.stderr
index b3c9b4381..9efc7b069 100644
--- a/src/test/ui/lint/must_not_suspend/boxed.stderr
+++ b/src/test/ui/lint/must_not_suspend/boxed.stderr
@@ -6,11 +6,6 @@ LL | let _guard = bar();
LL | other().await;
| ------ the value is held across this suspend point
|
-note: the lint level is defined here
- --> $DIR/boxed.rs:3:9
- |
-LL | #![deny(must_not_suspend)]
- | ^^^^^^^^^^^^^^^^
note: You gotta use Umm's, ya know?
--> $DIR/boxed.rs:20:9
|
@@ -21,6 +16,11 @@ help: consider using a block (`{ ... }`) to shrink the value's scope, ending bef
|
LL | let _guard = bar();
| ^^^^^^
+note: the lint level is defined here
+ --> $DIR/boxed.rs:3:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/lint/must_not_suspend/dedup.stderr b/src/test/ui/lint/must_not_suspend/dedup.stderr
index 13fa3ae30..f8978ba57 100644
--- a/src/test/ui/lint/must_not_suspend/dedup.stderr
+++ b/src/test/ui/lint/must_not_suspend/dedup.stderr
@@ -4,16 +4,16 @@ error: `No` held across a suspend point, but should not be
LL | wheeee(&No {}).await;
| ^^^^^ ------ the value is held across this suspend point
|
-note: the lint level is defined here
- --> $DIR/dedup.rs:3:9
- |
-LL | #![deny(must_not_suspend)]
- | ^^^^^^^^^^^^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
--> $DIR/dedup.rs:16:13
|
LL | wheeee(&No {}).await;
| ^^^^^
+note: the lint level is defined here
+ --> $DIR/dedup.rs:3:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/lint/must_not_suspend/gated.stderr b/src/test/ui/lint/must_not_suspend/gated.stderr
index b58ecb555..64de1ebea 100644
--- a/src/test/ui/lint/must_not_suspend/gated.stderr
+++ b/src/test/ui/lint/must_not_suspend/gated.stderr
@@ -4,10 +4,10 @@ warning: unknown lint: `must_not_suspend`
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unknown_lints)]` on by default
= note: the `must_not_suspend` lint is unstable
= note: see issue #83310 <https://github.com/rust-lang/rust/issues/83310> for more information
= help: add `#![feature(must_not_suspend)]` to the crate attributes to enable
+ = note: `#[warn(unknown_lints)]` on by default
warning: unknown lint: `must_not_suspend`
--> $DIR/gated.rs:4:1
diff --git a/src/test/ui/lint/must_not_suspend/mutex.stderr b/src/test/ui/lint/must_not_suspend/mutex.stderr
index a968b7ca0..c251cb845 100644
--- a/src/test/ui/lint/must_not_suspend/mutex.stderr
+++ b/src/test/ui/lint/must_not_suspend/mutex.stderr
@@ -6,11 +6,6 @@ LL | let _guard = m.lock().unwrap();
LL | other().await;
| ------ the value is held across this suspend point
|
-note: the lint level is defined here
- --> $DIR/mutex.rs:3:9
- |
-LL | #![deny(must_not_suspend)]
- | ^^^^^^^^^^^^^^^^
note: holding a MutexGuard across suspend points can cause deadlocks, delays, and cause Futures to not implement `Send`
--> $DIR/mutex.rs:8:9
|
@@ -21,6 +16,11 @@ help: consider using a block (`{ ... }`) to shrink the value's scope, ending bef
|
LL | let _guard = m.lock().unwrap();
| ^^^^^^
+note: the lint level is defined here
+ --> $DIR/mutex.rs:3:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/lint/must_not_suspend/ref-drop-tracking.rs b/src/test/ui/lint/must_not_suspend/ref-drop-tracking.rs
new file mode 100644
index 000000000..1bc4a3812
--- /dev/null
+++ b/src/test/ui/lint/must_not_suspend/ref-drop-tracking.rs
@@ -0,0 +1,30 @@
+// edition:2018
+// compile-flags: -Zdrop-tracking
+#![feature(must_not_suspend)]
+#![deny(must_not_suspend)]
+
+#[must_not_suspend = "You gotta use Umm's, ya know?"]
+struct Umm {
+ i: i64
+}
+
+struct Bar {
+ u: Umm,
+}
+
+async fn other() {}
+
+impl Bar {
+ async fn uhoh(&mut self) {
+ let guard = &mut self.u; //~ ERROR `Umm` held across
+
+ other().await;
+
+ *guard = Umm {
+ i: 2
+ }
+ }
+}
+
+fn main() {
+}
diff --git a/src/test/ui/lint/must_not_suspend/ref-drop-tracking.stderr b/src/test/ui/lint/must_not_suspend/ref-drop-tracking.stderr
new file mode 100644
index 000000000..180e187c1
--- /dev/null
+++ b/src/test/ui/lint/must_not_suspend/ref-drop-tracking.stderr
@@ -0,0 +1,27 @@
+error: reference to `Umm` held across a suspend point, but should not be
+ --> $DIR/ref-drop-tracking.rs:19:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+LL |
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/ref-drop-tracking.rs:19:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/ref-drop-tracking.rs:19:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+note: the lint level is defined here
+ --> $DIR/ref-drop-tracking.rs:4:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/must_not_suspend/ref.drop_tracking.stderr b/src/test/ui/lint/must_not_suspend/ref.drop_tracking.stderr
new file mode 100644
index 000000000..abf76711b
--- /dev/null
+++ b/src/test/ui/lint/must_not_suspend/ref.drop_tracking.stderr
@@ -0,0 +1,27 @@
+error: reference to `Umm` held across a suspend point, but should not be
+ --> $DIR/ref.rs:21:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+LL |
+LL | other().await;
+ | ------ the value is held across this suspend point
+ |
+note: You gotta use Umm's, ya know?
+ --> $DIR/ref.rs:21:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
+ --> $DIR/ref.rs:21:13
+ |
+LL | let guard = &mut self.u;
+ | ^^^^^
+note: the lint level is defined here
+ --> $DIR/ref.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/must_not_suspend/ref.stderr b/src/test/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr
index 5f000014c..41ac09ea7 100644
--- a/src/test/ui/lint/must_not_suspend/ref.stderr
+++ b/src/test/ui/lint/must_not_suspend/ref.no_drop_tracking.stderr
@@ -1,5 +1,5 @@
error: `Umm` held across a suspend point, but should not be
- --> $DIR/ref.rs:18:26
+ --> $DIR/ref.rs:21:26
|
LL | let guard = &mut self.u;
| ^^^^^^
@@ -7,21 +7,21 @@ LL |
LL | other().await;
| ------ the value is held across this suspend point
|
-note: the lint level is defined here
- --> $DIR/ref.rs:3:9
- |
-LL | #![deny(must_not_suspend)]
- | ^^^^^^^^^^^^^^^^
note: You gotta use Umm's, ya know?
- --> $DIR/ref.rs:18:26
+ --> $DIR/ref.rs:21:26
|
LL | let guard = &mut self.u;
| ^^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
- --> $DIR/ref.rs:18:26
+ --> $DIR/ref.rs:21:26
|
LL | let guard = &mut self.u;
| ^^^^^^
+note: the lint level is defined here
+ --> $DIR/ref.rs:6:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/lint/must_not_suspend/ref.rs b/src/test/ui/lint/must_not_suspend/ref.rs
index 738dd9e04..f6b23746f 100644
--- a/src/test/ui/lint/must_not_suspend/ref.rs
+++ b/src/test/ui/lint/must_not_suspend/ref.rs
@@ -1,10 +1,13 @@
// edition:2018
+// revisions: no_drop_tracking drop_tracking
+// [drop_tracking] compile-flags: -Zdrop-tracking=yes
+// [no_drop_tracking] compile-flags: -Zdrop-tracking=no
#![feature(must_not_suspend)]
#![deny(must_not_suspend)]
#[must_not_suspend = "You gotta use Umm's, ya know?"]
struct Umm {
- i: i64
+ i: i64,
}
struct Bar {
@@ -19,11 +22,8 @@ impl Bar {
other().await;
- *guard = Umm {
- i: 2
- }
+ *guard = Umm { i: 2 }
}
}
-fn main() {
-}
+fn main() {}
diff --git a/src/test/ui/lint/must_not_suspend/trait.stderr b/src/test/ui/lint/must_not_suspend/trait.stderr
index 60369430a..d64d25aae 100644
--- a/src/test/ui/lint/must_not_suspend/trait.stderr
+++ b/src/test/ui/lint/must_not_suspend/trait.stderr
@@ -7,16 +7,16 @@ LL | let _guard1 = r#impl();
LL | other().await;
| ------ the value is held across this suspend point
|
-note: the lint level is defined here
- --> $DIR/trait.rs:3:9
- |
-LL | #![deny(must_not_suspend)]
- | ^^^^^^^^^^^^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
--> $DIR/trait.rs:21:9
|
LL | let _guard1 = r#impl();
| ^^^^^^^
+note: the lint level is defined here
+ --> $DIR/trait.rs:3:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
error: boxed `Wow` trait object held across a suspend point, but should not be
--> $DIR/trait.rs:22:9
diff --git a/src/test/ui/lint/must_not_suspend/unit.stderr b/src/test/ui/lint/must_not_suspend/unit.stderr
index 42d037b35..c967dbac5 100644
--- a/src/test/ui/lint/must_not_suspend/unit.stderr
+++ b/src/test/ui/lint/must_not_suspend/unit.stderr
@@ -6,11 +6,6 @@ LL | let _guard = bar();
LL | other().await;
| ------ the value is held across this suspend point
|
-note: the lint level is defined here
- --> $DIR/unit.rs:3:9
- |
-LL | #![deny(must_not_suspend)]
- | ^^^^^^^^^^^^^^^^
note: You gotta use Umm's, ya know?
--> $DIR/unit.rs:20:9
|
@@ -21,6 +16,11 @@ help: consider using a block (`{ ... }`) to shrink the value's scope, ending bef
|
LL | let _guard = bar();
| ^^^^^^
+note: the lint level is defined here
+ --> $DIR/unit.rs:3:9
+ |
+LL | #![deny(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/lint/must_not_suspend/warn.stderr b/src/test/ui/lint/must_not_suspend/warn.stderr
index 417c397da..fe551c652 100644
--- a/src/test/ui/lint/must_not_suspend/warn.stderr
+++ b/src/test/ui/lint/must_not_suspend/warn.stderr
@@ -6,11 +6,6 @@ LL | let _guard = bar();
LL | other().await;
| ------ the value is held across this suspend point
|
-note: the lint level is defined here
- --> $DIR/warn.rs:4:9
- |
-LL | #![warn(must_not_suspend)]
- | ^^^^^^^^^^^^^^^^
note: You gotta use Umm's, ya know?
--> $DIR/warn.rs:21:9
|
@@ -21,6 +16,11 @@ help: consider using a block (`{ ... }`) to shrink the value's scope, ending bef
|
LL | let _guard = bar();
| ^^^^^^
+note: the lint level is defined here
+ --> $DIR/warn.rs:4:9
+ |
+LL | #![warn(must_not_suspend)]
+ | ^^^^^^^^^^^^^^^^
warning: 1 warning emitted
diff --git a/src/test/ui/lint/no-coverage.stderr b/src/test/ui/lint/no-coverage.stderr
index 8452ccc7a..404efbeac 100644
--- a/src/test/ui/lint/no-coverage.stderr
+++ b/src/test/ui/lint/no-coverage.stderr
@@ -94,7 +94,7 @@ error: unconstrained opaque type
LL | type U = impl Trait;
| ^^^^^^^^^^
|
- = note: `U` must be used in combination with a concrete type within the same module
+ = note: `U` must be used in combination with a concrete type within the same impl
error: aborting due to 7 previous errors; 6 warnings emitted
diff --git a/src/test/ui/lint/noop-method-call.rs b/src/test/ui/lint/noop-method-call.rs
index 9870c8135..89b296635 100644
--- a/src/test/ui/lint/noop-method-call.rs
+++ b/src/test/ui/lint/noop-method-call.rs
@@ -46,6 +46,7 @@ fn main() {
fn generic<T>(non_clone_type: &PlainType<T>) {
non_clone_type.clone();
+ //~^ WARNING call to `.clone()` on a reference in this situation does nothing
}
fn non_generic(non_clone_type: &PlainType<u32>) {
diff --git a/src/test/ui/lint/noop-method-call.stderr b/src/test/ui/lint/noop-method-call.stderr
index 7f6f96bf1..6a904d01a 100644
--- a/src/test/ui/lint/noop-method-call.stderr
+++ b/src/test/ui/lint/noop-method-call.stderr
@@ -4,12 +4,12 @@ warning: call to `.clone()` on a reference in this situation does nothing
LL | let non_clone_type_ref_clone: &PlainType<u32> = non_clone_type_ref.clone();
| ^^^^^^^^ unnecessary method call
|
+ = note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
note: the lint level is defined here
--> $DIR/noop-method-call.rs:4:9
|
LL | #![warn(noop_method_call)]
| ^^^^^^^^^^^^^^^^
- = note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
warning: call to `.deref()` on a reference in this situation does nothing
--> $DIR/noop-method-call.rs:28:63
@@ -28,12 +28,20 @@ LL | let non_borrow_type_borrow: &PlainType<u32> = non_borrow_type.borrow();
= note: the type `&PlainType<u32>` which `borrow` is being called on is the same as the type returned from `borrow`, so the method call does not do anything and can be removed
warning: call to `.clone()` on a reference in this situation does nothing
- --> $DIR/noop-method-call.rs:52:19
+ --> $DIR/noop-method-call.rs:48:19
+ |
+LL | non_clone_type.clone();
+ | ^^^^^^^^ unnecessary method call
+ |
+ = note: the type `&PlainType<T>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
+
+warning: call to `.clone()` on a reference in this situation does nothing
+ --> $DIR/noop-method-call.rs:53:19
|
LL | non_clone_type.clone();
| ^^^^^^^^ unnecessary method call
|
= note: the type `&PlainType<u32>` which `clone` is being called on is the same as the type returned from `clone`, so the method call does not do anything and can be removed
-warning: 4 warnings emitted
+warning: 5 warnings emitted
diff --git a/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr b/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr
index 62d00fd68..33aa95854 100644
--- a/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr
+++ b/src/test/ui/lint/opaque-ty-ffi-unsafe.stderr
@@ -4,12 +4,12 @@ error: `extern` block uses type `A`, which is not FFI-safe
LL | pub fn a(_: A);
| ^ not FFI-safe
|
+ = note: opaque types have no C equivalent
note: the lint level is defined here
--> $DIR/opaque-ty-ffi-unsafe.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
- = note: opaque types have no C equivalent
error: aborting due to previous error
diff --git a/src/test/ui/lint/outer-forbid.stderr b/src/test/ui/lint/outer-forbid.stderr
index 781457321..a47877980 100644
--- a/src/test/ui/lint/outer-forbid.stderr
+++ b/src/test/ui/lint/outer-forbid.stderr
@@ -7,13 +7,13 @@ LL | #![forbid(unused, non_snake_case)]
LL | #[allow(unused_variables)]
| ^^^^^^^^^^^^^^^^ overruled by previous forbid
|
+ = 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 #81670 <https://github.com/rust-lang/rust/issues/81670>
note: the lint level is defined here
--> $DIR/outer-forbid.rs:18:11
|
LL | #![forbid(forbidden_lint_groups)]
| ^^^^^^^^^^^^^^^^^^^^^
- = 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 #81670 <https://github.com/rust-lang/rust/issues/81670>
error: allow(unused) incompatible with previous forbid
--> $DIR/outer-forbid.rs:25:9
diff --git a/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr b/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr
index bc0c53303..e31d14c55 100644
--- a/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr
+++ b/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr
@@ -1,4 +1,4 @@
-TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..489) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(487..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..506) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(504..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }]
+TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..488) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(488..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..505) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(505..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }]
error: unnecessary trailing semicolon
--> $DIR/redundant-semi-proc-macro.rs:9:19
|
diff --git a/src/test/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr b/src/test/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr
index 370e51bf7..2c35647b8 100644
--- a/src/test/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr
+++ b/src/test/ui/lint/rfc-2383-lint-reason/expect_nested_lint_levels.stderr
@@ -31,8 +31,8 @@ warning: this lint expectation is unfulfilled
LL | unused_mut,
| ^^^^^^^^^^
|
- = note: `#[warn(unfulfilled_lint_expectations)]` on by default
= note: this `expect` is overridden by a `allow` attribute before the `unused_mut` lint is triggered
+ = note: `#[warn(unfulfilled_lint_expectations)]` on by default
warning: this lint expectation is unfulfilled
--> $DIR/expect_nested_lint_levels.rs:24:5
diff --git a/src/test/ui/lint/rfc-2383-lint-reason/expect_unfulfilled_expectation.stderr b/src/test/ui/lint/rfc-2383-lint-reason/expect_unfulfilled_expectation.stderr
index 9bfee79b0..9a1c3e442 100644
--- a/src/test/ui/lint/rfc-2383-lint-reason/expect_unfulfilled_expectation.stderr
+++ b/src/test/ui/lint/rfc-2383-lint-reason/expect_unfulfilled_expectation.stderr
@@ -4,9 +4,9 @@ warning: this lint expectation is unfulfilled
LL | #![expect(unfulfilled_lint_expectations, reason = "idk why you would expect this")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unfulfilled_lint_expectations)]` on by default
= note: idk why you would expect this
= note: the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message
+ = note: `#[warn(unfulfilled_lint_expectations)]` on by default
warning: this lint expectation is unfulfilled
--> $DIR/expect_unfulfilled_expectation.rs:13:10
diff --git a/src/test/ui/lint/rfc-2383-lint-reason/expect_with_reason.stderr b/src/test/ui/lint/rfc-2383-lint-reason/expect_with_reason.stderr
index 82c1a4c08..e349e4081 100644
--- a/src/test/ui/lint/rfc-2383-lint-reason/expect_with_reason.stderr
+++ b/src/test/ui/lint/rfc-2383-lint-reason/expect_with_reason.stderr
@@ -4,8 +4,8 @@ warning: this lint expectation is unfulfilled
LL | #![expect(unused_variables, reason = "<This should fail and display this reason>")]
| ^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unfulfilled_lint_expectations)]` on by default
= note: <This should fail and display this reason>
+ = note: `#[warn(unfulfilled_lint_expectations)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr b/src/test/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr
index 06befcbb5..5942fa8ae 100644
--- a/src/test/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr
+++ b/src/test/ui/lint/rfc-2383-lint-reason/force_warn_expected_lints_fulfilled.stderr
@@ -1,11 +1,3 @@
-warning: denote infinite loops with `loop { ... }`
- --> $DIR/force_warn_expected_lints_fulfilled.rs:10:5
- |
-LL | while true {
- | ^^^^^^^^^^ help: use `loop`
- |
- = note: requested on the command line with `--force-warn while-true`
-
warning: unused variable: `x`
--> $DIR/force_warn_expected_lints_fulfilled.rs:20:9
|
@@ -36,5 +28,13 @@ LL | let mut what_does_the_fox_say = "*ding* *deng* *dung*";
|
= note: requested on the command line with `--force-warn unused-mut`
+warning: denote infinite loops with `loop { ... }`
+ --> $DIR/force_warn_expected_lints_fulfilled.rs:10:5
+ |
+LL | while true {
+ | ^^^^^^^^^^ help: use `loop`
+ |
+ = note: requested on the command line with `--force-warn while-true`
+
warning: 5 warnings emitted
diff --git a/src/test/ui/lint/rfc-2383-lint-reason/lint-attribute-only-with-reason.stderr b/src/test/ui/lint/rfc-2383-lint-reason/lint-attribute-only-with-reason.stderr
index 3bf8137dc..3e9d70821 100644
--- a/src/test/ui/lint/rfc-2383-lint-reason/lint-attribute-only-with-reason.stderr
+++ b/src/test/ui/lint/rfc-2383-lint-reason/lint-attribute-only-with-reason.stderr
@@ -4,12 +4,12 @@ error: unused attribute
LL | #[allow(reason = "I want to allow something")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
+ = note: attribute `allow` without any lints has no effect
note: the lint level is defined here
--> $DIR/lint-attribute-only-with-reason.rs:3:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = note: attribute `allow` without any lints has no effect
error: unused attribute
--> $DIR/lint-attribute-only-with-reason.rs:6:1
diff --git a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr
index 9ca034b71..884a4a453 100644
--- a/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr
+++ b/src/test/ui/lint/rfc-2457-non-ascii-idents/lint-mixed-script-confusables.stderr
@@ -4,13 +4,13 @@ error: the usage of Script Group `Greek` in this crate consists solely of mixed
LL | struct ΑctuallyNotLatin;
| ^^^^^^^^^^^^^^^^
|
+ = note: the usage includes 'Α' (U+0391)
+ = note: please recheck to make sure their usages are indeed what you want
note: the lint level is defined here
--> $DIR/lint-mixed-script-confusables.rs:1:9
|
LL | #![deny(mixed_script_confusables)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = note: the usage includes 'Α' (U+0391)
- = note: please recheck to make sure their usages are indeed what you want
error: the usage of Script Group `Cyrillic` in this crate consists solely of mixed script confusables
--> $DIR/lint-mixed-script-confusables.rs:10:5
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr b/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr
index 84ad32bdd..49608c205 100644
--- a/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr
+++ b/src/test/ui/lint/semicolon-in-expressions-from-macros/semicolon-in-expressions-from-macros.stderr
@@ -7,15 +7,15 @@ LL | true;
LL | foo!(warn_in_block)
| ------------------- in this macro invocation
|
+ = 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 #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: macro invocations at the end of a block are treated as expressions
+ = note: to ignore the value produced by the macro, add a semicolon after the invocation of `foo`
note: the lint level is defined here
--> $DIR/semicolon-in-expressions-from-macros.rs:4:9
|
LL | #![warn(semicolon_in_expressions_from_macros)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #79813 <https://github.com/rust-lang/rust/issues/79813>
- = note: macro invocations at the end of a block are treated as expressions
- = note: to ignore the value produced by the macro, add a semicolon after the invocation of `foo`
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: trailing semicolon in macro used in expression position
diff --git a/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr b/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr
index d770a8c8f..16c152eb2 100644
--- a/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr
+++ b/src/test/ui/lint/semicolon-in-expressions-from-macros/warn-semicolon-in-expressions-from-macros.stderr
@@ -7,9 +7,9 @@ LL | true;
LL | _ => foo!()
| ------ in this macro invocation
|
- = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 1 warning emitted
diff --git a/src/test/ui/lint/trivial-cast-ice.rs b/src/test/ui/lint/trivial-cast-ice.rs
new file mode 100644
index 000000000..f781fab22
--- /dev/null
+++ b/src/test/ui/lint/trivial-cast-ice.rs
@@ -0,0 +1,12 @@
+// aux-build:trivial-cast-ice.rs
+// check-pass
+
+// Demonstrates the ICE in #102561
+
+#![deny(trivial_casts)]
+
+extern crate trivial_cast_ice;
+
+fn main() {
+ trivial_cast_ice::foo!();
+}
diff --git a/src/test/ui/lint/trivial-casts-featuring-type-ascription.stderr b/src/test/ui/lint/trivial-casts-featuring-type-ascription.stderr
index f7c42acb3..5087807b6 100644
--- a/src/test/ui/lint/trivial-casts-featuring-type-ascription.stderr
+++ b/src/test/ui/lint/trivial-casts-featuring-type-ascription.stderr
@@ -4,12 +4,12 @@ error: trivial numeric cast: `i32` as `i32`
LL | let lugubrious = 12i32 as i32;
| ^^^^^^^^^^^^
|
+ = help: cast can be replaced by coercion; this might require type ascription or a temporary variable
note: the lint level is defined here
--> $DIR/trivial-casts-featuring-type-ascription.rs:1:24
|
LL | #![deny(trivial_casts, trivial_numeric_casts)]
| ^^^^^^^^^^^^^^^^^^^^^
- = help: cast can be replaced by coercion; this might require type ascription or a temporary variable
error: trivial cast: `&u32` as `*const u32`
--> $DIR/trivial-casts-featuring-type-ascription.rs:8:13
@@ -17,12 +17,12 @@ error: trivial cast: `&u32` as `*const u32`
LL | let _ = haunted as *const u32;
| ^^^^^^^^^^^^^^^^^^^^^
|
+ = help: cast can be replaced by coercion; this might require type ascription or a temporary variable
note: the lint level is defined here
--> $DIR/trivial-casts-featuring-type-ascription.rs:1:9
|
LL | #![deny(trivial_casts, trivial_numeric_casts)]
| ^^^^^^^^^^^^^
- = help: cast can be replaced by coercion; this might require type ascription or a temporary variable
error: aborting due to 2 previous errors
diff --git a/src/test/ui/lint/trivial-casts.stderr b/src/test/ui/lint/trivial-casts.stderr
index 1544f553c..7ace353de 100644
--- a/src/test/ui/lint/trivial-casts.stderr
+++ b/src/test/ui/lint/trivial-casts.stderr
@@ -4,12 +4,12 @@ error: trivial numeric cast: `i32` as `i32`
LL | let lugubrious = 12i32 as i32;
| ^^^^^^^^^^^^
|
+ = help: cast can be replaced by coercion; this might require a temporary variable
note: the lint level is defined here
--> $DIR/trivial-casts.rs:1:24
|
LL | #![deny(trivial_casts, trivial_numeric_casts)]
| ^^^^^^^^^^^^^^^^^^^^^
- = help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&u32` as `*const u32`
--> $DIR/trivial-casts.rs:7:13
@@ -17,12 +17,12 @@ error: trivial cast: `&u32` as `*const u32`
LL | let _ = haunted as *const u32;
| ^^^^^^^^^^^^^^^^^^^^^
|
+ = help: cast can be replaced by coercion; this might require a temporary variable
note: the lint level is defined here
--> $DIR/trivial-casts.rs:1:9
|
LL | #![deny(trivial_casts, trivial_numeric_casts)]
| ^^^^^^^^^^^^^
- = help: cast can be replaced by coercion; this might require a temporary variable
error: aborting due to 2 previous errors
diff --git a/src/test/ui/lint/trivial_casts.stderr b/src/test/ui/lint/trivial_casts.stderr
index 8a216360f..74f962835 100644
--- a/src/test/ui/lint/trivial_casts.stderr
+++ b/src/test/ui/lint/trivial_casts.stderr
@@ -4,12 +4,12 @@ error: trivial numeric cast: `i32` as `i32`
LL | let _ = 42_i32 as i32;
| ^^^^^^^^^^^^^
|
+ = help: cast can be replaced by coercion; this might require a temporary variable
note: the lint level is defined here
--> $DIR/trivial_casts.rs:4:24
|
LL | #![deny(trivial_casts, trivial_numeric_casts)]
| ^^^^^^^^^^^^^^^^^^^^^
- = help: cast can be replaced by coercion; this might require a temporary variable
error: trivial numeric cast: `u8` as `u8`
--> $DIR/trivial_casts.rs:19:13
@@ -25,12 +25,12 @@ error: trivial cast: `&u32` as `*const u32`
LL | let _ = x as *const u32;
| ^^^^^^^^^^^^^^^
|
+ = help: cast can be replaced by coercion; this might require a temporary variable
note: the lint level is defined here
--> $DIR/trivial_casts.rs:4:9
|
LL | #![deny(trivial_casts, trivial_numeric_casts)]
| ^^^^^^^^^^^^^
- = help: cast can be replaced by coercion; this might require a temporary variable
error: trivial cast: `&mut u32` as `*mut u32`
--> $DIR/trivial_casts.rs:28:13
diff --git a/src/test/ui/lint/type-overflow.stderr b/src/test/ui/lint/type-overflow.stderr
index 8a31fd447..62cb1f7f4 100644
--- a/src/test/ui/lint/type-overflow.stderr
+++ b/src/test/ui/lint/type-overflow.stderr
@@ -4,13 +4,13 @@ warning: literal out of range for `i8`
LL | let error = 255i8;
| ^^^^^
|
+ = note: the literal `255i8` does not fit into the type `i8` whose range is `-128..=127`
+ = help: consider using the type `u8` instead
note: the lint level is defined here
--> $DIR/type-overflow.rs:2:9
|
LL | #![warn(overflowing_literals)]
| ^^^^^^^^^^^^^^^^^^^^
- = note: the literal `255i8` does not fit into the type `i8` whose range is `-128..=127`
- = help: consider using the type `u8` instead
warning: literal out of range for `i8`
--> $DIR/type-overflow.rs:10:16
diff --git a/src/test/ui/lint/unaligned_references.stderr b/src/test/ui/lint/unaligned_references.stderr
index 97dbec286..346f49b92 100644
--- a/src/test/ui/lint/unaligned_references.stderr
+++ b/src/test/ui/lint/unaligned_references.stderr
@@ -4,15 +4,15 @@ error: reference to packed field is unaligned
LL | let _ = &good.ptr;
| ^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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: reference to packed field is unaligned
--> $DIR/unaligned_references.rs:24:17
@@ -111,15 +111,15 @@ error: reference to packed field is unaligned
LL | let _ = &good.ptr;
| ^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -128,15 +128,15 @@ error: reference to packed field is unaligned
LL | let _ = &good.data;
| ^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -145,15 +145,15 @@ error: reference to packed field is unaligned
LL | let _ = &good.data as *const _;
| ^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -162,15 +162,15 @@ error: reference to packed field is unaligned
LL | let _: *const _ = &good.data;
| ^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -179,15 +179,15 @@ error: reference to packed field is unaligned
LL | let _ = good.data.clone();
| ^^^^^^^^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -196,15 +196,15 @@ error: reference to packed field is unaligned
LL | let _ = &good.data2[0];
| ^^^^^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -213,15 +213,15 @@ error: reference to packed field is unaligned
LL | let _ = &packed2.x;
| ^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -230,15 +230,15 @@ error: reference to packed field is unaligned
LL | let _ref = &m1.1.a;
| ^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -247,13 +247,13 @@ error: reference to packed field is unaligned
LL | let _ref = &m2.1.a;
| ^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references.rs:1:9
|
LL | #![deny(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
diff --git a/src/test/ui/lint/unaligned_references_external_macro.stderr b/src/test/ui/lint/unaligned_references_external_macro.stderr
index 1262c21ee..c46ca6742 100644
--- a/src/test/ui/lint/unaligned_references_external_macro.stderr
+++ b/src/test/ui/lint/unaligned_references_external_macro.stderr
@@ -10,6 +10,10 @@ LL | | }
LL | | }
| |_^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references_external_macro.rs:5:1
|
@@ -21,10 +25,6 @@ LL | | pub field: u16
LL | | }
LL | | }
| |_^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
= note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
@@ -42,6 +42,10 @@ LL | | }
LL | | }
| |_^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/unaligned_references_external_macro.rs:5:1
|
@@ -53,9 +57,5 @@ LL | | pub field: u16
LL | | }
LL | | }
| |_^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
= note: this error originates in the macro `unaligned_references_external_crate::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/lint/unreachable_pub.stderr b/src/test/ui/lint/unreachable_pub.stderr
index e021f500c..762834b97 100644
--- a/src/test/ui/lint/unreachable_pub.stderr
+++ b/src/test/ui/lint/unreachable_pub.stderr
@@ -6,12 +6,12 @@ LL | pub use std::fmt;
| |
| help: consider restricting its visibility: `pub(crate)`
|
+ = help: or consider exporting it for use by other crates
note: the lint level is defined here
--> $DIR/unreachable_pub.rs:4:9
|
LL | #![warn(unreachable_pub)]
| ^^^^^^^^^^^^^^^
- = help: or consider exporting it for use by other crates
warning: unreachable `pub` item
--> $DIR/unreachable_pub.rs:9:24
diff --git a/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr b/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
index 26fa6eb9b..fe2e3afc8 100644
--- a/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
+++ b/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
@@ -49,8 +49,8 @@ warning: value assigned to `hours_are_suns` is never read
LL | hours_are_suns = false;
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
= help: maybe it is overwritten before being read?
+ = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
warning: unused variable: `fire`
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:52:32
diff --git a/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr b/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr
index c501aa25f..f2e616899 100644
--- a/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr
+++ b/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr
@@ -11,12 +11,6 @@ LL | #![deny(unused)]
| ^^^^^^
= note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
-error: unused variable: `x`
- --> $DIR/issue-54180-unused-ref-field.rs:29:45
- |
-LL | let _: i32 = points.iter().map(|Point { x, y }| y).sum();
- | ^ help: try ignoring the field: `x: _`
-
error: unused variable: `f1`
--> $DIR/issue-54180-unused-ref-field.rs:26:13
|
@@ -29,5 +23,11 @@ error: unused variable: `x`
LL | Point { y, ref mut x } => y,
| ^^^^^^^^^ help: try ignoring the field: `x: _`
+error: unused variable: `x`
+ --> $DIR/issue-54180-unused-ref-field.rs:29:45
+ |
+LL | let _: i32 = points.iter().map(|Point { x, y }| y).sum();
+ | ^ help: try ignoring the field: `x: _`
+
error: aborting due to 4 previous errors
diff --git a/src/test/ui/lint/unused/lint-unused-variables.stderr b/src/test/ui/lint/unused/lint-unused-variables.stderr
index d6e684e83..fd9a5bcbf 100644
--- a/src/test/ui/lint/unused/lint-unused-variables.stderr
+++ b/src/test/ui/lint/unused/lint-unused-variables.stderr
@@ -17,55 +17,55 @@ LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `a`
- --> $DIR/lint-unused-variables.rs:68:9
+ --> $DIR/lint-unused-variables.rs:22:9
|
LL | a: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_a`
error: unused variable: `b`
- --> $DIR/lint-unused-variables.rs:74:9
+ --> $DIR/lint-unused-variables.rs:29:9
|
LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `b`
- --> $DIR/lint-unused-variables.rs:42:9
+ --> $DIR/lint-unused-variables.rs:34:9
|
LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `b`
- --> $DIR/lint-unused-variables.rs:47:9
+ --> $DIR/lint-unused-variables.rs:42:9
|
LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
-error: unused variable: `a`
- --> $DIR/lint-unused-variables.rs:22:9
- |
-LL | a: i32,
- | ^ help: if this is intentional, prefix it with an underscore: `_a`
-
error: unused variable: `b`
- --> $DIR/lint-unused-variables.rs:29:9
+ --> $DIR/lint-unused-variables.rs:47:9
|
LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `b`
- --> $DIR/lint-unused-variables.rs:34:9
+ --> $DIR/lint-unused-variables.rs:55:9
|
LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `b`
- --> $DIR/lint-unused-variables.rs:55:9
+ --> $DIR/lint-unused-variables.rs:60:9
|
LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
+error: unused variable: `a`
+ --> $DIR/lint-unused-variables.rs:68:9
+ |
+LL | a: i32,
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
+
error: unused variable: `b`
- --> $DIR/lint-unused-variables.rs:60:9
+ --> $DIR/lint-unused-variables.rs:74:9
|
LL | b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
diff --git a/src/test/ui/lint/unused/must-use-box-from-raw.stderr b/src/test/ui/lint/unused/must-use-box-from-raw.stderr
index 7769f09aa..011acc3bf 100644
--- a/src/test/ui/lint/unused/must-use-box-from-raw.stderr
+++ b/src/test/ui/lint/unused/must-use-box-from-raw.stderr
@@ -4,12 +4,12 @@ warning: unused return value of `Box::<T>::from_raw` that must be used
LL | Box::from_raw(ptr);
| ^^^^^^^^^^^^^^^^^^^
|
+ = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
note: the lint level is defined here
--> $DIR/must-use-box-from-raw.rs:5:9
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
warning: 1 warning emitted
diff --git a/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr b/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
index 76978d29d..f5199f43c 100644
--- a/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
+++ b/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
@@ -4,12 +4,12 @@ error: unused implementer of `Iterator` that must be used
LL | iterator();
| ^^^^^^^^^^^
|
+ = note: iterators are lazy and do nothing unless consumed
note: the lint level is defined here
--> $DIR/must_use-in-stdlib-traits.rs:1:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: iterators are lazy and do nothing unless consumed
error: unused implementer of `Future` that must be used
--> $DIR/must_use-in-stdlib-traits.rs:43:4
diff --git a/src/test/ui/lint/unused/must_use-tuple.stderr b/src/test/ui/lint/unused/must_use-tuple.stderr
index e5709a5f0..63e0318fb 100644
--- a/src/test/ui/lint/unused/must_use-tuple.stderr
+++ b/src/test/ui/lint/unused/must_use-tuple.stderr
@@ -4,12 +4,12 @@ error: unused `Result` in tuple element 0 that must be used
LL | (Ok::<(), ()>(()),);
| ^^^^^^^^^^^^^^^^
|
+ = note: this `Result` may be an `Err` variant, which should be handled
note: the lint level is defined here
--> $DIR/must_use-tuple.rs:1:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: this `Result` may be an `Err` variant, which should be handled
error: unused `Result` in tuple element 0 that must be used
--> $DIR/must_use-tuple.rs:10:6
diff --git a/src/test/ui/lint/unused/unused-attr-duplicate.stderr b/src/test/ui/lint/unused/unused-attr-duplicate.stderr
index f592323b5..769b17487 100644
--- a/src/test/ui/lint/unused/unused-attr-duplicate.stderr
+++ b/src/test/ui/lint/unused/unused-attr-duplicate.stderr
@@ -4,16 +4,16 @@ error: unused attribute
LL | #[no_link]
| ^^^^^^^^^^ help: remove this attribute
|
-note: the lint level is defined here
- --> $DIR/unused-attr-duplicate.rs:12:9
- |
-LL | #![deny(unused_attributes)]
- | ^^^^^^^^^^^^^^^^^
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:32:1
|
LL | #[no_link]
| ^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/unused-attr-duplicate.rs:12:9
+ |
+LL | #![deny(unused_attributes)]
+ | ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:37:1
diff --git a/src/test/ui/lint/unused/unused-closure.stderr b/src/test/ui/lint/unused/unused-closure.stderr
index 265d3e8e0..4362abd20 100644
--- a/src/test/ui/lint/unused/unused-closure.stderr
+++ b/src/test/ui/lint/unused/unused-closure.stderr
@@ -6,12 +6,12 @@ LL | | println!("Hello!");
LL | | };
| |______^
|
+ = note: closures are lazy and do nothing unless called
note: the lint level is defined here
--> $DIR/unused-closure.rs:6:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: closures are lazy and do nothing unless called
error: unused implementer of `Future` that must be used
--> $DIR/unused-closure.rs:13:5
diff --git a/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr b/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
index 1a022c309..078b780d8 100644
--- a/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
+++ b/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
@@ -23,12 +23,12 @@ LL |
LL | _ => false,
| ---------- rustdoc does not generate documentation for match arms
|
+ = help: use `//` for a plain comment
note: the lint level is defined here
--> $DIR/unused-doc-comments-edge-cases.rs:1:9
|
LL | #![deny(unused_doc_comments)]
| ^^^^^^^^^^^^^^^^^^^
- = help: use `//` for a plain comment
error: unused doc comment
--> $DIR/unused-doc-comments-edge-cases.rs:23:5
diff --git a/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr b/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
index f4f5bb71e..26b1c2b05 100644
--- a/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
+++ b/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
@@ -8,12 +8,12 @@ LL | | /// line3
| |
| rustdoc does not generate documentation for macro invocations
|
+ = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
note: the lint level is defined here
--> $DIR/unused-doc-comments-for-macros.rs:1:9
|
LL | #![deny(unused_doc_comments)]
| ^^^^^^^^^^^^^^^^^^^
- = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
error: unused doc comment
--> $DIR/unused-doc-comments-for-macros.rs:13:5
diff --git a/src/test/ui/lint/unused/unused-supertrait.rs b/src/test/ui/lint/unused/unused-supertrait.rs
new file mode 100644
index 000000000..64a8e5204
--- /dev/null
+++ b/src/test/ui/lint/unused/unused-supertrait.rs
@@ -0,0 +1,11 @@
+#![deny(unused_must_use)]
+
+fn it() -> impl ExactSizeIterator<Item = ()> {
+ let x: Box<dyn ExactSizeIterator<Item = ()>> = todo!();
+ x
+}
+
+fn main() {
+ it();
+ //~^ ERROR unused implementer of `Iterator` that must be used
+}
diff --git a/src/test/ui/lint/unused/unused-supertrait.stderr b/src/test/ui/lint/unused/unused-supertrait.stderr
new file mode 100644
index 000000000..d2f8c0078
--- /dev/null
+++ b/src/test/ui/lint/unused/unused-supertrait.stderr
@@ -0,0 +1,15 @@
+error: unused implementer of `Iterator` that must be used
+ --> $DIR/unused-supertrait.rs:9:5
+ |
+LL | it();
+ | ^^^^^
+ |
+ = note: iterators are lazy and do nothing unless consumed
+note: the lint level is defined here
+ --> $DIR/unused-supertrait.rs:1:9
+ |
+LL | #![deny(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/unused/unused_attributes-must_use.rs b/src/test/ui/lint/unused/unused_attributes-must_use.rs
index 1c4abb949..51f868706 100644
--- a/src/test/ui/lint/unused/unused_attributes-must_use.rs
+++ b/src/test/ui/lint/unused/unused_attributes-must_use.rs
@@ -122,4 +122,10 @@ fn main() {
Some(res) => res,
None => 0,
};
+
+ struct PatternField {
+ foo: i32,
+ }
+ let s = PatternField { #[must_use] foo: 123 }; //~ ERROR `#[must_use]` has no effect
+ let PatternField { #[must_use] foo } = s; //~ ERROR `#[must_use]` has no effect
}
diff --git a/src/test/ui/lint/unused/unused_attributes-must_use.stderr b/src/test/ui/lint/unused/unused_attributes-must_use.stderr
index 317d81c59..ce959ddbc 100644
--- a/src/test/ui/lint/unused/unused_attributes-must_use.stderr
+++ b/src/test/ui/lint/unused/unused_attributes-must_use.stderr
@@ -4,16 +4,16 @@ error: unused attribute `must_use`
LL | #[must_use]
| ^^^^^^^^^^^
|
-note: the lint level is defined here
- --> $DIR/unused_attributes-must_use.rs:2:9
- |
-LL | #![deny(unused_attributes, unused_must_use)]
- | ^^^^^^^^^^^^^^^^^
note: the built-in attribute `must_use` will be ignored, since it's applied to the macro invocation `global_asm`
--> $DIR/unused_attributes-must_use.rs:59:1
|
LL | global_asm!("");
| ^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/unused_attributes-must_use.rs:2:9
+ |
+LL | #![deny(unused_attributes, unused_must_use)]
+ | ^^^^^^^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to an extern crate
--> $DIR/unused_attributes-must_use.rs:5:1
@@ -105,6 +105,18 @@ error: `#[must_use]` has no effect when applied to an match arm
LL | #[must_use]
| ^^^^^^^^^^^
+error: `#[must_use]` has no effect when applied to a struct field
+ --> $DIR/unused_attributes-must_use.rs:129:28
+ |
+LL | let s = PatternField { #[must_use] foo: 123 };
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a pattern field
+ --> $DIR/unused_attributes-must_use.rs:130:24
+ |
+LL | let PatternField { #[must_use] foo } = s;
+ | ^^^^^^^^^^^
+
error: `#[must_use]` has no effect when applied to an associated const
--> $DIR/unused_attributes-must_use.rs:68:5
|
@@ -171,5 +183,5 @@ error: unused return value of `Use::get_four` that must be used
LL | ().get_four();
| ^^^^^^^^^^^^^^
-error: aborting due to 26 previous errors
+error: aborting due to 28 previous errors
diff --git a/src/test/ui/lint/unused/useless-comment.stderr b/src/test/ui/lint/unused/useless-comment.stderr
index 0054426fb..8bb5bdaeb 100644
--- a/src/test/ui/lint/unused/useless-comment.stderr
+++ b/src/test/ui/lint/unused/useless-comment.stderr
@@ -4,12 +4,12 @@ error: unused doc comment
LL | /// foo
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustdoc does not generate documentation for macro invocations
|
+ = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
note: the lint level is defined here
--> $DIR/useless-comment.rs:3:9
|
LL | #![deny(unused_doc_comments)]
| ^^^^^^^^^^^^^^^^^^^
- = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
error: unused doc comment
--> $DIR/useless-comment.rs:32:5
diff --git a/src/test/ui/lint/unused_labels.rs b/src/test/ui/lint/unused_labels.rs
index 8a3568f65..87a5392fd 100644
--- a/src/test/ui/lint/unused_labels.rs
+++ b/src/test/ui/lint/unused_labels.rs
@@ -4,7 +4,6 @@
// check-pass
-#![feature(label_break_value)]
#![warn(unused_labels)]
fn main() {
diff --git a/src/test/ui/lint/unused_labels.stderr b/src/test/ui/lint/unused_labels.stderr
index 85adc9ab3..846da792b 100644
--- a/src/test/ui/lint/unused_labels.stderr
+++ b/src/test/ui/lint/unused_labels.stderr
@@ -1,5 +1,5 @@
warning: label name `'many_used_shadowed` shadows a label name that is already in scope
- --> $DIR/unused_labels.rs:62:9
+ --> $DIR/unused_labels.rs:61:9
|
LL | 'many_used_shadowed: for _ in 0..10 {
| ------------------- first declared here
@@ -8,55 +8,55 @@ LL | 'many_used_shadowed: for _ in 0..10 {
| ^^^^^^^^^^^^^^^^^^^ label `'many_used_shadowed` already in scope
warning: unused label
- --> $DIR/unused_labels.rs:11:5
+ --> $DIR/unused_labels.rs:10:5
|
LL | 'unused_while_label: while 0 == 0 {
| ^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
- --> $DIR/unused_labels.rs:8:9
+ --> $DIR/unused_labels.rs:7:9
|
LL | #![warn(unused_labels)]
| ^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:16:5
+ --> $DIR/unused_labels.rs:15:5
|
LL | 'unused_while_let_label: while let Some(_) = opt {
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:20:5
+ --> $DIR/unused_labels.rs:19:5
|
LL | 'unused_for_label: for _ in 0..10 {
| ^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:36:9
+ --> $DIR/unused_labels.rs:35:9
|
LL | 'unused_loop_label_inner_2: for _ in 0..10 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:42:5
+ --> $DIR/unused_labels.rs:41:5
|
LL | 'unused_loop_label_outer_3: for _ in 0..10 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:60:5
+ --> $DIR/unused_labels.rs:59:5
|
LL | 'many_used_shadowed: for _ in 0..10 {
| ^^^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:72:5
+ --> $DIR/unused_labels.rs:71:5
|
LL | 'unused_loop_label: loop {
| ^^^^^^^^^^^^^^^^^^
warning: unused label
- --> $DIR/unused_labels.rs:78:5
+ --> $DIR/unused_labels.rs:77:5
|
LL | 'unused_block_label: {
| ^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/lint/unused_parens_multibyte_recovery.rs b/src/test/ui/lint/unused_parens_multibyte_recovery.rs
new file mode 100644
index 000000000..8fcfae22a
--- /dev/null
+++ b/src/test/ui/lint/unused_parens_multibyte_recovery.rs
@@ -0,0 +1,11 @@
+// ignore-tidy-trailing-newlines
+//
+// error-pattern: this file contains an unclosed delimiter
+// error-pattern: this file contains an unclosed delimiter
+// error-pattern: this file contains an unclosed delimiter
+// error-pattern: format argument must be a string literal
+//
+// Verify that unused parens lint does not try to create a span
+// which points in the middle of a multibyte character.
+
+fn f(){(print!(á \ No newline at end of file
diff --git a/src/test/ui/lint/unused_parens_multibyte_recovery.stderr b/src/test/ui/lint/unused_parens_multibyte_recovery.stderr
new file mode 100644
index 000000000..a0302b17e
--- /dev/null
+++ b/src/test/ui/lint/unused_parens_multibyte_recovery.stderr
@@ -0,0 +1,43 @@
+error: this file contains an unclosed delimiter
+ --> $DIR/unused_parens_multibyte_recovery.rs:11:17
+ |
+LL | fn f(){(print!(á
+ | -- - ^
+ | || |
+ | || unclosed delimiter
+ | |unclosed delimiter
+ | unclosed delimiter
+
+error: this file contains an unclosed delimiter
+ --> $DIR/unused_parens_multibyte_recovery.rs:11:17
+ |
+LL | fn f(){(print!(á
+ | -- - ^
+ | || |
+ | || unclosed delimiter
+ | |unclosed delimiter
+ | unclosed delimiter
+
+error: this file contains an unclosed delimiter
+ --> $DIR/unused_parens_multibyte_recovery.rs:11:17
+ |
+LL | fn f(){(print!(á
+ | -- - ^
+ | || |
+ | || unclosed delimiter
+ | |unclosed delimiter
+ | unclosed delimiter
+
+error: format argument must be a string literal
+ --> $DIR/unused_parens_multibyte_recovery.rs:11:16
+ |
+LL | fn f(){(print!(á
+ | ^
+ |
+help: you might be missing a string literal to format with
+ |
+LL | fn f(){(print!("{}", á
+ | +++++
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/liveness/liveness-asm.stderr b/src/test/ui/liveness/liveness-asm.stderr
index d052aca33..57d89e44d 100644
--- a/src/test/ui/liveness/liveness-asm.stderr
+++ b/src/test/ui/liveness/liveness-asm.stderr
@@ -4,12 +4,12 @@ warning: value assigned to `src` is never read
LL | asm!("/*{0}*/", inout(reg) src);
| ^^^
|
+ = help: maybe it is overwritten before being read?
note: the lint level is defined here
--> $DIR/liveness-asm.rs:7:9
|
LL | #![warn(unused_assignments)]
| ^^^^^^^^^^^^^^^^^^
- = help: maybe it is overwritten before being read?
warning: value assigned to `src` is never read
--> $DIR/liveness-asm.rs:24:39
diff --git a/src/test/ui/liveness/liveness-consts.stderr b/src/test/ui/liveness/liveness-consts.stderr
index adaf54316..6199ea96c 100644
--- a/src/test/ui/liveness/liveness-consts.stderr
+++ b/src/test/ui/liveness/liveness-consts.stderr
@@ -4,13 +4,13 @@ warning: variable `a` is assigned to, but never used
LL | let mut a = 0;
| ^
|
+ = note: consider using `_a` instead
note: the lint level is defined here
--> $DIR/liveness-consts.rs:2:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
- = note: consider using `_a` instead
warning: value assigned to `b` is never read
--> $DIR/liveness-consts.rs:17:5
@@ -18,8 +18,8 @@ warning: value assigned to `b` is never read
LL | b += 1;
| ^
|
- = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
= help: maybe it is overwritten before being read?
+ = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
warning: unused variable: `e`
--> $DIR/liveness-consts.rs:24:13
@@ -39,12 +39,6 @@ warning: unused variable: `z`
LL | pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8; { let z = 18; 100 }] {
| ^ help: if this is intentional, prefix it with an underscore: `_z`
-warning: unused variable: `z`
- --> $DIR/liveness-consts.rs:60:13
- |
-LL | let z = 42;
- | ^ help: if this is intentional, prefix it with an underscore: `_z`
-
warning: value assigned to `t` is never read
--> $DIR/liveness-consts.rs:42:9
|
@@ -59,5 +53,11 @@ warning: unused variable: `w`
LL | let w = 10;
| ^ help: if this is intentional, prefix it with an underscore: `_w`
+warning: unused variable: `z`
+ --> $DIR/liveness-consts.rs:60:13
+ |
+LL | let z = 42;
+ | ^ help: if this is intentional, prefix it with an underscore: `_z`
+
warning: 8 warnings emitted
diff --git a/src/test/ui/liveness/liveness-dead.stderr b/src/test/ui/liveness/liveness-dead.stderr
index 12680ab11..de6d5bd99 100644
--- a/src/test/ui/liveness/liveness-dead.stderr
+++ b/src/test/ui/liveness/liveness-dead.stderr
@@ -4,12 +4,12 @@ error: value assigned to `x` is never read
LL | let mut x: isize = 3;
| ^
|
+ = help: maybe it is overwritten before being read?
note: the lint level is defined here
--> $DIR/liveness-dead.rs:2:9
|
LL | #![deny(unused_assignments)]
| ^^^^^^^^^^^^^^^^^^
- = help: maybe it is overwritten before being read?
error: value assigned to `x` is never read
--> $DIR/liveness-dead.rs:17:5
diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.rs b/src/test/ui/liveness/liveness-return-last-stmt-semi.rs
index e8909c4a5..dff859429 100644
--- a/src/test/ui/liveness/liveness-return-last-stmt-semi.rs
+++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.rs
@@ -1,4 +1,3 @@
-//
// regression test for #8005
macro_rules! test { () => { fn foo() -> i32 { 1; } } }
diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
index 82d136bd3..de0843aa6 100644
--- a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
+++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/liveness-return-last-stmt-semi.rs:7:19
+ --> $DIR/liveness-return-last-stmt-semi.rs:6:19
|
LL | fn no_return() -> i32 {}
| --------- ^^^ expected `i32`, found `()`
@@ -7,17 +7,17 @@ LL | fn no_return() -> i32 {}
| implicitly returns `()` as its body has no tail or `return` expression
error[E0308]: mismatched types
- --> $DIR/liveness-return-last-stmt-semi.rs:9:19
+ --> $DIR/liveness-return-last-stmt-semi.rs:8:19
|
LL | fn bar(x: u32) -> u32 {
| --- ^^^ expected `u32`, found `()`
| |
| implicitly returns `()` as its body has no tail or `return` expression
LL | x * 2;
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error[E0308]: mismatched types
- --> $DIR/liveness-return-last-stmt-semi.rs:13:19
+ --> $DIR/liveness-return-last-stmt-semi.rs:12:19
|
LL | fn baz(x: u64) -> u32 {
| --- ^^^ expected `u32`, found `()`
@@ -25,7 +25,7 @@ LL | fn baz(x: u64) -> u32 {
| implicitly returns `()` as its body has no tail or `return` expression
error[E0308]: mismatched types
- --> $DIR/liveness-return-last-stmt-semi.rs:4:41
+ --> $DIR/liveness-return-last-stmt-semi.rs:3:41
|
LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
| --- ^^^ expected `i32`, found `()`
diff --git a/src/test/ui/liveness/liveness-unused.stderr b/src/test/ui/liveness/liveness-unused.stderr
index 4a6122681..f6c478ddb 100644
--- a/src/test/ui/liveness/liveness-unused.stderr
+++ b/src/test/ui/liveness/liveness-unused.stderr
@@ -57,12 +57,12 @@ error: value assigned to `x` is never read
LL | x += 4;
| ^
|
+ = help: maybe it is overwritten before being read?
note: the lint level is defined here
--> $DIR/liveness-unused.rs:3:9
|
LL | #![deny(unused_assignments)]
| ^^^^^^^^^^^^^^^^^^
- = help: maybe it is overwritten before being read?
error: variable `z` is assigned to, but never used
--> $DIR/liveness-unused.rs:37:13
diff --git a/src/test/ui/liveness/liveness-upvars.stderr b/src/test/ui/liveness/liveness-upvars.stderr
index cb104e0a3..82f62371e 100644
--- a/src/test/ui/liveness/liveness-upvars.stderr
+++ b/src/test/ui/liveness/liveness-upvars.stderr
@@ -4,13 +4,13 @@ warning: value assigned to `last` is never read
LL | last = Some(s);
| ^^^^
|
+ = help: maybe it is overwritten before being read?
note: the lint level is defined here
--> $DIR/liveness-upvars.rs:4:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
- = help: maybe it is overwritten before being read?
warning: unused variable: `last`
--> $DIR/liveness-upvars.rs:10:9
@@ -18,8 +18,8 @@ warning: unused variable: `last`
LL | last = Some(s);
| ^^^^
|
- = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
= help: did you mean to capture by reference instead?
+ = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]`
warning: unused variable: `sum`
--> $DIR/liveness-upvars.rs:22:9
diff --git a/src/test/ui/loops/loop-proper-liveness.stderr b/src/test/ui/loops/loop-proper-liveness.stderr
index 14e86aee0..f9d94b681 100644
--- a/src/test/ui/loops/loop-proper-liveness.stderr
+++ b/src/test/ui/loops/loop-proper-liveness.stderr
@@ -8,6 +8,10 @@ LL | println!("{:?}", x);
| ^ `x` used here but it isn't initialized
|
= 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 assigning a value
+ |
+LL | let x: i32 = 0;
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/lowering/issue-96847.rs b/src/test/ui/lowering/issue-96847.rs
new file mode 100644
index 000000000..2aa34c8b3
--- /dev/null
+++ b/src/test/ui/lowering/issue-96847.rs
@@ -0,0 +1,14 @@
+// run-pass
+
+// Test that this doesn't abort during AST lowering. In #96847 it did abort
+// because the attribute was being lowered twice.
+
+#![feature(stmt_expr_attributes)]
+#![feature(lang_items)]
+
+fn main() {
+ for _ in [1,2,3] {
+ #![lang="foo"]
+ println!("foo");
+ }
+}
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr
deleted file mode 100644
index 217392aa3..000000000
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllleak.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-error: unknown debugging option: `borrowck`
-
diff --git a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr b/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr
deleted file mode 100644
index 217392aa3..000000000
--- a/src/test/ui/lub-glb/old-lub-glb-hr-noteq1.nllnoleak.stderr
+++ /dev/null
@@ -1,2 +0,0 @@
-error: unknown debugging option: `borrowck`
-
diff --git a/src/test/ui/macros/auxiliary/issue-100199.rs b/src/test/ui/macros/auxiliary/issue-100199.rs
new file mode 100644
index 000000000..9e190b542
--- /dev/null
+++ b/src/test/ui/macros/auxiliary/issue-100199.rs
@@ -0,0 +1,18 @@
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+#![feature(proc_macro_quote)]
+
+extern crate proc_macro;
+
+use proc_macro::{quote, Ident, Span, TokenStream, TokenTree};
+
+#[proc_macro_attribute]
+pub fn struct_with_bound(_: TokenStream, _: TokenStream) -> TokenStream {
+ let crate_ident = TokenTree::Ident(Ident::new("crate", Span::call_site()));
+ let trait_ident = TokenTree::Ident(Ident::new("MyTrait", Span::call_site()));
+ quote!(
+ struct Foo<T: $crate_ident::$trait_ident> {}
+ )
+}
diff --git a/src/test/ui/macros/format-parse-errors.stderr b/src/test/ui/macros/format-parse-errors.stderr
index 1a7578e60..f9ea4c633 100644
--- a/src/test/ui/macros/format-parse-errors.stderr
+++ b/src/test/ui/macros/format-parse-errors.stderr
@@ -22,7 +22,7 @@ error: positional arguments cannot follow named arguments
--> $DIR/format-parse-errors.rs:10:9
|
LL | foo = foo,
- | --- named argument
+ | --------- named argument
LL | bar,
| ^^^ positional arguments must be before named arguments
diff --git a/src/test/ui/macros/issue-100199.rs b/src/test/ui/macros/issue-100199.rs
new file mode 100644
index 000000000..6e50afa07
--- /dev/null
+++ b/src/test/ui/macros/issue-100199.rs
@@ -0,0 +1,16 @@
+#[issue_100199::struct_with_bound] //~ ERROR cannot find trait `MyTrait` in the crate root
+struct Foo {}
+// The above must be on the first line so that it's span points to pos 0.
+// This used to trigger an ICE because the diagnostic emitter would get
+// an unexpected dummy span (lo == 0 == hi) while attempting to print a
+// suggestion.
+
+// aux-build: issue-100199.rs
+
+extern crate issue_100199;
+
+mod traits {
+ pub trait MyTrait {}
+}
+
+fn main() {}
diff --git a/src/test/ui/macros/issue-100199.stderr b/src/test/ui/macros/issue-100199.stderr
new file mode 100644
index 000000000..2cb45dc12
--- /dev/null
+++ b/src/test/ui/macros/issue-100199.stderr
@@ -0,0 +1,15 @@
+error[E0405]: cannot find trait `MyTrait` in the crate root
+ --> $DIR/issue-100199.rs:1:1
+ |
+LL | #[issue_100199::struct_with_bound]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in the crate root
+ |
+ = 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;
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0405`.
diff --git a/src/test/ui/macros/issue-102878.rs b/src/test/ui/macros/issue-102878.rs
new file mode 100644
index 000000000..aac589193
--- /dev/null
+++ b/src/test/ui/macros/issue-102878.rs
@@ -0,0 +1,10 @@
+macro_rules!test{($l:expr,$_:r)=>({const:y y)}
+//~^ ERROR mismatched closing delimiter: `)`
+//~| ERROR invalid fragment specifier `r`
+//~| ERROR expected identifier, found keyword `const`
+//~| ERROR expected identifier, found keyword `const`
+//~| ERROR expected identifier, found `:`
+
+fn s(){test!(1,i)}
+
+fn main() {}
diff --git a/src/test/ui/macros/issue-102878.stderr b/src/test/ui/macros/issue-102878.stderr
new file mode 100644
index 000000000..e0b8855a3
--- /dev/null
+++ b/src/test/ui/macros/issue-102878.stderr
@@ -0,0 +1,60 @@
+error: mismatched closing delimiter: `)`
+ --> $DIR/issue-102878.rs:1:35
+ |
+LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
+ | -^ ^ mismatched closing delimiter
+ | ||
+ | |unclosed delimiter
+ | closing delimiter possibly meant for this
+
+error: invalid fragment specifier `r`
+ --> $DIR/issue-102878.rs:1:27
+ |
+LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
+ | ^^^^
+ |
+ = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, `literal`, `path`, `meta`, `tt`, `item` and `vis`
+
+error: expected identifier, found keyword `const`
+ --> $DIR/issue-102878.rs:1:36
+ |
+LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
+ | ^^^^^ expected identifier, found keyword
+...
+LL | fn s(){test!(1,i)}
+ | ---------- in this macro invocation
+ |
+ = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: escape `const` to use it as an identifier
+ |
+LL | macro_rules!test{($l:expr,$_:r)=>({r#const:y y)}
+ | ++
+
+error: expected identifier, found keyword `const`
+ --> $DIR/issue-102878.rs:1:36
+ |
+LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
+ | ^^^^^ expected identifier, found keyword
+...
+LL | fn s(){test!(1,i)}
+ | ---------- in this macro invocation
+ |
+ = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: escape `const` to use it as an identifier
+ |
+LL | macro_rules!test{($l:expr,$_:r)=>({r#const:y y)}
+ | ++
+
+error: expected identifier, found `:`
+ --> $DIR/issue-102878.rs:1:41
+ |
+LL | macro_rules!test{($l:expr,$_:r)=>({const:y y)}
+ | ^ expected identifier
+...
+LL | fn s(){test!(1,i)}
+ | ---------- in this macro invocation
+ |
+ = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 5 previous errors
+
diff --git a/src/test/ui/macros/issue-39404.stderr b/src/test/ui/macros/issue-39404.stderr
index d2f2a823c..3886a70bb 100644
--- a/src/test/ui/macros/issue-39404.stderr
+++ b/src/test/ui/macros/issue-39404.stderr
@@ -4,9 +4,9 @@ error: missing fragment specifier
LL | macro_rules! m { ($i) => {} }
| ^^
|
- = note: `#[deny(missing_fragment_specifier)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
+ = note: `#[deny(missing_fragment_specifier)]` on by default
error: aborting due to previous error
diff --git a/src/test/ui/macros/issue-84195-lint-anon-const.stderr b/src/test/ui/macros/issue-84195-lint-anon-const.stderr
index 39485d74e..306c08b13 100644
--- a/src/test/ui/macros/issue-84195-lint-anon-const.stderr
+++ b/src/test/ui/macros/issue-84195-lint-anon-const.stderr
@@ -7,13 +7,13 @@ LL | () => { 0; };
LL | let val: [u8; len!()] = [];
| ------ in this macro invocation
|
+ = 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 #79813 <https://github.com/rust-lang/rust/issues/79813>
note: the lint level is defined here
--> $DIR/issue-84195-lint-anon-const.rs:5:9
|
LL | #![deny(semicolon_in_expressions_from_macros)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #79813 <https://github.com/rust-lang/rust/issues/79813>
= note: this error originates in the macro `len` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/macros/issue-99265.stderr b/src/test/ui/macros/issue-99265.stderr
index 2bfeedd7d..9185dbff6 100644
--- a/src/test/ui/macros/issue-99265.stderr
+++ b/src/test/ui/macros/issue-99265.stderr
@@ -77,18 +77,18 @@ help: use the named argument by name to avoid ambiguity
LL | println!("Hello {:width$}!", "x", width = 5);
| ~~~~~~
-warning: named argument `width` is not used by name
- --> $DIR/issue-99265.rs:23:46
+warning: named argument `f` is not used by name
+ --> $DIR/issue-99265.rs:23:33
|
LL | println!("Hello {:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | -- ^^^^^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `width` by position
+ | -------- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `f` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("Hello {:width$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | ~~~~~~
+LL | println!("Hello {f:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
+ | +
warning: named argument `precision` is not used by name
--> $DIR/issue-99265.rs:23:57
@@ -103,31 +103,31 @@ help: use the named argument by name to avoid ambiguity
LL | println!("Hello {:1$.precision$}!", f = 0.02f32, width = 5, precision = 2);
| ~~~~~~~~~~
-warning: named argument `f` is not used by name
- --> $DIR/issue-99265.rs:23:33
+warning: named argument `width` is not used by name
+ --> $DIR/issue-99265.rs:23:46
|
LL | println!("Hello {:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | -- ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `f` by position
+ | -- ^^^^^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `width` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("Hello {f:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | +
+LL | println!("Hello {:width$.2$}!", f = 0.02f32, width = 5, precision = 2);
+ | ~~~~~~
-warning: named argument `width` is not used by name
- --> $DIR/issue-99265.rs:31:47
+warning: named argument `f` is not used by name
+ --> $DIR/issue-99265.rs:31:34
|
LL | println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | -- ^^^^^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `width` by position
+ | --------- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `f` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("Hello {0:width$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | ~~~~~~
+LL | println!("Hello {f:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
+ | ~
warning: named argument `precision` is not used by name
--> $DIR/issue-99265.rs:31:58
@@ -142,32 +142,32 @@ help: use the named argument by name to avoid ambiguity
LL | println!("Hello {0:1$.precision$}!", f = 0.02f32, width = 5, precision = 2);
| ~~~~~~~~~~
-warning: named argument `f` is not used by name
- --> $DIR/issue-99265.rs:31:34
+warning: named argument `width` is not used by name
+ --> $DIR/issue-99265.rs:31:47
|
LL | println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | - ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `f` by position
+ | -- ^^^^^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `width` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("Hello {f:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
- | ~
+LL | println!("Hello {0:width$.2$}!", f = 0.02f32, width = 5, precision = 2);
+ | ~~~~~~
-warning: named argument `width` is not used by name
- --> $DIR/issue-99265.rs:52:9
+warning: named argument `f` is not used by name
+ --> $DIR/issue-99265.rs:49:9
|
LL | "{}, Hello {1:2$.3$} {4:5$.6$}! {1}",
- | -- this formatting argument uses named argument `width` by position
+ | --------- this formatting argument uses named argument `f` by position
...
-LL | width = 5,
- | ^^^^^ this named argument is referred to by position in formatting string
+LL | f = 0.02f32,
+ | ^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | "{}, Hello {1:width$.3$} {4:5$.6$}! {1}",
- | ~~~~~~
+LL | "{}, Hello {f:2$.3$} {4:5$.6$}! {1}",
+ | ~
warning: named argument `precision` is not used by name
--> $DIR/issue-99265.rs:54:9
@@ -183,33 +183,33 @@ help: use the named argument by name to avoid ambiguity
LL | "{}, Hello {1:2$.precision$} {4:5$.6$}! {1}",
| ~~~~~~~~~~
-warning: named argument `f` is not used by name
- --> $DIR/issue-99265.rs:49:9
+warning: named argument `width` is not used by name
+ --> $DIR/issue-99265.rs:52:9
|
LL | "{}, Hello {1:2$.3$} {4:5$.6$}! {1}",
- | - this formatting argument uses named argument `f` by position
+ | -- this formatting argument uses named argument `width` by position
...
-LL | f = 0.02f32,
- | ^ this named argument is referred to by position in formatting string
+LL | width = 5,
+ | ^^^^^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | "{}, Hello {f:2$.3$} {4:5$.6$}! {1}",
- | ~
+LL | "{}, Hello {1:width$.3$} {4:5$.6$}! {1}",
+ | ~~~~~~
-warning: named argument `width2` is not used by name
- --> $DIR/issue-99265.rs:58:9
+warning: named argument `g` is not used by name
+ --> $DIR/issue-99265.rs:56:9
|
LL | "{}, Hello {1:2$.3$} {4:5$.6$}! {1}",
- | -- this formatting argument uses named argument `width2` by position
+ | --------- this formatting argument uses named argument `g` by position
...
-LL | width2 = 5,
- | ^^^^^^ this named argument is referred to by position in formatting string
+LL | g = 0.02f32,
+ | ^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | "{}, Hello {1:2$.3$} {4:width2$.6$}! {1}",
- | ~~~~~~~
+LL | "{}, Hello {1:2$.3$} {g:5$.6$}! {1}",
+ | ~
warning: named argument `precision2` is not used by name
--> $DIR/issue-99265.rs:60:9
@@ -225,25 +225,25 @@ help: use the named argument by name to avoid ambiguity
LL | "{}, Hello {1:2$.3$} {4:5$.precision2$}! {1}",
| ~~~~~~~~~~~
-warning: named argument `g` is not used by name
- --> $DIR/issue-99265.rs:56:9
+warning: named argument `width2` is not used by name
+ --> $DIR/issue-99265.rs:58:9
|
LL | "{}, Hello {1:2$.3$} {4:5$.6$}! {1}",
- | - this formatting argument uses named argument `g` by position
+ | -- this formatting argument uses named argument `width2` by position
...
-LL | g = 0.02f32,
- | ^ this named argument is referred to by position in formatting string
+LL | width2 = 5,
+ | ^^^^^^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | "{}, Hello {1:2$.3$} {g:5$.6$}! {1}",
- | ~
+LL | "{}, Hello {1:2$.3$} {4:width2$.6$}! {1}",
+ | ~~~~~~~
warning: named argument `f` is not used by name
--> $DIR/issue-99265.rs:49:9
|
LL | "{}, Hello {1:2$.3$} {4:5$.6$}! {1}",
- | - this formatting argument uses named argument `f` by position
+ | --- this formatting argument uses named argument `f` by position
...
LL | f = 0.02f32,
| ^ this named argument is referred to by position in formatting string
@@ -257,7 +257,7 @@ warning: named argument `f` is not used by name
--> $DIR/issue-99265.rs:64:31
|
LL | println!("Hello {:0.1}!", f = 0.02f32);
- | -- ^ this named argument is referred to by position in formatting string
+ | ------ ^ this named argument is referred to by position in formatting string
| |
| this formatting argument uses named argument `f` by position
|
@@ -270,9 +270,9 @@ warning: named argument `f` is not used by name
--> $DIR/issue-99265.rs:68:32
|
LL | println!("Hello {0:0.1}!", f = 0.02f32);
- | - ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `f` by position
+ | ------- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `f` by position
|
help: use the named argument by name to avoid ambiguity
|
@@ -283,6 +283,19 @@ warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:79:23
|
LL | println!("{:0$}", v = val);
+ | ----- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `v` by position
+ |
+help: use the named argument by name to avoid ambiguity
+ |
+LL | println!("{v:0$}", v = val);
+ | +
+
+warning: named argument `v` is not used by name
+ --> $DIR/issue-99265.rs:79:23
+ |
+LL | println!("{:0$}", v = val);
| -- ^ this named argument is referred to by position in formatting string
| |
| this formatting argument uses named argument `v` by position
@@ -293,17 +306,17 @@ LL | println!("{:v$}", v = val);
| ~~
warning: named argument `v` is not used by name
- --> $DIR/issue-99265.rs:79:23
+ --> $DIR/issue-99265.rs:84:24
|
-LL | println!("{:0$}", v = val);
- | -- ^ this named argument is referred to by position in formatting string
+LL | println!("{0:0$}", v = val);
+ | ------ ^ this named argument is referred to by position in formatting string
| |
| this formatting argument uses named argument `v` by position
|
help: use the named argument by name to avoid ambiguity
|
LL | println!("{v:0$}", v = val);
- | +
+ | ~
warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:84:24
@@ -319,30 +332,17 @@ LL | println!("{0:v$}", v = val);
| ~~
warning: named argument `v` is not used by name
- --> $DIR/issue-99265.rs:84:24
- |
-LL | println!("{0:0$}", v = val);
- | - ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `v` by position
- |
-help: use the named argument by name to avoid ambiguity
- |
-LL | println!("{v:0$}", v = val);
- | ~
-
-warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:89:26
|
LL | println!("{:0$.0$}", v = val);
- | -- ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `v` by position
+ | -------- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `v` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("{:v$.0$}", v = val);
- | ~~
+LL | println!("{v:0$.0$}", v = val);
+ | +
warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:89:26
@@ -361,27 +361,27 @@ warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:89:26
|
LL | println!("{:0$.0$}", v = val);
- | -- ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `v` by position
+ | -- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `v` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("{v:0$.0$}", v = val);
- | +
+LL | println!("{:v$.0$}", v = val);
+ | ~~
warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:96:27
|
LL | println!("{0:0$.0$}", v = val);
- | -- ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `v` by position
+ | --------- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `v` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("{0:v$.0$}", v = val);
- | ~~
+LL | println!("{v:0$.0$}", v = val);
+ | ~
warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:96:27
@@ -400,14 +400,14 @@ warning: named argument `v` is not used by name
--> $DIR/issue-99265.rs:96:27
|
LL | println!("{0:0$.0$}", v = val);
- | - ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `v` by position
+ | -- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `v` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("{v:0$.0$}", v = val);
- | ~
+LL | println!("{0:v$.0$}", v = val);
+ | ~~
warning: named argument `a` is not used by name
--> $DIR/issue-99265.rs:104:28
@@ -426,28 +426,28 @@ warning: named argument `a` is not used by name
--> $DIR/issue-99265.rs:104:28
|
LL | println!("{} {a} {0}", a = 1);
- | - ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `a` by position
+ | --- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `a` by position
|
help: use the named argument by name to avoid ambiguity
|
LL | println!("{} {a} {a}", a = 1);
| ~
-warning: named argument `b` is not used by name
- --> $DIR/issue-99265.rs:115:23
+warning: named argument `a` is not used by name
+ --> $DIR/issue-99265.rs:115:14
|
LL | {:1$.2$}",
- | -- this formatting argument uses named argument `b` by position
+ | -------- this formatting argument uses named argument `a` by position
...
LL | a = 1.0, b = 1, c = 2,
- | ^ this named argument is referred to by position in formatting string
+ | ^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | {:b$.2$}",
- | ~~
+LL | {a:1$.2$}",
+ | +
warning: named argument `c` is not used by name
--> $DIR/issue-99265.rs:115:30
@@ -463,33 +463,33 @@ help: use the named argument by name to avoid ambiguity
LL | {:1$.c$}",
| ~~
-warning: named argument `a` is not used by name
- --> $DIR/issue-99265.rs:115:14
+warning: named argument `b` is not used by name
+ --> $DIR/issue-99265.rs:115:23
|
LL | {:1$.2$}",
- | -- this formatting argument uses named argument `a` by position
+ | -- this formatting argument uses named argument `b` by position
...
LL | a = 1.0, b = 1, c = 2,
- | ^ this named argument is referred to by position in formatting string
+ | ^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | {a:1$.2$}",
- | +
+LL | {:b$.2$}",
+ | ~~
-warning: named argument `b` is not used by name
- --> $DIR/issue-99265.rs:126:23
+warning: named argument `a` is not used by name
+ --> $DIR/issue-99265.rs:126:14
|
LL | {0:1$.2$}",
- | -- this formatting argument uses named argument `b` by position
+ | --------- this formatting argument uses named argument `a` by position
...
LL | a = 1.0, b = 1, c = 2,
- | ^ this named argument is referred to by position in formatting string
+ | ^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | {0:b$.2$}",
- | ~~
+LL | {a:1$.2$}",
+ | ~
warning: named argument `c` is not used by name
--> $DIR/issue-99265.rs:126:30
@@ -505,32 +505,32 @@ help: use the named argument by name to avoid ambiguity
LL | {0:1$.c$}",
| ~~
-warning: named argument `a` is not used by name
- --> $DIR/issue-99265.rs:126:14
+warning: named argument `b` is not used by name
+ --> $DIR/issue-99265.rs:126:23
|
LL | {0:1$.2$}",
- | - this formatting argument uses named argument `a` by position
+ | -- this formatting argument uses named argument `b` by position
...
LL | a = 1.0, b = 1, c = 2,
- | ^ this named argument is referred to by position in formatting string
+ | ^ this named argument is referred to by position in formatting string
|
help: use the named argument by name to avoid ambiguity
|
-LL | {a:1$.2$}",
- | ~
+LL | {0:b$.2$}",
+ | ~~
-warning: named argument `width` is not used by name
- --> $DIR/issue-99265.rs:132:39
+warning: named argument `x` is not used by name
+ --> $DIR/issue-99265.rs:132:30
|
LL | println!("{{{:1$.2$}}}", x = 1.0, width = 3, precision = 2);
- | -- ^^^^^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `width` by position
+ | -------- ^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `x` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("{{{:width$.2$}}}", x = 1.0, width = 3, precision = 2);
- | ~~~~~~
+LL | println!("{{{x:1$.2$}}}", x = 1.0, width = 3, precision = 2);
+ | +
warning: named argument `precision` is not used by name
--> $DIR/issue-99265.rs:132:50
@@ -545,18 +545,18 @@ help: use the named argument by name to avoid ambiguity
LL | println!("{{{:1$.precision$}}}", x = 1.0, width = 3, precision = 2);
| ~~~~~~~~~~
-warning: named argument `x` is not used by name
- --> $DIR/issue-99265.rs:132:30
+warning: named argument `width` is not used by name
+ --> $DIR/issue-99265.rs:132:39
|
LL | println!("{{{:1$.2$}}}", x = 1.0, width = 3, precision = 2);
- | -- ^ this named argument is referred to by position in formatting string
- | |
- | this formatting argument uses named argument `x` by position
+ | -- ^^^^^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `width` by position
|
help: use the named argument by name to avoid ambiguity
|
-LL | println!("{{{x:1$.2$}}}", x = 1.0, width = 3, precision = 2);
- | +
+LL | println!("{{{:width$.2$}}}", x = 1.0, width = 3, precision = 2);
+ | ~~~~~~
warning: 42 warnings emitted
diff --git a/src/test/ui/macros/issue-99907.stderr b/src/test/ui/macros/issue-99907.stderr
index 4786ce003..eefb28dee 100644
--- a/src/test/ui/macros/issue-99907.stderr
+++ b/src/test/ui/macros/issue-99907.stderr
@@ -2,7 +2,7 @@ warning: named argument `f` is not used by name
--> $DIR/issue-99907.rs:5:30
|
LL | println!("Hello {:.1}!", f = 0.02f32);
- | -- ^ this named argument is referred to by position in formatting string
+ | ----- ^ this named argument is referred to by position in formatting string
| |
| this formatting argument uses named argument `f` by position
|
@@ -16,7 +16,7 @@ warning: named argument `f` is not used by name
--> $DIR/issue-99907.rs:9:31
|
LL | println!("Hello {:1.1}!", f = 0.02f32);
- | -- ^ this named argument is referred to by position in formatting string
+ | ------ ^ this named argument is referred to by position in formatting string
| |
| this formatting argument uses named argument `f` by position
|
diff --git a/src/test/ui/macros/lint-trailing-macro-call.stderr b/src/test/ui/macros/lint-trailing-macro-call.stderr
index a98a559c8..6ab121f7c 100644
--- a/src/test/ui/macros/lint-trailing-macro-call.stderr
+++ b/src/test/ui/macros/lint-trailing-macro-call.stderr
@@ -7,11 +7,11 @@ LL | #[cfg(FALSE)] 25;
LL | expand_it!()
| ------------ in this macro invocation
|
- = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
= note: macro invocations at the end of a block are treated as expressions
= note: to ignore the value produced by the macro, add a semicolon after the invocation of `expand_it`
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= note: this warning originates in the macro `expand_it` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 1 warning emitted
diff --git a/src/test/ui/macros/macro-comma-behavior-rpass.rs b/src/test/ui/macros/macro-comma-behavior-rpass.rs
index dfd58b25d..8406b4e78 100644
--- a/src/test/ui/macros/macro-comma-behavior-rpass.rs
+++ b/src/test/ui/macros/macro-comma-behavior-rpass.rs
@@ -14,7 +14,6 @@
// compile-flags: --test -C debug_assertions=yes
// revisions: std core
-// ignore-wasm32-bare compiled with panic=abort by default
#![cfg_attr(core, no_std)]
#[cfg(core)]
diff --git a/src/test/ui/macros/macro-context.stderr b/src/test/ui/macros/macro-context.stderr
index 5dc178070..f597c398b 100644
--- a/src/test/ui/macros/macro-context.stderr
+++ b/src/test/ui/macros/macro-context.stderr
@@ -57,7 +57,7 @@ error[E0425]: cannot find value `i` in this scope
--> $DIR/macro-context.rs:3:13
|
LL | () => ( i ; typeof );
- | ^ help: a local variable with a similar name exists: `a`
+ | ^ not found in this scope
...
LL | let i = m!();
| ---- in this macro invocation
@@ -73,9 +73,9 @@ LL | () => ( i ; typeof );
LL | let i = m!();
| ---- in this macro invocation
|
- = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 6 previous errors; 1 warning emitted
diff --git a/src/test/ui/macros/macro-in-expression-context.stderr b/src/test/ui/macros/macro-in-expression-context.stderr
index 1840babd6..1023189ea 100644
--- a/src/test/ui/macros/macro-in-expression-context.stderr
+++ b/src/test/ui/macros/macro-in-expression-context.stderr
@@ -20,11 +20,11 @@ LL | assert_eq!("A", "A");
LL | foo!()
| ------ in this macro invocation
|
- = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79813 <https://github.com/rust-lang/rust/issues/79813>
= note: macro invocations at the end of a block are treated as expressions
= note: to ignore the value produced by the macro, add a semicolon after the invocation of `foo`
+ = note: `#[warn(semicolon_in_expressions_from_macros)]` on by default
= note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/macros/macro-match-nonterminal.stderr b/src/test/ui/macros/macro-match-nonterminal.stderr
index 48b9bc6ff..ef7261c02 100644
--- a/src/test/ui/macros/macro-match-nonterminal.stderr
+++ b/src/test/ui/macros/macro-match-nonterminal.stderr
@@ -10,9 +10,9 @@ error: missing fragment specifier
LL | ($a, $b) => {
| ^
|
- = note: `#[deny(missing_fragment_specifier)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
+ = note: `#[deny(missing_fragment_specifier)]` on by default
error: missing fragment specifier
--> $DIR/macro-match-nonterminal.rs:2:10
diff --git a/src/test/ui/macros/macro-missing-fragment-deduplication.stderr b/src/test/ui/macros/macro-missing-fragment-deduplication.stderr
index 7622ca054..3b9e716e1 100644
--- a/src/test/ui/macros/macro-missing-fragment-deduplication.stderr
+++ b/src/test/ui/macros/macro-missing-fragment-deduplication.stderr
@@ -10,9 +10,9 @@ error: missing fragment specifier
LL | ($name) => {}
| ^^^^^
|
- = note: `#[deny(missing_fragment_specifier)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
+ = note: `#[deny(missing_fragment_specifier)]` on by default
error: aborting due to 2 previous errors
diff --git a/src/test/ui/macros/macro-missing-fragment.stderr b/src/test/ui/macros/macro-missing-fragment.stderr
index 1bf6f04ec..2aa1e58f6 100644
--- a/src/test/ui/macros/macro-missing-fragment.stderr
+++ b/src/test/ui/macros/macro-missing-fragment.stderr
@@ -10,13 +10,13 @@ warning: missing fragment specifier
LL | ( $( any_token $field_rust_type )* ) => {};
| ^^^^^^^^^^^^^^^^
|
+ = 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 #40107 <https://github.com/rust-lang/rust/issues/40107>
note: the lint level is defined here
--> $DIR/macro-missing-fragment.rs:1:9
|
LL | #![warn(missing_fragment_specifier)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #40107 <https://github.com/rust-lang/rust/issues/40107>
warning: missing fragment specifier
--> $DIR/macro-missing-fragment.rs:12:7
diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.stderr b/src/test/ui/macros/macro-or-patterns-back-compat.stderr
index 9a5b8009f..e04dfefa4 100644
--- a/src/test/ui/macros/macro-or-patterns-back-compat.stderr
+++ b/src/test/ui/macros/macro-or-patterns-back-compat.stderr
@@ -4,13 +4,13 @@ error: the meaning of the `pat` fragment specifier is changing in Rust 2021, whi
LL | macro_rules! foo { ($x:pat | $y:pat) => {} }
| ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
note: the lint level is defined here
--> $DIR/macro-or-patterns-back-compat.rs:4:9
|
LL | #![deny(rust_2021_incompatible_or_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
--> $DIR/macro-or-patterns-back-compat.rs:13:23
diff --git a/src/test/ui/macros/macro-use-all-and-none.stderr b/src/test/ui/macros/macro-use-all-and-none.stderr
index 6de7ffb2f..00b10dccd 100644
--- a/src/test/ui/macros/macro-use-all-and-none.stderr
+++ b/src/test/ui/macros/macro-use-all-and-none.stderr
@@ -4,12 +4,12 @@ warning: unused attribute
LL | #[macro_use()]
| ^^^^^^^^^^^^^^ help: remove this attribute
|
+ = note: attribute `macro_use` with an empty list has no effect
note: the lint level is defined here
--> $DIR/macro-use-all-and-none.rs:4:9
|
LL | #![warn(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
- = note: attribute `macro_use` with an empty list has no effect
warning: 1 warning emitted
diff --git a/src/test/ui/macros/macro_rules-unmatchable-literals.rs b/src/test/ui/macros/macro_rules-unmatchable-literals.rs
new file mode 100644
index 000000000..bde0fe1a0
--- /dev/null
+++ b/src/test/ui/macros/macro_rules-unmatchable-literals.rs
@@ -0,0 +1,14 @@
+// Pinning tests for things that don't work to make sure we notice if that changes
+
+#![crate_type = "lib"]
+
+macro_rules! octal_with_bad_digit {
+ ( 0o1238 ) => {}; //~ ERROR invalid digit
+}
+
+macro_rules! binary_with_bad_digit {
+ ( 0b012 ) => {}; //~ ERROR invalid digit
+}
+
+// This can't happen for Hex and Decimal as things like `123A` and `0xFFG`
+// get treated as unknown *suffixes*, rather than digits.
diff --git a/src/test/ui/macros/macro_rules-unmatchable-literals.stderr b/src/test/ui/macros/macro_rules-unmatchable-literals.stderr
new file mode 100644
index 000000000..956a66979
--- /dev/null
+++ b/src/test/ui/macros/macro_rules-unmatchable-literals.stderr
@@ -0,0 +1,14 @@
+error: invalid digit for a base 8 literal
+ --> $DIR/macro_rules-unmatchable-literals.rs:6:12
+ |
+LL | ( 0o1238 ) => {};
+ | ^
+
+error: invalid digit for a base 2 literal
+ --> $DIR/macro_rules-unmatchable-literals.rs:10:11
+ |
+LL | ( 0b012 ) => {};
+ | ^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/macros/macros-nonfatal-errors.rs b/src/test/ui/macros/macros-nonfatal-errors.rs
index e7a01f105..ab14c3589 100644
--- a/src/test/ui/macros/macros-nonfatal-errors.rs
+++ b/src/test/ui/macros/macros-nonfatal-errors.rs
@@ -4,7 +4,7 @@
// immediately, so that we get more errors listed at a time.
#![feature(trace_macros, concat_idents)]
-#![feature(stmt_expr_attributes, arbitrary_enum_discriminant)]
+#![feature(stmt_expr_attributes)]
use std::arch::asm;
@@ -116,3 +116,24 @@ fn main() {
trace_macros!(invalid); //~ ERROR
}
+
+/// Check that `#[derive(Default)]` does use a `T : Default` bound when the
+/// `#[default]` variant is `#[non_exhaustive]` (should this end up allowed).
+const _: () = {
+ #[derive(Default)]
+ enum NonExhaustiveDefaultGeneric<T> {
+ #[default]
+ #[non_exhaustive]
+ Foo, //~ ERROR default variant must be exhaustive
+ Bar(T),
+ }
+
+ fn assert_impls_default<T: Default>() {}
+
+ enum NotDefault {}
+
+ // Note: the `derive(Default)` currently bails early enough for trait-checking
+ // not to happen. Should it bail late enough, or even pass, make sure to
+ // assert that the following line fails.
+ let _ = assert_impls_default::<NonExhaustiveDefaultGeneric<NotDefault>>;
+};
diff --git a/src/test/ui/macros/macros-nonfatal-errors.stderr b/src/test/ui/macros/macros-nonfatal-errors.stderr
index b3c6d07f9..d42f6c179 100644
--- a/src/test/ui/macros/macros-nonfatal-errors.stderr
+++ b/src/test/ui/macros/macros-nonfatal-errors.stderr
@@ -215,11 +215,21 @@ error: trace_macros! accepts only `true` or `false`
LL | trace_macros!(invalid);
| ^^^^^^^^^^^^^^^^^^^^^^
+error: default variant must be exhaustive
+ --> $DIR/macros-nonfatal-errors.rs:127:9
+ |
+LL | #[non_exhaustive]
+ | ----------------- declared `#[non_exhaustive]` here
+LL | Foo,
+ | ^^^
+ |
+ = help: consider a manual implementation of `Default`
+
error: cannot find macro `llvm_asm` in this scope
--> $DIR/macros-nonfatal-errors.rs:99:5
|
LL | llvm_asm!(invalid);
| ^^^^^^^^
-error: aborting due to 27 previous errors
+error: aborting due to 28 previous errors
diff --git a/src/test/ui/macros/must-use-in-macro-55516.stderr b/src/test/ui/macros/must-use-in-macro-55516.stderr
index b56b00cc7..8878b0eea 100644
--- a/src/test/ui/macros/must-use-in-macro-55516.stderr
+++ b/src/test/ui/macros/must-use-in-macro-55516.stderr
@@ -4,8 +4,8 @@ warning: unused `Result` that must be used
LL | write!(&mut example, "{}", 42);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `-W unused-must-use` implied by `-W unused`
= note: this `Result` may be an `Err` variant, which should be handled
+ = note: `-W unused-must-use` implied by `-W unused`
= note: this warning originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 1 warning emitted
diff --git a/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs b/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs
index f538ec643..b8b6f0846 100644
--- a/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs
+++ b/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-expr-kinds.rs
@@ -2,6 +2,7 @@
// ignore-tidy-linelength
// only-x86_64
// run-pass
+// needs-unwind Asserting on contents of error message
#![allow(path_statements, unused_allocation)]
#![feature(box_syntax, core_intrinsics, generic_assert, generic_assert_internals)]
diff --git a/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-not-available-cases.rs b/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-not-available-cases.rs
index 86697c58f..d46f396ee 100644
--- a/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-not-available-cases.rs
+++ b/src/test/ui/macros/rfc-2011-nicer-assert-messages/all-not-available-cases.rs
@@ -2,6 +2,7 @@
// ignore-tidy-linelength
// only-x86_64
// run-pass
+// needs-unwind Asserting on contents of error message
#![feature(core_intrinsics, generic_assert, generic_assert_internals)]
diff --git a/src/test/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs b/src/test/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs
index 06c4993ec..1f5a29ab5 100644
--- a/src/test/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs
+++ b/src/test/ui/macros/rfc-2011-nicer-assert-messages/assert-without-captures-does-not-create-unnecessary-code.rs
@@ -1,6 +1,7 @@
// aux-build:common.rs
// only-x86_64
// run-pass
+// needs-unwind Asserting on contents of error message
#![feature(core_intrinsics, generic_assert, generic_assert_internals)]
diff --git a/src/test/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr b/src/test/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr
index 0188938a3..a6cff95fd 100644
--- a/src/test/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr
+++ b/src/test/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr
@@ -319,11 +319,11 @@ LL | unknown_metavar!(a);
|
= note: this error originates in the macro `unknown_metavar` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0425]: cannot find function `count` in this scope
- --> $DIR/syntax-errors.rs:29:30
+error[E0425]: cannot find value `i` in this scope
+ --> $DIR/syntax-errors.rs:29:36
|
LL | ( $( $i:ident ),* ) => { count(i) };
- | ^^^^^ not found in this scope
+ | ^ not found in this scope
...
LL | no_curly__no_rhs_dollar__round!(a, b, c);
| ---------------------------------------- in this macro invocation
@@ -331,10 +331,27 @@ LL | no_curly__no_rhs_dollar__round!(a, b, c);
= note: this error originates in the macro `no_curly__no_rhs_dollar__round` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `i` in this scope
- --> $DIR/syntax-errors.rs:29:36
+ --> $DIR/syntax-errors.rs:35:29
+ |
+LL | ( $i:ident ) => { count(i) };
+ | ^ not found in this scope
+...
+LL | no_curly__no_rhs_dollar__no_round!(a);
+ | ------------------------------------- in this macro invocation
+ |
+ = note: this error originates in the macro `no_curly__no_rhs_dollar__no_round` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0425]: cannot find value `a` in this scope
+ --> $DIR/syntax-errors.rs:153:37
+ |
+LL | no_curly__rhs_dollar__no_round!(a);
+ | ^ not found in this scope
+
+error[E0425]: cannot find function `count` in this scope
+ --> $DIR/syntax-errors.rs:29:30
|
LL | ( $( $i:ident ),* ) => { count(i) };
- | ^ not found in this scope
+ | ^^^^^ not found in this scope
...
LL | no_curly__no_rhs_dollar__round!(a, b, c);
| ---------------------------------------- in this macro invocation
@@ -352,17 +369,6 @@ LL | no_curly__no_rhs_dollar__no_round!(a);
|
= note: this error originates in the macro `no_curly__no_rhs_dollar__no_round` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0425]: cannot find value `i` in this scope
- --> $DIR/syntax-errors.rs:35:29
- |
-LL | ( $i:ident ) => { count(i) };
- | ^ not found in this scope
-...
-LL | no_curly__no_rhs_dollar__no_round!(a);
- | ------------------------------------- in this macro invocation
- |
- = note: this error originates in the macro `no_curly__no_rhs_dollar__no_round` (in Nightly builds, run with -Z macro-backtrace for more info)
-
error[E0425]: cannot find function `count` in this scope
--> $DIR/syntax-errors.rs:46:23
|
@@ -374,12 +380,6 @@ LL | no_curly__rhs_dollar__no_round!(a);
|
= note: this error originates in the macro `no_curly__rhs_dollar__no_round` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0425]: cannot find value `a` in this scope
- --> $DIR/syntax-errors.rs:153:37
- |
-LL | no_curly__rhs_dollar__no_round!(a);
- | ^ not found in this scope
-
error: aborting due to 40 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/macros/stringify.rs b/src/test/ui/macros/stringify.rs
index f246aa26a..bc0d44881 100644
--- a/src/test/ui/macros/stringify.rs
+++ b/src/test/ui/macros/stringify.rs
@@ -3,11 +3,16 @@
// compile-flags: --test
#![feature(async_closure)]
+#![feature(box_patterns)]
+#![feature(box_syntax)]
#![feature(const_trait_impl)]
+#![feature(decl_macro)]
#![feature(generators)]
-#![feature(half_open_range_patterns)]
#![feature(more_qualified_paths)]
#![feature(raw_ref_op)]
+#![feature(trait_alias)]
+#![feature(try_blocks)]
+#![feature(type_ascription)]
#![deny(unused_macros)]
macro_rules! stringify_block {
@@ -865,8 +870,9 @@ fn test_vis() {
assert_eq!(stringify_vis!(pub(crate)), "pub(crate) ");
assert_eq!(stringify_vis!(pub(self)), "pub(self) ");
assert_eq!(stringify_vis!(pub(super)), "pub(super) ");
- assert_eq!(stringify_vis!(pub(in self)), "pub(self) ");
- assert_eq!(stringify_vis!(pub(in super)), "pub(super) ");
+ assert_eq!(stringify_vis!(pub(in crate)), "pub(in crate) ");
+ assert_eq!(stringify_vis!(pub(in self)), "pub(in self) ");
+ assert_eq!(stringify_vis!(pub(in super)), "pub(in super) ");
assert_eq!(stringify_vis!(pub(in path::to)), "pub(in path::to) ");
assert_eq!(stringify_vis!(pub(in ::path::to)), "pub(in ::path::to) ");
assert_eq!(stringify_vis!(pub(in self::path::to)), "pub(in self::path::to) ");
diff --git a/src/test/ui/macros/syntax-error-recovery.rs b/src/test/ui/macros/syntax-error-recovery.rs
new file mode 100644
index 000000000..ae6de3c50
--- /dev/null
+++ b/src/test/ui/macros/syntax-error-recovery.rs
@@ -0,0 +1,18 @@
+macro_rules! values {
+ ($($token:ident($value:literal) $(as $inner:ty)? => $attr:meta,)*) => {
+ #[derive(Debug)]
+ pub enum TokenKind {
+ $(
+ #[$attr]
+ $token $($inner)? = $value,
+ )*
+ }
+ };
+}
+//~^^^^^ ERROR expected one of `(`, `,`, `=`, `{`, or `}`, found `(String)`
+//~| ERROR macro expansion ignores token `(String)` and any following
+
+values!(STRING(1) as (String) => cfg(test),);
+//~^ ERROR expected one of `!` or `::`, found `<eof>`
+
+fn main() {}
diff --git a/src/test/ui/macros/syntax-error-recovery.stderr b/src/test/ui/macros/syntax-error-recovery.stderr
new file mode 100644
index 000000000..c153b3b91
--- /dev/null
+++ b/src/test/ui/macros/syntax-error-recovery.stderr
@@ -0,0 +1,30 @@
+error: expected one of `(`, `,`, `=`, `{`, or `}`, found `(String)`
+ --> $DIR/syntax-error-recovery.rs:7:26
+ |
+LL | $token $($inner)? = $value,
+ | ^^^^^^ expected one of `(`, `,`, `=`, `{`, or `}`
+...
+LL | values!(STRING(1) as (String) => cfg(test),);
+ | -------------------------------------------- in this macro invocation
+ |
+ = note: this error originates in the macro `values` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: macro expansion ignores token `(String)` and any following
+ --> $DIR/syntax-error-recovery.rs:7:26
+ |
+LL | $token $($inner)? = $value,
+ | ^^^^^^
+...
+LL | values!(STRING(1) as (String) => cfg(test),);
+ | -------------------------------------------- caused by the macro expansion here
+ |
+ = note: the usage of `values!` is likely invalid in item context
+
+error: expected one of `!` or `::`, found `<eof>`
+ --> $DIR/syntax-error-recovery.rs:15:9
+ |
+LL | values!(STRING(1) as (String) => cfg(test),);
+ | ^^^^^^ expected one of `!` or `::`
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/malformed/malformed-regressions.stderr b/src/test/ui/malformed/malformed-regressions.stderr
index 13c12ff72..9bfbe7eba 100644
--- a/src/test/ui/malformed/malformed-regressions.stderr
+++ b/src/test/ui/malformed/malformed-regressions.stderr
@@ -4,9 +4,9 @@ error: attribute must be of the form `#[doc(hidden|inline|...)]` or `#[doc = "st
LL | #[doc]
| ^^^^^^
|
- = note: `#[deny(ill_formed_attribute_input)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
+ = note: `#[deny(ill_formed_attribute_input)]` on by default
error: attribute must be of the form `#[ignore]` or `#[ignore = "reason"]`
--> $DIR/malformed-regressions.rs:3:1
@@ -26,7 +26,7 @@ LL | #[inline = ""]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
-error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...")]`
+error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated")]`
--> $DIR/malformed-regressions.rs:7:1
|
LL | #[link]
@@ -35,7 +35,7 @@ LL | #[link]
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571>
-error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...")]`
+error: attribute must be of the form `#[link(name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...", /*opt*/ import_name_type = "decorated|noprefix|undecorated")]`
--> $DIR/malformed-regressions.rs:9:1
|
LL | #[link = ""]
diff --git a/src/test/ui/marker_trait_attr/overlap-doesnt-conflict-with-specialization.stderr b/src/test/ui/marker_trait_attr/overlap-doesnt-conflict-with-specialization.stderr
index fca986627..649e58915 100644
--- a/src/test/ui/marker_trait_attr/overlap-doesnt-conflict-with-specialization.stderr
+++ b/src/test/ui/marker_trait_attr/overlap-doesnt-conflict-with-specialization.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs b/src/test/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs
new file mode 100644
index 000000000..62aa22d41
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/overlap-marker-trait-with-static-lifetime.rs
@@ -0,0 +1,10 @@
+// check-pass
+#![feature(marker_trait_attr)]
+
+#[marker]
+trait Marker {}
+
+impl Marker for &'static () {}
+impl Marker for &'static () {}
+
+fn main() {}
diff --git a/src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.rs b/src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.rs
new file mode 100644
index 000000000..eabce1aef
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.rs
@@ -0,0 +1,9 @@
+#![feature(marker_trait_attr)]
+
+#[marker]
+trait Marker {}
+
+impl Marker for &'_ () {} //~ ERROR type annotations needed
+impl Marker for &'_ () {} //~ ERROR type annotations needed
+
+fn main() {}
diff --git a/src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.stderr b/src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.stderr
new file mode 100644
index 000000000..235c89e20
--- /dev/null
+++ b/src/test/ui/marker_trait_attr/overlap-marker-trait-with-underscore-lifetime.stderr
@@ -0,0 +1,31 @@
+error[E0283]: type annotations needed: cannot satisfy `&(): Marker`
+ --> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:6:6
+ |
+LL | impl Marker for &'_ () {}
+ | ^^^^^^
+ |
+note: multiple `impl`s satisfying `&(): Marker` found
+ --> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:6:1
+ |
+LL | impl Marker for &'_ () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+LL | impl Marker for &'_ () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0283]: type annotations needed: cannot satisfy `&(): Marker`
+ --> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:7:6
+ |
+LL | impl Marker for &'_ () {}
+ | ^^^^^^
+ |
+note: multiple `impl`s satisfying `&(): Marker` found
+ --> $DIR/overlap-marker-trait-with-underscore-lifetime.rs:6:1
+ |
+LL | impl Marker for &'_ () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+LL | impl Marker for &'_ () {}
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/marker_trait_attr/overlap-marker-trait.rs b/src/test/ui/marker_trait_attr/overlap-marker-trait.rs
index 8794d42f4..67e551797 100644
--- a/src/test/ui/marker_trait_attr/overlap-marker-trait.rs
+++ b/src/test/ui/marker_trait_attr/overlap-marker-trait.rs
@@ -7,7 +7,8 @@
use std::fmt::{Debug, Display};
-#[marker] trait Marker {}
+#[marker]
+trait Marker {}
impl<T: Debug> Marker for T {}
impl<T: Display> Marker for T {}
diff --git a/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr b/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr
index 1f3410597..133bc0484 100644
--- a/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr
+++ b/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `NotDebugOrDisplay: Marker` is not satisfied
- --> $DIR/overlap-marker-trait.rs:27:17
+ --> $DIR/overlap-marker-trait.rs:28:17
|
LL | is_marker::<NotDebugOrDisplay>();
| ^^^^^^^^^^^^^^^^^ the trait `Marker` is not implemented for `NotDebugOrDisplay`
|
note: required by a bound in `is_marker`
- --> $DIR/overlap-marker-trait.rs:15:17
+ --> $DIR/overlap-marker-trait.rs:16:17
|
LL | fn is_marker<T: Marker>() { }
| ^^^^^^ required by this bound in `is_marker`
diff --git a/src/test/ui/marker_trait_attr/overlap-permitted-for-annotated-marker-traits.rs b/src/test/ui/marker_trait_attr/overlap-permitted-for-annotated-marker-traits.rs
index 383313902..f7654458f 100644
--- a/src/test/ui/marker_trait_attr/overlap-permitted-for-annotated-marker-traits.rs
+++ b/src/test/ui/marker_trait_attr/overlap-permitted-for-annotated-marker-traits.rs
@@ -7,7 +7,8 @@
use std::fmt::{Debug, Display};
-#[marker] trait MyMarker {}
+#[marker]
+trait MyMarker {}
impl<T: Debug> MyMarker for T {}
impl<T: Display> MyMarker for T {}
diff --git a/src/test/ui/match/expr_before_ident_pat.rs b/src/test/ui/match/expr_before_ident_pat.rs
index 47db6c3f4..27ef3d05a 100644
--- a/src/test/ui/match/expr_before_ident_pat.rs
+++ b/src/test/ui/match/expr_before_ident_pat.rs
@@ -1,5 +1,3 @@
-#![feature(half_open_range_patterns)]
-
macro_rules! funny {
($a:expr, $b:ident) => {
match [1, 2] {
diff --git a/src/test/ui/match/expr_before_ident_pat.stderr b/src/test/ui/match/expr_before_ident_pat.stderr
index 2bd1b3b94..57a2d2b26 100644
--- a/src/test/ui/match/expr_before_ident_pat.stderr
+++ b/src/test/ui/match/expr_before_ident_pat.stderr
@@ -1,11 +1,11 @@
error[E0425]: cannot find value `a` in this scope
- --> $DIR/expr_before_ident_pat.rs:12:12
+ --> $DIR/expr_before_ident_pat.rs:10:12
|
LL | funny!(a, a);
| ^ not found in this scope
error: arbitrary expressions aren't allowed in patterns
- --> $DIR/expr_before_ident_pat.rs:12:12
+ --> $DIR/expr_before_ident_pat.rs:10:12
|
LL | funny!(a, a);
| ^
diff --git a/src/test/ui/match/issue-41255.rs b/src/test/ui/match/issue-41255.rs
index 9d7072f16..d163801fd 100644
--- a/src/test/ui/match/issue-41255.rs
+++ b/src/test/ui/match/issue-41255.rs
@@ -1,7 +1,6 @@
// Matching against float literals should result in a linter error
#![feature(exclusive_range_pattern)]
-#![feature(half_open_range_patterns)]
#![allow(unused)]
#![forbid(illegal_floating_point_literal_pattern)]
diff --git a/src/test/ui/match/issue-41255.stderr b/src/test/ui/match/issue-41255.stderr
index bf81c8d37..9bc49654e 100644
--- a/src/test/ui/match/issue-41255.stderr
+++ b/src/test/ui/match/issue-41255.stderr
@@ -1,19 +1,19 @@
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:11:9
+ --> $DIR/issue-41255.rs:10:9
|
LL | 5.0 => {},
| ^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
note: the lint level is defined here
- --> $DIR/issue-41255.rs:6:11
+ --> $DIR/issue-41255.rs:5:11
|
LL | #![forbid(illegal_floating_point_literal_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:13:9
+ --> $DIR/issue-41255.rs:12:9
|
LL | 5.0f32 => {},
| ^^^^^^
@@ -22,7 +22,7 @@ LL | 5.0f32 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:15:10
+ --> $DIR/issue-41255.rs:14:10
|
LL | -5.0 => {},
| ^^^
@@ -31,7 +31,7 @@ LL | -5.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:17:9
+ --> $DIR/issue-41255.rs:16:9
|
LL | 1.0 .. 33.0 => {},
| ^^^
@@ -40,7 +40,7 @@ LL | 1.0 .. 33.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:17:16
+ --> $DIR/issue-41255.rs:16:16
|
LL | 1.0 .. 33.0 => {},
| ^^^^
@@ -49,7 +49,7 @@ LL | 1.0 .. 33.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:21:9
+ --> $DIR/issue-41255.rs:20:9
|
LL | 39.0 ..= 70.0 => {},
| ^^^^
@@ -58,7 +58,7 @@ LL | 39.0 ..= 70.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:21:18
+ --> $DIR/issue-41255.rs:20:18
|
LL | 39.0 ..= 70.0 => {},
| ^^^^
@@ -67,7 +67,7 @@ LL | 39.0 ..= 70.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:26:11
+ --> $DIR/issue-41255.rs:25:11
|
LL | ..71.0 => {}
| ^^^^
@@ -76,7 +76,7 @@ LL | ..71.0 => {}
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:29:12
+ --> $DIR/issue-41255.rs:28:12
|
LL | ..=72.0 => {}
| ^^^^
@@ -85,7 +85,7 @@ LL | ..=72.0 => {}
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:32:9
+ --> $DIR/issue-41255.rs:31:9
|
LL | 71.0.. => {}
| ^^^^
@@ -94,7 +94,7 @@ LL | 71.0.. => {}
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:40:10
+ --> $DIR/issue-41255.rs:39:10
|
LL | (3.14, 1) => {},
| ^^^^
@@ -103,7 +103,7 @@ LL | (3.14, 1) => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
- --> $DIR/issue-41255.rs:47:18
+ --> $DIR/issue-41255.rs:46:18
|
LL | Foo { x: 2.0 } => {},
| ^^^
diff --git a/src/test/ui/match/issue-42679.rs b/src/test/ui/match/issue-42679.rs
index 596309f25..46a0bd35d 100644
--- a/src/test/ui/match/issue-42679.rs
+++ b/src/test/ui/match/issue-42679.rs
@@ -1,5 +1,4 @@
// run-pass
-#![feature(box_syntax)]
#![feature(box_patterns)]
#[derive(Debug, PartialEq)]
@@ -9,13 +8,13 @@ enum Test {
}
fn main() {
- let a = box Test::Foo(10);
- let b = box Test::Bar(-20);
+ let a = Box::new(Test::Foo(10));
+ let b = Box::new(Test::Bar(-20));
match (a, b) {
(_, box Test::Foo(_)) => unreachable!(),
(box Test::Foo(x), b) => {
assert_eq!(x, 10);
- assert_eq!(b, box Test::Bar(-20));
+ assert_eq!(b, Box::new(Test::Bar(-20)));
},
_ => unreachable!(),
}
diff --git a/src/test/ui/match/issue-92100.rs b/src/test/ui/match/issue-92100.rs
index 021166b2b..baac570dd 100644
--- a/src/test/ui/match/issue-92100.rs
+++ b/src/test/ui/match/issue-92100.rs
@@ -1,4 +1,4 @@
-#![feature(half_open_range_patterns)]
+#![feature(half_open_range_patterns_in_slices)]
fn main() {
match [1, 2] {
diff --git a/src/test/ui/match/match_non_exhaustive.rs b/src/test/ui/match/match_non_exhaustive.rs
index 8219f0eb1..f162dd60f 100644
--- a/src/test/ui/match/match_non_exhaustive.rs
+++ b/src/test/ui/match/match_non_exhaustive.rs
@@ -21,7 +21,7 @@ fn main() {
match l { L::A => (), L::B => () };
// (except if the match is already non-exhaustive)
match l { L::A => () };
- //~^ ERROR: non-exhaustive patterns: `B` not covered [E0004]
+ //~^ ERROR: non-exhaustive patterns: `L::B` not covered [E0004]
// E1 is not visibly uninhabited from here
let (e1, e2) = bar();
diff --git a/src/test/ui/match/match_non_exhaustive.stderr b/src/test/ui/match/match_non_exhaustive.stderr
index 9d92f8fdb..46ee8d517 100644
--- a/src/test/ui/match/match_non_exhaustive.stderr
+++ b/src/test/ui/match/match_non_exhaustive.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `B` not covered
+error[E0004]: non-exhaustive patterns: `L::B` not covered
--> $DIR/match_non_exhaustive.rs:23:11
|
LL | match l { L::A => () };
- | ^ pattern `B` not covered
+ | ^ pattern `L::B` not covered
|
note: `L` defined here
--> $DIR/match_non_exhaustive.rs:10:13
@@ -12,8 +12,8 @@ LL | enum L { A, B }
= note: the matched value is of type `L`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
|
-LL | match l { L::A => (), B => todo!() };
- | ++++++++++++++
+LL | match l { L::A => (), L::B => todo!() };
+ | +++++++++++++++++
error[E0004]: non-exhaustive patterns: type `E1` is non-empty
--> $DIR/match_non_exhaustive.rs:28:11
diff --git a/src/test/ui/methods/issues/issue-90315.rs b/src/test/ui/methods/issues/issue-90315.rs
index 01bf9f484..79cdc4195 100644
--- a/src/test/ui/methods/issues/issue-90315.rs
+++ b/src/test/ui/methods/issues/issue-90315.rs
@@ -1,7 +1,76 @@
+#![allow(unused)]
fn main() {
- let arr = &[0,1,2,3];
- for _i in 0..arr.len().rev() { //~ERROR not an iterator
- // The above error used to say “the method `rev` exists for type `usize`”.
- // This regression test ensures it doesn't say that any more.
- }
+ let arr = &[0, 1, 2, 3];
+ for _i in 0..arr.len().rev() {
+ //~^ ERROR can't call method
+ //~| surround the range in parentheses
+ // The above error used to say “the method `rev` exists for type `usize`”.
+ // This regression test ensures it doesn't say that any more.
+ }
+
+ // Test for #102396
+ for i in 1..11.rev() {
+ //~^ ERROR can't call method
+ //~| HELP surround the range in parentheses
+ }
+
+ let end: usize = 10;
+ for i in 1..end.rev() {
+ //~^ ERROR can't call method
+ //~| HELP surround the range in parentheses
+ }
+
+ for i in 1..(end + 1).rev() {
+ //~^ ERROR can't call method
+ //~| HELP surround the range in parentheses
+ }
+
+ if 1..(end + 1).is_empty() {
+ //~^ ERROR can't call method
+ //~| ERROR mismatched types [E0308]
+ //~| HELP surround the range in parentheses
+ }
+
+ if 1..(end + 1).is_sorted() {
+ //~^ ERROR mismatched types [E0308]
+ //~| ERROR can't call method
+ //~| HELP surround the range in parentheses
+ }
+
+ let _res: i32 = 3..6.take(2).sum();
+ //~^ ERROR can't call method
+ //~| ERROR mismatched types [E0308]
+ //~| HELP surround the range in parentheses
+
+ let _sum: i32 = 3..6.sum();
+ //~^ ERROR can't call method
+ //~| ERROR mismatched types [E0308]
+ //~| HELP surround the range in parentheses
+
+ let a = 1 as usize;
+ let b = 10 as usize;
+
+ for _a in a..=b.rev() {
+ //~^ ERROR can't call method
+ //~| HELP surround the range in parentheses
+ }
+
+ let _res = ..10.contains(3);
+ //~^ ERROR can't call method
+ //~| HELP surround the range in parentheses
+
+ if 1..end.error_method() {
+ //~^ ERROR no method named `error_method`
+ //~| ERROR mismatched types [E0308]
+ // Won't suggest
+ }
+
+ let _res = b.take(1)..a;
+ //~^ ERROR `usize` is not an iterator
+
+ let _res: i32 = ..6.take(2).sum();
+ //~^ can't call method `take` on ambiguous numeric type
+ //~| ERROR mismatched types [E0308]
+ //~| HELP you must specify a concrete type for this numeric value
+ // Won't suggest because `RangeTo` dest not implemented `take`
}
diff --git a/src/test/ui/methods/issues/issue-90315.stderr b/src/test/ui/methods/issues/issue-90315.stderr
index c6a76c9e7..070cd3054 100644
--- a/src/test/ui/methods/issues/issue-90315.stderr
+++ b/src/test/ui/methods/issues/issue-90315.stderr
@@ -1,13 +1,201 @@
+error[E0689]: can't call method `rev` on type `usize`
+ --> $DIR/issue-90315.rs:4:28
+ |
+LL | for _i in 0..arr.len().rev() {
+ | ^^^ can't call method `rev` on type `usize`
+ |
+help: you must surround the range in parentheses to call its `rev` function
+ |
+LL | for _i in (0..arr.len()).rev() {
+ | + +
+
+error[E0689]: can't call method `rev` on type `{integer}`
+ --> $DIR/issue-90315.rs:12:20
+ |
+LL | for i in 1..11.rev() {
+ | ^^^ can't call method `rev` on type `{integer}`
+ |
+help: you must surround the range in parentheses to call its `rev` function
+ |
+LL | for i in (1..11).rev() {
+ | + +
+
+error[E0689]: can't call method `rev` on type `usize`
+ --> $DIR/issue-90315.rs:18:21
+ |
+LL | for i in 1..end.rev() {
+ | ^^^ can't call method `rev` on type `usize`
+ |
+help: you must surround the range in parentheses to call its `rev` function
+ |
+LL | for i in (1..end).rev() {
+ | + +
+
+error[E0689]: can't call method `rev` on type `usize`
+ --> $DIR/issue-90315.rs:23:27
+ |
+LL | for i in 1..(end + 1).rev() {
+ | ^^^ can't call method `rev` on type `usize`
+ |
+help: you must surround the range in parentheses to call its `rev` function
+ |
+LL | for i in (1..(end + 1)).rev() {
+ | + +
+
+error[E0689]: can't call method `is_empty` on type `usize`
+ --> $DIR/issue-90315.rs:28:21
+ |
+LL | if 1..(end + 1).is_empty() {
+ | ^^^^^^^^ can't call method `is_empty` on type `usize`
+ |
+help: you must surround the range in parentheses to call its `is_empty` function
+ |
+LL | if (1..(end + 1)).is_empty() {
+ | + +
+
+error[E0308]: mismatched types
+ --> $DIR/issue-90315.rs:28:8
+ |
+LL | if 1..(end + 1).is_empty() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ |
+ = note: expected type `bool`
+ found struct `std::ops::Range<{integer}>`
+
+error[E0689]: can't call method `is_sorted` on type `usize`
+ --> $DIR/issue-90315.rs:34:21
+ |
+LL | if 1..(end + 1).is_sorted() {
+ | ^^^^^^^^^ can't call method `is_sorted` on type `usize`
+ |
+help: you must surround the range in parentheses to call its `is_sorted` function
+ |
+LL | if (1..(end + 1)).is_sorted() {
+ | + +
+
+error[E0308]: mismatched types
+ --> $DIR/issue-90315.rs:34:8
+ |
+LL | if 1..(end + 1).is_sorted() {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ |
+ = note: expected type `bool`
+ found struct `std::ops::Range<{integer}>`
+
+error[E0689]: can't call method `take` on type `{integer}`
+ --> $DIR/issue-90315.rs:40:26
+ |
+LL | let _res: i32 = 3..6.take(2).sum();
+ | ^^^^ can't call method `take` on type `{integer}`
+ |
+help: you must surround the range in parentheses to call its `take` function
+ |
+LL | let _res: i32 = (3..6).take(2).sum();
+ | + +
+
+error[E0308]: mismatched types
+ --> $DIR/issue-90315.rs:40:21
+ |
+LL | let _res: i32 = 3..6.take(2).sum();
+ | --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `std::ops::Range`
+ | |
+ | expected due to this
+ |
+ = note: expected type `i32`
+ found struct `std::ops::Range<{integer}>`
+
+error[E0689]: can't call method `sum` on type `{integer}`
+ --> $DIR/issue-90315.rs:45:26
+ |
+LL | let _sum: i32 = 3..6.sum();
+ | ^^^ can't call method `sum` on type `{integer}`
+ |
+help: you must surround the range in parentheses to call its `sum` function
+ |
+LL | let _sum: i32 = (3..6).sum();
+ | + +
+
+error[E0308]: mismatched types
+ --> $DIR/issue-90315.rs:45:21
+ |
+LL | let _sum: i32 = 3..6.sum();
+ | --- ^^^^^^^^^^ expected `i32`, found struct `std::ops::Range`
+ | |
+ | expected due to this
+ |
+ = note: expected type `i32`
+ found struct `std::ops::Range<{integer}>`
+
+error[E0689]: can't call method `rev` on type `usize`
+ --> $DIR/issue-90315.rs:53:21
+ |
+LL | for _a in a..=b.rev() {
+ | ^^^ can't call method `rev` on type `usize`
+ |
+help: you must surround the range in parentheses to call its `rev` function
+ |
+LL | for _a in (a..=b).rev() {
+ | + +
+
+error[E0689]: can't call method `contains` on type `{integer}`
+ --> $DIR/issue-90315.rs:58:21
+ |
+LL | let _res = ..10.contains(3);
+ | ^^^^^^^^ can't call method `contains` on type `{integer}`
+ |
+help: you must surround the range in parentheses to call its `contains` function
+ |
+LL | let _res = (..10).contains(3);
+ | + +
+
+error[E0599]: no method named `error_method` found for type `usize` in the current scope
+ --> $DIR/issue-90315.rs:62:15
+ |
+LL | if 1..end.error_method() {
+ | ^^^^^^^^^^^^ method not found in `usize`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-90315.rs:62:8
+ |
+LL | if 1..end.error_method() {
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
+ |
+ = note: expected type `bool`
+ found struct `std::ops::Range<{integer}>`
+
error[E0599]: `usize` is not an iterator
- --> $DIR/issue-90315.rs:3:26
+ --> $DIR/issue-90315.rs:68:18
|
-LL | for _i in 0..arr.len().rev() {
- | ^^^ `usize` is not an iterator
+LL | let _res = b.take(1)..a;
+ | ^^^^ `usize` is not an iterator
|
= note: the following trait bounds were not satisfied:
`usize: Iterator`
which is required by `&mut usize: Iterator`
-error: aborting due to previous error
+error[E0689]: can't call method `take` on ambiguous numeric type `{integer}`
+ --> $DIR/issue-90315.rs:71:25
+ |
+LL | let _res: i32 = ..6.take(2).sum();
+ | ^^^^
+ |
+help: you must specify a concrete type for this numeric value, like `i32`
+ |
+LL | let _res: i32 = ..6_i32.take(2).sum();
+ | ~~~~~
+
+error[E0308]: mismatched types
+ --> $DIR/issue-90315.rs:71:21
+ |
+LL | let _res: i32 = ..6.take(2).sum();
+ | --- ^^^^^^^^^^^^^^^^^ expected `i32`, found struct `RangeTo`
+ | |
+ | expected due to this
+ |
+ = note: expected type `i32`
+ found struct `RangeTo<_>`
+
+error: aborting due to 19 previous errors
-For more information about this error, try `rustc --explain E0599`.
+Some errors have detailed explanations: E0308, E0599, E0689.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr
index 690fe8fa7..a4ffb864d 100644
--- a/src/test/ui/methods/method-call-err-msg.stderr
+++ b/src/test/ui/methods/method-call-err-msg.stderr
@@ -8,11 +8,11 @@ note: associated function defined here
--> $DIR/method-call-err-msg.rs:5:8
|
LL | fn zero(self) -> Foo { self }
- | ^^^^ ----
+ | ^^^^
help: remove the extra argument
|
LL | x.zero()
- | ~~~~~~
+ | ~~
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/method-call-err-msg.rs:14:7
@@ -24,11 +24,11 @@ note: associated function defined here
--> $DIR/method-call-err-msg.rs:6:8
|
LL | fn one(self, _: isize) -> Foo { self }
- | ^^^ ---- --------
+ | ^^^ --------
help: provide the argument
|
LL | .one(/* isize */)
- | ~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/method-call-err-msg.rs:15:7
@@ -40,11 +40,11 @@ note: associated function defined here
--> $DIR/method-call-err-msg.rs:7:8
|
LL | fn two(self, _: isize, _: isize) -> Foo { self }
- | ^^^ ---- -------- --------
+ | ^^^ -------- --------
help: provide the argument
|
LL | .two(0, /* isize */);
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~
error[E0599]: `Foo` is not an iterator
--> $DIR/method-call-err-msg.rs:19:7
@@ -80,11 +80,11 @@ note: associated function defined here
--> $DIR/method-call-err-msg.rs:8:8
|
LL | fn three<T>(self, _: T, _: T, _: T) -> Foo { self }
- | ^^^^^ ---- ---- ---- ----
+ | ^^^^^ ---- ---- ----
help: provide the arguments
|
LL | y.three::<usize>(/* usize */, /* usize */, /* usize */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
diff --git a/src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr b/src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr
index 9e07d5ea3..394c1ac3c 100644
--- a/src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr
+++ b/src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr
@@ -7,13 +7,13 @@ LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {}
LL | S.late::<'static>(&0, &0);
| ^^^^^^^
|
+ = 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 #42868 <https://github.com/rust-lang/rust/issues/42868>
note: the lint level is defined here
--> $DIR/method-call-lifetime-args-lint-fail.rs:1:9
|
LL | #![deny(late_bound_lifetime_arguments)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #42868 <https://github.com/rust-lang/rust/issues/42868>
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-lint-fail.rs:26:14
diff --git a/src/test/ui/methods/method-call-lifetime-args-lint.stderr b/src/test/ui/methods/method-call-lifetime-args-lint.stderr
index f31f510a3..b4fc2d717 100644
--- a/src/test/ui/methods/method-call-lifetime-args-lint.stderr
+++ b/src/test/ui/methods/method-call-lifetime-args-lint.stderr
@@ -7,13 +7,13 @@ LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {}
LL | S.late::<'static>(&0, &0);
| ^^^^^^^
|
+ = 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 #42868 <https://github.com/rust-lang/rust/issues/42868>
note: the lint level is defined here
--> $DIR/method-call-lifetime-args-lint.rs:1:9
|
LL | #![deny(late_bound_lifetime_arguments)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #42868 <https://github.com/rust-lang/rust/issues/42868>
error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
--> $DIR/method-call-lifetime-args-lint.rs:16:23
diff --git a/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr b/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr
index 78af19586..62f20d6d5 100644
--- a/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr
+++ b/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr
@@ -17,9 +17,9 @@ LL | 0.clone::<'a>();
LL | fn clone(&self) -> Self;
| - the late bound lifetime parameter is introduced here
|
- = note: `#[warn(late_bound_lifetime_arguments)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868>
+ = note: `#[warn(late_bound_lifetime_arguments)]` on by default
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
index 59075397e..82addab94 100644
--- a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
+++ b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals, unsized_fn_params)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:87:24
diff --git a/src/test/ui/methods/method-macro-backtrace.stderr b/src/test/ui/methods/method-macro-backtrace.stderr
index 7ae00835c..dd616c4a5 100644
--- a/src/test/ui/methods/method-macro-backtrace.stderr
+++ b/src/test/ui/methods/method-macro-backtrace.stderr
@@ -1,11 +1,11 @@
-error[E0201]: duplicate definitions with name `bar`:
+error[E0592]: duplicate definitions with name `bar`
--> $DIR/method-macro-backtrace.rs:22:5
|
LL | fn bar(&self) { }
- | ------------- previous definition of `bar` here
+ | ------------- other definition for `bar`
LL | fn bar(&self) { }
- | ^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^ duplicate definitions for `bar`
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0201`.
+For more information about this error, try `rustc --explain E0592`.
diff --git a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
index 0af58bc61..917334116 100644
--- a/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
+++ b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr
@@ -18,7 +18,7 @@ LL | let x = y.neg();
help: you must specify a type for this binding, like `f32`
|
LL | let y: f32 = 2.0;
- | ~~~~~~
+ | +++++
error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
--> $DIR/method-on-ambiguous-numeric-type.rs:19:26
@@ -37,7 +37,7 @@ LL | local_bar.pow(2);
help: you must specify a type for this binding, like `i32`
|
LL | ($ident:ident) => { let $ident: i32 = 42; }
- | ~~~~~~~~~~~
+ | +++++
error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
--> $DIR/method-on-ambiguous-numeric-type.rs:30:9
@@ -46,10 +46,10 @@ LL | bar.pow(2);
| ^^^
|
help: you must specify a type for this binding, like `i32`
- --> $DIR/auxiliary/macro-in-other-crate.rs:3:29
+ --> $DIR/auxiliary/macro-in-other-crate.rs:3:35
|
LL | ($ident:ident) => { let $ident: i32 = 42; }
- | ~~~~~~~~~~~
+ | +++++
error: aborting due to 5 previous errors
diff --git a/src/test/ui/mir/drop-elaboration-after-borrowck-error.rs b/src/test/ui/mir/drop-elaboration-after-borrowck-error.rs
index fc7341a56..624b464ec 100644
--- a/src/test/ui/mir/drop-elaboration-after-borrowck-error.rs
+++ b/src/test/ui/mir/drop-elaboration-after-borrowck-error.rs
@@ -3,9 +3,9 @@
static A: () = {
let a: [String; 1];
- //~^ ERROR destructors cannot be evaluated at compile-time
+ //~^ ERROR destructor of
a[0] = String::new();
- //~^ ERROR destructors cannot be evaluated at compile-time
+ //~^ ERROR destructor of
//~| ERROR binding `a` isn't initialized
};
@@ -14,9 +14,9 @@ struct B<T>([T; 1]);
impl<T> B<T> {
pub const fn f(mut self, other: T) -> Self {
let _this = self;
- //~^ ERROR destructors cannot be evaluated at compile-time
+ //~^ ERROR destructor of
self.0[0] = other;
- //~^ ERROR destructors cannot be evaluated at compile-time
+ //~^ ERROR destructor of
//~| ERROR use of moved value
self
}
diff --git a/src/test/ui/mir/drop-elaboration-after-borrowck-error.stderr b/src/test/ui/mir/drop-elaboration-after-borrowck-error.stderr
index d8154f8d2..d96106172 100644
--- a/src/test/ui/mir/drop-elaboration-after-borrowck-error.stderr
+++ b/src/test/ui/mir/drop-elaboration-after-borrowck-error.stderr
@@ -1,17 +1,17 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `String` cannot be evaluated at compile-time
--> $DIR/drop-elaboration-after-borrowck-error.rs:7:5
|
LL | a[0] = String::new();
| ^^^^
| |
- | statics cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in statics
| value is dropped here
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `[String; 1]` cannot be evaluated at compile-time
--> $DIR/drop-elaboration-after-borrowck-error.rs:5:9
|
LL | let a: [String; 1];
- | ^ statics cannot evaluate destructors
+ | ^ the destructor for this type cannot be evaluated in statics
...
LL | };
| - value is dropped here
@@ -24,21 +24,26 @@ LL | let a: [String; 1];
LL |
LL | a[0] = String::new();
| ^^^^ `a` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let a: [String; 1] = todo!();
+ | +++++++++
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/drop-elaboration-after-borrowck-error.rs:18:9
|
LL | self.0[0] = other;
| ^^^^^^^^^
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
| value is dropped here
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `B<T>` cannot be evaluated at compile-time
--> $DIR/drop-elaboration-after-borrowck-error.rs:16:13
|
LL | let _this = self;
- | ^^^^^ constant functions cannot evaluate destructors
+ | ^^^^^ the destructor for this type cannot be evaluated in constant functions
...
LL | }
| - value is dropped here
diff --git a/src/test/ui/mir/issue-100476-recursion-check-blewup.rs b/src/test/ui/mir/issue-100476-recursion-check-blewup.rs
deleted file mode 100644
index bc2f32f4c..000000000
--- a/src/test/ui/mir/issue-100476-recursion-check-blewup.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-// check-pass
-
-// compile-flags: --emit=mir,link -O
-
-// At one point the MIR inlining, when guarding against infinitely (or even just
-// excessive) recursion, was using `ty::Instance` as the basis for its history
-// check. The problem is that when you have polymorphic recursion, you can have
-// distinct instances of the same code (because you're inlining the same code
-// with differing substitutions), causing the amount of inlining to blow up
-// exponentially.
-//
-// This test illustrates an example of that filed in issue rust#100476.
-
-#![allow(unconditional_recursion)]
-#![feature(decl_macro)]
-
-macro emit($($m:ident)*) {$(
- // Randomize `def_path_hash` by defining them under a module with
- // different names
- pub mod $m {
- pub trait Tr {
- type Next: Tr;
- }
-
- pub fn hoge<const N: usize, T: Tr>() {
- inner::<N, T>();
- }
-
- #[inline(always)]
- fn inner<const N: usize, T: Tr>() {
- inner::<N, T::Next>();
- }
- }
-)*}
-
-// Increase the chance of triggering the bug
-emit!(
- m00 m01 m02 m03 m04 m05 m06 m07 m08 m09
- m10 m11 m12 m13 m14 m15 m16 m17 m18 m19
-);
-
-fn main() { }
diff --git a/src/test/ui/mir/issue-101844.rs b/src/test/ui/mir/issue-101844.rs
new file mode 100644
index 000000000..da8a25f5f
--- /dev/null
+++ b/src/test/ui/mir/issue-101844.rs
@@ -0,0 +1,73 @@
+// check-pass
+
+pub trait FirstTrait {
+ type Item;
+ type Extra: Extra<(), Error = Self::Item>;
+}
+
+trait SecondTrait {
+ type Item2;
+}
+
+trait ThirdTrait: SecondTrait {
+ type Item3;
+}
+
+trait FourthTrait {
+ type Item4;
+}
+
+impl<First> SecondTrait for First
+where
+ First: FirstTrait,
+{
+ type Item2 = First::Extra;
+}
+
+impl<Second, T> ThirdTrait for Second
+where
+ Second: SecondTrait<Item2 = T>,
+{
+ type Item3 = T;
+}
+
+impl<S, Third: ?Sized> FourthTrait for Third
+where
+ Third: ThirdTrait<Item3 = S>,
+{
+ type Item4 = S;
+}
+
+pub trait Extra<Request> {
+ type Error;
+}
+
+struct ImplShoulExist<D, Req> {
+ _gen: (D, Req),
+}
+
+impl<D, Req> ImplShoulExist<D, Req>
+where
+ D: FourthTrait,
+ D::Item4: Extra<Req>,
+ <D::Item4 as Extra<Req>>::Error: Into<()>,
+{
+ fn access_fn(_: D) {
+ todo!()
+ }
+}
+
+impl<D, Req> Extra<Req> for ImplShoulExist<D, Req> {
+ type Error = ();
+}
+
+pub fn broken<MS>(ms: MS)
+where
+ MS: FirstTrait,
+ MS::Item: Into<()>,
+{
+ // Error: Apparently Balance::new doesn't exist during MIR validation
+ let _ = ImplShoulExist::<MS, ()>::access_fn(ms);
+}
+
+fn main() {}
diff --git a/src/test/ui/mir/issue-102389.rs b/src/test/ui/mir/issue-102389.rs
new file mode 100644
index 000000000..8b27d5e55
--- /dev/null
+++ b/src/test/ui/mir/issue-102389.rs
@@ -0,0 +1,8 @@
+enum Enum { A, B, C }
+
+fn func(inbounds: &Enum, array: &[i16; 3]) -> i16 {
+ array[*inbounds as usize]
+ //~^ ERROR [E0507]
+}
+
+fn main() {}
diff --git a/src/test/ui/mir/issue-102389.stderr b/src/test/ui/mir/issue-102389.stderr
new file mode 100644
index 000000000..925dc258a
--- /dev/null
+++ b/src/test/ui/mir/issue-102389.stderr
@@ -0,0 +1,9 @@
+error[E0507]: cannot move out of `*inbounds` which is behind a shared reference
+ --> $DIR/issue-102389.rs:4:11
+ |
+LL | array[*inbounds as usize]
+ | ^^^^^^^^^ move occurs because `*inbounds` has type `Enum`, which does not implement the `Copy` trait
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0507`.
diff --git a/src/test/ui/mir/issue-99852.rs b/src/test/ui/mir/issue-99852.rs
new file mode 100644
index 000000000..1c675788e
--- /dev/null
+++ b/src/test/ui/mir/issue-99852.rs
@@ -0,0 +1,24 @@
+// check-pass
+// compile-flags: -Z validate-mir
+#![feature(let_chains)]
+
+fn lambda<T, U>() -> U
+where
+ T: Default,
+ U: Default,
+{
+ let foo: Result<T, ()> = Ok(T::default());
+ let baz: U = U::default();
+
+ if let Ok(foo) = foo && let Ok(bar) = transform(foo) {
+ bar
+ } else {
+ baz
+ }
+}
+
+fn transform<T, U>(input: T) -> Result<U, ()> {
+ todo!()
+}
+
+fn main() {}
diff --git a/src/test/ui/mir/issue-99866.rs b/src/test/ui/mir/issue-99866.rs
new file mode 100644
index 000000000..d39ae6ebf
--- /dev/null
+++ b/src/test/ui/mir/issue-99866.rs
@@ -0,0 +1,25 @@
+// check-pass
+pub trait Backend {
+ type DescriptorSetLayout;
+}
+
+pub struct Back;
+
+impl Backend for Back {
+ type DescriptorSetLayout = u32;
+}
+
+pub struct HalSetLayouts {
+ vertex_layout: <Back as Backend>::DescriptorSetLayout,
+}
+
+impl HalSetLayouts {
+ pub fn iter<DSL>(self) -> DSL
+ where
+ Back: Backend<DescriptorSetLayout = DSL>,
+ {
+ self.vertex_layout
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs b/src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs
new file mode 100644
index 000000000..f67b07354
--- /dev/null
+++ b/src/test/ui/mir/mir-inlining/ice-issue-100550-unnormalized-projection.rs
@@ -0,0 +1,30 @@
+// This test verifies that we do not ICE due to MIR inlining in case of normalization failure
+// in a projection.
+//
+// compile-flags: --crate-type lib -C opt-level=3
+// build-pass
+
+pub trait Trait {
+ type Associated;
+}
+impl<T> Trait for T {
+ type Associated = T;
+}
+
+pub struct Struct<T>(<T as Trait>::Associated);
+
+pub fn foo<T>() -> Struct<T>
+where
+ T: Trait,
+{
+ bar()
+}
+
+#[inline]
+fn bar<T>() -> Struct<T> {
+ Struct(baz())
+}
+
+fn baz<T>() -> T {
+ unimplemented!()
+}
diff --git a/src/test/ui/mir/mir_calls_to_shims.rs b/src/test/ui/mir/mir_calls_to_shims.rs
index 42eaab77d..9dc0acfbf 100644
--- a/src/test/ui/mir/mir_calls_to_shims.rs
+++ b/src/test/ui/mir/mir_calls_to_shims.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(fn_traits)]
#![feature(never_type)]
diff --git a/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs
index 796d74477..19dba4970 100644
--- a/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs
+++ b/src/test/ui/mir/mir_codegen_calls_diverging_drops.rs
@@ -1,7 +1,7 @@
// run-fail
// error-pattern:diverging_fn called
// error-pattern:0 dropped
-// ignore-emscripten no processes
+// needs-unwind this test checks that a destructor is called after panicking
struct Droppable(u8);
impl Drop for Droppable {
diff --git a/src/test/ui/mir/mir_drop_order.rs b/src/test/ui/mir/mir_drop_order.rs
index 853efb0fe..75f5b171a 100644
--- a/src/test/ui/mir/mir_drop_order.rs
+++ b/src/test/ui/mir/mir_drop_order.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
use std::cell::RefCell;
use std::panic;
diff --git a/src/test/ui/mir/mir_drop_panics.rs b/src/test/ui/mir/mir_drop_panics.rs
index b4093d704..0d00426d6 100644
--- a/src/test/ui/mir/mir_drop_panics.rs
+++ b/src/test/ui/mir/mir_drop_panics.rs
@@ -2,7 +2,6 @@
// needs-unwind
// error-pattern:panic 1
// error-pattern:drop 2
-// ignore-emscripten no processes
struct Droppable(u32);
impl Drop for Droppable {
diff --git a/src/test/ui/mir/mir_let_chains_drop_order.rs b/src/test/ui/mir/mir_let_chains_drop_order.rs
index 6498a5195..6471553e9 100644
--- a/src/test/ui/mir/mir_let_chains_drop_order.rs
+++ b/src/test/ui/mir/mir_let_chains_drop_order.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// See `mir_drop_order.rs` for more information
@@ -13,7 +12,7 @@ use std::panic;
pub struct DropLogger<'a, T> {
extra: T,
id: usize,
- log: &'a panic::AssertUnwindSafe<RefCell<Vec<usize>>>
+ log: &'a panic::AssertUnwindSafe<RefCell<Vec<usize>>>,
}
impl<'a, T> Drop for DropLogger<'a, T> {
@@ -56,9 +55,9 @@ fn main() {
else {
// 10 is not constructed
d(10, None)
- }
+ },
);
- assert_eq!(get(), vec![3, 8, 7, 1, 2]);
+ assert_eq!(get(), vec![8, 7, 1, 3, 2]);
}
assert_eq!(get(), vec![0, 4, 6, 9, 5]);
@@ -90,5 +89,5 @@ fn main() {
panic::panic_any(InjectedFailure)
);
});
- assert_eq!(get(), vec![14, 19, 20, 17, 15, 11, 18, 16, 12, 13]);
+ assert_eq!(get(), vec![20, 17, 15, 11, 19, 18, 16, 12, 14, 13]);
}
diff --git a/src/test/ui/mir/thir-constparam-temp.stderr b/src/test/ui/mir/thir-constparam-temp.stderr
index ed2766c00..b77d67e08 100644
--- a/src/test/ui/mir/thir-constparam-temp.stderr
+++ b/src/test/ui/mir/thir-constparam-temp.stderr
@@ -4,7 +4,6 @@ warning: taking a mutable reference to a `const` item
LL | YIKES.mut_self()
| ^^^^^^^^^^^^^^^^
|
- = note: `#[warn(const_item_mutation)]` on by default
= note: each usage of a `const` item creates a new temporary
= note: the mutable reference will refer to this temporary, not the original `const` item
note: mutable reference created due to call to this method
@@ -17,6 +16,7 @@ note: `const` item defined here
|
LL | fn foo<const YIKES: Yikes>() {
| ^^^^^^^^^^^^^^^^^^
+ = note: `#[warn(const_item_mutation)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/mismatched_types/E0409.stderr b/src/test/ui/mismatched_types/E0409.stderr
index ef03b67b1..7fec6ecd7 100644
--- a/src/test/ui/mismatched_types/E0409.stderr
+++ b/src/test/ui/mismatched_types/E0409.stderr
@@ -17,6 +17,10 @@ LL | (0, ref y) | (y, 0) => {}
| first introduced with type `&{integer}` here
|
= note: in the same arm, a binding must have the same type in all alternatives
+help: consider adding `ref`
+ |
+LL | (0, ref y) | (ref y, 0) => {}
+ | +++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/mismatched_types/E0631.rs b/src/test/ui/mismatched_types/E0631.rs
index a29394658..83dbdb77a 100644
--- a/src/test/ui/mismatched_types/E0631.rs
+++ b/src/test/ui/mismatched_types/E0631.rs
@@ -1,7 +1,7 @@
#![feature(unboxed_closures)]
fn foo<F: Fn(usize)>(_: F) {}
-fn bar<F: Fn<usize>>(_: F) {}
+fn bar<F: Fn<(usize,)>>(_: F) {}
fn main() {
fn f(_: u64) {}
foo(|_: isize| {}); //~ ERROR type mismatch
diff --git a/src/test/ui/mismatched_types/E0631.stderr b/src/test/ui/mismatched_types/E0631.stderr
index 4d673d455..410ea4b0b 100644
--- a/src/test/ui/mismatched_types/E0631.stderr
+++ b/src/test/ui/mismatched_types/E0631.stderr
@@ -27,8 +27,8 @@ LL | bar(|_: isize| {});
note: required by a bound in `bar`
--> $DIR/E0631.rs:4:11
|
-LL | fn bar<F: Fn<usize>>(_: F) {}
- | ^^^^^^^^^ required by this bound in `bar`
+LL | fn bar<F: Fn<(usize,)>>(_: F) {}
+ | ^^^^^^^^^^^^ required by this bound in `bar`
error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:9:9
@@ -65,8 +65,8 @@ LL | bar(f);
note: required by a bound in `bar`
--> $DIR/E0631.rs:4:11
|
-LL | fn bar<F: Fn<usize>>(_: F) {}
- | ^^^^^^^^^ required by this bound in `bar`
+LL | fn bar<F: Fn<(usize,)>>(_: F) {}
+ | ^^^^^^^^^^^^ required by this bound in `bar`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/mismatched_types/closure-arg-count.rs b/src/test/ui/mismatched_types/closure-arg-count.rs
index e817631ad..65c8d6a7e 100644
--- a/src/test/ui/mismatched_types/closure-arg-count.rs
+++ b/src/test/ui/mismatched_types/closure-arg-count.rs
@@ -1,6 +1,6 @@
#![feature(unboxed_closures)]
-fn f<F: Fn<usize>>(_: F) {}
+fn f<F: Fn<(usize,)>>(_: F) {}
fn main() {
[1, 2, 3].sort_by(|| panic!());
//~^ ERROR closure is expected to take
diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr
index 3968774e3..a02ec8198 100644
--- a/src/test/ui/mismatched_types/closure-arg-count.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-count.stderr
@@ -56,8 +56,8 @@ LL | f(|| panic!());
note: required by a bound in `f`
--> $DIR/closure-arg-count.rs:3:9
|
-LL | fn f<F: Fn<usize>>(_: F) {}
- | ^^^^^^^^^ required by this bound in `f`
+LL | fn f<F: Fn<(usize,)>>(_: F) {}
+ | ^^^^^^^^^^^^ required by this bound in `f`
help: consider changing the closure to take and ignore the expected argument
|
LL | f(|_| panic!());
@@ -74,8 +74,8 @@ LL | f( move || panic!());
note: required by a bound in `f`
--> $DIR/closure-arg-count.rs:3:9
|
-LL | fn f<F: Fn<usize>>(_: F) {}
- | ^^^^^^^^^ required by this bound in `f`
+LL | fn f<F: Fn<(usize,)>>(_: F) {}
+ | ^^^^^^^^^^^^ required by this bound in `f`
help: consider changing the closure to take and ignore the expected argument
|
LL | f( move |_| panic!());
diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
index 71469bfec..92d545b73 100644
--- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
+++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
@@ -23,7 +23,7 @@ LL | a.iter().map(|_: &(u16, u16)| 45);
| expected due to this
|
= note: expected closure signature `fn(&(u32, u32)) -> _`
- found closure signature `for<'r> fn(&'r (u16, u16)) -> _`
+ found closure signature `for<'a> fn(&'a (u16, u16)) -> _`
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
diff --git a/src/test/ui/mismatched_types/closure-mismatch.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr
index ef76ec63f..a7ef8fa08 100644
--- a/src/test/ui/mismatched_types/closure-mismatch.stderr
+++ b/src/test/ui/mismatched_types/closure-mismatch.stderr
@@ -13,7 +13,7 @@ error[E0308]: mismatched types
LL | baz(|_| ());
| ^^^^^^^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r> Fn<(&'r (),)>`
+ = note: expected trait `for<'a> Fn<(&'a (),)>`
found trait `Fn<(&(),)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/closure-mismatch.rs:8:9
diff --git a/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs b/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs
new file mode 100644
index 000000000..d302dc99b
--- /dev/null
+++ b/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs
@@ -0,0 +1,23 @@
+struct S;
+struct Y;
+
+trait Trait {}
+
+impl Trait for Y {}
+
+fn foo() -> impl Trait {
+ if true {
+ S
+ } else {
+ Y //~ ERROR `if` and `else` have incompatible types
+ }
+}
+
+fn bar() -> impl Trait {
+ match true {
+ true => S,
+ false => Y, //~ ERROR `match` arms have incompatible types
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr b/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr
new file mode 100644
index 000000000..2f814445b
--- /dev/null
+++ b/src/test/ui/mismatched_types/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.stderr
@@ -0,0 +1,26 @@
+error[E0308]: `if` and `else` have incompatible types
+ --> $DIR/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs:12:9
+ |
+LL | / if true {
+LL | | S
+ | | - expected because of this
+LL | | } else {
+LL | | Y
+ | | ^ expected struct `S`, found struct `Y`
+LL | | }
+ | |_____- `if` and `else` have incompatible types
+
+error[E0308]: `match` arms have incompatible types
+ --> $DIR/do-not-suggest-boxed-trait-objects-instead-of-impl-trait.rs:19:18
+ |
+LL | / match true {
+LL | | true => S,
+ | | - this is found to be of type `S`
+LL | | false => Y,
+ | | ^ expected struct `S`, found struct `Y`
+LL | | }
+ | |_____- `match` arms have incompatible types
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/dont-point-return-on-E0308.rs b/src/test/ui/mismatched_types/dont-point-return-on-E0308.rs
new file mode 100644
index 000000000..f2ba610e2
--- /dev/null
+++ b/src/test/ui/mismatched_types/dont-point-return-on-E0308.rs
@@ -0,0 +1,18 @@
+// edition:2021
+
+async fn f(_: &()) {}
+//~^ NOTE function defined here
+//~| NOTE
+// Second note is the span of the underlined argument, I think...
+
+fn main() {
+ (|| async {
+ Err::<(), ()>(())?;
+ f(());
+ //~^ ERROR mismatched types
+ //~| NOTE arguments to this function are incorrect
+ //~| NOTE expected `&()`, found `()`
+ //~| HELP consider borrowing here
+ Ok::<(), ()>(())
+ })();
+}
diff --git a/src/test/ui/mismatched_types/dont-point-return-on-E0308.stderr b/src/test/ui/mismatched_types/dont-point-return-on-E0308.stderr
new file mode 100644
index 000000000..13942682d
--- /dev/null
+++ b/src/test/ui/mismatched_types/dont-point-return-on-E0308.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+ --> $DIR/dont-point-return-on-E0308.rs:11:11
+ |
+LL | f(());
+ | - ^^
+ | | |
+ | | expected `&()`, found `()`
+ | | help: consider borrowing here: `&()`
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/dont-point-return-on-E0308.rs:3:10
+ |
+LL | async fn f(_: &()) {}
+ | ^ ------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/fn-variance-1.stderr b/src/test/ui/mismatched_types/fn-variance-1.stderr
index eec6d83fe..5794e606e 100644
--- a/src/test/ui/mismatched_types/fn-variance-1.stderr
+++ b/src/test/ui/mismatched_types/fn-variance-1.stderr
@@ -10,7 +10,7 @@ LL | apply(&3, takes_mut);
| required by a bound introduced by this call
|
= note: expected function signature `fn(&{integer}) -> _`
- found function signature `for<'r> fn(&'r mut isize) -> _`
+ found function signature `for<'a> fn(&'a mut isize) -> _`
note: required by a bound in `apply`
--> $DIR/fn-variance-1.rs:5:37
|
@@ -29,7 +29,7 @@ LL | apply(&mut 3, takes_imm);
| required by a bound introduced by this call
|
= note: expected function signature `fn(&mut {integer}) -> _`
- found function signature `for<'r> fn(&'r isize) -> _`
+ found function signature `for<'a> fn(&'a isize) -> _`
note: required by a bound in `apply`
--> $DIR/fn-variance-1.rs:5:37
|
diff --git a/src/test/ui/mismatched_types/issue-19109.stderr b/src/test/ui/mismatched_types/issue-19109.stderr
index c25e2687b..5cef64bb1 100644
--- a/src/test/ui/mismatched_types/issue-19109.stderr
+++ b/src/test/ui/mismatched_types/issue-19109.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | fn function(t: &mut dyn Trait) {
| - help: try adding a return type: `-> *mut dyn Trait`
LL | t as *mut dyn Trait
- | ^^^^^^^^^^^^^^^^^^^ expected `()`, found *-ptr
+ | ^^^^^^^^^^^^^^^^^^^ expected `()`, found `*mut dyn Trait`
|
= note: expected unit type `()`
found raw pointer `*mut dyn Trait`
diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr
index b11ea97d1..906001ca1 100644
--- a/src/test/ui/mismatched_types/issue-36053-2.stderr
+++ b/src/test/ui/mismatched_types/issue-36053-2.stderr
@@ -6,8 +6,8 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
| |
| expected due to this
|
- = note: expected closure signature `for<'r> fn(&'r &str) -> _`
- found closure signature `for<'r> fn(&'r str) -> _`
+ = note: expected closure signature `for<'a> fn(&'a &str) -> _`
+ found closure signature `for<'a> fn(&'a str) -> _`
note: required by a bound in `filter`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
diff --git a/src/test/ui/mismatched_types/issue-84976.stderr b/src/test/ui/mismatched_types/issue-84976.stderr
index f8f2b1f0f..9157566e3 100644
--- a/src/test/ui/mismatched_types/issue-84976.stderr
+++ b/src/test/ui/mismatched_types/issue-84976.stderr
@@ -3,6 +3,11 @@ error[E0308]: mismatched types
|
LL | length = { foo(&length) };
| ^^^^^^^^^^^^ expected `u32`, found `i32`
+ |
+help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
+ |
+LL | length = { foo(&length).try_into().unwrap() };
+ | ++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/issue-84976.rs:17:14
diff --git a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr
index c2515c40b..36748fae1 100644
--- a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr
+++ b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr
@@ -1,8 +1,10 @@
error[E0277]: `Foo` doesn't implement `Debug`
- --> $DIR/method-help-unsatisfied-bound.rs:5:7
+ --> $DIR/method-help-unsatisfied-bound.rs:5:5
|
LL | a.unwrap();
- | ^^^^^^ `Foo` cannot be formatted using `{:?}`
+ | ^ ------ required by a bound introduced by this call
+ | |
+ | `Foo` cannot be formatted using `{:?}`
|
= help: the trait `Debug` is not implemented for `Foo`
= note: add `#[derive(Debug)]` to `Foo` or manually `impl Debug for Foo`
diff --git a/src/test/ui/mismatched_types/normalize-fn-sig.rs b/src/test/ui/mismatched_types/normalize-fn-sig.rs
new file mode 100644
index 000000000..1a2093c44
--- /dev/null
+++ b/src/test/ui/mismatched_types/normalize-fn-sig.rs
@@ -0,0 +1,16 @@
+trait Foo {
+ type Bar;
+}
+
+impl<T> Foo for T {
+ type Bar = i32;
+}
+
+fn foo<T>(_: <T as Foo>::Bar, _: &'static <T as Foo>::Bar) {}
+
+fn needs_i32_ref_fn(_: fn(&'static i32, i32)) {}
+
+fn main() {
+ needs_i32_ref_fn(foo::<()>);
+ //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/mismatched_types/normalize-fn-sig.stderr b/src/test/ui/mismatched_types/normalize-fn-sig.stderr
new file mode 100644
index 000000000..6c55f29c5
--- /dev/null
+++ b/src/test/ui/mismatched_types/normalize-fn-sig.stderr
@@ -0,0 +1,19 @@
+error[E0308]: mismatched types
+ --> $DIR/normalize-fn-sig.rs:14:22
+ |
+LL | needs_i32_ref_fn(foo::<()>);
+ | ---------------- ^^^^^^^^^ expected `&i32`, found `i32`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected fn pointer `fn(&'static i32, i32)`
+ found fn item `fn(i32, &'static i32) {foo::<()>}`
+note: function defined here
+ --> $DIR/normalize-fn-sig.rs:11:4
+ |
+LL | fn needs_i32_ref_fn(_: fn(&'static i32, i32)) {}
+ | ^^^^^^^^^^^^^^^^ ------------------------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr
index 475ea9dfa..fb3597aa8 100644
--- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr
+++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr
@@ -26,7 +26,7 @@ LL | impl FnMut<(isize,)> for S {
help: provide the argument
|
LL | let ans = s(/* isize */);
- | ~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error[E0057]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/overloaded-calls-bad.rs:31:15
@@ -44,7 +44,7 @@ LL | impl FnMut<(isize,)> for S {
help: remove the extra argument
|
LL | let ans = s(/* isize */);
- | ~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/mismatched_types/show_module.rs b/src/test/ui/mismatched_types/show_module.rs
new file mode 100644
index 000000000..61550b887
--- /dev/null
+++ b/src/test/ui/mismatched_types/show_module.rs
@@ -0,0 +1,18 @@
+pub mod blah {
+ pub mod baz {
+ pub struct Foo;
+ }
+}
+
+pub mod meh {
+ pub struct Foo;
+}
+
+pub type Foo = blah::baz::Foo;
+
+fn foo() -> Foo {
+ meh::Foo
+ //~^ ERROR mismatched types [E0308]
+}
+
+fn main() {}
diff --git a/src/test/ui/mismatched_types/show_module.stderr b/src/test/ui/mismatched_types/show_module.stderr
new file mode 100644
index 000000000..5e48e0955
--- /dev/null
+++ b/src/test/ui/mismatched_types/show_module.stderr
@@ -0,0 +1,23 @@
+error[E0308]: mismatched types
+ --> $DIR/show_module.rs:14:5
+ |
+LL | fn foo() -> Foo {
+ | --- expected `baz::Foo` because of return type
+LL | meh::Foo
+ | ^^^^^^^^ expected struct `baz::Foo`, found struct `meh::Foo`
+ |
+ = note: struct `meh::Foo` and struct `baz::Foo` have similar names, but are actually distinct types
+note: struct `meh::Foo` is defined in module `crate::meh` of the current crate
+ --> $DIR/show_module.rs:8:5
+ |
+LL | pub struct Foo;
+ | ^^^^^^^^^^^^^^
+note: struct `baz::Foo` is defined in module `crate::blah::baz` of the current crate
+ --> $DIR/show_module.rs:3:9
+ |
+LL | pub struct Foo;
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/similar_paths.rs b/src/test/ui/mismatched_types/similar_paths.rs
new file mode 100644
index 000000000..4b9157f39
--- /dev/null
+++ b/src/test/ui/mismatched_types/similar_paths.rs
@@ -0,0 +1,11 @@
+enum Option<T> {
+ Some(T),
+ None,
+}
+
+pub fn foo() -> Option<u8> {
+ Some(42_u8)
+ //~^ ERROR mismatched types [E0308]
+}
+
+fn main() {}
diff --git a/src/test/ui/mismatched_types/similar_paths.stderr b/src/test/ui/mismatched_types/similar_paths.stderr
new file mode 100644
index 000000000..e65ae58d4
--- /dev/null
+++ b/src/test/ui/mismatched_types/similar_paths.stderr
@@ -0,0 +1,23 @@
+error[E0308]: mismatched types
+ --> $DIR/similar_paths.rs:7:5
+ |
+LL | pub fn foo() -> Option<u8> {
+ | ---------- expected `Option<u8>` because of return type
+LL | Some(42_u8)
+ | ^^^^^^^^^^^ expected enum `Option`, found enum `std::option::Option`
+ |
+ = note: enum `std::option::Option` and enum `Option` have similar names, but are actually distinct types
+note: enum `std::option::Option` is defined in crate `core`
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub enum Option<T> {
+ | ^^^^^^^^^^^^^^^^^^
+note: enum `Option` is defined in the current crate
+ --> $DIR/similar_paths.rs:1:1
+ |
+LL | enum Option<T> {
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/similar_paths_primitive.rs b/src/test/ui/mismatched_types/similar_paths_primitive.rs
new file mode 100644
index 000000000..8f5b7cce4
--- /dev/null
+++ b/src/test/ui/mismatched_types/similar_paths_primitive.rs
@@ -0,0 +1,10 @@
+#![allow(non_camel_case_types)]
+
+struct bool;
+
+fn foo(_: bool) {}
+
+fn main() {
+ foo(true);
+ //~^ ERROR mismatched types [E0308]
+}
diff --git a/src/test/ui/mismatched_types/similar_paths_primitive.stderr b/src/test/ui/mismatched_types/similar_paths_primitive.stderr
new file mode 100644
index 000000000..8a2f73945
--- /dev/null
+++ b/src/test/ui/mismatched_types/similar_paths_primitive.stderr
@@ -0,0 +1,24 @@
+error[E0308]: mismatched types
+ --> $DIR/similar_paths_primitive.rs:8:9
+ |
+LL | foo(true);
+ | --- ^^^^ expected struct `bool`, found `bool`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: bool and struct `bool` have similar names, but are actually distinct types
+ = note: bool is a primitive defined by the language
+note: struct `bool` is defined in the current crate
+ --> $DIR/similar_paths_primitive.rs:3:1
+ |
+LL | struct bool;
+ | ^^^^^^^^^^^
+note: function defined here
+ --> $DIR/similar_paths_primitive.rs:5:4
+ |
+LL | fn foo(_: bool) {}
+ | ^^^ -------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.fixed b/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.fixed
new file mode 100644
index 000000000..56f93cfbf
--- /dev/null
+++ b/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.fixed
@@ -0,0 +1,21 @@
+// run-rustfix
+#![allow(dead_code, unused_variables)]
+
+fn main() {
+ enum Blah {
+ A(isize, isize, usize),
+ B(isize, usize),
+ }
+
+ match Blah::A(1, 1, 2) {
+ Blah::A(_, x, ref y) | Blah::B(x, ref y) => {}
+ //~^ ERROR mismatched types
+ //~| ERROR variable `y` is bound inconsistently across alternatives separated by `|`
+ }
+
+ match Blah::A(1, 1, 2) {
+ Blah::A(_, x, y) | Blah::B(x, y) => {}
+ //~^ ERROR mismatched types
+ //~| variable `y` is bound inconsistently across alternatives separated by `|`
+ }
+}
diff --git a/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.rs b/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.rs
new file mode 100644
index 000000000..0c33f99a4
--- /dev/null
+++ b/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.rs
@@ -0,0 +1,21 @@
+// run-rustfix
+#![allow(dead_code, unused_variables)]
+
+fn main() {
+ enum Blah {
+ A(isize, isize, usize),
+ B(isize, usize),
+ }
+
+ match Blah::A(1, 1, 2) {
+ Blah::A(_, x, ref y) | Blah::B(x, y) => {}
+ //~^ ERROR mismatched types
+ //~| ERROR variable `y` is bound inconsistently across alternatives separated by `|`
+ }
+
+ match Blah::A(1, 1, 2) {
+ Blah::A(_, x, y) | Blah::B(x, ref y) => {}
+ //~^ ERROR mismatched types
+ //~| variable `y` is bound inconsistently across alternatives separated by `|`
+ }
+}
diff --git a/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.stderr b/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.stderr
new file mode 100644
index 000000000..e8357f9a3
--- /dev/null
+++ b/src/test/ui/mismatched_types/suggest-adding-or-removing-ref-for-binding-pattern.stderr
@@ -0,0 +1,49 @@
+error[E0409]: variable `y` is bound inconsistently across alternatives separated by `|`
+ --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:11:43
+ |
+LL | Blah::A(_, x, ref y) | Blah::B(x, y) => {}
+ | - first binding ^ bound in different ways
+
+error[E0409]: variable `y` is bound inconsistently across alternatives separated by `|`
+ --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:17:43
+ |
+LL | Blah::A(_, x, y) | Blah::B(x, ref y) => {}
+ | - first binding ^ bound in different ways
+
+error[E0308]: mismatched types
+ --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:11:43
+ |
+LL | match Blah::A(1, 1, 2) {
+ | ---------------- this expression has type `Blah`
+LL | Blah::A(_, x, ref y) | Blah::B(x, y) => {}
+ | ----- ^ expected `&usize`, found `usize`
+ | |
+ | first introduced with type `&usize` here
+ |
+ = note: in the same arm, a binding must have the same type in all alternatives
+help: consider adding `ref`
+ |
+LL | Blah::A(_, x, ref y) | Blah::B(x, ref y) => {}
+ | +++
+
+error[E0308]: mismatched types
+ --> $DIR/suggest-adding-or-removing-ref-for-binding-pattern.rs:17:39
+ |
+LL | match Blah::A(1, 1, 2) {
+ | ---------------- this expression has type `Blah`
+LL | Blah::A(_, x, y) | Blah::B(x, ref y) => {}
+ | - ^^^^^ expected `usize`, found `&usize`
+ | |
+ | first introduced with type `usize` here
+ |
+ = note: in the same arm, a binding must have the same type in all alternatives
+help: consider removing `ref`
+ |
+LL - Blah::A(_, x, y) | Blah::B(x, ref y) => {}
+LL + Blah::A(_, x, y) | Blah::B(x, y) => {}
+ |
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0308, E0409.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed
new file mode 100644
index 000000000..f30feaed0
--- /dev/null
+++ b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.fixed
@@ -0,0 +1,28 @@
+// run-rustfix
+
+#![allow(dead_code)]
+
+struct S;
+struct Y;
+
+trait Trait {}
+
+impl Trait for S {}
+impl Trait for Y {}
+
+fn foo() -> Box<dyn Trait> {
+ if true {
+ Box::new(S)
+ } else {
+ Box::new(Y) //~ ERROR `if` and `else` have incompatible types
+ }
+}
+
+fn bar() -> Box<dyn Trait> {
+ match true {
+ true => Box::new(S),
+ false => Box::new(Y), //~ ERROR `match` arms have incompatible types
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.rs b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.rs
new file mode 100644
index 000000000..2bd8146e2
--- /dev/null
+++ b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.rs
@@ -0,0 +1,28 @@
+// run-rustfix
+
+#![allow(dead_code)]
+
+struct S;
+struct Y;
+
+trait Trait {}
+
+impl Trait for S {}
+impl Trait for Y {}
+
+fn foo() -> impl Trait {
+ if true {
+ S
+ } else {
+ Y //~ ERROR `if` and `else` have incompatible types
+ }
+}
+
+fn bar() -> impl Trait {
+ match true {
+ true => S,
+ false => Y, //~ ERROR `match` arms have incompatible types
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr
new file mode 100644
index 000000000..f58b9c3ec
--- /dev/null
+++ b/src/test/ui/mismatched_types/suggest-boxed-trait-objects-instead-of-impl-trait.stderr
@@ -0,0 +1,47 @@
+error[E0308]: `if` and `else` have incompatible types
+ --> $DIR/suggest-boxed-trait-objects-instead-of-impl-trait.rs:17:9
+ |
+LL | / if true {
+LL | | S
+ | | - expected because of this
+LL | | } else {
+LL | | Y
+ | | ^ expected struct `S`, found struct `Y`
+LL | | }
+ | |_____- `if` and `else` have incompatible types
+ |
+help: you could change the return type to be a boxed trait object
+ |
+LL | fn foo() -> Box<dyn Trait> {
+ | ~~~~~~~ +
+help: if you change the return type to expect trait objects, box the returned expressions
+ |
+LL ~ Box::new(S)
+LL | } else {
+LL ~ Box::new(Y)
+ |
+
+error[E0308]: `match` arms have incompatible types
+ --> $DIR/suggest-boxed-trait-objects-instead-of-impl-trait.rs:24:18
+ |
+LL | / match true {
+LL | | true => S,
+ | | - this is found to be of type `S`
+LL | | false => Y,
+ | | ^ expected struct `S`, found struct `Y`
+LL | | }
+ | |_____- `match` arms have incompatible types
+ |
+help: you could change the return type to be a boxed trait object
+ |
+LL | fn bar() -> Box<dyn Trait> {
+ | ~~~~~~~ +
+help: if you change the return type to expect trait objects, box the returned expressions
+ |
+LL ~ true => Box::new(S),
+LL ~ false => Box::new(Y),
+ |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/modules/auxiliary/dummy_lib.rs b/src/test/ui/modules/auxiliary/dummy_lib.rs
new file mode 100644
index 000000000..ef805c1f0
--- /dev/null
+++ b/src/test/ui/modules/auxiliary/dummy_lib.rs
@@ -0,0 +1,2 @@
+#[allow(dead_code)]
+pub struct Dummy;
diff --git a/src/test/ui/modules/special_module_name.rs b/src/test/ui/modules/special_module_name.rs
new file mode 100644
index 000000000..15c59b2da
--- /dev/null
+++ b/src/test/ui/modules/special_module_name.rs
@@ -0,0 +1,8 @@
+mod lib;
+//~^ WARN found module declaration for lib.rs
+//~| ERROR file not found for module `lib`
+mod main;
+//~^ WARN found module declaration for main.rs
+//~| ERROR file not found for module `main`
+
+fn main() {}
diff --git a/src/test/ui/modules/special_module_name.stderr b/src/test/ui/modules/special_module_name.stderr
new file mode 100644
index 000000000..bc4b4f1b3
--- /dev/null
+++ b/src/test/ui/modules/special_module_name.stderr
@@ -0,0 +1,37 @@
+error[E0583]: file not found for module `lib`
+ --> $DIR/special_module_name.rs:1:1
+ |
+LL | mod lib;
+ | ^^^^^^^^
+ |
+ = help: to create the module `lib`, create file "$DIR/lib.rs" or "$DIR/lib/mod.rs"
+
+error[E0583]: file not found for module `main`
+ --> $DIR/special_module_name.rs:4:1
+ |
+LL | mod main;
+ | ^^^^^^^^^
+ |
+ = help: to create the module `main`, create file "$DIR/main.rs" or "$DIR/main/mod.rs"
+
+warning: found module declaration for lib.rs
+ --> $DIR/special_module_name.rs:1:1
+ |
+LL | mod lib;
+ | ^^^^^^^^
+ |
+ = note: lib.rs is the root of this crate's library target
+ = help: to refer to it from other targets, use the library's name as the path
+ = note: `#[warn(special_module_name)]` on by default
+
+warning: found module declaration for main.rs
+ --> $DIR/special_module_name.rs:4:1
+ |
+LL | mod main;
+ | ^^^^^^^^^
+ |
+ = note: a binary crate cannot be used as library
+
+error: aborting due to 2 previous errors; 2 warnings emitted
+
+For more information about this error, try `rustc --explain E0583`.
diff --git a/src/test/ui/modules/special_module_name_ignore.rs b/src/test/ui/modules/special_module_name_ignore.rs
new file mode 100644
index 000000000..07cea9b2b
--- /dev/null
+++ b/src/test/ui/modules/special_module_name_ignore.rs
@@ -0,0 +1,9 @@
+// run-pass
+
+#[path = "auxiliary/dummy_lib.rs"]
+mod lib;
+
+#[path = "auxiliary/dummy_lib.rs"]
+mod main;
+
+fn main() {}
diff --git a/src/test/ui/moves/issue-72649-uninit-in-loop.stderr b/src/test/ui/moves/issue-72649-uninit-in-loop.stderr
index c7373b5be..974994223 100644
--- a/src/test/ui/moves/issue-72649-uninit-in-loop.stderr
+++ b/src/test/ui/moves/issue-72649-uninit-in-loop.stderr
@@ -47,6 +47,11 @@ LL | let value: NonCopy;
| ----- binding declared here but left uninitialized
LL | let _used = value;
| ^^^^^ `value` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let value: NonCopy = todo!();
+ | +++++++++
error[E0381]: used binding `value` isn't initialized
--> $DIR/issue-72649-uninit-in-loop.rs:69:21
@@ -56,6 +61,11 @@ LL | let mut value: NonCopy;
LL | loop {
LL | let _used = value;
| ^^^^^ `value` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut value: NonCopy = todo!();
+ | +++++++++
error: aborting due to 6 previous errors
diff --git a/src/test/ui/moves/move-into-dead-array-1.stderr b/src/test/ui/moves/move-into-dead-array-1.stderr
index 344a6bbf0..6db0f0bcb 100644
--- a/src/test/ui/moves/move-into-dead-array-1.stderr
+++ b/src/test/ui/moves/move-into-dead-array-1.stderr
@@ -5,6 +5,11 @@ LL | let mut a: [D; 4];
| ----- binding declared here but left uninitialized
LL | a[i] = d();
| ^^^^ `a` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let mut a: [D; 4] = todo!();
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/moves/move-of-addr-of-mut.stderr b/src/test/ui/moves/move-of-addr-of-mut.stderr
index e75f2b1c0..ddebaa012 100644
--- a/src/test/ui/moves/move-of-addr-of-mut.stderr
+++ b/src/test/ui/moves/move-of-addr-of-mut.stderr
@@ -7,6 +7,10 @@ LL | std::ptr::addr_of_mut!(x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ `x` used here but it isn't initialized
|
= note: this error originates in the macro `std::ptr::addr_of_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider assigning a value
+ |
+LL | let mut x: S = todo!();
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/moves/move-out-of-array-ref.stderr b/src/test/ui/moves/move-out-of-array-ref.stderr
index fd682e56a..0caa0b83a 100644
--- a/src/test/ui/moves/move-out-of-array-ref.stderr
+++ b/src/test/ui/moves/move-out-of-array-ref.stderr
@@ -13,7 +13,7 @@ error[E0508]: cannot move out of type `[D; 4]`, a non-copy array
--> $DIR/move-out-of-array-ref.rs:13:27
|
LL | let [_, s @ .. , _] = *a;
- | ------ ^^
+ | - ^^
| | |
| | cannot move out of here
| | help: consider borrowing here: `&*a`
@@ -35,7 +35,7 @@ error[E0508]: cannot move out of type `[D; 4]`, a non-copy array
--> $DIR/move-out-of-array-ref.rs:23:27
|
LL | let [_, s @ .. , _] = *a;
- | ------ ^^
+ | - ^^
| | |
| | cannot move out of here
| | help: consider borrowing here: `&*a`
diff --git a/src/test/ui/moves/move-out-of-slice-2.stderr b/src/test/ui/moves/move-out-of-slice-2.stderr
index 9a863bf31..46357ce6f 100644
--- a/src/test/ui/moves/move-out-of-slice-2.stderr
+++ b/src/test/ui/moves/move-out-of-slice-2.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0508]: cannot move out of type `[A]`, a non-copy slice
--> $DIR/move-out-of-slice-2.rs:10:11
@@ -14,7 +14,7 @@ LL | match *a {
| ^^ cannot move out of here
LL |
LL | [a @ ..] => {}
- | ------
+ | -
| |
| data moved here
| move occurs because `a` has type `[A]`, which does not implement the `Copy` trait
@@ -26,7 +26,7 @@ LL | match *b {
| ^^ cannot move out of here
LL |
LL | [_, _, b @ .., _] => {}
- | ------
+ | -
| |
| data moved here
| move occurs because `b` has type `[A]`, which does not implement the `Copy` trait
@@ -38,7 +38,7 @@ LL | match *c {
| ^^ cannot move out of here
LL |
LL | [c @ ..] => {}
- | ------
+ | -
| |
| data moved here
| move occurs because `c` has type `[C]`, which does not implement the `Copy` trait
@@ -50,7 +50,7 @@ LL | match *d {
| ^^ cannot move out of here
LL |
LL | [_, _, d @ .., _] => {}
- | ------
+ | -
| |
| data moved here
| move occurs because `d` has type `[C]`, which does not implement the `Copy` trait
diff --git a/src/test/ui/mutexguard-sync.stderr b/src/test/ui/mutexguard-sync.stderr
index b3c77b13e..3fbb2ddf1 100644
--- a/src/test/ui/mutexguard-sync.stderr
+++ b/src/test/ui/mutexguard-sync.stderr
@@ -7,7 +7,7 @@ LL | test_sync(guard);
| required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
- = note: required because of the requirements on the impl of `Sync` for `MutexGuard<'_, Cell<i32>>`
+ = note: required for `MutexGuard<'_, Cell<i32>>` to implement `Sync`
note: required by a bound in `test_sync`
--> $DIR/mutexguard-sync.rs:5:17
|
diff --git a/src/test/ui/namespace/namespace-mix.stderr b/src/test/ui/namespace/namespace-mix.stderr
index b04ea14d1..c07914df7 100644
--- a/src/test/ui/namespace/namespace-mix.stderr
+++ b/src/test/ui/namespace/namespace-mix.stderr
@@ -218,7 +218,7 @@ error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfi
--> $DIR/namespace-mix.rs:56:11
|
LL | check(m3::TS);
- | ----- ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}`
+ | ----- ^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> c::TS {c::TS}`
| |
| required by a bound introduced by this call
|
@@ -274,7 +274,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::T
--> $DIR/namespace-mix.rs:62:11
|
LL | check(xm3::TS);
- | ----- ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
+ | ----- ^^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}`
| |
| required by a bound introduced by this call
|
@@ -526,7 +526,7 @@ error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satis
--> $DIR/namespace-mix.rs:122:11
|
LL | check(m9::TV);
- | ----- ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}`
+ | ----- ^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> c::E {c::E::TV}`
| |
| required by a bound introduced by this call
|
@@ -582,7 +582,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::xm7::
--> $DIR/namespace-mix.rs:128:11
|
LL | check(xm9::TV);
- | ----- ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
+ | ----- ^^^^^^^ the trait `Impossible` is not implemented for fn item `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr b/src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr
index f3dbcc2d7..227d30282 100644
--- a/src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr
+++ b/src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr
@@ -1,27 +1,27 @@
-error[E0425]: cannot find function `foo` in this scope
- --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:11:5
- |
-LL | foo();
- | ^^^ not found in this scope
-
error[E0425]: cannot find function `foo` in module `m`
--> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:12:8
|
LL | m::foo();
| ^^^ not found in `m`
-error[E0425]: cannot find function `bar` in this scope
- --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:13:5
- |
-LL | bar();
- | ^^^ not found in this scope
-
error[E0425]: cannot find function `bar` in module `m`
--> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:14:8
|
LL | m::bar();
| ^^^ not found in `m`
+error[E0425]: cannot find function `foo` in this scope
+ --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:11:5
+ |
+LL | foo();
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find function `bar` in this scope
+ --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:13:5
+ |
+LL | bar();
+ | ^^^ not found in this scope
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/namespace/namespaced-enum-glob-import-no-impls.stderr b/src/test/ui/namespace/namespaced-enum-glob-import-no-impls.stderr
index 98784de8e..111ac7ab0 100644
--- a/src/test/ui/namespace/namespaced-enum-glob-import-no-impls.stderr
+++ b/src/test/ui/namespace/namespaced-enum-glob-import-no-impls.stderr
@@ -1,27 +1,27 @@
-error[E0425]: cannot find function `foo` in this scope
- --> $DIR/namespaced-enum-glob-import-no-impls.rs:21:5
- |
-LL | foo();
- | ^^^ not found in this scope
-
error[E0425]: cannot find function `foo` in module `m`
--> $DIR/namespaced-enum-glob-import-no-impls.rs:22:8
|
LL | m::foo();
| ^^^ not found in `m`
-error[E0425]: cannot find function `bar` in this scope
- --> $DIR/namespaced-enum-glob-import-no-impls.rs:23:5
- |
-LL | bar();
- | ^^^ not found in this scope
-
error[E0425]: cannot find function `bar` in module `m`
--> $DIR/namespaced-enum-glob-import-no-impls.rs:24:8
|
LL | m::bar();
| ^^^ not found in `m`
+error[E0425]: cannot find function `foo` in this scope
+ --> $DIR/namespaced-enum-glob-import-no-impls.rs:21:5
+ |
+LL | foo();
+ | ^^^ not found in this scope
+
+error[E0425]: cannot find function `bar` in this scope
+ --> $DIR/namespaced-enum-glob-import-no-impls.rs:23:5
+ |
+LL | bar();
+ | ^^^ not found in this scope
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/native-library-link-flags/suggest-libname-only-1.rs b/src/test/ui/native-library-link-flags/suggest-libname-only-1.rs
new file mode 100644
index 000000000..abf988a7c
--- /dev/null
+++ b/src/test/ui/native-library-link-flags/suggest-libname-only-1.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: --crate-type rlib
+// error-pattern: could not find native static library `libfoo.a`
+// error-pattern: only provide the library name `foo`, not the full filename
+
+#[link(name = "libfoo.a", kind = "static")]
+extern { }
+
+pub fn main() { }
diff --git a/src/test/ui/native-library-link-flags/suggest-libname-only-1.stderr b/src/test/ui/native-library-link-flags/suggest-libname-only-1.stderr
new file mode 100644
index 000000000..64d0a9077
--- /dev/null
+++ b/src/test/ui/native-library-link-flags/suggest-libname-only-1.stderr
@@ -0,0 +1,6 @@
+error: could not find native static library `libfoo.a`, perhaps an -L flag is missing?
+ |
+ = help: only provide the library name `foo`, not the full filename
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/native-library-link-flags/suggest-libname-only-2.rs b/src/test/ui/native-library-link-flags/suggest-libname-only-2.rs
new file mode 100644
index 000000000..dfa70e56d
--- /dev/null
+++ b/src/test/ui/native-library-link-flags/suggest-libname-only-2.rs
@@ -0,0 +1,9 @@
+// build-fail
+// compile-flags: --crate-type rlib
+// error-pattern: could not find native static library `bar.lib`
+// error-pattern: only provide the library name `bar`, not the full filename
+
+#[link(name = "bar.lib", kind = "static")]
+extern { }
+
+pub fn main() { }
diff --git a/src/test/ui/native-library-link-flags/suggest-libname-only-2.stderr b/src/test/ui/native-library-link-flags/suggest-libname-only-2.stderr
new file mode 100644
index 000000000..e166af9ed
--- /dev/null
+++ b/src/test/ui/native-library-link-flags/suggest-libname-only-2.stderr
@@ -0,0 +1,6 @@
+error: could not find native static library `bar.lib`, perhaps an -L flag is missing?
+ |
+ = help: only provide the library name `bar`, not the full filename
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/nested-ty-params.stderr b/src/test/ui/nested-ty-params.stderr
index f6741b5e5..8f4746f5e 100644
--- a/src/test/ui/nested-ty-params.stderr
+++ b/src/test/ui/nested-ty-params.stderr
@@ -4,9 +4,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn hd<U>(v: Vec<U> ) -> U {
| - type parameter from outer function
LL | fn hd1(w: [U]) -> U { return w[0]; }
- | --- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `hd1<U>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<U>`
error[E0401]: can't use generic parameters from outer function
--> $DIR/nested-ty-params.rs:3:23
@@ -14,9 +14,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn hd<U>(v: Vec<U> ) -> U {
| - type parameter from outer function
LL | fn hd1(w: [U]) -> U { return w[0]; }
- | --- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `hd1<U>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<U>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/never_type/defaulted-never-note.fallback.stderr b/src/test/ui/never_type/defaulted-never-note.fallback.stderr
index 4c8b49224..283aca1b0 100644
--- a/src/test/ui/never_type/defaulted-never-note.fallback.stderr
+++ b/src/test/ui/never_type/defaulted-never-note.fallback.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `!: ImplementedForUnitButNotNever` is not satisfied
- --> $DIR/defaulted-never-note.rs:30:5
+ --> $DIR/defaulted-never-note.rs:30:9
|
LL | foo(_x);
- | ^^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!`
+ | --- ^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `ImplementedForUnitButNotNever` is implemented for `()`
= note: this error might have been caused by changes to Rust's type-inference algorithm (see issue #48950 <https://github.com/rust-lang/rust/issues/48950> for more information)
diff --git a/src/test/ui/never_type/defaulted-never-note.rs b/src/test/ui/never_type/defaulted-never-note.rs
index aefc739a0..d30ffcd38 100644
--- a/src/test/ui/never_type/defaulted-never-note.rs
+++ b/src/test/ui/never_type/defaulted-never-note.rs
@@ -32,6 +32,7 @@ fn smeg() {
//[fallback]~| NOTE the trait `ImplementedForUnitButNotNever` is not implemented
//[fallback]~| HELP trait `ImplementedForUnitButNotNever` is implemented for `()`
//[fallback]~| NOTE this error might have been caused
+ //[fallback]~| NOTE required by a bound introduced by this call
//[fallback]~| HELP did you intend
}
diff --git a/src/test/ui/never_type/diverging-fallback-no-leak.fallback.stderr b/src/test/ui/never_type/diverging-fallback-no-leak.fallback.stderr
index dee2b1d70..3215c4669 100644
--- a/src/test/ui/never_type/diverging-fallback-no-leak.fallback.stderr
+++ b/src/test/ui/never_type/diverging-fallback-no-leak.fallback.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `!: Test` is not satisfied
- --> $DIR/diverging-fallback-no-leak.rs:17:5
+ --> $DIR/diverging-fallback-no-leak.rs:17:23
|
LL | unconstrained_arg(return);
- | ^^^^^^^^^^^^^^^^^ the trait `Test` is not implemented for `!`
+ | ----------------- ^^^^^^ the trait `Test` is not implemented for `!`
+ | |
+ | required by a bound introduced by this call
|
= help: the following other types implement trait `Test`:
()
diff --git a/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr b/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr
index 2acf44432..45cf37234 100644
--- a/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr
+++ b/src/test/ui/never_type/fallback-closure-wrap.fallback.stderr
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `<[closure@$DIR/fallback-closure-wrap.rs:18:40: 18:47] as FnOnce<()>>::Output == ()`
+error[E0271]: expected `[closure@$DIR/fallback-closure-wrap.rs:18:40: 18:47]` to be a closure that returns `()`, but it returns `!`
--> $DIR/fallback-closure-wrap.rs:18:31
|
LL | let error = Closure::wrap(Box::new(move || {
diff --git a/src/test/ui/never_type/fallback-closure-wrap.rs b/src/test/ui/never_type/fallback-closure-wrap.rs
index af0577ac0..f88355bb2 100644
--- a/src/test/ui/never_type/fallback-closure-wrap.rs
+++ b/src/test/ui/never_type/fallback-closure-wrap.rs
@@ -3,7 +3,7 @@
//
// This particular test case currently fails as the inference to `()` rather
// than `!` happens as a result of an `as` cast, which is not currently tracked.
-// Crater did not find many cases of this occuring, but it is included for
+// Crater did not find many cases of this occurring, but it is included for
// awareness.
//
// revisions: nofallback fallback
@@ -16,7 +16,7 @@ use std::marker::PhantomData;
fn main() {
let error = Closure::wrap(Box::new(move || {
- //[fallback]~^ ERROR type mismatch resolving
+ //[fallback]~^ to be a closure that returns `()`, but it returns `!`
panic!("Can't connect to server.");
}) as Box<dyn FnMut()>);
}
diff --git a/src/test/ui/never_type/feature-gate-never_type_fallback.stderr b/src/test/ui/never_type/feature-gate-never_type_fallback.stderr
index 54abed383..6dc039fc3 100644
--- a/src/test/ui/never_type/feature-gate-never_type_fallback.stderr
+++ b/src/test/ui/never_type/feature-gate-never_type_fallback.stderr
@@ -1,8 +1,12 @@
error[E0277]: the trait bound `(): T` is not satisfied
- --> $DIR/feature-gate-never_type_fallback.rs:10:5
+ --> $DIR/feature-gate-never_type_fallback.rs:10:9
|
LL | foo(panic!())
- | ^^^ the trait `T` is not implemented for `()`
+ | --- ^^^^^^^^
+ | | |
+ | | the trait `T` is not implemented for `()`
+ | | this tail expression is of type `_`
+ | required by a bound introduced by this call
|
note: required by a bound in `foo`
--> $DIR/feature-gate-never_type_fallback.rs:13:16
diff --git a/src/test/ui/never_type/issue-52443.rs b/src/test/ui/never_type/issue-52443.rs
index cebcca944..0498a8a16 100644
--- a/src/test/ui/never_type/issue-52443.rs
+++ b/src/test/ui/never_type/issue-52443.rs
@@ -9,6 +9,6 @@ fn main() {
[(); { for _ in 0usize.. {}; 0}];
//~^ ERROR `for` is not allowed in a `const`
//~| ERROR cannot convert
- //~| ERROR mutable references are not allowed in constants
- //~| ERROR cannot call non-const fn
+ //~| ERROR mutable references
+ //~| ERROR cannot call
}
diff --git a/src/test/ui/never_type/issue-52443.stderr b/src/test/ui/never_type/issue-52443.stderr
index 3c0daa4c5..0910e9ad7 100644
--- a/src/test/ui/never_type/issue-52443.stderr
+++ b/src/test/ui/never_type/issue-52443.stderr
@@ -47,8 +47,8 @@ LL | [(); { for _ in 0usize.. {}; 0}];
note: impl defined here, but it is not `const`
--> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
|
-LL | impl<I: ~const Iterator> const IntoIterator for I {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | impl<I: Iterator> const IntoIterator for I {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
error[E0658]: mutable references are not allowed in constants
diff --git a/src/test/ui/issues/issue-5500-1.rs b/src/test/ui/never_type/issue-5500-1.rs
index 98d6e1a14..98d6e1a14 100644
--- a/src/test/ui/issues/issue-5500-1.rs
+++ b/src/test/ui/never_type/issue-5500-1.rs
diff --git a/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr b/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr
index e20455913..06e902bca 100644
--- a/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr
+++ b/src/test/ui/never_type/never-value-fallback-issue-66757.nofallback.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `E: From<()>` is not satisfied
- --> $DIR/never-value-fallback-issue-66757.rs:28:5
+ --> $DIR/never-value-fallback-issue-66757.rs:28:26
|
LL | <E as From<_>>::from(never);
- | ^^^^^^^^^^^^^^^^^^^^ the trait `From<()>` is not implemented for `E`
+ | -------------------- ^^^^^ the trait `From<()>` is not implemented for `E`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `From<!>` is implemented for `E`
diff --git a/src/test/ui/nll/closure-malformed-projection-input-issue-102800.rs b/src/test/ui/nll/closure-malformed-projection-input-issue-102800.rs
new file mode 100644
index 000000000..25f47f5b6
--- /dev/null
+++ b/src/test/ui/nll/closure-malformed-projection-input-issue-102800.rs
@@ -0,0 +1,31 @@
+// Regression test for #102800
+//
+// Here we are generating higher-ranked region constraints when normalizing and relating closure
+// input types. Previously this was an ICE in the error path because we didn't register enough
+// diagnostic information to render the higher-ranked subtyping error.
+
+// check-fail
+
+trait Trait {
+ type Ty;
+}
+
+impl Trait for &'static () {
+ type Ty = ();
+}
+
+fn main() {
+ let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ //~^ ERROR lifetime may not live long enough
+ //~| ERROR higher-ranked subtype error
+ //~| ERROR higher-ranked subtype error
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+ //~| ERROR implementation of `Trait` is not general enough
+}
diff --git a/src/test/ui/nll/closure-malformed-projection-input-issue-102800.stderr b/src/test/ui/nll/closure-malformed-projection-input-issue-102800.stderr
new file mode 100644
index 000000000..dbd5dabd1
--- /dev/null
+++ b/src/test/ui/nll/closure-malformed-projection-input-issue-102800.stderr
@@ -0,0 +1,104 @@
+error: lifetime may not live long enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^-^
+ | ||
+ | |has type `<&'1 () as Trait>::Ty`
+ | requires that `'1` must outlive `'static`
+
+error: higher-ranked subtype error
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^
+
+error: higher-ranked subtype error
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:12
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:12
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:12
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:12
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: implementation of `Trait` is not general enough
+ --> $DIR/closure-malformed-projection-input-issue-102800.rs:18:48
+ |
+LL | let _: for<'a> fn(<&'a () as Trait>::Ty) = |_| {};
+ | ^^^^^^ implementation of `Trait` is not general enough
+ |
+ = note: `&'0 ()` must implement `Trait`, for any lifetime `'0`...
+ = note: ...but `Trait` is actually implemented for the type `&'static ()`
+
+error: aborting due to 12 previous errors
+
diff --git a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr b/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr
index f86a19fff..d2d26b23d 100644
--- a/src/test/ui/nll/closure-requirements/escape-argument-callee.stderr
+++ b/src/test/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<'r, 's, 't0> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) i32)),
+ for<'a, 'b, 'c> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) i32)),
(),
]
@@ -22,14 +22,8 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
note: no external requirements
--> $DIR/escape-argument-callee.rs:20:1
|
-LL | / fn test() {
-LL | | let x = 44;
-LL | | let mut p = &x;
-LL | |
-... |
-LL | | deref(p);
-LL | | }
- | |_^
+LL | fn test() {
+ | ^^^^^^^^^
|
= note: defining type: test
diff --git a/src/test/ui/nll/closure-requirements/escape-argument.stderr b/src/test/ui/nll/closure-requirements/escape-argument.stderr
index 8cd8b43ca..6355d3295 100644
--- a/src/test/ui/nll/closure-requirements/escape-argument.stderr
+++ b/src/test/ui/nll/closure-requirements/escape-argument.stderr
@@ -6,21 +6,15 @@ LL | let mut closure = expect_sig(|p, y| *p = y);
|
= note: defining type: test::{closure#0} with closure substs [
i16,
- for<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32)),
+ for<'a, 'b> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) mut &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32)),
(),
]
note: no external requirements
--> $DIR/escape-argument.rs:20:1
|
-LL | / fn test() {
-LL | | let x = 44;
-LL | | let mut p = &x;
-LL | |
-... |
-LL | | deref(p);
-LL | | }
- | |_^
+LL | fn test() {
+ | ^^^^^^^^^
|
= note: defining type: test
diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr
index abf80e039..4fbd5eb19 100644
--- a/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr
+++ b/src/test/ui/nll/closure-requirements/escape-upvar-nested.stderr
@@ -29,14 +29,8 @@ LL | let mut closure = || {
note: no external requirements
--> $DIR/escape-upvar-nested.rs:13:1
|
-LL | / fn test() {
-LL | | let x = 44;
-LL | | let mut p = &x;
-LL | |
-... |
-LL | | deref(p);
-LL | | }
- | |_^
+LL | fn test() {
+ | ^^^^^^^^^
|
= note: defining type: test
diff --git a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr
index bc7546421..bc1ceac5b 100644
--- a/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr
+++ b/src/test/ui/nll/closure-requirements/escape-upvar-ref.stderr
@@ -15,14 +15,8 @@ LL | let mut closure = || p = &y;
note: no external requirements
--> $DIR/escape-upvar-ref.rs:17:1
|
-LL | / fn test() {
-LL | | let x = 44;
-LL | | let mut p = &x;
-LL | |
-... |
-LL | | deref(p);
-LL | | }
- | |_^
+LL | fn test() {
+ | ^^^^^^^^^
|
= note: defining type: test
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
index b9b0f3ad2..5f9724ce3 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-fail-no-postdom.stderr
@@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, _outlives3, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)),
+ for<'a, 'b> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#3r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)),
(),
]
= note: late-bound region is '_#4r
@@ -27,14 +27,8 @@ LL | demand_y(x, y, p)
note: no external requirements
--> $DIR/propagate-approximated-fail-no-postdom.rs:38:1
|
-LL | / fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) {
-LL | | establish_relationships(
-LL | | cell_a,
-LL | | cell_b,
-... |
-LL | | );
-LL | | }
- | |_^
+LL | fn supply<'a, 'b, 'c>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>, cell_c: Cell<&'c u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr
index a2371ee31..ec728ebd5 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-ref.stderr
+++ b/src/test/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<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t3) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>)),
+ for<'a, 'b, 'c, 'd, 'e, 'f> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('f) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>)),
(),
]
= note: late-bound region is '_#3r
@@ -17,14 +17,8 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
note: no external requirements
--> $DIR/propagate-approximated-ref.rs:42:1
|
-LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | | // Only works if 'x: 'y:
-LL | | demand_y(x, y, x.get())
-LL | |
-LL | | });
-LL | | }
- | |_^
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
index e53ae167f..012933797 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-comparing-against-free.stderr
@@ -6,7 +6,7 @@ LL | foo(cell, |cell_a, cell_x| {
|
= note: defining type: case1::{closure#0} with closure substs [
i32,
- for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>)),
+ for<'a> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>)),
(),
]
@@ -23,14 +23,8 @@ LL | cell_a.set(cell_x.get()); // forces 'x: 'a, error in closure
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:18:1
|
-LL | / fn case1() {
-LL | | let a = 0;
-LL | | let cell = Cell::new(&a);
-LL | | foo(cell, |cell_a, cell_x| {
-... |
-LL | | })
-LL | | }
- | |_^
+LL | fn case1() {
+ | ^^^^^^^^^^
|
= note: defining type: case1
@@ -42,7 +36,7 @@ LL | foo(cell, |cell_a, cell_x| {
|
= note: defining type: case2::{closure#0} with closure substs [
i32,
- for<'r> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>)),
+ for<'a> extern "rust-call" fn((std::cell::Cell<&'_#1r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>)),
(),
]
= note: number of external vids: 2
@@ -51,14 +45,8 @@ LL | foo(cell, |cell_a, cell_x| {
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-comparing-against-free.rs:28:1
|
-LL | / fn case2() {
-LL | | let a = 0;
-LL | | let cell = Cell::new(&a);
-LL | |
-... |
-LL | | })
-LL | | }
- | |_^
+LL | fn case2() {
+ | ^^^^^^^^^^
|
= note: defining type: case2
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
index c3c7eb1bd..ce85b20b3 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr
@@ -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<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) u32>)),
+ for<'a, 'b, 'c, 'd, 'e> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) u32>)),
(),
]
= note: late-bound region is '_#2r
@@ -17,14 +17,8 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:31:1
|
-LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-LL | |
-LL | |
-... |
-LL | | });
-LL | | }
- | |_^
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply
@@ -46,7 +40,7 @@ LL | | });
| |______`cell_a` escapes the function body here
| argument requires that `'a` must outlive `'static`
|
- = note: requirement occurs because of the type `Cell<&'_#10r u32>`, which makes the generic argument `&'_#10r u32` invariant
+ = note: requirement occurs because of the type `Cell<&'_#9r u32>`, which makes the generic argument `&'_#9r u32` invariant
= note: the struct `Cell<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
index 846e5aedb..20c7967b7 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr
@@ -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<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t3) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>)),
+ for<'a, 'b, 'c, 'd, 'e, 'f> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&'_#2r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('f) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>)),
(),
]
= note: late-bound region is '_#3r
@@ -17,14 +17,8 @@ LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y
note: no external requirements
--> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:34:1
|
-LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | |
-LL | |
-... |
-LL | | });
-LL | | }
- | |_^
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply
@@ -46,7 +40,7 @@ LL | | });
| |______`cell_a` escapes the function body here
| argument requires that `'a` must outlive `'static`
|
- = note: requirement occurs because of the type `Cell<&'_#11r u32>`, which makes the generic argument `&'_#11r u32` invariant
+ = note: requirement occurs because of the type `Cell<&'_#10r u32>`, which makes the generic argument `&'_#10r u32` invariant
= note: the struct `Cell<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr
index a570932ed..f7db5ab1f 100644
--- a/src/test/ui/nll/closure-requirements/propagate-approximated-val.stderr
+++ b/src/test/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<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)),
+ for<'a, 'b> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)),
(),
]
= note: late-bound region is '_#3r
@@ -17,14 +17,8 @@ LL | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
note: no external requirements
--> $DIR/propagate-approximated-val.rs:35:1
|
-LL | / fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-LL | | establish_relationships(cell_a, cell_b, |outlives1, outlives2, x, y| {
-LL | | // Only works if 'x: 'y:
-LL | | demand_y(outlives1, outlives2, x.get())
-LL | |
-LL | | });
-LL | | }
- | |_^
+LL | fn test<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: test
diff --git a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
index 407bc6764..3488edc75 100644
--- a/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-despite-same-free-region.stderr
@@ -6,7 +6,7 @@ LL | |_outlives1, _outlives2, x, y| {
|
= note: defining type: supply::{closure#0} with closure substs [
i16,
- for<'r, 's> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)),
+ for<'a, 'b> extern "rust-call" fn((std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#2r u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) u32>, std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)),
(),
]
= note: late-bound region is '_#3r
@@ -16,14 +16,8 @@ LL | |_outlives1, _outlives2, x, y| {
note: no external requirements
--> $DIR/propagate-despite-same-free-region.rs:39:1
|
-LL | / fn supply<'a>(cell_a: Cell<&'a u32>) {
-LL | | establish_relationships(
-LL | | cell_a,
-LL | | |_outlives1, _outlives2, x, y| {
-... |
-LL | | );
-LL | | }
- | |_^
+LL | fn supply<'a>(cell_a: Cell<&'a u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply
diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
index fcb55d37f..0dc2d0de9 100644
--- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-no-bounds.stderr
@@ -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<'r, 's, 't0, 't1, 't2> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>)),
+ for<'a, 'b, 'c, 'd, 'e> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>)),
(),
]
= note: late-bound region is '_#2r
@@ -26,14 +26,8 @@ LL | demand_y(x, y, x.get())
note: no external requirements
--> $DIR/propagate-fail-to-approximate-longer-no-bounds.rs:34:1
|
-LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| {
-LL | | // Only works if 'x: 'y:
-LL | | demand_y(x, y, x.get())
-LL | |
-LL | | });
-LL | | }
- | |_^
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply
diff --git a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
index 75beae39e..4c9e026ea 100644
--- a/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-fail-to-approximate-longer-wrong-bounds.stderr
@@ -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<'r, 's, 't0, 't1, 't2, 't3> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('t0) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('t2) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('t3) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('t1) }) u32>)),
+ for<'a, 'b, 'c, 'd, 'e, 'f> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) &'_#1r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 2, kind: BrNamed('c) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) &'_#2r u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 4, kind: BrNamed('e) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) u32>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 5, kind: BrNamed('f) }) std::cell::Cell<&ReLateBound(DebruijnIndex(0), BoundRegion { var: 3, kind: BrNamed('d) }) u32>)),
(),
]
= note: late-bound region is '_#3r
@@ -26,14 +26,8 @@ LL | demand_y(x, y, x.get())
note: no external requirements
--> $DIR/propagate-fail-to-approximate-longer-wrong-bounds.rs:38:1
|
-LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
-LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| {
-LL | | // Only works if 'x: 'y:
-LL | | demand_y(x, y, x.get())
-LL | |
-LL | | });
-LL | | }
- | |_^
+LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: supply
diff --git a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr
index 58aced2bf..750b08bbe 100644
--- a/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr
+++ b/src/test/ui/nll/closure-requirements/propagate-from-trait-match.stderr
@@ -18,11 +18,7 @@ note: no external requirements
LL | / fn supply<'a, T>(value: T)
LL | | where
LL | | T: Trait<'a>,
-LL | | {
-... |
-LL | | });
-LL | | }
- | |_^
+ | |_________________^
|
= note: defining type: supply::<'_#1r, T>
diff --git a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
index 1c9d0c835..68429142e 100644
--- a/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
+++ b/src/test/ui/nll/closure-requirements/return-wrong-bound-region.stderr
@@ -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<'r, 's> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) i32)) -> &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) i32,
+ for<'a, 'b> extern "rust-call" fn((&ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) i32, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) i32)) -> &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) i32,
(),
]
@@ -22,11 +22,8 @@ LL | expect_sig(|a, b| b); // ought to return `a`
note: no external requirements
--> $DIR/return-wrong-bound-region.rs:10:1
|
-LL | / fn test() {
-LL | | expect_sig(|a, b| b); // ought to return `a`
-LL | |
-LL | | }
- | |_^
+LL | fn test() {
+ | ^^^^^^^^^
|
= note: defining type: test
diff --git a/src/test/ui/nll/closures-in-loops.stderr b/src/test/ui/nll/closures-in-loops.stderr
index 2be0460df..1c1a31d35 100644
--- a/src/test/ui/nll/closures-in-loops.stderr
+++ b/src/test/ui/nll/closures-in-loops.stderr
@@ -13,17 +13,21 @@ error[E0499]: cannot borrow `x` as mutable more than once at a time
--> $DIR/closures-in-loops.rs:13:16
|
LL | v.push(|| x = String::new());
- | ^^ - borrows occur due to use of `x` in closure
- | |
- | `x` was mutably borrowed here in the previous iteration of the loop
+ | -------^^-------------------
+ | | | |
+ | | | borrows occur due to use of `x` in closure
+ | | `x` was mutably borrowed here in the previous iteration of the loop
+ | first borrow used here, in later iteration of loop
error[E0524]: two closures require unique access to `x` at the same time
--> $DIR/closures-in-loops.rs:20:16
|
LL | v.push(|| *x = String::new());
- | ^^ -- borrows occur due to use of `x` in closure
- | |
- | closures are constructed here in different iterations of loop
+ | -------^^--------------------
+ | | | |
+ | | | borrows occur due to use of `x` in closure
+ | | closures are constructed here in different iterations of loop
+ | first borrow used here, in later iteration of loop
error: aborting due to 3 previous errors
diff --git a/src/test/ui/nll/issue-21232-partial-init-and-use.rs b/src/test/ui/nll/issue-21232-partial-init-and-use.rs
index 4cd1e406f..ad3eb2483 100644
--- a/src/test/ui/nll/issue-21232-partial-init-and-use.rs
+++ b/src/test/ui/nll/issue-21232-partial-init-and-use.rs
@@ -53,7 +53,7 @@ impl<F> R<F> { fn new(f: F) -> Self { R { w: 0, f } } }
// * local/field: Is the structure in a local or a field
// * fully/partial/void: Are we fully initializing it before using any part?
// Is whole type empty due to a void component?
-// * init/reinit: First initialization, or did we previously inititalize and then move out?
+// * init/reinit: First initialization, or did we previously initialize and then move out?
// * struct/tuple: Is this a struct or a (X, Y).
//
// As a shorthand for the cases above, adding a numeric summary to
diff --git a/src/test/ui/nll/issue-48623-generator.stderr b/src/test/ui/nll/issue-48623-generator.stderr
index 70a83e46f..1b35165db 100644
--- a/src/test/ui/nll/issue-48623-generator.stderr
+++ b/src/test/ui/nll/issue-48623-generator.stderr
@@ -4,8 +4,8 @@ warning: unused generator that must be used
LL | move || { d; yield; &mut *r };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unused_must_use)]` on by default
= note: generators are lazy and do nothing unless resumed
+ = note: `#[warn(unused_must_use)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/nll/issue-51191.stderr b/src/test/ui/nll/issue-51191.stderr
index 9f4e971f9..63ca6ae5c 100644
--- a/src/test/ui/nll/issue-51191.stderr
+++ b/src/test/ui/nll/issue-51191.stderr
@@ -7,8 +7,8 @@ LL | fn bar(self: &mut Self) {
LL | (&mut self).bar();
| ----------------- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
--> $DIR/issue-51191.rs:7:9
diff --git a/src/test/ui/nll/issue-51244.stderr b/src/test/ui/nll/issue-51244.stderr
index 19f0223a3..dcb6f9fec 100644
--- a/src/test/ui/nll/issue-51244.stderr
+++ b/src/test/ui/nll/issue-51244.stderr
@@ -2,7 +2,7 @@ error[E0594]: cannot assign to `*my_ref`, which is behind a `&` reference
--> $DIR/issue-51244.rs:3:5
|
LL | let ref my_ref @ _ = 0;
- | -------------- help: consider changing this to be a mutable reference: `ref mut my_ref @ _`
+ | ---------- help: consider changing this to be a mutable reference: `ref mut my_ref`
LL | *my_ref = 0;
| ^^^^^^^^^^^ `my_ref` is a `&` reference, so the data it refers to cannot be written
diff --git a/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr b/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr
index 0ae6b7c1d..6e96f40c0 100644
--- a/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr
+++ b/src/test/ui/nll/issue-57642-higher-ranked-subtype.stderr
@@ -1,11 +1,11 @@
-error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'r> fn(&'r ())`, but its trait bounds were not satisfied
+error[E0599]: the function or associated item `make_g` exists for fn pointer `for<'a> fn(&'a ())`, but its trait bounds were not satisfied
--> $DIR/issue-57642-higher-ranked-subtype.rs:31:25
|
LL | let x = <fn (&())>::make_g();
- | ^^^^^^ function or associated item cannot be called on `for<'r> fn(&'r ())` due to unsatisfied trait bounds
+ | ^^^^^^ function or associated item cannot be called on `for<'a> fn(&'a ())` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
- `for<'r> fn(&'r ()): X`
+ `for<'a> fn(&'a ()): X`
= help: items from traits can only be used if the trait is implemented and in scope
note: `X` defines an item `make_g`, perhaps you need to implement it
--> $DIR/issue-57642-higher-ranked-subtype.rs:4:1
@@ -13,11 +13,11 @@ note: `X` defines an item `make_g`, perhaps you need to implement it
LL | trait X {
| ^^^^^^^
-error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'r> fn(&'r ())` in the current scope
+error[E0599]: no function or associated item named `make_f` found for fn pointer `for<'a> fn(&'a ())` in the current scope
--> $DIR/issue-57642-higher-ranked-subtype.rs:35:25
|
LL | let x = <fn (&())>::make_f();
- | ^^^^^^ function or associated item not found in `for<'r> fn(&'r ())`
+ | ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `Y` defines an item `make_f`, perhaps you need to implement it
diff --git a/src/test/ui/nll/issue-97997.stderr b/src/test/ui/nll/issue-97997.stderr
index 78401bbf6..46440c021 100644
--- a/src/test/ui/nll/issue-97997.stderr
+++ b/src/test/ui/nll/issue-97997.stderr
@@ -4,7 +4,7 @@ error: implementation of `Foo` is not general enough
LL | <fn(&u8) as Foo>::ASSOC;
| ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
- = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r u8)`
+ = note: `Foo` would have to be implemented for the type `for<'a> fn(&'a u8)`
= note: ...but `Foo` is actually implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0`
error: implementation of `Foo` is not general enough
@@ -13,7 +13,7 @@ error: implementation of `Foo` is not general enough
LL | <fn(&u8) as Foo>::ASSOC;
| ^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Foo` is not general enough
|
- = note: `Foo` would have to be implemented for the type `for<'r> fn(&'r u8)`
+ = note: `Foo` would have to be implemented for the type `for<'a> fn(&'a u8)`
= note: ...but `Foo` is actually implemented for the type `fn(&'0 u8)`, for some specific lifetime `'0`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/nll/local-outlives-static-via-hrtb.stderr b/src/test/ui/nll/local-outlives-static-via-hrtb.stderr
index 61009da49..f5c10f3dd 100644
--- a/src/test/ui/nll/local-outlives-static-via-hrtb.stderr
+++ b/src/test/ui/nll/local-outlives-static-via-hrtb.stderr
@@ -9,6 +9,12 @@ LL | assert_static_via_hrtb(&local);
LL | assert_static_via_hrtb_with_assoc_type(&&local);
LL | }
| - `local` dropped here while still borrowed
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/local-outlives-static-via-hrtb.rs:15:53
+ |
+LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}
+ | ^^^^^^^^^^^^
error[E0597]: `local` does not live long enough
--> $DIR/local-outlives-static-via-hrtb.rs:25:45
@@ -20,6 +26,12 @@ LL | assert_static_via_hrtb_with_assoc_type(&&local);
| argument requires that `local` is borrowed for `'static`
LL | }
| - `local` dropped here while still borrowed
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/local-outlives-static-via-hrtb.rs:19:20
+ |
+LL | for<'a> &'a T: Reference<AssociatedType = &'a ()>,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/nll/match-cfg-fake-edges.stderr b/src/test/ui/nll/match-cfg-fake-edges.stderr
index 250aa482e..2d48a9142 100644
--- a/src/test/ui/nll/match-cfg-fake-edges.stderr
+++ b/src/test/ui/nll/match-cfg-fake-edges.stderr
@@ -9,6 +9,11 @@ LL | _ if { x = 2; true } => 1,
LL | _ if {
LL | x;
| ^ `x` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let x = 0;
+ | +++
error[E0382]: use of moved value: `x`
--> $DIR/match-cfg-fake-edges.rs:35:13
diff --git a/src/test/ui/nll/match-on-borrowed.stderr b/src/test/ui/nll/match-on-borrowed.stderr
index 664f36f69..32666529f 100644
--- a/src/test/ui/nll/match-on-borrowed.stderr
+++ b/src/test/ui/nll/match-on-borrowed.stderr
@@ -40,6 +40,11 @@ LL | let n: Never;
| - binding declared here but left uninitialized
LL | match n {}
| ^ `n` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let n: Never = todo!();
+ | +++++++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/nll/normalization-bounds-error.stderr b/src/test/ui/nll/normalization-bounds-error.stderr
index 6da3d5d96..6abe53127 100644
--- a/src/test/ui/nll/normalization-bounds-error.stderr
+++ b/src/test/ui/nll/normalization-bounds-error.stderr
@@ -1,8 +1,8 @@
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'d` due to conflicting requirements
- --> $DIR/normalization-bounds-error.rs:12:4
+ --> $DIR/normalization-bounds-error.rs:12:1
|
LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
- | ^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime `'d` as defined here...
--> $DIR/normalization-bounds-error.rs:12:14
@@ -15,10 +15,10 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined he
LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
| ^^
note: ...so that the types are compatible
- --> $DIR/normalization-bounds-error.rs:12:4
+ --> $DIR/normalization-bounds-error.rs:12:1
|
LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {}
- | ^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: expected `Visitor<'d>`
found `Visitor<'_>`
diff --git a/src/test/ui/nll/polonius/assignment-kills-loans.rs b/src/test/ui/nll/polonius/assignment-kills-loans.rs
index c4cf20389..696bf61ce 100644
--- a/src/test/ui/nll/polonius/assignment-kills-loans.rs
+++ b/src/test/ui/nll/polonius/assignment-kills-loans.rs
@@ -1,7 +1,7 @@
#![allow(dead_code)]
// This tests the various kinds of assignments there are. Polonius used to generate `killed`
-// facts only on simple assigments, but not projections, incorrectly causing errors to be emitted
+// facts only on simple assignments, but not projections, incorrectly causing errors to be emitted
// for code accepted by NLL. They are all variations from example code in the NLL RFC.
// check-pass
diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
index c4db6fc97..05e2ea047 100644
--- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
+++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs
@@ -30,4 +30,5 @@ fn main() {
let _x = <fn(&())>::make_f();
//~^ ERROR implementation of `Y` is not general enough
//~| ERROR implementation of `Y` is not general enough
+ //~| ERROR implementation of `Y` is not general enough
}
diff --git a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
index 51adfca3e..b945ffedd 100644
--- a/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
+++ b/src/test/ui/nll/relate_tys/impl-fn-ignore-binder-via-bottom.stderr
@@ -4,7 +4,7 @@ error: implementation of `Y` is not general enough
LL | let _x = <fn(&())>::make_f();
| ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough
|
- = note: `Y` would have to be implemented for the type `for<'r> fn(&'r ())`
+ = note: `Y` would have to be implemented for the type `for<'a> fn(&'a ())`
= note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
error: implementation of `Y` is not general enough
@@ -13,8 +13,17 @@ error: implementation of `Y` is not general enough
LL | let _x = <fn(&())>::make_f();
| ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough
|
- = note: `Y` would have to be implemented for the type `for<'r> fn(&'r ())`
+ = note: `Y` would have to be implemented for the type `for<'a> fn(&'a ())`
= note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
-error: aborting due to 2 previous errors
+error: implementation of `Y` is not general enough
+ --> $DIR/impl-fn-ignore-binder-via-bottom.rs:30:14
+ |
+LL | let _x = <fn(&())>::make_f();
+ | ^^^^^^^^^^^^^^^^^^^ implementation of `Y` is not general enough
+ |
+ = note: `Y` would have to be implemented for the type `for<'a> fn(&'a ())`
+ = note: ...but `Y` is actually implemented for the type `fn(&'0 ())`, for some specific lifetime `'0`
+
+error: aborting due to 3 previous errors
diff --git a/src/test/ui/nll/relate_tys/universe-violation.stderr b/src/test/ui/nll/relate_tys/universe-violation.stderr
index 6f38154e3..fe801b42c 100644
--- a/src/test/ui/nll/relate_tys/universe-violation.stderr
+++ b/src/test/ui/nll/relate_tys/universe-violation.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | let b: fn(&u32) -> &u32 = a;
| ^ one type is more general than the other
|
- = note: expected fn pointer `for<'r> fn(&'r u32) -> &'r u32`
+ = note: expected fn pointer `for<'a> fn(&'a u32) -> &'a u32`
found fn pointer `fn(&u32) -> &u32`
error: aborting due to previous error
diff --git a/src/test/ui/nll/trait-associated-constant.stderr b/src/test/ui/nll/trait-associated-constant.stderr
index ae0ffd904..cf1c52ba7 100644
--- a/src/test/ui/nll/trait-associated-constant.stderr
+++ b/src/test/ui/nll/trait-associated-constant.stderr
@@ -2,7 +2,7 @@ error[E0308]: const not compatible with trait
--> $DIR/trait-associated-constant.rs:21:5
|
LL | const AC: Option<&'c str> = None;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected enum `Option<&'b str>`
found enum `Option<&'c str>`
diff --git a/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr b/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
index 330c6fafa..737cb3584 100644
--- a/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
+++ b/src/test/ui/nll/ty-outlives/impl-trait-captures.stderr
@@ -1,14 +1,14 @@
-error[E0700]: hidden type for `Opaque(DefId(0:11 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReStatic, T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds
+error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReStatic, 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> {
- | -- hidden type `&ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:13 ~ impl_trait_captures[1afc]::foo::'_), '_)) T` captures the anonymous lifetime 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
LL | x
| ^
|
-help: to declare that the `impl Trait` captures `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:13 ~ impl_trait_captures[1afc]::foo::'_), '_))`, you can add an explicit `ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:13 ~ impl_trait_captures[1afc]::foo::'_), '_))` lifetime bound
+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
|
-LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> + ReFree(DefId(0:8 ~ impl_trait_captures[1afc]::foo), BrNamed(DefId(0:13 ~ impl_trait_captures[1afc]::foo::'_), '_)) {
+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::'_), '_)) {
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
index feab24769..ee1f7b64b 100644
--- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr
@@ -18,11 +18,7 @@ note: no external requirements
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: Iterator,
-LL | | {
-LL | | with_signature(x, |mut y| Box::new(y.next()))
-LL | |
-LL | | }
- | |_^
+ | |________________^
|
= note: defining type: no_region::<'_#1r, T>
@@ -55,10 +51,7 @@ note: no external requirements
LL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: 'a + Iterator,
-LL | | {
-LL | | with_signature(x, |mut y| Box::new(y.next()))
-LL | | }
- | |_^
+ | |_____________________^
|
= note: defining type: correct_region::<'_#1r, T>
@@ -82,11 +75,7 @@ note: no external requirements
LL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: 'b + Iterator,
-LL | | {
-LL | | with_signature(x, |mut y| Box::new(y.next()))
-LL | |
-LL | | }
- | |_^
+ | |_____________________^
|
= note: defining type: wrong_region::<'_#1r, '_#2r, T>
@@ -120,10 +109,7 @@ LL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>
LL | | where
LL | | T: 'b + Iterator,
LL | | 'b: 'a,
-LL | | {
-LL | | with_signature(x, |mut y| Box::new(y.next()))
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: outlives_region::<'_#1r, '_#2r, T>
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
index 98063bd0a..4e57dfad7 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-closure.stderr
@@ -20,11 +20,7 @@ note: no external requirements
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
-LL | | {
-... |
-LL | |
-LL | | }
- | |_^
+ | |____________________^
|
= note: defining type: no_relationships_late::<'_#1r, T>
@@ -74,10 +70,7 @@ LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | 'a: 'a,
-... |
-LL | |
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, T>
@@ -126,10 +119,7 @@ LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |_____________________^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, T>
@@ -155,10 +145,8 @@ LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T: 'a,
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+LL | | 'b: 'a,
+ | |___________^
|
= note: defining type: elements_outlive::<'_#1r, '_#2r, T>
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
index 45e61bcbd..250c796e2 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-closure.stderr
@@ -19,11 +19,7 @@ note: no external requirements
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | |
-LL | | }
- | |_^
+ | |____________________^
|
= note: defining type: no_relationships_late::<'_#1r, T>
@@ -61,10 +57,7 @@ LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | 'a: 'a,
-... |
-LL | |
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, T>
@@ -102,10 +95,7 @@ LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |_____________________^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, T>
@@ -130,10 +120,7 @@ LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | 'b: 'a,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: elements_outlive::<'_#1r, '_#2r, T>
@@ -157,11 +144,7 @@ note: no external requirements
LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'a>,
-LL | | {
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |____________________^
|
= note: defining type: one_region::<'_#1r, T>
diff --git a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
index f2549205b..b27186b05 100644
--- a/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-one-region-trait-bound-static-closure.stderr
@@ -17,10 +17,7 @@ note: no external requirements
LL | / fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |____________________^
|
= note: defining type: no_relationships_late::<'_#1r, T>
@@ -43,10 +40,7 @@ LL | / fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | 'a: 'a,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, T>
@@ -69,10 +63,7 @@ LL | / fn projection_outlives<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | T::AssocType: 'a,
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |_____________________^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, T>
@@ -95,10 +86,7 @@ LL | / fn elements_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b>,
LL | | 'b: 'a,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: elements_outlive::<'_#1r, '_#2r, T>
@@ -120,11 +108,7 @@ note: no external requirements
LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'a>,
-LL | | {
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |____________________^
|
= note: defining type: one_region::<'_#1r, T>
diff --git a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
index 8e1b6fa2e..0195a693e 100644
--- a/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
+++ b/src/test/ui/nll/ty-outlives/projection-two-region-trait-bound-closure.stderr
@@ -19,11 +19,7 @@ note: no external requirements
LL | / fn no_relationships_late<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | |
-LL | | }
- | |_^
+ | |________________________^
|
= note: defining type: no_relationships_late::<'_#1r, '_#2r, T>
@@ -57,10 +53,7 @@ LL | / fn no_relationships_early<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | 'a: 'a,
-... |
-LL | |
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: no_relationships_early::<'_#1r, '_#2r, '_#3r, T>
@@ -94,10 +87,7 @@ LL | / fn projection_outlives<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | T::AssocType: 'a,
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |_____________________^
|
= note: defining type: projection_outlives::<'_#1r, '_#2r, '_#3r, T>
@@ -122,10 +112,7 @@ LL | / fn elements_outlive1<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | 'b: 'a,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: elements_outlive1::<'_#1r, '_#2r, '_#3r, T>
@@ -150,10 +137,7 @@ LL | / fn elements_outlive2<'a, 'b, 'c, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'c>,
LL | | 'c: 'a,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: elements_outlive2::<'_#1r, '_#2r, '_#3r, T>
@@ -178,11 +162,7 @@ note: no external requirements
LL | / fn two_regions<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'b>,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | |
-LL | | }
- | |_^
+ | |________________________^
|
= note: defining type: two_regions::<'_#1r, T>
@@ -220,10 +200,7 @@ LL | / fn two_regions_outlive<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'b, 'b>,
LL | | 'b: 'a,
-LL | | {
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: two_regions_outlive::<'_#1r, '_#2r, T>
@@ -247,11 +224,7 @@ note: no external requirements
LL | / fn one_region<'a, T>(cell: Cell<&'a ()>, t: T)
LL | | where
LL | | T: Anything<'a, 'a>,
-LL | | {
-... |
-LL | | with_signature(cell, t, |cell, t| require(cell, t));
-LL | | }
- | |_^
+ | |________________________^
|
= note: defining type: one_region::<'_#1r, T>
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
index 12c76d198..61c7d2550 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
@@ -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<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) T)),
+ for<'a, 'b> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) T)),
(),
]
= note: number of external vids: 2
@@ -15,11 +15,8 @@ LL | twice(cell, value, |a, b| invoke(a, b));
note: no external requirements
--> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1
|
-LL | / fn generic<T>(value: T) {
-LL | | let cell = Cell::new(&());
-LL | | twice(cell, value, |a, b| invoke(a, b));
-LL | | }
- | |_^
+LL | fn generic<T>(value: T) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: generic::<T>
@@ -31,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<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) T)),
+ for<'a, 'b> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('a) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('b) }) T)),
(),
]
= note: late-bound region is '_#2r
@@ -41,11 +38,8 @@ LL | twice(cell, value, |a, b| invoke(a, b));
note: no external requirements
--> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1
|
-LL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
-LL | | twice(cell, value, |a, b| invoke(a, b));
-LL | |
-LL | | }
- | |_^
+LL | fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: generic_fail::<T>
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
index 35741859d..50d9e3aab 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr
@@ -18,11 +18,7 @@ note: no external requirements
LL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
LL | | where
LL | | T: Debug,
-LL | | {
-... |
-LL | |
-LL | | }
- | |_^
+ | |_____________^
|
= note: defining type: no_region::<'_#1r, T>
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
index 0261bc39e..14c55e32a 100644
--- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr
@@ -16,14 +16,8 @@ LL | with_signature(a, b, |x, y| {
note: no external requirements
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:26:1
|
-LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
-LL | | with_signature(a, b, |x, y| {
-LL | |
-LL | | //
-... |
-LL | | })
-LL | | }
- | |_^
+LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: defining type: no_region::<T>
@@ -65,11 +59,7 @@ note: no external requirements
LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'a,
-LL | | {
-... |
-LL | | })
-LL | | }
- | |_^
+ | |__________^
|
= note: defining type: correct_region::<'_#1r, T>
@@ -94,11 +84,7 @@ note: no external requirements
LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
-LL | | {
-... |
-LL | | })
-LL | | }
- | |_^
+ | |__________^
|
= note: defining type: wrong_region::<'_#1r, T>
@@ -139,10 +125,7 @@ LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
LL | | where
LL | | T: 'b,
LL | | 'b: 'a,
-... |
-LL | | })
-LL | | }
- | |_^
+ | |___________^
|
= note: defining type: outlives_region::<'_#1r, '_#2r, T>
diff --git a/src/test/ui/nll/type-test-universe.stderr b/src/test/ui/nll/type-test-universe.stderr
index 242486c36..31e17d64b 100644
--- a/src/test/ui/nll/type-test-universe.stderr
+++ b/src/test/ui/nll/type-test-universe.stderr
@@ -11,6 +11,12 @@ LL | fn test2<'a>() {
| -- lifetime `'a` defined here
LL | outlives_forall::<Value<'a>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+ |
+note: due to current limitations in the borrow checker, this implies a `'static` lifetime
+ --> $DIR/type-test-universe.rs:6:16
+ |
+LL | for<'u> T: 'u,
+ | ^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr b/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr
index ee332278c..3326fa521 100644
--- a/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr
+++ b/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr
@@ -30,14 +30,15 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-LL | let _closure = || {
- | - `c` dropped here while still borrowed
...
LL | SomeEnum::SomeVariant(Cell::new(&c)),
| ----------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
+...
+LL | };
+ | - `c` dropped here while still borrowed
error: aborting due to 3 previous errors
diff --git a/src/test/ui/nll/user-annotations/adt-tuple-struct-calls.stderr b/src/test/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
index 95bbd62c4..9664fb9f5 100644
--- a/src/test/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
+++ b/src/test/ui/nll/user-annotations/adt-tuple-struct-calls.stderr
@@ -28,28 +28,28 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-LL | let _closure = || {
- | - `c` dropped here while still borrowed
...
LL | f(&c);
| --^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
+LL | };
+ | - `c` dropped here while still borrowed
error[E0597]: `c` does not live long enough
--> $DIR/adt-tuple-struct-calls.rs:53:11
|
LL | let f = SomeStruct::<&'a u32>;
| - lifetime `'1` appears in the type of `f`
-LL | let _closure = || {
- | - `c` dropped here while still borrowed
-LL | let c = 66;
+...
LL | f(&c);
| --^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'1`
+LL | };
+ | - `c` dropped here while still borrowed
error: aborting due to 4 previous errors
diff --git a/src/test/ui/nll/user-annotations/fns.stderr b/src/test/ui/nll/user-annotations/fns.stderr
index bd4d121d5..e0640da39 100644
--- a/src/test/ui/nll/user-annotations/fns.stderr
+++ b/src/test/ui/nll/user-annotations/fns.stderr
@@ -28,14 +28,14 @@ error[E0597]: `c` does not live long enough
|
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
-LL | let _closure = || {
- | - `c` dropped here while still borrowed
-LL | let c = 66;
+...
LL | some_fn::<&'a u32>(&c);
| -------------------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
+LL | };
+ | - `c` dropped here while still borrowed
error: aborting due to 3 previous errors
diff --git a/src/test/ui/nll/user-annotations/method-call.stderr b/src/test/ui/nll/user-annotations/method-call.stderr
index fcaeb465d..10447e45a 100644
--- a/src/test/ui/nll/user-annotations/method-call.stderr
+++ b/src/test/ui/nll/user-annotations/method-call.stderr
@@ -29,14 +29,13 @@ error[E0597]: `c` does not live long enough
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
...
-LL | let _closure = || {
- | - `c` dropped here while still borrowed
-LL | let c = 66;
LL | a.method::<&'a u32>(b, &c);
| ------------------------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
+LL | };
+ | - `c` dropped here while still borrowed
error: aborting due to 3 previous errors
diff --git a/src/test/ui/nll/user-annotations/method-ufcs-3.stderr b/src/test/ui/nll/user-annotations/method-ufcs-3.stderr
index 328dde980..e7851833e 100644
--- a/src/test/ui/nll/user-annotations/method-ufcs-3.stderr
+++ b/src/test/ui/nll/user-annotations/method-ufcs-3.stderr
@@ -29,14 +29,13 @@ error[E0597]: `c` does not live long enough
LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) {
| -- lifetime `'a` defined here
...
-LL | let _closure = || {
- | - `c` dropped here while still borrowed
-LL | let c = 66;
LL | <_ as Bazoom<_>>::method::<&'a u32>(&a, b, &c);
| -------------------------------------------^^-
| | |
| | borrowed value does not live long enough
| argument requires that `c` is borrowed for `'a`
+LL | };
+ | - `c` dropped here while still borrowed
error: aborting due to 3 previous errors
diff --git a/src/test/ui/no-patterns-in-args-2.stderr b/src/test/ui/no-patterns-in-args-2.stderr
index 98932349a..6adcbb9dc 100644
--- a/src/test/ui/no-patterns-in-args-2.stderr
+++ b/src/test/ui/no-patterns-in-args-2.stderr
@@ -10,13 +10,13 @@ error: patterns aren't allowed in functions without bodies
LL | fn f1(mut arg: u8);
| ^^^^^^^ help: remove `mut` from the parameter: `arg`
|
+ = 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 #35203 <https://github.com/rust-lang/rust/issues/35203>
note: the lint level is defined here
--> $DIR/no-patterns-in-args-2.rs:1:9
|
LL | #![deny(patterns_in_fns_without_body)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #35203 <https://github.com/rust-lang/rust/issues/35203>
error: aborting due to 2 previous errors
diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr
index 249c2fe2f..c864b93db 100644
--- a/src/test/ui/no-send-res-ports.stderr
+++ b/src/test/ui/no-send-res-ports.stderr
@@ -1,10 +1,17 @@
error[E0277]: `Rc<()>` cannot be sent between threads safely
- --> $DIR/no-send-res-ports.rs:25:5
+ --> $DIR/no-send-res-ports.rs:25:19
|
-LL | thread::spawn(move|| {
- | ^^^^^^^^^^^^^ ------ within this `[closure@$DIR/no-send-res-ports.rs:25:19: 25:25]`
- | |
- | `Rc<()>` cannot be sent between threads safely
+LL | thread::spawn(move|| {
+ | ------------- ^-----
+ | | |
+ | _____|_____________within this `[closure@$DIR/no-send-res-ports.rs:25:19: 25:25]`
+ | | |
+ | | required by a bound introduced by this call
+LL | |
+LL | | let y = x;
+LL | | println!("{:?}", y);
+LL | | });
+ | |_____^ `Rc<()>` cannot be sent between threads safely
|
= help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 25:25]`, the trait `Send` is not implemented for `Rc<()>`
note: required because it appears within the type `Port<()>`
diff --git a/src/test/ui/non-fmt-panic.stderr b/src/test/ui/non-fmt-panic.stderr
index 6e4434e6f..162802b7f 100644
--- a/src/test/ui/non-fmt-panic.stderr
+++ b/src/test/ui/non-fmt-panic.stderr
@@ -4,8 +4,8 @@ warning: panic message contains a brace
LL | panic!("here's a brace: {");
| ^
|
- = note: `#[warn(non_fmt_panics)]` on by default
= note: this message is not used as a format string, but will be in Rust 2021
+ = note: `#[warn(non_fmt_panics)]` on by default
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", "here's a brace: {");
diff --git a/src/test/ui/not-clone-closure.stderr b/src/test/ui/not-clone-closure.stderr
index 37d94cf0e..f61ee661b 100644
--- a/src/test/ui/not-clone-closure.stderr
+++ b/src/test/ui/not-clone-closure.stderr
@@ -1,11 +1,13 @@
error[E0277]: the trait bound `S: Clone` is not satisfied in `[closure@$DIR/not-clone-closure.rs:7:17: 7:24]`
- --> $DIR/not-clone-closure.rs:11:23
+ --> $DIR/not-clone-closure.rs:11:17
|
LL | let hello = move || {
| ------- within this `[closure@$DIR/not-clone-closure.rs:7:17: 7:24]`
...
LL | let hello = hello.clone();
- | ^^^^^ within `[closure@$DIR/not-clone-closure.rs:7:17: 7:24]`, the trait `Clone` is not implemented for `S`
+ | ^^^^^ ----- required by a bound introduced by this call
+ | |
+ | within `[closure@$DIR/not-clone-closure.rs:7:17: 7:24]`, the trait `Clone` is not implemented for `S`
|
note: required because it's used within this closure
--> $DIR/not-clone-closure.rs:7:17
diff --git a/src/test/ui/not-enough-arguments.stderr b/src/test/ui/not-enough-arguments.stderr
index b1df578ea..8b2dafb4e 100644
--- a/src/test/ui/not-enough-arguments.stderr
+++ b/src/test/ui/not-enough-arguments.stderr
@@ -12,7 +12,7 @@ LL | fn foo(a: isize, b: isize, c: isize, d:isize) {
help: provide the argument
|
LL | foo(1, 2, 3, /* isize */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 6 arguments but 3 arguments were supplied
--> $DIR/not-enough-arguments.rs:29:3
@@ -40,7 +40,7 @@ LL | f: i32,
help: provide the arguments
|
LL | bar(1, 2, 3, /* i32 */, /* i32 */, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/not-panic/not-panic-safe-2.stderr b/src/test/ui/not-panic/not-panic-safe-2.stderr
index 65594702b..3b0f83b3b 100644
--- a/src/test/ui/not-panic/not-panic-safe-2.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-2.stderr
@@ -1,12 +1,12 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-2.rs:10:5
+ --> $DIR/not-panic-safe-2.rs:10:14
|
LL | assert::<Rc<RefCell<i32>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `Rc<RefCell<i32>>`
+ = note: required for `Rc<RefCell<i32>>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-2.rs:7:14
|
@@ -14,15 +14,15 @@ LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-2.rs:10:5
+ --> $DIR/not-panic-safe-2.rs:10:14
|
LL | assert::<Rc<RefCell<i32>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `Rc<RefCell<i32>>`
+ = note: required for `Rc<RefCell<i32>>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-2.rs:7:14
|
diff --git a/src/test/ui/not-panic/not-panic-safe-3.stderr b/src/test/ui/not-panic/not-panic-safe-3.stderr
index db3fdb253..9e9a12764 100644
--- a/src/test/ui/not-panic/not-panic-safe-3.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-3.stderr
@@ -1,12 +1,12 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-3.rs:10:5
+ --> $DIR/not-panic-safe-3.rs:10:14
|
LL | assert::<Arc<RefCell<i32>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `Arc<RefCell<i32>>`
+ = note: required for `Arc<RefCell<i32>>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-3.rs:7:14
|
@@ -14,15 +14,15 @@ LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-3.rs:10:5
+ --> $DIR/not-panic-safe-3.rs:10:14
|
LL | assert::<Arc<RefCell<i32>>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `Arc<RefCell<i32>>`
+ = note: required for `Arc<RefCell<i32>>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-3.rs:7:14
|
diff --git a/src/test/ui/not-panic/not-panic-safe-4.stderr b/src/test/ui/not-panic/not-panic-safe-4.stderr
index 079601b39..fc1c594d0 100644
--- a/src/test/ui/not-panic/not-panic-safe-4.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-4.stderr
@@ -1,12 +1,12 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-4.rs:9:5
+ --> $DIR/not-panic-safe-4.rs:9:14
|
LL | assert::<&RefCell<i32>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `&RefCell<i32>`
+ = note: required for `&RefCell<i32>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-4.rs:6:14
|
@@ -14,15 +14,15 @@ LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-4.rs:9:5
+ --> $DIR/not-panic-safe-4.rs:9:14
|
LL | assert::<&RefCell<i32>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `&RefCell<i32>`
+ = note: required for `&RefCell<i32>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-4.rs:6:14
|
diff --git a/src/test/ui/not-panic/not-panic-safe-5.stderr b/src/test/ui/not-panic/not-panic-safe-5.stderr
index edd0f72dd..cb78370b4 100644
--- a/src/test/ui/not-panic/not-panic-safe-5.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-5.stderr
@@ -1,11 +1,11 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-5.rs:9:5
+ --> $DIR/not-panic-safe-5.rs:9:14
|
LL | assert::<*const UnsafeCell<i32>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `*const UnsafeCell<i32>`
+ = note: required for `*const UnsafeCell<i32>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-5.rs:6:14
|
diff --git a/src/test/ui/not-panic/not-panic-safe-6.stderr b/src/test/ui/not-panic/not-panic-safe-6.stderr
index f3b784a29..7986e341e 100644
--- a/src/test/ui/not-panic/not-panic-safe-6.stderr
+++ b/src/test/ui/not-panic/not-panic-safe-6.stderr
@@ -1,12 +1,12 @@
error[E0277]: the type `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-6.rs:9:5
+ --> $DIR/not-panic-safe-6.rs:9:14
|
LL | assert::<*mut RefCell<i32>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^^^^^ `UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<i32>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `*mut RefCell<i32>`
+ = note: required for `*mut RefCell<i32>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-6.rs:6:14
|
@@ -14,15 +14,15 @@ LL | fn assert<T: UnwindSafe + ?Sized>() {}
| ^^^^^^^^^^ required by this bound in `assert`
error[E0277]: the type `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
- --> $DIR/not-panic-safe-6.rs:9:5
+ --> $DIR/not-panic-safe-6.rs:9:14
|
LL | assert::<*mut RefCell<i32>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
+ | ^^^^^^^^^^^^^^^^^ `UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `RefCell<i32>`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<isize>`
= note: required because it appears within the type `Cell<isize>`
= note: required because it appears within the type `RefCell<i32>`
- = note: required because of the requirements on the impl of `UnwindSafe` for `*mut RefCell<i32>`
+ = note: required for `*mut RefCell<i32>` to implement `UnwindSafe`
note: required by a bound in `assert`
--> $DIR/not-panic-safe-6.rs:6:14
|
diff --git a/src/test/ui/numbers-arithmetic/float-int-invalid-const-cast.rs b/src/test/ui/numbers-arithmetic/float-int-invalid-const-cast.rs
index 769114960..260281d75 100644
--- a/src/test/ui/numbers-arithmetic/float-int-invalid-const-cast.rs
+++ b/src/test/ui/numbers-arithmetic/float-int-invalid-const-cast.rs
@@ -1,7 +1,5 @@
// run-pass
-#![deny(const_err)]
-
// Forces evaluation of constants, triggering hard error
fn force<T>(_: T) {}
diff --git a/src/test/ui/numbers-arithmetic/issue-8460-const.noopt.stderr b/src/test/ui/numbers-arithmetic/issue-8460-const.noopt.stderr
index e2eee1ccd..c4abcb784 100644
--- a/src/test/ui/numbers-arithmetic/issue-8460-const.noopt.stderr
+++ b/src/test/ui/numbers-arithmetic/issue-8460-const.noopt.stderr
@@ -1,5 +1,5 @@
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:13:36
+ --> $DIR/issue-8460-const.rs:11:36
|
LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow
@@ -7,139 +7,139 @@ LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
= note: `#[deny(unconditional_panic)]` on by default
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:15:36
+ --> $DIR/issue-8460-const.rs:13:36
|
LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:17:36
+ --> $DIR/issue-8460-const.rs:15:36
|
LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:19:36
+ --> $DIR/issue-8460-const.rs:17:36
|
LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:21:36
+ --> $DIR/issue-8460-const.rs:19:36
|
LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:23:36
+ --> $DIR/issue-8460-const.rs:21:36
|
LL | assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:25:36
+ --> $DIR/issue-8460-const.rs:23:36
|
LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
| ^^^^^^^^^^ attempt to divide `1_isize` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:27:36
+ --> $DIR/issue-8460-const.rs:25:36
|
LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
| ^^^^^^^ attempt to divide `1_i8` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:29:36
+ --> $DIR/issue-8460-const.rs:27:36
|
LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i16` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:31:36
+ --> $DIR/issue-8460-const.rs:29:36
|
LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i32` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:33:36
+ --> $DIR/issue-8460-const.rs:31:36
|
LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i64` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:35:36
+ --> $DIR/issue-8460-const.rs:33:36
|
LL | assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err());
| ^^^^^^^^^ attempt to divide `1_i128` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:37:36
+ --> $DIR/issue-8460-const.rs:35:36
|
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:39:36
+ --> $DIR/issue-8460-const.rs:37:36
|
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:41:36
+ --> $DIR/issue-8460-const.rs:39:36
|
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:43:36
+ --> $DIR/issue-8460-const.rs:41:36
|
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:45:36
+ --> $DIR/issue-8460-const.rs:43:36
|
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:47:36
+ --> $DIR/issue-8460-const.rs:45:36
|
LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:49:36
+ --> $DIR/issue-8460-const.rs:47:36
|
LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
| ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:51:36
+ --> $DIR/issue-8460-const.rs:49:36
|
LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
| ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:53:36
+ --> $DIR/issue-8460-const.rs:51:36
|
LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:55:36
+ --> $DIR/issue-8460-const.rs:53:36
|
LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:57:36
+ --> $DIR/issue-8460-const.rs:55:36
|
LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:59:36
+ --> $DIR/issue-8460-const.rs:57:36
|
LL | assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err());
| ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
diff --git a/src/test/ui/numbers-arithmetic/issue-8460-const.opt.stderr b/src/test/ui/numbers-arithmetic/issue-8460-const.opt.stderr
index e2eee1ccd..c4abcb784 100644
--- a/src/test/ui/numbers-arithmetic/issue-8460-const.opt.stderr
+++ b/src/test/ui/numbers-arithmetic/issue-8460-const.opt.stderr
@@ -1,5 +1,5 @@
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:13:36
+ --> $DIR/issue-8460-const.rs:11:36
|
LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow
@@ -7,139 +7,139 @@ LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
= note: `#[deny(unconditional_panic)]` on by default
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:15:36
+ --> $DIR/issue-8460-const.rs:13:36
|
LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:17:36
+ --> $DIR/issue-8460-const.rs:15:36
|
LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:19:36
+ --> $DIR/issue-8460-const.rs:17:36
|
LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:21:36
+ --> $DIR/issue-8460-const.rs:19:36
|
LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:23:36
+ --> $DIR/issue-8460-const.rs:21:36
|
LL | assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:25:36
+ --> $DIR/issue-8460-const.rs:23:36
|
LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
| ^^^^^^^^^^ attempt to divide `1_isize` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:27:36
+ --> $DIR/issue-8460-const.rs:25:36
|
LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
| ^^^^^^^ attempt to divide `1_i8` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:29:36
+ --> $DIR/issue-8460-const.rs:27:36
|
LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i16` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:31:36
+ --> $DIR/issue-8460-const.rs:29:36
|
LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i32` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:33:36
+ --> $DIR/issue-8460-const.rs:31:36
|
LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i64` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:35:36
+ --> $DIR/issue-8460-const.rs:33:36
|
LL | assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err());
| ^^^^^^^^^ attempt to divide `1_i128` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:37:36
+ --> $DIR/issue-8460-const.rs:35:36
|
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:39:36
+ --> $DIR/issue-8460-const.rs:37:36
|
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:41:36
+ --> $DIR/issue-8460-const.rs:39:36
|
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:43:36
+ --> $DIR/issue-8460-const.rs:41:36
|
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:45:36
+ --> $DIR/issue-8460-const.rs:43:36
|
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:47:36
+ --> $DIR/issue-8460-const.rs:45:36
|
LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:49:36
+ --> $DIR/issue-8460-const.rs:47:36
|
LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
| ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:51:36
+ --> $DIR/issue-8460-const.rs:49:36
|
LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
| ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:53:36
+ --> $DIR/issue-8460-const.rs:51:36
|
LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:55:36
+ --> $DIR/issue-8460-const.rs:53:36
|
LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:57:36
+ --> $DIR/issue-8460-const.rs:55:36
|
LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:59:36
+ --> $DIR/issue-8460-const.rs:57:36
|
LL | assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err());
| ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
diff --git a/src/test/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr b/src/test/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr
index e2eee1ccd..c4abcb784 100644
--- a/src/test/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr
+++ b/src/test/ui/numbers-arithmetic/issue-8460-const.opt_with_overflow_checks.stderr
@@ -1,5 +1,5 @@
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:13:36
+ --> $DIR/issue-8460-const.rs:11:36
|
LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^^^ attempt to compute `isize::MIN / -1_isize`, which would overflow
@@ -7,139 +7,139 @@ LL | assert!(thread::spawn(move|| { isize::MIN / -1; }).join().is_err());
= note: `#[deny(unconditional_panic)]` on by default
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:15:36
+ --> $DIR/issue-8460-const.rs:13:36
|
LL | assert!(thread::spawn(move|| { i8::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^ attempt to compute `i8::MIN / -1_i8`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:17:36
+ --> $DIR/issue-8460-const.rs:15:36
|
LL | assert!(thread::spawn(move|| { i16::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i16::MIN / -1_i16`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:19:36
+ --> $DIR/issue-8460-const.rs:17:36
|
LL | assert!(thread::spawn(move|| { i32::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i32::MIN / -1_i32`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:21:36
+ --> $DIR/issue-8460-const.rs:19:36
|
LL | assert!(thread::spawn(move|| { i64::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute `i64::MIN / -1_i64`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:23:36
+ --> $DIR/issue-8460-const.rs:21:36
|
LL | assert!(thread::spawn(move|| { i128::MIN / -1; }).join().is_err());
| ^^^^^^^^^^^^^^ attempt to compute `i128::MIN / -1_i128`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:25:36
+ --> $DIR/issue-8460-const.rs:23:36
|
LL | assert!(thread::spawn(move|| { 1isize / 0; }).join().is_err());
| ^^^^^^^^^^ attempt to divide `1_isize` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:27:36
+ --> $DIR/issue-8460-const.rs:25:36
|
LL | assert!(thread::spawn(move|| { 1i8 / 0; }).join().is_err());
| ^^^^^^^ attempt to divide `1_i8` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:29:36
+ --> $DIR/issue-8460-const.rs:27:36
|
LL | assert!(thread::spawn(move|| { 1i16 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i16` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:31:36
+ --> $DIR/issue-8460-const.rs:29:36
|
LL | assert!(thread::spawn(move|| { 1i32 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i32` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:33:36
+ --> $DIR/issue-8460-const.rs:31:36
|
LL | assert!(thread::spawn(move|| { 1i64 / 0; }).join().is_err());
| ^^^^^^^^ attempt to divide `1_i64` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:35:36
+ --> $DIR/issue-8460-const.rs:33:36
|
LL | assert!(thread::spawn(move|| { 1i128 / 0; }).join().is_err());
| ^^^^^^^^^ attempt to divide `1_i128` by zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:37:36
+ --> $DIR/issue-8460-const.rs:35:36
|
LL | assert!(thread::spawn(move|| { isize::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^^^ attempt to compute the remainder of `isize::MIN % -1_isize`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:39:36
+ --> $DIR/issue-8460-const.rs:37:36
|
LL | assert!(thread::spawn(move|| { i8::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^ attempt to compute the remainder of `i8::MIN % -1_i8`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:41:36
+ --> $DIR/issue-8460-const.rs:39:36
|
LL | assert!(thread::spawn(move|| { i16::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i16::MIN % -1_i16`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:43:36
+ --> $DIR/issue-8460-const.rs:41:36
|
LL | assert!(thread::spawn(move|| { i32::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i32::MIN % -1_i32`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:45:36
+ --> $DIR/issue-8460-const.rs:43:36
|
LL | assert!(thread::spawn(move|| { i64::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^ attempt to compute the remainder of `i64::MIN % -1_i64`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:47:36
+ --> $DIR/issue-8460-const.rs:45:36
|
LL | assert!(thread::spawn(move|| { i128::MIN % -1; }).join().is_err());
| ^^^^^^^^^^^^^^ attempt to compute the remainder of `i128::MIN % -1_i128`, which would overflow
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:49:36
+ --> $DIR/issue-8460-const.rs:47:36
|
LL | assert!(thread::spawn(move|| { 1isize % 0; }).join().is_err());
| ^^^^^^^^^^ attempt to calculate the remainder of `1_isize` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:51:36
+ --> $DIR/issue-8460-const.rs:49:36
|
LL | assert!(thread::spawn(move|| { 1i8 % 0; }).join().is_err());
| ^^^^^^^ attempt to calculate the remainder of `1_i8` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:53:36
+ --> $DIR/issue-8460-const.rs:51:36
|
LL | assert!(thread::spawn(move|| { 1i16 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i16` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:55:36
+ --> $DIR/issue-8460-const.rs:53:36
|
LL | assert!(thread::spawn(move|| { 1i32 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i32` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:57:36
+ --> $DIR/issue-8460-const.rs:55:36
|
LL | assert!(thread::spawn(move|| { 1i64 % 0; }).join().is_err());
| ^^^^^^^^ attempt to calculate the remainder of `1_i64` with a divisor of zero
error: this operation will panic at runtime
- --> $DIR/issue-8460-const.rs:59:36
+ --> $DIR/issue-8460-const.rs:57:36
|
LL | assert!(thread::spawn(move|| { 1i128 % 0; }).join().is_err());
| ^^^^^^^^^ attempt to calculate the remainder of `1_i128` with a divisor of zero
diff --git a/src/test/ui/numbers-arithmetic/issue-8460-const.rs b/src/test/ui/numbers-arithmetic/issue-8460-const.rs
index 8cad6deb3..02e7567da 100644
--- a/src/test/ui/numbers-arithmetic/issue-8460-const.rs
+++ b/src/test/ui/numbers-arithmetic/issue-8460-const.rs
@@ -5,8 +5,6 @@
// build-fail
-#![deny(const_err)]
-
use std::thread;
fn main() {
diff --git a/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs b/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs
index f857d4f4c..79d78da33 100644
--- a/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs
+++ b/src/test/ui/numbers-arithmetic/next-power-of-two-overflow-debug.rs
@@ -1,7 +1,6 @@
// run-pass
// compile-flags: -C debug_assertions=yes
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten dies with an LLVM error
use std::panic;
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs
index e5ce80336..7f8b0c877 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _x = 1_i32 << 32;
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr
index 1d029939c..434c9d5b4 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-1.stderr
@@ -7,7 +7,7 @@ LL | let _x = 1_i32 << 32;
note: the lint level is defined here
--> $DIR/overflowing-lsh-1.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs
index 7fd3407a0..76718ecd1 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _x = 1 << -1;
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr
index 8598792e0..c3b44e5a0 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-2.stderr
@@ -7,7 +7,7 @@ LL | let _x = 1 << -1;
note: the lint level is defined here
--> $DIR/overflowing-lsh-2.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs
index e007eb4a2..b2bdd09bf 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _x = 1_u64 << 64;
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr
index 9c6f806f1..9d6479bd7 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-3.stderr
@@ -7,7 +7,7 @@ LL | let _x = 1_u64 << 64;
note: the lint level is defined here
--> $DIR/overflowing-lsh-3.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs
index 738d01339..1042bfcb3 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.rs
@@ -4,7 +4,7 @@
// This function is checking that our automatic truncation does not
// sidestep the overflow checking.
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
// this signals overflow when checking is on
diff --git a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr
index 08081a0b7..2bb5b6a6d 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-lsh-4.stderr
@@ -7,7 +7,7 @@ LL | let x = 1_i8 << 17;
note: the lint level is defined here
--> $DIR/overflowing-lsh-4.rs:7:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs
index f1488cf85..80593c865 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _x = -1_i32 >> 32;
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr
index 4d726fa7f..b2b3114d1 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-1.stderr
@@ -7,7 +7,7 @@ LL | let _x = -1_i32 >> 32;
note: the lint level is defined here
--> $DIR/overflowing-rsh-1.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs
index 39127b970..917352bfc 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _x = -1_i32 >> -1;
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr
index 9a8349d5d..ad18c3bb7 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-2.stderr
@@ -7,7 +7,7 @@ LL | let _x = -1_i32 >> -1;
note: the lint level is defined here
--> $DIR/overflowing-rsh-2.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs
index 8ee6dde93..1e052990a 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _x = -1_i64 >> 64;
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr
index f48b7ff6d..37d02e09d 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-3.stderr
@@ -7,7 +7,7 @@ LL | let _x = -1_i64 >> 64;
note: the lint level is defined here
--> $DIR/overflowing-rsh-3.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs
index ce7f818e3..be918becd 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.rs
@@ -4,7 +4,7 @@
// This function is checking that our (type-based) automatic
// truncation does not sidestep the overflow checking.
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
// this signals overflow when checking is on
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr
index 4816a3899..692602c07 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-4.stderr
@@ -7,7 +7,7 @@ LL | let x = 2_i8 >> 17;
note: the lint level is defined here
--> $DIR/overflowing-rsh-4.rs:7:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs
index 88928c995..f75e779ed 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _n = 1i64 >> [64][0];
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr
index cd36f543d..e3b5859df 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-5.stderr
@@ -7,7 +7,7 @@ LL | let _n = 1i64 >> [64][0];
note: the lint level is defined here
--> $DIR/overflowing-rsh-5.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs
index 88928c995..f75e779ed 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.rs
@@ -1,7 +1,7 @@
// build-fail
// compile-flags: -C debug-assertions
-#![deny(arithmetic_overflow, const_err)]
+#![deny(arithmetic_overflow)]
fn main() {
let _n = 1i64 >> [64][0];
diff --git a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr
index bec8b17df..a3475c04c 100644
--- a/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr
+++ b/src/test/ui/numbers-arithmetic/overflowing-rsh-6.stderr
@@ -7,7 +7,7 @@ LL | let _n = 1i64 >> [64][0];
note: the lint level is defined here
--> $DIR/overflowing-rsh-6.rs:4:9
|
-LL | #![deny(arithmetic_overflow, const_err)]
+LL | #![deny(arithmetic_overflow)]
| ^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs b/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs
index 4785abbc5..76279e913 100644
--- a/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs
+++ b/src/test/ui/numbers-arithmetic/promoted_overflow_opt.rs
@@ -1,5 +1,4 @@
// run-pass
-#![allow(const_err)]
// compile-flags: -O
diff --git a/src/test/ui/object-lifetime/object-lifetime-default.rs b/src/test/ui/object-lifetime/object-lifetime-default.rs
index 60b6629e6..74f5bb7dd 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default.rs
+++ b/src/test/ui/object-lifetime/object-lifetime-default.rs
@@ -1,24 +1,50 @@
#![feature(rustc_attrs)]
#[rustc_object_lifetime_default]
-struct A<T>(T); //~ ERROR BaseDefault
+struct A<
+ T, //~ ERROR BaseDefault
+>(T);
#[rustc_object_lifetime_default]
-struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
+struct B<
+ 'a,
+ T, //~ ERROR BaseDefault
+>(&'a (), T);
#[rustc_object_lifetime_default]
-struct C<'a,T:'a>(&'a T); //~ ERROR 'a
+struct C<
+ 'a,
+ T: 'a, //~ ERROR 'a
+>(&'a T);
#[rustc_object_lifetime_default]
-struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous
+struct D<
+ 'a,
+ 'b,
+ T: 'a + 'b, //~ ERROR Ambiguous
+>(&'a T, &'b T);
#[rustc_object_lifetime_default]
-struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
+struct E<
+ 'a,
+ 'b: 'a,
+ T: 'b, //~ ERROR 'b
+>(&'a T, &'b T);
#[rustc_object_lifetime_default]
-struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b
+struct F<
+ 'a,
+ 'b,
+ T: 'a, //~ ERROR 'a
+ U: 'b, //~ ERROR 'b
+>(&'a T, &'b U);
#[rustc_object_lifetime_default]
-struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
-
-fn main() { }
+struct G<
+ 'a,
+ 'b,
+ T: 'a, //~ ERROR 'a
+ U: 'a + 'b, //~ ERROR Ambiguous
+>(&'a T, &'b U);
+
+fn main() {}
diff --git a/src/test/ui/object-lifetime/object-lifetime-default.stderr b/src/test/ui/object-lifetime/object-lifetime-default.stderr
index 60cb98c8f..a58afad3e 100644
--- a/src/test/ui/object-lifetime/object-lifetime-default.stderr
+++ b/src/test/ui/object-lifetime/object-lifetime-default.stderr
@@ -1,44 +1,56 @@
error: BaseDefault
- --> $DIR/object-lifetime-default.rs:4:1
+ --> $DIR/object-lifetime-default.rs:5:5
|
-LL | struct A<T>(T);
- | ^^^^^^^^^^^^^^^
+LL | T,
+ | ^
error: BaseDefault
- --> $DIR/object-lifetime-default.rs:7:1
+ --> $DIR/object-lifetime-default.rs:11:5
|
-LL | struct B<'a,T>(&'a (), T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | T,
+ | ^
error: 'a
- --> $DIR/object-lifetime-default.rs:10:1
+ --> $DIR/object-lifetime-default.rs:17:5
|
-LL | struct C<'a,T:'a>(&'a T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | T: 'a,
+ | ^
error: Ambiguous
- --> $DIR/object-lifetime-default.rs:13:1
+ --> $DIR/object-lifetime-default.rs:24:5
|
-LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | T: 'a + 'b,
+ | ^
error: 'b
- --> $DIR/object-lifetime-default.rs:16:1
+ --> $DIR/object-lifetime-default.rs:31:5
|
-LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | T: 'b,
+ | ^
-error: 'a,'b
- --> $DIR/object-lifetime-default.rs:19:1
+error: 'a
+ --> $DIR/object-lifetime-default.rs:38:5
+ |
+LL | T: 'a,
+ | ^
+
+error: 'b
+ --> $DIR/object-lifetime-default.rs:39:5
|
-LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | U: 'b,
+ | ^
-error: 'a,Ambiguous
- --> $DIR/object-lifetime-default.rs:22:1
+error: 'a
+ --> $DIR/object-lifetime-default.rs:46:5
+ |
+LL | T: 'a,
+ | ^
+
+error: Ambiguous
+ --> $DIR/object-lifetime-default.rs:47:5
|
-LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | U: 'a + 'b,
+ | ^
-error: aborting due to 7 previous errors
+error: aborting due to 9 previous errors
diff --git a/src/test/ui/object-safety/issue-102762.rs b/src/test/ui/object-safety/issue-102762.rs
new file mode 100644
index 000000000..4f4c36345
--- /dev/null
+++ b/src/test/ui/object-safety/issue-102762.rs
@@ -0,0 +1,26 @@
+// compile-flags: --crate-type=lib
+// This test checks that the `where_clauses_object_safety` lint does not cause
+// other object safety *hard errors* to be suppressed, because we currently
+// only emit one object safety error per trait...
+
+use std::future::Future;
+use std::pin::Pin;
+
+pub trait Fetcher: Send + Sync {
+ fn get<'a>(self: &'a Box<Self>) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
+ where
+ Self: Sync,
+ {
+ todo!()
+ }
+}
+
+fn fetcher() -> Box<dyn Fetcher> {
+ //~^ ERROR the trait `Fetcher` cannot be made into an object
+ todo!()
+}
+
+pub fn foo() {
+ let fetcher = fetcher();
+ let _ = fetcher.get();
+}
diff --git a/src/test/ui/object-safety/issue-102762.stderr b/src/test/ui/object-safety/issue-102762.stderr
new file mode 100644
index 000000000..5041ebe77
--- /dev/null
+++ b/src/test/ui/object-safety/issue-102762.stderr
@@ -0,0 +1,20 @@
+error[E0038]: the trait `Fetcher` cannot be made into an object
+ --> $DIR/issue-102762.rs:18:21
+ |
+LL | fn get<'a>(self: &'a Box<Self>) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
+ | ------------- help: consider changing method `get`'s `self` parameter to be `&self`: `&Self`
+...
+LL | fn fetcher() -> Box<dyn Fetcher> {
+ | ^^^^^^^^^^^ `Fetcher` 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-102762.rs:10:22
+ |
+LL | pub trait Fetcher: Send + Sync {
+ | ------- this trait cannot be made into an object...
+LL | fn get<'a>(self: &'a Box<Self>) -> Pin<Box<dyn Future<Output = Vec<u8>> + 'a>>
+ | ^^^^^^^^^^^^^ ...because method `get`'s `self` parameter cannot be dispatched on
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/object-safety/issue-102933.rs b/src/test/ui/object-safety/issue-102933.rs
new file mode 100644
index 000000000..843391cff
--- /dev/null
+++ b/src/test/ui/object-safety/issue-102933.rs
@@ -0,0 +1,25 @@
+// check-pass
+
+use std::future::Future;
+
+pub trait Service {
+ type Response;
+ type Future: Future<Output = Self::Response>;
+}
+
+pub trait A1: Service<Response = i32> {}
+
+pub trait A2: Service<Future = Box<dyn Future<Output = i32>>> + A1 {
+ fn foo(&self) {}
+}
+
+pub trait B1: Service<Future = Box<dyn Future<Output = i32>>> {}
+
+pub trait B2: Service<Response = i32> + B1 {
+ fn foo(&self) {}
+}
+
+fn main() {
+ let x: &dyn A2 = todo!();
+ let x: &dyn B2 = todo!();
+}
diff --git a/src/test/ui/object-safety/issue-19538.stderr b/src/test/ui/object-safety/issue-19538.stderr
index 7b37e1f95..8420637b3 100644
--- a/src/test/ui/object-safety/issue-19538.stderr
+++ b/src/test/ui/object-safety/issue-19538.stderr
@@ -29,7 +29,7 @@ LL | fn foo<T>(&self, val: T);
LL | trait Bar: Foo { }
| --- this trait cannot be made into an object...
= help: consider moving `foo` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<&mut dyn Bar>` for `&mut Thing`
+ = note: required for `&mut Thing` to implement `CoerceUnsized<&mut dyn Bar>`
= note: required by cast to type `&mut dyn Bar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/object-safety/object-safety-associated-consts.curr.stderr b/src/test/ui/object-safety/object-safety-associated-consts.curr.stderr
index 9dd144fee..5f94c9284 100644
--- a/src/test/ui/object-safety/object-safety-associated-consts.curr.stderr
+++ b/src/test/ui/object-safety/object-safety-associated-consts.curr.stderr
@@ -1,8 +1,8 @@
error[E0038]: the trait `Bar` cannot be made into an object
- --> $DIR/object-safety-associated-consts.rs:12:30
+ --> $DIR/object-safety-associated-consts.rs:12:31
|
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
- | ^^^^^^^^ `Bar` cannot be made into an object
+ | ^^^^^^^ `Bar` 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-associated-consts.rs:9:11
diff --git a/src/test/ui/object-safety/object-safety-associated-consts.object_safe_for_dispatch.stderr b/src/test/ui/object-safety/object-safety-associated-consts.object_safe_for_dispatch.stderr
index 9ba3b251e..f44de07d5 100644
--- a/src/test/ui/object-safety/object-safety-associated-consts.object_safe_for_dispatch.stderr
+++ b/src/test/ui/object-safety/object-safety-associated-consts.object_safe_for_dispatch.stderr
@@ -12,7 +12,7 @@ LL | trait Bar {
LL | const X: usize;
| ^ ...because it contains this associated `const`
= help: consider moving `X` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Bar>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Bar>`
= note: required by cast to type `&dyn Bar`
error: aborting due to previous error
diff --git a/src/test/ui/object-safety/object-safety-bounds.stderr b/src/test/ui/object-safety/object-safety-bounds.stderr
index 89c4f8ced..29ffb5448 100644
--- a/src/test/ui/object-safety/object-safety-bounds.stderr
+++ b/src/test/ui/object-safety/object-safety-bounds.stderr
@@ -1,8 +1,8 @@
error[E0038]: the trait `X` cannot be made into an object
- --> $DIR/object-safety-bounds.rs:7:11
+ --> $DIR/object-safety-bounds.rs:7:15
|
LL | fn f() -> Box<dyn X<U = u32>> {
- | ^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object
+ | ^^^^^^^^^^^^^^ `X` 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-bounds.rs:4:13
diff --git a/src/test/ui/object-safety/object-safety-generics.curr.stderr b/src/test/ui/object-safety/object-safety-generics.curr.stderr
index 345950f1a..458103752 100644
--- a/src/test/ui/object-safety/object-safety-generics.curr.stderr
+++ b/src/test/ui/object-safety/object-safety-generics.curr.stderr
@@ -1,8 +1,8 @@
error[E0038]: the trait `Bar` cannot be made into an object
- --> $DIR/object-safety-generics.rs:18:30
+ --> $DIR/object-safety-generics.rs:18:31
|
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
- | ^^^^^^^^ `Bar` cannot be made into an object
+ | ^^^^^^^ `Bar` 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-generics.rs:10:8
@@ -14,10 +14,10 @@ LL | fn bar<T>(&self, t: T);
= help: consider moving `bar` to another trait
error[E0038]: the trait `Bar` cannot be made into an object
- --> $DIR/object-safety-generics.rs:24:39
+ --> $DIR/object-safety-generics.rs:24:40
|
LL | fn make_bar_explicit<T:Bar>(t: &T) -> &dyn Bar {
- | ^^^^^^^^ `Bar` cannot be made into an object
+ | ^^^^^^^ `Bar` 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-generics.rs:10:8
diff --git a/src/test/ui/object-safety/object-safety-generics.object_safe_for_dispatch.stderr b/src/test/ui/object-safety/object-safety-generics.object_safe_for_dispatch.stderr
index 86355627c..9a2d472d5 100644
--- a/src/test/ui/object-safety/object-safety-generics.object_safe_for_dispatch.stderr
+++ b/src/test/ui/object-safety/object-safety-generics.object_safe_for_dispatch.stderr
@@ -12,7 +12,7 @@ LL | trait Bar {
LL | fn bar<T>(&self, t: T);
| ^^^ ...because method `bar` has generic type parameters
= help: consider moving `bar` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Bar>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Bar>`
= note: required by cast to type `&dyn Bar`
error[E0038]: the trait `Bar` cannot be made into an object
@@ -29,7 +29,7 @@ LL | trait Bar {
LL | fn bar<T>(&self, t: T);
| ^^^ ...because method `bar` has generic type parameters
= help: consider moving `bar` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Bar>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Bar>`
= note: required by cast to type `&dyn Bar`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/object-safety/object-safety-mentions-Self.curr.stderr b/src/test/ui/object-safety/object-safety-mentions-Self.curr.stderr
index f91c9b985..de430a89b 100644
--- a/src/test/ui/object-safety/object-safety-mentions-Self.curr.stderr
+++ b/src/test/ui/object-safety/object-safety-mentions-Self.curr.stderr
@@ -1,8 +1,8 @@
error[E0038]: the trait `Bar` cannot be made into an object
- --> $DIR/object-safety-mentions-Self.rs:22:30
+ --> $DIR/object-safety-mentions-Self.rs:22:31
|
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
- | ^^^^^^^^ `Bar` cannot be made into an object
+ | ^^^^^^^ `Bar` 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-mentions-Self.rs:11:22
@@ -14,10 +14,10 @@ LL | fn bar(&self, x: &Self);
= help: consider moving `bar` to another trait
error[E0038]: the trait `Baz` cannot be made into an object
- --> $DIR/object-safety-mentions-Self.rs:28:30
+ --> $DIR/object-safety-mentions-Self.rs:28:31
|
LL | fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
- | ^^^^^^^^ `Baz` cannot be made into an object
+ | ^^^^^^^ `Baz` 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-mentions-Self.rs:15:22
diff --git a/src/test/ui/object-safety/object-safety-mentions-Self.object_safe_for_dispatch.stderr b/src/test/ui/object-safety/object-safety-mentions-Self.object_safe_for_dispatch.stderr
index f48628c9d..40a298bd1 100644
--- a/src/test/ui/object-safety/object-safety-mentions-Self.object_safe_for_dispatch.stderr
+++ b/src/test/ui/object-safety/object-safety-mentions-Self.object_safe_for_dispatch.stderr
@@ -12,7 +12,7 @@ LL | trait Bar {
LL | fn bar(&self, x: &Self);
| ^^^^^ ...because method `bar` references the `Self` type in this parameter
= help: consider moving `bar` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Bar>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Bar>`
= note: required by cast to type `&dyn Bar`
error[E0038]: the trait `Baz` cannot be made into an object
@@ -29,7 +29,7 @@ LL | trait Baz {
LL | fn baz(&self) -> Self;
| ^^^^ ...because method `baz` references the `Self` type in its return type
= help: consider moving `baz` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Baz>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Baz>`
= note: required by cast to type `&dyn Baz`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/object-safety/object-safety-no-static.curr.stderr b/src/test/ui/object-safety/object-safety-no-static.curr.stderr
index bd8cf4e30..1b025229e 100644
--- a/src/test/ui/object-safety/object-safety-no-static.curr.stderr
+++ b/src/test/ui/object-safety/object-safety-no-static.curr.stderr
@@ -1,8 +1,8 @@
error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety-no-static.rs:12:18
+ --> $DIR/object-safety-no-static.rs:12:22
|
LL | fn diverges() -> Box<dyn Foo> {
- | ^^^^^^^^^^^^ `Foo` cannot be made into an object
+ | ^^^^^^^ `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-no-static.rs:9:8
diff --git a/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr b/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr
index ea1c575ff..da87b58c9 100644
--- a/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr
+++ b/src/test/ui/object-safety/object-safety-no-static.object_safe_for_dispatch.stderr
@@ -11,7 +11,7 @@ LL | trait Foo {
| --- this trait cannot be made into an object...
LL | fn foo() {}
| ^^^ ...because associated function `foo` has no `self` parameter
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Foo>>` for `Box<Bar>`
+ = note: required for `Box<Bar>` to implement `CoerceUnsized<Box<dyn Foo>>`
= note: required by cast to type `Box<dyn Foo>`
help: consider turning `foo` into a method by giving it a `&self` argument
|
diff --git a/src/test/ui/object-safety/object-safety-sized-2.curr.stderr b/src/test/ui/object-safety/object-safety-sized-2.curr.stderr
index 71236c8e3..b01926412 100644
--- a/src/test/ui/object-safety/object-safety-sized-2.curr.stderr
+++ b/src/test/ui/object-safety/object-safety-sized-2.curr.stderr
@@ -1,8 +1,8 @@
error[E0038]: the trait `Bar` cannot be made into an object
- --> $DIR/object-safety-sized-2.rs:14:30
+ --> $DIR/object-safety-sized-2.rs:14:31
|
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
- | ^^^^^^^^ `Bar` cannot be made into an object
+ | ^^^^^^^ `Bar` 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-sized-2.rs:9:18
diff --git a/src/test/ui/object-safety/object-safety-sized-2.object_safe_for_dispatch.stderr b/src/test/ui/object-safety/object-safety-sized-2.object_safe_for_dispatch.stderr
index b6e4903b0..6c29c8d5f 100644
--- a/src/test/ui/object-safety/object-safety-sized-2.object_safe_for_dispatch.stderr
+++ b/src/test/ui/object-safety/object-safety-sized-2.object_safe_for_dispatch.stderr
@@ -11,7 +11,7 @@ LL | trait Bar
| --- this trait cannot be made into an object...
LL | where Self : Sized
| ^^^^^ ...because it requires `Self: Sized`
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Bar>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Bar>`
= note: required by cast to type `&dyn Bar`
error: aborting due to previous error
diff --git a/src/test/ui/object-safety/object-safety-sized.curr.stderr b/src/test/ui/object-safety/object-safety-sized.curr.stderr
index 94b06ee93..974813121 100644
--- a/src/test/ui/object-safety/object-safety-sized.curr.stderr
+++ b/src/test/ui/object-safety/object-safety-sized.curr.stderr
@@ -1,8 +1,8 @@
error[E0038]: the trait `Bar` cannot be made into an object
- --> $DIR/object-safety-sized.rs:12:30
+ --> $DIR/object-safety-sized.rs:12:31
|
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
- | ^^^^^^^^ `Bar` cannot be made into an object
+ | ^^^^^^^ `Bar` 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-sized.rs:8:13
diff --git a/src/test/ui/object-safety/object-safety-sized.object_safe_for_dispatch.stderr b/src/test/ui/object-safety/object-safety-sized.object_safe_for_dispatch.stderr
index 645852c7e..70a44ed61 100644
--- a/src/test/ui/object-safety/object-safety-sized.object_safe_for_dispatch.stderr
+++ b/src/test/ui/object-safety/object-safety-sized.object_safe_for_dispatch.stderr
@@ -11,7 +11,7 @@ LL | trait Bar : Sized {
| --- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Bar>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Bar>`
= note: required by cast to type `&dyn Bar`
error: aborting due to previous error
diff --git a/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs b/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs
new file mode 100644
index 000000000..14e00d2ef
--- /dev/null
+++ b/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.rs
@@ -0,0 +1,15 @@
+//~ ERROR the parameter type `Self` may not live long enough
+
+trait GatTrait {
+ type Gat<'a>
+ where
+ Self: 'a;
+}
+
+trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
+ fn c(&self) -> dyn SuperTrait<T>;
+ //~^ ERROR associated item referring to unboxed trait object for its own trait
+ //~| ERROR the trait `SuperTrait` cannot be made into an object
+}
+
+fn main() {}
diff --git a/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr b/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr
new file mode 100644
index 000000000..c1aaad31e
--- /dev/null
+++ b/src/test/ui/object-safety/object-safety-supertrait-mentions-GAT.stderr
@@ -0,0 +1,43 @@
+error[E0311]: the parameter type `Self` may not live long enough
+ |
+ = help: consider adding an explicit lifetime bound `Self: 'a`...
+ = note: ...so that the type `Self` will meet its required lifetime bounds...
+note: ...that is required by this bound
+ --> $DIR/object-safety-supertrait-mentions-GAT.rs:9:39
+ |
+LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
+ | ^^^^^^^^^^^
+
+error: associated item referring to unboxed trait object for its own trait
+ --> $DIR/object-safety-supertrait-mentions-GAT.rs:10:20
+ |
+LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
+ | ---------- in this trait
+LL | fn c(&self) -> dyn SuperTrait<T>;
+ | ^^^^^^^^^^^^^^^^^
+ |
+help: you might have meant to use `Self` to refer to the implementing type
+ |
+LL | fn c(&self) -> Self;
+ | ~~~~
+
+error[E0038]: the trait `SuperTrait` cannot be made into an object
+ --> $DIR/object-safety-supertrait-mentions-GAT.rs:10:20
+ |
+LL | fn c(&self) -> dyn SuperTrait<T>;
+ | ^^^^^^^^^^^^^^^^^ `SuperTrait` 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-supertrait-mentions-GAT.rs:4:10
+ |
+LL | type Gat<'a>
+ | ^^^ ...because it contains the generic associated type `Gat`
+...
+LL | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a> = T> {
+ | ---------- this trait cannot be made into an object...
+ = help: consider moving `Gat` to another trait
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0038, E0311.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/src/test/ui/on-unimplemented/enclosing-scope.rs b/src/test/ui/on-unimplemented/enclosing-scope.rs
deleted file mode 100644
index 881bff63f..000000000
--- a/src/test/ui/on-unimplemented/enclosing-scope.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-// Test scope annotations from `enclosing_scope` parameter
-
-#![feature(rustc_attrs)]
-
-#[rustc_on_unimplemented(enclosing_scope="in this scope")]
-trait Trait{}
-
-struct Foo;
-
-fn f<T: Trait>(x: T) {}
-
-fn main() {
- let x = || {
- f(Foo{}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
- let y = || {
- f(Foo{}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
- };
- };
-
- {
- {
- f(Foo{}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
- }
- }
-
- f(Foo{}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
-}
diff --git a/src/test/ui/on-unimplemented/enclosing-scope.stderr b/src/test/ui/on-unimplemented/enclosing-scope.stderr
deleted file mode 100644
index 67759d02a..000000000
--- a/src/test/ui/on-unimplemented/enclosing-scope.stderr
+++ /dev/null
@@ -1,86 +0,0 @@
-error[E0277]: the trait bound `Foo: Trait` is not satisfied
- --> $DIR/enclosing-scope.rs:14:11
- |
-LL | let x = || {
- | _____________-
-LL | | f(Foo{});
- | | - ^^^^^ the trait `Trait` is not implemented for `Foo`
- | | |
- | | required by a bound introduced by this call
-LL | | let y = || {
-LL | | f(Foo{});
-LL | | };
-LL | | };
- | |_____- in this scope
- |
-note: required by a bound in `f`
- --> $DIR/enclosing-scope.rs:10:9
- |
-LL | fn f<T: Trait>(x: T) {}
- | ^^^^^ required by this bound in `f`
-
-error[E0277]: the trait bound `Foo: Trait` is not satisfied
- --> $DIR/enclosing-scope.rs:16:15
- |
-LL | let y = || {
- | _________________-
-LL | | f(Foo{});
- | | - ^^^^^ the trait `Trait` is not implemented for `Foo`
- | | |
- | | required by a bound introduced by this call
-LL | | };
- | |_________- in this scope
- |
-note: required by a bound in `f`
- --> $DIR/enclosing-scope.rs:10:9
- |
-LL | fn f<T: Trait>(x: T) {}
- | ^^^^^ required by this bound in `f`
-
-error[E0277]: the trait bound `Foo: Trait` is not satisfied
- --> $DIR/enclosing-scope.rs:22:15
- |
-LL | / fn main() {
-LL | | let x = || {
-LL | | f(Foo{});
-LL | | let y = || {
-... |
-LL | | f(Foo{});
- | | - ^^^^^ the trait `Trait` is not implemented for `Foo`
- | | |
- | | required by a bound introduced by this call
-... |
-LL | | f(Foo{});
-LL | | }
- | |_- in this scope
- |
-note: required by a bound in `f`
- --> $DIR/enclosing-scope.rs:10:9
- |
-LL | fn f<T: Trait>(x: T) {}
- | ^^^^^ required by this bound in `f`
-
-error[E0277]: the trait bound `Foo: Trait` is not satisfied
- --> $DIR/enclosing-scope.rs:26:7
- |
-LL | / fn main() {
-LL | | let x = || {
-LL | | f(Foo{});
-LL | | let y = || {
-... |
-LL | | f(Foo{});
- | | - ^^^^^ the trait `Trait` is not implemented for `Foo`
- | | |
- | | required by a bound introduced by this call
-LL | | }
- | |_- in this scope
- |
-note: required by a bound in `f`
- --> $DIR/enclosing-scope.rs:10:9
- |
-LL | fn f<T: Trait>(x: T) {}
- | ^^^^^ required by this bound in `f`
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/on-unimplemented/multiple-impls.rs b/src/test/ui/on-unimplemented/multiple-impls.rs
index b74957ebc..a32fd4566 100644
--- a/src/test/ui/on-unimplemented/multiple-impls.rs
+++ b/src/test/ui/on-unimplemented/multiple-impls.rs
@@ -33,10 +33,13 @@ fn main() {
Index::index(&[] as &[i32], 2u32);
//~^ ERROR E0277
//~| ERROR E0277
+ //~| ERROR E0277
Index::index(&[] as &[i32], Foo(2u32));
//~^ ERROR E0277
//~| ERROR E0277
+ //~| ERROR E0277
Index::index(&[] as &[i32], Bar(2u32));
//~^ ERROR E0277
//~| ERROR E0277
+ //~| ERROR E0277
}
diff --git a/src/test/ui/on-unimplemented/multiple-impls.stderr b/src/test/ui/on-unimplemented/multiple-impls.stderr
index 06e1a222a..d628b159a 100644
--- a/src/test/ui/on-unimplemented/multiple-impls.stderr
+++ b/src/test/ui/on-unimplemented/multiple-impls.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
- --> $DIR/multiple-impls.rs:33:18
+ --> $DIR/multiple-impls.rs:33:33
|
LL | Index::index(&[] as &[i32], 2u32);
- | ------------ ^^^^^^^^^^^^^ trait message
+ | ------------ ^^^^ trait message
| |
| required by a bound introduced by this call
|
@@ -11,11 +11,22 @@ LL | Index::index(&[] as &[i32], 2u32);
<[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
+ --> $DIR/multiple-impls.rs:33:5
+ |
+LL | Index::index(&[] as &[i32], 2u32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ trait message
+ |
+ = help: the trait `Index<u32>` is not implemented for `[i32]`
+ = help: the following other types implement trait `Index<Idx>`:
+ <[i32] as Index<Bar<usize>>>
+ <[i32] as Index<Foo<usize>>>
+
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
- --> $DIR/multiple-impls.rs:36:18
+ --> $DIR/multiple-impls.rs:37:33
|
LL | Index::index(&[] as &[i32], Foo(2u32));
- | ------------ ^^^^^^^^^^^^^ on impl for Foo
+ | ------------ ^^^^^^^^^ on impl for Foo
| |
| required by a bound introduced by this call
|
@@ -24,11 +35,22 @@ LL | Index::index(&[] as &[i32], Foo(2u32));
<[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
+ --> $DIR/multiple-impls.rs:37:5
+ |
+LL | Index::index(&[] as &[i32], Foo(2u32));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ on impl for Foo
+ |
+ = help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
+ = help: the following other types implement trait `Index<Idx>`:
+ <[i32] as Index<Bar<usize>>>
+ <[i32] as Index<Foo<usize>>>
+
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
- --> $DIR/multiple-impls.rs:39:18
+ --> $DIR/multiple-impls.rs:41:33
|
LL | Index::index(&[] as &[i32], Bar(2u32));
- | ------------ ^^^^^^^^^^^^^ on impl for Bar
+ | ------------ ^^^^^^^^^ on impl for Bar
| |
| required by a bound introduced by this call
|
@@ -37,6 +59,17 @@ LL | Index::index(&[] as &[i32], Bar(2u32));
<[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
+error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
+ --> $DIR/multiple-impls.rs:41:5
+ |
+LL | Index::index(&[] as &[i32], Bar(2u32));
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ on impl for Bar
+ |
+ = help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
+ = help: the following other types implement trait `Index<Idx>`:
+ <[i32] as Index<Bar<usize>>>
+ <[i32] as Index<Foo<usize>>>
+
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/multiple-impls.rs:33:5
|
@@ -49,7 +82,7 @@ LL | Index::index(&[] as &[i32], 2u32);
<[i32] as Index<Foo<usize>>>
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
- --> $DIR/multiple-impls.rs:36:5
+ --> $DIR/multiple-impls.rs:37:5
|
LL | Index::index(&[] as &[i32], Foo(2u32));
| ^^^^^^^^^^^^ on impl for Foo
@@ -60,7 +93,7 @@ LL | Index::index(&[] as &[i32], Foo(2u32));
<[i32] as Index<Foo<usize>>>
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
- --> $DIR/multiple-impls.rs:39:5
+ --> $DIR/multiple-impls.rs:41:5
|
LL | Index::index(&[] as &[i32], Bar(2u32));
| ^^^^^^^^^^^^ on impl for Bar
@@ -70,6 +103,6 @@ LL | Index::index(&[] as &[i32], Bar(2u32));
<[i32] as Index<Bar<usize>>>
<[i32] as Index<Foo<usize>>>
-error: aborting due to 6 previous errors
+error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/on-unimplemented/on-impl.rs b/src/test/ui/on-unimplemented/on-impl.rs
index ab3e67d01..d0537810c 100644
--- a/src/test/ui/on-unimplemented/on-impl.rs
+++ b/src/test/ui/on-unimplemented/on-impl.rs
@@ -22,4 +22,5 @@ fn main() {
Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32);
//~^ ERROR E0277
//~| ERROR E0277
+ //~| ERROR E0277
}
diff --git a/src/test/ui/on-unimplemented/on-impl.stderr b/src/test/ui/on-unimplemented/on-impl.stderr
index 769a3d77a..2253c5992 100644
--- a/src/test/ui/on-unimplemented/on-impl.stderr
+++ b/src/test/ui/on-unimplemented/on-impl.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
- --> $DIR/on-impl.rs:22:25
+ --> $DIR/on-impl.rs:22:47
|
LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32);
- | ------------------- ^^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
+ | ------------------- ^^^^ a usize is required to index into a slice
| |
| required by a bound introduced by this call
|
@@ -13,11 +13,20 @@ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
--> $DIR/on-impl.rs:22:5
|
LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
+ |
+ = help: the trait `Index<u32>` is not implemented for `[i32]`
+ = help: the trait `Index<usize>` is implemented for `[i32]`
+
+error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
+ --> $DIR/on-impl.rs:22:5
+ |
+LL | Index::<u32>::index(&[1, 2, 3] as &[i32], 2u32);
| ^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
|
= help: the trait `Index<u32>` is not implemented for `[i32]`
= help: the trait `Index<usize>` is implemented for `[i32]`
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/on-unimplemented/parent-label.rs b/src/test/ui/on-unimplemented/parent-label.rs
new file mode 100644
index 000000000..b65f64968
--- /dev/null
+++ b/src/test/ui/on-unimplemented/parent-label.rs
@@ -0,0 +1,27 @@
+// Test scope annotations from `parent_label` parameter
+
+#![feature(rustc_attrs)]
+
+#[rustc_on_unimplemented(parent_label = "in this scope")]
+trait Trait {}
+
+struct Foo;
+
+fn f<T: Trait>(x: T) {}
+
+fn main() {
+ let x = || {
+ f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
+ let y = || {
+ f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
+ };
+ };
+
+ {
+ {
+ f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
+ }
+ }
+
+ f(Foo {}); //~ ERROR the trait bound `Foo: Trait` is not satisfied
+}
diff --git a/src/test/ui/on-unimplemented/parent-label.stderr b/src/test/ui/on-unimplemented/parent-label.stderr
new file mode 100644
index 000000000..8cd7412fd
--- /dev/null
+++ b/src/test/ui/on-unimplemented/parent-label.stderr
@@ -0,0 +1,69 @@
+error[E0277]: the trait bound `Foo: Trait` is not satisfied
+ --> $DIR/parent-label.rs:14:11
+ |
+LL | let x = || {
+ | -- in this scope
+LL | f(Foo {});
+ | - ^^^^^^ the trait `Trait` is not implemented for `Foo`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `f`
+ --> $DIR/parent-label.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
+
+error[E0277]: the trait bound `Foo: Trait` is not satisfied
+ --> $DIR/parent-label.rs:16:15
+ |
+LL | let y = || {
+ | -- in this scope
+LL | f(Foo {});
+ | - ^^^^^^ the trait `Trait` is not implemented for `Foo`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `f`
+ --> $DIR/parent-label.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
+
+error[E0277]: the trait bound `Foo: Trait` is not satisfied
+ --> $DIR/parent-label.rs:22:15
+ |
+LL | fn main() {
+ | --------- in this scope
+...
+LL | f(Foo {});
+ | - ^^^^^^ the trait `Trait` is not implemented for `Foo`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `f`
+ --> $DIR/parent-label.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
+
+error[E0277]: the trait bound `Foo: Trait` is not satisfied
+ --> $DIR/parent-label.rs:26:7
+ |
+LL | fn main() {
+ | --------- in this scope
+...
+LL | f(Foo {});
+ | - ^^^^^^ the trait `Trait` is not implemented for `Foo`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `f`
+ --> $DIR/parent-label.rs:10:9
+ |
+LL | fn f<T: Trait>(x: T) {}
+ | ^^^^^ required by this bound in `f`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/on-unimplemented/slice-index.stderr b/src/test/ui/on-unimplemented/slice-index.stderr
index 72f67a685..a7ec3bda8 100644
--- a/src/test/ui/on-unimplemented/slice-index.stderr
+++ b/src/test/ui/on-unimplemented/slice-index.stderr
@@ -6,7 +6,7 @@ LL | x[1i32];
|
= help: the trait `SliceIndex<[i32]>` is not implemented for `i32`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<i32>` for `[i32]`
+ = note: required for `[i32]` to implement `Index<i32>`
error[E0277]: the type `[i32]` cannot be indexed by `RangeTo<i32>`
--> $DIR/slice-index.rs:9:7
@@ -18,7 +18,7 @@ LL | x[..1i32];
= help: the following other types implement trait `SliceIndex<T>`:
<RangeTo<usize> as SliceIndex<[T]>>
<RangeTo<usize> as SliceIndex<str>>
- = note: required because of the requirements on the impl of `Index<RangeTo<i32>>` for `[i32]`
+ = note: required for `[i32]` to implement `Index<RangeTo<i32>>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/oom_unwind.rs b/src/test/ui/oom_unwind.rs
index d036c817a..21a8fb2b2 100644
--- a/src/test/ui/oom_unwind.rs
+++ b/src/test/ui/oom_unwind.rs
@@ -4,8 +4,6 @@
// needs-unwind
// only-linux
-#![feature(bench_black_box)]
-
use std::hint::black_box;
use std::mem::forget;
use std::panic::catch_unwind;
diff --git a/src/test/ui/opt-in-copy.stderr b/src/test/ui/opt-in-copy.stderr
index 0a275f1aa..4461567df 100644
--- a/src/test/ui/opt-in-copy.stderr
+++ b/src/test/ui/opt-in-copy.stderr
@@ -1,20 +1,20 @@
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/opt-in-copy.rs:7:6
+ --> $DIR/opt-in-copy.rs:7:15
|
LL | but_i_cant: CantCopyThis,
| ------------------------ this field does not implement `Copy`
...
LL | impl Copy for IWantToCopyThis {}
- | ^^^^
+ | ^^^^^^^^^^^^^^^
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/opt-in-copy.rs:19:6
+ --> $DIR/opt-in-copy.rs:19:15
|
LL | ButICant(CantCopyThisEither),
| ------------------ this field does not implement `Copy`
...
LL | impl Copy for IWantToCopyThisToo {}
- | ^^^^
+ | ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/or-patterns/inner-or-pat.or3.stderr b/src/test/ui/or-patterns/inner-or-pat.or3.stderr
new file mode 100644
index 000000000..2236a38c3
--- /dev/null
+++ b/src/test/ui/or-patterns/inner-or-pat.or3.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/inner-or-pat.rs:38:54
+ |
+LL | match x {
+ | - this expression has type `&str`
+LL | x @ ((("h" | "ho" | "yo" | ("dude" | "w")) | () | "nop") | ("hey" | "gg")) |
+ | ^^ expected `str`, found `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/or-patterns/inner-or-pat.or4.stderr b/src/test/ui/or-patterns/inner-or-pat.or4.stderr
new file mode 100644
index 000000000..058873ff5
--- /dev/null
+++ b/src/test/ui/or-patterns/inner-or-pat.or4.stderr
@@ -0,0 +1,11 @@
+error[E0408]: variable `x` is not bound in all patterns
+ --> $DIR/inner-or-pat.rs:53:37
+ |
+LL | (x @ "red" | (x @ "blue" | "red")) => {
+ | - ^^^^^ pattern doesn't bind `x`
+ | |
+ | variable not in all patterns
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0408`.
diff --git a/src/test/ui/or-patterns/inner-or-pat.rs b/src/test/ui/or-patterns/inner-or-pat.rs
new file mode 100644
index 000000000..f4cf4b0c1
--- /dev/null
+++ b/src/test/ui/or-patterns/inner-or-pat.rs
@@ -0,0 +1,73 @@
+// revisions: or1 or2 or3 or4 or5
+// [or1] run-pass
+// [or2] run-pass
+// [or5] run-pass
+
+#![allow(unreachable_patterns)]
+#![allow(unused_variables)]
+#![allow(unused_parens)]
+#![allow(dead_code)]
+
+
+
+fn foo() {
+ let x = "foo";
+ match x {
+ x @ ((("h" | "ho" | "yo" | ("dude" | "w")) | "no" | "nop") | ("hey" | "gg")) |
+ x @ ("black" | "pink") |
+ x @ ("red" | "blue") => {
+ }
+ _ => (),
+ }
+}
+
+fn bar() {
+ let x = "foo";
+ match x {
+ x @ ("foo" | "bar") |
+ (x @ "red" | (x @ "blue" | x @ "red")) => {
+ }
+ _ => (),
+ }
+}
+
+#[cfg(or3)]
+fn zot() {
+ let x = "foo";
+ match x {
+ x @ ((("h" | "ho" | "yo" | ("dude" | "w")) | () | "nop") | ("hey" | "gg")) |
+ //[or3]~^ ERROR mismatched types
+ x @ ("black" | "pink") |
+ x @ ("red" | "blue") => {
+ }
+ _ => (),
+ }
+}
+
+
+#[cfg(or4)]
+fn hey() {
+ let x = "foo";
+ match x {
+ x @ ("foo" | "bar") |
+ (x @ "red" | (x @ "blue" | "red")) => {
+ //[or4]~^ variable `x` is not bound in all patterns
+ }
+ _ => (),
+ }
+}
+
+fn don() {
+ enum Foo {
+ A,
+ B,
+ C,
+ }
+
+ match Foo::A {
+ | _foo @ (Foo::A | Foo::B) => {}
+ Foo::C => {}
+ };
+}
+
+fn main(){}
diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs b/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs
index 6f9a631b0..dda5c0bb5 100644
--- a/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs
+++ b/src/test/ui/or-patterns/or-patterns-syntactic-pass.rs
@@ -7,7 +7,7 @@ fn main() {}
// Test the `pat` macro fragment parser:
macro_rules! accept_pat {
- ($p:pat) => {}
+ ($p:pat) => {};
}
accept_pat!((p | q));
@@ -21,28 +21,28 @@ accept_pat!([p | q]);
#[cfg(FALSE)]
fn or_patterns() {
// Top level of `let`:
- let (| A | B);
+ let (A | B);
let (A | B);
let (A | B): u8;
let (A | B) = 0;
let (A | B): u8 = 0;
// Top level of `for`:
- for | A | B in 0 {}
+ for A | B in 0 {}
for A | B in 0 {}
// Top level of `while`:
- while let | A | B = 0 {}
+ while let A | B = 0 {}
while let A | B = 0 {}
// Top level of `if`:
- if let | A | B = 0 {}
+ if let A | B = 0 {}
if let A | B = 0 {}
// Top level of `match` arms:
match 0 {
- | A | B => {},
- A | B => {},
+ A | B => {}
+ A | B => {}
}
// Functions:
@@ -68,6 +68,8 @@ fn or_patterns() {
// These bind as `(prefix p) | q` as opposed to `prefix (p | q)`:
let (box 0 | 1); // Unstable; we *can* change the precedence if we want.
+ //~^ WARN box pattern syntax is experimental
+ //~| WARN unstable syntax
let (&0 | 1);
let (&mut 0 | 1);
let (x @ 0 | 1);
diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-pass.stderr b/src/test/ui/or-patterns/or-patterns-syntactic-pass.stderr
new file mode 100644
index 000000000..c43fe192a
--- /dev/null
+++ b/src/test/ui/or-patterns/or-patterns-syntactic-pass.stderr
@@ -0,0 +1,13 @@
+warning: box pattern syntax is experimental
+ --> $DIR/or-patterns-syntactic-pass.rs:70:10
+ |
+LL | let (box 0 | 1); // Unstable; we *can* change the precedence if we want.
+ | ^^^^^
+ |
+ = 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: 1 warning emitted
+
diff --git a/src/test/ui/packed/issue-27060-rpass.stderr b/src/test/ui/packed/issue-27060-rpass.stderr
index 667b70afb..adf9ae9f5 100644
--- a/src/test/ui/packed/issue-27060-rpass.stderr
+++ b/src/test/ui/packed/issue-27060-rpass.stderr
@@ -5,15 +5,15 @@ warning: reference to packed field is unaligned
LL | let _ = &good.data; // ok
| ^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/issue-27060-rpass.rs:11:9
|
LL | #[allow(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
warning: reference to packed field is unaligned
@@ -22,15 +22,15 @@ warning: reference to packed field is unaligned
LL | let _ = &good.data2[0]; // ok
| ^^^^^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/issue-27060-rpass.rs:11:9
|
LL | #[allow(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
warning: reference to packed field is unaligned
@@ -39,15 +39,15 @@ warning: reference to packed field is unaligned
LL | let _ = &good.data;
| ^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/issue-27060-rpass.rs:11:9
|
LL | #[allow(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
warning: reference to packed field is unaligned
@@ -56,13 +56,13 @@ warning: reference to packed field is unaligned
LL | let _ = &good.data2[0];
| ^^^^^^^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/issue-27060-rpass.rs:11:9
|
LL | #[allow(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
diff --git a/src/test/ui/packed/issue-27060.stderr b/src/test/ui/packed/issue-27060.stderr
index 1bab16e6d..85e08fa02 100644
--- a/src/test/ui/packed/issue-27060.stderr
+++ b/src/test/ui/packed/issue-27060.stderr
@@ -4,11 +4,11 @@ error: reference to packed field is unaligned
LL | let _ = &good.data;
| ^^^^^^^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
error: reference to packed field is unaligned
--> $DIR/issue-27060.rs:17:13
@@ -52,11 +52,11 @@ error: reference to packed field is unaligned
LL | let _ = &good.data;
| ^^^^^^^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -65,11 +65,11 @@ error: reference to packed field is unaligned
LL | let _ = &good.data2[0];
| ^^^^^^^^^^^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -78,11 +78,11 @@ error: reference to packed field is unaligned
LL | let _ = &good.data;
| ^^^^^^^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
Future breakage diagnostic:
error: reference to packed field is unaligned
@@ -91,9 +91,9 @@ error: reference to packed field is unaligned
LL | let _ = &good.data2[0];
| ^^^^^^^^^^^^^^
|
- = note: `#[deny(unaligned_references)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82523 <https://github.com/rust-lang/rust/issues/82523>
= 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)
+ = note: `#[deny(unaligned_references)]` on by default
diff --git a/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr b/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
index dcd1c19fa..fb2f5615c 100644
--- a/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
+++ b/src/test/ui/packed/packed-struct-borrow-element-64bit.stderr
@@ -4,15 +4,15 @@ warning: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/packed-struct-borrow-element-64bit.rs:12:8
|
LL | #[warn(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
warning: 1 warning emitted
@@ -23,13 +23,13 @@ warning: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/packed-struct-borrow-element-64bit.rs:12:8
|
LL | #[warn(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
diff --git a/src/test/ui/packed/packed-struct-borrow-element.stderr b/src/test/ui/packed/packed-struct-borrow-element.stderr
index fb483227e..75d55c4f6 100644
--- a/src/test/ui/packed/packed-struct-borrow-element.stderr
+++ b/src/test/ui/packed/packed-struct-borrow-element.stderr
@@ -4,15 +4,15 @@ warning: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/packed-struct-borrow-element.rs:23:8
|
LL | #[warn(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
warning: reference to packed field is unaligned
--> $DIR/packed-struct-borrow-element.rs:31:15
@@ -34,15 +34,15 @@ warning: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/packed-struct-borrow-element.rs:23:8
|
LL | #[warn(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
Future breakage diagnostic:
warning: reference to packed field is unaligned
@@ -51,13 +51,13 @@ warning: reference to packed field is unaligned
LL | let brw = &foo.baz;
| ^^^^^^^^
|
+ = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
+ = 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)
note: the lint level is defined here
--> $DIR/packed-struct-borrow-element.rs:23:8
|
LL | #[warn(unaligned_references)]
| ^^^^^^^^^^^^^^^^^^^^
- = 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 #82523 <https://github.com/rust-lang/rust/issues/82523>
- = 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)
diff --git a/src/test/ui/panic-handler/weak-lang-item.rs b/src/test/ui/panic-handler/weak-lang-item.rs
index df31e614c..14a07a9ef 100644
--- a/src/test/ui/panic-handler/weak-lang-item.rs
+++ b/src/test/ui/panic-handler/weak-lang-item.rs
@@ -2,7 +2,7 @@
// error-pattern: `#[panic_handler]` function required, but not found
// error-pattern: language item required, but not found: `eh_personality`
// needs-unwind since it affects the error output
-// ignore-emscripten compiled with panic=abort, personality not required
+// ignore-emscripten missing eh_catch_typeinfo lang item
#![no_std]
diff --git a/src/test/ui/panic-runtime/need-abort-got-unwind.rs b/src/test/ui/panic-runtime/need-abort-got-unwind.rs
index c72fb96e3..e92400931 100644
--- a/src/test/ui/panic-runtime/need-abort-got-unwind.rs
+++ b/src/test/ui/panic-runtime/need-abort-got-unwind.rs
@@ -2,7 +2,6 @@
// needs-unwind
// error-pattern:is incompatible with this crate's strategy of `unwind`
// aux-build:needs-abort.rs
-// ignore-wasm32-bare compiled with panic=abort by default
extern crate needs_abort;
diff --git a/src/test/ui/panic-runtime/transitive-link-a-bunch.rs b/src/test/ui/panic-runtime/transitive-link-a-bunch.rs
index 622535a75..0e74e300f 100644
--- a/src/test/ui/panic-runtime/transitive-link-a-bunch.rs
+++ b/src/test/ui/panic-runtime/transitive-link-a-bunch.rs
@@ -6,7 +6,6 @@
// aux-build:wants-panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
// error-pattern: is not compiled with this crate's panic strategy `unwind`
-// ignore-wasm32-bare compiled with panic=abort by default
#![no_std]
#![no_main]
diff --git a/src/test/ui/panic-runtime/want-unwind-got-abort.rs b/src/test/ui/panic-runtime/want-unwind-got-abort.rs
index 23bfea6af..b6174dc4e 100644
--- a/src/test/ui/panic-runtime/want-unwind-got-abort.rs
+++ b/src/test/ui/panic-runtime/want-unwind-got-abort.rs
@@ -3,7 +3,6 @@
// error-pattern:is not compiled with this crate's panic strategy `unwind`
// aux-build:panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
-// ignore-wasm32-bare compiled with panic=abort by default
#![no_std]
#![no_main]
diff --git a/src/test/ui/panic-runtime/want-unwind-got-abort2.rs b/src/test/ui/panic-runtime/want-unwind-got-abort2.rs
index 7a2e48e2f..b54babbef 100644
--- a/src/test/ui/panic-runtime/want-unwind-got-abort2.rs
+++ b/src/test/ui/panic-runtime/want-unwind-got-abort2.rs
@@ -4,7 +4,6 @@
// aux-build:panic-runtime-abort.rs
// aux-build:wants-panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
-// ignore-wasm32-bare compiled with panic=abort by default
#![no_std]
#![no_main]
diff --git a/src/test/ui/panic-while-printing.rs b/src/test/ui/panic-while-printing.rs
index 098f54ac2..3abedf2a7 100644
--- a/src/test/ui/panic-while-printing.rs
+++ b/src/test/ui/panic-while-printing.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-emscripten no subprocess support
#![feature(internal_output_capture)]
diff --git a/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr b/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr
index b6223b937..ac4ed8225 100644
--- a/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr
+++ b/src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:22:5
+thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:23:5
stack backtrace:
0: std::panicking::begin_panic
1: issue_47429_short_backtraces::main
diff --git a/src/test/ui/panics/issue-47429-short-backtraces.rs b/src/test/ui/panics/issue-47429-short-backtraces.rs
index f338ace6b..58d0fa62c 100644
--- a/src/test/ui/panics/issue-47429-short-backtraces.rs
+++ b/src/test/ui/panics/issue-47429-short-backtraces.rs
@@ -12,6 +12,7 @@
// ignore-wasm no panic or subprocess support
// ignore-emscripten no panic or subprocess support
// ignore-sgx no subprocess support
+// ignore-fuchsia Backtraces not symbolized
// NOTE(eddyb) output differs between symbol mangling schemes
// revisions: legacy v0
diff --git a/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr b/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr
index c2bea4492..65401fe1c 100644
--- a/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr
+++ b/src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:22:5
+thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:23:5
stack backtrace:
0: std::panicking::begin_panic::<&str>
1: issue_47429_short_backtraces::main
diff --git a/src/test/ui/panics/runtime-switch.legacy.run.stderr b/src/test/ui/panics/runtime-switch.legacy.run.stderr
index f282f1883..0f7655163 100644
--- a/src/test/ui/panics/runtime-switch.legacy.run.stderr
+++ b/src/test/ui/panics/runtime-switch.legacy.run.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:25:5
+thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:26:5
stack backtrace:
0: std::panicking::begin_panic
1: runtime_switch::main
diff --git a/src/test/ui/panics/runtime-switch.rs b/src/test/ui/panics/runtime-switch.rs
index 37ef961e2..882340e49 100644
--- a/src/test/ui/panics/runtime-switch.rs
+++ b/src/test/ui/panics/runtime-switch.rs
@@ -12,6 +12,7 @@
// ignore-wasm no panic or subprocess support
// ignore-emscripten no panic or subprocess support
// ignore-sgx no subprocess support
+// ignore-fuchsia Backtrace not symbolized
// NOTE(eddyb) output differs between symbol mangling schemes
// revisions: legacy v0
diff --git a/src/test/ui/panics/runtime-switch.v0.run.stderr b/src/test/ui/panics/runtime-switch.v0.run.stderr
index 7ce9722e5..a4ae44131 100644
--- a/src/test/ui/panics/runtime-switch.v0.run.stderr
+++ b/src/test/ui/panics/runtime-switch.v0.run.stderr
@@ -1,4 +1,4 @@
-thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:25:5
+thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:26:5
stack backtrace:
0: std::panicking::begin_panic::<&str>
1: runtime_switch::main
diff --git a/src/test/ui/parser/assoc-static-semantic-fail.stderr b/src/test/ui/parser/assoc-static-semantic-fail.stderr
index 7ae092cee..8a74f49b9 100644
--- a/src/test/ui/parser/assoc-static-semantic-fail.stderr
+++ b/src/test/ui/parser/assoc-static-semantic-fail.stderr
@@ -168,9 +168,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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: aborting due to 24 previous errors; 1 warning emitted
diff --git a/src/test/ui/parser/attr-stmt-expr-attr-bad.rs b/src/test/ui/parser/attr-stmt-expr-attr-bad.rs
index 09f494bdc..469c3855c 100644
--- a/src/test/ui/parser/attr-stmt-expr-attr-bad.rs
+++ b/src/test/ui/parser/attr-stmt-expr-attr-bad.rs
@@ -1,5 +1,3 @@
-#![feature(half_open_range_patterns)]
-
fn main() {}
#[cfg(FALSE)] fn e() { let _ = box #![attr] 0; }
diff --git a/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr b/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
index 7bb3db030..872c560cb 100644
--- a/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
+++ b/src/test/ui/parser/attr-stmt-expr-attr-bad.stderr
@@ -1,5 +1,5 @@
error: an inner attribute is not permitted in this context
- --> $DIR/attr-stmt-expr-attr-bad.rs:5:36
+ --> $DIR/attr-stmt-expr-attr-bad.rs:3:36
|
LL | #[cfg(FALSE)] fn e() { let _ = box #![attr] 0; }
| ^^^^^^^^
@@ -8,19 +8,19 @@ LL | #[cfg(FALSE)] fn e() { let _ = box #![attr] 0; }
= note: outer attributes, like `#[test]`, annotate the item following them
error: expected expression, found `]`
- --> $DIR/attr-stmt-expr-attr-bad.rs:7:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:5: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:9:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:7: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:11:36
+ --> $DIR/attr-stmt-expr-attr-bad.rs:9:36
|
LL | #[cfg(FALSE)] fn e() { let _ = foo(#![attr]); }
| ^^^^^^^^
@@ -29,13 +29,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:11:44
+ --> $DIR/attr-stmt-expr-attr-bad.rs:9: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:14:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:12:38
|
LL | #[cfg(FALSE)] fn e() { let _ = x.foo(#![attr]); }
| ^^^^^^^^
@@ -44,13 +44,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:14:46
+ --> $DIR/attr-stmt-expr-attr-bad.rs:12: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:17:36
+ --> $DIR/attr-stmt-expr-attr-bad.rs:15:36
|
LL | #[cfg(FALSE)] fn e() { let _ = 0 + #![attr] 0; }
| ^^^^^^^^
@@ -59,7 +59,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:19:33
+ --> $DIR/attr-stmt-expr-attr-bad.rs:17:33
|
LL | #[cfg(FALSE)] fn e() { let _ = !#![attr] 0; }
| ^^^^^^^^
@@ -68,7 +68,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:21:33
+ --> $DIR/attr-stmt-expr-attr-bad.rs:19:33
|
LL | #[cfg(FALSE)] fn e() { let _ = -#![attr] 0; }
| ^^^^^^^^
@@ -77,13 +77,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:23:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:21: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:25:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:23:35
|
LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] foo; }
| ^^^^^^^^
@@ -92,7 +92,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:27:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:25:40
|
LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] foo; }
| ^^^^^^^^
@@ -101,7 +101,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:29:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:27:35
|
LL | #[cfg(FALSE)] fn e() { let _ = || #![attr] {foo}; }
| ^^^^^^^^
@@ -110,7 +110,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:31:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:29:40
|
LL | #[cfg(FALSE)] fn e() { let _ = move || #![attr] {foo}; }
| ^^^^^^^^
@@ -119,19 +119,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:33:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:31:40
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] ..#[attr] 0; }
| ^^ expected expression
error: expected expression, found `..`
- --> $DIR/attr-stmt-expr-attr-bad.rs:35:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:33: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:37:41
+ --> $DIR/attr-stmt-expr-attr-bad.rs:35:41
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &#![attr] 0; }
| ^^^^^^^^
@@ -140,7 +140,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:39:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:37:45
|
LL | #[cfg(FALSE)] fn e() { let _ = #[attr] &mut #![attr] 0; }
| ^^^^^^^^
@@ -149,7 +149,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:41:37
+ --> $DIR/attr-stmt-expr-attr-bad.rs:39:37
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -158,7 +158,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:43:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:41:38
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {#![attr]}; }
| ^^^^^^^^
@@ -167,13 +167,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:45:40
+ --> $DIR/attr-stmt-expr-attr-bad.rs:43: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:47:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:45:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
@@ -182,7 +182,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:49:46
+ --> $DIR/attr-stmt-expr-attr-bad.rs:47:46
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else {#![attr]}; }
| ^^^^^^^^
@@ -191,7 +191,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:51:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:49:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else #[attr] if 0 {}; }
| ---- ^^^^^^^ ------- the attributes are attached to this branch
@@ -200,7 +200,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:53:50
+ --> $DIR/attr-stmt-expr-attr-bad.rs:51:50
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -209,7 +209,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:55:51
+ --> $DIR/attr-stmt-expr-attr-bad.rs:53:51
|
LL | #[cfg(FALSE)] fn e() { let _ = if 0 {} else if 0 {#![attr]}; }
| ^^^^^^^^
@@ -218,7 +218,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:57:45
+ --> $DIR/attr-stmt-expr-attr-bad.rs:55:45
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -227,7 +227,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:59:46
+ --> $DIR/attr-stmt-expr-attr-bad.rs:57:46
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {#![attr]}; }
| ^^^^^^^^
@@ -236,13 +236,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:61:48
+ --> $DIR/attr-stmt-expr-attr-bad.rs:59: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:63:53
+ --> $DIR/attr-stmt-expr-attr-bad.rs:61:53
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] {}; }
| ---- ^^^^^^^ -- the attributes are attached to this branch
@@ -251,7 +251,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:65:54
+ --> $DIR/attr-stmt-expr-attr-bad.rs:63:54
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else {#![attr]}; }
| ^^^^^^^^
@@ -260,7 +260,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:67:53
+ --> $DIR/attr-stmt-expr-attr-bad.rs:65:53
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else #[attr] if let _ = 0 {}; }
| ---- ^^^^^^^ --------------- the attributes are attached to this branch
@@ -269,7 +269,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:69:66
+ --> $DIR/attr-stmt-expr-attr-bad.rs:67:66
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 #[attr] {}; }
| -- ^^^^^^^ -- the attributes are attached to this branch
@@ -278,7 +278,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:71:67
+ --> $DIR/attr-stmt-expr-attr-bad.rs:69:67
|
LL | #[cfg(FALSE)] fn e() { let _ = if let _ = 0 {} else if let _ = 0 {#![attr]}; }
| ^^^^^^^^
@@ -287,7 +287,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:74:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:72:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] let _ = 0; }
| ------- ^^^^^^^^ not permitted following an outer attribute
@@ -298,7 +298,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:76:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:74:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] 0; }
| ------- ^^^^^^^^ not permitted following an outer attribute
@@ -309,7 +309,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: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
@@ -325,7 +325,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
@@ -341,7 +341,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:82:32
+ --> $DIR/attr-stmt-expr-attr-bad.rs:80:32
|
LL | #[cfg(FALSE)] fn s() { #[attr] #![attr] foo!{}; }
| ------- ^^^^^^^^ ------ the inner attribute doesn't annotate this item macro invocation
@@ -357,7 +357,7 @@ LL + #[cfg(FALSE)] fn s() { #[attr] #[attr] foo!{}; }
|
error[E0586]: inclusive range with no end
- --> $DIR/attr-stmt-expr-attr-bad.rs:88:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:86:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] 10 => () } }
| ^^^ help: use `..` instead
@@ -365,13 +365,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:88:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:86: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:91:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:89:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] -10 => () } }
| ^^^ help: use `..` instead
@@ -379,19 +379,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:91:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:89: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:94:39
+ --> $DIR/attr-stmt-expr-attr-bad.rs:92: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:96:35
+ --> $DIR/attr-stmt-expr-attr-bad.rs:94:35
|
LL | #[cfg(FALSE)] fn e() { match 0 { 0..=#[attr] FOO => () } }
| ^^^ help: use `..` instead
@@ -399,43 +399,43 @@ 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:96:38
+ --> $DIR/attr-stmt-expr-attr-bad.rs:94: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:100:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:98: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:100:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:98: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:103:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:101: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:103:34
+ --> $DIR/attr-stmt-expr-attr-bad.rs:101: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:108:37
+ --> $DIR/attr-stmt-expr-attr-bad.rs:106:37
|
LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr]; } } }
| ^^^^^^^
error: expected statement after outer attribute
- --> $DIR/attr-stmt-expr-attr-bad.rs:110:37
+ --> $DIR/attr-stmt-expr-attr-bad.rs:108:37
|
LL | #[cfg(FALSE)] fn e() { { fn foo() { #[attr] } } }
| ^^^^^^^
diff --git a/src/test/ui/parser/bad-interpolated-block.rs b/src/test/ui/parser/bad-interpolated-block.rs
index 38d53a14b..c6d7ae383 100644
--- a/src/test/ui/parser/bad-interpolated-block.rs
+++ b/src/test/ui/parser/bad-interpolated-block.rs
@@ -1,5 +1,3 @@
-#![feature(label_break_value)]
-
fn main() {}
macro_rules! m {
diff --git a/src/test/ui/parser/bad-interpolated-block.stderr b/src/test/ui/parser/bad-interpolated-block.stderr
index 77933b1bc..2a0999afd 100644
--- a/src/test/ui/parser/bad-interpolated-block.stderr
+++ b/src/test/ui/parser/bad-interpolated-block.stderr
@@ -1,5 +1,5 @@
error: cannot use a `block` macro fragment here
- --> $DIR/bad-interpolated-block.rs:7:15
+ --> $DIR/bad-interpolated-block.rs:5:15
|
LL | 'lab: $b;
| ------^^
@@ -12,7 +12,7 @@ LL | m!({});
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot use a `block` macro fragment here
- --> $DIR/bad-interpolated-block.rs:8:16
+ --> $DIR/bad-interpolated-block.rs:6:16
|
LL | unsafe $b;
| -------^^
@@ -25,7 +25,7 @@ LL | m!({});
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot use a `block` macro fragment here
- --> $DIR/bad-interpolated-block.rs:9:23
+ --> $DIR/bad-interpolated-block.rs:7:23
|
LL | |x: u8| -> () $b;
| ^^ the `block` fragment is within this context
diff --git a/src/test/ui/parser/bad-let-as-field.rs b/src/test/ui/parser/bad-let-as-field.rs
new file mode 100644
index 000000000..fec2bc256
--- /dev/null
+++ b/src/test/ui/parser/bad-let-as-field.rs
@@ -0,0 +1,6 @@
+struct Foo {
+ let: i32,
+ //~^ ERROR expected identifier, found keyword
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/bad-let-as-field.stderr b/src/test/ui/parser/bad-let-as-field.stderr
new file mode 100644
index 000000000..57def42b1
--- /dev/null
+++ b/src/test/ui/parser/bad-let-as-field.stderr
@@ -0,0 +1,15 @@
+error: expected identifier, found keyword `let`
+ --> $DIR/bad-let-as-field.rs:2:5
+ |
+LL | struct Foo {
+ | --- while parsing this struct
+LL | let: i32,
+ | ^^^ expected identifier, found keyword
+ |
+help: escape `let` to use it as an identifier
+ |
+LL | r#let: i32,
+ | ++
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/bad-lit-suffixes.rs b/src/test/ui/parser/bad-lit-suffixes.rs
index 446a09405..9724533c4 100644
--- a/src/test/ui/parser/bad-lit-suffixes.rs
+++ b/src/test/ui/parser/bad-lit-suffixes.rs
@@ -1,18 +1,18 @@
extern
- "C"suffix //~ ERROR suffixes on a string literal are invalid
+ "C"suffix //~ ERROR suffixes on string literals are invalid
fn foo() {}
extern
- "C"suffix //~ ERROR suffixes on a string literal are invalid
+ "C"suffix //~ ERROR suffixes on string literals are invalid
{}
fn main() {
- ""suffix; //~ ERROR suffixes on a string literal are invalid
- b""suffix; //~ ERROR suffixes on a byte string literal are invalid
- r#""#suffix; //~ ERROR suffixes on a string literal are invalid
- br#""#suffix; //~ ERROR suffixes on a byte string literal are invalid
- 'a'suffix; //~ ERROR suffixes on a char literal are invalid
- b'a'suffix; //~ ERROR suffixes on a byte literal are invalid
+ ""suffix; //~ ERROR suffixes on string literals are invalid
+ b""suffix; //~ ERROR suffixes on byte string literals are invalid
+ r#""#suffix; //~ ERROR suffixes on string literals are invalid
+ br#""#suffix; //~ ERROR suffixes on byte string literals are invalid
+ 'a'suffix; //~ ERROR suffixes on char literals are invalid
+ b'a'suffix; //~ ERROR suffixes on byte literals are invalid
1234u1024; //~ ERROR invalid width `1024` for integer literal
1234i1024; //~ ERROR invalid width `1024` for integer literal
diff --git a/src/test/ui/parser/bad-lit-suffixes.stderr b/src/test/ui/parser/bad-lit-suffixes.stderr
index 9b5965714..f74eef324 100644
--- a/src/test/ui/parser/bad-lit-suffixes.stderr
+++ b/src/test/ui/parser/bad-lit-suffixes.stderr
@@ -1,46 +1,46 @@
-error: suffixes on a string literal are invalid
+error: suffixes on string literals are invalid
--> $DIR/bad-lit-suffixes.rs:2:5
|
LL | "C"suffix
| ^^^^^^^^^ invalid suffix `suffix`
-error: suffixes on a string literal are invalid
+error: suffixes on string literals are invalid
--> $DIR/bad-lit-suffixes.rs:6:5
|
LL | "C"suffix
| ^^^^^^^^^ invalid suffix `suffix`
-error: suffixes on a string literal are invalid
+error: suffixes on string literals are invalid
--> $DIR/bad-lit-suffixes.rs:10:5
|
LL | ""suffix;
| ^^^^^^^^ invalid suffix `suffix`
-error: suffixes on a byte string literal are invalid
+error: suffixes on byte string literals are invalid
--> $DIR/bad-lit-suffixes.rs:11:5
|
LL | b""suffix;
| ^^^^^^^^^ invalid suffix `suffix`
-error: suffixes on a string literal are invalid
+error: suffixes on string literals are invalid
--> $DIR/bad-lit-suffixes.rs:12:5
|
LL | r#""#suffix;
| ^^^^^^^^^^^ invalid suffix `suffix`
-error: suffixes on a byte string literal are invalid
+error: suffixes on byte string literals are invalid
--> $DIR/bad-lit-suffixes.rs:13:5
|
LL | br#""#suffix;
| ^^^^^^^^^^^^ invalid suffix `suffix`
-error: suffixes on a char literal are invalid
+error: suffixes on char literals are invalid
--> $DIR/bad-lit-suffixes.rs:14:5
|
LL | 'a'suffix;
| ^^^^^^^^^ invalid suffix `suffix`
-error: suffixes on a byte literal are invalid
+error: suffixes on byte literals are invalid
--> $DIR/bad-lit-suffixes.rs:15:5
|
LL | b'a'suffix;
diff --git a/src/test/ui/parser/bad-pointer-type.rs b/src/test/ui/parser/bad-pointer-type.rs
index 59e5e0c5d..6a82acb4c 100644
--- a/src/test/ui/parser/bad-pointer-type.rs
+++ b/src/test/ui/parser/bad-pointer-type.rs
@@ -1,5 +1,5 @@
fn foo(_: *()) {
- //~^ ERROR expected mut or const in raw pointer type
+ //~^ ERROR expected `mut` or `const` keyword in raw pointer type
}
fn main() {}
diff --git a/src/test/ui/parser/bad-pointer-type.stderr b/src/test/ui/parser/bad-pointer-type.stderr
index e18c220af..b7225ca88 100644
--- a/src/test/ui/parser/bad-pointer-type.stderr
+++ b/src/test/ui/parser/bad-pointer-type.stderr
@@ -1,10 +1,15 @@
-error: expected mut or const in raw pointer type
+error: expected `mut` or `const` keyword in raw pointer type
--> $DIR/bad-pointer-type.rs:1:11
|
LL | fn foo(_: *()) {
- | ^ expected mut or const in raw pointer type
+ | ^
|
- = help: use `*mut T` or `*const T` as appropriate
+help: add `mut` or `const` here
+ |
+LL | fn foo(_: *const ()) {
+ | +++++
+LL | fn foo(_: *mut ()) {
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs b/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs
index afbd13e6f..d8346653c 100644
--- a/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs
+++ b/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.rs
@@ -3,7 +3,11 @@
#[cfg(FALSE)]
fn syntax() {
foo::<T = u8, T: Ord, String>();
+ //~^ WARN associated type bounds are unstable
+ //~| WARN unstable syntax
foo::<T = u8, 'a, T: Ord>();
+ //~^ WARN associated type bounds are unstable
+ //~| WARN unstable syntax
}
fn main() {}
diff --git a/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.stderr b/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.stderr
new file mode 100644
index 000000000..7e843c7f4
--- /dev/null
+++ b/src/test/ui/parser/constraints-before-generic-args-syntactic-pass.stderr
@@ -0,0 +1,24 @@
+warning: associated type bounds are unstable
+ --> $DIR/constraints-before-generic-args-syntactic-pass.rs:5:19
+ |
+LL | foo::<T = u8, T: Ord, String>();
+ | ^^^^^^
+ |
+ = 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: 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: associated type bounds are unstable
+ --> $DIR/constraints-before-generic-args-syntactic-pass.rs:8:23
+ |
+LL | foo::<T = u8, 'a, T: Ord>();
+ | ^^^^^^
+ |
+ = 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: 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/src/test/ui/parser/default.stderr b/src/test/ui/parser/default.stderr
index 5b763ae72..37aa48ccf 100644
--- a/src/test/ui/parser/default.stderr
+++ b/src/test/ui/parser/default.stderr
@@ -29,9 +29,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0046]: not all trait items implemented, missing: `foo`
--> $DIR/default.rs:22:1
diff --git a/src/test/ui/parser/do-not-suggest-semicolon-before-array.rs b/src/test/ui/parser/do-not-suggest-semicolon-before-array.rs
new file mode 100644
index 000000000..7ebf3f6b0
--- /dev/null
+++ b/src/test/ui/parser/do-not-suggest-semicolon-before-array.rs
@@ -0,0 +1,8 @@
+fn foo() {}
+
+fn bar() -> [u8; 2] {
+ foo()
+ [1, 3) //~ ERROR expected one of `.`, `?`, `]`, or an operator, found `,`
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/do-not-suggest-semicolon-before-array.stderr b/src/test/ui/parser/do-not-suggest-semicolon-before-array.stderr
new file mode 100644
index 000000000..a9dd52632
--- /dev/null
+++ b/src/test/ui/parser/do-not-suggest-semicolon-before-array.stderr
@@ -0,0 +1,10 @@
+error: expected one of `.`, `?`, `]`, or an operator, found `,`
+ --> $DIR/do-not-suggest-semicolon-before-array.rs:5:5
+ |
+LL | [1, 3)
+ | ^ ^ help: `]` may belong here
+ | |
+ | unclosed delimiter
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.rs b/src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.rs
new file mode 100644
index 000000000..d6f798181
--- /dev/null
+++ b/src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.rs
@@ -0,0 +1,3 @@
+fn main() {
+ let _x = vec[1, 2, 3]; //~ ERROR expected one of `.`, `?`, `]`, or an operator
+}
diff --git a/src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.stderr b/src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.stderr
new file mode 100644
index 000000000..2fe6a28ee
--- /dev/null
+++ b/src/test/ui/parser/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.stderr
@@ -0,0 +1,8 @@
+error: expected one of `.`, `?`, `]`, or an operator, found `,`
+ --> $DIR/do-not-suggest-semicolon-between-macro-without-exclamation-mark-and-array.rs:2:19
+ |
+LL | let _x = vec[1, 2, 3];
+ | ^ expected one of `.`, `?`, `]`, or an operator
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/doc-after-struct-field.rs b/src/test/ui/parser/doc-after-struct-field.rs
index 5b6f08036..03faa6733 100644
--- a/src/test/ui/parser/doc-after-struct-field.rs
+++ b/src/test/ui/parser/doc-after-struct-field.rs
@@ -1,13 +1,13 @@
struct X {
a: u8 /** document a */,
//~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
+ //~| HELP if a comment was intended use `//`
}
struct Y {
a: u8 /// document a
//~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
+ //~| HELP if a comment was intended use `//`
}
fn main() {
diff --git a/src/test/ui/parser/doc-after-struct-field.stderr b/src/test/ui/parser/doc-after-struct-field.stderr
index e3b32a7f0..ae177f1a2 100644
--- a/src/test/ui/parser/doc-after-struct-field.stderr
+++ b/src/test/ui/parser/doc-after-struct-field.stderr
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | a: u8 /** document a */,
| ^^^^^^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-after-struct-field.rs:8:11
@@ -12,7 +12,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | a: u8 /// document a
| ^^^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/doc-before-extern-rbrace.stderr b/src/test/ui/parser/doc-before-extern-rbrace.stderr
index 0edceb268..8fa12ec26 100644
--- a/src/test/ui/parser/doc-before-extern-rbrace.stderr
+++ b/src/test/ui/parser/doc-before-extern-rbrace.stderr
@@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
LL | /// hi
| ^^^^^^ this doc comment doesn't document anything
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/doc-before-fn-rbrace.rs b/src/test/ui/parser/doc-before-fn-rbrace.rs
index eb355136f..c85021648 100644
--- a/src/test/ui/parser/doc-before-fn-rbrace.rs
+++ b/src/test/ui/parser/doc-before-fn-rbrace.rs
@@ -1,5 +1,5 @@
fn main() {
/// document
//~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
+ //~| HELP if a comment was intended use `//`
}
diff --git a/src/test/ui/parser/doc-before-fn-rbrace.stderr b/src/test/ui/parser/doc-before-fn-rbrace.stderr
index 56241de70..6ea68e42b 100644
--- a/src/test/ui/parser/doc-before-fn-rbrace.stderr
+++ b/src/test/ui/parser/doc-before-fn-rbrace.stderr
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// document
| ^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/doc-before-rbrace.rs b/src/test/ui/parser/doc-before-rbrace.rs
index 8ff946344..570306f2c 100644
--- a/src/test/ui/parser/doc-before-rbrace.rs
+++ b/src/test/ui/parser/doc-before-rbrace.rs
@@ -1,5 +1,5 @@
fn main() {
println!("Hi"); /// hi
//~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
+ //~| HELP if a comment was intended use `//`
}
diff --git a/src/test/ui/parser/doc-before-rbrace.stderr b/src/test/ui/parser/doc-before-rbrace.stderr
index 55719cf64..4d4741dfe 100644
--- a/src/test/ui/parser/doc-before-rbrace.stderr
+++ b/src/test/ui/parser/doc-before-rbrace.stderr
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | println!("Hi"); /// hi
| ^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/doc-before-semi.rs b/src/test/ui/parser/doc-before-semi.rs
index 405a7e1e2..444b5874e 100644
--- a/src/test/ui/parser/doc-before-semi.rs
+++ b/src/test/ui/parser/doc-before-semi.rs
@@ -1,6 +1,6 @@
fn main() {
/// hi
//~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
+ //~| HELP if a comment was intended use `//`
;
}
diff --git a/src/test/ui/parser/doc-before-semi.stderr b/src/test/ui/parser/doc-before-semi.stderr
index e6bade18d..a879e13ff 100644
--- a/src/test/ui/parser/doc-before-semi.stderr
+++ b/src/test/ui/parser/doc-before-semi.stderr
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// hi
| ^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/doc-before-struct-rbrace-1.rs b/src/test/ui/parser/doc-before-struct-rbrace-1.rs
index 3866a3105..0c8d90c3b 100644
--- a/src/test/ui/parser/doc-before-struct-rbrace-1.rs
+++ b/src/test/ui/parser/doc-before-struct-rbrace-1.rs
@@ -2,7 +2,7 @@ struct X {
a: u8,
/// document
//~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
+ //~| HELP if a comment was intended use `//`
}
fn main() {
diff --git a/src/test/ui/parser/doc-before-struct-rbrace-1.stderr b/src/test/ui/parser/doc-before-struct-rbrace-1.stderr
index 19f906773..94934f734 100644
--- a/src/test/ui/parser/doc-before-struct-rbrace-1.stderr
+++ b/src/test/ui/parser/doc-before-struct-rbrace-1.stderr
@@ -1,10 +1,13 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/doc-before-struct-rbrace-1.rs:3:5
|
+LL | struct X {
+ | - while parsing this struct
+LL | a: u8,
LL | /// document
| ^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/doc-before-struct-rbrace-2.rs b/src/test/ui/parser/doc-before-struct-rbrace-2.rs
index dda138f1a..2b2aadf79 100644
--- a/src/test/ui/parser/doc-before-struct-rbrace-2.rs
+++ b/src/test/ui/parser/doc-before-struct-rbrace-2.rs
@@ -1,7 +1,7 @@
struct X {
a: u8 /// document
//~^ ERROR found a documentation comment that doesn't document anything
- //~| HELP maybe a comment was intended
+ //~| HELP if a comment was intended use `//`
}
fn main() {
diff --git a/src/test/ui/parser/doc-before-struct-rbrace-2.stderr b/src/test/ui/parser/doc-before-struct-rbrace-2.stderr
index b25ccab79..6b5c8c1f8 100644
--- a/src/test/ui/parser/doc-before-struct-rbrace-2.stderr
+++ b/src/test/ui/parser/doc-before-struct-rbrace-2.stderr
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | a: u8 /// document
| ^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/doc-inside-trait-item.stderr b/src/test/ui/parser/doc-inside-trait-item.stderr
index 246255a0a..900124adc 100644
--- a/src/test/ui/parser/doc-inside-trait-item.stderr
+++ b/src/test/ui/parser/doc-inside-trait-item.stderr
@@ -4,7 +4,7 @@ error[E0584]: found a documentation comment that doesn't document anything
LL | /// empty doc
| ^^^^^^^^^^^^^ this doc comment doesn't document anything
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/double-pointer.rs b/src/test/ui/parser/double-pointer.rs
new file mode 100644
index 000000000..54d34db4a
--- /dev/null
+++ b/src/test/ui/parser/double-pointer.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let x: i32 = 5;
+ let ptr: *const i32 = &x;
+ let dptr: **const i32 = &ptr;
+ //~^ ERROR expected `mut` or `const` keyword in raw pointer type
+ //~| HELP add `mut` or `const` here
+}
diff --git a/src/test/ui/parser/double-pointer.stderr b/src/test/ui/parser/double-pointer.stderr
new file mode 100644
index 000000000..28037f932
--- /dev/null
+++ b/src/test/ui/parser/double-pointer.stderr
@@ -0,0 +1,15 @@
+error: expected `mut` or `const` keyword in raw pointer type
+ --> $DIR/double-pointer.rs:4:15
+ |
+LL | let dptr: **const i32 = &ptr;
+ | ^
+ |
+help: add `mut` or `const` here
+ |
+LL | let dptr: *const *const i32 = &ptr;
+ | +++++
+LL | let dptr: *mut *const i32 = &ptr;
+ | +++
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/emoji-identifiers.stderr b/src/test/ui/parser/emoji-identifiers.stderr
index 2550dc3d3..e645b68ba 100644
--- a/src/test/ui/parser/emoji-identifiers.stderr
+++ b/src/test/ui/parser/emoji-identifiers.stderr
@@ -9,15 +9,6 @@ help: Unicode character '➖' (Heavy Minus Sign) looks like '-' (Minus/Hyphen),
LL | let _ = i_like_to_😄_a_lot() - 4;
| ~
-error[E0425]: cannot find function `i_like_to_😄_a_lot` in this scope
- --> $DIR/emoji-identifiers.rs:13:13
- |
-LL | fn i_like_to_😅_a_lot() -> 👀 {
- | ----------------------------- similarly named function `i_like_to_😅_a_lot` defined here
-...
-LL | let _ = i_like_to_😄_a_lot() ➖ 4;
- | ^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `i_like_to_😅_a_lot`
-
error: Ferris cannot be used as an identifier
--> $DIR/emoji-identifiers.rs:17:9
|
@@ -85,6 +76,15 @@ LL | 👀::full_of✨()
| function or associated item not found in `👀`
| help: there is an associated function with a similar name: `full_of_✨`
+error[E0425]: cannot find function `i_like_to_😄_a_lot` in this scope
+ --> $DIR/emoji-identifiers.rs:13:13
+ |
+LL | fn i_like_to_😅_a_lot() -> 👀 {
+ | ----------------------------- similarly named function `i_like_to_😅_a_lot` defined here
+...
+LL | let _ = i_like_to_😄_a_lot() ➖ 4;
+ | ^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `i_like_to_😅_a_lot`
+
error: aborting due to 10 previous errors
Some errors have detailed explanations: E0425, E0599.
diff --git a/src/test/ui/parser/empty-impl-semicolon.rs b/src/test/ui/parser/empty-impl-semicolon.rs
index 207ebef64..2485f5b85 100644
--- a/src/test/ui/parser/empty-impl-semicolon.rs
+++ b/src/test/ui/parser/empty-impl-semicolon.rs
@@ -1 +1,4 @@
-impl Foo; //~ ERROR expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
+struct Foo;
+impl Foo; //~ ERROR expected `{}`, found `;`
+
+fn main() {}
diff --git a/src/test/ui/parser/empty-impl-semicolon.stderr b/src/test/ui/parser/empty-impl-semicolon.stderr
index 398eb5c89..6ed309eba 100644
--- a/src/test/ui/parser/empty-impl-semicolon.stderr
+++ b/src/test/ui/parser/empty-impl-semicolon.stderr
@@ -1,8 +1,10 @@
-error: expected one of `!`, `(`, `+`, `::`, `<`, `for`, `where`, or `{`, found `;`
- --> $DIR/empty-impl-semicolon.rs:1:9
+error: expected `{}`, found `;`
+ --> $DIR/empty-impl-semicolon.rs:2:9
|
LL | impl Foo;
- | ^ expected one of 8 possible tokens
+ | ^
+ |
+ = help: try using `{}` instead
error: aborting due to previous error
diff --git a/src/test/ui/parser/expr-as-stmt-2.stderr b/src/test/ui/parser/expr-as-stmt-2.stderr
index 9b939f05e..2b6314c38 100644
--- a/src/test/ui/parser/expr-as-stmt-2.stderr
+++ b/src/test/ui/parser/expr-as-stmt-2.stderr
@@ -36,11 +36,6 @@ LL | / &&
LL | | if let Some(y) = a { true } else { false }
| |______________________________________________^ expected `bool`, found `&&bool`
|
-help: consider removing the `&&`
- |
-LL - &&
-LL + if let Some(y) = a { true } else { false }
- |
help: parentheses are required to parse this as an expression
|
LL | (if let Some(x) = a { true } else { false })
diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr
index 858b4e8db..6da4ac340 100644
--- a/src/test/ui/parser/expr-as-stmt.stderr
+++ b/src/test/ui/parser/expr-as-stmt.stderr
@@ -170,11 +170,6 @@ LL | fn revenge_from_mars() -> bool {
LL | { true } && { true }
| ^^^^^^^^^^^ expected `bool`, found `&&bool`
|
-help: consider removing the `&&`
- |
-LL - { true } && { true }
-LL + { true } { true }
- |
help: parentheses are required to parse this as an expression
|
LL | ({ true }) && { true }
@@ -201,10 +196,6 @@ LL | { true } || { true }
|
= note: expected type `bool`
found closure `[closure@$DIR/expr-as-stmt.rs:51:14: 51:16]`
-help: use parentheses to call this closure
- |
-LL | { true } (|| { true })()
- | + +++
help: parentheses are required to parse this as an expression
|
LL | ({ true }) || { true }
diff --git a/src/test/ui/parser/fn-defined-using-def.rs b/src/test/ui/parser/fn-defined-using-def.rs
new file mode 100644
index 000000000..21da34c47
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-def.rs
@@ -0,0 +1,10 @@
+// Check what happens when `def` is used to define a function, instead of `fn`
+// edition:2021
+
+#![allow(dead_code)]
+
+def foo() {}
+//~^ ERROR expected one of `!` or `::`, found `foo`
+//~^^ HELP write `fn` instead of `def` to declare a function
+
+fn main() {}
diff --git a/src/test/ui/parser/fn-defined-using-def.stderr b/src/test/ui/parser/fn-defined-using-def.stderr
new file mode 100644
index 000000000..f34329012
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-def.stderr
@@ -0,0 +1,10 @@
+error: expected one of `!` or `::`, found `foo`
+ --> $DIR/fn-defined-using-def.rs:6:5
+ |
+LL | def foo() {}
+ | --- ^^^ expected one of `!` or `::`
+ | |
+ | help: write `fn` instead of `def` to declare a function
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/fn-defined-using-fun.rs b/src/test/ui/parser/fn-defined-using-fun.rs
new file mode 100644
index 000000000..4f7460504
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-fun.rs
@@ -0,0 +1,10 @@
+// Check what happens when `fun` is used to define a function, instead of `fn`
+// edition:2021
+
+#![allow(dead_code)]
+
+fun foo() {}
+//~^ ERROR expected one of `!` or `::`, found `foo`
+//~^^ HELP write `fn` instead of `fun` to declare a function
+
+fn main() {}
diff --git a/src/test/ui/parser/fn-defined-using-fun.stderr b/src/test/ui/parser/fn-defined-using-fun.stderr
new file mode 100644
index 000000000..2f6cfff35
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-fun.stderr
@@ -0,0 +1,10 @@
+error: expected one of `!` or `::`, found `foo`
+ --> $DIR/fn-defined-using-fun.rs:6:5
+ |
+LL | fun foo() {}
+ | --- ^^^ expected one of `!` or `::`
+ | |
+ | help: write `fn` instead of `fun` to declare a function
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/fn-defined-using-func.rs b/src/test/ui/parser/fn-defined-using-func.rs
new file mode 100644
index 000000000..2dce96fdc
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-func.rs
@@ -0,0 +1,10 @@
+// Check what happens when `func` is used to define a function, instead of `fn`
+// edition:2021
+
+#![allow(dead_code)]
+
+func foo() {}
+//~^ ERROR expected one of `!` or `::`, found `foo`
+//~^^ HELP write `fn` instead of `func` to declare a function
+
+fn main() {}
diff --git a/src/test/ui/parser/fn-defined-using-func.stderr b/src/test/ui/parser/fn-defined-using-func.stderr
new file mode 100644
index 000000000..355741e89
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-func.stderr
@@ -0,0 +1,10 @@
+error: expected one of `!` or `::`, found `foo`
+ --> $DIR/fn-defined-using-func.rs:6:6
+ |
+LL | func foo() {}
+ | ---- ^^^ expected one of `!` or `::`
+ | |
+ | help: write `fn` instead of `func` to declare a function
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/fn-defined-using-function.rs b/src/test/ui/parser/fn-defined-using-function.rs
new file mode 100644
index 000000000..fd8782728
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-function.rs
@@ -0,0 +1,10 @@
+// Check what happens when `function` is used to define a function, instead of `fn`
+// edition:2021
+
+#![allow(dead_code)]
+
+function foo() {}
+//~^ ERROR expected one of `!` or `::`, found `foo`
+//~^^ HELP write `fn` instead of `function` to declare a function
+
+fn main() {}
diff --git a/src/test/ui/parser/fn-defined-using-function.stderr b/src/test/ui/parser/fn-defined-using-function.stderr
new file mode 100644
index 000000000..43c33a2cd
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-function.stderr
@@ -0,0 +1,10 @@
+error: expected one of `!` or `::`, found `foo`
+ --> $DIR/fn-defined-using-function.rs:6:10
+ |
+LL | function foo() {}
+ | -------- ^^^ expected one of `!` or `::`
+ | |
+ | help: write `fn` instead of `function` to declare a function
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/fn-field-parse-error-ice.rs b/src/test/ui/parser/fn-field-parse-error-ice.rs
index 4ea55062f..188257ea5 100644
--- a/src/test/ui/parser/fn-field-parse-error-ice.rs
+++ b/src/test/ui/parser/fn-field-parse-error-ice.rs
@@ -3,7 +3,7 @@
struct Baz {
inner : dyn fn ()
//~^ ERROR expected `,`, or `}`, found keyword `fn`
- //~| ERROR functions are not allowed in struct definitions
+ //~| ERROR expected identifier, found keyword `fn`
//~| ERROR cannot find type `dyn` in this scope
}
diff --git a/src/test/ui/parser/fn-field-parse-error-ice.stderr b/src/test/ui/parser/fn-field-parse-error-ice.stderr
index d582f61cc..3bf68e8cc 100644
--- a/src/test/ui/parser/fn-field-parse-error-ice.stderr
+++ b/src/test/ui/parser/fn-field-parse-error-ice.stderr
@@ -4,14 +4,18 @@ error: expected `,`, or `}`, found keyword `fn`
LL | inner : dyn fn ()
| ^ help: try adding a comma: `,`
-error: functions are not allowed in struct definitions
+error: expected identifier, found keyword `fn`
--> $DIR/fn-field-parse-error-ice.rs:4:17
|
+LL | struct Baz {
+ | --- while parsing this struct
LL | inner : dyn fn ()
- | ^^
+ | ^^ expected identifier, found keyword
|
- = help: unlike in C++, Java, and C#, functions are declared in `impl` blocks
- = help: see https://doc.rust-lang.org/book/ch05-03-method-syntax.html for more information
+help: escape `fn` to use it as an identifier
+ |
+LL | inner : dyn r#fn ()
+ | ++
error[E0412]: cannot find type `dyn` in this scope
--> $DIR/fn-field-parse-error-ice.rs:4:13
diff --git a/src/test/ui/parser/fn-header-semantic-fail.rs b/src/test/ui/parser/fn-header-semantic-fail.rs
index 8ff14fb1f..cf5d3dab4 100644
--- a/src/test/ui/parser/fn-header-semantic-fail.rs
+++ b/src/test/ui/parser/fn-header-semantic-fail.rs
@@ -27,7 +27,6 @@ fn main() {
struct Y;
impl X for Y {
async fn ft1() {} //~ ERROR functions in traits cannot be declared `async`
- //~^ ERROR has an incompatible type for trait
unsafe fn ft2() {} // OK.
const fn ft3() {} //~ ERROR functions in traits cannot be declared const
extern "C" fn ft4() {}
@@ -36,7 +35,6 @@ fn main() {
//~| ERROR functions in traits cannot be declared const
//~| ERROR functions cannot be both `const` and `async`
//~| ERROR cycle detected
- //~| ERROR has an incompatible type for trait
}
impl Y {
diff --git a/src/test/ui/parser/fn-header-semantic-fail.stderr b/src/test/ui/parser/fn-header-semantic-fail.stderr
index bc51ba8b8..038fdfb2d 100644
--- a/src/test/ui/parser/fn-header-semantic-fail.stderr
+++ b/src/test/ui/parser/fn-header-semantic-fail.stderr
@@ -7,17 +7,6 @@ LL | const async unsafe extern "C" fn ff5() {}
| | `async` because of this
| `const` because of this
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:17:9
- |
-LL | async fn ft1();
- | -----^^^^^^^^^^
- | |
- | `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
-
error[E0379]: functions in traits cannot be declared const
--> $DIR/fn-header-semantic-fail.rs:19:9
|
@@ -30,17 +19,6 @@ error[E0379]: functions in traits cannot be declared const
LL | const async unsafe extern "C" fn ft5();
| ^^^^^ functions in traits cannot be const
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:21:9
- |
-LL | const async unsafe extern "C" fn ft5();
- | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | `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
-
error: functions cannot be both `const` and `async`
--> $DIR/fn-header-semantic-fail.rs:21:9
|
@@ -50,42 +28,20 @@ LL | const async unsafe extern "C" fn ft5();
| | `async` because of this
| `const` because of this
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:29:9
- |
-LL | async fn ft1() {}
- | -----^^^^^^^^^^^^
- | |
- | `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
-
error[E0379]: functions in traits cannot be declared const
- --> $DIR/fn-header-semantic-fail.rs:32:9
+ --> $DIR/fn-header-semantic-fail.rs:31: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:34:9
+ --> $DIR/fn-header-semantic-fail.rs:33:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^ functions in traits cannot be const
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/fn-header-semantic-fail.rs:34:9
- |
-LL | const async unsafe extern "C" fn ft5() {}
- | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | `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
-
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:34:9
+ --> $DIR/fn-header-semantic-fail.rs:33:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^-^^^^^------------------------------
@@ -94,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:47:9
+ --> $DIR/fn-header-semantic-fail.rs:45:9
|
LL | const async unsafe extern "C" fn fi5() {}
| ^^^^^-^^^^^------------------------------
@@ -103,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:53:18
+ --> $DIR/fn-header-semantic-fail.rs:51:18
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -116,7 +72,7 @@ LL | fn fe1();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:54:19
+ --> $DIR/fn-header-semantic-fail.rs:52:19
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -130,7 +86,7 @@ LL | fn fe2();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:55:18
+ --> $DIR/fn-header-semantic-fail.rs:53:18
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -144,7 +100,7 @@ LL | fn fe3();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:56:23
+ --> $DIR/fn-header-semantic-fail.rs:54:23
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -158,7 +114,7 @@ LL | fn fe4();
| ~~
error: functions in `extern` blocks cannot have qualifiers
- --> $DIR/fn-header-semantic-fail.rs:57:42
+ --> $DIR/fn-header-semantic-fail.rs:55:42
|
LL | extern "C" {
| ---------- in this `extern` block
@@ -172,7 +128,7 @@ LL | fn fe5();
| ~~
error: functions cannot be both `const` and `async`
- --> $DIR/fn-header-semantic-fail.rs:57:9
+ --> $DIR/fn-header-semantic-fail.rs:55:9
|
LL | const async unsafe extern "C" fn fe5();
| ^^^^^-^^^^^----------------------------
@@ -180,6 +136,58 @@ LL | const async unsafe extern "C" fn fe5();
| | `async` because of this
| `const` because of this
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/fn-header-semantic-fail.rs:17:9
+ |
+LL | async fn ft1();
+ | -----^^^^^^^^^^
+ | |
+ | `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/fn-header-semantic-fail.rs:21:9
+ |
+LL | const async unsafe extern "C" fn ft5();
+ | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | `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/fn-header-semantic-fail.rs:29:9
+ |
+LL | async fn ft1() {}
+ | -----^^^^^^^^^
+ | |
+ | `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/fn-header-semantic-fail.rs:33:9
+ |
+LL | const async unsafe extern "C" fn ft5() {}
+ | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | `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[E0391]: cycle detected when computing type of `main::ff5::{opaque#0}`
--> $DIR/fn-header-semantic-fail.rs:12:44
|
@@ -191,7 +199,7 @@ note: ...which requires borrow-checking `main::ff5`...
|
LL | const async unsafe extern "C" fn ff5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing `main::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() {}
@@ -216,60 +224,24 @@ LL | | }
LL | | }
| |_^
-error[E0053]: method `ft1` has an incompatible type for trait
- --> $DIR/fn-header-semantic-fail.rs:29:24
- |
-LL | async fn ft1() {}
- | ^
- | |
- | checked the `Output` of this `async fn`, found opaque type
- | expected `()`, found opaque type
- |
- = note: while checking the return type of the `async fn`
-note: type in trait
- --> $DIR/fn-header-semantic-fail.rs:17:23
- |
-LL | async fn ft1();
- | ^
- = note: expected fn pointer `fn()`
- found fn pointer `fn() -> impl Future<Output = ()>`
-
-error[E0053]: method `ft5` has an incompatible type for trait
- --> $DIR/fn-header-semantic-fail.rs:34:48
- |
-LL | const async unsafe extern "C" fn ft5() {}
- | ^
- | |
- | checked the `Output` of this `async fn`, found opaque type
- | expected `()`, found opaque type
- |
- = note: while checking the return type of the `async fn`
-note: type in trait
- --> $DIR/fn-header-semantic-fail.rs:21:47
- |
-LL | const async unsafe extern "C" fn ft5();
- | ^
- = note: expected fn pointer `unsafe extern "C" fn()`
- found fn pointer `unsafe extern "C" fn() -> impl Future<Output = ()>`
-
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:34:48
+ --> $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:34:9
+ --> $DIR/fn-header-semantic-fail.rs:33:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
- --> $DIR/fn-header-semantic-fail.rs:34:9
+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:34:9
+ --> $DIR/fn-header-semantic-fail.rs:33:9
|
LL | const async unsafe extern "C" fn ft5() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -288,30 +260,30 @@ LL | | }
LL | | }
| |_^
-error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5::{opaque#0}`
- --> $DIR/fn-header-semantic-fail.rs:47:48
+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:42:5: 42:11>::fi5`...
- --> $DIR/fn-header-semantic-fail.rs:47:9
+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 `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
- --> $DIR/fn-header-semantic-fail.rs:47:9
+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:42:5: 42:11>::fi5`...
- --> $DIR/fn-header-semantic-fail.rs:47:9
+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 `impl core::future::future::Future<Output = ()>` is freeze...
= note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
- = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5::{opaque#0}`, completing the cycle
+ = 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
|
@@ -324,7 +296,7 @@ LL | | }
LL | | }
| |_^
-error: aborting due to 23 previous errors
+error: aborting due to 21 previous errors
-Some errors have detailed explanations: E0053, E0379, E0391, E0706.
-For more information about an error, try `rustc --explain E0053`.
+Some errors have detailed explanations: E0379, E0391, E0706.
+For more information about an error, try `rustc --explain E0379`.
diff --git a/src/test/ui/parser/impl-item-type-no-body-semantic-fail.rs b/src/test/ui/parser/impl-item-type-no-body-semantic-fail.rs
index 9871cb8fe..1291a021b 100644
--- a/src/test/ui/parser/impl-item-type-no-body-semantic-fail.rs
+++ b/src/test/ui/parser/impl-item-type-no-body-semantic-fail.rs
@@ -1,5 +1,3 @@
-#![feature(generic_associated_types)]
-
fn main() {}
struct X;
diff --git a/src/test/ui/parser/impl-item-type-no-body-semantic-fail.stderr b/src/test/ui/parser/impl-item-type-no-body-semantic-fail.stderr
index 4b398d791..3856754e0 100644
--- a/src/test/ui/parser/impl-item-type-no-body-semantic-fail.stderr
+++ b/src/test/ui/parser/impl-item-type-no-body-semantic-fail.stderr
@@ -1,5 +1,5 @@
error: associated type in `impl` without body
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:8:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:6:5
|
LL | type Y;
| ^^^^^^-
@@ -7,7 +7,7 @@ LL | type Y;
| help: provide a definition for the type: `= <type>;`
error: associated type in `impl` without body
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:11:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:9:5
|
LL | type Z: Ord;
| ^^^^^^^^^^^-
@@ -15,13 +15,13 @@ LL | type Z: Ord;
| help: provide a definition for the type: `= <type>;`
error: bounds on `type`s in `impl`s have no effect
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:11:13
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:9:13
|
LL | type Z: Ord;
| ^^^
error: associated type in `impl` without body
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:15:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:13:5
|
LL | type W: Ord where Self: Eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^-
@@ -29,13 +29,13 @@ LL | type W: Ord where Self: Eq;
| help: provide a definition for the type: `= <type>;`
error: bounds on `type`s in `impl`s have no effect
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:15:13
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:13:13
|
LL | type W: Ord where Self: Eq;
| ^^^
error: associated type in `impl` without body
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:19:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
|
LL | type W where Self: Eq;
| ^^^^^^^^^^^^^^^^^^^^^-
@@ -43,7 +43,7 @@ LL | type W where Self: Eq;
| help: provide a definition for the type: `= <type>;`
error[E0658]: inherent associated types are unstable
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:8:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:6:5
|
LL | type Y;
| ^^^^^^^
@@ -52,7 +52,7 @@ LL | type Y;
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
error[E0658]: inherent associated types are unstable
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:11:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:9:5
|
LL | type Z: Ord;
| ^^^^^^^^^^^^
@@ -61,7 +61,7 @@ LL | type Z: Ord;
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
error[E0658]: inherent associated types are unstable
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:15:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:13:5
|
LL | type W: Ord where Self: Eq;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -70,7 +70,7 @@ LL | type W: Ord where Self: Eq;
= help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
error[E0658]: inherent associated types are unstable
- --> $DIR/impl-item-type-no-body-semantic-fail.rs:19:5
+ --> $DIR/impl-item-type-no-body-semantic-fail.rs:17:5
|
LL | type W where Self: Eq;
| ^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/parser/increment-notfixed.stderr b/src/test/ui/parser/increment-notfixed.stderr
index 352d98cf8..ae55ae067 100644
--- a/src/test/ui/parser/increment-notfixed.stderr
+++ b/src/test/ui/parser/increment-notfixed.stderr
@@ -8,9 +8,8 @@ help: use `+= 1` instead
|
LL | { let tmp = i; i += 1; tmp };
| +++++++++++ ~~~~~~~~~~~~~~~
-LL - i++;
-LL + i += 1;
- |
+LL | i += 1;
+ | ~~~~
error: Rust has no postfix increment operator
--> $DIR/increment-notfixed.rs:17:12
@@ -24,9 +23,8 @@ help: use `+= 1` instead
|
LL | while { let tmp = i; i += 1; tmp } < 5 {
| +++++++++++ ~~~~~~~~~~~~~~~
-LL - while i++ < 5 {
-LL + while i += 1 < 5 {
- |
+LL | while i += 1 < 5 {
+ | ~~~~
error: Rust has no postfix increment operator
--> $DIR/increment-notfixed.rs:25:8
@@ -38,9 +36,8 @@ help: use `+= 1` instead
|
LL | { let tmp_ = tmp; tmp += 1; tmp_ };
| ++++++++++++ ~~~~~~~~~~~~~~~~~~
-LL - tmp++;
-LL + tmp += 1;
- |
+LL | tmp += 1;
+ | ~~~~
error: Rust has no postfix increment operator
--> $DIR/increment-notfixed.rs:31:14
@@ -54,9 +51,8 @@ help: use `+= 1` instead
|
LL | while { let tmp_ = tmp; tmp += 1; tmp_ } < 5 {
| ++++++++++++ ~~~~~~~~~~~~~~~~~~
-LL - while tmp++ < 5 {
-LL + while tmp += 1 < 5 {
- |
+LL | while tmp += 1 < 5 {
+ | ~~~~
error: Rust has no postfix increment operator
--> $DIR/increment-notfixed.rs:39:16
@@ -68,9 +64,8 @@ help: use `+= 1` instead
|
LL | { let tmp = foo.bar.qux; foo.bar.qux += 1; tmp };
| +++++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~
-LL - foo.bar.qux++;
-LL + foo.bar.qux += 1;
- |
+LL | foo.bar.qux += 1;
+ | ~~~~
error: Rust has no postfix increment operator
--> $DIR/increment-notfixed.rs:49:10
@@ -82,9 +77,8 @@ help: use `+= 1` instead
|
LL | { let tmp = s.tmp; s.tmp += 1; tmp };
| +++++++++++ ~~~~~~~~~~~~~~~~~~~
-LL - s.tmp++;
-LL + s.tmp += 1;
- |
+LL | s.tmp += 1;
+ | ~~~~
error: Rust has no prefix increment operator
--> $DIR/increment-notfixed.rs:56:5
diff --git a/src/test/ui/parser/inner-attr-after-doc-comment.stderr b/src/test/ui/parser/inner-attr-after-doc-comment.stderr
index 2cfafac77..3ec3ad8e9 100644
--- a/src/test/ui/parser/inner-attr-after-doc-comment.stderr
+++ b/src/test/ui/parser/inner-attr-after-doc-comment.stderr
@@ -7,7 +7,7 @@ LL | | */
| |___- previous doc comment
LL |
LL | #![recursion_limit="100"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ not permitted following an outer attribute
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ not permitted following an outer doc comment
LL |
LL | fn main() {}
| ------------ the inner attribute doesn't annotate this function
diff --git a/src/test/ui/parser/issue-100197-mut-let.fixed b/src/test/ui/parser/issue-100197-mut-let.fixed
new file mode 100644
index 000000000..5a8956222
--- /dev/null
+++ b/src/test/ui/parser/issue-100197-mut-let.fixed
@@ -0,0 +1,6 @@
+// run-rustfix
+
+fn main() {
+ let mut _x = 123;
+ //~^ ERROR invalid variable declaration
+}
diff --git a/src/test/ui/parser/issue-100197-mut-let.rs b/src/test/ui/parser/issue-100197-mut-let.rs
new file mode 100644
index 000000000..71103813a
--- /dev/null
+++ b/src/test/ui/parser/issue-100197-mut-let.rs
@@ -0,0 +1,6 @@
+// run-rustfix
+
+fn main() {
+ mut let _x = 123;
+ //~^ ERROR invalid variable declaration
+}
diff --git a/src/test/ui/parser/issue-100197-mut-let.stderr b/src/test/ui/parser/issue-100197-mut-let.stderr
new file mode 100644
index 000000000..86658e4f3
--- /dev/null
+++ b/src/test/ui/parser/issue-100197-mut-let.stderr
@@ -0,0 +1,8 @@
+error: invalid variable declaration
+ --> $DIR/issue-100197-mut-let.rs:4:5
+ |
+LL | mut let _x = 123;
+ | ^^^^^^^ help: switch the order of `mut` and `let`: `let mut`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-101477-enum.fixed b/src/test/ui/parser/issue-101477-enum.fixed
new file mode 100644
index 000000000..1dfeae22a
--- /dev/null
+++ b/src/test/ui/parser/issue-101477-enum.fixed
@@ -0,0 +1,10 @@
+// run-rustfix
+
+#[allow(dead_code)]
+enum Demo {
+ A = 1,
+ B = 2 //~ ERROR unexpected `==`
+ //~^ expected item, found `==`
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/issue-101477-enum.rs b/src/test/ui/parser/issue-101477-enum.rs
new file mode 100644
index 000000000..ea7051d69
--- /dev/null
+++ b/src/test/ui/parser/issue-101477-enum.rs
@@ -0,0 +1,10 @@
+// run-rustfix
+
+#[allow(dead_code)]
+enum Demo {
+ A = 1,
+ B == 2 //~ ERROR unexpected `==`
+ //~^ expected item, found `==`
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/issue-101477-enum.stderr b/src/test/ui/parser/issue-101477-enum.stderr
new file mode 100644
index 000000000..bffc881bd
--- /dev/null
+++ b/src/test/ui/parser/issue-101477-enum.stderr
@@ -0,0 +1,14 @@
+error: unexpected `==`
+ --> $DIR/issue-101477-enum.rs:6:7
+ |
+LL | B == 2
+ | ^^ help: try using `=` instead
+
+error: expected item, found `==`
+ --> $DIR/issue-101477-enum.rs:6:7
+ |
+LL | B == 2
+ | ^^ expected item
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/parser/issue-101477-let.fixed b/src/test/ui/parser/issue-101477-let.fixed
new file mode 100644
index 000000000..9989ad815
--- /dev/null
+++ b/src/test/ui/parser/issue-101477-let.fixed
@@ -0,0 +1,6 @@
+// run-rustfix
+
+fn main() {
+ let x = 2; //~ ERROR unexpected `==`
+ println!("x: {}", x)
+}
diff --git a/src/test/ui/parser/issue-101477-let.rs b/src/test/ui/parser/issue-101477-let.rs
new file mode 100644
index 000000000..8b0e8bee1
--- /dev/null
+++ b/src/test/ui/parser/issue-101477-let.rs
@@ -0,0 +1,6 @@
+// run-rustfix
+
+fn main() {
+ let x == 2; //~ ERROR unexpected `==`
+ println!("x: {}", x)
+}
diff --git a/src/test/ui/parser/issue-101477-let.stderr b/src/test/ui/parser/issue-101477-let.stderr
new file mode 100644
index 000000000..1b30d4b17
--- /dev/null
+++ b/src/test/ui/parser/issue-101477-let.stderr
@@ -0,0 +1,8 @@
+error: unexpected `==`
+ --> $DIR/issue-101477-let.rs:4:11
+ |
+LL | let x == 2;
+ | ^^ help: try using `=` instead
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issue-103143.rs b/src/test/ui/parser/issue-103143.rs
new file mode 100644
index 000000000..a584274c4
--- /dev/null
+++ b/src/test/ui/parser/issue-103143.rs
@@ -0,0 +1,5 @@
+fn main() {
+ x::<#[a]y::<z>>
+ //~^ ERROR invalid const generic expression
+ //~| ERROR cannot find value `x` in this scope
+}
diff --git a/src/test/ui/parser/issue-103143.stderr b/src/test/ui/parser/issue-103143.stderr
new file mode 100644
index 000000000..4035c69af
--- /dev/null
+++ b/src/test/ui/parser/issue-103143.stderr
@@ -0,0 +1,20 @@
+error: invalid const generic expression
+ --> $DIR/issue-103143.rs:2:13
+ |
+LL | x::<#[a]y::<z>>
+ | ^^^^^^
+ |
+help: expressions must be enclosed in braces to be used as const generic arguments
+ |
+LL | x::<#[a]{ y::<z> }>
+ | + +
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/issue-103143.rs:2:5
+ |
+LL | x::<#[a]y::<z>>
+ | ^ not found in this scope
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/parser/issue-103425.rs b/src/test/ui/parser/issue-103425.rs
new file mode 100644
index 000000000..c2f8123ca
--- /dev/null
+++ b/src/test/ui/parser/issue-103425.rs
@@ -0,0 +1,15 @@
+fn f() -> f32 {
+ 3
+ //~^ ERROR expected `;`
+ 5.0
+}
+
+fn k() -> f32 {
+ 2_u32
+ //~^ ERROR expected `;`
+ 3_i8
+ //~^ ERROR expected `;`
+ 5.0
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/issue-103425.stderr b/src/test/ui/parser/issue-103425.stderr
new file mode 100644
index 000000000..0efe3e3ca
--- /dev/null
+++ b/src/test/ui/parser/issue-103425.stderr
@@ -0,0 +1,29 @@
+error: expected `;`, found `5.0`
+ --> $DIR/issue-103425.rs:2:6
+ |
+LL | 3
+ | ^ help: add `;` here
+LL |
+LL | 5.0
+ | --- unexpected token
+
+error: expected `;`, found `3_i8`
+ --> $DIR/issue-103425.rs:8:10
+ |
+LL | 2_u32
+ | ^ help: add `;` here
+LL |
+LL | 3_i8
+ | ---- unexpected token
+
+error: expected `;`, found `5.0`
+ --> $DIR/issue-103425.rs:10:9
+ |
+LL | 3_i8
+ | ^ help: add `;` here
+LL |
+LL | 5.0
+ | --- unexpected token
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/issues/issue-17718-parse-const.rs b/src/test/ui/parser/issue-17718-parse-const.rs
index d5a5f445d..d5a5f445d 100644
--- a/src/test/ui/issues/issue-17718-parse-const.rs
+++ b/src/test/ui/parser/issue-17718-parse-const.rs
diff --git a/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.fixed b/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.fixed
new file mode 100644
index 000000000..64ab6f62b
--- /dev/null
+++ b/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.fixed
@@ -0,0 +1,8 @@
+// run-rustfix
+
+fn main() {
+ const _FOO: i32 = 123;
+ //~^ ERROR const` and `let` are mutually exclusive
+ const _BAR: i32 = 123;
+ //~^ ERROR `const` and `let` are mutually exclusive
+}
diff --git a/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.rs b/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.rs
new file mode 100644
index 000000000..50520971f
--- /dev/null
+++ b/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.rs
@@ -0,0 +1,8 @@
+// run-rustfix
+
+fn main() {
+ const let _FOO: i32 = 123;
+ //~^ ERROR const` and `let` are mutually exclusive
+ let const _BAR: i32 = 123;
+ //~^ ERROR `const` and `let` are mutually exclusive
+}
diff --git a/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.stderr b/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.stderr
new file mode 100644
index 000000000..72377fc37
--- /dev/null
+++ b/src/test/ui/parser/issue-99910-const-let-mutually-exclusive.stderr
@@ -0,0 +1,14 @@
+error: `const` and `let` are mutually exclusive
+ --> $DIR/issue-99910-const-let-mutually-exclusive.rs:4:5
+ |
+LL | const let _FOO: i32 = 123;
+ | ^^^^^^^^^ help: remove `let`: `const`
+
+error: `const` and `let` are mutually exclusive
+ --> $DIR/issue-99910-const-let-mutually-exclusive.rs:6:5
+ |
+LL | let const _BAR: i32 = 123;
+ | ^^^^^^^^^ help: remove `let`: `const`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/parser/issues/issue-101540.rs b/src/test/ui/parser/issues/issue-101540.rs
new file mode 100644
index 000000000..328ec6f90
--- /dev/null
+++ b/src/test/ui/parser/issues/issue-101540.rs
@@ -0,0 +1,7 @@
+struct S1 {
+ struct S2 {
+ //~^ ERROR structs are not allowed in struct definitions
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/issues/issue-101540.stderr b/src/test/ui/parser/issues/issue-101540.stderr
new file mode 100644
index 000000000..8af887050
--- /dev/null
+++ b/src/test/ui/parser/issues/issue-101540.stderr
@@ -0,0 +1,12 @@
+error: structs are not allowed in struct definitions
+ --> $DIR/issue-101540.rs:2:5
+ |
+LL | struct S1 {
+ | -- while parsing this struct
+LL | struct S2 {
+ | ^^^^^^^^^
+ |
+ = help: consider creating a new `struct` definition instead of nesting
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issues/issue-102182-impl-trait-recover.rs b/src/test/ui/parser/issues/issue-102182-impl-trait-recover.rs
new file mode 100644
index 000000000..4bfc676d6
--- /dev/null
+++ b/src/test/ui/parser/issues/issue-102182-impl-trait-recover.rs
@@ -0,0 +1,3 @@
+fn foo<T: impl Trait>() {}
+//~^ ERROR expected trait bound, found `impl Trait` type
+fn main() {}
diff --git a/src/test/ui/parser/issues/issue-102182-impl-trait-recover.stderr b/src/test/ui/parser/issues/issue-102182-impl-trait-recover.stderr
new file mode 100644
index 000000000..52b6ae5df
--- /dev/null
+++ b/src/test/ui/parser/issues/issue-102182-impl-trait-recover.stderr
@@ -0,0 +1,14 @@
+error: expected trait bound, found `impl Trait` type
+ --> $DIR/issue-102182-impl-trait-recover.rs:1:11
+ |
+LL | fn foo<T: impl Trait>() {}
+ | ^^^^^^^^^^ not a trait
+ |
+help: use the trait bounds directly
+ |
+LL - fn foo<T: impl Trait>() {}
+LL + fn foo<T: Trait>() {}
+ |
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/issues/issue-14303-enum.rs b/src/test/ui/parser/issues/issue-14303-enum.rs
deleted file mode 100644
index a61061598..000000000
--- a/src/test/ui/parser/issues/issue-14303-enum.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-enum X<'a, T, 'b> {
-//~^ ERROR lifetime parameters must be declared prior to type parameters
- A(&'a &'b T)
-}
-
-fn main() {}
diff --git a/src/test/ui/parser/issues/issue-14303-enum.stderr b/src/test/ui/parser/issues/issue-14303-enum.stderr
deleted file mode 100644
index 55cef4cab..000000000
--- a/src/test/ui/parser/issues/issue-14303-enum.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: lifetime parameters must be declared prior to type parameters
- --> $DIR/issue-14303-enum.rs:1:15
- |
-LL | enum X<'a, T, 'b> {
- | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/issues/issue-14303-fn-def.rs b/src/test/ui/parser/issues/issue-14303-fn-def.rs
deleted file mode 100644
index 221bd311e..000000000
--- a/src/test/ui/parser/issues/issue-14303-fn-def.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-fn foo<'a, T, 'b>(x: &'a T) {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
-
-fn main() {}
diff --git a/src/test/ui/parser/issues/issue-14303-fn-def.stderr b/src/test/ui/parser/issues/issue-14303-fn-def.stderr
deleted file mode 100644
index bacc92296..000000000
--- a/src/test/ui/parser/issues/issue-14303-fn-def.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: lifetime parameters must be declared prior to type parameters
- --> $DIR/issue-14303-fn-def.rs:1:15
- |
-LL | fn foo<'a, T, 'b>(x: &'a T) {}
- | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/issues/issue-14303-impl.rs b/src/test/ui/parser/issues/issue-14303-impl.rs
deleted file mode 100644
index 4dc2c6660..000000000
--- a/src/test/ui/parser/issues/issue-14303-impl.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-struct X<T>(T);
-
-impl<'a, T, 'b> X<T> {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
-
-fn main() {}
diff --git a/src/test/ui/parser/issues/issue-14303-impl.stderr b/src/test/ui/parser/issues/issue-14303-impl.stderr
deleted file mode 100644
index d6be02f70..000000000
--- a/src/test/ui/parser/issues/issue-14303-impl.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: lifetime parameters must be declared prior to type parameters
- --> $DIR/issue-14303-impl.rs:3:13
- |
-LL | impl<'a, T, 'b> X<T> {}
- | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/issues/issue-14303-path.rs b/src/test/ui/parser/issues/issue-14303-path.rs
deleted file mode 100644
index 89ef914ab..000000000
--- a/src/test/ui/parser/issues/issue-14303-path.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-mod foo {
- pub struct X<'a, 'b, 'c, T> {
- a: &'a str,
- b: &'b str,
- c: &'c str,
- t: T,
- }
-}
-
-fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
-//~^ ERROR type provided when a lifetime was expected
-
-fn main() {}
diff --git a/src/test/ui/parser/issues/issue-14303-path.stderr b/src/test/ui/parser/issues/issue-14303-path.stderr
deleted file mode 100644
index 841e63ecb..000000000
--- a/src/test/ui/parser/issues/issue-14303-path.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0747]: type provided when a lifetime was expected
- --> $DIR/issue-14303-path.rs:10:37
- |
-LL | fn bar<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}
- | ^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/parser/issues/issue-14303-struct.rs b/src/test/ui/parser/issues/issue-14303-struct.rs
deleted file mode 100644
index 0bd10b4d0..000000000
--- a/src/test/ui/parser/issues/issue-14303-struct.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-struct X<'a, T, 'b> {
-//~^ ERROR lifetime parameters must be declared prior to type parameters
- x: &'a &'b T
-}
-
-fn main() {}
diff --git a/src/test/ui/parser/issues/issue-14303-struct.stderr b/src/test/ui/parser/issues/issue-14303-struct.stderr
deleted file mode 100644
index fa62a39f2..000000000
--- a/src/test/ui/parser/issues/issue-14303-struct.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: lifetime parameters must be declared prior to type parameters
- --> $DIR/issue-14303-struct.rs:1:17
- |
-LL | struct X<'a, T, 'b> {
- | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/issues/issue-14303-trait.rs b/src/test/ui/parser/issues/issue-14303-trait.rs
deleted file mode 100644
index f253de92d..000000000
--- a/src/test/ui/parser/issues/issue-14303-trait.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-trait Foo<'a, T, 'b> {}
-//~^ ERROR lifetime parameters must be declared prior to type parameters
-
-fn main() {}
diff --git a/src/test/ui/parser/issues/issue-14303-trait.stderr b/src/test/ui/parser/issues/issue-14303-trait.stderr
deleted file mode 100644
index 75cd67a9d..000000000
--- a/src/test/ui/parser/issues/issue-14303-trait.stderr
+++ /dev/null
@@ -1,8 +0,0 @@
-error: lifetime parameters must be declared prior to type parameters
- --> $DIR/issue-14303-trait.rs:1:18
- |
-LL | trait Foo<'a, T, 'b> {}
- | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/parser/issues/issue-14303.rs b/src/test/ui/parser/issues/issue-14303.rs
new file mode 100644
index 000000000..82850d77a
--- /dev/null
+++ b/src/test/ui/parser/issues/issue-14303.rs
@@ -0,0 +1,33 @@
+enum Enum<'a, T, 'b> {
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
+ A(&'a &'b T)
+}
+
+struct Struct<'a, T, 'b> {
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
+ x: &'a &'b T
+}
+
+trait Trait<'a, T, 'b> {}
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
+
+fn foo<'a, T, 'b>(x: &'a T) {}
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
+
+struct Y<T>(T);
+impl<'a, T, 'b> Y<T> {}
+//~^ ERROR lifetime parameters must be declared prior to type and const parameters
+
+mod bar {
+ pub struct X<'a, 'b, 'c, T> {
+ a: &'a str,
+ b: &'b str,
+ c: &'c str,
+ t: T,
+ }
+}
+
+fn bar<'a, 'b, 'c, T>(x: bar::X<'a, T, 'b, 'c>) {}
+//~^ ERROR type provided when a lifetime was expected
+
+fn main() {}
diff --git a/src/test/ui/parser/issues/issue-14303.stderr b/src/test/ui/parser/issues/issue-14303.stderr
new file mode 100644
index 000000000..f121107c0
--- /dev/null
+++ b/src/test/ui/parser/issues/issue-14303.stderr
@@ -0,0 +1,39 @@
+error: lifetime parameters must be declared prior to type and const parameters
+ --> $DIR/issue-14303.rs:1:18
+ |
+LL | enum Enum<'a, T, 'b> {
+ | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
+
+error: lifetime parameters must be declared prior to type and const parameters
+ --> $DIR/issue-14303.rs:6:22
+ |
+LL | struct Struct<'a, T, 'b> {
+ | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
+
+error: lifetime parameters must be declared prior to type and const parameters
+ --> $DIR/issue-14303.rs:11:20
+ |
+LL | trait Trait<'a, T, 'b> {}
+ | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
+
+error: lifetime parameters must be declared prior to type and const parameters
+ --> $DIR/issue-14303.rs:14:15
+ |
+LL | fn foo<'a, T, 'b>(x: &'a T) {}
+ | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
+
+error: lifetime parameters must be declared prior to type and const parameters
+ --> $DIR/issue-14303.rs:18:13
+ |
+LL | impl<'a, T, 'b> Y<T> {}
+ | --------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, 'b, T>`
+
+error[E0747]: type provided when a lifetime was expected
+ --> $DIR/issue-14303.rs:30:37
+ |
+LL | fn bar<'a, 'b, 'c, T>(x: bar::X<'a, T, 'b, 'c>) {}
+ | ^
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0747`.
diff --git a/src/test/ui/parser/issues/issue-17383.rs b/src/test/ui/parser/issues/issue-17383.rs
deleted file mode 100644
index 7bf0e64f2..000000000
--- a/src/test/ui/parser/issues/issue-17383.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-enum X {
- A = 3,
- //~^ ERROR custom discriminant values are not allowed in enums with tuple or struct variants
- B(usize)
-}
-
-fn main() {}
diff --git a/src/test/ui/parser/issues/issue-17383.stderr b/src/test/ui/parser/issues/issue-17383.stderr
deleted file mode 100644
index 265d6e148..000000000
--- a/src/test/ui/parser/issues/issue-17383.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants
- --> $DIR/issue-17383.rs:2:9
- |
-LL | A = 3,
- | ^ disallowed custom discriminant
-LL |
-LL | B(usize)
- | -------- tuple variant defined here
- |
- = note: see issue #60553 <https://github.com/rust-lang/rust/issues/60553> for more information
- = help: add `#![feature(arbitrary_enum_discriminant)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/parser/issues/issue-34222-1.stderr b/src/test/ui/parser/issues/issue-34222-1.stderr
index 0799656b0..b451484ba 100644
--- a/src/test/ui/parser/issues/issue-34222-1.stderr
+++ b/src/test/ui/parser/issues/issue-34222-1.stderr
@@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything
LL | /// comment
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/issues/issue-48636.stderr b/src/test/ui/parser/issues/issue-48636.stderr
index 462723d1d..6177870d1 100644
--- a/src/test/ui/parser/issues/issue-48636.stderr
+++ b/src/test/ui/parser/issues/issue-48636.stderr
@@ -1,12 +1,14 @@
error[E0585]: found a documentation comment that doesn't document anything
--> $DIR/issue-48636.rs:7:5
|
+LL | struct S {
+ | - while parsing this struct
LL | x: u8
| - help: missing comma here: `,`
LL | /// The ID of the parent core
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = help: doc comments must come before what they document, maybe a comment was intended with `//`?
+ = help: doc comments must come before what they document, if a comment was intended use `//`
error: aborting due to previous error
diff --git a/src/test/ui/parser/issues/issue-63115-range-pat-interpolated.rs b/src/test/ui/parser/issues/issue-63115-range-pat-interpolated.rs
index 8efb3c73f..b6e5091b6 100644
--- a/src/test/ui/parser/issues/issue-63115-range-pat-interpolated.rs
+++ b/src/test/ui/parser/issues/issue-63115-range-pat-interpolated.rs
@@ -1,7 +1,6 @@
// check-pass
#![feature(exclusive_range_pattern)]
-#![feature(half_open_range_patterns)]
#![allow(ellipsis_inclusive_range_patterns)]
diff --git a/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr b/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr
index 85c9fe409..a00f37ed6 100644
--- a/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr
+++ b/src/test/ui/parser/issues/issue-67377-invalid-syntax-in-enum-discriminant.stderr
@@ -107,10 +107,10 @@ LL | V = [Vec::new; { [0].len() ].len() as isize,
| closing delimiter possibly meant for this
error[E0282]: type annotations needed
- --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:29
+ --> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:15:26
|
LL | V = [Vec::new; { [].len() ].len() as isize,
- | ^^^ cannot infer type for type parameter `T`
+ | ^^ cannot infer type for type parameter `T`
error[E0282]: type annotations needed
--> $DIR/issue-67377-invalid-syntax-in-enum-discriminant.rs:26:14
diff --git a/src/test/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr b/src/test/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr
index ef365a616..adabb6859 100644
--- a/src/test/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr
+++ b/src/test/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr
@@ -7,6 +7,8 @@ LL | pub bar: Vec<i32>ö
error: expected `:`, found `}`
--> $DIR/issue-68000-unicode-ident-after-missing-comma.rs:4:1
|
+LL | pub struct Foo {
+ | --- while parsing this struct
LL | pub bar: Vec<i32>ö
| - expected `:`
LL |
diff --git a/src/test/ui/parser/issues/issue-8537.stderr b/src/test/ui/parser/issues/issue-8537.stderr
index 505d830ef..523cc9dc5 100644
--- a/src/test/ui/parser/issues/issue-8537.stderr
+++ b/src/test/ui/parser/issues/issue-8537.stderr
@@ -4,7 +4,7 @@ error[E0703]: invalid ABI: found `invalid-ab_isize`
LL | "invalid-ab_isize"
| ^^^^^^^^^^^^^^^^^^ invalid ABI
|
- = help: valid ABIs: Rust, C, C-unwind, cdecl, cdecl-unwind, stdcall, stdcall-unwind, fastcall, fastcall-unwind, vectorcall, vectorcall-unwind, thiscall, thiscall-unwind, aapcs, aapcs-unwind, win64, win64-unwind, sysv64, sysv64-unwind, ptx-kernel, msp430-interrupt, x86-interrupt, amdgpu-kernel, efiapi, avr-interrupt, avr-non-blocking-interrupt, C-cmse-nonsecure-call, wasm, system, system-unwind, rust-intrinsic, rust-call, platform-intrinsic, unadjusted, rust-cold
+ = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions.
error: aborting due to previous error
diff --git a/src/test/ui/parser/issues/issue-89574.stderr b/src/test/ui/parser/issues/issue-89574.stderr
index cbee3d351..fb1312c78 100644
--- a/src/test/ui/parser/issues/issue-89574.stderr
+++ b/src/test/ui/parser/issues/issue-89574.stderr
@@ -1,8 +1,8 @@
error: missing type for `const` item
- --> $DIR/issue-89574.rs:2:11
+ --> $DIR/issue-89574.rs:2:22
|
LL | const EMPTY_ARRAY = [];
- | ^^^^^^^^^^^ help: provide a type for the item: `EMPTY_ARRAY: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: aborting due to previous error
diff --git a/src/test/ui/parser/issues/issue-93282.rs b/src/test/ui/parser/issues/issue-93282.rs
index 261fcb5f9..274245f1a 100644
--- a/src/test/ui/parser/issues/issue-93282.rs
+++ b/src/test/ui/parser/issues/issue-93282.rs
@@ -12,4 +12,5 @@ fn foo() {
let x = 1;
bar('y, x);
//~^ ERROR expected
+ //~| ERROR mismatched types
}
diff --git a/src/test/ui/parser/issues/issue-93282.stderr b/src/test/ui/parser/issues/issue-93282.stderr
index ee554784b..c6140bb82 100644
--- a/src/test/ui/parser/issues/issue-93282.stderr
+++ b/src/test/ui/parser/issues/issue-93282.stderr
@@ -3,6 +3,11 @@ error: expected `while`, `for`, `loop` or `{` after a label
|
LL | f<'a,>
| ^ expected `while`, `for`, `loop` or `{` after a label
+ |
+help: add `'` to close the char literal
+ |
+LL | f<'a',>
+ | +
error: expected one of `.`, `:`, `;`, `?`, `for`, `loop`, `while`, `}`, or an operator, found `,`
--> $DIR/issue-93282.rs:2:9
@@ -20,6 +25,26 @@ error: expected `while`, `for`, `loop` or `{` after a label
|
LL | bar('y, x);
| ^ expected `while`, `for`, `loop` or `{` after a label
+ |
+help: add `'` to close the char literal
+ |
+LL | bar('y', x);
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/issue-93282.rs:13:9
+ |
+LL | bar('y, x);
+ | --- ^^ expected `usize`, found `char`
+ | |
+ | arguments to this function are incorrect
+ |
+note: function defined here
+ --> $DIR/issue-93282.rs:7:4
+ |
+LL | fn bar(a: usize, b: usize) -> usize {
+ | ^^^ --------
-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/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr b/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr
index c340e958e..5365b0a1f 100644
--- a/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr
+++ b/src/test/ui/parser/item-free-const-no-body-semantic-fail.stderr
@@ -15,10 +15,10 @@ LL | const B;
| help: provide a definition for the constant: `= <expr>;`
error: missing type for `const` item
- --> $DIR/item-free-const-no-body-semantic-fail.rs:6:7
+ --> $DIR/item-free-const-no-body-semantic-fail.rs:6:8
|
LL | const B;
- | ^ help: provide a type for the item: `B: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr b/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr
index 4d542b798..1b61e4305 100644
--- a/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr
+++ b/src/test/ui/parser/item-free-static-no-body-semantic-fail.stderr
@@ -31,16 +31,16 @@ LL | static mut D;
| help: provide a definition for the static: `= <expr>;`
error: missing type for `static` item
- --> $DIR/item-free-static-no-body-semantic-fail.rs:6:8
+ --> $DIR/item-free-static-no-body-semantic-fail.rs:6:9
|
LL | static B;
- | ^ help: provide a type for the item: `B: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: missing type for `static mut` item
- --> $DIR/item-free-static-no-body-semantic-fail.rs:10:12
+ --> $DIR/item-free-static-no-body-semantic-fail.rs:10:13
|
LL | static mut D;
- | ^ help: provide a type for the item: `D: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: aborting due to 6 previous errors
diff --git a/src/test/ui/parser/item-needs-block.rs b/src/test/ui/parser/item-needs-block.rs
new file mode 100644
index 000000000..4edac588e
--- /dev/null
+++ b/src/test/ui/parser/item-needs-block.rs
@@ -0,0 +1,10 @@
+trait Trait;
+//~^ ERROR expected `{}`, found `;`
+
+impl Trait for ();
+//~^ ERROR expected `{}`, found `;`
+
+enum Enum;
+//~^ ERROR expected `{}`, found `;`
+
+fn main() {}
diff --git a/src/test/ui/parser/item-needs-block.stderr b/src/test/ui/parser/item-needs-block.stderr
new file mode 100644
index 000000000..3cabd0c73
--- /dev/null
+++ b/src/test/ui/parser/item-needs-block.stderr
@@ -0,0 +1,26 @@
+error: expected `{}`, found `;`
+ --> $DIR/item-needs-block.rs:1:12
+ |
+LL | trait Trait;
+ | ^
+ |
+ = help: try using `{}` instead
+
+error: expected `{}`, found `;`
+ --> $DIR/item-needs-block.rs:4:18
+ |
+LL | impl Trait for ();
+ | ^
+ |
+ = help: try using `{}` instead
+
+error: expected `{}`, found `;`
+ --> $DIR/item-needs-block.rs:7:10
+ |
+LL | enum Enum;
+ | ^
+ |
+ = help: try using `{}` instead
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/parser/kw-in-trait-bounds.rs b/src/test/ui/parser/kw-in-trait-bounds.rs
new file mode 100644
index 000000000..fa037e593
--- /dev/null
+++ b/src/test/ui/parser/kw-in-trait-bounds.rs
@@ -0,0 +1,47 @@
+// edition:2018
+
+fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
+//~^ ERROR expected identifier, found keyword `fn`
+//~| ERROR expected identifier, found keyword `fn`
+//~| ERROR expected identifier, found keyword `fn`
+//~| ERROR cannot find trait `r#fn` in this scope
+//~| ERROR cannot find trait `r#fn` in this scope
+//~| ERROR cannot find trait `r#fn` in this scope
+//~| HELP a trait with a similar name exists
+//~| HELP a trait with a similar name exists
+//~| HELP a trait with a similar name exists
+//~| HELP escape `fn` to use it as an identifier
+//~| HELP escape `fn` to use it as an identifier
+//~| HELP escape `fn` to use it as an identifier
+where
+G: fn(),
+ //~^ ERROR expected identifier, found keyword `fn`
+ //~| ERROR cannot find trait `r#fn` in this scope
+ //~| HELP a trait with a similar name exists
+ //~| HELP escape `fn` to use it as an identifier
+{}
+
+fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
+//~^ ERROR expected identifier, found keyword `struct`
+//~| ERROR expected identifier, found keyword `struct`
+//~| ERROR expected identifier, found keyword `struct`
+//~| ERROR cannot find trait `r#struct` in this scope
+//~| ERROR cannot find trait `r#struct` in this scope
+//~| ERROR cannot find trait `r#struct` in this scope
+//~| HELP a trait with a similar name exists
+//~| HELP a trait with a similar name exists
+//~| HELP a trait with a similar name exists
+//~| HELP escape `struct` to use it as an identifier
+//~| HELP escape `struct` to use it as an identifier
+//~| HELP escape `struct` to use it as an identifier
+where
+ B: struct,
+ //~^ ERROR expected identifier, found keyword `struct`
+ //~| ERROR cannot find trait `r#struct` in this scope
+ //~| HELP a trait with a similar name exists
+ //~| HELP escape `struct` to use it as an identifier
+{}
+
+trait Struct {}
+
+fn main() {}
diff --git a/src/test/ui/parser/kw-in-trait-bounds.stderr b/src/test/ui/parser/kw-in-trait-bounds.stderr
new file mode 100644
index 000000000..28196c7ce
--- /dev/null
+++ b/src/test/ui/parser/kw-in-trait-bounds.stderr
@@ -0,0 +1,171 @@
+error: expected identifier, found keyword `fn`
+ --> $DIR/kw-in-trait-bounds.rs:3:10
+ |
+LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
+ | ^^ expected identifier, found keyword
+ |
+help: escape `fn` to use it as an identifier
+ |
+LL | fn _f<F: r#fn(), G>(_: impl fn(), _: &dyn fn())
+ | ++
+
+error: expected identifier, found keyword `fn`
+ --> $DIR/kw-in-trait-bounds.rs:3:27
+ |
+LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
+ | ^^ expected identifier, found keyword
+ |
+help: escape `fn` to use it as an identifier
+ |
+LL | fn _f<F: fn(), G>(_: impl r#fn(), _: &dyn fn())
+ | ++
+
+error: expected identifier, found keyword `fn`
+ --> $DIR/kw-in-trait-bounds.rs:3:41
+ |
+LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
+ | ^^ expected identifier, found keyword
+ |
+help: escape `fn` to use it as an identifier
+ |
+LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn r#fn())
+ | ++
+
+error: expected identifier, found keyword `fn`
+ --> $DIR/kw-in-trait-bounds.rs:17:4
+ |
+LL | G: fn(),
+ | ^^ expected identifier, found keyword
+ |
+help: escape `fn` to use it as an identifier
+ |
+LL | G: r#fn(),
+ | ++
+
+error: expected identifier, found keyword `struct`
+ --> $DIR/kw-in-trait-bounds.rs:24:10
+ |
+LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
+ | ^^^^^^ expected identifier, found keyword
+ |
+help: escape `struct` to use it as an identifier
+ |
+LL | fn _g<A: r#struct, B>(_: impl struct, _: &dyn struct)
+ | ++
+
+error: expected identifier, found keyword `struct`
+ --> $DIR/kw-in-trait-bounds.rs:24:29
+ |
+LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
+ | ^^^^^^ expected identifier, found keyword
+ |
+help: escape `struct` to use it as an identifier
+ |
+LL | fn _g<A: struct, B>(_: impl r#struct, _: &dyn struct)
+ | ++
+
+error: expected identifier, found keyword `struct`
+ --> $DIR/kw-in-trait-bounds.rs:24:45
+ |
+LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
+ | ^^^^^^ expected identifier, found keyword
+ |
+help: escape `struct` to use it as an identifier
+ |
+LL | fn _g<A: struct, B>(_: impl struct, _: &dyn r#struct)
+ | ++
+
+error: expected identifier, found keyword `struct`
+ --> $DIR/kw-in-trait-bounds.rs:38:8
+ |
+LL | B: struct,
+ | ^^^^^^ expected identifier, found keyword
+ |
+help: escape `struct` to use it as an identifier
+ |
+LL | B: r#struct,
+ | ++
+
+error[E0405]: cannot find trait `r#fn` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:3:10
+ |
+LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
+ | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
+ |
+ ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
+ |
+LL | pub trait Fn<Args>: FnMut<Args> {
+ | ------------------------------- similarly named trait `Fn` defined here
+
+error[E0405]: cannot find trait `r#fn` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:17:4
+ |
+LL | G: fn(),
+ | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
+ |
+ ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
+ |
+LL | pub trait Fn<Args>: FnMut<Args> {
+ | ------------------------------- similarly named trait `Fn` defined here
+
+error[E0405]: cannot find trait `r#fn` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:3:27
+ |
+LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
+ | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
+ |
+ ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
+ |
+LL | pub trait Fn<Args>: FnMut<Args> {
+ | ------------------------------- similarly named trait `Fn` defined here
+
+error[E0405]: cannot find trait `r#fn` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:3:41
+ |
+LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
+ | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
+ |
+ ::: $SRC_DIR/core/src/ops/function.rs:LL:COL
+ |
+LL | pub trait Fn<Args>: FnMut<Args> {
+ | ------------------------------- similarly named trait `Fn` defined here
+
+error[E0405]: cannot find trait `r#struct` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:24:10
+ |
+LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
+ | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
+...
+LL | trait Struct {}
+ | ------------ similarly named trait `Struct` defined here
+
+error[E0405]: cannot find trait `r#struct` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:38:8
+ |
+LL | B: struct,
+ | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
+...
+LL | trait Struct {}
+ | ------------ similarly named trait `Struct` defined here
+
+error[E0405]: cannot find trait `r#struct` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:24:29
+ |
+LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
+ | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
+...
+LL | trait Struct {}
+ | ------------ similarly named trait `Struct` defined here
+
+error[E0405]: cannot find trait `r#struct` in this scope
+ --> $DIR/kw-in-trait-bounds.rs:24:45
+ |
+LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
+ | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
+...
+LL | trait Struct {}
+ | ------------ similarly named trait `Struct` defined here
+
+error: aborting due to 16 previous errors
+
+For more information about this error, try `rustc --explain E0405`.
diff --git a/src/test/ui/parser/label-after-block-like.rs b/src/test/ui/parser/label-after-block-like.rs
new file mode 100644
index 000000000..55f3f8f9f
--- /dev/null
+++ b/src/test/ui/parser/label-after-block-like.rs
@@ -0,0 +1,43 @@
+fn a() {
+ if let () = () 'a {}
+ //~^ ERROR labeled expression must be followed by `:`
+ //~| ERROR expected `{`, found `'a`
+}
+
+fn b() {
+ if true 'a {}
+ //~^ ERROR labeled expression must be followed by `:`
+ //~| ERROR expected `{`, found `'a`
+}
+
+fn c() {
+ loop 'a {}
+ //~^ ERROR labeled expression must be followed by `:`
+ //~| ERROR expected `{`, found `'a`
+}
+
+fn d() {
+ while true 'a {}
+ //~^ ERROR labeled expression must be followed by `:`
+ //~| ERROR expected `{`, found `'a`
+}
+
+fn e() {
+ while let () = () 'a {}
+ //~^ ERROR labeled expression must be followed by `:`
+ //~| ERROR expected `{`, found `'a`
+}
+
+fn f() {
+ for _ in 0..0 'a {}
+ //~^ ERROR labeled expression must be followed by `:`
+ //~| ERROR expected `{`, found `'a`
+}
+
+fn g() {
+ unsafe 'a {}
+ //~^ ERROR labeled expression must be followed by `:`
+ //~| ERROR expected `{`, found `'a`
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/label-after-block-like.stderr b/src/test/ui/parser/label-after-block-like.stderr
new file mode 100644
index 000000000..8ff50b124
--- /dev/null
+++ b/src/test/ui/parser/label-after-block-like.stderr
@@ -0,0 +1,176 @@
+error: labeled expression must be followed by `:`
+ --> $DIR/label-after-block-like.rs:2:20
+ |
+LL | if let () = () 'a {}
+ | ---^^
+ | | |
+ | | help: add `:` after the label
+ | the label
+ |
+ = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
+
+error: expected `{`, found `'a`
+ --> $DIR/label-after-block-like.rs:2:20
+ |
+LL | if let () = () 'a {}
+ | ^^ expected `{`
+ |
+note: the `if` expression is missing a block after this condition
+ --> $DIR/label-after-block-like.rs:2:8
+ |
+LL | if let () = () 'a {}
+ | ^^^^^^^^^^^
+help: try placing this code inside a block
+ |
+LL | if let () = () { 'a {} }
+ | + +
+
+error: labeled expression must be followed by `:`
+ --> $DIR/label-after-block-like.rs:8:13
+ |
+LL | if true 'a {}
+ | ---^^
+ | | |
+ | | help: add `:` after the label
+ | the label
+ |
+ = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
+
+error: expected `{`, found `'a`
+ --> $DIR/label-after-block-like.rs:8:13
+ |
+LL | if true 'a {}
+ | ^^ expected `{`
+ |
+note: the `if` expression is missing a block after this condition
+ --> $DIR/label-after-block-like.rs:8:8
+ |
+LL | if true 'a {}
+ | ^^^^
+help: try placing this code inside a block
+ |
+LL | if true { 'a {} }
+ | + +
+
+error: labeled expression must be followed by `:`
+ --> $DIR/label-after-block-like.rs:14:10
+ |
+LL | loop 'a {}
+ | ---^^
+ | | |
+ | | help: add `:` after the label
+ | the label
+ |
+ = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
+
+error: expected `{`, found `'a`
+ --> $DIR/label-after-block-like.rs:14:10
+ |
+LL | loop 'a {}
+ | ---- ^^ expected `{`
+ | |
+ | while parsing this `loop` expression
+ |
+help: try placing this code inside a block
+ |
+LL | loop { 'a {} }
+ | + +
+
+error: labeled expression must be followed by `:`
+ --> $DIR/label-after-block-like.rs:20:16
+ |
+LL | while true 'a {}
+ | ---^^
+ | | |
+ | | help: add `:` after the label
+ | the label
+ |
+ = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
+
+error: expected `{`, found `'a`
+ --> $DIR/label-after-block-like.rs:20:16
+ |
+LL | while true 'a {}
+ | ----- ---- ^^ expected `{`
+ | | |
+ | | this `while` condition successfully parsed
+ | while parsing the body of this `while` expression
+ |
+help: try placing this code inside a block
+ |
+LL | while true { 'a {} }
+ | + +
+
+error: labeled expression must be followed by `:`
+ --> $DIR/label-after-block-like.rs:26:23
+ |
+LL | while let () = () 'a {}
+ | ---^^
+ | | |
+ | | help: add `:` after the label
+ | the label
+ |
+ = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
+
+error: expected `{`, found `'a`
+ --> $DIR/label-after-block-like.rs:26:23
+ |
+LL | while let () = () 'a {}
+ | ----- ----------- ^^ expected `{`
+ | | |
+ | | this `while` condition successfully parsed
+ | while parsing the body of this `while` expression
+ |
+help: try placing this code inside a block
+ |
+LL | while let () = () { 'a {} }
+ | + +
+
+error: labeled expression must be followed by `:`
+ --> $DIR/label-after-block-like.rs:32:19
+ |
+LL | for _ in 0..0 'a {}
+ | ---^^
+ | | |
+ | | help: add `:` after the label
+ | the label
+ |
+ = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
+
+error: expected `{`, found `'a`
+ --> $DIR/label-after-block-like.rs:32:19
+ |
+LL | for _ in 0..0 'a {}
+ | ^^ expected `{`
+ |
+help: try placing this code inside a block
+ |
+LL | for _ in 0..0 { 'a {} }
+ | + +
+
+error: labeled expression must be followed by `:`
+ --> $DIR/label-after-block-like.rs:38:12
+ |
+LL | unsafe 'a {}
+ | ---^^
+ | | |
+ | | help: add `:` after the label
+ | the label
+ |
+ = note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
+
+error: expected `{`, found `'a`
+ --> $DIR/label-after-block-like.rs:38:12
+ |
+LL | unsafe 'a {}
+ | ------ ^^ expected `{`
+ | |
+ | while parsing this `unsafe` expression
+ |
+help: try placing this code inside a block
+ |
+LL | unsafe { 'a {} }
+ | + +
+
+error: aborting due to 14 previous errors
+
diff --git a/src/test/ui/parser/label-is-actually-char.rs b/src/test/ui/parser/label-is-actually-char.rs
new file mode 100644
index 000000000..183da603d
--- /dev/null
+++ b/src/test/ui/parser/label-is-actually-char.rs
@@ -0,0 +1,16 @@
+fn main() {
+ let c = 'a;
+ //~^ ERROR expected `while`, `for`, `loop` or `{` after a label
+ //~| HELP add `'` to close the char literal
+ match c {
+ 'a'..='b => {}
+ //~^ ERROR unexpected token: `'b`
+ //~| HELP add `'` to close the char literal
+ _ => {}
+ }
+ let x = ['a, 'b];
+ //~^ ERROR expected `while`, `for`, `loop` or `{` after a label
+ //~| ERROR expected `while`, `for`, `loop` or `{` after a label
+ //~| HELP add `'` to close the char literal
+ //~| HELP add `'` to close the char literal
+}
diff --git a/src/test/ui/parser/label-is-actually-char.stderr b/src/test/ui/parser/label-is-actually-char.stderr
new file mode 100644
index 000000000..28c8d2ada
--- /dev/null
+++ b/src/test/ui/parser/label-is-actually-char.stderr
@@ -0,0 +1,46 @@
+error: expected `while`, `for`, `loop` or `{` after a label
+ --> $DIR/label-is-actually-char.rs:2:15
+ |
+LL | let c = 'a;
+ | ^ expected `while`, `for`, `loop` or `{` after a label
+ |
+help: add `'` to close the char literal
+ |
+LL | let c = 'a';
+ | +
+
+error: unexpected token: `'b`
+ --> $DIR/label-is-actually-char.rs:6:15
+ |
+LL | 'a'..='b => {}
+ | ^^
+ |
+help: add `'` to close the char literal
+ |
+LL | 'a'..='b' => {}
+ | +
+
+error: expected `while`, `for`, `loop` or `{` after a label
+ --> $DIR/label-is-actually-char.rs:11:16
+ |
+LL | let x = ['a, 'b];
+ | ^ expected `while`, `for`, `loop` or `{` after a label
+ |
+help: add `'` to close the char literal
+ |
+LL | let x = ['a', 'b];
+ | +
+
+error: expected `while`, `for`, `loop` or `{` after a label
+ --> $DIR/label-is-actually-char.rs:11:20
+ |
+LL | let x = ['a, 'b];
+ | ^ expected `while`, `for`, `loop` or `{` after a label
+ |
+help: add `'` to close the char literal
+ |
+LL | let x = ['a, 'b'];
+ | +
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/parser/labeled-no-colon-expr.rs b/src/test/ui/parser/labeled-no-colon-expr.rs
index db9ef52c1..d9ebd7473 100644
--- a/src/test/ui/parser/labeled-no-colon-expr.rs
+++ b/src/test/ui/parser/labeled-no-colon-expr.rs
@@ -1,5 +1,3 @@
-#![feature(label_break_value)]
-
fn main() {
'l0 while false {} //~ ERROR labeled expression must be followed by `:`
'l1 for _ in 0..1 {} //~ ERROR labeled expression must be followed by `:`
diff --git a/src/test/ui/parser/labeled-no-colon-expr.stderr b/src/test/ui/parser/labeled-no-colon-expr.stderr
index a258bd3cc..62288fe15 100644
--- a/src/test/ui/parser/labeled-no-colon-expr.stderr
+++ b/src/test/ui/parser/labeled-no-colon-expr.stderr
@@ -1,5 +1,5 @@
error: labeled expression must be followed by `:`
- --> $DIR/labeled-no-colon-expr.rs:4:5
+ --> $DIR/labeled-no-colon-expr.rs:2:5
|
LL | 'l0 while false {}
| ----^^^^^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | 'l0 while false {}
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
error: labeled expression must be followed by `:`
- --> $DIR/labeled-no-colon-expr.rs:5:5
+ --> $DIR/labeled-no-colon-expr.rs:3:5
|
LL | 'l1 for _ in 0..1 {}
| ----^^^^^^^^^^^^^^^^
@@ -21,7 +21,7 @@ LL | 'l1 for _ in 0..1 {}
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
error: labeled expression must be followed by `:`
- --> $DIR/labeled-no-colon-expr.rs:6:5
+ --> $DIR/labeled-no-colon-expr.rs:4:5
|
LL | 'l2 loop {}
| ----^^^^^^^
@@ -32,7 +32,7 @@ LL | 'l2 loop {}
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
error: labeled expression must be followed by `:`
- --> $DIR/labeled-no-colon-expr.rs:7:5
+ --> $DIR/labeled-no-colon-expr.rs:5:5
|
LL | 'l3 {}
| ----^^
@@ -43,7 +43,7 @@ LL | 'l3 {}
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/labeled-no-colon-expr.rs:8:9
+ --> $DIR/labeled-no-colon-expr.rs:6:9
|
LL | 'l4 0;
| ^ expected `while`, `for`, `loop` or `{` after a label
@@ -55,7 +55,7 @@ LL + 0;
|
error: labeled expression must be followed by `:`
- --> $DIR/labeled-no-colon-expr.rs:8:9
+ --> $DIR/labeled-no-colon-expr.rs:6:9
|
LL | 'l4 0;
| ----^
@@ -66,7 +66,7 @@ LL | 'l4 0;
= note: labels are used before loops and blocks, allowing e.g., `break 'label` to them
error: cannot use a `block` macro fragment here
- --> $DIR/labeled-no-colon-expr.rs:13:17
+ --> $DIR/labeled-no-colon-expr.rs:11:17
|
LL | 'l5 $b;
| ----^^
@@ -79,7 +79,7 @@ LL | m!({});
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: labeled expression must be followed by `:`
- --> $DIR/labeled-no-colon-expr.rs:16:8
+ --> $DIR/labeled-no-colon-expr.rs:14:8
|
LL | 'l5 $b;
| ---- help: add `:` after the label
diff --git a/src/test/ui/parser/macro/issue-33569.stderr b/src/test/ui/parser/macro/issue-33569.stderr
index 39d49fd03..0dca090fb 100644
--- a/src/test/ui/parser/macro/issue-33569.stderr
+++ b/src/test/ui/parser/macro/issue-33569.stderr
@@ -22,9 +22,9 @@ error: missing fragment specifier
LL | { $+ } => {
| ^
|
- = note: `#[deny(missing_fragment_specifier)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
+ = note: `#[deny(missing_fragment_specifier)]` on by default
error: aborting due to 4 previous errors
diff --git a/src/test/ui/parser/macro/issue-37113.stderr b/src/test/ui/parser/macro/issue-37113.stderr
index 0912858dd..b1f8674fb 100644
--- a/src/test/ui/parser/macro/issue-37113.stderr
+++ b/src/test/ui/parser/macro/issue-37113.stderr
@@ -1,6 +1,8 @@
error: expected identifier, found `String`
--> $DIR/issue-37113.rs:4:16
|
+LL | enum SomeEnum {
+ | -------- while parsing this enum
LL | $( $t, )*
| ^^ expected identifier
...
diff --git a/src/test/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr b/src/test/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr
index a47d5506e..ad1e90e43 100644
--- a/src/test/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr
+++ b/src/test/ui/parser/mismatched-braces/missing-close-brace-in-struct.stderr
@@ -10,6 +10,9 @@ LL | fn main() {}
error: expected identifier, found keyword `trait`
--> $DIR/missing-close-brace-in-struct.rs:4:1
|
+LL | pub(crate) struct Bar<T> {
+ | --- while parsing this struct
+...
LL | trait T {
| ^^^^^ expected identifier, found keyword
diff --git a/src/test/ui/parser/missing-closing-angle-bracket-struct-field-ty.stderr b/src/test/ui/parser/missing-closing-angle-bracket-struct-field-ty.stderr
index 46ca1f06b..6d8b0c3fc 100644
--- a/src/test/ui/parser/missing-closing-angle-bracket-struct-field-ty.stderr
+++ b/src/test/ui/parser/missing-closing-angle-bracket-struct-field-ty.stderr
@@ -1,6 +1,9 @@
error: expected one of `>`, a const expression, lifetime, or type, found `}`
--> $DIR/missing-closing-angle-bracket-struct-field-ty.rs:9:1
|
+LL | pub struct Foo {
+ | --- while parsing this struct
+...
LL | c: Arc<Mutex<usize>>,
| - expected one of `>`, a const expression, lifetime, or type
LL | }
diff --git a/src/test/ui/parser/numeric-lifetime.stderr b/src/test/ui/parser/numeric-lifetime.stderr
index 73a828952..7c1bcb726 100644
--- a/src/test/ui/parser/numeric-lifetime.stderr
+++ b/src/test/ui/parser/numeric-lifetime.stderr
@@ -1,3 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/numeric-lifetime.rs:6:20
+ |
+LL | let x: usize = "";
+ | ----- ^^ expected `usize`, found `&str`
+ | |
+ | expected due to this
+
error: lifetimes cannot start with a number
--> $DIR/numeric-lifetime.rs:1:10
|
@@ -10,14 +18,6 @@ error: lifetimes cannot start with a number
LL | struct S<'1> { s: &'1 usize }
| ^^
-error[E0308]: mismatched types
- --> $DIR/numeric-lifetime.rs:6:20
- |
-LL | let x: usize = "";
- | ----- ^^ expected `usize`, found `&str`
- | |
- | expected due to this
-
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/parser/parser-recovery-1.stderr b/src/test/ui/parser/parser-recovery-1.stderr
index f56060c3e..0cb771ea3 100644
--- a/src/test/ui/parser/parser-recovery-1.stderr
+++ b/src/test/ui/parser/parser-recovery-1.stderr
@@ -18,18 +18,18 @@ error: unexpected token: `;`
LL | let x = y.;
| ^
-error[E0425]: cannot find function `foo` in this scope
- --> $DIR/parser-recovery-1.rs:5:17
- |
-LL | let x = foo();
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `y` in this scope
--> $DIR/parser-recovery-1.rs:10:13
|
LL | let x = y.;
| ^ not found in this scope
+error[E0425]: cannot find function `foo` in this scope
+ --> $DIR/parser-recovery-1.rs:5:17
+ |
+LL | let x = foo();
+ | ^^^ not found in this scope
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/parser/parser-recovery-2.stderr b/src/test/ui/parser/parser-recovery-2.stderr
index 0980d033f..8829cf4c1 100644
--- a/src/test/ui/parser/parser-recovery-2.stderr
+++ b/src/test/ui/parser/parser-recovery-2.stderr
@@ -13,18 +13,18 @@ LL | let x = foo();
LL | )
| ^ mismatched closing delimiter
-error[E0425]: cannot find function `foo` in this scope
- --> $DIR/parser-recovery-2.rs:5:17
- |
-LL | let x = foo();
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `y` in this scope
--> $DIR/parser-recovery-2.rs:10:13
|
LL | let x = y.;
| ^ not found in this scope
+error[E0425]: cannot find function `foo` in this scope
+ --> $DIR/parser-recovery-2.rs:5:17
+ |
+LL | let x = foo();
+ | ^^^ not found in this scope
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/parser/public-instead-of-pub-1.fixed b/src/test/ui/parser/public-instead-of-pub-1.fixed
new file mode 100644
index 000000000..a4fa68ba5
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-1.fixed
@@ -0,0 +1,11 @@
+// Checks what happens when `public` is used instead of the correct, `pub`
+// run-rustfix
+
+pub enum Test {
+ //~^ ERROR expected one of `!` or `::`, found keyword `enum`
+ //~^^ HELP write `pub` instead of `public` to make the item public
+ A,
+ B,
+}
+
+fn main() { }
diff --git a/src/test/ui/parser/public-instead-of-pub-1.rs b/src/test/ui/parser/public-instead-of-pub-1.rs
new file mode 100644
index 000000000..43565c9b1
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-1.rs
@@ -0,0 +1,11 @@
+// Checks what happens when `public` is used instead of the correct, `pub`
+// run-rustfix
+
+public enum Test {
+ //~^ ERROR expected one of `!` or `::`, found keyword `enum`
+ //~^^ HELP write `pub` instead of `public` to make the item public
+ A,
+ B,
+}
+
+fn main() { }
diff --git a/src/test/ui/parser/public-instead-of-pub-1.stderr b/src/test/ui/parser/public-instead-of-pub-1.stderr
new file mode 100644
index 000000000..795a5bcf5
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-1.stderr
@@ -0,0 +1,13 @@
+error: expected one of `!` or `::`, found keyword `enum`
+ --> $DIR/public-instead-of-pub-1.rs:4:8
+ |
+LL | public enum Test {
+ | ^^^^ expected one of `!` or `::`
+ |
+help: write `pub` instead of `public` to make the item public
+ |
+LL | pub enum Test {
+ | ~~~
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/public-instead-of-pub-2.rs b/src/test/ui/parser/public-instead-of-pub-2.rs
new file mode 100644
index 000000000..8a43c361e
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-2.rs
@@ -0,0 +1,7 @@
+// Checks what happens when `public` is used instead of the correct, `pub`
+// Won't give help message for this case
+
+public let x = 1;
+//~^ ERROR expected one of `!` or `::`, found keyword `let`
+
+fn main() { }
diff --git a/src/test/ui/parser/public-instead-of-pub-2.stderr b/src/test/ui/parser/public-instead-of-pub-2.stderr
new file mode 100644
index 000000000..efe225656
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-2.stderr
@@ -0,0 +1,8 @@
+error: expected one of `!` or `::`, found keyword `let`
+ --> $DIR/public-instead-of-pub-2.rs:4:8
+ |
+LL | public let x = 1;
+ | ^^^ expected one of `!` or `::`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/public-instead-of-pub-3.fixed b/src/test/ui/parser/public-instead-of-pub-3.fixed
new file mode 100644
index 000000000..14f620f41
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-3.fixed
@@ -0,0 +1,9 @@
+// run-rustfix
+mod test {
+ pub const X: i32 = 123;
+ //~^ ERROR expected one of `!` or `::`, found keyword `const`
+}
+
+fn main() {
+ println!("{}", test::X);
+}
diff --git a/src/test/ui/parser/public-instead-of-pub-3.rs b/src/test/ui/parser/public-instead-of-pub-3.rs
new file mode 100644
index 000000000..ee27cb1a1
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-3.rs
@@ -0,0 +1,9 @@
+// run-rustfix
+mod test {
+ public const X: i32 = 123;
+ //~^ ERROR expected one of `!` or `::`, found keyword `const`
+}
+
+fn main() {
+ println!("{}", test::X);
+}
diff --git a/src/test/ui/parser/public-instead-of-pub-3.stderr b/src/test/ui/parser/public-instead-of-pub-3.stderr
new file mode 100644
index 000000000..72efae08d
--- /dev/null
+++ b/src/test/ui/parser/public-instead-of-pub-3.stderr
@@ -0,0 +1,13 @@
+error: expected one of `!` or `::`, found keyword `const`
+ --> $DIR/public-instead-of-pub-3.rs:3:12
+ |
+LL | public const X: i32 = 123;
+ | ^^^^^ expected one of `!` or `::`
+ |
+help: write `pub` instead of `public` to make the item public
+ |
+LL | pub const X: i32 = 123;
+ | ~~~
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/recover-enum2.stderr b/src/test/ui/parser/recover-enum2.stderr
index ee29f0663..7634bca92 100644
--- a/src/test/ui/parser/recover-enum2.stderr
+++ b/src/test/ui/parser/recover-enum2.stderr
@@ -1,6 +1,8 @@
error: expected type, found `{`
--> $DIR/recover-enum2.rs:6:18
|
+LL | Var3 {
+ | ---- while parsing this struct
LL | abc: {},
| ^ expected type
diff --git a/src/test/ui/parser/recover-field-semi.rs b/src/test/ui/parser/recover-field-semi.rs
new file mode 100644
index 000000000..b70357886
--- /dev/null
+++ b/src/test/ui/parser/recover-field-semi.rs
@@ -0,0 +1,16 @@
+struct Foo {
+ foo: i32;
+ //~^ ERROR struct fields are separated by `,`
+}
+
+union Bar { //~ ERROR
+ foo: i32;
+ //~^ ERROR union fields are separated by `,`
+}
+
+enum Baz {
+ Qux { foo: i32; }
+ //~^ ERROR struct fields are separated by `,`
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/recover-field-semi.stderr b/src/test/ui/parser/recover-field-semi.stderr
new file mode 100644
index 000000000..3cf484748
--- /dev/null
+++ b/src/test/ui/parser/recover-field-semi.stderr
@@ -0,0 +1,35 @@
+error: struct fields are separated by `,`
+ --> $DIR/recover-field-semi.rs:2:13
+ |
+LL | struct Foo {
+ | --- while parsing this struct
+LL | foo: i32;
+ | ^ help: replace `;` with `,`
+
+error: union fields are separated by `,`
+ --> $DIR/recover-field-semi.rs:7:13
+ |
+LL | union Bar {
+ | --- while parsing this union
+LL | foo: i32;
+ | ^ help: replace `;` with `,`
+
+error: struct fields are separated by `,`
+ --> $DIR/recover-field-semi.rs:12:19
+ |
+LL | Qux { foo: i32; }
+ | --- ^ help: replace `;` with `,`
+ | |
+ | while parsing this struct
+
+error: unions cannot have zero fields
+ --> $DIR/recover-field-semi.rs:6:1
+ |
+LL | / union Bar {
+LL | | foo: i32;
+LL | |
+LL | | }
+ | |_^
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.fixed b/src/test/ui/parser/recover-labeled-non-block-expr.fixed
index fe546a719..c2e76444d 100644
--- a/src/test/ui/parser/recover-labeled-non-block-expr.fixed
+++ b/src/test/ui/parser/recover-labeled-non-block-expr.fixed
@@ -1,5 +1,4 @@
// run-rustfix
-#![feature(label_break_value)]
fn main() {
let _ = 1 + 1; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.rs b/src/test/ui/parser/recover-labeled-non-block-expr.rs
index 35862e2ee..fc11c646a 100644
--- a/src/test/ui/parser/recover-labeled-non-block-expr.rs
+++ b/src/test/ui/parser/recover-labeled-non-block-expr.rs
@@ -1,5 +1,4 @@
// run-rustfix
-#![feature(label_break_value)]
fn main() {
let _ = 'label: 1 + 1; //~ ERROR expected `while`, `for`, `loop` or `{` after a label
diff --git a/src/test/ui/parser/recover-labeled-non-block-expr.stderr b/src/test/ui/parser/recover-labeled-non-block-expr.stderr
index 04fc1203e..d66ce6950 100644
--- a/src/test/ui/parser/recover-labeled-non-block-expr.stderr
+++ b/src/test/ui/parser/recover-labeled-non-block-expr.stderr
@@ -1,5 +1,5 @@
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/recover-labeled-non-block-expr.rs:4:21
+ --> $DIR/recover-labeled-non-block-expr.rs:3:21
|
LL | let _ = 'label: 1 + 1;
| ^ expected `while`, `for`, `loop` or `{` after a label
@@ -11,7 +11,7 @@ LL + let _ = 1 + 1;
|
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/recover-labeled-non-block-expr.rs:6:13
+ --> $DIR/recover-labeled-non-block-expr.rs:5:13
|
LL | 'label: match () { () => {}, };
| ^^^^^ expected `while`, `for`, `loop` or `{` after a label
@@ -23,7 +23,7 @@ LL + match () { () => {}, };
|
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/recover-labeled-non-block-expr.rs:7:13
+ --> $DIR/recover-labeled-non-block-expr.rs:6:13
|
LL | 'label: match () { () => break 'label, };
| ^^^^^ expected `while`, `for`, `loop` or `{` after a label
@@ -34,7 +34,7 @@ LL | 'label: { match () { () => break 'label, } };
| + +
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/recover-labeled-non-block-expr.rs:9:13
+ --> $DIR/recover-labeled-non-block-expr.rs:8:13
|
LL | 'label: match () { () => 'lp: loop { break 'lp 0 }, };
| ^^^^^ expected `while`, `for`, `loop` or `{` after a label
@@ -45,7 +45,7 @@ LL | 'label: { match () { () => 'lp: loop { break 'lp 0 }, } };
| + +
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/recover-labeled-non-block-expr.rs:12:22
+ --> $DIR/recover-labeled-non-block-expr.rs:11:22
|
LL | let _i = 'label: match x {
| ^^^^^ expected `while`, `for`, `loop` or `{` after a label
@@ -60,7 +60,7 @@ LL ~ } };
|
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/recover-labeled-non-block-expr.rs:26:24
+ --> $DIR/recover-labeled-non-block-expr.rs:25:24
|
LL | let _val = 'label: (1, if other == 3 { break 'label (2, 3) } else { other });
| ^ expected `while`, `for`, `loop` or `{` after a label
diff --git a/src/test/ui/parser/recover-missing-semi-before-item.fixed b/src/test/ui/parser/recover-missing-semi-before-item.fixed
new file mode 100644
index 000000000..0be17e69e
--- /dev/null
+++ b/src/test/ui/parser/recover-missing-semi-before-item.fixed
@@ -0,0 +1,61 @@
+// run-rustfix
+
+#![allow(unused_variables, dead_code)]
+
+fn for_struct() {
+ let foo = 3; //~ ERROR expected `;`, found keyword `struct`
+ struct Foo;
+}
+
+fn for_union() {
+ let foo = 3; //~ ERROR expected `;`, found `union`
+ union Foo {
+ foo: usize,
+ }
+}
+
+fn for_enum() {
+ let foo = 3; //~ ERROR expected `;`, found keyword `enum`
+ enum Foo {
+ Bar,
+ }
+}
+
+fn for_fn() {
+ let foo = 3; //~ ERROR expected `;`, found keyword `fn`
+ fn foo() {}
+}
+
+fn for_extern() {
+ let foo = 3; //~ ERROR expected `;`, found keyword `extern`
+ extern fn foo() {}
+}
+
+fn for_impl() {
+ struct Foo;
+ let foo = 3; //~ ERROR expected `;`, found keyword `impl`
+ impl Foo {}
+}
+
+fn for_use() {
+ let foo = 3; //~ ERROR expected `;`, found keyword `pub`
+ pub use bar::Bar;
+}
+
+fn for_mod() {
+ let foo = 3; //~ ERROR expected `;`, found keyword `mod`
+ mod foo {}
+}
+
+fn for_type() {
+ let foo = 3; //~ ERROR expected `;`, found keyword `type`
+ type Foo = usize;
+}
+
+mod bar {
+ pub struct Bar;
+}
+
+const X: i32 = 123; //~ ERROR expected `;`, found keyword `fn`
+
+fn main() {}
diff --git a/src/test/ui/parser/recover-missing-semi-before-item.rs b/src/test/ui/parser/recover-missing-semi-before-item.rs
new file mode 100644
index 000000000..867b7b749
--- /dev/null
+++ b/src/test/ui/parser/recover-missing-semi-before-item.rs
@@ -0,0 +1,61 @@
+// run-rustfix
+
+#![allow(unused_variables, dead_code)]
+
+fn for_struct() {
+ let foo = 3 //~ ERROR expected `;`, found keyword `struct`
+ struct Foo;
+}
+
+fn for_union() {
+ let foo = 3 //~ ERROR expected `;`, found `union`
+ union Foo {
+ foo: usize,
+ }
+}
+
+fn for_enum() {
+ let foo = 3 //~ ERROR expected `;`, found keyword `enum`
+ enum Foo {
+ Bar,
+ }
+}
+
+fn for_fn() {
+ let foo = 3 //~ ERROR expected `;`, found keyword `fn`
+ fn foo() {}
+}
+
+fn for_extern() {
+ let foo = 3 //~ ERROR expected `;`, found keyword `extern`
+ extern fn foo() {}
+}
+
+fn for_impl() {
+ struct Foo;
+ let foo = 3 //~ ERROR expected `;`, found keyword `impl`
+ impl Foo {}
+}
+
+fn for_use() {
+ let foo = 3 //~ ERROR expected `;`, found keyword `pub`
+ pub use bar::Bar;
+}
+
+fn for_mod() {
+ let foo = 3 //~ ERROR expected `;`, found keyword `mod`
+ mod foo {}
+}
+
+fn for_type() {
+ let foo = 3 //~ ERROR expected `;`, found keyword `type`
+ type Foo = usize;
+}
+
+mod bar {
+ pub struct Bar;
+}
+
+const X: i32 = 123 //~ ERROR expected `;`, found keyword `fn`
+
+fn main() {}
diff --git a/src/test/ui/parser/recover-missing-semi-before-item.stderr b/src/test/ui/parser/recover-missing-semi-before-item.stderr
new file mode 100644
index 000000000..61c43f2f1
--- /dev/null
+++ b/src/test/ui/parser/recover-missing-semi-before-item.stderr
@@ -0,0 +1,83 @@
+error: expected `;`, found keyword `struct`
+ --> $DIR/recover-missing-semi-before-item.rs:6:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | struct Foo;
+ | ------ unexpected token
+
+error: expected `;`, found `union`
+ --> $DIR/recover-missing-semi-before-item.rs:11:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | union Foo {
+ | ----- unexpected token
+
+error: expected `;`, found keyword `enum`
+ --> $DIR/recover-missing-semi-before-item.rs:18:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | enum Foo {
+ | ---- unexpected token
+
+error: expected `;`, found keyword `fn`
+ --> $DIR/recover-missing-semi-before-item.rs:25:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | fn foo() {}
+ | -- unexpected token
+
+error: expected `;`, found keyword `extern`
+ --> $DIR/recover-missing-semi-before-item.rs:30:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | extern fn foo() {}
+ | ------ unexpected token
+
+error: expected `;`, found keyword `impl`
+ --> $DIR/recover-missing-semi-before-item.rs:36:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | impl Foo {}
+ | ---- unexpected token
+
+error: expected `;`, found keyword `pub`
+ --> $DIR/recover-missing-semi-before-item.rs:41:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | pub use bar::Bar;
+ | --- unexpected token
+
+error: expected `;`, found keyword `mod`
+ --> $DIR/recover-missing-semi-before-item.rs:46:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | mod foo {}
+ | --- unexpected token
+
+error: expected `;`, found keyword `type`
+ --> $DIR/recover-missing-semi-before-item.rs:51:16
+ |
+LL | let foo = 3
+ | ^ help: add `;` here
+LL | type Foo = usize;
+ | ---- unexpected token
+
+error: expected `;`, found keyword `fn`
+ --> $DIR/recover-missing-semi-before-item.rs:59:19
+ |
+LL | const X: i32 = 123
+ | ^ help: add `;` here
+LL |
+LL | fn main() {}
+ | -- unexpected token
+
+error: aborting due to 10 previous errors
+
diff --git a/src/test/ui/parser/recover-range-pats.rs b/src/test/ui/parser/recover-range-pats.rs
index 2e5a99154..156c7ad94 100644
--- a/src/test/ui/parser/recover-range-pats.rs
+++ b/src/test/ui/parser/recover-range-pats.rs
@@ -4,7 +4,6 @@
// 2. Or at least we have parser recovery if they don't.
#![feature(exclusive_range_pattern)]
-#![feature(half_open_range_patterns)]
#![deny(ellipsis_inclusive_range_patterns)]
fn main() {}
diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr
index d0979b23f..c54f13e01 100644
--- a/src/test/ui/parser/recover-range-pats.stderr
+++ b/src/test/ui/parser/recover-range-pats.stderr
@@ -1,47 +1,47 @@
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:22:12
+ --> $DIR/recover-range-pats.rs:21:12
|
LL | if let .0..Y = 0 {}
| ^^ help: must have an integer part: `0.0`
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:24:16
+ --> $DIR/recover-range-pats.rs:23:16
|
LL | if let X.. .0 = 0 {}
| ^^ help: must have an integer part: `0.0`
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:35:12
+ --> $DIR/recover-range-pats.rs:34:12
|
LL | if let .0..=Y = 0 {}
| ^^ help: must have an integer part: `0.0`
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:37:16
+ --> $DIR/recover-range-pats.rs:36:16
|
LL | if let X..=.0 = 0 {}
| ^^ help: must have an integer part: `0.0`
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:60:12
+ --> $DIR/recover-range-pats.rs:59:12
|
LL | if let .0...Y = 0 {}
| ^^ help: must have an integer part: `0.0`
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:64:17
+ --> $DIR/recover-range-pats.rs:63:17
|
LL | if let X... .0 = 0 {}
| ^^ help: must have an integer part: `0.0`
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:75:12
+ --> $DIR/recover-range-pats.rs:74:12
|
LL | if let .0.. = 0 {}
| ^^ help: must have an integer part: `0.0`
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:81:13
+ --> $DIR/recover-range-pats.rs:80:13
|
LL | if let 0..= = 0 {}
| ^^^ help: use `..` instead
@@ -49,7 +49,7 @@ LL | if let 0..= = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:82:13
+ --> $DIR/recover-range-pats.rs:81:13
|
LL | if let X..= = 0 {}
| ^^^ help: use `..` instead
@@ -57,7 +57,7 @@ LL | if let X..= = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:83:16
+ --> $DIR/recover-range-pats.rs:82:16
|
LL | if let true..= = 0 {}
| ^^^ help: use `..` instead
@@ -65,13 +65,13 @@ LL | if let true..= = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:85:12
+ --> $DIR/recover-range-pats.rs:84:12
|
LL | if let .0..= = 0 {}
| ^^ help: must have an integer part: `0.0`
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:85:14
+ --> $DIR/recover-range-pats.rs:84:14
|
LL | if let .0..= = 0 {}
| ^^^ help: use `..` instead
@@ -79,7 +79,7 @@ LL | if let .0..= = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:91:13
+ --> $DIR/recover-range-pats.rs:90:13
|
LL | if let 0... = 0 {}
| ^^^ help: use `..` instead
@@ -87,7 +87,7 @@ LL | if let 0... = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:92:13
+ --> $DIR/recover-range-pats.rs:91:13
|
LL | if let X... = 0 {}
| ^^^ help: use `..` instead
@@ -95,7 +95,7 @@ LL | if let X... = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:93:16
+ --> $DIR/recover-range-pats.rs:92:16
|
LL | if let true... = 0 {}
| ^^^ help: use `..` instead
@@ -103,13 +103,13 @@ LL | if let true... = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:95:12
+ --> $DIR/recover-range-pats.rs:94:12
|
LL | if let .0... = 0 {}
| ^^ help: must have an integer part: `0.0`
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:95:14
+ --> $DIR/recover-range-pats.rs:94:14
|
LL | if let .0... = 0 {}
| ^^^ help: use `..` instead
@@ -117,49 +117,49 @@ LL | if let .0... = 0 {}
= note: inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:105:15
+ --> $DIR/recover-range-pats.rs:104:15
|
LL | if let .. .0 = 0 {}
| ^^ help: must have an integer part: `0.0`
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:115:15
+ --> $DIR/recover-range-pats.rs:114:15
|
LL | if let ..=.0 = 0 {}
| ^^ help: must have an integer part: `0.0`
error: range-to patterns with `...` are not allowed
- --> $DIR/recover-range-pats.rs:121:12
+ --> $DIR/recover-range-pats.rs:120:12
|
LL | if let ...3 = 0 {}
| ^^^ help: use `..=` instead
error: range-to patterns with `...` are not allowed
- --> $DIR/recover-range-pats.rs:123:12
+ --> $DIR/recover-range-pats.rs:122:12
|
LL | if let ...Y = 0 {}
| ^^^ help: use `..=` instead
error: range-to patterns with `...` are not allowed
- --> $DIR/recover-range-pats.rs:125:12
+ --> $DIR/recover-range-pats.rs:124:12
|
LL | if let ...true = 0 {}
| ^^^ help: use `..=` instead
error: float literals must have an integer part
- --> $DIR/recover-range-pats.rs:128:15
+ --> $DIR/recover-range-pats.rs:127:15
|
LL | if let ....3 = 0 {}
| ^^ help: must have an integer part: `0.3`
error: range-to patterns with `...` are not allowed
- --> $DIR/recover-range-pats.rs:128:12
+ --> $DIR/recover-range-pats.rs:127:12
|
LL | if let ....3 = 0 {}
| ^^^ help: use `..=` instead
error: range-to patterns with `...` are not allowed
- --> $DIR/recover-range-pats.rs:150:17
+ --> $DIR/recover-range-pats.rs:149:17
|
LL | let ...$e;
| ^^^ help: use `..=` instead
@@ -170,7 +170,7 @@ LL | mac!(0);
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:154:19
+ --> $DIR/recover-range-pats.rs:153:19
|
LL | let $e...;
| ^^^ help: use `..` instead
@@ -182,7 +182,7 @@ LL | mac!(0);
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0586]: inclusive range with no end
- --> $DIR/recover-range-pats.rs:155:19
+ --> $DIR/recover-range-pats.rs:154:19
|
LL | let $e..=;
| ^^^ help: use `..` instead
@@ -194,21 +194,21 @@ LL | mac!(0);
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:42:13
+ --> $DIR/recover-range-pats.rs:41:13
|
LL | if let 0...3 = 0 {}
| ^^^ help: use `..=` for an inclusive range
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
- --> $DIR/recover-range-pats.rs:8:9
+ --> $DIR/recover-range-pats.rs:7:9
|
LL | #![deny(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:45:13
+ --> $DIR/recover-range-pats.rs:44:13
|
LL | if let 0...Y = 0 {}
| ^^^ help: use `..=` for an inclusive range
@@ -217,7 +217,7 @@ LL | if let 0...Y = 0 {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:48:13
+ --> $DIR/recover-range-pats.rs:47:13
|
LL | if let X...3 = 0 {}
| ^^^ help: use `..=` for an inclusive range
@@ -226,7 +226,7 @@ LL | if let X...3 = 0 {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:51:13
+ --> $DIR/recover-range-pats.rs:50:13
|
LL | if let X...Y = 0 {}
| ^^^ help: use `..=` for an inclusive range
@@ -235,7 +235,7 @@ LL | if let X...Y = 0 {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:54:16
+ --> $DIR/recover-range-pats.rs:53:16
|
LL | if let true...Y = 0 {}
| ^^^ help: use `..=` for an inclusive range
@@ -244,7 +244,7 @@ LL | if let true...Y = 0 {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:57:13
+ --> $DIR/recover-range-pats.rs:56:13
|
LL | if let X...true = 0 {}
| ^^^ help: use `..=` for an inclusive range
@@ -253,7 +253,7 @@ LL | if let X...true = 0 {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:60:14
+ --> $DIR/recover-range-pats.rs:59:14
|
LL | if let .0...Y = 0 {}
| ^^^ help: use `..=` for an inclusive range
@@ -262,7 +262,7 @@ LL | if let .0...Y = 0 {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:64:13
+ --> $DIR/recover-range-pats.rs:63:13
|
LL | if let X... .0 = 0 {}
| ^^^ help: use `..=` for an inclusive range
@@ -271,7 +271,7 @@ LL | if let X... .0 = 0 {}
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
- --> $DIR/recover-range-pats.rs:138:20
+ --> $DIR/recover-range-pats.rs:137:20
|
LL | let $e1...$e2;
| ^^^ help: use `..=` for an inclusive range
@@ -284,7 +284,7 @@ LL | mac2!(0, 1);
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:20:12
+ --> $DIR/recover-range-pats.rs:19:12
|
LL | if let true..Y = 0 {}
| ^^^^ - this is of type `u8`
@@ -292,7 +292,7 @@ LL | if let true..Y = 0 {}
| this is of type `bool` but it should be `char` or numeric
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:21:15
+ --> $DIR/recover-range-pats.rs:20:15
|
LL | if let X..true = 0 {}
| - ^^^^ this is of type `bool` but it should be `char` or numeric
@@ -300,7 +300,7 @@ LL | if let X..true = 0 {}
| this is of type `u8`
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:22:12
+ --> $DIR/recover-range-pats.rs:21:12
|
LL | if let .0..Y = 0 {}
| ^^ - - this expression has type `{integer}`
@@ -309,7 +309,7 @@ LL | if let .0..Y = 0 {}
| expected integer, found floating-point number
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:24:16
+ --> $DIR/recover-range-pats.rs:23:16
|
LL | if let X.. .0 = 0 {}
| - ^^ - this expression has type `u8`
@@ -321,7 +321,7 @@ LL | if let X.. .0 = 0 {}
found type `{float}`
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:33:12
+ --> $DIR/recover-range-pats.rs:32:12
|
LL | if let true..=Y = 0 {}
| ^^^^ - this is of type `u8`
@@ -329,7 +329,7 @@ LL | if let true..=Y = 0 {}
| this is of type `bool` but it should be `char` or numeric
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:34:16
+ --> $DIR/recover-range-pats.rs:33:16
|
LL | if let X..=true = 0 {}
| - ^^^^ this is of type `bool` but it should be `char` or numeric
@@ -337,7 +337,7 @@ LL | if let X..=true = 0 {}
| this is of type `u8`
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:35:12
+ --> $DIR/recover-range-pats.rs:34:12
|
LL | if let .0..=Y = 0 {}
| ^^ - - this expression has type `{integer}`
@@ -346,7 +346,7 @@ LL | if let .0..=Y = 0 {}
| expected integer, found floating-point number
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:37:16
+ --> $DIR/recover-range-pats.rs:36:16
|
LL | if let X..=.0 = 0 {}
| - ^^ - this expression has type `u8`
@@ -358,7 +358,7 @@ LL | if let X..=.0 = 0 {}
found type `{float}`
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:54:12
+ --> $DIR/recover-range-pats.rs:53:12
|
LL | if let true...Y = 0 {}
| ^^^^ - this is of type `u8`
@@ -366,7 +366,7 @@ LL | if let true...Y = 0 {}
| this is of type `bool` but it should be `char` or numeric
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:57:16
+ --> $DIR/recover-range-pats.rs:56:16
|
LL | if let X...true = 0 {}
| - ^^^^ this is of type `bool` but it should be `char` or numeric
@@ -374,7 +374,7 @@ LL | if let X...true = 0 {}
| this is of type `u8`
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:60:12
+ --> $DIR/recover-range-pats.rs:59:12
|
LL | if let .0...Y = 0 {}
| ^^ - - this expression has type `{integer}`
@@ -383,7 +383,7 @@ LL | if let .0...Y = 0 {}
| expected integer, found floating-point number
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:64:17
+ --> $DIR/recover-range-pats.rs:63:17
|
LL | if let X... .0 = 0 {}
| - ^^ - this expression has type `u8`
@@ -395,13 +395,13 @@ LL | if let X... .0 = 0 {}
found type `{float}`
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:73:12
+ --> $DIR/recover-range-pats.rs:72:12
|
LL | if let true.. = 0 {}
| ^^^^ this is of type `bool` but it should be `char` or numeric
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:75:12
+ --> $DIR/recover-range-pats.rs:74:12
|
LL | if let .0.. = 0 {}
| ^^ - this expression has type `{integer}`
@@ -409,13 +409,13 @@ LL | if let .0.. = 0 {}
| expected integer, found floating-point number
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:83:12
+ --> $DIR/recover-range-pats.rs:82:12
|
LL | if let true..= = 0 {}
| ^^^^ this is of type `bool` but it should be `char` or numeric
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:85:12
+ --> $DIR/recover-range-pats.rs:84:12
|
LL | if let .0..= = 0 {}
| ^^ - this expression has type `{integer}`
@@ -423,13 +423,13 @@ LL | if let .0..= = 0 {}
| expected integer, found floating-point number
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:93:12
+ --> $DIR/recover-range-pats.rs:92:12
|
LL | if let true... = 0 {}
| ^^^^ this is of type `bool` but it should be `char` or numeric
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:95:12
+ --> $DIR/recover-range-pats.rs:94:12
|
LL | if let .0... = 0 {}
| ^^ - this expression has type `{integer}`
@@ -437,13 +437,13 @@ LL | if let .0... = 0 {}
| expected integer, found floating-point number
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:103:14
+ --> $DIR/recover-range-pats.rs:102:14
|
LL | if let ..true = 0 {}
| ^^^^ this is of type `bool` but it should be `char` or numeric
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:105:15
+ --> $DIR/recover-range-pats.rs:104:15
|
LL | if let .. .0 = 0 {}
| ^^ - this expression has type `{integer}`
@@ -451,13 +451,13 @@ LL | if let .. .0 = 0 {}
| expected integer, found floating-point number
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:113:15
+ --> $DIR/recover-range-pats.rs:112:15
|
LL | if let ..=true = 0 {}
| ^^^^ this is of type `bool` but it should be `char` or numeric
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:115:15
+ --> $DIR/recover-range-pats.rs:114:15
|
LL | if let ..=.0 = 0 {}
| ^^ - this expression has type `{integer}`
@@ -465,13 +465,13 @@ LL | if let ..=.0 = 0 {}
| expected integer, found floating-point number
error[E0029]: only `char` and numeric types are allowed in range patterns
- --> $DIR/recover-range-pats.rs:125:15
+ --> $DIR/recover-range-pats.rs:124:15
|
LL | if let ...true = 0 {}
| ^^^^ this is of type `bool` but it should be `char` or numeric
error[E0308]: mismatched types
- --> $DIR/recover-range-pats.rs:128:15
+ --> $DIR/recover-range-pats.rs:127:15
|
LL | if let ....3 = 0 {}
| ^^ - this expression has type `{integer}`
diff --git a/src/test/ui/parser/recover-struct.stderr b/src/test/ui/parser/recover-struct.stderr
index 1b72184b0..9f6fb06ca 100644
--- a/src/test/ui/parser/recover-struct.stderr
+++ b/src/test/ui/parser/recover-struct.stderr
@@ -1,6 +1,8 @@
error: expected `:`, found `Bad`
--> $DIR/recover-struct.rs:4:9
|
+LL | struct Test {
+ | ---- while parsing this struct
LL | Very
| - expected `:`
LL | Bad
diff --git a/src/test/ui/parser/recovered-struct-variant.stderr b/src/test/ui/parser/recovered-struct-variant.stderr
index 51aaf8bb3..78c67866f 100644
--- a/src/test/ui/parser/recovered-struct-variant.stderr
+++ b/src/test/ui/parser/recovered-struct-variant.stderr
@@ -2,7 +2,9 @@ error: expected `:`, found `,`
--> $DIR/recovered-struct-variant.rs:2:10
|
LL | A { a, b: usize }
- | ^ expected `:`
+ | - ^ expected `:`
+ | |
+ | while parsing this struct
error: aborting due to previous error
diff --git a/src/test/ui/parser/removed-syntax-enum-newtype.stderr b/src/test/ui/parser/removed-syntax-enum-newtype.stderr
index 2daa6249b..8f7ca3567 100644
--- a/src/test/ui/parser/removed-syntax-enum-newtype.stderr
+++ b/src/test/ui/parser/removed-syntax-enum-newtype.stderr
@@ -2,7 +2,9 @@ error: expected one of `<`, `where`, or `{`, found `=`
--> $DIR/removed-syntax-enum-newtype.rs:1:8
|
LL | enum e = isize;
- | ^ expected one of `<`, `where`, or `{`
+ | - ^ expected one of `<`, `where`, or `{`
+ | |
+ | while parsing this enum
error: aborting due to previous error
diff --git a/src/test/ui/parser/removed-syntax-field-let-2.rs b/src/test/ui/parser/removed-syntax-field-let-2.rs
new file mode 100644
index 000000000..7ff91b476
--- /dev/null
+++ b/src/test/ui/parser/removed-syntax-field-let-2.rs
@@ -0,0 +1,12 @@
+struct Foo {
+ let x: i32,
+ //~^ ERROR expected identifier, found keyword
+ let y: i32,
+ //~^ ERROR expected identifier, found keyword
+}
+
+fn main() {
+ let _ = Foo {
+ //~^ ERROR missing fields `x` and `y` in initializer of `Foo`
+ };
+}
diff --git a/src/test/ui/parser/removed-syntax-field-let-2.stderr b/src/test/ui/parser/removed-syntax-field-let-2.stderr
new file mode 100644
index 000000000..fda0919b9
--- /dev/null
+++ b/src/test/ui/parser/removed-syntax-field-let-2.stderr
@@ -0,0 +1,33 @@
+error: expected identifier, found keyword `let`
+ --> $DIR/removed-syntax-field-let-2.rs:2:5
+ |
+LL | let x: i32,
+ | ^^^-
+ | |
+ | expected identifier, found keyword
+ | help: remove this `let` keyword
+ |
+ = note: the `let` keyword is not allowed in `struct` fields
+ = note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information
+
+error: expected identifier, found keyword `let`
+ --> $DIR/removed-syntax-field-let-2.rs:4:5
+ |
+LL | let y: i32,
+ | ^^^-
+ | |
+ | expected identifier, found keyword
+ | help: remove this `let` keyword
+ |
+ = note: the `let` keyword is not allowed in `struct` fields
+ = note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information
+
+error[E0063]: missing fields `x` and `y` in initializer of `Foo`
+ --> $DIR/removed-syntax-field-let-2.rs:9:13
+ |
+LL | let _ = Foo {
+ | ^^^ missing `x` and `y`
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0063`.
diff --git a/src/test/ui/parser/removed-syntax-field-let.stderr b/src/test/ui/parser/removed-syntax-field-let.stderr
index 10be2e045..9bc18dabd 100644
--- a/src/test/ui/parser/removed-syntax-field-let.stderr
+++ b/src/test/ui/parser/removed-syntax-field-let.stderr
@@ -2,7 +2,13 @@ error: expected identifier, found keyword `let`
--> $DIR/removed-syntax-field-let.rs:2:5
|
LL | let foo: (),
- | ^^^ expected identifier, found keyword
+ | ^^^-
+ | |
+ | expected identifier, found keyword
+ | help: remove this `let` keyword
+ |
+ = note: the `let` keyword is not allowed in `struct` fields
+ = note: see <https://doc.rust-lang.org/book/ch05-01-defining-structs.html> for more information
error: aborting due to previous error
diff --git a/src/test/ui/parser/removed-syntax-field-semicolon.rs b/src/test/ui/parser/removed-syntax-field-semicolon.rs
index ac28e21ae..808f2a5cc 100644
--- a/src/test/ui/parser/removed-syntax-field-semicolon.rs
+++ b/src/test/ui/parser/removed-syntax-field-semicolon.rs
@@ -1,6 +1,6 @@
struct S {
bar: ();
- //~^ ERROR expected `,`, or `}`, found `;`
+ //~^ ERROR struct fields are separated by `,`
}
fn main() {}
diff --git a/src/test/ui/parser/removed-syntax-field-semicolon.stderr b/src/test/ui/parser/removed-syntax-field-semicolon.stderr
index fbefeb26a..532d4fb2b 100644
--- a/src/test/ui/parser/removed-syntax-field-semicolon.stderr
+++ b/src/test/ui/parser/removed-syntax-field-semicolon.stderr
@@ -1,8 +1,10 @@
-error: expected `,`, or `}`, found `;`
+error: struct fields are separated by `,`
--> $DIR/removed-syntax-field-semicolon.rs:2:12
|
+LL | struct S {
+ | - while parsing this struct
LL | bar: ();
- | ^
+ | ^ help: replace `;` with `,`
error: aborting due to previous error
diff --git a/src/test/ui/parser/removed-syntax-static-fn.stderr b/src/test/ui/parser/removed-syntax-static-fn.stderr
index 04e34dc16..52e065894 100644
--- a/src/test/ui/parser/removed-syntax-static-fn.stderr
+++ b/src/test/ui/parser/removed-syntax-static-fn.stderr
@@ -16,10 +16,10 @@ LL | }
| - the item list ends here
error: missing type for `static` item
- --> $DIR/removed-syntax-static-fn.rs:4:12
+ --> $DIR/removed-syntax-static-fn.rs:4:14
|
LL | static fn f() {}
- | ^^ help: provide a type for the item: `r#fn: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.rs b/src/test/ui/parser/require-parens-for-chained-comparison.rs
index f29fd7a54..5b90e905a 100644
--- a/src/test/ui/parser/require-parens-for-chained-comparison.rs
+++ b/src/test/ui/parser/require-parens-for-chained-comparison.rs
@@ -23,11 +23,13 @@ fn main() {
//~^ ERROR expected one of
//~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
//~| ERROR expected
+ //~| HELP add `'` to close the char literal
f<'_>();
//~^ comparison operators cannot be chained
//~| HELP use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
//~| ERROR expected
+ //~| HELP add `'` to close the char literal
let _ = f<u8>;
//~^ ERROR comparison operators cannot be chained
diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr
index 0bf52854e..52e201c43 100644
--- a/src/test/ui/parser/require-parens-for-chained-comparison.stderr
+++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr
@@ -58,6 +58,11 @@ error: expected `while`, `for`, `loop` or `{` after a label
|
LL | let _ = f<'_, i8>();
| ^ expected `while`, `for`, `loop` or `{` after a label
+ |
+help: add `'` to close the char literal
+ |
+LL | let _ = f<'_', i8>();
+ | +
error: expected one of `.`, `:`, `;`, `?`, `else`, `for`, `loop`, `while`, or an operator, found `,`
--> $DIR/require-parens-for-chained-comparison.rs:22:17
@@ -71,13 +76,18 @@ LL | let _ = f::<'_, i8>();
| ++
error: expected `while`, `for`, `loop` or `{` after a label
- --> $DIR/require-parens-for-chained-comparison.rs:27:9
+ --> $DIR/require-parens-for-chained-comparison.rs:28:9
|
LL | f<'_>();
| ^ expected `while`, `for`, `loop` or `{` after a label
+ |
+help: add `'` to close the char literal
+ |
+LL | f<'_'>();
+ | +
error: comparison operators cannot be chained
- --> $DIR/require-parens-for-chained-comparison.rs:27:6
+ --> $DIR/require-parens-for-chained-comparison.rs:28:6
|
LL | f<'_>();
| ^ ^
@@ -88,7 +98,7 @@ LL | f::<'_>();
| ++
error: comparison operators cannot be chained
- --> $DIR/require-parens-for-chained-comparison.rs:32:14
+ --> $DIR/require-parens-for-chained-comparison.rs:34:14
|
LL | let _ = f<u8>;
| ^ ^
diff --git a/src/test/ui/parser/semi-after-closure-in-macro.rs b/src/test/ui/parser/semi-after-closure-in-macro.rs
new file mode 100644
index 000000000..14efb6100
--- /dev/null
+++ b/src/test/ui/parser/semi-after-closure-in-macro.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+// Checks that the fix in #103222 doesn't also disqualify semicolons after
+// closures within parentheses *in macros*, where they're totally allowed.
+
+macro_rules! m {
+ (($expr:expr ; )) => {
+ $expr
+ };
+}
+
+fn main() {
+ let x = m!(( ||() ; ));
+}
diff --git a/src/test/ui/parser/struct-filed-with-attr.fixed b/src/test/ui/parser/struct-filed-with-attr.fixed
new file mode 100644
index 000000000..a799ec8ca
--- /dev/null
+++ b/src/test/ui/parser/struct-filed-with-attr.fixed
@@ -0,0 +1,18 @@
+// Issue: 100461, Try to give a helpful diagnostic even when the next struct field has an attribute.
+// run-rustfix
+
+struct Feelings {
+ owo: bool,
+ //~^ ERROR expected `,`, or `}`, found `#`
+ #[allow(unused)]
+ uwu: bool,
+}
+
+impl Feelings {
+ #[allow(unused)]
+ fn hmm(&self) -> bool {
+ self.owo
+ }
+}
+
+fn main() { }
diff --git a/src/test/ui/parser/struct-filed-with-attr.rs b/src/test/ui/parser/struct-filed-with-attr.rs
new file mode 100644
index 000000000..bfc78e15b
--- /dev/null
+++ b/src/test/ui/parser/struct-filed-with-attr.rs
@@ -0,0 +1,18 @@
+// Issue: 100461, Try to give a helpful diagnostic even when the next struct field has an attribute.
+// run-rustfix
+
+struct Feelings {
+ owo: bool
+ //~^ ERROR expected `,`, or `}`, found `#`
+ #[allow(unused)]
+ uwu: bool,
+}
+
+impl Feelings {
+ #[allow(unused)]
+ fn hmm(&self) -> bool {
+ self.owo
+ }
+}
+
+fn main() { }
diff --git a/src/test/ui/parser/struct-filed-with-attr.stderr b/src/test/ui/parser/struct-filed-with-attr.stderr
new file mode 100644
index 000000000..c2cd7e82e
--- /dev/null
+++ b/src/test/ui/parser/struct-filed-with-attr.stderr
@@ -0,0 +1,8 @@
+error: expected `,`, or `}`, found `#`
+ --> $DIR/struct-filed-with-attr.rs:5:14
+ |
+LL | owo: bool
+ | ^ help: try adding a comma: `,`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/struct-literal-in-for.stderr b/src/test/ui/parser/struct-literal-in-for.stderr
index 4b191710c..1c91eba68 100644
--- a/src/test/ui/parser/struct-literal-in-for.stderr
+++ b/src/test/ui/parser/struct-literal-in-for.stderr
@@ -24,7 +24,7 @@ LL | | }.hi() {
| |__________^ `bool` is not an iterator
|
= help: the trait `Iterator` is not implemented for `bool`
- = note: required because of the requirements on the impl of `IntoIterator` for `bool`
+ = note: required for `bool` to implement `IntoIterator`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/parser/suggest-assoc-const.fixed b/src/test/ui/parser/suggest-assoc-const.fixed
new file mode 100644
index 000000000..259f37b23
--- /dev/null
+++ b/src/test/ui/parser/suggest-assoc-const.fixed
@@ -0,0 +1,10 @@
+// Issue: 101797, Suggest associated const for incorrect use of let in traits
+// run-rustfix
+trait Trait {
+ const _X: i32;
+ //~^ ERROR non-item in item list
+}
+
+fn main() {
+
+}
diff --git a/src/test/ui/parser/suggest-assoc-const.rs b/src/test/ui/parser/suggest-assoc-const.rs
new file mode 100644
index 000000000..c7be712ec
--- /dev/null
+++ b/src/test/ui/parser/suggest-assoc-const.rs
@@ -0,0 +1,10 @@
+// Issue: 101797, Suggest associated const for incorrect use of let in traits
+// run-rustfix
+trait Trait {
+ let _X: i32;
+ //~^ ERROR non-item in item list
+}
+
+fn main() {
+
+}
diff --git a/src/test/ui/parser/suggest-assoc-const.stderr b/src/test/ui/parser/suggest-assoc-const.stderr
new file mode 100644
index 000000000..2ddfa07c5
--- /dev/null
+++ b/src/test/ui/parser/suggest-assoc-const.stderr
@@ -0,0 +1,8 @@
+error: non-item in item list
+ --> $DIR/suggest-assoc-const.rs:4:5
+ |
+LL | let _X: i32;
+ | ^^^ help: consider using `const` instead of `let` for associated const: `const`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/suggest-const-for-global-var.rs b/src/test/ui/parser/suggest-const-for-global-var.rs
new file mode 100644
index 000000000..d6216cb7a
--- /dev/null
+++ b/src/test/ui/parser/suggest-const-for-global-var.rs
@@ -0,0 +1,6 @@
+let X: i32 = 12;
+//~^ ERROR expected item, found keyword `let`
+
+fn main() {
+ println!("{}", X);
+}
diff --git a/src/test/ui/parser/suggest-const-for-global-var.stderr b/src/test/ui/parser/suggest-const-for-global-var.stderr
new file mode 100644
index 000000000..94e44ec7f
--- /dev/null
+++ b/src/test/ui/parser/suggest-const-for-global-var.stderr
@@ -0,0 +1,8 @@
+error: expected item, found keyword `let`
+ --> $DIR/suggest-const-for-global-var.rs:1:1
+ |
+LL | let X: i32 = 12;
+ | ^^^ consider using `const` or `static` instead of `let` for global variables
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.fixed b/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.fixed
new file mode 100644
index 000000000..637047354
--- /dev/null
+++ b/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.fixed
@@ -0,0 +1,7 @@
+// run-rustfix
+
+trait Foo {
+ fn bar() {} //~ ERROR non-item in item list
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.rs b/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.rs
new file mode 100644
index 000000000..4650b05e2
--- /dev/null
+++ b/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.rs
@@ -0,0 +1,7 @@
+// run-rustfix
+
+trait Foo {
+ fn bar() {}; //~ ERROR non-item in item list
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr b/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr
new file mode 100644
index 000000000..396e0c130
--- /dev/null
+++ b/src/test/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr
@@ -0,0 +1,15 @@
+error: non-item in item list
+ --> $DIR/suggest-removing-semicolon-after-impl-trait-items.rs:4:16
+ |
+LL | trait Foo {
+ | - item list starts here
+LL | fn bar() {};
+ | ^
+ | |
+ | non-item starts here
+ | help: consider removing this semicolon
+LL | }
+ | - item list ends here
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/suggest-semicolon-before-array.fixed b/src/test/ui/parser/suggest-semicolon-before-array.fixed
new file mode 100644
index 000000000..a06b58b27
--- /dev/null
+++ b/src/test/ui/parser/suggest-semicolon-before-array.fixed
@@ -0,0 +1,11 @@
+// run-rustfix
+#![allow(dead_code)]
+
+fn foo() {}
+
+fn bar() -> [u8; 2] {
+ foo();
+ [1, 3] //~ ERROR expected `;`, found `[`
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/suggest-semicolon-before-array.rs b/src/test/ui/parser/suggest-semicolon-before-array.rs
new file mode 100644
index 000000000..f601ca2ae
--- /dev/null
+++ b/src/test/ui/parser/suggest-semicolon-before-array.rs
@@ -0,0 +1,11 @@
+// run-rustfix
+#![allow(dead_code)]
+
+fn foo() {}
+
+fn bar() -> [u8; 2] {
+ foo()
+ [1, 3] //~ ERROR expected `;`, found `[`
+}
+
+fn main() {}
diff --git a/src/test/ui/parser/suggest-semicolon-before-array.stderr b/src/test/ui/parser/suggest-semicolon-before-array.stderr
new file mode 100644
index 000000000..8a33321fb
--- /dev/null
+++ b/src/test/ui/parser/suggest-semicolon-before-array.stderr
@@ -0,0 +1,13 @@
+error: expected `;`, found `[`
+ --> $DIR/suggest-semicolon-before-array.rs:8:5
+ |
+LL | [1, 3]
+ | ^
+ |
+help: consider adding `;` here
+ |
+LL | foo();
+ | +
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/tag-variant-disr-non-nullary.rs b/src/test/ui/parser/tag-variant-disr-non-nullary.rs
deleted file mode 100644
index a9cfdd549..000000000
--- a/src/test/ui/parser/tag-variant-disr-non-nullary.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-enum Color {
- Red = 0xff0000,
- //~^ ERROR custom discriminant values are not allowed in enums with tuple or struct variants
- Green = 0x00ff00,
- Blue = 0x0000ff,
- Black = 0x000000,
- White = 0xffffff,
- Other(usize),
- Other2(usize, usize),
-}
-
-fn main() {}
diff --git a/src/test/ui/parser/tag-variant-disr-non-nullary.stderr b/src/test/ui/parser/tag-variant-disr-non-nullary.stderr
deleted file mode 100644
index 79f044a06..000000000
--- a/src/test/ui/parser/tag-variant-disr-non-nullary.stderr
+++ /dev/null
@@ -1,25 +0,0 @@
-error[E0658]: custom discriminant values are not allowed in enums with tuple or struct variants
- --> $DIR/tag-variant-disr-non-nullary.rs:2:11
- |
-LL | Red = 0xff0000,
- | ^^^^^^^^ disallowed custom discriminant
-LL |
-LL | Green = 0x00ff00,
- | ^^^^^^^^ disallowed custom discriminant
-LL | Blue = 0x0000ff,
- | ^^^^^^^^ disallowed custom discriminant
-LL | Black = 0x000000,
- | ^^^^^^^^ disallowed custom discriminant
-LL | White = 0xffffff,
- | ^^^^^^^^ disallowed custom discriminant
-LL | Other(usize),
- | ------------ tuple variant defined here
-LL | Other2(usize, usize),
- | -------------------- tuple variant defined here
- |
- = note: see issue #60553 <https://github.com/rust-lang/rust/issues/60553> for more information
- = help: add `#![feature(arbitrary_enum_discriminant)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/parser/trait-item-with-defaultness-fail-semantic.stderr b/src/test/ui/parser/trait-item-with-defaultness-fail-semantic.stderr
index 76fa86033..be858cd65 100644
--- a/src/test/ui/parser/trait-item-with-defaultness-fail-semantic.stderr
+++ b/src/test/ui/parser/trait-item-with-defaultness-fail-semantic.stderr
@@ -52,9 +52,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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: aborting due to 6 previous errors; 1 warning emitted
diff --git a/src/test/ui/parser/trait-object-delimiters.rs b/src/test/ui/parser/trait-object-delimiters.rs
index b5258eebb..cc04ac052 100644
--- a/src/test/ui/parser/trait-object-delimiters.rs
+++ b/src/test/ui/parser/trait-object-delimiters.rs
@@ -6,7 +6,7 @@ fn foo1(_: &dyn Drop + AsRef<str>) {} //~ ERROR ambiguous `+` in a type
fn foo2(_: &dyn (Drop + AsRef<str>)) {} //~ ERROR incorrect braces around trait bounds
fn foo3(_: &dyn {Drop + AsRef<str>}) {} //~ ERROR expected parameter name, found `{`
-//~^ ERROR expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
+//~^ ERROR expected one of `!`, `(`, `)`, `*`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
//~| ERROR at least one trait is required for an object type
fn foo4(_: &dyn <Drop + AsRef<str>>) {} //~ ERROR expected identifier, found `<`
diff --git a/src/test/ui/parser/trait-object-delimiters.stderr b/src/test/ui/parser/trait-object-delimiters.stderr
index 6eb9c7238..99c451545 100644
--- a/src/test/ui/parser/trait-object-delimiters.stderr
+++ b/src/test/ui/parser/trait-object-delimiters.stderr
@@ -22,11 +22,11 @@ error: expected parameter name, found `{`
LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
| ^ expected parameter name
-error: expected one of `!`, `(`, `)`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
+error: expected one of `!`, `(`, `)`, `*`, `,`, `?`, `for`, `~`, lifetime, or path, found `{`
--> $DIR/trait-object-delimiters.rs:8:17
|
LL | fn foo3(_: &dyn {Drop + AsRef<str>}) {}
- | -^ expected one of 9 possible tokens
+ | -^ expected one of 10 possible tokens
| |
| help: missing `,`
diff --git a/src/test/ui/parser/trait-object-trait-parens.stderr b/src/test/ui/parser/trait-object-trait-parens.stderr
index 7ee965bd2..5e07a3fe6 100644
--- a/src/test/ui/parser/trait-object-trait-parens.stderr
+++ b/src/test/ui/parser/trait-object-trait-parens.stderr
@@ -22,14 +22,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
-LL - let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>;
-LL + let _: Box<dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)>;
- |
+LL | let _: Box<dyn (Obj) + (?Sized) + (for<'a> Trait<'a>)>;
+ | +++
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/trait-object-trait-parens.rs:8:35
@@ -52,9 +51,8 @@ LL | let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - let _: Box<?Sized + (for<'a> Trait<'a>) + (Obj)>;
-LL + let _: Box<dyn ?Sized + (for<'a> Trait<'a>) + (Obj)>;
- |
+LL | let _: Box<dyn ?Sized + (for<'a> Trait<'a>) + (Obj)>;
+ | +++
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/trait-object-trait-parens.rs:13:47
@@ -77,9 +75,8 @@ LL | let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - let _: Box<for<'a> Trait<'a> + (Obj) + (?Sized)>;
-LL + let _: Box<dyn for<'a> Trait<'a> + (Obj) + (?Sized)>;
- |
+LL | let _: Box<dyn for<'a> Trait<'a> + (Obj) + (?Sized)>;
+ | +++
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/trait-object-trait-parens.rs:18:36
diff --git a/src/test/ui/parser/type-alias-where-fixable.fixed b/src/test/ui/parser/type-alias-where-fixable.fixed
index 41dd10676..2f47c0d91 100644
--- a/src/test/ui/parser/type-alias-where-fixable.fixed
+++ b/src/test/ui/parser/type-alias-where-fixable.fixed
@@ -1,8 +1,6 @@
// check-pass
// run-rustfix
-#![feature(generic_associated_types)]
-
trait Trait {
// Fine.
type Assoc where u32: Copy;
diff --git a/src/test/ui/parser/type-alias-where-fixable.rs b/src/test/ui/parser/type-alias-where-fixable.rs
index 562a530a7..b20aa9398 100644
--- a/src/test/ui/parser/type-alias-where-fixable.rs
+++ b/src/test/ui/parser/type-alias-where-fixable.rs
@@ -1,8 +1,6 @@
// check-pass
// run-rustfix
-#![feature(generic_associated_types)]
-
trait Trait {
// Fine.
type Assoc where u32: Copy;
diff --git a/src/test/ui/parser/type-alias-where-fixable.stderr b/src/test/ui/parser/type-alias-where-fixable.stderr
index abfeb62fc..f0acb388b 100644
--- a/src/test/ui/parser/type-alias-where-fixable.stderr
+++ b/src/test/ui/parser/type-alias-where-fixable.stderr
@@ -1,11 +1,11 @@
warning: where clause not allowed here
- --> $DIR/type-alias-where-fixable.rs:15:16
+ --> $DIR/type-alias-where-fixable.rs:13:16
|
LL | type Assoc where u32: Copy = ();
| ^^^^^^^^^^^^^^^
|
- = note: `#[warn(deprecated_where_clause_location)]` on by default
= note: see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
+ = note: `#[warn(deprecated_where_clause_location)]` on by default
help: move it to the end of the type declaration
|
LL - type Assoc where u32: Copy = ();
@@ -13,7 +13,7 @@ LL + type Assoc = () where u32: Copy;
|
warning: where clause not allowed here
- --> $DIR/type-alias-where-fixable.rs:18:17
+ --> $DIR/type-alias-where-fixable.rs:16:17
|
LL | type Assoc2 where u32: Copy = () where i32: Copy;
| ^^^^^^^^^^^^^^^
@@ -26,7 +26,7 @@ LL + type Assoc2 = () where i32: Copy, u32: Copy;
|
warning: where clause not allowed here
- --> $DIR/type-alias-where-fixable.rs:26:17
+ --> $DIR/type-alias-where-fixable.rs:24:17
|
LL | type Assoc2 where u32: Copy, i32: Copy = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/parser/type-alias-where.rs b/src/test/ui/parser/type-alias-where.rs
index f6e7dfb7b..62e301cb4 100644
--- a/src/test/ui/parser/type-alias-where.rs
+++ b/src/test/ui/parser/type-alias-where.rs
@@ -1,7 +1,5 @@
// check-fail
-#![feature(generic_associated_types)]
-
// Fine, but lints as unused
type Foo where u32: Copy = ();
// Not fine.
diff --git a/src/test/ui/parser/type-alias-where.stderr b/src/test/ui/parser/type-alias-where.stderr
index 8789d2665..fb8381792 100644
--- a/src/test/ui/parser/type-alias-where.stderr
+++ b/src/test/ui/parser/type-alias-where.stderr
@@ -1,5 +1,5 @@
error: where clauses are not allowed after the type for type aliases
- --> $DIR/type-alias-where.rs:8:15
+ --> $DIR/type-alias-where.rs:6:15
|
LL | type Bar = () where u32: Copy;
| ^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | type Bar = () where u32: Copy;
= note: see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
error: where clauses are not allowed after the type for type aliases
- --> $DIR/type-alias-where.rs:10:15
+ --> $DIR/type-alias-where.rs:8:15
|
LL | type Baz = () where;
| ^^^^^
diff --git a/src/test/ui/parser/unicode-control-codepoints.stderr b/src/test/ui/parser/unicode-control-codepoints.stderr
index 71509fe41..44548c72f 100644
--- a/src/test/ui/parser/unicode-control-codepoints.stderr
+++ b/src/test/ui/parser/unicode-control-codepoints.stderr
@@ -92,8 +92,8 @@ LL | // if access_level != "user" { // Check if admin
| | '\u{202b}'
| this comment contains invisible unicode text flow control codepoints
|
- = note: `#[deny(text_direction_codepoint_in_comment)]` on by default
= note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
+ = note: `#[deny(text_direction_codepoint_in_comment)]` on by default
= help: if their presence wasn't intentional, you can remove them
error: unicode codepoint changing visible direction of text present in comment
@@ -123,8 +123,8 @@ LL | println!("{:?}", "/* } if isAdmin begin admins only ");
| | '\u{202e}'
| this literal contains invisible unicode text flow control codepoints
|
- = note: `#[deny(text_direction_codepoint_in_literal)]` on by default
= note: these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
+ = note: `#[deny(text_direction_codepoint_in_literal)]` on by default
= help: if their presence wasn't intentional, you can remove them
help: if you want to keep them but make them visible in your source code, you can escape them
|
diff --git a/src/test/ui/parser/unmatched-langle-1.stderr b/src/test/ui/parser/unmatched-langle-1.stderr
index c8072b4c5..cdf74bded 100644
--- a/src/test/ui/parser/unmatched-langle-1.stderr
+++ b/src/test/ui/parser/unmatched-langle-1.stderr
@@ -4,18 +4,18 @@ error: unmatched angle brackets
LL | foo::<<<<Ty<i32>>();
| ^^^ help: remove extra angle brackets
-error[E0425]: cannot find function `foo` in this scope
- --> $DIR/unmatched-langle-1.rs:5:5
- |
-LL | foo::<<<<Ty<i32>>();
- | ^^^ not found in this scope
-
error[E0412]: cannot find type `Ty` in this scope
--> $DIR/unmatched-langle-1.rs:5:14
|
LL | foo::<<<<Ty<i32>>();
| ^^ not found in this scope
+error[E0425]: cannot find function `foo` in this scope
+ --> $DIR/unmatched-langle-1.rs:5:5
+ |
+LL | foo::<<<<Ty<i32>>();
+ | ^^^ not found in this scope
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0412, E0425.
diff --git a/src/test/ui/parser/unnecessary-let.rs b/src/test/ui/parser/unnecessary-let.rs
new file mode 100644
index 000000000..627910962
--- /dev/null
+++ b/src/test/ui/parser/unnecessary-let.rs
@@ -0,0 +1,11 @@
+fn main() {
+ for let x of [1, 2, 3] {}
+ //~^ ERROR expected pattern, found `let`
+ //~| ERROR missing `in` in `for` loop
+
+ match 1 {
+ let 1 => {}
+ //~^ ERROR expected pattern, found `let`
+ _ => {}
+ }
+}
diff --git a/src/test/ui/parser/unnecessary-let.stderr b/src/test/ui/parser/unnecessary-let.stderr
new file mode 100644
index 000000000..952119cae
--- /dev/null
+++ b/src/test/ui/parser/unnecessary-let.stderr
@@ -0,0 +1,20 @@
+error: expected pattern, found `let`
+ --> $DIR/unnecessary-let.rs:2:9
+ |
+LL | for let x of [1, 2, 3] {}
+ | ^^^ help: remove the unnecessary `let` keyword
+
+error: missing `in` in `for` loop
+ --> $DIR/unnecessary-let.rs:2:15
+ |
+LL | for let x of [1, 2, 3] {}
+ | ^^ help: try using `in` here instead
+
+error: expected pattern, found `let`
+ --> $DIR/unnecessary-let.rs:7:9
+ |
+LL | let 1 => {}
+ | ^^^ help: remove the unnecessary `let` keyword
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
index 4249a74b3..fad84dda0 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-neither-can-live-while-the-other-survives-1.stderr
@@ -40,9 +40,8 @@ error[E0382]: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:12:14
|
LL | Some(ref _y @ _z) => {}
- | ^^^^^^^^^--
- | | |
- | | value moved here
+ | ^^^^^^ -- value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `X`, which does not implement the `Copy` trait
@@ -55,9 +54,8 @@ error[E0382]: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:26:14
|
LL | Some(ref mut _y @ _z) => {}
- | ^^^^^^^^^^^^^--
- | | |
- | | value moved here
+ | ^^^^^^^^^^ -- value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `X`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr b/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
index ee0885a01..a481ca468 100644
--- a/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
+++ b/src/test/ui/pattern/bindings-after-at/bind-by-move-no-subbindings-fun-param.stderr
@@ -2,9 +2,8 @@ error[E0382]: use of partially moved value
--> $DIR/bind-by-move-no-subbindings-fun-param.rs:7:6
|
LL | fn f(a @ A(u): A) -> Box<u8> {
- | ^^^^^^-^
- | | |
- | | value partially moved here
+ | ^ - value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `Box<u8>`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
index 8e00bf5c3..a227cc583 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-move-and-move.stderr
@@ -2,7 +2,7 @@ error[E0382]: use of moved value
--> $DIR/borrowck-move-and-move.rs:11:9
|
LL | let a @ b = U;
- | ^^^^- - move occurs because value has type `U`, which does not implement the `Copy` trait
+ | ^ - - move occurs because value has type `U`, which does not implement the `Copy` trait
| | |
| | value moved here
| value used here after move
@@ -11,9 +11,8 @@ error[E0382]: use of partially moved value
--> $DIR/borrowck-move-and-move.rs:13:9
|
LL | let a @ (b, c) = (U, U);
- | ^^^^^^^^-^
- | | |
- | | value partially moved here
+ | ^ - value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -22,9 +21,8 @@ error[E0382]: use of partially moved value
--> $DIR/borrowck-move-and-move.rs:15:9
|
LL | let a @ (b, c) = (u(), u());
- | ^^^^^^^^-^
- | | |
- | | value partially moved here
+ | ^ - value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -35,9 +33,8 @@ error[E0382]: use of moved value
LL | match Ok(U) {
| ----- move occurs because value has type `Result<U, U>`, which does not implement the `Copy` trait
LL | a @ Ok(b) | a @ Err(b) => {}
- | -------^-
- | | |
- | | value used here after move
+ | - ^ value used here after move
+ | |
| value moved here
error[E0382]: use of moved value
@@ -46,18 +43,16 @@ error[E0382]: use of moved value
LL | match Ok(U) {
| ----- move occurs because value has type `Result<U, U>`, which does not implement the `Copy` trait
LL | a @ Ok(b) | a @ Err(b) => {}
- | --------^-
- | | |
- | | value used here after move
+ | - ^ value used here after move
+ | |
| value moved here
error[E0382]: use of partially moved value
--> $DIR/borrowck-move-and-move.rs:25:9
|
LL | xs @ [a, .., b] => {}
- | ^^^^^^^^^^^^^-^
- | | |
- | | value partially moved here
+ | ^^ - value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -66,9 +61,8 @@ error[E0382]: use of partially moved value
--> $DIR/borrowck-move-and-move.rs:29:9
|
LL | xs @ [_, ys @ .., _] => {}
- | ^^^^^^^^^-------^^^^
- | | |
- | | value partially moved here
+ | ^^ -- value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -77,9 +71,8 @@ error[E0382]: use of moved value
--> $DIR/borrowck-move-and-move.rs:22:12
|
LL | fn fun(a @ b: U) {}
- | ^^^^-
- | | |
- | | value moved here
+ | ^ - value moved here
+ | |
| value used here after move
| move occurs because value has type `U`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
index 4b2048855..002c7609f 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
@@ -74,9 +74,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-at-and-box.rs:31:9
|
LL | let ref a @ box b = Box::new(NC);
- | ^^^^^^^^^^^^-
- | | |
- | | value moved here
+ | ^^^^^ - value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `NC`, which does not implement the `Copy` trait
@@ -85,9 +84,8 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
--> $DIR/borrowck-pat-at-and-box.rs:38:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
- | ^^^^^^^^^^^^---------
- | | |
- | | mutable borrow occurs here
+ | ^^^^^ --------- mutable borrow occurs here
+ | |
| immutable borrow occurs here
...
LL | *b = NC;
@@ -97,9 +95,8 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
--> $DIR/borrowck-pat-at-and-box.rs:42:9
|
LL | let ref a @ box ref mut b = Box::new(NC);
- | ^^^^^^^^^^^^---------
- | | |
- | | mutable borrow occurs here
+ | ^^^^^ --------- mutable borrow occurs here
+ | |
| immutable borrow occurs here
...
LL | *b = NC;
@@ -109,9 +106,8 @@ error[E0502]: cannot borrow value as mutable because it is also borrowed as immu
--> $DIR/borrowck-pat-at-and-box.rs:48:9
|
LL | let ref mut a @ box ref b = Box::new(NC);
- | ^^^^^^^^^^^^^^^^-----
- | | |
- | | immutable borrow occurs here
+ | ^^^^^^^^^ ----- immutable borrow occurs here
+ | |
| mutable borrow occurs here
...
LL | drop(b);
@@ -121,9 +117,8 @@ error[E0502]: cannot borrow value as mutable because it is also borrowed as immu
--> $DIR/borrowck-pat-at-and-box.rs:62:9
|
LL | ref mut a @ box ref b => {
- | ^^^^^^^^^^^^^^^^-----
- | | |
- | | immutable borrow occurs here
+ | ^^^^^^^^^ ----- immutable borrow occurs here
+ | |
| mutable borrow occurs here
...
LL | drop(b);
@@ -133,9 +128,8 @@ error[E0502]: cannot borrow value as mutable because it is also borrowed as immu
--> $DIR/borrowck-pat-at-and-box.rs:54:11
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
- | ^^^^^^^^^^^^^^^^-----
- | | |
- | | immutable borrow occurs here
+ | ^^^^^^^^^ ----- immutable borrow occurs here
+ | |
| mutable borrow occurs here
...
LL | drop(b);
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
index bc2c1625f..a9e66de08 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref-inverse.stderr
@@ -262,9 +262,8 @@ error[E0382]: use of partially 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 partially moved here
+ | ^ - value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -273,9 +272,8 @@ error[E0382]: use of partially 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 partially moved here
+ | ^ - value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -286,10 +284,7 @@ error[E0382]: use of moved value
LL | match Some((U, U)) {
| ------------ move occurs because value has type `Option<(U, U)>`, which does not implement the `Copy` trait
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -----------------------------^^^^^^^^^--
- | | |
- | | value used here after move
- | value moved here
+ | - value moved here ^ value used here after move
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:55:30
@@ -297,9 +292,8 @@ error[E0382]: borrow of moved value
LL | match Some([U, U]) {
| ------------ move occurs because value has type `Option<[U; 2]>`, which does not implement the `Copy` trait
LL | mut a @ Some([ref b, ref mut c]) => {}
- | ---------------------^^^^^^^^^--
- | | |
- | | value borrowed here after move
+ | ----- ^^^^^^^^^ value borrowed here after move
+ | |
| value moved here
error[E0382]: borrow of moved value
@@ -308,9 +302,8 @@ error[E0382]: borrow of moved value
LL | match Some(u()) {
| --------- move occurs because value has type `Option<U>`, which does not implement the `Copy` trait
LL | a @ Some(ref b) => {}
- | ---------^^^^^-
- | | |
- | | value borrowed here after move
+ | - ^^^^^ value borrowed here after move
+ | |
| value moved here
error[E0382]: use of moved value
@@ -319,10 +312,7 @@ error[E0382]: use of moved value
LL | match Some((u(), u())) {
| ---------------- move occurs because value has type `Option<(U, U)>`, which does not implement the `Copy` trait
LL | a @ Some((mut b @ ref mut c, d @ ref e)) => {}
- | -----------------------------^^^^^^^^^--
- | | |
- | | value used here after move
- | value moved here
+ | - value moved here ^ value used here after move
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref-inverse.rs:75:30
@@ -330,18 +320,16 @@ error[E0382]: borrow of moved value
LL | match Some([u(), u()]) {
| ---------------- move occurs because value has type `Option<[U; 2]>`, which does not implement the `Copy` trait
LL | mut a @ Some([ref b, ref mut c]) => {}
- | ---------------------^^^^^^^^^--
- | | |
- | | value borrowed here after move
+ | ----- ^^^^^^^^^ value borrowed here after move
+ | |
| value moved here
error[E0382]: use of partially 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 partially moved here
+ | ^^^^^ ----- value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
index c019aae3d..b2f22fe86 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr
@@ -237,9 +237,8 @@ error[E0382]: borrow of partially moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:30:9
|
LL | let ref mut a @ [b, mut c] = [U, U];
- | ^^^^^^^^^^^^^^^^-----^
- | | |
- | | value partially moved here
+ | ^^^^^^^^^ ----- value partially moved here
+ | |
| value borrowed here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -248,7 +247,7 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:33:9
|
LL | let ref a @ b = u();
- | ^^^^^^^^- --- move occurs because value has type `U`, which does not implement the `Copy` trait
+ | ^^^^^ - --- move occurs because value has type `U`, which does not implement the `Copy` trait
| | |
| | value moved here
| value borrowed here after move
@@ -257,9 +256,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
- | ^^^^^^^^-----
- | | |
- | | value moved here
+ | ^^^^^ ----- value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -268,9 +266,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
- | ^^^^^^^^-
- | | |
- | | value moved here
+ | ^^^^^ - value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -279,9 +276,8 @@ error[E0382]: borrow of partially moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:42:9
|
LL | let ref mut a @ [b, mut c] = [u(), u()];
- | ^^^^^^^^^^^^^^^^-----^
- | | |
- | | value partially moved here
+ | ^^^^^^^^^ ----- value partially moved here
+ | |
| value borrowed here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -290,9 +286,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | ^^^^^^^^-----
- | | |
- | | value moved here
+ | ^^^^^ ----- value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -305,9 +300,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
- | ^^^^^^^^-
- | | |
- | | value moved here
+ | ^^^^^ - value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -320,9 +314,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
|
LL | fn f1(ref a @ b: U) {}
- | ^^^^^^^^-
- | | |
- | | value moved here
+ | ^^^^^ - value moved here
+ | |
| value borrowed here after move
| move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -330,9 +323,8 @@ error[E0382]: borrow of moved value
--> $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 moved here
+ | ^^^^^ ----- value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -341,9 +333,8 @@ error[E0382]: borrow of moved value
--> $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 moved here
+ | ^^^^^ - value moved here
+ | |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
@@ -352,9 +343,8 @@ error[E0382]: borrow of partially moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:20:11
|
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
- | ^^^^^^^^^^^^^^^^-----^
- | | |
- | | value partially moved here
+ | ^^^^^^^^^ ----- value partially moved here
+ | |
| value borrowed here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
index 2ae78d108..8546b4bb4 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-and-ref.stderr
@@ -298,9 +298,8 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:8:31
|
LL | ref mut z @ &mut Some(ref a) => {
- | ----------------------^^^^^-
- | | |
- | | immutable borrow occurs here
+ | --------- ^^^^^ immutable borrow occurs here
+ | |
| mutable borrow occurs here
...
LL | **z = None;
@@ -310,9 +309,8 @@ error[E0502]: cannot borrow value as mutable because it is also borrowed as immu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:46:9
|
LL | let ref mut a @ ref b = u();
- | ^^^^^^^^^^^^-----
- | | |
- | | immutable borrow occurs here
+ | ^^^^^^^^^ ----- immutable borrow occurs here
+ | |
| mutable borrow occurs here
...
LL | drop(b);
@@ -322,9 +320,8 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:51:9
|
LL | let ref a @ ref mut b = u();
- | ^^^^^^^^---------
- | | |
- | | mutable borrow occurs here
+ | ^^^^^ --------- mutable borrow occurs here
+ | |
| immutable borrow occurs here
...
LL | *b = u();
@@ -334,9 +331,8 @@ error[E0502]: cannot borrow value as mutable because it is also borrowed as immu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:20
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
- | -----------^^^^^^^^^-
- | | |
- | | mutable borrow occurs here
+ | ----- ^^^^^^^^^ mutable borrow occurs here
+ | |
| immutable borrow occurs here
...
LL | drop(a);
@@ -346,9 +342,8 @@ error[E0502]: cannot borrow value as mutable because it is also borrowed as immu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:76:45
|
LL | ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) => {
- | ------------^^^^^^^^^-
- | | |
- | | mutable borrow occurs here
+ | ----- ^^^^^^^^^ mutable borrow occurs here
+ | |
| immutable borrow occurs here
...
LL | drop(a);
@@ -406,9 +401,8 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:117:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
- | ^^^^^^^^^---------^^^^^^^^^^^^
- | | |
- | | mutable borrow occurs here
+ | ^^^^^ --------- mutable borrow occurs here
+ | |
| immutable borrow occurs here
...
LL | *b = U;
@@ -418,9 +412,8 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:123:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
- | ^^^^^^^^^---------^^^^^^^^^^^^
- | | |
- | | mutable borrow occurs here
+ | ^^^^^ --------- mutable borrow occurs here
+ | |
| immutable borrow occurs here
...
LL | *b = U;
@@ -430,9 +423,8 @@ error[E0502]: cannot borrow value as immutable because it is also borrowed as mu
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:129:9
|
LL | let ref a @ (ref mut b, ref mut c) = (U, U);
- | ^^^^^^^^^---------^^^^^^^^^^^^
- | | |
- | | mutable borrow occurs here
+ | ^^^^^ --------- mutable borrow occurs here
+ | |
| immutable borrow occurs here
LL |
LL | *b = U;
@@ -442,9 +434,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-and-ref.rs:28:30
|
LL | fn f4_also_moved(ref a @ ref mut b @ c: U) {}
- | --------^^^^^^^^^^^^-
- | | | |
- | | | value moved here
+ | ----- ^^^^^^^^^ - value moved here
+ | | |
| | value borrowed here after move
| move occurs because value has type `U`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
index aa0223041..384a57b2e 100644
--- a/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
+++ b/src/test/ui/pattern/bindings-after-at/borrowck-pat-ref-mut-twice.stderr
@@ -262,9 +262,8 @@ error[E0499]: 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;
- | ^^^^^^^^^^^^---------
- | | |
- | | first mutable borrow occurs here
+ | ^^^^^^^^^ --------- first mutable borrow occurs here
+ | |
| second mutable borrow occurs here
...
LL | drop(b);
@@ -274,9 +273,8 @@ error[E0499]: 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;
- | ^^^^^^^^^^^^---------
- | | |
- | | first mutable borrow occurs here
+ | ^^^^^^^^^ --------- first mutable borrow occurs here
+ | |
| second mutable borrow occurs here
...
LL | *b = U;
@@ -286,9 +284,8 @@ error[E0499]: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:89:24
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------------^^^^^^^^^-
- | | |
- | | second mutable borrow occurs here
+ | --------- ^^^^^^^^^ second mutable borrow occurs here
+ | |
| first mutable borrow occurs here
...
LL | *a = Err(U);
@@ -298,9 +295,8 @@ error[E0499]: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:89:53
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ----------------^^^^^^^^^-
- | | |
- | | second mutable borrow occurs here
+ | --------- ^^^^^^^^^ second mutable borrow occurs here
+ | |
| first mutable borrow occurs here
...
LL | *a = Err(U);
@@ -310,9 +306,8 @@ error[E0499]: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:101:24
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ---------------^^^^^^^^^-
- | | |
- | | second mutable borrow occurs here
+ | --------- ^^^^^^^^^ second mutable borrow occurs here
+ | |
| first mutable borrow occurs here
...
LL | drop(a);
@@ -322,9 +317,8 @@ error[E0499]: cannot borrow value as mutable more than once at a time
--> $DIR/borrowck-pat-ref-mut-twice.rs:101:53
|
LL | ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {
- | ----------------^^^^^^^^^-
- | | |
- | | second mutable borrow occurs here
+ | --------- ^^^^^^^^^ second mutable borrow occurs here
+ | |
| first mutable borrow occurs here
...
LL | drop(a);
@@ -334,9 +328,8 @@ error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-ref-mut-twice.rs:21:34
|
LL | fn f4_also_moved(ref mut a @ ref mut b @ c: U) {}
- | ------------^^^^^^^^^^^^-
- | | | |
- | | | value moved here
+ | --------- ^^^^^^^^^ - value moved here
+ | | |
| | value borrowed here after move
| move occurs because value has type `U`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr b/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
index d290144b6..cd3234952 100644
--- a/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
+++ b/src/test/ui/pattern/bindings-after-at/copy-and-move-mixed.stderr
@@ -2,9 +2,8 @@ error[E0382]: use of partially moved value
--> $DIR/copy-and-move-mixed.rs:12:9
|
LL | let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));
- | ^^^^^^^^^^------------^
- | | |
- | | value partially moved here
+ | ^ - value partially moved here
+ | |
| value used here after partial move
|
= note: partial move occurs because value has type `NC<C, C>`, which does not implement the `Copy` trait
diff --git a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
index d78faa682..840a513d6 100644
--- a/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
+++ b/src/test/ui/pattern/bindings-after-at/default-binding-modes-both-sides-independent.stderr
@@ -48,7 +48,7 @@ error[E0382]: borrow of moved value
--> $DIR/default-binding-modes-both-sides-independent.rs:29:9
|
LL | let ref mut a @ b = NotCopy;
- | ^^^^^^^^^^^^- ------- move occurs because value has type `NotCopy`, which does not implement the `Copy` trait
+ | ^^^^^^^^^ - ------- move occurs because value has type `NotCopy`, which does not implement the `Copy` trait
| | |
| | value moved here
| value borrowed here after move
diff --git a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
index 3180bd0af..70beb5d42 100644
--- a/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
+++ b/src/test/ui/pattern/bindings-after-at/nested-binding-modes-mut.stderr
@@ -11,7 +11,7 @@ error[E0596]: cannot borrow `not_mut` as mutable, as it is not declared as mutab
--> $DIR/nested-binding-modes-mut.rs:9:5
|
LL | let not_mut @ mut is_mut = 42;
- | -------------------- help: consider changing this to be mutable: `mut not_mut`
+ | ------- help: consider changing this to be mutable: `mut not_mut`
LL | &mut is_mut;
LL | &mut not_mut;
| ^^^^^^^^^^^^ cannot borrow as mutable
diff --git a/src/test/ui/issues/issue-17718-patterns.rs b/src/test/ui/pattern/issue-17718-patterns.rs
index 2ca0f67f8..2ca0f67f8 100644
--- a/src/test/ui/issues/issue-17718-patterns.rs
+++ b/src/test/ui/pattern/issue-17718-patterns.rs
diff --git a/src/test/ui/issues/issue-17718-patterns.stderr b/src/test/ui/pattern/issue-17718-patterns.stderr
index 109091c2a..109091c2a 100644
--- a/src/test/ui/issues/issue-17718-patterns.stderr
+++ b/src/test/ui/pattern/issue-17718-patterns.stderr
diff --git a/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr b/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr
index fef0f3c0e..f40642f30 100644
--- a/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr
+++ b/src/test/ui/pattern/issue-66270-pat-struct-parser-recovery.stderr
@@ -1,6 +1,8 @@
error: expected type, found `0`
--> $DIR/issue-66270-pat-struct-parser-recovery.rs:4:22
|
+LL | struct Bug {
+ | --- while parsing this struct
LL | incorrect_field: 0,
| ^ expected type
diff --git a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr b/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
index 5beca04d2..bac2db6ce 100644
--- a/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
+++ b/src/test/ui/pattern/move-ref-patterns/borrowck-move-ref-pattern.stderr
@@ -35,7 +35,7 @@ error[E0502]: cannot borrow `arr[..]` as mutable because it is also borrowed as
--> $DIR/borrowck-move-ref-pattern.rs:13:16
|
LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
- | ---------------- immutable borrow occurs here
+ | ----------- immutable borrow occurs here
...
LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
| ^^^^^^^^^^^ mutable borrow occurs here
@@ -47,7 +47,7 @@ error[E0505]: cannot move out of `arr[..]` because it is borrowed
--> $DIR/borrowck-move-ref-pattern.rs:13:29
|
LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
- | ---------------- borrow of `arr[..]` occurs here
+ | ----------- borrow of `arr[..]` occurs here
...
LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
| ^^^ move out of `arr[..]` occurs here
@@ -59,7 +59,7 @@ error[E0505]: cannot move out of `arr[..]` because it is borrowed
--> $DIR/borrowck-move-ref-pattern.rs:13:34
|
LL | let [ref _x0_hold, _x1, ref xs_hold @ ..] = arr;
- | ---------------- borrow of `arr[..]` occurs here
+ | ----------- borrow of `arr[..]` occurs here
...
LL | let [_, _, ref mut _x2, _x3, mut _x4] = arr;
| ^^^^^^^ move out of `arr[..]` occurs here
diff --git a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr
index d96e86393..eba65a618 100644
--- a/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr
+++ b/src/test/ui/pattern/move-ref-patterns/move-ref-patterns-closure-captures.stderr
@@ -8,7 +8,15 @@ LL | drop::<U>(_x1);
| --- closure is `FnOnce` because it moves the variable `_x1` out of its environment
...
LL | accept_fn_mut(&c1);
- | ------------- the requirement to implement `FnMut` derives from here
+ | ------------- --- the requirement to implement `FnMut` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `accept_fn_mut`
+ --> $DIR/move-ref-patterns-closure-captures.rs:4:31
+ |
+LL | fn accept_fn_mut(_: &impl FnMut()) {}
+ | ^^^^^^^ required by this bound in `accept_fn_mut`
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
--> $DIR/move-ref-patterns-closure-captures.rs:9:14
@@ -20,7 +28,15 @@ LL | drop::<U>(_x1);
| --- closure is `FnOnce` because it moves the variable `_x1` out of its environment
...
LL | accept_fn(&c1);
- | --------- the requirement to implement `Fn` derives from here
+ | --------- --- the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `accept_fn`
+ --> $DIR/move-ref-patterns-closure-captures.rs:5:27
+ |
+LL | fn accept_fn(_: &impl Fn()) {}
+ | ^^^^ required by this bound in `accept_fn`
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnMut`
--> $DIR/move-ref-patterns-closure-captures.rs:20:14
@@ -32,7 +48,15 @@ LL | drop::<&mut U>(_x2);
| --- closure is `FnMut` because it mutates the variable `_x2` here
...
LL | accept_fn(&c2);
- | --------- the requirement to implement `Fn` derives from here
+ | --------- --- the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `accept_fn`
+ --> $DIR/move-ref-patterns-closure-captures.rs:5:27
+ |
+LL | fn accept_fn(_: &impl Fn()) {}
+ | ^^^^ required by this bound in `accept_fn`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/pattern/rest-pat-semantic-disallowed.rs b/src/test/ui/pattern/rest-pat-semantic-disallowed.rs
index 84552f2e7..156285e0f 100644
--- a/src/test/ui/pattern/rest-pat-semantic-disallowed.rs
+++ b/src/test/ui/pattern/rest-pat-semantic-disallowed.rs
@@ -1,5 +1,5 @@
// Here we test that rest patterns, i.e. `..`, are not allowed
-// outside of slice (+ ident patterns witin those), tuple,
+// outside of slice (+ ident patterns within those), tuple,
// and tuple struct patterns and that duplicates are caught in these contexts.
#![feature(box_patterns)]
diff --git a/src/test/ui/pattern/rest-pat-syntactic.rs b/src/test/ui/pattern/rest-pat-syntactic.rs
index 9656a0b5d..4da5a2db7 100644
--- a/src/test/ui/pattern/rest-pat-syntactic.rs
+++ b/src/test/ui/pattern/rest-pat-syntactic.rs
@@ -19,6 +19,8 @@ fn rest_patterns() {
// Box patterns:
let box ..;
+ //~^ WARN box pattern syntax is experimental
+ //~| WARN unstable syntax
// In or-patterns:
match x {
@@ -57,7 +59,7 @@ fn rest_patterns() {
.. |
[
(
- box ..,
+ box .., //~ WARN box pattern syntax is experimental
&(..),
&mut ..,
x @ ..
@@ -67,4 +69,5 @@ fn rest_patterns() {
ref mut x @ ..
=> {}
}
+ //~| WARN unstable syntax
}
diff --git a/src/test/ui/pattern/rest-pat-syntactic.stderr b/src/test/ui/pattern/rest-pat-syntactic.stderr
new file mode 100644
index 000000000..37019b7d5
--- /dev/null
+++ b/src/test/ui/pattern/rest-pat-syntactic.stderr
@@ -0,0 +1,24 @@
+warning: box pattern syntax is experimental
+ --> $DIR/rest-pat-syntactic.rs:21:9
+ |
+LL | let box ..;
+ | ^^^^^^
+ |
+ = 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: box pattern syntax is experimental
+ --> $DIR/rest-pat-syntactic.rs:62:17
+ |
+LL | box ..,
+ | ^^^^^^
+ |
+ = 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: 2 warnings emitted
+
diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
new file mode 100644
index 000000000..b28dce881
--- /dev/null
+++ b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.fixed
@@ -0,0 +1,10 @@
+// run-rustfix
+
+fn main() {
+ match Some(1) { //~ ERROR non-exhaustive patterns: `None` not covered
+ Some(1) => {}
+ // hello
+ Some(_) => {}
+ None => todo!()
+ }
+}
diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs
new file mode 100644
index 000000000..42493a632
--- /dev/null
+++ b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.rs
@@ -0,0 +1,9 @@
+// run-rustfix
+
+fn main() {
+ match Some(1) { //~ ERROR non-exhaustive patterns: `None` not covered
+ Some(1) => {}
+ // hello
+ Some(_) => {}
+ }
+}
diff --git a/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
new file mode 100644
index 000000000..f3dca9bcb
--- /dev/null
+++ b/src/test/ui/pattern/suggest-adding-appropriate-missing-pattern-excluding-comments.stderr
@@ -0,0 +1,24 @@
+error[E0004]: non-exhaustive patterns: `None` not covered
+ --> $DIR/suggest-adding-appropriate-missing-pattern-excluding-comments.rs:4:11
+ |
+LL | match Some(1) {
+ | ^^^^^^^ pattern `None` not covered
+ |
+note: `Option<i32>` defined here
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub enum Option<T> {
+ | ------------------
+...
+LL | None,
+ | ^^^^ not covered
+ = 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 + None => todo!()
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0004`.
diff --git a/src/test/ui/pattern/usefulness/consts-opaque.stderr b/src/test/ui/pattern/usefulness/consts-opaque.stderr
index 05c009a6f..35396751a 100644
--- a/src/test/ui/pattern/usefulness/consts-opaque.stderr
+++ b/src/test/ui/pattern/usefulness/consts-opaque.stderr
@@ -40,9 +40,9 @@ warning: to use a constant of type `Foo` in a pattern, `Foo` must be annotated w
LL | FOO_REF_REF => {}
| ^^^^^^^^^^^
|
- = note: `#[warn(indirect_structural_match)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+ = note: `#[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)]`
--> $DIR/consts-opaque.rs:53:9
diff --git a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr b/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
index b97683526..cdb6b5c7a 100644
--- a/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
+++ b/src/test/ui/pattern/usefulness/deny-irrefutable-let-patterns.stderr
@@ -4,13 +4,13 @@ error: irrefutable `if let` pattern
LL | if let _ = 5 {}
| ^^^^^^^^^
|
+ = note: this pattern will always match, so the `if let` is useless
+ = help: consider replacing the `if let` with a `let`
note: the lint level is defined here
--> $DIR/deny-irrefutable-let-patterns.rs:3:9
|
LL | #![deny(irrefutable_let_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = note: this pattern will always match, so the `if let` is useless
- = help: consider replacing the `if let` with a `let`
error: irrefutable `while let` pattern
--> $DIR/deny-irrefutable-let-patterns.rs:8:11
diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs
index d968c48fb..5d4181a30 100644
--- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs
+++ b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.rs
@@ -22,22 +22,22 @@ fn main() {
HiddenEnum::A => {}
HiddenEnum::C => {}
}
- //~^^^^ non-exhaustive patterns: `B` not covered
+ //~^^^^ non-exhaustive patterns: `HiddenEnum::B` not covered
match HiddenEnum::A {
HiddenEnum::A => {}
}
- //~^^^ non-exhaustive patterns: `B` and `_` not covered
+ //~^^^ non-exhaustive patterns: `HiddenEnum::B` and `_` not covered
match None {
None => {}
Some(HiddenEnum::A) => {}
}
- //~^^^^ non-exhaustive patterns: `Some(B)` and `Some(_)` not covered
+ //~^^^^ non-exhaustive patterns: `Some(HiddenEnum::B)` and `Some(_)` not covered
match InCrate::A {
InCrate::A => {}
InCrate::B => {}
}
- //~^^^^ non-exhaustive patterns: `C` not covered
+ //~^^^^ non-exhaustive patterns: `InCrate::C` not covered
}
diff --git a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
index 643e734f9..b450a9aed 100644
--- a/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
+++ b/src/test/ui/pattern/usefulness/doc-hidden-non-exhaustive.stderr
@@ -16,11 +16,11 @@ LL ~ HiddenEnum::B => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `B` not covered
+error[E0004]: non-exhaustive patterns: `HiddenEnum::B` not covered
--> $DIR/doc-hidden-non-exhaustive.rs:21:11
|
LL | match HiddenEnum::A {
- | ^^^^^^^^^^^^^ pattern `B` not covered
+ | ^^^^^^^^^^^^^ pattern `HiddenEnum::B` not covered
|
note: `HiddenEnum` defined here
--> $DIR/auxiliary/hidden.rs:3:5
@@ -34,14 +34,14 @@ LL | B,
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 + B => todo!()
+LL + HiddenEnum::B => todo!()
|
-error[E0004]: non-exhaustive patterns: `B` and `_` not covered
+error[E0004]: non-exhaustive patterns: `HiddenEnum::B` and `_` not covered
--> $DIR/doc-hidden-non-exhaustive.rs:27:11
|
LL | match HiddenEnum::A {
- | ^^^^^^^^^^^^^ patterns `B` and `_` not covered
+ | ^^^^^^^^^^^^^ patterns `HiddenEnum::B` and `_` not covered
|
note: `HiddenEnum` defined here
--> $DIR/auxiliary/hidden.rs:3:5
@@ -55,14 +55,14 @@ LL | B,
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 + B | _ => todo!()
+LL + HiddenEnum::B | _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `Some(B)` and `Some(_)` not covered
+error[E0004]: non-exhaustive patterns: `Some(HiddenEnum::B)` and `Some(_)` not covered
--> $DIR/doc-hidden-non-exhaustive.rs:32:11
|
LL | match None {
- | ^^^^ patterns `Some(B)` and `Some(_)` not covered
+ | ^^^^ patterns `Some(HiddenEnum::B)` and `Some(_)` not covered
|
note: `Option<HiddenEnum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
@@ -76,14 +76,14 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] 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 ~ Some(HiddenEnum::A) => {}
-LL + Some(B) | Some(_) => todo!()
+LL + Some(HiddenEnum::B) | Some(_) => todo!()
|
-error[E0004]: non-exhaustive patterns: `C` not covered
+error[E0004]: non-exhaustive patterns: `InCrate::C` not covered
--> $DIR/doc-hidden-non-exhaustive.rs:38:11
|
LL | match InCrate::A {
- | ^^^^^^^^^^ pattern `C` not covered
+ | ^^^^^^^^^^ pattern `InCrate::C` not covered
|
note: `InCrate` defined here
--> $DIR/doc-hidden-non-exhaustive.rs:11:5
@@ -97,7 +97,7 @@ LL | C,
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 + C => todo!()
+LL + InCrate::C => todo!()
|
error: aborting due to 5 previous errors
diff --git a/src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr b/src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
index d31ee0dbd..5e12bc1d2 100644
--- a/src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
+++ b/src/test/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr
@@ -105,11 +105,11 @@ 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
-error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
--> $DIR/empty-match.rs:83:20
|
LL | match_no_arms!(NonEmptyEnum1::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
|
note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
@@ -121,11 +121,11 @@ 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
-error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
--> $DIR/empty-match.rs:84:20
|
LL | match_no_arms!(NonEmptyEnum2::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
|
note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
@@ -139,11 +139,11 @@ 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 or multiple match arms
-error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
--> $DIR/empty-match.rs:85:20
|
LL | match_no_arms!(NonEmptyEnum5::V1);
- | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
+ | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
|
note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
@@ -238,11 +238,11 @@ LL ~ _ if false => {}
LL + NonEmptyUnion2 { .. } => todo!()
|
-error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
--> $DIR/empty-match.rs:92:24
|
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
|
note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
@@ -255,14 +255,14 @@ LL | Foo(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 ~ _ if false => {}
-LL + Foo(_) => todo!()
+LL + NonEmptyEnum1::Foo(_) => todo!()
|
-error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
--> $DIR/empty-match.rs:93:24
|
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
|
note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
@@ -277,14 +277,14 @@ LL | Bar,
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 + Foo(_) | Bar => todo!()
+LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
|
-error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
--> $DIR/empty-match.rs:94:24
|
LL | match_guarded_arm!(NonEmptyEnum5::V1);
- | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
+ | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
|
note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
diff --git a/src/test/ui/pattern/usefulness/empty-match.normal.stderr b/src/test/ui/pattern/usefulness/empty-match.normal.stderr
index d31ee0dbd..5e12bc1d2 100644
--- a/src/test/ui/pattern/usefulness/empty-match.normal.stderr
+++ b/src/test/ui/pattern/usefulness/empty-match.normal.stderr
@@ -105,11 +105,11 @@ 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
-error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
--> $DIR/empty-match.rs:83:20
|
LL | match_no_arms!(NonEmptyEnum1::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
|
note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
@@ -121,11 +121,11 @@ 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
-error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
--> $DIR/empty-match.rs:84:20
|
LL | match_no_arms!(NonEmptyEnum2::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
|
note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
@@ -139,11 +139,11 @@ 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 or multiple match arms
-error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
--> $DIR/empty-match.rs:85:20
|
LL | match_no_arms!(NonEmptyEnum5::V1);
- | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
+ | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
|
note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
@@ -238,11 +238,11 @@ LL ~ _ if false => {}
LL + NonEmptyUnion2 { .. } => todo!()
|
-error[E0004]: non-exhaustive patterns: `Foo(_)` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered
--> $DIR/empty-match.rs:92:24
|
LL | match_guarded_arm!(NonEmptyEnum1::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo(_)` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered
|
note: `NonEmptyEnum1` defined here
--> $DIR/empty-match.rs:24:5
@@ -255,14 +255,14 @@ LL | Foo(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 ~ _ if false => {}
-LL + Foo(_) => todo!()
+LL + NonEmptyEnum1::Foo(_) => todo!()
|
-error[E0004]: non-exhaustive patterns: `Foo(_)` and `Bar` not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
--> $DIR/empty-match.rs:93:24
|
LL | match_guarded_arm!(NonEmptyEnum2::Foo(true));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `Foo(_)` and `Bar` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
|
note: `NonEmptyEnum2` defined here
--> $DIR/empty-match.rs:27:5
@@ -277,14 +277,14 @@ LL | Bar,
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 + Foo(_) | Bar => todo!()
+LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!()
|
-error[E0004]: non-exhaustive patterns: `V1`, `V2`, `V3` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
--> $DIR/empty-match.rs:94:24
|
LL | match_guarded_arm!(NonEmptyEnum5::V1);
- | ^^^^^^^^^^^^^^^^^ patterns `V1`, `V2`, `V3` and 2 more not covered
+ | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
|
note: `NonEmptyEnum5` defined here
--> $DIR/empty-match.rs:30:6
diff --git a/src/test/ui/pattern/usefulness/empty-match.rs b/src/test/ui/pattern/usefulness/empty-match.rs
index 8110ec013..9cdc0413b 100644
--- a/src/test/ui/pattern/usefulness/empty-match.rs
+++ b/src/test/ui/pattern/usefulness/empty-match.rs
@@ -80,16 +80,16 @@ fn main() {
match_no_arms!(NonEmptyStruct2(true)); //~ ERROR type `NonEmptyStruct2` is non-empty
match_no_arms!((NonEmptyUnion1 { foo: () })); //~ ERROR type `NonEmptyUnion1` is non-empty
match_no_arms!((NonEmptyUnion2 { foo: () })); //~ ERROR type `NonEmptyUnion2` is non-empty
- match_no_arms!(NonEmptyEnum1::Foo(true)); //~ ERROR `Foo(_)` not covered
- match_no_arms!(NonEmptyEnum2::Foo(true)); //~ ERROR `Foo(_)` and `Bar` not covered
- match_no_arms!(NonEmptyEnum5::V1); //~ ERROR `V1`, `V2`, `V3` and 2 more not covered
+ match_no_arms!(NonEmptyEnum1::Foo(true)); //~ ERROR `NonEmptyEnum1::Foo(_)` not covered
+ match_no_arms!(NonEmptyEnum2::Foo(true)); //~ ERROR `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
+ match_no_arms!(NonEmptyEnum5::V1); //~ ERROR `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
match_guarded_arm!(0u8); //~ ERROR `_` not covered
match_guarded_arm!(NonEmptyStruct1); //~ ERROR `NonEmptyStruct1` not covered
match_guarded_arm!(NonEmptyStruct2(true)); //~ ERROR `NonEmptyStruct2(_)` not covered
match_guarded_arm!((NonEmptyUnion1 { foo: () })); //~ ERROR `NonEmptyUnion1 { .. }` not covered
match_guarded_arm!((NonEmptyUnion2 { foo: () })); //~ ERROR `NonEmptyUnion2 { .. }` not covered
- match_guarded_arm!(NonEmptyEnum1::Foo(true)); //~ ERROR `Foo(_)` not covered
- match_guarded_arm!(NonEmptyEnum2::Foo(true)); //~ ERROR `Foo(_)` and `Bar` not covered
- match_guarded_arm!(NonEmptyEnum5::V1); //~ ERROR `V1`, `V2`, `V3` and 2 more not covered
+ match_guarded_arm!(NonEmptyEnum1::Foo(true)); //~ ERROR `NonEmptyEnum1::Foo(_)` not covered
+ match_guarded_arm!(NonEmptyEnum2::Foo(true)); //~ ERROR `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered
+ match_guarded_arm!(NonEmptyEnum5::V1); //~ ERROR `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered
}
diff --git a/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr b/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr
index 24c0419e1..ea0e8f6e4 100644
--- a/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr
+++ b/src/test/ui/pattern/usefulness/integer-ranges/overlapping_range_endpoints.stderr
@@ -6,12 +6,12 @@ LL | m!(0u8, 20..=30, 30..=40);
| |
| this range overlaps on `30_u8`...
|
+ = note: you likely meant to write mutually exclusive ranges
note: the lint level is defined here
--> $DIR/overlapping_range_endpoints.rs:2:9
|
LL | #![deny(overlapping_range_endpoints)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: you likely meant to write mutually exclusive ranges
error: multiple patterns overlap on their endpoints
--> $DIR/overlapping_range_endpoints.rs:16:22
diff --git a/src/test/ui/pattern/usefulness/issue-15129.rs b/src/test/ui/pattern/usefulness/issue-15129.rs
index d2b72a86b..f02e5c0c6 100644
--- a/src/test/ui/pattern/usefulness/issue-15129.rs
+++ b/src/test/ui/pattern/usefulness/issue-15129.rs
@@ -10,7 +10,7 @@ pub enum V {
fn main() {
match (T::T1(()), V::V2(true)) {
- //~^ ERROR non-exhaustive patterns: `(T1(()), V2(_))` and `(T2(()), V1(_))` not covered
+ //~^ ERROR non-exhaustive patterns: `(T::T1(()), V::V2(_))` and `(T::T2(()), V::V1(_))` not covered
(T::T1(()), V::V1(i)) => (),
(T::T2(()), V::V2(b)) => (),
}
diff --git a/src/test/ui/pattern/usefulness/issue-15129.stderr b/src/test/ui/pattern/usefulness/issue-15129.stderr
index af60f3ff5..ee8410b76 100644
--- a/src/test/ui/pattern/usefulness/issue-15129.stderr
+++ b/src/test/ui/pattern/usefulness/issue-15129.stderr
@@ -1,14 +1,14 @@
-error[E0004]: non-exhaustive patterns: `(T1(()), V2(_))` and `(T2(()), V1(_))` not covered
+error[E0004]: non-exhaustive patterns: `(T::T1(()), V::V2(_))` and `(T::T2(()), V::V1(_))` not covered
--> $DIR/issue-15129.rs:12:11
|
LL | match (T::T1(()), V::V2(true)) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `(T1(()), V2(_))` and `(T2(()), V1(_))` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `(T::T1(()), V::V2(_))` and `(T::T2(()), V::V1(_))` not covered
|
= note: the matched value is of type `(T, V)`
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::T2(()), V::V2(b)) => (),
-LL ~ (T1(()), V2(_)) | (T2(()), V1(_)) => todo!(),
+LL ~ (T::T1(()), V::V2(_)) | (T::T2(()), V::V1(_)) => todo!(),
|
error: aborting due to previous error
diff --git a/src/test/ui/pattern/usefulness/issue-31561.rs b/src/test/ui/pattern/usefulness/issue-31561.rs
index 813b2409c..5b878851a 100644
--- a/src/test/ui/pattern/usefulness/issue-31561.rs
+++ b/src/test/ui/pattern/usefulness/issue-31561.rs
@@ -6,5 +6,5 @@ enum Thing {
fn main() {
let Thing::Foo(y) = Thing::Foo(1);
- //~^ ERROR refutable pattern in local binding: `Bar` and `Baz` not covered
+ //~^ ERROR refutable pattern in local binding: `Thing::Bar` and `Thing::Baz` not covered
}
diff --git a/src/test/ui/pattern/usefulness/issue-31561.stderr b/src/test/ui/pattern/usefulness/issue-31561.stderr
index 9da6b5eee..20f2f0950 100644
--- a/src/test/ui/pattern/usefulness/issue-31561.stderr
+++ b/src/test/ui/pattern/usefulness/issue-31561.stderr
@@ -1,8 +1,8 @@
-error[E0005]: refutable pattern in local binding: `Bar` and `Baz` not covered
+error[E0005]: refutable pattern in local binding: `Thing::Bar` and `Thing::Baz` not covered
--> $DIR/issue-31561.rs:8:9
|
LL | let Thing::Foo(y) = Thing::Foo(1);
- | ^^^^^^^^^^^^^ patterns `Bar` and `Baz` not covered
+ | ^^^^^^^^^^^^^ patterns `Thing::Bar` and `Thing::Baz` 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
@@ -21,7 +21,7 @@ help: you might want to use `if let` to ignore the variants that aren't matched
|
LL | let y = if let Thing::Foo(y) = Thing::Foo(1) { y } else { todo!() };
| ++++++++++ ++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variants that aren't matched
+help: alternatively, you might want to use let else to handle the variants that aren't matched
|
LL | let Thing::Foo(y) = Thing::Foo(1) else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/pattern/usefulness/issue-35609.stderr b/src/test/ui/pattern/usefulness/issue-35609.stderr
index 2247b818d..c9781d52e 100644
--- a/src/test/ui/pattern/usefulness/issue-35609.stderr
+++ b/src/test/ui/pattern/usefulness/issue-35609.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `(Enum::B, _)`, `(Enum::C, _)`, `(Enum::D, _)` and 2 more not covered
--> $DIR/issue-35609.rs:10:11
|
LL | match (A, ()) {
- | ^^^^^^^ patterns `(B, _)`, `(C, _)`, `(D, _)` and 2 more not covered
+ | ^^^^^^^ patterns `(Enum::B, _)`, `(Enum::C, _)`, `(Enum::D, _)` and 2 more not covered
|
= 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
@@ -11,11 +11,11 @@ LL ~ (A, _) => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `(_, Enum::B)`, `(_, Enum::C)`, `(_, Enum::D)` and 2 more not covered
--> $DIR/issue-35609.rs:14:11
|
LL | match (A, A) {
- | ^^^^^^ patterns `(_, B)`, `(_, C)`, `(_, D)` and 2 more not covered
+ | ^^^^^^ patterns `(_, Enum::B)`, `(_, Enum::C)`, `(_, Enum::D)` and 2 more not covered
|
= 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
@@ -24,11 +24,11 @@ LL ~ (_, A) => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `((Enum::B, _), _)`, `((Enum::C, _), _)`, `((Enum::D, _), _)` and 2 more not covered
--> $DIR/issue-35609.rs:18:11
|
LL | match ((A, ()), ()) {
- | ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
+ | ^^^^^^^^^^^^^ patterns `((Enum::B, _), _)`, `((Enum::C, _), _)`, `((Enum::D, _), _)` and 2 more not covered
|
= 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
@@ -37,11 +37,11 @@ LL ~ ((A, ()), _) => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `((Enum::B, _), _)`, `((Enum::C, _), _)`, `((Enum::D, _), _)` and 2 more not covered
--> $DIR/issue-35609.rs:22:11
|
LL | match ((A, ()), A) {
- | ^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
+ | ^^^^^^^^^^^^ patterns `((Enum::B, _), _)`, `((Enum::C, _), _)`, `((Enum::D, _), _)` and 2 more not covered
|
= 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
@@ -50,11 +50,11 @@ LL ~ ((A, ()), _) => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `((Enum::B, _), _)`, `((Enum::C, _), _)`, `((Enum::D, _), _)` and 2 more not covered
--> $DIR/issue-35609.rs:26:11
|
LL | match ((A, ()), ()) {
- | ^^^^^^^^^^^^^ patterns `((B, _), _)`, `((C, _), _)`, `((D, _), _)` and 2 more not covered
+ | ^^^^^^^^^^^^^ patterns `((Enum::B, _), _)`, `((Enum::C, _), _)`, `((Enum::D, _), _)` and 2 more not covered
|
= 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
@@ -63,11 +63,11 @@ LL ~ ((A, _), _) => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `S(Enum::B, _)`, `S(Enum::C, _)`, `S(Enum::D, _)` and 2 more not covered
--> $DIR/issue-35609.rs:31:11
|
LL | match S(A, ()) {
- | ^^^^^^^^ patterns `S(B, _)`, `S(C, _)`, `S(D, _)` and 2 more not covered
+ | ^^^^^^^^ patterns `S(Enum::B, _)`, `S(Enum::C, _)`, `S(Enum::D, _)` and 2 more not covered
|
note: `S` defined here
--> $DIR/issue-35609.rs:6:8
@@ -81,11 +81,11 @@ LL ~ S(A, _) => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `Sd { x: Enum::B, .. }`, `Sd { x: Enum::C, .. }`, `Sd { x: Enum::D, .. }` and 2 more not covered
--> $DIR/issue-35609.rs:35:11
|
LL | match (Sd { x: A, y: () }) {
- | ^^^^^^^^^^^^^^^^^^^^ patterns `Sd { x: B, .. }`, `Sd { x: C, .. }`, `Sd { x: D, .. }` and 2 more not covered
+ | ^^^^^^^^^^^^^^^^^^^^ patterns `Sd { x: Enum::B, .. }`, `Sd { x: Enum::C, .. }`, `Sd { x: Enum::D, .. }` and 2 more not covered
|
note: `Sd` defined here
--> $DIR/issue-35609.rs:7:8
@@ -99,11 +99,11 @@ LL ~ Sd { x: A, y: _ } => {}
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `Some(Enum::B)`, `Some(Enum::C)`, `Some(Enum::D)` and 2 more not covered
--> $DIR/issue-35609.rs:39:11
|
LL | match Some(A) {
- | ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
+ | ^^^^^^^ patterns `Some(Enum::B)`, `Some(Enum::C)`, `Some(Enum::D)` and 2 more not covered
|
note: `Option<Enum>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
diff --git a/src/test/ui/pattern/usefulness/issue-39362.stderr b/src/test/ui/pattern/usefulness/issue-39362.stderr
index ca37af6fb..b8b17918a 100644
--- a/src/test/ui/pattern/usefulness/issue-39362.stderr
+++ b/src/test/ui/pattern/usefulness/issue-39362.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered
+error[E0004]: non-exhaustive patterns: `Foo::Bar { bar: Bar::C, .. }`, `Foo::Bar { bar: Bar::D, .. }`, `Foo::Bar { bar: Bar::E, .. }` and 1 more not covered
--> $DIR/issue-39362.rs:10:11
|
LL | match f {
- | ^ patterns `Bar { bar: C, .. }`, `Bar { bar: D, .. }`, `Bar { bar: E, .. }` and 1 more not covered
+ | ^ patterns `Foo::Bar { bar: Bar::C, .. }`, `Foo::Bar { bar: Bar::D, .. }`, `Foo::Bar { bar: Bar::E, .. }` and 1 more not covered
|
note: `Foo` defined here
--> $DIR/issue-39362.rs:2:5
diff --git a/src/test/ui/pattern/usefulness/issue-40221.stderr b/src/test/ui/pattern/usefulness/issue-40221.stderr
index c477e4353..4973e42b0 100644
--- a/src/test/ui/pattern/usefulness/issue-40221.stderr
+++ b/src/test/ui/pattern/usefulness/issue-40221.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `C(QA)` not covered
+error[E0004]: non-exhaustive patterns: `P::C(PC::QA)` not covered
--> $DIR/issue-40221.rs:11:11
|
LL | match proto {
- | ^^^^^ pattern `C(QA)` not covered
+ | ^^^^^ pattern `P::C(PC::QA)` not covered
|
note: `P` defined here
--> $DIR/issue-40221.rs:2:5
@@ -15,7 +15,7 @@ LL | C(PC),
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 ~ P::C(PC::Q) => (),
-LL ~ C(QA) => todo!(),
+LL ~ P::C(PC::QA) => todo!(),
|
error: aborting due to previous error
diff --git a/src/test/ui/pattern/usefulness/issue-50900.rs b/src/test/ui/pattern/usefulness/issue-50900.rs
index 27135af95..9cc760e9a 100644
--- a/src/test/ui/pattern/usefulness/issue-50900.rs
+++ b/src/test/ui/pattern/usefulness/issue-50900.rs
@@ -13,7 +13,7 @@ impl Tag {
fn main() {
match Tag::ExifIFDPointer {
- //~^ ERROR: non-exhaustive patterns: `Tag(Exif, _)` not covered
+ //~^ ERROR: non-exhaustive patterns: `Tag(Context::Exif, _)` not covered
Tag::ExifIFDPointer => {}
}
}
diff --git a/src/test/ui/pattern/usefulness/issue-50900.stderr b/src/test/ui/pattern/usefulness/issue-50900.stderr
index 2bdbecabb..348246d28 100644
--- a/src/test/ui/pattern/usefulness/issue-50900.stderr
+++ b/src/test/ui/pattern/usefulness/issue-50900.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `Tag(Exif, _)` not covered
+error[E0004]: non-exhaustive patterns: `Tag(Context::Exif, _)` not covered
--> $DIR/issue-50900.rs:15:11
|
LL | match Tag::ExifIFDPointer {
- | ^^^^^^^^^^^^^^^^^^^ pattern `Tag(Exif, _)` not covered
+ | ^^^^^^^^^^^^^^^^^^^ pattern `Tag(Context::Exif, _)` not covered
|
note: `Tag` defined here
--> $DIR/issue-50900.rs:2:12
@@ -13,7 +13,7 @@ LL | pub struct Tag(pub Context, pub u16);
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(Exif, _) => todo!()
+LL + Tag(Context::Exif, _) => todo!()
|
error: aborting due to previous error
diff --git a/src/test/ui/pattern/usefulness/issue-56379.rs b/src/test/ui/pattern/usefulness/issue-56379.rs
index 9bccccca9..097cf98d0 100644
--- a/src/test/ui/pattern/usefulness/issue-56379.rs
+++ b/src/test/ui/pattern/usefulness/issue-56379.rs
@@ -6,7 +6,7 @@ enum Foo {
fn main() {
match Foo::A(true) {
- //~^ ERROR non-exhaustive patterns: `A(false)`, `B(false)` and `C(false)` not covered
+ //~^ ERROR non-exhaustive patterns: `Foo::A(false)`, `Foo::B(false)` and `Foo::C(false)` not covered
Foo::A(true) => {}
Foo::B(true) => {}
Foo::C(true) => {}
diff --git a/src/test/ui/pattern/usefulness/issue-56379.stderr b/src/test/ui/pattern/usefulness/issue-56379.stderr
index f6261001c..6eed6bfae 100644
--- a/src/test/ui/pattern/usefulness/issue-56379.stderr
+++ b/src/test/ui/pattern/usefulness/issue-56379.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `A(false)`, `B(false)` and `C(false)` not covered
+error[E0004]: non-exhaustive patterns: `Foo::A(false)`, `Foo::B(false)` and `Foo::C(false)` not covered
--> $DIR/issue-56379.rs:8:11
|
LL | match Foo::A(true) {
- | ^^^^^^^^^^^^ patterns `A(false)`, `B(false)` and `C(false)` not covered
+ | ^^^^^^^^^^^^ patterns `Foo::A(false)`, `Foo::B(false)` and `Foo::C(false)` not covered
|
note: `Foo` defined here
--> $DIR/issue-56379.rs:2:5
@@ -19,7 +19,7 @@ LL | C(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 ~ Foo::C(true) => {}
-LL + A(false) | B(false) | C(false) => todo!()
+LL + Foo::A(false) | Foo::B(false) | Foo::C(false) => todo!()
|
error: aborting due to previous error
diff --git a/src/test/ui/pattern/usefulness/issue-72377.rs b/src/test/ui/pattern/usefulness/issue-72377.rs
index b0d8a53ed..b5ad3075c 100644
--- a/src/test/ui/pattern/usefulness/issue-72377.rs
+++ b/src/test/ui/pattern/usefulness/issue-72377.rs
@@ -6,7 +6,7 @@ fn main() {
let y = Some(X::A);
match (x, y) {
- //~^ ERROR non-exhaustive patterns: `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2
+ //~^ ERROR non-exhaustive patterns: `(X::A, Some(X::A))`, `(X::A, Some(X::B))`, `(X::B, Some(X::B))` and 2
//~| more not covered
(_, None) => false,
(v, Some(w)) if v == w => true,
diff --git a/src/test/ui/pattern/usefulness/issue-72377.stderr b/src/test/ui/pattern/usefulness/issue-72377.stderr
index 20f002dd3..123dd051d 100644
--- a/src/test/ui/pattern/usefulness/issue-72377.stderr
+++ b/src/test/ui/pattern/usefulness/issue-72377.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2 more not covered
+error[E0004]: non-exhaustive patterns: `(X::A, Some(X::A))`, `(X::A, Some(X::B))`, `(X::B, Some(X::B))` and 2 more not covered
--> $DIR/issue-72377.rs:8:11
|
LL | match (x, y) {
- | ^^^^^^ patterns `(A, Some(A))`, `(A, Some(B))`, `(B, Some(B))` and 2 more not covered
+ | ^^^^^^ patterns `(X::A, Some(X::A))`, `(X::A, Some(X::B))`, `(X::B, Some(X::B))` and 2 more not covered
|
= note: the matched value is of type `(X, Option<X>)`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms
diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.rs b/src/test/ui/pattern/usefulness/match-arm-statics-2.rs
index 4c5f2d356..3c9c16561 100644
--- a/src/test/ui/pattern/usefulness/match-arm-statics-2.rs
+++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.rs
@@ -27,7 +27,7 @@ const EAST: Direction = East;
fn nonexhaustive_2() {
match Some(Some(North)) {
- //~^ ERROR non-exhaustive patterns: `Some(Some(West))` not covered
+ //~^ ERROR non-exhaustive patterns: `Some(Some(Direction::West))` not covered
Some(NONE) => (),
Some(Some(North)) => (),
Some(Some(EAST)) => (),
@@ -46,7 +46,7 @@ const STATIC_FOO: Foo = Foo { bar: None, baz: NEW_FALSE };
fn nonexhaustive_3() {
match (Foo { bar: Some(North), baz: NewBool(true) }) {
- //~^ ERROR non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }`
+ //~^ ERROR non-exhaustive patterns: `Foo { bar: Some(Direction::North), baz: NewBool(true) }`
Foo { bar: None, baz: NewBool(true) } => (),
Foo { bar: _, baz: NEW_FALSE } => (),
Foo { bar: Some(West), baz: NewBool(true) } => (),
diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr
index a2b66f5ed..b0d7fe5eb 100644
--- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr
+++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr
@@ -11,11 +11,11 @@ LL ~ (false, true) => (),
LL + (true, false) => todo!()
|
-error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered
+error[E0004]: non-exhaustive patterns: `Some(Some(Direction::West))` not covered
--> $DIR/match-arm-statics-2.rs:29:11
|
LL | match Some(Some(North)) {
- | ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered
+ | ^^^^^^^^^^^^^^^^^ pattern `Some(Some(Direction::West))` not covered
|
note: `Option<Option<Direction>>` defined here
--> $SRC_DIR/core/src/option.rs:LL:COL
@@ -32,14 +32,14 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] 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 ~ None => (),
-LL + Some(Some(West)) => todo!()
+LL + Some(Some(Direction::West)) => todo!()
|
-error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered
+error[E0004]: non-exhaustive patterns: `Foo { bar: Some(Direction::North), baz: NewBool(true) }` not covered
--> $DIR/match-arm-statics-2.rs:48:11
|
LL | match (Foo { bar: Some(North), baz: NewBool(true) }) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { bar: Some(North), baz: NewBool(true) }` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { bar: Some(Direction::North), baz: NewBool(true) }` not covered
|
note: `Foo` defined here
--> $DIR/match-arm-statics-2.rs:40:8
@@ -50,7 +50,7 @@ LL | struct 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 { bar: Some(EAST), .. } => (),
-LL + Foo { bar: Some(North), baz: NewBool(true) } => todo!()
+LL + Foo { bar: Some(Direction::North), baz: NewBool(true) } => todo!()
|
error: aborting due to 3 previous errors
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.rs b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.rs
index 2e15bc2d2..af42fc1ae 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.rs
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.rs
@@ -35,43 +35,43 @@ enum E {
fn by_val(e: E) {
let e1 = e.clone();
- match e1 { //~ ERROR non-exhaustive patterns: `B` and `C` not covered
- //~^ NOTE patterns `B` and `C` not covered
+ match e1 { //~ ERROR non-exhaustive patterns: `E::B` and `E::C` not covered
+ //~^ NOTE patterns `E::B` and `E::C` not covered
//~| NOTE the matched value is of type `E`
E::A => {}
}
- let E::A = e; //~ ERROR refutable pattern in local binding: `B` and `C` not covered
- //~^ NOTE patterns `B` and `C` not covered
+ let E::A = e; //~ ERROR refutable pattern in local binding: `E::B` and `E::C` not covered
+ //~^ NOTE patterns `E::B` and `E::C` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
//~| NOTE the matched value is of type `E`
}
fn by_ref_once(e: &E) {
- match e { //~ ERROR non-exhaustive patterns: `&B` and `&C` not covered
- //~^ NOTE patterns `&B` and `&C` not covered
+ match e { //~ ERROR non-exhaustive patterns: `&E::B` and `&E::C` not covered
+ //~^ NOTE patterns `&E::B` and `&E::C` not covered
//~| NOTE the matched value is of type `&E`
E::A => {}
}
- let E::A = e; //~ ERROR refutable pattern in local binding: `&B` and `&C` not covered
- //~^ NOTE patterns `&B` and `&C` not covered
+ let E::A = e; //~ ERROR refutable pattern in local binding: `&E::B` and `&E::C` not covered
+ //~^ NOTE patterns `&E::B` and `&E::C` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
//~| NOTE the matched value is of type `&E`
}
fn by_ref_thrice(e: & &mut &E) {
- match e { //~ ERROR non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
- //~^ NOTE patterns `&&mut &B` and `&&mut &C` not covered
+ match e { //~ ERROR non-exhaustive patterns: `&&mut &E::B` and `&&mut &E::C` not covered
+ //~^ NOTE patterns `&&mut &E::B` and `&&mut &E::C` not covered
//~| NOTE the matched value is of type `&&mut &E`
E::A => {}
}
let E::A = e;
- //~^ ERROR refutable pattern in local binding: `&&mut &B` and `&&mut &C` not covered
- //~| NOTE patterns `&&mut &B` and `&&mut &C` not covered
+ //~^ ERROR refutable pattern in local binding: `&&mut &E::B` and `&&mut &E::C` not covered
+ //~| NOTE patterns `&&mut &E::B` and `&&mut &E::C` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
//~| NOTE the matched value is of type `&&mut &E`
@@ -89,15 +89,15 @@ enum Opt {
}
fn ref_pat(e: Opt) {
- match e {//~ ERROR non-exhaustive patterns: `None` not covered
- //~^ NOTE pattern `None` not covered
+ match e {//~ ERROR non-exhaustive patterns: `Opt::None` not covered
+ //~^ NOTE pattern `Opt::None` not covered
//~| NOTE the matched value is of type `Opt`
Opt::Some(ref _x) => {}
}
- let Opt::Some(ref _x) = e; //~ ERROR refutable pattern in local binding: `None` not covered
+ let Opt::Some(ref _x) = e; //~ ERROR refutable pattern in local binding: `Opt::None` not covered
//~^ NOTE the matched value is of type `Opt`
- //~| NOTE pattern `None` not covered
+ //~| NOTE pattern `Opt::None` not covered
//~| NOTE `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with
//~| NOTE for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
}
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
index 0f06c31c4..678c9b2ab 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-defined-here.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `B` and `C` not covered
+error[E0004]: non-exhaustive patterns: `E::B` and `E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:38:11
|
LL | match e1 {
- | ^^ patterns `B` and `C` not covered
+ | ^^ patterns `E::B` and `E::C` not covered
|
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
@@ -19,14 +19,14 @@ LL | C
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 + B | C => todo!()
+LL + E::B | E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `B` and `C` not covered
+error[E0005]: refutable pattern in local binding: `E::B` and `E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:44:9
|
LL | let E::A = e;
- | ^^^^ patterns `B` and `C` not covered
+ | ^^^^ patterns `E::B` and `E::C` 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
@@ -47,11 +47,11 @@ help: you might want to use `if let` to ignore the variants that aren't matched
LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
-error[E0004]: non-exhaustive patterns: `&B` and `&C` not covered
+error[E0004]: non-exhaustive patterns: `&E::B` and `&E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:52:11
|
LL | match e {
- | ^ patterns `&B` and `&C` not covered
+ | ^ patterns `&E::B` and `&E::C` not covered
|
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
@@ -68,14 +68,14 @@ LL | C
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 + &B | &C => todo!()
+LL + &E::B | &E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `&B` and `&C` not covered
+error[E0005]: refutable pattern in local binding: `&E::B` and `&E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:58:9
|
LL | let E::A = e;
- | ^^^^ patterns `&B` and `&C` not covered
+ | ^^^^ patterns `&E::B` and `&E::C` 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
@@ -96,11 +96,11 @@ help: you might want to use `if let` to ignore the variants that aren't matched
LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
-error[E0004]: non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
+error[E0004]: non-exhaustive patterns: `&&mut &E::B` and `&&mut &E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:66:11
|
LL | match e {
- | ^ patterns `&&mut &B` and `&&mut &C` not covered
+ | ^ patterns `&&mut &E::B` and `&&mut &E::C` not covered
|
note: `E` defined here
--> $DIR/non-exhaustive-defined-here.rs:14:5
@@ -117,14 +117,14 @@ LL | C
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 + &&mut &B | &&mut &C => todo!()
+LL + &&mut &E::B | &&mut &E::C => todo!()
|
-error[E0005]: refutable pattern in local binding: `&&mut &B` and `&&mut &C` not covered
+error[E0005]: refutable pattern in local binding: `&&mut &E::B` and `&&mut &E::C` not covered
--> $DIR/non-exhaustive-defined-here.rs:72:9
|
LL | let E::A = e;
- | ^^^^ patterns `&&mut &B` and `&&mut &C` not covered
+ | ^^^^ patterns `&&mut &E::B` and `&&mut &E::C` 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
@@ -145,11 +145,11 @@ help: you might want to use `if let` to ignore the variants that aren't matched
LL | if let E::A = e { todo!() }
| ++ ~~~~~~~~~~~
-error[E0004]: non-exhaustive patterns: `None` not covered
+error[E0004]: non-exhaustive patterns: `Opt::None` not covered
--> $DIR/non-exhaustive-defined-here.rs:92:11
|
LL | match e {
- | ^ pattern `None` not covered
+ | ^ pattern `Opt::None` not covered
|
note: `Opt` defined here
--> $DIR/non-exhaustive-defined-here.rs:84:5
@@ -163,14 +163,14 @@ LL | None,
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 + None => todo!()
+LL + Opt::None => todo!()
|
-error[E0005]: refutable pattern in local binding: `None` not covered
+error[E0005]: refutable pattern in local binding: `Opt::None` not covered
--> $DIR/non-exhaustive-defined-here.rs:98:9
|
LL | let Opt::Some(ref _x) = e;
- | ^^^^^^^^^^^^^^^^^ pattern `None` not covered
+ | ^^^^^^^^^^^^^^^^^ pattern `Opt::None` 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
@@ -187,7 +187,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let _x = if let Opt::Some(ref _x) = e { _x } else { todo!() };
| +++++++++++ +++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+help: alternatively, you might want to use let else to handle the variant that isn't matched
|
LL | let Opt::Some(ref _x) = e else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs
index d19814479..69c3c7658 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.rs
@@ -12,7 +12,7 @@ fn match_nested_vecs<'a, T>(l1: Option<&'a [T]>, l2: Result<&'a [T], ()>) -> &'s
fn main() {
let x = T::A(U::C);
- match x { //~ ERROR non-exhaustive patterns: `A(C)` not covered
+ match x { //~ ERROR non-exhaustive patterns: `T::A(U::C)` not covered
T::A(U::D) => { panic!("hello"); }
T::B => { panic!("goodbye"); }
}
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
index cbbd544f9..44f327421 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-match-nested.stderr
@@ -11,11 +11,11 @@ LL ~ (None, Ok(&[_, _, ..])) => "None, Ok(at least two elements)",
LL + (Some(&[]), Err(_)) => todo!()
|
-error[E0004]: non-exhaustive patterns: `A(C)` not covered
+error[E0004]: non-exhaustive patterns: `T::A(U::C)` not covered
--> $DIR/non-exhaustive-match-nested.rs:15:11
|
LL | match x {
- | ^ pattern `A(C)` not covered
+ | ^ pattern `T::A(U::C)` not covered
|
note: `T` defined here
--> $DIR/non-exhaustive-match-nested.rs:1:10
@@ -26,7 +26,7 @@ LL | enum T { A(U), B }
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 + A(C) => todo!()
+LL + T::A(U::C) => todo!()
|
error: aborting due to 2 previous errors
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.rs b/src/test/ui/pattern/usefulness/non-exhaustive-match.rs
index 4ff12aa2f..1cb58b8ce 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match.rs
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.rs
@@ -4,7 +4,7 @@ enum T { A, B }
fn main() {
let x = T::A;
- match x { T::B => { } } //~ ERROR non-exhaustive patterns: `A` not covered
+ match x { T::B => { } } //~ ERROR non-exhaustive patterns: `T::A` not covered
match true { //~ ERROR non-exhaustive patterns: `false` not covered
true => {}
}
@@ -15,11 +15,11 @@ fn main() {
// and `(_, _, 5_i32..=i32::MAX)` not covered
(_, _, 4) => {}
}
- match (T::A, T::A) { //~ ERROR non-exhaustive patterns: `(A, A)` and `(B, B)` not covered
+ match (T::A, T::A) { //~ ERROR non-exhaustive patterns: `(T::A, T::A)` and `(T::B, T::B)` not covered
(T::A, T::B) => {}
(T::B, T::A) => {}
}
- match T::A { //~ ERROR non-exhaustive patterns: `B` not covered
+ match T::A { //~ ERROR non-exhaustive patterns: `T::B` not covered
T::A => {}
}
// This is exhaustive, though the algorithm got it wrong at one point
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
index f2362c316..4234600d0 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `A` not covered
+error[E0004]: non-exhaustive patterns: `T::A` not covered
--> $DIR/non-exhaustive-match.rs:7:11
|
LL | match x { T::B => { } }
- | ^ pattern `A` not covered
+ | ^ pattern `T::A` not covered
|
note: `T` defined here
--> $DIR/non-exhaustive-match.rs:3:10
@@ -12,8 +12,8 @@ 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 | match x { T::B => { }, A => todo!() }
- | ++++++++++++++
+LL | match x { T::B => { }, T::A => todo!() }
+ | +++++++++++++++++
error[E0004]: non-exhaustive patterns: `false` not covered
--> $DIR/non-exhaustive-match.rs:8:11
@@ -62,24 +62,24 @@ LL ~ (_, _, 4) => {}
LL + (_, _, i32::MIN..=3_i32) | (_, _, 5_i32..=i32::MAX) => todo!()
|
-error[E0004]: non-exhaustive patterns: `(A, A)` and `(B, B)` not covered
+error[E0004]: non-exhaustive patterns: `(T::A, T::A)` and `(T::B, T::B)` not covered
--> $DIR/non-exhaustive-match.rs:18:11
|
LL | match (T::A, T::A) {
- | ^^^^^^^^^^^^ patterns `(A, A)` and `(B, B)` not covered
+ | ^^^^^^^^^^^^ patterns `(T::A, T::A)` and `(T::B, T::B)` not covered
|
= 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 + (A, A) | (B, B) => todo!()
+LL + (T::A, T::A) | (T::B, T::B) => todo!()
|
-error[E0004]: non-exhaustive patterns: `B` not covered
+error[E0004]: non-exhaustive patterns: `T::B` not covered
--> $DIR/non-exhaustive-match.rs:22:11
|
LL | match T::A {
- | ^^^^ pattern `B` not covered
+ | ^^^^ pattern `T::B` not covered
|
note: `T` defined here
--> $DIR/non-exhaustive-match.rs:3:13
@@ -90,7 +90,7 @@ LL | enum T { A, B }
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 + B => todo!()
+LL + T::B => todo!()
|
error[E0004]: non-exhaustive patterns: `[]` not covered
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs b/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs
index abb4ea8da..4bd344219 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.rs
@@ -21,7 +21,7 @@ enum Color {
fn enum_with_single_missing_variant() {
match Color::Red {
- //~^ ERROR non-exhaustive patterns: `Red` not covered
+ //~^ ERROR non-exhaustive patterns: `Color::Red` not covered
Color::CustomRGBA { .. } => (),
Color::Green => ()
}
@@ -33,7 +33,7 @@ enum Direction {
fn enum_with_multiple_missing_variants() {
match Direction::North {
- //~^ ERROR non-exhaustive patterns: `East`, `South` and `West` not covered
+ //~^ ERROR non-exhaustive patterns: `Direction::East`, `Direction::South` and `Direction::West` not covered
Direction::North => ()
}
}
@@ -44,7 +44,7 @@ enum ExcessiveEnum {
fn enum_with_excessive_missing_variants() {
match ExcessiveEnum::First {
- //~^ ERROR `Second`, `Third`, `Fourth` and 8 more not covered
+ //~^ ERROR `ExcessiveEnum::Second`, `ExcessiveEnum::Third`, `ExcessiveEnum::Fourth` and 8 more not covered
ExcessiveEnum::First => ()
}
@@ -52,7 +52,7 @@ fn enum_with_excessive_missing_variants() {
fn enum_struct_variant() {
match Color::Red {
- //~^ ERROR non-exhaustive patterns: `CustomRGBA { a: true, .. }` not covered
+ //~^ ERROR non-exhaustive patterns: `Color::CustomRGBA { a: true, .. }` not covered
Color::Red => (),
Color::Green => (),
Color::CustomRGBA { a: false, r: _, g: _, b: 0 } => (),
@@ -68,7 +68,7 @@ enum Enum {
fn vectors_with_nested_enums() {
let x: &'static [Enum] = &[Enum::First, Enum::Second(false)];
match *x {
- //~^ ERROR non-exhaustive patterns: `[Second(true), Second(false)]` not covered
+ //~^ ERROR non-exhaustive patterns: `[Enum::Second(true), Enum::Second(false)]` not covered
[] => (),
[_] => (),
[Enum::First, _] => (),
diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr
index b0cfd631f..b8af566de 100644
--- a/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr
+++ b/src/test/ui/pattern/usefulness/non-exhaustive-pattern-witness.stderr
@@ -16,11 +16,11 @@ LL ~ Foo { first: false, second: Some([1, 2, 3, 4]) } => (),
LL + Foo { first: false, second: Some([_, _, _, _]) } => todo!()
|
-error[E0004]: non-exhaustive patterns: `Red` not covered
+error[E0004]: non-exhaustive patterns: `Color::Red` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:23:11
|
LL | match Color::Red {
- | ^^^^^^^^^^ pattern `Red` not covered
+ | ^^^^^^^^^^ pattern `Color::Red` not covered
|
note: `Color` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:17:5
@@ -33,14 +33,14 @@ LL | Red,
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 ~ Color::Green => (),
-LL + Red => todo!()
+LL + Color::Red => todo!()
|
-error[E0004]: non-exhaustive patterns: `East`, `South` and `West` not covered
+error[E0004]: non-exhaustive patterns: `Direction::East`, `Direction::South` and `Direction::West` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:35:11
|
LL | match Direction::North {
- | ^^^^^^^^^^^^^^^^ patterns `East`, `South` and `West` not covered
+ | ^^^^^^^^^^^^^^^^ patterns `Direction::East`, `Direction::South` and `Direction::West` not covered
|
note: `Direction` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:31:12
@@ -56,14 +56,14 @@ LL | North, East, South, West
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 ~ Direction::North => (),
-LL + East | South | West => todo!()
+LL + Direction::East | Direction::South | Direction::West => todo!()
|
-error[E0004]: non-exhaustive patterns: `Second`, `Third`, `Fourth` and 8 more not covered
+error[E0004]: non-exhaustive patterns: `ExcessiveEnum::Second`, `ExcessiveEnum::Third`, `ExcessiveEnum::Fourth` and 8 more not covered
--> $DIR/non-exhaustive-pattern-witness.rs:46:11
|
LL | match ExcessiveEnum::First {
- | ^^^^^^^^^^^^^^^^^^^^ patterns `Second`, `Third`, `Fourth` and 8 more not covered
+ | ^^^^^^^^^^^^^^^^^^^^ patterns `ExcessiveEnum::Second`, `ExcessiveEnum::Third`, `ExcessiveEnum::Fourth` and 8 more not covered
|
note: `ExcessiveEnum` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:41:6
@@ -77,11 +77,11 @@ LL ~ ExcessiveEnum::First => (),
LL + _ => todo!()
|
-error[E0004]: non-exhaustive patterns: `CustomRGBA { a: true, .. }` not covered
+error[E0004]: non-exhaustive patterns: `Color::CustomRGBA { a: true, .. }` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:54:11
|
LL | match Color::Red {
- | ^^^^^^^^^^ pattern `CustomRGBA { a: true, .. }` not covered
+ | ^^^^^^^^^^ pattern `Color::CustomRGBA { a: true, .. }` not covered
|
note: `Color` defined here
--> $DIR/non-exhaustive-pattern-witness.rs:19:5
@@ -95,20 +95,20 @@ LL | CustomRGBA { a: bool, r: u8, g: u8, b: 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 ~ Color::CustomRGBA { a: false, r: _, g: _, b: _ } => (),
-LL + CustomRGBA { a: true, .. } => todo!()
+LL + Color::CustomRGBA { a: true, .. } => todo!()
|
-error[E0004]: non-exhaustive patterns: `[Second(true), Second(false)]` not covered
+error[E0004]: non-exhaustive patterns: `[Enum::Second(true), Enum::Second(false)]` not covered
--> $DIR/non-exhaustive-pattern-witness.rs:70:11
|
LL | match *x {
- | ^^ pattern `[Second(true), Second(false)]` not covered
+ | ^^ pattern `[Enum::Second(true), Enum::Second(false)]` not covered
|
= 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 or an explicit pattern as shown
|
LL ~ [_, _, ref tail @ .., _] => (),
-LL + [Second(true), Second(false)] => todo!()
+LL + [Enum::Second(true), Enum::Second(false)] => todo!()
|
error[E0004]: non-exhaustive patterns: `((), false)` not covered
diff --git a/src/test/ui/pattern/usefulness/stable-gated-patterns.rs b/src/test/ui/pattern/usefulness/stable-gated-patterns.rs
index ff1c472e2..03db01160 100644
--- a/src/test/ui/pattern/usefulness/stable-gated-patterns.rs
+++ b/src/test/ui/pattern/usefulness/stable-gated-patterns.rs
@@ -8,7 +8,7 @@ fn main() {
match UnstableEnum::Stable {
UnstableEnum::Stable => {}
}
- //~^^^ non-exhaustive patterns: `Stable2` and `_` not covered
+ //~^^^ non-exhaustive patterns: `UnstableEnum::Stable2` and `_` not covered
match UnstableEnum::Stable {
UnstableEnum::Stable => {}
diff --git a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr b/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr
index 98c75953a..7b8588a3c 100644
--- a/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr
+++ b/src/test/ui/pattern/usefulness/stable-gated-patterns.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `Stable2` and `_` not covered
+error[E0004]: non-exhaustive patterns: `UnstableEnum::Stable2` and `_` not covered
--> $DIR/stable-gated-patterns.rs:8:11
|
LL | match UnstableEnum::Stable {
- | ^^^^^^^^^^^^^^^^^^^^ patterns `Stable2` and `_` not covered
+ | ^^^^^^^^^^^^^^^^^^^^ patterns `UnstableEnum::Stable2` and `_` not covered
|
note: `UnstableEnum` defined here
--> $DIR/auxiliary/unstable.rs:9:5
@@ -16,7 +16,7 @@ LL | Stable2,
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 + Stable2 | _ => todo!()
+LL + UnstableEnum::Stable2 | _ => todo!()
|
error[E0004]: non-exhaustive patterns: `_` not covered
diff --git a/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr b/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
index 6127fad3f..85c97be29 100644
--- a/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
+++ b/src/test/ui/pattern/usefulness/struct-like-enum-nonexhaustive.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `B { x: Some(_) }` not covered
+error[E0004]: non-exhaustive patterns: `A::B { x: Some(_) }` not covered
--> $DIR/struct-like-enum-nonexhaustive.rs:8:11
|
LL | match x {
- | ^ pattern `B { x: Some(_) }` not covered
+ | ^ pattern `A::B { x: Some(_) }` not covered
|
note: `A` defined here
--> $DIR/struct-like-enum-nonexhaustive.rs:2:5
@@ -15,7 +15,7 @@ LL | B { x: 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 ~ A::B { x: None } => {}
-LL + B { x: Some(_) } => todo!()
+LL + A::B { x: Some(_) } => todo!()
|
error: aborting due to previous error
diff --git a/src/test/ui/pattern/usefulness/top-level-alternation.rs b/src/test/ui/pattern/usefulness/top-level-alternation.rs
index 076de8461..e8cd12ea4 100644
--- a/src/test/ui/pattern/usefulness/top-level-alternation.rs
+++ b/src/test/ui/pattern/usefulness/top-level-alternation.rs
@@ -1,5 +1,3 @@
-#![feature(let_else)]
-
#![deny(unreachable_patterns)]
fn main() {
diff --git a/src/test/ui/pattern/usefulness/top-level-alternation.stderr b/src/test/ui/pattern/usefulness/top-level-alternation.stderr
index dd5936fdc..17fa951c5 100644
--- a/src/test/ui/pattern/usefulness/top-level-alternation.stderr
+++ b/src/test/ui/pattern/usefulness/top-level-alternation.stderr
@@ -1,71 +1,71 @@
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:6:23
+ --> $DIR/top-level-alternation.rs:4:23
|
LL | while let 0..=2 | 1 = 0 {}
| ^
|
note: the lint level is defined here
- --> $DIR/top-level-alternation.rs:3:9
+ --> $DIR/top-level-alternation.rs:1:9
|
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:7:20
+ --> $DIR/top-level-alternation.rs:5:20
|
LL | if let 0..=2 | 1 = 0 {}
| ^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:11:15
+ --> $DIR/top-level-alternation.rs:9:15
|
LL | | 0 => {}
| ^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:16:15
+ --> $DIR/top-level-alternation.rs:14:15
|
LL | | Some(0) => {}
| ^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:21:9
+ --> $DIR/top-level-alternation.rs:19:9
|
LL | (0, 0) => {}
| ^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:41:9
+ --> $DIR/top-level-alternation.rs:39:9
|
LL | _ => {}
| ^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:45:9
+ --> $DIR/top-level-alternation.rs:43:9
|
LL | Some(_) => {}
| ^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:46:9
+ --> $DIR/top-level-alternation.rs:44:9
|
LL | None => {}
| ^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:51:9
+ --> $DIR/top-level-alternation.rs:49:9
|
LL | None | Some(_) => {}
| ^^^^^^^^^^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:55:9
+ --> $DIR/top-level-alternation.rs:53:9
|
LL | 1..=2 => {},
| ^^^^^
error: unreachable pattern
- --> $DIR/top-level-alternation.rs:58:14
+ --> $DIR/top-level-alternation.rs:56:14
|
LL | let (0 | 0) = 0 else { return };
| ^
diff --git a/src/test/ui/pattern/usefulness/unstable-gated-patterns.rs b/src/test/ui/pattern/usefulness/unstable-gated-patterns.rs
index bdab327fd..7046555e0 100644
--- a/src/test/ui/pattern/usefulness/unstable-gated-patterns.rs
+++ b/src/test/ui/pattern/usefulness/unstable-gated-patterns.rs
@@ -11,7 +11,7 @@ fn main() {
UnstableEnum::Stable => {}
UnstableEnum::Stable2 => {}
}
- //~^^^^ non-exhaustive patterns: `Unstable` not covered
+ //~^^^^ non-exhaustive patterns: `UnstableEnum::Unstable` not covered
// Ok: all variants are explicitly matched
match UnstableEnum::Stable {
diff --git a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr b/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr
index f07a25ca8..6dc9a4058 100644
--- a/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr
+++ b/src/test/ui/pattern/usefulness/unstable-gated-patterns.stderr
@@ -1,8 +1,8 @@
-error[E0004]: non-exhaustive patterns: `Unstable` not covered
+error[E0004]: non-exhaustive patterns: `UnstableEnum::Unstable` not covered
--> $DIR/unstable-gated-patterns.rs:10:11
|
LL | match UnstableEnum::Stable {
- | ^^^^^^^^^^^^^^^^^^^^ pattern `Unstable` not covered
+ | ^^^^^^^^^^^^^^^^^^^^ pattern `UnstableEnum::Unstable` not covered
|
note: `UnstableEnum` defined here
--> $DIR/auxiliary/unstable.rs:11:5
@@ -16,7 +16,7 @@ LL | Unstable,
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 + Unstable => todo!()
+LL + UnstableEnum::Unstable => todo!()
|
error: aborting due to previous error
diff --git a/src/test/ui/phantom-auto-trait.stderr b/src/test/ui/phantom-auto-trait.stderr
index 1cc653c51..015c8fa4c 100644
--- a/src/test/ui/phantom-auto-trait.stderr
+++ b/src/test/ui/phantom-auto-trait.stderr
@@ -6,7 +6,7 @@ LL | is_zen(x)
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Zen` for `&T`
+note: required for `&T` to implement `Zen`
--> $DIR/phantom-auto-trait.rs:10:24
|
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
@@ -35,7 +35,7 @@ LL | is_zen(x)
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Zen` for `&T`
+note: required for `&T` to implement `Zen`
--> $DIR/phantom-auto-trait.rs:10:24
|
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
diff --git a/src/test/ui/polymorphization/const_parameters/closures.stderr b/src/test/ui/polymorphization/const_parameters/closures.stderr
index fdf817cae..4e927f773 100644
--- a/src/test/ui/polymorphization/const_parameters/closures.stderr
+++ b/src/test/ui/polymorphization/const_parameters/closures.stderr
@@ -4,8 +4,8 @@ warning: the feature `generic_const_exprs` is incomplete and may not be safe to
LL | #![feature(generic_const_exprs, rustc_attrs)]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error: item has unused generic parameters
--> $DIR/closures.rs:19:19
diff --git a/src/test/ui/polymorphization/const_parameters/functions.stderr b/src/test/ui/polymorphization/const_parameters/functions.stderr
index f2b5a7307..9d0922ac7 100644
--- a/src/test/ui/polymorphization/const_parameters/functions.stderr
+++ b/src/test/ui/polymorphization/const_parameters/functions.stderr
@@ -4,8 +4,8 @@ warning: the feature `generic_const_exprs` is incomplete and may not be safe to
LL | #![feature(generic_const_exprs, rustc_attrs)]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error: item has unused generic parameters
--> $DIR/functions.rs:15:8
diff --git a/src/test/ui/polymorphization/generators.stderr b/src/test/ui/polymorphization/generators.stderr
index a24eee5fe..84888f6fb 100644
--- a/src/test/ui/polymorphization/generators.stderr
+++ b/src/test/ui/polymorphization/generators.stderr
@@ -4,8 +4,8 @@ warning: the feature `generic_const_exprs` is incomplete and may not be safe to
LL | #![feature(generic_const_exprs, generators, generator_trait, rustc_attrs)]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error: item has unused generic parameters
--> $DIR/generators.rs:35:5
diff --git a/src/test/ui/polymorphization/predicates.stderr b/src/test/ui/polymorphization/predicates.stderr
index e5af1d751..80bb2af25 100644
--- a/src/test/ui/polymorphization/predicates.stderr
+++ b/src/test/ui/polymorphization/predicates.stderr
@@ -41,7 +41,7 @@ error: item has unused generic parameters
LL | fn bar<I>() {
| ^^^ - generic parameter `I` is unused
-note: the above error was encountered while instantiating `fn foo::<std::slice::Iter<u32>, T>`
+note: the above error was encountered while instantiating `fn foo::<std::slice::Iter<'_, u32>, T>`
--> $DIR/predicates.rs:86:5
|
LL | foo(x.iter());
diff --git a/src/test/ui/polymorphization/promoted-function-2.stderr b/src/test/ui/polymorphization/promoted-function-2.stderr
index 4d7bab6aa..547569df7 100644
--- a/src/test/ui/polymorphization/promoted-function-2.stderr
+++ b/src/test/ui/polymorphization/promoted-function-2.stderr
@@ -4,8 +4,8 @@ warning: the feature `generic_const_exprs` is incomplete and may not be safe to
LL | #![feature(generic_const_exprs, rustc_attrs)]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error: item has unused generic parameters
--> $DIR/promoted-function-2.rs:8:4
diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.rs b/src/test/ui/privacy/associated-item-privacy-inherent.rs
index c3ae92023..7b7c734a9 100644
--- a/src/test/ui/privacy/associated-item-privacy-inherent.rs
+++ b/src/test/ui/privacy/associated-item-privacy-inherent.rs
@@ -11,11 +11,11 @@ mod priv_nominal {
pub macro mac() {
let value = Pub::method;
- //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private
+ //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private
value;
- //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private
+ //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private
Pub.method();
- //~^ ERROR type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private
+ //~^ ERROR type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private
Pub::CONST;
//~^ ERROR associated constant `CONST` is private
// let _: Pub::AssocTy;
diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.stderr b/src/test/ui/privacy/associated-item-privacy-inherent.stderr
index 4478e5c2a..f4d4ee459 100644
--- a/src/test/ui/privacy/associated-item-privacy-inherent.stderr
+++ b/src/test/ui/privacy/associated-item-privacy-inherent.stderr
@@ -1,4 +1,4 @@
-error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private
+error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private
--> $DIR/associated-item-privacy-inherent.rs:13:21
|
LL | let value = Pub::method;
@@ -9,7 +9,7 @@ LL | priv_nominal::mac!();
|
= note: this error originates in the macro `priv_nominal::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private
+error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private
--> $DIR/associated-item-privacy-inherent.rs:15:9
|
LL | value;
@@ -20,7 +20,7 @@ LL | priv_nominal::mac!();
|
= note: this error originates in the macro `priv_nominal::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private
+error: type `for<'a> fn(&'a priv_nominal::Pub) {priv_nominal::Pub::method}` is private
--> $DIR/associated-item-privacy-inherent.rs:17:13
|
LL | Pub.method();
diff --git a/src/test/ui/privacy/associated-item-privacy-trait.rs b/src/test/ui/privacy/associated-item-privacy-trait.rs
index c07aeed99..ad9a5e15c 100644
--- a/src/test/ui/privacy/associated-item-privacy-trait.rs
+++ b/src/test/ui/privacy/associated-item-privacy-trait.rs
@@ -13,11 +13,11 @@ mod priv_trait {
pub macro mac() {
let value = <Pub as PrivTr>::method;
- //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
+ //~^ ERROR type `for<'a> fn(&'a priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
value;
- //~^ ERROR type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
+ //~^ ERROR type `for<'a> fn(&'a priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
Pub.method();
- //~^ ERROR type `for<'r> fn(&'r Self) {<Self as PrivTr>::method}` is private
+ //~^ ERROR type `for<'a> fn(&'a Self) {<Self as PrivTr>::method}` is private
<Pub as PrivTr>::CONST;
//~^ ERROR associated constant `<Pub as PrivTr>::CONST` is private
let _: <Pub as PrivTr>::AssocTy;
diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/src/test/ui/privacy/associated-item-privacy-trait.stderr
index 6095f5f42..c4be1a9d9 100644
--- a/src/test/ui/privacy/associated-item-privacy-trait.stderr
+++ b/src/test/ui/privacy/associated-item-privacy-trait.stderr
@@ -1,4 +1,4 @@
-error: type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
+error: type `for<'a> fn(&'a priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
--> $DIR/associated-item-privacy-trait.rs:15:21
|
LL | let value = <Pub as PrivTr>::method;
@@ -9,7 +9,7 @@ LL | priv_trait::mac!();
|
= note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
+error: type `for<'a> fn(&'a priv_trait::Pub) {<priv_trait::Pub as PrivTr>::method}` is private
--> $DIR/associated-item-privacy-trait.rs:17:9
|
LL | value;
@@ -20,7 +20,7 @@ LL | priv_trait::mac!();
|
= note: this error originates in the macro `priv_trait::mac` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: type `for<'r> fn(&'r Self) {<Self as PrivTr>::method}` is private
+error: type `for<'a> fn(&'a Self) {<Self as PrivTr>::method}` is private
--> $DIR/associated-item-privacy-trait.rs:19:13
|
LL | Pub.method();
diff --git a/src/test/ui/issues/auxiliary/issue-17718-const-privacy.rs b/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs
index 93cf4bf3e..93cf4bf3e 100644
--- a/src/test/ui/issues/auxiliary/issue-17718-const-privacy.rs
+++ b/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs
diff --git a/src/test/ui/privacy/effective_visibilities.rs b/src/test/ui/privacy/effective_visibilities.rs
new file mode 100644
index 000000000..1d806a1d1
--- /dev/null
+++ b/src/test/ui/privacy/effective_visibilities.rs
@@ -0,0 +1,75 @@
+#![feature(rustc_attrs)]
+
+#[rustc_effective_visibility]
+mod outer { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ #[rustc_effective_visibility]
+ pub mod inner1 { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+ #[rustc_effective_visibility]
+ extern "C" {} //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+ #[rustc_effective_visibility]
+ pub trait PubTrait { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ #[rustc_effective_visibility]
+ const A: i32; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ #[rustc_effective_visibility]
+ type B; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ }
+
+ #[rustc_effective_visibility]
+ struct PrivStruct; //~ 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 not in the table
+ #[rustc_effective_visibility]
+ pub b: u8, //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ }
+
+ #[rustc_effective_visibility]
+ pub enum Enum { //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ #[rustc_effective_visibility]
+ A( //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ #[rustc_effective_visibility]
+ PubUnion, //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ ),
+ }
+ }
+
+ #[rustc_effective_visibility]
+ macro_rules! none_macro { //~ Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ () => {};
+ }
+
+ #[macro_export]
+ #[rustc_effective_visibility]
+ macro_rules! public_macro { //~ Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ () => {};
+ }
+
+ #[rustc_effective_visibility]
+ pub struct ReachableStruct { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+ #[rustc_effective_visibility]
+ pub a: u8, //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+ }
+}
+
+#[rustc_effective_visibility]
+pub use outer::inner1; //~ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+pub fn foo() -> outer::ReachableStruct { outer::ReachableStruct {a: 0} }
+
+mod half_public_import {
+ #[rustc_effective_visibility]
+ pub type HalfPublicImport = u8; //~ ERROR Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ #[rustc_effective_visibility]
+ #[allow(non_upper_case_globals)]
+ pub(crate) const HalfPublicImport: u8 = 0; //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+}
+
+#[rustc_effective_visibility]
+pub use half_public_import::HalfPublicImport; //~ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ //~^ ERROR Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+
+fn main() {}
diff --git a/src/test/ui/privacy/effective_visibilities.stderr b/src/test/ui/privacy/effective_visibilities.stderr
new file mode 100644
index 000000000..1c6201600
--- /dev/null
+++ b/src/test/ui/privacy/effective_visibilities.stderr
@@ -0,0 +1,134 @@
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ --> $DIR/effective_visibilities.rs:4:1
+ |
+LL | mod outer {
+ | ^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:6:5
+ |
+LL | pub mod inner1 {
+ | ^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:9:9
+ |
+LL | extern "C" {}
+ | ^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:12:9
+ |
+LL | pub trait PubTrait {
+ | ^^^^^^^^^^^^^^^^^^
+
+error: not in the table
+ --> $DIR/effective_visibilities.rs:20:9
+ |
+LL | struct PrivStruct;
+ | ^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:23:9
+ |
+LL | pub union PubUnion {
+ | ^^^^^^^^^^^^^^^^^^
+
+error: not in the table
+ --> $DIR/effective_visibilities.rs:25:13
+ |
+LL | a: u8,
+ | ^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:27:13
+ |
+LL | pub b: u8,
+ | ^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:31:9
+ |
+LL | pub enum Enum {
+ | ^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:33:13
+ |
+LL | A(
+ | ^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:35:17
+ |
+LL | PubUnion,
+ | ^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ --> $DIR/effective_visibilities.rs:41:5
+ |
+LL | macro_rules! none_macro {
+ | ^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:47:5
+ |
+LL | macro_rules! public_macro {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:52:5
+ |
+LL | pub struct ReachableStruct {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:54:9
+ |
+LL | pub a: u8,
+ | ^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:59:9
+ |
+LL | pub use outer::inner1;
+ | ^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:65:5
+ |
+LL | pub type HalfPublicImport = u8;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
+ --> $DIR/effective_visibilities.rs:68:5
+ |
+LL | pub(crate) const HalfPublicImport: u8 = 0;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:72:9
+ |
+LL | pub use half_public_import::HalfPublicImport;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub, Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:72:9
+ |
+LL | pub use half_public_import::HalfPublicImport;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:14:13
+ |
+LL | const A: i32;
+ | ^^^^^^^^^^^^
+
+error: Direct: pub(crate), Reexported: pub, Reachable: pub, ReachableThroughImplTrait: pub
+ --> $DIR/effective_visibilities.rs:16:13
+ |
+LL | type B;
+ | ^^^^^^
+
+error: aborting due to 22 previous errors
+
diff --git a/src/test/ui/issues/issue-17718-const-privacy.rs b/src/test/ui/privacy/issue-17718-const-privacy.rs
index 6ab3a60df..6ab3a60df 100644
--- a/src/test/ui/issues/issue-17718-const-privacy.rs
+++ b/src/test/ui/privacy/issue-17718-const-privacy.rs
diff --git a/src/test/ui/issues/issue-17718-const-privacy.stderr b/src/test/ui/privacy/issue-17718-const-privacy.stderr
index 133a6360b..133a6360b 100644
--- a/src/test/ui/issues/issue-17718-const-privacy.stderr
+++ b/src/test/ui/privacy/issue-17718-const-privacy.stderr
diff --git a/src/test/ui/privacy/issue-30079.stderr b/src/test/ui/privacy/issue-30079.stderr
index dc98cfe3b..9179ff339 100644
--- a/src/test/ui/privacy/issue-30079.stderr
+++ b/src/test/ui/privacy/issue-30079.stderr
@@ -4,9 +4,9 @@ warning: private type `m1::Priv` in public interface (error E0446)
LL | pub fn f(_: Priv) {}
| ^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(private_in_public)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+ = note: `#[warn(private_in_public)]` on by default
error[E0446]: private type `m2::Priv` in public interface
--> $DIR/issue-30079.rs:18:9
diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.stderr
index 1abeafe39..a59027d81 100644
--- a/src/test/ui/privacy/private-in-public-assoc-ty.stderr
+++ b/src/test/ui/privacy/private-in-public-assoc-ty.stderr
@@ -13,9 +13,9 @@ warning: private trait `PrivTr` in public interface (error E0445)
LL | type Alias1: PrivTr;
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(private_in_public)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+ = note: `#[warn(private_in_public)]` on by default
warning: private type `Priv` in public interface (error E0446)
--> $DIR/private-in-public-assoc-ty.rs:27:9
diff --git a/src/test/ui/privacy/private-in-public-non-principal.stderr b/src/test/ui/privacy/private-in-public-non-principal.stderr
index 5b4123ea8..de20cada4 100644
--- a/src/test/ui/privacy/private-in-public-non-principal.stderr
+++ b/src/test/ui/privacy/private-in-public-non-principal.stderr
@@ -4,9 +4,9 @@ warning: private trait `PrivNonPrincipal` in public interface (error E0445)
LL | pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(private_in_public)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+ = note: `#[warn(private_in_public)]` on by default
error: missing documentation for an associated function
--> $DIR/private-in-public-non-principal.rs:14:9
diff --git a/src/test/ui/privacy/private-in-public-warn.stderr b/src/test/ui/privacy/private-in-public-warn.stderr
index f2ff6cf2f..66f91ce6f 100644
--- a/src/test/ui/privacy/private-in-public-warn.stderr
+++ b/src/test/ui/privacy/private-in-public-warn.stderr
@@ -4,13 +4,13 @@ error: private type `types::Priv` in public interface (error E0446)
LL | pub type Alias = Priv;
| ^^^^^^^^^^^^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
note: the lint level is defined here
--> $DIR/private-in-public-warn.rs:5:9
|
LL | #![deny(private_in_public)]
| ^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
error: private type `types::Priv` in public interface (error E0446)
--> $DIR/private-in-public-warn.rs:18:12
diff --git a/src/test/ui/privacy/private-inferred-type-3.rs b/src/test/ui/privacy/private-inferred-type-3.rs
index 00f0a715a..0337aedd0 100644
--- a/src/test/ui/privacy/private-inferred-type-3.rs
+++ b/src/test/ui/privacy/private-inferred-type-3.rs
@@ -6,7 +6,7 @@
// error-pattern:type `fn() {<u8 as ext::PrivTrait>::method}` is private
// error-pattern:type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private
// error-pattern:type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private
-// error-pattern:type `for<'r> fn(&'r Pub<u8>) {Pub::<u8>::priv_method}` is private
+// error-pattern:type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
#![feature(decl_macro)]
diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/src/test/ui/privacy/private-inferred-type-3.stderr
index f9dd1c3d0..00b61512d 100644
--- a/src/test/ui/privacy/private-inferred-type-3.stderr
+++ b/src/test/ui/privacy/private-inferred-type-3.stderr
@@ -46,7 +46,7 @@ LL | ext::m!();
|
= note: this error originates in the macro `ext::m` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: type `for<'r> fn(&'r Pub<u8>) {Pub::<u8>::priv_method}` is private
+error: type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
--> $DIR/private-inferred-type-3.rs:16:5
|
LL | ext::m!();
diff --git a/src/test/ui/privacy/private-inferred-type.rs b/src/test/ui/privacy/private-inferred-type.rs
index b083a3970..e8743dd96 100644
--- a/src/test/ui/privacy/private-inferred-type.rs
+++ b/src/test/ui/privacy/private-inferred-type.rs
@@ -47,7 +47,7 @@ mod m {
PubTupleStruct;
//~^ ERROR type `fn(u8) -> PubTupleStruct {PubTupleStruct}` is private
Pub(0u8).priv_method();
- //~^ ERROR type `for<'r> fn(&'r Pub<u8>) {Pub::<u8>::priv_method}` is private
+ //~^ ERROR type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
}
trait Trait {}
diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/src/test/ui/privacy/private-inferred-type.stderr
index aecd8b58c..fc3f9ab62 100644
--- a/src/test/ui/privacy/private-inferred-type.stderr
+++ b/src/test/ui/privacy/private-inferred-type.stderr
@@ -161,7 +161,7 @@ LL | m::m!();
|
= note: this error originates in the macro `m::m` (in Nightly builds, run with -Z macro-backtrace for more info)
-error: type `for<'r> fn(&'r Pub<u8>) {Pub::<u8>::priv_method}` is private
+error: type `for<'a> fn(&'a Pub<u8>) {Pub::<u8>::priv_method}` is private
--> $DIR/private-inferred-type.rs:49:18
|
LL | Pub(0u8).priv_method();
diff --git a/src/test/ui/privacy/reachable-unnameable-items.rs b/src/test/ui/privacy/reachable-unnameable-items.rs
index 1c91541e6..1babe0119 100644
--- a/src/test/ui/privacy/reachable-unnameable-items.rs
+++ b/src/test/ui/privacy/reachable-unnameable-items.rs
@@ -1,5 +1,4 @@
// run-pass
-// ignore-wasm32-bare compiled with panic=abort by default
// needs-unwind
// aux-build:reachable-unnameable-items.rs
diff --git a/src/test/ui/privacy/where-priv-type.stderr b/src/test/ui/privacy/where-priv-type.stderr
index 7eb71346a..c5fb2cdb0 100644
--- a/src/test/ui/privacy/where-priv-type.stderr
+++ b/src/test/ui/privacy/where-priv-type.stderr
@@ -4,9 +4,9 @@ warning: private type `PrivTy` in public interface (error E0446)
LL | pub struct S
| ^^^^^^^^^^^^
|
- = note: `#[warn(private_in_public)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+ = note: `#[warn(private_in_public)]` on by default
warning: private type `PrivTy` in public interface (error E0446)
--> $DIR/where-priv-type.rs:27:1
diff --git a/src/test/ui/proc-macro/attr-complex-fn.stdout b/src/test/ui/proc-macro/attr-complex-fn.stdout
index fc69a13dd..b12eb587f 100644
--- a/src/test/ui/proc-macro/attr-complex-fn.stdout
+++ b/src/test/ui/proc-macro/attr-complex-fn.stdout
@@ -53,12 +53,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '>',
spacing: Joint,
- span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0),
+ span: $DIR/attr-complex-fn.rs:19:36: 19:37 (#0),
},
Punct {
ch: '>',
spacing: Joint,
- span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0),
+ span: $DIR/attr-complex-fn.rs:19:37: 19:38 (#0),
},
Punct {
ch: '>',
diff --git a/src/test/ui/proc-macro/auxiliary/expand-expr.rs b/src/test/ui/proc-macro/auxiliary/expand-expr.rs
index 5463e79d7..1d6ef8a13 100644
--- a/src/test/ui/proc-macro/auxiliary/expand-expr.rs
+++ b/src/test/ui/proc-macro/auxiliary/expand-expr.rs
@@ -80,13 +80,21 @@ fn assert_ts_eq(lhs: &TokenStream, rhs: &TokenStream) {
pub fn expand_expr_is(input: TokenStream) -> TokenStream {
let mut iter = input.into_iter();
let mut expected_tts = Vec::new();
- loop {
+ let comma = loop {
match iter.next() {
- Some(TokenTree::Punct(ref p)) if p.as_char() == ',' => break,
+ Some(TokenTree::Punct(p)) if p.as_char() == ',' => break p,
Some(tt) => expected_tts.push(tt),
None => panic!("expected comma"),
}
- }
+ };
+
+ // Make sure that `Ident` and `Literal` objects from this proc-macro's
+ // environment are not invalidated when `expand_expr` recursively invokes
+ // another macro by taking a local copy, and checking it after the fact.
+ let pre_expand_span = comma.span();
+ let pre_expand_ident = Ident::new("ident", comma.span());
+ let pre_expand_literal = Literal::string("literal");
+ let pre_expand_call_site = Span::call_site();
let expected = expected_tts.into_iter().collect::<TokenStream>();
let expanded = iter.collect::<TokenStream>().expand_expr().expect("expand_expr failed");
@@ -100,6 +108,15 @@ pub fn expand_expr_is(input: TokenStream) -> TokenStream {
// Also compare the raw tts to make sure they line up.
assert_ts_eq(&expected, &expanded);
+ assert!(comma.span().eq(&pre_expand_span), "pre-expansion span is still equal");
+ assert_eq!(pre_expand_ident.to_string(), "ident", "pre-expansion identifier is still valid");
+ assert_eq!(
+ pre_expand_literal.to_string(),
+ "\"literal\"",
+ "pre-expansion literal is still valid"
+ );
+ assert!(Span::call_site().eq(&pre_expand_call_site), "pre-expansion call-site is still equal");
+
TokenStream::new()
}
diff --git a/src/test/ui/proc-macro/auxiliary/re-export.rs b/src/test/ui/proc-macro/auxiliary/re-export.rs
new file mode 100644
index 000000000..e8e9c9d3e
--- /dev/null
+++ b/src/test/ui/proc-macro/auxiliary/re-export.rs
@@ -0,0 +1,19 @@
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+
+#[proc_macro]
+pub fn cause_ice(_: TokenStream) -> TokenStream {
+ "
+ enum IceCause {
+ Variant,
+ }
+
+ pub use IceCause::Variant;
+ ".parse().unwrap()
+}
diff --git a/src/test/ui/proc-macro/call-deprecated.rs b/src/test/ui/proc-macro/call-deprecated.rs
index b92cc2363..cb634671b 100644
--- a/src/test/ui/proc-macro/call-deprecated.rs
+++ b/src/test/ui/proc-macro/call-deprecated.rs
@@ -5,7 +5,7 @@ extern crate call_deprecated;
// These first two `#[allow(deprecated)]` attributes
// do nothing, since the AST nodes for `First` and `Second`
-// haven't been been assigned a `NodeId`.
+// haven't been assigned a `NodeId`.
// See #63221 for a discussion about how we should
// handle the interaction of 'inert' attributes and
// proc-macro attributes.
diff --git a/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout b/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout
index 4de8746a1..b88fbd3e8 100644
--- a/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout
+++ b/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout
@@ -177,12 +177,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0),
+ span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:17 (#0),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0),
+ span: $DIR/capture-macro-rules-invoke.rs:45:17: 45:18 (#0),
},
Ident {
ident: "option",
@@ -191,12 +191,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0),
+ span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:25 (#0),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0),
+ span: $DIR/capture-macro-rules-invoke.rs:45:25: 45:26 (#0),
},
Ident {
ident: "Option",
@@ -231,12 +231,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0),
+ span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:25 (#0),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0),
+ span: $DIR/capture-macro-rules-invoke.rs:46:25: 46:26 (#0),
},
Ident {
ident: "path",
diff --git a/src/test/ui/proc-macro/crt-static.rs b/src/test/ui/proc-macro/crt-static.rs
index 8c1a9dc80..6103acb7b 100644
--- a/src/test/ui/proc-macro/crt-static.rs
+++ b/src/test/ui/proc-macro/crt-static.rs
@@ -9,7 +9,7 @@
// FIXME: This don't work when crate-type is specified by attribute
// `#![crate_type = "proc-macro"]`, not by `--crate-type=proc-macro`
-// command line flag. This is beacuse the list of `cfg` symbols is generated
+// command line flag. This is because the list of `cfg` symbols is generated
// before attributes are parsed. See rustc_interface::util::add_configuration
#[cfg(target_feature = "crt-static")]
compile_error!("crt-static is enabled");
diff --git a/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs b/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
index fd34eb974..102bd6b7b 100644
--- a/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
+++ b/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs
@@ -2,6 +2,7 @@
// aux-build:macro-dump-debug.rs
// compile-flags: -Z span-debug
+
extern crate macro_dump_debug;
use macro_dump_debug::dump_debug;
@@ -9,7 +10,11 @@ dump_debug! {
ident // ident
r#ident // raw ident
, // alone punct
- ==> // joint punct
+ && // joint punct, two-char op
+ ||> // joint punct, two-char op + one-char op
+ ||<< // joint punct, two-char op + two-char op
+ ..= // joint punct, three-char op
+ <<=! // joint punct, three-char op + one-char-op
() // empty group
[_] // nonempty group
diff --git a/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr b/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr
index 2c05bdbc4..fa65cbbf1 100644
--- a/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr
+++ b/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr
@@ -1,166 +1,231 @@
-TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }]
+TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0) }, Punct { ch: '&', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0) }, Punct { ch: '&', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0) }, Punct { ch: '<', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0) }, Punct { ch: '=', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0) }, Punct { ch: '!', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0) }]
TokenStream [
Ident {
ident: "ident",
- span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0),
+ span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0),
},
Ident {
ident: "r#ident",
- span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0),
+ span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0),
},
Punct {
ch: ',',
spacing: Alone,
- span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0),
+ span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0),
+ },
+ Punct {
+ ch: '&',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0),
+ },
+ Punct {
+ ch: '&',
+ spacing: Alone,
+ span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0),
+ },
+ Punct {
+ ch: '|',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0),
+ },
+ Punct {
+ ch: '|',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0),
+ },
+ Punct {
+ ch: '>',
+ spacing: Alone,
+ span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0),
+ },
+ Punct {
+ ch: '|',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0),
+ },
+ Punct {
+ ch: '|',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0),
+ },
+ Punct {
+ ch: '<',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0),
+ },
+ Punct {
+ ch: '<',
+ spacing: Alone,
+ span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0),
+ },
+ Punct {
+ ch: '.',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0),
+ },
+ Punct {
+ ch: '.',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0),
},
Punct {
ch: '=',
+ spacing: Alone,
+ span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0),
+ },
+ Punct {
+ ch: '<',
spacing: Joint,
- span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0),
+ span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0),
+ },
+ Punct {
+ ch: '<',
+ spacing: Joint,
+ span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0),
},
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0),
+ span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0),
},
Punct {
- ch: '>',
+ ch: '!',
spacing: Alone,
- span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0),
+ span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
- span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0),
+ span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "_",
- span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0),
+ span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0),
},
],
- span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0),
+ span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0),
},
Literal {
kind: Integer,
symbol: "0",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0),
+ span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0),
},
Literal {
kind: Float,
symbol: "1.0",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0),
+ span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0),
},
Literal {
kind: Str,
symbol: "S",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0),
+ span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0),
},
Literal {
kind: ByteStr,
symbol: "B",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0),
+ span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0),
},
Literal {
kind: StrRaw(0),
symbol: "R",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0),
+ span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0),
},
Literal {
kind: StrRaw(2),
symbol: "R",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0),
+ span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0),
},
Literal {
kind: ByteStrRaw(0),
symbol: "BR",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0),
+ span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0),
},
Literal {
kind: ByteStrRaw(2),
symbol: "BR",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0),
+ span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0),
},
Literal {
kind: Char,
symbol: "C",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0),
+ span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0),
},
Literal {
kind: Byte,
symbol: "B",
suffix: None,
- span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0),
+ span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0),
},
Literal {
kind: Integer,
symbol: "0",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0),
+ span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0),
},
Literal {
kind: Float,
symbol: "1.0",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0),
+ span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0),
},
Literal {
kind: Str,
symbol: "S",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0),
+ span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0),
},
Literal {
kind: ByteStr,
symbol: "B",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0),
+ span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0),
},
Literal {
kind: StrRaw(0),
symbol: "R",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0),
+ span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0),
},
Literal {
kind: StrRaw(2),
symbol: "R",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0),
+ span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0),
},
Literal {
kind: ByteStrRaw(0),
symbol: "BR",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0),
+ span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0),
},
Literal {
kind: ByteStrRaw(2),
symbol: "BR",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0),
+ span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0),
},
Literal {
kind: Char,
symbol: "C",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0),
+ span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0),
},
Literal {
kind: Byte,
symbol: "B",
suffix: Some("q"),
- span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0),
+ span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0),
},
]
diff --git a/src/test/ui/proc-macro/debug/dump-debug.stderr b/src/test/ui/proc-macro/debug/dump-debug.stderr
index 0aedefd4e..db422b601 100644
--- a/src/test/ui/proc-macro/debug/dump-debug.stderr
+++ b/src/test/ui/proc-macro/debug/dump-debug.stderr
@@ -1,4 +1,4 @@
-TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }]
+TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..204) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(204..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }]
TokenStream [
Ident {
ident: "ident",
@@ -16,12 +16,12 @@ TokenStream [
Punct {
ch: '=',
spacing: Joint,
- span: #0 bytes(203..205),
+ span: #0 bytes(203..204),
},
Punct {
ch: '=',
spacing: Joint,
- span: #0 bytes(203..205),
+ span: #0 bytes(204..205),
},
Punct {
ch: '>',
diff --git a/src/test/ui/proc-macro/derive-bad.stderr b/src/test/ui/proc-macro/derive-bad.stderr
index ae48141fb..241f99b28 100644
--- a/src/test/ui/proc-macro/derive-bad.stderr
+++ b/src/test/ui/proc-macro/derive-bad.stderr
@@ -2,7 +2,10 @@ error: expected `:`, found `}`
--> $DIR/derive-bad.rs:6:10
|
LL | #[derive(A)]
- | ^ expected `:`
+ | ^
+ | |
+ | expected `:`
+ | while parsing this struct
|
= note: this error originates in the derive macro `A` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/proc-macro/derive-helper-shadowing.stderr b/src/test/ui/proc-macro/derive-helper-shadowing.stderr
index d8287eb73..9c52ca422 100644
--- a/src/test/ui/proc-macro/derive-helper-shadowing.stderr
+++ b/src/test/ui/proc-macro/derive-helper-shadowing.stderr
@@ -80,9 +80,9 @@ LL | #[empty_helper]
LL | #[derive(Empty)]
| ----- the attribute is introduced here
|
- = note: `#[warn(legacy_derive_helpers)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
+ = note: `#[warn(legacy_derive_helpers)]` on by default
error: aborting due to 5 previous errors; 1 warning emitted
diff --git a/src/test/ui/proc-macro/dollar-crate-issue-101211.rs b/src/test/ui/proc-macro/dollar-crate-issue-101211.rs
new file mode 100644
index 000000000..fc1acfd32
--- /dev/null
+++ b/src/test/ui/proc-macro/dollar-crate-issue-101211.rs
@@ -0,0 +1,29 @@
+// check-pass
+// edition:2021
+// aux-build:test-macros.rs
+
+#![no_std] // Don't load unnecessary hygiene information from std
+extern crate std;
+
+#[macro_use]
+extern crate test_macros;
+
+macro_rules! foo {
+ ($($path:ident)::*) => (
+ test_macros::recollect!(
+ $($path)::*
+ )
+ )
+}
+
+macro_rules! baz {
+ () => (
+ foo!($crate::BAR)
+ )
+}
+
+pub const BAR: u32 = 19;
+
+fn main(){
+ std::println!("{}", baz!());
+}
diff --git a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout
index c0c9ed72c..2622c005d 100644
--- a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout
+++ b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout
@@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4),
+ span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:29 (#4),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4),
+ span: $DIR/dollar-crate-issue-57089.rs:17:29: 17:30 (#4),
},
Ident {
ident: "S",
@@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4),
+ span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:25 (#4),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4),
+ span: $DIR/dollar-crate-issue-57089.rs:21:25: 21:26 (#4),
},
Ident {
ident: "S",
diff --git a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout
index e6148a687..a91908239 100644
--- a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout
+++ b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout
@@ -30,12 +30,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4),
+ span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:31 (#4),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4),
+ span: $DIR/dollar-crate-issue-62325.rs:19:31: 19:32 (#4),
},
Ident {
ident: "S",
@@ -85,12 +85,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12),
+ span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:31 (#12),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12),
+ span: $DIR/auxiliary/dollar-crate-external.rs:21:31: 21:32 (#12),
},
Ident {
ident: "S",
diff --git a/src/test/ui/proc-macro/dollar-crate.stdout b/src/test/ui/proc-macro/dollar-crate.stdout
index d01fcb9d0..4e169d47e 100644
--- a/src/test/ui/proc-macro/dollar-crate.stdout
+++ b/src/test/ui/proc-macro/dollar-crate.stdout
@@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/dollar-crate.rs:20:32: 20:34 (#4),
+ span: $DIR/dollar-crate.rs:20:32: 20:33 (#4),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/dollar-crate.rs:20:32: 20:34 (#4),
+ span: $DIR/dollar-crate.rs:20:33: 20:34 (#4),
},
Ident {
ident: "S",
@@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/dollar-crate.rs:24:28: 24:30 (#4),
+ span: $DIR/dollar-crate.rs:24:28: 24:29 (#4),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/dollar-crate.rs:24:28: 24:30 (#4),
+ span: $DIR/dollar-crate.rs:24:29: 24:30 (#4),
},
Ident {
ident: "S",
@@ -98,12 +98,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/dollar-crate.rs:27:28: 27:30 (#4),
+ span: $DIR/dollar-crate.rs:27:28: 27:29 (#4),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/dollar-crate.rs:27:28: 27:30 (#4),
+ span: $DIR/dollar-crate.rs:27:29: 27:30 (#4),
},
Ident {
ident: "S",
@@ -138,12 +138,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15),
+ span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:29 (#15),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15),
+ span: $DIR/auxiliary/dollar-crate-external.rs:7:29: 7:30 (#15),
},
Ident {
ident: "S",
@@ -178,12 +178,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15),
+ span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:25 (#15),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15),
+ span: $DIR/auxiliary/dollar-crate-external.rs:11:25: 11:26 (#15),
},
Ident {
ident: "S",
@@ -218,12 +218,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
Punct {
ch: ':',
spacing: Joint,
- span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15),
+ span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:25 (#15),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15),
+ span: $DIR/auxiliary/dollar-crate-external.rs:14:25: 14:26 (#15),
},
Ident {
ident: "S",
diff --git a/src/test/ui/proc-macro/expand-to-unstable-2.rs b/src/test/ui/proc-macro/expand-to-unstable-2.rs
deleted file mode 100644
index 4160e5418..000000000
--- a/src/test/ui/proc-macro/expand-to-unstable-2.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// aux-build:derive-unstable-2.rs
-
-#![feature(register_attr)]
-
-#![register_attr(rustc_foo)]
-
-#[macro_use]
-extern crate derive_unstable_2;
-
-#[derive(Unstable)]
-//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
-
-struct A;
-
-fn main() {
- foo();
-}
diff --git a/src/test/ui/proc-macro/expand-to-unstable-2.stderr b/src/test/ui/proc-macro/expand-to-unstable-2.stderr
deleted file mode 100644
index 8b16ffb76..000000000
--- a/src/test/ui/proc-macro/expand-to-unstable-2.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: attributes starting with `rustc` are reserved for use by the `rustc` compiler
- --> $DIR/expand-to-unstable-2.rs:10:10
- |
-LL | #[derive(Unstable)]
- | ^^^^^^^^
- |
- = note: this error originates in the derive macro `Unstable` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/proc-macro/expand-with-a-macro.rs b/src/test/ui/proc-macro/expand-with-a-macro.rs
index 21a4547d1..042a28365 100644
--- a/src/test/ui/proc-macro/expand-with-a-macro.rs
+++ b/src/test/ui/proc-macro/expand-with-a-macro.rs
@@ -2,7 +2,6 @@
// needs-unwind
// aux-build:expand-with-a-macro.rs
-// ignore-wasm32-bare compiled with panic=abort by default
#![deny(warnings)]
diff --git a/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr b/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr
index 6060f872f..df7c4f72e 100644
--- a/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr
+++ b/src/test/ui/proc-macro/gen-macro-rules-hygiene.stderr
@@ -13,7 +13,7 @@ error[E0425]: cannot find value `local_use` in this scope
--> $DIR/gen-macro-rules-hygiene.rs:12:1
|
LL | gen_macro_rules!();
- | ^^^^^^^^^^^^^^^^^^ not found in this scope
+ | ^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def`
...
LL | generated!();
| ------------ in this macro invocation
@@ -24,7 +24,7 @@ error[E0425]: cannot find value `local_def` in this scope
--> $DIR/gen-macro-rules-hygiene.rs:21:9
|
LL | local_def;
- | ^^^^^^^^^ not found in this scope
+ | ^^^^^^^^^ help: a local variable with a similar name exists: `local_use`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/proc-macro/generate-mod.stderr b/src/test/ui/proc-macro/generate-mod.stderr
index f1a167e37..39bf28dba 100644
--- a/src/test/ui/proc-macro/generate-mod.stderr
+++ b/src/test/ui/proc-macro/generate-mod.stderr
@@ -44,9 +44,9 @@ error: cannot find type `FromOutside` in this scope
LL | #[derive(generate_mod::CheckDerive)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
- = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
+ = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot find type `OuterDerive` in this scope
@@ -89,9 +89,9 @@ error: cannot find type `FromOutside` in this scope
LL | #[derive(generate_mod::CheckDerive)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
- = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
+ = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -101,9 +101,9 @@ error: cannot find type `OuterDerive` in this scope
LL | #[derive(generate_mod::CheckDerive)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
- = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
+ = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -113,9 +113,9 @@ error: cannot find type `FromOutside` in this scope
LL | #[derive(generate_mod::CheckDerive)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
- = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
+ = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -125,9 +125,9 @@ error: cannot find type `OuterDerive` in this scope
LL | #[derive(generate_mod::CheckDerive)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
- = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #83583 <https://github.com/rust-lang/rust/issues/83583>
+ = note: `#[deny(proc_macro_derive_resolution_fallback)]` on by default
= note: this error originates in the derive macro `generate_mod::CheckDerive` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -137,13 +137,13 @@ warning: cannot find type `FromOutside` in this scope
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
+ = 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 #83583 <https://github.com/rust-lang/rust/issues/83583>
note: the lint level is defined here
--> $DIR/generate-mod.rs:30:10
|
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #83583 <https://github.com/rust-lang/rust/issues/83583>
= note: this warning originates in the derive macro `generate_mod::CheckDeriveLint` (in Nightly builds, run with -Z macro-backtrace for more info)
Future breakage diagnostic:
@@ -153,12 +153,12 @@ warning: cannot find type `OuterDeriveLint` in this scope
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ names from parent modules are not accessible without an explicit import
|
+ = 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 #83583 <https://github.com/rust-lang/rust/issues/83583>
note: the lint level is defined here
--> $DIR/generate-mod.rs:30:10
|
LL | #[derive(generate_mod::CheckDeriveLint)] // OK, lint is suppressed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #83583 <https://github.com/rust-lang/rust/issues/83583>
= note: this warning originates in the derive macro `generate_mod::CheckDeriveLint` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr b/src/test/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr
index 45b014c4b..9441cdcc8 100644
--- a/src/test/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr
+++ b/src/test/ui/proc-macro/helper-attr-blocked-by-import-ambig.stderr
@@ -26,9 +26,9 @@ LL | #[empty_helper]
LL | #[derive(Empty)]
| ----- the attribute is introduced here
|
- = note: `#[warn(legacy_derive_helpers)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
+ = note: `#[warn(legacy_derive_helpers)]` on by default
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/proc-macro/inner-attr-non-inline-mod.stderr b/src/test/ui/proc-macro/inner-attr-non-inline-mod.stderr
index 4286896df..2d357d04d 100644
--- a/src/test/ui/proc-macro/inner-attr-non-inline-mod.stderr
+++ b/src/test/ui/proc-macro/inner-attr-non-inline-mod.stderr
@@ -31,9 +31,9 @@ error: custom inner attributes are unstable
LL | #![rustfmt::skip]
| ^^^^^^^^^^^^^
|
- = note: `#[deny(soft_unstable)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>
+ = note: `#[deny(soft_unstable)]` on by default
error: aborting due to 4 previous errors
diff --git a/src/test/ui/proc-macro/inner-attrs.rs b/src/test/ui/proc-macro/inner-attrs.rs
index 2e3c704da..1000c9c75 100644
--- a/src/test/ui/proc-macro/inner-attrs.rs
+++ b/src/test/ui/proc-macro/inner-attrs.rs
@@ -1,3 +1,4 @@
+// gate-test-custom_inner_attributes
// compile-flags: -Z span-debug --error-format human
// aux-build:test-macros.rs
// edition:2018
diff --git a/src/test/ui/proc-macro/inner-attrs.stderr b/src/test/ui/proc-macro/inner-attrs.stderr
index 4da8751ef..a332e143a 100644
--- a/src/test/ui/proc-macro/inner-attrs.stderr
+++ b/src/test/ui/proc-macro/inner-attrs.stderr
@@ -1,23 +1,23 @@
error: expected non-macro inner attribute, found attribute macro `print_attr`
- --> $DIR/inner-attrs.rs:63:12
+ --> $DIR/inner-attrs.rs:64:12
|
LL | #![print_attr]
| ^^^^^^^^^^ not a non-macro inner attribute
error: expected non-macro inner attribute, found attribute macro `print_attr`
- --> $DIR/inner-attrs.rs:67:12
+ --> $DIR/inner-attrs.rs:68:12
|
LL | #![print_attr]
| ^^^^^^^^^^ not a non-macro inner attribute
error: expected non-macro inner attribute, found attribute macro `print_attr`
- --> $DIR/inner-attrs.rs:71:12
+ --> $DIR/inner-attrs.rs:72:12
|
LL | #![print_attr]
| ^^^^^^^^^^ not a non-macro inner attribute
error: expected non-macro inner attribute, found attribute macro `print_attr`
- --> $DIR/inner-attrs.rs:75:12
+ --> $DIR/inner-attrs.rs:76:12
|
LL | #![print_attr]
| ^^^^^^^^^^ not a non-macro inner attribute
diff --git a/src/test/ui/proc-macro/inner-attrs.stdout b/src/test/ui/proc-macro/inner-attrs.stdout
index eaa8882d6..ee8adf0b4 100644
--- a/src/test/ui/proc-macro/inner-attrs.stdout
+++ b/src/test/ui/proc-macro/inner-attrs.stdout
@@ -2,7 +2,7 @@ PRINT-ATTR_ARGS INPUT (DISPLAY): first
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "first",
- span: $DIR/inner-attrs.rs:16:25: 16:30 (#0),
+ span: $DIR/inner-attrs.rs:17:25: 17:30 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second)] fn foo()
@@ -11,40 +11,40 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Alone,
- span: $DIR/inner-attrs.rs:17:1: 17:2 (#0),
+ span: $DIR/inner-attrs.rs:18:1: 18:2 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:17:3: 17:24 (#0),
+ span: $DIR/inner-attrs.rs:18:3: 18:24 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "second",
- span: $DIR/inner-attrs.rs:17:25: 17:31 (#0),
+ span: $DIR/inner-attrs.rs:18:25: 18:31 (#0),
},
],
- span: $DIR/inner-attrs.rs:17:24: 17:32 (#0),
+ span: $DIR/inner-attrs.rs:18:24: 18:32 (#0),
},
],
- span: $DIR/inner-attrs.rs:17:2: 17:33 (#0),
+ span: $DIR/inner-attrs.rs:18:2: 18:33 (#0),
},
Ident {
ident: "fn",
- span: $DIR/inner-attrs.rs:18:1: 18:3 (#0),
+ span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
},
Ident {
ident: "foo",
- span: $DIR/inner-attrs.rs:18:4: 18:7 (#0),
+ span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:18:7: 18:9 (#0),
+ span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
},
Group {
delimiter: Brace,
@@ -52,72 +52,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:19:5: 19:6 (#0),
+ span: $DIR/inner-attrs.rs:20:5: 20:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:19:6: 19:7 (#0),
+ span: $DIR/inner-attrs.rs:20:6: 20:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:19:8: 19:29 (#0),
+ span: $DIR/inner-attrs.rs:20:8: 20:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "third",
- span: $DIR/inner-attrs.rs:19:30: 19:35 (#0),
+ span: $DIR/inner-attrs.rs:20:30: 20:35 (#0),
},
],
- span: $DIR/inner-attrs.rs:19:29: 19:36 (#0),
+ span: $DIR/inner-attrs.rs:20:29: 20:36 (#0),
},
],
- span: $DIR/inner-attrs.rs:19:7: 19:37 (#0),
+ span: $DIR/inner-attrs.rs:20:7: 20:37 (#0),
},
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:20:5: 20:6 (#0),
+ span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:20:6: 20:7 (#0),
+ span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:20:8: 20:29 (#0),
+ span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "fourth",
- span: $DIR/inner-attrs.rs:20:30: 20:36 (#0),
+ span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
},
],
- span: $DIR/inner-attrs.rs:20:29: 20:37 (#0),
+ span: $DIR/inner-attrs.rs:21:29: 21:37 (#0),
},
],
- span: $DIR/inner-attrs.rs:20:7: 20:38 (#0),
+ span: $DIR/inner-attrs.rs:21:7: 21:38 (#0),
},
],
- span: $DIR/inner-attrs.rs:18:10: 21:2 (#0),
+ span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): second
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "second",
- span: $DIR/inner-attrs.rs:17:25: 17:31 (#0),
+ span: $DIR/inner-attrs.rs:18:25: 18:31 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): fn foo()
@@ -125,16 +125,16 @@ PRINT-ATTR INPUT (DISPLAY): fn foo()
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "fn",
- span: $DIR/inner-attrs.rs:18:1: 18:3 (#0),
+ span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
},
Ident {
ident: "foo",
- span: $DIR/inner-attrs.rs:18:4: 18:7 (#0),
+ span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:18:7: 18:9 (#0),
+ span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
},
Group {
delimiter: Brace,
@@ -142,88 +142,88 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:19:5: 19:6 (#0),
+ span: $DIR/inner-attrs.rs:20:5: 20:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:19:6: 19:7 (#0),
+ span: $DIR/inner-attrs.rs:20:6: 20:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:19:8: 19:29 (#0),
+ span: $DIR/inner-attrs.rs:20:8: 20:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "third",
- span: $DIR/inner-attrs.rs:19:30: 19:35 (#0),
+ span: $DIR/inner-attrs.rs:20:30: 20:35 (#0),
},
],
- span: $DIR/inner-attrs.rs:19:29: 19:36 (#0),
+ span: $DIR/inner-attrs.rs:20:29: 20:36 (#0),
},
],
- span: $DIR/inner-attrs.rs:19:7: 19:37 (#0),
+ span: $DIR/inner-attrs.rs:20:7: 20:37 (#0),
},
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:20:5: 20:6 (#0),
+ span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:20:6: 20:7 (#0),
+ span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:20:8: 20:29 (#0),
+ span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "fourth",
- span: $DIR/inner-attrs.rs:20:30: 20:36 (#0),
+ span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
},
],
- span: $DIR/inner-attrs.rs:20:29: 20:37 (#0),
+ span: $DIR/inner-attrs.rs:21:29: 21:37 (#0),
},
],
- span: $DIR/inner-attrs.rs:20:7: 20:38 (#0),
+ span: $DIR/inner-attrs.rs:21:7: 21:38 (#0),
},
],
- span: $DIR/inner-attrs.rs:18:10: 21:2 (#0),
+ span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): third
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "third",
- span: $DIR/inner-attrs.rs:19:30: 19:35 (#0),
+ span: $DIR/inner-attrs.rs:20:30: 20:35 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): fn foo() { #! [print_target_and_args(fourth)] }
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "fn",
- span: $DIR/inner-attrs.rs:18:1: 18:3 (#0),
+ span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
},
Ident {
ident: "foo",
- span: $DIR/inner-attrs.rs:18:4: 18:7 (#0),
+ span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:18:7: 18:9 (#0),
+ span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
},
Group {
delimiter: Brace,
@@ -231,70 +231,70 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:20:5: 20:6 (#0),
+ span: $DIR/inner-attrs.rs:21:5: 21:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:20:6: 20:7 (#0),
+ span: $DIR/inner-attrs.rs:21:6: 21:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:20:8: 20:29 (#0),
+ span: $DIR/inner-attrs.rs:21:8: 21:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "fourth",
- span: $DIR/inner-attrs.rs:20:30: 20:36 (#0),
+ span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
},
],
- span: $DIR/inner-attrs.rs:20:29: 20:37 (#0),
+ span: $DIR/inner-attrs.rs:21:29: 21:37 (#0),
},
],
- span: $DIR/inner-attrs.rs:20:7: 20:38 (#0),
+ span: $DIR/inner-attrs.rs:21:7: 21:38 (#0),
},
],
- span: $DIR/inner-attrs.rs:18:10: 21:2 (#0),
+ span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): fourth
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "fourth",
- span: $DIR/inner-attrs.rs:20:30: 20:36 (#0),
+ span: $DIR/inner-attrs.rs:21:30: 21:36 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): fn foo() {}
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "fn",
- span: $DIR/inner-attrs.rs:18:1: 18:3 (#0),
+ span: $DIR/inner-attrs.rs:19:1: 19:3 (#0),
},
Ident {
ident: "foo",
- span: $DIR/inner-attrs.rs:18:4: 18:7 (#0),
+ span: $DIR/inner-attrs.rs:19:4: 19:7 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:18:7: 18:9 (#0),
+ span: $DIR/inner-attrs.rs:19:7: 19:9 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:18:10: 21:2 (#0),
+ span: $DIR/inner-attrs.rs:19:10: 22:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): mod_first
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "mod_first",
- span: $DIR/inner-attrs.rs:23:25: 23:34 (#0),
+ span: $DIR/inner-attrs.rs:24:25: 24:34 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(mod_second)] mod inline_mod
@@ -306,35 +306,35 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Alone,
- span: $DIR/inner-attrs.rs:24:1: 24:2 (#0),
+ span: $DIR/inner-attrs.rs:25:1: 25:2 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:24:3: 24:24 (#0),
+ span: $DIR/inner-attrs.rs:25:3: 25:24 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "mod_second",
- span: $DIR/inner-attrs.rs:24:25: 24:35 (#0),
+ span: $DIR/inner-attrs.rs:25:25: 25:35 (#0),
},
],
- span: $DIR/inner-attrs.rs:24:24: 24:36 (#0),
+ span: $DIR/inner-attrs.rs:25:24: 25:36 (#0),
},
],
- span: $DIR/inner-attrs.rs:24:2: 24:37 (#0),
+ span: $DIR/inner-attrs.rs:25:2: 25:37 (#0),
},
Ident {
ident: "mod",
- span: $DIR/inner-attrs.rs:25:1: 25:4 (#0),
+ span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
},
Ident {
ident: "inline_mod",
- span: $DIR/inner-attrs.rs:25:5: 25:15 (#0),
+ span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
},
Group {
delimiter: Brace,
@@ -342,72 +342,72 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:26:5: 26:6 (#0),
+ span: $DIR/inner-attrs.rs:27:5: 27:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:26:6: 26:7 (#0),
+ span: $DIR/inner-attrs.rs:27:6: 27:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:26:8: 26:29 (#0),
+ span: $DIR/inner-attrs.rs:27:8: 27:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "mod_third",
- span: $DIR/inner-attrs.rs:26:30: 26:39 (#0),
+ span: $DIR/inner-attrs.rs:27:30: 27:39 (#0),
},
],
- span: $DIR/inner-attrs.rs:26:29: 26:40 (#0),
+ span: $DIR/inner-attrs.rs:27:29: 27:40 (#0),
},
],
- span: $DIR/inner-attrs.rs:26:7: 26:41 (#0),
+ span: $DIR/inner-attrs.rs:27:7: 27:41 (#0),
},
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:27:5: 27:6 (#0),
+ span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:27:6: 27:7 (#0),
+ span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:27:8: 27:29 (#0),
+ span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "mod_fourth",
- span: $DIR/inner-attrs.rs:27:30: 27:40 (#0),
+ span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
},
],
- span: $DIR/inner-attrs.rs:27:29: 27:41 (#0),
+ span: $DIR/inner-attrs.rs:28:29: 28:41 (#0),
},
],
- span: $DIR/inner-attrs.rs:27:7: 27:42 (#0),
+ span: $DIR/inner-attrs.rs:28:7: 28:42 (#0),
},
],
- span: $DIR/inner-attrs.rs:25:16: 28:2 (#0),
+ span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): mod_second
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "mod_second",
- span: $DIR/inner-attrs.rs:24:25: 24:35 (#0),
+ span: $DIR/inner-attrs.rs:25:25: 25:35 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): mod inline_mod
@@ -418,11 +418,11 @@ PRINT-ATTR INPUT (DISPLAY): mod inline_mod
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "mod",
- span: $DIR/inner-attrs.rs:25:1: 25:4 (#0),
+ span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
},
Ident {
ident: "inline_mod",
- span: $DIR/inner-attrs.rs:25:5: 25:15 (#0),
+ span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
},
Group {
delimiter: Brace,
@@ -430,83 +430,83 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:26:5: 26:6 (#0),
+ span: $DIR/inner-attrs.rs:27:5: 27:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:26:6: 26:7 (#0),
+ span: $DIR/inner-attrs.rs:27:6: 27:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:26:8: 26:29 (#0),
+ span: $DIR/inner-attrs.rs:27:8: 27:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "mod_third",
- span: $DIR/inner-attrs.rs:26:30: 26:39 (#0),
+ span: $DIR/inner-attrs.rs:27:30: 27:39 (#0),
},
],
- span: $DIR/inner-attrs.rs:26:29: 26:40 (#0),
+ span: $DIR/inner-attrs.rs:27:29: 27:40 (#0),
},
],
- span: $DIR/inner-attrs.rs:26:7: 26:41 (#0),
+ span: $DIR/inner-attrs.rs:27:7: 27:41 (#0),
},
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:27:5: 27:6 (#0),
+ span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:27:6: 27:7 (#0),
+ span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:27:8: 27:29 (#0),
+ span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "mod_fourth",
- span: $DIR/inner-attrs.rs:27:30: 27:40 (#0),
+ span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
},
],
- span: $DIR/inner-attrs.rs:27:29: 27:41 (#0),
+ span: $DIR/inner-attrs.rs:28:29: 28:41 (#0),
},
],
- span: $DIR/inner-attrs.rs:27:7: 27:42 (#0),
+ span: $DIR/inner-attrs.rs:28:7: 28:42 (#0),
},
],
- span: $DIR/inner-attrs.rs:25:16: 28:2 (#0),
+ span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): mod_third
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "mod_third",
- span: $DIR/inner-attrs.rs:26:30: 26:39 (#0),
+ span: $DIR/inner-attrs.rs:27:30: 27:39 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): mod inline_mod { #! [print_target_and_args(mod_fourth)] }
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "mod",
- span: $DIR/inner-attrs.rs:25:1: 25:4 (#0),
+ span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
},
Ident {
ident: "inline_mod",
- span: $DIR/inner-attrs.rs:25:5: 25:15 (#0),
+ span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
},
Group {
delimiter: Brace,
@@ -514,58 +514,58 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:27:5: 27:6 (#0),
+ span: $DIR/inner-attrs.rs:28:5: 28:6 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:27:6: 27:7 (#0),
+ span: $DIR/inner-attrs.rs:28:6: 28:7 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "print_target_and_args",
- span: $DIR/inner-attrs.rs:27:8: 27:29 (#0),
+ span: $DIR/inner-attrs.rs:28:8: 28:29 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "mod_fourth",
- span: $DIR/inner-attrs.rs:27:30: 27:40 (#0),
+ span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
},
],
- span: $DIR/inner-attrs.rs:27:29: 27:41 (#0),
+ span: $DIR/inner-attrs.rs:28:29: 28:41 (#0),
},
],
- span: $DIR/inner-attrs.rs:27:7: 27:42 (#0),
+ span: $DIR/inner-attrs.rs:28:7: 28:42 (#0),
},
],
- span: $DIR/inner-attrs.rs:25:16: 28:2 (#0),
+ span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): mod_fourth
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "mod_fourth",
- span: $DIR/inner-attrs.rs:27:30: 27:40 (#0),
+ span: $DIR/inner-attrs.rs:28:30: 28:40 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): mod inline_mod {}
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "mod",
- span: $DIR/inner-attrs.rs:25:1: 25:4 (#0),
+ span: $DIR/inner-attrs.rs:26:1: 26:4 (#0),
},
Ident {
ident: "inline_mod",
- span: $DIR/inner-attrs.rs:25:5: 25:15 (#0),
+ span: $DIR/inner-attrs.rs:26:5: 26:15 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:25:16: 28:2 (#0),
+ span: $DIR/inner-attrs.rs:26:16: 29:2 (#0),
},
]
PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint
@@ -576,63 +576,63 @@ PRINT-DERIVE INPUT (DISPLAY): struct MyDerivePrint
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "struct",
- span: $DIR/inner-attrs.rs:35:1: 35:7 (#0),
+ span: $DIR/inner-attrs.rs:36:1: 36:7 (#0),
},
Ident {
ident: "MyDerivePrint",
- span: $DIR/inner-attrs.rs:35:8: 35:21 (#0),
+ span: $DIR/inner-attrs.rs:36:8: 36:21 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [
Ident {
ident: "field",
- span: $DIR/inner-attrs.rs:36:5: 36:10 (#0),
+ span: $DIR/inner-attrs.rs:37:5: 37:10 (#0),
},
Punct {
ch: ':',
spacing: Alone,
- span: $DIR/inner-attrs.rs:36:10: 36:11 (#0),
+ span: $DIR/inner-attrs.rs:37:10: 37:11 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "u8",
- span: $DIR/inner-attrs.rs:36:13: 36:15 (#0),
+ span: $DIR/inner-attrs.rs:37:13: 37:15 (#0),
},
Punct {
ch: ';',
spacing: Alone,
- span: $DIR/inner-attrs.rs:36:15: 36:16 (#0),
+ span: $DIR/inner-attrs.rs:37:15: 37:16 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [
Ident {
ident: "match",
- span: $DIR/inner-attrs.rs:37:9: 37:14 (#0),
+ span: $DIR/inner-attrs.rs:38:9: 38:14 (#0),
},
Ident {
ident: "true",
- span: $DIR/inner-attrs.rs:37:15: 37:19 (#0),
+ span: $DIR/inner-attrs.rs:38:15: 38:19 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [
Ident {
ident: "_",
- span: $DIR/inner-attrs.rs:38:13: 38:14 (#0),
+ span: $DIR/inner-attrs.rs:39:13: 39:14 (#0),
},
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/inner-attrs.rs:38:15: 38:17 (#0),
+ span: $DIR/inner-attrs.rs:39:15: 39:16 (#0),
},
Punct {
ch: '>',
spacing: Alone,
- span: $DIR/inner-attrs.rs:38:15: 38:17 (#0),
+ span: $DIR/inner-attrs.rs:39:16: 39:17 (#0),
},
Group {
delimiter: Brace,
@@ -640,69 +640,69 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Alone,
- span: $DIR/inner-attrs.rs:39:17: 39:18 (#0),
+ span: $DIR/inner-attrs.rs:40:17: 40:18 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:39:18: 39:19 (#0),
+ span: $DIR/inner-attrs.rs:40:18: 40:19 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "rustc_dummy",
- span: $DIR/inner-attrs.rs:39:41: 39:52 (#0),
+ span: $DIR/inner-attrs.rs:40:41: 40:52 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "third",
- span: $DIR/inner-attrs.rs:39:53: 39:58 (#0),
+ span: $DIR/inner-attrs.rs:40:53: 40:58 (#0),
},
],
- span: $DIR/inner-attrs.rs:39:52: 39:59 (#0),
+ span: $DIR/inner-attrs.rs:40:52: 40:59 (#0),
},
],
- span: $DIR/inner-attrs.rs:39:17: 39:18 (#0),
+ span: $DIR/inner-attrs.rs:40:17: 40:18 (#0),
},
Ident {
ident: "true",
- span: $DIR/inner-attrs.rs:40:17: 40:21 (#0),
+ span: $DIR/inner-attrs.rs:41:17: 41:21 (#0),
},
],
- span: $DIR/inner-attrs.rs:38:18: 41:14 (#0),
+ span: $DIR/inner-attrs.rs:39:18: 42:14 (#0),
},
],
- span: $DIR/inner-attrs.rs:37:20: 42:10 (#0),
+ span: $DIR/inner-attrs.rs:38:20: 43:10 (#0),
},
Punct {
ch: ';',
spacing: Alone,
- span: $DIR/inner-attrs.rs:42:10: 42:11 (#0),
+ span: $DIR/inner-attrs.rs:43:10: 43:11 (#0),
},
Literal {
kind: Integer,
symbol: "0",
suffix: None,
- span: $DIR/inner-attrs.rs:43:9: 43:10 (#0),
+ span: $DIR/inner-attrs.rs:44:9: 44:10 (#0),
},
],
- span: $DIR/inner-attrs.rs:36:17: 44:6 (#0),
+ span: $DIR/inner-attrs.rs:37:17: 45:6 (#0),
},
],
- span: $DIR/inner-attrs.rs:36:12: 44:7 (#0),
+ span: $DIR/inner-attrs.rs:37:12: 45:7 (#0),
},
],
- span: $DIR/inner-attrs.rs:35:22: 45:2 (#0),
+ span: $DIR/inner-attrs.rs:36:22: 46:2 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "tuple_attrs",
- span: $DIR/inner-attrs.rs:48:29: 48:40 (#0),
+ span: $DIR/inner-attrs.rs:49:29: 49:40 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
@@ -714,23 +714,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
kind: Integer,
symbol: "3",
suffix: None,
- span: $DIR/inner-attrs.rs:49:9: 49:10 (#0),
+ span: $DIR/inner-attrs.rs:50:9: 50:10 (#0),
},
Punct {
ch: ',',
spacing: Alone,
- span: $DIR/inner-attrs.rs:49:10: 49:11 (#0),
+ span: $DIR/inner-attrs.rs:50:10: 50:11 (#0),
},
Literal {
kind: Integer,
symbol: "4",
suffix: None,
- span: $DIR/inner-attrs.rs:49:12: 49:13 (#0),
+ span: $DIR/inner-attrs.rs:50:12: 50:13 (#0),
},
Punct {
ch: ',',
spacing: Alone,
- span: $DIR/inner-attrs.rs:49:13: 49:14 (#0),
+ span: $DIR/inner-attrs.rs:50:13: 50:14 (#0),
},
Group {
delimiter: Brace,
@@ -738,85 +738,85 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:50:13: 50:14 (#0),
+ span: $DIR/inner-attrs.rs:51:13: 51:14 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:50:14: 50:15 (#0),
+ span: $DIR/inner-attrs.rs:51:14: 51:15 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "cfg_attr",
- span: $DIR/inner-attrs.rs:50:16: 50:24 (#0),
+ span: $DIR/inner-attrs.rs:51:16: 51:24 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "not",
- span: $DIR/inner-attrs.rs:50:25: 50:28 (#0),
+ span: $DIR/inner-attrs.rs:51:25: 51:28 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "FALSE",
- span: $DIR/inner-attrs.rs:50:29: 50:34 (#0),
+ span: $DIR/inner-attrs.rs:51:29: 51:34 (#0),
},
],
- span: $DIR/inner-attrs.rs:50:28: 50:35 (#0),
+ span: $DIR/inner-attrs.rs:51:28: 51:35 (#0),
},
Punct {
ch: ',',
spacing: Alone,
- span: $DIR/inner-attrs.rs:50:35: 50:36 (#0),
+ span: $DIR/inner-attrs.rs:51:35: 51:36 (#0),
},
Ident {
ident: "rustc_dummy",
- span: $DIR/inner-attrs.rs:50:37: 50:48 (#0),
+ span: $DIR/inner-attrs.rs:51:37: 51:48 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "innermost",
- span: $DIR/inner-attrs.rs:50:49: 50:58 (#0),
+ span: $DIR/inner-attrs.rs:51:49: 51:58 (#0),
},
],
- span: $DIR/inner-attrs.rs:50:48: 50:59 (#0),
+ span: $DIR/inner-attrs.rs:51:48: 51:59 (#0),
},
],
- span: $DIR/inner-attrs.rs:50:24: 50:60 (#0),
+ span: $DIR/inner-attrs.rs:51:24: 51:60 (#0),
},
],
- span: $DIR/inner-attrs.rs:50:15: 50:61 (#0),
+ span: $DIR/inner-attrs.rs:51:15: 51:61 (#0),
},
Literal {
kind: Integer,
symbol: "5",
suffix: None,
- span: $DIR/inner-attrs.rs:51:13: 51:14 (#0),
+ span: $DIR/inner-attrs.rs:52:13: 52:14 (#0),
},
],
- span: $DIR/inner-attrs.rs:49:15: 52:10 (#0),
+ span: $DIR/inner-attrs.rs:50:15: 53:10 (#0),
},
],
- span: $DIR/inner-attrs.rs:48:43: 53:6 (#0),
+ span: $DIR/inner-attrs.rs:49:43: 54:6 (#0),
},
Punct {
ch: ';',
spacing: Alone,
- span: $DIR/inner-attrs.rs:53:6: 53:7 (#0),
+ span: $DIR/inner-attrs.rs:54:6: 54:7 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): tuple_attrs
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "tuple_attrs",
- span: $DIR/inner-attrs.rs:55:29: 55:40 (#0),
+ span: $DIR/inner-attrs.rs:56:29: 56:40 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): (3, 4, { #! [cfg_attr(not(FALSE), rustc_dummy(innermost))] 5 }) ;
@@ -828,23 +828,23 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
kind: Integer,
symbol: "3",
suffix: None,
- span: $DIR/inner-attrs.rs:56:9: 56:10 (#0),
+ span: $DIR/inner-attrs.rs:57:9: 57:10 (#0),
},
Punct {
ch: ',',
spacing: Alone,
- span: $DIR/inner-attrs.rs:56:10: 56:11 (#0),
+ span: $DIR/inner-attrs.rs:57:10: 57:11 (#0),
},
Literal {
kind: Integer,
symbol: "4",
suffix: None,
- span: $DIR/inner-attrs.rs:56:12: 56:13 (#0),
+ span: $DIR/inner-attrs.rs:57:12: 57:13 (#0),
},
Punct {
ch: ',',
spacing: Alone,
- span: $DIR/inner-attrs.rs:56:13: 56:14 (#0),
+ span: $DIR/inner-attrs.rs:57:13: 57:14 (#0),
},
Group {
delimiter: Brace,
@@ -852,105 +852,105 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '#',
spacing: Joint,
- span: $DIR/inner-attrs.rs:57:13: 57:14 (#0),
+ span: $DIR/inner-attrs.rs:58:13: 58:14 (#0),
},
Punct {
ch: '!',
spacing: Alone,
- span: $DIR/inner-attrs.rs:57:14: 57:15 (#0),
+ span: $DIR/inner-attrs.rs:58:14: 58:15 (#0),
},
Group {
delimiter: Bracket,
stream: TokenStream [
Ident {
ident: "cfg_attr",
- span: $DIR/inner-attrs.rs:57:16: 57:24 (#0),
+ span: $DIR/inner-attrs.rs:58:16: 58:24 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "not",
- span: $DIR/inner-attrs.rs:57:25: 57:28 (#0),
+ span: $DIR/inner-attrs.rs:58:25: 58:28 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "FALSE",
- span: $DIR/inner-attrs.rs:57:29: 57:34 (#0),
+ span: $DIR/inner-attrs.rs:58:29: 58:34 (#0),
},
],
- span: $DIR/inner-attrs.rs:57:28: 57:35 (#0),
+ span: $DIR/inner-attrs.rs:58:28: 58:35 (#0),
},
Punct {
ch: ',',
spacing: Alone,
- span: $DIR/inner-attrs.rs:57:35: 57:36 (#0),
+ span: $DIR/inner-attrs.rs:58:35: 58:36 (#0),
},
Ident {
ident: "rustc_dummy",
- span: $DIR/inner-attrs.rs:57:37: 57:48 (#0),
+ span: $DIR/inner-attrs.rs:58:37: 58:48 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [
Ident {
ident: "innermost",
- span: $DIR/inner-attrs.rs:57:49: 57:58 (#0),
+ span: $DIR/inner-attrs.rs:58:49: 58:58 (#0),
},
],
- span: $DIR/inner-attrs.rs:57:48: 57:59 (#0),
+ span: $DIR/inner-attrs.rs:58:48: 58:59 (#0),
},
],
- span: $DIR/inner-attrs.rs:57:24: 57:60 (#0),
+ span: $DIR/inner-attrs.rs:58:24: 58:60 (#0),
},
],
- span: $DIR/inner-attrs.rs:57:15: 57:61 (#0),
+ span: $DIR/inner-attrs.rs:58:15: 58:61 (#0),
},
Literal {
kind: Integer,
symbol: "5",
suffix: None,
- span: $DIR/inner-attrs.rs:58:13: 58:14 (#0),
+ span: $DIR/inner-attrs.rs:59:13: 59:14 (#0),
},
],
- span: $DIR/inner-attrs.rs:56:15: 59:10 (#0),
+ span: $DIR/inner-attrs.rs:57:15: 60:10 (#0),
},
],
- span: $DIR/inner-attrs.rs:55:43: 60:6 (#0),
+ span: $DIR/inner-attrs.rs:56:43: 61:6 (#0),
},
Punct {
ch: ';',
spacing: Alone,
- span: $DIR/inner-attrs.rs:60:6: 60:7 (#0),
+ span: $DIR/inner-attrs.rs:61:6: 61:7 (#0),
},
]
PRINT-ATTR_ARGS INPUT (DISPLAY): tenth
PRINT-ATTR_ARGS INPUT (DEBUG): TokenStream [
Ident {
ident: "tenth",
- span: $DIR/inner-attrs.rs:82:42: 82:47 (#0),
+ span: $DIR/inner-attrs.rs:83:42: 83:47 (#0),
},
]
PRINT-ATTR INPUT (DISPLAY): fn weird_extern() {}
PRINT-ATTR INPUT (DEBUG): TokenStream [
Ident {
ident: "fn",
- span: $DIR/inner-attrs.rs:81:5: 81:7 (#0),
+ span: $DIR/inner-attrs.rs:82:5: 82:7 (#0),
},
Ident {
ident: "weird_extern",
- span: $DIR/inner-attrs.rs:81:8: 81:20 (#0),
+ span: $DIR/inner-attrs.rs:82:8: 82:20 (#0),
},
Group {
delimiter: Parenthesis,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:81:20: 81:22 (#0),
+ span: $DIR/inner-attrs.rs:82:20: 82:22 (#0),
},
Group {
delimiter: Brace,
stream: TokenStream [],
- span: $DIR/inner-attrs.rs:81:23: 83:6 (#0),
+ span: $DIR/inner-attrs.rs:82:23: 84:6 (#0),
},
]
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-1.rs b/src/test/ui/proc-macro/invalid-punct-ident-1.rs
index 814cd77cf..9a1802737 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-1.rs
+++ b/src/test/ui/proc-macro/invalid-punct-ident-1.rs
@@ -1,4 +1,5 @@
// aux-build:invalid-punct-ident.rs
+// needs-unwind proc macro panics to report errors
#[macro_use]
extern crate invalid_punct_ident;
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-1.stderr b/src/test/ui/proc-macro/invalid-punct-ident-1.stderr
index 7babe685b..78aa84401 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-1.stderr
+++ b/src/test/ui/proc-macro/invalid-punct-ident-1.stderr
@@ -1,5 +1,5 @@
error: proc macro panicked
- --> $DIR/invalid-punct-ident-1.rs:6:1
+ --> $DIR/invalid-punct-ident-1.rs:7:1
|
LL | invalid_punct!();
| ^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-2.rs b/src/test/ui/proc-macro/invalid-punct-ident-2.rs
index a04dec707..afb6985e4 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-2.rs
+++ b/src/test/ui/proc-macro/invalid-punct-ident-2.rs
@@ -1,4 +1,5 @@
// aux-build:invalid-punct-ident.rs
+// needs-unwind proc macro panics to report errors
#[macro_use]
extern crate invalid_punct_ident;
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-2.stderr b/src/test/ui/proc-macro/invalid-punct-ident-2.stderr
index 01b80768c..66979e756 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-2.stderr
+++ b/src/test/ui/proc-macro/invalid-punct-ident-2.stderr
@@ -1,5 +1,5 @@
error: proc macro panicked
- --> $DIR/invalid-punct-ident-2.rs:6:1
+ --> $DIR/invalid-punct-ident-2.rs:7:1
|
LL | invalid_ident!();
| ^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-3.rs b/src/test/ui/proc-macro/invalid-punct-ident-3.rs
index f0e953608..ff83695c5 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-3.rs
+++ b/src/test/ui/proc-macro/invalid-punct-ident-3.rs
@@ -1,4 +1,5 @@
// aux-build:invalid-punct-ident.rs
+// needs-unwind proc macro panics to report errors
#[macro_use]
extern crate invalid_punct_ident;
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-3.stderr b/src/test/ui/proc-macro/invalid-punct-ident-3.stderr
index 899c38158..c096bc8c0 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-3.stderr
+++ b/src/test/ui/proc-macro/invalid-punct-ident-3.stderr
@@ -1,5 +1,5 @@
error: proc macro panicked
- --> $DIR/invalid-punct-ident-3.rs:6:1
+ --> $DIR/invalid-punct-ident-3.rs:7:1
|
LL | invalid_raw_ident!();
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-4.rs b/src/test/ui/proc-macro/invalid-punct-ident-4.rs
index 59b347dac..2d2774bd1 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-4.rs
+++ b/src/test/ui/proc-macro/invalid-punct-ident-4.rs
@@ -1,4 +1,5 @@
// aux-build:invalid-punct-ident.rs
+// needs-unwind proc macro panics to report errors
#[macro_use]
extern crate invalid_punct_ident;
diff --git a/src/test/ui/proc-macro/invalid-punct-ident-4.stderr b/src/test/ui/proc-macro/invalid-punct-ident-4.stderr
index deb93b893..ab4116141 100644
--- a/src/test/ui/proc-macro/invalid-punct-ident-4.stderr
+++ b/src/test/ui/proc-macro/invalid-punct-ident-4.stderr
@@ -1,5 +1,5 @@
error: unexpected closing delimiter: `)`
- --> $DIR/invalid-punct-ident-4.rs:6:1
+ --> $DIR/invalid-punct-ident-4.rs:7:1
|
LL | lexer_failure!();
| ^^^^^^^^^^^^^^^^ unexpected closing delimiter
@@ -7,13 +7,13 @@ LL | lexer_failure!();
= note: this error originates in the macro `lexer_failure` (in Nightly builds, run with -Z macro-backtrace for more info)
error: proc macro panicked
- --> $DIR/invalid-punct-ident-4.rs:6:1
+ --> $DIR/invalid-punct-ident-4.rs:7:1
|
LL | lexer_failure!();
| ^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
- --> $DIR/invalid-punct-ident-4.rs:11:33
+ --> $DIR/invalid-punct-ident-4.rs:12:33
|
LL | let _recovery_witness: () = 0;
| -- ^ expected `()`, found integer
diff --git a/src/test/ui/proc-macro/issue-36935.rs b/src/test/ui/proc-macro/issue-36935.rs
index 5c43a564c..03cdfa05e 100644
--- a/src/test/ui/proc-macro/issue-36935.rs
+++ b/src/test/ui/proc-macro/issue-36935.rs
@@ -1,4 +1,5 @@
// aux-build:test-macros.rs
+// needs-unwind proc macro panics to report errors
#[macro_use]
extern crate test_macros;
diff --git a/src/test/ui/proc-macro/issue-36935.stderr b/src/test/ui/proc-macro/issue-36935.stderr
index 079e134c6..122903798 100644
--- a/src/test/ui/proc-macro/issue-36935.stderr
+++ b/src/test/ui/proc-macro/issue-36935.stderr
@@ -1,5 +1,5 @@
error[E0428]: the name `Baz` is defined multiple times
- --> $DIR/issue-36935.rs:7:1
+ --> $DIR/issue-36935.rs:8:1
|
LL | struct Baz {
| ^^^^^^^^^^
@@ -10,7 +10,7 @@ LL | struct Baz {
= note: `Baz` must be defined only once in the type namespace of this module
error: proc-macro derive panicked
- --> $DIR/issue-36935.rs:6:20
+ --> $DIR/issue-36935.rs:7:20
|
LL | #[derive(Identity, Panic)]
| ^^^^^
diff --git a/src/test/ui/proc-macro/issue-41211.rs b/src/test/ui/proc-macro/issue-41211.rs
deleted file mode 100644
index 072a63baf..000000000
--- a/src/test/ui/proc-macro/issue-41211.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// aux-build:test-macros.rs
-
-// FIXME: https://github.com/rust-lang/rust/issues/41430
-// This is a temporary regression test for the ICE reported in #41211
-
-#![feature(custom_inner_attributes)]
-#![feature(register_attr)]
-
-#![register_attr(identity_attr)]
-
-#![identity_attr]
-//~^ ERROR `identity_attr` is ambiguous
-extern crate test_macros;
-use test_macros::identity_attr;
-
-fn main() {}
diff --git a/src/test/ui/proc-macro/issue-41211.stderr b/src/test/ui/proc-macro/issue-41211.stderr
deleted file mode 100644
index 60cd36a9c..000000000
--- a/src/test/ui/proc-macro/issue-41211.stderr
+++ /dev/null
@@ -1,22 +0,0 @@
-error[E0659]: `identity_attr` is ambiguous
- --> $DIR/issue-41211.rs:11:4
- |
-LL | #![identity_attr]
- | ^^^^^^^^^^^^^ ambiguous name
- |
- = 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: `identity_attr` could refer to the attribute macro imported here
- --> $DIR/issue-41211.rs:14:5
- |
-LL | use test_macros::identity_attr;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: use `crate::identity_attr` to refer to this attribute macro unambiguously
-note: `identity_attr` could also refer to the explicitly registered attribute defined here
- --> $DIR/issue-41211.rs:9:18
- |
-LL | #![register_attr(identity_attr)]
- | ^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0659`.
diff --git a/src/test/ui/proc-macro/issue-73933-procedural-masquerade.rs b/src/test/ui/proc-macro/issue-73933-procedural-masquerade.rs
index 0c1c51c01..a573c6e1c 100644
--- a/src/test/ui/proc-macro/issue-73933-procedural-masquerade.rs
+++ b/src/test/ui/proc-macro/issue-73933-procedural-masquerade.rs
@@ -1,18 +1,11 @@
// aux-build:test-macros.rs
+// check-pass
#[macro_use]
extern crate test_macros;
#[derive(Print)]
enum ProceduralMasqueradeDummyType {
-//~^ ERROR using
-//~| WARN this was previously
-//~| ERROR using
-//~| WARN this was previously
-//~| ERROR using
-//~| WARN this was previously
-//~| ERROR using
-//~| WARN this was previously
Input
}
diff --git a/src/test/ui/proc-macro/issue-73933-procedural-masquerade.stderr b/src/test/ui/proc-macro/issue-73933-procedural-masquerade.stderr
deleted file mode 100644
index be4239089..000000000
--- a/src/test/ui/proc-macro/issue-73933-procedural-masquerade.stderr
+++ /dev/null
@@ -1,91 +0,0 @@
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[deny(proc_macro_back_compat)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
-error: aborting due to 4 previous errors
-
-Future incompatibility report: Future breakage diagnostic:
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[deny(proc_macro_back_compat)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
-Future breakage diagnostic:
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[deny(proc_macro_back_compat)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
-Future breakage diagnostic:
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[deny(proc_macro_back_compat)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
-Future breakage diagnostic:
-error: using `procedural-masquerade` crate
- --> $DIR/issue-73933-procedural-masquerade.rs:7:6
- |
-LL | enum ProceduralMasqueradeDummyType {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `#[deny(proc_macro_back_compat)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #83125 <https://github.com/rust-lang/rust/issues/83125>
- = note: The `procedural-masquerade` crate has been unnecessary since Rust 1.30.0. Versions of this crate below 0.1.7 will eventually stop compiling.
-
diff --git a/src/test/ui/proc-macro/issue-73933-procedural-masquerade.stdout b/src/test/ui/proc-macro/issue-73933-procedural-masquerade.stdout
index 50334589d..8cd981e03 100644
--- a/src/test/ui/proc-macro/issue-73933-procedural-masquerade.stdout
+++ b/src/test/ui/proc-macro/issue-73933-procedural-masquerade.stdout
@@ -1,22 +1,21 @@
-PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input, }
-PRINT-DERIVE RE-COLLECTED (DISPLAY): enum ProceduralMasqueradeDummyType { Input }
+PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input }
PRINT-DERIVE INPUT (DEBUG): TokenStream [
Ident {
ident: "enum",
- span: #0 bytes(86..90),
+ span: #0 bytes(100..104),
},
Ident {
ident: "ProceduralMasqueradeDummyType",
- span: #0 bytes(91..120),
+ span: #0 bytes(105..134),
},
Group {
delimiter: Brace,
stream: TokenStream [
Ident {
ident: "Input",
- span: #0 bytes(315..320),
+ span: #0 bytes(141..146),
},
],
- span: #0 bytes(121..322),
+ span: #0 bytes(135..148),
},
]
diff --git a/src/test/ui/proc-macro/issue-75930-derive-cfg.stderr b/src/test/ui/proc-macro/issue-75930-derive-cfg.stderr
index 69d72b55c..6d1efb0dc 100644
--- a/src/test/ui/proc-macro/issue-75930-derive-cfg.stderr
+++ b/src/test/ui/proc-macro/issue-75930-derive-cfg.stderr
@@ -7,9 +7,9 @@ LL | #[print_helper(a)]
LL | #[derive(Print)]
| ----- the attribute is introduced here
|
- = note: `#[warn(legacy_derive_helpers)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
+ = note: `#[warn(legacy_derive_helpers)]` on by default
warning: derive helper attribute is used before it is introduced
--> $DIR/issue-75930-derive-cfg.rs:19:3
diff --git a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
index c81fa201c..83afd0d3e 100644
--- a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
+++ b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout
@@ -489,12 +489,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:33 (#0),
},
Punct {
ch: '>',
spacing: Alone,
- span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:33:33: 33:34 (#0),
},
Group {
delimiter: Brace,
@@ -567,12 +567,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0),
},
Punct {
ch: '>',
spacing: Alone,
- span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0),
},
Group {
delimiter: Brace,
@@ -591,12 +591,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0),
},
Punct {
ch: '>',
spacing: Alone,
- span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0),
},
Group {
delimiter: Brace,
@@ -1519,12 +1519,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0),
},
Punct {
ch: '>',
spacing: Alone,
- span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0),
},
Group {
delimiter: Brace,
@@ -1543,12 +1543,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0),
},
Punct {
ch: '>',
spacing: Alone,
- span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0),
+ span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0),
},
Group {
delimiter: Brace,
diff --git a/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout b/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout
index 5493f9c7b..09eb33f7e 100644
--- a/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout
+++ b/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout
@@ -41,12 +41,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [
Punct {
ch: '=',
spacing: Joint,
- span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0),
+ span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:22 (#0),
},
Punct {
ch: '>',
spacing: Alone,
- span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0),
+ span: $DIR/issue-76182-leading-vert-pat.rs:15:22: 15:23 (#0),
},
Group {
delimiter: Parenthesis,
diff --git a/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs b/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs
index 98fa06b6e..5aefec3ec 100644
--- a/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs
+++ b/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.rs
@@ -1,5 +1,6 @@
// aux-build:proc-macro-panic.rs
// edition:2018
+// needs-unwind proc macro panics to report errors
// Regression test for issue #76270
// Tests that we don't print an ICE message when a panic
diff --git a/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr b/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr
index 1dc0f16bf..d69de23a4 100644
--- a/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr
+++ b/src/test/ui/proc-macro/issue-76270-panic-in-libproc-macro.stderr
@@ -1,5 +1,5 @@
error: proc macro panicked
- --> $DIR/issue-76270-panic-in-libproc-macro.rs:10:1
+ --> $DIR/issue-76270-panic-in-libproc-macro.rs:11:1
|
LL | proc_macro_panic::panic_in_libproc_macro!();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/proc-macro/issue-79148.rs b/src/test/ui/proc-macro/issue-79148.rs
new file mode 100644
index 000000000..3f01187a8
--- /dev/null
+++ b/src/test/ui/proc-macro/issue-79148.rs
@@ -0,0 +1,10 @@
+// aux-build:re-export.rs
+// edition:2018
+
+extern crate re_export;
+
+use re_export::cause_ice;
+
+cause_ice!(); //~ ERROR `Variant` is only public within the crate, and cannot be re-exported outside
+
+fn main() {}
diff --git a/src/test/ui/proc-macro/issue-79148.stderr b/src/test/ui/proc-macro/issue-79148.stderr
new file mode 100644
index 000000000..a3b2de01d
--- /dev/null
+++ b/src/test/ui/proc-macro/issue-79148.stderr
@@ -0,0 +1,16 @@
+error[E0364]: `Variant` is only public within the crate, and cannot be re-exported outside
+ --> $DIR/issue-79148.rs:8:1
+ |
+LL | cause_ice!();
+ | ^^^^^^^^^^^^
+ |
+note: consider marking `Variant` as `pub` in the imported module
+ --> $DIR/issue-79148.rs:8:1
+ |
+LL | cause_ice!();
+ | ^^^^^^^^^^^^
+ = note: this error originates in the macro `cause_ice` (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 E0364`.
diff --git a/src/test/ui/proc-macro/keep-expr-tokens.stderr b/src/test/ui/proc-macro/keep-expr-tokens.stderr
index 11052d11c..1a1f83cc1 100644
--- a/src/test/ui/proc-macro/keep-expr-tokens.stderr
+++ b/src/test/ui/proc-macro/keep-expr-tokens.stderr
@@ -1,15 +1,15 @@
-error[E0425]: cannot find function `missing_fn` in this scope
- --> $DIR/keep-expr-tokens.rs:17:17
- |
-LL | for item in missing_fn() {}
- | ^^^^^^^^^^ not found in this scope
-
error[E0425]: cannot find value `bad` in this scope
--> $DIR/keep-expr-tokens.rs:19:62
|
LL | (#[recollect_attr] #[recollect_attr] ((#[recollect_attr] bad)));
| ^^^ not found in this scope
+error[E0425]: cannot find function `missing_fn` in this scope
+ --> $DIR/keep-expr-tokens.rs:17:17
+ |
+LL | for item in missing_fn() {}
+ | ^^^^^^^^^^ not found in this scope
+
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/proc-macro/load-panic-backtrace.rs b/src/test/ui/proc-macro/load-panic-backtrace.rs
index cd6f70a55..bcdcb704a 100644
--- a/src/test/ui/proc-macro/load-panic-backtrace.rs
+++ b/src/test/ui/proc-macro/load-panic-backtrace.rs
@@ -3,6 +3,7 @@
// rustc-env:RUST_BACKTRACE=0
// normalize-stderr-test "thread '.*' panicked " -> ""
// normalize-stderr-test "note:.*RUST_BACKTRACE=1.*\n" -> ""
+// needs-unwind proc macro panics to report errors
#[macro_use]
extern crate test_macros;
diff --git a/src/test/ui/proc-macro/load-panic-backtrace.stderr b/src/test/ui/proc-macro/load-panic-backtrace.stderr
index cef5786d1..45d4fd1c9 100644
--- a/src/test/ui/proc-macro/load-panic-backtrace.stderr
+++ b/src/test/ui/proc-macro/load-panic-backtrace.stderr
@@ -1,6 +1,6 @@
at 'panic-derive', $DIR/auxiliary/test-macros.rs:43:5
error: proc-macro derive panicked
- --> $DIR/load-panic-backtrace.rs:10:10
+ --> $DIR/load-panic-backtrace.rs:11:10
|
LL | #[derive(Panic)]
| ^^^^^
diff --git a/src/test/ui/proc-macro/load-panic.rs b/src/test/ui/proc-macro/load-panic.rs
index 2e9a311d8..6ce88c400 100644
--- a/src/test/ui/proc-macro/load-panic.rs
+++ b/src/test/ui/proc-macro/load-panic.rs
@@ -1,4 +1,5 @@
// aux-build:test-macros.rs
+// needs-unwind proc macro panics to report errors
#[macro_use]
extern crate test_macros;
diff --git a/src/test/ui/proc-macro/load-panic.stderr b/src/test/ui/proc-macro/load-panic.stderr
index 40cc4ee0e..f0d62f690 100644
--- a/src/test/ui/proc-macro/load-panic.stderr
+++ b/src/test/ui/proc-macro/load-panic.stderr
@@ -1,5 +1,5 @@
error: proc-macro derive panicked
- --> $DIR/load-panic.rs:6:10
+ --> $DIR/load-panic.rs:7:10
|
LL | #[derive(Panic)]
| ^^^^^
diff --git a/src/test/ui/proc-macro/meta-macro-hygiene.rs b/src/test/ui/proc-macro/meta-macro-hygiene.rs
index 62968ea54..70b8d8da1 100644
--- a/src/test/ui/proc-macro/meta-macro-hygiene.rs
+++ b/src/test/ui/proc-macro/meta-macro-hygiene.rs
@@ -19,8 +19,8 @@ macro_rules! produce_it {
// `print_def_site!` will respan the `$crate` identifier
// with `Span::def_site()`. This should cause it to resolve
// relative to `meta_macro`, *not* `make_macro` (despite
- // the fact that that `print_def_site` is produced by
- // a `macro_rules!` macro in `make_macro`).
+ // the fact that `print_def_site` is produced by a
+ // `macro_rules!` macro in `make_macro`).
meta_macro::print_def_site!($crate::dummy!());
}
}
diff --git a/src/test/ui/proc-macro/meta-macro-hygiene.stdout b/src/test/ui/proc-macro/meta-macro-hygiene.stdout
index 5d04fe1e3..6b7b0c819 100644
--- a/src/test/ui/proc-macro/meta-macro-hygiene.stdout
+++ b/src/test/ui/proc-macro/meta-macro-hygiene.stdout
@@ -1,5 +1,5 @@
Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5)
-Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
+Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:44 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:44: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }]
Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }]
#![feature /* 0#0 */(prelude_import)]
// aux-build:make-macro.rs
@@ -35,8 +35,8 @@ macro_rules! produce_it
// `print_def_site!` will respan the `$crate` identifier
// with `Span::def_site()`. This should cause it to resolve
// relative to `meta_macro`, *not* `make_macro` (despite
- // the fact that that `print_def_site` is produced by
- // a `macro_rules!` macro in `make_macro`).
+ // the fact that `print_def_site` is produced by a
+ // `macro_rules!` macro in `make_macro`).
}
}
diff --git a/src/test/ui/proc-macro/mixed-site-span.stderr b/src/test/ui/proc-macro/mixed-site-span.stderr
index eab4317de..137860801 100644
--- a/src/test/ui/proc-macro/mixed-site-span.stderr
+++ b/src/test/ui/proc-macro/mixed-site-span.stderr
@@ -10,7 +10,7 @@ error[E0425]: cannot find value `local_use` in this scope
--> $DIR/mixed-site-span.rs:13:9
|
LL | proc_macro_rules!();
- | ^^^^^^^^^^^^^^^^^^^ not found in this scope
+ | ^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def`
|
= note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
@@ -18,7 +18,7 @@ error[E0425]: cannot find value `local_def` in this scope
--> $DIR/mixed-site-span.rs:17:9
|
LL | local_def;
- | ^^^^^^^^^ not found in this scope
+ | ^^^^^^^^^ help: a local variable with a similar name exists: `local_use`
error[E0412]: cannot find type `ItemUse` in crate `$crate`
--> $DIR/mixed-site-span.rs:24:1
diff --git a/src/test/ui/proc-macro/pretty-print-hack-hide.rs b/src/test/ui/proc-macro/pretty-print-hack-hide.rs
new file mode 100644
index 000000000..f53e8fe82
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack-hide.rs
@@ -0,0 +1,12 @@
+// aux-build:test-macros.rs
+// compile-flags: -Z span-debug
+// check-pass
+
+#![no_std] // Don't load unnecessary hygiene information from std
+extern crate std;
+
+#[macro_use] extern crate test_macros;
+
+include!("pretty-print-hack/rental-0.5.6/src/lib.rs");
+
+fn main() {}
diff --git a/src/test/ui/proc-macro/pretty-print-hack-hide.stdout b/src/test/ui/proc-macro/pretty-print-hack-hide.stdout
new file mode 100644
index 000000000..ea796bb26
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack-hide.stdout
@@ -0,0 +1,21 @@
+PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input }
+PRINT-DERIVE INPUT (DEBUG): TokenStream [
+ Ident {
+ ident: "enum",
+ span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:4:1: 4:5 (#0),
+ },
+ Ident {
+ ident: "ProceduralMasqueradeDummyType",
+ span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:4:6: 4:35 (#0),
+ },
+ Group {
+ delimiter: Brace,
+ stream: TokenStream [
+ Ident {
+ ident: "Input",
+ span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:13:5: 13:10 (#0),
+ },
+ ],
+ span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:4:36: 14:2 (#0),
+ },
+]
diff --git a/src/test/ui/proc-macro/pretty-print-hack-show.rs b/src/test/ui/proc-macro/pretty-print-hack-show.rs
new file mode 100644
index 000000000..9b1899e49
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack-show.rs
@@ -0,0 +1,17 @@
+// aux-build:test-macros.rs
+// compile-flags: -Z span-debug
+
+#![no_std] // Don't load unnecessary hygiene information from std
+extern crate std;
+
+#[macro_use] extern crate test_macros;
+
+mod first {
+ include!("pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs");
+}
+
+mod second {
+ include!("pretty-print-hack/rental-0.5.5/src/lib.rs");
+}
+
+fn main() {}
diff --git a/src/test/ui/proc-macro/pretty-print-hack-show.stderr b/src/test/ui/proc-macro/pretty-print-hack-show.stderr
new file mode 100644
index 000000000..873054927
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack-show.stderr
@@ -0,0 +1,179 @@
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+
+error: aborting due to 8 previous errors
+
+Future incompatibility report: Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
+Future breakage diagnostic:
+error: using an old version of `rental`
+ --> $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6
+ |
+LL | enum ProceduralMasqueradeDummyType {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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 #83125 <https://github.com/rust-lang/rust/issues/83125>
+ = note: older versions of the `rental` crate will stop compiling in future versions of Rust; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives
+ = note: `#[deny(proc_macro_back_compat)]` on by default
+
diff --git a/src/test/ui/proc-macro/pretty-print-hack-show.stdout b/src/test/ui/proc-macro/pretty-print-hack-show.stdout
new file mode 100644
index 000000000..3d793d2a0
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack-show.stdout
@@ -0,0 +1,44 @@
+PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input, }
+PRINT-DERIVE RE-COLLECTED (DISPLAY): enum ProceduralMasqueradeDummyType { Input }
+PRINT-DERIVE INPUT (DEBUG): TokenStream [
+ Ident {
+ ident: "enum",
+ span: $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:1: 4:5 (#0),
+ },
+ Ident {
+ ident: "ProceduralMasqueradeDummyType",
+ span: $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:6: 4:35 (#0),
+ },
+ Group {
+ delimiter: Brace,
+ stream: TokenStream [
+ Ident {
+ ident: "Input",
+ span: $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:13:5: 13:10 (#0),
+ },
+ ],
+ span: $DIR/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs:4:36: 14:2 (#0),
+ },
+]
+PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input, }
+PRINT-DERIVE RE-COLLECTED (DISPLAY): enum ProceduralMasqueradeDummyType { Input }
+PRINT-DERIVE INPUT (DEBUG): TokenStream [
+ Ident {
+ ident: "enum",
+ span: $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:1: 4:5 (#0),
+ },
+ Ident {
+ ident: "ProceduralMasqueradeDummyType",
+ span: $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:6: 4:35 (#0),
+ },
+ Group {
+ delimiter: Brace,
+ stream: TokenStream [
+ Ident {
+ ident: "Input",
+ span: $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:13:5: 13:10 (#0),
+ },
+ ],
+ span: $DIR/pretty-print-hack/rental-0.5.5/src/lib.rs:4:36: 14:2 (#0),
+ },
+]
diff --git a/src/test/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs b/src/test/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs
new file mode 100644
index 000000000..9501980fa
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs
@@ -0,0 +1,14 @@
+// ignore-test
+
+#[derive(Print)]
+enum ProceduralMasqueradeDummyType {
+//~^ ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+ Input
+}
diff --git a/src/test/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs b/src/test/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs
new file mode 100644
index 000000000..9501980fa
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs
@@ -0,0 +1,14 @@
+// ignore-test
+
+#[derive(Print)]
+enum ProceduralMasqueradeDummyType {
+//~^ ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+ Input
+}
diff --git a/src/test/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs b/src/test/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs
new file mode 100644
index 000000000..9501980fa
--- /dev/null
+++ b/src/test/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs
@@ -0,0 +1,14 @@
+// ignore-test
+
+#[derive(Print)]
+enum ProceduralMasqueradeDummyType {
+//~^ ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+//~| ERROR using
+//~| WARN this was previously
+ Input
+}
diff --git a/src/test/ui/proc-macro/proc-macro-attributes.stderr b/src/test/ui/proc-macro/proc-macro-attributes.stderr
index b66e4575e..140d87906 100644
--- a/src/test/ui/proc-macro/proc-macro-attributes.stderr
+++ b/src/test/ui/proc-macro/proc-macro-attributes.stderr
@@ -85,9 +85,9 @@ LL | #[B]
LL | #[derive(B)]
| - the attribute is introduced here
|
- = note: `#[warn(legacy_derive_helpers)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79202 <https://github.com/rust-lang/rust/issues/79202>
+ = note: `#[warn(legacy_derive_helpers)]` on by default
warning: derive helper attribute is used before it is introduced
--> $DIR/proc-macro-attributes.rs:10:3
diff --git a/src/test/ui/proc-macro/proc-macro-gates.stderr b/src/test/ui/proc-macro/proc-macro-gates.stderr
index 118213a17..3feb9b829 100644
--- a/src/test/ui/proc-macro/proc-macro-gates.stderr
+++ b/src/test/ui/proc-macro/proc-macro-gates.stderr
@@ -82,9 +82,9 @@ error: inner macro attributes are unstable
LL | #![test]
| ^^^^
|
- = note: `#[deny(soft_unstable)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #64266 <https://github.com/rust-lang/rust/issues/64266>
+ = note: `#[deny(soft_unstable)]` on by default
error: aborting due to 10 previous errors
diff --git a/src/test/ui/proc-macro/signature.stderr b/src/test/ui/proc-macro/signature.stderr
index a6bd98ddb..59b3e44c7 100644
--- a/src/test/ui/proc-macro/signature.stderr
+++ b/src/test/ui/proc-macro/signature.stderr
@@ -5,9 +5,12 @@ LL | / pub unsafe extern "C" fn foo(a: i32, b: u32) -> u32 {
LL | |
LL | | loop {}
LL | | }
- | |_^ call the function in a closure: `|| unsafe { /* code */ }`
+ | | ^
+ | | |
+ | |_call the function in a closure: `|| unsafe { /* code */ }`
+ | required by a bound introduced by this call
|
- = help: the trait `Fn<(proc_macro::TokenStream,)>` is not implemented for `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
+ = help: the trait `Fn<(proc_macro::TokenStream,)>` is not implemented for fn item `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `ProcMacro::custom_derive`
--> $SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
diff --git a/src/test/ui/proc-macro/three-equals.stderr b/src/test/ui/proc-macro/three-equals.stderr
index 1ce5e02bd..9cdb2a21b 100644
--- a/src/test/ui/proc-macro/three-equals.stderr
+++ b/src/test/ui/proc-macro/three-equals.stderr
@@ -8,16 +8,16 @@ LL | three_equals!(==);
= note: this error originates in the macro `three_equals` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected EOF, found `=`.
- --> $DIR/three-equals.rs:15:21
+ --> $DIR/three-equals.rs:15:22
|
LL | three_equals!(=====);
- | ^^
+ | ^
|
note: last good input was here
--> $DIR/three-equals.rs:15:21
|
LL | three_equals!(=====);
- | ^^
+ | ^
= help: input must be: `===`
error: expected `=`, found `abc`.
diff --git a/src/test/ui/process/core-run-destroy.rs b/src/test/ui/process/core-run-destroy.rs
index 5fd418e6c..d0e97bf01 100644
--- a/src/test/ui/process/core-run-destroy.rs
+++ b/src/test/ui/process/core-run-destroy.rs
@@ -8,6 +8,7 @@
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-vxworks no 'cat' and 'sleep'
+// ignore-fuchsia no 'cat'
// N.B., these tests kill child processes. Valgrind sees these children as leaking
// memory, which makes for some *confusing* logs. That's why these are here
diff --git a/src/test/ui/process/process-envs.rs b/src/test/ui/process/process-envs.rs
index 8fc99b23f..f3a469791 100644
--- a/src/test/ui/process/process-envs.rs
+++ b/src/test/ui/process/process-envs.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-vxworks no 'env'
+// ignore-fuchsia no 'env'
use std::process::Command;
use std::env;
diff --git a/src/test/ui/process/process-panic-after-fork.rs b/src/test/ui/process/process-panic-after-fork.rs
index 1ccf6bb05..6d4d24922 100644
--- a/src/test/ui/process/process-panic-after-fork.rs
+++ b/src/test/ui/process/process-panic-after-fork.rs
@@ -5,9 +5,8 @@
// ignore-sgx no libc
// ignore-emscripten no processes
// ignore-sgx no processes
-// ignore-android: FIXME(#85261)
+// ignore-fuchsia no fork
-#![feature(bench_black_box)]
#![feature(rustc_private)]
#![feature(never_type)]
#![feature(panic_always_abort)]
@@ -79,7 +78,49 @@ unsafe impl<A:GlobalAlloc> GlobalAlloc for PidChecking<A> {
fn expect_aborted(status: ExitStatus) {
dbg!(status);
let signal = status.signal().expect("expected child process to die of signal");
+
+ #[cfg(not(target_os = "android"))]
assert!(signal == libc::SIGABRT || signal == libc::SIGILL || signal == libc::SIGTRAP);
+
+ #[cfg(target_os = "android")]
+ {
+ // Android signals an abort() call with SIGSEGV at address 0xdeadbaad
+ // See e.g. https://groups.google.com/g/android-ndk/c/laW1CJc7Icc
+ assert!(signal == libc::SIGSEGV);
+
+ // Additional checks performed:
+ // 1. Find last tombstone (similar to coredump but in text format) from the
+ // same executable (path) as we are (must be because of usage of fork):
+ // This ensures that we look into the correct tombstone.
+ // 2. Cause of crash is a SIGSEGV with address 0xdeadbaad.
+ // 3. libc::abort call is in one of top two functions on callstack.
+ // The last two steps distinguish between a normal SIGSEGV and one caused
+ // by libc::abort.
+
+ let this_exe = std::env::current_exe().unwrap().into_os_string().into_string().unwrap();
+ let exe_string = format!(">>> {this_exe} <<<");
+ let tombstone = (0..100)
+ .map(|n| format!("/data/tombstones/tombstone_{n:02}"))
+ .filter(|f| std::path::Path::new(&f).exists())
+ .map(|f| std::fs::read_to_string(&f).expect("Cannot read tombstone file"))
+ .filter(|f| f.contains(&exe_string))
+ .last()
+ .expect("no tombstone found");
+
+ println!("Content of tombstone:\n{tombstone}");
+
+ assert!(
+ tombstone.contains("signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad")
+ );
+ let abort_on_top = tombstone
+ .lines()
+ .skip_while(|l| !l.contains("backtrace:"))
+ .skip(1)
+ .take_while(|l| l.starts_with(" #"))
+ .take(2)
+ .any(|f| f.contains("/system/lib/libc.so (abort"));
+ assert!(abort_on_top);
+ }
}
fn main() {
diff --git a/src/test/ui/process/process-remove-from-env.rs b/src/test/ui/process/process-remove-from-env.rs
index af4e49dfd..ad027d685 100644
--- a/src/test/ui/process/process-remove-from-env.rs
+++ b/src/test/ui/process/process-remove-from-env.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-vxworks no 'env'
+// ignore-fuchsia no 'env'
use std::process::Command;
use std::env;
diff --git a/src/test/ui/process/process-sigpipe.rs b/src/test/ui/process/process-sigpipe.rs
index ecf5e93c9..107eba45d 100644
--- a/src/test/ui/process/process-sigpipe.rs
+++ b/src/test/ui/process/process-sigpipe.rs
@@ -14,6 +14,7 @@
// ignore-emscripten no threads support
// ignore-vxworks no 'sh'
+// ignore-fuchsia no 'sh'
use std::process;
use std::thread;
diff --git a/src/test/ui/process/process-spawn-nonexistent.rs b/src/test/ui/process/process-spawn-nonexistent.rs
index a51372263..9dd608986 100644
--- a/src/test/ui/process/process-spawn-nonexistent.rs
+++ b/src/test/ui/process/process-spawn-nonexistent.rs
@@ -1,6 +1,7 @@
// run-pass
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia ErrorKind not translated
use std::io::ErrorKind;
use std::process::Command;
diff --git a/src/test/ui/process/process-spawn-with-unicode-params.rs b/src/test/ui/process/process-spawn-with-unicode-params.rs
index 6e9229b62..16dba6292 100644
--- a/src/test/ui/process/process-spawn-with-unicode-params.rs
+++ b/src/test/ui/process/process-spawn-with-unicode-params.rs
@@ -9,6 +9,7 @@
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia Filesystem manipulation privileged
use std::io::prelude::*;
use std::io;
diff --git a/src/test/ui/process/signal-exit-status.rs b/src/test/ui/process/signal-exit-status.rs
index 0963dcc80..9519ed7b4 100644
--- a/src/test/ui/process/signal-exit-status.rs
+++ b/src/test/ui/process/signal-exit-status.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-windows
+// ignore-fuchsia code returned as ZX_TASK_RETCODE_EXCEPTION_KILL, FIXME (#58590)
use std::env;
use std::process::Command;
diff --git a/src/test/ui/ptr_ops/issue-80309-safe.rs b/src/test/ui/ptr_ops/issue-80309-safe.rs
index f7513b6b8..8a4ff1669 100644
--- a/src/test/ui/ptr_ops/issue-80309-safe.rs
+++ b/src/test/ui/ptr_ops/issue-80309-safe.rs
@@ -1,5 +1,4 @@
// run-pass
-// min-llvm-version: 13.0
// compile-flags: -O
// Regression test for issue #80309
diff --git a/src/test/ui/ptr_ops/issue-80309.rs b/src/test/ui/ptr_ops/issue-80309.rs
index 5c0f4b76c..c13ce3c9c 100644
--- a/src/test/ui/ptr_ops/issue-80309.rs
+++ b/src/test/ui/ptr_ops/issue-80309.rs
@@ -1,5 +1,4 @@
// run-pass
-// min-llvm-version: 13.0
// compile-flags: -O
// Regression test for issue #80309
diff --git a/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr b/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr
index e4d73c647..c7fadc6f9 100644
--- a/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr
+++ b/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr
@@ -28,9 +28,9 @@ error: extern crate `core` is private, and cannot be re-exported (error E0365),
LL | pub use core as reexported_core;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[deny(pub_use_of_private_extern_crate)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>
+ = note: `#[deny(pub_use_of_private_extern_crate)]` on by default
error: aborting due to 3 previous errors
diff --git a/src/test/ui/pub/pub-restricted-error.stderr b/src/test/ui/pub/pub-restricted-error.stderr
index 95bf498c7..b47328f34 100644
--- a/src/test/ui/pub/pub-restricted-error.stderr
+++ b/src/test/ui/pub/pub-restricted-error.stderr
@@ -1,6 +1,8 @@
error: expected identifier, found `(`
--> $DIR/pub-restricted-error.rs:4:16
|
+LL | struct Foo {
+ | --- while parsing this struct
LL | pub(crate) () foo: usize,
| ^ expected identifier
diff --git a/src/test/ui/query-system/query_depth.rs b/src/test/ui/query-system/query_depth.rs
new file mode 100644
index 000000000..e600c1c08
--- /dev/null
+++ b/src/test/ui/query-system/query_depth.rs
@@ -0,0 +1,31 @@
+// build-fail
+
+#![recursion_limit = "64"]
+type Byte = Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Option<Option<Option<Option< Option<Option<Option<Option<
+ Box<String>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+ >>>> >>>>
+>>>> >>>>;
+
+fn main() {
+//~^ ERROR: queries overflow the depth limit!
+ println!("{}", std::mem::size_of::<Byte>());
+}
diff --git a/src/test/ui/query-system/query_depth.stderr b/src/test/ui/query-system/query_depth.stderr
new file mode 100644
index 000000000..43a18b4e0
--- /dev/null
+++ b/src/test/ui/query-system/query_depth.stderr
@@ -0,0 +1,11 @@
+error: queries overflow the depth limit!
+ --> $DIR/query_depth.rs:28:1
+ |
+LL | fn main() {
+ | ^^^^^^^^^
+ |
+ = help: consider increasing the recursion limit by adding a `#![recursion_limit = "128"]` attribute to your crate (`query_depth`)
+ = note: query depth increased by 66 when computing layout of `core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<alloc::boxed::Box<alloc::string::String>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/query-visibility.rs b/src/test/ui/query-visibility.rs
new file mode 100644
index 000000000..09a289d85
--- /dev/null
+++ b/src/test/ui/query-visibility.rs
@@ -0,0 +1,9 @@
+// check-pass
+// Check that it doesn't panic when `Input` gets its visibility checked.
+
+#![crate_type = "lib"]
+
+pub trait Layer<
+ /// Hello.
+ Input,
+> {}
diff --git a/src/test/ui/range/range-1.stderr b/src/test/ui/range/range-1.stderr
index 0bbed8704..aaea91ce0 100644
--- a/src/test/ui/range/range-1.stderr
+++ b/src/test/ui/range/range-1.stderr
@@ -20,14 +20,14 @@ LL | for i in false..true {}
isize
u128
and 5 others
- = note: required because of the requirements on the impl of `Iterator` for `std::ops::Range<bool>`
- = note: required because of the requirements on the impl of `IntoIterator` for `std::ops::Range<bool>`
+ = note: required for `std::ops::Range<bool>` to implement `Iterator`
+ = note: required for `std::ops::Range<bool>` to implement `IntoIterator`
error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time
--> $DIR/range-1.rs:14:17
|
LL | let range = *arr..;
- | ^^^^^^ doesn't have a size known at compile-time
+ | ^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `[{integer}]`
note: required by a bound in `RangeFrom`
diff --git a/src/test/ui/range/range-inclusive-pattern-precedence.stderr b/src/test/ui/range/range-inclusive-pattern-precedence.stderr
index 10513374c..f6788d034 100644
--- a/src/test/ui/range/range-inclusive-pattern-precedence.stderr
+++ b/src/test/ui/range/range-inclusive-pattern-precedence.stderr
@@ -10,13 +10,13 @@ warning: `...` range patterns are deprecated
LL | &0...9 => {}
| ^^^^^^ help: use `..=` for an inclusive range: `&(0..=9)`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
--> $DIR/range-inclusive-pattern-precedence.rs:7:9
|
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr
index cdec41d7f..bb4e3a13a 100644
--- a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr
+++ b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr
@@ -10,13 +10,13 @@ warning: `...` range patterns are deprecated
LL | box 0...9 => {}
| ^^^ help: use `..=` for an inclusive range
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
--> $DIR/range-inclusive-pattern-precedence2.rs:5:9
|
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/recursion/issue-83150.stderr b/src/test/ui/recursion/issue-83150.stderr
index 89a832984..3e0229717 100644
--- a/src/test/ui/recursion/issue-83150.stderr
+++ b/src/test/ui/recursion/issue-83150.stderr
@@ -6,13 +6,13 @@ LL | fn func<T: Iterator<Item = u8>>(iter: &mut T) {
LL | func(&mut iter.map(|x| x + 1))
| ------------------------------ recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
error[E0275]: overflow evaluating the requirement `Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>: Iterator`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_83150`)
- = note: required because of the requirements on the impl of `Iterator` for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>`
+ = note: required for `&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut Map<&mut std::ops::Range<u8>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>, [closure@$DIR/issue-83150.rs:11:24: 11:27]>` to implement `Iterator`
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/recursion/issue-95134.rs b/src/test/ui/recursion/issue-95134.rs
new file mode 100644
index 000000000..fdc4d5369
--- /dev/null
+++ b/src/test/ui/recursion/issue-95134.rs
@@ -0,0 +1,30 @@
+// build-fail
+// known-bug: #95134
+// compile-flags: -Copt-level=0
+// failure-status: 101
+// dont-check-compiler-stderr
+
+pub fn encode_num<Writer: ExampleWriter>(n: u32, mut writer: Writer) -> Result<(), Writer::Error> {
+ if n > 15 {
+ encode_num(n / 16, &mut writer)?;
+ }
+ Ok(())
+}
+
+pub trait ExampleWriter {
+ type Error;
+}
+
+impl<'a, T: ExampleWriter> ExampleWriter for &'a mut T {
+ type Error = T::Error;
+}
+
+struct EmptyWriter;
+
+impl ExampleWriter for EmptyWriter {
+ type Error = ();
+}
+
+fn main() {
+ encode_num(69, &mut EmptyWriter).unwrap();
+}
diff --git a/src/test/ui/recursion/recursive-enum.stderr b/src/test/ui/recursion/recursive-enum.stderr
index f5d25c564..d662d1022 100644
--- a/src/test/ui/recursion/recursive-enum.stderr
+++ b/src/test/ui/recursion/recursive-enum.stderr
@@ -3,10 +3,8 @@ error[E0072]: recursive type `List` has infinite size
|
LL | enum List<T> { Cons(T, List<T>), Nil }
| ^^^^^^^^^^^^ ------- recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `List` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | enum List<T> { Cons(T, Box<List<T>>), Nil }
| ++++ +
diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr
index acbd0d059..f2307899d 100644
--- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr
+++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr
@@ -6,7 +6,7 @@ LL | let Ok(x) = res;
|
= 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: `Result<u32, &R>` defined here
+note: `Result<u32, &R<'_>>` defined here
--> $SRC_DIR/core/src/result.rs:LL:COL
|
LL | pub enum Result<T, E> {
@@ -14,12 +14,12 @@ LL | pub enum Result<T, E> {
...
LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E),
| ^^^ not covered
- = note: the matched value is of type `Result<u32, &R>`
+ = note: the matched value is of type `Result<u32, &R<'_>>`
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let x = if let Ok(x) = res { x } else { todo!() };
| ++++++++++ ++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+help: alternatively, you might want to use let else to handle the variant that isn't matched
|
LL | let Ok(x) = res else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs
new file mode 100644
index 000000000..a1e801e39
--- /dev/null
+++ b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs
@@ -0,0 +1,12 @@
+pub trait T {}
+
+struct S<'a>(&'a ());
+
+impl<'a> T for S<'a> {}
+
+fn foo() -> impl T {
+ let x = ();
+ S(&x) //~ ERROR `x` does not live long enough
+}
+
+fn main() {}
diff --git a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr
new file mode 100644
index 000000000..6ea238f30
--- /dev/null
+++ b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr
@@ -0,0 +1,14 @@
+error[E0597]: `x` does not live long enough
+ --> $DIR/do-not-suggest-adding-bound-to-opaque-type.rs:9:7
+ |
+LL | S(&x)
+ | --^^-
+ | | |
+ | | borrowed value does not live long enough
+ | opaque type requires that `x` is borrowed for `'static`
+LL | }
+ | - `x` dropped here while still borrowed
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/regions/issue-101280.rs b/src/test/ui/regions/issue-101280.rs
new file mode 100644
index 000000000..29f158366
--- /dev/null
+++ b/src/test/ui/regions/issue-101280.rs
@@ -0,0 +1,10 @@
+use std::cell::Cell;
+
+type Ty = for<'r> fn(Cell<(&'r i32, &'r i32)>);
+
+fn f<'r>(f: fn(Cell<(&'r i32, &i32)>)) -> Ty {
+ f
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/regions/issue-101280.stderr b/src/test/ui/regions/issue-101280.stderr
new file mode 100644
index 000000000..320d008ae
--- /dev/null
+++ b/src/test/ui/regions/issue-101280.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-101280.rs:6:5
+ |
+LL | fn f<'r>(f: fn(Cell<(&'r i32, &i32)>)) -> Ty {
+ | -- expected `for<'r> fn(Cell<(&'r i32, &'r i32)>)` because of return type
+LL | f
+ | ^ one type is more general than the other
+ |
+ = note: expected fn pointer `for<'r> fn(Cell<(&'r i32, &'r i32)>)`
+ found fn pointer `for<'a> fn(Cell<(&'r i32, &'a i32)>)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/issue-102374.rs b/src/test/ui/regions/issue-102374.rs
new file mode 100644
index 000000000..e0a116421
--- /dev/null
+++ b/src/test/ui/regions/issue-102374.rs
@@ -0,0 +1,20 @@
+use std::cell::Cell;
+
+#[rustfmt::skip]
+fn f(
+ f: for<'a, 'b, 'c, 'd, 'e, 'f, 'g,
+ 'h, 'i, 'j, 'k, 'l, 'm, 'n,
+ 'o, 'p, 'q, 'r, 's, 't, 'u,
+ 'v, 'w, 'x, 'y, 'z, 'z0>
+ fn(Cell<(& i32, &'a i32, &'b i32, &'c i32, &'d i32,
+ &'e i32, &'f i32, &'g i32, &'h i32, &'i i32,
+ &'j i32, &'k i32, &'l i32, &'m i32, &'n i32,
+ &'o i32, &'p i32, &'q i32, &'r i32, &'s i32,
+ &'t i32, &'u i32, &'v i32, &'w i32, &'x i32,
+ &'y i32, &'z i32, &'z0 i32)>),
+) -> i32 {
+ f
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/regions/issue-102374.stderr b/src/test/ui/regions/issue-102374.stderr
new file mode 100644
index 000000000..31b855c36
--- /dev/null
+++ b/src/test/ui/regions/issue-102374.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-102374.rs:16:5
+ |
+LL | ) -> i32 {
+ | --- expected `i32` because of return type
+LL | f
+ | ^ expected `i32`, found fn pointer
+ |
+ = note: expected type `i32`
+ found fn pointer `for<'z1, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'l, 'm, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x, 'y, 'z, 'z0> fn(Cell<(&'z1 i32, &'a i32, &'b i32, &'c i32, &'d i32, &'e i32, &'f i32, &'g i32, &'h i32, &'i i32, &'j i32, &'k i32, &'l i32, &'m i32, &'n i32, &'o i32, &'p i32, &'q i32, &'r i32, &'s i32, &'t i32, &'u i32, &'v i32, &'w i32, &'x i32, &'y i32, &'z i32, &'z0 i32)>)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/issue-102392.rs b/src/test/ui/regions/issue-102392.rs
new file mode 100644
index 000000000..87cc1a8e7
--- /dev/null
+++ b/src/test/ui/regions/issue-102392.rs
@@ -0,0 +1,6 @@
+fn g(f: for<'a> fn(fn(&str, &'a str))) -> bool {
+ f
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/regions/issue-102392.stderr b/src/test/ui/regions/issue-102392.stderr
new file mode 100644
index 000000000..56f4c0c5d
--- /dev/null
+++ b/src/test/ui/regions/issue-102392.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-102392.rs:2:5
+ |
+LL | fn g(f: for<'a> fn(fn(&str, &'a str))) -> bool {
+ | ---- expected `bool` because of return type
+LL | f
+ | ^ expected `bool`, found fn pointer
+ |
+ = note: expected type `bool`
+ found fn pointer `for<'a> fn(for<'b> fn(&'b str, &'a str))`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs b/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs
index bdd1ae91f..a8f7a41c4 100644
--- a/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs
+++ b/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs
@@ -5,7 +5,7 @@
// by the function.
//
// This works today, which precludes changing things so that closures
-// follow the same lifetime-elision rules used elsehwere. See
+// follow the same lifetime-elision rules used elsewhere. See
// rust-lang/rust#56537
// check-pass
diff --git a/src/test/ui/regions/outlives-with-missing.rs b/src/test/ui/regions/outlives-with-missing.rs
new file mode 100644
index 000000000..29d89718b
--- /dev/null
+++ b/src/test/ui/regions/outlives-with-missing.rs
@@ -0,0 +1,16 @@
+trait HandlerFamily {
+ type Target;
+}
+
+struct HandlerWrapper<H: HandlerFamily>(H);
+
+impl<H: HandlerFamily> HandlerWrapper<H> {
+ pub fn set_handler(&self, handler: &H::Target)
+ where
+ T: Send + Sync + 'static,
+ //~^ ERROR cannot find type `T` in this scope
+ {
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/regions/outlives-with-missing.stderr b/src/test/ui/regions/outlives-with-missing.stderr
new file mode 100644
index 000000000..e204c9187
--- /dev/null
+++ b/src/test/ui/regions/outlives-with-missing.stderr
@@ -0,0 +1,12 @@
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/outlives-with-missing.rs:10:9
+ |
+LL | impl<H: HandlerFamily> HandlerWrapper<H> {
+ | - similarly named type parameter `H` defined here
+...
+LL | T: Send + Sync + 'static,
+ | ^ help: a type parameter with a similar name exists: `H`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
diff --git a/src/test/ui/regions/region-bound-on-closure-outlives-call.stderr b/src/test/ui/regions/region-bound-on-closure-outlives-call.stderr
index a2396ad42..ea43dde11 100644
--- a/src/test/ui/regions/region-bound-on-closure-outlives-call.stderr
+++ b/src/test/ui/regions/region-bound-on-closure-outlives-call.stderr
@@ -7,8 +7,8 @@ LL |
LL | (|x| f(x))(call_rec(f))
| ----------- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= help: a `loop` may express intention better if this is on purpose
+ = note: `#[warn(unconditional_recursion)]` on by default
error[E0505]: cannot move out of `f` because it is borrowed
--> $DIR/region-bound-on-closure-outlives-call.rs:3:25
diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
index 48f2e1a2f..3b62c7b61 100644
--- a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
+++ b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: fn(&mut &isize, &mut &isize) = a;
| ^ one type is more general than the other
|
- = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
- found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
+ = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)`
+ found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}`
error: aborting due to previous error
diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
index 36f40cd9a..8a18a234b 100644
--- a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
+++ b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ^ one type is more general than the other
|
- = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
- found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
+ = note: expected fn pointer `for<'a, 'b, 'c, 'd, 'e, 'f> fn(&'a mut &'b isize, &'c mut &'d isize, &'e mut &'f isize)`
+ found fn item `for<'a, 'b, 'c> fn(&'a mut &isize, &'b mut &isize, &'c mut &isize) {a::<'_, '_, '_>}`
error: aborting due to previous error
diff --git a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr
index d87d0d2f6..8d82ff958 100644
--- a/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr
+++ b/src/test/ui/regions/regions-fn-subtyping-return-static-fail.stderr
@@ -7,7 +7,7 @@ LL | want_G(baz);
| arguments to this function are incorrect
|
= note: expected fn pointer `for<'cx> fn(&'cx S) -> &'static S`
- found fn item `for<'r> fn(&'r S) -> &'r S {baz}`
+ found fn item `for<'a> fn(&'a S) -> &'a S {baz}`
note: function defined here
--> $DIR/regions-fn-subtyping-return-static-fail.rs:20:4
|
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
index c1dab6086..110635203 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs
@@ -19,7 +19,8 @@ trait Trait2<'a, 'b> {
// since for it to be WF, we would need to know that `'y: 'x`, but we
// do not infer that.
fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
- //~^ the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
+ //~^ ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
+ //~| ERROR the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
{
}
diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
index 6844e8665..66f592c34 100644
--- a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
+++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr
@@ -1,4 +1,19 @@
error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
+ --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:1
+ |
+LL | / fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
+LL | |
+LL | |
+LL | | {
+LL | | }
+ | |_^ the trait `for<'z> Trait2<'y, 'z>` is not implemented for `T`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
+ | ++++++++++++++++++++++++
+
+error[E0277]: the trait bound `for<'z> T: Trait2<'y, 'z>` is not satisfied
--> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:21:49
|
LL | fn callee<'x, 'y, T>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
@@ -9,6 +24,6 @@ help: consider restricting type parameter `T`
LL | fn callee<'x, 'y, T: for<'z> Trait2<'y, 'z>>(t: &'x dyn for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >)
| ++++++++++++++++++++++++
-error: aborting due to previous error
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
index a0daf58c6..17a901943 100644
--- a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
+++ b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr
@@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: fn(&mut &isize, &mut &isize) = a;
| ^ one type is more general than the other
|
- = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
- found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
+ = note: expected fn pointer `for<'a, 'b, 'c, 'd> fn(&'a mut &'b isize, &'c mut &'d isize)`
+ found fn item `for<'a, 'b> fn(&'a mut &isize, &'b mut &isize) {a::<'_, '_>}`
error: aborting due to previous error
diff --git a/src/test/ui/reify-intrinsic.stderr b/src/test/ui/reify-intrinsic.stderr
index 360557fb5..f78f1d822 100644
--- a/src/test/ui/reify-intrinsic.stderr
+++ b/src/test/ui/reify-intrinsic.stderr
@@ -23,6 +23,9 @@ LL | std::intrinsics::unlikely,
|
= note: expected fn item `extern "rust-intrinsic" fn(_) -> _ {likely}`
found fn item `extern "rust-intrinsic" fn(_) -> _ {unlikely}`
+ = note: different `fn` items always have unique types, even if their signatures are the same
+ = help: change the expected type to be function pointer `extern "rust-intrinsic" fn(bool) -> bool`
+ = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `likely as extern "rust-intrinsic" fn(bool) -> bool`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/repr/invalid_repr_list_help.rs b/src/test/ui/repr/invalid_repr_list_help.rs
new file mode 100644
index 000000000..c32098453
--- /dev/null
+++ b/src/test/ui/repr/invalid_repr_list_help.rs
@@ -0,0 +1,17 @@
+#![crate_type = "lib"]
+
+#[repr(uwu)] //~ERROR: unrecognized representation hint
+pub struct OwO;
+
+#[repr(uwu = "a")] //~ERROR: unrecognized representation hint
+pub struct OwO2(i32);
+
+#[repr(uwu(4))] //~ERROR: unrecognized representation hint
+pub struct OwO3 {
+ x: i32,
+}
+
+#[repr(uwu, u8)] //~ERROR: unrecognized representation hint
+pub enum OwO4 {
+ UwU = 1,
+}
diff --git a/src/test/ui/repr/invalid_repr_list_help.stderr b/src/test/ui/repr/invalid_repr_list_help.stderr
new file mode 100644
index 000000000..2acd56d9a
--- /dev/null
+++ b/src/test/ui/repr/invalid_repr_list_help.stderr
@@ -0,0 +1,35 @@
+error[E0552]: unrecognized representation hint
+ --> $DIR/invalid_repr_list_help.rs:3:8
+ |
+LL | #[repr(uwu)]
+ | ^^^
+ |
+ = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
+
+error[E0552]: unrecognized representation hint
+ --> $DIR/invalid_repr_list_help.rs:6:8
+ |
+LL | #[repr(uwu = "a")]
+ | ^^^^^^^^^
+ |
+ = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
+
+error[E0552]: unrecognized representation hint
+ --> $DIR/invalid_repr_list_help.rs:9:8
+ |
+LL | #[repr(uwu(4))]
+ | ^^^^^^
+ |
+ = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
+
+error[E0552]: unrecognized representation hint
+ --> $DIR/invalid_repr_list_help.rs:14:8
+ |
+LL | #[repr(uwu, u8)]
+ | ^^^
+ |
+ = help: valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0552`.
diff --git a/src/test/ui/repr/repr-transparent-issue-87496.stderr b/src/test/ui/repr/repr-transparent-issue-87496.stderr
index 3dc13b1c1..aee31212b 100644
--- a/src/test/ui/repr/repr-transparent-issue-87496.stderr
+++ b/src/test/ui/repr/repr-transparent-issue-87496.stderr
@@ -4,13 +4,13 @@ warning: `extern` block uses type `TransparentCustomZst`, which is not FFI-safe
LL | fn good17(p: TransparentCustomZst);
| ^^^^^^^^^^^^^^^^^^^^ not FFI-safe
|
- = note: `#[warn(improper_ctypes)]` on by default
= note: this struct contains only zero-sized fields
note: the type is defined here
--> $DIR/repr-transparent-issue-87496.rs:6:1
|
LL | struct TransparentCustomZst(());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: `#[warn(improper_ctypes)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/repr/repr-transparent-non-exhaustive.rs b/src/test/ui/repr/repr-transparent-non-exhaustive.rs
index 9ccd8610d..506f1dcf3 100644
--- a/src/test/ui/repr/repr-transparent-non-exhaustive.rs
+++ b/src/test/ui/repr/repr-transparent-non-exhaustive.rs
@@ -35,62 +35,62 @@ pub struct T4(Sized, ExternalIndirection<(InternalPrivate, InternalNonExhaustive
#[repr(transparent)]
pub struct T5(Sized, Private);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T6(Sized, NonExhaustive);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T7(Sized, NonExhaustiveEnum);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T8(Sized, NonExhaustiveVariant);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T9(Sized, InternalIndirection<Private>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T10(Sized, InternalIndirection<NonExhaustive>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T11(Sized, InternalIndirection<NonExhaustiveEnum>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T12(Sized, InternalIndirection<NonExhaustiveVariant>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T13(Sized, ExternalIndirection<Private>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T14(Sized, ExternalIndirection<NonExhaustive>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T15(Sized, ExternalIndirection<NonExhaustiveEnum>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
#[repr(transparent)]
pub struct T16(Sized, ExternalIndirection<NonExhaustiveVariant>);
-//~^ ERROR zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+//~^ ERROR zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
//~| WARN this was previously accepted by the compiler
fn main() {}
diff --git a/src/test/ui/repr/repr-transparent-non-exhaustive.stderr b/src/test/ui/repr/repr-transparent-non-exhaustive.stderr
index 3b1e334a0..16edf59c7 100644
--- a/src/test/ui/repr/repr-transparent-non-exhaustive.stderr
+++ b/src/test/ui/repr/repr-transparent-non-exhaustive.stderr
@@ -1,19 +1,19 @@
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:37:22
|
LL | pub struct T5(Sized, Private);
| ^^^^^^^
|
+ = 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 #78586 <https://github.com/rust-lang/rust/issues/78586>
+ = note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future.
note: the lint level is defined here
--> $DIR/repr-transparent-non-exhaustive.rs:1:9
|
LL | #![deny(repr_transparent_external_private_fields)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #78586 <https://github.com/rust-lang/rust/issues/78586>
- = note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:42:22
|
LL | pub struct T6(Sized, NonExhaustive);
@@ -23,7 +23,7 @@ LL | pub struct T6(Sized, NonExhaustive);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this struct contains `NonExhaustive`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:47:22
|
LL | pub struct T7(Sized, NonExhaustiveEnum);
@@ -33,7 +33,7 @@ LL | pub struct T7(Sized, NonExhaustiveEnum);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this enum contains `NonExhaustiveEnum`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:52:22
|
LL | pub struct T8(Sized, NonExhaustiveVariant);
@@ -43,7 +43,7 @@ LL | pub struct T8(Sized, NonExhaustiveVariant);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this enum contains `NonExhaustiveVariant`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:57:22
|
LL | pub struct T9(Sized, InternalIndirection<Private>);
@@ -53,7 +53,7 @@ LL | pub struct T9(Sized, InternalIndirection<Private>);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:62:23
|
LL | pub struct T10(Sized, InternalIndirection<NonExhaustive>);
@@ -63,7 +63,7 @@ LL | pub struct T10(Sized, InternalIndirection<NonExhaustive>);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this struct contains `NonExhaustive`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:67:23
|
LL | pub struct T11(Sized, InternalIndirection<NonExhaustiveEnum>);
@@ -73,7 +73,7 @@ LL | pub struct T11(Sized, InternalIndirection<NonExhaustiveEnum>);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this enum contains `NonExhaustiveEnum`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:72:23
|
LL | pub struct T12(Sized, InternalIndirection<NonExhaustiveVariant>);
@@ -83,7 +83,7 @@ LL | pub struct T12(Sized, InternalIndirection<NonExhaustiveVariant>);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this enum contains `NonExhaustiveVariant`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:77:23
|
LL | pub struct T13(Sized, ExternalIndirection<Private>);
@@ -93,7 +93,7 @@ LL | pub struct T13(Sized, ExternalIndirection<Private>);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this struct contains `Private`, which contains private fields, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:82:23
|
LL | pub struct T14(Sized, ExternalIndirection<NonExhaustive>);
@@ -103,7 +103,7 @@ LL | pub struct T14(Sized, ExternalIndirection<NonExhaustive>);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this struct contains `NonExhaustive`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:87:23
|
LL | pub struct T15(Sized, ExternalIndirection<NonExhaustiveEnum>);
@@ -113,7 +113,7 @@ LL | pub struct T15(Sized, ExternalIndirection<NonExhaustiveEnum>);
= note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
= note: this enum contains `NonExhaustiveEnum`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
-error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
+error: zero-sized fields in `repr(transparent)` cannot contain external non-exhaustive types
--> $DIR/repr-transparent-non-exhaustive.rs:92:23
|
LL | pub struct T16(Sized, ExternalIndirection<NonExhaustiveVariant>);
diff --git a/src/test/ui/resolve/bad-env-capture.stderr b/src/test/ui/resolve/bad-env-capture.stderr
index f78a38a3d..59b1fabfd 100644
--- a/src/test/ui/resolve/bad-env-capture.stderr
+++ b/src/test/ui/resolve/bad-env-capture.stderr
@@ -6,18 +6,18 @@ LL | fn bar() { log(debug, x); }
|
= help: use the `|| { ... }` closure form instead
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-env-capture.rs:4:16
- |
-LL | fn bar() { log(debug, x); }
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-env-capture.rs:4:20
|
LL | fn bar() { log(debug, x); }
| ^^^^^ not found in this scope
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-env-capture.rs:4:16
+ |
+LL | fn bar() { log(debug, x); }
+ | ^^^ not found in this scope
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0425, E0434.
diff --git a/src/test/ui/resolve/bad-env-capture2.stderr b/src/test/ui/resolve/bad-env-capture2.stderr
index 57c807fd7..811c259de 100644
--- a/src/test/ui/resolve/bad-env-capture2.stderr
+++ b/src/test/ui/resolve/bad-env-capture2.stderr
@@ -6,18 +6,18 @@ LL | fn bar() { log(debug, x); }
|
= help: use the `|| { ... }` closure form instead
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-env-capture2.rs:3:16
- |
-LL | fn bar() { log(debug, x); }
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-env-capture2.rs:3:20
|
LL | fn bar() { log(debug, x); }
| ^^^^^ not found in this scope
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-env-capture2.rs:3:16
+ |
+LL | fn bar() { log(debug, x); }
+ | ^^^ not found in this scope
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0425, E0434.
diff --git a/src/test/ui/resolve/bad-env-capture3.stderr b/src/test/ui/resolve/bad-env-capture3.stderr
index d6eb4f86e..eab37fde9 100644
--- a/src/test/ui/resolve/bad-env-capture3.stderr
+++ b/src/test/ui/resolve/bad-env-capture3.stderr
@@ -6,18 +6,18 @@ LL | fn bar() { log(debug, x); }
|
= help: use the `|| { ... }` closure form instead
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-env-capture3.rs:4:20
- |
-LL | fn bar() { log(debug, x); }
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-env-capture3.rs:4:24
|
LL | fn bar() { log(debug, x); }
| ^^^^^ not found in this scope
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-env-capture3.rs:4:20
+ |
+LL | fn bar() { log(debug, x); }
+ | ^^^ not found in this scope
+
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0425, E0434.
diff --git a/src/test/ui/resolve/bad-expr-path.stderr b/src/test/ui/resolve/bad-expr-path.stderr
index 77c48c951..8261e8e53 100644
--- a/src/test/ui/resolve/bad-expr-path.stderr
+++ b/src/test/ui/resolve/bad-expr-path.stderr
@@ -1,9 +1,3 @@
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-expr-path.rs:4:5
- |
-LL | log(debug, m1::arguments);
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-expr-path.rs:4:9
|
@@ -16,6 +10,12 @@ error[E0425]: cannot find value `arguments` in module `m1`
LL | log(debug, m1::arguments);
| ^^^^^^^^^ not found in `m1`
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-expr-path.rs:4:5
+ |
+LL | log(debug, m1::arguments);
+ | ^^^ not found in this scope
+
error[E0580]: `main` function has wrong type
--> $DIR/bad-expr-path.rs:3:1
|
diff --git a/src/test/ui/resolve/bad-expr-path2.stderr b/src/test/ui/resolve/bad-expr-path2.stderr
index d06e10271..6e11296d9 100644
--- a/src/test/ui/resolve/bad-expr-path2.stderr
+++ b/src/test/ui/resolve/bad-expr-path2.stderr
@@ -1,9 +1,3 @@
-error[E0425]: cannot find function `log` in this scope
- --> $DIR/bad-expr-path2.rs:6:5
- |
-LL | log(debug, m1::arguments);
- | ^^^ not found in this scope
-
error[E0425]: cannot find value `debug` in this scope
--> $DIR/bad-expr-path2.rs:6:9
|
@@ -16,6 +10,12 @@ error[E0423]: expected value, found module `m1::arguments`
LL | log(debug, m1::arguments);
| ^^^^^^^^^^^^^ not a value
+error[E0425]: cannot find function `log` in this scope
+ --> $DIR/bad-expr-path2.rs:6:5
+ |
+LL | log(debug, m1::arguments);
+ | ^^^ not found in this scope
+
error[E0580]: `main` function has wrong type
--> $DIR/bad-expr-path2.rs:5:1
|
diff --git a/src/test/ui/resolve/bad-type-env-capture.stderr b/src/test/ui/resolve/bad-type-env-capture.stderr
index 6f24c0d86..b6282c2d0 100644
--- a/src/test/ui/resolve/bad-type-env-capture.stderr
+++ b/src/test/ui/resolve/bad-type-env-capture.stderr
@@ -4,9 +4,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn foo<T>() {
| - type parameter from outer function
LL | fn bar(b: T) { }
- | --- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `bar<T>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<T>`
error: aborting due to previous error
diff --git a/src/test/ui/resolve/issue-100365.rs b/src/test/ui/resolve/issue-100365.rs
new file mode 100644
index 000000000..1d8835036
--- /dev/null
+++ b/src/test/ui/resolve/issue-100365.rs
@@ -0,0 +1,50 @@
+fn main() {
+ let addr = Into::<std::net::IpAddr>.into([127, 0, 0, 1]);
+ //~^ ERROR expected value, found trait `Into`
+ //~| HELP use the path separator
+
+ let _ = Into.into(());
+ //~^ ERROR expected value, found trait `Into`
+ //~| HELP use the path separator
+
+ let _ = Into::<()>.into;
+ //~^ ERROR expected value, found trait `Into`
+ //~| HELP use the path separator
+}
+
+macro_rules! Trait {
+ () => {
+ ::std::iter::Iterator
+ //~^ ERROR expected value, found trait `std::iter::Iterator`
+ //~| ERROR expected value, found trait `std::iter::Iterator`
+ };
+}
+
+macro_rules! create {
+ () => {
+ Into::<String>.into("")
+ //~^ ERROR expected value, found trait `Into`
+ //~| HELP use the path separator
+ };
+}
+
+fn interaction_with_macros() {
+ //
+ // Note that if the receiver is a macro call, we do not want to suggest to replace
+ // `.` with `::` as that would be a syntax error.
+ // Since the receiver is a trait and not a type, we cannot suggest to surround
+ // it with angle brackets. It would be interpreted as a trait object type void of
+ // `dyn` which is most likely not what the user intended to write.
+ // `<_ as Trait!()>::` is also not an option as it's equally syntactically invalid.
+ //
+
+ Trait!().map(std::convert::identity); // no `help` here!
+
+ Trait!().map; // no `help` here!
+
+ //
+ // Ensure that the suggestion is shown for expressions inside of macro definitions.
+ //
+
+ let _ = create!();
+}
diff --git a/src/test/ui/resolve/issue-100365.stderr b/src/test/ui/resolve/issue-100365.stderr
new file mode 100644
index 000000000..372d77266
--- /dev/null
+++ b/src/test/ui/resolve/issue-100365.stderr
@@ -0,0 +1,54 @@
+error[E0423]: expected value, found trait `Into`
+ --> $DIR/issue-100365.rs:2:16
+ |
+LL | let addr = Into::<std::net::IpAddr>.into([127, 0, 0, 1]);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::`
+
+error[E0423]: expected value, found trait `Into`
+ --> $DIR/issue-100365.rs:6:13
+ |
+LL | let _ = Into.into(());
+ | ^^^^- help: use the path separator to refer to an item: `::`
+
+error[E0423]: expected value, found trait `Into`
+ --> $DIR/issue-100365.rs:10:13
+ |
+LL | let _ = Into::<()>.into;
+ | ^^^^^^^^^^- help: use the path separator to refer to an item: `::`
+
+error[E0423]: expected value, found trait `std::iter::Iterator`
+ --> $DIR/issue-100365.rs:17:9
+ |
+LL | ::std::iter::Iterator
+ | ^^^^^^^^^^^^^^^^^^^^^ not a value
+...
+LL | Trait!().map(std::convert::identity); // no `help` here!
+ | -------- in this macro invocation
+ |
+ = note: this error originates in the macro `Trait` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0423]: expected value, found trait `std::iter::Iterator`
+ --> $DIR/issue-100365.rs:17:9
+ |
+LL | ::std::iter::Iterator
+ | ^^^^^^^^^^^^^^^^^^^^^ not a value
+...
+LL | Trait!().map; // no `help` here!
+ | -------- in this macro invocation
+ |
+ = note: this error originates in the macro `Trait` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0423]: expected value, found trait `Into`
+ --> $DIR/issue-100365.rs:25:9
+ |
+LL | Into::<String>.into("")
+ | ^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::`
+...
+LL | let _ = create!();
+ | --------- in this macro invocation
+ |
+ = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 6 previous errors
+
+For more information about this error, try `rustc --explain E0423`.
diff --git a/src/test/ui/resolve/issue-102946.rs b/src/test/ui/resolve/issue-102946.rs
new file mode 100644
index 000000000..c6feca6f3
--- /dev/null
+++ b/src/test/ui/resolve/issue-102946.rs
@@ -0,0 +1,7 @@
+impl Error for str::Utf8Error {
+ //~^ ERROR cannot find trait `Error` in this scope
+ //~| ERROR ambiguous associated type
+ fn description(&self) {}
+}
+
+fn main() {}
diff --git a/src/test/ui/resolve/issue-102946.stderr b/src/test/ui/resolve/issue-102946.stderr
new file mode 100644
index 000000000..65be0258e
--- /dev/null
+++ b/src/test/ui/resolve/issue-102946.stderr
@@ -0,0 +1,26 @@
+error[E0405]: cannot find trait `Error` in this scope
+ --> $DIR/issue-102946.rs:1:6
+ |
+LL | impl Error for str::Utf8Error {
+ | ^^^^^ not found in this scope
+ |
+help: consider importing this trait
+ |
+LL | use std::error::Error;
+ |
+
+error[E0223]: ambiguous associated type
+ --> $DIR/issue-102946.rs:1:16
+ |
+LL | impl Error for str::Utf8Error {
+ | ^^^^^^^^^^^^^^
+ |
+help: you are looking for the module in `std`, not the primitive type
+ |
+LL | impl Error for std::str::Utf8Error {
+ | +++++
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0223, E0405.
+For more information about an error, try `rustc --explain E0223`.
diff --git a/src/test/ui/resolve/issue-103202.rs b/src/test/ui/resolve/issue-103202.rs
new file mode 100644
index 000000000..469d9d7c8
--- /dev/null
+++ b/src/test/ui/resolve/issue-103202.rs
@@ -0,0 +1,7 @@
+struct S {}
+
+impl S {
+ fn f(self: &S::x) {} //~ ERROR ambiguous associated type
+}
+
+fn main() {}
diff --git a/src/test/ui/resolve/issue-103202.stderr b/src/test/ui/resolve/issue-103202.stderr
new file mode 100644
index 000000000..880389371
--- /dev/null
+++ b/src/test/ui/resolve/issue-103202.stderr
@@ -0,0 +1,9 @@
+error[E0223]: ambiguous associated type
+ --> $DIR/issue-103202.rs:4:17
+ |
+LL | fn f(self: &S::x) {}
+ | ^^^^ help: use fully-qualified syntax: `<S as Trait>::x`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0223`.
diff --git a/src/test/ui/resolve/issue-14254.stderr b/src/test/ui/resolve/issue-14254.stderr
index b1f45adb8..690a40f7e 100644
--- a/src/test/ui/resolve/issue-14254.stderr
+++ b/src/test/ui/resolve/issue-14254.stderr
@@ -1,21 +1,9 @@
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:19:9
- |
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
-
error[E0425]: cannot find value `a` in this scope
--> $DIR/issue-14254.rs:21:9
|
LL | a;
| ^ not found in this scope
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:28:9
- |
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
-
error[E0425]: cannot find value `x` in this scope
--> $DIR/issue-14254.rs:30:9
|
@@ -38,7 +26,12 @@ error[E0425]: cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:36:9
|
LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find value `b` in this scope
--> $DIR/issue-14254.rs:38:9
@@ -46,12 +39,6 @@ error[E0425]: cannot find value `b` in this scope
LL | b;
| ^ not found in this scope
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:45:9
- |
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
-
error[E0425]: cannot find value `x` in this scope
--> $DIR/issue-14254.rs:47:9
|
@@ -74,7 +61,12 @@ error[E0425]: cannot find value `bah` in this scope
--> $DIR/issue-14254.rs:53:9
|
LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find value `b` in this scope
--> $DIR/issue-14254.rs:55:9
@@ -82,65 +74,108 @@ error[E0425]: cannot find value `b` in this scope
LL | b;
| ^ not found in this scope
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:62:9
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:64:9
|
-LL | baz();
- | ^^^ help: you might have meant to call the method: `self.baz`
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:64:9
+ --> $DIR/issue-14254.rs:73:9
+ |
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
+
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:82:9
+ |
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
+
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:91:9
+ |
+LL | bah;
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
+
+error[E0425]: cannot find value `bah` in this scope
+ --> $DIR/issue-14254.rs:100:9
|
LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+ | ^^^
+ |
+help: you might have meant to refer to the associated function
+ |
+LL | Self::bah;
+ | ~~~~~~~~~
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:71:9
+ --> $DIR/issue-14254.rs:19:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:73:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:28:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:80:9
+ --> $DIR/issue-14254.rs:45:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:82:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:62:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:89:9
+ --> $DIR/issue-14254.rs:71:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:91:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:80:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error[E0425]: cannot find function `baz` in this scope
- --> $DIR/issue-14254.rs:98:9
+ --> $DIR/issue-14254.rs:89:9
|
LL | baz();
| ^^^ help: you might have meant to call the method: `self.baz`
-error[E0425]: cannot find value `bah` in this scope
- --> $DIR/issue-14254.rs:100:9
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/issue-14254.rs:98:9
|
-LL | bah;
- | ^^^ help: you might have meant to call the associated function: `Self::bah`
+LL | baz();
+ | ^^^ help: you might have meant to call the method: `self.baz`
error: aborting due to 24 previous errors
diff --git a/src/test/ui/resolve/issue-22692.rs b/src/test/ui/resolve/issue-22692.rs
index 1d8f44222..31a762614 100644
--- a/src/test/ui/resolve/issue-22692.rs
+++ b/src/test/ui/resolve/issue-22692.rs
@@ -1,3 +1,60 @@
fn main() {
- let _ = String.new(); //~ ERROR expected value, found struct `String`
+ let _ = String.new();
+ //~^ ERROR expected value, found struct `String`
+ //~| HELP use the path separator
+
+ let _ = String.default;
+ //~^ ERROR expected value, found struct `String`
+ //~| HELP use the path separator
+
+ let _ = Vec::<()>.with_capacity(1);
+ //~^ ERROR expected value, found struct `Vec`
+ //~| HELP use the path separator
+}
+
+macro_rules! Type {
+ () => {
+ ::std::cell::Cell
+ //~^ ERROR expected value, found struct `std::cell::Cell`
+ //~| ERROR expected value, found struct `std::cell::Cell`
+ //~| ERROR expected value, found struct `std::cell::Cell`
+ };
+}
+
+macro_rules! create {
+ (type method) => {
+ Vec.new()
+ //~^ ERROR expected value, found struct `Vec`
+ //~| HELP use the path separator
+ };
+ (type field) => {
+ Vec.new
+ //~^ ERROR expected value, found struct `Vec`
+ //~| HELP use the path separator
+ };
+ (macro method) => {
+ Type!().new(0)
+ //~^ HELP use the path separator
+ };
+}
+
+fn interaction_with_macros() {
+ //
+ // Verify that we do not only suggest to replace `.` with `::` if the receiver is a
+ // macro call but that we also correctly suggest to surround it with angle brackets.
+ //
+
+ Type!().get();
+ //~^ HELP use the path separator
+
+ Type! {}.get;
+ //~^ HELP use the path separator
+
+ //
+ // Ensure that the suggestion is shown for expressions inside of macro definitions.
+ //
+
+ let _ = create!(type method);
+ let _ = create!(type field);
+ let _ = create!(macro method);
}
diff --git a/src/test/ui/resolve/issue-22692.stderr b/src/test/ui/resolve/issue-22692.stderr
index e076419f6..6962aa161 100644
--- a/src/test/ui/resolve/issue-22692.stderr
+++ b/src/test/ui/resolve/issue-22692.stderr
@@ -2,10 +2,87 @@ error[E0423]: expected value, found struct `String`
--> $DIR/issue-22692.rs:2:13
|
LL | let _ = String.new();
- | ^^^^^^----
- | |
- | help: use the path separator to refer to an item: `String::new`
+ | ^^^^^^- help: use the path separator to refer to an item: `::`
-error: aborting due to previous error
+error[E0423]: expected value, found struct `String`
+ --> $DIR/issue-22692.rs:6:13
+ |
+LL | let _ = String.default;
+ | ^^^^^^- help: use the path separator to refer to an item: `::`
+
+error[E0423]: expected value, found struct `Vec`
+ --> $DIR/issue-22692.rs:10:13
+ |
+LL | let _ = Vec::<()>.with_capacity(1);
+ | ^^^^^^^^^- help: use the path separator to refer to an item: `::`
+
+error[E0423]: expected value, found struct `std::cell::Cell`
+ --> $DIR/issue-22692.rs:17:9
+ |
+LL | ::std::cell::Cell
+ | ^^^^^^^^^^^^^^^^^
+...
+LL | Type!().get();
+ | ------- in this macro invocation
+ |
+ = note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: use the path separator to refer to an item
+ |
+LL | <Type!()>::get();
+ | ~~~~~~~~~~~
+
+error[E0423]: expected value, found struct `std::cell::Cell`
+ --> $DIR/issue-22692.rs:17:9
+ |
+LL | ::std::cell::Cell
+ | ^^^^^^^^^^^^^^^^^
+...
+LL | Type! {}.get;
+ | -------- in this macro invocation
+ |
+ = note: this error originates in the macro `Type` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: use the path separator to refer to an item
+ |
+LL | <Type! {}>::get;
+ | ~~~~~~~~~~~~
+
+error[E0423]: expected value, found struct `Vec`
+ --> $DIR/issue-22692.rs:26:9
+ |
+LL | Vec.new()
+ | ^^^- help: use the path separator to refer to an item: `::`
+...
+LL | let _ = create!(type method);
+ | -------------------- in this macro invocation
+ |
+ = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0423]: expected value, found struct `Vec`
+ --> $DIR/issue-22692.rs:31:9
+ |
+LL | Vec.new
+ | ^^^- help: use the path separator to refer to an item: `::`
+...
+LL | let _ = create!(type field);
+ | ------------------- in this macro invocation
+ |
+ = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0423]: expected value, found struct `std::cell::Cell`
+ --> $DIR/issue-22692.rs:17:9
+ |
+LL | ::std::cell::Cell
+ | ^^^^^^^^^^^^^^^^^
+...
+LL | let _ = create!(macro method);
+ | --------------------- in this macro invocation
+ |
+ = note: this error originates in the macro `Type` which comes from the expansion of the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: use the path separator to refer to an item
+ |
+LL | <Type!()>::new(0)
+ | ~~~~~~~~~~~
+
+error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0423`.
diff --git a/src/test/ui/resolve/issue-23305.rs b/src/test/ui/resolve/issue-23305.rs
index 95635e12a..6d7fe7c50 100644
--- a/src/test/ui/resolve/issue-23305.rs
+++ b/src/test/ui/resolve/issue-23305.rs
@@ -3,6 +3,6 @@ pub trait ToNbt<T> {
}
impl dyn ToNbt<Self> {}
-//~^ ERROR cycle detected
+//~^ ERROR `Self` is not valid in the self type of an impl block
fn main() {}
diff --git a/src/test/ui/resolve/issue-23305.stderr b/src/test/ui/resolve/issue-23305.stderr
index 20aeb7b99..aad1b583a 100644
--- a/src/test/ui/resolve/issue-23305.stderr
+++ b/src/test/ui/resolve/issue-23305.stderr
@@ -1,22 +1,10 @@
-error[E0391]: cycle detected when computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:21>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/issue-23305.rs:5:16
|
LL | impl dyn ToNbt<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/issue-23305.rs:5:1: 5:21>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/issue-23305.rs:1:1
- |
-LL | / pub trait ToNbt<T> {
-LL | | fn new(val: T) -> Self;
-LL | | }
-LL | |
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/resolve/issue-2356.stderr b/src/test/ui/resolve/issue-2356.stderr
index b8d528efc..e7c53ff44 100644
--- a/src/test/ui/resolve/issue-2356.stderr
+++ b/src/test/ui/resolve/issue-2356.stderr
@@ -1,15 +1,3 @@
-error[E0425]: cannot find function `shave` in this scope
- --> $DIR/issue-2356.rs:17:5
- |
-LL | shave();
- | ^^^^^ not found in this scope
-
-error[E0425]: cannot find function `clone` in this scope
- --> $DIR/issue-2356.rs:24:5
- |
-LL | clone();
- | ^^^^^ help: you might have meant to call the method: `self.clone`
-
error[E0425]: cannot find function `default` in this scope
--> $DIR/issue-2356.rs:31:5
|
@@ -31,6 +19,51 @@ error[E0425]: cannot find value `whiskers` in this scope
LL | whiskers -= other;
| ^^^^^^^^ a field by this name exists in `Self`
+error[E0424]: expected value, found module `self`
+ --> $DIR/issue-2356.rs:65:8
+ |
+LL | fn meow() {
+ | ---- this function doesn't have a `self` parameter
+LL | if self.whiskers > 3 {
+ | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
+ |
+help: add a `self` receiver parameter to make the associated `fn` a method
+ |
+LL | fn meow(&self) {
+ | +++++
+
+error[E0425]: cannot find value `whiskers` in this scope
+ --> $DIR/issue-2356.rs:79:5
+ |
+LL | whiskers = 0;
+ | ^^^^^^^^ help: you might have meant to use the available field: `self.whiskers`
+
+error[E0425]: cannot find value `whiskers` in this scope
+ --> $DIR/issue-2356.rs:84:5
+ |
+LL | whiskers = 4;
+ | ^^^^^^^^ a field by this name exists in `Self`
+
+error[E0424]: expected value, found module `self`
+ --> $DIR/issue-2356.rs:92:5
+ |
+LL | fn main() {
+ | ---- this function can't have a `self` parameter
+LL | self += 1;
+ | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
+
+error[E0425]: cannot find function `shave` in this scope
+ --> $DIR/issue-2356.rs:17:5
+ |
+LL | shave();
+ | ^^^^^ not found in this scope
+
+error[E0425]: cannot find function `clone` in this scope
+ --> $DIR/issue-2356.rs:24:5
+ |
+LL | clone();
+ | ^^^^^ help: you might have meant to call the method: `self.clone`
+
error[E0425]: cannot find function `shave` in this scope
--> $DIR/issue-2356.rs:41:5
|
@@ -72,19 +105,6 @@ error[E0425]: cannot find function `purr` in this scope
LL | purr();
| ^^^^ not found in this scope
-error[E0424]: expected value, found module `self`
- --> $DIR/issue-2356.rs:65:8
- |
-LL | fn meow() {
- | ---- this function doesn't have a `self` parameter
-LL | if self.whiskers > 3 {
- | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
- |
-help: add a `self` receiver parameter to make the associated `fn` a method
- |
-LL | fn meow(&self) {
- | +++++
-
error[E0425]: cannot find function `grow_older` in this scope
--> $DIR/issue-2356.rs:72:5
|
@@ -102,32 +122,12 @@ error[E0425]: cannot find function `shave` in this scope
LL | shave();
| ^^^^^ not found in this scope
-error[E0425]: cannot find value `whiskers` in this scope
- --> $DIR/issue-2356.rs:79:5
- |
-LL | whiskers = 0;
- | ^^^^^^^^ help: you might have meant to use the available field: `self.whiskers`
-
-error[E0425]: cannot find value `whiskers` in this scope
- --> $DIR/issue-2356.rs:84:5
- |
-LL | whiskers = 4;
- | ^^^^^^^^ a field by this name exists in `Self`
-
error[E0425]: cannot find function `purr_louder` in this scope
--> $DIR/issue-2356.rs:86:5
|
LL | purr_louder();
| ^^^^^^^^^^^ not found in this scope
-error[E0424]: expected value, found module `self`
- --> $DIR/issue-2356.rs:92:5
- |
-LL | fn main() {
- | ---- this function can't have a `self` parameter
-LL | self += 1;
- | ^^^^ `self` value is a keyword only available in methods with a `self` parameter
-
error: aborting due to 17 previous errors
Some errors have detailed explanations: E0424, E0425.
diff --git a/src/test/ui/resolve/issue-3021-c.stderr b/src/test/ui/resolve/issue-3021-c.stderr
index 8764ac8a8..5176efc3a 100644
--- a/src/test/ui/resolve/issue-3021-c.stderr
+++ b/src/test/ui/resolve/issue-3021-c.stderr
@@ -3,22 +3,22 @@ error[E0401]: can't use generic parameters from outer function
|
LL | fn siphash<T>() {
| - type parameter from outer function
-...
+LL |
+LL | trait U {
+ | - help: try using a local generic parameter instead: `<T>`
LL | fn g(&self, x: T) -> T;
- | - ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `g<T>`
+ | ^ use of generic parameter from outer function
error[E0401]: can't use generic parameters from outer function
--> $DIR/issue-3021-c.rs:4:30
|
LL | fn siphash<T>() {
| - type parameter from outer function
-...
+LL |
+LL | trait U {
+ | - help: try using a local generic parameter instead: `<T>`
LL | fn g(&self, x: T) -> T;
- | - ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `g<T>`
+ | ^ use of generic parameter from outer function
error: aborting due to 2 previous errors
diff --git a/src/test/ui/resolve/issue-42944.stderr b/src/test/ui/resolve/issue-42944.stderr
index cad3ccc4a..0ee9fd391 100644
--- a/src/test/ui/resolve/issue-42944.stderr
+++ b/src/test/ui/resolve/issue-42944.stderr
@@ -1,15 +1,3 @@
-error[E0423]: cannot initialize a tuple struct which contains private fields
- --> $DIR/issue-42944.rs:9:9
- |
-LL | Bx(());
- | ^^
- |
-note: constructor is not visible here due to private fields
- --> $DIR/issue-42944.rs:2:19
- |
-LL | pub struct Bx(());
- | ^^ private field
-
error[E0425]: cannot find function, tuple struct or tuple variant `Bx` in this scope
--> $DIR/issue-42944.rs:16:9
|
@@ -22,6 +10,18 @@ note: tuple struct `foo::Bx` exists but is inaccessible
LL | pub struct Bx(());
| ^^^^^^^^^^^^^^^^^^ not accessible
+error[E0423]: cannot initialize a tuple struct which contains private fields
+ --> $DIR/issue-42944.rs:9:9
+ |
+LL | Bx(());
+ | ^^
+ |
+note: constructor is not visible here due to private fields
+ --> $DIR/issue-42944.rs:2:19
+ |
+LL | pub struct Bx(());
+ | ^^ private field
+
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0423, E0425.
diff --git a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs
index aaf0f7eae..49462f52f 100644
--- a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs
+++ b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.rs
@@ -14,7 +14,6 @@ trait B {
impl B for A {
async fn associated(); //~ ERROR without body
//~^ ERROR cannot be declared `async`
- //~| ERROR has an incompatible type for trait
}
fn main() {}
diff --git a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr
index d3214458e..1354abb4f 100644
--- a/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr
+++ b/src/test/ui/resolve/issue-70736-async-fn-no-body-def-collector.stderr
@@ -14,17 +14,6 @@ LL | async fn inherent();
| |
| help: provide a definition for the function: `{ <body> }`
-error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:11:5
- |
-LL | async fn associated();
- | -----^^^^^^^^^^^^^^^^^
- | |
- | `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
-
error: associated function in `impl` without body
--> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:5
|
@@ -34,7 +23,7 @@ LL | async fn associated();
| help: provide a definition for the function: `{ <body> }`
error[E0706]: functions in traits cannot be declared `async`
- --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:5
+ --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:11:5
|
LL | async fn associated();
| -----^^^^^^^^^^^^^^^^^
@@ -43,26 +32,22 @@ LL | async fn associated();
|
= 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[E0053]: method `associated` has an incompatible type for trait
- --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:26
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:15:5
|
LL | async fn associated();
- | ^
- | |
- | checked the `Output` of this `async fn`, found opaque type
- | expected `()`, found opaque type
- |
- = note: while checking the return type of the `async fn`
-note: type in trait
- --> $DIR/issue-70736-async-fn-no-body-def-collector.rs:11:26
+ | -----^^^^^^^^^^^^^^^^^
+ | |
+ | `async` because of this
|
-LL | async fn associated();
- | ^
- = note: expected fn pointer `fn()`
- found fn pointer `fn() -> impl Future<Output = ()>`
+ = 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 6 previous errors
+error: aborting due to 5 previous errors
-Some errors have detailed explanations: E0053, E0706.
-For more information about an error, try `rustc --explain E0053`.
+For more information about this error, try `rustc --explain E0706`.
diff --git a/src/test/ui/resolve/issue-73427.rs b/src/test/ui/resolve/issue-73427.rs
index 3c62782a8..5c2459a59 100644
--- a/src/test/ui/resolve/issue-73427.rs
+++ b/src/test/ui/resolve/issue-73427.rs
@@ -22,6 +22,10 @@ enum D {
Unit,
}
+enum E {
+ TupleWithFields(()),
+}
+
fn main() {
// Only variants without fields are suggested (and others mentioned in a note) where an enum
// is used rather than a variant.
@@ -34,6 +38,8 @@ fn main() {
//~^ ERROR expected value, found enum `C`
D.foo();
//~^ ERROR expected value, found enum `D`
+ E.foo();
+ //~^ ERROR expected value, found enum `E`
// Only tuple variants are suggested in calls or tuple struct pattern matching.
diff --git a/src/test/ui/resolve/issue-73427.stderr b/src/test/ui/resolve/issue-73427.stderr
index 59bb98a34..d31c5e477 100644
--- a/src/test/ui/resolve/issue-73427.stderr
+++ b/src/test/ui/resolve/issue-73427.stderr
@@ -1,5 +1,5 @@
error[E0423]: expected value, found enum `A`
- --> $DIR/issue-73427.rs:29:5
+ --> $DIR/issue-73427.rs:33:5
|
LL | A.foo();
| ^
@@ -23,7 +23,7 @@ LL | (A::Tuple()).foo();
| ~~~~~~~~~~~~
LL | A::Unit.foo();
| ~~~~~~~
-help: the following enum variants are available
+help: alternatively, the following enum variants are also available
|
LL | (A::StructWithFields { /* fields */ }).foo();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -31,7 +31,7 @@ LL | (A::TupleWithFields(/* fields */)).foo();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `B`
- --> $DIR/issue-73427.rs:31:5
+ --> $DIR/issue-73427.rs:35:5
|
LL | B.foo();
| ^
@@ -52,7 +52,7 @@ LL | (B::TupleWithFields(/* fields */)).foo();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `C`
- --> $DIR/issue-73427.rs:33:5
+ --> $DIR/issue-73427.rs:37:5
|
LL | C.foo();
| ^
@@ -70,7 +70,7 @@ help: you might have meant to use the following enum variant
|
LL | C::Unit.foo();
| ~~~~~~~
-help: the following enum variants are available
+help: alternatively, the following enum variants are also available
|
LL | (C::StructWithFields { /* fields */ }).foo();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -78,7 +78,7 @@ LL | (C::TupleWithFields(/* fields */)).foo();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `D`
- --> $DIR/issue-73427.rs:35:5
+ --> $DIR/issue-73427.rs:39:5
|
LL | D.foo();
| ^
@@ -95,38 +95,37 @@ help: you might have meant to use the following enum variant
|
LL | D::Unit.foo();
| ~~~~~~~
-help: the following enum variant is available
+help: alternatively, the following enum variant is available
|
LL | (D::TupleWithFields(/* fields */)).foo();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-error[E0423]: expected function, tuple struct or tuple variant, found enum `A`
- --> $DIR/issue-73427.rs:40:13
+error[E0423]: expected value, found enum `E`
+ --> $DIR/issue-73427.rs:41:5
|
-LL | let x = A(3);
- | ^
+LL | E.foo();
+ | ^
|
- = help: you might have meant to construct one of the enum's non-tuple variants
note: the enum is defined here
- --> $DIR/issue-73427.rs:1:1
+ --> $DIR/issue-73427.rs:25:1
|
-LL | / enum A {
-LL | | StructWithFields { x: () },
+LL | / enum E {
LL | | TupleWithFields(()),
-LL | | Struct {},
-LL | | Tuple(),
-LL | | Unit,
LL | | }
| |_^
-help: try to construct one of the enum's variants
+help: the following enum variant is available
+ |
+LL | (E::TupleWithFields(/* fields */)).foo();
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+help: consider importing one of these items instead
+ |
+LL | use std::f32::consts::E;
+ |
+LL | use std::f64::consts::E;
|
-LL | let x = A::Tuple(3);
- | ~~~~~~~~
-LL | let x = A::TupleWithFields(3);
- | ~~~~~~~~~~~~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found enum `A`
- --> $DIR/issue-73427.rs:42:12
+ --> $DIR/issue-73427.rs:48:12
|
LL | if let A(3) = x { }
| ^
@@ -150,7 +149,32 @@ LL | if let A::Tuple(3) = x { }
LL | if let A::TupleWithFields(3) = x { }
| ~~~~~~~~~~~~~~~~~~
-error: aborting due to 6 previous errors
+error[E0423]: expected function, tuple struct or tuple variant, found enum `A`
+ --> $DIR/issue-73427.rs:46:13
+ |
+LL | let x = A(3);
+ | ^
+ |
+ = help: you might have meant to construct one of the enum's non-tuple variants
+note: the enum is defined here
+ --> $DIR/issue-73427.rs:1:1
+ |
+LL | / enum A {
+LL | | StructWithFields { x: () },
+LL | | TupleWithFields(()),
+LL | | Struct {},
+LL | | Tuple(),
+LL | | Unit,
+LL | | }
+ | |_^
+help: try to construct one of the enum's variants
+ |
+LL | let x = A::Tuple(3);
+ | ~~~~~~~~
+LL | let x = A::TupleWithFields(3);
+ | ~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 7 previous errors
Some errors have detailed explanations: E0423, E0532.
For more information about an error, try `rustc --explain E0423`.
diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr
index 249a7e53d..9a2d61ea4 100644
--- a/src/test/ui/resolve/levenshtein.stderr
+++ b/src/test/ui/resolve/levenshtein.stderr
@@ -39,15 +39,6 @@ LL | const MAX_ITEM: usize = 10;
LL | let v = [0u32; MAXITEM]; // Misspelled constant name.
| ^^^^^^^ help: a constant with a similar name exists: `MAX_ITEM`
-error[E0425]: cannot find function `foobar` in this scope
- --> $DIR/levenshtein.rs:26:5
- |
-LL | fn foo_bar() {}
- | ------------ similarly named function `foo_bar` defined here
-...
-LL | foobar(); // Misspelled function name.
- | ^^^^^^ help: a function with a similar name exists: `foo_bar`
-
error[E0412]: cannot find type `first` in module `m`
--> $DIR/levenshtein.rs:28:15
|
@@ -66,6 +57,15 @@ LL | pub struct Second;
LL | let b: m::first = m::second; // Misspelled item in module.
| ^^^^^^ help: a unit struct with a similar name exists (notice the capitalization): `Second`
+error[E0425]: cannot find function `foobar` in this scope
+ --> $DIR/levenshtein.rs:26:5
+ |
+LL | fn foo_bar() {}
+ | ------------ similarly named function `foo_bar` defined here
+...
+LL | foobar(); // Misspelled function name.
+ | ^^^^^^ help: a function with a similar name exists: `foo_bar`
+
error: aborting due to 8 previous errors
Some errors have detailed explanations: E0412, E0425.
diff --git a/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs b/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs
new file mode 100644
index 000000000..fba4ffa1c
--- /dev/null
+++ b/src/test/ui/resolve/name-collision-in-trait-fn-sig.rs
@@ -0,0 +1,11 @@
+// check-pass
+// This is currently stable behavior, which was almost accidentally made an
+// error in #102161 since there is no test exercising it. I am not sure if
+// this _should_ be the desired behavior, but at least we should know if it
+// changes.
+
+fn main() {}
+
+trait Foo {
+ fn fn_with_type_named_same_as_local_in_param(b: i32, b: i32);
+}
diff --git a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.rs b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.rs
new file mode 100644
index 000000000..bd496875e
--- /dev/null
+++ b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.rs
@@ -0,0 +1,21 @@
+trait Foo<T> {
+ fn foo(&self, name: T) -> usize;
+}
+
+struct Bar {
+ baz: Baz,
+}
+
+struct Baz {
+ num: usize,
+}
+
+impl<Baz> Foo<Baz> for Bar {
+ fn foo(&self, _name: Baz) -> usize {
+ match self.baz {
+ Baz { num } => num, //~ ERROR expected struct, variant or union type, found type parameter `Baz`
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr
new file mode 100644
index 000000000..eb26cd9ca
--- /dev/null
+++ b/src/test/ui/resolve/point-at-type-parameter-shadowing-another-type.stderr
@@ -0,0 +1,17 @@
+error[E0574]: expected struct, variant or union type, found type parameter `Baz`
+ --> $DIR/point-at-type-parameter-shadowing-another-type.rs:16:13
+ |
+LL | / struct Baz {
+LL | | num: usize,
+LL | | }
+ | |_- you might have meant to refer to this struct
+LL |
+LL | impl<Baz> Foo<Baz> for Bar {
+ | --- found this type parameter
+...
+LL | Baz { num } => num,
+ | ^^^ not a struct, variant or union type
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0574`.
diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr
index f885ac215..82a4211f0 100644
--- a/src/test/ui/resolve/privacy-enum-ctor.stderr
+++ b/src/test/ui/resolve/privacy-enum-ctor.stderr
@@ -19,7 +19,7 @@ help: you might have meant to use the following enum variant
|
LL | m::Z::Unit;
| ~~~~~~~~~~
-help: the following enum variants are available
+help: alternatively, the following enum variants are also available
|
LL | (m::Z::Fn(/* fields */));
| ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -47,7 +47,7 @@ help: you might have meant to use the following enum variant
|
LL | m::Z::Unit;
| ~~~~~~~~~~
-help: the following enum variants are available
+help: alternatively, the following enum variants are also available
|
LL | (m::Z::Fn(/* fields */));
| ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -89,7 +89,7 @@ help: you might have meant to use the following enum variant
|
LL | let _: E = E::Unit;
| ~~~~~~~
-help: the following enum variants are available
+help: alternatively, the following enum variants are also available
|
LL | let _: E = (E::Fn(/* fields */));
| ~~~~~~~~~~~~~~~~~~~~~
@@ -143,7 +143,7 @@ help: you might have meant to use the following enum variant
|
LL | let _: E = E::Unit;
| ~~~~~~~
-help: the following enum variants are available
+help: alternatively, the following enum variants are also available
|
LL | let _: E = (E::Fn(/* fields */));
| ~~~~~~~~~~~~~~~~~~~~~
@@ -203,7 +203,7 @@ help: you might have meant to use the following enum variant
|
LL | let _: Z = m::Z::Unit;
| ~~~~~~~~~~
-help: the following enum variants are available
+help: alternatively, the following enum variants are also available
|
LL | let _: Z = (m::Z::Fn(/* fields */));
| ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -327,10 +327,10 @@ LL | let _: Z = Z::Fn;
|
= note: expected enum `Z`
found fn item `fn(u8) -> Z {Z::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
|
-LL | let _: Z = Z::Fn(_);
- | +++
+LL | let _: Z = Z::Fn(/* u8 */);
+ | ++++++++++
error[E0618]: expected function, found enum variant `Z::Unit`
--> $DIR/privacy-enum-ctor.rs:31:17
@@ -362,10 +362,10 @@ LL | let _: E = m::E::Fn;
|
= note: expected enum `E`
found fn item `fn(u8) -> E {E::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
|
-LL | let _: E = m::E::Fn(_);
- | +++
+LL | let _: E = m::E::Fn(/* u8 */);
+ | ++++++++++
error[E0618]: expected function, found enum variant `m::E::Unit`
--> $DIR/privacy-enum-ctor.rs:47:16
@@ -397,10 +397,10 @@ LL | let _: E = E::Fn;
|
= note: expected enum `E`
found fn item `fn(u8) -> E {E::Fn}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
|
-LL | let _: E = E::Fn(_);
- | +++
+LL | let _: E = E::Fn(/* u8 */);
+ | ++++++++++
error[E0618]: expected function, found enum variant `E::Unit`
--> $DIR/privacy-enum-ctor.rs:55:16
diff --git a/src/test/ui/resolve/resolve-assoc-suggestions.stderr b/src/test/ui/resolve/resolve-assoc-suggestions.stderr
index b6acaeb8c..8def9aa20 100644
--- a/src/test/ui/resolve/resolve-assoc-suggestions.stderr
+++ b/src/test/ui/resolve/resolve-assoc-suggestions.stderr
@@ -50,7 +50,7 @@ error[E0425]: cannot find value `method` in this scope
--> $DIR/resolve-assoc-suggestions.rs:34:9
|
LL | method;
- | ^^^^^^ help: you might have meant to call the method: `self.method`
+ | ^^^^^^ help: you might have meant to refer to the method: `self.method`
error: aborting due to 9 previous errors
diff --git a/src/test/ui/resolve/resolve-hint-macro.stderr b/src/test/ui/resolve/resolve-hint-macro.stderr
index bc69ddd8f..1e7ab48ef 100644
--- a/src/test/ui/resolve/resolve-hint-macro.stderr
+++ b/src/test/ui/resolve/resolve-hint-macro.stderr
@@ -14,17 +14,6 @@ LL | assert_eq { 1, 1 };
| |
| while parsing this struct
-error[E0423]: expected function, found macro `assert_eq`
- --> $DIR/resolve-hint-macro.rs:3:5
- |
-LL | assert_eq(1, 1);
- | ^^^^^^^^^ not a function
- |
-help: use `!` to invoke the macro
- |
-LL | assert_eq!(1, 1);
- | +
-
error[E0574]: expected struct, variant or union type, found macro `assert_eq`
--> $DIR/resolve-hint-macro.rs:5:5
|
@@ -47,6 +36,17 @@ help: use `!` to invoke the macro
LL | assert![true];
| +
+error[E0423]: expected function, found macro `assert_eq`
+ --> $DIR/resolve-hint-macro.rs:3:5
+ |
+LL | assert_eq(1, 1);
+ | ^^^^^^^^^ not a function
+ |
+help: use `!` to invoke the macro
+ |
+LL | assert_eq!(1, 1);
+ | +
+
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0423, E0574.
diff --git a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr
index 96c1869b4..c805c9eb1 100644
--- a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr
+++ b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr
@@ -31,6 +31,10 @@ LL | Opts::A(ref i) | Opts::B(i) => {}
| first introduced with type `&isize` here
|
= note: in the same arm, a binding must have the same type in all alternatives
+help: consider adding `ref`
+ |
+LL | Opts::A(ref i) | Opts::B(ref i) => {}
+ | +++
error[E0308]: mismatched types
--> $DIR/resolve-inconsistent-binding-mode.rs:18:34
@@ -43,6 +47,10 @@ LL | Opts::A(ref i) | Opts::B(i) => {}
| first introduced with type `&isize` here
|
= note: in the same arm, a binding must have the same type in all alternatives
+help: consider adding `ref`
+ |
+LL | Opts::A(ref i) | Opts::B(ref i) => {}
+ | +++
error[E0308]: mismatched types
--> $DIR/resolve-inconsistent-binding-mode.rs:27:38
diff --git a/src/test/ui/resolve/resolve-inconsistent-names.rs b/src/test/ui/resolve/resolve-inconsistent-names.rs
index 989d2d452..9a40b2034 100644
--- a/src/test/ui/resolve/resolve-inconsistent-names.rs
+++ b/src/test/ui/resolve/resolve-inconsistent-names.rs
@@ -23,6 +23,7 @@ fn main() {
//~| ERROR mismatched types
//~| ERROR variable `c` is not bound in all patterns
//~| HELP if you meant to match on unit variant `E::A`, use the full path in the pattern
+ //~| HELP consider removing `ref`
}
let z = (10, 20);
diff --git a/src/test/ui/resolve/resolve-inconsistent-names.stderr b/src/test/ui/resolve/resolve-inconsistent-names.stderr
index 9de191f7d..773c9f6cd 100644
--- a/src/test/ui/resolve/resolve-inconsistent-names.stderr
+++ b/src/test/ui/resolve/resolve-inconsistent-names.stderr
@@ -55,7 +55,7 @@ LL | (A, B) | (ref B, c) | (c, A) => ()
| first binding
error[E0408]: variable `CONST1` is not bound in all patterns
- --> $DIR/resolve-inconsistent-names.rs:30:23
+ --> $DIR/resolve-inconsistent-names.rs:31:23
|
LL | (CONST1, _) | (_, Const2) => ()
| ------ ^^^^^^^^^^^ pattern doesn't bind `CONST1`
@@ -69,7 +69,7 @@ LL | const CONST1: usize = 10;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ not accessible
error[E0408]: variable `Const2` is not bound in all patterns
- --> $DIR/resolve-inconsistent-names.rs:30:9
+ --> $DIR/resolve-inconsistent-names.rs:31:9
|
LL | (CONST1, _) | (_, Const2) => ()
| ^^^^^^^^^^^ ------ variable not in all patterns
@@ -92,6 +92,11 @@ LL | (A, B) | (ref B, c) | (c, A) => ()
| first introduced with type `E` here
|
= note: in the same arm, a binding must have the same type in all alternatives
+help: consider removing `ref`
+ |
+LL - (A, B) | (ref B, c) | (c, A) => ()
+LL + (A, B) | (B, c) | (c, A) => ()
+ |
error: aborting due to 9 previous errors
diff --git a/src/test/ui/resolve/resolve-primitive-fallback.stderr b/src/test/ui/resolve/resolve-primitive-fallback.stderr
index f0eb1a4f4..6d5d5bad9 100644
--- a/src/test/ui/resolve/resolve-primitive-fallback.stderr
+++ b/src/test/ui/resolve/resolve-primitive-fallback.stderr
@@ -34,7 +34,7 @@ LL | pub const fn size_of<T>() -> usize {
help: remove the extra argument
|
LL | std::mem::size_of();
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~
error: aborting due to 3 previous errors
diff --git a/src/test/ui/resolve/resolve-self-in-impl.rs b/src/test/ui/resolve/resolve-self-in-impl.rs
index 024fdc51e..d0872d1b7 100644
--- a/src/test/ui/resolve/resolve-self-in-impl.rs
+++ b/src/test/ui/resolve/resolve-self-in-impl.rs
@@ -11,10 +11,11 @@ impl Tr for S where Self: Copy {} // OK
impl Tr for S where S<Self>: Copy {} // OK
impl Tr for S where Self::A: Copy {} // OK
-impl Tr for Self {} //~ ERROR cycle detected
-impl Tr for S<Self> {} //~ ERROR cycle detected
-impl Self {} //~ ERROR cycle detected
-impl S<Self> {} //~ ERROR cycle detected
+impl Tr for Self {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl Tr for S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl Self {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
+impl (Self, Self) {} //~ ERROR `Self` is not valid in the self type of an impl block
impl Tr<Self::A> for S {} //~ ERROR cycle detected
fn main() {}
diff --git a/src/test/ui/resolve/resolve-self-in-impl.stderr b/src/test/ui/resolve/resolve-self-in-impl.stderr
index aa99c1a33..9f9ed6889 100644
--- a/src/test/ui/resolve/resolve-self-in-impl.stderr
+++ b/src/test/ui/resolve/resolve-self-in-impl.stderr
@@ -1,86 +1,50 @@
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:17>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:14:13
|
LL | impl Tr for Self {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:14:1: 14:17>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
- |
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:20>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:15:15
|
LL | impl Tr for S<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:15:1: 15:20>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
- |
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:10>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:16:6
|
LL | impl Self {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:16:1: 16:10>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
- |
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:13>`
+error: `Self` is not valid in the self type of an impl block
--> $DIR/resolve-self-in-impl.rs:17:8
|
LL | impl S<Self> {}
| ^^^^
|
- = note: ...which immediately requires computing type of `<impl at $DIR/resolve-self-in-impl.rs:17:1: 17:13>` again
-note: cycle used when collecting item types in top-level module
- --> $DIR/resolve-self-in-impl.rs:1:1
+ = note: replace `Self` with a different type
+
+error: `Self` is not valid in the self type of an impl block
+ --> $DIR/resolve-self-in-impl.rs:18:7
|
-LL | / #![feature(associated_type_defaults)]
-LL | |
-LL | | struct S<T = u8>(T);
-LL | | trait Tr<T = u8> {
-... |
-LL | |
-LL | | fn main() {}
- | |____________^
+LL | impl (Self, Self) {}
+ | ^^^^ ^^^^
+ |
+ = note: replace `Self` with a different type
-error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>`
- --> $DIR/resolve-self-in-impl.rs:18:1
+error[E0391]: cycle detected when computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>`
+ --> $DIR/resolve-self-in-impl.rs:19:1
|
LL | impl Tr<Self::A> for S {}
| ^^^^^^^^^^^^^^^^^^^^^^
|
- = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:18:1: 18:23>` again
+ = note: ...which immediately requires computing trait implemented by `<impl at $DIR/resolve-self-in-impl.rs:19:1: 19:23>` again
note: cycle used when collecting item types in top-level module
--> $DIR/resolve-self-in-impl.rs:1:1
|
@@ -93,6 +57,6 @@ LL | |
LL | | fn main() {}
| |____________^
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/resolve/resolve-speculative-adjustment.stderr b/src/test/ui/resolve/resolve-speculative-adjustment.stderr
index 1c34af6d0..be11a7ebe 100644
--- a/src/test/ui/resolve/resolve-speculative-adjustment.stderr
+++ b/src/test/ui/resolve/resolve-speculative-adjustment.stderr
@@ -4,12 +4,6 @@ error[E0425]: cannot find value `field` in this scope
LL | field;
| ^^^^^ not found in this scope
-error[E0425]: cannot find function `method` in this scope
- --> $DIR/resolve-speculative-adjustment.rs:19:13
- |
-LL | method();
- | ^^^^^^ not found in this scope
-
error[E0425]: cannot find value `field` in this scope
--> $DIR/resolve-speculative-adjustment.rs:23:9
|
@@ -22,6 +16,12 @@ error[E0425]: cannot find function `method` in this scope
LL | method();
| ^^^^^^ help: you might have meant to call the method: `self.method`
+error[E0425]: cannot find function `method` in this scope
+ --> $DIR/resolve-speculative-adjustment.rs:19:13
+ |
+LL | method();
+ | ^^^^^^ not found in this scope
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr b/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr
index 10a703ee0..0a6d1cc3b 100644
--- a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr
+++ b/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr
@@ -4,8 +4,8 @@ error[E0401]: can't use generic parameters from outer function
LL | trait TraitA<A> {
| - type parameter from outer function
LL | fn outer(&self) {
- | ----- try adding a local generic parameter in this method instead
LL | enum Foo<B> {
+ | - help: try using a local generic parameter instead: `A,`
LL | Variance(A)
| ^ use of generic parameter from outer function
@@ -15,9 +15,10 @@ error[E0401]: can't use generic parameters from outer function
LL | trait TraitB<A> {
| - type parameter from outer function
LL | fn outer(&self) {
- | ----- try adding a local generic parameter in this method instead
LL | struct Foo<B>(A);
- | ^ use of generic parameter from outer function
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `A,`
error[E0401]: can't use generic parameters from outer function
--> $DIR/resolve-type-param-in-item-in-trait.rs:23:28
@@ -25,9 +26,10 @@ error[E0401]: can't use generic parameters from outer function
LL | trait TraitC<A> {
| - type parameter from outer function
LL | fn outer(&self) {
- | ----- try adding a local generic parameter in this method instead
LL | struct Foo<B> { a: A }
- | ^ use of generic parameter from outer function
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `A,`
error[E0401]: can't use generic parameters from outer function
--> $DIR/resolve-type-param-in-item-in-trait.rs:30:22
@@ -36,9 +38,9 @@ LL | trait TraitD<A> {
| - type parameter from outer function
LL | fn outer(&self) {
LL | fn foo<B>(a: A) { }
- | ------ ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `foo<B, A>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `A,`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/resolve/suggest-path-for-tuple-struct.stderr b/src/test/ui/resolve/suggest-path-for-tuple-struct.stderr
index 957045ca7..4764cf2db 100644
--- a/src/test/ui/resolve/suggest-path-for-tuple-struct.stderr
+++ b/src/test/ui/resolve/suggest-path-for-tuple-struct.stderr
@@ -2,17 +2,13 @@ error[E0423]: expected value, found struct `SomeTupleStruct`
--> $DIR/suggest-path-for-tuple-struct.rs:22:13
|
LL | let _ = SomeTupleStruct.new();
- | ^^^^^^^^^^^^^^^----
- | |
- | help: use the path separator to refer to an item: `SomeTupleStruct::new`
+ | ^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::`
error[E0423]: expected value, found struct `SomeRegularStruct`
--> $DIR/suggest-path-for-tuple-struct.rs:24:13
|
LL | let _ = SomeRegularStruct.new();
- | ^^^^^^^^^^^^^^^^^----
- | |
- | help: use the path separator to refer to an item: `SomeRegularStruct::new`
+ | ^^^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs
index 204a27240..d5d6b13d6 100644
--- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs
+++ b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.rs
@@ -16,44 +16,96 @@ pub mod a {
fn h1() -> i32 {
a.I
//~^ ERROR expected value, found module `a`
+ //~| HELP use the path separator
}
fn h2() -> i32 {
a.g()
//~^ ERROR expected value, found module `a`
+ //~| HELP use the path separator
}
fn h3() -> i32 {
a.b.J
//~^ ERROR expected value, found module `a`
+ //~| HELP use the path separator
}
fn h4() -> i32 {
a::b.J
//~^ ERROR expected value, found module `a::b`
+ //~| HELP a constant with a similar name exists
+ //~| HELP use the path separator
}
fn h5() {
a.b.f();
//~^ ERROR expected value, found module `a`
+ //~| HELP use the path separator
let v = Vec::new();
v.push(a::b);
//~^ ERROR expected value, found module `a::b`
+ //~| HELP a constant with a similar name exists
}
fn h6() -> i32 {
a::b.f()
//~^ ERROR expected value, found module `a::b`
+ //~| HELP a constant with a similar name exists
+ //~| HELP use the path separator
}
fn h7() {
a::b
//~^ ERROR expected value, found module `a::b`
+ //~| HELP a constant with a similar name exists
}
fn h8() -> i32 {
a::b()
//~^ ERROR expected function, found module `a::b`
+ //~| HELP a constant with a similar name exists
+}
+
+macro_rules! module {
+ () => {
+ a
+ //~^ ERROR expected value, found module `a`
+ //~| ERROR expected value, found module `a`
+ };
+}
+
+macro_rules! create {
+ (method) => {
+ a.f()
+ //~^ ERROR expected value, found module `a`
+ //~| HELP use the path separator
+ };
+ (field) => {
+ a.f
+ //~^ ERROR expected value, found module `a`
+ //~| HELP use the path separator
+ };
+}
+
+fn h9() {
+ //
+ // Note that if the receiver is a macro call, we do not want to suggest to replace
+ // `.` with `::` as that would be a syntax error.
+ // Since the receiver is a module and not a type, we cannot suggest to surround
+ // it with angle brackets.
+ //
+
+ module!().g::<()>(); // no `help` here!
+
+ module!().g; // no `help` here!
+
+ //
+ // Ensure that the suggestion is shown for expressions inside of macro definitions.
+ //
+
+ let _ = create!(method);
+ let _ = create!(field);
}
fn main() {}
diff --git a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
index 54b242123..a4ce0deeb 100644
--- a/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
+++ b/src/test/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr
@@ -2,28 +2,22 @@ error[E0423]: expected value, found module `a`
--> $DIR/suggest-path-instead-of-mod-dot-item.rs:17:5
|
LL | a.I
- | ^--
- | |
- | help: use the path separator to refer to an item: `a::I`
+ | ^- help: use the path separator to refer to an item: `::`
error[E0423]: expected value, found module `a`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:22:5
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:23:5
|
LL | a.g()
- | ^--
- | |
- | help: use the path separator to refer to an item: `a::g`
+ | ^- help: use the path separator to refer to an item: `::`
error[E0423]: expected value, found module `a`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:27:5
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:29:5
|
LL | a.b.J
- | ^--
- | |
- | help: use the path separator to refer to an item: `a::b`
+ | ^- help: use the path separator to refer to an item: `::`
error[E0423]: expected value, found module `a::b`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:32:5
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:35:5
|
LL | pub const I: i32 = 1;
| --------------------- similarly named constant `I` defined here
@@ -34,22 +28,20 @@ LL | a::b.J
help: use the path separator to refer to an item
|
LL | a::b::J
- |
+ | ~~
help: a constant with a similar name exists
|
LL | a::I.J
| ~
error[E0423]: expected value, found module `a`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:37:5
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:42:5
|
LL | a.b.f();
- | ^--
- | |
- | help: use the path separator to refer to an item: `a::b`
+ | ^- help: use the path separator to refer to an item: `::`
error[E0423]: expected value, found module `a::b`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:40:12
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:46:12
|
LL | pub const I: i32 = 1;
| --------------------- similarly named constant `I` defined here
@@ -60,7 +52,7 @@ LL | v.push(a::b);
| help: a constant with a similar name exists: `I`
error[E0423]: expected value, found module `a::b`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:45:5
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:52:5
|
LL | pub const I: i32 = 1;
| --------------------- similarly named constant `I` defined here
@@ -71,14 +63,14 @@ LL | a::b.f()
help: use the path separator to refer to an item
|
LL | a::b::f()
- | ~~~~~~~
+ | ~~
help: a constant with a similar name exists
|
LL | a::I.f()
| ~
error[E0423]: expected value, found module `a::b`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:50:5
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:59:5
|
LL | pub const I: i32 = 1;
| --------------------- similarly named constant `I` defined here
@@ -89,7 +81,7 @@ LL | a::b
| help: a constant with a similar name exists: `I`
error[E0423]: expected function, found module `a::b`
- --> $DIR/suggest-path-instead-of-mod-dot-item.rs:55:5
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:65:5
|
LL | pub const I: i32 = 1;
| --------------------- similarly named constant `I` defined here
@@ -99,6 +91,50 @@ LL | a::b()
| |
| help: a constant with a similar name exists: `I`
-error: aborting due to 9 previous errors
+error[E0423]: expected value, found module `a`
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:72:9
+ |
+LL | a
+ | ^ not a value
+...
+LL | module!().g::<()>(); // no `help` here!
+ | --------- in this macro invocation
+ |
+ = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0423]: expected value, found module `a`
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:72:9
+ |
+LL | a
+ | ^ not a value
+...
+LL | module!().g; // no `help` here!
+ | --------- in this macro invocation
+ |
+ = note: this error originates in the macro `module` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0423]: expected value, found module `a`
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:80:9
+ |
+LL | a.f()
+ | ^- help: use the path separator to refer to an item: `::`
+...
+LL | let _ = create!(method);
+ | --------------- in this macro invocation
+ |
+ = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0423]: expected value, found module `a`
+ --> $DIR/suggest-path-instead-of-mod-dot-item.rs:85:9
+ |
+LL | a.f
+ | ^- help: use the path separator to refer to an item: `::`
+...
+LL | let _ = create!(field);
+ | -------------- in this macro invocation
+ |
+ = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0423`.
diff --git a/src/test/ui/resolve/tuple-struct-alias.stderr b/src/test/ui/resolve/tuple-struct-alias.stderr
index 5a7873301..a739ea43e 100644
--- a/src/test/ui/resolve/tuple-struct-alias.stderr
+++ b/src/test/ui/resolve/tuple-struct-alias.stderr
@@ -1,22 +1,22 @@
-error[E0423]: expected function, tuple struct or tuple variant, found type alias `A`
- --> $DIR/tuple-struct-alias.rs:5:13
+error[E0532]: expected tuple struct or tuple variant, found type alias `A`
+ --> $DIR/tuple-struct-alias.rs:7:9
|
LL | struct S(u8, u16);
| ------------------ similarly named tuple struct `S` defined here
...
-LL | let s = A(0, 1);
- | ^ help: a tuple struct with a similar name exists: `S`
+LL | A(..) => {}
+ | ^ help: a tuple struct with a similar name exists: `S`
|
= note: can't use a type alias as a constructor
-error[E0532]: expected tuple struct or tuple variant, found type alias `A`
- --> $DIR/tuple-struct-alias.rs:7:9
+error[E0423]: expected function, tuple struct or tuple variant, found type alias `A`
+ --> $DIR/tuple-struct-alias.rs:5:13
|
LL | struct S(u8, u16);
| ------------------ similarly named tuple struct `S` defined here
...
-LL | A(..) => {}
- | ^ help: a tuple struct with a similar name exists: `S`
+LL | let s = A(0, 1);
+ | ^ help: a tuple struct with a similar name exists: `S`
|
= note: can't use a type alias as a constructor
diff --git a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr b/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
index 0b0a37f24..f32e0404e 100644
--- a/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
+++ b/src/test/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr
@@ -31,24 +31,6 @@ help: a local variable with a similar name exists
LL | println!("{cofig}");
| ~~~~~
-error[E0425]: cannot find function `baz` in this scope
- --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9
- |
-LL | baz();
- | ^^^
-...
-LL | fn ba() {}
- | ------- similarly named function `ba` defined here
- |
-help: you might have meant to call the method
- |
-LL | self.baz();
- | ~~~~~~~~
-help: a function with a similar name exists
- |
-LL | ba();
- | ~~
-
error[E0425]: cannot find value `bah` in this scope
--> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:33:9
|
@@ -58,7 +40,7 @@ LL | bah;
LL | fn ba() {}
| ------- similarly named function `ba` defined here
|
-help: you might have meant to call the associated function
+help: you might have meant to refer to the associated function
|
LL | Self::bah;
| ~~~~~~~~~
@@ -103,6 +85,24 @@ help: a type alias with a similar name exists
LL | let foo: Bar = "".to_string();
| ~~~
+error[E0425]: cannot find function `baz` in this scope
+ --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:31:9
+ |
+LL | baz();
+ | ^^^
+...
+LL | fn ba() {}
+ | ------- similarly named function `ba` defined here
+ |
+help: you might have meant to call the method
+ |
+LL | self.baz();
+ | ~~~~~~~~
+help: a function with a similar name exists
+ |
+LL | ba();
+ | ~~
+
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0412, E0425.
diff --git a/src/test/ui/issues/issue-64620.rs b/src/test/ui/return/issue-64620.rs
index a62e5bf8d..a62e5bf8d 100644
--- a/src/test/ui/issues/issue-64620.rs
+++ b/src/test/ui/return/issue-64620.rs
diff --git a/src/test/ui/issues/issue-64620.stderr b/src/test/ui/return/issue-64620.stderr
index f40ac4de3..f40ac4de3 100644
--- a/src/test/ui/issues/issue-64620.stderr
+++ b/src/test/ui/return/issue-64620.stderr
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
index 659a98126..10dd635ff 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr
@@ -4,13 +4,13 @@ warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be a
LL | WRAP_DOUBLY_INDIRECT_INLINE => { panic!("WRAP_DOUBLY_INDIRECT_INLINE 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 lint level is defined here
--> $DIR/cant-hide-behind-doubly-indirect-embedded.rs:7:9
|
LL | #![warn(indirect_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
warning: 1 warning emitted
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
index c8c365105..66aecbc4f 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr
@@ -4,13 +4,13 @@ warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be a
LL | WRAP_DOUBLY_INDIRECT_PARAM => { panic!("WRAP_DOUBLY_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 lint level is defined here
--> $DIR/cant-hide-behind-doubly-indirect-param.rs:7:9
|
LL | #![warn(indirect_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
warning: 1 warning emitted
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
index 8abbd5d34..ee92954a6 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr
@@ -4,13 +4,13 @@ warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be a
LL | WRAP_INDIRECT_INLINE => { panic!("WRAP_INDIRECT_INLINE 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 lint level is defined here
--> $DIR/cant-hide-behind-indirect-struct-embedded.rs:7:9
|
LL | #![warn(indirect_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
warning: 1 warning emitted
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
index 3a716d54f..f0c492d6a 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr
@@ -4,13 +4,13 @@ warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be a
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 lint level is defined here
--> $DIR/cant-hide-behind-indirect-struct-param.rs:7:9
|
LL | #![warn(indirect_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
warning: 1 warning emitted
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
index a50093a5b..955ab4b54 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr
@@ -4,13 +4,13 @@ warning: to use a constant of type `B` in a pattern, `B` must be annotated with
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 lint level is defined here
--> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:13:9
|
LL | #![warn(indirect_structural_match, nontrivial_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
warning: to use a constant of type `B` in a pattern, `B` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/issue-62307-match-ref-ref-forbidden-without-eq.rs:38:9
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr
index 8cf87cc85..d6afc0255 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr
@@ -4,13 +4,13 @@ warning: function pointers and unsized pointers in patterns behave unpredictably
LL | B(TEST) => println!("matched"),
| ^^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
note: the lint level is defined here
--> $DIR/issue-63479-match-fnptr.rs:8:9
|
LL | #![warn(pointer_structural_match)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
warning: 1 warning emitted
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr
index 4e2961e5e..f37255d08 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr
@@ -4,13 +4,13 @@ error: floating-point types cannot be used in patterns
LL | NAN => {},
| ^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
note: the lint level is defined here
--> $DIR/issue-6804.rs:4:9
|
LL | #![deny(illegal_floating_point_literal_pattern)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-6804.rs:17:10
diff --git a/src/test/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr b/src/test/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
index df4809dab..616ed9e48 100644
--- a/src/test/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
+++ b/src/test/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr
@@ -10,9 +10,9 @@ warning: floating-point types cannot be used in patterns
LL | f32::INFINITY => { }
| ^^^^^^^^^^^^^
|
- = note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
+ = note: `#[warn(illegal_floating_point_literal_pattern)]` on by default
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs b/src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs
new file mode 100644
index 000000000..a75c91cc9
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs
@@ -0,0 +1,11 @@
+// Check that we don't blindly emit a diagnostic claiming that "`main` has an invalid return type"
+// if we encounter a type that doesn't implement `std::process::Termination` and is not actually
+// the return type of the program entry `main`.
+
+fn receive(_: impl std::process::Termination) {}
+
+struct Something;
+
+fn main() {
+ receive(Something); //~ ERROR the trait bound `Something: Termination` is not satisfied
+}
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr b/src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr
new file mode 100644
index 000000000..409dede1a
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr
@@ -0,0 +1,17 @@
+error[E0277]: the trait bound `Something: Termination` is not satisfied
+ --> $DIR/issue-103052-1.rs:10:13
+ |
+LL | receive(Something);
+ | ------- ^^^^^^^^^ the trait `Termination` is not implemented for `Something`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `receive`
+ --> $DIR/issue-103052-1.rs:5:20
+ |
+LL | fn receive(_: impl std::process::Termination) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `receive`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs b/src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs
new file mode 100644
index 000000000..fa9182b6d
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs
@@ -0,0 +1,18 @@
+#![feature(return_position_impl_trait_in_trait)]
+#![allow(incomplete_features)]
+
+mod child {
+ trait Main {
+ fn main() -> impl std::process::Termination;
+ }
+
+ struct Something;
+
+ impl Main for () {
+ fn main() -> Something { //~ ERROR the trait bound `Something: Termination` is not satisfied
+ Something
+ }
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr b/src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr
new file mode 100644
index 000000000..a700c72ea
--- /dev/null
+++ b/src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr
@@ -0,0 +1,15 @@
+error[E0277]: the trait bound `Something: Termination` is not satisfied
+ --> $DIR/issue-103052-2.rs:12: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
+ |
+LL | fn main() -> impl std::process::Termination;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Main::main::{opaque#0}`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs
index cd57d9bca..43888cece 100644
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs
@@ -2,7 +2,6 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(test)]
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
index 6086723b5..6ee323146 100644
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
@@ -1,4 +1,4 @@
-error[E0277]: `main` has invalid return type `f32`
+error[E0277]: the trait bound `f32: Termination` is not satisfied
--> $DIR/termination-trait-test-wrong-type.rs:6:1
|
LL | #[test]
@@ -6,14 +6,13 @@ LL | #[test]
LL | / fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> {
LL | | "0".parse()
LL | | }
- | |_^ `main` can only return types that implement `Termination`
+ | |_^ the trait `Termination` is not implemented for `f32`
|
- = help: the trait `Termination` is not implemented for `f32`
- = note: required because of the requirements on the impl of `Termination` for `Result<f32, ParseFloatError>`
+ = note: required for `Result<f32, ParseFloatError>` to implement `Termination`
note: required by a bound in `assert_test_result`
--> $SRC_DIR/test/src/lib.rs:LL:COL
|
-LL | pub fn assert_test_result<T: Termination>(result: T) {
+LL | pub fn assert_test_result<T: Termination>(result: T) -> Result<(), String> {
| ^^^^^^^^^^^ required by this bound in `assert_test_result`
= note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs b/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
index d9657bac7..5dce8180f 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
+++ b/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.rs
@@ -1,5 +1,4 @@
// aux-build:enums.rs
-// run-pass
extern crate enums;
@@ -7,11 +6,6 @@ use enums::FieldLessWithNonExhaustiveVariant;
fn main() {
let e = FieldLessWithNonExhaustiveVariant::default();
- // FIXME: https://github.com/rust-lang/rust/issues/91161
- // This `as` cast *should* be an error, since it would fail
- // if the non-exhaustive variant got fields. But today it
- // doesn't. The fix for that will update this test to
- // show an error (and not be run-pass any more).
- let d = e as u8;
+ let d = e as u8; //~ ERROR casting `FieldLessWithNonExhaustiveVariant` as `u8` is invalid [E0606]
assert_eq!(d, 0);
}
diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr b/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr
new file mode 100644
index 000000000..a61dcf839
--- /dev/null
+++ b/src/test/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr
@@ -0,0 +1,11 @@
+error[E0606]: casting `FieldLessWithNonExhaustiveVariant` as `u8` is invalid
+ --> $DIR/enum-as-cast.rs:9:13
+ |
+LL | let d = e as u8;
+ | ^^^^^^^
+ |
+ = note: cannot cast an enum with a non-exhaustive variant when it's defined in another crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0606`.
diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs b/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
index 70253a4fc..69a283c31 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
+++ b/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
@@ -31,7 +31,7 @@ fn empty_non_exhaustive(x: EmptyNonExhaustiveEnum) {
fn main() {
match NonExhaustiveEnum::Unit {}
- //~^ ERROR `Unit`, `Tuple(_)` and `Struct { .. }` not covered [E0004]
+ //~^ ERROR `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered [E0004]
match NormalEnum::Unit {}
- //~^ ERROR `Unit`, `Tuple(_)` and `Struct { .. }` not covered [E0004]
+ //~^ ERROR `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered [E0004]
}
diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr b/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
index 1f2090448..de1bf8be8 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
@@ -10,11 +10,11 @@ note: the lint level is defined here
LL | #![deny(unreachable_patterns)]
| ^^^^^^^^^^^^^^^^^^^^
-error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
+error[E0004]: non-exhaustive patterns: `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
--> $DIR/enum_same_crate_empty_match.rs:33:11
|
LL | match NonExhaustiveEnum::Unit {}
- | ^^^^^^^^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
+ | ^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
|
note: `NonExhaustiveEnum` defined here
--> $DIR/enum_same_crate_empty_match.rs:5:5
@@ -33,15 +33,15 @@ LL | Struct { field: u32 }
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 ~ match NonExhaustiveEnum::Unit {
-LL + Unit | Tuple(_) | Struct { .. } => todo!(),
+LL + NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_) | NonExhaustiveEnum::Struct { .. } => todo!(),
LL + }
|
-error[E0004]: non-exhaustive patterns: `Unit`, `Tuple(_)` and `Struct { .. }` not covered
+error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
--> $DIR/enum_same_crate_empty_match.rs:35:11
|
LL | match NormalEnum::Unit {}
- | ^^^^^^^^^^^^^^^^ patterns `Unit`, `Tuple(_)` and `Struct { .. }` not covered
+ | ^^^^^^^^^^^^^^^^ patterns `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
|
note: `NormalEnum` defined here
--> $DIR/enum_same_crate_empty_match.rs:14:5
@@ -60,7 +60,7 @@ LL | Struct { field: u32 }
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 ~ match NormalEnum::Unit {
-LL + Unit | Tuple(_) | Struct { .. } => todo!(),
+LL + NormalEnum::Unit | NormalEnum::Tuple(_) | NormalEnum::Struct { .. } => todo!(),
LL + }
|
diff --git a/src/test/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr b/src/test/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr
index 8a18ebc16..43c8e1015 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr
@@ -4,12 +4,12 @@ error: `extern` block uses type `NonExhaustiveEnum`, which is not FFI-safe
LL | pub fn non_exhaustive_enum(_: NonExhaustiveEnum);
| ^^^^^^^^^^^^^^^^^ not FFI-safe
|
+ = note: this enum is non-exhaustive
note: the lint level is defined here
--> $DIR/extern_crate_improper.rs:2:9
|
LL | #![deny(improper_ctypes)]
| ^^^^^^^^^^^^^^^
- = note: this enum is non-exhaustive
error: `extern` block uses type `NormalStruct`, which is not FFI-safe
--> $DIR/extern_crate_improper.rs:14:44
diff --git a/src/test/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr
index a9885449f..996bd4a12 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr
@@ -4,13 +4,13 @@ warning: some fields are not explicitly listed
LL | VariantNonExhaustive::Bar { x, .. } => {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `y` not listed
|
+ = help: ensure that all fields are mentioned explicitly by adding the suggested fields
+ = note: the pattern is of type `VariantNonExhaustive` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:99:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all fields are mentioned explicitly by adding the suggested fields
- = note: the pattern is of type `VariantNonExhaustive` and the `non_exhaustive_omitted_patterns` attribute was found
warning: some fields are not explicitly listed
--> $DIR/omitted-patterns.rs:107:9
@@ -18,13 +18,13 @@ warning: some fields are not explicitly listed
LL | let FunctionalRecord { first_field, second_field, .. } = FunctionalRecord::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `third_field` not listed
|
+ = help: ensure that all fields are mentioned explicitly by adding the suggested fields
+ = note: the pattern is of type `FunctionalRecord` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:106:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all fields are mentioned explicitly by adding the suggested fields
- = note: the pattern is of type `FunctionalRecord` and the `non_exhaustive_omitted_patterns` attribute was found
warning: some fields are not explicitly listed
--> $DIR/omitted-patterns.rs:115:29
@@ -32,13 +32,13 @@ warning: some fields are not explicitly listed
LL | let NestedStruct { bar: NormalStruct { first_field, .. }, .. } = NestedStruct::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `second_field` not listed
|
+ = help: ensure that all fields are mentioned explicitly by adding the suggested fields
+ = note: the pattern is of type `NormalStruct` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:114:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all fields are mentioned explicitly by adding the suggested fields
- = note: the pattern is of type `NormalStruct` and the `non_exhaustive_omitted_patterns` attribute was found
warning: some fields are not explicitly listed
--> $DIR/omitted-patterns.rs:115:9
@@ -55,13 +55,13 @@ warning: some fields are not explicitly listed
LL | let OnlyUnstableStruct { unstable, .. } = OnlyUnstableStruct::new();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable2` not listed
|
+ = help: ensure that all fields are mentioned explicitly by adding the suggested fields
+ = note: the pattern is of type `OnlyUnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:172:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all fields are mentioned explicitly by adding the suggested fields
- = note: the pattern is of type `OnlyUnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
warning: some fields are not explicitly listed
--> $DIR/omitted-patterns.rs:181:9
@@ -69,75 +69,75 @@ warning: some fields are not explicitly listed
LL | let UnstableStruct { stable, stable2, .. } = UnstableStruct::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable` not listed
|
+ = help: ensure that all fields are mentioned explicitly by adding the suggested fields
+ = note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:180:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all fields are mentioned explicitly by adding the suggested fields
- = note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:58:9
|
LL | _ => {}
- | ^ pattern `Struct { .. }` not covered
+ | ^ 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:57:16
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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
error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:65:9
|
LL | _ => {}
- | ^ pattern `Tuple(_)` not covered
+ | ^ pattern `NonExhaustiveEnum::Tuple(_)` 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:64:16
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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
error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:75:9
|
LL | _ => {}
- | ^ pattern `Unit` not covered
+ | ^ pattern `NonExhaustiveEnum::Unit` 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:74:16
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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
error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:92:32
|
LL | NestedNonExhaustive::A(_) => {}
- | ^ patterns `Tuple(_)` and `Struct { .. }` not covered
+ | ^ patterns `NonExhaustiveEnum::Tuple(_)` and `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:89:12
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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
error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:94:9
|
LL | _ => {}
- | ^ pattern `C` not covered
+ | ^ pattern `NestedNonExhaustive::C` not covered
|
= help: ensure that all variants are matched explicitly by adding the suggested match arms
= note: the matched value is of type `NestedNonExhaustive` and the `non_exhaustive_omitted_patterns` attribute was found
@@ -146,43 +146,43 @@ error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:132:9
|
LL | _ => {}
- | ^ pattern `A(_)` not covered
+ | ^ pattern `NonExhaustiveSingleVariant::A(_)` not covered
|
+ = help: ensure that all variants are matched explicitly by adding the suggested match arms
+ = note: the matched value is of type `NonExhaustiveSingleVariant` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:130:12
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all variants are matched explicitly by adding the suggested match arms
- = note: the matched value is of type `NonExhaustiveSingleVariant` and the `non_exhaustive_omitted_patterns` attribute was found
error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:144:9
|
LL | _ => {}
- | ^ pattern `Unstable` not covered
+ | ^ pattern `UnstableEnum::Unstable` not covered
|
+ = help: ensure that all variants are matched explicitly by adding the suggested match arms
+ = note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:143:16
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all variants are matched explicitly by adding the suggested match arms
- = note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
error: some variants are not matched explicitly
--> $DIR/omitted-patterns.rs:168:9
|
LL | _ => {}
- | ^ pattern `Unstable2` not covered
+ | ^ pattern `OnlyUnstableEnum::Unstable2` not covered
|
+ = help: ensure that all variants are matched explicitly by adding the suggested match arms
+ = note: the matched value is of type `OnlyUnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/omitted-patterns.rs:165:12
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all variants are matched explicitly by adding the suggested match arms
- = note: the matched value is of type `OnlyUnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
error: aborting due to 8 previous errors; 6 warnings emitted
diff --git a/src/test/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr
index 7cce17898..f38368590 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr
@@ -4,27 +4,27 @@ warning: some fields are not explicitly listed
LL | let UnstableStruct { stable, .. } = UnstableStruct::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `stable2` not listed
|
+ = help: ensure that all fields are mentioned explicitly by adding the suggested fields
+ = note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/stable-omitted-patterns.rs:38:12
|
LL | #[warn(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all fields are mentioned explicitly by adding the suggested fields
- = note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
error: some variants are not matched explicitly
--> $DIR/stable-omitted-patterns.rs:23:9
|
LL | _ => {}
- | ^ pattern `Stable2` not covered
+ | ^ pattern `UnstableEnum::Stable2` not covered
|
+ = help: ensure that all variants are matched explicitly by adding the suggested match arms
+ = note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
note: the lint level is defined here
--> $DIR/stable-omitted-patterns.rs:22:16
|
LL | #[deny(non_exhaustive_omitted_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: ensure that all variants are matched explicitly by adding the suggested match arms
- = note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr
index 2b34d0711..2cb9ba0d1 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr
@@ -1,9 +1,3 @@
-error[E0423]: cannot initialize a tuple struct which contains private fields
- --> $DIR/struct.rs:20:14
- |
-LL | let ts = TupleStruct(640, 480);
- | ^^^^^^^^^^^
-
error[E0423]: expected value, found struct `UnitStruct`
--> $DIR/struct.rs:29:14
|
@@ -68,6 +62,12 @@ help: add `..` at the end of the field list to ignore all other fields
LL | let NormalStruct { first_field, second_field , .. } = ns;
| ~~~~~~
+error[E0423]: cannot initialize a tuple struct which contains private fields
+ --> $DIR/struct.rs:20:14
+ |
+LL | let ts = TupleStruct(640, 480);
+ | ^^^^^^^^^^^
+
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:26:9
|
diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
index 32a5c07f1..a9c54af04 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr
@@ -55,11 +55,11 @@ LL + _ => todo!(),
LL ~ }
|
-error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
+error[E0004]: non-exhaustive patterns: `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
--> $DIR/match.rs:31:11
|
LL | match x {}
- | ^ patterns `Tuple(_)` and `Struct { .. }` not covered
+ | ^ patterns `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
|
note: `UninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:17:23
@@ -74,7 +74,7 @@ LL | #[non_exhaustive] Struct { x: ! }
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 ~ match x {
-LL + Tuple(_) | Struct { .. } => todo!(),
+LL + UninhabitedVariants::Tuple(_) | UninhabitedVariants::Struct { .. } => todo!(),
LL ~ }
|
diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
index c89c70ae6..ec2a2f6f0 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr
@@ -36,11 +36,11 @@ LL + _ => todo!(),
LL ~ }
|
-error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
+error[E0004]: non-exhaustive patterns: `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
--> $DIR/match_same_crate.rs:38:11
|
LL | match x {}
- | ^ patterns `Tuple(_)` and `Struct { .. }` not covered
+ | ^ patterns `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
|
note: `UninhabitedVariants` defined here
--> $DIR/match_same_crate.rs:16:23
@@ -55,7 +55,7 @@ LL | #[non_exhaustive] Struct { x: ! }
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 ~ match x {
-LL + Tuple(_) | Struct { .. } => todo!(),
+LL + UninhabitedVariants::Tuple(_) | UninhabitedVariants::Struct { .. } => todo!(),
LL ~ }
|
diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
index d854ea28f..b6b777ec5 100644
--- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
+++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr
@@ -55,11 +55,11 @@ LL + _ => todo!(),
LL ~ }
|
-error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covered
+error[E0004]: non-exhaustive patterns: `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
--> $DIR/match_with_exhaustive_patterns.rs:34:11
|
LL | match x {}
- | ^ patterns `Tuple(_)` and `Struct { .. }` not covered
+ | ^ patterns `UninhabitedVariants::Tuple(_)` and `UninhabitedVariants::Struct { .. }` not covered
|
note: `UninhabitedVariants` defined here
--> $DIR/auxiliary/uninhabited.rs:17:23
@@ -74,7 +74,7 @@ LL | #[non_exhaustive] Struct { x: ! }
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 ~ match x {
-LL + Tuple(_) | Struct { .. } => todo!(),
+LL + UninhabitedVariants::Tuple(_) | UninhabitedVariants::Struct { .. } => todo!(),
LL ~ }
|
diff --git a/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs b/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
index b067994a5..f11456250 100644
--- a/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
+++ b/src/test/ui/rfc-2091-track-caller/std-panic-locations.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// revisions: default mir-opt
//[mir-opt] compile-flags: -Zmir-opt-level=4
diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr
index a66330ccc..761089cd3 100644
--- a/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr
+++ b/src/test/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr
@@ -3,6 +3,13 @@ error[E0432]: unresolved import `alloc`
|
LL | use alloc;
| ^^^^^ no external crate `alloc`
+ |
+help: consider importing one of these items instead
+ |
+LL | use core::alloc;
+ | ~~~~~~~~~~~~
+LL | use std::alloc;
+ | ~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2294-if-let-guard/warns.stderr b/src/test/ui/rfc-2294-if-let-guard/warns.stderr
index cf64513f9..75f22ac8d 100644
--- a/src/test/ui/rfc-2294-if-let-guard/warns.stderr
+++ b/src/test/ui/rfc-2294-if-let-guard/warns.stderr
@@ -4,13 +4,13 @@ error: irrefutable `if let` guard pattern
LL | Some(x) if let () = x => {}
| ^^
|
+ = note: this pattern will always match, so the guard is useless
+ = help: consider removing the guard and adding a `let` inside the match arm
note: the lint level is defined here
--> $DIR/warns.rs:3:8
|
LL | #[deny(irrefutable_let_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = note: this pattern will always match, so the guard is useless
- = help: consider removing the guard and adding a `let` inside the match arm
error: unreachable pattern
--> $DIR/warns.rs:15:25
diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
index fce0cdfe0..91c001151 100644
--- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
@@ -1493,17 +1493,11 @@ LL | if (let 0 = 0)? {}
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/disallowed-positions.rs:132:19
|
-LL | / fn nested_within_if_expr() {
-LL | | if &let 0 = 0 {}
-LL | |
-LL | |
-... |
-LL | | if (let 0 = 0)? {}
- | | ^ cannot use the `?` operator in a function that returns `()`
-... |
-LL | |
-LL | | }
- | |_- this function should return `Result` or `Option` to accept `?`
+LL | fn nested_within_if_expr() {
+ | -------------------------- this function should return `Result` or `Option` to accept `?`
+...
+LL | if (let 0 = 0)? {}
+ | ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
@@ -1516,7 +1510,7 @@ LL | if x = let 0 = 0 {}
help: you might have meant to compare for equality
|
LL | if x == let 0 = 0 {}
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:157:8
@@ -1693,17 +1687,11 @@ LL | while (let 0 = 0)? {}
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/disallowed-positions.rs:224:22
|
-LL | / fn nested_within_while_expr() {
-LL | | while &let 0 = 0 {}
-LL | |
-LL | |
-... |
-LL | | while (let 0 = 0)? {}
- | | ^ cannot use the `?` operator in a function that returns `()`
-... |
-LL | |
-LL | | }
- | |_- this function should return `Result` or `Option` to accept `?`
+LL | fn nested_within_while_expr() {
+ | ----------------------------- this function should return `Result` or `Option` to accept `?`
+...
+LL | while (let 0 = 0)? {}
+ | ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
@@ -1716,7 +1704,7 @@ LL | while x = let 0 = 0 {}
help: you might have meant to compare for equality
|
LL | while x == let 0 = 0 {}
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:249:11
@@ -1881,17 +1869,11 @@ LL | (let 0 = 0)?;
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/disallowed-positions.rs:325:16
|
-LL | / fn outside_if_and_while_expr() {
-LL | | &let 0 = 0;
-LL | |
-LL | |
-... |
-LL | | (let 0 = 0)?;
- | | ^ cannot use the `?` operator in a function that returns `()`
-... |
-LL | |
-LL | | }
- | |_- this function should return `Result` or `Option` to accept `?`
+LL | fn outside_if_and_while_expr() {
+ | ------------------------------ this function should return `Result` or `Option` to accept `?`
+...
+LL | (let 0 = 0)?;
+ | ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
diff --git a/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs b/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
index 12befc637..2a6c14435 100644
--- a/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
+++ b/src/test/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs
@@ -1,4 +1,4 @@
-#![feature(let_chains, let_else)]
+#![feature(let_chains)]
fn main() {
let opt = Some(1i32);
diff --git a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr
index d1d5288ae..be4a52315 100644
--- a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr
@@ -4,13 +4,13 @@ error: leading irrefutable pattern in let chain
LL | if let first = &opt && let Some(ref second) = first && let None = second.start {}
| ^^^^^^^^^^^^^^^^
|
+ = note: this pattern will always match
+ = help: consider moving it outside of the construct
note: the lint level is defined here
--> $DIR/irrefutable-lets.rs:6:30
|
LL | #![cfg_attr(disallowed, deny(irrefutable_let_patterns))]
| ^^^^^^^^^^^^^^^^^^^^^^^^
- = note: this pattern will always match
- = help: consider moving it outside of the construct
error: irrefutable `if let` patterns
--> $DIR/irrefutable-lets.rs:19:8
@@ -75,26 +75,26 @@ LL | if let first = &opt && let None = Some(1) {}
= note: this pattern will always match
= help: consider moving it outside of the construct
-error: irrefutable `let` patterns
+error: irrefutable `if let` guard patterns
--> $DIR/irrefutable-lets.rs:44:28
|
LL | Some(ref first) if let second = first && let _third = second && let v = 4 + 4 => {},
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: these patterns will always match, so the `let` is useless
- = help: consider removing `let`
+ = note: these patterns will always match, so the guard is useless
+ = help: consider removing the guard and adding a `let` inside the match arm
-error: leading irrefutable pattern in let chain
- --> $DIR/irrefutable-lets.rs:50:28
+error: trailing irrefutable patterns in let chain
+ --> $DIR/irrefutable-lets.rs:59:16
|
-LL | Some(ref first) if let Range { start: local_start, end: _ } = first
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | && let v = local_end && let w = v => {},
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: this pattern will always match
- = help: consider moving it outside of the construct
+ = note: these patterns will always match
+ = help: consider moving them into the body
error: irrefutable `while let` patterns
- --> $DIR/irrefutable-lets.rs:59:11
+ --> $DIR/irrefutable-lets.rs:68:11
|
LL | while let first = &opt && let (a, b) = (1, 2) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -103,7 +103,7 @@ LL | while let first = &opt && let (a, b) = (1, 2) {}
= help: consider instead using a `loop { ... }` with a `let` inside it
error: trailing irrefutable patterns in let chain
- --> $DIR/irrefutable-lets.rs:62:40
+ --> $DIR/irrefutable-lets.rs:71:40
|
LL | while let Some(ref first) = opt && let second = first && let _third = second {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs
index 3d1626e8f..9afb6853b 100644
--- a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs
+++ b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs
@@ -42,18 +42,27 @@ fn main() {
match opt {
Some(ref first) if let second = first && let _third = second && let v = 4 + 4 => {},
- //[disallowed]~^ ERROR irrefutable `let` patterns
+ //[disallowed]~^ ERROR irrefutable `if let` guard patterns
_ => {}
}
+ // No error about leading irrefutable patterns: the expr on the rhs might
+ // use the bindings created by the match.
match opt {
Some(ref first) if let Range { start: local_start, end: _ } = first
- //[disallowed]~^ ERROR leading irrefutable pattern in let chain
&& let None = local_start => {},
_ => {}
}
- // No error, despite the prefix being irrefutable
+ match opt {
+ Some(ref first) if let Range { start: Some(_), end: local_end } = first
+ && let v = local_end && let w = v => {},
+ //[disallowed]~^ ERROR trailing irrefutable patterns in let chain
+ _ => {}
+ }
+
+ // No error, despite the prefix being irrefutable: moving out could change the behaviour,
+ // due to possible side effects of the operation.
while let first = &opt && let Some(ref second) = first && let None = second.start {}
while let first = &opt && let (a, b) = (1, 2) {}
diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr
index 1ced8d8a1..6d18d295c 100644
--- a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr
+++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr
@@ -23,97 +23,97 @@ LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
error: unused variable: `a`
- --> $DIR/param-attrs-cfg.rs:107:27
+ --> $DIR/param-attrs-cfg.rs:41:27
|
LL | #[cfg(something)] a: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_a`
error: unused variable: `b`
- --> $DIR/param-attrs-cfg.rs:113:27
+ --> $DIR/param-attrs-cfg.rs:48:27
|
LL | #[cfg(something)] b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `c`
- --> $DIR/param-attrs-cfg.rs:115:44
+ --> $DIR/param-attrs-cfg.rs:50:44
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
error: unused variable: `b`
- --> $DIR/param-attrs-cfg.rs:67:27
+ --> $DIR/param-attrs-cfg.rs:56:27
|
LL | #[cfg(something)] b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `c`
- --> $DIR/param-attrs-cfg.rs:69:44
+ --> $DIR/param-attrs-cfg.rs:58:44
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
error: unused variable: `b`
- --> $DIR/param-attrs-cfg.rs:75:27
+ --> $DIR/param-attrs-cfg.rs:67:27
|
LL | #[cfg(something)] b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `c`
- --> $DIR/param-attrs-cfg.rs:77:44
+ --> $DIR/param-attrs-cfg.rs:69:44
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
-error: unused variable: `a`
- --> $DIR/param-attrs-cfg.rs:41:27
- |
-LL | #[cfg(something)] a: i32,
- | ^ help: if this is intentional, prefix it with an underscore: `_a`
-
error: unused variable: `b`
- --> $DIR/param-attrs-cfg.rs:48:27
+ --> $DIR/param-attrs-cfg.rs:75:27
|
LL | #[cfg(something)] b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `c`
- --> $DIR/param-attrs-cfg.rs:50:44
+ --> $DIR/param-attrs-cfg.rs:77:44
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
error: unused variable: `b`
- --> $DIR/param-attrs-cfg.rs:56:27
+ --> $DIR/param-attrs-cfg.rs:86:27
|
LL | #[cfg(something)] b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `c`
- --> $DIR/param-attrs-cfg.rs:58:44
+ --> $DIR/param-attrs-cfg.rs:88:44
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
error: unused variable: `b`
- --> $DIR/param-attrs-cfg.rs:86:27
+ --> $DIR/param-attrs-cfg.rs:94:27
|
LL | #[cfg(something)] b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `c`
- --> $DIR/param-attrs-cfg.rs:88:44
+ --> $DIR/param-attrs-cfg.rs:96:44
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
+error: unused variable: `a`
+ --> $DIR/param-attrs-cfg.rs:107:27
+ |
+LL | #[cfg(something)] a: i32,
+ | ^ help: if this is intentional, prefix it with an underscore: `_a`
+
error: unused variable: `b`
- --> $DIR/param-attrs-cfg.rs:94:27
+ --> $DIR/param-attrs-cfg.rs:113:27
|
LL | #[cfg(something)] b: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_b`
error: unused variable: `c`
- --> $DIR/param-attrs-cfg.rs:96:44
+ --> $DIR/param-attrs-cfg.rs:115:44
|
LL | #[cfg_attr(nothing, cfg(nothing))] c: i32,
| ^ help: if this is intentional, prefix it with an underscore: `_c`
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs
new file mode 100644
index 000000000..22d57f8be
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs
@@ -0,0 +1,9 @@
+// only-windows
+// only-x86
+#![feature(raw_dylib)]
+
+#[link(name = "foo", kind = "raw-dylib", import_name_type = 6)]
+//~^ ERROR import name type must be of the form `import_name_type = "string"`
+extern "C" { }
+
+fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr
new file mode 100644
index 000000000..0e95fec29
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr
@@ -0,0 +1,8 @@
+error: import name type must be of the form `import_name_type = "string"`
+ --> $DIR/import-name-type-invalid-format.rs:5:42
+ |
+LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = 6)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs
new file mode 100644
index 000000000..7ccb0082f
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs
@@ -0,0 +1,10 @@
+// ignore-tidy-linelength
+// only-windows
+// only-x86
+#![feature(raw_dylib)]
+
+#[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated", import_name_type = "decorated")]
+//~^ ERROR multiple `import_name_type` arguments in a single `#[link]` attribute
+extern "C" { }
+
+fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr
new file mode 100644
index 000000000..7c0e0be91
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr
@@ -0,0 +1,8 @@
+error: multiple `import_name_type` arguments in a single `#[link]` attribute
+ --> $DIR/import-name-type-multiple.rs:6:74
+ |
+LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated", import_name_type = "decorated")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs
new file mode 100644
index 000000000..f728a578d
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs
@@ -0,0 +1,9 @@
+// only-windows
+// only-x86
+#![feature(raw_dylib)]
+
+#[link(name = "foo", kind = "raw-dylib", import_name_type = "unknown")]
+//~^ ERROR unknown import name type `unknown`, expected one of: decorated, noprefix, undecorated
+extern "C" { }
+
+fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr
new file mode 100644
index 000000000..2b299f2fe
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr
@@ -0,0 +1,8 @@
+error: unknown import name type `unknown`, expected one of: decorated, noprefix, undecorated
+ --> $DIR/import-name-type-unknown-value.rs:5:42
+ |
+LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "unknown")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs
new file mode 100644
index 000000000..ae9207864
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs
@@ -0,0 +1,17 @@
+// only-windows
+// only-x86
+#![feature(raw_dylib)]
+
+#[link(name = "foo", import_name_type = "decorated")]
+//~^ ERROR import name type can only be used with link kind `raw-dylib`
+extern "C" { }
+
+#[link(name = "bar", kind = "static", import_name_type = "decorated")]
+//~^ ERROR import name type can only be used with link kind `raw-dylib`
+extern "C" { }
+
+// Specifying `import_name_type` before `kind` shouldn't raise an error.
+#[link(name = "bar", import_name_type = "decorated", kind = "raw-dylib")]
+extern "C" { }
+
+fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr
new file mode 100644
index 000000000..5898cd875
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr
@@ -0,0 +1,14 @@
+error: import name type can only be used with link kind `raw-dylib`
+ --> $DIR/import-name-type-unsupported-link-kind.rs:5:22
+ |
+LL | #[link(name = "foo", import_name_type = "decorated")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: import name type can only be used with link kind `raw-dylib`
+ --> $DIR/import-name-type-unsupported-link-kind.rs:9:39
+ |
+LL | #[link(name = "bar", kind = "static", import_name_type = "decorated")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs
new file mode 100644
index 000000000..346ea18a8
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs
@@ -0,0 +1,7 @@
+// only-windows
+// ignore-x86
+#[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")]
+//~^ ERROR import name type is only supported on x86
+extern "C" { }
+
+fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr
new file mode 100644
index 000000000..b56449299
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr
@@ -0,0 +1,8 @@
+error: import name type is only supported on x86
+ --> $DIR/import-name-type-x86-only.rs:3:42
+ |
+LL | #[link(name = "foo", kind = "raw-dylib", import_name_type = "decorated")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs
index 42685cad9..1a128c87a 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs
@@ -1,5 +1,4 @@
-#![feature(raw_dylib)]
-//~^ WARN the feature `raw_dylib` is incomplete
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name="foo")]
extern "C" {
@@ -7,6 +6,10 @@ extern "C" {
#[link_ordinal(42)]
//~^ ERROR cannot use `#[link_name]` with `#[link_ordinal]`
fn foo();
+ #[link_name="foo"]
+ #[link_ordinal(5)]
+ //~^ ERROR cannot use `#[link_name]` with `#[link_ordinal]`
+ static mut imported_variable: i32;
}
fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
index 5d8545b50..481a06d27 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr
@@ -1,17 +1,14 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/link-ordinal-and-name.rs:1:12
- |
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
-
error: cannot use `#[link_name]` with `#[link_ordinal]`
- --> $DIR/link-ordinal-and-name.rs:7:5
+ --> $DIR/link-ordinal-and-name.rs:6:5
|
LL | #[link_ordinal(42)]
| ^^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
+error: cannot use `#[link_name]` with `#[link_ordinal]`
+ --> $DIR/link-ordinal-and-name.rs:10:5
+ |
+LL | #[link_ordinal(5)]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
index 135f5909e..7c8da050c 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs
@@ -1,11 +1,13 @@
-#![feature(raw_dylib)]
-//~^ WARN the feature `raw_dylib` is incomplete
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "foo")]
extern "C" {
#[link_ordinal("JustMonika")]
//~^ ERROR illegal ordinal format in `link_ordinal`
fn foo();
+ #[link_ordinal("JustMonika")]
+ //~^ ERROR illegal ordinal format in `link_ordinal`
+ static mut imported_variable: i32;
}
fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
index 8453a3966..55cdcad75 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr
@@ -1,19 +1,18 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/link-ordinal-invalid-format.rs:1:12
+error: illegal ordinal format in `link_ordinal`
+ --> $DIR/link-ordinal-invalid-format.rs:5:5
|
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
+LL | #[link_ordinal("JustMonika")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+ = note: an unsuffixed integer value, e.g., `1`, is expected
error: illegal ordinal format in `link_ordinal`
- --> $DIR/link-ordinal-invalid-format.rs:6:5
+ --> $DIR/link-ordinal-invalid-format.rs:8:5
|
LL | #[link_ordinal("JustMonika")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: an unsuffixed integer value, e.g., `1`, is expected
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
index c391ccd1c..9feed3941 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs
@@ -1,11 +1,13 @@
-#![feature(raw_dylib)]
-//~^ WARN the feature `raw_dylib` is incomplete
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "foo")]
extern "C" {
#[link_ordinal()]
//~^ ERROR incorrect number of arguments to `#[link_ordinal]`
fn foo();
+ #[link_ordinal()]
+ //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
+ static mut imported_variable: i32;
}
fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
index 8e9edfb9d..853cdad8c 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr
@@ -1,19 +1,18 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/link-ordinal-missing-argument.rs:1:12
+error: incorrect number of arguments to `#[link_ordinal]`
+ --> $DIR/link-ordinal-missing-argument.rs:5:5
|
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
+LL | #[link_ordinal()]
+ | ^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+ = note: the attribute requires exactly one argument
error: incorrect number of arguments to `#[link_ordinal]`
- --> $DIR/link-ordinal-missing-argument.rs:6:5
+ --> $DIR/link-ordinal-missing-argument.rs:8:5
|
LL | #[link_ordinal()]
| ^^^^^^^^^^^^^^^^^
|
= note: the attribute requires exactly one argument
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs
index 2a15b1d79..631c363d4 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs
@@ -1,12 +1,14 @@
// only-windows
-#![feature(raw_dylib)]
-//~^ WARN the feature `raw_dylib` is incomplete
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "foo", kind = "raw-dylib")]
extern "C" {
#[link_ordinal(1)] //~ ERROR multiple `link_ordinal` attributes
#[link_ordinal(2)]
fn foo();
+ #[link_ordinal(1)] //~ ERROR multiple `link_ordinal` attributes
+ #[link_ordinal(2)]
+ static mut imported_variable: i32;
}
fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
index 4772533ab..c0453d2bf 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr
@@ -1,23 +1,26 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/link-ordinal-multiple.rs:2:12
+error: multiple `link_ordinal` attributes
+ --> $DIR/link-ordinal-multiple.rs:6:5
|
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
+LL | #[link_ordinal(1)]
+ | ^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+note: attribute also specified here
+ --> $DIR/link-ordinal-multiple.rs:7:5
+ |
+LL | #[link_ordinal(2)]
+ | ^^^^^^^^^^^^^^^^^^
error: multiple `link_ordinal` attributes
- --> $DIR/link-ordinal-multiple.rs:7:5
+ --> $DIR/link-ordinal-multiple.rs:9:5
|
LL | #[link_ordinal(1)]
| ^^^^^^^^^^^^^^^^^^ help: remove this attribute
|
note: attribute also specified here
- --> $DIR/link-ordinal-multiple.rs:8:5
+ --> $DIR/link-ordinal-multiple.rs:10:5
|
LL | #[link_ordinal(2)]
| ^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
new file mode 100644
index 000000000..54e614164
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
@@ -0,0 +1,24 @@
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
+
+#[link_ordinal(123)]
+//~^ ERROR attribute should be applied to a foreign function or static
+struct Foo {}
+
+#[link_ordinal(123)]
+//~^ ERROR attribute should be applied to a foreign function or static
+fn test() {}
+
+#[link_ordinal(42)]
+//~^ ERROR attribute should be applied to a foreign function or static
+static mut imported_val: i32 = 123;
+
+#[link(name = "exporter", kind = "raw-dylib")]
+extern {
+ #[link_ordinal(13)]
+ fn imported_function();
+
+ #[link_ordinal(42)]
+ static mut imported_variable: i32;
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr
new file mode 100644
index 000000000..ec4104fbe
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr
@@ -0,0 +1,20 @@
+error: attribute should be applied to a foreign function or static
+ --> $DIR/link-ordinal-not-foreign-fn.rs:3:1
+ |
+LL | #[link_ordinal(123)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: attribute should be applied to a foreign function or static
+ --> $DIR/link-ordinal-not-foreign-fn.rs:7:1
+ |
+LL | #[link_ordinal(123)]
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: attribute should be applied to a foreign function or static
+ --> $DIR/link-ordinal-not-foreign-fn.rs:11:1
+ |
+LL | #[link_ordinal(42)]
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs
index b6089d27e..46731581e 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs
@@ -1,11 +1,13 @@
-#![feature(raw_dylib)]
-//~^ WARN the feature `raw_dylib` is incomplete
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "foo")]
extern "C" {
#[link_ordinal(72436)]
//~^ ERROR ordinal value in `link_ordinal` is too large: `72436`
fn foo();
+ #[link_ordinal(72436)]
+ //~^ ERROR ordinal value in `link_ordinal` is too large: `72436`
+ static mut imported_variable: i32;
}
fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
index bbe985fa1..fef6de6ae 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr
@@ -1,19 +1,18 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/link-ordinal-too-large.rs:1:12
+error: ordinal value in `link_ordinal` is too large: `72436`
+ --> $DIR/link-ordinal-too-large.rs:5:5
|
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
+LL | #[link_ordinal(72436)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+ = note: the value may not exceed `u16::MAX`
error: ordinal value in `link_ordinal` is too large: `72436`
- --> $DIR/link-ordinal-too-large.rs:6:5
+ --> $DIR/link-ordinal-too-large.rs:8:5
|
LL | #[link_ordinal(72436)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: the value may not exceed `u16::MAX`
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
index 93286c616..71e0ac9f3 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs
@@ -1,11 +1,13 @@
-#![feature(raw_dylib)]
-//~^ WARN the feature `raw_dylib` is incomplete
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "foo")]
extern "C" {
#[link_ordinal(3, 4)]
//~^ ERROR incorrect number of arguments to `#[link_ordinal]`
fn foo();
+ #[link_ordinal(3, 4)]
+ //~^ ERROR incorrect number of arguments to `#[link_ordinal]`
+ static mut imported_variable: i32;
}
fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
index 484c85a0f..7e0fcd845 100644
--- a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr
@@ -1,19 +1,18 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/link-ordinal-too-many-arguments.rs:1:12
+error: incorrect number of arguments to `#[link_ordinal]`
+ --> $DIR/link-ordinal-too-many-arguments.rs:5:5
|
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
+LL | #[link_ordinal(3, 4)]
+ | ^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
+ = note: the attribute requires exactly one argument
error: incorrect number of arguments to `#[link_ordinal]`
- --> $DIR/link-ordinal-too-many-arguments.rs:6:5
+ --> $DIR/link-ordinal-too-many-arguments.rs:8:5
|
LL | #[link_ordinal(3, 4)]
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: the attribute requires exactly one argument
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to 2 previous errors
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs
new file mode 100644
index 000000000..329c93fc1
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs
@@ -0,0 +1,17 @@
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
+
+#[link(name = "foo")]
+extern "C" {
+ #[link_ordinal(3)]
+ //~^ ERROR `#[link_ordinal]` is only supported if link kind is `raw-dylib`
+ fn foo();
+}
+
+#[link(name = "bar", kind = "static")]
+extern "C" {
+ #[link_ordinal(3)]
+ //~^ ERROR `#[link_ordinal]` is only supported if link kind is `raw-dylib`
+ fn bar();
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr
new file mode 100644
index 000000000..5fbffbda5
--- /dev/null
+++ b/src/test/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr
@@ -0,0 +1,14 @@
+error: `#[link_ordinal]` is only supported if link kind is `raw-dylib`
+ --> $DIR/link-ordinal-unsupported-link-kind.rs:5:5
+ |
+LL | #[link_ordinal(3)]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: `#[link_ordinal]` is only supported if link kind is `raw-dylib`
+ --> $DIR/link-ordinal-unsupported-link-kind.rs:12:5
+ |
+LL | #[link_ordinal(3)]
+ | ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs
index 13c9aa01e..6542faad2 100644
--- a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.rs
@@ -3,7 +3,6 @@
// compile-flags: --crate-type lib --emit link
#![allow(clashing_extern_declarations)]
#![feature(raw_dylib)]
-//~^ WARN the feature `raw_dylib` is incomplete
#[link(name = "foo", kind = "raw-dylib")]
extern "C" {
fn f(x: i32);
diff --git a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr
index 93ca8f4d8..c6808bec7 100644
--- a/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/multiple-declarations.stderr
@@ -1,17 +1,8 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/multiple-declarations.rs:5:12
- |
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
-
error: multiple declarations of external function `f` from library `foo.dll` have different calling conventions
- --> $DIR/multiple-declarations.rs:15:9
+ --> $DIR/multiple-declarations.rs:14:9
|
LL | fn f(x: i32);
| ^^^^^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
diff --git a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
index 5856b18aa..4efffbd53 100644
--- a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs
@@ -1,7 +1,6 @@
// ignore-windows
// compile-flags: --crate-type lib
-#![feature(raw_dylib)]
-//~^ WARNING: the feature `raw_dylib` is incomplete
+#![cfg_attr(target_arch = "x86", feature(raw_dylib))]
#[link(name = "foo", kind = "raw-dylib")]
//~^ ERROR: link kind `raw-dylib` is only supported on Windows targets
extern "C" {}
diff --git a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
index 600aac81a..14e791f1f 100644
--- a/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr
@@ -1,18 +1,9 @@
-warning: the feature `raw_dylib` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/raw-dylib-windows-only.rs:3:12
- |
-LL | #![feature(raw_dylib)]
- | ^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #58713 <https://github.com/rust-lang/rust/issues/58713> for more information
-
error[E0455]: link kind `raw-dylib` is only supported on Windows targets
- --> $DIR/raw-dylib-windows-only.rs:5:29
+ --> $DIR/raw-dylib-windows-only.rs:4:29
|
LL | #[link(name = "foo", kind = "raw-dylib")]
| ^^^^^^^^^^^
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0455`.
diff --git a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs
index dc647fd63..2f5a23e47 100644
--- a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs
+++ b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.rs
@@ -1,8 +1,6 @@
// only-x86_64
// only-windows
// compile-flags: --crate-type lib --emit link
-#![allow(incomplete_features)]
-#![feature(raw_dylib)]
#[link(name = "foo", kind = "raw-dylib")]
extern "stdcall" {
fn f(x: i32);
diff --git a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr
index d8a2a6af9..f8265ae69 100644
--- a/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr
+++ b/src/test/ui/rfc-2627-raw-dylib/unsupported-abi.stderr
@@ -1,5 +1,5 @@
error: ABI not supported by `#[link(kind = "raw-dylib")]` on this architecture
- --> $DIR/unsupported-abi.rs:8:5
+ --> $DIR/unsupported-abi.rs:6:5
|
LL | fn f(x: i32);
| ^^^^^^^^^^^^^
diff --git a/src/test/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs b/src/test/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs
new file mode 100644
index 000000000..780a510c5
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs
@@ -0,0 +1,14 @@
+// check-pass
+#![feature(const_trait_impl)]
+
+#[const_trait]
+trait Foo {
+ type Assoc: ~const Foo;
+ fn foo() {}
+}
+
+const fn foo<T: ~const Foo>() {
+ <T as Foo>::Assoc::foo();
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
index 99eacaa83..7d9dae52c 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.rs
@@ -10,6 +10,7 @@ impl std::ops::Add for NonConstAdd {
}
}
+#[const_trait]
trait Foo {
type Bar: ~const std::ops::Add;
}
@@ -19,6 +20,7 @@ impl const Foo for NonConstAdd {
//~^ ERROR: cannot add `NonConstAdd` to `NonConstAdd` in const contexts
}
+#[const_trait]
trait Baz {
type Qux: std::ops::Add;
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr
index 64501c523..89177b0f1 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/assoc-type.stderr
@@ -1,24 +1,20 @@
error[E0277]: cannot add `NonConstAdd` to `NonConstAdd` in const contexts
- --> $DIR/assoc-type.rs:18:16
+ --> $DIR/assoc-type.rs:19:16
|
LL | type Bar = NonConstAdd;
| ^^^^^^^^^^^ no implementation for `NonConstAdd + NonConstAdd`
|
= help: the trait `~const Add` is not implemented for `NonConstAdd`
note: the trait `Add` is implemented for `NonConstAdd`, but that implementation is not `const`
- --> $DIR/assoc-type.rs:18:16
+ --> $DIR/assoc-type.rs:19:16
|
LL | type Bar = NonConstAdd;
| ^^^^^^^^^^^
note: required by a bound in `Foo::Bar`
- --> $DIR/assoc-type.rs:14:15
+ --> $DIR/assoc-type.rs:15:15
|
LL | type Bar: ~const std::ops::Add;
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo::Bar`
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | impl const Foo for NonConstAdd where NonConstAdd: ~const Add {
- | +++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs b/src/test/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs
index 19e900609..589e3f024 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs
@@ -3,6 +3,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
#[stable(feature = "rust1", since = "1.0.0")]
+#[const_trait]
pub trait MyTrait {
#[stable(feature = "rust1", since = "1.0.0")]
fn func();
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs b/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
index 24b9235bb..dd9933974 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs
@@ -1,5 +1,6 @@
#![feature(const_trait_impl)]
+#[const_trait]
pub trait Plus {
fn plus(self, rhs: Self) -> Self;
}
@@ -23,7 +24,6 @@ pub const fn add_i32(a: i32, b: i32) -> i32 {
pub const fn add_u32(a: u32, b: u32) -> u32 {
a.plus(b)
//~^ ERROR the trait bound
- //~| ERROR cannot call non-const fn
}
fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr b/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
index 1fc9db277..7350909ba 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr
@@ -1,24 +1,15 @@
error[E0277]: the trait bound `u32: ~const Plus` is not satisfied
- --> $DIR/call-const-trait-method-fail.rs:24:7
+ --> $DIR/call-const-trait-method-fail.rs:25:7
|
LL | a.plus(b)
- | ^^^^^^^ the trait `~const Plus` is not implemented for `u32`
+ | ^^^^ the trait `~const Plus` is not implemented for `u32`
|
note: the trait `Plus` is implemented for `u32`, but that implementation is not `const`
- --> $DIR/call-const-trait-method-fail.rs:24:7
+ --> $DIR/call-const-trait-method-fail.rs:25:7
|
LL | a.plus(b)
- | ^^^^^^^
+ | ^^^^
-error[E0015]: cannot call non-const fn `<u32 as Plus>::plus` in constant functions
- --> $DIR/call-const-trait-method-fail.rs:24:7
- |
-LL | a.plus(b)
- | ^^^^^^^
- |
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs b/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs
index cf38bc3c9..b64161b6a 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs
@@ -21,6 +21,7 @@ impl const PartialEq for Int {
}
}
+#[const_trait]
pub trait Plus {
fn plus(self, rhs: Self) -> Self;
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
index 89dc47aad..50c465790 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs
@@ -1,6 +1,7 @@
// check-pass
#![feature(const_trait_impl)]
+#[const_trait]
trait MyPartialEq {
fn eq(&self, other: &Self) -> bool;
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
index 83d395dda..31e6dbdab 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr
@@ -9,7 +9,6 @@ note: the trait `PartialEq<_>` is implemented for `T`, but that implementation i
|
LL | *t == *t
| ^^
- = help: the trait `PartialEq<&B>` is implemented for `&A`
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
index d3e14a53a..414a8c87d 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs
@@ -2,13 +2,18 @@
struct S;
-impl PartialEq for S {
+#[const_trait]
+trait Foo {
+ fn eq(&self, _: &Self) -> bool;
+}
+
+impl Foo for S {
fn eq(&self, _: &S) -> bool {
true
}
}
-const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
+const fn equals_self<T: ~const Foo>(t: &T) -> bool {
true
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
index 0a2a5f0f2..706f52343 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr
@@ -1,26 +1,21 @@
-error[E0277]: can't compare `S` with `S` in const contexts
- --> $DIR/call-generic-method-nonconst.rs:18:34
+error[E0277]: the trait bound `S: ~const Foo` is not satisfied
+ --> $DIR/call-generic-method-nonconst.rs:23:34
|
LL | pub const EQ: bool = equals_self(&S);
- | ----------- ^^ no implementation for `S == S`
+ | ----------- ^^ the trait `~const Foo` is not implemented for `S`
| |
| required by a bound introduced by this call
|
- = help: the trait `~const PartialEq` is not implemented for `S`
-note: the trait `PartialEq` is implemented for `S`, but that implementation is not `const`
- --> $DIR/call-generic-method-nonconst.rs:18:34
+note: the trait `Foo` is implemented for `S`, but that implementation is not `const`
+ --> $DIR/call-generic-method-nonconst.rs:23:34
|
LL | pub const EQ: bool = equals_self(&S);
| ^^
note: required by a bound in `equals_self`
- --> $DIR/call-generic-method-nonconst.rs:11:25
- |
-LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
- | ^^^^^^^^^^^^^^^^ required by this bound in `equals_self`
-help: consider annotating `S` with `#[derive(PartialEq)]`
- |
-LL | #[derive(PartialEq)]
+ --> $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/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs
index b3e3dd62b..52984fb6b 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs
@@ -1,6 +1,7 @@
#![feature(const_trait_impl)]
struct S;
+#[const_trait]
trait T {
fn foo();
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr
index 9e49785c5..c8783de4c 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr
@@ -1,5 +1,5 @@
error[E0015]: cannot call non-const fn `non_const` in constant functions
- --> $DIR/const-check-fns-in-const-impl.rs:11:16
+ --> $DIR/const-check-fns-in-const-impl.rs:12:16
|
LL | fn foo() { non_const() }
| ^^^^^^^^^^^
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
index ec724cc96..c64930db9 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr
@@ -1,18 +1,16 @@
error[E0277]: the trait bound `NonConstImpl: ~const ConstDefaultFn` is not satisfied
- --> $DIR/const-default-method-bodies.rs:24:18
+ --> $DIR/const-default-method-bodies.rs:24:5
|
LL | NonConstImpl.a();
- | ^ the trait `~const ConstDefaultFn` is not implemented for `NonConstImpl`
+ | ^^^^^^^^^^^^ - required by a bound introduced by this call
+ | |
+ | the trait `~const ConstDefaultFn` is not implemented for `NonConstImpl`
|
note: the trait `ConstDefaultFn` is implemented for `NonConstImpl`, but that implementation is not `const`
- --> $DIR/const-default-method-bodies.rs:24:18
+ --> $DIR/const-default-method-bodies.rs:24:5
|
LL | NonConstImpl.a();
- | ^
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | const fn test() where NonConstImpl: ~const ConstDefaultFn {
- | +++++++++++++++++++++++++++++++++++++++++
+ | ^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
index 9dbaffd4c..796c0d388 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr
@@ -1,15 +1,15 @@
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:43:5
+ --> $DIR/const-drop-fail.rs:44:5
|
LL | const _: () = check($exp);
| ----- required by a bound introduced by this call
...
LL | NonTrivialDrop,
- | ^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct`
+ | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
|
= note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied
note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:34:19
+ --> $DIR/const-drop-fail.rs:35:19
|
LL | const fn check<T: ~const Destruct>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `check`
@@ -21,7 +21,7 @@ LL | &mut NonTrivialDrop,
| ++++
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:45:5
+ --> $DIR/const-drop-fail.rs:46:5
|
LL | const _: () = check($exp);
| ----- required by a bound introduced by this call
@@ -30,7 +30,7 @@ LL | ConstImplWithDropGlue(NonTrivialDrop),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
|
note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:45:5
+ --> $DIR/const-drop-fail.rs:46:5
|
LL | ConstImplWithDropGlue(NonTrivialDrop),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,39 +40,60 @@ note: required because it appears within the type `ConstImplWithDropGlue`
LL | struct ConstImplWithDropGlue(NonTrivialDrop);
| ^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:34:19
+ --> $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 `ConstDropImplWithBounds<NonTrivialDrop>: ~const Destruct` is not satisfied
- --> $DIR/const-drop-fail.rs:47:5
+error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
+ --> $DIR/const-drop-fail.rs:48:47
|
-LL | const _: () = check($exp);
- | ----- required by a bound introduced by this call
-...
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct`
+ | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
+ | |
+ | required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `~const Destruct` for `ConstDropImplWithBounds<NonTrivialDrop>`
- --> $DIR/const-drop-fail.rs:28:25
+note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail.rs:48:47
|
-LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
- | ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `~const Destruct` for `ConstDropImplWithBounds<NonTrivialDrop>`
-note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:34:19
+LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
+ | ^^^^^^^^^^^
+note: required by a bound in `ConstDropImplWithBounds`
+ --> $DIR/const-drop-fail.rs:27:35
|
-LL | const fn check<T: ~const Destruct>(_: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `check`
-help: consider borrowing here
+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),
- | +
-LL | &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ++++
+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>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to 5 previous errors
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0367.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
index 001dd430a..d36c7f81c 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.rs
@@ -19,11 +19,12 @@ impl const Drop for ConstImplWithDropGlue {
fn drop(&mut self) {}
}
-trait A { fn a() { println!("A"); } }
+#[const_trait]
+trait A { fn a() { } }
impl A for NonTrivialDrop {}
-struct ConstDropImplWithBounds<T: A>(PhantomData<T>);
+struct ConstDropImplWithBounds<T: ~const A>(PhantomData<T>);
impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
fn drop(&mut self) {
@@ -46,6 +47,16 @@ check_all! {
//~^ 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/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
index 9dbaffd4c..796c0d388 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr
@@ -1,15 +1,15 @@
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:43:5
+ --> $DIR/const-drop-fail.rs:44:5
|
LL | const _: () = check($exp);
| ----- required by a bound introduced by this call
...
LL | NonTrivialDrop,
- | ^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct`
+ | ^^^^^^^^^^^^^^ the trait `~const Destruct` is not implemented for `NonTrivialDrop`
|
= note: the trait bound `NonTrivialDrop: ~const Destruct` is not satisfied
note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:34:19
+ --> $DIR/const-drop-fail.rs:35:19
|
LL | const fn check<T: ~const Destruct>(_: T) {}
| ^^^^^^^^^^^^^^^ required by this bound in `check`
@@ -21,7 +21,7 @@ LL | &mut NonTrivialDrop,
| ++++
error[E0277]: can't drop `NonTrivialDrop` in const contexts
- --> $DIR/const-drop-fail.rs:45:5
+ --> $DIR/const-drop-fail.rs:46:5
|
LL | const _: () = check($exp);
| ----- required by a bound introduced by this call
@@ -30,7 +30,7 @@ LL | ConstImplWithDropGlue(NonTrivialDrop),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `ConstImplWithDropGlue`, the trait `~const Destruct` is not implemented for `NonTrivialDrop`
|
note: the trait `Destruct` is implemented for `NonTrivialDrop`, but that implementation is not `const`
- --> $DIR/const-drop-fail.rs:45:5
+ --> $DIR/const-drop-fail.rs:46:5
|
LL | ConstImplWithDropGlue(NonTrivialDrop),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -40,39 +40,60 @@ note: required because it appears within the type `ConstImplWithDropGlue`
LL | struct ConstImplWithDropGlue(NonTrivialDrop);
| ^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:34:19
+ --> $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 `ConstDropImplWithBounds<NonTrivialDrop>: ~const Destruct` is not satisfied
- --> $DIR/const-drop-fail.rs:47:5
+error[E0277]: the trait bound `NonTrivialDrop: ~const A` is not satisfied
+ --> $DIR/const-drop-fail.rs:48:47
|
-LL | const _: () = check($exp);
- | ----- required by a bound introduced by this call
-...
LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an implementor of trait `~const Destruct`
+ | ----------------------------------------- ^^^^^^^^^^^ the trait `~const A` is not implemented for `NonTrivialDrop`
+ | |
+ | required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `~const Destruct` for `ConstDropImplWithBounds<NonTrivialDrop>`
- --> $DIR/const-drop-fail.rs:28:25
+note: the trait `A` is implemented for `NonTrivialDrop`, but that implementation is not `const`
+ --> $DIR/const-drop-fail.rs:48:47
|
-LL | impl<T: ~const A> const Drop for ConstDropImplWithBounds<T> {
- | ^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `~const Destruct` for `ConstDropImplWithBounds<NonTrivialDrop>`
-note: required by a bound in `check`
- --> $DIR/const-drop-fail.rs:34:19
+LL | ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
+ | ^^^^^^^^^^^
+note: required by a bound in `ConstDropImplWithBounds`
+ --> $DIR/const-drop-fail.rs:27:35
|
-LL | const fn check<T: ~const Destruct>(_: T) {}
- | ^^^^^^^^^^^^^^^ required by this bound in `check`
-help: consider borrowing here
+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),
- | +
-LL | &mut ConstDropImplWithBounds::<NonTrivialDrop>(PhantomData),
- | ++++
+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>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to 5 previous errors
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0367.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-drop.rs b/src/test/ui/rfc-2632-const-trait-impl/const-drop.rs
index 04462c0a1..b0fc3adf9 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-drop.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-drop.rs
@@ -48,6 +48,7 @@ mod t {
pub struct HasConstDrop(pub ConstDrop);
pub struct TrivialFields(pub u8, pub i8, pub usize, pub isize);
+ #[const_trait]
pub trait SomeTrait {
fn foo();
}
@@ -59,7 +60,7 @@ mod t {
fn foo() {}
}
- pub struct ConstDropWithBound<T: SomeTrait>(pub core::marker::PhantomData<T>);
+ pub struct ConstDropWithBound<T: ~const SomeTrait>(pub core::marker::PhantomData<T>);
impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> {
fn drop(&mut self) {
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs b/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs
index 470c653dd..837124db0 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs
@@ -1,9 +1,11 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Foo {}
const impl Foo for i32 {} //~ ERROR: expected identifier, found keyword
+#[const_trait]
trait Bar {}
const impl<T: Foo> Bar for T {} //~ ERROR: expected identifier, found keyword
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr
index 709084c86..7217fc855 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr
@@ -1,5 +1,5 @@
error: expected identifier, found keyword `impl`
- --> $DIR/const-impl-recovery.rs:5:7
+ --> $DIR/const-impl-recovery.rs:6:7
|
LL | const impl Foo for i32 {}
| ^^^^ expected identifier, found keyword
@@ -11,7 +11,7 @@ LL + impl const Foo for i32 {}
|
error: expected identifier, found keyword `impl`
- --> $DIR/const-impl-recovery.rs:9:7
+ --> $DIR/const-impl-recovery.rs:11:7
|
LL | const impl<T: Foo> Bar for T {}
| ^^^^ expected identifier, found keyword
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs b/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs
new file mode 100644
index 000000000..2b4963991
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs
@@ -0,0 +1,9 @@
+#![feature(const_trait_impl)]
+
+pub trait A {}
+//~^ HELP: mark `A` as const
+
+impl const A for () {}
+//~^ ERROR: const `impl` for trait `A` which is not marked with `#[const_trait]`
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr
new file mode 100644
index 000000000..478adcf3e
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr
@@ -0,0 +1,14 @@
+error: const `impl` for trait `A` which is not marked with `#[const_trait]`
+ --> $DIR/const-impl-requires-const-trait.rs:6:12
+ |
+LL | pub trait A {}
+ | - help: mark `A` as const: `#[const_trait]`
+...
+LL | impl const A for () {}
+ | ^
+ |
+ = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
+ = note: adding a non-const method body in the future would be a breaking change
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr b/src/test/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
index 174c62912..925ae53e3 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr
@@ -1,18 +1,16 @@
error[E0277]: the trait bound `cross_crate::NonConst: ~const cross_crate::MyTrait` is not satisfied
- --> $DIR/cross-crate.rs:17:14
+ --> $DIR/cross-crate.rs:17:5
|
LL | NonConst.func();
- | ^^^^ the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
+ | ^^^^^^^^ ---- required by a bound introduced by this call
+ | |
+ | the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
|
note: the trait `cross_crate::MyTrait` is implemented for `cross_crate::NonConst`, but that implementation is not `const`
- --> $DIR/cross-crate.rs:17:14
+ --> $DIR/cross-crate.rs:17:5
|
LL | NonConst.func();
- | ^^^^
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | const fn const_context() where cross_crate::NonConst: ~const cross_crate::MyTrait {
- | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ | ^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr b/src/test/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
index 4619dd113..11db0c2b8 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr
@@ -1,18 +1,16 @@
error[E0277]: the trait bound `cross_crate::NonConst: cross_crate::MyTrait` is not satisfied
- --> $DIR/cross-crate.rs:17:14
+ --> $DIR/cross-crate.rs:17:5
|
LL | NonConst.func();
- | ^^^^ the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
+ | ^^^^^^^^ ---- required by a bound introduced by this call
+ | |
+ | the trait `~const cross_crate::MyTrait` is not implemented for `cross_crate::NonConst`
|
note: the trait `cross_crate::MyTrait` is implemented for `cross_crate::NonConst`, but that implementation is not `const`
- --> $DIR/cross-crate.rs:17:14
+ --> $DIR/cross-crate.rs:17:5
|
LL | NonConst.func();
- | ^^^^
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | const fn const_context() where cross_crate::NonConst: ~const cross_crate::MyTrait {
- | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ | ^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
index d27291231..96acdc300 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs
@@ -1,5 +1,6 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Tr {}
impl Tr for () {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
index 7542b81fe..a244ab10c 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr
@@ -1,23 +1,19 @@
error[E0277]: the trait bound `(): ~const Tr` is not satisfied
- --> $DIR/default-method-body-is-const-body-checking.rs:11:15
+ --> $DIR/default-method-body-is-const-body-checking.rs:12:15
|
LL | foo::<()>();
| ^^ 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:11:15
+ --> $DIR/default-method-body-is-const-body-checking.rs:12:15
|
LL | foo::<()>();
| ^^
note: required by a bound in `foo`
- --> $DIR/default-method-body-is-const-body-checking.rs:6:28
+ --> $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`
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | pub trait Foo where (): ~const Tr {
- | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
index b229053eb..c2c16921c 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr
@@ -1,18 +1,16 @@
error[E0277]: the trait bound `(): ~const Tr` is not satisfied
- --> $DIR/default-method-body-is-const-same-trait-ck.rs:8:12
+ --> $DIR/default-method-body-is-const-same-trait-ck.rs:8:9
|
LL | ().a()
- | ^ the trait `~const Tr` is not implemented for `()`
+ | ^^ - required by a bound introduced by this call
+ | |
+ | 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-same-trait-ck.rs:8:12
+ --> $DIR/default-method-body-is-const-same-trait-ck.rs:8:9
|
LL | ().a()
- | ^
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | pub trait Tr where (): ~const Tr {
- | +++++++++++++++++++
+ | ^^
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr b/src/test/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr
index af4d3909e..4c630d33c 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr
@@ -1,5 +1,5 @@
error: fatal error triggered by #[rustc_error]
- --> $DIR/feature-gate.rs:13:1
+ --> $DIR/feature-gate.rs:14:1
|
LL | fn main() {}
| ^^^^^^^^^
diff --git a/src/test/ui/rfc-2632-const-trait-impl/feature-gate.rs b/src/test/ui/rfc-2632-const-trait-impl/feature-gate.rs
index 7bac72e1b..0b409fbaa 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/feature-gate.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/feature-gate.rs
@@ -5,6 +5,7 @@
#![feature(rustc_attrs)]
struct S;
+#[const_trait] //[stock]~ ERROR `const_trait` is a temporary placeholder
trait T {}
impl const T for S {}
//[stock]~^ ERROR const trait impls are experimental
diff --git a/src/test/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr b/src/test/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr
index 91a8bb578..0e938c1c5 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr
@@ -1,5 +1,5 @@
error[E0658]: const trait impls are experimental
- --> $DIR/feature-gate.rs:9:6
+ --> $DIR/feature-gate.rs:10:6
|
LL | impl const T for S {}
| ^^^^^
@@ -7,6 +7,15 @@ LL | impl const T for S {}
= note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
= help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
-error: aborting due to previous error
+error[E0658]: `const_trait` is a temporary placeholder for marking a trait that is suitable for `const` `impls` and all default bodies as `const`, which may be removed or renamed in the future.
+ --> $DIR/feature-gate.rs:8:1
+ |
+LL | #[const_trait]
+ | ^^^^^^^^^^^^^^
+ |
+ = note: see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
+ = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs
index 80a4442de..337c73340 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs
@@ -2,6 +2,7 @@
#![feature(const_trait_impl)]
+#[const_trait]
pub trait MyTrait {
fn method(&self) -> Option<()>;
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
index 32df63e44..6d2be1daa 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
@@ -1,5 +1,5 @@
error[E0658]: `?` is not allowed in a `const fn`
- --> $DIR/hir-const-check.rs:11:9
+ --> $DIR/hir-const-check.rs:12:9
|
LL | Some(())?;
| ^^^^^^^^^
diff --git a/src/test/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs b/src/test/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs
index 2cef803a9..f8ac793e4 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs
@@ -3,7 +3,9 @@
struct S;
+#[const_trait]
trait A {}
+#[const_trait]
trait B {}
impl const A for S {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs
new file mode 100644
index 000000000..9f3f38ad4
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs
@@ -0,0 +1,39 @@
+// revisions: nn ny yn yy
+// check-pass
+#![feature(const_trait_impl, associated_type_defaults, const_mut_refs)]
+
+#[cfg_attr(any(yn, yy), const_trait)]
+pub trait Index {
+ type Output;
+}
+
+#[cfg_attr(any(ny, yy), const_trait)]
+pub trait IndexMut where Self: Index {
+ const C: <Self as Index>::Output;
+ type Assoc = <Self as Index>::Output;
+ fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output;
+}
+
+impl Index for () { type Output = (); }
+
+#[cfg(not(any(nn, yn)))]
+impl const IndexMut for <() as Index>::Output {
+ const C: <Self as Index>::Output = ();
+ type Assoc = <Self as Index>::Output;
+ fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
+ where <Self as Index>::Output:,
+ {}
+}
+
+#[cfg(any(nn, yn))]
+impl IndexMut for <() as Index>::Output {
+ const C: <Self as Index>::Output = ();
+ type Assoc = <Self as Index>::Output;
+ fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output
+ where <Self as Index>::Output:,
+ {}
+}
+
+const C: <() as Index>::Output = ();
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-102156.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-102156.rs
new file mode 100644
index 000000000..fe4e91081
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-102156.rs
@@ -0,0 +1,15 @@
+#![feature(allocator_api)]
+#![feature(const_trait_impl)]
+
+use core::convert::{From, TryFrom};
+//~^ ERROR
+//~| ERROR
+
+use std::pin::Pin;
+use std::alloc::Allocator;
+impl<T: ?Sized, A: Allocator> const From<Box<T, A>> for Pin<Box<T, A>>
+where
+ A: 'static,
+{}
+
+pub fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-102156.stderr b/src/test/ui/rfc-2632-const-trait-impl/issue-102156.stderr
new file mode 100644
index 000000000..8bf00eaff
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-102156.stderr
@@ -0,0 +1,19 @@
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+ --> $DIR/issue-102156.rs:4:5
+ |
+LL | use core::convert::{From, TryFrom};
+ | ^^^^ maybe a missing crate `core`?
+ |
+ = help: consider adding `extern crate core` to use the `core` crate
+
+error[E0433]: failed to resolve: maybe a missing crate `core`?
+ --> $DIR/issue-102156.rs:4:5
+ |
+LL | use core::convert::{From, TryFrom};
+ | ^^^^ maybe a missing crate `core`?
+ |
+ = help: consider adding `extern crate core` to use the `core` crate
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-102985.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-102985.rs
new file mode 100644
index 000000000..07d3f51ed
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-102985.rs
@@ -0,0 +1,12 @@
+#![feature(const_trait_impl)]
+
+struct Bug {
+ inner: [(); match || 1 {
+ n => n(),
+ //~^ ERROR the trait bound
+ //~| ERROR the trait bound
+ //~| ERROR cannot call non-const closure in constants
+ }],
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-102985.stderr b/src/test/ui/rfc-2632-const-trait-impl/issue-102985.stderr
new file mode 100644
index 000000000..b98ccbe5d
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-102985.stderr
@@ -0,0 +1,41 @@
+error[E0277]: the trait bound `[closure@$DIR/issue-102985.rs:4:23: 4:25]: ~const Fn<()>` is not satisfied
+ --> $DIR/issue-102985.rs:5:14
+ |
+LL | n => n(),
+ | ^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
+ |
+ = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
+note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-102985.rs:4:23: 4:25]`, but that implementation is not `const`
+ --> $DIR/issue-102985.rs:5:14
+ |
+LL | n => n(),
+ | ^^^
+ = note: wrap the `[closure@$DIR/issue-102985.rs:4:23: 4:25]` in a closure with no arguments: `|| { /* code */ }`
+
+error[E0277]: the trait bound `[closure@$DIR/issue-102985.rs:4:23: 4:25]: ~const Fn<()>` is not satisfied
+ --> $DIR/issue-102985.rs:5:14
+ |
+LL | n => n(),
+ | ^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
+ |
+ = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-102985.rs:4:23: 4:25]`
+note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-102985.rs:4:23: 4:25]`, but that implementation is not `const`
+ --> $DIR/issue-102985.rs:5:14
+ |
+LL | n => n(),
+ | ^^^
+ = note: wrap the `[closure@$DIR/issue-102985.rs:4:23: 4:25]` in a closure with no arguments: `|| { /* code */ }`
+
+error[E0015]: cannot call non-const closure in constants
+ --> $DIR/issue-102985.rs:5:14
+ |
+LL | n => n(),
+ | ^^^
+ |
+ = note: closures need an RFC before allowed to be called in constants
+ = note: calls in constants are limited to constant functions, tuple structs and tuple variants
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0015, E0277.
+For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-103677.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-103677.rs
new file mode 100644
index 000000000..d81724a36
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-103677.rs
@@ -0,0 +1,5 @@
+// check-pass
+
+const _: fn(&String) = |s| { &*s as &str; };
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-90052.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-90052.rs
new file mode 100644
index 000000000..21ddf4ab4
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-90052.rs
@@ -0,0 +1,9 @@
+#![feature(const_trait_impl)]
+
+#[const_trait]
+trait Bar {}
+
+fn foo<T>() where T: ~const Bar {}
+//~^ ERROR `~const` is not allowed
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-90052.stderr b/src/test/ui/rfc-2632-const-trait-impl/issue-90052.stderr
new file mode 100644
index 000000000..b2a936537
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-90052.stderr
@@ -0,0 +1,14 @@
+error: `~const` is not allowed here
+ --> $DIR/issue-90052.rs:6:22
+ |
+LL | fn foo<T>() where T: ~const Bar {}
+ | ^^^^^^^^^^
+ |
+note: this function is not `const`, so it cannot have `~const` trait bounds
+ --> $DIR/issue-90052.rs:6:4
+ |
+LL | fn foo<T>() where T: ~const Bar {}
+ | ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
index 97c27ce1a..4d3469653 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
@@ -4,7 +4,9 @@
#![feature(const_trait_impl)]
+#[const_trait]
pub trait Super {}
+#[const_trait]
pub trait Sub: Super {}
impl<A> const Super for &A where A: ~const Super {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs b/src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs
new file mode 100644
index 000000000..a85113600
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/nested-closure.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+#![feature(const_trait_impl, once_cell)]
+
+use std::sync::LazyLock;
+
+static EXTERN_FLAGS: LazyLock<String> = LazyLock::new(|| {
+ let x = || String::new();
+ x()
+});
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs b/src/test/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
index defef9e04..1a4509b18 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs
@@ -2,6 +2,7 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Convert<T> {
fn to(self) -> T;
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs
new file mode 100644
index 000000000..633543700
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs
@@ -0,0 +1,31 @@
+#![feature(const_trait_impl, min_specialization, rustc_attrs)]
+
+#[rustc_specialization_trait]
+#[const_trait]
+pub trait Sup {}
+
+impl const Sup for () {}
+
+#[const_trait]
+pub trait A {
+ fn a() -> u32;
+}
+
+impl<T: Default> A for T {
+ default fn a() -> u32 {
+ 2
+ }
+}
+
+impl<T: Default + ~const Sup> const A for T {
+ fn a() -> u32 {
+ 3
+ }
+}
+
+const fn generic<T: Default>() {
+ <T as A>::a();
+ //~^ ERROR: the trait bound `T: ~const Sup` is not satisfied
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr
new file mode 100644
index 000000000..c554671e1
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr
@@ -0,0 +1,19 @@
+error[E0277]: the trait bound `T: ~const Sup` is not satisfied
+ --> $DIR/specializing-constness-2.rs:27:5
+ |
+LL | <T as A>::a();
+ | ^^^^^^^^^^^^^ the trait `~const Sup` is not implemented for `T`
+ |
+note: required for `T` to implement `~const A`
+ --> $DIR/specializing-constness-2.rs:20:37
+ |
+LL | impl<T: Default + ~const Sup> const A for T {
+ | ^ ^
+help: consider further restricting this bound
+ |
+LL | const fn generic<T: Default + ~const Sup>() {
+ | ++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/specializing-constness.rs b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness.rs
new file mode 100644
index 000000000..ff0cd489d
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness.rs
@@ -0,0 +1,26 @@
+#![feature(const_trait_impl, min_specialization, rustc_attrs)]
+
+#[rustc_specialization_trait]
+#[const_trait]
+pub trait Sup {}
+
+impl const Sup for () {}
+
+#[const_trait]
+pub trait A {
+ fn a() -> u32;
+}
+
+impl<T: ~const Default> const A for T {
+ default fn a() -> u32 {
+ 2
+ }
+}
+
+impl<T: Default + Sup> A for T { //~ ERROR: cannot specialize
+ fn a() -> u32 {
+ 3
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/specializing-constness.stderr b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness.stderr
new file mode 100644
index 000000000..3296c109c
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/specializing-constness.stderr
@@ -0,0 +1,8 @@
+error: cannot specialize on trait `Default`
+ --> $DIR/specializing-constness.rs:20:9
+ |
+LL | impl<T: Default + Sup> A for T {
+ | ^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs b/src/test/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs
new file mode 100644
index 000000000..4520a3696
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs
@@ -0,0 +1,18 @@
+// check-pass
+pub struct S<T, F: FnOnce() -> T = fn() -> T> {
+ f: F,
+ x: Option<T>,
+}
+
+impl<T, F: FnOnce() -> T> S<T, F> {
+ pub const fn new(f: F) -> Self {
+ Self { f, x: None }
+ }
+}
+
+#[derive(Default)]
+pub struct Foo;
+
+static LOCKED_CALLSITES: S<Foo> = S::new(Default::default);
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr
new file mode 100644
index 000000000..d4f42b787
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr
@@ -0,0 +1,8 @@
+error: ~const can only be applied to `#[const_trait]` traits
+ --> $DIR/super-traits-fail-2.rs:11:19
+ |
+LL | trait Bar: ~const Foo {}
+ | ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr
new file mode 100644
index 000000000..d4f42b787
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr
@@ -0,0 +1,8 @@
+error: ~const can only be applied to `#[const_trait]` traits
+ --> $DIR/super-traits-fail-2.rs:11:19
+ |
+LL | trait Bar: ~const Foo {}
+ | ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs
index 7b38c15af..d183efde2 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs
@@ -1,14 +1,19 @@
#![feature(const_trait_impl)]
+// revisions: yy yn ny nn
+
+#[cfg_attr(any(yy, yn), const_trait)]
trait Foo {
fn a(&self);
}
+
+#[cfg_attr(any(yy, ny), const_trait)]
trait Bar: ~const Foo {}
+//[ny,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
const fn foo<T: Bar>(x: &T) {
x.a();
- //~^ ERROR the trait bound
- //~| ERROR cannot call
+ //[yn,yy]~^ ERROR the trait bound
}
fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.stderr
deleted file mode 100644
index 1766cdbee..000000000
--- a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.stderr
+++ /dev/null
@@ -1,24 +0,0 @@
-error[E0277]: the trait bound `T: ~const Foo` is not satisfied
- --> $DIR/super-traits-fail-2.rs:9:7
- |
-LL | x.a();
- | ^^^ the trait `~const Foo` is not implemented for `T`
- |
-note: the trait `Foo` is implemented for `T`, but that implementation is not `const`
- --> $DIR/super-traits-fail-2.rs:9:7
- |
-LL | x.a();
- | ^^^
-
-error[E0015]: cannot call non-const fn `<T as Foo>::a` in constant functions
- --> $DIR/super-traits-fail-2.rs:9:7
- |
-LL | x.a();
- | ^^^
- |
- = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
-
-error: aborting due to 2 previous errors
-
-Some errors have detailed explanations: E0015, E0277.
-For more information about an error, try `rustc --explain E0015`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
new file mode 100644
index 000000000..b52eb2c03
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `T: ~const Foo` is not satisfied
+ --> $DIR/super-traits-fail-2.rs:15:5
+ |
+LL | x.a();
+ | ^ - required by a bound introduced by this call
+ | |
+ | the trait `~const Foo` is not implemented for `T`
+ |
+note: the trait `Foo` is implemented for `T`, but that implementation is not `const`
+ --> $DIR/super-traits-fail-2.rs:15:5
+ |
+LL | x.a();
+ | ^
+help: consider further restricting this bound
+ |
+LL | const fn foo<T: Bar + ~const Foo>(x: &T) {
+ | ++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
new file mode 100644
index 000000000..b52eb2c03
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `T: ~const Foo` is not satisfied
+ --> $DIR/super-traits-fail-2.rs:15:5
+ |
+LL | x.a();
+ | ^ - required by a bound introduced by this call
+ | |
+ | the trait `~const Foo` is not implemented for `T`
+ |
+note: the trait `Foo` is implemented for `T`, but that implementation is not `const`
+ --> $DIR/super-traits-fail-2.rs:15:5
+ |
+LL | x.a();
+ | ^
+help: consider further restricting this bound
+ |
+LL | const fn foo<T: Bar + ~const Foo>(x: &T) {
+ | ++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr
new file mode 100644
index 000000000..d433e1cfa
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr
@@ -0,0 +1,14 @@
+error: ~const can only be applied to `#[const_trait]` traits
+ --> $DIR/super-traits-fail-3.rs:12:19
+ |
+LL | trait Bar: ~const Foo {}
+ | ^^^
+
+error: ~const can only be applied to `#[const_trait]` traits
+ --> $DIR/super-traits-fail-3.rs:15:24
+ |
+LL | const fn foo<T: ~const Bar>(x: &T) {
+ | ^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr
new file mode 100644
index 000000000..2a7e8e00b
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr
@@ -0,0 +1,8 @@
+error: ~const can only be applied to `#[const_trait]` traits
+ --> $DIR/super-traits-fail-3.rs:12:19
+ |
+LL | trait Bar: ~const Foo {}
+ | ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs
new file mode 100644
index 000000000..70d2936d3
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs
@@ -0,0 +1,20 @@
+#![feature(const_trait_impl)]
+
+// revisions: yy yn ny nn
+//[yy] check-pass
+
+#[cfg_attr(any(yy, yn), const_trait)]
+trait Foo {
+ fn a(&self);
+}
+
+#[cfg_attr(any(yy, ny), const_trait)]
+trait Bar: ~const Foo {}
+//[ny,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
+
+const fn foo<T: ~const Bar>(x: &T) {
+ //[yn,nn]~^ ERROR: ~const can only be applied to `#[const_trait]`
+ x.a();
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr
new file mode 100644
index 000000000..e5978c12a
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr
@@ -0,0 +1,8 @@
+error: ~const can only be applied to `#[const_trait]` traits
+ --> $DIR/super-traits-fail-3.rs:15:24
+ |
+LL | const fn foo<T: ~const Bar>(x: &T) {
+ | ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.rs b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.rs
index af465cad3..3e2b81368 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.rs
@@ -1,8 +1,10 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Foo {
fn a(&self);
}
+#[const_trait]
trait Bar: ~const Foo {}
struct S;
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr
index 9e8b8f8c6..1f8f312df 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr
@@ -1,23 +1,19 @@
error[E0277]: the trait bound `S: ~const Foo` is not satisfied
- --> $DIR/super-traits-fail.rs:13:12
+ --> $DIR/super-traits-fail.rs:15:12
|
LL | impl const Bar for S {}
| ^^^ the trait `~const Foo` is not implemented for `S`
|
note: the trait `Foo` is implemented for `S`, but that implementation is not `const`
- --> $DIR/super-traits-fail.rs:13:12
+ --> $DIR/super-traits-fail.rs:15:12
|
LL | impl const Bar for S {}
| ^^^
note: required by a bound in `Bar`
- --> $DIR/super-traits-fail.rs:6:12
+ --> $DIR/super-traits-fail.rs:8:12
|
LL | trait Bar: ~const Foo {}
| ^^^^^^^^^^ required by this bound in `Bar`
-help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
- |
-LL | impl const Bar for S where S: ~const Foo {}
- | +++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/rfc-2632-const-trait-impl/super-traits.rs b/src/test/ui/rfc-2632-const-trait-impl/super-traits.rs
index aded4ca9a..df96f6fb4 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/super-traits.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/super-traits.rs
@@ -1,9 +1,12 @@
// check-pass
#![feature(const_trait_impl)]
+#[const_trait]
trait Foo {
fn a(&self);
}
+
+#[const_trait]
trait Bar: ~const Foo {}
struct S;
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs
new file mode 100644
index 000000000..78a64b901
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs
@@ -0,0 +1,34 @@
+#![feature(const_trait_impl)]
+#![feature(generic_arg_infer)]
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Foo<const N: usize>;
+
+impl<const N: usize> Foo<N> {
+ fn add<A: ~const Add42>(self) -> Foo<{ A::add(N) }> {
+ Foo
+ }
+}
+
+#[const_trait]
+trait Add42 {
+ fn add(a: usize) -> usize;
+}
+
+impl const Add42 for () {
+ fn add(a: usize) -> usize {
+ a + 42
+ }
+}
+
+fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
+ //~^ ERROR `~const` is not allowed here
+ Foo
+}
+
+fn main() {
+ let foo = Foo::<0>;
+ let foo = bar::<(), _>(foo);
+ let _foo = bar::<(), _>(foo);
+}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr
new file mode 100644
index 000000000..aae72f36e
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr
@@ -0,0 +1,14 @@
+error: `~const` is not allowed here
+ --> $DIR/tilde-const-and-const-params.rs:25:11
+ |
+LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
+ | ^^^^^^^^^^^^
+ |
+note: this function is not `const`, so it cannot have `~const` trait bounds
+ --> $DIR/tilde-const-and-const-params.rs:25:4
+ |
+LL | fn bar<A: ~const Add42, const N: usize>(_: Foo<N>) -> Foo<{ A::add(N) }> {
+ | ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
index b4302f3e7..5bd52151f 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs
@@ -1,6 +1,7 @@
#![feature(const_trait_impl)]
#![feature(associated_type_bounds)]
+#[const_trait]
trait T {}
struct S;
impl T for S {}
@@ -17,12 +18,6 @@ fn rpit_assoc_bound() -> impl IntoIterator<Item: ~const T> { Some(S) }
fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T>) {}
//~^ ERROR `~const` is not allowed
-fn generic<P: ~const T>() {}
-//~^ ERROR `~const` is not allowed
-
-fn where_clause<P>() where P: ~const T {}
-//~^ ERROR `~const` is not allowed
-
struct TildeQuestion<T: ~const ?Sized>(std::marker::PhantomData<T>);
//~^ ERROR `~const` and `?` are mutually exclusive
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
index 033ec21ba..84867cb4a 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr
@@ -1,56 +1,40 @@
error: `~const` is not allowed here
- --> $DIR/tilde-const-invalid-places.rs:8:19
+ --> $DIR/tilde-const-invalid-places.rs:9:19
|
LL | fn rpit() -> impl ~const T { S }
| ^^^^^^^^
|
- = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+ = note: `impl Trait`s cannot have `~const` trait bounds
error: `~const` is not allowed here
- --> $DIR/tilde-const-invalid-places.rs:11:17
+ --> $DIR/tilde-const-invalid-places.rs:12:17
|
LL | fn apit(_: impl ~const T) {}
| ^^^^^^^^
|
- = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+ = note: `impl Trait`s cannot have `~const` trait bounds
error: `~const` is not allowed here
- --> $DIR/tilde-const-invalid-places.rs:14:50
+ --> $DIR/tilde-const-invalid-places.rs:15:50
|
LL | fn rpit_assoc_bound() -> impl IntoIterator<Item: ~const T> { Some(S) }
| ^^^^^^^^
|
- = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+ = note: `impl Trait`s cannot have `~const` trait bounds
error: `~const` is not allowed here
- --> $DIR/tilde-const-invalid-places.rs:17:48
+ --> $DIR/tilde-const-invalid-places.rs:18:48
|
LL | fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T>) {}
| ^^^^^^^^
|
- = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
-
-error: `~const` is not allowed here
- --> $DIR/tilde-const-invalid-places.rs:20:15
- |
-LL | fn generic<P: ~const T>() {}
- | ^^^^^^^^
- |
- = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
-
-error: `~const` is not allowed here
- --> $DIR/tilde-const-invalid-places.rs:23:31
- |
-LL | fn where_clause<P>() where P: ~const T {}
- | ^^^^^^^^
- |
- = note: only allowed on bounds on traits' associated types and functions, const fns, const impls and its associated functions
+ = note: `impl Trait`s cannot have `~const` trait bounds
error: `~const` and `?` are mutually exclusive
- --> $DIR/tilde-const-invalid-places.rs:26:25
+ --> $DIR/tilde-const-invalid-places.rs:21:25
|
LL | struct TildeQuestion<T: ~const ?Sized>(std::marker::PhantomData<T>);
| ^^^^^^^^^^^^^
-error: aborting due to 7 previous errors
+error: aborting due to 5 previous errors
diff --git a/src/test/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs b/src/test/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs
new file mode 100644
index 000000000..285cef571
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs
@@ -0,0 +1,17 @@
+// check-pass
+#![feature(const_trait_impl)]
+
+#[const_trait]
+trait Foo {
+ fn foo(&self) {}
+}
+
+struct Bar<T>(T);
+
+impl<T: ~const Foo> Bar<T> {
+ const fn foo(&self) {
+ self.0.foo()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs
new file mode 100644
index 000000000..bfe98b98c
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs
@@ -0,0 +1,31 @@
+// Like trait-where-clause.rs, but we are calling from a const context.
+// Checking the validity of traits' where clauses happen at a later stage.
+// (`rustc_const_eval` instead of `rustc_hir_analysis`) Therefore one file as a
+// test is not enough.
+#![feature(const_trait_impl)]
+
+#[const_trait]
+trait Bar {}
+
+#[const_trait]
+trait Foo {
+ fn a();
+ fn b() where Self: ~const Bar;
+ fn c<T: ~const Bar>();
+}
+
+const fn test1<T: ~const Foo + Bar>() {
+ T::a();
+ T::b();
+ //~^ ERROR the trait bound
+ T::c::<T>();
+ //~^ ERROR the trait bound
+}
+
+const fn test2<T: ~const Foo + ~const Bar>() {
+ T::a();
+ T::b();
+ T::c::<T>();
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr
new file mode 100644
index 000000000..f2846b6a6
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr
@@ -0,0 +1,35 @@
+error[E0277]: the trait bound `T: ~const Bar` is not satisfied
+ --> $DIR/trait-where-clause-const.rs:19:5
+ |
+LL | T::b();
+ | ^^^^^^ the trait `~const Bar` is not implemented for `T`
+ |
+note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
+ --> $DIR/trait-where-clause-const.rs:19:5
+ |
+LL | T::b();
+ | ^^^^^^
+help: consider further restricting this bound
+ |
+LL | const fn test1<T: ~const Foo + Bar + ~const Bar>() {
+ | ++++++++++++
+
+error[E0277]: the trait bound `T: ~const Bar` is not satisfied
+ --> $DIR/trait-where-clause-const.rs:21:5
+ |
+LL | T::c::<T>();
+ | ^^^^^^^^^^^ the trait `~const Bar` is not implemented for `T`
+ |
+note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
+ --> $DIR/trait-where-clause-const.rs:21:5
+ |
+LL | T::c::<T>();
+ | ^^^^^^^^^^^
+help: consider further restricting this bound
+ |
+LL | const fn test1<T: ~const Foo + Bar + ~const Bar>() {
+ | ++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs
index b7cf9a13b..4b8b00406 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs
@@ -2,6 +2,7 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Bar {
fn bar() -> u8;
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
index acea58eae..3b028ac48 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs
@@ -2,6 +2,7 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Foo {
fn bar() where Self: ~const Foo;
}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs
index d37ed3bb8..85ca5fc90 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.rs
@@ -1,5 +1,6 @@
#![feature(const_trait_impl)]
+#[const_trait]
trait Bar {}
trait Foo {
@@ -8,7 +9,7 @@ trait Foo {
fn c<T: ~const Bar>();
}
-const fn test1<T: ~const Foo + Bar>() {
+fn test1<T: Foo>() {
T::a();
T::b();
//~^ ERROR the trait bound
@@ -16,21 +17,7 @@ const fn test1<T: ~const Foo + Bar>() {
//~^ ERROR the trait bound
}
-const fn test2<T: ~const Foo + ~const Bar>() {
- T::a();
- T::b();
- T::c::<T>();
-}
-
-fn test3<T: Foo>() {
- T::a();
- T::b();
- //~^ ERROR the trait bound
- T::c::<T>();
- //~^ ERROR the trait bound
-}
-
-fn test4<T: Foo + Bar>() {
+fn test2<T: Foo + Bar>() {
T::a();
T::b();
T::c::<T>();
diff --git a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr
index d5b2d2697..11f0c4016 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr
@@ -1,77 +1,35 @@
-error[E0277]: the trait bound `T: ~const Bar` is not satisfied
- --> $DIR/trait-where-clause.rs:13:5
- |
-LL | T::b();
- | ^^^^ the trait `~const Bar` is not implemented for `T`
- |
-note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
- --> $DIR/trait-where-clause.rs:13:5
- |
-LL | T::b();
- | ^^^^
-note: required by a bound in `Foo::b`
- --> $DIR/trait-where-clause.rs:7:24
- |
-LL | fn b() where Self: ~const Bar;
- | ^^^^^^^^^^ required by this bound in `Foo::b`
-help: consider further restricting this bound
- |
-LL | const fn test1<T: ~const Foo + Bar + ~const Bar>() {
- | ++++++++++++
-
-error[E0277]: the trait bound `T: ~const Bar` is not satisfied
- --> $DIR/trait-where-clause.rs:15:5
- |
-LL | T::c::<T>();
- | ^^^^^^^^^ the trait `~const Bar` is not implemented for `T`
- |
-note: the trait `Bar` is implemented for `T`, but that implementation is not `const`
- --> $DIR/trait-where-clause.rs:15:5
- |
-LL | T::c::<T>();
- | ^^^^^^^^^
-note: required by a bound in `Foo::c`
- --> $DIR/trait-where-clause.rs:8:13
- |
-LL | fn c<T: ~const Bar>();
- | ^^^^^^^^^^ required by this bound in `Foo::c`
-help: consider further restricting this bound
- |
-LL | const fn test1<T: ~const Foo + Bar + ~const Bar>() {
- | ++++++++++++
-
error[E0277]: the trait bound `T: Bar` is not satisfied
- --> $DIR/trait-where-clause.rs:27:5
+ --> $DIR/trait-where-clause.rs:14:5
|
LL | T::b();
| ^^^^ the trait `Bar` is not implemented for `T`
|
note: required by a bound in `Foo::b`
- --> $DIR/trait-where-clause.rs:7:24
+ --> $DIR/trait-where-clause.rs:8:24
|
LL | fn b() where Self: ~const Bar;
| ^^^^^^^^^^ required by this bound in `Foo::b`
help: consider further restricting this bound
|
-LL | fn test3<T: Foo + Bar>() {
+LL | fn test1<T: Foo + Bar>() {
| +++++
error[E0277]: the trait bound `T: Bar` is not satisfied
- --> $DIR/trait-where-clause.rs:29:5
+ --> $DIR/trait-where-clause.rs:16:12
|
LL | T::c::<T>();
- | ^^^^^^^^^ the trait `Bar` is not implemented for `T`
+ | ^ the trait `Bar` is not implemented for `T`
|
note: required by a bound in `Foo::c`
- --> $DIR/trait-where-clause.rs:8:13
+ --> $DIR/trait-where-clause.rs:9:13
|
LL | fn c<T: ~const Bar>();
| ^^^^^^^^^^ required by this bound in `Foo::c`
help: consider further restricting this bound
|
-LL | fn test3<T: Foo + Bar>() {
+LL | fn test1<T: Foo + Bar>() {
| +++++
-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/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs
index e8b261545..d63381b5f 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.rs
@@ -3,4 +3,4 @@
#![feature(const_trait_impl)]
struct S<T: const Tr>;
-//~^ ERROR expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, `~`, lifetime, or path
+//~^ ERROR const bounds must start with `~`
diff --git a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr
index b6b77ac4a..31300354a 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/without-tilde.stderr
@@ -1,8 +1,10 @@
-error: expected one of `!`, `(`, `,`, `=`, `>`, `?`, `for`, `~`, lifetime, or path, found keyword `const`
+error: const bounds must start with `~`
--> $DIR/without-tilde.rs:5:13
|
LL | struct S<T: const Tr>;
- | ^^^^^ expected one of 10 possible tokens
+ | -^^^^
+ | |
+ | help: add `~`: `~`
error: aborting due to previous error
diff --git a/src/test/ui/rfc1623-2.stderr b/src/test/ui/rfc1623-2.stderr
index 495d45e22..945c6533c 100644
--- a/src/test/ui/rfc1623-2.stderr
+++ b/src/test/ui/rfc1623-2.stderr
@@ -23,7 +23,7 @@ help: consider making the type lifetime-generic with a new `'a` lifetime
LL | &(non_elidable as for<'a> fn(&'a u8, &'a u8) -> &'a u8);
| +++++++ ++ ++ ++
-error[E0605]: non-primitive cast: `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {non_elidable}` as `for<'r, 's> fn(&'r u8, &'s u8) -> &u8`
+error[E0605]: non-primitive cast: `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {non_elidable}` as `for<'a, 'b> fn(&'a u8, &'b u8) -> &u8`
--> $DIR/rfc1623-2.rs:10:6
|
LL | &(non_elidable as fn(&u8, &u8) -> &u8);
diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
index 94a90a568..fc7bf2277 100644
--- a/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
+++ b/src/test/ui/rfcs/rfc-2396-target_feature-11/fn-traits.stderr
@@ -6,7 +6,7 @@ LL | call(foo);
| |
| required by a bound introduced by this call
|
- = help: the trait `Fn<()>` is not implemented for `fn() {foo}`
+ = help: the trait `Fn<()>` is not implemented for fn item `fn() {foo}`
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
note: required by a bound in `call`
@@ -23,7 +23,7 @@ LL | call_mut(foo);
| |
| required by a bound introduced by this call
|
- = help: the trait `FnMut<()>` is not implemented for `fn() {foo}`
+ = help: the trait `FnMut<()>` is not implemented for fn item `fn() {foo}`
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
note: required by a bound in `call_mut`
@@ -40,7 +40,7 @@ LL | call_once(foo);
| |
| required by a bound introduced by this call
|
- = help: the trait `FnOnce<()>` is not implemented for `fn() {foo}`
+ = help: the trait `FnOnce<()>` is not implemented for fn item `fn() {foo}`
= note: wrap the `fn() {foo}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
note: required by a bound in `call_once`
@@ -57,7 +57,7 @@ LL | call(foo_unsafe);
| |
| required by a bound introduced by this call
|
- = help: the trait `Fn<()>` is not implemented for `unsafe fn() {foo_unsafe}`
+ = help: the trait `Fn<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
note: required by a bound in `call`
@@ -74,7 +74,7 @@ LL | call_mut(foo_unsafe);
| |
| required by a bound introduced by this call
|
- = help: the trait `FnMut<()>` is not implemented for `unsafe fn() {foo_unsafe}`
+ = help: the trait `FnMut<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
note: required by a bound in `call_mut`
@@ -91,7 +91,7 @@ LL | call_once(foo_unsafe);
| |
| required by a bound introduced by this call
|
- = help: the trait `FnOnce<()>` is not implemented for `unsafe fn() {foo_unsafe}`
+ = help: the trait `FnOnce<()>` is not implemented for fn item `unsafe fn() {foo_unsafe}`
= note: wrap the `unsafe fn() {foo_unsafe}` in a closure with no arguments: `|| { /* code */ }`
= note: `#[target_feature]` functions do not implement the `Fn` traits
note: required by a bound in `call_once`
diff --git a/src/test/ui/rfcs/rfc1857-drop-order.rs b/src/test/ui/rfcs/rfc1857-drop-order.rs
index 243b7fb6f..4c4816c2f 100644
--- a/src/test/ui/rfcs/rfc1857-drop-order.rs
+++ b/src/test/ui/rfcs/rfc1857-drop-order.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![allow(dead_code, unreachable_code)]
diff --git a/src/test/ui/runtime/backtrace-debuginfo.rs b/src/test/ui/runtime/backtrace-debuginfo.rs
index 7c9f1a7f2..8b5466b6c 100644
--- a/src/test/ui/runtime/backtrace-debuginfo.rs
+++ b/src/test/ui/runtime/backtrace-debuginfo.rs
@@ -12,6 +12,7 @@
// ignore-pretty issue #37195
// ignore-emscripten spawning processes is not supported
// ignore-sgx no processes
+// ignore-fuchsia Backtrace not symbolized, trace different line alignment
use std::env;
diff --git a/src/test/ui/runtime/out-of-stack.rs b/src/test/ui/runtime/out-of-stack.rs
index 73c31cd97..6873abc49 100644
--- a/src/test/ui/runtime/out-of-stack.rs
+++ b/src/test/ui/runtime/out-of-stack.rs
@@ -5,6 +5,7 @@
// ignore-android: FIXME (#20004)
// ignore-emscripten no processes
// ignore-sgx no processes
+// ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
#![feature(core_intrinsics)]
#![feature(rustc_private)]
diff --git a/src/test/ui/runtime/rt-explody-panic-payloads.rs b/src/test/ui/runtime/rt-explody-panic-payloads.rs
index eb5bf8f67..755d3df42 100644
--- a/src/test/ui/runtime/rt-explody-panic-payloads.rs
+++ b/src/test/ui/runtime/rt-explody-panic-payloads.rs
@@ -2,9 +2,6 @@
// needs-unwind
// ignore-emscripten no processes
// ignore-sgx no processes
-// ignore-wasm32-bare no unwinding panic
-// ignore-avr no unwinding panic
-// ignore-nvptx64 no unwinding panic
use std::env;
use std::process::Command;
@@ -25,7 +22,12 @@ fn main() {
}.expect("running the command should have succeeded");
println!("{:#?}", output);
let stderr = std::str::from_utf8(&output.stderr);
- assert!(stderr.map(|v| {
- v.ends_with("fatal runtime error: drop of the panic payload panicked\n")
- }).unwrap_or(false));
+ assert!(stderr
+ .map(|v| {
+ // When running inside QEMU user-mode emulation, there will be an extra message printed
+ // by QEMU in the stderr whenever a core dump happens. Remove it before the check.
+ v.strip_suffix("qemu: uncaught target signal 6 (Aborted) - core dumped\n").unwrap_or(v)
+ })
+ .map(|v| { v.ends_with("fatal runtime error: drop of the panic payload panicked\n") })
+ .unwrap_or(false));
}
diff --git a/src/test/ui/rust-2018/async-ident-allowed.stderr b/src/test/ui/rust-2018/async-ident-allowed.stderr
index 5b63eab8e..992b29750 100644
--- a/src/test/ui/rust-2018/async-ident-allowed.stderr
+++ b/src/test/ui/rust-2018/async-ident-allowed.stderr
@@ -4,14 +4,14 @@ error: `async` is a keyword in the 2018 edition
LL | let async = 3;
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/async-ident-allowed.rs:3:9
|
LL | #![deny(rust_2018_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[deny(keyword_idents)]` implied by `#[deny(rust_2018_compatibility)]`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
error: aborting due to previous error
diff --git a/src/test/ui/rust-2018/async-ident.stderr b/src/test/ui/rust-2018/async-ident.stderr
index 6396e9dee..d15250c54 100644
--- a/src/test/ui/rust-2018/async-ident.stderr
+++ b/src/test/ui/rust-2018/async-ident.stderr
@@ -4,13 +4,13 @@ error: `async` is a keyword in the 2018 edition
LL | fn async() {}
| ^^^^^ help: you can use a raw identifier to stay compatible: `r#async`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/async-ident.rs:2:9
|
LL | #![deny(keyword_idents)]
| ^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
error: `async` is a keyword in the 2018 edition
--> $DIR/async-ident.rs:12:7
diff --git a/src/test/ui/rust-2018/dyn-keyword.stderr b/src/test/ui/rust-2018/dyn-keyword.stderr
index 699242f2d..b6f5b10cf 100644
--- a/src/test/ui/rust-2018/dyn-keyword.stderr
+++ b/src/test/ui/rust-2018/dyn-keyword.stderr
@@ -4,13 +4,13 @@ error: `dyn` is a keyword in the 2018 edition
LL | let dyn = ();
| ^^^ help: you can use a raw identifier to stay compatible: `r#dyn`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/dyn-keyword.rs:5:9
|
LL | #![deny(keyword_idents)]
| ^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
error: aborting due to previous error
diff --git a/src/test/ui/rust-2018/edition-lint-fully-qualified-paths.stderr b/src/test/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
index 6f529fa91..e1709db09 100644
--- a/src/test/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
+++ b/src/test/ui/rust-2018/edition-lint-fully-qualified-paths.stderr
@@ -4,13 +4,13 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external c
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>
note: the lint level is defined here
--> $DIR/edition-lint-fully-qualified-paths.rs:4:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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:23:13
diff --git a/src/test/ui/rust-2018/edition-lint-nested-empty-paths.stderr b/src/test/ui/rust-2018/edition-lint-nested-empty-paths.stderr
index e47c320f7..8769cbb35 100644
--- a/src/test/ui/rust-2018/edition-lint-nested-empty-paths.stderr
+++ b/src/test/ui/rust-2018/edition-lint-nested-empty-paths.stderr
@@ -4,13 +4,13 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external c
LL | use foo::{bar::{baz::{}}};
| ^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::foo::{bar::{baz::{}}}`
|
+ = 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>
note: the lint level is defined here
--> $DIR/edition-lint-nested-empty-paths.rs:4:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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-nested-empty-paths.rs:21:5
diff --git a/src/test/ui/rust-2018/edition-lint-nested-paths.stderr b/src/test/ui/rust-2018/edition-lint-nested-paths.stderr
index 24b17f212..354a6fe32 100644
--- a/src/test/ui/rust-2018/edition-lint-nested-paths.stderr
+++ b/src/test/ui/rust-2018/edition-lint-nested-paths.stderr
@@ -4,13 +4,13 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external c
LL | use foo::{a, b};
| ^^^^^^^^^^^ help: use `crate`: `crate::foo::{a, b}`
|
+ = 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>
note: the lint level is defined here
--> $DIR/edition-lint-nested-paths.rs:4:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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-nested-paths.rs:6:5
diff --git a/src/test/ui/rust-2018/edition-lint-paths.stderr b/src/test/ui/rust-2018/edition-lint-paths.stderr
index 1ded8cd36..42652be94 100644
--- a/src/test/ui/rust-2018/edition-lint-paths.stderr
+++ b/src/test/ui/rust-2018/edition-lint-paths.stderr
@@ -4,13 +4,13 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external c
LL | use bar::Bar;
| ^^^^^^^^ help: use `crate`: `crate::bar::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>
note: the lint level is defined here
--> $DIR/edition-lint-paths.rs:5:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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-paths.rs:19:9
diff --git a/src/test/ui/rust-2018/extern-crate-rename.stderr b/src/test/ui/rust-2018/extern-crate-rename.stderr
index 4bccbc512..eb040f5de 100644
--- a/src/test/ui/rust-2018/extern-crate-rename.stderr
+++ b/src/test/ui/rust-2018/extern-crate-rename.stderr
@@ -4,13 +4,13 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external c
LL | use my_crate::foo;
| ^^^^^^^^^^^^^ help: use `crate`: `crate::my_crate::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>
note: the lint level is defined here
--> $DIR/extern-crate-rename.rs:8:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 previous error
diff --git a/src/test/ui/rust-2018/extern-crate-submod.stderr b/src/test/ui/rust-2018/extern-crate-submod.stderr
index 3c75319ae..1a9aa7578 100644
--- a/src/test/ui/rust-2018/extern-crate-submod.stderr
+++ b/src/test/ui/rust-2018/extern-crate-submod.stderr
@@ -4,13 +4,13 @@ error: absolute paths must start with `self`, `super`, `crate`, or an external c
LL | use m::edition_lint_paths::foo;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `crate`: `crate::m::edition_lint_paths::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>
note: the lint level is defined here
--> $DIR/extern-crate-submod.rs:9:9
|
LL | #![deny(absolute_paths_not_starting_with_crate)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 previous error
diff --git a/src/test/ui/rust-2018/try-ident.stderr b/src/test/ui/rust-2018/try-ident.stderr
index 3d93b433c..74015ac9d 100644
--- a/src/test/ui/rust-2018/try-ident.stderr
+++ b/src/test/ui/rust-2018/try-ident.stderr
@@ -4,14 +4,14 @@ warning: `try` is a keyword in the 2018 edition
LL | try();
| ^^^ help: you can use a raw identifier to stay compatible: `r#try`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/try-ident.rs:4:9
|
LL | #![warn(rust_2018_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(keyword_idents)]` implied by `#[warn(rust_2018_compatibility)]`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
warning: `try` is a keyword in the 2018 edition
--> $DIR/try-ident.rs:12:4
diff --git a/src/test/ui/rust-2018/try-macro.stderr b/src/test/ui/rust-2018/try-macro.stderr
index f315b4d4a..760378f09 100644
--- a/src/test/ui/rust-2018/try-macro.stderr
+++ b/src/test/ui/rust-2018/try-macro.stderr
@@ -4,14 +4,14 @@ warning: `try` is a keyword in the 2018 edition
LL | try!(x);
| ^^^ help: you can use a raw identifier to stay compatible: `r#try`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
+ = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
note: the lint level is defined here
--> $DIR/try-macro.rs:6:9
|
LL | #![warn(rust_2018_compatibility)]
| ^^^^^^^^^^^^^^^^^^^^^^^
= note: `#[warn(keyword_idents)]` implied by `#[warn(rust_2018_compatibility)]`
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2018!
- = note: for more information, see issue #49716 <https://github.com/rust-lang/rust/issues/49716>
warning: 1 warning emitted
diff --git a/src/test/ui/rust-2021/array-into-iter-ambiguous.stderr b/src/test/ui/rust-2021/array-into-iter-ambiguous.stderr
index fac8d21c7..2a724bd30 100644
--- a/src/test/ui/rust-2021/array-into-iter-ambiguous.stderr
+++ b/src/test/ui/rust-2021/array-into-iter-ambiguous.stderr
@@ -4,13 +4,13 @@ warning: trait method `into_iter` will become ambiguous in Rust 2021
LL | let y = points.into_iter();
| ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyIntoIter::into_iter(points)`
|
+ = warning: this changes meaning in Rust 2021
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
note: the lint level is defined here
--> $DIR/array-into-iter-ambiguous.rs:5:9
|
LL | #![warn(array_into_iter)]
| ^^^^^^^^^^^^^^^
- = warning: this changes meaning in Rust 2021
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
warning: 1 warning emitted
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr
index 14ad9b017..f38da132b 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic-trait.stderr
@@ -4,13 +4,13 @@ warning: trait-associated function `try_from` will become ambiguous in Rust 2021
LL | U::try_from(self)
| ^^^^^^^^^^^ help: disambiguate the associated function: `<U as PyTryFrom<'_, _>>::try_from`
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/future-prelude-collision-generic-trait.rs:5:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 1 warning emitted
diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic.stderr b/src/test/ui/rust-2021/future-prelude-collision-generic.stderr
index e1d3f3c0a..9893b3eba 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-generic.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision-generic.stderr
@@ -4,13 +4,13 @@ warning: trait-associated function `from_iter` will become ambiguous in Rust 202
LL | Generic::from_iter(1);
| ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic<'_, _> as MyFromIter>::from_iter`
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/future-prelude-collision-generic.rs:5:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-generic.rs:31:5
diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
index 56abb8abd..c1d72d0df 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr
@@ -4,13 +4,13 @@ warning: trait method `try_into` will become ambiguous in Rust 2021
LL | let _: u32 = 3u8.try_into().unwrap();
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)`
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/future-prelude-collision-imported.rs:4:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-imported.rs:40:22
diff --git a/src/test/ui/rust-2021/future-prelude-collision-macros.stderr b/src/test/ui/rust-2021/future-prelude-collision-macros.stderr
index 4c3543ca7..4d4a07699 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-macros.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision-macros.stderr
@@ -4,13 +4,13 @@ warning: trait method `try_into` will become ambiguous in Rust 2021
LL | foo!().try_into(todo!());
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyTry::try_into(foo!(), todo!())`
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/future-prelude-collision-macros.rs:4:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-macros.rs:42:5
diff --git a/src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr b/src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr
index 2de9020bc..c0ef80fd8 100644
--- a/src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision-turbofish.stderr
@@ -4,13 +4,13 @@ warning: trait method `try_into` will become ambiguous in Rust 2021
LL | x.try_into::<usize>().or(Err("foo"))?.checked_sub(1);
| ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `AnnotatableTryInto::try_into::<usize>(x)`
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/future-prelude-collision-turbofish.rs:6:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-turbofish.rs:23:5
diff --git a/src/test/ui/rust-2021/future-prelude-collision.stderr b/src/test/ui/rust-2021/future-prelude-collision.stderr
index 889e66de0..cae113ff7 100644
--- a/src/test/ui/rust-2021/future-prelude-collision.stderr
+++ b/src/test/ui/rust-2021/future-prelude-collision.stderr
@@ -4,13 +4,13 @@ warning: trait method `try_into` will become ambiguous in Rust 2021
LL | let _: u32 = 3u8.try_into().unwrap();
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)`
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/future-prelude-collision.rs:4:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:61:13
diff --git a/src/test/ui/rust-2021/generic-type-collision.stderr b/src/test/ui/rust-2021/generic-type-collision.stderr
index e6ea28d71..1ec61044f 100644
--- a/src/test/ui/rust-2021/generic-type-collision.stderr
+++ b/src/test/ui/rust-2021/generic-type-collision.stderr
@@ -4,13 +4,13 @@ warning: trait-associated function `from_iter` will become ambiguous in Rust 202
LL | <Vec<i32>>::from_iter(None);
| ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Vec<i32> as MyTrait<_>>::from_iter`
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/generic-type-collision.rs:4:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 1 warning emitted
diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.stderr b/src/test/ui/rust-2021/inherent-dyn-collision.stderr
index 77b4c3851..f5905574a 100644
--- a/src/test/ui/rust-2021/inherent-dyn-collision.stderr
+++ b/src/test/ui/rust-2021/inherent-dyn-collision.stderr
@@ -4,13 +4,13 @@ warning: trait method `try_into` will become ambiguous in Rust 2021
LL | get_dyn_trait().try_into().unwrap()
| ^^^^^^^^^^^^^^^ help: disambiguate the method call: `(&*get_dyn_trait())`
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
note: the lint level is defined here
--> $DIR/inherent-dyn-collision.rs:8:9
|
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 1 warning emitted
diff --git a/src/test/ui/rust-2021/reserved-prefixes-migration.stderr b/src/test/ui/rust-2021/reserved-prefixes-migration.stderr
index 647a9f393..20914d1b9 100644
--- a/src/test/ui/rust-2021/reserved-prefixes-migration.stderr
+++ b/src/test/ui/rust-2021/reserved-prefixes-migration.stderr
@@ -4,18 +4,17 @@ warning: prefix `z` is unknown
LL | m2!(z"hey");
| ^ unknown prefix
|
+ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
note: the lint level is defined here
--> $DIR/reserved-prefixes-migration.rs:5:9
|
LL | #![warn(rust_2021_prefixes_incompatible_syntax)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL - m2!(z"hey");
-LL + m2!(z "hey");
- |
+LL | m2!(z "hey");
+ | +
warning: prefix `prefix` is unknown
--> $DIR/reserved-prefixes-migration.rs:19:9
@@ -27,9 +26,8 @@ LL | m2!(prefix"hey");
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL - m2!(prefix"hey");
-LL + m2!(prefix "hey");
- |
+LL | m2!(prefix "hey");
+ | +
warning: prefix `hey` is unknown
--> $DIR/reserved-prefixes-migration.rs:22:9
@@ -41,9 +39,8 @@ LL | m3!(hey#123);
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL - m3!(hey#123);
-LL + m3!(hey #123);
- |
+LL | m3!(hey #123);
+ | +
warning: prefix `hey` is unknown
--> $DIR/reserved-prefixes-migration.rs:25:9
@@ -55,9 +52,8 @@ LL | m3!(hey#hey);
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL - m3!(hey#hey);
-LL + m3!(hey #hey);
- |
+LL | m3!(hey #hey);
+ | +
warning: prefix `kind` is unknown
--> $DIR/reserved-prefixes-migration.rs:35:14
@@ -69,9 +65,8 @@ LL | #name = #kind#value
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL - #name = #kind#value
-LL + #name = #kind #value
- |
+LL | #name = #kind #value
+ | +
warning: 5 warnings emitted
diff --git a/src/test/ui/rust-2021/reserved-prefixes.stderr b/src/test/ui/rust-2021/reserved-prefixes.stderr
index df31aee66..807d6d98b 100644
--- a/src/test/ui/rust-2021/reserved-prefixes.stderr
+++ b/src/test/ui/rust-2021/reserved-prefixes.stderr
@@ -7,9 +7,8 @@ LL | demo3!(foo#bar);
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo3!(foo#bar);
-LL + demo3!(foo #bar);
- |
+LL | demo3!(foo #bar);
+ | +
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:17:12
@@ -20,9 +19,8 @@ LL | demo2!(foo"bar");
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo2!(foo"bar");
-LL + demo2!(foo "bar");
- |
+LL | demo2!(foo "bar");
+ | +
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:18:12
@@ -33,9 +31,8 @@ LL | demo2!(foo'b');
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo2!(foo'b');
-LL + demo2!(foo 'b');
- |
+LL | demo2!(foo 'b');
+ | +
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:20:12
@@ -46,9 +43,8 @@ LL | demo2!(foo'b);
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo2!(foo'b);
-LL + demo2!(foo 'b);
- |
+LL | demo2!(foo 'b);
+ | +
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:21:12
@@ -59,9 +55,8 @@ LL | demo3!(foo# bar);
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo3!(foo# bar);
-LL + demo3!(foo # bar);
- |
+LL | demo3!(foo # bar);
+ | +
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:22:12
@@ -72,9 +67,8 @@ LL | demo4!(foo#! bar);
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo4!(foo#! bar);
-LL + demo4!(foo #! bar);
- |
+LL | demo4!(foo #! bar);
+ | +
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:23:12
@@ -85,9 +79,8 @@ LL | demo4!(foo## bar);
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo4!(foo## bar);
-LL + demo4!(foo ## bar);
- |
+LL | demo4!(foo ## bar);
+ | +
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:25:12
@@ -98,9 +91,8 @@ LL | demo4!(foo#bar#);
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo4!(foo#bar#);
-LL + demo4!(foo #bar#);
- |
+LL | demo4!(foo #bar#);
+ | +
error: prefix `bar` is unknown
--> $DIR/reserved-prefixes.rs:25:16
@@ -111,9 +103,8 @@ LL | demo4!(foo#bar#);
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL - demo4!(foo#bar#);
-LL + demo4!(foo#bar #);
- |
+LL | demo4!(foo#bar #);
+ | +
error: aborting due to 9 previous errors
diff --git a/src/test/ui/rustdoc/deny-invalid-doc-attrs.stderr b/src/test/ui/rustdoc/deny-invalid-doc-attrs.stderr
index a14ab8fe4..e9a4c1dd5 100644
--- a/src/test/ui/rustdoc/deny-invalid-doc-attrs.stderr
+++ b/src/test/ui/rustdoc/deny-invalid-doc-attrs.stderr
@@ -4,13 +4,13 @@ error: unknown `doc` attribute `x`
LL | #![doc(x)]
| ^
|
+ = 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/deny-invalid-doc-attrs.rs:1:9
|
LL | #![deny(invalid_doc_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = 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>
error: aborting due to previous error
diff --git a/src/test/ui/rustdoc/doc-test-attr.stderr b/src/test/ui/rustdoc/doc-test-attr.stderr
index 7f5e2d6bc..5e6014954 100644
--- a/src/test/ui/rustdoc/doc-test-attr.stderr
+++ b/src/test/ui/rustdoc/doc-test-attr.stderr
@@ -4,13 +4,13 @@ error: `#[doc(test(...)]` takes a list of attributes
LL | #![doc(test)]
| ^^^^
|
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
note: the lint level is defined here
--> $DIR/doc-test-attr.rs:2:9
|
LL | #![deny(invalid_doc_attributes)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = 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>
error: `#[doc(test(...)]` takes a list of attributes
--> $DIR/doc-test-attr.rs:7:8
diff --git a/src/test/ui/rustdoc/feature-gate-doc_primitive.stderr b/src/test/ui/rustdoc/feature-gate-doc_primitive.stderr
index 736bf29c5..194b2d87d 100644
--- a/src/test/ui/rustdoc/feature-gate-doc_primitive.stderr
+++ b/src/test/ui/rustdoc/feature-gate-doc_primitive.stderr
@@ -4,9 +4,9 @@ warning: `doc(primitive)` should never have been stable
LL | #[doc(primitive = "usize")]
| ^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(invalid_doc_attributes)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
+ = note: `#[warn(invalid_doc_attributes)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/sanitize/address.rs b/src/test/ui/sanitize/address.rs
index 9a26a351d..5b2cea875 100644
--- a/src/test/ui/sanitize/address.rs
+++ b/src/test/ui/sanitize/address.rs
@@ -5,9 +5,7 @@
//
// run-fail
// error-pattern: AddressSanitizer: stack-buffer-overflow
-// error-pattern: 'xs' (line 15) <== Memory access at offset
-
-#![feature(bench_black_box)]
+// error-pattern: 'xs' (line 13) <== Memory access at offset
use std::hint::black_box;
diff --git a/src/test/ui/sanitize/hwaddress.rs b/src/test/ui/sanitize/hwaddress.rs
index b988035f7..f9b37a155 100644
--- a/src/test/ui/sanitize/hwaddress.rs
+++ b/src/test/ui/sanitize/hwaddress.rs
@@ -10,8 +10,6 @@
// run-fail
// error-pattern: HWAddressSanitizer: tag-mismatch
-#![feature(bench_black_box)]
-
use std::hint::black_box;
fn main() {
diff --git a/src/test/ui/sanitize/inline-always.stderr b/src/test/ui/sanitize/inline-always.stderr
index 918762d1f..74fba3c0e 100644
--- a/src/test/ui/sanitize/inline-always.stderr
+++ b/src/test/ui/sanitize/inline-always.stderr
@@ -4,12 +4,12 @@ warning: `no_sanitize` will have no effect after inlining
LL | #[no_sanitize(address)]
| ^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(inline_no_sanitize)]` on by default
note: inlining requested here
--> $DIR/inline-always.rs:5:1
|
LL | #[inline(always)]
| ^^^^^^^^^^^^^^^^^
+ = note: `#[warn(inline_no_sanitize)]` on by default
warning: 1 warning emitted
diff --git a/src/test/ui/sanitize/leak.rs b/src/test/ui/sanitize/leak.rs
index f63f81352..cbb44ae8a 100644
--- a/src/test/ui/sanitize/leak.rs
+++ b/src/test/ui/sanitize/leak.rs
@@ -6,8 +6,6 @@
// run-fail
// error-pattern: LeakSanitizer: detected memory leaks
-#![feature(bench_black_box)]
-
use std::hint::black_box;
use std::mem;
diff --git a/src/test/ui/sanitize/memory-eager.rs b/src/test/ui/sanitize/memory-eager.rs
new file mode 100644
index 000000000..0018c2f75
--- /dev/null
+++ b/src/test/ui/sanitize/memory-eager.rs
@@ -0,0 +1,37 @@
+// needs-sanitizer-support
+// needs-sanitizer-memory
+// min-llvm-version: 14.0.0
+//
+// revisions: unoptimized optimized
+//
+// [optimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O
+// [unoptimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins
+//
+// run-fail
+// error-pattern: MemorySanitizer: use-of-uninitialized-value
+// error-pattern: Uninitialized value was created by an allocation
+// error-pattern: in the stack frame
+//
+// This test case intentionally limits the usage of the std,
+// since it will be linked with an uninstrumented version of it.
+
+#![feature(core_intrinsics)]
+#![feature(start)]
+
+use std::hint::black_box;
+use std::mem::MaybeUninit;
+
+#[inline(never)]
+#[no_mangle]
+#[allow(invalid_value)]
+fn random() -> char {
+ let r = unsafe { MaybeUninit::uninit().assume_init() };
+ // Avoid optimizing everything out.
+ black_box(r)
+}
+
+#[start]
+fn main(_: isize, _: *const *const u8) -> isize {
+ random();
+ 0
+}
diff --git a/src/test/ui/sanitize/memory.rs b/src/test/ui/sanitize/memory.rs
index b53f19a5b..1a9ac3a4f 100644
--- a/src/test/ui/sanitize/memory.rs
+++ b/src/test/ui/sanitize/memory.rs
@@ -1,19 +1,22 @@
// needs-sanitizer-support
// needs-sanitizer-memory
//
-// compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O
+// revisions: unoptimized optimized
+//
+// [optimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins -O
+// [unoptimized]compile-flags: -Z sanitizer=memory -Zsanitizer-memory-track-origins
//
// run-fail
// error-pattern: MemorySanitizer: use-of-uninitialized-value
// error-pattern: Uninitialized value was created by an allocation
-// error-pattern: in the stack frame of function 'main'
+// error-pattern: in the stack frame
//
// This test case intentionally limits the usage of the std,
// since it will be linked with an uninstrumented version of it.
#![feature(core_intrinsics)]
#![feature(start)]
-#![feature(bench_black_box)]
+#![allow(invalid_value)]
use std::hint::black_box;
use std::mem::MaybeUninit;
@@ -21,9 +24,9 @@ use std::mem::MaybeUninit;
#[inline(never)]
#[no_mangle]
fn random() -> [isize; 32] {
- let r = unsafe { MaybeUninit::uninit().assume_init() };
+ let r = MaybeUninit::uninit();
// Avoid optimizing everything out.
- black_box(r)
+ unsafe { std::intrinsics::volatile_load(r.as_ptr()) }
}
#[inline(never)]
@@ -38,6 +41,6 @@ fn xor(a: &[isize]) -> isize {
#[start]
fn main(_: isize, _: *const *const u8) -> isize {
- let r = random();
+ let r = black_box(random as fn() -> [isize; 32])();
xor(&r)
}
diff --git a/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs b/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
index 1542c7f31..33e18e355 100644
--- a/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
+++ b/src/test/ui/sanitize/new-llvm-pass-manager-thin-lto.rs
@@ -7,7 +7,7 @@
//
// no-prefer-dynamic
// revisions: opt0 opt1
-// compile-flags: -Znew-llvm-pass-manager=yes -Zsanitizer=address -Clto=thin
+// compile-flags: -Zsanitizer=address -Clto=thin
//[opt0]compile-flags: -Copt-level=0
//[opt1]compile-flags: -Copt-level=1
// run-fail
diff --git a/src/test/ui/save-analysis/issue-68621.stderr b/src/test/ui/save-analysis/issue-68621.stderr
index 4a4bf9a69..4452ee791 100644
--- a/src/test/ui/save-analysis/issue-68621.stderr
+++ b/src/test/ui/save-analysis/issue-68621.stderr
@@ -4,7 +4,7 @@ error: unconstrained opaque type
LL | type Future = impl Trait;
| ^^^^^^^^^^
|
- = note: `Future` must be used in combination with a concrete type within the same module
+ = note: `Future` must be used in combination with a concrete type within the same impl
error: aborting due to previous error
diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr b/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr
index 35a65facb..0ec0d4be5 100644
--- a/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr
+++ b/src/test/ui/self/arbitrary-self-types-not-object-safe.curr.stderr
@@ -31,7 +31,7 @@ LL | trait Foo {
| --- this trait cannot be made into an object...
LL | fn foo(self: &Rc<Self>) -> usize;
| ^^^^^^^^^ ...because method `foo`'s `self` parameter cannot be dispatched on
- = note: required because of the requirements on the impl of `CoerceUnsized<Rc<dyn Foo>>` for `Rc<usize>`
+ = note: required for `Rc<usize>` to implement `CoerceUnsized<Rc<dyn Foo>>`
= note: required by cast to type `Rc<dyn Foo>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr b/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr
index a74752cf8..b494b448e 100644
--- a/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr
+++ b/src/test/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr
@@ -14,7 +14,7 @@ LL | trait Foo {
| --- this trait cannot be made into an object...
LL | fn foo(self: &Rc<Self>) -> usize;
| ^^^^^^^^^ ...because method `foo`'s `self` parameter cannot be dispatched on
- = note: required because of the requirements on the impl of `CoerceUnsized<Rc<dyn Foo>>` for `Rc<usize>`
+ = note: required for `Rc<usize>` to implement `CoerceUnsized<Rc<dyn Foo>>`
= note: required by cast to type `Rc<dyn Foo>`
error: aborting due to previous error
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
index 7e7d60d0f..eb3d3e4a6 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.stderr
@@ -6,7 +6,7 @@ LL | async fn f(self: Pin<&Self>) -> impl Clone { self }
| |
| hidden type `Pin<&Foo>` captures the anonymous lifetime defined here
|
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl Clone` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | async fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
| ++++
diff --git a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
index 30d2250c0..2c0b2a0d9 100644
--- a/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
+++ b/src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait.stderr
@@ -6,7 +6,7 @@ LL | fn f(self: Pin<&Self>) -> impl Clone { self }
| |
| hidden type `Pin<&Foo>` captures the anonymous lifetime defined here
|
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl Clone` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
| ++++
diff --git a/src/test/ui/simd/intrinsic/ptr-cast.rs b/src/test/ui/simd/intrinsic/ptr-cast.rs
new file mode 100644
index 000000000..1d13720bc
--- /dev/null
+++ b/src/test/ui/simd/intrinsic/ptr-cast.rs
@@ -0,0 +1,33 @@
+// run-pass
+
+#![feature(repr_simd, platform_intrinsics)]
+
+extern "platform-intrinsic" {
+ fn simd_cast_ptr<T, U>(x: T) -> U;
+ fn simd_expose_addr<T, U>(x: T) -> U;
+ fn simd_from_exposed_addr<T, U>(x: T) -> U;
+}
+
+#[derive(Copy, Clone)]
+#[repr(simd)]
+struct V<T>([T; 2]);
+
+fn main() {
+ unsafe {
+ let mut foo = 4i8;
+ let ptr = &mut foo as *mut i8;
+
+ let ptrs = V::<*mut i8>([ptr, core::ptr::null_mut()]);
+
+ // change constness and type
+ let const_ptrs: V<*const u8> = simd_cast_ptr(ptrs);
+
+ let exposed_addr: V<usize> = simd_expose_addr(const_ptrs);
+
+ let from_exposed_addr: V<*mut i8> = simd_from_exposed_addr(exposed_addr);
+
+ assert!(const_ptrs.0 == [ptr as *const u8, core::ptr::null()]);
+ assert!(exposed_addr.0 == [ptr as usize, 0]);
+ assert!(from_exposed_addr.0 == ptrs.0);
+ }
+}
diff --git a/src/test/ui/simd/portable-intrinsics-arent-exposed.stderr b/src/test/ui/simd/portable-intrinsics-arent-exposed.stderr
index 870f4064d..8881ede0d 100644
--- a/src/test/ui/simd/portable-intrinsics-arent-exposed.stderr
+++ b/src/test/ui/simd/portable-intrinsics-arent-exposed.stderr
@@ -11,6 +11,11 @@ error[E0432]: unresolved import `std::simd::intrinsics`
|
LL | use std::simd::intrinsics;
| ^^^^^^^^^^^^^^^^^^^^^ no `intrinsics` in `simd`
+ |
+help: consider importing this module instead
+ |
+LL | use std::intrinsics;
+ | ~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/simd/target-feature-mixup.rs b/src/test/ui/simd/target-feature-mixup.rs
index 6d7688191..5dd163715 100644
--- a/src/test/ui/simd/target-feature-mixup.rs
+++ b/src/test/ui/simd/target-feature-mixup.rs
@@ -5,6 +5,7 @@
// ignore-emscripten
// ignore-sgx no processes
+// ignore-fuchsia must translate zircon signal to SIGILL, FIXME (#58590)
#![feature(repr_simd, target_feature, cfg_target_feature)]
#![feature(avx512_target_feature)]
diff --git a/src/test/ui/single-use-lifetime/derive-eq.rs b/src/test/ui/single-use-lifetime/derive-eq.rs
new file mode 100644
index 000000000..e5bdfc55d
--- /dev/null
+++ b/src/test/ui/single-use-lifetime/derive-eq.rs
@@ -0,0 +1,11 @@
+// check-pass
+
+#![deny(single_use_lifetimes)]
+
+#[derive(PartialEq, Eq)]
+struct Foo<'a, T> {
+ /// a reference to the underlying secret data that will be derefed
+ pub data: &'a mut T,
+}
+
+fn main() {}
diff --git a/src/test/ui/sized-cycle-note.rs b/src/test/ui/sized-cycle-note.rs
index ca8be5692..766a5fa0d 100644
--- a/src/test/ui/sized-cycle-note.rs
+++ b/src/test/ui/sized-cycle-note.rs
@@ -1,15 +1,6 @@
-// Test the error message resulting from a cycle in solving `Foo:
-// Sized`. The specifics of the message will of course but the main
-// thing we want to preserve is that:
-//
-// 1. the message should appear attached to one of the structs
-// defined in this file;
-// 2. it should elaborate the steps that led to the cycle.
-
struct Baz { q: Option<Foo> }
-//~^ ERROR recursive type `Baz` has infinite size
+//~^ ERROR recursive types `Baz` and `Foo` have infinite size
struct Foo { q: Option<Baz> }
-//~^ ERROR recursive type `Foo` has infinite size
impl Foo { fn bar(&self) {} }
diff --git a/src/test/ui/sized-cycle-note.stderr b/src/test/ui/sized-cycle-note.stderr
index 536510814..06c87b61f 100644
--- a/src/test/ui/sized-cycle-note.stderr
+++ b/src/test/ui/sized-cycle-note.stderr
@@ -1,29 +1,19 @@
-error[E0072]: recursive type `Baz` has infinite size
- --> $DIR/sized-cycle-note.rs:9:1
+error[E0072]: recursive types `Baz` and `Foo` have infinite size
+ --> $DIR/sized-cycle-note.rs:1:1
|
LL | struct Baz { q: Option<Foo> }
- | ^^^^^^^^^^ ----------- recursive without indirection
- | |
- | recursive type has infinite size
- |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Baz` representable
- |
-LL | struct Baz { q: Option<Box<Foo>> }
- | ++++ +
-
-error[E0072]: recursive type `Foo` has infinite size
- --> $DIR/sized-cycle-note.rs:11:1
- |
+ | ^^^^^^^^^^ --- recursive without indirection
+LL |
LL | struct Foo { q: Option<Baz> }
- | ^^^^^^^^^^ ----------- recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^^^ --- recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+LL ~ struct Baz { q: Option<Box<Foo>> }
+LL |
+LL ~ struct Foo { q: Option<Box<Baz>> }
|
-LL | struct Foo { q: Option<Box<Baz>> }
- | ++++ +
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/span/E0072.stderr b/src/test/ui/span/E0072.stderr
index 882ed577c..20f2e0df0 100644
--- a/src/test/ui/span/E0072.stderr
+++ b/src/test/ui/span/E0072.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `ListNode` has infinite size
--> $DIR/E0072.rs:1:1
|
LL | struct ListNode {
- | ^^^^^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^^^^^
LL | head: u8,
LL | tail: Option<ListNode>,
- | ---------------- recursive without indirection
+ | -------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | tail: Option<Box<ListNode>>,
| ++++ +
diff --git a/src/test/ui/span/E0204.stderr b/src/test/ui/span/E0204.stderr
index 257584843..0b2166eed 100644
--- a/src/test/ui/span/E0204.stderr
+++ b/src/test/ui/span/E0204.stderr
@@ -1,11 +1,11 @@
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/E0204.rs:5:6
+ --> $DIR/E0204.rs:5:15
|
LL | foo: Vec<u32>,
| ------------- this field does not implement `Copy`
...
LL | impl Copy for Foo { }
- | ^^^^
+ | ^^^
error[E0204]: the trait `Copy` may not be implemented for this type
--> $DIR/E0204.rs:7:10
@@ -19,13 +19,13 @@ 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
- --> $DIR/E0204.rs:17:6
+ --> $DIR/E0204.rs:17:15
|
LL | Bar { x: Vec<u32> },
| ----------- this field does not implement `Copy`
...
LL | impl Copy for EFoo { }
- | ^^^^
+ | ^^^^
error[E0204]: the trait `Copy` may not be implemented for this type
--> $DIR/E0204.rs:19:10
diff --git a/src/test/ui/span/E0493.rs b/src/test/ui/span/E0493.rs
index ad4100205..625da25a7 100644
--- a/src/test/ui/span/E0493.rs
+++ b/src/test/ui/span/E0493.rs
@@ -15,7 +15,7 @@ impl Drop for Bar {
}
const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1;
-//~^ destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
fn main() {
}
diff --git a/src/test/ui/span/E0493.stderr b/src/test/ui/span/E0493.stderr
index 29d1b0009..9db627562 100644
--- a/src/test/ui/span/E0493.stderr
+++ b/src/test/ui/span/E0493.stderr
@@ -1,10 +1,10 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(Foo, Foo)` cannot be evaluated at compile-time
--> $DIR/E0493.rs:17:17
|
LL | const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
error: aborting due to previous error
diff --git a/src/test/ui/span/E0535.stderr b/src/test/ui/span/E0535.stderr
index f52c3f9f2..b1411bc43 100644
--- a/src/test/ui/span/E0535.stderr
+++ b/src/test/ui/span/E0535.stderr
@@ -3,6 +3,8 @@ error[E0535]: invalid argument
|
LL | #[inline(unknown)]
| ^^^^^^^
+ |
+ = help: valid inline arguments are `always` and `never`
error: aborting due to previous error
diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
index b280c8ab6..4559da91e 100644
--- a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
+++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
@@ -12,7 +12,7 @@ impl A {
trait C{async fn new(val: T) {} //~ ERROR `async fn` is not permitted in Rust 2015
//~^ ERROR functions in traits cannot be declared `async`
-//~^^ ERROR cannot find type `T` in this scope
-//~^^^ WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
+//~| ERROR cannot find type `T` in this scope
+//~| WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
//~ ERROR this file contains an unclosed delimiter
diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr
index 50de23229..df1cafdb7 100644
--- a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr
+++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr
@@ -25,16 +25,27 @@ LL | trait C{async fn new(val: T) {}
= help: pass `--edition 2021` to `rustc`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
+error[E0412]: cannot find type `T` in this scope
+ --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:27
+ |
+LL | pub struct A {}
+ | ------------ similarly named struct `A` defined here
+...
+LL | trait C{async fn new(val: T) {}
+ | ^ help: a struct with a similar name exists: `A`
+
error[E0706]: functions in traits cannot be declared `async`
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:9
|
LL | trait C{async fn new(val: T) {}
- | -----^^^^^^^^^^^^^^^^^^
+ | -----^^^^^^^^^^^^^^^
| |
| `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[E0423]: expected function, found module `crate`
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:9:5
@@ -42,15 +53,6 @@ error[E0423]: expected function, found module `crate`
LL | crate(move || {} ).await
| ^^^^^ not a function
-error[E0412]: cannot find type `T` in this scope
- --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:27
- |
-LL | pub struct A {}
- | ------------ similarly named struct `A` defined here
-...
-LL | trait C{async fn new(val: T) {}
- | ^ help: a struct with a similar name exists: `A`
-
warning: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:57
|
@@ -65,8 +67,8 @@ LL | | crate(move || {} ).await
LL | | }
| |_____^
|
- = note: requested on the command line with `-W rust-2021-incompatible-closure-captures`
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
+ = note: requested on the command line with `-W rust-2021-incompatible-closure-captures`
help: add a dummy let to cause `path` to be fully captured
|
LL | async fn create(path: impl AsRef<std::path::Path>) { let _ = &path;
diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr
index e676d7372..15179954a 100644
--- a/src/test/ui/span/issue-34264.stderr
+++ b/src/test/ui/span/issue-34264.stderr
@@ -64,7 +64,7 @@ LL | fn foo(Option<i32>, String) {}
help: remove the extra argument
|
LL | foo(Some(42), 2);
- | ~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-34264.rs:8:13
@@ -78,7 +78,7 @@ note: function defined here
--> $DIR/issue-34264.rs:3:4
|
LL | fn bar(x, y: usize) {}
- | ^^^ - --------
+ | ^^^ --------
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/issue-34264.rs:10:5
@@ -94,7 +94,7 @@ LL | fn bar(x, y: usize) {}
help: remove the extra argument
|
LL | bar(1, 2);
- | ~~~~~~~~~
+ | ~~~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/span/issue-35987.stderr b/src/test/ui/span/issue-35987.stderr
index 2bc3ff4c3..d8fddc800 100644
--- a/src/test/ui/span/issue-35987.stderr
+++ b/src/test/ui/span/issue-35987.stderr
@@ -2,7 +2,9 @@ error[E0404]: expected trait, found type parameter `Add`
--> $DIR/issue-35987.rs:5:21
|
LL | impl<T: Clone, Add> Add for Foo<T> {
- | ^^^ not a trait
+ | --- ^^^ not a trait
+ | |
+ | found this type parameter
|
help: consider importing this trait instead
|
diff --git a/src/test/ui/span/issue-36530.rs b/src/test/ui/span/issue-36530.rs
deleted file mode 100644
index 70e04bf7e..000000000
--- a/src/test/ui/span/issue-36530.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// gate-test-custom_inner_attributes
-
-#![feature(register_attr)]
-
-#![register_attr(foo)]
-
-#[foo]
-mod foo {
- #![foo] //~ ERROR custom inner attributes are unstable
-}
-
-fn main() {}
diff --git a/src/test/ui/span/issue-36530.stderr b/src/test/ui/span/issue-36530.stderr
deleted file mode 100644
index a998d7217..000000000
--- a/src/test/ui/span/issue-36530.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0658]: custom inner attributes are unstable
- --> $DIR/issue-36530.rs:9:8
- |
-LL | #![foo]
- | ^^^
- |
- = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information
- = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs
deleted file mode 100644
index eddd158ae..000000000
--- a/src/test/ui/span/issue-7575.rs
+++ /dev/null
@@ -1,75 +0,0 @@
-// Test the mechanism for warning about possible missing `self` declarations.
-trait CtxtFn {
- fn f8(self, _: usize) -> usize;
- fn f9(_: usize) -> usize;
-}
-
-trait OtherTrait {
- fn f9(_: usize) -> usize;
-}
-
-// Note: this trait is not implemented, but we can't really tell
-// whether or not an impl would match anyhow without a self
-// declaration to match against, so we wind up prisizeing it as a
-// candidate. This seems not unreasonable -- perhaps the user meant to
-// implement it, after all.
-trait UnusedTrait {
- fn f9(_: usize) -> usize;
-}
-
-impl CtxtFn for usize {
- fn f8(self, i: usize) -> usize {
- i * 4
- }
-
- fn f9(i: usize) -> usize {
- i * 4
- }
-}
-
-impl OtherTrait for usize {
- fn f9(i: usize) -> usize {
- i * 8
- }
-}
-
-struct Myisize(isize);
-
-impl Myisize {
- fn fff(i: isize) -> isize {
- i
- }
-}
-
-trait ManyImplTrait {
- fn is_str() -> bool {
- false
- }
-}
-
-impl ManyImplTrait for String {
- fn is_str() -> bool {
- true
- }
-}
-
-impl ManyImplTrait for usize {}
-impl ManyImplTrait for isize {}
-impl ManyImplTrait for char {}
-impl ManyImplTrait for Myisize {}
-
-fn no_param_bound(u: usize, m: Myisize) -> usize {
- u.f8(42) + u.f9(342) + m.fff(42)
- //~^ ERROR no method named `f9` found
- //~| ERROR no method named `fff` found
-
-
-}
-
-fn param_bound<T: ManyImplTrait>(t: T) -> bool {
- t.is_str()
- //~^ ERROR no method named `is_str` found
-}
-
-fn main() {
-}
diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr
deleted file mode 100644
index 4f30edb3f..000000000
--- a/src/test/ui/span/issue-7575.stderr
+++ /dev/null
@@ -1,82 +0,0 @@
-error[E0599]: no method named `f9` found for type `usize` in the current scope
- --> $DIR/issue-7575.rs:62:18
- |
-LL | u.f8(42) + u.f9(342) + m.fff(42)
- | ^^ this is an associated function, not a method
- |
- = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
-note: candidate #1 is defined in the trait `CtxtFn`
- --> $DIR/issue-7575.rs:4:5
- |
-LL | fn f9(_: usize) -> usize;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: candidate #2 is defined in the trait `OtherTrait`
- --> $DIR/issue-7575.rs:8:5
- |
-LL | fn f9(_: usize) -> usize;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: candidate #3 is defined in the trait `UnusedTrait`
- --> $DIR/issue-7575.rs:17:5
- |
-LL | fn f9(_: usize) -> usize;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: items from traits can only be used if the trait is implemented and in scope
- = note: the following traits define an item `f9`, perhaps you need to implement one of them:
- candidate #1: `CtxtFn`
- candidate #2: `OtherTrait`
- candidate #3: `UnusedTrait`
-help: disambiguate the associated function for candidate #1
- |
-LL | u.f8(42) + <usize as CtxtFn>::f9(u, 342) + m.fff(42)
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-help: disambiguate the associated function for candidate #2
- |
-LL | u.f8(42) + <usize as OtherTrait>::f9(u, 342) + m.fff(42)
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-help: disambiguate the associated function for candidate #3
- |
-LL | u.f8(42) + <usize as UnusedTrait>::f9(u, 342) + m.fff(42)
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-error[E0599]: no method named `fff` found for struct `Myisize` in the current scope
- --> $DIR/issue-7575.rs:62:30
- |
-LL | struct Myisize(isize);
- | -------------- method `fff` not found for this struct
-...
-LL | u.f8(42) + u.f9(342) + m.fff(42)
- | --^^^
- | | |
- | | this is an associated function, not a method
- | help: use associated function syntax instead: `Myisize::fff`
- |
- = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
-note: the candidate is defined in an impl for the type `Myisize`
- --> $DIR/issue-7575.rs:39:5
- |
-LL | fn fff(i: isize) -> isize {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0599]: no method named `is_str` found for type parameter `T` in the current scope
- --> $DIR/issue-7575.rs:70:7
- |
-LL | fn param_bound<T: ManyImplTrait>(t: T) -> bool {
- | - method `is_str` not found for this type parameter
-LL | t.is_str()
- | ^^^^^^ this is an associated function, not a method
- |
- = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
-note: the candidate is defined in the trait `ManyImplTrait`
- --> $DIR/issue-7575.rs:45:5
- |
-LL | fn is_str() -> bool {
- | ^^^^^^^^^^^^^^^^^^^
- = help: items from traits can only be used if the type parameter is bounded by the trait
-help: disambiguate the associated function for the candidate
- |
-LL | <T as ManyImplTrait>::is_str(t)
- |
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/span/lint-unused-unsafe-thir.rs b/src/test/ui/span/lint-unused-unsafe-thir.rs
index 95a537ed2..adb72c26b 100644
--- a/src/test/ui/span/lint-unused-unsafe-thir.rs
+++ b/src/test/ui/span/lint-unused-unsafe-thir.rs
@@ -22,7 +22,7 @@ fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary `unsafe` block
unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
fn bad4() { unsafe { callback(||{}) } } //~ ERROR: unnecessary `unsafe` block
-unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block
+unsafe fn bad5() { unsafe { unsf() } }
fn bad6() {
unsafe { // don't put the warning here
unsafe { //~ ERROR: unnecessary `unsafe` block
@@ -31,7 +31,7 @@ fn bad6() {
}
}
unsafe fn bad7() {
- unsafe { //~ ERROR: unnecessary `unsafe` block
+ unsafe {
unsafe { //~ ERROR: unnecessary `unsafe` block
unsf()
}
diff --git a/src/test/ui/span/lint-unused-unsafe-thir.stderr b/src/test/ui/span/lint-unused-unsafe-thir.stderr
index 6654910c5..3bcbb7597 100644
--- a/src/test/ui/span/lint-unused-unsafe-thir.stderr
+++ b/src/test/ui/span/lint-unused-unsafe-thir.stderr
@@ -31,14 +31,6 @@ LL | fn bad4() { unsafe { callback(||{}) } }
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe-thir.rs:25:20
- |
-LL | unsafe fn bad5() { unsafe { unsf() } }
- | ---------------- ^^^^^^ unnecessary `unsafe` block
- | |
- | because it's nested under this `unsafe` fn
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe-thir.rs:28:9
|
LL | unsafe { // don't put the warning here
@@ -54,13 +46,5 @@ LL | unsafe {
LL | unsafe {
| ^^^^^^ unnecessary `unsafe` block
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe-thir.rs:34:5
- |
-LL | unsafe fn bad7() {
- | ---------------- because it's nested under this `unsafe` fn
-LL | unsafe {
- | ^^^^^^ unnecessary `unsafe` block
-
-error: aborting due to 8 previous errors
+error: aborting due to 6 previous errors
diff --git a/src/test/ui/span/lint-unused-unsafe.mir.stderr b/src/test/ui/span/lint-unused-unsafe.mir.stderr
index 850550a1d..d8412908c 100644
--- a/src/test/ui/span/lint-unused-unsafe.mir.stderr
+++ b/src/test/ui/span/lint-unused-unsafe.mir.stderr
@@ -29,17 +29,6 @@ LL | fn bad4() { unsafe { callback(||{}) } }
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:30:20
- |
-LL | unsafe fn bad5() { unsafe { unsf() } }
- | ---------------- ^^^^^^ unnecessary `unsafe` block
- | |
- | because it's nested under this `unsafe` fn
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
- = note: `#[allow(unsafe_op_in_unsafe_fn)]` on by default
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:32:5
|
LL | unsafe {
@@ -52,17 +41,6 @@ LL | unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:40:9
- |
-LL | unsafe fn bad7() {
- | ---------------- because it's nested under this `unsafe` fn
-LL | unsafe {
-LL | unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:74:9
|
LL | unsafe {
@@ -273,90 +251,31 @@ LL | unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:197:13
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-LL | unsafe {
-LL | unsafe { unsf() }
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:194:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:198:13
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | unsafe { unsf() }
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:199:13
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | unsafe { unsf() }
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:205:9
- |
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-LL | unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:203:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:207:13
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-...
+LL | unsafe {
+ | ------ because it's nested under this `unsafe` block
+LL | unsf();
LL | unsafe { unsf() }
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:208:13
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | unsafe { unsf() }
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:209:13
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | unsafe { unsf() }
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:220:17
@@ -398,19 +317,12 @@ LL | unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:254:9
+ --> $DIR/lint-unused-unsafe.rs:255:13
|
-LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- | ----------------------------------------------- because it's nested under this `unsafe` fn
LL | unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:252:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ------ because it's nested under this `unsafe` block
+LL | unsafe {
+ | ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:268:13
@@ -631,90 +543,31 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:409:24
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:406:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:410:24
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:411:24
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:417:20
- |
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:415:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:419:24
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-...
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
+LL | unsf();
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:420:24
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:421:24
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:432:28
@@ -756,19 +609,12 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:466:20
+ --> $DIR/lint-unused-unsafe.rs:467:24
|
-LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- | ----------------------------------------------- because it's nested under this `unsafe` fn
LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:464:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ------ because it's nested under this `unsafe` block
+LL | let _ = || unsafe {
+ | ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:480:24
@@ -989,90 +835,31 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:622:24
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
-LL | let _ = || unsafe { let _ = || unsf(); };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:619:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:623:24
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { let _ = || unsf(); };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:624:24
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { let _ = || unsf(); };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:630:20
- |
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:628:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:632:24
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-...
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
+LL | let _ = || unsf();
LL | let _ = || unsafe { let _ = || unsf(); };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:633:24
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { let _ = || unsf(); };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:634:24
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { let _ = || unsf(); };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:645:28
@@ -1114,19 +901,12 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:679:20
+ --> $DIR/lint-unused-unsafe.rs:680:24
|
-LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- | ----------------------------------------------- because it's nested under this `unsafe` fn
LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:677:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ------ because it's nested under this `unsafe` block
+LL | let _ = || unsafe {
+ | ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:693:24
@@ -1257,90 +1037,31 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:784:28
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:781:17
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:785:28
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:786:28
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:792:24
- |
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:790:17
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:794:28
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-...
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
+LL | unsf();
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:795:28
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:796:28
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:807:32
@@ -1382,19 +1103,12 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:841:24
+ --> $DIR/lint-unused-unsafe.rs:842:28
|
-LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- | ----------------------------------------------- because it's nested under this `unsafe` fn
LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:839:17
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ------ because it's nested under this `unsafe` block
+LL | let _ = || unsafe {
+ | ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:855:28
@@ -1525,90 +1239,31 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:942:28
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:939:17
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:943:28
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:944:28
- |
-LL | unsafe fn granularity_2() {
- | ------------------------- because it's nested under this `unsafe` fn
-...
-LL | let _ = || unsafe { unsf() };
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:950:24
- |
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:948:17
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:952:28
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
-...
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
+LL | unsf();
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:953:28
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:954:28
|
-LL | unsafe fn top_level_used_2() {
- | ---------------------------- because it's nested under this `unsafe` fn
+LL | let _ = || unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = || unsafe { unsf() };
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:965:32
@@ -1650,19 +1305,12 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:999:24
+ --> $DIR/lint-unused-unsafe.rs:1000:28
|
-LL | unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- | ----------------------------------------------- because it's nested under this `unsafe` fn
LL | let _ = || unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:997:17
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ------ because it's nested under this `unsafe` block
+LL | let _ = || unsafe {
+ | ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:1013:28
@@ -1673,21 +1321,6 @@ LL | let _ = || unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:1044:9
- |
-LL | unsafe fn multiple_unsafe_op_in_unsafe_fn_allows() {
- | -------------------------------------------------- because it's nested under this `unsafe` fn
-LL | unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:1045:21
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:1059:29
|
LL | let _ = async { unsafe {
@@ -1727,86 +1360,31 @@ LL | let _ = async { unsafe {
| ^^^^^^ unnecessary `unsafe` block
error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:1074:33
- |
-LL | async unsafe fn async_blocks() {
- | ------------------------------ because it's nested under this `unsafe` fn
-...
-LL | let _ = async { unsafe { let _ = async { unsf() }; }};
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/lint-unused-unsafe.rs:1071:17
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:1075:33
- |
-LL | async unsafe fn async_blocks() {
- | ------------------------------ because it's nested under this `unsafe` fn
-...
-LL | let _ = async { unsafe { let _ = async { unsf() }; }};
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:1076:33
- |
-LL | async unsafe fn async_blocks() {
- | ------------------------------ because it's nested under this `unsafe` fn
-...
-LL | let _ = async { unsafe { let _ = async { unsf() }; }};
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
- --> $DIR/lint-unused-unsafe.rs:1078:29
- |
-LL | async unsafe fn async_blocks() {
- | ------------------------------ because it's nested under this `unsafe` fn
-...
-LL | let _ = async { unsafe {
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-
-error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:1080:33
|
-LL | async unsafe fn async_blocks() {
- | ------------------------------ because it's nested under this `unsafe` fn
-...
+LL | let _ = async { unsafe {
+ | ------ because it's nested under this `unsafe` block
+LL | let _ = async { unsf() };
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:1081:33
|
-LL | async unsafe fn async_blocks() {
- | ------------------------------ because it's nested under this `unsafe` fn
+LL | let _ = async { unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:1082:33
|
-LL | async unsafe fn async_blocks() {
- | ------------------------------ because it's nested under this `unsafe` fn
+LL | let _ = async { unsafe {
+ | ------ because it's nested under this `unsafe` block
...
LL | let _ = async { unsafe { let _ = async { unsf() }; }};
| ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
error: unnecessary `unsafe` block
--> $DIR/lint-unused-unsafe.rs:1092:22
@@ -1820,5 +1398,5 @@ error: unnecessary `unsafe` block
LL | let _x: [(); unsafe { unsafe { size() } }] = [];
| ^^^^^^ unnecessary `unsafe` block
-error: aborting due to 201 previous errors
+error: aborting due to 174 previous errors
diff --git a/src/test/ui/span/lint-unused-unsafe.rs b/src/test/ui/span/lint-unused-unsafe.rs
index f8d1dff35..5d042768b 100644
--- a/src/test/ui/span/lint-unused-unsafe.rs
+++ b/src/test/ui/span/lint-unused-unsafe.rs
@@ -27,7 +27,7 @@ fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
fn bad2() { unsafe { bad1() } } //~ ERROR: unnecessary `unsafe` block
unsafe fn bad3() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
fn bad4() { unsafe { callback(||{}) } } //~ ERROR: unnecessary `unsafe` block
-unsafe fn bad5() { unsafe { unsf() } } //~ ERROR: unnecessary `unsafe` block
+unsafe fn bad5() { unsafe { unsf() } }
fn bad6() {
unsafe { //~ ERROR: unnecessary `unsafe` block
unsafe { // don't put the warning here
@@ -37,7 +37,7 @@ fn bad6() {
}
unsafe fn bad7() {
unsafe { //~ ERROR: unnecessary `unsafe` block
- unsafe { //~ ERROR: unnecessary `unsafe` block
+ unsafe {
unsf()
}
}
@@ -194,15 +194,15 @@ mod additional_tests {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granularity_2() {
unsafe { //~ ERROR: unnecessary `unsafe` block
- unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block
- unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block
- unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block
+ unsafe { unsf() }
+ unsafe { unsf() }
+ unsafe { unsf() }
}
}
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn top_level_used_2() {
- unsafe { //~ ERROR: unnecessary `unsafe` block
+ unsafe {
unsf();
unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block
unsafe { unsf() } //~ ERROR: unnecessary `unsafe` block
@@ -251,8 +251,8 @@ mod additional_tests {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- unsafe { //~ ERROR: unnecessary `unsafe` block
- unsafe {
+ unsafe {
+ unsafe { //~ ERROR: unnecessary `unsafe` block
#[deny(unsafe_op_in_unsafe_fn)]
{
unsf();
@@ -406,15 +406,15 @@ mod additional_tests_closures {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granularity_2() {
let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe { unsf() };
+ let _ = || unsafe { unsf() };
+ let _ = || unsafe { unsf() };
};
}
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn top_level_used_2() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe {
unsf();
let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
@@ -463,8 +463,8 @@ mod additional_tests_closures {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe {
+ let _ = || unsafe {
+ let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
#[deny(unsafe_op_in_unsafe_fn)]
{
unsf();
@@ -619,15 +619,15 @@ mod additional_tests_even_more_closures {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granularity_2() {
let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe { let _ = || unsf(); };
+ let _ = || unsafe { let _ = || unsf(); };
+ let _ = || unsafe { let _ = || unsf(); };
};
}
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn top_level_used_2() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe {
let _ = || unsf();
let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block
let _ = || unsafe { let _ = || unsf(); }; //~ ERROR: unnecessary `unsafe` block
@@ -676,8 +676,8 @@ mod additional_tests_even_more_closures {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe {
+ let _ = || unsafe {
+ let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
#[deny(unsafe_op_in_unsafe_fn)]
{
let _ = || unsf();
@@ -781,15 +781,15 @@ mod item_likes {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granularity_2() {
let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe { unsf() };
+ let _ = || unsafe { unsf() };
+ let _ = || unsafe { unsf() };
};
}
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn top_level_used_2() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe {
unsf();
let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
@@ -838,8 +838,8 @@ mod item_likes {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe {
+ let _ = || unsafe {
+ let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
#[deny(unsafe_op_in_unsafe_fn)]
{
unsf();
@@ -939,15 +939,15 @@ mod item_likes {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granularity_2() {
let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe { unsf() };
+ let _ = || unsafe { unsf() };
+ let _ = || unsafe { unsf() };
};
}
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn top_level_used_2() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
+ let _ = || unsafe {
unsf();
let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
let _ = || unsafe { unsf() }; //~ ERROR: unnecessary `unsafe` block
@@ -996,8 +996,8 @@ mod item_likes {
#[allow(unsafe_op_in_unsafe_fn)]
unsafe fn granular_disallow_op_in_unsafe_fn_3() {
- let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = || unsafe {
+ let _ = || unsafe {
+ let _ = || unsafe { //~ ERROR: unnecessary `unsafe` block
#[deny(unsafe_op_in_unsafe_fn)]
{
unsf();
@@ -1041,7 +1041,7 @@ mod additional_tests_extra {
#[warn(unsafe_op_in_unsafe_fn)]
unsafe fn multiple_unsafe_op_in_unsafe_fn_allows() {
- unsafe { //~ ERROR: unnecessary `unsafe` block
+ unsafe {
#[allow(unsafe_op_in_unsafe_fn)]
{
unsf();
@@ -1071,11 +1071,11 @@ mod additional_tests_extra {
#[allow(unsafe_op_in_unsafe_fn)]
{
let _ = async { unsafe { //~ ERROR: unnecessary `unsafe` block
- let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block
- let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block
- let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block
+ let _ = async { unsafe { let _ = async { unsf() }; }};
+ let _ = async { unsafe { let _ = async { unsf() }; }};
+ let _ = async { unsafe { let _ = async { unsf() }; }};
}};
- let _ = async { unsafe { //~ ERROR: unnecessary `unsafe` block
+ let _ = async { unsafe {
let _ = async { unsf() };
let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block
let _ = async { unsafe { let _ = async { unsf() }; }}; //~ ERROR: unnecessary `unsafe` block
diff --git a/src/test/ui/span/missing-unit-argument.stderr b/src/test/ui/span/missing-unit-argument.stderr
index e68260e4a..b76a3ab30 100644
--- a/src/test/ui/span/missing-unit-argument.stderr
+++ b/src/test/ui/span/missing-unit-argument.stderr
@@ -12,7 +12,7 @@ LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
help: provide the argument
|
LL | let _: Result<(), String> = Ok(());
- | ~~~~~~
+ | ~~~~
error[E0061]: this function takes 2 arguments but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:12:5
@@ -28,7 +28,7 @@ LL | fn foo(():(), ():()) {}
help: provide the arguments
|
LL | foo((), ());
- | ~~~~~~~~~~~
+ | ~~~~~~~~
error[E0061]: this function takes 2 arguments but 1 argument was supplied
--> $DIR/missing-unit-argument.rs:13:5
@@ -44,7 +44,7 @@ LL | fn foo(():(), ():()) {}
help: provide the argument
|
LL | foo((), ());
- | ~~~~~~~~~~~
+ | ~~~~~~~~
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:14:5
@@ -60,7 +60,7 @@ LL | fn bar(():()) {}
help: provide the argument
|
LL | bar(());
- | ~~~~~~~
+ | ~~~~
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:15:7
@@ -72,11 +72,11 @@ note: associated function defined here
--> $DIR/missing-unit-argument.rs:6:8
|
LL | fn baz(self, (): ()) { }
- | ^^^ ---- ------
+ | ^^^ ------
help: provide the argument
|
LL | S.baz(());
- | ~~~~~~~
+ | ~~~~
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:16:7
@@ -88,11 +88,11 @@ note: associated function defined here
--> $DIR/missing-unit-argument.rs:7:8
|
LL | fn generic<T>(self, _: T) { }
- | ^^^^^^^ ---- ----
+ | ^^^^^^^ ----
help: provide the argument
|
LL | S.generic::<()>(());
- | ~~~~~~~~~~~~~~~~~
+ | ~~~~
error: aborting due to 6 previous errors
diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr
index 79b13f45f..fc2f6e662 100644
--- a/src/test/ui/span/multiline-span-E0072.stderr
+++ b/src/test/ui/span/multiline-span-E0072.stderr
@@ -3,12 +3,12 @@ error[E0072]: recursive type `ListNode` has infinite size
|
LL | / struct
LL | | ListNode
- | |________^ recursive type has infinite size
+ | |________^
...
LL | tail: Option<ListNode>,
- | ---------------- recursive without indirection
+ | -------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | tail: Option<Box<ListNode>>,
| ++++ +
diff --git a/src/test/ui/span/recursive-type-field.rs b/src/test/ui/span/recursive-type-field.rs
index 58ea81b83..bd4c43534 100644
--- a/src/test/ui/span/recursive-type-field.rs
+++ b/src/test/ui/span/recursive-type-field.rs
@@ -1,11 +1,11 @@
use std::rc::Rc;
-struct Foo<'a> { //~ ERROR recursive type
+struct Foo<'a> { //~ ERROR recursive types `Foo` and `Bar` have infinite size
bar: Bar<'a>,
b: Rc<Bar<'a>>,
}
-struct Bar<'a> { //~ ERROR recursive type
+struct Bar<'a> {
y: (Foo<'a>, Foo<'a>),
z: Option<Bar<'a>>,
a: &'a Foo<'a>,
diff --git a/src/test/ui/span/recursive-type-field.stderr b/src/test/ui/span/recursive-type-field.stderr
index 08e97e750..10af4c36b 100644
--- a/src/test/ui/span/recursive-type-field.stderr
+++ b/src/test/ui/span/recursive-type-field.stderr
@@ -1,35 +1,27 @@
-error[E0072]: recursive type `Foo` has infinite size
+error[E0072]: recursive types `Foo` and `Bar` have infinite size
--> $DIR/recursive-type-field.rs:3:1
|
LL | struct Foo<'a> {
- | ^^^^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^^^^
LL | bar: Bar<'a>,
| ------- recursive without indirection
+...
+LL | struct Bar<'a> {
+ | ^^^^^^^^^^^^^^
+LL | y: (Foo<'a>, Foo<'a>),
+ | ------- ------- recursive without indirection
+ | |
+ | recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
- |
-LL | bar: Box<Bar<'a>>,
- | ++++ +
-
-error[E0072]: recursive type `Bar` has infinite size
- --> $DIR/recursive-type-field.rs:8:1
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
+LL ~ bar: Box<Bar<'a>>,
+LL | b: Rc<Bar<'a>>,
+ ...
LL | struct Bar<'a> {
- | ^^^^^^^^^^^^^^ recursive type has infinite size
-LL | y: (Foo<'a>, Foo<'a>),
- | ------------------ recursive without indirection
-LL | z: Option<Bar<'a>>,
- | --------------- recursive without indirection
-...
-LL | d: [Bar<'a>; 1],
- | ------------ recursive without indirection
-LL | e: Foo<'a>,
- | ------- recursive without indirection
-LL | x: Bar<'a>,
- | ------- recursive without indirection
+LL ~ y: (Box<Foo<'a>>, Box<Foo<'a>>),
|
- = help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/specialization/assoc-ty-graph-cycle.stderr b/src/test/ui/specialization/assoc-ty-graph-cycle.stderr
index 17da34caa..f5529c24d 100644
--- a/src/test/ui/specialization/assoc-ty-graph-cycle.stderr
+++ b/src/test/ui/specialization/assoc-ty-graph-cycle.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/const_trait_impl.rs b/src/test/ui/specialization/const_trait_impl.rs
new file mode 100644
index 000000000..05ba4c8d4
--- /dev/null
+++ b/src/test/ui/specialization/const_trait_impl.rs
@@ -0,0 +1,55 @@
+// check-pass
+#![feature(const_trait_impl, min_specialization, rustc_attrs)]
+
+#[rustc_specialization_trait]
+#[const_trait]
+pub unsafe trait Sup {
+ fn foo() -> u32;
+}
+
+#[rustc_specialization_trait]
+#[const_trait]
+pub unsafe trait Sub: ~const Sup {}
+
+unsafe impl const Sup for u8 {
+ default fn foo() -> u32 {
+ 1
+ }
+}
+
+unsafe impl const Sup for () {
+ fn foo() -> u32 {
+ 42
+ }
+}
+
+unsafe impl const Sub for () {}
+
+#[const_trait]
+pub trait A {
+ fn a() -> u32;
+}
+
+impl<T: ~const Default> const A for T {
+ default fn a() -> u32 {
+ 2
+ }
+}
+
+impl<T: ~const Default + ~const Sup> const A for T {
+ default fn a() -> u32 {
+ 3
+ }
+}
+
+impl<T: ~const Default + ~const Sub> const A for T {
+ fn a() -> u32 {
+ T::foo()
+ }
+}
+
+const _: () = assert!(<()>::a() == 42);
+const _: () = assert!(<u8>::a() == 3);
+const _: () = assert!(<u16>::a() == 2);
+
+fn main() {}
diff --git a/src/test/ui/specialization/cross-crate-defaults.stderr b/src/test/ui/specialization/cross-crate-defaults.stderr
index e368c2e73..ee5c77a76 100644
--- a/src/test/ui/specialization/cross-crate-defaults.stderr
+++ b/src/test/ui/specialization/cross-crate-defaults.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/default-associated-type-bound-1.stderr b/src/test/ui/specialization/default-associated-type-bound-1.stderr
index af9f2f7c2..e498187c0 100644
--- a/src/test/ui/specialization/default-associated-type-bound-1.stderr
+++ b/src/test/ui/specialization/default-associated-type-bound-1.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/default-associated-type-bound-1.rs:18:22
diff --git a/src/test/ui/specialization/default-associated-type-bound-2.stderr b/src/test/ui/specialization/default-associated-type-bound-2.stderr
index 91778ed0f..4dbe251ed 100644
--- a/src/test/ui/specialization/default-associated-type-bound-2.stderr
+++ b/src/test/ui/specialization/default-associated-type-bound-2.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0277]: can't compare `&'static B` with `B`
--> $DIR/default-associated-type-bound-2.rs:16:22
diff --git a/src/test/ui/specialization/default-generic-associated-type-bound.rs b/src/test/ui/specialization/default-generic-associated-type-bound.rs
index 0f5714e99..31a0685d0 100644
--- a/src/test/ui/specialization/default-generic-associated-type-bound.rs
+++ b/src/test/ui/specialization/default-generic-associated-type-bound.rs
@@ -1,8 +1,7 @@
// Check that default generics associated types are validated.
#![feature(specialization)]
-#![feature(generic_associated_types)]
-//~^^ WARNING `specialization` is incomplete
+//~^ WARNING `specialization` is incomplete
trait X {
type U<'a>: PartialEq<&'a Self> where Self: 'a;
diff --git a/src/test/ui/specialization/default-generic-associated-type-bound.stderr b/src/test/ui/specialization/default-generic-associated-type-bound.stderr
index 58c6667c8..c597eed37 100644
--- a/src/test/ui/specialization/default-generic-associated-type-bound.stderr
+++ b/src/test/ui/specialization/default-generic-associated-type-bound.stderr
@@ -4,19 +4,19 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0277]: can't compare `T` with `T`
- --> $DIR/default-generic-associated-type-bound.rs:18:26
+ --> $DIR/default-generic-associated-type-bound.rs:17:26
|
LL | default type U<'a> = &'a T;
| ^^^^^ no implementation for `T == T`
|
- = note: required because of the requirements on the impl of `PartialEq` for `&'a T`
+ = note: required for `&'a T` to implement `PartialEq`
note: required by a bound in `X::U`
- --> $DIR/default-generic-associated-type-bound.rs:8:17
+ --> $DIR/default-generic-associated-type-bound.rs:7:17
|
LL | type U<'a>: PartialEq<&'a Self> where Self: 'a;
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `X::U`
diff --git a/src/test/ui/specialization/defaultimpl/allowed-cross-crate.stderr b/src/test/ui/specialization/defaultimpl/allowed-cross-crate.stderr
index d8b9c48c7..02f13d461 100644
--- a/src/test/ui/specialization/defaultimpl/allowed-cross-crate.stderr
+++ b/src/test/ui/specialization/defaultimpl/allowed-cross-crate.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/defaultimpl/out-of-order.stderr b/src/test/ui/specialization/defaultimpl/out-of-order.stderr
index 9ca915686..2cf1ac909 100644
--- a/src/test/ui/specialization/defaultimpl/out-of-order.stderr
+++ b/src/test/ui/specialization/defaultimpl/out-of-order.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/defaultimpl/overlap-projection.stderr b/src/test/ui/specialization/defaultimpl/overlap-projection.stderr
index 31d0e6e38..75fdfafd9 100644
--- a/src/test/ui/specialization/defaultimpl/overlap-projection.stderr
+++ b/src/test/ui/specialization/defaultimpl/overlap-projection.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/defaultimpl/projection.stderr b/src/test/ui/specialization/defaultimpl/projection.stderr
index 2d5c80d05..cc3fe8237 100644
--- a/src/test/ui/specialization/defaultimpl/projection.stderr
+++ b/src/test/ui/specialization/defaultimpl/projection.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr b/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr
index 360b7bc78..770be2af2 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:20:5
diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented-rpass.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented-rpass.stderr
index 163c93550..407c1ab77 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented-rpass.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented-rpass.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr
index 250f0017b..f19975060 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0046]: not all trait items implemented, missing: `foo_two`
--> $DIR/specialization-trait-item-not-implemented.rs:18:1
diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr
index d1004a690..33ca7a2c2 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0599]: the method `foo_one` exists for struct `MyStruct`, but its trait bounds were not satisfied
--> $DIR/specialization-trait-not-implemented.rs:22:29
diff --git a/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr b/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr
index a8fdbc528..e78016034 100644
--- a/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr
+++ b/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0277]: the trait bound `U: Eq` is not satisfied
--> $DIR/specialization-wfcheck.rs:7:17
diff --git a/src/test/ui/specialization/defaultimpl/validation.stderr b/src/test/ui/specialization/defaultimpl/validation.stderr
index cbf0cef5e..eb6dc9355 100644
--- a/src/test/ui/specialization/defaultimpl/validation.stderr
+++ b/src/test/ui/specialization/defaultimpl/validation.stderr
@@ -14,9 +14,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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: impls of auto traits cannot be default
--> $DIR/validation.rs:9:21
diff --git a/src/test/ui/specialization/issue-33017.rs b/src/test/ui/specialization/issue-33017.rs
index 4d19230df..8dbadf58d 100644
--- a/src/test/ui/specialization/issue-33017.rs
+++ b/src/test/ui/specialization/issue-33017.rs
@@ -1,4 +1,4 @@
-// Test to ensure that trait bounds are propertly
+// Test to ensure that trait bounds are properly
// checked on specializable associated types
#![allow(incomplete_features)]
diff --git a/src/test/ui/specialization/issue-35376.stderr b/src/test/ui/specialization/issue-35376.stderr
index 835277d40..6c4167f3f 100644
--- a/src/test/ui/specialization/issue-35376.stderr
+++ b/src/test/ui/specialization/issue-35376.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/issue-36804.stderr b/src/test/ui/specialization/issue-36804.stderr
index 783a38e6b..c2113b25f 100644
--- a/src/test/ui/specialization/issue-36804.stderr
+++ b/src/test/ui/specialization/issue-36804.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/issue-38091-2.stderr b/src/test/ui/specialization/issue-38091-2.stderr
index a93f27ff0..117fb10bb 100644
--- a/src/test/ui/specialization/issue-38091-2.stderr
+++ b/src/test/ui/specialization/issue-38091-2.stderr
@@ -4,13 +4,13 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0275]: overflow evaluating the requirement `i32: Check`
|
-note: required because of the requirements on the impl of `Iterate` for `i32`
+note: required for `i32` to implement `Iterate<'_>`
--> $DIR/issue-38091-2.rs:11:13
|
LL | impl<'a, T> Iterate<'a> for T
diff --git a/src/test/ui/specialization/issue-38091.stderr b/src/test/ui/specialization/issue-38091.stderr
index cc5536c9e..f2210a407 100644
--- a/src/test/ui/specialization/issue-38091.stderr
+++ b/src/test/ui/specialization/issue-38091.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0277]: the trait bound `(): Valid` is not satisfied
--> $DIR/issue-38091.rs:12:23
diff --git a/src/test/ui/specialization/issue-39448.stderr b/src/test/ui/specialization/issue-39448.stderr
index c4fc44c73..60157d9a3 100644
--- a/src/test/ui/specialization/issue-39448.stderr
+++ b/src/test/ui/specialization/issue-39448.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0275]: overflow evaluating the requirement `T: FromA<U>`
--> $DIR/issue-39448.rs:45:13
@@ -14,12 +14,12 @@ error[E0275]: overflow evaluating the requirement `T: FromA<U>`
LL | x.foo(y.to()).to()
| ^^
|
-note: required because of the requirements on the impl of `FromA<U>` for `T`
+note: required for `T` to implement `FromA<U>`
--> $DIR/issue-39448.rs:24:29
|
LL | impl<T: A, U: A + FromA<T>> FromA<T> for U {
| ^^^^^^^^ ^
-note: required because of the requirements on the impl of `ToA<T>` for `U`
+note: required for `U` to implement `ToA<T>`
--> $DIR/issue-39448.rs:34:12
|
LL | impl<T, U> ToA<U> for T
diff --git a/src/test/ui/specialization/issue-39618.stderr b/src/test/ui/specialization/issue-39618.stderr
index 77a45806e..19de60c7c 100644
--- a/src/test/ui/specialization/issue-39618.stderr
+++ b/src/test/ui/specialization/issue-39618.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/issue-45814.stderr b/src/test/ui/specialization/issue-45814.stderr
index ab6adf477..419345add 100644
--- a/src/test/ui/specialization/issue-45814.stderr
+++ b/src/test/ui/specialization/issue-45814.stderr
@@ -1,13 +1,13 @@
error[E0275]: overflow evaluating the requirement `T: Trait<_>`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_45814`)
-note: required because of the requirements on the impl of `Trait<_>` for `T`
+note: required for `T` to implement `Trait<_>`
--> $DIR/issue-45814.rs:8:20
|
LL | default impl<T, U> Trait<T> for U {}
| ^^^^^^^^ ^
= note: 128 redundant requirements hidden
- = note: required because of the requirements on the impl of `Trait<_>` for `T`
+ = note: required for `T` to implement `Trait<_>`
error: aborting due to previous error
diff --git a/src/test/ui/specialization/issue-50452-fail.stderr b/src/test/ui/specialization/issue-50452-fail.stderr
index 7249ad738..5c136adc4 100644
--- a/src/test/ui/specialization/issue-50452-fail.stderr
+++ b/src/test/ui/specialization/issue-50452-fail.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/issue-50452-fail.rs:10:5
diff --git a/src/test/ui/specialization/issue-50452.stderr b/src/test/ui/specialization/issue-50452.stderr
index 2f05c4134..48cab9dcd 100644
--- a/src/test/ui/specialization/issue-50452.stderr
+++ b/src/test/ui/specialization/issue-50452.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/issue-52050.stderr b/src/test/ui/specialization/issue-52050.stderr
index 6d24997a5..c263fe467 100644
--- a/src/test/ui/specialization/issue-52050.stderr
+++ b/src/test/ui/specialization/issue-52050.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()`
--> $DIR/issue-52050.rs:28:1
diff --git a/src/test/ui/specialization/issue-63716-parse-async.stderr b/src/test/ui/specialization/issue-63716-parse-async.stderr
index cde17872d..a00572da8 100644
--- a/src/test/ui/specialization/issue-63716-parse-async.stderr
+++ b/src/test/ui/specialization/issue-63716-parse-async.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/issue-70442.stderr b/src/test/ui/specialization/issue-70442.stderr
index 5ee82e991..aa72c3286 100644
--- a/src/test/ui/specialization/issue-70442.stderr
+++ b/src/test/ui/specialization/issue-70442.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/min_specialization/issue-79224.stderr b/src/test/ui/specialization/min_specialization/issue-79224.stderr
index cfb9007c7..fd34a59d2 100644
--- a/src/test/ui/specialization/min_specialization/issue-79224.stderr
+++ b/src/test/ui/specialization/min_specialization/issue-79224.stderr
@@ -1,22 +1,28 @@
error[E0277]: the trait bound `B: Clone` is not satisfied
- --> $DIR/issue-79224.rs:18:17
+ --> $DIR/issue-79224.rs:18:1
|
-LL | impl<B: ?Sized> Display for Cow<'_, B> {
- | ^^^^^^^ the trait `Clone` is not implemented for `B`
+LL | / impl<B: ?Sized> Display for Cow<'_, B> {
+LL | | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+LL | | write!(f, "foo")
+LL | | }
+LL | | }
+ | |_^ the trait `Clone` is not implemented for `B`
|
- = note: required because of the requirements on the impl of `ToOwned` for `B`
+ = note: required for `B` to implement `ToOwned`
help: consider further restricting this bound
|
LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
| +++++++++++++++++++
error[E0277]: the trait bound `B: Clone` is not satisfied
- --> $DIR/issue-79224.rs:19:12
+ --> $DIR/issue-79224.rs:19:5
|
-LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
- | ^^^^^ the trait `Clone` is not implemented for `B`
+LL | / fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+LL | | write!(f, "foo")
+LL | | }
+ | |_____^ the trait `Clone` is not implemented for `B`
|
- = note: required because of the requirements on the impl of `ToOwned` for `B`
+ = note: required for `B` to implement `ToOwned`
help: consider further restricting this bound
|
LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
diff --git a/src/test/ui/specialization/non-defaulted-item-fail.stderr b/src/test/ui/specialization/non-defaulted-item-fail.stderr
index 8b7d67972..faa14555a 100644
--- a/src/test/ui/specialization/non-defaulted-item-fail.stderr
+++ b/src/test/ui/specialization/non-defaulted-item-fail.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization, associated_type_defaults)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0520]: `Ty` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/non-defaulted-item-fail.rs:30:5
diff --git a/src/test/ui/specialization/specialization-allowed-cross-crate.stderr b/src/test/ui/specialization/specialization-allowed-cross-crate.stderr
index 9605bd089..3eea4a53b 100644
--- a/src/test/ui/specialization/specialization-allowed-cross-crate.stderr
+++ b/src/test/ui/specialization/specialization-allowed-cross-crate.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-assoc-fns.stderr b/src/test/ui/specialization/specialization-assoc-fns.stderr
index a7c0661a8..69f7cece7 100644
--- a/src/test/ui/specialization/specialization-assoc-fns.stderr
+++ b/src/test/ui/specialization/specialization-assoc-fns.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-basics.stderr b/src/test/ui/specialization/specialization-basics.stderr
index afb2af380..7714d4af4 100644
--- a/src/test/ui/specialization/specialization-basics.stderr
+++ b/src/test/ui/specialization/specialization-basics.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-cross-crate.stderr b/src/test/ui/specialization/specialization-cross-crate.stderr
index c69130c0a..06818bb56 100644
--- a/src/test/ui/specialization/specialization-cross-crate.stderr
+++ b/src/test/ui/specialization/specialization-cross-crate.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-default-methods.stderr b/src/test/ui/specialization/specialization-default-methods.stderr
index ef6365ed3..d78d30bd8 100644
--- a/src/test/ui/specialization/specialization-default-methods.stderr
+++ b/src/test/ui/specialization/specialization-default-methods.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-default-projection.stderr b/src/test/ui/specialization/specialization-default-projection.stderr
index 7a2b75a1c..b8b81876d 100644
--- a/src/test/ui/specialization/specialization-default-projection.stderr
+++ b/src/test/ui/specialization/specialization-default-projection.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0308]: mismatched types
--> $DIR/specialization-default-projection.rs:21:5
diff --git a/src/test/ui/specialization/specialization-default-types.stderr b/src/test/ui/specialization/specialization-default-types.stderr
index 5ba38face..61a556a93 100644
--- a/src/test/ui/specialization/specialization-default-types.stderr
+++ b/src/test/ui/specialization/specialization-default-types.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0308]: mismatched types
--> $DIR/specialization-default-types.rs:15:9
diff --git a/src/test/ui/specialization/specialization-no-default.stderr b/src/test/ui/specialization/specialization-no-default.stderr
index 28c869a70..842cec9c7 100644
--- a/src/test/ui/specialization/specialization-no-default.stderr
+++ b/src/test/ui/specialization/specialization-no-default.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:20:5
diff --git a/src/test/ui/specialization/specialization-on-projection.stderr b/src/test/ui/specialization/specialization-on-projection.stderr
index d051ffe0a..00fc7ffc5 100644
--- a/src/test/ui/specialization/specialization-on-projection.stderr
+++ b/src/test/ui/specialization/specialization-on-projection.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-out-of-order.stderr b/src/test/ui/specialization/specialization-out-of-order.stderr
index 785ec2923..b524e00f0 100644
--- a/src/test/ui/specialization/specialization-out-of-order.stderr
+++ b/src/test/ui/specialization/specialization-out-of-order.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-overlap-negative.stderr b/src/test/ui/specialization/specialization-overlap-negative.stderr
index 552b04a60..fb3d9723a 100644
--- a/src/test/ui/specialization/specialization-overlap-negative.stderr
+++ b/src/test/ui/specialization/specialization-overlap-negative.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0751]: found both positive and negative implementation of trait `std::marker::Send` for type `TestType<_>`:
--> $DIR/specialization-overlap-negative.rs:9:1
diff --git a/src/test/ui/specialization/specialization-overlap-projection.stderr b/src/test/ui/specialization/specialization-overlap-projection.stderr
index c92db7307..708c0817f 100644
--- a/src/test/ui/specialization/specialization-overlap-projection.stderr
+++ b/src/test/ui/specialization/specialization-overlap-projection.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-overlap.stderr b/src/test/ui/specialization/specialization-overlap.stderr
index 3ccbe1616..989264467 100644
--- a/src/test/ui/specialization/specialization-overlap.stderr
+++ b/src/test/ui/specialization/specialization-overlap.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>`
--> $DIR/specialization-overlap.rs:5:1
diff --git a/src/test/ui/specialization/specialization-polarity.stderr b/src/test/ui/specialization/specialization-polarity.stderr
index be013552f..f287018ba 100644
--- a/src/test/ui/specialization/specialization-polarity.stderr
+++ b/src/test/ui/specialization/specialization-polarity.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0751]: found both positive and negative implementation of trait `Foo` for type `u8`:
--> $DIR/specialization-polarity.rs:10:1
diff --git a/src/test/ui/specialization/specialization-projection-alias.stderr b/src/test/ui/specialization/specialization-projection-alias.stderr
index 6d2bca5d2..c94d9ed07 100644
--- a/src/test/ui/specialization/specialization-projection-alias.stderr
+++ b/src/test/ui/specialization/specialization-projection-alias.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-projection.stderr b/src/test/ui/specialization/specialization-projection.stderr
index 0f1ecf5e3..bfc4e0a0f 100644
--- a/src/test/ui/specialization/specialization-projection.stderr
+++ b/src/test/ui/specialization/specialization-projection.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-supertraits.stderr b/src/test/ui/specialization/specialization-supertraits.stderr
index d32e47a24..e716bc215 100644
--- a/src/test/ui/specialization/specialization-supertraits.stderr
+++ b/src/test/ui/specialization/specialization-supertraits.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-translate-projections-with-lifetimes.stderr b/src/test/ui/specialization/specialization-translate-projections-with-lifetimes.stderr
index d30f7af2c..c7aad3c0f 100644
--- a/src/test/ui/specialization/specialization-translate-projections-with-lifetimes.stderr
+++ b/src/test/ui/specialization/specialization-translate-projections-with-lifetimes.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-translate-projections-with-params.stderr b/src/test/ui/specialization/specialization-translate-projections-with-params.stderr
index 1762248f6..1c4fd9325 100644
--- a/src/test/ui/specialization/specialization-translate-projections-with-params.stderr
+++ b/src/test/ui/specialization/specialization-translate-projections-with-params.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/specialization-translate-projections.stderr b/src/test/ui/specialization/specialization-translate-projections.stderr
index 94a0e79dd..22bbb12a0 100644
--- a/src/test/ui/specialization/specialization-translate-projections.stderr
+++ b/src/test/ui/specialization/specialization-translate-projections.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/specialization/transmute-specialization.stderr b/src/test/ui/specialization/transmute-specialization.stderr
index a0ea72415..b1c26d7da 100644
--- a/src/test/ui/specialization/transmute-specialization.stderr
+++ b/src/test/ui/specialization/transmute-specialization.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/stability-attribute/auxiliary/ctor-stability.rs b/src/test/ui/stability-attribute/auxiliary/ctor-stability.rs
new file mode 100644
index 000000000..74c6023d7
--- /dev/null
+++ b/src/test/ui/stability-attribute/auxiliary/ctor-stability.rs
@@ -0,0 +1,8 @@
+#![crate_type = "lib"]
+#![feature(staged_api)]
+#![stable(feature = "none", since = "1.0")]
+
+#[stable(feature = "none", since = "1.0")]
+pub enum Foo {
+ A,
+}
diff --git a/src/test/ui/stability-attribute/auxiliary/default_body.rs b/src/test/ui/stability-attribute/auxiliary/default_body.rs
new file mode 100644
index 000000000..3a177419d
--- /dev/null
+++ b/src/test/ui/stability-attribute/auxiliary/default_body.rs
@@ -0,0 +1,29 @@
+#![crate_type = "lib"]
+#![feature(staged_api, rustc_attrs)]
+#![stable(feature = "stable_feature", since = "1.0.0")]
+
+#[stable(feature = "stable_feature", since = "1.0.0")]
+pub trait JustTrait {
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ #[rustc_default_body_unstable(feature = "constant_default_body", issue = "none")]
+ const CONSTANT: usize = 0;
+
+ #[rustc_default_body_unstable(feature = "fun_default_body", issue = "none")]
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ fn fun() {}
+}
+
+#[rustc_must_implement_one_of(eq, neq)]
+#[stable(feature = "stable_feature", since = "1.0.0")]
+pub trait Equal {
+ #[rustc_default_body_unstable(feature = "eq_default_body", issue = "none")]
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ fn eq(&self, other: &Self) -> bool {
+ !self.neq(other)
+ }
+
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ fn neq(&self, other: &Self) -> bool {
+ !self.eq(other)
+ }
+}
diff --git a/src/test/ui/stability-attribute/ctor-stability.rs b/src/test/ui/stability-attribute/ctor-stability.rs
new file mode 100644
index 000000000..fcab0cb10
--- /dev/null
+++ b/src/test/ui/stability-attribute/ctor-stability.rs
@@ -0,0 +1,8 @@
+// aux-build:ctor-stability.rs
+// check-pass
+
+extern crate ctor_stability;
+
+fn main() {
+ let _ = ctor_stability::Foo::A;
+}
diff --git a/src/test/ui/stability-attribute/default-body-stability-err.rs b/src/test/ui/stability-attribute/default-body-stability-err.rs
new file mode 100644
index 000000000..ecb281bcc
--- /dev/null
+++ b/src/test/ui/stability-attribute/default-body-stability-err.rs
@@ -0,0 +1,19 @@
+// aux-build:default_body.rs
+#![crate_type = "lib"]
+
+extern crate default_body;
+
+use default_body::{Equal, JustTrait};
+
+struct Type;
+
+impl JustTrait for Type {}
+//~^ ERROR not all trait items implemented, missing: `CONSTANT` [E0046]
+//~| ERROR not all trait items implemented, missing: `fun` [E0046]
+
+impl Equal for Type {
+ //~^ ERROR not all trait items implemented, missing: `eq` [E0046]
+ fn neq(&self, other: &Self) -> bool {
+ false
+ }
+}
diff --git a/src/test/ui/stability-attribute/default-body-stability-err.stderr b/src/test/ui/stability-attribute/default-body-stability-err.stderr
new file mode 100644
index 000000000..ef666f30f
--- /dev/null
+++ b/src/test/ui/stability-attribute/default-body-stability-err.stderr
@@ -0,0 +1,38 @@
+error[E0046]: not all trait items implemented, missing: `CONSTANT`
+ --> $DIR/default-body-stability-err.rs:10:1
+ |
+LL | impl JustTrait for Type {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: default implementation of `CONSTANT` is unstable
+ = note: use of unstable library feature 'constant_default_body'
+ = help: add `#![feature(constant_default_body)]` to the crate attributes to enable
+
+error[E0046]: not all trait items implemented, missing: `fun`
+ --> $DIR/default-body-stability-err.rs:10:1
+ |
+LL | impl JustTrait for Type {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: default implementation of `fun` is unstable
+ = note: use of unstable library feature 'fun_default_body'
+ = help: add `#![feature(fun_default_body)]` to the crate attributes to enable
+
+error[E0046]: not all trait items implemented, missing: `eq`
+ --> $DIR/default-body-stability-err.rs:14:1
+ |
+LL | / impl Equal for Type {
+LL | |
+LL | | fn neq(&self, other: &Self) -> bool {
+LL | | false
+LL | | }
+LL | | }
+ | |_^
+ |
+ = note: default implementation of `eq` is unstable
+ = note: use of unstable library feature 'eq_default_body'
+ = help: add `#![feature(eq_default_body)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/src/test/ui/stability-attribute/default-body-stability-ok-enables.rs b/src/test/ui/stability-attribute/default-body-stability-ok-enables.rs
new file mode 100644
index 000000000..bdc7522f4
--- /dev/null
+++ b/src/test/ui/stability-attribute/default-body-stability-ok-enables.rs
@@ -0,0 +1,18 @@
+// check-pass
+// aux-build:default_body.rs
+#![crate_type = "lib"]
+#![feature(fun_default_body, eq_default_body, constant_default_body)]
+
+extern crate default_body;
+
+use default_body::{Equal, JustTrait};
+
+struct Type;
+
+impl JustTrait for Type {}
+
+impl Equal for Type {
+ fn neq(&self, other: &Self) -> bool {
+ false
+ }
+}
diff --git a/src/test/ui/stability-attribute/default-body-stability-ok-impls.rs b/src/test/ui/stability-attribute/default-body-stability-ok-impls.rs
new file mode 100644
index 000000000..e1f5c0170
--- /dev/null
+++ b/src/test/ui/stability-attribute/default-body-stability-ok-impls.rs
@@ -0,0 +1,21 @@
+// check-pass
+// aux-build:default_body.rs
+#![crate_type = "lib"]
+
+extern crate default_body;
+
+use default_body::{Equal, JustTrait};
+
+struct Type;
+
+impl JustTrait for Type {
+ const CONSTANT: usize = 1;
+
+ fn fun() {}
+}
+
+impl Equal for Type {
+ fn eq(&self, other: &Self) -> bool {
+ false
+ }
+}
diff --git a/src/test/ui/stability-attribute/missing-const-stability.rs b/src/test/ui/stability-attribute/missing-const-stability.rs
index d89886af3..6eff899bf 100644
--- a/src/test/ui/stability-attribute/missing-const-stability.rs
+++ b/src/test/ui/stability-attribute/missing-const-stability.rs
@@ -19,6 +19,7 @@ impl Foo {
}
#[stable(feature = "stable", since = "1.0.0")]
+#[const_trait]
pub trait Bar {
#[stable(feature = "stable", since = "1.0.0")]
fn fun();
diff --git a/src/test/ui/stability-attribute/missing-const-stability.stderr b/src/test/ui/stability-attribute/missing-const-stability.stderr
index 10978728f..4cfbe1528 100644
--- a/src/test/ui/stability-attribute/missing-const-stability.stderr
+++ b/src/test/ui/stability-attribute/missing-const-stability.stderr
@@ -5,7 +5,7 @@ LL | pub const fn foo() {}
| ^^^^^^^^^^^^^^^^^^^^^
error: implementation has missing const stability attribute
- --> $DIR/missing-const-stability.rs:27:1
+ --> $DIR/missing-const-stability.rs:28:1
|
LL | / impl const Bar for Foo {
LL | |
diff --git a/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs b/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs
index ce2726ffd..0c771ae87 100644
--- a/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs
+++ b/src/test/ui/stability-attribute/stability-attribute-trait-impl.rs
@@ -1,4 +1,4 @@
-#![feature(staged_api)]
+#![feature(staged_api, never_type, c_unwind)]
//~^ ERROR module has missing stability attribute
#[stable(feature = "a", since = "1")]
@@ -23,7 +23,21 @@ impl StableTrait for UnstableType {}
impl UnstableTrait for StableType {}
#[unstable(feature = "h", issue = "none")]
+impl StableTrait for ! {}
+
+// Note: If C-unwind is stabilized, switch this to another (unstable) ABI.
+#[unstable(feature = "i", issue = "none")]
+impl StableTrait for extern "C-unwind" fn() {}
+
+#[unstable(feature = "j", issue = "none")]
//~^ ERROR an `#[unstable]` annotation here has no effect [ineffective_unstable_trait_impl]
impl StableTrait for StableType {}
+#[unstable(feature = "k", issue = "none")]
+//~^ ERROR an `#[unstable]` annotation here has no effect [ineffective_unstable_trait_impl]
+impl StableTrait for fn() -> ! {}
+
+#[unstable(feature = "l", issue = "none")]
+impl StableTrait for fn() -> UnstableType {}
+
fn main() {}
diff --git a/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr b/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr
index 310f02024..b91a1d2e1 100644
--- a/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr
+++ b/src/test/ui/stability-attribute/stability-attribute-trait-impl.stderr
@@ -1,16 +1,24 @@
error: an `#[unstable]` annotation here has no effect
- --> $DIR/stability-attribute-trait-impl.rs:25:1
+ --> $DIR/stability-attribute-trait-impl.rs:32:1
|
-LL | #[unstable(feature = "h", issue = "none")]
+LL | #[unstable(feature = "j", issue = "none")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
+ = note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information
= note: `#[deny(ineffective_unstable_trait_impl)]` on by default
+
+error: an `#[unstable]` annotation here has no effect
+ --> $DIR/stability-attribute-trait-impl.rs:36:1
+ |
+LL | #[unstable(feature = "k", issue = "none")]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
= note: see issue #55436 <https://github.com/rust-lang/rust/issues/55436> for more information
error: module has missing stability attribute
--> $DIR/stability-attribute-trait-impl.rs:1:1
|
-LL | / #![feature(staged_api)]
+LL | / #![feature(staged_api, never_type, c_unwind)]
LL | |
LL | |
LL | | #[stable(feature = "a", since = "1")]
@@ -19,5 +27,5 @@ LL | |
LL | | fn main() {}
| |____________^
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
diff --git a/src/test/ui/stability-attribute/stable-in-unstable.rs b/src/test/ui/stability-attribute/stable-in-unstable.rs
index 272a1a972..226367c39 100644
--- a/src/test/ui/stability-attribute/stable-in-unstable.rs
+++ b/src/test/ui/stability-attribute/stable-in-unstable.rs
@@ -44,3 +44,11 @@ mod isolated5 {
impl stable_in_unstable_std::old_stable_module::OldTrait for LocalType {}
}
+
+mod isolated6 {
+ use stable_in_unstable_core::new_unstable_module::{OldTrait}; //~ ERROR use of unstable library feature 'unstable_test_feature'
+}
+
+mod isolated7 {
+ use stable_in_unstable_core::new_unstable_module::*; //~ ERROR use of unstable library feature 'unstable_test_feature'
+}
diff --git a/src/test/ui/stability-attribute/stable-in-unstable.stderr b/src/test/ui/stability-attribute/stable-in-unstable.stderr
index e123d8358..b5e3e5f12 100644
--- a/src/test/ui/stability-attribute/stable-in-unstable.stderr
+++ b/src/test/ui/stability-attribute/stable-in-unstable.stderr
@@ -34,6 +34,24 @@ LL | impl stable_in_unstable_core::new_unstable_module::OldTrait for LocalTy
= note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
= help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
-error: aborting due to 4 previous errors
+error[E0658]: use of unstable library feature 'unstable_test_feature'
+ --> $DIR/stable-in-unstable.rs:49:56
+ |
+LL | use stable_in_unstable_core::new_unstable_module::{OldTrait};
+ | ^^^^^^^^
+ |
+ = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
+ = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+
+error[E0658]: use of unstable library feature 'unstable_test_feature'
+ --> $DIR/stable-in-unstable.rs:53:9
+ |
+LL | use stable_in_unstable_core::new_unstable_module::*;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
+ = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+
+error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/static/static-drop-scope.rs b/src/test/ui/static/static-drop-scope.rs
index e7ea8663d..34afa9873 100644
--- a/src/test/ui/static/static-drop-scope.rs
+++ b/src/test/ui/static/static-drop-scope.rs
@@ -5,33 +5,33 @@ impl Drop for WithDtor {
}
static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
//~| ERROR temporary value dropped while borrowed
const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
//~| ERROR temporary value dropped while borrowed
static EARLY_DROP_S: i32 = (WithDtor, 0).1;
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
const EARLY_DROP_C: i32 = (WithDtor, 0).1;
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
const fn const_drop<T>(_: T) {}
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
const fn const_drop2<T>(x: T) {
(x, ()).1
- //~^ ERROR destructors cannot be evaluated at compile-time
+ //~^ ERROR destructor of
}
const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
const HELPER: Option<WithDtor> = Some(WithDtor);
const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
-//~^ ERROR destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
fn main () {}
diff --git a/src/test/ui/static/static-drop-scope.stderr b/src/test/ui/static/static-drop-scope.stderr
index ac32f217f..112bfc003 100644
--- a/src/test/ui/static/static-drop-scope.stderr
+++ b/src/test/ui/static/static-drop-scope.stderr
@@ -1,10 +1,10 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `WithDtor` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:7:60
|
LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
| ^^^^^^^^- value is dropped here
| |
- | statics cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in statics
error[E0716]: temporary value dropped while borrowed
--> $DIR/static-drop-scope.rs:7:60
@@ -16,13 +16,13 @@ LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
| | creates a temporary which is freed while still in use
| using this value as a static requires that borrow lasts for `'static`
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `WithDtor` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:11:59
|
LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
| ^^^^^^^^- value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
error[E0716]: temporary value dropped while borrowed
--> $DIR/static-drop-scope.rs:11:59
@@ -34,54 +34,54 @@ LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
| | creates a temporary which is freed while still in use
| using this value as a constant requires that borrow lasts for `'static`
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(WithDtor, i32)` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:15:28
|
LL | static EARLY_DROP_S: i32 = (WithDtor, 0).1;
| ^^^^^^^^^^^^^ - value is dropped here
| |
- | statics cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in statics
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(WithDtor, i32)` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:18:27
|
LL | const EARLY_DROP_C: i32 = (WithDtor, 0).1;
| ^^^^^^^^^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:21:24
|
LL | const fn const_drop<T>(_: T) {}
| ^ - value is dropped here
| |
- | constant functions cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constant functions
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(T, ())` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:25:5
|
LL | (x, ()).1
- | ^^^^^^^ constant functions cannot evaluate destructors
+ | ^^^^^^^ the destructor for this type cannot be evaluated in constant functions
LL |
LL | }
| - value is dropped here
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:29:34
|
LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
| ^^^^^^^^^^^^^^^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
--> $DIR/static-drop-scope.rs:34:43
|
LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
| ^^^^^^^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
error: aborting due to 10 previous errors
diff --git a/src/test/ui/static/static-vec-repeat-not-constant.stderr b/src/test/ui/static/static-vec-repeat-not-constant.stderr
index 84fc638a9..dec012318 100644
--- a/src/test/ui/static/static-vec-repeat-not-constant.stderr
+++ b/src/test/ui/static/static-vec-repeat-not-constant.stderr
@@ -5,6 +5,7 @@ LL | static a: [isize; 2] = [foo(); 2];
| ^^^^^
|
= 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
diff --git a/src/test/ui/issues/issue-17718-static-sync.rs b/src/test/ui/statics/issue-17718-static-sync.rs
index 6f278d76b..6f278d76b 100644
--- a/src/test/ui/issues/issue-17718-static-sync.rs
+++ b/src/test/ui/statics/issue-17718-static-sync.rs
diff --git a/src/test/ui/issues/issue-17718-static-sync.stderr b/src/test/ui/statics/issue-17718-static-sync.stderr
index bc6e45e59..bc6e45e59 100644
--- a/src/test/ui/issues/issue-17718-static-sync.stderr
+++ b/src/test/ui/statics/issue-17718-static-sync.stderr
diff --git a/src/test/ui/issues/issue-17718-static-unsafe-interior.rs b/src/test/ui/statics/issue-17718-static-unsafe-interior.rs
index 65a8713ba..65a8713ba 100644
--- a/src/test/ui/issues/issue-17718-static-unsafe-interior.rs
+++ b/src/test/ui/statics/issue-17718-static-unsafe-interior.rs
diff --git a/src/test/ui/statics/uninhabited-static.stderr b/src/test/ui/statics/uninhabited-static.stderr
index 88ee4cbdc..ef794bb36 100644
--- a/src/test/ui/statics/uninhabited-static.stderr
+++ b/src/test/ui/statics/uninhabited-static.stderr
@@ -4,14 +4,14 @@ error: static of uninhabited type
LL | static VOID: Void;
| ^^^^^^^^^^^^^^^^^
|
+ = 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 #74840 <https://github.com/rust-lang/rust/issues/74840>
+ = note: uninhabited statics cannot be initialized, and any access would be an immediate error
note: the lint level is defined here
--> $DIR/uninhabited-static.rs:2:9
|
LL | #![deny(uninhabited_static)]
| ^^^^^^^^^^^^^^^^^^
- = 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 #74840 <https://github.com/rust-lang/rust/issues/74840>
- = note: uninhabited statics cannot be initialized, and any access would be an immediate error
error: static of uninhabited type
--> $DIR/uninhabited-static.rs:8:5
@@ -58,8 +58,12 @@ LL | static VOID2: Void = unsafe { std::mem::transmute(()) };
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
+note: enums with no inhabited variants have no valid value
+ --> $DIR/uninhabited-static.rs:4:1
+ |
+LL | enum Void {}
+ | ^^^^^^^^^
= note: `#[warn(invalid_value)]` on by default
- = note: enums with no variants have no valid value
error[E0080]: could not evaluate static initializer
--> $DIR/uninhabited-static.rs:16:32
@@ -76,7 +80,11 @@ LL | static NEVER2: Void = unsafe { std::mem::transmute(()) };
| this code causes undefined behavior when executed
| help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
|
- = note: enums with no variants have no valid value
+note: enums with no inhabited variants have no valid value
+ --> $DIR/uninhabited-static.rs:4:1
+ |
+LL | enum Void {}
+ | ^^^^^^^^^
error: aborting due to 6 previous errors; 2 warnings emitted
diff --git a/src/test/ui/stats/hir-stats.rs b/src/test/ui/stats/hir-stats.rs
new file mode 100644
index 000000000..a24b3ada5
--- /dev/null
+++ b/src/test/ui/stats/hir-stats.rs
@@ -0,0 +1,41 @@
+// check-pass
+// compile-flags: -Zhir-stats
+// only-x86_64
+
+// The aim here is to include at least one of every different type of top-level
+// AST/HIR node reported by `-Zhir-stats`.
+
+#![allow(dead_code)]
+
+use std::arch::asm;
+use std::fmt::Debug;
+use std::ffi::c_void;
+
+extern "C" { fn f(p: *mut c_void); }
+
+/// An enum.
+enum E<'a, T: Copy> { A { t: T }, B(&'a u32) }
+
+trait Go {
+ type G: Debug;
+ fn go(self) -> u32;
+}
+
+impl<'a, T: Copy> Go for E<'a, T> {
+ type G = bool;
+ fn go(self) -> u32 {
+ 99
+ }
+}
+
+fn f2<T>(t: T) where T: Debug {}
+
+fn main() {
+ let x = E::A { t: 3 };
+ match x {
+ E::A { .. } => {}
+ _ => {}
+ }
+
+ unsafe { asm!("mov rdi, 1"); }
+}
diff --git a/src/test/ui/stats/hir-stats.stderr b/src/test/ui/stats/hir-stats.stderr
new file mode 100644
index 000000000..1521b692a
--- /dev/null
+++ b/src/test/ui/stats/hir-stats.stderr
@@ -0,0 +1,178 @@
+ast-stats-1 PRE EXPANSION AST STATS
+ast-stats-1 Name Accumulated Size Count Item Size
+ast-stats-1 ----------------------------------------------------------------
+ast-stats-1 ExprField 48 ( 0.6%) 1 48
+ast-stats-1 Crate 56 ( 0.7%) 1 56
+ast-stats-1 Attribute 64 ( 0.8%) 2 32
+ast-stats-1 - Normal 32 ( 0.4%) 1
+ast-stats-1 - DocComment 32 ( 0.4%) 1
+ast-stats-1 GenericArgs 64 ( 0.8%) 1 64
+ast-stats-1 - AngleBracketed 64 ( 0.8%) 1
+ast-stats-1 Local 72 ( 0.9%) 1 72
+ast-stats-1 WherePredicate 72 ( 0.9%) 1 72
+ast-stats-1 - BoundPredicate 72 ( 0.9%) 1
+ast-stats-1 Arm 96 ( 1.1%) 2 48
+ast-stats-1 ForeignItem 96 ( 1.1%) 1 96
+ast-stats-1 - Fn 96 ( 1.1%) 1
+ast-stats-1 FieldDef 160 ( 1.9%) 2 80
+ast-stats-1 Stmt 160 ( 1.9%) 5 32
+ast-stats-1 - Local 32 ( 0.4%) 1
+ast-stats-1 - MacCall 32 ( 0.4%) 1
+ast-stats-1 - Expr 96 ( 1.1%) 3
+ast-stats-1 Param 160 ( 1.9%) 4 40
+ast-stats-1 FnDecl 200 ( 2.4%) 5 40
+ast-stats-1 Variant 240 ( 2.9%) 2 120
+ast-stats-1 Block 288 ( 3.4%) 6 48
+ast-stats-1 GenericBound 352 ( 4.2%) 4 88
+ast-stats-1 - Trait 352 ( 4.2%) 4
+ast-stats-1 AssocItem 416 ( 4.9%) 4 104
+ast-stats-1 - Type 208 ( 2.5%) 2
+ast-stats-1 - Fn 208 ( 2.5%) 2
+ast-stats-1 GenericParam 480 ( 5.7%) 5 96
+ast-stats-1 PathSegment 720 ( 8.6%) 30 24
+ast-stats-1 Expr 832 ( 9.9%) 8 104
+ast-stats-1 - Path 104 ( 1.2%) 1
+ast-stats-1 - Match 104 ( 1.2%) 1
+ast-stats-1 - Struct 104 ( 1.2%) 1
+ast-stats-1 - Lit 208 ( 2.5%) 2
+ast-stats-1 - Block 312 ( 3.7%) 3
+ast-stats-1 Pat 840 (10.0%) 7 120
+ast-stats-1 - Struct 120 ( 1.4%) 1
+ast-stats-1 - Wild 120 ( 1.4%) 1
+ast-stats-1 - Ident 600 ( 7.1%) 5
+ast-stats-1 Ty 1_344 (16.0%) 14 96
+ast-stats-1 - Rptr 96 ( 1.1%) 1
+ast-stats-1 - Ptr 96 ( 1.1%) 1
+ast-stats-1 - ImplicitSelf 192 ( 2.3%) 2
+ast-stats-1 - Path 960 (11.4%) 10
+ast-stats-1 Item 1_656 (19.7%) 9 184
+ast-stats-1 - Trait 184 ( 2.2%) 1
+ast-stats-1 - Enum 184 ( 2.2%) 1
+ast-stats-1 - ForeignMod 184 ( 2.2%) 1
+ast-stats-1 - Impl 184 ( 2.2%) 1
+ast-stats-1 - Fn 368 ( 4.4%) 2
+ast-stats-1 - Use 552 ( 6.6%) 3
+ast-stats-1 ----------------------------------------------------------------
+ast-stats-1 Total 8_416
+ast-stats-1
+ast-stats-2 POST EXPANSION AST STATS
+ast-stats-2 Name Accumulated Size Count Item Size
+ast-stats-2 ----------------------------------------------------------------
+ast-stats-2 ExprField 48 ( 0.5%) 1 48
+ast-stats-2 Crate 56 ( 0.6%) 1 56
+ast-stats-2 GenericArgs 64 ( 0.7%) 1 64
+ast-stats-2 - AngleBracketed 64 ( 0.7%) 1
+ast-stats-2 Local 72 ( 0.8%) 1 72
+ast-stats-2 WherePredicate 72 ( 0.8%) 1 72
+ast-stats-2 - BoundPredicate 72 ( 0.8%) 1
+ast-stats-2 Arm 96 ( 1.0%) 2 48
+ast-stats-2 ForeignItem 96 ( 1.0%) 1 96
+ast-stats-2 - Fn 96 ( 1.0%) 1
+ast-stats-2 InlineAsm 120 ( 1.3%) 1 120
+ast-stats-2 Attribute 128 ( 1.4%) 4 32
+ast-stats-2 - DocComment 32 ( 0.3%) 1
+ast-stats-2 - Normal 96 ( 1.0%) 3
+ast-stats-2 FieldDef 160 ( 1.7%) 2 80
+ast-stats-2 Stmt 160 ( 1.7%) 5 32
+ast-stats-2 - Local 32 ( 0.3%) 1
+ast-stats-2 - Semi 32 ( 0.3%) 1
+ast-stats-2 - Expr 96 ( 1.0%) 3
+ast-stats-2 Param 160 ( 1.7%) 4 40
+ast-stats-2 FnDecl 200 ( 2.2%) 5 40
+ast-stats-2 Variant 240 ( 2.6%) 2 120
+ast-stats-2 Block 288 ( 3.1%) 6 48
+ast-stats-2 GenericBound 352 ( 3.8%) 4 88
+ast-stats-2 - Trait 352 ( 3.8%) 4
+ast-stats-2 AssocItem 416 ( 4.5%) 4 104
+ast-stats-2 - Type 208 ( 2.3%) 2
+ast-stats-2 - Fn 208 ( 2.3%) 2
+ast-stats-2 GenericParam 480 ( 5.2%) 5 96
+ast-stats-2 PathSegment 792 ( 8.7%) 33 24
+ast-stats-2 Pat 840 ( 9.2%) 7 120
+ast-stats-2 - Struct 120 ( 1.3%) 1
+ast-stats-2 - Wild 120 ( 1.3%) 1
+ast-stats-2 - Ident 600 ( 6.6%) 5
+ast-stats-2 Expr 936 (10.2%) 9 104
+ast-stats-2 - Path 104 ( 1.1%) 1
+ast-stats-2 - Match 104 ( 1.1%) 1
+ast-stats-2 - Struct 104 ( 1.1%) 1
+ast-stats-2 - InlineAsm 104 ( 1.1%) 1
+ast-stats-2 - Lit 208 ( 2.3%) 2
+ast-stats-2 - Block 312 ( 3.4%) 3
+ast-stats-2 Ty 1_344 (14.7%) 14 96
+ast-stats-2 - Rptr 96 ( 1.0%) 1
+ast-stats-2 - Ptr 96 ( 1.0%) 1
+ast-stats-2 - ImplicitSelf 192 ( 2.1%) 2
+ast-stats-2 - Path 960 (10.5%) 10
+ast-stats-2 Item 2_024 (22.1%) 11 184
+ast-stats-2 - Trait 184 ( 2.0%) 1
+ast-stats-2 - Enum 184 ( 2.0%) 1
+ast-stats-2 - ExternCrate 184 ( 2.0%) 1
+ast-stats-2 - ForeignMod 184 ( 2.0%) 1
+ast-stats-2 - Impl 184 ( 2.0%) 1
+ast-stats-2 - Fn 368 ( 4.0%) 2
+ast-stats-2 - Use 736 ( 8.0%) 4
+ast-stats-2 ----------------------------------------------------------------
+ast-stats-2 Total 9_144
+ast-stats-2
+hir-stats HIR STATS
+hir-stats Name Accumulated Size Count Item Size
+hir-stats ----------------------------------------------------------------
+hir-stats ForeignItemRef 24 ( 0.3%) 1 24
+hir-stats Lifetime 32 ( 0.4%) 1 32
+hir-stats Mod 32 ( 0.4%) 1 32
+hir-stats ExprField 40 ( 0.4%) 1 40
+hir-stats TraitItemRef 56 ( 0.6%) 2 28
+hir-stats Local 64 ( 0.7%) 1 64
+hir-stats Param 64 ( 0.7%) 2 32
+hir-stats InlineAsm 72 ( 0.8%) 1 72
+hir-stats ImplItemRef 72 ( 0.8%) 2 36
+hir-stats Body 96 ( 1.1%) 3 32
+hir-stats GenericArg 96 ( 1.1%) 4 24
+hir-stats - Type 24 ( 0.3%) 1
+hir-stats - Lifetime 72 ( 0.8%) 3
+hir-stats FieldDef 96 ( 1.1%) 2 48
+hir-stats Arm 96 ( 1.1%) 2 48
+hir-stats Stmt 96 ( 1.1%) 3 32
+hir-stats - Local 32 ( 0.4%) 1
+hir-stats - Semi 32 ( 0.4%) 1
+hir-stats - Expr 32 ( 0.4%) 1
+hir-stats FnDecl 120 ( 1.3%) 3 40
+hir-stats Attribute 128 ( 1.4%) 4 32
+hir-stats GenericArgs 144 ( 1.6%) 3 48
+hir-stats Variant 160 ( 1.8%) 2 80
+hir-stats GenericBound 192 ( 2.1%) 4 48
+hir-stats - Trait 192 ( 2.1%) 4
+hir-stats WherePredicate 192 ( 2.1%) 3 64
+hir-stats - BoundPredicate 192 ( 2.1%) 3
+hir-stats Block 288 ( 3.2%) 6 48
+hir-stats Pat 360 ( 3.9%) 5 72
+hir-stats - Wild 72 ( 0.8%) 1
+hir-stats - Struct 72 ( 0.8%) 1
+hir-stats - Binding 216 ( 2.4%) 3
+hir-stats GenericParam 400 ( 4.4%) 5 80
+hir-stats Generics 560 ( 6.1%) 10 56
+hir-stats Ty 720 ( 7.9%) 15 48
+hir-stats - Ptr 48 ( 0.5%) 1
+hir-stats - Rptr 48 ( 0.5%) 1
+hir-stats - Path 624 ( 6.8%) 13
+hir-stats Expr 768 ( 8.4%) 12 64
+hir-stats - Path 64 ( 0.7%) 1
+hir-stats - Struct 64 ( 0.7%) 1
+hir-stats - Match 64 ( 0.7%) 1
+hir-stats - InlineAsm 64 ( 0.7%) 1
+hir-stats - Lit 128 ( 1.4%) 2
+hir-stats - Block 384 ( 4.2%) 6
+hir-stats Item 960 (10.5%) 12 80
+hir-stats - Trait 80 ( 0.9%) 1
+hir-stats - Enum 80 ( 0.9%) 1
+hir-stats - ExternCrate 80 ( 0.9%) 1
+hir-stats - ForeignMod 80 ( 0.9%) 1
+hir-stats - Impl 80 ( 0.9%) 1
+hir-stats - Fn 160 ( 1.8%) 2
+hir-stats - Use 400 ( 4.4%) 5
+hir-stats Path 1_280 (14.0%) 32 40
+hir-stats PathSegment 1_920 (21.0%) 40 48
+hir-stats ----------------------------------------------------------------
+hir-stats Total 9_128
+hir-stats
diff --git a/src/test/ui/std-backtrace.rs b/src/test/ui/std-backtrace.rs
index 07de066b5..59574b471 100644
--- a/src/test/ui/std-backtrace.rs
+++ b/src/test/ui/std-backtrace.rs
@@ -4,11 +4,10 @@
// ignore-openbsd no support for libbacktrace without filename
// ignore-sgx no processes
// ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
+// ignore-fuchsia Backtraces not symbolized
// compile-flags:-g
// compile-flags:-Cstrip=none
-#![feature(backtrace)]
-
use std::env;
use std::process::Command;
use std::str;
diff --git a/src/test/ui/str/str-idx.stderr b/src/test/ui/str/str-idx.stderr
index 9079a18d6..019305def 100644
--- a/src/test/ui/str/str-idx.stderr
+++ b/src/test/ui/str/str-idx.stderr
@@ -8,7 +8,7 @@ LL | let _: u8 = s[4];
= note: you can use `.chars().nth()` or `.bytes().nth()`
for more information, see chapter 8 in The Book: <https://doc.rust-lang.org/book/ch08-02-strings.html#indexing-into-strings>
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<{integer}>` for `str`
+ = note: required for `str` to implement `Index<{integer}>`
error[E0277]: the type `str` cannot be indexed by `{integer}`
--> $DIR/str-idx.rs:4:19
@@ -53,7 +53,7 @@ LL | let _: u8 = s['c'];
| ^^^ string indices are ranges of `usize`
|
= help: the trait `SliceIndex<str>` is not implemented for `char`
- = note: required because of the requirements on the impl of `Index<char>` for `str`
+ = note: required for `str` to implement `Index<char>`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr
index 2d062e56a..b165c4825 100644
--- a/src/test/ui/str/str-mut-idx.stderr
+++ b/src/test/ui/str/str-mut-idx.stderr
@@ -32,7 +32,7 @@ LL | s[1usize] = bot();
|
= help: the trait `SliceIndex<str>` is not implemented for `usize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<usize>` for `str`
+ = note: required for `str` to implement `Index<usize>`
error[E0277]: the type `str` cannot be indexed by `{integer}`
--> $DIR/str-mut-idx.rs:9:15
@@ -77,7 +77,7 @@ LL | s['c'];
| ^^^ string indices are ranges of `usize`
|
= help: the trait `SliceIndex<str>` is not implemented for `char`
- = note: required because of the requirements on the impl of `Index<char>` for `str`
+ = note: required for `str` to implement `Index<char>`
error: aborting due to 6 previous errors
diff --git a/src/test/ui/structs-enums/align-struct.rs b/src/test/ui/structs-enums/align-struct.rs
index 27ef990aa..f5418e754 100644
--- a/src/test/ui/structs-enums/align-struct.rs
+++ b/src/test/ui/structs-enums/align-struct.rs
@@ -1,6 +1,5 @@
// run-pass
#![allow(dead_code)]
-#![feature(box_syntax)]
use std::mem;
@@ -232,9 +231,9 @@ pub fn main() {
assert_eq!(mem::size_of_val(&a), 32);
assert!(is_aligned_to(&a, 16));
- let mut large = box AlignLarge {
+ 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/src/test/ui/issues/issue-2718-a.rs b/src/test/ui/structs-enums/issue-2718-a.rs
index 6c4915845..6c4915845 100644
--- a/src/test/ui/issues/issue-2718-a.rs
+++ b/src/test/ui/structs-enums/issue-2718-a.rs
diff --git a/src/test/ui/issues/issue-2718-a.stderr b/src/test/ui/structs-enums/issue-2718-a.stderr
index c6e703f48..7ea620f38 100644
--- a/src/test/ui/issues/issue-2718-a.stderr
+++ b/src/test/ui/structs-enums/issue-2718-a.stderr
@@ -3,10 +3,8 @@ error[E0072]: recursive type `Pong` has infinite size
|
LL | pub struct Pong(SendPacket<Ping>);
| ^^^^^^^^^^^^^^^ ---------------- recursive without indirection
- | |
- | recursive type has infinite size
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Pong` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | pub struct Pong(Box<SendPacket<Ping>>);
| ++++ +
diff --git a/src/test/ui/structs-enums/rec-align-u32.rs b/src/test/ui/structs-enums/rec-align-u32.rs
index 889294daa..ee704198d 100644
--- a/src/test/ui/structs-enums/rec-align-u32.rs
+++ b/src/test/ui/structs-enums/rec-align-u32.rs
@@ -10,6 +10,7 @@ use std::mem;
mod rusti {
extern "rust-intrinsic" {
pub fn pref_align_of<T>() -> usize;
+ #[rustc_safe_intrinsic]
pub fn min_align_of<T>() -> usize;
}
}
diff --git a/src/test/ui/structs-enums/rec-align-u64.rs b/src/test/ui/structs-enums/rec-align-u64.rs
index 3bc2d16cf..40ede9705 100644
--- a/src/test/ui/structs-enums/rec-align-u64.rs
+++ b/src/test/ui/structs-enums/rec-align-u64.rs
@@ -12,6 +12,7 @@ use std::mem;
mod rusti {
extern "rust-intrinsic" {
pub fn pref_align_of<T>() -> usize;
+ #[rustc_safe_intrinsic]
pub fn min_align_of<T>() -> usize;
}
}
diff --git a/src/test/ui/structs-enums/struct-rec/issue-74224.stderr b/src/test/ui/structs-enums/struct-rec/issue-74224.stderr
index 619917846..f1d50bc8a 100644
--- a/src/test/ui/structs-enums/struct-rec/issue-74224.stderr
+++ b/src/test/ui/structs-enums/struct-rec/issue-74224.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `A` has infinite size
--> $DIR/issue-74224.rs:1:1
|
LL | struct A<T> {
- | ^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^
...
LL | y: A<A<T>>,
| ------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | y: Box<A<A<T>>>,
| ++++ +
diff --git a/src/test/ui/structs-enums/struct-rec/issue-84611.stderr b/src/test/ui/structs-enums/struct-rec/issue-84611.stderr
index 2e99435e0..536f54e3e 100644
--- a/src/test/ui/structs-enums/struct-rec/issue-84611.stderr
+++ b/src/test/ui/structs-enums/struct-rec/issue-84611.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-84611.rs:1:1
|
LL | struct Foo<T> {
- | ^^^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^^^
LL |
LL | x: Foo<[T; 1]>,
| ----------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | x: Box<Foo<[T; 1]>>,
| ++++ +
diff --git a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs
index cca97f43e..3bfce8b4f 100644
--- a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs
+++ b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.rs
@@ -1,22 +1,20 @@
struct A<T> {
-//~^ ERROR recursive type `A` has infinite size
+//~^ ERROR recursive types `A` and `B` have infinite size
x: T,
y: B<T>,
}
struct B<T> {
-//~^ ERROR recursive type `B` has infinite size
z: A<T>
}
struct C<T> {
-//~^ ERROR recursive type `C` has infinite size
+//~^ ERROR recursive types `C` and `D` have infinite size
x: T,
y: Option<Option<D<T>>>,
}
struct D<T> {
-//~^ ERROR recursive type `D` has infinite size
z: Option<Option<C<T>>>,
}
diff --git a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
index 80a494f3f..881bc2819 100644
--- a/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
+++ b/src/test/ui/structs-enums/struct-rec/mutual-struct-recursion.stderr
@@ -1,59 +1,49 @@
-error[E0072]: recursive type `A` has infinite size
+error[E0072]: recursive types `A` and `B` have infinite size
--> $DIR/mutual-struct-recursion.rs:1:1
|
LL | struct A<T> {
- | ^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^
...
LL | y: B<T>,
| ---- recursive without indirection
- |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable
- |
-LL | y: Box<B<T>>,
- | ++++ +
-
-error[E0072]: recursive type `B` has infinite size
- --> $DIR/mutual-struct-recursion.rs:7:1
- |
+...
LL | struct B<T> {
- | ^^^^^^^^^^^ recursive type has infinite size
-LL |
+ | ^^^^^^^^^^^
LL | z: A<T>
| ---- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `B` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL ~ y: Box<B<T>>,
+LL | }
+LL |
+LL | struct B<T> {
+LL ~ z: Box<A<T>>
|
-LL | z: Box<A<T>>
- | ++++ +
-error[E0072]: recursive type `C` has infinite size
- --> $DIR/mutual-struct-recursion.rs:12:1
+error[E0072]: recursive types `C` and `D` have infinite size
+ --> $DIR/mutual-struct-recursion.rs:11:1
|
LL | struct C<T> {
- | ^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^
...
LL | y: Option<Option<D<T>>>,
- | -------------------- recursive without indirection
- |
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `C` representable
- |
-LL | y: Option<Box<Option<D<T>>>>,
- | ++++ +
-
-error[E0072]: recursive type `D` has infinite size
- --> $DIR/mutual-struct-recursion.rs:18:1
- |
+ | ---- recursive without indirection
+...
LL | struct D<T> {
- | ^^^^^^^^^^^ recursive type has infinite size
-LL |
+ | ^^^^^^^^^^^
LL | z: Option<Option<C<T>>>,
- | -------------------- recursive without indirection
+ | ---- recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `D` representable
+LL ~ y: Option<Option<Box<D<T>>>>,
+LL | }
+LL |
+LL | struct D<T> {
+LL ~ z: Option<Option<Box<C<T>>>>,
|
-LL | z: Option<Box<Option<C<T>>>>,
- | ++++ +
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0072`.
diff --git a/src/test/ui/structs-enums/type-sizes.rs b/src/test/ui/structs-enums/type-sizes.rs
index 73a11a5e7..7a23f1363 100644
--- a/src/test/ui/structs-enums/type-sizes.rs
+++ b/src/test/ui/structs-enums/type-sizes.rs
@@ -120,6 +120,54 @@ pub enum AlwaysTaggedBecauseItHasNoNiche {
B
}
+pub enum NicheFilledMultipleFields {
+ A(bool, u8),
+ B(u8),
+ C(u8),
+ D(bool),
+ E,
+ F,
+ G,
+}
+
+struct BoolInTheMiddle(std::num::NonZeroU16, bool, u8);
+
+enum NicheWithData {
+ A,
+ B([u16; 5]),
+ Largest { a1: u32, a2: BoolInTheMiddle, a3: u32 },
+ C,
+ D(u32, u32),
+}
+
+// A type with almost 2^16 invalid values.
+#[repr(u16)]
+pub enum NicheU16 {
+ _0,
+}
+
+pub enum EnumManyVariant<X> {
+ Dataful(u8, X),
+
+ // 0x100 niche variants.
+ _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, _0A, _0B, _0C, _0D, _0E, _0F,
+ _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _1A, _1B, _1C, _1D, _1E, _1F,
+ _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _2A, _2B, _2C, _2D, _2E, _2F,
+ _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _3A, _3B, _3C, _3D, _3E, _3F,
+ _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _4A, _4B, _4C, _4D, _4E, _4F,
+ _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _5A, _5B, _5C, _5D, _5E, _5F,
+ _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _6A, _6B, _6C, _6D, _6E, _6F,
+ _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _7A, _7B, _7C, _7D, _7E, _7F,
+ _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _8A, _8B, _8C, _8D, _8E, _8F,
+ _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _9A, _9B, _9C, _9D, _9E, _9F,
+ _A0, _A1, _A2, _A3, _A4, _A5, _A6, _A7, _A8, _A9, _AA, _AB, _AC, _AD, _AE, _AF,
+ _B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7, _B8, _B9, _BA, _BB, _BC, _BD, _BE, _BF,
+ _C0, _C1, _C2, _C3, _C4, _C5, _C6, _C7, _C8, _C9, _CA, _CB, _CC, _CD, _CE, _CF,
+ _D0, _D1, _D2, _D3, _D4, _D5, _D6, _D7, _D8, _D9, _DA, _DB, _DC, _DD, _DE, _DF,
+ _E0, _E1, _E2, _E3, _E4, _E5, _E6, _E7, _E8, _E9, _EA, _EB, _EC, _ED, _EE, _EF,
+ _F0, _F1, _F2, _F3, _F4, _F5, _F6, _F7, _F8, _F9, _FA, _FB, _FC, _FD, _FE, _FF,
+}
+
pub fn main() {
assert_eq!(size_of::<u8>(), 1 as usize);
assert_eq!(size_of::<u32>(), 4 as usize);
@@ -170,4 +218,35 @@ pub fn main() {
assert_eq!(size_of::<AlwaysTaggedBecauseItHasNoNiche>(), 8);
assert_eq!(size_of::<Option<AlwaysTaggedBecauseItHasNoNiche>>(), 8);
assert_eq!(size_of::<Option<Option<AlwaysTaggedBecauseItHasNoNiche>>>(), 8);
+
+ assert_eq!(size_of::<NicheFilledMultipleFields>(), 2);
+ assert_eq!(size_of::<Option<NicheFilledMultipleFields>>(), 2);
+ assert_eq!(size_of::<Option<Option<NicheFilledMultipleFields>>>(), 2);
+
+ struct S1{ a: u16, b: std::num::NonZeroU16, c: u16, d: u8, e: u32, f: u64, g:[u8;2] }
+ assert_eq!(size_of::<S1>(), 24);
+ assert_eq!(size_of::<Option<S1>>(), 24);
+
+ assert_eq!(size_of::<NicheWithData>(), 12);
+ assert_eq!(size_of::<Option<NicheWithData>>(), 12);
+ assert_eq!(size_of::<Option<Option<NicheWithData>>>(), 12);
+ assert_eq!(
+ size_of::<Option<Option2<&(), Option<NicheWithData>>>>(),
+ size_of::<(&(), NicheWithData)>()
+ );
+
+ pub enum FillPadding { A(std::num::NonZeroU8, u32), B }
+ assert_eq!(size_of::<FillPadding>(), 8);
+ assert_eq!(size_of::<Option<FillPadding>>(), 8);
+ assert_eq!(size_of::<Option<Option<FillPadding>>>(), 8);
+
+ assert_eq!(size_of::<Result<(std::num::NonZeroU8, u8, u8), u16>>(), 4);
+ assert_eq!(size_of::<Option<Result<(std::num::NonZeroU8, u8, u8), u16>>>(), 4);
+ assert_eq!(size_of::<Result<(std::num::NonZeroU8, u8, u8, u8), u16>>(), 4);
+
+ assert_eq!(size_of::<EnumManyVariant<u16>>(), 6);
+ assert_eq!(size_of::<EnumManyVariant<NicheU16>>(), 4);
+ assert_eq!(size_of::<EnumManyVariant<Option<NicheU16>>>(), 4);
+ assert_eq!(size_of::<EnumManyVariant<Option2<NicheU16,u8>>>(), 6);
+ assert_eq!(size_of::<EnumManyVariant<Option<(NicheU16,u8)>>>(), 6);
}
diff --git a/src/test/ui/structs/incomplete-fn-in-struct-definition.rs b/src/test/ui/structs/incomplete-fn-in-struct-definition.rs
new file mode 100644
index 000000000..cd8a79ba6
--- /dev/null
+++ b/src/test/ui/structs/incomplete-fn-in-struct-definition.rs
@@ -0,0 +1,5 @@
+fn main() {}
+
+struct S {
+ fn: u8 //~ ERROR expected identifier, found keyword `fn`
+}
diff --git a/src/test/ui/structs/incomplete-fn-in-struct-definition.stderr b/src/test/ui/structs/incomplete-fn-in-struct-definition.stderr
new file mode 100644
index 000000000..0d12ba9c9
--- /dev/null
+++ b/src/test/ui/structs/incomplete-fn-in-struct-definition.stderr
@@ -0,0 +1,15 @@
+error: expected identifier, found keyword `fn`
+ --> $DIR/incomplete-fn-in-struct-definition.rs:4:5
+ |
+LL | struct S {
+ | - while parsing this struct
+LL | fn: u8
+ | ^^ expected identifier, found keyword
+ |
+help: escape `fn` to use it as an identifier
+ |
+LL | r#fn: u8
+ | ++
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/structs/struct-fn-in-definition.stderr b/src/test/ui/structs/struct-fn-in-definition.stderr
index 1d7cd5272..472365c6e 100644
--- a/src/test/ui/structs/struct-fn-in-definition.stderr
+++ b/src/test/ui/structs/struct-fn-in-definition.stderr
@@ -1,6 +1,9 @@
error: functions are not allowed in struct definitions
--> $DIR/struct-fn-in-definition.rs:9:5
|
+LL | struct S {
+ | - while parsing this struct
+...
LL | fn foo() {}
| ^^^^^^^^^^^
|
@@ -10,6 +13,9 @@ LL | fn foo() {}
error: functions are not allowed in union definitions
--> $DIR/struct-fn-in-definition.rs:18:5
|
+LL | union U {
+ | - while parsing this union
+...
LL | fn foo() {}
| ^^^^^^^^^^^
|
@@ -19,6 +25,9 @@ LL | fn foo() {}
error: functions are not allowed in enum definitions
--> $DIR/struct-fn-in-definition.rs:27:5
|
+LL | enum E {
+ | - while parsing this enum
+...
LL | fn foo() {}
| ^^^^^^^^^^^
|
diff --git a/src/test/ui/structs/struct-path-associated-type.rs b/src/test/ui/structs/struct-path-associated-type.rs
index f88572f84..2dd7174a9 100644
--- a/src/test/ui/structs/struct-path-associated-type.rs
+++ b/src/test/ui/structs/struct-path-associated-type.rs
@@ -13,7 +13,7 @@ fn f<T: Tr>() {
//~^ ERROR expected struct, variant or union type, found associated type
let z = T::A::<u8> {};
//~^ ERROR expected struct, variant or union type, found associated type
- //~| ERROR type arguments are not allowed on this type
+ //~| ERROR this associated type takes 0 generic arguments but 1 generic argument was supplied
match S {
T::A {} => {}
//~^ ERROR expected struct, variant or union type, found associated type
@@ -22,7 +22,7 @@ fn f<T: Tr>() {
fn g<T: Tr<A = S>>() {
let s = T::A {}; // OK
- let z = T::A::<u8> {}; //~ ERROR type arguments are not allowed on this type
+ let z = T::A::<u8> {}; //~ ERROR this associated type takes 0 generic arguments but 1 generic argument was supplied
match S {
T::A {} => {} // OK
}
diff --git a/src/test/ui/structs/struct-path-associated-type.stderr b/src/test/ui/structs/struct-path-associated-type.stderr
index bdce0e1b3..abb445214 100644
--- a/src/test/ui/structs/struct-path-associated-type.stderr
+++ b/src/test/ui/structs/struct-path-associated-type.stderr
@@ -4,13 +4,19 @@ error[E0071]: expected struct, variant or union type, found associated type
LL | let s = T::A {};
| ^^^^ not a struct
-error[E0109]: type arguments are not allowed on this type
- --> $DIR/struct-path-associated-type.rs:14:20
+error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/struct-path-associated-type.rs:14:16
|
LL | let z = T::A::<u8> {};
- | - ^^ type argument not allowed
+ | ^------ help: remove these generics
| |
- | not allowed on this type
+ | expected 0 generic arguments
+ |
+note: associated type defined here, with 0 generic parameters
+ --> $DIR/struct-path-associated-type.rs:4:10
+ |
+LL | type A;
+ | ^
error[E0071]: expected struct, variant or union type, found associated type
--> $DIR/struct-path-associated-type.rs:14:13
@@ -24,13 +30,19 @@ error[E0071]: expected struct, variant or union type, found associated type
LL | T::A {} => {}
| ^^^^ not a struct
-error[E0109]: type arguments are not allowed on this type
- --> $DIR/struct-path-associated-type.rs:25:20
+error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/struct-path-associated-type.rs:25:16
|
LL | let z = T::A::<u8> {};
- | - ^^ type argument not allowed
+ | ^------ help: remove these generics
| |
- | not allowed on this type
+ | expected 0 generic arguments
+ |
+note: associated type defined here, with 0 generic parameters
+ --> $DIR/struct-path-associated-type.rs:4:10
+ |
+LL | type A;
+ | ^
error[E0223]: ambiguous associated type
--> $DIR/struct-path-associated-type.rs:32:13
@@ -52,5 +64,5 @@ LL | S::A {} => {}
error: aborting due to 8 previous errors
-Some errors have detailed explanations: E0071, E0109, E0223.
+Some errors have detailed explanations: E0071, E0107, E0223.
For more information about an error, try `rustc --explain E0071`.
diff --git a/src/test/ui/structs/struct-record-suggestion.fixed b/src/test/ui/structs/struct-record-suggestion.fixed
index 48144cd1c..49e38b196 100644
--- a/src/test/ui/structs/struct-record-suggestion.fixed
+++ b/src/test/ui/structs/struct-record-suggestion.fixed
@@ -6,11 +6,29 @@ struct A {
d: usize,
}
-fn main() {
- let q = A { c: 5, .. Default::default() };
+fn a() {
+ let q = A { c: 5,..Default::default() };
//~^ ERROR mismatched types
//~| ERROR missing fields
//~| HELP separate the last named field with a comma
- let r = A { c: 5, .. Default::default() };
+ let r = A { c: 5, ..Default::default() };
assert_eq!(q, r);
}
+
+#[derive(Debug, Default, Eq, PartialEq)]
+struct B {
+ b: u32,
+}
+
+fn b() {
+ let q = B { b: 1,..Default::default() };
+ //~^ ERROR mismatched types
+ //~| HELP separate the last named field with a comma
+ let r = B { b: 1 };
+ assert_eq!(q, r);
+}
+
+fn main() {
+ a();
+ b();
+}
diff --git a/src/test/ui/structs/struct-record-suggestion.rs b/src/test/ui/structs/struct-record-suggestion.rs
index 6d169d5c6..901f310c8 100644
--- a/src/test/ui/structs/struct-record-suggestion.rs
+++ b/src/test/ui/structs/struct-record-suggestion.rs
@@ -6,11 +6,29 @@ struct A {
d: usize,
}
-fn main() {
- let q = A { c: 5 .. Default::default() };
+fn a() {
+ let q = A { c: 5..Default::default() };
//~^ ERROR mismatched types
//~| ERROR missing fields
//~| HELP separate the last named field with a comma
- let r = A { c: 5, .. Default::default() };
+ let r = A { c: 5, ..Default::default() };
assert_eq!(q, r);
}
+
+#[derive(Debug, Default, Eq, PartialEq)]
+struct B {
+ b: u32,
+}
+
+fn b() {
+ let q = B { b: 1..Default::default() };
+ //~^ ERROR mismatched types
+ //~| HELP separate the last named field with a comma
+ let r = B { b: 1 };
+ assert_eq!(q, r);
+}
+
+fn main() {
+ a();
+ b();
+}
diff --git a/src/test/ui/structs/struct-record-suggestion.stderr b/src/test/ui/structs/struct-record-suggestion.stderr
index e5bd03117..66e9f021e 100644
--- a/src/test/ui/structs/struct-record-suggestion.stderr
+++ b/src/test/ui/structs/struct-record-suggestion.stderr
@@ -1,8 +1,8 @@
error[E0308]: mismatched types
--> $DIR/struct-record-suggestion.rs:10:20
|
-LL | let q = A { c: 5 .. Default::default() };
- | ^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found struct `std::ops::Range`
+LL | let q = A { c: 5..Default::default() };
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found struct `std::ops::Range`
|
= note: expected type `u64`
found struct `std::ops::Range<{integer}>`
@@ -10,15 +10,28 @@ LL | let q = A { c: 5 .. Default::default() };
error[E0063]: missing fields `b` and `d` in initializer of `A`
--> $DIR/struct-record-suggestion.rs:10:13
|
-LL | let q = A { c: 5 .. Default::default() };
+LL | let q = A { c: 5..Default::default() };
| ^ missing `b` and `d`
|
help: to set the remaining fields from `Default::default()`, separate the last named field with a comma
|
-LL | let q = A { c: 5, .. Default::default() };
+LL | let q = A { c: 5,..Default::default() };
| +
-error: aborting due to 2 previous errors
+error[E0308]: mismatched types
+ --> $DIR/struct-record-suggestion.rs:24:20
+ |
+LL | let q = B { b: 1..Default::default() };
+ | ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `std::ops::Range`
+ |
+ = note: expected type `u32`
+ found struct `std::ops::Range<{integer}>`
+help: to set the remaining fields from `Default::default()`, separate the last named field with a comma
+ |
+LL | let q = B { b: 1,..Default::default() };
+ | +
+
+error: aborting due to 3 previous errors
Some errors have detailed explanations: E0063, E0308.
For more information about an error, try `rustc --explain E0063`.
diff --git a/src/test/ui/suggestions/abi-typo.fixed b/src/test/ui/suggestions/abi-typo.fixed
new file mode 100644
index 000000000..04d265865
--- /dev/null
+++ b/src/test/ui/suggestions/abi-typo.fixed
@@ -0,0 +1,6 @@
+// run-rustfix
+extern "cdecl" fn cdedl() {} //~ ERROR invalid ABI
+
+fn main() {
+ cdedl();
+}
diff --git a/src/test/ui/suggestions/abi-typo.rs b/src/test/ui/suggestions/abi-typo.rs
new file mode 100644
index 000000000..6d80db522
--- /dev/null
+++ b/src/test/ui/suggestions/abi-typo.rs
@@ -0,0 +1,6 @@
+// run-rustfix
+extern "cdedl" fn cdedl() {} //~ ERROR invalid ABI
+
+fn main() {
+ cdedl();
+}
diff --git a/src/test/ui/suggestions/abi-typo.stderr b/src/test/ui/suggestions/abi-typo.stderr
new file mode 100644
index 000000000..67a84f119
--- /dev/null
+++ b/src/test/ui/suggestions/abi-typo.stderr
@@ -0,0 +1,14 @@
+error[E0703]: invalid ABI: found `cdedl`
+ --> $DIR/abi-typo.rs:2:8
+ |
+LL | extern "cdedl" fn cdedl() {}
+ | ^^^^^^^
+ | |
+ | invalid ABI
+ | help: did you mean: `"cdecl"`
+ |
+ = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions.
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0703`.
diff --git a/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr b/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr
index 805c75f46..0a91c442d 100644
--- a/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr
+++ b/src/test/ui/suggestions/args-instead-of-tuple-errors.stderr
@@ -2,10 +2,13 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
--> $DIR/args-instead-of-tuple-errors.rs:6:34
|
LL | let _: Option<(i32, bool)> = Some(1, 2);
- | ^^^^ - - argument of type `{integer}` unexpected
- | |
- | expected tuple, found integer
+ | ^^^^ - argument of type `{integer}` unexpected
|
+note: expected tuple, found integer
+ --> $DIR/args-instead-of-tuple-errors.rs:6:39
+ |
+LL | let _: Option<(i32, bool)> = Some(1, 2);
+ | ^
= note: expected tuple `(i32, bool)`
found type `{integer}`
note: tuple variant defined here
@@ -16,16 +19,19 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
help: remove the extra argument
|
LL | let _: Option<(i32, bool)> = Some(/* (i32, bool) */);
- | ~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~
error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/args-instead-of-tuple-errors.rs:8:5
|
LL | int_bool(1, 2);
- | ^^^^^^^^ - - argument of type `{integer}` unexpected
- | |
- | expected tuple, found integer
+ | ^^^^^^^^ - argument of type `{integer}` unexpected
|
+note: expected tuple, found integer
+ --> $DIR/args-instead-of-tuple-errors.rs:8:14
+ |
+LL | int_bool(1, 2);
+ | ^
= note: expected tuple `(i32, bool)`
found type `{integer}`
note: function defined here
@@ -36,7 +42,7 @@ LL | fn int_bool(_: (i32, bool)) {
help: remove the extra argument
|
LL | int_bool(/* (i32, bool) */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~
error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
--> $DIR/args-instead-of-tuple-errors.rs:11:28
@@ -52,7 +58,7 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
help: provide the argument
|
LL | let _: Option<(i8,)> = Some(/* (i8,) */);
- | ~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/args-instead-of-tuple-errors.rs:14:34
diff --git a/src/test/ui/suggestions/args-instead-of-tuple.stderr b/src/test/ui/suggestions/args-instead-of-tuple.stderr
index 2448a5149..20f9e5259 100644
--- a/src/test/ui/suggestions/args-instead-of-tuple.stderr
+++ b/src/test/ui/suggestions/args-instead-of-tuple.stderr
@@ -44,7 +44,7 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
help: provide the argument
|
LL | let _: Option<()> = Some(());
- | ~~~~~~~~
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/args-instead-of-tuple.rs:14:34
diff --git a/src/test/ui/suggestions/as-ref-2.fixed b/src/test/ui/suggestions/as-ref-2.fixed
deleted file mode 100644
index 13bbb233f..000000000
--- a/src/test/ui/suggestions/as-ref-2.fixed
+++ /dev/null
@@ -1,13 +0,0 @@
-// run-rustfix
-
-struct Struct;
-
-fn bar(_: &Struct) -> Struct {
- Struct
-}
-
-fn main() {
- let foo = Some(Struct);
- let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s));
- let _y = foo; //~ERROR use of moved value: `foo`
-}
diff --git a/src/test/ui/suggestions/as-ref-2.rs b/src/test/ui/suggestions/as-ref-2.rs
index 74d61cdd9..b22f409b4 100644
--- a/src/test/ui/suggestions/as-ref-2.rs
+++ b/src/test/ui/suggestions/as-ref-2.rs
@@ -1,5 +1,3 @@
-// run-rustfix
-
struct Struct;
fn bar(_: &Struct) -> Struct {
diff --git a/src/test/ui/suggestions/as-ref-2.stderr b/src/test/ui/suggestions/as-ref-2.stderr
index 3c9d0f72a..e15e45d86 100644
--- a/src/test/ui/suggestions/as-ref-2.stderr
+++ b/src/test/ui/suggestions/as-ref-2.stderr
@@ -1,10 +1,12 @@
error[E0382]: use of moved value: `foo`
- --> $DIR/as-ref-2.rs:12:14
+ --> $DIR/as-ref-2.rs:10:14
|
LL | let foo = Some(Struct);
| --- move occurs because `foo` has type `Option<Struct>`, which does not implement the `Copy` trait
LL | let _x: Option<Struct> = foo.map(|s| bar(&s));
- | ---------------- `foo` moved due to this method call
+ | --- ---------------- `foo` moved due to this method call
+ | |
+ | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
LL | let _y = foo;
| ^^^ value used here after move
|
@@ -13,10 +15,6 @@ note: this function takes ownership of the receiver `self`, which moves `foo`
|
LL | pub const fn map<U, F>(self, f: F) -> Option<U>
| ^^^^
-help: consider calling `.as_ref()` to borrow the type's contents
- |
-LL | let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s));
- | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/as-ref.rs b/src/test/ui/suggestions/as-ref.rs
index 46d946153..a05353441 100644
--- a/src/test/ui/suggestions/as-ref.rs
+++ b/src/test/ui/suggestions/as-ref.rs
@@ -17,4 +17,11 @@ fn main() {
// note: do not suggest because of `E: usize`
let x: &Result<usize, usize> = &Ok(3);
let y: Result<&usize, usize> = x; //~ ERROR mismatched types [E0308]
+
+ let multiple_ref_opt = &&Some(Foo);
+ multiple_ref_opt.map(|arg| takes_ref(arg)); //~ ERROR mismatched types [E0308]
+ multiple_ref_opt.and_then(|arg| Some(takes_ref(arg))); //~ ERROR mismatched types [E0308]
+ let multiple_ref_result = &&Ok(Foo);
+ multiple_ref_result.map(|arg| takes_ref(arg)); //~ ERROR mismatched types [E0308]
+ multiple_ref_result.and_then(|arg| Ok(takes_ref(arg))); //~ ERROR mismatched types [E0308]
}
diff --git a/src/test/ui/suggestions/as-ref.stderr b/src/test/ui/suggestions/as-ref.stderr
index 1efd1b317..deafa9f48 100644
--- a/src/test/ui/suggestions/as-ref.stderr
+++ b/src/test/ui/suggestions/as-ref.stderr
@@ -97,6 +97,66 @@ LL | let y: Result<&usize, usize> = x;
= note: expected enum `Result<&usize, usize>`
found reference `&Result<usize, usize>`
-error: aborting due to 7 previous errors
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:22:42
+ |
+LL | multiple_ref_opt.map(|arg| takes_ref(arg));
+ | --- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().map`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:23:52
+ |
+LL | multiple_ref_opt.and_then(|arg| Some(takes_ref(arg)));
+ | -------- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().and_then`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:25:45
+ |
+LL | multiple_ref_result.map(|arg| takes_ref(arg));
+ | --- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().map`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:26:53
+ |
+LL | multiple_ref_result.and_then(|arg| Ok(takes_ref(arg)));
+ | -------- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().and_then`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error: aborting due to 11 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/assoc-const-as-field.stderr b/src/test/ui/suggestions/assoc-const-as-field.stderr
index 5e746ecb2..78e5634b2 100644
--- a/src/test/ui/suggestions/assoc-const-as-field.stderr
+++ b/src/test/ui/suggestions/assoc-const-as-field.stderr
@@ -2,9 +2,7 @@ error[E0423]: expected value, found struct `Mod::Foo`
--> $DIR/assoc-const-as-field.rs:11:9
|
LL | foo(Mod::Foo.Bar);
- | ^^^^^^^^----
- | |
- | help: use the path separator to refer to an item: `Mod::Foo::Bar`
+ | ^^^^^^^^- help: use the path separator to refer to an item: `::`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/assoc_fn_without_self.stderr b/src/test/ui/suggestions/assoc_fn_without_self.stderr
index 4a0e62e73..88920b852 100644
--- a/src/test/ui/suggestions/assoc_fn_without_self.stderr
+++ b/src/test/ui/suggestions/assoc_fn_without_self.stderr
@@ -1,10 +1,4 @@
error[E0425]: cannot find function `foo` in this scope
- --> $DIR/assoc_fn_without_self.rs:14:13
- |
-LL | foo();
- | ^^^ not found in this scope
-
-error[E0425]: cannot find function `foo` in this scope
--> $DIR/assoc_fn_without_self.rs:16:9
|
LL | foo();
@@ -32,6 +26,12 @@ help: consider using the associated function
LL | Self::baz(2, 3);
| ~~~~~~~~~
+error[E0425]: cannot find function `foo` in this scope
+ --> $DIR/assoc_fn_without_self.rs:14:13
+ |
+LL | foo();
+ | ^^^ not found in this scope
+
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
index c7d420e0a..8ed62f854 100644
--- a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
+++ b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
@@ -1,22 +1,19 @@
error[E0277]: `fn() -> impl Future<Output = ()> {foo}` is not a future
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:10:9
|
-LL | async fn foo() {}
- | --- consider calling this function
-...
LL | bar(foo);
| --- ^^^ `fn() -> impl Future<Output = ()> {foo}` is not a future
| |
| required by a bound introduced by this call
|
- = help: the trait `Future` is not implemented for `fn() -> impl Future<Output = ()> {foo}`
+ = help: the trait `Future` is not implemented for fn item `fn() -> impl Future<Output = ()> {foo}`
= note: fn() -> impl Future<Output = ()> {foo} must be a future or must implement `IntoFuture` to be awaited
note: required by a bound in `bar`
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
|
LL | fn bar(f: impl Future<Output=()>) {}
| ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
-help: use parentheses to call the function
+help: use parentheses to call this function
|
LL | bar(foo());
| ++
@@ -24,21 +21,19 @@ LL | bar(foo());
error[E0277]: `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]` is not a future
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:12:9
|
-LL | let async_closure = async || ();
- | -------- consider calling this closure
LL | bar(async_closure);
| --- ^^^^^^^^^^^^^ `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]` is not a future
| |
| required by a bound introduced by this call
|
- = help: the trait `Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]`
+ = help: the trait `Future` is not implemented for closure `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33]`
= note: [closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:33] must be a future or must implement `IntoFuture` to be awaited
note: required by a bound in `bar`
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:7:16
|
LL | fn bar(f: impl Future<Output=()>) {}
| ^^^^^^^^^^^^^^^^^ required by this bound in `bar`
-help: use parentheses to call the closure
+help: use parentheses to call this closure
|
LL | bar(async_closure());
| ++
diff --git a/src/test/ui/suggestions/bool_typo_err_suggest.rs b/src/test/ui/suggestions/bool_typo_err_suggest.rs
new file mode 100644
index 000000000..deab0fb05
--- /dev/null
+++ b/src/test/ui/suggestions/bool_typo_err_suggest.rs
@@ -0,0 +1,12 @@
+// Suggest the boolean value instead of emit a generic error that the value
+// True is not in the scope.
+
+fn main() {
+ let x = True;
+ //~^ ERROR cannot find value `True` in this scope
+ //~| HELP you may want to use a bool value instead
+
+ let y = False;
+ //~^ ERROR cannot find value `False` in this scope
+ //~| HELP you may want to use a bool value instead
+}
diff --git a/src/test/ui/suggestions/bool_typo_err_suggest.stderr b/src/test/ui/suggestions/bool_typo_err_suggest.stderr
new file mode 100644
index 000000000..52bde07ca
--- /dev/null
+++ b/src/test/ui/suggestions/bool_typo_err_suggest.stderr
@@ -0,0 +1,25 @@
+error[E0425]: cannot find value `True` in this scope
+ --> $DIR/bool_typo_err_suggest.rs:5:13
+ |
+LL | let x = True;
+ | ^^^^ not found in this scope
+ |
+help: you may want to use a bool value instead
+ |
+LL | let x = true;
+ | ~~~~
+
+error[E0425]: cannot find value `False` in this scope
+ --> $DIR/bool_typo_err_suggest.rs:9:13
+ |
+LL | let y = False;
+ | ^^^^^ not found in this scope
+ |
+help: you may want to use a bool value instead
+ |
+LL | let y = false;
+ | ~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/suggestions/boxed-variant-field.rs b/src/test/ui/suggestions/boxed-variant-field.rs
index e79be2f61..6050963c4 100644
--- a/src/test/ui/suggestions/boxed-variant-field.rs
+++ b/src/test/ui/suggestions/boxed-variant-field.rs
@@ -9,7 +9,6 @@ fn foo(x: Ty) -> Ty {
Ty::List(elem) => foo(elem),
//~^ ERROR mismatched types
//~| HELP consider unboxing the value
- //~| HELP try wrapping
}
}
diff --git a/src/test/ui/suggestions/boxed-variant-field.stderr b/src/test/ui/suggestions/boxed-variant-field.stderr
index 6dfb73480..9ae36a06a 100644
--- a/src/test/ui/suggestions/boxed-variant-field.stderr
+++ b/src/test/ui/suggestions/boxed-variant-field.stderr
@@ -17,10 +17,6 @@ help: consider unboxing the value
|
LL | Ty::List(elem) => foo(*elem),
| +
-help: try wrapping the expression in `Ty::List`
- |
-LL | Ty::List(elem) => foo(Ty::List(elem)),
- | +++++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/call-boxed.rs b/src/test/ui/suggestions/call-boxed.rs
new file mode 100644
index 000000000..d19e4596a
--- /dev/null
+++ b/src/test/ui/suggestions/call-boxed.rs
@@ -0,0 +1,7 @@
+fn main() {
+ let mut x = 1i32;
+ let y = Box::new(|| 1);
+ x = y;
+ //~^ ERROR mismatched types
+ //~| HELP use parentheses to call this closure
+}
diff --git a/src/test/ui/suggestions/call-boxed.stderr b/src/test/ui/suggestions/call-boxed.stderr
new file mode 100644
index 000000000..9b619ac9a
--- /dev/null
+++ b/src/test/ui/suggestions/call-boxed.stderr
@@ -0,0 +1,20 @@
+error[E0308]: mismatched types
+ --> $DIR/call-boxed.rs:4:9
+ |
+LL | let mut x = 1i32;
+ | ---- expected due to this value
+LL | let y = Box::new(|| 1);
+ | -- the found closure
+LL | x = y;
+ | ^ expected `i32`, found struct `Box`
+ |
+ = note: expected type `i32`
+ found struct `Box<[closure@$DIR/call-boxed.rs:3:22: 3:24]>`
+help: use parentheses to call this closure
+ |
+LL | x = y();
+ | ++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/call-on-missing.rs b/src/test/ui/suggestions/call-on-missing.rs
new file mode 100644
index 000000000..25ced84dd
--- /dev/null
+++ b/src/test/ui/suggestions/call-on-missing.rs
@@ -0,0 +1,39 @@
+struct Foo { i: i32 }
+
+impl Foo {
+ fn bar(&self) {}
+}
+
+fn foo() -> Foo {
+ Foo { i: 1 }
+}
+
+fn main() {
+ foo.bar();
+ //~^ ERROR no method named `bar`
+ //~| HELP use parentheses to call this function
+
+ foo.i;
+ //~^ ERROR no field `i`
+ //~| HELP use parentheses to call this function
+
+ let callable = Box::new(|| Foo { i: 1 }) as Box<dyn Fn() -> Foo>;
+
+ callable.bar();
+ //~^ ERROR no method named `bar`
+ //~| HELP use parentheses to call this trait object
+
+ callable.i;
+ //~^ ERROR no field `i`
+ //~| HELP use parentheses to call this trait object
+}
+
+fn type_param<T: Fn() -> Foo>(t: T) {
+ t.bar();
+ //~^ ERROR no method named `bar`
+ //~| HELP use parentheses to call this type parameter
+
+ t.i;
+ //~^ ERROR no field `i`
+ //~| HELP use parentheses to call this type parameter
+}
diff --git a/src/test/ui/suggestions/call-on-missing.stderr b/src/test/ui/suggestions/call-on-missing.stderr
new file mode 100644
index 000000000..ca9abc7e9
--- /dev/null
+++ b/src/test/ui/suggestions/call-on-missing.stderr
@@ -0,0 +1,75 @@
+error[E0599]: no method named `bar` found for fn item `fn() -> Foo {foo}` in the current scope
+ --> $DIR/call-on-missing.rs:12:9
+ |
+LL | foo.bar();
+ | ^^^ method not found in `fn() -> Foo {foo}`
+ |
+help: use parentheses to call this function
+ |
+LL | foo().bar();
+ | ++
+
+error[E0609]: no field `i` on type `fn() -> Foo {foo}`
+ --> $DIR/call-on-missing.rs:16:9
+ |
+LL | foo.i;
+ | ^
+ |
+help: use parentheses to call this function
+ |
+LL | foo().i;
+ | ++
+
+error[E0599]: no method named `bar` found for struct `Box<dyn Fn() -> Foo>` in the current scope
+ --> $DIR/call-on-missing.rs:22:14
+ |
+LL | callable.bar();
+ | ^^^ method not found in `Box<dyn Fn() -> Foo>`
+ |
+help: use parentheses to call this trait object
+ |
+LL | callable().bar();
+ | ++
+
+error[E0609]: no field `i` on type `Box<dyn Fn() -> Foo>`
+ --> $DIR/call-on-missing.rs:26:14
+ |
+LL | callable.i;
+ | ^ unknown field
+ |
+help: use parentheses to call this trait object
+ |
+LL | callable().i;
+ | ++
+
+error[E0599]: no method named `bar` found for type parameter `T` in the current scope
+ --> $DIR/call-on-missing.rs:32:7
+ |
+LL | fn type_param<T: Fn() -> Foo>(t: T) {
+ | - method `bar` not found for this type parameter
+LL | t.bar();
+ | ^^^ method not found in `T`
+ |
+help: use parentheses to call this type parameter
+ |
+LL | t().bar();
+ | ++
+
+error[E0609]: no field `i` on type `T`
+ --> $DIR/call-on-missing.rs:36:7
+ |
+LL | fn type_param<T: Fn() -> Foo>(t: T) {
+ | - type parameter 'T' declared here
+...
+LL | t.i;
+ | ^
+ |
+help: use parentheses to call this type parameter
+ |
+LL | t().i;
+ | ++
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0599, E0609.
+For more information about an error, try `rustc --explain E0599`.
diff --git a/src/test/ui/suggestions/call-on-unimplemented-ctor.rs b/src/test/ui/suggestions/call-on-unimplemented-ctor.rs
new file mode 100644
index 000000000..5f811044e
--- /dev/null
+++ b/src/test/ui/suggestions/call-on-unimplemented-ctor.rs
@@ -0,0 +1,17 @@
+fn main() {
+ insert_resource(Marker);
+ insert_resource(Time);
+ //~^ ERROR the trait bound `fn(u32) -> Time {Time}: Resource` is not satisfied
+ //~| HELP use parentheses to construct this tuple struct
+}
+
+trait Resource {}
+
+fn insert_resource<R: Resource>(resource: R) {}
+
+struct Marker;
+impl Resource for Marker {}
+
+struct Time(u32);
+
+impl Resource for Time {}
diff --git a/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr b/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr
new file mode 100644
index 000000000..58612cbfb
--- /dev/null
+++ b/src/test/ui/suggestions/call-on-unimplemented-ctor.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `fn(u32) -> Time {Time}: Resource` is not satisfied
+ --> $DIR/call-on-unimplemented-ctor.rs:3:21
+ |
+LL | insert_resource(Time);
+ | --------------- ^^^^ the trait `Resource` is not implemented for fn item `fn(u32) -> Time {Time}`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `insert_resource`
+ --> $DIR/call-on-unimplemented-ctor.rs:10:23
+ |
+LL | fn insert_resource<R: Resource>(resource: R) {}
+ | ^^^^^^^^ required by this bound in `insert_resource`
+help: use parentheses to construct this tuple struct
+ |
+LL | insert_resource(Time(/* u32 */));
+ | +++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs b/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs
new file mode 100644
index 000000000..86490c724
--- /dev/null
+++ b/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.rs
@@ -0,0 +1,15 @@
+struct Foo;
+
+trait Bar {}
+
+impl Bar for Foo {}
+
+fn needs_bar<T: Bar>(_: T) {}
+
+fn blah(f: fn() -> Foo) {
+ needs_bar(f);
+ //~^ ERROR the trait bound `fn() -> Foo: Bar` is not satisfied
+ //~| HELP use parentheses to call this function pointer
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.stderr b/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.stderr
new file mode 100644
index 000000000..167f7e592
--- /dev/null
+++ b/src/test/ui/suggestions/call-on-unimplemented-fn-ptr.stderr
@@ -0,0 +1,21 @@
+error[E0277]: the trait bound `fn() -> Foo: Bar` is not satisfied
+ --> $DIR/call-on-unimplemented-fn-ptr.rs:10:15
+ |
+LL | needs_bar(f);
+ | --------- ^ the trait `Bar` is not implemented for `fn() -> Foo`
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `needs_bar`
+ --> $DIR/call-on-unimplemented-fn-ptr.rs:7:17
+ |
+LL | fn needs_bar<T: Bar>(_: T) {}
+ | ^^^ required by this bound in `needs_bar`
+help: use parentheses to call this function pointer
+ |
+LL | needs_bar(f());
+ | ++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/suggestions/const-no-type.rs b/src/test/ui/suggestions/const-no-type.rs
index 6f46cfdf0..c6fdcdadb 100644
--- a/src/test/ui/suggestions/const-no-type.rs
+++ b/src/test/ui/suggestions/const-no-type.rs
@@ -14,38 +14,38 @@ fn main() {}
const C2 = 42;
//~^ ERROR missing type for `const` item
//~| HELP provide a type for the item
-//~| SUGGESTION C2: <type>
+//~| SUGGESTION : <type>
#[cfg(FALSE)]
static S2 = "abc";
//~^ ERROR missing type for `static` item
//~| HELP provide a type for the item
-//~| SUGGESTION S2: <type>
+//~| SUGGESTION : <type>
#[cfg(FALSE)]
static mut SM2 = "abc";
//~^ ERROR missing type for `static mut` item
//~| HELP provide a type for the item
-//~| SUGGESTION SM2: <type>
+//~| SUGGESTION : <type>
// These will, so the diagnostics should be stolen by typeck:
const C = 42;
//~^ ERROR missing type for `const` item
//~| HELP provide a type for the constant
-//~| SUGGESTION C: i32
+//~| SUGGESTION : i32
const D = &&42;
//~^ ERROR missing type for `const` item
//~| HELP provide a type for the constant
-//~| SUGGESTION D: &&i32
+//~| SUGGESTION : &&i32
static S = Vec::<String>::new();
//~^ ERROR missing type for `static` item
//~| HELP provide a type for the static variable
-//~| SUGGESTION S: Vec<String>
+//~| SUGGESTION : Vec<String>
static mut SM = "abc";
//~^ ERROR missing type for `static mut` item
//~| HELP provide a type for the static variable
-//~| SUGGESTION &str
+//~| SUGGESTION : &str
diff --git a/src/test/ui/suggestions/const-no-type.stderr b/src/test/ui/suggestions/const-no-type.stderr
index 3b0fd6337..bd703992f 100644
--- a/src/test/ui/suggestions/const-no-type.stderr
+++ b/src/test/ui/suggestions/const-no-type.stderr
@@ -1,44 +1,44 @@
error: missing type for `const` item
- --> $DIR/const-no-type.rs:33:7
+ --> $DIR/const-no-type.rs:33:8
|
LL | const C = 42;
- | ^ help: provide a type for the constant: `C: i32`
+ | ^ help: provide a type for the constant: `: i32`
error: missing type for `const` item
- --> $DIR/const-no-type.rs:38:7
+ --> $DIR/const-no-type.rs:38:8
|
LL | const D = &&42;
- | ^ help: provide a type for the constant: `D: &&i32`
+ | ^ help: provide a type for the constant: `: &&i32`
error: missing type for `static` item
- --> $DIR/const-no-type.rs:43:8
+ --> $DIR/const-no-type.rs:43:9
|
LL | static S = Vec::<String>::new();
- | ^ help: provide a type for the static variable: `S: Vec<String>`
+ | ^ help: provide a type for the static variable: `: Vec<String>`
error: missing type for `static mut` item
- --> $DIR/const-no-type.rs:48:12
+ --> $DIR/const-no-type.rs:48:14
|
LL | static mut SM = "abc";
- | ^^ help: provide a type for the static variable: `SM: &str`
+ | ^ help: provide a type for the static variable: `: &str`
error: missing type for `const` item
- --> $DIR/const-no-type.rs:14:7
+ --> $DIR/const-no-type.rs:14:9
|
LL | const C2 = 42;
- | ^^ help: provide a type for the item: `C2: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: missing type for `static` item
- --> $DIR/const-no-type.rs:20:8
+ --> $DIR/const-no-type.rs:20:10
|
LL | static S2 = "abc";
- | ^^ help: provide a type for the item: `S2: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: missing type for `static mut` item
- --> $DIR/const-no-type.rs:26:12
+ --> $DIR/const-no-type.rs:26:15
|
LL | static mut SM2 = "abc";
- | ^^^ help: provide a type for the item: `SM2: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: aborting due to 7 previous errors
diff --git a/src/test/ui/suggestions/copied-and-cloned.fixed b/src/test/ui/suggestions/copied-and-cloned.fixed
new file mode 100644
index 000000000..f801403fe
--- /dev/null
+++ b/src/test/ui/suggestions/copied-and-cloned.fixed
@@ -0,0 +1,23 @@
+// run-rustfix
+
+fn expect<T>(_: T) {}
+
+fn main() {
+ let x = Some(&());
+ expect::<Option<()>>(x.copied());
+ //~^ ERROR mismatched types
+ //~| HELP use `Option::copied` to copy the value inside the `Option`
+ let x = Ok(&());
+ expect::<Result<(), ()>>(x.copied());
+ //~^ ERROR mismatched types
+ //~| HELP use `Result::copied` to copy the value inside the `Result`
+ let s = String::new();
+ let x = Some(&s);
+ expect::<Option<String>>(x.cloned());
+ //~^ ERROR mismatched types
+ //~| HELP use `Option::cloned` to clone the value inside the `Option`
+ let x = Ok(&s);
+ expect::<Result<String, ()>>(x.cloned());
+ //~^ ERROR mismatched types
+ //~| HELP use `Result::cloned` to clone the value inside the `Result`
+}
diff --git a/src/test/ui/suggestions/copied-and-cloned.rs b/src/test/ui/suggestions/copied-and-cloned.rs
new file mode 100644
index 000000000..640450b76
--- /dev/null
+++ b/src/test/ui/suggestions/copied-and-cloned.rs
@@ -0,0 +1,23 @@
+// run-rustfix
+
+fn expect<T>(_: T) {}
+
+fn main() {
+ let x = Some(&());
+ expect::<Option<()>>(x);
+ //~^ ERROR mismatched types
+ //~| HELP use `Option::copied` to copy the value inside the `Option`
+ let x = Ok(&());
+ expect::<Result<(), ()>>(x);
+ //~^ ERROR mismatched types
+ //~| HELP use `Result::copied` to copy the value inside the `Result`
+ let s = String::new();
+ let x = Some(&s);
+ expect::<Option<String>>(x);
+ //~^ ERROR mismatched types
+ //~| HELP use `Option::cloned` to clone the value inside the `Option`
+ let x = Ok(&s);
+ expect::<Result<String, ()>>(x);
+ //~^ ERROR mismatched types
+ //~| HELP use `Result::cloned` to clone the value inside the `Result`
+}
diff --git a/src/test/ui/suggestions/copied-and-cloned.stderr b/src/test/ui/suggestions/copied-and-cloned.stderr
new file mode 100644
index 000000000..a6336281b
--- /dev/null
+++ b/src/test/ui/suggestions/copied-and-cloned.stderr
@@ -0,0 +1,83 @@
+error[E0308]: mismatched types
+ --> $DIR/copied-and-cloned.rs:7:26
+ |
+LL | expect::<Option<()>>(x);
+ | -------------------- ^ expected `()`, found `&()`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected enum `Option<()>`
+ found enum `Option<&()>`
+note: function defined here
+ --> $DIR/copied-and-cloned.rs:3:4
+ |
+LL | fn expect<T>(_: T) {}
+ | ^^^^^^ ----
+help: use `Option::copied` to copy the value inside the `Option`
+ |
+LL | expect::<Option<()>>(x.copied());
+ | +++++++++
+
+error[E0308]: mismatched types
+ --> $DIR/copied-and-cloned.rs:11:30
+ |
+LL | expect::<Result<(), ()>>(x);
+ | ------------------------ ^ expected `()`, found `&()`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected enum `Result<(), ()>`
+ found enum `Result<&(), _>`
+note: function defined here
+ --> $DIR/copied-and-cloned.rs:3:4
+ |
+LL | fn expect<T>(_: T) {}
+ | ^^^^^^ ----
+help: use `Result::copied` to copy the value inside the `Result`
+ |
+LL | expect::<Result<(), ()>>(x.copied());
+ | +++++++++
+
+error[E0308]: mismatched types
+ --> $DIR/copied-and-cloned.rs:16:30
+ |
+LL | expect::<Option<String>>(x);
+ | ------------------------ ^ expected struct `String`, found `&String`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected enum `Option<String>`
+ found enum `Option<&String>`
+note: function defined here
+ --> $DIR/copied-and-cloned.rs:3:4
+ |
+LL | fn expect<T>(_: T) {}
+ | ^^^^^^ ----
+help: use `Option::cloned` to clone the value inside the `Option`
+ |
+LL | expect::<Option<String>>(x.cloned());
+ | +++++++++
+
+error[E0308]: mismatched types
+ --> $DIR/copied-and-cloned.rs:20:34
+ |
+LL | expect::<Result<String, ()>>(x);
+ | ---------------------------- ^ expected struct `String`, found `&String`
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected enum `Result<String, ()>`
+ found enum `Result<&String, _>`
+note: function defined here
+ --> $DIR/copied-and-cloned.rs:3:4
+ |
+LL | fn expect<T>(_: T) {}
+ | ^^^^^^ ----
+help: use `Result::cloned` to clone the value inside the `Result`
+ |
+LL | expect::<Result<String, ()>>(x.cloned());
+ | +++++++++
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/deref-path-method.rs b/src/test/ui/suggestions/deref-path-method.rs
new file mode 100644
index 000000000..0281cdb6b
--- /dev/null
+++ b/src/test/ui/suggestions/deref-path-method.rs
@@ -0,0 +1,6 @@
+fn main() {
+ let vec = Vec::new();
+ Vec::contains(&vec, &0);
+ //~^ ERROR no function or associated item named `contains` found for struct `Vec<_, _>` in the current scope
+ //~| HELP the function `contains` is implemented on `[_]`
+}
diff --git a/src/test/ui/suggestions/deref-path-method.stderr b/src/test/ui/suggestions/deref-path-method.stderr
new file mode 100644
index 000000000..1cc37d611
--- /dev/null
+++ b/src/test/ui/suggestions/deref-path-method.stderr
@@ -0,0 +1,14 @@
+error[E0599]: no function or associated item named `contains` found for struct `Vec<_, _>` in the current scope
+ --> $DIR/deref-path-method.rs:3:10
+ |
+LL | Vec::contains(&vec, &0);
+ | ^^^^^^^^ function or associated item not found in `Vec<_, _>`
+ |
+help: the function `contains` is implemented on `[_]`
+ |
+LL | <[_]>::contains(&vec, &0);
+ | ~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/suggestions/derive-clone-for-eq.stderr b/src/test/ui/suggestions/derive-clone-for-eq.stderr
index 55a23c031..0645f0cdd 100644
--- a/src/test/ui/suggestions/derive-clone-for-eq.stderr
+++ b/src/test/ui/suggestions/derive-clone-for-eq.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `T: Clone` is not satisfied
LL | #[derive(Clone, Eq)]
| ^^ the trait `Clone` is not implemented for `T`
|
-note: required because of the requirements on the impl of `PartialEq` for `Struct<T>`
+note: required for `Struct<T>` to implement `PartialEq`
--> $DIR/derive-clone-for-eq.rs:9:19
|
LL | impl<T: Clone, U> PartialEq<U> for Struct<T>
diff --git a/src/test/ui/suggestions/derive-macro-missing-bounds.stderr b/src/test/ui/suggestions/derive-macro-missing-bounds.stderr
index 4186dc7cb..b9f773965 100644
--- a/src/test/ui/suggestions/derive-macro-missing-bounds.stderr
+++ b/src/test/ui/suggestions/derive-macro-missing-bounds.stderr
@@ -26,13 +26,13 @@ LL | #[derive(Debug)]
LL | struct Outer<T>(Inner<T>);
| ^^^^^^^^ the trait `c::Trait` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Debug` for `c::Inner<T>`
+note: required for `c::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:34:28
|
LL | impl<T: Debug + Trait> Debug for Inner<T> {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `Debug` for `&c::Inner<T>`
+ = note: required for `&c::Inner<T>` to implement `Debug`
= note: required for the cast from `&c::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
@@ -48,13 +48,13 @@ LL | #[derive(Debug)]
LL | struct Outer<T>(Inner<T>);
| ^^^^^^^^ the trait `d::Trait` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Debug` for `d::Inner<T>`
+note: required for `d::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:49:13
|
LL | impl<T> Debug for Inner<T> where T: Debug, T: Trait {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `Debug` for `&d::Inner<T>`
+ = note: required for `&d::Inner<T>` to implement `Debug`
= note: required for the cast from `&d::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
@@ -70,13 +70,13 @@ LL | #[derive(Debug)]
LL | struct Outer<T>(Inner<T>);
| ^^^^^^^^ the trait `e::Trait` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Debug` for `e::Inner<T>`
+note: required for `e::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:64:13
|
LL | impl<T> Debug for Inner<T> where T: Debug + Trait {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `Debug` for `&e::Inner<T>`
+ = note: required for `&e::Inner<T>` to implement `Debug`
= note: required for the cast from `&e::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
@@ -92,13 +92,13 @@ LL | #[derive(Debug)]
LL | struct Outer<T>(Inner<T>);
| ^^^^^^^^ the trait `f::Trait` is not implemented for `T`
|
-note: required because of the requirements on the impl of `Debug` for `f::Inner<T>`
+note: required for `f::Inner<T>` to implement `Debug`
--> $DIR/derive-macro-missing-bounds.rs:79:20
|
LL | impl<T: Debug> Debug for Inner<T> where T: Trait {
| ^^^^^ ^^^^^^^^
= note: 1 redundant requirement hidden
- = note: required because of the requirements on the impl of `Debug` for `&f::Inner<T>`
+ = note: required for `&f::Inner<T>` to implement `Debug`
= note: required for the cast from `&f::Inner<T>` to the object type `dyn Debug`
= note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider restricting type parameter `T`
diff --git a/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr b/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr
index 677aa031b..c66da3ea6 100644
--- a/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr
+++ b/src/test/ui/suggestions/dont-suggest-pin-array-dot-set.stderr
@@ -2,7 +2,7 @@ error[E0599]: no method named `set` found for array `[u8; 1]` in the current sco
--> $DIR/dont-suggest-pin-array-dot-set.rs:14:7
|
LL | a.set(0, 3);
- | ^^^ help: there is an associated function with a similar name: `get`
+ | ^^^ help: there is a method with a similar name: `get`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/dont-try-removing-the-field.rs b/src/test/ui/suggestions/dont-try-removing-the-field.rs
new file mode 100644
index 000000000..948aa2b94
--- /dev/null
+++ b/src/test/ui/suggestions/dont-try-removing-the-field.rs
@@ -0,0 +1,17 @@
+// run-pass
+
+#![allow(dead_code)]
+
+struct Foo {
+ foo: i32,
+ bar: i32,
+ baz: (),
+}
+
+fn use_foo(x: Foo) -> (i32, i32) {
+ let Foo { foo, bar, baz } = x; //~ WARNING unused variable: `baz`
+ //~| help: try ignoring the field
+ return (foo, bar);
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/dont-try-removing-the-field.stderr b/src/test/ui/suggestions/dont-try-removing-the-field.stderr
new file mode 100644
index 000000000..263171a4a
--- /dev/null
+++ b/src/test/ui/suggestions/dont-try-removing-the-field.stderr
@@ -0,0 +1,10 @@
+warning: unused variable: `baz`
+ --> $DIR/dont-try-removing-the-field.rs:12:25
+ |
+LL | let Foo { foo, bar, baz } = x;
+ | ^^^ help: try ignoring the field: `baz: _`
+ |
+ = note: `#[warn(unused_variables)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
index 71facf57e..77cef485f 100644
--- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
+++ b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
@@ -46,10 +46,12 @@ LL | pub const fn new(pointer: P) -> Pin<P> {
| ^^^
error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned
- --> $DIR/expected-boxed-future-isnt-pinned.rs:19:5
+ --> $DIR/expected-boxed-future-isnt-pinned.rs:19:14
|
LL | Pin::new(x)
- | ^^^^^^^^ the trait `Unpin` is not implemented for `dyn Future<Output = i32> + Send`
+ | -------- ^ the trait `Unpin` is not implemented for `dyn Future<Output = i32> + Send`
+ | |
+ | required by a bound introduced by this call
|
= note: consider using `Box::pin`
note: required by a bound in `Pin::<P>::new`
@@ -59,10 +61,12 @@ LL | impl<P: Deref<Target: Unpin>> Pin<P> {
| ^^^^^ required by this bound in `Pin::<P>::new`
error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned
- --> $DIR/expected-boxed-future-isnt-pinned.rs:24:5
+ --> $DIR/expected-boxed-future-isnt-pinned.rs:24:14
|
LL | Pin::new(Box::new(x))
- | ^^^^^^^^ the trait `Unpin` is not implemented for `dyn Future<Output = i32> + Send`
+ | -------- ^^^^^^^^^^^ the trait `Unpin` is not implemented for `dyn Future<Output = i32> + Send`
+ | |
+ | required by a bound introduced by this call
|
= note: consider using `Box::pin`
note: required by a bound in `Pin::<P>::new`
@@ -87,7 +91,7 @@ LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
| ------------------------------- the found opaque type
|
= note: expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>`
- found opaque type `impl Future`
+ found opaque type `impl Future<Output = {integer}>`
help: you need to pin and box this expression
|
LL ~ Box::pin(async {
diff --git a/src/test/ui/suggestions/field-access-considering-privacy.rs b/src/test/ui/suggestions/field-access-considering-privacy.rs
new file mode 100644
index 000000000..3de06b214
--- /dev/null
+++ b/src/test/ui/suggestions/field-access-considering-privacy.rs
@@ -0,0 +1,35 @@
+use a::TyCtxt;
+
+mod a {
+ use std::ops::Deref;
+ pub struct TyCtxt<'tcx> {
+ gcx: &'tcx GlobalCtxt<'tcx>,
+ }
+
+ impl<'tcx> Deref for TyCtxt<'tcx> {
+ type Target = &'tcx GlobalCtxt<'tcx>;
+
+ fn deref(&self) -> &Self::Target {
+ &self.gcx
+ }
+ }
+
+ pub struct GlobalCtxt<'tcx> {
+ pub sess: &'tcx Session,
+ _t: &'tcx (),
+ }
+
+ pub struct Session {
+ pub opts: (),
+ }
+}
+
+mod b {
+ fn foo<'tcx>(tcx: crate::TyCtxt<'tcx>) {
+ tcx.opts;
+ //~^ ERROR no field `opts` on type `TyCtxt<'tcx>`
+ //~| HELP one of the expressions' fields has a field of the same name
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/field-access-considering-privacy.stderr b/src/test/ui/suggestions/field-access-considering-privacy.stderr
new file mode 100644
index 000000000..cbf6f3d10
--- /dev/null
+++ b/src/test/ui/suggestions/field-access-considering-privacy.stderr
@@ -0,0 +1,14 @@
+error[E0609]: no field `opts` on type `TyCtxt<'tcx>`
+ --> $DIR/field-access-considering-privacy.rs:29:13
+ |
+LL | tcx.opts;
+ | ^^^^ unknown field
+ |
+help: one of the expressions' fields has a field of the same name
+ |
+LL | tcx.sess.opts;
+ | +++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0609`.
diff --git a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
index fb0a6f70b..955148315 100644
--- a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
+++ b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr
@@ -1,11 +1,8 @@
error[E0277]: the trait bound `fn() -> impl T<O = ()> {foo}: T` is not satisfied
--> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:17:9
|
-LL | fn foo() -> impl T<O=()> { S }
- | --- consider calling this function
-...
LL | bar(foo);
- | --- ^^^ the trait `T` is not implemented for `fn() -> impl T<O = ()> {foo}`
+ | --- ^^^ the trait `T` is not implemented for fn item `fn() -> impl T<O = ()> {foo}`
| |
| required by a bound introduced by this call
|
@@ -14,7 +11,7 @@ note: required by a bound in `bar`
|
LL | fn bar(f: impl T<O=()>) {}
| ^^^^^^^ required by this bound in `bar`
-help: use parentheses to call the function
+help: use parentheses to call this function
|
LL | bar(foo());
| ++
@@ -22,10 +19,8 @@ LL | bar(foo());
error[E0277]: the trait bound `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:21]: T` is not satisfied
--> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9
|
-LL | let closure = || S;
- | -- consider calling this closure
LL | bar(closure);
- | --- ^^^^^^^ the trait `T` is not implemented for `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:21]`
+ | --- ^^^^^^^ the trait `T` is not implemented for closure `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:21]`
| |
| required by a bound introduced by this call
|
@@ -34,7 +29,7 @@ note: required by a bound in `bar`
|
LL | fn bar(f: impl T<O=()>) {}
| ^^^^^^^ required by this bound in `bar`
-help: use parentheses to call the closure
+help: use parentheses to call this closure
|
LL | bar(closure());
| ++
diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
index e75ce0da8..597dc61c3 100644
--- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
+++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr
@@ -33,8 +33,8 @@ LL | let _: usize = foo;
found fn item `fn(usize, usize) -> usize {foo}`
help: use parentheses to call this function
|
-LL | let _: usize = foo(_, _);
- | ++++++
+LL | let _: usize = foo(/* usize */, /* usize */);
+ | ++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:30:16
@@ -49,10 +49,10 @@ LL | let _: S = S;
|
= note: expected struct `S`
found fn item `fn(usize, usize) -> S {S}`
-help: use parentheses to instantiate this tuple struct
+help: use parentheses to construct this tuple struct
|
-LL | let _: S = S(_, _);
- | ++++++
+LL | let _: S = S(/* usize */, /* usize */);
+ | ++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:31:20
@@ -85,7 +85,7 @@ LL | let _: V = V;
|
= note: expected struct `V`
found fn item `fn() -> V {V}`
-help: use parentheses to instantiate this tuple struct
+help: use parentheses to construct this tuple struct
|
LL | let _: V = V();
| ++
@@ -103,10 +103,10 @@ LL | let _: usize = T::baz;
|
= note: expected type `usize`
found fn item `fn(usize, usize) -> usize {<_ as T>::baz}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
-LL | let _: usize = T::baz(_, _);
- | ++++++
+LL | let _: usize = T::baz(/* usize */, /* usize */);
+ | ++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:34:20
@@ -121,10 +121,10 @@ LL | let _: usize = T::bat;
|
= note: expected type `usize`
found fn item `fn(usize) -> usize {<_ as T>::bat}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
-LL | let _: usize = T::bat(_);
- | +++
+LL | let _: usize = T::bat(/* usize */);
+ | +++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:35:16
@@ -139,10 +139,10 @@ LL | let _: E = E::A;
|
= note: expected enum `E`
found fn item `fn(usize) -> E {E::A}`
-help: use parentheses to instantiate this tuple variant
+help: use parentheses to construct this tuple variant
|
-LL | let _: E = E::A(_);
- | +++
+LL | let _: E = E::A(/* usize */);
+ | +++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:37:20
@@ -157,10 +157,10 @@ LL | let _: usize = X::baz;
|
= note: expected type `usize`
found fn item `fn(usize, usize) -> usize {<X as T>::baz}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
-LL | let _: usize = X::baz(_, _);
- | ++++++
+LL | let _: usize = X::baz(/* usize */, /* usize */);
+ | ++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:38:20
@@ -175,10 +175,10 @@ LL | let _: usize = X::bat;
|
= note: expected type `usize`
found fn item `fn(usize) -> usize {<X as T>::bat}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
-LL | let _: usize = X::bat(_);
- | +++
+LL | let _: usize = X::bat(/* usize */);
+ | +++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:39:20
@@ -193,10 +193,10 @@ LL | let _: usize = X::bax;
|
= note: expected type `usize`
found fn item `fn(usize) -> usize {<X as T>::bax}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
-LL | let _: usize = X::bax(_);
- | +++
+LL | let _: usize = X::bax(/* usize */);
+ | +++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:40:20
@@ -211,16 +211,16 @@ LL | let _: usize = X::bach;
|
= note: expected type `usize`
found fn item `fn(usize) -> usize {<X as T>::bach}`
-help: use parentheses to call this function
+help: use parentheses to call this associated function
|
-LL | let _: usize = X::bach(_);
- | +++
+LL | let _: usize = X::bach(/* usize */);
+ | +++++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:41:20
|
LL | fn ban(&self) -> usize { 42 }
- | ---------------------- for<'r> fn(&'r X) -> usize {<X as T>::ban} defined here
+ | ---------------------- for<'a> fn(&'a X) -> usize {<X as T>::ban} defined here
...
LL | let _: usize = X::ban;
| ----- ^^^^^^ expected `usize`, found fn item
@@ -228,17 +228,17 @@ LL | let _: usize = X::ban;
| expected due to this
|
= note: expected type `usize`
- found fn item `for<'r> fn(&'r X) -> usize {<X as T>::ban}`
-help: use parentheses to call this function
+ found fn item `for<'a> fn(&'a X) -> usize {<X as T>::ban}`
+help: use parentheses to call this associated function
|
-LL | let _: usize = X::ban(_);
- | +++
+LL | let _: usize = X::ban(/* &X */);
+ | ++++++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:42:20
|
LL | fn bal(&self) -> usize;
- | ----------------------- for<'r> fn(&'r X) -> usize {<X as T>::bal} defined here
+ | ----------------------- for<'a> fn(&'a X) -> usize {<X as T>::bal} defined here
...
LL | let _: usize = X::bal;
| ----- ^^^^^^ expected `usize`, found fn item
@@ -246,11 +246,11 @@ LL | let _: usize = X::bal;
| expected due to this
|
= note: expected type `usize`
- found fn item `for<'r> fn(&'r X) -> usize {<X as T>::bal}`
-help: use parentheses to call this function
+ found fn item `for<'a> fn(&'a X) -> usize {<X as T>::bal}`
+help: use parentheses to call this associated function
|
-LL | let _: usize = X::bal(_);
- | +++
+LL | let _: usize = X::bal(/* &X */);
+ | ++++++++++
error[E0615]: attempted to take value of method `ban` on type `X`
--> $DIR/fn-or-tuple-struct-without-args.rs:43:22
diff --git a/src/test/ui/suggestions/fn-to-method.rs b/src/test/ui/suggestions/fn-to-method.rs
new file mode 100644
index 000000000..9a35c3efc
--- /dev/null
+++ b/src/test/ui/suggestions/fn-to-method.rs
@@ -0,0 +1,19 @@
+struct Foo;
+
+impl Foo {
+ fn bar(self) {}
+}
+
+fn main() {
+ let x = cmp(&1, &2);
+ //~^ ERROR cannot find function `cmp` in this scope
+ //~| HELP use the `.` operator to call the method `Ord::cmp` on `&{integer}`
+
+ let y = len([1, 2, 3]);
+ //~^ ERROR cannot find function `len` in this scope
+ //~| HELP use the `.` operator to call the method `len` on `&[{integer}]`
+
+ let z = bar(Foo);
+ //~^ ERROR cannot find function `bar` in this scope
+ //~| HELP use the `.` operator to call the method `bar` on `Foo`
+}
diff --git a/src/test/ui/suggestions/fn-to-method.stderr b/src/test/ui/suggestions/fn-to-method.stderr
new file mode 100644
index 000000000..36c17e60d
--- /dev/null
+++ b/src/test/ui/suggestions/fn-to-method.stderr
@@ -0,0 +1,38 @@
+error[E0425]: cannot find function `cmp` in this scope
+ --> $DIR/fn-to-method.rs:8:13
+ |
+LL | let x = cmp(&1, &2);
+ | ^^^ not found in this scope
+ |
+help: use the `.` operator to call the method `Ord::cmp` on `&{integer}`
+ |
+LL | let x = (&1).cmp(&2);
+ | ~ ~~~~~~~~~
+
+error[E0425]: cannot find function `len` in this scope
+ --> $DIR/fn-to-method.rs:12:13
+ |
+LL | let y = len([1, 2, 3]);
+ | ^^^ not found in this scope
+ |
+help: use the `.` operator to call the method `len` on `&[{integer}]`
+ |
+LL - let y = len([1, 2, 3]);
+LL + let y = [1, 2, 3].len();
+ |
+
+error[E0425]: cannot find function `bar` in this scope
+ --> $DIR/fn-to-method.rs:16:13
+ |
+LL | let z = bar(Foo);
+ | ^^^ not found in this scope
+ |
+help: use the `.` operator to call the method `bar` on `Foo`
+ |
+LL - let z = bar(Foo);
+LL + let z = Foo.bar();
+ |
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/suggestions/format-borrow.stderr b/src/test/ui/suggestions/format-borrow.stderr
index fac6a5a5f..8ed2b9c9a 100644
--- a/src/test/ui/suggestions/format-borrow.stderr
+++ b/src/test/ui/suggestions/format-borrow.stderr
@@ -11,6 +11,10 @@ help: consider removing the borrow
LL - let a: String = &String::from("a");
LL + let a: String = String::from("a");
|
+help: alternatively, consider changing the type annotation
+ |
+LL | let a: &String = &String::from("a");
+ | +
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:4:21
@@ -25,6 +29,10 @@ help: consider removing the borrow
LL - let b: String = &format!("b");
LL + let b: String = format!("b");
|
+help: alternatively, consider changing the type annotation
+ |
+LL | let b: &String = &format!("b");
+ | +
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:6:21
@@ -39,6 +47,10 @@ help: consider removing the borrow
LL - let c: String = &mut format!("c");
LL + let c: String = format!("c");
|
+help: alternatively, consider changing the type annotation
+ |
+LL | let c: &mut String = &mut format!("c");
+ | ++++
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:8:21
@@ -53,6 +65,10 @@ help: consider removing the borrow
LL - let d: String = &mut (format!("d"));
LL + let d: String = format!("d"));
|
+help: alternatively, consider changing the type annotation
+ |
+LL | let d: &mut String = &mut (format!("d"));
+ | ++++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr b/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr
index ba6af8f15..864ab0535 100644
--- a/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr
+++ b/src/test/ui/suggestions/imm-ref-trait-object-literal-bound-regions.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `for<'b> &'b S: Trait` is not satisfied
- --> $DIR/imm-ref-trait-object-literal-bound-regions.rs:17:5
+ --> $DIR/imm-ref-trait-object-literal-bound-regions.rs:17:14
|
LL | foo::<S>(s);
- | ^^^^^^^^ the trait `for<'b> Trait` is not implemented for `&'b S`
+ | -------- ^ the trait `for<'b> Trait` is not implemented for `&'b S`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Trait` is implemented for `&'a mut S`
= note: `for<'b> Trait` is implemented for `&'b mut S`, but not for `&'b S`
diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr b/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
index 5f3f62a7b..e01102e38 100644
--- a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
+++ b/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr
@@ -21,7 +21,7 @@ error[E0277]: the trait bound `S: Trait` is not satisfied
--> $DIR/imm-ref-trait-object-literal.rs:13:7
|
LL | foo(s);
- | --- ^ expected an implementor of trait `Trait`
+ | --- ^ the trait `Trait` is not implemented for `S`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr b/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr
index e82a6f769..9833da13f 100644
--- a/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr
+++ b/src/test/ui/suggestions/impl-trait-missing-lifetime-gated.stderr
@@ -26,17 +26,25 @@ error[E0658]: anonymous lifetimes in `impl Trait` are unstable
--> $DIR/impl-trait-missing-lifetime-gated.rs:5:31
|
LL | fn f(_: impl Iterator<Item = &'_ ()>) {}
- | ^^
+ | ^^ expected named lifetime parameter
|
= help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
+help: consider introducing a named lifetime parameter
+ |
+LL | fn f<'a>(_: impl Iterator<Item = &'_'a ()>) {}
+ | ++++ ++
error[E0658]: anonymous lifetimes in `impl Trait` are unstable
--> $DIR/impl-trait-missing-lifetime-gated.rs:8:31
|
LL | fn g(x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
- | ^^
+ | ^^ expected named lifetime parameter
|
= help: add `#![feature(anonymous_lifetime_in_impl_trait)]` to the crate attributes to enable
+help: consider introducing a named lifetime parameter
+ |
+LL | fn g<'a>(x: impl Iterator<Item = &'_'a ()>) -> Option<&'_ ()> { x.next() }
+ | ++++ ++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/inner_type.fixed b/src/test/ui/suggestions/inner_type.fixed
new file mode 100644
index 000000000..7af7391ca
--- /dev/null
+++ b/src/test/ui/suggestions/inner_type.fixed
@@ -0,0 +1,40 @@
+// compile-flags: --edition=2021
+// run-rustfix
+
+pub struct Struct<T> {
+ pub p: T,
+}
+
+impl<T> Struct<T> {
+ pub fn method(&self) {}
+
+ pub fn some_mutable_method(&mut self) {}
+}
+
+fn main() {
+ let other_item = std::cell::RefCell::new(Struct { p: 42_u32 });
+
+ other_item.borrow().method();
+ //~^ ERROR no method named `method` found for struct `RefCell` in the current scope [E0599]
+ //~| HELP use `.borrow()` to borrow the `Struct<u32>`, panicking if a mutable borrow exists
+
+ other_item.borrow_mut().some_mutable_method();
+ //~^ ERROR no method named `some_mutable_method` found for struct `RefCell` in the current scope [E0599]
+ //~| HELP .borrow_mut()` to mutably borrow the `Struct<u32>`, panicking if any borrows exist
+
+ let another_item = std::sync::Mutex::new(Struct { p: 42_u32 });
+
+ another_item.lock().unwrap().method();
+ //~^ ERROR no method named `method` found for struct `Mutex` in the current scope [E0599]
+ //~| HELP use `.lock().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+
+ let another_item = std::sync::RwLock::new(Struct { p: 42_u32 });
+
+ another_item.read().unwrap().method();
+ //~^ ERROR no method named `method` found for struct `RwLock` in the current scope [E0599]
+ //~| HELP use `.read().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+
+ another_item.write().unwrap().some_mutable_method();
+ //~^ ERROR no method named `some_mutable_method` found for struct `RwLock` in the current scope [E0599]
+ //~| HELP use `.write().unwrap()` to mutably borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+}
diff --git a/src/test/ui/suggestions/inner_type.rs b/src/test/ui/suggestions/inner_type.rs
new file mode 100644
index 000000000..4aca50716
--- /dev/null
+++ b/src/test/ui/suggestions/inner_type.rs
@@ -0,0 +1,40 @@
+// compile-flags: --edition=2021
+// run-rustfix
+
+pub struct Struct<T> {
+ pub p: T,
+}
+
+impl<T> Struct<T> {
+ pub fn method(&self) {}
+
+ pub fn some_mutable_method(&mut self) {}
+}
+
+fn main() {
+ let other_item = std::cell::RefCell::new(Struct { p: 42_u32 });
+
+ other_item.method();
+ //~^ ERROR no method named `method` found for struct `RefCell` in the current scope [E0599]
+ //~| HELP use `.borrow()` to borrow the `Struct<u32>`, panicking if a mutable borrow exists
+
+ other_item.some_mutable_method();
+ //~^ ERROR no method named `some_mutable_method` found for struct `RefCell` in the current scope [E0599]
+ //~| HELP .borrow_mut()` to mutably borrow the `Struct<u32>`, panicking if any borrows exist
+
+ let another_item = std::sync::Mutex::new(Struct { p: 42_u32 });
+
+ another_item.method();
+ //~^ ERROR no method named `method` found for struct `Mutex` in the current scope [E0599]
+ //~| HELP use `.lock().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+
+ let another_item = std::sync::RwLock::new(Struct { p: 42_u32 });
+
+ another_item.method();
+ //~^ ERROR no method named `method` found for struct `RwLock` in the current scope [E0599]
+ //~| HELP use `.read().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+
+ another_item.some_mutable_method();
+ //~^ ERROR no method named `some_mutable_method` found for struct `RwLock` in the current scope [E0599]
+ //~| HELP use `.write().unwrap()` to mutably borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+}
diff --git a/src/test/ui/suggestions/inner_type.stderr b/src/test/ui/suggestions/inner_type.stderr
new file mode 100644
index 000000000..5ac3d04f1
--- /dev/null
+++ b/src/test/ui/suggestions/inner_type.stderr
@@ -0,0 +1,83 @@
+error[E0599]: no method named `method` found for struct `RefCell` in the current scope
+ --> $DIR/inner_type.rs:17:16
+ |
+LL | other_item.method();
+ | ^^^^^^ method not found in `RefCell<Struct<u32>>`
+ |
+note: the method `method` exists on the type `Struct<u32>`
+ --> $DIR/inner_type.rs:9:5
+ |
+LL | pub fn method(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^
+help: use `.borrow()` to borrow the `Struct<u32>`, panicking if a mutable borrow exists
+ |
+LL | other_item.borrow().method();
+ | +++++++++
+
+error[E0599]: no method named `some_mutable_method` found for struct `RefCell` in the current scope
+ --> $DIR/inner_type.rs:21:16
+ |
+LL | other_item.some_mutable_method();
+ | ^^^^^^^^^^^^^^^^^^^ method not found in `RefCell<Struct<u32>>`
+ |
+note: the method `some_mutable_method` exists on the type `Struct<u32>`
+ --> $DIR/inner_type.rs:11:5
+ |
+LL | pub fn some_mutable_method(&mut self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: use `.borrow_mut()` to mutably borrow the `Struct<u32>`, panicking if any borrows exist
+ |
+LL | other_item.borrow_mut().some_mutable_method();
+ | +++++++++++++
+
+error[E0599]: no method named `method` found for struct `Mutex` in the current scope
+ --> $DIR/inner_type.rs:27:18
+ |
+LL | another_item.method();
+ | ^^^^^^ method not found in `Mutex<Struct<u32>>`
+ |
+note: the method `method` exists on the type `Struct<u32>`
+ --> $DIR/inner_type.rs:9:5
+ |
+LL | pub fn method(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^
+help: use `.lock().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+ |
+LL | another_item.lock().unwrap().method();
+ | ++++++++++++++++
+
+error[E0599]: no method named `method` found for struct `RwLock` in the current scope
+ --> $DIR/inner_type.rs:33:18
+ |
+LL | another_item.method();
+ | ^^^^^^ method not found in `RwLock<Struct<u32>>`
+ |
+note: the method `method` exists on the type `Struct<u32>`
+ --> $DIR/inner_type.rs:9:5
+ |
+LL | pub fn method(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^
+help: use `.read().unwrap()` to borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+ |
+LL | another_item.read().unwrap().method();
+ | ++++++++++++++++
+
+error[E0599]: no method named `some_mutable_method` found for struct `RwLock` in the current scope
+ --> $DIR/inner_type.rs:37:18
+ |
+LL | another_item.some_mutable_method();
+ | ^^^^^^^^^^^^^^^^^^^ method not found in `RwLock<Struct<u32>>`
+ |
+note: the method `some_mutable_method` exists on the type `Struct<u32>`
+ --> $DIR/inner_type.rs:11:5
+ |
+LL | pub fn some_mutable_method(&mut self) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: use `.write().unwrap()` to mutably borrow the `Struct<u32>`, blocking the current thread until it can be acquired
+ |
+LL | another_item.write().unwrap().some_mutable_method();
+ | +++++++++++++++++
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/suggestions/inner_type2.rs b/src/test/ui/suggestions/inner_type2.rs
new file mode 100644
index 000000000..c56ea7c03
--- /dev/null
+++ b/src/test/ui/suggestions/inner_type2.rs
@@ -0,0 +1,26 @@
+pub struct Struct<T> {
+ pub p: T,
+}
+
+impl<T> Struct<T> {
+ pub fn method(&self) {}
+
+ pub fn some_mutable_method(&mut self) {}
+}
+
+thread_local! {
+ static STRUCT: Struct<u32> = Struct {
+ p: 42_u32
+ };
+}
+
+fn main() {
+ STRUCT.method();
+ //~^ ERROR no method named `method` found for struct `LocalKey` in the current scope [E0599]
+ //~| HELP use `with` or `try_with` to access thread local storage
+
+ let item = std::mem::MaybeUninit::new(Struct { p: 42_u32 });
+ item.method();
+ //~^ ERROR no method named `method` found for union `MaybeUninit` in the current scope [E0599]
+ //~| HELP if this `MaybeUninit::<Struct<u32>>` has been initialized, use one of the `assume_init` methods to access the inner value
+}
diff --git a/src/test/ui/suggestions/inner_type2.stderr b/src/test/ui/suggestions/inner_type2.stderr
new file mode 100644
index 000000000..eddfd9d63
--- /dev/null
+++ b/src/test/ui/suggestions/inner_type2.stderr
@@ -0,0 +1,29 @@
+error[E0599]: no method named `method` found for struct `LocalKey` in the current scope
+ --> $DIR/inner_type2.rs:18:12
+ |
+LL | STRUCT.method();
+ | ^^^^^^ method not found in `LocalKey<Struct<u32>>`
+ |
+ = help: use `with` or `try_with` to access thread local storage
+note: the method `method` exists on the type `Struct<u32>`
+ --> $DIR/inner_type2.rs:6:5
+ |
+LL | pub fn method(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error[E0599]: no method named `method` found for union `MaybeUninit` in the current scope
+ --> $DIR/inner_type2.rs:23:10
+ |
+LL | item.method();
+ | ^^^^^^ method not found in `MaybeUninit<Struct<u32>>`
+ |
+ = help: if this `MaybeUninit::<Struct<u32>>` has been initialized, use one of the `assume_init` methods to access the inner value
+note: the method `method` exists on the type `Struct<u32>`
+ --> $DIR/inner_type2.rs:6:5
+ |
+LL | pub fn method(&self) {}
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/suggestions/into-convert.rs b/src/test/ui/suggestions/into-convert.rs
new file mode 100644
index 000000000..1c9a9e0aa
--- /dev/null
+++ b/src/test/ui/suggestions/into-convert.rs
@@ -0,0 +1,26 @@
+use std::path::{Path, PathBuf};
+use std::sync::atomic::AtomicU32;
+use std::sync::Arc;
+
+fn main() {
+ let x: A = B;
+ //~^ ERROR mismatched types
+ //~| HELP call `Into::into` on this expression to convert `B` into `A`
+
+ let y: Arc<Path> = PathBuf::new();
+ //~^ ERROR mismatched types
+ //~| HELP call `Into::into` on this expression to convert `PathBuf` into `Arc<Path>`
+
+ let z: AtomicU32 = 1;
+ //~^ ERROR mismatched types
+ //~| HELP call `Into::into` on this expression to convert `{integer}` into `AtomicU32`
+}
+
+struct A;
+struct B;
+
+impl From<B> for A {
+ fn from(_: B) -> Self {
+ A
+ }
+}
diff --git a/src/test/ui/suggestions/into-convert.stderr b/src/test/ui/suggestions/into-convert.stderr
new file mode 100644
index 000000000..d43104a21
--- /dev/null
+++ b/src/test/ui/suggestions/into-convert.stderr
@@ -0,0 +1,44 @@
+error[E0308]: mismatched types
+ --> $DIR/into-convert.rs:6:16
+ |
+LL | let x: A = B;
+ | - ^ expected struct `A`, found struct `B`
+ | |
+ | expected due to this
+ |
+help: call `Into::into` on this expression to convert `B` into `A`
+ |
+LL | let x: A = B.into();
+ | +++++++
+
+error[E0308]: mismatched types
+ --> $DIR/into-convert.rs:10:24
+ |
+LL | let y: Arc<Path> = PathBuf::new();
+ | --------- ^^^^^^^^^^^^^^ expected struct `Arc`, found struct `PathBuf`
+ | |
+ | expected due to this
+ |
+ = note: expected struct `Arc<Path>`
+ found struct `PathBuf`
+help: call `Into::into` on this expression to convert `PathBuf` into `Arc<Path>`
+ |
+LL | let y: Arc<Path> = PathBuf::new().into();
+ | +++++++
+
+error[E0308]: mismatched types
+ --> $DIR/into-convert.rs:14:24
+ |
+LL | let z: AtomicU32 = 1;
+ | --------- ^ expected struct `AtomicU32`, found integer
+ | |
+ | expected due to this
+ |
+help: call `Into::into` on this expression to convert `{integer}` into `AtomicU32`
+ |
+LL | let z: AtomicU32 = 1.into();
+ | +++++++
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/into-str.stderr b/src/test/ui/suggestions/into-str.stderr
index 8ae5c8479..a56a2a188 100644
--- a/src/test/ui/suggestions/into-str.stderr
+++ b/src/test/ui/suggestions/into-str.stderr
@@ -14,7 +14,7 @@ LL | foo(String::new());
<String as From<Box<str>>>
<String as From<Cow<'a, str>>>
<String as From<char>>
- = note: required because of the requirements on the impl of `Into<&str>` for `String`
+ = note: required for `String` to implement `Into<&str>`
note: required by a bound in `foo`
--> $DIR/into-str.rs:1:31
|
diff --git a/src/test/ui/suggestions/issue-101065.fixed b/src/test/ui/suggestions/issue-101065.fixed
new file mode 100644
index 000000000..88c716cc8
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101065.fixed
@@ -0,0 +1,14 @@
+// check-fail
+// run-rustfix
+
+enum FakeResult<T> {
+ Ok(T)
+}
+
+fn main() {
+ let _x = if true {
+ FakeResult::Ok(FakeResult::Ok(()))
+ } else {
+ FakeResult::Ok(FakeResult::Ok(())) //~ERROR E0308
+ };
+}
diff --git a/src/test/ui/suggestions/issue-101065.rs b/src/test/ui/suggestions/issue-101065.rs
new file mode 100644
index 000000000..2715f1027
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101065.rs
@@ -0,0 +1,14 @@
+// check-fail
+// run-rustfix
+
+enum FakeResult<T> {
+ Ok(T)
+}
+
+fn main() {
+ let _x = if true {
+ FakeResult::Ok(FakeResult::Ok(()))
+ } else {
+ FakeResult::Ok(()) //~ERROR E0308
+ };
+}
diff --git a/src/test/ui/suggestions/issue-101065.stderr b/src/test/ui/suggestions/issue-101065.stderr
new file mode 100644
index 000000000..6f7ecd24c
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101065.stderr
@@ -0,0 +1,23 @@
+error[E0308]: `if` and `else` have incompatible types
+ --> $DIR/issue-101065.rs:12:9
+ |
+LL | let _x = if true {
+ | ______________-
+LL | | FakeResult::Ok(FakeResult::Ok(()))
+ | | ---------------------------------- expected because of this
+LL | | } else {
+LL | | FakeResult::Ok(())
+ | | ^^^^^^^^^^^^^^^^^^ expected enum `FakeResult`, found `()`
+LL | | };
+ | |_____- `if` and `else` have incompatible types
+ |
+ = note: expected enum `FakeResult<FakeResult<()>>`
+ found enum `FakeResult<()>`
+help: try wrapping the expression in `FakeResult::Ok`
+ |
+LL | FakeResult::Ok(FakeResult::Ok(()))
+ | +++++++++++++++ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/issue-101421.rs b/src/test/ui/suggestions/issue-101421.rs
new file mode 100644
index 000000000..b615997d1
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101421.rs
@@ -0,0 +1,12 @@
+pub trait Ice {
+ fn f(&self, _: ());
+}
+
+impl Ice for () {
+ fn f(&self, _: ()) {}
+}
+
+fn main() {
+ ().f::<()>(());
+ //~^ ERROR this associated function takes 0 generic arguments but 1 generic argument was supplied
+}
diff --git a/src/test/ui/suggestions/issue-101421.stderr b/src/test/ui/suggestions/issue-101421.stderr
new file mode 100644
index 000000000..f8e1efb88
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101421.stderr
@@ -0,0 +1,17 @@
+error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/issue-101421.rs:10:8
+ |
+LL | ().f::<()>(());
+ | ^------ help: remove these generics
+ | |
+ | expected 0 generic arguments
+ |
+note: associated function defined here, with 0 generic parameters
+ --> $DIR/issue-101421.rs:2:8
+ |
+LL | fn f(&self, _: ());
+ | ^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/suggestions/issue-101465.rs b/src/test/ui/suggestions/issue-101465.rs
new file mode 100644
index 000000000..8e42e2c22
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101465.rs
@@ -0,0 +1,25 @@
+#![feature(trait_alias)]
+
+struct B;
+struct C;
+
+trait Tr {}
+
+impl Tr for B {}
+impl Tr for C {}
+
+trait Tr2<S> = Into<S>;
+
+fn foo2<T: Tr2<()>>() {}
+
+fn foo() -> impl Tr {
+ let x = foo2::<_>();
+
+ match true {
+ true => B,
+ false => C,
+ //~^ `match` arms have incompatible types
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-101465.stderr b/src/test/ui/suggestions/issue-101465.stderr
new file mode 100644
index 000000000..e2ca77712
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101465.stderr
@@ -0,0 +1,25 @@
+error[E0308]: `match` arms have incompatible types
+ --> $DIR/issue-101465.rs:20:18
+ |
+LL | / match true {
+LL | | true => B,
+ | | - this is found to be of type `B`
+LL | | false => C,
+ | | ^ expected struct `B`, found struct `C`
+LL | |
+LL | | }
+ | |_____- `match` arms have incompatible types
+ |
+help: you could change the return type to be a boxed trait object
+ |
+LL | fn foo() -> Box<dyn Tr> {
+ | ~~~~~~~ +
+help: if you change the return type to expect trait objects, box the returned expressions
+ |
+LL ~ true => Box::new(B),
+LL ~ false => Box::new(C),
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/issue-101623.rs b/src/test/ui/suggestions/issue-101623.rs
new file mode 100644
index 000000000..d18a4a21f
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101623.rs
@@ -0,0 +1,25 @@
+pub struct Stuff {
+ inner: *mut (),
+}
+
+pub struct Wrap<T>(T);
+
+fn fun<T>(t: T) -> Wrap<T> {
+ todo!()
+}
+
+pub trait Trait<'de> {
+ fn do_stuff(_: Wrap<&'de mut Self>);
+}
+
+impl<'a> Trait<'a> for () {
+ fn do_stuff(_: Wrap<&'a mut Self>) {}
+}
+
+fn fun2(t: &mut Stuff) -> () {
+ let Stuff { inner, .. } = t;
+ Trait::do_stuff({ fun(&mut *inner) });
+ //~^ ERROR the trait bound `*mut (): Trait<'_>` is not satisfied
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-101623.stderr b/src/test/ui/suggestions/issue-101623.stderr
new file mode 100644
index 000000000..361483cc0
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101623.stderr
@@ -0,0 +1,14 @@
+error[E0277]: the trait bound `*mut (): Trait<'_>` is not satisfied
+ --> $DIR/issue-101623.rs:21:21
+ |
+LL | Trait::do_stuff({ fun(&mut *inner) });
+ | --------------- ^^----------------^^
+ | | |
+ | | the trait `Trait<'_>` is not implemented for `*mut ()`
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Trait<'a>` is implemented for `()`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/suggestions/issue-101984.rs b/src/test/ui/suggestions/issue-101984.rs
new file mode 100644
index 000000000..5f7ecb77e
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101984.rs
@@ -0,0 +1,27 @@
+use std::marker::PhantomData;
+
+type Component = fn(&());
+
+struct Wrapper {
+ router: Router<(Component, Box<Self>)>,
+}
+
+struct Match<C>(PhantomData<C>);
+
+struct Router<T>(PhantomData<T>);
+
+impl<T> Router<T> {
+ pub fn at(&self) -> Result<Match<&T>, ()> {
+ todo!()
+ }
+}
+
+impl Wrapper {
+ fn at(&self, path: &str) -> Result<(Component, Box<Self>), ()> {
+ let (cmp, router) = self.router.at()?;
+ //~^ ERROR mismatched types
+ todo!()
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-101984.stderr b/src/test/ui/suggestions/issue-101984.stderr
new file mode 100644
index 000000000..81758a700
--- /dev/null
+++ b/src/test/ui/suggestions/issue-101984.stderr
@@ -0,0 +1,14 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-101984.rs:21:13
+ |
+LL | let (cmp, router) = self.router.at()?;
+ | ^^^^^^^^^^^^^ ----------------- this expression has type `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
+ | |
+ | expected struct `Match`, found tuple
+ |
+ = note: expected struct `Match<&(for<'a> fn(&'a ()), Box<Wrapper>)>`
+ found tuple `(_, _)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/issue-102354.rs b/src/test/ui/suggestions/issue-102354.rs
new file mode 100644
index 000000000..f881feb00
--- /dev/null
+++ b/src/test/ui/suggestions/issue-102354.rs
@@ -0,0 +1,10 @@
+trait Trait {
+ fn func() {}
+}
+
+impl Trait for i32 {}
+
+fn main() {
+ let x: i32 = 123;
+ x.func(); //~ERROR no method
+}
diff --git a/src/test/ui/suggestions/issue-102354.stderr b/src/test/ui/suggestions/issue-102354.stderr
new file mode 100644
index 000000000..4f76c5f2e
--- /dev/null
+++ b/src/test/ui/suggestions/issue-102354.stderr
@@ -0,0 +1,24 @@
+error[E0599]: no method named `func` found for type `i32` in the current scope
+ --> $DIR/issue-102354.rs:9:7
+ |
+LL | x.func();
+ | ^^^^ this is an associated function, not a method
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: the candidate is defined in the trait `Trait`
+ --> $DIR/issue-102354.rs:2:5
+ |
+LL | fn func() {}
+ | ^^^^^^^^^
+help: use associated function syntax instead
+ |
+LL | i32::func();
+ | ~~~~~~~~~
+help: disambiguate the associated function for the candidate
+ |
+LL | <i32 as Trait>::func(x);
+ | ~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/suggestions/issue-102892.rs b/src/test/ui/suggestions/issue-102892.rs
new file mode 100644
index 000000000..c1a791d8d
--- /dev/null
+++ b/src/test/ui/suggestions/issue-102892.rs
@@ -0,0 +1,25 @@
+#![allow(dead_code, unused_variables)]
+
+use std::sync::Arc;
+
+#[derive(Debug)]
+struct A;
+#[derive(Debug)]
+struct B;
+
+fn process_without_annot(arc: &Arc<(A, B)>) {
+ let (a, b) = **arc; // suggests putting `&**arc` here; with that, fixed!
+}
+
+fn process_with_annot(arc: &Arc<(A, B)>) {
+ let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
+ //~^ ERROR mismatched types
+}
+
+fn process_with_tuple_annot(mutation: &mut (A, B), arc: &Arc<(A, B)>) {
+ let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-102892.stderr b/src/test/ui/suggestions/issue-102892.stderr
new file mode 100644
index 000000000..a3dbc7cb8
--- /dev/null
+++ b/src/test/ui/suggestions/issue-102892.stderr
@@ -0,0 +1,57 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-102892.rs:15:26
+ |
+LL | let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
+ | ------ ^^^^^^ expected tuple, found `&(A, B)`
+ | |
+ | expected due to this
+ |
+ = note: expected tuple `(A, B)`
+ found reference `&(A, B)`
+help: consider removing the borrow
+ |
+LL - let (a, b): (A, B) = &**arc; // suggests putting `&**arc` here too
+LL + let (a, b): (A, B) = **arc; // suggests putting `&**arc` here too
+ |
+help: alternatively, consider changing the type annotation
+ |
+LL | let (a, b): &(A, B) = &**arc; // suggests putting `&**arc` here too
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/issue-102892.rs:20:32
+ |
+LL | let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
+ | ^^^^^^^^^^^^^^ expected tuple, found `&mut (A, B)`
+ |
+ = note: expected tuple `(A, B)`
+ found mutable reference `&mut (A, B)`
+help: consider removing the borrow
+ |
+LL - let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
+LL + let (a, b): ((A, B), A) = (*mutation, &(**arc).0); // suggests putting `&**arc` here too
+ |
+help: alternatively, consider changing the type annotation
+ |
+LL | let (a, b): (&mut (A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
+ | ++++
+
+error[E0308]: mismatched types
+ --> $DIR/issue-102892.rs:20:48
+ |
+LL | let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
+ | ^^^^^^^^^^ expected struct `A`, found `&A`
+ |
+help: consider removing the borrow
+ |
+LL - let (a, b): ((A, B), A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
+LL + let (a, b): ((A, B), A) = (&mut *mutation, (**arc).0); // suggests putting `&**arc` here too
+ |
+help: alternatively, consider changing the type annotation
+ |
+LL | let (a, b): ((A, B), &A) = (&mut *mutation, &(**arc).0); // suggests putting `&**arc` here too
+ | +
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/issue-103112.rs b/src/test/ui/suggestions/issue-103112.rs
new file mode 100644
index 000000000..111ae7c73
--- /dev/null
+++ b/src/test/ui/suggestions/issue-103112.rs
@@ -0,0 +1,4 @@
+fn main() {
+ std::process::abort!();
+ //~^ ERROR: failed to resolve
+}
diff --git a/src/test/ui/suggestions/issue-103112.stderr b/src/test/ui/suggestions/issue-103112.stderr
new file mode 100644
index 000000000..4ca7fdf9b
--- /dev/null
+++ b/src/test/ui/suggestions/issue-103112.stderr
@@ -0,0 +1,15 @@
+error[E0433]: failed to resolve: could not find `abort` in `process`
+ --> $DIR/issue-103112.rs:2:19
+ |
+LL | std::process::abort!();
+ | ^^^^^ could not find `abort` in `process`
+ |
+help: std::process::abort is not a macro, but a function, try to remove `!`
+ |
+LL - std::process::abort!();
+LL + std::process::abort();
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/src/test/ui/suggestions/issue-61963.stderr b/src/test/ui/suggestions/issue-61963.stderr
index c0d776e59..b99b1b0b9 100644
--- a/src/test/ui/suggestions/issue-61963.stderr
+++ b/src/test/ui/suggestions/issue-61963.stderr
@@ -4,18 +4,17 @@ error: trait objects without an explicit `dyn` are deprecated
LL | bar: Box<Bar>,
| ^^^
|
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
note: the lint level is defined here
--> $DIR/issue-61963.rs:3:9
|
LL | #![deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
- = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - bar: Box<Bar>,
-LL + bar: Box<dyn Bar>,
- |
+LL | bar: Box<dyn Bar>,
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:18:1
@@ -27,9 +26,8 @@ LL | pub struct Foo {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub struct Foo {
-LL + dyn pub struct Foo {
- |
+LL | dyn pub struct Foo {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:28:14
@@ -41,9 +39,8 @@ LL | bar: Box<Bar>,
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - bar: Box<Bar>,
-LL + bar: Box<dyn Bar>,
- |
+LL | bar: Box<dyn Bar>,
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:28:14
@@ -55,9 +52,8 @@ LL | bar: Box<Bar>,
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - bar: Box<Bar>,
-LL + bar: Box<dyn Bar>,
- |
+LL | bar: Box<dyn Bar>,
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:18:1
@@ -69,9 +65,8 @@ LL | pub struct Foo {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub struct Foo {
-LL + dyn pub struct Foo {
- |
+LL | dyn pub struct Foo {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:18:1
@@ -83,9 +78,8 @@ LL | pub struct Foo {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub struct Foo {
-LL + dyn pub struct Foo {
- |
+LL | dyn pub struct Foo {
+ | +++
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:18:1
@@ -97,9 +91,8 @@ LL | pub struct Foo {
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
help: use `dyn`
|
-LL - pub struct Foo {
-LL + dyn pub struct Foo {
- |
+LL | dyn pub struct Foo {
+ | +++
error: aborting due to 7 previous errors
diff --git a/src/test/ui/suggestions/issue-62843.stderr b/src/test/ui/suggestions/issue-62843.stderr
index bc1c69406..62f0943d4 100644
--- a/src/test/ui/suggestions/issue-62843.stderr
+++ b/src/test/ui/suggestions/issue-62843.stderr
@@ -2,12 +2,12 @@ error[E0277]: expected a `FnMut<(char,)>` closure, found `String`
--> $DIR/issue-62843.rs:4:32
|
LL | println!("{:?}", line.find(pattern));
- | ---- ^^^^^^^ expected an implementor of trait `Pattern<'_>`
+ | ---- ^^^^^^^ the trait `Pattern<'_>` is not implemented for `String`
| |
| required by a bound introduced by this call
|
= note: the trait bound `String: Pattern<'_>` is not satisfied
- = note: required because of the requirements on the impl of `Pattern<'_>` for `String`
+ = note: required for `String` to implement `Pattern<'_>`
note: required by a bound in `core::str::<impl str>::find`
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
diff --git a/src/test/ui/suggestions/issue-71394-no-from-impl.stderr b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr
index 383f40d47..684db23e1 100644
--- a/src/test/ui/suggestions/issue-71394-no-from-impl.stderr
+++ b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr
@@ -1,13 +1,15 @@
error[E0277]: the trait bound `&[i8]: From<&[u8]>` is not satisfied
- --> $DIR/issue-71394-no-from-impl.rs:3:25
+ --> $DIR/issue-71394-no-from-impl.rs:3:20
|
LL | let _: &[i8] = data.into();
- | ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]`
+ | ^^^^ ---- required by a bound introduced by this call
+ | |
+ | the trait `From<&[u8]>` is not implemented for `&[i8]`
|
= help: the following other types implement trait `From<T>`:
<[T; LANES] as From<Simd<T, LANES>>>
<[bool; LANES] as From<Mask<T, LANES>>>
- = note: required because of the requirements on the impl of `Into<&[i8]>` for `&[u8]`
+ = note: required for `&[u8]` to implement `Into<&[i8]>`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/issue-84973-2.stderr b/src/test/ui/suggestions/issue-84973-2.stderr
index 2c54ea672..513bf28fb 100644
--- a/src/test/ui/suggestions/issue-84973-2.stderr
+++ b/src/test/ui/suggestions/issue-84973-2.stderr
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `i32: Tr` is not satisfied
--> $DIR/issue-84973-2.rs:11:9
|
LL | foo(a);
- | --- ^ expected an implementor of trait `Tr`
+ | --- ^ the trait `Tr` is not implemented for `i32`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/suggestions/issue-84973-blacklist.stderr b/src/test/ui/suggestions/issue-84973-blacklist.stderr
index ae0d3efca..c20cc8164 100644
--- a/src/test/ui/suggestions/issue-84973-blacklist.stderr
+++ b/src/test/ui/suggestions/issue-84973-blacklist.stderr
@@ -31,10 +31,12 @@ LL | #[derive(Clone)]
|
error[E0277]: `[static generator@$DIR/issue-84973-blacklist.rs:17:13: 17:22]` cannot be unpinned
- --> $DIR/issue-84973-blacklist.rs:17:5
+ --> $DIR/issue-84973-blacklist.rs:17:13
|
LL | f_unpin(static || { yield; });
- | ^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/issue-84973-blacklist.rs:17:13: 17:22]`
+ | ------- ^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `[static generator@$DIR/issue-84973-blacklist.rs:17:13: 17:22]`
+ | |
+ | required by a bound introduced by this call
|
= note: consider using `Box::pin`
note: required by a bound in `f_unpin`
diff --git a/src/test/ui/suggestions/issue-84973-negative.stderr b/src/test/ui/suggestions/issue-84973-negative.stderr
index 15559d4ae..ce838bce0 100644
--- a/src/test/ui/suggestions/issue-84973-negative.stderr
+++ b/src/test/ui/suggestions/issue-84973-negative.stderr
@@ -17,7 +17,7 @@ error[E0277]: the trait bound `f32: Tr` is not satisfied
--> $DIR/issue-84973-negative.rs:11:9
|
LL | bar(b);
- | --- ^ expected an implementor of trait `Tr`
+ | --- ^ the trait `Tr` is not implemented for `f32`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/suggestions/issue-84973.stderr b/src/test/ui/suggestions/issue-84973.stderr
index 24c989ec3..ae2bf5aac 100644
--- a/src/test/ui/suggestions/issue-84973.stderr
+++ b/src/test/ui/suggestions/issue-84973.stderr
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `Fancy: SomeTrait` is not satisfied
--> $DIR/issue-84973.rs:6:24
|
LL | let o = Other::new(f);
- | ---------- ^ expected an implementor of trait `SomeTrait`
+ | ---------- ^ the trait `SomeTrait` is not implemented for `Fancy`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/suggestions/issue-85347.rs b/src/test/ui/suggestions/issue-85347.rs
index f08e38689..02b5fb618 100644
--- a/src/test/ui/suggestions/issue-85347.rs
+++ b/src/test/ui/suggestions/issue-85347.rs
@@ -1,9 +1,8 @@
-#![allow(incomplete_features)]
-#![feature(generic_associated_types)]
use std::ops::Deref;
trait Foo {
type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>;
//~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+ //~| ERROR associated type bindings are not allowed here
//~| HELP add missing
}
diff --git a/src/test/ui/suggestions/issue-85347.stderr b/src/test/ui/suggestions/issue-85347.stderr
index fccd2ef8d..17c1b7dc4 100644
--- a/src/test/ui/suggestions/issue-85347.stderr
+++ b/src/test/ui/suggestions/issue-85347.stderr
@@ -1,11 +1,11 @@
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
- --> $DIR/issue-85347.rs:5:42
+ --> $DIR/issue-85347.rs:3:42
|
LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>;
| ^^^ expected 1 lifetime argument
|
note: associated type defined here, with 1 lifetime parameter: `'a`
- --> $DIR/issue-85347.rs:5:10
+ --> $DIR/issue-85347.rs:3:10
|
LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>;
| ^^^ --
@@ -14,6 +14,13 @@ help: add missing lifetime argument
LL | type Bar<'a>: Deref<Target = <Self>::Bar<'a, Target = Self>>;
| +++
-error: aborting due to previous error
+error[E0229]: associated type bindings are not allowed here
+ --> $DIR/issue-85347.rs:3:46
+ |
+LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>;
+ | ^^^^^^^^^^^^^ associated type not allowed here
+
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0107`.
+Some errors have detailed explanations: E0107, E0229.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/suggestions/issue-89064.rs b/src/test/ui/suggestions/issue-89064.rs
new file mode 100644
index 000000000..fa5fc899d
--- /dev/null
+++ b/src/test/ui/suggestions/issue-89064.rs
@@ -0,0 +1,35 @@
+use std::convert::TryInto;
+
+trait A<T> {
+ fn foo() {}
+}
+
+trait B<T, U> {
+ fn bar() {}
+}
+
+struct S;
+
+impl<T> A<T> for S {}
+impl<T, U> B<T, U> for S {}
+
+fn main() {
+ let _ = A::foo::<S>();
+ //~^ ERROR
+ //~| HELP remove these generics
+ //~| HELP consider moving this generic argument
+
+ let _ = B::bar::<S, S>();
+ //~^ ERROR
+ //~| HELP remove these generics
+ //~| HELP consider moving these generic arguments
+
+ let _ = A::<S>::foo::<S>();
+ //~^ ERROR
+ //~| HELP remove these generics
+
+ let _ = 42.into::<Option<_>>();
+ //~^ ERROR
+ //~| HELP remove these generics
+ //~| HELP consider moving this generic argument
+}
diff --git a/src/test/ui/suggestions/issue-89064.stderr b/src/test/ui/suggestions/issue-89064.stderr
new file mode 100644
index 000000000..8b2a38816
--- /dev/null
+++ b/src/test/ui/suggestions/issue-89064.stderr
@@ -0,0 +1,82 @@
+error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/issue-89064.rs:17:16
+ |
+LL | let _ = A::foo::<S>();
+ | ^^^ expected 0 generic arguments
+ |
+note: associated function defined here, with 0 generic parameters
+ --> $DIR/issue-89064.rs:4:8
+ |
+LL | fn foo() {}
+ | ^^^
+help: consider moving this generic argument to the `A` trait, which takes up to 1 argument
+ |
+LL - let _ = A::foo::<S>();
+LL + let _ = A::<S>::foo();
+ |
+help: remove these generics
+ |
+LL - let _ = A::foo::<S>();
+LL + let _ = A::foo();
+ |
+
+error[E0107]: this associated function takes 0 generic arguments but 2 generic arguments were supplied
+ --> $DIR/issue-89064.rs:22:16
+ |
+LL | let _ = B::bar::<S, S>();
+ | ^^^ expected 0 generic arguments
+ |
+note: associated function defined here, with 0 generic parameters
+ --> $DIR/issue-89064.rs:8:8
+ |
+LL | fn bar() {}
+ | ^^^
+help: consider moving these generic arguments to the `B` trait, which takes up to 2 arguments
+ |
+LL - let _ = B::bar::<S, S>();
+LL + let _ = B::<S, S>::bar();
+ |
+help: remove these generics
+ |
+LL - let _ = B::bar::<S, S>();
+LL + let _ = B::bar();
+ |
+
+error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/issue-89064.rs:27:21
+ |
+LL | let _ = A::<S>::foo::<S>();
+ | ^^^----- help: remove these generics
+ | |
+ | expected 0 generic arguments
+ |
+note: associated function defined here, with 0 generic parameters
+ --> $DIR/issue-89064.rs:4:8
+ |
+LL | fn foo() {}
+ | ^^^
+
+error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/issue-89064.rs:31:16
+ |
+LL | let _ = 42.into::<Option<_>>();
+ | ^^^^ expected 0 generic arguments
+ |
+note: associated function defined here, with 0 generic parameters
+ --> $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ |
+LL | fn into(self) -> T;
+ | ^^^^
+help: consider moving this generic argument to the `Into` trait, which takes up to 1 argument
+ |
+LL | let _ = Into::<Option<_>>::into(42);
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+help: remove these generics
+ |
+LL - let _ = 42.into::<Option<_>>();
+LL + let _ = 42.into();
+ |
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/suggestions/issue-96223.stderr b/src/test/ui/suggestions/issue-96223.stderr
index 513725d99..72a9a739a 100644
--- a/src/test/ui/suggestions/issue-96223.stderr
+++ b/src/test/ui/suggestions/issue-96223.stderr
@@ -7,12 +7,12 @@ LL | icey_bounds(&p);
| required by a bound introduced by this call
|
= help: the trait `Foo<'de>` is implemented for `Baz<T>`
-note: required because of the requirements on the impl of `for<'de> Foo<'de>` for `Baz<EmptyBis<'de>>`
+note: required for `Baz<EmptyBis<'de>>` to implement `for<'de> Foo<'de>`
--> $DIR/issue-96223.rs:16:14
|
LL | impl<'de, T> Foo<'de> for Baz<T> where T: Foo<'de> {}
| ^^^^^^^^ ^^^^^^
-note: required because of the requirements on the impl of `Dummy<EmptyMarker>` for `Empty`
+note: required for `Empty` to implement `Dummy<EmptyMarker>`
--> $DIR/issue-96223.rs:20:9
|
LL | impl<M> Dummy<M> for Empty
diff --git a/src/test/ui/suggestions/issue-96555.stderr b/src/test/ui/suggestions/issue-96555.stderr
index a1a603cf2..9a8a183dc 100644
--- a/src/test/ui/suggestions/issue-96555.stderr
+++ b/src/test/ui/suggestions/issue-96555.stderr
@@ -8,7 +8,7 @@ LL | m::f1().await;
|
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
- = note: required because of the requirements on the impl of `IntoFuture` for `()`
+ = note: required for `()` to implement `IntoFuture`
help: remove the `.await`
|
LL - m::f1().await;
@@ -29,7 +29,7 @@ LL | m::f2().await;
|
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
- = note: required because of the requirements on the impl of `IntoFuture` for `()`
+ = note: required for `()` to implement `IntoFuture`
help: remove the `.await`
|
LL - m::f2().await;
@@ -50,7 +50,7 @@ LL | m::f3().await;
|
= help: the trait `Future` is not implemented for `()`
= note: () must be a future or must implement `IntoFuture` to be awaited
- = note: required because of the requirements on the impl of `IntoFuture` for `()`
+ = note: required for `()` to implement `IntoFuture`
help: remove the `.await`
|
LL - m::f3().await;
diff --git a/src/test/ui/suggestions/issue-97677.fixed b/src/test/ui/suggestions/issue-97677.fixed
index 73ca9f97b..1e7569fa4 100644
--- a/src/test/ui/suggestions/issue-97677.fixed
+++ b/src/test/ui/suggestions/issue-97677.fixed
@@ -1,6 +1,6 @@
// run-rustfix
-fn add_ten<N: std::ops::Add<i32, Output=N>>(n: N) -> N {
+fn add_ten<N: std::ops::Add<i32, Output = N>>(n: N) -> N {
n + 10
//~^ ERROR cannot add `{integer}` to `N`
}
diff --git a/src/test/ui/suggestions/issue-97677.stderr b/src/test/ui/suggestions/issue-97677.stderr
index 069b184ac..575d79267 100644
--- a/src/test/ui/suggestions/issue-97677.stderr
+++ b/src/test/ui/suggestions/issue-97677.stderr
@@ -8,8 +8,8 @@ LL | n + 10
|
help: consider restricting type parameter `N`
|
-LL | fn add_ten<N: std::ops::Add<i32, Output=N>>(n: N) -> N {
- | ++++++++++++++++++++++++++++++
+LL | fn add_ten<N: std::ops::Add<i32, Output = N>>(n: N) -> N {
+ | ++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr
index 0212c2d71..872263fd7 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr
@@ -22,8 +22,9 @@ LL | | });
| |______^
help: consider adding an explicit lifetime bound...
|
-LL | fn func<T: Test + 'a>(foo: &Foo, t: T) {
- | ++++
+LL | fn func<'a, T: Test + 'a>(foo: &Foo, t: T) {
+ | +++ ++++
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0311`.
diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
index 0d749f04b..fa758bf05 100644
--- a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
+++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature.stderr
@@ -18,7 +18,7 @@ LL | | *dest = g.get();
LL | | }
| |_____^
|
-help: to declare that the `impl Trait` captures `'_`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl FnOnce()` captures `'_`, you can add an explicit `'_` lifetime bound
|
LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
| ++++
@@ -47,8 +47,10 @@ LL | | }
| |_____^
help: consider adding an explicit lifetime bound...
|
-LL | G: Get<T> + 'a,
- | ++++
+LL ~ fn bar<'a, G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
+LL | where
+LL ~ G: Get<T> + 'a,
+ |
error[E0311]: the parameter type `G` may not live long enough
--> $DIR/missing-lifetimes-in-signature.rs:52:5
@@ -74,8 +76,8 @@ LL | | }
| |_____^
help: consider adding an explicit lifetime bound...
|
-LL | fn qux<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
- | ++++
+LL | fn qux<'b, 'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
+ | +++ ++++
error[E0311]: the parameter type `G` may not live long enough
--> $DIR/missing-lifetimes-in-signature.rs:61:9
@@ -101,8 +103,8 @@ LL | | }
| |_________^
help: consider adding an explicit lifetime bound...
|
-LL | fn qux<'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
- | ++++
+LL | fn qux<'c, 'b, G: Get<T> + 'b + 'c, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
+ | +++ ++++
error[E0311]: the parameter type `G` may not live long enough
--> $DIR/missing-lifetimes-in-signature.rs:73:5
@@ -130,8 +132,8 @@ LL | | }
| |_____^
help: consider adding an explicit lifetime bound...
|
-LL | fn bat<'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
- | ++++
+LL | fn bat<'b, 'a, G: 'a + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
+ | +++ ++++
error[E0621]: explicit lifetime required in the type of `dest`
--> $DIR/missing-lifetimes-in-signature.rs:73:5
@@ -162,5 +164,5 @@ LL | G: Get<T> + 'a,
error: aborting due to 8 previous errors
-Some errors have detailed explanations: E0261, E0309, E0621, E0700.
+Some errors have detailed explanations: E0261, E0309, E0311, E0621, E0700.
For more information about an error, try `rustc --explain E0261`.
diff --git a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
index f49876bcd..c77ef79e7 100644
--- a/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
+++ b/src/test/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr
@@ -10,7 +10,7 @@ LL | | remaining: self.0.iter(),
LL | | }
| |_________^ returning this value requires that `'1` must outlive `'static`
|
-help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
+help: to declare that `impl Iterator<Item = Box<(dyn Foo + 'static)>>` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
| ++++
@@ -65,7 +65,7 @@ LL | | remaining: self.0.iter(),
LL | | }
| |_________^ returning this value requires that `'a` must outlive `'static`
|
-help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'a` lifetime bound
+help: to declare that `impl Iterator<Item = Box<(dyn Foo + 'static)>>` captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
| ++++
diff --git a/src/test/ui/suggestions/many-type-ascription.rs b/src/test/ui/suggestions/many-type-ascription.rs
new file mode 100644
index 000000000..31ac556b9
--- /dev/null
+++ b/src/test/ui/suggestions/many-type-ascription.rs
@@ -0,0 +1,4 @@
+fn main() {
+ let _ = 0: i32; //~ ERROR: type ascription is experimental
+ let _ = 0: i32; // (error only emitted once)
+}
diff --git a/src/test/ui/suggestions/many-type-ascription.stderr b/src/test/ui/suggestions/many-type-ascription.stderr
new file mode 100644
index 000000000..3706bbae9
--- /dev/null
+++ b/src/test/ui/suggestions/many-type-ascription.stderr
@@ -0,0 +1,12 @@
+error[E0658]: type ascription is experimental
+ --> $DIR/many-type-ascription.rs:2:13
+ |
+LL | let _ = 0: i32;
+ | ^^^^^^
+ |
+ = note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
+ = help: add `#![feature(type_ascription)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr b/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr
index be6fc2615..00aa7d18a 100644
--- a/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr
+++ b/src/test/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr
@@ -7,7 +7,7 @@ LL | fn not_all_paths(a: &str) -> u32 {
| implicitly returns `()` as its body has no tail or `return` expression
...
LL | };
- | - help: remove this semicolon
+ | - help: remove this semicolon to return this value
error[E0308]: `match` arms have incompatible types
--> $DIR/match-with-different-arm-types-as-stmt-instead-of-expr.rs:26:14
diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr b/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr
index e0f405eed..9e6f0d9eb 100644
--- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr
+++ b/src/test/ui/suggestions/missing-bound-in-manual-copy-impl-2.stderr
@@ -1,11 +1,11 @@
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/missing-bound-in-manual-copy-impl-2.rs:16:9
+ --> $DIR/missing-bound-in-manual-copy-impl-2.rs:16:18
|
LL | struct Wrapper<T>(T);
| - this field does not implement `Copy`
...
LL | impl<S> Copy for Wrapper<OnlyCopyIfDisplay<S>> {}
- | ^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the `Copy` impl for `OnlyCopyIfDisplay<S>` requires that `S: std::fmt::Display`
--> $DIR/missing-bound-in-manual-copy-impl-2.rs:4:19
diff --git a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr b/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr
index 218988511..fe2d133c8 100644
--- a/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr
+++ b/src/test/ui/suggestions/missing-bound-in-manual-copy-impl.stderr
@@ -1,11 +1,11 @@
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/missing-bound-in-manual-copy-impl.rs:6:9
+ --> $DIR/missing-bound-in-manual-copy-impl.rs:6:18
|
LL | struct Wrapper<T>(T);
| - this field does not implement `Copy`
LL |
LL | impl<S> Copy for Wrapper<S> {}
- | ^^^^
+ | ^^^^^^^^^^
|
help: consider restricting type parameter `S`
|
diff --git a/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs b/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs
new file mode 100644
index 000000000..2f540060a
--- /dev/null
+++ b/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.rs
@@ -0,0 +1,18 @@
+// Generalizes the suggestion introduced in #100838
+
+trait Foo<T> {
+ fn bar(&self, _: T);
+}
+
+impl Foo<i32> for i32 {
+ fn bar(&self, x: i32) {
+ println!("{}", self + x);
+ }
+}
+
+fn main() {
+ 1.bar::<i32>(0);
+ //~^ ERROR this associated function takes 0 generic arguments but 1 generic argument was supplied
+ //~| HELP consider moving this generic argument to the `Foo` trait, which takes up to 1 argument
+ //~| HELP remove these generics
+}
diff --git a/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr b/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr
new file mode 100644
index 000000000..9557220f6
--- /dev/null
+++ b/src/test/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr
@@ -0,0 +1,24 @@
+error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+ --> $DIR/move-generic-to-trait-in-method-with-params.rs:14:7
+ |
+LL | 1.bar::<i32>(0);
+ | ^^^ expected 0 generic arguments
+ |
+note: associated function defined here, with 0 generic parameters
+ --> $DIR/move-generic-to-trait-in-method-with-params.rs:4:8
+ |
+LL | fn bar(&self, _: T);
+ | ^^^
+help: consider moving this generic argument to the `Foo` trait, which takes up to 1 argument
+ |
+LL | Foo::<i32>::bar(1, 0);
+ | ~~~~~~~~~~~~~~~~~~~~~
+help: remove these generics
+ |
+LL - 1.bar::<i32>(0);
+LL + 1.bar(0);
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs b/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs
index 98b408daa..a7a3f9818 100644
--- a/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs
+++ b/src/test/ui/suggestions/non-existent-field-present-in-subfield-recursion-limit.rs
@@ -1,4 +1,4 @@
-// In rustc_typeck::check::expr::no_such_field_err we recursively
+// In rustc_hir_analysis::check::expr::no_such_field_err we recursively
// look in subfields for the field. This recursive search is limited
// in depth for compile-time reasons and to avoid infinite recursion
// in case of cycles. This file tests that the limit in the recursion
diff --git a/src/test/ui/suggestions/option-content-move.fixed b/src/test/ui/suggestions/option-content-move.fixed
deleted file mode 100644
index ba16bcc8a..000000000
--- a/src/test/ui/suggestions/option-content-move.fixed
+++ /dev/null
@@ -1,39 +0,0 @@
-//run-rustfix
-
-pub struct LipogramCorpora {
- selections: Vec<(char, Option<String>)>,
-}
-
-impl LipogramCorpora {
- pub fn validate_all(&mut self) -> Result<(), char> {
- for selection in &self.selections {
- if selection.1.is_some() {
- if selection.1.as_ref().unwrap().contains(selection.0) {
- //~^ ERROR cannot move out of `selection.1`
- return Err(selection.0);
- }
- }
- }
- Ok(())
- }
-}
-
-pub struct LipogramCorpora2 {
- selections: Vec<(char, Result<String, String>)>,
-}
-
-impl LipogramCorpora2 {
- pub fn validate_all(&mut self) -> Result<(), char> {
- for selection in &self.selections {
- if selection.1.is_ok() {
- if selection.1.as_ref().unwrap().contains(selection.0) {
- //~^ ERROR cannot move out of `selection.1`
- return Err(selection.0);
- }
- }
- }
- Ok(())
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/suggestions/option-content-move.rs b/src/test/ui/suggestions/option-content-move.rs
index ef38f114e..46c895b95 100644
--- a/src/test/ui/suggestions/option-content-move.rs
+++ b/src/test/ui/suggestions/option-content-move.rs
@@ -1,5 +1,3 @@
-//run-rustfix
-
pub struct LipogramCorpora {
selections: Vec<(char, Option<String>)>,
}
diff --git a/src/test/ui/suggestions/option-content-move.stderr b/src/test/ui/suggestions/option-content-move.stderr
index fccfbe1d7..a6f1ebc97 100644
--- a/src/test/ui/suggestions/option-content-move.stderr
+++ b/src/test/ui/suggestions/option-content-move.stderr
@@ -1,9 +1,10 @@
error[E0507]: cannot move out of `selection.1` which is behind a shared reference
- --> $DIR/option-content-move.rs:11:20
+ --> $DIR/option-content-move.rs:9:20
|
LL | if selection.1.unwrap().contains(selection.0) {
| ^^^^^^^^^^^ -------- `selection.1` moved due to this method call
| |
+ | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
| move occurs because `selection.1` has type `Option<String>`, which does not implement the `Copy` trait
|
note: this function takes ownership of the receiver `self`, which moves `selection.1`
@@ -11,17 +12,14 @@ note: this function takes ownership of the receiver `self`, which moves `selecti
|
LL | pub const fn unwrap(self) -> T {
| ^^^^
-help: consider calling `.as_ref()` to borrow the type's contents
- |
-LL | if selection.1.as_ref().unwrap().contains(selection.0) {
- | +++++++++
error[E0507]: cannot move out of `selection.1` which is behind a shared reference
- --> $DIR/option-content-move.rs:29:20
+ --> $DIR/option-content-move.rs:27:20
|
LL | if selection.1.unwrap().contains(selection.0) {
| ^^^^^^^^^^^ -------- `selection.1` moved due to this method call
| |
+ | help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents
| move occurs because `selection.1` has type `Result<String, String>`, which does not implement the `Copy` trait
|
note: this function takes ownership of the receiver `self`, which moves `selection.1`
@@ -29,10 +27,6 @@ note: this function takes ownership of the receiver `self`, which moves `selecti
|
LL | pub fn unwrap(self) -> T
| ^^^^
-help: consider calling `.as_ref()` to borrow the type's contents
- |
-LL | if selection.1.as_ref().unwrap().contains(selection.0) {
- | +++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/suggestions/restrict-type-not-param.rs b/src/test/ui/suggestions/restrict-type-not-param.rs
new file mode 100644
index 000000000..60f5ba45c
--- /dev/null
+++ b/src/test/ui/suggestions/restrict-type-not-param.rs
@@ -0,0 +1,12 @@
+use std::ops::Add;
+
+struct Wrapper<T>(T);
+
+trait Foo {}
+
+fn qux<T>(a: Wrapper<T>, b: T) -> T {
+ a + b
+ //~^ ERROR cannot add `T` to `Wrapper<T>`
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/restrict-type-not-param.stderr b/src/test/ui/suggestions/restrict-type-not-param.stderr
new file mode 100644
index 000000000..e7d9c5ecb
--- /dev/null
+++ b/src/test/ui/suggestions/restrict-type-not-param.stderr
@@ -0,0 +1,26 @@
+error[E0369]: cannot add `T` to `Wrapper<T>`
+ --> $DIR/restrict-type-not-param.rs:8:7
+ |
+LL | a + b
+ | - ^ - T
+ | |
+ | Wrapper<T>
+ |
+note: an implementation of `Add<_>` might be missing for `Wrapper<T>`
+ --> $DIR/restrict-type-not-param.rs:3:1
+ |
+LL | struct Wrapper<T>(T);
+ | ^^^^^^^^^^^^^^^^^ must implement `Add<_>`
+note: the following trait must be implemented
+ --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ |
+LL | pub trait Add<Rhs = Self> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
+help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
+ |
+LL | fn qux<T>(a: Wrapper<T>, b: T) -> T where Wrapper<T>: Add<T, Output = T> {
+ | ++++++++++++++++++++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0369`.
diff --git a/src/test/ui/suggestions/return-closures.rs b/src/test/ui/suggestions/return-closures.rs
new file mode 100644
index 000000000..86c7c1537
--- /dev/null
+++ b/src/test/ui/suggestions/return-closures.rs
@@ -0,0 +1,13 @@
+fn foo() {
+ //~^ HELP try adding a return type
+ |x: &i32| 1i32
+ //~^ ERROR mismatched types
+}
+
+fn bar(i: impl Sized) {
+ //~^ HELP a return type might be missing here
+ || i
+ //~^ ERROR mismatched types
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/return-closures.stderr b/src/test/ui/suggestions/return-closures.stderr
new file mode 100644
index 000000000..8b856d8de
--- /dev/null
+++ b/src/test/ui/suggestions/return-closures.stderr
@@ -0,0 +1,27 @@
+error[E0308]: mismatched types
+ --> $DIR/return-closures.rs:3:5
+ |
+LL | fn foo() {
+ | - help: try adding a return type: `-> impl for<'a> Fn(&'a i32) -> i32`
+LL |
+LL | |x: &i32| 1i32
+ | ^^^^^^^^^^^^^^ expected `()`, found closure
+ |
+ = note: expected unit type `()`
+ found closure `[closure@$DIR/return-closures.rs:3:5: 3:14]`
+
+error[E0308]: mismatched types
+ --> $DIR/return-closures.rs:9:5
+ |
+LL | fn bar(i: impl Sized) {
+ | - help: a return type might be missing here: `-> _`
+LL |
+LL | || i
+ | ^^^^ expected `()`, found closure
+ |
+ = note: expected unit type `()`
+ found closure `[closure@$DIR/return-closures.rs:9:5: 9:7]`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/return-cycle-2.rs b/src/test/ui/suggestions/return-cycle-2.rs
new file mode 100644
index 000000000..d6d24be1b
--- /dev/null
+++ b/src/test/ui/suggestions/return-cycle-2.rs
@@ -0,0 +1,14 @@
+use std::marker::PhantomData;
+
+struct Token<T>(PhantomData<T>);
+
+impl<T> Token<T> {
+ fn as_ref(_: i32, _: i32) -> _ {
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
+ //~| NOTE not allowed in type signatures
+ //~| HELP replace with the correct return type
+ Token(PhantomData::<&T>)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/return-cycle-2.stderr b/src/test/ui/suggestions/return-cycle-2.stderr
new file mode 100644
index 000000000..3a1a0f7f4
--- /dev/null
+++ b/src/test/ui/suggestions/return-cycle-2.stderr
@@ -0,0 +1,12 @@
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/return-cycle-2.rs:6:34
+ |
+LL | fn as_ref(_: i32, _: i32) -> _ {
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `Token<&'static T>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/src/test/ui/suggestions/return-cycle.rs b/src/test/ui/suggestions/return-cycle.rs
new file mode 100644
index 000000000..60b80e35a
--- /dev/null
+++ b/src/test/ui/suggestions/return-cycle.rs
@@ -0,0 +1,14 @@
+use std::marker::PhantomData;
+
+struct Token<T>(PhantomData<T>);
+
+impl<T> Token<T> {
+ fn new() -> _ {
+ //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types
+ //~| NOTE not allowed in type signatures
+ //~| HELP replace with the correct return type
+ Token(PhantomData::<()>)
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/return-cycle.stderr b/src/test/ui/suggestions/return-cycle.stderr
new file mode 100644
index 000000000..63fa9e040
--- /dev/null
+++ b/src/test/ui/suggestions/return-cycle.stderr
@@ -0,0 +1,12 @@
+error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/return-cycle.rs:6:17
+ |
+LL | fn new() -> _ {
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `Token<()>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0121`.
diff --git a/src/test/ui/suggestions/slice-issue-87994.stderr b/src/test/ui/suggestions/slice-issue-87994.stderr
index fd2a44f9a..84ecd749b 100644
--- a/src/test/ui/suggestions/slice-issue-87994.stderr
+++ b/src/test/ui/suggestions/slice-issue-87994.stderr
@@ -2,10 +2,10 @@ error[E0277]: the size for values of type `[i32]` cannot be known at compilation
--> $DIR/slice-issue-87994.rs:3:12
|
LL | for _ in v[1..] {
- | ^^^^^^ expected an implementor of trait `IntoIterator`
+ | ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]`
|
= note: the trait bound `[i32]: IntoIterator` is not satisfied
- = note: required because of the requirements on the impl of `IntoIterator` for `[i32]`
+ = note: required for `[i32]` to implement `IntoIterator`
help: consider borrowing here
|
LL | for _ in &v[1..] {
@@ -17,10 +17,10 @@ error[E0277]: `[i32]` is not an iterator
--> $DIR/slice-issue-87994.rs:3:12
|
LL | for _ in v[1..] {
- | ^^^^^^ expected an implementor of trait `IntoIterator`
+ | ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]`
|
= note: the trait bound `[i32]: IntoIterator` is not satisfied
- = note: required because of the requirements on the impl of `IntoIterator` for `[i32]`
+ = note: required for `[i32]` to implement `IntoIterator`
help: consider borrowing here
|
LL | for _ in &v[1..] {
@@ -32,10 +32,10 @@ error[E0277]: the size for values of type `[K]` cannot be known at compilation t
--> $DIR/slice-issue-87994.rs:11:13
|
LL | for i2 in v2[1..] {
- | ^^^^^^^ expected an implementor of trait `IntoIterator`
+ | ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]`
|
= note: the trait bound `[K]: IntoIterator` is not satisfied
- = note: required because of the requirements on the impl of `IntoIterator` for `[K]`
+ = note: required for `[K]` to implement `IntoIterator`
help: consider borrowing here
|
LL | for i2 in &v2[1..] {
@@ -47,10 +47,10 @@ error[E0277]: `[K]` is not an iterator
--> $DIR/slice-issue-87994.rs:11:13
|
LL | for i2 in v2[1..] {
- | ^^^^^^^ expected an implementor of trait `IntoIterator`
+ | ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]`
|
= note: the trait bound `[K]: IntoIterator` is not satisfied
- = note: required because of the requirements on the impl of `IntoIterator` for `[K]`
+ = note: required for `[K]` to implement `IntoIterator`
help: consider borrowing here
|
LL | for i2 in &v2[1..] {
diff --git a/src/test/ui/suggestions/struct-field-type-including-single-colon.stderr b/src/test/ui/suggestions/struct-field-type-including-single-colon.stderr
index 189759d64..4dd514480 100644
--- a/src/test/ui/suggestions/struct-field-type-including-single-colon.stderr
+++ b/src/test/ui/suggestions/struct-field-type-including-single-colon.stderr
@@ -12,6 +12,8 @@ LL | a: foo::A,
error: expected `,`, or `}`, found `:`
--> $DIR/struct-field-type-including-single-colon.rs:9:11
|
+LL | struct Foo {
+ | --- while parsing this struct
LL | a: foo:A,
| ^
@@ -29,6 +31,8 @@ LL | b: foo::bar::B,
error: expected `,`, or `}`, found `:`
--> $DIR/struct-field-type-including-single-colon.rs:15:16
|
+LL | struct Bar {
+ | --- while parsing this struct
LL | b: foo::bar:B,
| ^
diff --git a/src/test/ui/suggestions/sugg-else-for-closure.fixed b/src/test/ui/suggestions/sugg-else-for-closure.fixed
new file mode 100644
index 000000000..cf381d9da
--- /dev/null
+++ b/src/test/ui/suggestions/sugg-else-for-closure.fixed
@@ -0,0 +1,8 @@
+// run-rustfix
+
+fn main() {
+ let x = "com.example.app";
+ let y: Option<&str> = None;
+ let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
+ //~^ ERROR: mismatched types [E0308]
+}
diff --git a/src/test/ui/suggestions/sugg-else-for-closure.rs b/src/test/ui/suggestions/sugg-else-for-closure.rs
new file mode 100644
index 000000000..540ced91f
--- /dev/null
+++ b/src/test/ui/suggestions/sugg-else-for-closure.rs
@@ -0,0 +1,8 @@
+// run-rustfix
+
+fn main() {
+ let x = "com.example.app";
+ let y: Option<&str> = None;
+ let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
+ //~^ ERROR: mismatched types [E0308]
+}
diff --git a/src/test/ui/suggestions/sugg-else-for-closure.stderr b/src/test/ui/suggestions/sugg-else-for-closure.stderr
new file mode 100644
index 000000000..55a0eee18
--- /dev/null
+++ b/src/test/ui/suggestions/sugg-else-for-closure.stderr
@@ -0,0 +1,23 @@
+error[E0308]: mismatched types
+ --> $DIR/sugg-else-for-closure.rs:6:26
+ |
+LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap());
+ | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure
+ | |
+ | arguments to this function are incorrect
+ |
+ = note: expected reference `&str`
+ found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]`
+note: associated function defined here
+ --> $SRC_DIR/core/src/option.rs:LL:COL
+ |
+LL | pub const fn unwrap_or(self, default: T) -> T
+ | ^^^^^^^^^
+help: try calling `unwrap_or_else` instead
+ |
+LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap());
+ | +++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs
new file mode 100644
index 000000000..21ab6830b
--- /dev/null
+++ b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs
@@ -0,0 +1,10 @@
+// When build the suggesttion take in consideration the `:?`
+// https://github.com/rust-lang/rust/issues/100648
+#![deny(warnings)]
+
+fn main () {
+ println!("hello {:?}", world = "world");
+ //~^ ERROR named argument `world` is not used by name
+ //~| HELP use the named argument by name to avoid ambiguity
+ //~| SUGGESTION world
+}
diff --git a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr
new file mode 100644
index 000000000..850f69f2d
--- /dev/null
+++ b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr
@@ -0,0 +1,21 @@
+error: named argument `world` is not used by name
+ --> $DIR/sugg_with_positional_args_and_debug_fmt.rs:6:28
+ |
+LL | println!("hello {:?}", world = "world");
+ | ---- ^^^^^ this named argument is referred to by position in formatting string
+ | |
+ | this formatting argument uses named argument `world` by position
+ |
+note: the lint level is defined here
+ --> $DIR/sugg_with_positional_args_and_debug_fmt.rs:3:9
+ |
+LL | #![deny(warnings)]
+ | ^^^^^^^^
+ = note: `#[deny(named_arguments_used_positionally)]` implied by `#[deny(warnings)]`
+help: use the named argument by name to avoid ambiguity
+ |
+LL | println!("hello {world:?}", world = "world");
+ | +++++
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed b/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed
new file mode 100644
index 000000000..e9b8a9caa
--- /dev/null
+++ b/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.fixed
@@ -0,0 +1,15 @@
+// run-rustfix
+#![allow(unused_variables)]
+
+fn foo(foo: &mut usize) {
+ todo!()
+}
+
+fn bar(bar: &usize) {
+ todo!()
+}
+
+fn main() {
+ foo(&mut Default::default()); //~ the trait bound `&mut usize: Default` is not satisfied
+ bar(&Default::default()); //~ the trait bound `&usize: Default` is not satisfied
+}
diff --git a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs b/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs
new file mode 100644
index 000000000..5fae21ccc
--- /dev/null
+++ b/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.rs
@@ -0,0 +1,15 @@
+// run-rustfix
+#![allow(unused_variables)]
+
+fn foo(foo: &mut usize) {
+ todo!()
+}
+
+fn bar(bar: &usize) {
+ todo!()
+}
+
+fn main() {
+ foo(Default::default()); //~ the trait bound `&mut usize: Default` is not satisfied
+ bar(Default::default()); //~ the trait bound `&usize: Default` is not satisfied
+}
diff --git a/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr b/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr
new file mode 100644
index 000000000..125a8b44f
--- /dev/null
+++ b/src/test/ui/suggestions/suggest-adding-reference-to-trait-assoc-item.stderr
@@ -0,0 +1,25 @@
+error[E0277]: the trait bound `&mut usize: Default` is not satisfied
+ --> $DIR/suggest-adding-reference-to-trait-assoc-item.rs:13:9
+ |
+LL | foo(Default::default());
+ | ^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `&mut usize`
+ |
+help: consider mutably borrowing here
+ |
+LL | foo(&mut Default::default());
+ | ++++
+
+error[E0277]: the trait bound `&usize: Default` is not satisfied
+ --> $DIR/suggest-adding-reference-to-trait-assoc-item.rs:14:9
+ |
+LL | bar(Default::default());
+ | ^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `&usize`
+ |
+help: consider borrowing here
+ |
+LL | bar(&Default::default());
+ | +
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs b/src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs
index 7cf536f79..14fef1b52 100644
--- a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs
+++ b/src/test/ui/suggestions/suggest-blanket-impl-local-trait.rs
@@ -1,5 +1,5 @@
// Ensure that the compiler include the blanklet implementation suggestion
-// when inside a `impl` statment are used two local traits.
+// when inside a `impl` statement are used two local traits.
//
// edition:2021
use std::fmt;
diff --git a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr b/src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr
index d739a8272..398caa98b 100644
--- a/src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr
+++ b/src/test/ui/suggestions/suggest-blanket-impl-local-trait.stderr
@@ -6,9 +6,8 @@ LL | impl LocalTraitTwo for LocalTraitOne {}
|
help: add `dyn` keyword before this trait
|
-LL - impl LocalTraitTwo for LocalTraitOne {}
-LL + impl LocalTraitTwo for dyn LocalTraitOne {}
- |
+LL | impl LocalTraitTwo for dyn LocalTraitOne {}
+ | +++
help: alternatively use a blanket implementation to implement `LocalTraitTwo` for all types that also implement `LocalTraitOne`
|
LL | impl<T: LocalTraitOne> LocalTraitTwo for T {}
@@ -22,9 +21,8 @@ LL | impl fmt::Display for LocalTraitOne {
|
help: add `dyn` keyword before this trait
|
-LL - impl fmt::Display for LocalTraitOne {
-LL + impl fmt::Display for dyn LocalTraitOne {
- |
+LL | impl fmt::Display for dyn LocalTraitOne {
+ | +++
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/suggest-blanket-impl-local-trait.rs:26:23
@@ -34,9 +32,8 @@ LL | impl fmt::Display for LocalTraitTwo + Send {
|
help: add `dyn` keyword before this trait
|
-LL - impl fmt::Display for LocalTraitTwo + Send {
-LL + impl fmt::Display for dyn LocalTraitTwo + Send {
- |
+LL | impl fmt::Display for dyn LocalTraitTwo + Send {
+ | +++
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/suggest-blanket-impl-local-trait.rs:34:24
@@ -46,9 +43,8 @@ LL | impl LocalTraitOne for fmt::Display {}
|
help: add `dyn` keyword before this trait
|
-LL - impl LocalTraitOne for fmt::Display {}
-LL + impl LocalTraitOne for dyn fmt::Display {}
- |
+LL | impl LocalTraitOne for dyn fmt::Display {}
+ | +++
help: alternatively use a blanket implementation to implement `LocalTraitOne` for all types that also implement `fmt::Display`
|
LL | impl<T: fmt::Display> LocalTraitOne for T {}
@@ -62,9 +58,8 @@ LL | impl LocalTraitOne for fmt::Display + Send {}
|
help: add `dyn` keyword before this trait
|
-LL - impl LocalTraitOne for fmt::Display + Send {}
-LL + impl LocalTraitOne for dyn fmt::Display + Send {}
- |
+LL | impl LocalTraitOne for dyn fmt::Display + Send {}
+ | +++
help: alternatively use a blanket implementation to implement `LocalTraitOne` for all types that also implement `fmt::Display + Send`
|
LL | impl<T: fmt::Display + Send> LocalTraitOne for T {}
@@ -78,9 +73,8 @@ LL | impl<E> GenericTrait<E> for LocalTraitOne {}
|
help: add `dyn` keyword before this trait
|
-LL - impl<E> GenericTrait<E> for LocalTraitOne {}
-LL + impl<E> GenericTrait<E> for dyn LocalTraitOne {}
- |
+LL | impl<E> GenericTrait<E> for dyn LocalTraitOne {}
+ | +++
help: alternatively use a blanket implementation to implement `GenericTrait<E>` for all types that also implement `LocalTraitOne`
|
LL | impl<E, T: LocalTraitOne> GenericTrait<E> for T {}
@@ -94,9 +88,8 @@ LL | impl<T, E> GenericTraitTwo<E> for GenericTrait<T> {}
|
help: add `dyn` keyword before this trait
|
-LL - impl<T, E> GenericTraitTwo<E> for GenericTrait<T> {}
-LL + impl<T, E> GenericTraitTwo<E> for dyn GenericTrait<T> {}
- |
+LL | impl<T, E> GenericTraitTwo<E> for dyn GenericTrait<T> {}
+ | +++
help: alternatively use a blanket implementation to implement `GenericTraitTwo<E>` for all types that also implement `GenericTrait<T>`
|
LL | impl<T, E, U: GenericTrait<T>> GenericTraitTwo<E> for U {}
diff --git a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr b/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr
index 6b6e40613..6ce9bfd9d 100644
--- a/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr
+++ b/src/test/ui/suggestions/suggest-borrow-to-dyn-object.stderr
@@ -2,9 +2,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation
--> $DIR/suggest-borrow-to-dyn-object.rs:12:11
|
LL | check(s);
- | ----- ^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^ doesn't have a size known at compile-time
|
= help: within `OsStr`, the trait `Sized` is not implemented for `[u8]`
= note: required because it appears within the type `OsStr`
diff --git a/src/test/ui/suggestions/suggest-dereferencing-index.stderr b/src/test/ui/suggestions/suggest-dereferencing-index.stderr
index c8b87af7b..147dc9234 100644
--- a/src/test/ui/suggestions/suggest-dereferencing-index.stderr
+++ b/src/test/ui/suggestions/suggest-dereferencing-index.stderr
@@ -6,7 +6,7 @@ LL | let one_item_please: i32 = [1, 2, 3][i];
|
= help: the trait `SliceIndex<[{integer}]>` is not implemented for `&usize`
= help: the trait `SliceIndex<[T]>` is implemented for `usize`
- = note: required because of the requirements on the impl of `Index<&usize>` for `[{integer}]`
+ = note: required for `[{integer}]` to implement `Index<&usize>`
help: dereference this index
|
LL | let one_item_please: i32 = [1, 2, 3][*i];
diff --git a/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr b/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr
index 6583cabe1..f2eb651ea 100644
--- a/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr
+++ b/src/test/ui/suggestions/suggest-imm-mut-trait-implementations.stderr
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `A: Trait` is not satisfied
--> $DIR/suggest-imm-mut-trait-implementations.rs:20:9
|
LL | foo(a);
- | --- ^ expected an implementor of trait `Trait`
+ | --- ^ the trait `Trait` is not implemented for `A`
| |
| required by a bound introduced by this call
|
@@ -22,7 +22,7 @@ error[E0277]: the trait bound `B: Trait` is not satisfied
--> $DIR/suggest-imm-mut-trait-implementations.rs:21:9
|
LL | foo(b);
- | --- ^ expected an implementor of trait `Trait`
+ | --- ^ the trait `Trait` is not implemented for `B`
| |
| required by a bound introduced by this call
|
@@ -40,7 +40,7 @@ error[E0277]: the trait bound `C: Trait` is not satisfied
--> $DIR/suggest-imm-mut-trait-implementations.rs:22:9
|
LL | foo(c);
- | --- ^ expected an implementor of trait `Trait`
+ | --- ^ the trait `Trait` is not implemented for `C`
| |
| required by a bound introduced by this call
|
diff --git a/src/test/ui/suggestions/suggest-let-for-assignment.fixed b/src/test/ui/suggestions/suggest-let-for-assignment.fixed
new file mode 100644
index 000000000..3a25e25ee
--- /dev/null
+++ b/src/test/ui/suggestions/suggest-let-for-assignment.fixed
@@ -0,0 +1,17 @@
+// run-rustfix
+
+fn main() {
+ let demo = 1; //~ ERROR cannot find value `demo` in this scope
+ dbg!(demo); //~ ERROR cannot find value `demo` in this scope
+
+ let x = "x"; //~ ERROR cannot find value `x` in this scope
+ println!("x: {}", x); //~ ERROR cannot find value `x` in this scope
+
+ if x == "x" {
+ //~^ ERROR cannot find value `x` in this scope
+ println!("x is 1");
+ }
+
+ let y = 1 + 2; //~ ERROR cannot find value `y` in this scope
+ println!("y: {}", y); //~ ERROR cannot find value `y` in this scope
+}
diff --git a/src/test/ui/suggestions/suggest-let-for-assignment.rs b/src/test/ui/suggestions/suggest-let-for-assignment.rs
new file mode 100644
index 000000000..67705fe06
--- /dev/null
+++ b/src/test/ui/suggestions/suggest-let-for-assignment.rs
@@ -0,0 +1,17 @@
+// run-rustfix
+
+fn main() {
+ demo = 1; //~ ERROR cannot find value `demo` in this scope
+ dbg!(demo); //~ ERROR cannot find value `demo` in this scope
+
+ x = "x"; //~ ERROR cannot find value `x` in this scope
+ println!("x: {}", x); //~ ERROR cannot find value `x` in this scope
+
+ if x == "x" {
+ //~^ ERROR cannot find value `x` in this scope
+ println!("x is 1");
+ }
+
+ y = 1 + 2; //~ ERROR cannot find value `y` in this scope
+ println!("y: {}", y); //~ ERROR cannot find value `y` in this scope
+}
diff --git a/src/test/ui/suggestions/suggest-let-for-assignment.stderr b/src/test/ui/suggestions/suggest-let-for-assignment.stderr
new file mode 100644
index 000000000..3f6a3da4b
--- /dev/null
+++ b/src/test/ui/suggestions/suggest-let-for-assignment.stderr
@@ -0,0 +1,60 @@
+error[E0425]: cannot find value `demo` in this scope
+ --> $DIR/suggest-let-for-assignment.rs:4:5
+ |
+LL | demo = 1;
+ | ^^^^
+ |
+help: you might have meant to introduce a new binding
+ |
+LL | let demo = 1;
+ | +++
+
+error[E0425]: cannot find value `demo` in this scope
+ --> $DIR/suggest-let-for-assignment.rs:5:10
+ |
+LL | dbg!(demo);
+ | ^^^^ not found in this scope
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/suggest-let-for-assignment.rs:7:5
+ |
+LL | x = "x";
+ | ^
+ |
+help: you might have meant to introduce a new binding
+ |
+LL | let x = "x";
+ | +++
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/suggest-let-for-assignment.rs:8:23
+ |
+LL | println!("x: {}", x);
+ | ^ not found in this scope
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/suggest-let-for-assignment.rs:10:8
+ |
+LL | if x == "x" {
+ | ^ not found in this scope
+
+error[E0425]: cannot find value `y` in this scope
+ --> $DIR/suggest-let-for-assignment.rs:15:5
+ |
+LL | y = 1 + 2;
+ | ^
+ |
+help: you might have meant to introduce a new binding
+ |
+LL | let y = 1 + 2;
+ | +++
+
+error[E0425]: cannot find value `y` in this scope
+ --> $DIR/suggest-let-for-assignment.rs:16:23
+ |
+LL | println!("y: {}", y);
+ | ^ not found in this scope
+
+error: aborting due to 7 previous errors
+
+For more information about this error, try `rustc --explain E0425`.
diff --git a/src/test/ui/suggestions/suggest-methods.stderr b/src/test/ui/suggestions/suggest-methods.stderr
index 97d7e6696..03cb9c779 100644
--- a/src/test/ui/suggestions/suggest-methods.stderr
+++ b/src/test/ui/suggestions/suggest-methods.stderr
@@ -5,25 +5,25 @@ LL | struct Foo;
| ---------- method `bat` not found for this struct
...
LL | f.bat(1.0);
- | ^^^ help: there is an associated function with a similar name: `bar`
+ | ^^^ help: there is a method with a similar name: `bar`
error[E0599]: no method named `is_emtpy` found for struct `String` in the current scope
--> $DIR/suggest-methods.rs:21:15
|
LL | let _ = s.is_emtpy();
- | ^^^^^^^^ help: there is an associated function with a similar name: `is_empty`
+ | ^^^^^^^^ help: there is a method with a similar name: `is_empty`
error[E0599]: no method named `count_eos` found for type `u32` in the current scope
--> $DIR/suggest-methods.rs:25:19
|
LL | let _ = 63u32.count_eos();
- | ^^^^^^^^^ help: there is an associated function with a similar name: `count_zeros`
+ | ^^^^^^^^^ help: there is a method with a similar name: `count_zeros`
error[E0599]: no method named `count_o` found for type `u32` in the current scope
--> $DIR/suggest-methods.rs:28:19
|
LL | let _ = 63u32.count_o();
- | ^^^^^^^ help: there is an associated function with a similar name: `count_ones`
+ | ^^^^^^^ help: there is a method with a similar name: `count_ones`
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/suggest-move-lifetimes.stderr b/src/test/ui/suggestions/suggest-move-lifetimes.stderr
index f52631cae..b1a49447d 100644
--- a/src/test/ui/suggestions/suggest-move-lifetimes.stderr
+++ b/src/test/ui/suggestions/suggest-move-lifetimes.stderr
@@ -1,22 +1,22 @@
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/suggest-move-lifetimes.rs:1:13
|
LL | struct A<T, 'a> {
| ----^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T>`
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/suggest-move-lifetimes.rs:5:13
|
LL | struct B<T, 'a, U> {
| ----^^---- help: reorder the parameters: lifetimes, then consts and types: `<'a, T, U>`
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/suggest-move-lifetimes.rs:10:16
|
LL | struct C<T, U, 'a> {
| -------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, T, U>`
-error: lifetime parameters must be declared prior to type parameters
+error: lifetime parameters must be declared prior to type and const parameters
--> $DIR/suggest-move-lifetimes.rs:15:16
|
LL | struct D<T, U, 'a, 'b, V, 'c> {
diff --git a/src/test/ui/suggestions/suggest-move-types.stderr b/src/test/ui/suggestions/suggest-move-types.stderr
index 1a6032db0..b222e8142 100644
--- a/src/test/ui/suggestions/suggest-move-types.stderr
+++ b/src/test/ui/suggestions/suggest-move-types.stderr
@@ -121,7 +121,7 @@ LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=()
| ^^
|
= note: lifetime arguments must be provided before type arguments
- = help: reorder the arguments: lifetimes, then types: `<'a, 'b, 'c, T, U, V>`
+ = help: reorder the arguments: lifetimes, then type and consts: `<'a, 'b, 'c, T, U, V>`
error[E0747]: lifetime provided when a type was expected
--> $DIR/suggest-move-types.rs:82:56
@@ -130,7 +130,7 @@ LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, '
| ^^
|
= note: lifetime arguments must be provided before type arguments
- = help: reorder the arguments: lifetimes, then types: `<'a, 'b, 'c, T, U, V>`
+ = help: reorder the arguments: lifetimes, then type and consts: `<'a, 'b, 'c, T, U, V>`
error: aborting due to 12 previous errors
diff --git a/src/test/ui/suggestions/suggest-ref-macro.stderr b/src/test/ui/suggestions/suggest-ref-macro.stderr
index 84cbc9357..17de49fbd 100644
--- a/src/test/ui/suggestions/suggest-ref-macro.stderr
+++ b/src/test/ui/suggestions/suggest-ref-macro.stderr
@@ -10,14 +10,8 @@ LL | #[hello]
note: function defined here
--> $DIR/suggest-ref-macro.rs:8:1
|
-LL | #[hello]
- | _-^^^^^^^
-LL | | fn abc() {}
-LL | |
-LL | | fn x(_: &mut i32) {}
-LL | |
-LL | | macro_rules! bla {
- | |_____________-
+LL | #[hello]
+ | ^^^^^^^^
= note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
diff --git a/src/test/ui/suggestions/suggest-remove-refs-1.stderr b/src/test/ui/suggestions/suggest-remove-refs-1.stderr
index 1083b2f97..1a843f3f5 100644
--- a/src/test/ui/suggestions/suggest-remove-refs-1.stderr
+++ b/src/test/ui/suggestions/suggest-remove-refs-1.stderr
@@ -8,7 +8,7 @@ LL | for (i, _) in &v.iter().enumerate() {
| help: consider removing the leading `&`-reference
|
= help: the trait `Iterator` is not implemented for `&Enumerate<std::slice::Iter<'_, {integer}>>`
- = note: required because of the requirements on the impl of `IntoIterator` for `&Enumerate<std::slice::Iter<'_, {integer}>>`
+ = note: required for `&Enumerate<std::slice::Iter<'_, {integer}>>` to implement `IntoIterator`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-remove-refs-2.stderr b/src/test/ui/suggestions/suggest-remove-refs-2.stderr
index 197b19a1b..f39361d52 100644
--- a/src/test/ui/suggestions/suggest-remove-refs-2.stderr
+++ b/src/test/ui/suggestions/suggest-remove-refs-2.stderr
@@ -8,7 +8,7 @@ LL | for (i, _) in & & & & &v.iter().enumerate() {
| help: consider removing 5 leading `&`-references
|
= help: the trait `Iterator` is not implemented for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>`
- = note: required because of the requirements on the impl of `IntoIterator` for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>`
+ = note: required for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` to implement `IntoIterator`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-remove-refs-3.stderr b/src/test/ui/suggestions/suggest-remove-refs-3.stderr
index bb0cceac1..4d0732427 100644
--- a/src/test/ui/suggestions/suggest-remove-refs-3.stderr
+++ b/src/test/ui/suggestions/suggest-remove-refs-3.stderr
@@ -12,7 +12,7 @@ LL | | .enumerate() {
| |_____________________^ `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator
|
= help: the trait `Iterator` is not implemented for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>`
- = note: required because of the requirements on the impl of `IntoIterator` for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>`
+ = note: required for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` to implement `IntoIterator`
error: aborting due to previous error
diff --git a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr b/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr
index fc880d6b8..87e716436 100644
--- a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr
+++ b/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.stderr
@@ -39,9 +39,8 @@ LL | impl<'a, T> Struct<T> for Trait<'a, T> {}
|
help: add `dyn` keyword before this trait
|
-LL - impl<'a, T> Struct<T> for Trait<'a, T> {}
-LL + impl<'a, T> Struct<T> for dyn Trait<'a, T> {}
- |
+LL | impl<'a, T> Struct<T> for dyn Trait<'a, T> {}
+ | +++
error: aborting due to 4 previous errors
diff --git a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr b/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr
index f5143762d..ffd505fff 100644
--- a/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr
+++ b/src/test/ui/suggestions/suggest-swapping-self-ty-and-trait.stderr
@@ -37,14 +37,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | impl<'a, T> Struct<T> for Trait<'a, T> {}
| ^^^^^^^^^^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
-LL - impl<'a, T> Struct<T> for Trait<'a, T> {}
-LL + impl<'a, T> Struct<T> for dyn Trait<'a, T> {}
- |
+LL | impl<'a, T> Struct<T> for dyn Trait<'a, T> {}
+ | +++
error: aborting due to 3 previous errors; 1 warning emitted
diff --git a/src/test/ui/suggestions/too-many-field-suggestions.rs b/src/test/ui/suggestions/too-many-field-suggestions.rs
new file mode 100644
index 000000000..905f9502c
--- /dev/null
+++ b/src/test/ui/suggestions/too-many-field-suggestions.rs
@@ -0,0 +1,29 @@
+struct Thing {
+ a0: Foo,
+ a1: Foo,
+ a2: Foo,
+ a3: Foo,
+ a4: Foo,
+ a5: Foo,
+ a6: Foo,
+ a7: Foo,
+ a8: Foo,
+ a9: Foo,
+}
+
+struct Foo {
+ field: Field,
+}
+
+struct Field;
+
+impl Foo {
+ fn bar(&self) {}
+}
+
+fn bar(t: Thing) {
+ t.bar(); //~ ERROR no method named `bar` found for struct `Thing`
+ t.field; //~ ERROR no field `field` on type `Thing`
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/too-many-field-suggestions.stderr b/src/test/ui/suggestions/too-many-field-suggestions.stderr
new file mode 100644
index 000000000..63ad6fdb1
--- /dev/null
+++ b/src/test/ui/suggestions/too-many-field-suggestions.stderr
@@ -0,0 +1,44 @@
+error[E0599]: no method named `bar` found for struct `Thing` in the current scope
+ --> $DIR/too-many-field-suggestions.rs:25:7
+ |
+LL | struct Thing {
+ | ------------ method `bar` not found for this struct
+...
+LL | t.bar();
+ | ^^^ method not found in `Thing`
+ |
+help: some of the expressions' fields have a method of the same name
+ |
+LL | t.a0.bar();
+ | +++
+LL | t.a1.bar();
+ | +++
+LL | t.a2.bar();
+ | +++
+LL | t.a3.bar();
+ | +++
+ and 6 other candidates
+
+error[E0609]: no field `field` on type `Thing`
+ --> $DIR/too-many-field-suggestions.rs:26:7
+ |
+LL | t.field;
+ | ^^^^^ unknown field
+ |
+ = note: available fields are: `a0`, `a1`, `a2`, `a3`, `a4` ... and 5 others
+help: some of the expressions' fields have a field of the same name
+ |
+LL | t.a0.field;
+ | +++
+LL | t.a1.field;
+ | +++
+LL | t.a2.field;
+ | +++
+LL | t.a3.field;
+ | +++
+ and 6 other candidates
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0599, E0609.
+For more information about an error, try `rustc --explain E0599`.
diff --git a/src/test/ui/suggestions/try-removing-the-field.rs b/src/test/ui/suggestions/try-removing-the-field.rs
new file mode 100644
index 000000000..9d0573ca2
--- /dev/null
+++ b/src/test/ui/suggestions/try-removing-the-field.rs
@@ -0,0 +1,17 @@
+// run-pass
+
+#![allow(dead_code)]
+
+struct Foo {
+ foo: i32,
+ bar: (),
+ baz: (),
+}
+
+fn use_foo(x: Foo) -> i32 {
+ let Foo { foo, bar, .. } = x; //~ WARNING unused variable: `bar`
+ //~| help: try removing the field
+ return foo;
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/try-removing-the-field.stderr b/src/test/ui/suggestions/try-removing-the-field.stderr
new file mode 100644
index 000000000..448a2c3d2
--- /dev/null
+++ b/src/test/ui/suggestions/try-removing-the-field.stderr
@@ -0,0 +1,12 @@
+warning: unused variable: `bar`
+ --> $DIR/try-removing-the-field.rs:12:20
+ |
+LL | let Foo { foo, bar, .. } = x;
+ | ^^^-
+ | |
+ | help: try removing the field
+ |
+ = note: `#[warn(unused_variables)]` on by default
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/suggestions/type-ascription-and-other-error.rs b/src/test/ui/suggestions/type-ascription-and-other-error.rs
new file mode 100644
index 000000000..99ab2f3c8
--- /dev/null
+++ b/src/test/ui/suggestions/type-ascription-and-other-error.rs
@@ -0,0 +1,6 @@
+fn main() {
+ not rust; //~ ERROR
+ let _ = 0: i32; // (error hidden by existing error)
+ #[cfg(FALSE)]
+ let _ = 0: i32; // (warning hidden by existing error)
+}
diff --git a/src/test/ui/suggestions/type-ascription-and-other-error.stderr b/src/test/ui/suggestions/type-ascription-and-other-error.stderr
new file mode 100644
index 000000000..eadf634bb
--- /dev/null
+++ b/src/test/ui/suggestions/type-ascription-and-other-error.stderr
@@ -0,0 +1,8 @@
+error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `rust`
+ --> $DIR/type-ascription-and-other-error.rs:2:9
+ |
+LL | not rust;
+ | ^^^^ expected one of 8 possible tokens
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/suggestions/unnamable-types.stderr b/src/test/ui/suggestions/unnamable-types.stderr
index de64269d1..ede3ebfa7 100644
--- a/src/test/ui/suggestions/unnamable-types.stderr
+++ b/src/test/ui/suggestions/unnamable-types.stderr
@@ -1,8 +1,8 @@
error: missing type for `const` item
- --> $DIR/unnamable-types.rs:6:7
+ --> $DIR/unnamable-types.rs:6:8
|
LL | const A = 5;
- | ^ help: provide a type for the constant: `A: i32`
+ | ^ help: provide a type for the constant: `: i32`
error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
--> $DIR/unnamable-types.rs:10:11
@@ -26,10 +26,10 @@ LL | const C: _ = || 42;
| ^^^^^
error: missing type for `const` item
- --> $DIR/unnamable-types.rs:23:7
+ --> $DIR/unnamable-types.rs:23:8
|
LL | const D = S { t: { let i = 0; move || -> i32 { i } } };
- | ^
+ | ^
|
note: however, the inferred type `S<[closure@$DIR/unnamable-types.rs:23:31: 23:45]>` cannot be named
--> $DIR/unnamable-types.rs:23:11
@@ -38,22 +38,22 @@ LL | const D = S { t: { let i = 0; move || -> i32 { i } } };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing type for `const` item
- --> $DIR/unnamable-types.rs:29:7
+ --> $DIR/unnamable-types.rs:29:8
|
LL | const E = foo;
- | ^ help: provide a type for the constant: `E: fn() -> i32`
+ | ^ help: provide a type for the constant: `: fn() -> i32`
error: missing type for `const` item
- --> $DIR/unnamable-types.rs:32:7
+ --> $DIR/unnamable-types.rs:32:8
|
LL | const F = S { t: foo };
- | ^ help: provide a type for the constant: `F: S<fn() -> i32>`
+ | ^ help: provide a type for the constant: `: S<fn() -> i32>`
error: missing type for `const` item
- --> $DIR/unnamable-types.rs:37:7
+ --> $DIR/unnamable-types.rs:37:8
|
LL | const G = || -> i32 { yield 0; return 1; };
- | ^
+ | ^
|
note: however, the inferred type `[generator@$DIR/unnamable-types.rs:37:11: 37:20]` cannot be named
--> $DIR/unnamable-types.rs:37:11
diff --git a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
index 7038a572b..75b919232 100644
--- a/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
+++ b/src/test/ui/suggestions/use-type-argument-instead-of-assoc-type.stderr
@@ -12,7 +12,7 @@ LL | pub trait T<X, Y> {
help: replace the generic bounds with the associated types
|
LL | i: Box<dyn T<usize, usize, A = usize, C = usize, B=usize>>,
- | ~~~~~~~~~ ~~~~~~~~~
+ | +++ +++
error[E0191]: the value of the associated types `A` (from trait `T`), `C` (from trait `T`) must be specified
--> $DIR/use-type-argument-instead-of-assoc-type.rs:7:16
diff --git a/src/test/ui/symbol-names/impl1.legacy.stderr b/src/test/ui/symbol-names/impl1.legacy.stderr
index b6012e415..3d438df92 100644
--- a/src/test/ui/symbol-names/impl1.legacy.stderr
+++ b/src/test/ui/symbol-names/impl1.legacy.stderr
@@ -64,7 +64,7 @@ error: demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::A
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: def-path(<[&dyn Foo<Assoc = for<'r> extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
+error: def-path(<[&dyn Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
--> $DIR/impl1.rs:69:13
|
LL | #[rustc_def_path]
diff --git a/src/test/ui/symbol-names/impl1.rs b/src/test/ui/symbol-names/impl1.rs
index 86f0a8b0b..629c2f33d 100644
--- a/src/test/ui/symbol-names/impl1.rs
+++ b/src/test/ui/symbol-names/impl1.rs
@@ -67,8 +67,8 @@ fn main() {
//[v0]~| ERROR demangling(<[&dyn
//[v0]~| ERROR demangling-alt(<[&dyn impl1::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + impl1::AutoTrait; 3] as impl1::main::{closure#1}::Bar>::method)
#[rustc_def_path]
- //[legacy]~^ ERROR def-path(<[&dyn Foo<Assoc = for<'r> extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
- //[v0]~^^ ERROR def-path(<[&dyn Foo<Assoc = for<'r> extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
+ //[legacy]~^ ERROR def-path(<[&dyn Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
+ //[v0]~^^ ERROR def-path(<[&dyn Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
fn method(&self) {}
}
};
diff --git a/src/test/ui/symbol-names/impl1.v0.stderr b/src/test/ui/symbol-names/impl1.v0.stderr
index 48f7473b6..33caad71f 100644
--- a/src/test/ui/symbol-names/impl1.v0.stderr
+++ b/src/test/ui/symbol-names/impl1.v0.stderr
@@ -64,7 +64,7 @@ error: demangling-alt(<[&dyn impl1::Foo<Assoc = for<'a> extern "C" fn(&'a u8, ..
LL | #[rustc_symbol_name]
| ^^^^^^^^^^^^^^^^^^^^
-error: def-path(<[&dyn Foo<Assoc = for<'r> extern "C" fn(&'r u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
+error: def-path(<[&dyn Foo<Assoc = for<'a> extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method)
--> $DIR/impl1.rs:69:13
|
LL | #[rustc_def_path]
diff --git a/src/test/ui/tag-variant-disr-dup.rs b/src/test/ui/tag-variant-disr-dup.rs
deleted file mode 100644
index e497f993d..000000000
--- a/src/test/ui/tag-variant-disr-dup.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// Black and White have the same discriminator value ...
-
-enum Color {
- //~^ ERROR discriminant value `0` assigned more than once
- Red = 0xff0000,
- Green = 0x00ff00,
- Blue = 0x0000ff,
- Black = 0x000000,
- White = 0x000000,
-}
-
-fn main() { }
diff --git a/src/test/ui/tag-variant-disr-dup.stderr b/src/test/ui/tag-variant-disr-dup.stderr
deleted file mode 100644
index 6b1ba43d2..000000000
--- a/src/test/ui/tag-variant-disr-dup.stderr
+++ /dev/null
@@ -1,14 +0,0 @@
-error[E0081]: discriminant value `0` assigned more than once
- --> $DIR/tag-variant-disr-dup.rs:3:1
- |
-LL | enum Color {
- | ^^^^^^^^^^
-...
-LL | Black = 0x000000,
- | -------- first assignment of `0`
-LL | White = 0x000000,
- | -------- second assignment of `0`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0081`.
diff --git a/src/test/ui/test-attrs/inaccessible-test-modules.stderr b/src/test/ui/test-attrs/inaccessible-test-modules.stderr
index a94ea1e79..0c16ecd4c 100644
--- a/src/test/ui/test-attrs/inaccessible-test-modules.stderr
+++ b/src/test/ui/test-attrs/inaccessible-test-modules.stderr
@@ -11,10 +11,16 @@ error[E0432]: unresolved import `test`
--> $DIR/inaccessible-test-modules.rs:6:5
|
LL | use test as y;
- | ----^^^^^
- | |
- | no `test` in the root
- | help: a similar name exists in the module: `test`
+ | ^^^^^^^^^ no `test` in the root
+ |
+help: a similar name exists in the module
+ |
+LL | use test as y;
+ | ~~~~
+help: consider importing this module instead
+ |
+LL | use test::test;
+ | ~~~~~~~~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs b/src/test/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs
index ff62d8492..585874e27 100644
--- a/src/test/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs
+++ b/src/test/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs
@@ -1,4 +1,5 @@
// run-pass
+// needs-unwind (#73509)
#![feature(test)]
diff --git a/src/test/ui/test-attrs/test-on-not-fn.stderr b/src/test/ui/test-attrs/test-on-not-fn.stderr
index 23efd5bc0..fc2c5f62b 100644
--- a/src/test/ui/test-attrs/test-on-not-fn.stderr
+++ b/src/test/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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on 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 a function to be run on a test and has no effect on non-functions
+ | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
LL | foo!();
| ------- expected a non-associated function, found an item macro invocation
|
diff --git a/src/test/ui/test-attrs/test-panic-while-printing.rs b/src/test/ui/test-attrs/test-panic-while-printing.rs
index 01e460da5..033c8beb4 100644
--- a/src/test/ui/test-attrs/test-panic-while-printing.rs
+++ b/src/test/ui/test-attrs/test-panic-while-printing.rs
@@ -1,7 +1,6 @@
// compile-flags:--test
// run-pass
// needs-unwind
-// ignore-emscripten no subprocess support
use std::fmt;
use std::fmt::{Display, Formatter};
diff --git a/src/test/ui/test-attrs/test-should-fail-good-message.rs b/src/test/ui/test-attrs/test-should-fail-good-message.rs
index 3260b6938..83519c452 100644
--- a/src/test/ui/test-attrs/test-should-fail-good-message.rs
+++ b/src/test/ui/test-attrs/test-should-fail-good-message.rs
@@ -1,6 +1,5 @@
// run-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: --test
#[test]
#[should_panic(expected = "foo")]
diff --git a/src/test/ui/test-attrs/test-thread-capture.rs b/src/test/ui/test-attrs/test-thread-capture.rs
index edc972837..53acca341 100644
--- a/src/test/ui/test-attrs/test-thread-capture.rs
+++ b/src/test/ui/test-attrs/test-thread-capture.rs
@@ -5,6 +5,7 @@
// exec-env:RUST_BACKTRACE=0
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
// ignore-emscripten no threads support
+// needs-unwind
#[test]
fn thready_pass() {
diff --git a/src/test/ui/test-attrs/test-thread-capture.run.stdout b/src/test/ui/test-attrs/test-thread-capture.run.stdout
index 487cfb55e..c712a78af 100644
--- a/src/test/ui/test-attrs/test-thread-capture.run.stdout
+++ b/src/test/ui/test-attrs/test-thread-capture.run.stdout
@@ -10,7 +10,7 @@ fee
fie
foe
fum
-thread 'main' panicked at 'explicit panic', $DIR/test-thread-capture.rs:31:5
+thread 'main' panicked at 'explicit panic', $DIR/test-thread-capture.rs:32:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/src/test/ui/test-attrs/test-thread-nocapture.rs b/src/test/ui/test-attrs/test-thread-nocapture.rs
index 8e8e9bbfd..2b57eb8aa 100644
--- a/src/test/ui/test-attrs/test-thread-nocapture.rs
+++ b/src/test/ui/test-attrs/test-thread-nocapture.rs
@@ -5,6 +5,7 @@
// exec-env:RUST_BACKTRACE=0
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
// ignore-emscripten no threads support
+// needs-unwind
#[test]
fn thready_pass() {
diff --git a/src/test/ui/test-attrs/test-thread-nocapture.run.stderr b/src/test/ui/test-attrs/test-thread-nocapture.run.stderr
index 06495681b..0a12a0528 100644
--- a/src/test/ui/test-attrs/test-thread-nocapture.run.stderr
+++ b/src/test/ui/test-attrs/test-thread-nocapture.run.stderr
@@ -1,2 +1,2 @@
-thread 'main' panicked at 'explicit panic', $DIR/test-thread-nocapture.rs:31:5
+thread 'main' panicked at 'explicit panic', $DIR/test-thread-nocapture.rs:32:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
diff --git a/src/test/ui/thir-tree.stdout b/src/test/ui/thir-tree.stdout
index 3c84be8e8..7fb90581f 100644
--- a/src/test/ui/thir-tree.stdout
+++ b/src/test/ui/thir-tree.stdout
@@ -1,6 +1,17 @@
DefId(0:3 ~ thir_tree[8f1d]::main):
Thir {
arms: [],
+ blocks: [
+ Block {
+ targeted_by_break: false,
+ region_scope: Node(1),
+ opt_destruction_scope: None,
+ span: $DIR/thir-tree.rs:4:15: 4:17 (#0),
+ stmts: [],
+ expr: None,
+ safety_mode: Safe,
+ },
+ ],
exprs: [
Expr {
ty: (),
@@ -9,15 +20,7 @@ Thir {
),
span: $DIR/thir-tree.rs:4:15: 4:17 (#0),
kind: Block {
- body: Block {
- targeted_by_break: false,
- region_scope: Node(1),
- opt_destruction_scope: None,
- span: $DIR/thir-tree.rs:4:15: 4:17 (#0),
- stmts: [],
- expr: None,
- safety_mode: Safe,
- },
+ block: b0,
},
},
Expr {
@@ -30,7 +33,9 @@ Thir {
region_scope: Node(2),
lint_level: Explicit(
HirId {
- owner: DefId(0:3 ~ thir_tree[8f1d]::main),
+ owner: OwnerId {
+ def_id: DefId(0:3 ~ thir_tree[8f1d]::main),
+ },
local_id: 2,
},
),
@@ -51,5 +56,6 @@ Thir {
},
],
stmts: [],
+ params: [],
}
diff --git a/src/test/ui/threads-sendsync/issue-43733-2.rs b/src/test/ui/threads-sendsync/issue-43733-2.rs
index 21ea8e9a2..32baeec43 100644
--- a/src/test/ui/threads-sendsync/issue-43733-2.rs
+++ b/src/test/ui/threads-sendsync/issue-43733-2.rs
@@ -1,5 +1,5 @@
+// ignore-wasm32
// dont-check-compiler-stderr
-
#![feature(cfg_target_thread_local, thread_local_internals)]
// On platforms *without* `#[thread_local]`, use
diff --git a/src/test/ui/threads-sendsync/issue-43733.rs b/src/test/ui/threads-sendsync/issue-43733.rs
index 0ac6f588f..935e02944 100644
--- a/src/test/ui/threads-sendsync/issue-43733.rs
+++ b/src/test/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"
-
#![feature(thread_local)]
#![feature(cfg_target_thread_local, thread_local_internals)]
diff --git a/src/test/ui/threads-sendsync/sync-send-in-std.rs b/src/test/ui/threads-sendsync/sync-send-in-std.rs
index b8ae214dc..6d1fba64e 100644
--- a/src/test/ui/threads-sendsync/sync-send-in-std.rs
+++ b/src/test/ui/threads-sendsync/sync-send-in-std.rs
@@ -2,6 +2,7 @@
// ignore-wasm32-bare networking not available
// ignore-sgx ToSocketAddrs cannot be used for DNS Resolution
+// ignore-fuchsia Req. test-harness networking privileges
use std::net::ToSocketAddrs;
diff --git a/src/test/ui/traits/alias/cross-crate.stderr b/src/test/ui/traits/alias/cross-crate.stderr
index d0d00c97e..ae9d7d0a9 100644
--- a/src/test/ui/traits/alias/cross-crate.stderr
+++ b/src/test/ui/traits/alias/cross-crate.stderr
@@ -5,7 +5,7 @@ LL | use_alias::<Rc<u32>>();
| ^^^^^^^ `Rc<u32>` cannot be sent between threads safely
|
= help: the trait `Send` is not implemented for `Rc<u32>`
- = note: required because of the requirements on the impl of `SendSync` for `Rc<u32>`
+ = note: required for `Rc<u32>` to implement `SendSync`
note: required by a bound in `use_alias`
--> $DIR/cross-crate.rs:10:17
|
@@ -19,7 +19,7 @@ LL | use_alias::<Rc<u32>>();
| ^^^^^^^ `Rc<u32>` cannot be shared between threads safely
|
= help: the trait `Sync` is not implemented for `Rc<u32>`
- = note: required because of the requirements on the impl of `SendSync` for `Rc<u32>`
+ = note: required for `Rc<u32>` to implement `SendSync`
note: required by a bound in `use_alias`
--> $DIR/cross-crate.rs:10:17
|
diff --git a/src/test/ui/traits/alias/generic-default-in-dyn.rs b/src/test/ui/traits/alias/generic-default-in-dyn.rs
new file mode 100644
index 000000000..d44e1c2a9
--- /dev/null
+++ b/src/test/ui/traits/alias/generic-default-in-dyn.rs
@@ -0,0 +1,10 @@
+trait SendEqAlias<T> = PartialEq;
+//~^ ERROR trait aliases are experimental
+
+struct Foo<T>(dyn SendEqAlias<T>);
+//~^ ERROR the type parameter `Rhs` must be explicitly specified [E0393]
+
+struct Bar<T>(dyn SendEqAlias<T>, T);
+//~^ ERROR the type parameter `Rhs` must be explicitly specified [E0393]
+
+fn main() {}
diff --git a/src/test/ui/traits/alias/generic-default-in-dyn.stderr b/src/test/ui/traits/alias/generic-default-in-dyn.stderr
new file mode 100644
index 000000000..76a068e86
--- /dev/null
+++ b/src/test/ui/traits/alias/generic-default-in-dyn.stderr
@@ -0,0 +1,39 @@
+error[E0658]: trait aliases are experimental
+ --> $DIR/generic-default-in-dyn.rs:1:1
+ |
+LL | trait SendEqAlias<T> = PartialEq;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = 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
+
+error[E0393]: the type parameter `Rhs` must be explicitly specified
+ --> $DIR/generic-default-in-dyn.rs:4:19
+ |
+LL | struct Foo<T>(dyn SendEqAlias<T>);
+ | ^^^^^^^^^^^^^^ missing reference to `Rhs`
+ |
+ ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+LL | pub trait PartialEq<Rhs: ?Sized = Self> {
+ | --------------------------------------- type parameter `Rhs` must be specified for this
+ |
+ = note: because of the default `Self` reference, type parameters must be specified on object types
+
+error[E0393]: the type parameter `Rhs` must be explicitly specified
+ --> $DIR/generic-default-in-dyn.rs:7:19
+ |
+LL | struct Bar<T>(dyn SendEqAlias<T>, T);
+ | ^^^^^^^^^^^^^^ missing reference to `Rhs`
+ |
+ ::: $SRC_DIR/core/src/cmp.rs:LL:COL
+ |
+LL | pub trait PartialEq<Rhs: ?Sized = Self> {
+ | --------------------------------------- type parameter `Rhs` must be specified for this
+ |
+ = note: because of the default `Self` reference, type parameters must be specified on object types
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0393, E0658.
+For more information about an error, try `rustc --explain E0393`.
diff --git a/src/test/ui/traits/alias/self-in-const-generics.rs b/src/test/ui/traits/alias/self-in-const-generics.rs
new file mode 100644
index 000000000..b0de8ccd6
--- /dev/null
+++ b/src/test/ui/traits/alias/self-in-const-generics.rs
@@ -0,0 +1,12 @@
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+#![feature(trait_alias)]
+
+trait Bar<const N: usize> {}
+
+trait BB = Bar<{ 2 + 1 }>;
+
+fn foo(x: &dyn BB) {}
+//~^ ERROR the trait alias `BB` cannot be made into an object [E0038]
+
+fn main() {}
diff --git a/src/test/ui/traits/alias/self-in-const-generics.stderr b/src/test/ui/traits/alias/self-in-const-generics.stderr
new file mode 100644
index 000000000..61cc217cf
--- /dev/null
+++ b/src/test/ui/traits/alias/self-in-const-generics.stderr
@@ -0,0 +1,11 @@
+error[E0038]: the trait alias `BB` cannot be made into an object
+ --> $DIR/self-in-const-generics.rs:9:16
+ |
+LL | fn foo(x: &dyn BB) {}
+ | ^^
+ |
+ = note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/traits/alias/self-in-generics.rs b/src/test/ui/traits/alias/self-in-generics.rs
new file mode 100644
index 000000000..0bb6335f9
--- /dev/null
+++ b/src/test/ui/traits/alias/self-in-generics.rs
@@ -0,0 +1,15 @@
+// astconv uses `FreshTy(0)` as a dummy `Self` type when instanciating trait objects.
+// This `FreshTy(0)` can leak into substs, causing ICEs in several places.
+// Using `save-analysis` triggers type-checking `f` that would be normally skipped
+// as `type_of` emitted an error.
+//
+// compile-flags: -Zsave-analysis
+
+#![feature(trait_alias)]
+
+pub trait SelfInput = Fn(&mut Self);
+
+pub fn f(_f: &dyn SelfInput) {}
+//~^ ERROR the trait alias `SelfInput` cannot be made into an object [E0038]
+
+fn main() {}
diff --git a/src/test/ui/traits/alias/self-in-generics.stderr b/src/test/ui/traits/alias/self-in-generics.stderr
new file mode 100644
index 000000000..110d60e6e
--- /dev/null
+++ b/src/test/ui/traits/alias/self-in-generics.stderr
@@ -0,0 +1,11 @@
+error[E0038]: the trait alias `SelfInput` cannot be made into an object
+ --> $DIR/self-in-generics.rs:12:19
+ |
+LL | pub fn f(_f: &dyn SelfInput) {}
+ | ^^^^^^^^^
+ |
+ = note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0038`.
diff --git a/src/test/ui/traits/assoc-type-in-superbad.rs b/src/test/ui/traits/assoc-type-in-superbad.rs
index 579ce7cf7..d7d6241ef 100644
--- a/src/test/ui/traits/assoc-type-in-superbad.rs
+++ b/src/test/ui/traits/assoc-type-in-superbad.rs
@@ -4,13 +4,13 @@
use std::vec::IntoIter;
-pub trait Foo: Iterator<Item=<Self as Foo>::Key> {
+pub trait Foo: Iterator<Item = <Self as Foo>::Key> {
type Key;
}
impl Foo for IntoIter<i32> {
- type Key = u32; //~ ERROR type mismatch
+ type Key = u32;
+ //~^ ERROR expected `std::vec::IntoIter<i32>` to be an iterator that yields `u32`, but it yields `i32`
}
-fn main() {
-}
+fn main() {}
diff --git a/src/test/ui/traits/assoc-type-in-superbad.stderr b/src/test/ui/traits/assoc-type-in-superbad.stderr
index f36947914..3e2d9d903 100644
--- a/src/test/ui/traits/assoc-type-in-superbad.stderr
+++ b/src/test/ui/traits/assoc-type-in-superbad.stderr
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `<std::vec::IntoIter<i32> as Iterator>::Item == u32`
+error[E0271]: expected `std::vec::IntoIter<i32>` to be an iterator that yields `u32`, but it yields `i32`
--> $DIR/assoc-type-in-superbad.rs:12:16
|
LL | type Key = u32;
@@ -7,8 +7,8 @@ LL | type Key = u32;
note: required by a bound in `Foo`
--> $DIR/assoc-type-in-superbad.rs:7:25
|
-LL | pub trait Foo: Iterator<Item=<Self as Foo>::Key> {
- | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo`
+LL | pub trait Foo: Iterator<Item = <Self as Foo>::Key> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo`
error: aborting due to previous error
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr
index bfbbe7fd2..fa7a8a2a0 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `str: Clone` is not satisfied
- --> $DIR/check-trait-object-bounds-1.rs:12:5
+ --> $DIR/check-trait-object-bounds-1.rs:12:9
|
LL | f::<dyn X<Y = str>>();
- | ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
+ | ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `f`
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr
index 46e8ce788..10e82c54e 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr
@@ -1,10 +1,10 @@
error[E0277]: expected a `FnOnce<(&i32,)>` closure, found `i32`
- --> $DIR/check-trait-object-bounds-2.rs:13:5
+ --> $DIR/check-trait-object-bounds-2.rs:13:9
|
LL | f::<dyn for<'x> X<'x, F = i32>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32`
|
- = help: the trait `for<'r> FnOnce<(&'r i32,)>` is not implemented for `i32`
+ = help: the trait `for<'a> FnOnce<(&'a i32,)>` is not implemented for `i32`
note: required by a bound in `f`
--> $DIR/check-trait-object-bounds-2.rs:8:9
|
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr
index 3ca36d5d2..4891ee9c2 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `str: Clone` is not satisfied
- --> $DIR/check-trait-object-bounds-4.rs:15:5
+ --> $DIR/check-trait-object-bounds-4.rs:15:9
|
LL | f::<dyn X<Y = str>>();
- | ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
+ | ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str`
|
= help: the trait `Clone` is implemented for `String`
note: required by a bound in `f`
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr
index 4251c1a1e..00fdb3753 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<i32 as Is>::T == i64`
- --> $DIR/check-trait-object-bounds-5.rs:23:5
+ --> $DIR/check-trait-object-bounds-5.rs:23:12
|
LL | is_obj(x)
- | ^^^^^^ type mismatch resolving `<i32 as Is>::T == i64`
+ | ------ ^ type mismatch resolving `<i32 as Is>::T == i64`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `i64`
--> $DIR/check-trait-object-bounds-5.rs:9:14
diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr
index 5b23a513e..9b0975e5e 100644
--- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr
+++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr
@@ -1,8 +1,10 @@
error[E0271]: type mismatch resolving `<i32 as Is>::T == i64`
- --> $DIR/check-trait-object-bounds-6.rs:20:5
+ --> $DIR/check-trait-object-bounds-6.rs:20:12
|
LL | is_obj(x)
- | ^^^^^^ type mismatch resolving `<i32 as Is>::T == i64`
+ | ------ ^ type mismatch resolving `<i32 as Is>::T == i64`
+ | |
+ | required by a bound introduced by this call
|
note: expected this to be `i64`
--> $DIR/check-trait-object-bounds-6.rs:9:14
diff --git a/src/test/ui/traits/bad-method-typaram-kind.stderr b/src/test/ui/traits/bad-method-typaram-kind.stderr
index 8befa4c5f..56acfbe80 100644
--- a/src/test/ui/traits/bad-method-typaram-kind.stderr
+++ b/src/test/ui/traits/bad-method-typaram-kind.stderr
@@ -1,8 +1,8 @@
error[E0277]: `T` cannot be sent between threads safely
- --> $DIR/bad-method-typaram-kind.rs:2:7
+ --> $DIR/bad-method-typaram-kind.rs:2:13
|
LL | 1.bar::<T>();
- | ^^^ `T` cannot be sent between threads safely
+ | ^ `T` cannot be sent between threads safely
|
note: required by a bound in `Bar::bar`
--> $DIR/bad-method-typaram-kind.rs:6:14
diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
index 1d2345180..f9a934764 100644
--- a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
+++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
@@ -2,10 +2,9 @@ fn strip_lf(s: &str) -> &str {
s.strip_suffix(b'\n').unwrap_or(s)
//~^ ERROR expected a `FnMut<(char,)>` closure, found `u8`
//~| NOTE expected an `FnMut<(char,)>` closure, found `u8`
- //~| NOTE required by a bound introduced by this call
//~| HELP the trait `FnMut<(char,)>` is not implemented for `u8`
//~| HELP the following other types implement trait `Pattern<'a>`:
- //~| NOTE required because of the requirements on the impl of `Pattern<'_>` for `u8`
+ //~| NOTE required for `u8` to implement `Pattern<'_>`
}
diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
index 6ce57b626..ce9ab2d81 100644
--- a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
+++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
@@ -1,10 +1,8 @@
error[E0277]: expected a `FnMut<(char,)>` closure, found `u8`
- --> $DIR/assoc-fn-bound-root-obligation.rs:2:20
+ --> $DIR/assoc-fn-bound-root-obligation.rs:2:7
|
LL | s.strip_suffix(b'\n').unwrap_or(s)
- | ------------ ^^^^^ expected an `FnMut<(char,)>` closure, found `u8`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^ expected an `FnMut<(char,)>` closure, found `u8`
|
= help: the trait `FnMut<(char,)>` is not implemented for `u8`
= help: the following other types implement trait `Pattern<'a>`:
@@ -15,7 +13,7 @@ LL | s.strip_suffix(b'\n').unwrap_or(s)
&'c &'b str
[char; N]
char
- = note: required because of the requirements on the impl of `Pattern<'_>` for `u8`
+ = note: required for `u8` to implement `Pattern<'_>`
error: aborting due to previous error
diff --git a/src/test/ui/traits/bound/not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr
index 8a92dd118..8da0b6d6b 100644
--- a/src/test/ui/traits/bound/not-on-bare-trait.stderr
+++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr
@@ -4,14 +4,13 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | fn foo(_x: Foo + Send) {
| ^^^^^^^^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
-LL - fn foo(_x: Foo + Send) {
-LL + fn foo(_x: dyn Foo + Send) {
- |
+LL | fn foo(_x: dyn Foo + Send) {
+ | +++
error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time
--> $DIR/not-on-bare-trait.rs:7:8
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-locals.rs b/src/test/ui/traits/bound/on-structs-and-enums-locals.rs
index 21c0ce80f..60ba343bb 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-locals.rs
+++ b/src/test/ui/traits/bound/on-structs-and-enums-locals.rs
@@ -8,8 +8,8 @@ struct Foo<T:Trait> {
fn main() {
let foo = Foo {
- //~^ ERROR E0277
x: 3
+ //~^ ERROR E0277
};
let baz: Foo<usize> = loop { };
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr
index c9068a270..20bbe69c0 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr
@@ -11,10 +11,10 @@ LL | struct Foo<T:Trait> {
| ^^^^^ required by this bound in `Foo`
error[E0277]: the trait bound `{integer}: Trait` is not satisfied
- --> $DIR/on-structs-and-enums-locals.rs:10:15
+ --> $DIR/on-structs-and-enums-locals.rs:11:12
|
-LL | let foo = Foo {
- | ^^^ the trait `Trait` is not implemented for `{integer}`
+LL | x: 3
+ | ^ the trait `Trait` is not implemented for `{integer}`
|
note: required by a bound in `Foo`
--> $DIR/on-structs-and-enums-locals.rs:5:14
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs b/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs
index 8156868e0..5ef35b513 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs
+++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs
@@ -6,8 +6,8 @@ use on_structs_and_enums_xc::{Bar, Foo, Trait};
fn main() {
let foo = Foo {
- //~^ ERROR E0277
x: 3
+ //~^ ERROR E0277
};
let bar: Bar<f64> = return;
//~^ ERROR E0277
diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr
index f4cc64af9..3fb5decb7 100644
--- a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr
+++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr
@@ -11,10 +11,10 @@ LL | pub enum Bar<T:Trait> {
| ^^^^^ required by this bound in `Bar`
error[E0277]: the trait bound `{integer}: Trait` is not satisfied
- --> $DIR/on-structs-and-enums-xc1.rs:8:15
+ --> $DIR/on-structs-and-enums-xc1.rs:9:12
|
-LL | let foo = Foo {
- | ^^^ the trait `Trait` is not implemented for `{integer}`
+LL | x: 3
+ | ^ the trait `Trait` is not implemented for `{integer}`
|
note: required by a bound in `Foo`
--> $DIR/auxiliary/on_structs_and_enums_xc.rs:5:18
diff --git a/src/test/ui/traits/copy-impl-cannot-normalize.stderr b/src/test/ui/traits/copy-impl-cannot-normalize.stderr
index afdad1609..68b95b42b 100644
--- a/src/test/ui/traits/copy-impl-cannot-normalize.stderr
+++ b/src/test/ui/traits/copy-impl-cannot-normalize.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `T: TraitFoo` is not satisfied
- --> $DIR/copy-impl-cannot-normalize.rs:22:1
+ --> $DIR/copy-impl-cannot-normalize.rs:22:18
|
LL | impl<T> Copy for Foo<T> {}
- | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitFoo` is not implemented for `T`
+ | ^^^^^^ the trait `TraitFoo` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
diff --git a/src/test/ui/traits/cycle-cache-err-60010.stderr b/src/test/ui/traits/cycle-cache-err-60010.stderr
index 859403f20..2478eb354 100644
--- a/src/test/ui/traits/cycle-cache-err-60010.stderr
+++ b/src/test/ui/traits/cycle-cache-err-60010.stderr
@@ -17,12 +17,12 @@ note: required because it appears within the type `RootDatabase`
|
LL | struct RootDatabase {
| ^^^^^^^^^^^^
-note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase`
+note: required for `RootDatabase` to implement `SourceDatabase`
--> $DIR/cycle-cache-err-60010.rs:44:9
|
LL | impl<T> SourceDatabase for T
| ^^^^^^^^^^^^^^ ^
-note: required because of the requirements on the impl of `Query<RootDatabase>` for `ParseQuery`
+note: required for `ParseQuery` to implement `Query<RootDatabase>`
--> $DIR/cycle-cache-err-60010.rs:37:10
|
LL | impl<DB> Query<DB> for ParseQuery
diff --git a/src/test/ui/traits/inductive-overflow/lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs
index c36c17d3d..004e47737 100644
--- a/src/test/ui/traits/inductive-overflow/lifetime.rs
+++ b/src/test/ui/traits/inductive-overflow/lifetime.rs
@@ -28,5 +28,5 @@ fn main() {
is_send::<X<C<'static>>>();
//~^ ERROR overflow evaluating
//~| 3 redundant requirements hidden
- //~| required because of
+ //~| required for
}
diff --git a/src/test/ui/traits/inductive-overflow/lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr
index 9ca615aac..b72d53bdd 100644
--- a/src/test/ui/traits/inductive-overflow/lifetime.stderr
+++ b/src/test/ui/traits/inductive-overflow/lifetime.stderr
@@ -4,13 +4,13 @@ error[E0275]: overflow evaluating the requirement `X<C<'_>>: NotAuto`
LL | is_send::<X<C<'static>>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
-note: required because of the requirements on the impl of `NotAuto` for `Box<X<C<'_>>>`
+note: required for `Box<X<C<'_>>>` to implement `NotAuto`
--> $DIR/lifetime.rs:18:18
|
LL | impl<T: NotAuto> NotAuto for Box<T> {}
| ^^^^^^^ ^^^^^^
= note: 3 redundant requirements hidden
- = note: required because of the requirements on the impl of `NotAuto` for `X<C<'static>>`
+ = note: required for `X<C<'static>>` to implement `NotAuto`
note: required by a bound in `is_send`
--> $DIR/lifetime.rs:22:15
|
diff --git a/src/test/ui/traits/inductive-overflow/simultaneous.stderr b/src/test/ui/traits/inductive-overflow/simultaneous.stderr
index 230c2638c..09930e60e 100644
--- a/src/test/ui/traits/inductive-overflow/simultaneous.stderr
+++ b/src/test/ui/traits/inductive-overflow/simultaneous.stderr
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum`
LL | is_ee(4);
| ^^^^^
|
-note: required because of the requirements on the impl of `Combo` for `{integer}`
+note: required for `{integer}` to implement `Combo`
--> $DIR/simultaneous.rs:11:34
|
LL | impl<T: Tweedledee + Tweedledum> Combo for T {}
diff --git a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
index d7697dcc6..3ec288d13 100644
--- a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
+++ b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr
@@ -14,7 +14,7 @@ LL | let (a, b) = copy(NoClone);
| |
| required by a bound introduced by this call
|
-note: required because of the requirements on the impl of `Magic` for `NoClone`
+note: required for `NoClone` to implement `Magic`
--> $DIR/supertrait-auto-trait.rs:8:12
|
LL | auto trait Magic: Copy {}
diff --git a/src/test/ui/traits/inductive-overflow/supertrait.stderr b/src/test/ui/traits/inductive-overflow/supertrait.stderr
index 95325a534..4b862cf79 100644
--- a/src/test/ui/traits/inductive-overflow/supertrait.stderr
+++ b/src/test/ui/traits/inductive-overflow/supertrait.stderr
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `NoClone: Magic`
LL | let (a, b) = copy(NoClone);
| ^^^^
|
-note: required because of the requirements on the impl of `Magic` for `NoClone`
+note: required for `NoClone` to implement `Magic`
--> $DIR/supertrait.rs:5:16
|
LL | impl<T: Magic> Magic for T {}
diff --git a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
index cab0ccdf7..656e0d0bf 100644
--- a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
+++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
@@ -1,18 +1,22 @@
error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied
- --> $DIR/repeated-supertrait-ambig.rs:26:7
+ --> $DIR/repeated-supertrait-ambig.rs:26:15
|
LL | c.same_as(22)
- | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts`
+ | ------- ^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts`
+ | |
+ | required by a bound introduced by this call
|
= help: the following other types implement trait `CompareTo<T>`:
<i64 as CompareTo<i64>>
<i64 as CompareTo<u64>>
error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied
- --> $DIR/repeated-supertrait-ambig.rs:30:7
+ --> $DIR/repeated-supertrait-ambig.rs:30:15
|
LL | c.same_as(22)
- | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `C`
+ | ------- ^^ the trait `CompareTo<i32>` is not implemented for `C`
+ | |
+ | required by a bound introduced by this call
|
help: consider further restricting this bound
|
@@ -20,20 +24,24 @@ LL | fn with_trait<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool {
| ++++++++++++++++
error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied
- --> $DIR/repeated-supertrait-ambig.rs:34:5
+ --> $DIR/repeated-supertrait-ambig.rs:34:37
|
LL | <dyn CompareToInts>::same_as(c, 22)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts`
+ | ---------------------------- ^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts`
+ | |
+ | required by a bound introduced by this call
|
= help: the following other types implement trait `CompareTo<T>`:
<i64 as CompareTo<i64>>
<i64 as CompareTo<u64>>
error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied
- --> $DIR/repeated-supertrait-ambig.rs:38:5
+ --> $DIR/repeated-supertrait-ambig.rs:38:27
|
LL | CompareTo::same_as(c, 22)
- | ^^^^^^^^^^^^^^^^^^ the trait `CompareTo<i32>` is not implemented for `C`
+ | ------------------ ^^ the trait `CompareTo<i32>` is not implemented for `C`
+ | |
+ | required by a bound introduced by this call
|
help: consider further restricting this bound
|
@@ -41,10 +49,12 @@ LL | fn with_ufcs2<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool {
| ++++++++++++++++
error[E0277]: the trait bound `i64: CompareTo<i32>` is not satisfied
- --> $DIR/repeated-supertrait-ambig.rs:42:23
+ --> $DIR/repeated-supertrait-ambig.rs:42:31
|
LL | assert_eq!(22_i64.same_as(22), true);
- | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `i64`
+ | ------- ^^ the trait `CompareTo<i32>` is not implemented for `i64`
+ | |
+ | required by a bound introduced by this call
|
= help: the following other types implement trait `CompareTo<T>`:
<i64 as CompareTo<i64>>
diff --git a/src/test/ui/traits/issue-102989.rs b/src/test/ui/traits/issue-102989.rs
new file mode 100644
index 000000000..62f95272f
--- /dev/null
+++ b/src/test/ui/traits/issue-102989.rs
@@ -0,0 +1,16 @@
+// normalize-stderr-test "loaded from .*libcore-.*.rlib" -> "loaded from SYSROOT/libcore-*.rlib"
+
+#![feature(lang_items)]
+#[lang="sized"]
+trait Sized { } //~ ERROR found duplicate lang item `sized`
+
+fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
+ //~^ ERROR `self` parameter is only allowed in associated functions
+ //~| ERROR cannot find type `Struct` in this scope
+ //~| ERROR mismatched types
+ let x = x << 1;
+ //~^ ERROR the size for values of type `{integer}` cannot be known at compilation time
+ //~| ERROR cannot find value `x` in this scope
+}
+
+fn main() {}
diff --git a/src/test/ui/traits/issue-102989.stderr b/src/test/ui/traits/issue-102989.stderr
new file mode 100644
index 000000000..efe1a2467
--- /dev/null
+++ b/src/test/ui/traits/issue-102989.stderr
@@ -0,0 +1,59 @@
+error: `self` parameter is only allowed in associated functions
+ --> $DIR/issue-102989.rs:7:15
+ |
+LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
+ | ^^^^ not semantically valid as function parameter
+ |
+ = note: associated functions are those in `impl` or `trait` definitions
+
+error[E0412]: cannot find type `Struct` in this scope
+ --> $DIR/issue-102989.rs:7:22
+ |
+LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
+ | ^^^^^^ not found in this scope
+
+error[E0425]: cannot find value `x` in this scope
+ --> $DIR/issue-102989.rs:11:13
+ |
+LL | let x = x << 1;
+ | ^ help: a local variable with a similar name exists: `f`
+
+error[E0152]: found duplicate lang item `sized`
+ --> $DIR/issue-102989.rs:5:1
+ |
+LL | trait Sized { }
+ | ^^^^^^^^^^^
+ |
+ = note: the lang item is first defined in crate `core` (which `std` depends on)
+ = note: first definition in `core` loaded from SYSROOT/libcore-*.rlib
+ = note: second definition in the local crate (`issue_102989`)
+
+error[E0277]: the size for values of type `{integer}` cannot be known at compilation time
+ --> $DIR/issue-102989.rs:11:15
+ |
+LL | let x = x << 1;
+ | ^^ doesn't have a size known at compile-time
+ |
+ = help: the trait `std::marker::Sized` is not implemented for `{integer}`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-102989.rs:7:42
+ |
+LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
+ | ---------- ^^^^ expected `&u32`, found `()`
+ | |
+ | implicitly returns `()` as its body has no tail or `return` expression
+ |
+note: consider returning one of these bindings
+ --> $DIR/issue-102989.rs:7:30
+ |
+LL | fn ref_Struct(self: &Struct, f: &u32) -> &u32 {
+ | ^
+...
+LL | let x = x << 1;
+ | ^
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0152, E0277, E0308, E0412, E0425.
+For more information about an error, try `rustc --explain E0152`.
diff --git a/src/test/ui/traits/issue-18400.stderr b/src/test/ui/traits/issue-18400.stderr
index 92e0f6007..4394e6f7e 100644
--- a/src/test/ui/traits/issue-18400.stderr
+++ b/src/test/ui/traits/issue-18400.stderr
@@ -5,13 +5,13 @@ LL | 0.contains(bits);
| ^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_18400`)
-note: required because of the requirements on the impl of `Set<&[_]>` for `{integer}`
+note: required for `{integer}` to implement `Set<&[_]>`
--> $DIR/issue-18400.rs:6:16
|
LL | impl<'a, T, S> Set<&'a [T]> for S where
| ^^^^^^^^^^^^ ^
= note: 128 redundant requirements hidden
- = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}`
+ = note: required for `{integer}` to implement `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>`
error: aborting due to previous error
diff --git a/src/test/ui/traits/issue-20692.stderr b/src/test/ui/traits/issue-20692.stderr
index 1d7f252e5..2028994cd 100644
--- a/src/test/ui/traits/issue-20692.stderr
+++ b/src/test/ui/traits/issue-20692.stderr
@@ -27,7 +27,7 @@ LL | trait Array: Sized + Copy {}
| | |
| | ...because it requires `Self: Sized`
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Array>` for `&T`
+ = note: required for `&T` to implement `CoerceUnsized<&dyn Array>`
= note: required by cast to type `&dyn Array`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/issue-33140-hack-boundaries.stderr b/src/test/ui/traits/issue-33140-hack-boundaries.stderr
index 62cfca545..58286648d 100644
--- a/src/test/ui/traits/issue-33140-hack-boundaries.stderr
+++ b/src/test/ui/traits/issue-33140-hack-boundaries.stderr
@@ -66,3 +66,20 @@ error: aborting due to 8 previous errors
Some errors have detailed explanations: E0119, E0751.
For more information about an error, try `rustc --explain E0119`.
+Future incompatibility report: Future breakage diagnostic:
+warning: conflicting implementations of trait `Trait0` for type `(dyn std::marker::Send + 'static)`: (E0119)
+ --> $DIR/issue-33140-hack-boundaries.rs:10:1
+ |
+LL | impl Trait0 for dyn Send {}
+ | ------------------------ first implementation here
+LL | impl Trait0 for dyn Send {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
+ |
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
+note: the lint level is defined here
+ --> $DIR/issue-33140-hack-boundaries.rs:2:10
+ |
+LL | #![allow(order_dependent_trait_objects)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/src/test/ui/traits/issue-38604.stderr b/src/test/ui/traits/issue-38604.stderr
index d41488c15..50d6fb054 100644
--- a/src/test/ui/traits/issue-38604.stderr
+++ b/src/test/ui/traits/issue-38604.stderr
@@ -25,7 +25,7 @@ LL | trait Foo where u32: Q<Self> {
| --- ^^^^^^^ ...because it uses `Self` as a type parameter
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Foo>>` for `Box<()>`
+ = note: required for `Box<()>` to implement `CoerceUnsized<Box<dyn Foo>>`
= note: required by cast to type `Box<dyn Foo>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/issues/issue-43784-supertrait.rs b/src/test/ui/traits/issue-43784-supertrait.rs
index 55c26ccd2..55c26ccd2 100644
--- a/src/test/ui/issues/issue-43784-supertrait.rs
+++ b/src/test/ui/traits/issue-43784-supertrait.rs
diff --git a/src/test/ui/issues/issue-43784-supertrait.stderr b/src/test/ui/traits/issue-43784-supertrait.stderr
index bb890cb99..bb890cb99 100644
--- a/src/test/ui/issues/issue-43784-supertrait.stderr
+++ b/src/test/ui/traits/issue-43784-supertrait.stderr
diff --git a/src/test/ui/traits/issue-71036.rs b/src/test/ui/traits/issue-71036.rs
index 3d2df6fe9..69eed0c04 100644
--- a/src/test/ui/traits/issue-71036.rs
+++ b/src/test/ui/traits/issue-71036.rs
@@ -12,6 +12,6 @@ impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'
//~^ ERROR the trait bound `&'a T: Unsize<&'a U>` is not satisfied
//~| NOTE the trait `Unsize<&'a U>` is not implemented for `&'a T`
//~| NOTE all implementations of `Unsize` are provided automatically by the compiler
-//~| NOTE required because of the requirements on the impl
+//~| NOTE required for
fn main() {}
diff --git a/src/test/ui/traits/issue-71036.stderr b/src/test/ui/traits/issue-71036.stderr
index 3ee6db40e..79eb7a2ae 100644
--- a/src/test/ui/traits/issue-71036.stderr
+++ b/src/test/ui/traits/issue-71036.stderr
@@ -5,7 +5,7 @@ LL | impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unsize<&'a U>` is not implemented for `&'a T`
|
= note: all implementations of `Unsize` are provided automatically by the compiler, see <https://doc.rust-lang.org/stable/std/marker/trait.Unsize.html> for more information
- = note: required because of the requirements on the impl of `DispatchFromDyn<&'a &'a U>` for `&'a &'a T`
+ = note: required for `&'a &'a T` to implement `DispatchFromDyn<&'a &'a U>`
error: aborting due to previous error
diff --git a/src/test/ui/traits/issue-71136.stderr b/src/test/ui/traits/issue-71136.stderr
index 62a2a64ed..f54173392 100644
--- a/src/test/ui/traits/issue-71136.stderr
+++ b/src/test/ui/traits/issue-71136.stderr
@@ -7,7 +7,7 @@ LL | struct FooHolster {
LL | the_foos: Vec<Foo>,
| ^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `Foo`
|
- = note: required because of the requirements on the impl of `Clone` for `Vec<Foo>`
+ = note: required for `Vec<Foo>` to implement `Clone`
= 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)]`
|
diff --git a/src/test/ui/traits/issue-77982.stderr b/src/test/ui/traits/issue-77982.stderr
index 2b832e27c..e210f11b3 100644
--- a/src/test/ui/traits/issue-77982.stderr
+++ b/src/test/ui/traits/issue-77982.stderr
@@ -2,7 +2,9 @@ error[E0283]: type annotations needed
--> $DIR/issue-77982.rs:8:10
|
LL | opts.get(opt.as_ref());
- | ^^^ cannot infer type of the type parameter `Q` declared on the associated function `get`
+ | ^^^ ------------ type must be known at this point
+ | |
+ | cannot infer type of the type parameter `Q` declared on the associated function `get`
|
= note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
- impl Borrow<str> for String;
@@ -13,7 +15,7 @@ note: required by a bound in `HashMap::<K, V, S>::get`
|
LL | K: Borrow<Q>,
| ^^^^^^^^^ required by this bound in `HashMap::<K, V, S>::get`
-help: consider specifying the type argument in the function call
+help: consider specifying the generic argument
|
LL | opts.get::<Q>(opt.as_ref());
| +++++
@@ -42,7 +44,7 @@ error[E0283]: type annotations needed
LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect();
| --------- ^^^^
| |
- | type must be known at this point
+ | required by a bound introduced by this call
|
= note: multiple `impl`s satisfying `u32: From<_>` found in the following crates: `core`, `std`:
- impl From<Ipv4Addr> for u32;
diff --git a/src/test/ui/traits/issue-8153.stderr b/src/test/ui/traits/issue-8153.stderr
index b76bbc023..ae214bb9e 100644
--- a/src/test/ui/traits/issue-8153.stderr
+++ b/src/test/ui/traits/issue-8153.stderr
@@ -1,10 +1,13 @@
error[E0201]: duplicate definitions with name `bar`:
--> $DIR/issue-8153.rs:11:5
|
+LL | fn bar(&self) -> isize;
+ | ----------------------- item in trait
+...
LL | fn bar(&self) -> isize {1}
- | ---------------------- previous definition of `bar` here
+ | -------------------------- previous definition here
LL | fn bar(&self) -> isize {2}
- | ^^^^^^^^^^^^^^^^^^^^^^ duplicate definition
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition
error: aborting due to previous error
diff --git a/src/test/ui/traits/issue-82830.stderr b/src/test/ui/traits/issue-82830.stderr
index f863143c7..6a597a402 100644
--- a/src/test/ui/traits/issue-82830.stderr
+++ b/src/test/ui/traits/issue-82830.stderr
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `P: Sized`
LL | t: MaybeBox<P>,
| ^^^^^^^^^^^
|
-note: required because of the requirements on the impl of `A<P, Box<P>>` for `P`
+note: required for `P` to implement `A<P, Box<P>>`
--> $DIR/issue-82830.rs:10:12
|
LL | impl<Y, N> A<Y, N> for P {
diff --git a/src/test/ui/traits/issue-91594.stderr b/src/test/ui/traits/issue-91594.stderr
index f2b3de13b..5fcd090a8 100644
--- a/src/test/ui/traits/issue-91594.stderr
+++ b/src/test/ui/traits/issue-91594.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `Foo: HasComponent<()>` is not satisfied
- --> $DIR/issue-91594.rs:10:6
+ --> $DIR/issue-91594.rs:10:1
|
LL | impl HasComponent<<Foo as Component<Foo>>::Interface> for Foo {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo`
|
= help: the trait `HasComponent<<Foo as Component<Foo>>::Interface>` is implemented for `Foo`
-note: required because of the requirements on the impl of `Component<Foo>` for `Foo`
+note: required for `Foo` to implement `Component<Foo>`
--> $DIR/issue-91594.rs:13:27
|
LL | impl<M: HasComponent<()>> Component<M> for Foo {
diff --git a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr
index f5d6d72af..61b6d4b08 100644
--- a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr
+++ b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr
@@ -9,15 +9,15 @@ LL | {
LL | recurse(IteratorOfWrapped(elements).map(|t| t.0))
| ------------------------------------------------- recursive call site
|
- = note: `#[warn(unconditional_recursion)]` on by default
= 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`
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`)
- = note: required because of the requirements on the impl of `Iterator` for `std::iter::Empty<()>`
+ = note: required for `std::iter::Empty<()>` to implement `Iterator`
= note: 171 redundant requirements hidden
- = note: required because of the requirements on the impl of `Iterator` for `IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), std::iter::Empty<()>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>`
+ = note: required for `IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), Map<IteratorOfWrapped<(), std::iter::Empty<()>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>` to implement `Iterator`
error: aborting due to previous error; 1 warning emitted
diff --git a/src/test/ui/traits/issue-97576.stderr b/src/test/ui/traits/issue-97576.stderr
index bdee073d6..146d38d07 100644
--- a/src/test/ui/traits/issue-97576.stderr
+++ b/src/test/ui/traits/issue-97576.stderr
@@ -1,10 +1,12 @@
error[E0277]: the trait bound `String: From<impl ToString>` is not satisfied
- --> $DIR/issue-97576.rs:8:22
+ --> $DIR/issue-97576.rs:8:18
|
LL | bar: bar.into(),
- | ^^^^ the trait `From<impl ToString>` is not implemented for `String`
+ | ^^^ ---- required by a bound introduced by this call
+ | |
+ | the trait `From<impl ToString>` is not implemented for `String`
|
- = note: required because of the requirements on the impl of `Into<String>` for `impl ToString`
+ = note: required for `impl ToString` to implement `Into<String>`
error: aborting due to previous error
diff --git a/src/test/ui/traits/multidispatch-bad.stderr b/src/test/ui/traits/multidispatch-bad.stderr
index 8b6e61006..d58f1e2d9 100644
--- a/src/test/ui/traits/multidispatch-bad.stderr
+++ b/src/test/ui/traits/multidispatch-bad.stderr
@@ -10,7 +10,7 @@ note: function defined here
--> $DIR/multidispatch-bad.rs:13:4
|
LL | fn test<T,U>(_: T, _: U)
- | ^^^^ ---- ----
+ | ^^^^ ----
help: change the type of the numeric literal from `i32` to `u32`
|
LL | test(22i32, 44u32);
diff --git a/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr b/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr
index cbec35934..6e6172eea 100644
--- a/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr
+++ b/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr
@@ -13,7 +13,9 @@ error[E0283]: type annotations needed
--> $DIR/multidispatch-convert-ambig-dest.rs:26:5
|
LL | test(22, std::default::Default::default());
- | ^^^^ cannot infer type of the type parameter `U` declared on the function `test`
+ | ^^^^ -------------------------------- type must be known at this point
+ | |
+ | cannot infer type of the type parameter `U` declared on the function `test`
|
note: multiple `impl`s satisfying `i32: Convert<_>` found
--> $DIR/multidispatch-convert-ambig-dest.rs:8:1
@@ -30,10 +32,10 @@ LL | fn test<T,U>(_: T, _: U)
| ---- required by a bound in this
LL | where T : Convert<U>
| ^^^^^^^^^^ required by this bound in `test`
-help: consider specifying the type arguments in the function call
+help: consider specifying the generic arguments
|
-LL | test::<T, U>(22, std::default::Default::default());
- | ++++++++
+LL | test::<i32, U>(22, std::default::Default::default());
+ | ++++++++++
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs b/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs
index 1314f9cb0..17ddaa312 100644
--- a/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs
+++ b/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs
@@ -1,5 +1,5 @@
// This tests issue #79683: note in the error message that the trait is
-// explicitely unimplemented instead of suggesting to implement it.
+// explicitly unimplemented instead of suggesting to implement it.
#![feature(negative_impls)]
diff --git a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr
index c5d4ccc2f..41fc3600f 100644
--- a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr
+++ b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr
@@ -61,12 +61,12 @@ error[E0277]: `dummy2::TestType` cannot be sent between threads safely
--> $DIR/negated-auto-traits-error.rs:48:13
|
LL | is_send(Box::new(TestType));
- | ------- ^^^^^^^^^^^^^^^^^^ expected an implementor of trait `Send`
+ | ------- ^^^^^^^^^^^^^^^^^^ the trait `Send` is not implemented for `Unique<dummy2::TestType>`
| |
| required by a bound introduced by this call
|
= note: the trait bound `Unique<dummy2::TestType>: Send` is not satisfied
- = note: required because of the requirements on the impl of `Send` for `Unique<dummy2::TestType>`
+ = note: required for `Unique<dummy2::TestType>` to implement `Send`
= note: required because it appears within the type `Box<dummy2::TestType>`
note: required by a bound in `is_send`
--> $DIR/negated-auto-traits-error.rs:16:15
@@ -92,7 +92,7 @@ note: required because it appears within the type `Outer2<dummy3::TestType>`
|
LL | struct Outer2<T>(T);
| ^^^^^^
- = note: required because of the requirements on the impl of `Send` for `Unique<Outer2<dummy3::TestType>>`
+ = note: required for `Unique<Outer2<dummy3::TestType>>` to implement `Send`
= note: required because it appears within the type `Box<Outer2<dummy3::TestType>>`
note: required by a bound in `is_send`
--> $DIR/negated-auto-traits-error.rs:16:15
@@ -109,7 +109,7 @@ LL | is_sync(Outer2(TestType));
| required by a bound introduced by this call
|
= help: the trait `Send` is not implemented for `main::TestType`
-note: required because of the requirements on the impl of `Sync` for `Outer2<main::TestType>`
+note: required for `Outer2<main::TestType>` to implement `Sync`
--> $DIR/negated-auto-traits-error.rs:14:22
|
LL | unsafe impl<T: Send> Sync for Outer2<T> {}
diff --git a/src/test/ui/traits/negative-impls/negative-default-impls.stderr b/src/test/ui/traits/negative-impls/negative-default-impls.stderr
index ceb86559d..7b54cf542 100644
--- a/src/test/ui/traits/negative-impls/negative-default-impls.stderr
+++ b/src/test/ui/traits/negative-impls/negative-default-impls.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0750]: negative impls cannot be default impls
--> $DIR/negative-default-impls.rs:9:1
diff --git a/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr b/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr
index 9a846143d..751e29c3b 100644
--- a/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr
+++ b/src/test/ui/traits/negative-impls/negative-specializes-negative.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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
warning: 1 warning emitted
diff --git a/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr b/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr
index 77b4373a2..1cfa49b20 100644
--- a/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr
+++ b/src/test/ui/traits/negative-impls/negative-specializes-positive-item.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0751]: found both positive and negative implementation of trait `MyTrait` for type `u32`:
--> $DIR/negative-specializes-positive-item.rs:11:1
diff --git a/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr b/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr
index e5dc81b3e..9f9e28678 100644
--- a/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr
+++ b/src/test/ui/traits/negative-impls/negative-specializes-positive.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0751]: found both positive and negative implementation of trait `MyTrait` for type `u32`:
--> $DIR/negative-specializes-positive.rs:7:1
diff --git a/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr b/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr
index c091bc81d..545f94143 100644
--- a/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr
+++ b/src/test/ui/traits/negative-impls/positive-specializes-negative.stderr
@@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= 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[E0751]: found both positive and negative implementation of trait `MyTrait` for type `u32`:
--> $DIR/positive-specializes-negative.rs:7:1
diff --git a/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr b/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr
index 75d45d905..53178328c 100644
--- a/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr
+++ b/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr
@@ -22,7 +22,7 @@ LL | impl I<i32> for B {}
| ^^^^^^^^^^^^^^^^^
LL | impl I<u32> for B {}
| ^^^^^^^^^^^^^^^^^
-note: required because of the requirements on the impl of `V<_>` for `A<B>`
+note: required for `A<B>` to implement `V<_>`
--> $DIR/not-suggest-non-existing-fully-qualified-path.rs:12:12
|
LL | impl<T, U> V<U> for A<T>
diff --git a/src/test/ui/traits/object/enforce-supertrait-projection.stderr b/src/test/ui/traits/object/enforce-supertrait-projection.stderr
index eab42ca56..cbf093866 100644
--- a/src/test/ui/traits/object/enforce-supertrait-projection.stderr
+++ b/src/test/ui/traits/object/enforce-supertrait-projection.stderr
@@ -1,12 +1,12 @@
error[E0271]: type mismatch resolving `<dyn Trait<B = B, A = A> as SuperTrait>::A == B`
- --> $DIR/enforce-supertrait-projection.rs:9:5
+ --> $DIR/enforce-supertrait-projection.rs:9:17
|
LL | fn transmute<A, B>(x: A) -> B {
| - - expected type parameter
| |
| found type parameter
LL | foo::<A, B, dyn Trait<A = A, B = B>>(x)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `B`, found type parameter `A`
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `B`, found type parameter `A`
|
= note: expected type parameter `B`
found type parameter `A`
diff --git a/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr b/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr
index 77d71360b..0af4df2ae 100644
--- a/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr
+++ b/src/test/ui/traits/object/issue-33140-traitobject-crate.stderr
@@ -6,13 +6,13 @@ LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { }
LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
|
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
note: the lint level is defined here
--> $DIR/issue-33140-traitobject-crate.rs:3:9
|
LL | #![warn(order_dependent_trait_objects)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
--> $DIR/issue-33140-traitobject-crate.rs:89:1
@@ -40,3 +40,56 @@ LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { }
warning: 3 warnings emitted
+Future incompatibility report: Future breakage diagnostic:
+warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
+ --> $DIR/issue-33140-traitobject-crate.rs:86:1
+ |
+LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { }
+ | ------------------------------------------------------ first implementation here
+LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
+ |
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
+note: the lint level is defined here
+ --> $DIR/issue-33140-traitobject-crate.rs:3:9
+ |
+LL | #![warn(order_dependent_trait_objects)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Future breakage diagnostic:
+warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
+ --> $DIR/issue-33140-traitobject-crate.rs:89:1
+ |
+LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { }
+ | ------------------------------------------------------------- first implementation here
+...
+LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
+ |
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
+note: the lint level is defined here
+ --> $DIR/issue-33140-traitobject-crate.rs:3:9
+ |
+LL | #![warn(order_dependent_trait_objects)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Future breakage diagnostic:
+warning: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: (E0119)
+ --> $DIR/issue-33140-traitobject-crate.rs:93:1
+ |
+LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { }
+ | ------------------------------------------------------ first implementation here
+...
+LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
+ |
+ = 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 #56484 <https://github.com/rust-lang/rust/issues/56484>
+note: the lint level is defined here
+ --> $DIR/issue-33140-traitobject-crate.rs:3:9
+ |
+LL | #![warn(order_dependent_trait_objects)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/src/test/ui/traits/object/safety.stderr b/src/test/ui/traits/object/safety.stderr
index cf534d984..dc18adeaf 100644
--- a/src/test/ui/traits/object/safety.stderr
+++ b/src/test/ui/traits/object/safety.stderr
@@ -11,7 +11,7 @@ LL | trait Tr {
| -- this trait cannot be made into an object...
LL | fn foo();
| ^^^ ...because associated function `foo` has no `self` parameter
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Tr>` for `&St`
+ = note: required for `&St` to implement `CoerceUnsized<&dyn Tr>`
= note: required by cast to type `&dyn Tr`
help: consider turning `foo` into a method by giving it a `&self` argument
|
diff --git a/src/test/ui/traits/pointee-tail-is-generic-errors.stderr b/src/test/ui/traits/pointee-tail-is-generic-errors.stderr
index 8456f8456..0c3d7060d 100644
--- a/src/test/ui/traits/pointee-tail-is-generic-errors.stderr
+++ b/src/test/ui/traits/pointee-tail-is-generic-errors.stderr
@@ -1,8 +1,8 @@
error[E0271]: type mismatch resolving `<T as Pointee>::Metadata == ()`
- --> $DIR/pointee-tail-is-generic-errors.rs:13:5
+ --> $DIR/pointee-tail-is-generic-errors.rs:13:15
|
LL | is_thin::<T>();
- | ^^^^^^^^^^^^ expected `()`, found associated type
+ | ^ expected `()`, found associated type
|
= note: expected unit type `()`
found associated type `<T as Pointee>::Metadata`
@@ -15,13 +15,13 @@ LL | fn is_thin<T: std::ptr::Pointee<Metadata = ()> + ?Sized>() {}
| ^^^^^^^^^^^^^ required by this bound in `is_thin`
error[E0271]: type mismatch resolving `<Opaque as Pointee>::Metadata == ()`
- --> $DIR/pointee-tail-is-generic-errors.rs:16:5
+ --> $DIR/pointee-tail-is-generic-errors.rs:16:15
|
LL | type Opaque = impl std::fmt::Debug + ?Sized;
| ----------------------------- the found opaque type
...
LL | is_thin::<Opaque>();
- | ^^^^^^^^^^^^^^^^^ expected `()`, found associated type
+ | ^^^^^^ expected `()`, found associated type
|
= note: expected unit type `()`
found associated type `<Opaque as Pointee>::Metadata`
diff --git a/src/test/ui/traits/resolution-in-overloaded-op.stderr b/src/test/ui/traits/resolution-in-overloaded-op.stderr
index 34fae64e4..fe5e1d6d2 100644
--- a/src/test/ui/traits/resolution-in-overloaded-op.stderr
+++ b/src/test/ui/traits/resolution-in-overloaded-op.stderr
@@ -8,8 +8,8 @@ LL | a * b
|
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
-LL | fn foo<T: MyMul<f64, f64>>(a: &T, b: f64) -> f64 where &T: Mul<f64> {
- | ++++++++++++++++++
+LL | fn foo<T: MyMul<f64, f64>>(a: &T, b: f64) -> f64 where &T: Mul<f64, Output = f64> {
+ | ++++++++++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/traits/safety-trait-impl-cc.stderr b/src/test/ui/traits/safety-trait-impl-cc.stderr
index 5a0f8d3b8..0b1fb3047 100644
--- a/src/test/ui/traits/safety-trait-impl-cc.stderr
+++ b/src/test/ui/traits/safety-trait-impl-cc.stderr
@@ -7,6 +7,12 @@ LL | | panic!();
LL | | }
LL | | }
| |_^
+ |
+ = note: the trait `Foo` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
+help: add `unsafe` to this trait implementation
+ |
+LL | unsafe impl lib::Foo for Bar {
+ | ++++++
error: aborting due to previous error
diff --git a/src/test/ui/traits/safety-trait-impl.stderr b/src/test/ui/traits/safety-trait-impl.stderr
index fc0f6c693..721e2b48b 100644
--- a/src/test/ui/traits/safety-trait-impl.stderr
+++ b/src/test/ui/traits/safety-trait-impl.stderr
@@ -3,12 +3,24 @@ error[E0200]: the trait `UnsafeTrait` requires an `unsafe impl` declaration
|
LL | impl UnsafeTrait for u16 { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: the trait `UnsafeTrait` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword
+help: add `unsafe` to this trait implementation
+ |
+LL | unsafe impl UnsafeTrait for u16 { }
+ | ++++++
error[E0199]: implementing the trait `SafeTrait` is not unsafe
--> $DIR/safety-trait-impl.rs:16:1
|
LL | unsafe impl SafeTrait for u32 { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+help: remove `unsafe` from this trait implementation
+ |
+LL - unsafe impl SafeTrait for u32 { }
+LL + impl SafeTrait for u32 { }
+ |
error: aborting due to 2 previous errors
diff --git a/src/test/ui/traits/static-method-generic-inference.stderr b/src/test/ui/traits/static-method-generic-inference.stderr
index f1b8f23ec..5f74d0c3b 100644
--- a/src/test/ui/traits/static-method-generic-inference.stderr
+++ b/src/test/ui/traits/static-method-generic-inference.stderr
@@ -9,8 +9,8 @@ LL | let _f: base::Foo = base::HasNew::new();
|
help: use the fully-qualified path to the only available implementation
|
-LL | let _f: base::Foo = base::<::base::Foo as HasNew>::new();
- | +++++++++++++++ +
+LL | let _f: base::Foo = base::<Foo as HasNew>::new();
+ | +++++++ +
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/issue-39029.stderr b/src/test/ui/traits/suggest-deferences/issue-39029.stderr
index 5c324cd38..eb2b88059 100644
--- a/src/test/ui/traits/suggest-deferences/issue-39029.stderr
+++ b/src/test/ui/traits/suggest-deferences/issue-39029.stderr
@@ -2,18 +2,20 @@ error[E0277]: the trait bound `NoToSocketAddrs: ToSocketAddrs` is not satisfied
--> $DIR/issue-39029.rs:16:37
|
LL | let _errors = TcpListener::bind(&bad);
- | ----------------- ^^^^
- | | |
- | | the trait `ToSocketAddrs` is not implemented for `NoToSocketAddrs`
- | | help: consider dereferencing here: `&*bad`
+ | ----------------- ^^^^ the trait `ToSocketAddrs` is not implemented for `NoToSocketAddrs`
+ | |
| required by a bound introduced by this call
|
- = note: required because of the requirements on the impl of `ToSocketAddrs` for `&NoToSocketAddrs`
+ = note: required for `&NoToSocketAddrs` to implement `ToSocketAddrs`
note: required by a bound in `TcpListener::bind`
--> $SRC_DIR/std/src/net/tcp.rs:LL:COL
|
LL | pub fn bind<A: ToSocketAddrs>(addr: A) -> io::Result<TcpListener> {
| ^^^^^^^^^^^^^ required by this bound in `TcpListener::bind`
+help: consider dereferencing here
+ |
+LL | let _errors = TcpListener::bind(&*bad);
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/issue-62530.stderr b/src/test/ui/traits/suggest-deferences/issue-62530.stderr
index d129328da..e47ae0b65 100644
--- a/src/test/ui/traits/suggest-deferences/issue-62530.stderr
+++ b/src/test/ui/traits/suggest-deferences/issue-62530.stderr
@@ -2,10 +2,8 @@ error[E0277]: the trait bound `&String: SomeTrait` is not satisfied
--> $DIR/issue-62530.rs:13:26
|
LL | takes_type_parameter(&string); // Error
- | -------------------- ^^^^^^^
- | | |
- | | the trait `SomeTrait` is not implemented for `&String`
- | | help: consider dereferencing here: `&*string`
+ | -------------------- ^^^^^^^ the trait `SomeTrait` is not implemented for `&String`
+ | |
| required by a bound introduced by this call
|
note: required by a bound in `takes_type_parameter`
@@ -13,6 +11,10 @@ note: required by a bound in `takes_type_parameter`
|
LL | fn takes_type_parameter<T>(_x: T) where T: SomeTrait {}
| ^^^^^^^^^ required by this bound in `takes_type_parameter`
+help: consider dereferencing here
+ |
+LL | takes_type_parameter(&*string); // Error
+ | +
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/multiple-0.stderr b/src/test/ui/traits/suggest-deferences/multiple-0.stderr
index efb3c7d12..6a4d4b8d5 100644
--- a/src/test/ui/traits/suggest-deferences/multiple-0.stderr
+++ b/src/test/ui/traits/suggest-deferences/multiple-0.stderr
@@ -2,10 +2,8 @@ error[E0277]: the trait bound `&Baz: Happy` is not satisfied
--> $DIR/multiple-0.rs:34:9
|
LL | foo(&baz);
- | --- ^^^^
- | | |
- | | the trait `Happy` is not implemented for `&Baz`
- | | help: consider dereferencing here: `&***baz`
+ | --- ^^^^ the trait `Happy` is not implemented for `&Baz`
+ | |
| required by a bound introduced by this call
|
note: required by a bound in `foo`
@@ -13,6 +11,10 @@ note: required by a bound in `foo`
|
LL | fn foo<T>(_: T) where T: Happy {}
| ^^^^^ required by this bound in `foo`
+help: consider dereferencing here
+ |
+LL | foo(&***baz);
+ | +++
error: aborting due to previous error
diff --git a/src/test/ui/traits/suggest-deferences/root-obligation.stderr b/src/test/ui/traits/suggest-deferences/root-obligation.stderr
index 16e03e79c..76663ace7 100644
--- a/src/test/ui/traits/suggest-deferences/root-obligation.stderr
+++ b/src/test/ui/traits/suggest-deferences/root-obligation.stderr
@@ -7,8 +7,8 @@ LL | .filter(|c| "aeiou".contains(c))
| required by a bound introduced by this call
|
= help: the trait `Fn<(char,)>` is not implemented for `char`
- = note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&char`
- = note: required because of the requirements on the impl of `Pattern<'_>` for `&char`
+ = note: required for `&char` to implement `FnOnce<(char,)>`
+ = note: required for `&char` to implement `Pattern<'_>`
note: required by a bound in `core::str::<impl str>::contains`
--> $SRC_DIR/core/src/str/mod.rs:LL:COL
|
diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr
index d4d9b4967..747e2477b 100644
--- a/src/test/ui/traits/suggest-where-clause.stderr
+++ b/src/test/ui/traits/suggest-where-clause.stderr
@@ -19,13 +19,13 @@ LL + fn check<T: Iterator, U>() {
|
error[E0277]: the size for values of type `U` cannot be known at compilation time
- --> $DIR/suggest-where-clause.rs:10:5
+ --> $DIR/suggest-where-clause.rs:10:20
|
LL | fn check<T: Iterator, U: ?Sized>() {
| - this type parameter needs to be `std::marker::Sized`
...
LL | mem::size_of::<Misc<U>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | ^^^^^^^ doesn't have a size known at compile-time
|
note: required because it appears within the type `Misc<U>`
--> $DIR/suggest-where-clause.rs:3:8
diff --git a/src/test/ui/traits/test-2.stderr b/src/test/ui/traits/test-2.stderr
index 77ea4e4e9..eaa20b0b4 100644
--- a/src/test/ui/traits/test-2.stderr
+++ b/src/test/ui/traits/test-2.stderr
@@ -76,7 +76,7 @@ LL | trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
| this trait cannot be made into an object...
= help: consider moving `dup` to another trait
= help: consider moving `blah` to another trait
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn bar>>` for `Box<{integer}>`
+ = note: required for `Box<{integer}>` to implement `CoerceUnsized<Box<dyn bar>>`
= note: required by cast to type `Box<dyn bar>`
error: aborting due to 5 previous errors
diff --git a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr
index 35af9112a..6c359b698 100644
--- a/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr
+++ b/src/test/ui/traits/trait-upcasting/migrate-lint-deny.stderr
@@ -4,13 +4,13 @@ error: `dyn B` implements `Deref` with supertrait `(dyn A + 'static)` as output
LL | take_a(b)
| ^
|
+ = 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 #89460 <https://github.com/rust-lang/rust/issues/89460>
note: the lint level is defined here
--> $DIR/migrate-lint-deny.rs:1:9
|
LL | #![deny(deref_into_dyn_supertrait)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
- = 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 #89460 <https://github.com/rust-lang/rust/issues/89460>
error: aborting due to previous error
diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs
index 6986ad621..6986ad621 100644
--- a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.rs
+++ b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.rs
diff --git a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr
index e9670ad7d..956481351 100644
--- a/src/test/ui/traits/trait-upcasting/multiple-occurence-ambiguousity.stderr
+++ b/src/test/ui/traits/trait-upcasting/multiple-occurrence-ambiguousity.stderr
@@ -1,5 +1,5 @@
error[E0308]: mismatched types
- --> $DIR/multiple-occurence-ambiguousity.rs:21:26
+ --> $DIR/multiple-occurrence-ambiguousity.rs:21:26
|
LL | let t: &dyn Bar<_> = s;
| ----------- ^ expected trait `Bar`, found trait `Foo`
diff --git a/src/test/ui/traits/trait-upcasting/subtrait-method.stderr b/src/test/ui/traits/trait-upcasting/subtrait-method.stderr
index 8c6901180..af7a410f6 100644
--- a/src/test/ui/traits/trait-upcasting/subtrait-method.stderr
+++ b/src/test/ui/traits/trait-upcasting/subtrait-method.stderr
@@ -2,7 +2,7 @@ error[E0599]: no method named `c` found for reference `&dyn Bar` in the current
--> $DIR/subtrait-method.rs:56:9
|
LL | bar.c();
- | ^ help: there is an associated function with a similar name: `a`
+ | ^ help: there is a method with a similar name: `a`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `Baz` defines an item `c`, perhaps you need to implement it
@@ -15,7 +15,7 @@ error[E0599]: no method named `b` found for reference `&dyn Foo` in the current
--> $DIR/subtrait-method.rs:60:9
|
LL | foo.b();
- | ^ help: there is an associated function with a similar name: `a`
+ | ^ help: there is a method with a similar name: `a`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `Bar` defines an item `b`, perhaps you need to implement it
@@ -28,7 +28,7 @@ error[E0599]: no method named `c` found for reference `&dyn Foo` in the current
--> $DIR/subtrait-method.rs:62:9
|
LL | foo.c();
- | ^ help: there is an associated function with a similar name: `a`
+ | ^ help: there is a method with a similar name: `a`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `Baz` defines an item `c`, perhaps you need to implement it
@@ -41,7 +41,7 @@ error[E0599]: no method named `b` found for reference `&dyn Foo` in the current
--> $DIR/subtrait-method.rs:66:9
|
LL | foo.b();
- | ^ help: there is an associated function with a similar name: `a`
+ | ^ help: there is a method with a similar name: `a`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `Bar` defines an item `b`, perhaps you need to implement it
@@ -54,7 +54,7 @@ error[E0599]: no method named `c` found for reference `&dyn Foo` in the current
--> $DIR/subtrait-method.rs:68:9
|
LL | foo.c();
- | ^ help: there is an associated function with a similar name: `a`
+ | ^ help: there is a method with a similar name: `a`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `Baz` defines an item `c`, perhaps you need to implement it
diff --git a/src/test/ui/unspecified-self-in-trait-ref.rs b/src/test/ui/traits/unspecified-self-in-trait-ref.rs
index 158b5a985..158b5a985 100644
--- a/src/test/ui/unspecified-self-in-trait-ref.rs
+++ b/src/test/ui/traits/unspecified-self-in-trait-ref.rs
diff --git a/src/test/ui/unspecified-self-in-trait-ref.stderr b/src/test/ui/traits/unspecified-self-in-trait-ref.stderr
index 7869176bb..b5e8e8867 100644
--- a/src/test/ui/unspecified-self-in-trait-ref.stderr
+++ b/src/test/ui/traits/unspecified-self-in-trait-ref.stderr
@@ -4,9 +4,9 @@ warning: trait objects without an explicit `dyn` are deprecated
LL | let a = Foo::lol();
| ^^^
|
- = note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
+ = note: `#[warn(bare_trait_objects)]` on by default
help: use `dyn`
|
LL | let a = <dyn Foo>::lol();
diff --git a/src/test/ui/transmutability/abstraction/abstracted_assume.rs b/src/test/ui/transmutability/abstraction/abstracted_assume.rs
index 2abbbf3c1..0225c4230 100644
--- a/src/test/ui/transmutability/abstraction/abstracted_assume.rs
+++ b/src/test/ui/transmutability/abstraction/abstracted_assume.rs
@@ -3,6 +3,7 @@
//! provided indirectly through an abstraction.
#![crate_type = "lib"]
+#![feature(adt_const_params)]
#![feature(transmutability)]
#![allow(dead_code, incomplete_features, non_camel_case_types)]
@@ -13,19 +14,13 @@ mod assert {
Src,
Dst,
Context,
- const ASSUME_ALIGNMENT: bool,
- const ASSUME_LIFETIMES: bool,
- const ASSUME_VALIDITY: bool,
- const ASSUME_VISIBILITY: bool,
+ const ASSUME: std::mem::Assume,
>()
where
Dst: BikeshedIntrinsicFrom<
Src,
Context,
- ASSUME_ALIGNMENT,
- ASSUME_LIFETIMES,
- ASSUME_VALIDITY,
- ASSUME_VISIBILITY,
+ ASSUME,
>,
{}
}
@@ -35,7 +30,7 @@ fn direct() {
#[repr(C)] struct Src;
#[repr(C)] struct Dst;
- assert::is_transmutable::<Src, Dst, Context, false, false, false, false>();
+ assert::is_transmutable::<Src, Dst, Context, { std::mem::Assume::NOTHING }>();
}
fn via_const() {
@@ -45,7 +40,7 @@ fn via_const() {
const FALSE: bool = false;
- assert::is_transmutable::<Src, Dst, Context, FALSE, FALSE, FALSE, FALSE>();
+ assert::is_transmutable::<Src, Dst, Context, { std::mem::Assume::NOTHING }>();
}
fn via_associated_const() {
@@ -65,9 +60,13 @@ fn via_associated_const() {
Src,
Dst,
Context,
- {Ty::FALSE},
- {Ty::FALSE},
- {Ty::FALSE},
- {Ty::FALSE}
+ {
+ std::mem::Assume {
+ alignment: {Ty::FALSE},
+ lifetimes: {Ty::FALSE},
+ safety: {Ty::FALSE},
+ validity: {Ty::FALSE},
+ }
+ }
>();
}
diff --git a/src/test/ui/transmutability/abstraction/const_generic_fn.rs b/src/test/ui/transmutability/abstraction/const_generic_fn.rs
index 94c38bb28..e693a0957 100644
--- a/src/test/ui/transmutability/abstraction/const_generic_fn.rs
+++ b/src/test/ui/transmutability/abstraction/const_generic_fn.rs
@@ -6,13 +6,13 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn array_like<T, E, const N: usize>()
where
- T: BikeshedIntrinsicFrom<[E; N], Context, false, false, false, true>,
- [E; N]: BikeshedIntrinsicFrom<T, Context, false, false, false, true>
+ T: BikeshedIntrinsicFrom<[E; N], Context, { Assume::SAFETY }>,
+ [E; N]: BikeshedIntrinsicFrom<T, Context, { Assume::SAFETY }>
{}
}
diff --git a/src/test/ui/transmutability/arrays/should_have_correct_length.rs b/src/test/ui/transmutability/arrays/should_have_correct_length.rs
index bfe6d830a..353797d0c 100644
--- a/src/test/ui/transmutability/arrays/should_have_correct_length.rs
+++ b/src/test/ui/transmutability/arrays/should_have_correct_length.rs
@@ -6,12 +6,12 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
{}
}
diff --git a/src/test/ui/transmutability/arrays/should_inherit_alignment.rs b/src/test/ui/transmutability/arrays/should_inherit_alignment.rs
index fcb1765ea..b00e5c7e4 100644
--- a/src/test/ui/transmutability/arrays/should_inherit_alignment.rs
+++ b/src/test/ui/transmutability/arrays/should_inherit_alignment.rs
@@ -6,12 +6,17 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs
index 8e69527c1..853bd9cbc 100644
--- a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs
+++ b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.rs
@@ -5,12 +5,17 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr
index eae0c947d..96a2fdc54 100644
--- a/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr
+++ b/src/test/ui/transmutability/arrays/should_require_well_defined_layout.stderr
@@ -1,98 +1,134 @@
error[E0277]: `[String; 0]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:21:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<[String; 0], assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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_maybe_transmutable`
error[E0277]: `u128` cannot be safely transmuted into `[String; 0]` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:22:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `[String; 0]`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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_maybe_transmutable`
error[E0277]: `[String; 1]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:27:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<[String; 1], assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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_maybe_transmutable`
error[E0277]: `u128` cannot be safely transmuted into `[String; 1]` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:28:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `[String; 1]`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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_maybe_transmutable`
error[E0277]: `[String; 2]` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:33:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<[String; 2], assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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_maybe_transmutable`
error[E0277]: `u128` cannot be safely transmuted into `[String; 2]` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:34:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `[String; 2]`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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_maybe_transmutable`
error: aborting due to 6 previous errors
diff --git a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs
index 18e02b0d2..940f070e7 100644
--- a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs
+++ b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.rs
@@ -5,11 +5,18 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr
index fa2e3b89b..4da5fcea3 100644
--- a/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr
+++ b/src/test/ui/transmutability/enums/repr/primitive_reprs_should_have_correct_length.stderr
@@ -1,322 +1,462 @@
error[E0277]: `Zst` cannot be safely transmuted into `V0i8` in the defining scope of `n8::Context`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:41:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:43:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0i8, n8::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:49:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Zst, n8::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:51:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0u8, n8::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:65:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:67:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0i16, n16::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:73:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, n16::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:75:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0u16, n16::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:89:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:91:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0i32, n32::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:97:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, n32::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:99:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0u32, n32::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:113:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:115:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0i64, n64::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:121:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u32, n64::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:123:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0u64, n64::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:137:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:139:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0isize, nsize::Context, true, true, true, true>` is not implemented for `[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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:145:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, nsize::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+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`.
- --> $DIR/primitive_reprs_should_have_correct_length.rs:147:44
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<V0usize, nsize::Context, true, true, true, true>` is not implemented for `[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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+LL | where
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
+ | ______________^
+LL | | Assume {
+LL | | alignment: true,
+LL | | lifetimes: true,
+... |
+LL | | }
+LL | | }>
+ | |__________^ required by this bound in `is_transmutable`
error: aborting due to 20 previous errors
diff --git a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs
index 978a12648..102111ae2 100644
--- a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs
+++ b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.rs
@@ -6,12 +6,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr
index 3273e87c8..510b8c56e 100644
--- a/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr
+++ b/src/test/ui/transmutability/enums/repr/should_require_well_defined_layout.stderr
@@ -1,98 +1,140 @@
error[E0277]: `void::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:21:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<void::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `u128` cannot be safely transmuted into `void::repr_rust` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:22:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `void::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `singleton::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:27:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<singleton::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `u128` cannot be safely transmuted into `singleton::repr_rust` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:28:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `singleton::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `duplex::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:33:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<duplex::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `u128` cannot be safely transmuted into `duplex::repr_rust` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:34:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `duplex::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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 6 previous errors
diff --git a/src/test/ui/transmutability/enums/should_order_correctly.rs b/src/test/ui/transmutability/enums/should_order_correctly.rs
index 6558d2658..1335cc9d2 100644
--- a/src/test/ui/transmutability/enums/should_order_correctly.rs
+++ b/src/test/ui/transmutability/enums/should_order_correctly.rs
@@ -2,17 +2,21 @@
//! The payloads of an enum variant should be ordered after its tag.
#![crate_type = "lib"]
-#![feature(arbitrary_enum_discriminant)]
#![feature(transmutability)]
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/enums/should_pad_variants.rs b/src/test/ui/transmutability/enums/should_pad_variants.rs
index 466b6c8a1..c077c52a3 100644
--- a/src/test/ui/transmutability/enums/should_pad_variants.rs
+++ b/src/test/ui/transmutability/enums/should_pad_variants.rs
@@ -6,11 +6,16 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/enums/should_pad_variants.stderr b/src/test/ui/transmutability/enums/should_pad_variants.stderr
index 429f7211d..a823503d5 100644
--- a/src/test/ui/transmutability/enums/should_pad_variants.stderr
+++ b/src/test/ui/transmutability/enums/should_pad_variants.stderr
@@ -1,18 +1,24 @@
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
- --> $DIR/should_pad_variants.rs:39:36
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+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
diff --git a/src/test/ui/transmutability/enums/should_respect_endianness.rs b/src/test/ui/transmutability/enums/should_respect_endianness.rs
index 67a3c4e94..f3567b405 100644
--- a/src/test/ui/transmutability/enums/should_respect_endianness.rs
+++ b/src/test/ui/transmutability/enums/should_respect_endianness.rs
@@ -2,17 +2,21 @@
//! an enum with a multi-byte tag.
#![crate_type = "lib"]
-#![feature(arbitrary_enum_discriminant)]
#![feature(transmutability)]
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/enums/should_respect_endianness.stderr b/src/test/ui/transmutability/enums/should_respect_endianness.stderr
index 78023cb37..0845a5edf 100644
--- a/src/test/ui/transmutability/enums/should_respect_endianness.stderr
+++ b/src/test/ui/transmutability/enums/should_respect_endianness.stderr
@@ -1,18 +1,24 @@
error[E0277]: `Src` cannot be safely transmuted into `Unexpected` in the defining scope of `assert::Context`.
- --> $DIR/should_respect_endianness.rs:32:36
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Src, assert::Context, true, true, true, true>` is not implemented for `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:15:14
+ --> $DIR/should_respect_endianness.rs:14:14
|
-LL | pub fn is_transmutable<Src, Dst>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst>()
+ | --------------- required by a bound in this
+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
diff --git a/src/test/ui/transmutability/issue-101739-1.rs b/src/test/ui/transmutability/issue-101739-1.rs
new file mode 100644
index 000000000..bcb8b158e
--- /dev/null
+++ b/src/test/ui/transmutability/issue-101739-1.rs
@@ -0,0 +1,21 @@
+#![feature(transmutability)]
+
+mod assert {
+ use std::mem::BikeshedIntrinsicFrom;
+
+ 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
+ {
+ }
+}
+
+fn via_const() {
+ struct Context;
+ struct Src;
+
+ assert::is_transmutable::<Src, Context, false>();
+}
+
+fn main() {}
diff --git a/src/test/ui/transmutability/issue-101739-1.stderr b/src/test/ui/transmutability/issue-101739-1.stderr
new file mode 100644
index 000000000..5fa741f26
--- /dev/null
+++ b/src/test/ui/transmutability/issue-101739-1.stderr
@@ -0,0 +1,16 @@
+error[E0412]: cannot find type `Dst` in this scope
+ --> $DIR/issue-101739-1.rs:8:9
+ |
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>,
+ | ^^^ not found in this scope
+
+error[E0308]: mismatched types
+ --> $DIR/issue-101739-1.rs:8:50
+ |
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>,
+ | ^^^^^^^^^^^^^^^^ expected struct `Assume`, found `bool`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0308, E0412.
+For more information about an error, try `rustc --explain E0308`.
diff --git a/src/test/ui/transmutability/issue-101739-2.rs b/src/test/ui/transmutability/issue-101739-2.rs
new file mode 100644
index 000000000..964a7e49e
--- /dev/null
+++ b/src/test/ui/transmutability/issue-101739-2.rs
@@ -0,0 +1,37 @@
+#![crate_type = "lib"]
+#![feature(transmutability)]
+#![allow(dead_code, incomplete_features, non_camel_case_types)]
+
+mod assert {
+ use std::mem::BikeshedIntrinsicFrom;
+
+ pub fn is_transmutable<
+ Src,
+ Dst,
+ Context,
+ const ASSUME_ALIGNMENT: bool,
+ const ASSUME_LIFETIMES: bool,
+ const ASSUME_VALIDITY: bool,
+ const ASSUME_VISIBILITY: bool,
+ >()
+ where
+ Dst: BikeshedIntrinsicFrom< //~ ERROR this trait takes at most 3 generic arguments but 6 generic arguments were supplied
+ Src,
+ Context,
+ ASSUME_ALIGNMENT,
+ ASSUME_LIFETIMES,
+ ASSUME_VALIDITY,
+ ASSUME_VISIBILITY,
+ >,
+ {}
+}
+
+fn via_const() {
+ struct Context;
+ #[repr(C)] struct Src;
+ #[repr(C)] struct Dst;
+
+ const FALSE: bool = false;
+
+ assert::is_transmutable::<Src, Dst, Context, FALSE, FALSE, FALSE, FALSE>();
+}
diff --git a/src/test/ui/transmutability/issue-101739-2.stderr b/src/test/ui/transmutability/issue-101739-2.stderr
new file mode 100644
index 000000000..3f83d6583
--- /dev/null
+++ b/src/test/ui/transmutability/issue-101739-2.stderr
@@ -0,0 +1,20 @@
+error[E0107]: this trait takes at most 3 generic arguments but 6 generic arguments were supplied
+ --> $DIR/issue-101739-2.rs:18:14
+ |
+LL | Dst: BikeshedIntrinsicFrom<
+ | ^^^^^^^^^^^^^^^^^^^^^ expected at most 3 generic arguments
+...
+LL | / ASSUME_LIFETIMES,
+LL | | ASSUME_VALIDITY,
+LL | | ASSUME_VISIBILITY,
+ | |_____________________________- help: remove these generic arguments
+ |
+note: trait defined here, with at most 3 generic parameters: `Src`, `Context`, `ASSUME`
+ --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL
+ |
+LL | pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }>
+ | ^^^^^^^^^^^^^^^^^^^^^ --- ------- ------------------------------------------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs
index e13462d39..b3a1e13b8 100644
--- a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs
+++ b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_dst.rs
@@ -10,7 +10,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
+ Dst: BikeshedIntrinsicFrom<Src, Context>
{}
}
diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs
index dc51e2a8f..092b205b7 100644
--- a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs
+++ b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src.rs
@@ -10,7 +10,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
+ Dst: BikeshedIntrinsicFrom<Src, Context>
{}
}
diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
index 86fc8bd6b..ebe34e134 100644
--- a/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
+++ b/src/test/ui/transmutability/malformed-program-gracefulness/unknown_src_field.rs
@@ -10,7 +10,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
+ Dst: BikeshedIntrinsicFrom<Src, Context>
{}
}
diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs
index bd36748e7..52aa4bb31 100644
--- a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs
+++ b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.rs
@@ -2,11 +2,13 @@
//! provided.
#![crate_type = "lib"]
+#![feature(adt_const_params)]
+#![feature(generic_const_exprs)]
#![feature(transmutability)]
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<
Src,
@@ -14,19 +16,30 @@ mod assert {
Context,
const ASSUME_ALIGNMENT: bool,
const ASSUME_LIFETIMES: bool,
+ const ASSUME_SAFETY: bool,
const ASSUME_VALIDITY: bool,
- const ASSUME_VISIBILITY: bool,
>()
where
Dst: BikeshedIntrinsicFrom<
Src,
Context,
- ASSUME_ALIGNMENT,
- ASSUME_LIFETIMES,
- ASSUME_VALIDITY,
- ASSUME_VISIBILITY,
+ { from_options(ASSUME_ALIGNMENT, ASSUME_LIFETIMES, ASSUME_SAFETY, ASSUME_VALIDITY) }
>,
{}
+
+ const fn from_options(
+ alignment: bool,
+ lifetimes: bool,
+ safety: bool,
+ validity: bool,
+ ) -> Assume {
+ Assume {
+ alignment,
+ lifetimes,
+ safety,
+ validity,
+ }
+ }
}
fn test() {
diff --git a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr
index e1464e023..c6d93876c 100644
--- a/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr
+++ b/src/test/ui/transmutability/malformed-program-gracefulness/wrong-type-assume.stderr
@@ -1,23 +1,23 @@
error[E0308]: mismatched types
- --> $DIR/wrong-type-assume.rs:36:51
+ --> $DIR/wrong-type-assume.rs:49:51
|
LL | assert::is_transmutable::<Src, Dst, Context, {0u8}, false, false, false>();
| ^^^ expected `bool`, found `u8`
error[E0308]: mismatched types
- --> $DIR/wrong-type-assume.rs:37:58
+ --> $DIR/wrong-type-assume.rs:50:58
|
LL | assert::is_transmutable::<Src, Dst, Context, false, {0u8}, false, false>();
| ^^^ expected `bool`, found `u8`
error[E0308]: mismatched types
- --> $DIR/wrong-type-assume.rs:38:65
+ --> $DIR/wrong-type-assume.rs:51:65
|
LL | assert::is_transmutable::<Src, Dst, Context, false, false, {0u8}, false>();
| ^^^ expected `bool`, found `u8`
error[E0308]: mismatched types
- --> $DIR/wrong-type-assume.rs:39:72
+ --> $DIR/wrong-type-assume.rs:52:72
|
LL | assert::is_transmutable::<Src, Dst, Context, false, false, false, {0u8}>();
| ^^^ expected `bool`, found `u8`
diff --git a/src/test/ui/transmutability/primitives/bool.rs b/src/test/ui/transmutability/primitives/bool.rs
index 4f79bc253..eebb74fff 100644
--- a/src/test/ui/transmutability/primitives/bool.rs
+++ b/src/test/ui/transmutability/primitives/bool.rs
@@ -4,17 +4,17 @@
#![allow(incomplete_features)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
{}
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
{}
}
diff --git a/src/test/ui/transmutability/primitives/bool.stderr b/src/test/ui/transmutability/primitives/bool.stderr
index dc740251c..214b5e150 100644
--- a/src/test/ui/transmutability/primitives/bool.stderr
+++ b/src/test/ui/transmutability/primitives/bool.stderr
@@ -4,15 +4,15 @@ error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope
LL | assert::is_transmutable::<u8, bool>();
| ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, true>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to previous error
diff --git a/src/test/ui/transmutability/primitives/numbers.rs b/src/test/ui/transmutability/primitives/numbers.rs
index a5f79065d..0df43d204 100644
--- a/src/test/ui/transmutability/primitives/numbers.rs
+++ b/src/test/ui/transmutability/primitives/numbers.rs
@@ -9,7 +9,7 @@ mod assert {
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
+ Dst: BikeshedIntrinsicFrom<Src, Context>
{}
}
diff --git a/src/test/ui/transmutability/primitives/numbers.stderr b/src/test/ui/transmutability/primitives/numbers.stderr
index 9b802a444..7cb7ca8e6 100644
--- a/src/test/ui/transmutability/primitives/numbers.stderr
+++ b/src/test/ui/transmutability/primitives/numbers.stderr
@@ -4,15 +4,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i16` in the defining scope
LL | assert::is_transmutable::< i8, i16>();
| ^^^ `i8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -20,15 +20,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u16` in the defining scope
LL | assert::is_transmutable::< i8, u16>();
| ^^^ `i8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -36,15 +36,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i32` in the defining scope
LL | assert::is_transmutable::< i8, i32>();
| ^^^ `i8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -52,15 +52,15 @@ error[E0277]: `i8` cannot be safely transmuted into `f32` in the defining scope
LL | assert::is_transmutable::< i8, f32>();
| ^^^ `i8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -68,15 +68,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u32` in the defining scope
LL | assert::is_transmutable::< i8, u32>();
| ^^^ `i8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -84,15 +84,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u64` in the defining scope
LL | assert::is_transmutable::< i8, u64>();
| ^^^ `i8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -100,15 +100,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i64` in the defining scope
LL | assert::is_transmutable::< i8, i64>();
| ^^^ `i8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -116,15 +116,15 @@ error[E0277]: `i8` cannot be safely transmuted into `f64` in the defining scope
LL | assert::is_transmutable::< i8, f64>();
| ^^^ `i8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -132,15 +132,15 @@ error[E0277]: `i8` cannot be safely transmuted into `u128` in the defining scope
LL | assert::is_transmutable::< i8, u128>();
| ^^^^ `i8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -148,15 +148,15 @@ error[E0277]: `i8` cannot be safely transmuted into `i128` in the defining scope
LL | assert::is_transmutable::< i8, i128>();
| ^^^^ `i8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -164,15 +164,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i16` in the defining scope
LL | assert::is_transmutable::< u8, i16>();
| ^^^ `u8` cannot be safely transmuted into `i16` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -180,15 +180,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u16` in the defining scope
LL | assert::is_transmutable::< u8, u16>();
| ^^^ `u8` cannot be safely transmuted into `u16` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -196,15 +196,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i32` in the defining scope
LL | assert::is_transmutable::< u8, i32>();
| ^^^ `u8` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -212,15 +212,15 @@ error[E0277]: `u8` cannot be safely transmuted into `f32` in the defining scope
LL | assert::is_transmutable::< u8, f32>();
| ^^^ `u8` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -228,15 +228,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u32` in the defining scope
LL | assert::is_transmutable::< u8, u32>();
| ^^^ `u8` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -244,15 +244,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u64` in the defining scope
LL | assert::is_transmutable::< u8, u64>();
| ^^^ `u8` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -260,15 +260,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i64` in the defining scope
LL | assert::is_transmutable::< u8, i64>();
| ^^^ `u8` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -276,15 +276,15 @@ error[E0277]: `u8` cannot be safely transmuted into `f64` in the defining scope
LL | assert::is_transmutable::< u8, f64>();
| ^^^ `u8` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -292,15 +292,15 @@ error[E0277]: `u8` cannot be safely transmuted into `u128` in the defining scope
LL | assert::is_transmutable::< u8, u128>();
| ^^^^ `u8` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -308,15 +308,15 @@ error[E0277]: `u8` cannot be safely transmuted into `i128` in the defining scope
LL | assert::is_transmutable::< u8, i128>();
| ^^^^ `u8` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -324,15 +324,15 @@ error[E0277]: `i16` cannot be safely transmuted into `i32` in the defining scope
LL | assert::is_transmutable::< i16, i32>();
| ^^^ `i16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -340,15 +340,15 @@ error[E0277]: `i16` cannot be safely transmuted into `f32` in the defining scope
LL | assert::is_transmutable::< i16, f32>();
| ^^^ `i16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -356,15 +356,15 @@ error[E0277]: `i16` cannot be safely transmuted into `u32` in the defining scope
LL | assert::is_transmutable::< i16, u32>();
| ^^^ `i16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -372,15 +372,15 @@ error[E0277]: `i16` cannot be safely transmuted into `u64` in the defining scope
LL | assert::is_transmutable::< i16, u64>();
| ^^^ `i16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -388,15 +388,15 @@ error[E0277]: `i16` cannot be safely transmuted into `i64` in the defining scope
LL | assert::is_transmutable::< i16, i64>();
| ^^^ `i16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -404,15 +404,15 @@ error[E0277]: `i16` cannot be safely transmuted into `f64` in the defining scope
LL | assert::is_transmutable::< i16, f64>();
| ^^^ `i16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -420,15 +420,15 @@ error[E0277]: `i16` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< i16, u128>();
| ^^^^ `i16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -436,15 +436,15 @@ error[E0277]: `i16` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< i16, i128>();
| ^^^^ `i16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -452,15 +452,15 @@ error[E0277]: `u16` cannot be safely transmuted into `i32` in the defining scope
LL | assert::is_transmutable::< u16, i32>();
| ^^^ `u16` cannot be safely transmuted into `i32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -468,15 +468,15 @@ error[E0277]: `u16` cannot be safely transmuted into `f32` in the defining scope
LL | assert::is_transmutable::< u16, f32>();
| ^^^ `u16` cannot be safely transmuted into `f32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -484,15 +484,15 @@ error[E0277]: `u16` cannot be safely transmuted into `u32` in the defining scope
LL | assert::is_transmutable::< u16, u32>();
| ^^^ `u16` cannot be safely transmuted into `u32` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -500,15 +500,15 @@ error[E0277]: `u16` cannot be safely transmuted into `u64` in the defining scope
LL | assert::is_transmutable::< u16, u64>();
| ^^^ `u16` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -516,15 +516,15 @@ error[E0277]: `u16` cannot be safely transmuted into `i64` in the defining scope
LL | assert::is_transmutable::< u16, i64>();
| ^^^ `u16` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -532,15 +532,15 @@ error[E0277]: `u16` cannot be safely transmuted into `f64` in the defining scope
LL | assert::is_transmutable::< u16, f64>();
| ^^^ `u16` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -548,15 +548,15 @@ error[E0277]: `u16` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< u16, u128>();
| ^^^^ `u16` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -564,15 +564,15 @@ error[E0277]: `u16` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< u16, i128>();
| ^^^^ `u16` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u16, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -580,15 +580,15 @@ error[E0277]: `i32` cannot be safely transmuted into `u64` in the defining scope
LL | assert::is_transmutable::< i32, u64>();
| ^^^ `i32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -596,15 +596,15 @@ error[E0277]: `i32` cannot be safely transmuted into `i64` in the defining scope
LL | assert::is_transmutable::< i32, i64>();
| ^^^ `i32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -612,15 +612,15 @@ error[E0277]: `i32` cannot be safely transmuted into `f64` in the defining scope
LL | assert::is_transmutable::< i32, f64>();
| ^^^ `i32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -628,15 +628,15 @@ error[E0277]: `i32` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< i32, u128>();
| ^^^^ `i32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -644,15 +644,15 @@ error[E0277]: `i32` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< i32, i128>();
| ^^^^ `i32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -660,15 +660,15 @@ error[E0277]: `f32` cannot be safely transmuted into `u64` in the defining scope
LL | assert::is_transmutable::< f32, u64>();
| ^^^ `f32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -676,15 +676,15 @@ error[E0277]: `f32` cannot be safely transmuted into `i64` in the defining scope
LL | assert::is_transmutable::< f32, i64>();
| ^^^ `f32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -692,15 +692,15 @@ error[E0277]: `f32` cannot be safely transmuted into `f64` in the defining scope
LL | assert::is_transmutable::< f32, f64>();
| ^^^ `f32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -708,15 +708,15 @@ error[E0277]: `f32` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< f32, u128>();
| ^^^^ `f32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -724,15 +724,15 @@ error[E0277]: `f32` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< f32, i128>();
| ^^^^ `f32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<f32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -740,15 +740,15 @@ error[E0277]: `u32` cannot be safely transmuted into `u64` in the defining scope
LL | assert::is_transmutable::< u32, u64>();
| ^^^ `u32` cannot be safely transmuted into `u64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -756,15 +756,15 @@ error[E0277]: `u32` cannot be safely transmuted into `i64` in the defining scope
LL | assert::is_transmutable::< u32, i64>();
| ^^^ `u32` cannot be safely transmuted into `i64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -772,15 +772,15 @@ error[E0277]: `u32` cannot be safely transmuted into `f64` in the defining scope
LL | assert::is_transmutable::< u32, f64>();
| ^^^ `u32` cannot be safely transmuted into `f64` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -788,15 +788,15 @@ error[E0277]: `u32` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< u32, u128>();
| ^^^^ `u32` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -804,15 +804,15 @@ error[E0277]: `u32` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< u32, i128>();
| ^^^^ `u32` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u32, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -820,15 +820,15 @@ error[E0277]: `u64` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< u64, u128>();
| ^^^^ `u64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u64, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -836,15 +836,15 @@ error[E0277]: `u64` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< u64, i128>();
| ^^^^ `u64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<u64, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -852,15 +852,15 @@ error[E0277]: `i64` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< i64, u128>();
| ^^^^ `i64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i64, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -868,15 +868,15 @@ error[E0277]: `i64` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< i64, i128>();
| ^^^^ `i64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<i64, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -884,15 +884,15 @@ error[E0277]: `f64` cannot be safely transmuted into `u128` in the defining scop
LL | assert::is_transmutable::< f64, u128>();
| ^^^^ `f64` cannot be safely transmuted into `u128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<f64, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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
@@ -900,15 +900,15 @@ error[E0277]: `f64` cannot be safely transmuted into `i128` in the defining scop
LL | assert::is_transmutable::< f64, i128>();
| ^^^^ `f64` cannot be safely transmuted into `i128` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<f64, assert::Context, false, false, false, false>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to 57 previous errors
diff --git a/src/test/ui/transmutability/primitives/unit.rs b/src/test/ui/transmutability/primitives/unit.rs
index 86d474030..1975a61de 100644
--- a/src/test/ui/transmutability/primitives/unit.rs
+++ b/src/test/ui/transmutability/primitives/unit.rs
@@ -5,11 +5,16 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/primitives/unit.stderr b/src/test/ui/transmutability/primitives/unit.stderr
index cf27c0d17..8cabe44a0 100644
--- a/src/test/ui/transmutability/primitives/unit.stderr
+++ b/src/test/ui/transmutability/primitives/unit.stderr
@@ -1,18 +1,24 @@
error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
- --> $DIR/unit.rs:23:35
+ --> $DIR/unit.rs:28:35
|
LL | assert::is_transmutable::<(), u8, Context>();
| ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+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
diff --git a/src/test/ui/transmutability/references.rs b/src/test/ui/transmutability/references.rs
index c6fd4c43e..af3ff0ec1 100644
--- a/src/test/ui/transmutability/references.rs
+++ b/src/test/ui/transmutability/references.rs
@@ -5,12 +5,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/references.stderr b/src/test/ui/transmutability/references.stderr
index b1359ea58..e9c7b144a 100644
--- a/src/test/ui/transmutability/references.stderr
+++ b/src/test/ui/transmutability/references.stderr
@@ -1,18 +1,25 @@
error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
- --> $DIR/references.rs:19:37
+ --> $DIR/references.rs:26: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` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, true, true, true, true>` is not implemented for `&'static Unit`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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
diff --git a/src/test/ui/transmutability/structs/repr/should_handle_align.rs b/src/test/ui/transmutability/structs/repr/should_handle_align.rs
index 71720165a..ea9bf2a23 100644
--- a/src/test/ui/transmutability/structs/repr/should_handle_align.rs
+++ b/src/test/ui/transmutability/structs/repr/should_handle_align.rs
@@ -6,12 +6,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/structs/repr/should_handle_packed.rs b/src/test/ui/transmutability/structs/repr/should_handle_packed.rs
index ae8acf504..17dc995fc 100644
--- a/src/test/ui/transmutability/structs/repr/should_handle_packed.rs
+++ b/src/test/ui/transmutability/structs/repr/should_handle_packed.rs
@@ -6,12 +6,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs
index 556be989d..9a65b4d70 100644
--- a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs
+++ b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.rs
@@ -5,12 +5,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr
index 07355f7c2..621dbee84 100644
--- a/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr
+++ b/src/test/ui/transmutability/structs/repr/should_require_well_defined_layout.stderr
@@ -1,194 +1,278 @@
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:21:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::unit::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[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:22:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::unit::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[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:27:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::tuple::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[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:28:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::tuple::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[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:33:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::braces::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[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:34:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::braces::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `aligned::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:39:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<aligned::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `u128` cannot be safely transmuted into `aligned::repr_rust` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:40:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `aligned::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `packed::repr_rust` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:45:52
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<packed::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `u128` cannot be safely transmuted into `packed::repr_rust` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:46:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `packed::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `nested::repr_c` cannot be safely transmuted into `()` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:52:49
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<nested::repr_c, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[E0277]: `u128` cannot be safely transmuted into `nested::repr_c` in the defining scope of `assert::Context`.
- --> $DIR/should_require_well_defined_layout.rs:53:47
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `nested::repr_c`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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 12 previous errors
diff --git a/src/test/ui/transmutability/structs/should_order_fields_correctly.rs b/src/test/ui/transmutability/structs/should_order_fields_correctly.rs
index db49b914f..28724562b 100644
--- a/src/test/ui/transmutability/structs/should_order_fields_correctly.rs
+++ b/src/test/ui/transmutability/structs/should_order_fields_correctly.rs
@@ -6,12 +6,17 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/unions/boolish.rs b/src/test/ui/transmutability/unions/boolish.rs
index 975118b99..e469c4973 100644
--- a/src/test/ui/transmutability/unions/boolish.rs
+++ b/src/test/ui/transmutability/unions/boolish.rs
@@ -7,12 +7,12 @@
#![allow(incomplete_features)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
{}
}
diff --git a/src/test/ui/transmutability/unions/repr/should_handle_align.rs b/src/test/ui/transmutability/unions/repr/should_handle_align.rs
index e215799a2..09c13cc4d 100644
--- a/src/test/ui/transmutability/unions/repr/should_handle_align.rs
+++ b/src/test/ui/transmutability/unions/repr/should_handle_align.rs
@@ -6,12 +6,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/unions/repr/should_handle_packed.rs b/src/test/ui/transmutability/unions/repr/should_handle_packed.rs
index 34a53c7a8..24c2abd69 100644
--- a/src/test/ui/transmutability/unions/repr/should_handle_packed.rs
+++ b/src/test/ui/transmutability/unions/repr/should_handle_packed.rs
@@ -6,12 +6,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs
index cec8e389f..b1d5f71dc 100644
--- a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs
+++ b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.rs
@@ -5,12 +5,19 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume {
+ alignment: true,
+ lifetimes: true,
+ safety: true,
+ validity: true,
+ }
+ }>
{}
}
diff --git a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr
index 2ed01b159..523bde85a 100644
--- a/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr
+++ b/src/test/ui/transmutability/unions/repr/should_require_well_defined_layout.stderr
@@ -1,34 +1,48 @@
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:23:48
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<should_reject_repr_rust::repr_rust, assert::Context, true, true, true, true>` is not implemented for `()`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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[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:24:43
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<u128, assert::Context, true, true, true, true>` is not implemented for `should_reject_repr_rust::repr_rust`
+ = 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
|
-LL | pub fn is_maybe_transmutable<Src, Dst>()
- | --------------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+ | --------------------- required by a bound in this
+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 2 previous errors
diff --git a/src/test/ui/transmutability/unions/should_pad_variants.rs b/src/test/ui/transmutability/unions/should_pad_variants.rs
index c4757900f..cabe54467 100644
--- a/src/test/ui/transmutability/unions/should_pad_variants.rs
+++ b/src/test/ui/transmutability/unions/should_pad_variants.rs
@@ -6,11 +6,16 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, {
+ Assume::ALIGNMENT
+ .and(Assume::LIFETIMES)
+ .and(Assume::SAFETY)
+ .and(Assume::VALIDITY)
+ }>
{}
}
diff --git a/src/test/ui/transmutability/unions/should_pad_variants.stderr b/src/test/ui/transmutability/unions/should_pad_variants.stderr
index 429f7211d..a823503d5 100644
--- a/src/test/ui/transmutability/unions/should_pad_variants.stderr
+++ b/src/test/ui/transmutability/unions/should_pad_variants.stderr
@@ -1,18 +1,24 @@
error[E0277]: `Src` cannot be safely transmuted into `Dst` in the defining scope of `should_pad_variants::Context`.
- --> $DIR/should_pad_variants.rs:39:36
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Src, should_pad_variants::Context, true, true, true, true>` is not implemented for `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
|
-LL | pub fn is_transmutable<Src, Dst, Context>()
- | --------------- required by a bound in this
-LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, true, true, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | pub fn is_transmutable<Src, Dst, Context>()
+ | --------------- required by a bound in this
+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
diff --git a/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs b/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs
index 2493d7155..1007fdd79 100644
--- a/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs
+++ b/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs
@@ -7,13 +7,12 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
- // validity IS assumed --------------------------------^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
{}
}
diff --git a/src/test/ui/transmutability/unions/should_reject_contraction.rs b/src/test/ui/transmutability/unions/should_reject_contraction.rs
index e8138d0e0..a24dfccd3 100644
--- a/src/test/ui/transmutability/unions/should_reject_contraction.rs
+++ b/src/test/ui/transmutability/unions/should_reject_contraction.rs
@@ -5,12 +5,12 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
{}
}
diff --git a/src/test/ui/transmutability/unions/should_reject_contraction.stderr b/src/test/ui/transmutability/unions/should_reject_contraction.stderr
index 99f589008..41f0cedc3 100644
--- a/src/test/ui/transmutability/unions/should_reject_contraction.stderr
+++ b/src/test/ui/transmutability/unions/should_reject_contraction.stderr
@@ -4,15 +4,15 @@ error[E0277]: `Superset` cannot be safely transmuted into `Subset` in the defini
LL | assert::is_transmutable::<Superset, Subset>();
| ^^^^^^ `Superset` cannot be safely transmuted into `Subset` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<Superset, assert::Context, false, false, false, true>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to previous error
diff --git a/src/test/ui/transmutability/unions/should_reject_disjoint.rs b/src/test/ui/transmutability/unions/should_reject_disjoint.rs
index 16160e29a..43aaa6905 100644
--- a/src/test/ui/transmutability/unions/should_reject_disjoint.rs
+++ b/src/test/ui/transmutability/unions/should_reject_disjoint.rs
@@ -5,13 +5,12 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_maybe_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
- // validity IS assumed --------------------------------^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
{}
}
diff --git a/src/test/ui/transmutability/unions/should_reject_disjoint.stderr b/src/test/ui/transmutability/unions/should_reject_disjoint.stderr
index 5714e2bf3..4323f9740 100644
--- a/src/test/ui/transmutability/unions/should_reject_disjoint.stderr
+++ b/src/test/ui/transmutability/unions/should_reject_disjoint.stderr
@@ -1,34 +1,34 @@
error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
- --> $DIR/should_reject_disjoint.rs:34:40
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<A, assert::Context, false, false, true, true>` is not implemented for `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
|
LL | pub fn is_maybe_transmutable<Src, Dst>()
| --------------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+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`.
- --> $DIR/should_reject_disjoint.rs:35:40
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<B, assert::Context, false, false, true, true>` is not implemented for `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
|
LL | pub fn is_maybe_transmutable<Src, Dst>()
| --------------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, true, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY.and(Assume::VALIDITY) }>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/transmutability/unions/should_reject_intersecting.rs b/src/test/ui/transmutability/unions/should_reject_intersecting.rs
index 58e399fb9..9cd4233ee 100644
--- a/src/test/ui/transmutability/unions/should_reject_intersecting.rs
+++ b/src/test/ui/transmutability/unions/should_reject_intersecting.rs
@@ -6,13 +6,13 @@
#![allow(dead_code, incomplete_features, non_camel_case_types)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub struct Context;
pub fn is_transmutable<Src, Dst>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- // validity is NOT assumed ----------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ // validity is NOT assumed --------------^^^^^^^^^^^^^^^^^^
{}
}
diff --git a/src/test/ui/transmutability/unions/should_reject_intersecting.stderr b/src/test/ui/transmutability/unions/should_reject_intersecting.stderr
index 92689a5f8..e009888ae 100644
--- a/src/test/ui/transmutability/unions/should_reject_intersecting.stderr
+++ b/src/test/ui/transmutability/unions/should_reject_intersecting.stderr
@@ -4,15 +4,15 @@ error[E0277]: `A` cannot be safely transmuted into `B` in the defining scope of
LL | assert::is_transmutable::<A, B>();
| ^ `A` cannot be safely transmuted into `B` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<A, assert::Context, false, false, false, true>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+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`.
--> $DIR/should_reject_intersecting.rs:37:34
@@ -20,15 +20,15 @@ error[E0277]: `B` cannot be safely transmuted into `A` in the defining scope of
LL | assert::is_transmutable::<B, A>();
| ^ `B` cannot be safely transmuted into `A` in the defining scope of `assert::Context`.
|
- = help: the trait `BikeshedIntrinsicFrom<B, assert::Context, false, false, false, true>` is not implemented for `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
|
LL | pub fn is_transmutable<Src, Dst>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs
index 5a8c81049..8a41669c6 100644
--- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs
+++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_field.rs
@@ -7,12 +7,12 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- // visibility IS assumed -------------------------------------^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
{}
}
diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs
index 77ab4fa6b..dd57b877d 100644
--- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs
+++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_private_variant.rs
@@ -7,12 +7,12 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- // visibility IS assumed -------------------------------------^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
{}
}
diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs
index 2421b24cb..ebce8ce87 100644
--- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs
+++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_tricky_unreachable_field.rs
@@ -13,12 +13,12 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- // visibility IS assumed -------------------------------------^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
{}
}
diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs
index 80b454fda..546fcbaa3 100644
--- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs
+++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_field.rs
@@ -8,12 +8,12 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- // visibility IS assumed -------------------------------------^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
{}
}
diff --git a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs
index 7c53c91e4..b9b74d183 100644
--- a/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs
+++ b/src/test/ui/transmutability/visibility/assume/should_accept_if_dst_has_unreachable_ty.rs
@@ -8,12 +8,12 @@
#![allow(dead_code)]
mod assert {
- use std::mem::BikeshedIntrinsicFrom;
+ use std::mem::{Assume, BikeshedIntrinsicFrom};
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, true>
- // visibility IS assumed -------------------------------------^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
+ // safety IS assumed --------------------^^^^^^^^^^^^^^^^^^
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs
index c3f298f01..5a0df09d4 100644
--- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs
+++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_field.rs
@@ -11,8 +11,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs
index 73f6aece5..0f69630cc 100644
--- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs
+++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_private_variant.rs
@@ -11,8 +11,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs
index 6d602601e..9c8345a8e 100644
--- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs
+++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.rs
@@ -11,8 +11,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr
index 3f7d08d0a..39b73302e 100644
--- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr
+++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_field.stderr
@@ -1,5 +1,5 @@
error[E0446]: private type `src::Zst` in public interface
- --> $DIR/should_accept_if_src_has_unreachable_field.rs:23:9
+ --> $DIR/should_accept_if_src_has_unreachable_field.rs:22:9
|
LL | #[repr(C)] pub(self) struct Zst; // <- unreachable type
| -------------------- `src::Zst` declared as private
diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs
index 1943fb871..acf9f2302 100644
--- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs
+++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.rs
@@ -11,8 +11,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr
index e961984e1..76dc7f340 100644
--- a/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr
+++ b/src/test/ui/transmutability/visibility/should_accept_if_src_has_unreachable_ty.stderr
@@ -1,11 +1,11 @@
error[E0603]: struct `Src` is private
- --> $DIR/should_accept_if_src_has_unreachable_ty.rs:38:36
+ --> $DIR/should_accept_if_src_has_unreachable_ty.rs:37:36
|
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
| ^^^ private struct
|
note: the struct `Src` is defined here
- --> $DIR/should_accept_if_src_has_unreachable_ty.rs:23:16
+ --> $DIR/should_accept_if_src_has_unreachable_ty.rs:22:16
|
LL | #[repr(C)] pub(self) struct Src {
| ^^^^^^^^^^^^^^^^^^^^
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs
index fcf3f3a52..e8c3fbc9a 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.rs
@@ -10,8 +10,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr
index 85124019e..d5d6d431b 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_field.stderr
@@ -1,18 +1,18 @@
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:36:41
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
+ = 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
|
LL | pub fn is_transmutable<Src, Dst, Context>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to previous error
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs
index 566b56467..47bca27ab 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.rs
@@ -10,8 +10,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr
index 0be564d93..a1ca2ced5 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_private_variant.stderr
@@ -1,18 +1,18 @@
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:37:41
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
+ = 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
|
LL | pub fn is_transmutable<Src, Dst, Context>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to previous error
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs
index 35fff5966..662c32af1 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_tricky_unreachable_field.rs
@@ -23,8 +23,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs
index 42799d803..d7e21676f 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.rs
@@ -12,8 +12,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr
index 95c68d452..4e648664d 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_field.stderr
@@ -1,18 +1,18 @@
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:38:41
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
+ = 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
|
LL | pub fn is_transmutable<Src, Dst, Context>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to previous error
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs
index e13b32b30..c7b59f15b 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.rs
@@ -12,8 +12,7 @@ mod assert {
pub fn is_transmutable<Src, Dst, Context>()
where
- Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- // visibility is NOT assumed ---------------------------------^^^^^
+ Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
{}
}
diff --git a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr
index 3391839e3..bd72d64cc 100644
--- a/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr
+++ b/src/test/ui/transmutability/visibility/should_reject_if_dst_has_unreachable_ty.stderr
@@ -1,30 +1,30 @@
error[E0603]: struct `Dst` is private
- --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:39:46
+ --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:38:46
|
LL | assert::is_transmutable::<src::Src, dst::Dst, Context>();
| ^^^ private struct
|
note: the struct `Dst` is defined here
- --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:32:16
+ --> $DIR/should_reject_if_dst_has_unreachable_ty.rs:31:16
|
LL | #[repr(C)] pub(self) struct Dst {
| ^^^^^^^^^^^^^^^^^^^^
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:39:41
+ --> $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`.
|
- = help: the trait `BikeshedIntrinsicFrom<Src, test::Context, false, false, false, false>` is not implemented for `Dst`
+ = 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
|
LL | pub fn is_transmutable<Src, Dst, Context>()
| --------------- required by a bound in this
LL | where
-LL | Dst: BikeshedIntrinsicFrom<Src, Context, false, false, false, false>
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
+LL | Dst: BikeshedIntrinsicFrom<Src, Context> // safety is NOT assumed
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/transmute-equal-assoc-types.rs b/src/test/ui/transmute-equal-assoc-types.rs
index 6f357543e..d1b593b7f 100644
--- a/src/test/ui/transmute-equal-assoc-types.rs
+++ b/src/test/ui/transmute-equal-assoc-types.rs
@@ -1,9 +1,11 @@
+// check-pass
+
trait Foo {
type Bar;
}
unsafe fn noop<F: Foo>(foo: F::Bar) -> F::Bar {
- ::std::mem::transmute(foo) //~ ERROR cannot transmute between types of different sizes
+ ::std::mem::transmute(foo)
}
fn main() {}
diff --git a/src/test/ui/transmute-equal-assoc-types.stderr b/src/test/ui/transmute-equal-assoc-types.stderr
deleted file mode 100644
index ce7657f96..000000000
--- a/src/test/ui/transmute-equal-assoc-types.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
- --> $DIR/transmute-equal-assoc-types.rs:6:5
- |
-LL | ::std::mem::transmute(foo)
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: `<F as Foo>::Bar` does not have a fixed size
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0512`.
diff --git a/src/test/ui/transmute/lifetimes.rs b/src/test/ui/transmute/lifetimes.rs
new file mode 100644
index 000000000..943191551
--- /dev/null
+++ b/src/test/ui/transmute/lifetimes.rs
@@ -0,0 +1,23 @@
+// check-pass
+
+use std::ptr::NonNull;
+
+struct Foo<'a, T: ?Sized>(&'a (), NonNull<T>);
+
+fn foo<'a, 'b, T: ?Sized>(x: Foo<'a, T>) -> Foo<'b, T> {
+ unsafe { std::mem::transmute(x) }
+}
+
+struct Bar<'a, T: ?Sized>(&'a T);
+
+fn bar<'a, 'b, T: ?Sized>(x: Bar<'a, T>) -> Bar<'b, T> {
+ unsafe { std::mem::transmute(x) }
+}
+
+struct Boo<'a, T: ?Sized>(&'a T, u32);
+
+fn boo<'a, 'b, T: ?Sized>(x: Boo<'a, T>) -> Boo<'b, T> {
+ unsafe { std::mem::transmute(x) }
+}
+
+fn main() {}
diff --git a/src/test/ui/transmute/main.rs b/src/test/ui/transmute/main.rs
index cb46fc5ec..da4a0a660 100644
--- a/src/test/ui/transmute/main.rs
+++ b/src/test/ui/transmute/main.rs
@@ -10,7 +10,7 @@ pub trait TypeConstructor<'a> {
unsafe fn transmute_lifetime<'a, 'b, C>(x: <C as TypeConstructor<'a>>::T)
-> <C as TypeConstructor<'b>>::T
where for<'z> C: TypeConstructor<'z> {
- transmute(x) //~ ERROR cannot transmute between types of different sizes
+ transmute(x)
}
unsafe fn sizes() {
diff --git a/src/test/ui/transmute/main.stderr b/src/test/ui/transmute/main.stderr
index f48562094..6cb0d7f67 100644
--- a/src/test/ui/transmute/main.stderr
+++ b/src/test/ui/transmute/main.stderr
@@ -1,12 +1,4 @@
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
- --> $DIR/main.rs:13:5
- |
-LL | transmute(x)
- | ^^^^^^^^^
- |
- = note: `<C as TypeConstructor>::T` does not have a fixed size
-
-error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/main.rs:17:17
|
LL | let x: u8 = transmute(10u16);
@@ -33,6 +25,6 @@ LL | let x: Foo = transmute(10);
= note: source type: `i32` (32 bits)
= note: target type: `Foo` (0 bits)
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0512`.
diff --git a/src/test/ui/treat-err-as-bug/delay_span_bug.rs b/src/test/ui/treat-err-as-bug/delay_span_bug.rs
index d4d44049c..832afddf8 100644
--- a/src/test/ui/treat-err-as-bug/delay_span_bug.rs
+++ b/src/test/ui/treat-err-as-bug/delay_span_bug.rs
@@ -1,7 +1,7 @@
// compile-flags: -Ztreat-err-as-bug
// failure-status: 101
// error-pattern: aborting due to `-Z treat-err-as-bug=1`
-// error-pattern: [trigger_delay_span_bug] trigger a delay span bug
+// error-pattern: [trigger_delay_span_bug] triggering a delay span bug
// normalize-stderr-test "note: .*\n\n" -> ""
// normalize-stderr-test "thread 'rustc' panicked.*\n" -> ""
// rustc-env:RUST_BACKTRACE=0
diff --git a/src/test/ui/treat-err-as-bug/delay_span_bug.stderr b/src/test/ui/treat-err-as-bug/delay_span_bug.stderr
index c23c2b81b..e9457c8fa 100644
--- a/src/test/ui/treat-err-as-bug/delay_span_bug.stderr
+++ b/src/test/ui/treat-err-as-bug/delay_span_bug.stderr
@@ -7,5 +7,5 @@ LL | fn main() {}
error: internal compiler error: unexpected panic
query stack during panic:
-#0 [trigger_delay_span_bug] trigger a delay span bug
+#0 [trigger_delay_span_bug] triggering a delay span bug
end of query stack
diff --git a/src/test/ui/try-block/try-block-bad-type.stderr b/src/test/ui/try-block/try-block-bad-type.stderr
index f9906713f..e11c3f810 100644
--- a/src/test/ui/try-block/try-block-bad-type.stderr
+++ b/src/test/ui/try-block/try-block-bad-type.stderr
@@ -6,7 +6,7 @@ LL | Err("")?;
|
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
= help: the trait `From<Infallible>` is implemented for `TryFromSliceError`
- = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, &str>>` for `Result<u32, TryFromSliceError>`
+ = note: required for `Result<u32, TryFromSliceError>` to implement `FromResidual<Result<Infallible, &str>>`
error[E0271]: type mismatch resolving `<Result<i32, i32> as Try>::Output == &str`
--> $DIR/try-block-bad-type.rs:12:9
diff --git a/src/test/ui/try-trait/bad-interconversion.stderr b/src/test/ui/try-trait/bad-interconversion.stderr
index 1dbf3ebdf..419a86bf3 100644
--- a/src/test/ui/try-trait/bad-interconversion.stderr
+++ b/src/test/ui/try-trait/bad-interconversion.stderr
@@ -16,19 +16,16 @@ LL | Ok(Err(123_i32)?)
<f64 as From<i16>>
<f64 as From<i32>>
<f64 as From<i8>>
- and 67 others
- = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, i32>>` for `Result<u64, u8>`
+ and 68 others
+ = note: required for `Result<u64, u8>` to implement `FromResidual<Result<Infallible, i32>>`
error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
--> $DIR/bad-interconversion.rs:11:12
|
-LL | / fn option_to_result() -> Result<u64, String> {
-LL | | Some(3)?;
- | | ^ use `.ok_or(...)?` to provide an error compatible with `Result<u64, String>`
-LL | |
-LL | | Ok(10)
-LL | | }
- | |_- this function returns a `Result`
+LL | fn option_to_result() -> Result<u64, String> {
+ | -------------------------------------------- this function returns a `Result`
+LL | Some(3)?;
+ | ^ use `.ok_or(...)?` to provide an error compatible with `Result<u64, String>`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u64, String>`
= help: the following other types implement trait `FromResidual<R>`:
@@ -38,12 +35,10 @@ LL | | }
error[E0277]: the `?` operator can only be used on `Result`s in a function that returns `Result`
--> $DIR/bad-interconversion.rs:17:31
|
-LL | / fn control_flow_to_result() -> Result<u64, String> {
-LL | | Ok(ControlFlow::Break(123)?)
- | | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Result<u64, String>`
-LL | |
-LL | | }
- | |_- this function returns a `Result`
+LL | fn control_flow_to_result() -> Result<u64, String> {
+ | -------------------------------------------------- this function returns a `Result`
+LL | Ok(ControlFlow::Break(123)?)
+ | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Result<u64, String>`
|
= help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Result<u64, String>`
= help: the following other types implement trait `FromResidual<R>`:
@@ -53,12 +48,10 @@ LL | | }
error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
--> $DIR/bad-interconversion.rs:22:22
|
-LL | / fn result_to_option() -> Option<u16> {
-LL | | Some(Err("hello")?)
- | | ^ use `.ok()?` if you want to discard the `Result<Infallible, &str>` error information
-LL | |
-LL | | }
- | |_- this function returns an `Option`
+LL | fn result_to_option() -> Option<u16> {
+ | ------------------------------------ this function returns an `Option`
+LL | Some(Err("hello")?)
+ | ^ use `.ok()?` if you want to discard the `Result<Infallible, &str>` error information
|
= help: the trait `FromResidual<Result<Infallible, &str>>` is not implemented for `Option<u16>`
= help: the following other types implement trait `FromResidual<R>`:
@@ -68,12 +61,10 @@ LL | | }
error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option`
--> $DIR/bad-interconversion.rs:27:33
|
-LL | / fn control_flow_to_option() -> Option<u64> {
-LL | | Some(ControlFlow::Break(123)?)
- | | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Option<u64>`
-LL | |
-LL | | }
- | |_- this function returns an `Option`
+LL | fn control_flow_to_option() -> Option<u64> {
+ | ------------------------------------------ this function returns an `Option`
+LL | Some(ControlFlow::Break(123)?)
+ | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Option<u64>`
|
= help: the trait `FromResidual<ControlFlow<{integer}, Infallible>>` is not implemented for `Option<u64>`
= help: the following other types implement trait `FromResidual<R>`:
@@ -83,12 +74,10 @@ LL | | }
error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow`
--> $DIR/bad-interconversion.rs:32:39
|
-LL | / fn result_to_control_flow() -> ControlFlow<String> {
-LL | | ControlFlow::Continue(Err("hello")?)
- | | ^ this `?` produces `Result<Infallible, &str>`, which is incompatible with `ControlFlow<String>`
-LL | |
-LL | | }
- | |_- this function returns a `ControlFlow`
+LL | fn result_to_control_flow() -> ControlFlow<String> {
+ | -------------------------------------------------- this function returns a `ControlFlow`
+LL | ControlFlow::Continue(Err("hello")?)
+ | ^ this `?` produces `Result<Infallible, &str>`, which is incompatible with `ControlFlow<String>`
|
= help: the trait `FromResidual<Result<Infallible, &str>>` is not implemented for `ControlFlow<String>`
= help: the trait `FromResidual` is implemented for `ControlFlow<B, C>`
@@ -96,13 +85,10 @@ LL | | }
error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow`
--> $DIR/bad-interconversion.rs:37:12
|
-LL | / fn option_to_control_flow() -> ControlFlow<u64> {
-LL | | Some(3)?;
- | | ^ this `?` produces `Option<Infallible>`, which is incompatible with `ControlFlow<u64>`
-LL | |
-LL | | ControlFlow::Break(10)
-LL | | }
- | |_- this function returns a `ControlFlow`
+LL | fn option_to_control_flow() -> ControlFlow<u64> {
+ | ----------------------------------------------- this function returns a `ControlFlow`
+LL | Some(3)?;
+ | ^ this `?` produces `Option<Infallible>`, which is incompatible with `ControlFlow<u64>`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `ControlFlow<u64>`
= help: the trait `FromResidual` is implemented for `ControlFlow<B, C>`
@@ -110,13 +96,10 @@ LL | | }
error[E0277]: the `?` operator in a function that returns `ControlFlow<B, _>` can only be used on other `ControlFlow<B, _>`s (with the same Break type)
--> $DIR/bad-interconversion.rs:43:29
|
-LL | / fn control_flow_to_control_flow() -> ControlFlow<i64> {
-LL | | ControlFlow::Break(4_u8)?;
- | | ^ this `?` produces `ControlFlow<u8, Infallible>`, which is incompatible with `ControlFlow<i64>`
-LL | |
-LL | | ControlFlow::Continue(())
-LL | | }
- | |_- this function returns a `ControlFlow`
+LL | fn control_flow_to_control_flow() -> ControlFlow<i64> {
+ | ----------------------------------------------------- this function returns a `ControlFlow`
+LL | ControlFlow::Break(4_u8)?;
+ | ^ this `?` produces `ControlFlow<u8, Infallible>`, which is incompatible with `ControlFlow<i64>`
|
= help: the trait `FromResidual<ControlFlow<u8, Infallible>>` is not implemented for `ControlFlow<i64>`
= note: unlike `Result`, there's no `From`-conversion performed for `ControlFlow`
diff --git a/src/test/ui/try-trait/option-to-result.stderr b/src/test/ui/try-trait/option-to-result.stderr
index ae5c3ad62..fabc1ff2c 100644
--- a/src/test/ui/try-trait/option-to-result.stderr
+++ b/src/test/ui/try-trait/option-to-result.stderr
@@ -1,13 +1,11 @@
error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
--> $DIR/option-to-result.rs:5:6
|
-LL | / fn test_result() -> Result<(),()> {
-LL | | let a:Option<()> = Some(());
-LL | | a?;
- | | ^ use `.ok_or(...)?` to provide an error compatible with `Result<(), ()>`
-LL | | Ok(())
-LL | | }
- | |_- this function returns a `Result`
+LL | fn test_result() -> Result<(),()> {
+ | --------------------------------- this function returns a `Result`
+LL | let a:Option<()> = Some(());
+LL | a?;
+ | ^ use `.ok_or(...)?` to provide an error compatible with `Result<(), ()>`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<(), ()>`
= help: the following other types implement trait `FromResidual<R>`:
@@ -17,13 +15,11 @@ LL | | }
error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option`
--> $DIR/option-to-result.rs:11:6
|
-LL | / fn test_option() -> Option<i32>{
-LL | | let a:Result<i32, i32> = Ok(5);
-LL | | a?;
- | | ^ use `.ok()?` if you want to discard the `Result<Infallible, i32>` error information
-LL | | Some(5)
-LL | | }
- | |_- this function returns an `Option`
+LL | fn test_option() -> Option<i32>{
+ | ------------------------------- this function returns an `Option`
+LL | let a:Result<i32, i32> = Ok(5);
+LL | a?;
+ | ^ use `.ok()?` if you want to discard the `Result<Infallible, i32>` error information
|
= help: the trait `FromResidual<Result<Infallible, i32>>` is not implemented for `Option<i32>`
= help: the following other types implement trait `FromResidual<R>`:
diff --git a/src/test/ui/try-trait/try-on-option-diagnostics.stderr b/src/test/ui/try-trait/try-on-option-diagnostics.stderr
index a6badd190..9ee540c79 100644
--- a/src/test/ui/try-trait/try-on-option-diagnostics.stderr
+++ b/src/test/ui/try-trait/try-on-option-diagnostics.stderr
@@ -1,51 +1,44 @@
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option-diagnostics.rs:7:6
|
-LL | / fn a_function() -> u32 {
-LL | | let x: Option<u32> = None;
-LL | | x?;
- | | ^ cannot use the `?` operator in a function that returns `u32`
-LL | | 22
-LL | | }
- | |_- this function should return `Result` or `Option` to accept `?`
+LL | fn a_function() -> u32 {
+ | ---------------------- this function should return `Result` or `Option` to accept `?`
+LL | let x: Option<u32> = None;
+LL | x?;
+ | ^ cannot use the `?` operator in a function that returns `u32`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
error[E0277]: the `?` operator can only be used in a closure that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option-diagnostics.rs:14:10
|
-LL | let a_closure = || {
- | _____________________-
-LL | | let x: Option<u32> = None;
-LL | | x?;
- | | ^ cannot use the `?` operator in a closure that returns `{integer}`
-LL | | 22
-LL | | };
- | |_____- this function should return `Result` or `Option` to accept `?`
+LL | let a_closure = || {
+ | -- this function should return `Result` or `Option` to accept `?`
+LL | let x: Option<u32> = None;
+LL | x?;
+ | ^ cannot use the `?` operator in a closure that returns `{integer}`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `{integer}`
error[E0277]: the `?` operator can only be used in a method that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option-diagnostics.rs:26:14
|
-LL | / fn a_method() {
-LL | | let x: Option<u32> = None;
-LL | | x?;
- | | ^ cannot use the `?` operator in a method that returns `()`
-LL | | }
- | |_________- this function should return `Result` or `Option` to accept `?`
+LL | fn a_method() {
+ | ------------- this function should return `Result` or `Option` to accept `?`
+LL | let x: Option<u32> = None;
+LL | x?;
+ | ^ cannot use the `?` operator in a method that returns `()`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `()`
error[E0277]: the `?` operator can only be used in a trait method that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option-diagnostics.rs:39:14
|
-LL | / fn a_trait_method() {
-LL | | let x: Option<u32> = None;
-LL | | x?;
- | | ^ cannot use the `?` operator in a trait method that returns `()`
-LL | | }
- | |_________- this function should return `Result` or `Option` to accept `?`
+LL | fn a_trait_method() {
+ | ------------------- this function should return `Result` or `Option` to accept `?`
+LL | let x: Option<u32> = None;
+LL | x?;
+ | ^ cannot use the `?` operator in a trait method that returns `()`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `()`
diff --git a/src/test/ui/try-trait/try-on-option.stderr b/src/test/ui/try-trait/try-on-option.stderr
index ba85a7cad..fad6a1fe8 100644
--- a/src/test/ui/try-trait/try-on-option.stderr
+++ b/src/test/ui/try-trait/try-on-option.stderr
@@ -1,13 +1,11 @@
error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
--> $DIR/try-on-option.rs:5:6
|
-LL | / fn foo() -> Result<u32, ()> {
-LL | | let x: Option<u32> = None;
-LL | | x?;
- | | ^ use `.ok_or(...)?` to provide an error compatible with `Result<u32, ()>`
-LL | | Ok(22)
-LL | | }
- | |_- this function returns a `Result`
+LL | fn foo() -> Result<u32, ()> {
+ | --------------------------- this function returns a `Result`
+LL | let x: Option<u32> = None;
+LL | x?;
+ | ^ use `.ok_or(...)?` to provide an error compatible with `Result<u32, ()>`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<u32, ()>`
= help: the following other types implement trait `FromResidual<R>`:
@@ -17,13 +15,11 @@ LL | | }
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-on-option.rs:11:6
|
-LL | / fn bar() -> u32 {
-LL | | let x: Option<u32> = None;
-LL | | x?;
- | | ^ cannot use the `?` operator in a function that returns `u32`
-LL | | 22
-LL | | }
- | |_- this function should return `Result` or `Option` to accept `?`
+LL | fn bar() -> u32 {
+ | --------------- this function should return `Result` or `Option` to accept `?`
+LL | let x: Option<u32> = None;
+LL | x?;
+ | ^ cannot use the `?` operator in a function that returns `u32`
|
= help: the trait `FromResidual<Option<Infallible>>` is not implemented for `u32`
diff --git a/src/test/ui/try-trait/try-operator-on-main.stderr b/src/test/ui/try-trait/try-operator-on-main.stderr
index ad55f40b5..7cd38e0cf 100644
--- a/src/test/ui/try-trait/try-operator-on-main.stderr
+++ b/src/test/ui/try-trait/try-operator-on-main.stderr
@@ -1,15 +1,11 @@
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-operator-on-main.rs:7:31
|
-LL | / fn main() {
-LL | | // error for a `Try` type on a non-`Try` fn
-LL | | std::fs::File::open("foo")?;
- | | ^ cannot use the `?` operator in a function that returns `()`
-LL | |
-... |
-LL | | try_trait_generic::<()>();
-LL | | }
- | |_- this function should return `Result` or `Option` to accept `?`
+LL | fn main() {
+ | --------- this function should return `Result` or `Option` to accept `?`
+LL | // error for a `Try` type on a non-`Try` fn
+LL | std::fs::File::open("foo")?;
+ | ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<Result<Infallible, std::io::Error>>` is not implemented for `()`
@@ -24,17 +20,11 @@ LL | ()?;
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/try-operator-on-main.rs:10:7
|
-LL | / fn main() {
-LL | | // error for a `Try` type on a non-`Try` fn
-LL | | std::fs::File::open("foo")?;
-LL | |
-LL | | // a non-`Try` type on a non-`Try` fn
-LL | | ()?;
- | | ^ cannot use the `?` operator in a function that returns `()`
-... |
-LL | | try_trait_generic::<()>();
-LL | | }
- | |_- this function should return `Result` or `Option` to accept `?`
+LL | fn main() {
+ | --------- this function should return `Result` or `Option` to accept `?`
+...
+LL | ()?;
+ | ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
diff --git a/src/test/ui/tuple/add-tuple-within-arguments.stderr b/src/test/ui/tuple/add-tuple-within-arguments.stderr
index 95df96ca0..7029d298d 100644
--- a/src/test/ui/tuple/add-tuple-within-arguments.stderr
+++ b/src/test/ui/tuple/add-tuple-within-arguments.stderr
@@ -8,7 +8,7 @@ note: function defined here
--> $DIR/add-tuple-within-arguments.rs:1:4
|
LL | fn foo(s: &str, a: (i32, i32), s2: &str) {}
- | ^^^ ------- ------------- --------
+ | ^^^ -------------
help: wrap these arguments in parentheses to construct a tuple
|
LL | foo("hi", (1, 2), "hi");
@@ -28,7 +28,7 @@ note: function defined here
--> $DIR/add-tuple-within-arguments.rs:3:4
|
LL | fn bar(s: &str, a: (&str,), s2: &str) {}
- | ^^^ ------- ---------- --------
+ | ^^^ ----------
help: use a trailing comma to create a tuple with one element
|
LL | bar("hi", ("hi",), "hi");
diff --git a/src/test/ui/tuple/builtin-fail.rs b/src/test/ui/tuple/builtin-fail.rs
new file mode 100644
index 000000000..312080961
--- /dev/null
+++ b/src/test/ui/tuple/builtin-fail.rs
@@ -0,0 +1,19 @@
+#![feature(tuple_trait)]
+
+fn assert_is_tuple<T: std::marker::Tuple + ?Sized>() {}
+
+struct TupleStruct(i32, i32);
+
+fn from_param_env<T>() {
+ assert_is_tuple::<T>();
+ //~^ ERROR `T` is not a tuple
+}
+
+fn main() {
+ assert_is_tuple::<i32>();
+ //~^ ERROR `i32` is not a tuple
+ assert_is_tuple::<(i32)>();
+ //~^ ERROR `i32` is not a tuple
+ assert_is_tuple::<TupleStruct>();
+ //~^ ERROR `TupleStruct` is not a tuple
+}
diff --git a/src/test/ui/tuple/builtin-fail.stderr b/src/test/ui/tuple/builtin-fail.stderr
new file mode 100644
index 000000000..e3e29a73f
--- /dev/null
+++ b/src/test/ui/tuple/builtin-fail.stderr
@@ -0,0 +1,55 @@
+error[E0277]: `T` is not a tuple
+ --> $DIR/builtin-fail.rs:8:23
+ |
+LL | assert_is_tuple::<T>();
+ | ^ the trait `Tuple` is not implemented for `T`
+ |
+note: required by a bound in `assert_is_tuple`
+ --> $DIR/builtin-fail.rs:3:23
+ |
+LL | fn assert_is_tuple<T: std::marker::Tuple + ?Sized>() {}
+ | ^^^^^^^^^^^^^^^^^^ required by this bound in `assert_is_tuple`
+help: consider restricting type parameter `T`
+ |
+LL | fn from_param_env<T: std::marker::Tuple>() {
+ | ++++++++++++++++++++
+
+error[E0277]: `i32` is not a tuple
+ --> $DIR/builtin-fail.rs:13:23
+ |
+LL | assert_is_tuple::<i32>();
+ | ^^^ the trait `Tuple` is not implemented for `i32`
+ |
+note: required by a bound in `assert_is_tuple`
+ --> $DIR/builtin-fail.rs:3:23
+ |
+LL | fn assert_is_tuple<T: std::marker::Tuple + ?Sized>() {}
+ | ^^^^^^^^^^^^^^^^^^ required by this bound in `assert_is_tuple`
+
+error[E0277]: `i32` is not a tuple
+ --> $DIR/builtin-fail.rs:15:24
+ |
+LL | assert_is_tuple::<(i32)>();
+ | ^^^ the trait `Tuple` is not implemented for `i32`
+ |
+note: required by a bound in `assert_is_tuple`
+ --> $DIR/builtin-fail.rs:3:23
+ |
+LL | fn assert_is_tuple<T: std::marker::Tuple + ?Sized>() {}
+ | ^^^^^^^^^^^^^^^^^^ required by this bound in `assert_is_tuple`
+
+error[E0277]: `TupleStruct` is not a tuple
+ --> $DIR/builtin-fail.rs:17:23
+ |
+LL | assert_is_tuple::<TupleStruct>();
+ | ^^^^^^^^^^^ the trait `Tuple` is not implemented for `TupleStruct`
+ |
+note: required by a bound in `assert_is_tuple`
+ --> $DIR/builtin-fail.rs:3:23
+ |
+LL | fn assert_is_tuple<T: std::marker::Tuple + ?Sized>() {}
+ | ^^^^^^^^^^^^^^^^^^ required by this bound in `assert_is_tuple`
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/tuple/builtin.rs b/src/test/ui/tuple/builtin.rs
new file mode 100644
index 000000000..d87ce5263
--- /dev/null
+++ b/src/test/ui/tuple/builtin.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+#![feature(tuple_trait)]
+
+fn assert_is_tuple<T: std::marker::Tuple + ?Sized>() {}
+
+struct Unsized([u8]);
+
+fn from_param_env<T: std::marker::Tuple + ?Sized>() {
+ assert_is_tuple::<T>();
+}
+
+fn main() {
+ assert_is_tuple::<()>();
+ assert_is_tuple::<(i32,)>();
+ assert_is_tuple::<(Unsized,)>();
+ from_param_env::<()>();
+ from_param_env::<(i32,)>();
+ from_param_env::<(Unsized,)>();
+}
diff --git a/src/test/ui/tuple/wrong_argument_ice-3.stderr b/src/test/ui/tuple/wrong_argument_ice-3.stderr
index 2733fb314..f3a547fa2 100644
--- a/src/test/ui/tuple/wrong_argument_ice-3.stderr
+++ b/src/test/ui/tuple/wrong_argument_ice-3.stderr
@@ -2,10 +2,13 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/wrong_argument_ice-3.rs:9:16
|
LL | groups.push(new_group, vec![process]);
- | ^^^^ --------- ------------- argument of type `Vec<&Process>` unexpected
- | |
- | expected tuple, found struct `Vec`
+ | ^^^^ ------------- argument of type `Vec<&Process>` unexpected
|
+note: expected tuple, found struct `Vec`
+ --> $DIR/wrong_argument_ice-3.rs:9:21
+ |
+LL | groups.push(new_group, vec![process]);
+ | ^^^^^^^^^
= note: expected tuple `(Vec<String>, Vec<Process>)`
found struct `Vec<String>`
note: associated function defined here
@@ -16,7 +19,7 @@ LL | pub fn push(&mut self, value: T) {
help: remove the extra argument
|
LL | groups.push(/* (Vec<String>, Vec<Process>) */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/tuple/wrong_argument_ice-4.stderr b/src/test/ui/tuple/wrong_argument_ice-4.stderr
index 828ae21b4..a2686ab94 100644
--- a/src/test/ui/tuple/wrong_argument_ice-4.stderr
+++ b/src/test/ui/tuple/wrong_argument_ice-4.stderr
@@ -16,7 +16,7 @@ LL | (|| {})(|| {
help: remove the extra argument
|
LL | (|| {})();
- | ~~~~~~~~~
+ | ~~
error: aborting due to previous error
diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
index 006253f84..eb58ee73c 100644
--- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
+++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
@@ -12,7 +12,7 @@ LL | V(u8)
help: provide the argument
|
LL | <E>::V(/* u8 */);
- | ~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17
diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr
index aaa3159e0..0202a2fea 100644
--- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr
+++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr
@@ -4,7 +4,6 @@ error: ambiguous associated item
LL | fn f() -> Self::V { 0 }
| ^^^^^^^ help: use fully-qualified syntax: `<E as Tr>::V`
|
- = note: `#[deny(ambiguous_associated_items)]` on by default
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #57644 <https://github.com/rust-lang/rust/issues/57644>
note: `V` could refer to the variant defined here
@@ -17,6 +16,7 @@ note: `V` could also refer to the associated type defined here
|
LL | type V;
| ^^^^^^
+ = note: `#[deny(ambiguous_associated_items)]` on by default
error: ambiguous associated item
--> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:32:15
diff --git a/src/test/ui/type-alias-impl-trait/closure_args.rs b/src/test/ui/type-alias-impl-trait/closure_args.rs
new file mode 100644
index 000000000..c5e7af81d
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/closure_args.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+// regression test for https://github.com/rust-lang/rust/issues/100800
+
+#![feature(type_alias_impl_trait)]
+
+trait Anything {}
+impl<T> Anything for T {}
+type Input = impl Anything;
+fn run<F: FnOnce(Input) -> ()>(f: F, i: Input) {
+ f(i);
+}
+
+fn main() {
+ run(|x: u32| {println!("{x}");}, 0);
+}
diff --git a/src/test/ui/type-alias-impl-trait/closure_args2.rs b/src/test/ui/type-alias-impl-trait/closure_args2.rs
new file mode 100644
index 000000000..82386c280
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/closure_args2.rs
@@ -0,0 +1,23 @@
+// run-pass
+
+#![feature(type_alias_impl_trait)]
+
+trait Foo {
+ // This was reachable in https://github.com/rust-lang/rust/issues/100800
+ fn foo(&self) { unreachable!() }
+}
+impl<T> Foo for T {}
+
+struct B;
+impl B {
+ fn foo(&self) {}
+}
+
+type Input = impl Foo;
+fn run1<F: FnOnce(Input)>(f: F, i: Input) {f(i)}
+fn run2<F: FnOnce(B)>(f: F, i: B) {f(i)}
+
+fn main() {
+ run1(|x: B| {x.foo()}, B);
+ run2(|x: B| {x.foo()}, B);
+}
diff --git a/src/test/ui/type-alias-impl-trait/closure_parent_substs.rs b/src/test/ui/type-alias-impl-trait/closure_parent_substs.rs
new file mode 100644
index 000000000..475f4724f
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/closure_parent_substs.rs
@@ -0,0 +1,65 @@
+// When WF checking the hidden type in the ParamEnv of the opaque type,
+// one complication arises when the hidden type is a closure/generator:
+// the "parent_substs" of the type may reference lifetime parameters
+// not present in the opaque type.
+// These region parameters are not really useful in this check.
+// So here we ignore them and replace them with fresh region variables.
+
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// Basic test
+mod test1 {
+ // Hidden type = Closure['_#0r]
+ type Opaque = impl Sized;
+
+ fn define<'a: 'a>() -> Opaque {
+ || {}
+ }
+}
+
+// the region vars cannot both be equal to `'static` or `'empty`
+mod test2 {
+ trait Trait {}
+
+ // Hidden type = Closure['a, '_#0r, '_#1r]
+ // Constraints = [('_#0r: 'a), ('a: '_#1r)]
+ type Opaque<'a>
+ where
+ &'a (): Trait,
+ = impl Sized + 'a;
+
+ fn define<'a, 'x, 'y>() -> Opaque<'a>
+ where
+ &'a (): Trait,
+ 'x: 'a,
+ 'a: 'y,
+ {
+ || {}
+ }
+}
+
+// the region var cannot be equal to `'a` or `'b`
+mod test3 {
+ trait Trait {}
+
+ // Hidden type = Closure['a, 'b, '_#0r]
+ // Constraints = [('_#0r: 'a), ('_#0r: 'b)]
+ type Opaque<'a, 'b>
+ where
+ (&'a (), &'b ()): Trait,
+ = impl Sized + 'a + 'b;
+
+ fn define<'a, 'b, 'x>() -> Opaque<'a, 'b>
+ where
+ (&'a (), &'b ()): Trait,
+ 'x: 'a,
+ 'x: 'b,
+ {
+ || {}
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/closure_wf_outlives.rs b/src/test/ui/type-alias-impl-trait/closure_wf_outlives.rs
new file mode 100644
index 000000000..53974dbb3
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/closure_wf_outlives.rs
@@ -0,0 +1,65 @@
+// If the hidden type is a closure, we require the "outlives" bounds that appear on the
+// defining site to also appear on the opaque type.
+//
+// It's not clear if this is the desired behavior but at least
+// it's consistent and has no back-compat risk.
+
+// check-fail
+
+#![feature(type_alias_impl_trait)]
+#![allow(dead_code)]
+
+// requires `'a: 'b` bound
+mod test1 {
+ type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ //~^ ERROR lifetime bound not satisfied
+
+ fn define<'a, 'b>() -> Opaque<'a, 'b>
+ where
+ 'a: 'b,
+ {
+ || {}
+ }
+}
+
+// Same as the above but through indirection `'x`
+mod test2 {
+ type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ //~^ ERROR cannot infer an appropriate lifetime
+
+ fn define<'a, 'b, 'x>() -> Opaque<'a, 'b>
+ where
+ 'a: 'x,
+ 'x: 'b,
+ {
+ || {}
+ }
+}
+
+// fixed version of the above
+mod test2_fixed {
+ type Opaque<'a: 'b, 'b> = impl Sized + 'a + 'b;
+
+ fn define<'a, 'b, 'x>() -> Opaque<'a, 'b>
+ where
+ 'a: 'x,
+ 'x: 'b,
+ {
+ || {}
+ }
+}
+
+// requires `T: 'static`
+mod test3 {
+ type Opaque<T> = impl Sized;
+ //~^ ERROR the parameter type `T` may not live long enough
+
+ fn define<T>() -> Opaque<T>
+ where
+ T: 'static,
+ {
+ || {}
+ }
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/closure_wf_outlives.stderr b/src/test/ui/type-alias-impl-trait/closure_wf_outlives.stderr
new file mode 100644
index 000000000..ae6462bb6
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/closure_wf_outlives.stderr
@@ -0,0 +1,64 @@
+error[E0478]: lifetime bound not satisfied
+ --> $DIR/closure_wf_outlives.rs:14:27
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: lifetime parameter instantiated with the lifetime `'a` as defined here
+ --> $DIR/closure_wf_outlives.rs:14:17
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^
+note: but lifetime parameter must outlive the lifetime `'b` as defined here
+ --> $DIR/closure_wf_outlives.rs:14:21
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^
+
+error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
+ --> $DIR/closure_wf_outlives.rs:27:27
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
+ --> $DIR/closure_wf_outlives.rs:27:17
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^
+note: ...so that the declared lifetime parameter bounds are satisfied
+ --> $DIR/closure_wf_outlives.rs:27:27
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^^^^^^^^^^^^^^^^^^^
+note: but, the lifetime must be valid for the lifetime `'b` as defined here...
+ --> $DIR/closure_wf_outlives.rs:27:21
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^
+note: ...so that the declared lifetime parameter bounds are satisfied
+ --> $DIR/closure_wf_outlives.rs:27:27
+ |
+LL | type Opaque<'a, 'b> = impl Sized + 'a + 'b;
+ | ^^^^^^^^^^^^^^^^^^^^
+
+error[E0310]: the parameter type `T` may not live long enough
+ --> $DIR/closure_wf_outlives.rs:54:22
+ |
+LL | type Opaque<T> = impl Sized;
+ | ^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
+ |
+note: ...that is required by this bound
+ --> $DIR/closure_wf_outlives.rs:59:12
+ |
+LL | T: 'static,
+ | ^^^^^^^
+help: consider adding an explicit lifetime bound...
+ |
+LL | type Opaque<T: 'static> = impl Sized;
+ | +++++++++
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0310, E0478, E0495.
+For more information about an error, try `rustc --explain E0310`.
diff --git a/src/test/ui/type-alias-impl-trait/constrain_inputs.rs b/src/test/ui/type-alias-impl-trait/constrain_inputs.rs
index c32174288..03fb64b7b 100644
--- a/src/test/ui/type-alias-impl-trait/constrain_inputs.rs
+++ b/src/test/ui/type-alias-impl-trait/constrain_inputs.rs
@@ -1,17 +1,33 @@
-// check-pass
-
#![feature(type_alias_impl_trait)]
-mod foo {
+mod lifetime_params {
type Ty<'a> = impl Sized;
fn defining(s: &str) -> Ty<'_> { s }
fn execute(ty: Ty<'_>) -> &str { todo!() }
+ //~^ ERROR return type references an anonymous lifetime, which is not constrained by the fn input types
+
+ type BadFnSig = fn(Ty<'_>) -> &str;
+ //~^ ERROR return type references an anonymous lifetime, which is not constrained by the fn input types
+ type BadTraitRef = dyn Fn(Ty<'_>) -> &str;
+ //~^ ERROR binding for associated type `Output` references an anonymous lifetime
}
-mod bar {
+mod lifetime_params_2 {
type Ty<'a> = impl FnOnce() -> &'a str;
fn defining(s: &str) -> Ty<'_> { move || s }
fn execute(ty: Ty<'_>) -> &str { ty() }
+ //~^ ERROR return type references an anonymous lifetime, which is not constrained by the fn input types
+}
+
+// regression test for https://github.com/rust-lang/rust/issues/97104
+mod type_params {
+ type Ty<T> = impl Sized;
+ fn define<T>(s: T) -> Ty<T> { s }
+
+ type BadFnSig = fn(Ty<&str>) -> &str;
+ //~^ ERROR return type references an anonymous lifetime, which is not constrained by the fn input types
+ type BadTraitRef = dyn Fn(Ty<&str>) -> &str;
+ //~^ ERROR binding for associated type `Output` references an anonymous lifetime
}
fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/constrain_inputs.stderr b/src/test/ui/type-alias-impl-trait/constrain_inputs.stderr
new file mode 100644
index 000000000..93953fd06
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/constrain_inputs.stderr
@@ -0,0 +1,58 @@
+error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
+ --> $DIR/constrain_inputs.rs:6:31
+ |
+LL | fn execute(ty: Ty<'_>) -> &str { todo!() }
+ | ^^^^
+ |
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
+
+error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
+ --> $DIR/constrain_inputs.rs:9:35
+ |
+LL | type BadFnSig = fn(Ty<'_>) -> &str;
+ | ^^^^
+ |
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
+
+error[E0582]: binding for associated type `Output` references an anonymous lifetime, which does not appear in the trait input types
+ --> $DIR/constrain_inputs.rs:11:42
+ |
+LL | type BadTraitRef = dyn Fn(Ty<'_>) -> &str;
+ | ^^^^
+ |
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
+
+error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
+ --> $DIR/constrain_inputs.rs:18:31
+ |
+LL | fn execute(ty: Ty<'_>) -> &str { ty() }
+ | ^^^^
+ |
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
+
+error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
+ --> $DIR/constrain_inputs.rs:27:37
+ |
+LL | type BadFnSig = fn(Ty<&str>) -> &str;
+ | ^^^^
+ |
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
+
+error[E0582]: binding for associated type `Output` references an anonymous lifetime, which does not appear in the trait input types
+ --> $DIR/constrain_inputs.rs:29:44
+ |
+LL | type BadTraitRef = dyn Fn(Ty<&str>) -> &str;
+ | ^^^^
+ |
+ = note: lifetimes appearing in an associated or opaque type are not considered constrained
+ = note: consider introducing a named lifetime parameter
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0581, E0582.
+For more information about an error, try `rustc --explain E0581`.
diff --git a/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs b/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs
new file mode 100644
index 000000000..3bae0f173
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.rs
@@ -0,0 +1,31 @@
+#![feature(type_alias_impl_trait)]
+
+trait Static: 'static {}
+impl Static for () {}
+
+type Gal<T> = impl Static;
+fn _defining<T>() -> Gal<T> {}
+
+trait Callable<Arg> { type Output; }
+
+/// We can infer `<C as Callable<Arg>>::Output: 'static`,
+/// because we know `C: 'static` and `Arg: 'static`,
+fn box_str<C, Arg>(s: C::Output) -> Box<dyn AsRef<str> + 'static>
+where
+ Arg: Static,
+ C: ?Sized + Callable<Arg> + 'static,
+ C::Output: AsRef<str>,
+{
+ Box::new(s)
+}
+
+fn extend_lifetime(s: &str) -> Box<dyn AsRef<str> + 'static> {
+ type MalformedTy = dyn for<'a> Callable<Gal<&'a ()>, Output = &'a str>;
+ //~^ ERROR binding for associated type `Output` references lifetime `'a`
+ box_str::<MalformedTy, _>(s)
+}
+
+fn main() {
+ let extended = extend_lifetime(&String::from("hello"));
+ println!("{}", extended.as_ref().as_ref());
+}
diff --git a/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.stderr b/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.stderr
new file mode 100644
index 000000000..d5fc46cb1
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/constrain_inputs_unsound.stderr
@@ -0,0 +1,9 @@
+error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
+ --> $DIR/constrain_inputs_unsound.rs:23:58
+ |
+LL | type MalformedTy = dyn for<'a> Callable<Gal<&'a ()>, Output = &'a str>;
+ | ^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0582`.
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs
index 811832848..9a50c0f98 100644
--- a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs
+++ b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.rs
@@ -1,8 +1,9 @@
// compile-flags: --edition=2021
+// check-pass
#![feature(type_alias_impl_trait)]
fn main() {
- type T = impl Copy; //~ ERROR unconstrained opaque type
+ type T = impl Copy;
let foo: T = (1u32, 2u32);
let (a, b): (u32, u32) = foo;
}
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr
deleted file mode 100644
index 03b172e6d..000000000
--- a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: unconstrained opaque type
- --> $DIR/cross_inference_pattern_bug.rs:5:14
- |
-LL | type T = impl Copy;
- | ^^^^^^^^^
- |
- = note: `T` must be used in combination with a concrete type within the same module
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs
index 328096d44..b929122a6 100644
--- a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs
+++ b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.rs
@@ -1,13 +1,13 @@
-// known-bug: #96572
// compile-flags: --edition=2021 --crate-type=lib
// rustc-env:RUST_BACKTRACE=0
+// check-pass
// tracked in https://github.com/rust-lang/rust/issues/96572
#![feature(type_alias_impl_trait)]
fn main() {
- type T = impl Copy; // error: unconstrained opaque type
+ type T = impl Copy;
let foo: T = (1u32, 2u32);
- let (a, b) = foo; // removing this line makes the code compile
+ let (a, b) = foo; // this line used to make the code fail
}
diff --git a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr b/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr
deleted file mode 100644
index 8aa1f4956..000000000
--- a/src/test/ui/type-alias-impl-trait/cross_inference_pattern_bug_no_type.stderr
+++ /dev/null
@@ -1,10 +0,0 @@
-error: unconstrained opaque type
- --> $DIR/cross_inference_pattern_bug_no_type.rs:10:14
- |
-LL | type T = impl Copy; // error: unconstrained opaque type
- | ^^^^^^^^^
- |
- = note: `T` must be used in combination with a concrete type within the same module
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs
index 7740f774e..0b8157fe3 100644
--- a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.rs
@@ -1,5 +1,5 @@
#![feature(type_alias_impl_trait)]
-// check-pass
+
fn main() {}
// two definitions with different types
@@ -9,7 +9,7 @@ fn foo() -> Foo {
""
}
-fn bar() -> Foo {
+fn bar() -> Foo { //~ ERROR: concrete type differs from previous defining opaque type use
panic!()
}
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr
new file mode 100644
index 000000000..09dadb0af
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/different_defining_uses_never_type.rs:12:13
+ |
+LL | fn bar() -> Foo {
+ | ^^^ expected `&'static str`, got `()`
+ |
+note: previous use here
+ --> $DIR/different_defining_uses_never_type.rs:9:5
+ |
+LL | ""
+ | ^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.rs b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.rs
new file mode 100644
index 000000000..bc827a8f2
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.rs
@@ -0,0 +1,12 @@
+#![feature(type_alias_impl_trait)]
+
+type Tait = impl Sized;
+
+struct One;
+fn one() -> Tait { One }
+
+struct Two<T>(T);
+fn two() -> Tait { Two::<()>(todo!()) }
+//~^ ERROR concrete type differs from previous defining opaque type use
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.stderr b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.stderr
new file mode 100644
index 000000000..146a57cbb
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/different_defining_uses_never_type3.stderr
@@ -0,0 +1,14 @@
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/different_defining_uses_never_type3.rs:9:13
+ |
+LL | fn two() -> Tait { Two::<()>(todo!()) }
+ | ^^^^ expected `One`, got `Two<()>`
+ |
+note: previous use here
+ --> $DIR/different_defining_uses_never_type3.rs:6:20
+ |
+LL | fn one() -> Tait { One }
+ | ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs
index 4f424b8c6..5f75fdc71 100644
--- a/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs
+++ b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.rs
@@ -1,7 +1,11 @@
#![feature(type_alias_impl_trait)]
#![allow(dead_code)]
-type OneLifetime<'a, 'b> = impl std::fmt::Debug;
+pub trait Captures<'a> {}
+
+impl<'a, T: ?Sized> Captures<'a> for T {}
+
+type OneLifetime<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
fn foo<'a, 'b>(a: &'a u32, b: &'b u32) -> OneLifetime<'a, 'b> {
a
diff --git a/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr
index 0c50a84e8..546598e8a 100644
--- a/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr
+++ b/src/test/ui/type-alias-impl-trait/different_lifetimes_defining_uses.stderr
@@ -1,11 +1,11 @@
error: concrete type differs from previous defining opaque type use
- --> $DIR/different_lifetimes_defining_uses.rs:11:5
+ --> $DIR/different_lifetimes_defining_uses.rs:15:5
|
LL | b
| ^ expected `&'a u32`, got `&'b u32`
|
note: previous use here
- --> $DIR/different_lifetimes_defining_uses.rs:7:5
+ --> $DIR/different_lifetimes_defining_uses.rs:11:5
|
LL | a
| ^
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
index c9b9e128f..9d938a616 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.rs
@@ -2,8 +2,11 @@
fn main() {}
-type Two<'a, 'b> = impl std::fmt::Debug;
+pub trait Captures<'a> {}
+impl<'a, T: ?Sized> Captures<'a> for T {}
+
+type Two<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
fn one<'a>(t: &'a ()) -> Two<'a, 'a> {
t
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
index 222aaea78..72e1ef4b4 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_lifetime_param.stderr
@@ -1,13 +1,13 @@
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_lifetime_param.rs:9:5
+ --> $DIR/generic_duplicate_lifetime_param.rs:12:5
|
LL | t
| ^
|
note: lifetime used multiple times
- --> $DIR/generic_duplicate_lifetime_param.rs:5:10
+ --> $DIR/generic_duplicate_lifetime_param.rs:9:10
|
-LL | type Two<'a, 'b> = impl std::fmt::Debug;
+LL | type Two<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
| ^^ ^^
error: aborting due to previous error
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
index 093c1c231..80462f8ac 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.rs
@@ -7,7 +7,12 @@ fn main() {}
// test that unused generic parameters are ok
type TwoTys<T, U> = impl Debug;
-type TwoLifetimes<'a, 'b> = impl Debug;
+
+pub trait Captures<'a> {}
+
+impl<'a, T: ?Sized> Captures<'a> for T {}
+
+type TwoLifetimes<'a, 'b> = impl Debug + Captures<'a> + Captures<'b>;
type TwoConsts<const X: usize, const Y: usize> = impl Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
index b2edcc552..98e4bfea1 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use.stderr
@@ -1,5 +1,5 @@
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:16:5
+ --> $DIR/generic_duplicate_param_use.rs:21:5
|
LL | t
| ^
@@ -11,25 +11,25 @@ LL | type TwoTys<T, U> = impl Debug;
| ^ ^
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:21:5
+ --> $DIR/generic_duplicate_param_use.rs:26:5
|
LL | t
| ^
|
note: lifetime used multiple times
- --> $DIR/generic_duplicate_param_use.rs:10:19
+ --> $DIR/generic_duplicate_param_use.rs:15:19
|
-LL | type TwoLifetimes<'a, 'b> = impl Debug;
+LL | type TwoLifetimes<'a, 'b> = impl Debug + Captures<'a> + Captures<'b>;
| ^^ ^^
error: non-defining opaque type use in defining scope
- --> $DIR/generic_duplicate_param_use.rs:26:5
+ --> $DIR/generic_duplicate_param_use.rs:31:5
|
LL | t
| ^
|
note: constant used multiple times
- --> $DIR/generic_duplicate_param_use.rs:12:16
+ --> $DIR/generic_duplicate_param_use.rs:17:16
|
LL | type TwoConsts<const X: usize, const Y: usize> = impl Debug;
| ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr
index 2768f0c3a..586ea8234 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use5.stderr
@@ -4,7 +4,7 @@ error[E0277]: `T` doesn't implement `Debug`
LL | (t, u)
| ^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(T, U)`
+ = note: required for `(T, U)` to implement `Debug`
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
@@ -16,7 +16,7 @@ error[E0277]: `U` doesn't implement `Debug`
LL | (t, u)
| ^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(T, U)`
+ = note: required for `(T, U)` to implement `Debug`
help: consider restricting type parameter `U`
|
LL | type Two<T, U: std::fmt::Debug> = impl Debug;
@@ -28,7 +28,7 @@ error[E0277]: `U` doesn't implement `Debug`
LL | (u, t)
| ^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(U, T)`
+ = note: required for `(U, T)` to implement `Debug`
help: consider restricting type parameter `U`
|
LL | type Two<T, U: std::fmt::Debug> = impl Debug;
@@ -40,7 +40,7 @@ error[E0277]: `T` doesn't implement `Debug`
LL | (u, t)
| ^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(U, T)`
+ = note: required for `(U, T)` to implement `Debug`
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr
index c1712ca2e..cb162d382 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use6.stderr
@@ -4,7 +4,7 @@ error[E0277]: `T` doesn't implement `Debug`
LL | (t, t)
| ^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(T, T)`
+ = note: required for `(T, T)` to implement `Debug`
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
@@ -16,7 +16,7 @@ error[E0277]: `U` doesn't implement `Debug`
LL | (u, t)
| ^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(U, T)`
+ = note: required for `(U, T)` to implement `Debug`
help: consider restricting type parameter `U`
|
LL | type Two<T, U: std::fmt::Debug> = impl Debug;
@@ -28,7 +28,7 @@ error[E0277]: `T` doesn't implement `Debug`
LL | (u, t)
| ^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(U, T)`
+ = note: required for `(U, T)` to implement `Debug`
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr
index b83105c45..14cbfb380 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use8.stderr
@@ -4,7 +4,7 @@ error[E0277]: `T` doesn't implement `Debug`
LL | (t, 4u32)
| ^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(T, u32)`
+ = note: required for `(T, u32)` to implement `Debug`
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
@@ -16,7 +16,7 @@ error[E0277]: `U` doesn't implement `Debug`
LL | (u, 4u32)
| ^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(U, u32)`
+ = note: required for `(U, u32)` to implement `Debug`
help: consider restricting type parameter `U`
|
LL | type Two<T, U: std::fmt::Debug> = impl Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr
index 50cf98273..722693e42 100644
--- a/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr
+++ b/src/test/ui/type-alias-impl-trait/generic_duplicate_param_use9.stderr
@@ -15,7 +15,7 @@ error[E0277]: `A` doesn't implement `Debug`
LL | (t, u, T::BAR)
| ^^^^^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(A, B, _)`
+ = note: required for `(A, B, _)` to implement `Debug`
help: consider restricting type parameter `A`
|
LL | type Two<A: std::fmt::Debug, B> = impl Debug;
@@ -27,7 +27,7 @@ error[E0277]: `B` doesn't implement `Debug`
LL | (t, u, T::BAR)
| ^^^^^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(A, B, _)`
+ = note: required for `(A, B, _)` to implement `Debug`
help: consider restricting type parameter `B`
|
LL | type Two<A, B: std::fmt::Debug> = impl Debug;
@@ -39,7 +39,7 @@ error[E0277]: `A` doesn't implement `Debug`
LL | (t, u, 42)
| ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(A, B, i32)`
+ = note: required for `(A, B, i32)` to implement `Debug`
help: consider restricting type parameter `A`
|
LL | type Two<A: std::fmt::Debug, B> = impl Debug;
@@ -51,7 +51,7 @@ error[E0277]: `B` doesn't implement `Debug`
LL | (t, u, 42)
| ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(A, B, i32)`
+ = note: required for `(A, B, i32)` to implement `Debug`
help: consider restricting type parameter `B`
|
LL | type Two<A, B: std::fmt::Debug> = impl Debug;
diff --git a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs b/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs
index e109c38c9..106efefba 100644
--- a/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs
+++ b/src/test/ui/type-alias-impl-trait/generic_lifetime_param.rs
@@ -1,10 +1,11 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
#![feature(type_alias_impl_trait)]
fn main() {}
-type Region<'a> = impl std::fmt::Debug;
+type Region<'a> = impl std::fmt::Debug + 'a;
+
fn region<'b>(a: &'b ()) -> Region<'b> {
a
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds.rs b/src/test/ui/type-alias-impl-trait/implied_bounds.rs
new file mode 100644
index 000000000..53cbf8d22
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds.rs
@@ -0,0 +1,51 @@
+#![feature(type_alias_impl_trait)]
+
+type WithLifetime<'a> = impl Equals<SelfType = ()>;
+fn _defining_use<'a>() -> WithLifetime<'a> {}
+
+trait Convert<'a> {
+ type Witness;
+ fn convert<'b, T: ?Sized>(_proof: &'b Self::Witness, x: &'a T) -> &'b T;
+}
+
+impl<'a> Convert<'a> for () {
+ type Witness = WithLifetime<'a>;
+
+ fn convert<'b, T: ?Sized>(_proof: &'b WithLifetime<'a>, x: &'a T) -> &'b T {
+ // compiler used to think it gets to assume 'a: 'b here because
+ // of the `&'b WithLifetime<'a>` argument
+ x
+ //~^ ERROR lifetime may not live long enough
+ }
+}
+
+fn extend_lifetime<'a, 'b, T: ?Sized>(x: &'a T) -> &'b T {
+ WithLifetime::<'a>::convert_helper::<(), T>(&(), x)
+}
+
+trait Equals {
+ type SelfType;
+ fn convert_helper<'a, 'b, W: Convert<'a, Witness = Self>, T: ?Sized>(
+ proof: &'b Self::SelfType,
+ x: &'a T,
+ ) -> &'b T;
+}
+
+impl<S> Equals for S {
+ type SelfType = Self;
+ fn convert_helper<'a, 'b, W: Convert<'a, Witness = Self>, T: ?Sized>(
+ proof: &'b Self,
+ x: &'a T,
+ ) -> &'b T {
+ W::convert(proof, x)
+ }
+}
+
+fn main() {
+ let r;
+ {
+ let x = String::from("Hello World?");
+ r = extend_lifetime(&x);
+ }
+ println!("{}", r);
+}
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds.stderr b/src/test/ui/type-alias-impl-trait/implied_bounds.stderr
new file mode 100644
index 000000000..6f11b6663
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds.stderr
@@ -0,0 +1,16 @@
+error: lifetime may not live long enough
+ --> $DIR/implied_bounds.rs:17:9
+ |
+LL | impl<'a> Convert<'a> for () {
+ | -- lifetime `'a` defined here
+...
+LL | fn convert<'b, T: ?Sized>(_proof: &'b WithLifetime<'a>, x: &'a T) -> &'b T {
+ | -- lifetime `'b` defined here
+...
+LL | x
+ | ^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+ |
+ = help: consider adding the following bound: `'a: 'b`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds2.rs b/src/test/ui/type-alias-impl-trait/implied_bounds2.rs
new file mode 100644
index 000000000..b4c4c013c
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds2.rs
@@ -0,0 +1,10 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+
+type Ty<'a, A> = impl Sized + 'a;
+fn defining<'a, A>() -> Ty<'a, A> {}
+fn assert_static<T: 'static>() {}
+fn test<'a, A>() where Ty<'a, A>: 'static, { assert_static::<Ty<'a, A>>() }
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds3.rs b/src/test/ui/type-alias-impl-trait/implied_bounds3.rs
new file mode 100644
index 000000000..e39c61328
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds3.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+fn foo<F>(_: F)
+where
+ F: 'static,
+{
+}
+
+fn from<F: Send>(f: F) -> impl Send {
+ f
+}
+
+fn bar<T>() {
+ foo(from(|| ()))
+}
+
+fn main() {
+}
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds_closure.rs b/src/test/ui/type-alias-impl-trait/implied_bounds_closure.rs
new file mode 100644
index 000000000..4cf35f951
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds_closure.rs
@@ -0,0 +1,31 @@
+trait StaticDefaultRef: 'static {
+ fn default_ref() -> &'static Self;
+}
+
+impl StaticDefaultRef for str {
+ fn default_ref() -> &'static str {
+ ""
+ }
+}
+
+fn into_impl(x: &str) -> &(impl ?Sized + AsRef<str> + StaticDefaultRef + '_) {
+ x
+}
+
+fn extend_lifetime<'a>(x: &'a str) -> &'static str {
+ let t = into_impl(x);
+ helper(|_| t) //~ ERROR lifetime may not live long enough
+}
+
+fn helper<T: ?Sized + AsRef<str> + StaticDefaultRef>(f: impl FnOnce(&T) -> &T) -> &'static str {
+ f(T::default_ref()).as_ref()
+}
+
+fn main() {
+ let r;
+ {
+ let x = String::from("Hello World?");
+ r = extend_lifetime(&x);
+ }
+ println!("{}", r);
+}
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds_closure.stderr b/src/test/ui/type-alias-impl-trait/implied_bounds_closure.stderr
new file mode 100644
index 000000000..151564c3b
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds_closure.stderr
@@ -0,0 +1,11 @@
+error: lifetime may not live long enough
+ --> $DIR/implied_bounds_closure.rs:17:16
+ |
+LL | fn extend_lifetime<'a>(x: &'a str) -> &'static str {
+ | -- lifetime `'a` defined here
+LL | let t = into_impl(x);
+LL | helper(|_| t)
+ | ^ returning this value requires that `'a` must outlive `'static`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds_from_types.rs b/src/test/ui/type-alias-impl-trait/implied_bounds_from_types.rs
new file mode 100644
index 000000000..8023cd24f
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds_from_types.rs
@@ -0,0 +1,51 @@
+#![feature(type_alias_impl_trait)]
+
+type WithLifetime<T> = impl Equals<SelfType = ()>;
+fn _defining_use<T>() -> WithLifetime<T> {}
+
+trait Convert<'a> {
+ type Witness;
+ fn convert<'b, T: ?Sized>(_proof: &'b Self::Witness, x: &'a T) -> &'b T;
+}
+
+impl<'a> Convert<'a> for () {
+ type Witness = WithLifetime<&'a ()>;
+
+ fn convert<'b, T: ?Sized>(_proof: &'b WithLifetime<&'a ()>, x: &'a T) -> &'b T {
+ // compiler used to think it gets to assume 'a: 'b here because
+ // of the `&'b WithLifetime<&'a ()>` argument
+ x
+ //~^ ERROR lifetime may not live long enough
+ }
+}
+
+fn extend_lifetime<'a, 'b, T: ?Sized>(x: &'a T) -> &'b T {
+ WithLifetime::<&'a ()>::convert_helper::<(), T>(&(), x)
+}
+
+trait Equals {
+ type SelfType;
+ fn convert_helper<'a, 'b, W: Convert<'a, Witness = Self>, T: ?Sized>(
+ proof: &'b Self::SelfType,
+ x: &'a T,
+ ) -> &'b T;
+}
+
+impl<S> Equals for S {
+ type SelfType = Self;
+ fn convert_helper<'a, 'b, W: Convert<'a, Witness = Self>, T: ?Sized>(
+ proof: &'b Self,
+ x: &'a T,
+ ) -> &'b T {
+ W::convert(proof, x)
+ }
+}
+
+fn main() {
+ let r;
+ {
+ let x = String::from("Hello World?");
+ r = extend_lifetime(&x);
+ }
+ println!("{}", r);
+}
diff --git a/src/test/ui/type-alias-impl-trait/implied_bounds_from_types.stderr b/src/test/ui/type-alias-impl-trait/implied_bounds_from_types.stderr
new file mode 100644
index 000000000..cbc5e6073
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_bounds_from_types.stderr
@@ -0,0 +1,16 @@
+error: lifetime may not live long enough
+ --> $DIR/implied_bounds_from_types.rs:17:9
+ |
+LL | impl<'a> Convert<'a> for () {
+ | -- lifetime `'a` defined here
+...
+LL | fn convert<'b, T: ?Sized>(_proof: &'b WithLifetime<&'a ()>, x: &'a T) -> &'b T {
+ | -- lifetime `'b` defined here
+...
+LL | x
+ | ^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
+ |
+ = help: consider adding the following bound: `'a: 'b`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs
new file mode 100644
index 000000000..b6a7264a5
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check.rs
@@ -0,0 +1,27 @@
+#![feature(type_alias_impl_trait)]
+
+// known-bug: #99840
+// this should not compile
+// check-pass
+
+type Alias = impl Sized;
+
+fn constrain() -> Alias {
+ 1i32
+}
+
+trait HideIt {
+ type Assoc;
+}
+
+impl HideIt for () {
+ type Assoc = Alias;
+}
+
+pub trait Yay {}
+
+impl Yay for <() as HideIt>::Assoc {}
+// impl Yay for i32 {} // this already errors
+// impl Yay for u32 {} // this also already errors
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs
new file mode 100644
index 000000000..07f825aea
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs
@@ -0,0 +1,43 @@
+#![feature(type_alias_impl_trait)]
+
+mod test_lifetime_param {
+ type Ty<'a> = impl Sized + 'a;
+ fn defining(a: &str) -> Ty<'_> { a }
+ fn assert_static<'a: 'static>() {}
+ //~^ WARN: unnecessary lifetime parameter `'a`
+ fn test<'a>() where Ty<'a>: 'static { assert_static::<'a>() }
+ //~^ ERROR: lifetime may not live long enough
+}
+
+mod test_higher_kinded_lifetime_param {
+ type Ty<'a> = impl Sized + 'a;
+ fn defining(a: &str) -> Ty<'_> { a }
+ fn assert_static<'a: 'static>() {}
+ //~^ WARN: unnecessary lifetime parameter `'a`
+ fn test<'a>() where for<'b> Ty<'b>: 'a { assert_static::<'a>() }
+ //~^ ERROR: lifetime may not live long enough
+}
+
+mod test_higher_kinded_lifetime_param2 {
+ fn assert_static<'a: 'static>() {}
+ //~^ WARN: unnecessary lifetime parameter `'a`
+ fn test<'a>() { assert_static::<'a>() }
+ //~^ ERROR: lifetime may not live long enough
+}
+
+mod test_type_param {
+ type Ty<A> = impl Sized;
+ fn defining<A>(s: A) -> Ty<A> { s }
+ fn assert_static<A: 'static>() {}
+ fn test<A>() where Ty<A>: 'static { assert_static::<A>() }
+ //~^ ERROR: parameter type `A` may not live long enough
+}
+
+mod test_implied_from_fn_sig {
+ type Opaque<T: 'static> = impl Sized;
+ fn defining<T: 'static>() -> Opaque<T> {}
+ fn assert_static<T: 'static>() {}
+ fn test<T>(_: Opaque<T>) { assert_static::<T>(); }
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.stderr b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.stderr
new file mode 100644
index 000000000..887620a4d
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check3.stderr
@@ -0,0 +1,58 @@
+warning: unnecessary lifetime parameter `'a`
+ --> $DIR/implied_lifetime_wf_check3.rs:6:22
+ |
+LL | fn assert_static<'a: 'static>() {}
+ | ^^
+ |
+ = help: you can use the `'static` lifetime directly, in place of `'a`
+
+warning: unnecessary lifetime parameter `'a`
+ --> $DIR/implied_lifetime_wf_check3.rs:15:22
+ |
+LL | fn assert_static<'a: 'static>() {}
+ | ^^
+ |
+ = help: you can use the `'static` lifetime directly, in place of `'a`
+
+warning: unnecessary lifetime parameter `'a`
+ --> $DIR/implied_lifetime_wf_check3.rs:22:22
+ |
+LL | fn assert_static<'a: 'static>() {}
+ | ^^
+ |
+ = help: you can use the `'static` lifetime directly, in place of `'a`
+
+error: lifetime may not live long enough
+ --> $DIR/implied_lifetime_wf_check3.rs:8:43
+ |
+LL | fn test<'a>() where Ty<'a>: 'static { assert_static::<'a>() }
+ | -- lifetime `'a` defined here ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+
+error: lifetime may not live long enough
+ --> $DIR/implied_lifetime_wf_check3.rs:17:46
+ |
+LL | fn test<'a>() where for<'b> Ty<'b>: 'a { assert_static::<'a>() }
+ | -- lifetime `'a` defined here ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+
+error: lifetime may not live long enough
+ --> $DIR/implied_lifetime_wf_check3.rs:24:21
+ |
+LL | fn test<'a>() { assert_static::<'a>() }
+ | -- ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static`
+ | |
+ | lifetime `'a` defined here
+
+error[E0310]: the parameter type `A` may not live long enough
+ --> $DIR/implied_lifetime_wf_check3.rs:32:41
+ |
+LL | fn test<A>() where Ty<A>: 'static { assert_static::<A>() }
+ | ^^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | fn test<A: 'static>() where Ty<A>: 'static { assert_static::<A>() }
+ | +++++++++
+
+error: aborting due to 4 previous errors; 3 warnings emitted
+
+For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs
new file mode 100644
index 000000000..ac32dbde0
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs
@@ -0,0 +1,11 @@
+#![feature(type_alias_impl_trait)]
+
+mod test_type_param_static {
+ type Ty<A> = impl Sized + 'static;
+ //~^ ERROR: the parameter type `A` may not live long enough
+ fn defining<A: 'static>(s: A) -> Ty<A> { s }
+ fn assert_static<A: 'static>() {}
+ fn test<A>() where Ty<A>: 'static { assert_static::<A>() }
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.stderr b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.stderr
new file mode 100644
index 000000000..47bc31e78
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.stderr
@@ -0,0 +1,14 @@
+error[E0310]: the parameter type `A` may not live long enough
+ --> $DIR/implied_lifetime_wf_check4_static.rs:4:18
+ |
+LL | type Ty<A> = impl Sized + 'static;
+ | ^^^^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | type Ty<A: 'static> = impl Sized + 'static;
+ | +++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0310`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-101750.rs b/src/test/ui/type-alias-impl-trait/issue-101750.rs
new file mode 100644
index 000000000..f564f4fa7
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-101750.rs
@@ -0,0 +1,37 @@
+#![feature(type_alias_impl_trait)]
+
+// check-pass
+
+trait Trait {}
+
+type TAIT = impl Trait;
+
+struct Concrete;
+impl Trait for Concrete {}
+
+fn tait() -> TAIT {
+ Concrete
+}
+
+trait OuterTrait {
+ type Item;
+}
+struct Dummy<T> {
+ t: T,
+}
+impl<T> OuterTrait for Dummy<T> {
+ type Item = T;
+}
+
+fn tait_and_impl_trait() -> impl OuterTrait<Item = (TAIT, impl Trait)> {
+ Dummy {
+ t: (tait(), Concrete),
+ }
+}
+
+fn tait_and_dyn_trait() -> impl OuterTrait<Item = (TAIT, Box<dyn Trait>)> {
+ let b: Box<dyn Trait> = Box::new(Concrete);
+ Dummy { t: (tait(), b) }
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr
index d20b1cc6d..0a34e8486 100644
--- a/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-53398-cyclic-types.stderr
@@ -1,10 +1,11 @@
-error[E0275]: overflow evaluating the requirement `fn() -> Foo {foo}: Sized`
+error[E0275]: overflow evaluating the requirement `Foo: Sized`
--> $DIR/issue-53398-cyclic-types.rs:5:13
|
LL | fn foo() -> Foo {
| ^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_53398_cyclic_types`)
+ = note: required because it appears within the type `fn() -> Foo {foo}`
error: aborting due to previous error
diff --git a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr
index f14bf6b0f..6344f114a 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-57611-trait-alias.stderr
@@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | |x| x
| ^^^^^ one type is more general than the other
|
- = note: expected trait `for<'r> Fn<(&'r X,)>`
+ = note: expected trait `for<'a> Fn<(&'a X,)>`
found trait `Fn<(&X,)>`
note: this closure does not fulfill the lifetime requirements
--> $DIR/issue-57611-trait-alias.rs:21:9
diff --git a/src/test/ui/type-alias-impl-trait/issue-57961.rs b/src/test/ui/type-alias-impl-trait/issue-57961.rs
index 472886c9c..24b3a0458 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57961.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-57961.rs
@@ -8,7 +8,7 @@ trait Foo {
impl Foo for () {
type Bar = std::vec::IntoIter<u32>;
- //~^ ERROR type mismatch resolving `<std::vec::IntoIter<u32> as Iterator>::Item == X
+ //~^ ERROR expected `std::vec::IntoIter<u32>` to be an iterator that yields `X`, but it yields `u32`
}
fn incoherent() {
diff --git a/src/test/ui/type-alias-impl-trait/issue-57961.stderr b/src/test/ui/type-alias-impl-trait/issue-57961.stderr
index ed4caf6ce..fb40895c4 100644
--- a/src/test/ui/type-alias-impl-trait/issue-57961.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-57961.stderr
@@ -1,4 +1,4 @@
-error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as Iterator>::Item == X`
+error[E0271]: expected `std::vec::IntoIter<u32>` to be an iterator that yields `X`, but it yields `u32`
--> $DIR/issue-57961.rs:10:16
|
LL | type X = impl Sized;
diff --git a/src/test/ui/type-alias-impl-trait/issue-58662-generator-with-lifetime.rs b/src/test/ui/type-alias-impl-trait/issue-58662-generator-with-lifetime.rs
index f20ddf020..477b61390 100644
--- a/src/test/ui/type-alias-impl-trait/issue-58662-generator-with-lifetime.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-58662-generator-with-lifetime.rs
@@ -16,7 +16,7 @@ fn rand_generator<'a>(rng: &'a ()) -> RandGenerator<'a> {
}
}
-pub type RandGeneratorWithIndirection<'a> = impl Generator<Return = (), Yield = u64> + 'a;
+pub type RandGeneratorWithIndirection<'c> = impl Generator<Return = (), Yield = u64> + 'c;
pub fn rand_generator_with_indirection<'a>(rng: &'a ()) -> RandGeneratorWithIndirection<'a> {
fn helper<'b>(rng: &'b ()) -> impl 'b + Generator<Return = (), Yield = u64> {
move || {
diff --git a/src/test/ui/type-alias-impl-trait/issue-58662-simplified.rs b/src/test/ui/type-alias-impl-trait/issue-58662-simplified.rs
new file mode 100644
index 000000000..27ca7d0fd
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-58662-simplified.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+#![feature(generators, generator_trait)]
+#![feature(type_alias_impl_trait)]
+
+trait Trait {}
+
+impl<T> Trait for T {}
+
+type Foo<'c> = impl Trait + 'c;
+fn foo<'a>(rng: &'a ()) -> Foo<'a> {
+ fn helper<'b>(rng: &'b ()) -> impl 'b + Trait {
+ rng
+ }
+
+ helper(rng)
+}
+
+fn main() {
+}
diff --git a/src/test/ui/type-alias-impl-trait/issue-60371.stderr b/src/test/ui/type-alias-impl-trait/issue-60371.stderr
index 082b0f0c3..d0c04371b 100644
--- a/src/test/ui/type-alias-impl-trait/issue-60371.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-60371.stderr
@@ -11,7 +11,7 @@ error[E0277]: the trait bound `(): Bug` is not satisfied
--> $DIR/issue-60371.rs:10:40
|
LL | const FUN: fn() -> Self::Item = || ();
- | ^ the trait `Bug` is not implemented for `()`
+ | ^^ the trait `Bug` is not implemented for `()`
|
= help: the trait `Bug` is implemented for `&()`
diff --git a/src/test/ui/type-alias-impl-trait/issue-74280.stderr b/src/test/ui/type-alias-impl-trait/issue-74280.stderr
index 5ed29e0ac..66886db6e 100644
--- a/src/test/ui/type-alias-impl-trait/issue-74280.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-74280.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-74280.rs:9:5
|
LL | fn test() -> Test {
- | ---- expected `_` because of return type
+ | ---- expected `()` because of return type
LL | let y = || -> Test { () };
LL | 7
| ^ expected `()`, found integer
diff --git a/src/test/ui/type-alias-impl-trait/issue-89686.rs b/src/test/ui/type-alias-impl-trait/issue-89686.rs
index de070fc9d..058417bdb 100644
--- a/src/test/ui/type-alias-impl-trait/issue-89686.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-89686.rs
@@ -4,7 +4,7 @@
use std::future::Future;
-type G<'a, T> = impl Future<Output = ()>;
+type G<'a, T> = impl Future<Output = ()> + 'a;
trait Trait {
type F: Future<Output = ()>;
diff --git a/src/test/ui/type-alias-impl-trait/issue-89686.stderr b/src/test/ui/type-alias-impl-trait/issue-89686.stderr
index b636ada8b..3b95a575a 100644
--- a/src/test/ui/type-alias-impl-trait/issue-89686.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-89686.stderr
@@ -6,7 +6,7 @@ LL | async move { self.f().await }
|
help: consider restricting type parameter `T`
|
-LL | type G<'a, T: Trait> = impl Future<Output = ()>;
+LL | type G<'a, T: Trait> = impl Future<Output = ()> + 'a;
| +++++++
error: aborting due to previous error
diff --git a/src/test/ui/type-alias-impl-trait/issue-90400-1.rs b/src/test/ui/type-alias-impl-trait/issue-90400-1.rs
index 8550a3e86..15aead2f6 100644
--- a/src/test/ui/type-alias-impl-trait/issue-90400-1.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-90400-1.rs
@@ -1,7 +1,6 @@
// Regression test for #90400,
// taken from https://github.com/rust-lang/rust/issues/90400#issuecomment-954927836
-#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
trait Bar {
diff --git a/src/test/ui/type-alias-impl-trait/issue-90400-1.stderr b/src/test/ui/type-alias-impl-trait/issue-90400-1.stderr
index 428a10740..ead28769f 100644
--- a/src/test/ui/type-alias-impl-trait/issue-90400-1.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-90400-1.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `B: Bar` is not satisfied
- --> $DIR/issue-90400-1.rs:23:9
+ --> $DIR/issue-90400-1.rs:22:9
|
LL | move || bar.bar()
| ^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `B`
|
note: required by a bound in `<MyFoo as Foo>::foo`
- --> $DIR/issue-90400-1.rs:22:15
+ --> $DIR/issue-90400-1.rs:21:15
|
LL | fn foo<B: Bar>(&self, bar: B) -> Self::FooFn<B> {
| ^^^ required by this bound in `<MyFoo as Foo>::foo`
diff --git a/src/test/ui/type-alias-impl-trait/issue-90400-2.rs b/src/test/ui/type-alias-impl-trait/issue-90400-2.rs
index 2b369bb8a..4c6e893c1 100644
--- a/src/test/ui/type-alias-impl-trait/issue-90400-2.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-90400-2.rs
@@ -1,7 +1,6 @@
// Regression test for #90400,
// taken from https://github.com/rust-lang/rust/issues/90400#issuecomment-954927836
-#![feature(generic_associated_types)]
#![feature(type_alias_impl_trait)]
trait Bar {
diff --git a/src/test/ui/type-alias-impl-trait/issue-90400-2.stderr b/src/test/ui/type-alias-impl-trait/issue-90400-2.stderr
index 5da05a439..50b2dc049 100644
--- a/src/test/ui/type-alias-impl-trait/issue-90400-2.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-90400-2.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `B: Bar` is not satisfied
- --> $DIR/issue-90400-2.rs:26:9
+ --> $DIR/issue-90400-2.rs:25:9
|
LL | MyBaz(bar)
| ^^^^^^^^^^ the trait `Bar` is not implemented for `B`
|
-note: required because of the requirements on the impl of `Baz` for `MyBaz<B>`
- --> $DIR/issue-90400-2.rs:31:14
+note: required for `MyBaz<B>` to implement `Baz`
+ --> $DIR/issue-90400-2.rs:30:14
|
LL | impl<B: Bar> Baz for MyBaz<B> {
| ^^^ ^^^^^^^^
diff --git a/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.rs b/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.rs
new file mode 100644
index 000000000..825710851
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.rs
@@ -0,0 +1,10 @@
+#![feature(type_alias_impl_trait)]
+
+fn main() {
+ type T = impl Copy;
+ let foo: T = Some((1u32, 2u32));
+ match foo {
+ None => (),
+ Some((a, b, c)) => (), //~ ERROR mismatched types
+ }
+}
diff --git a/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.stderr b/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.stderr
new file mode 100644
index 000000000..728244a18
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained-mismatch.stderr
@@ -0,0 +1,15 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-96572-unconstrained-mismatch.rs:8:14
+ |
+LL | match foo {
+ | --- this expression has type `T`
+LL | None => (),
+LL | Some((a, b, c)) => (),
+ | ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
+ |
+ = note: expected tuple `(u32, u32)`
+ found tuple `(_, _, _)`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained.rs b/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained.rs
new file mode 100644
index 000000000..2c740ccc1
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/issue-96572-unconstrained.rs
@@ -0,0 +1,92 @@
+#![feature(type_alias_impl_trait)]
+// check-pass
+
+fn main() {
+ type T = impl Copy;
+ let foo: T = Some((1u32, 2u32));
+ match foo {
+ None => (),
+ Some((a, b)) => (),
+ }
+}
+
+fn upvar() {
+ #[derive(Copy, Clone)]
+ struct Foo((u32, u32));
+
+ type T = impl Copy;
+ let foo: T = Foo((1u32, 2u32));
+ let x = move || {
+ let Foo((a, b)) = foo;
+ };
+}
+
+fn enum_upvar() {
+ type T = impl Copy;
+ let foo: T = Some((1u32, 2u32));
+ let x = move || {
+ match foo {
+ None => (),
+ Some((a, b)) => (),
+ }
+ };
+}
+
+fn r#struct() {
+ #[derive(Copy, Clone)]
+ struct Foo((u32, u32));
+
+ type U = impl Copy;
+ let foo: U = Foo((1u32, 2u32));
+ let Foo((a, b)) = foo;
+}
+
+mod only_pattern {
+ type T = impl Copy;
+
+ fn foo(foo: T) {
+ let (mut x, mut y) = foo;
+ x = 42;
+ y = "foo";
+ }
+
+ type U = impl Copy;
+
+ fn bar(bar: Option<U>) {
+ match bar {
+ Some((mut x, mut y)) => {
+ x = 42;
+ y = "foo";
+ }
+ None => {}
+ }
+ }
+}
+
+mod only_pattern_rpit {
+ #[allow(unconditional_recursion)]
+ fn foo(b: bool) -> impl Copy {
+ let (mut x, mut y) = foo(false);
+ x = 42;
+ y = "foo";
+ if b {
+ panic!()
+ } else {
+ foo(true)
+ }
+ }
+
+ fn bar(b: bool) -> Option<impl Copy> {
+ if b {
+ return None;
+ }
+ match bar(!b) {
+ Some((mut x, mut y)) => {
+ x = 42;
+ y = "foo";
+ }
+ None => {}
+ }
+ None
+ }
+}
diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.rs b/src/test/ui/type-alias-impl-trait/issue-98604.rs
index a4fd8a82a..32c2f9ed5 100644
--- a/src/test/ui/type-alias-impl-trait/issue-98604.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-98604.rs
@@ -1,13 +1,11 @@
// edition:2018
-type AsyncFnPtr = Box<
- dyn Fn() -> std::pin::Pin<Box<dyn std::future::Future<Output = ()>>>,
->;
+type AsyncFnPtr = Box<dyn Fn() -> std::pin::Pin<Box<dyn std::future::Future<Output = ()>>>>;
async fn test() {}
#[allow(unused_must_use)]
fn main() {
Box::new(test) as AsyncFnPtr;
- //~^ ERROR type mismatch
+ //~^ ERROR expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
}
diff --git a/src/test/ui/type-alias-impl-trait/issue-98604.stderr b/src/test/ui/type-alias-impl-trait/issue-98604.stderr
index f04d1b4d7..92d01eb0d 100644
--- a/src/test/ui/type-alias-impl-trait/issue-98604.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-98604.stderr
@@ -1,11 +1,11 @@
-error[E0271]: type mismatch resolving `<fn() -> impl Future<Output = ()> {test} as FnOnce<()>>::Output == Pin<Box<(dyn Future<Output = ()> + 'static)>>`
- --> $DIR/issue-98604.rs:11:5
+error[E0271]: expected `fn() -> impl Future<Output = ()> {test}` to be a fn item that returns `Pin<Box<(dyn Future<Output = ()> + 'static)>>`, but it returns `impl Future<Output = ()>`
+ --> $DIR/issue-98604.rs:9:5
|
LL | Box::new(test) as AsyncFnPtr;
| ^^^^^^^^^^^^^^ expected struct `Pin`, found opaque type
|
note: while checking the return type of the `async fn`
- --> $DIR/issue-98604.rs:7:17
+ --> $DIR/issue-98604.rs:5:17
|
LL | async fn test() {}
| ^ checked the `Output` of this `async fn`, found opaque type
diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.rs b/src/test/ui/type-alias-impl-trait/issue-98608.rs
index d75762a8b..1f89af045 100644
--- a/src/test/ui/type-alias-impl-trait/issue-98608.rs
+++ b/src/test/ui/type-alias-impl-trait/issue-98608.rs
@@ -1,8 +1,10 @@
-fn hi() -> impl Sized { std::ptr::null::<u8>() }
+fn hi() -> impl Sized {
+ std::ptr::null::<u8>()
+}
fn main() {
let b: Box<dyn Fn() -> Box<u8>> = Box::new(hi);
- //~^ ERROR type mismatch resolving `<fn() -> impl Sized {hi} as FnOnce<()>>::Output == Box<u8>`
+ //~^ ERROR expected `fn() -> impl Sized {hi}` to be a fn item that returns `Box<u8>`, but it returns `impl Sized`
let boxed = b();
let null = *boxed;
println!("{null:?}");
diff --git a/src/test/ui/type-alias-impl-trait/issue-98608.stderr b/src/test/ui/type-alias-impl-trait/issue-98608.stderr
index 8f3ec7d9d..916a58451 100644
--- a/src/test/ui/type-alias-impl-trait/issue-98608.stderr
+++ b/src/test/ui/type-alias-impl-trait/issue-98608.stderr
@@ -1,7 +1,7 @@
-error[E0271]: type mismatch resolving `<fn() -> impl Sized {hi} as FnOnce<()>>::Output == Box<u8>`
- --> $DIR/issue-98608.rs:4:39
+error[E0271]: expected `fn() -> impl Sized {hi}` to be a fn item that returns `Box<u8>`, but it returns `impl Sized`
+ --> $DIR/issue-98608.rs:6:39
|
-LL | fn hi() -> impl Sized { std::ptr::null::<u8>() }
+LL | fn hi() -> impl Sized {
| ---------- the found opaque type
...
LL | let b: Box<dyn Fn() -> Box<u8>> = Box::new(hi);
diff --git a/src/test/ui/type-alias-impl-trait/missing_lifetime_bound.rs b/src/test/ui/type-alias-impl-trait/missing_lifetime_bound.rs
new file mode 100644
index 000000000..428194058
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/missing_lifetime_bound.rs
@@ -0,0 +1,7 @@
+#![feature(type_alias_impl_trait)]
+
+type Opaque<'a, T> = impl Sized;
+fn defining<'a, T>(x: &'a i32) -> Opaque<T> { x }
+//~^ ERROR: non-defining opaque type use in defining scope
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/missing_lifetime_bound.stderr b/src/test/ui/type-alias-impl-trait/missing_lifetime_bound.stderr
new file mode 100644
index 000000000..df2b3ed19
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/missing_lifetime_bound.stderr
@@ -0,0 +1,8 @@
+error: non-defining opaque type use in defining scope
+ --> $DIR/missing_lifetime_bound.rs:4:47
+ |
+LL | fn defining<'a, T>(x: &'a i32) -> Opaque<T> { x }
+ | ^ lifetime `'a` is part of concrete type but not used in parameter list of the `impl Trait` type alias
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs
index 3f122f106..65eb2952e 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.rs
@@ -1,6 +1,10 @@
#![feature(type_alias_impl_trait)]
-type Foo<'a, 'b> = impl std::fmt::Debug;
+pub trait Captures<'a> {}
+
+impl<'a, T: ?Sized> Captures<'a> for T {}
+
+type Foo<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
fn foo<'x, 'y>(i: &'x i32, j: &'y i32) -> (Foo<'x, 'y>, Foo<'y, 'x>) {
(i, i) //~ ERROR concrete type differs from previous
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr
index 81e603e23..d7676b8e9 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-lifetimes.stderr
@@ -1,5 +1,5 @@
error: concrete type differs from previous defining opaque type use
- --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:6:5
+ --> $DIR/multiple-def-uses-in-one-fn-lifetimes.rs:10:5
|
LL | (i, i)
| ^^^^^^
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs
index 83fd9a1da..21fca047a 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn-pass.rs
@@ -7,7 +7,11 @@ fn f<A: ToString + Clone, B: ToString + Clone>(a: A, b: B) -> (X<A, B>, X<A, B>)
(a.clone(), a)
}
-type Foo<'a, 'b> = impl std::fmt::Debug;
+pub trait Captures<'a> {}
+
+impl<'a, T: ?Sized> Captures<'a> for T {}
+
+type Foo<'a, 'b> = impl std::fmt::Debug + Captures<'a> + Captures<'b>;
fn foo<'x, 'y>(i: &'x i32, j: &'y i32) -> (Foo<'x, 'y>, Foo<'y, 'x>) {
(i, j)
diff --git a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
index cdaae99e2..66a6b0bbf 100644
--- a/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
+++ b/src/test/ui/type-alias-impl-trait/multiple-def-uses-in-one-fn.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `&'static B: From<&A>` is not satisfied
LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
| ^^^^^^^^^^^^^^^^^^ the trait `From<&A>` is not implemented for `&'static B`
|
- = note: required because of the requirements on the impl of `Into<&'static B>` for `&A`
+ = note: required for `&A` to implement `Into<&'static B>`
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
|
LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) where &'static B: From<&A> {
diff --git a/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr
index a5ac38c38..b11198c58 100644
--- a/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr
+++ b/src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr
@@ -4,7 +4,7 @@ error[E0277]: `T` doesn't implement `Debug`
LL | (t, 5i8)
| ^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(T, i8)`
+ = note: required for `(T, i8)` to implement `Debug`
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
@@ -27,7 +27,7 @@ error[E0277]: `T` doesn't implement `Debug`
LL | (t, <U as Bar>::FOO)
| ^^^^^^^^^^^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
|
- = note: required because of the requirements on the impl of `Debug` for `(T, _)`
+ = note: required for `(T, _)` to implement `Debug`
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
diff --git a/src/test/ui/type-alias-impl-trait/unbounded_opaque_type.rs b/src/test/ui/type-alias-impl-trait/unbounded_opaque_type.rs
new file mode 100644
index 000000000..f43ad7dce
--- /dev/null
+++ b/src/test/ui/type-alias-impl-trait/unbounded_opaque_type.rs
@@ -0,0 +1,14 @@
+// check-pass
+
+#![feature(type_alias_impl_trait)]
+type Opaque<T> = impl Sized;
+fn defining<T>() -> Opaque<T> {}
+struct Ss<'a, T>(&'a Opaque<T>);
+
+
+fn test<'a, T>(_: Ss<'a, T>) {
+ // test that we have an implied bound `Opaque<T>: 'a` from fn signature
+ None::<&'a Opaque<T>>;
+}
+
+fn main() {}
diff --git a/src/test/ui/type-alias-impl-trait/underconstrained_generic.stderr b/src/test/ui/type-alias-impl-trait/underconstrained_generic.stderr
index e70916573..95fb6f6a5 100644
--- a/src/test/ui/type-alias-impl-trait/underconstrained_generic.stderr
+++ b/src/test/ui/type-alias-impl-trait/underconstrained_generic.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `T: Trait` is not satisfied
LL | ()
| ^^ the trait `Trait` is not implemented for `T`
|
-note: required because of the requirements on the impl of `ProofForConversion<T>` for `()`
+note: required for `()` to implement `ProofForConversion<T>`
--> $DIR/underconstrained_generic.rs:13:16
|
LL | impl<X: Trait> ProofForConversion<X> for () {
diff --git a/src/test/ui/type/issue-100584.rs b/src/test/ui/type/issue-100584.rs
new file mode 100644
index 000000000..102846563
--- /dev/null
+++ b/src/test/ui/type/issue-100584.rs
@@ -0,0 +1,15 @@
+#![deny(unused)]
+fn foo(xyza: &str) {
+//~^ ERROR unused variable: `xyza`
+ let _ = "{xyza}";
+}
+
+fn foo3(xyza: &str) {
+//~^ ERROR unused variable: `xyza`
+ let _ = "aaa{xyza}bbb";
+}
+
+fn main() {
+ foo("x");
+ foo3("xx");
+}
diff --git a/src/test/ui/type/issue-100584.stderr b/src/test/ui/type/issue-100584.stderr
new file mode 100644
index 000000000..e1db14d1f
--- /dev/null
+++ b/src/test/ui/type/issue-100584.stderr
@@ -0,0 +1,44 @@
+error: unused variable: `xyza`
+ --> $DIR/issue-100584.rs:2:8
+ |
+LL | fn foo(xyza: &str) {
+ | ^^^^ unused variable
+LL |
+LL | let _ = "{xyza}";
+ | -------- you might have meant to use string interpolation in this string literal
+ |
+note: the lint level is defined here
+ --> $DIR/issue-100584.rs:1:9
+ |
+LL | #![deny(unused)]
+ | ^^^^^^
+ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]`
+help: string interpolation only works in `format!` invocations
+ |
+LL | let _ = format!("{xyza}");
+ | ++++++++ +
+help: if this is intentional, prefix it with an underscore
+ |
+LL | fn foo(_xyza: &str) {
+ | ~~~~~
+
+error: unused variable: `xyza`
+ --> $DIR/issue-100584.rs:7:9
+ |
+LL | fn foo3(xyza: &str) {
+ | ^^^^ unused variable
+LL |
+LL | let _ = "aaa{xyza}bbb";
+ | -------------- you might have meant to use string interpolation in this string literal
+ |
+help: string interpolation only works in `format!` invocations
+ |
+LL | let _ = format!("aaa{xyza}bbb");
+ | ++++++++ +
+help: if this is intentional, prefix it with an underscore
+ |
+LL | fn foo3(_xyza: &str) {
+ | ~~~~~
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/type/issue-101866.rs b/src/test/ui/type/issue-101866.rs
new file mode 100644
index 000000000..d332c4adb
--- /dev/null
+++ b/src/test/ui/type/issue-101866.rs
@@ -0,0 +1,15 @@
+trait TraitA<T> {
+ fn func();
+}
+
+struct StructA {}
+
+impl TraitA<i32> for StructA {
+ fn func() {}
+}
+
+fn main() {
+ TraitA::<i32>::func();
+ //~^ ERROR: cannot call associated function on trait without specifying the corresponding `impl` type [E0790]
+ //~| help: use the fully-qualified path to the only available implementation
+}
diff --git a/src/test/ui/type/issue-101866.stderr b/src/test/ui/type/issue-101866.stderr
new file mode 100644
index 000000000..fe9982119
--- /dev/null
+++ b/src/test/ui/type/issue-101866.stderr
@@ -0,0 +1,18 @@
+error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
+ --> $DIR/issue-101866.rs:12:5
+ |
+LL | fn func();
+ | ---------- `TraitA::func` defined here
+...
+LL | TraitA::<i32>::func();
+ | ^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait
+ |
+help: use the fully-qualified path to the only available implementation
+ |
+LL - TraitA::<i32>::func();
+LL + <StructA as TraitA<i32>>::func();
+ |
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0790`.
diff --git a/src/test/ui/type/issue-94187-verbose-type-name.rs b/src/test/ui/type/issue-94187-verbose-type-name.rs
new file mode 100644
index 000000000..902ef5ade
--- /dev/null
+++ b/src/test/ui/type/issue-94187-verbose-type-name.rs
@@ -0,0 +1,13 @@
+// Check to insure that the output of `std::any::type_name` does not change based on -Zverbose
+// when printing constants
+// run-pass
+// edition: 2018
+// revisions: normal verbose
+// [verbose]compile-flags:-Zverbose
+
+struct Wrapper<const VALUE: usize>;
+
+fn main() {
+ assert_eq!(std::any::type_name::<[u32; 0]>(), "[u32; 0]");
+ assert_eq!(std::any::type_name::<Wrapper<0>>(), "issue_94187_verbose_type_name::Wrapper<0>");
+}
diff --git a/src/test/ui/type/type-alias-bounds.rs b/src/test/ui/type/type-alias-bounds.rs
index 65b79650d..e49731725 100644
--- a/src/test/ui/type/type-alias-bounds.rs
+++ b/src/test/ui/type/type-alias-bounds.rs
@@ -52,7 +52,7 @@ type T2<U> where U: Bound = U::Assoc; //~ WARN not enforced in type aliases
// Do this instead:
type T4<U> = <U as Bound>::Assoc;
-// Make sure the help about associatd types is not shown incorrectly
+// Make sure the help about associated types is not shown incorrectly
type T5<U: Bound> = <U as Bound>::Assoc; //~ WARN not enforced in type aliases
type T6<U: Bound> = ::std::vec::Vec<U>; //~ WARN not enforced in type aliases
diff --git a/src/test/ui/type/type-arg-out-of-scope.stderr b/src/test/ui/type/type-arg-out-of-scope.stderr
index 0b6283fbc..7f18b4510 100644
--- a/src/test/ui/type/type-arg-out-of-scope.stderr
+++ b/src/test/ui/type/type-arg-out-of-scope.stderr
@@ -4,9 +4,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn foo<T>(x: T) {
| - type parameter from outer function
LL | fn bar(f: Box<dyn FnMut(T) -> T>) { }
- | --- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `bar<T>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<T>`
error[E0401]: can't use generic parameters from outer function
--> $DIR/type-arg-out-of-scope.rs:3:35
@@ -14,9 +14,9 @@ error[E0401]: can't use generic parameters from outer function
LL | fn foo<T>(x: T) {
| - type parameter from outer function
LL | fn bar(f: Box<dyn FnMut(T) -> T>) { }
- | --- ^ use of generic parameter from outer function
- | |
- | help: try using a local generic parameter instead: `bar<T>`
+ | - ^ use of generic parameter from outer function
+ | |
+ | help: try using a local generic parameter instead: `<T>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/type/type-ascription-instead-of-initializer.stderr b/src/test/ui/type/type-ascription-instead-of-initializer.stderr
index fcac6c495..de578ca93 100644
--- a/src/test/ui/type/type-ascription-instead-of-initializer.stderr
+++ b/src/test/ui/type/type-ascription-instead-of-initializer.stderr
@@ -21,7 +21,7 @@ LL | pub fn with_capacity(capacity: usize) -> Self {
help: remove the extra argument
|
LL | let x: Vec::with_capacity(10);
- | ~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~
error: aborting due to 2 previous errors
diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr
index 56a9b5317..cf77c057d 100644
--- a/src/test/ui/type/type-check-defaults.stderr
+++ b/src/test/ui/type/type-check-defaults.stderr
@@ -1,8 +1,8 @@
error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
- --> $DIR/type-check-defaults.rs:6:19
+ --> $DIR/type-check-defaults.rs:6:23
|
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
- | ^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
+ | ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `FromIterator<i32>` is not implemented for `i32`
note: required by a bound in `Foo`
@@ -12,10 +12,10 @@ LL | struct Foo<T, U: FromIterator<T>>(T, U);
| ^^^^^^^^^^^^^^^ required by this bound in `Foo`
error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
- --> $DIR/type-check-defaults.rs:8:27
+ --> $DIR/type-check-defaults.rs:8:38
|
LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
+ | ^^^^^^^^^^^^^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `FromIterator<i32>` is not implemented for `i32`
note: required by a bound in `Foo`
diff --git a/src/test/ui/type/type-check/assignment-expected-bool.stderr b/src/test/ui/type/type-check/assignment-expected-bool.stderr
index e2b821f7b..56494baff 100644
--- a/src/test/ui/type/type-check/assignment-expected-bool.stderr
+++ b/src/test/ui/type/type-check/assignment-expected-bool.stderr
@@ -7,7 +7,7 @@ LL | let _: bool = 0 = 0;
help: you might have meant to compare for equality
|
LL | let _: bool = 0 == 0;
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:9:14
@@ -18,7 +18,7 @@ LL | 0 => 0 = 0,
help: you might have meant to compare for equality
|
LL | 0 => 0 == 0,
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:10:14
@@ -29,7 +29,7 @@ LL | _ => 0 = 0,
help: you might have meant to compare for equality
|
LL | _ => 0 == 0,
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:14:17
@@ -40,7 +40,7 @@ LL | true => 0 = 0,
help: you might have meant to compare for equality
|
LL | true => 0 == 0,
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:18:8
@@ -51,7 +51,7 @@ LL | if 0 = 0 {}
help: you might have meant to compare for equality
|
LL | if 0 == 0 {}
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:20:24
@@ -62,7 +62,7 @@ LL | let _: bool = if { 0 = 0 } {
help: you might have meant to compare for equality
|
LL | let _: bool = if { 0 == 0 } {
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:21:9
@@ -73,7 +73,7 @@ LL | 0 = 0
help: you might have meant to compare for equality
|
LL | 0 == 0
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:23:9
@@ -84,7 +84,7 @@ LL | 0 = 0
help: you might have meant to compare for equality
|
LL | 0 == 0
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:26:13
@@ -95,7 +95,7 @@ LL | let _ = (0 = 0)
help: you might have meant to compare for equality
|
LL | let _ = (0 == 0)
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:27:14
@@ -106,7 +106,7 @@ LL | && { 0 = 0 }
help: you might have meant to compare for equality
|
LL | && { 0 == 0 }
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:28:12
@@ -117,7 +117,7 @@ LL | || (0 = 0);
help: you might have meant to compare for equality
|
LL | || (0 == 0);
- | ~~
+ | +
error[E0070]: invalid left-hand side of assignment
--> $DIR/assignment-expected-bool.rs:31:22
diff --git a/src/test/ui/type/type-check/assignment-in-if.rs b/src/test/ui/type/type-check/assignment-in-if.rs
index 8da7b32b4..ada250df2 100644
--- a/src/test/ui/type/type-check/assignment-in-if.rs
+++ b/src/test/ui/type/type-check/assignment-in-if.rs
@@ -40,4 +40,23 @@ fn main() {
) {
println!("{}", x);
}
+
+ if x == x && x = x && x == x {
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+ //~| ERROR mismatched types
+ println!("{}", x);
+ }
+
+ if x == x && x == x && x = x {
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+ println!("{}", x);
+ }
+
+ if x = 1 && x == 1 {
+ //~^ ERROR mismatched types
+ //~| ERROR mismatched types
+ println!("{}", x);
+ }
}
diff --git a/src/test/ui/type/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr
index f4ef44e24..8ab08e25e 100644
--- a/src/test/ui/type/type-check/assignment-in-if.stderr
+++ b/src/test/ui/type/type-check/assignment-in-if.stderr
@@ -7,7 +7,7 @@ LL | if x = x {
help: you might have meant to compare for equality
|
LL | if x == x {
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:20:8
@@ -18,7 +18,7 @@ LL | if (x = x) {
help: you might have meant to compare for equality
|
LL | if (x == x) {
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:25:8
@@ -29,7 +29,7 @@ LL | if y = (Foo { foo: x }) {
help: you might have meant to compare for equality
|
LL | if y == (Foo { foo: x }) {
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:30:8
@@ -40,7 +40,7 @@ LL | if 3 = x {
help: you might have meant to compare for equality
|
LL | if 3 == x {
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:36:13
@@ -51,7 +51,7 @@ LL | x = 4
help: you might have meant to compare for equality
|
LL | x == 4
- | ~~
+ | +
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:38:13
@@ -62,8 +62,65 @@ LL | x = 5
help: you might have meant to compare for equality
|
LL | x == 5
- | ~~
+ | +
-error: aborting due to 6 previous errors
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:44:18
+ |
+LL | if x == x && x = x && x == x {
+ | ^ expected `bool`, found `usize`
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:44:22
+ |
+LL | if x == x && x = x && x == x {
+ | ^ expected `bool`, found `usize`
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:44:8
+ |
+LL | if x == x && x = x && x == x {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: you might have meant to compare for equality
+ |
+LL | if x == x && x == x && x == x {
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:51:28
+ |
+LL | if x == x && x == x && x = x {
+ | ^ expected `bool`, found `usize`
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:51:8
+ |
+LL | if x == x && x == x && x = x {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: you might have meant to compare for equality
+ |
+LL | if x == x && x == x && x == x {
+ | +
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:57:12
+ |
+LL | if x = 1 && x == 1 {
+ | ^ expected `bool`, found integer
+
+error[E0308]: mismatched types
+ --> $DIR/assignment-in-if.rs:57:8
+ |
+LL | if x = 1 && x == 1 {
+ | ^^^^^^^^^^^^^^^ expected `bool`, found `()`
+ |
+help: you might have meant to compare for equality
+ |
+LL | if x == 1 && x == 1 {
+ | +
+
+error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr b/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr
index 615fd2ccb..847bc517e 100644
--- a/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr
+++ b/src/test/ui/type/type-check/issue-88577-check-fn-with-more-than-65535-arguments.stderr
@@ -1,13 +1,13 @@
error: function can not have more than 65535 arguments
- --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:24
+ --> $DIR/issue-88577-check-fn-with-more-than-65535-arguments.rs:6:22
|
-LL | fn _f($($t: ()),*) {}
- | ________________________^
-LL | | }
-LL | | }
-LL | |
-LL | | many_args!{[_]########## ######}
- | |____________^
+LL | fn _f($($t: ()),*) {}
+ | ^
+...
+LL | many_args!{[_]########## ######}
+ | -------------------------------- in this macro invocation
+ |
+ = note: this error originates in the macro `many_args` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
diff --git a/src/test/ui/type/type-mismatch-same-crate-name.stderr b/src/test/ui/type/type-mismatch-same-crate-name.stderr
index 783f747fa..fcafd315e 100644
--- a/src/test/ui/type/type-mismatch-same-crate-name.stderr
+++ b/src/test/ui/type/type-mismatch-same-crate-name.stderr
@@ -6,6 +6,17 @@ LL | a::try_foo(foo2);
| |
| arguments to this function are incorrect
|
+ = note: struct `main::a::Foo` and struct `main::a::Foo` have similar names, but are actually distinct types
+note: struct `main::a::Foo` is defined in crate `crate_a2`
+ --> $DIR/auxiliary/crate_a2.rs:1:1
+ |
+LL | pub struct Foo;
+ | ^^^^^^^^^^^^^^
+note: struct `main::a::Foo` is defined in crate `crate_a1`
+ --> $DIR/auxiliary/crate_a1.rs:1:1
+ |
+LL | pub struct Foo;
+ | ^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `crate_a1` are being used?
note: function defined here
--> $DIR/auxiliary/crate_a1.rs:10:8
diff --git a/src/test/ui/type/type-params-in-different-spaces-2.stderr b/src/test/ui/type/type-params-in-different-spaces-2.stderr
index 53610985f..220b3929c 100644
--- a/src/test/ui/type/type-params-in-different-spaces-2.stderr
+++ b/src/test/ui/type/type-params-in-different-spaces-2.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `Self: Tr<U>` is not satisfied
- --> $DIR/type-params-in-different-spaces-2.rs:10:9
+ --> $DIR/type-params-in-different-spaces-2.rs:10:16
|
LL | Tr::op(u)
- | ^^^^^^ the trait `Tr<U>` is not implemented for `Self`
+ | ------ ^ the trait `Tr<U>` is not implemented for `Self`
+ | |
+ | required by a bound introduced by this call
|
help: consider further restricting `Self`
|
@@ -10,10 +12,12 @@ LL | fn test<U>(u: U) -> Self where Self: Tr<U> {
| +++++++++++++++++
error[E0277]: the trait bound `Self: Tr<U>` is not satisfied
- --> $DIR/type-params-in-different-spaces-2.rs:16:9
+ --> $DIR/type-params-in-different-spaces-2.rs:16:16
|
LL | Tr::op(u)
- | ^^^^^^ the trait `Tr<U>` is not implemented for `Self`
+ | ------ ^ the trait `Tr<U>` is not implemented for `Self`
+ | |
+ | required by a bound introduced by this call
|
help: consider further restricting `Self`
|
diff --git a/src/test/ui/type/type-recursive-box-shadowed.stderr b/src/test/ui/type/type-recursive-box-shadowed.stderr
index c22d848f3..cb0e98287 100644
--- a/src/test/ui/type/type-recursive-box-shadowed.stderr
+++ b/src/test/ui/type/type-recursive-box-shadowed.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `Foo` has infinite size
--> $DIR/type-recursive-box-shadowed.rs:7:1
|
LL | struct Foo {
- | ^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^
LL |
LL | inner: Foo,
| --- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | inner: Box<Foo>,
| ++++ +
diff --git a/src/test/ui/type/type-recursive.stderr b/src/test/ui/type/type-recursive.stderr
index 320271028..9a4d798f6 100644
--- a/src/test/ui/type/type-recursive.stderr
+++ b/src/test/ui/type/type-recursive.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `T1` has infinite size
--> $DIR/type-recursive.rs:1:1
|
LL | struct T1 {
- | ^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^
LL | foo: isize,
LL | foolish: T1,
| -- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T1` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | foolish: Box<T1>,
| ++++ +
@@ -16,11 +16,11 @@ error[E0072]: recursive type `T2` has infinite size
--> $DIR/type-recursive.rs:6:1
|
LL | struct T2 {
- | ^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^
LL | inner: Option<T2>,
- | ---------- recursive without indirection
+ | -- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T2` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | inner: Option<Box<T2>>,
| ++++ +
@@ -29,11 +29,11 @@ error[E0072]: recursive type `T3` has infinite size
--> $DIR/type-recursive.rs:12:1
|
LL | struct T3 {
- | ^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^
LL | inner: OptionT3,
| -------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T3` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | inner: Box<OptionT3>,
| ++++ +
@@ -42,11 +42,9 @@ error[E0072]: recursive type `T4` has infinite size
--> $DIR/type-recursive.rs:16:1
|
LL | struct T4(Option<T4>);
- | ^^^^^^^^^ ---------- recursive without indirection
- | |
- | recursive type has infinite size
+ | ^^^^^^^^^ -- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T4` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | struct T4(Option<Box<T4>>);
| ++++ +
@@ -55,11 +53,11 @@ error[E0072]: recursive type `T5` has infinite size
--> $DIR/type-recursive.rs:18:1
|
LL | enum T5 {
- | ^^^^^^^ recursive type has infinite size
+ | ^^^^^^^
LL | Variant(Option<T5>),
- | ---------- recursive without indirection
+ | -- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T5` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | Variant(Option<Box<T5>>),
| ++++ +
@@ -68,11 +66,11 @@ error[E0072]: recursive type `T6` has infinite size
--> $DIR/type-recursive.rs:22:1
|
LL | enum T6 {
- | ^^^^^^^ recursive type has infinite size
+ | ^^^^^^^
LL | Variant{ field: Option<T6> },
- | ---------- recursive without indirection
+ | -- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T6` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | Variant{ field: Option<Box<T6>> },
| ++++ +
@@ -81,14 +79,14 @@ error[E0072]: recursive type `T7` has infinite size
--> $DIR/type-recursive.rs:26:1
|
LL | struct T7 {
- | ^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^
LL | foo: std::cell::Cell<Option<T7>>,
- | --------------------------- recursive without indirection
+ | -- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T7` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | foo: Box<std::cell::Cell<Option<T7>>>,
- | ++++ +
+LL | foo: std::cell::Cell<Option<Box<T7>>>,
+ | ++++ +
error: aborting due to 7 previous errors
diff --git a/src/test/ui/type_length_limit.stderr b/src/test/ui/type_length_limit.stderr
index 1508b84c1..84ac48b1e 100644
--- a/src/test/ui/type_length_limit.stderr
+++ b/src/test/ui/type_length_limit.stderr
@@ -4,8 +4,8 @@ error: reached the type-length limit while instantiating `std::mem::drop::<Optio
LL | pub fn drop<T>(_x: T) {}
| ^^^^^^^^^^^^^^^^^^^^^
|
- = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt'
= help: consider adding a `#![type_length_limit="8"]` attribute to your crate
+ = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt'
error: reached the type-length limit while instantiating `<[closure@std::rt::lang_start<()...e<()>>::call_once - shim(vtable)`
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
@@ -13,8 +13,8 @@ error: reached the type-length limit while instantiating `<[closure@std::rt::lan
LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt'
= help: consider adding a `#![type_length_limit="8"]` attribute to your crate
+ = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit/type_length_limit.long-type.txt'
error: aborting due to 2 previous errors
diff --git a/src/test/ui/typeck/assign-non-lval-derefmut.stderr b/src/test/ui/typeck/assign-non-lval-derefmut.stderr
index a6fcdfe21..e394cf820 100644
--- a/src/test/ui/typeck/assign-non-lval-derefmut.stderr
+++ b/src/test/ui/typeck/assign-non-lval-derefmut.stderr
@@ -19,7 +19,7 @@ LL | x.lock().unwrap() += 1;
| |
| cannot use `+=` on type `MutexGuard<'_, usize>`
|
-help: `+=` can be used on `usize`, you can dereference `x.lock().unwrap()`
+help: `+=` can be used on `usize` if you dereference the left-hand side
|
LL | *x.lock().unwrap() += 1;
| +
@@ -47,7 +47,7 @@ LL | y += 1;
| |
| cannot use `+=` on type `MutexGuard<'_, usize>`
|
-help: `+=` can be used on `usize`, you can dereference `y`
+help: `+=` can be used on `usize` if you dereference the left-hand side
|
LL | *y += 1;
| +
diff --git a/src/test/ui/typeck/assign-non-lval-mut-ref.stderr b/src/test/ui/typeck/assign-non-lval-mut-ref.stderr
index be2e9fe95..cbdc960ba 100644
--- a/src/test/ui/typeck/assign-non-lval-mut-ref.stderr
+++ b/src/test/ui/typeck/assign-non-lval-mut-ref.stderr
@@ -19,7 +19,7 @@ LL | x.last_mut().unwrap() += 1;
| |
| cannot use `+=` on type `&mut usize`
|
-help: `+=` can be used on `usize`, you can dereference `x.last_mut().unwrap()`
+help: `+=` can be used on `usize` if you dereference the left-hand side
|
LL | *x.last_mut().unwrap() += 1;
| +
@@ -45,7 +45,7 @@ LL | y += 1;
| |
| cannot use `+=` on type `&mut usize`
|
-help: `+=` can be used on `usize`, you can dereference `y`
+help: `+=` can be used on `usize` if you dereference the left-hand side
|
LL | *y += 1;
| +
diff --git a/src/test/ui/typeck/assign-non-lval-needs-deref.rs b/src/test/ui/typeck/assign-non-lval-needs-deref.rs
new file mode 100644
index 000000000..c979d76b4
--- /dev/null
+++ b/src/test/ui/typeck/assign-non-lval-needs-deref.rs
@@ -0,0 +1,19 @@
+// issue #101376
+
+use std::ops::AddAssign;
+struct Foo;
+
+impl AddAssign<()> for Foo {
+ fn add_assign(&mut self, _: ()) {}
+}
+
+impl AddAssign<()> for &mut Foo {
+ fn add_assign(&mut self, _: ()) {}
+}
+
+fn main() {
+ (&mut Foo) += ();
+ //~^ ERROR invalid left-hand side of assignment
+ //~| NOTE cannot assign to this expression
+ //~| HELP consider dereferencing the left-hand side of this operation
+}
diff --git a/src/test/ui/typeck/assign-non-lval-needs-deref.stderr b/src/test/ui/typeck/assign-non-lval-needs-deref.stderr
new file mode 100644
index 000000000..ee83b1453
--- /dev/null
+++ b/src/test/ui/typeck/assign-non-lval-needs-deref.stderr
@@ -0,0 +1,16 @@
+error[E0067]: invalid left-hand side of assignment
+ --> $DIR/assign-non-lval-needs-deref.rs:15:16
+ |
+LL | (&mut Foo) += ();
+ | ---------- ^^
+ | |
+ | cannot assign to this expression
+ |
+help: consider dereferencing the left-hand side of this operation
+ |
+LL | *(&mut Foo) += ();
+ | +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0067`.
diff --git a/src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.rs b/src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.rs
new file mode 100644
index 000000000..97e0b213f
--- /dev/null
+++ b/src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.rs
@@ -0,0 +1,8 @@
+trait Foo {
+ const A; //~ ERROR missing type for `const` item
+ static B;
+ //~^ ERROR associated `static` items are not allowed
+ //~| ERROR missing type for `static` item
+}
+
+fn main() {}
diff --git a/src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.stderr b/src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.stderr
new file mode 100644
index 000000000..8982d6285
--- /dev/null
+++ b/src/test/ui/typeck/do-not-suggest-placeholder-to-const-static-without-type.stderr
@@ -0,0 +1,20 @@
+error: associated `static` items are not allowed
+ --> $DIR/do-not-suggest-placeholder-to-const-static-without-type.rs:3:5
+ |
+LL | static B;
+ | ^^^^^^^^^
+
+error: missing type for `const` item
+ --> $DIR/do-not-suggest-placeholder-to-const-static-without-type.rs:2:12
+ |
+LL | const A;
+ | ^ help: provide a type for the item: `: <type>`
+
+error: missing type for `static` item
+ --> $DIR/do-not-suggest-placeholder-to-const-static-without-type.rs:3:13
+ |
+LL | static B;
+ | ^ help: provide a type for the item: `: <type>`
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/typeck/issue-100164.fixed b/src/test/ui/typeck/issue-100164.fixed
new file mode 100644
index 000000000..a5f68beb1
--- /dev/null
+++ b/src/test/ui/typeck/issue-100164.fixed
@@ -0,0 +1,9 @@
+// run-rustfix
+
+const _A: i32 = 123;
+//~^ ERROR: missing type for `const` item
+
+fn main() {
+ const _B: i32 = 123;
+ //~^ ERROR: missing type for `const` item
+}
diff --git a/src/test/ui/typeck/issue-100164.rs b/src/test/ui/typeck/issue-100164.rs
new file mode 100644
index 000000000..7efb9ac62
--- /dev/null
+++ b/src/test/ui/typeck/issue-100164.rs
@@ -0,0 +1,9 @@
+// run-rustfix
+
+const _A: = 123;
+//~^ ERROR: missing type for `const` item
+
+fn main() {
+ const _B: = 123;
+ //~^ ERROR: missing type for `const` item
+}
diff --git a/src/test/ui/typeck/issue-100164.stderr b/src/test/ui/typeck/issue-100164.stderr
new file mode 100644
index 000000000..06a132d65
--- /dev/null
+++ b/src/test/ui/typeck/issue-100164.stderr
@@ -0,0 +1,14 @@
+error: missing type for `const` item
+ --> $DIR/issue-100164.rs:3:10
+ |
+LL | const _A: = 123;
+ | ^ help: provide a type for the constant: `i32`
+
+error: missing type for `const` item
+ --> $DIR/issue-100164.rs:7:14
+ |
+LL | const _B: = 123;
+ | ^ help: provide a type for the constant: `i32`
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/typeck/issue-100246.rs b/src/test/ui/typeck/issue-100246.rs
new file mode 100644
index 000000000..8f0b34bab
--- /dev/null
+++ b/src/test/ui/typeck/issue-100246.rs
@@ -0,0 +1,30 @@
+#![recursion_limit = "5"] // To reduce noise
+
+//expect incompatible type error when ambiguous traits are in scope
+//and not an overflow error on the span in the main function.
+
+struct Ratio<T>(T);
+
+pub trait Pow {
+ fn pow(self) -> Self;
+}
+
+impl<'a, T> Pow for &'a Ratio<T>
+where
+ &'a T: Pow,
+{
+ fn pow(self) -> Self {
+ self
+ }
+}
+
+fn downcast<'a, W: ?Sized>() -> std::io::Result<&'a W> {
+ todo!()
+}
+
+struct Other;
+
+fn main() -> std::io::Result<()> {
+ let other: Other = downcast()?;//~ERROR 28:24: 28:35: `?` operator has incompatible types
+ Ok(())
+}
diff --git a/src/test/ui/typeck/issue-100246.stderr b/src/test/ui/typeck/issue-100246.stderr
new file mode 100644
index 000000000..8b77de94e
--- /dev/null
+++ b/src/test/ui/typeck/issue-100246.stderr
@@ -0,0 +1,13 @@
+error[E0308]: `?` operator has incompatible types
+ --> $DIR/issue-100246.rs:28:24
+ |
+LL | let other: Other = downcast()?;
+ | ^^^^^^^^^^^ expected struct `Other`, found reference
+ |
+ = note: `?` operator cannot convert from `&_` to `Other`
+ = note: expected struct `Other`
+ found reference `&_`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/typeck/issue-100285.rs b/src/test/ui/typeck/issue-100285.rs
new file mode 100644
index 000000000..e206469b8
--- /dev/null
+++ b/src/test/ui/typeck/issue-100285.rs
@@ -0,0 +1,22 @@
+fn foo(n: i32) -> i32 {
+ for i in 0..0 {
+ //~^ ERROR: mismatched types [E0308]
+ if n < 0 {
+ return i;
+ } else if n < 10 {
+ return 1;
+ } else if n < 20 {
+ return 2;
+ } else if n < 30 {
+ return 3;
+ } else if n < 40 {
+ return 4;
+ } else {
+ return 5;
+ }
+
+ }
+ //~| help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
+}
+
+fn main() {}
diff --git a/src/test/ui/typeck/issue-100285.stderr b/src/test/ui/typeck/issue-100285.stderr
new file mode 100644
index 000000000..42c64b039
--- /dev/null
+++ b/src/test/ui/typeck/issue-100285.stderr
@@ -0,0 +1,34 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-100285.rs:2:5
+ |
+LL | fn foo(n: i32) -> i32 {
+ | --- expected `i32` because of return type
+LL | / for i in 0..0 {
+LL | |
+LL | | if n < 0 {
+LL | | return i;
+... |
+LL | |
+LL | | }
+ | |_____^ expected `i32`, found `()`
+ |
+note: the function expects a value to always be returned, but loops might run zero times
+ --> $DIR/issue-100285.rs:2:5
+ |
+LL | for i in 0..0 {
+ | ^^^^^^^^^^^^^ this might have zero elements to iterate on
+...
+LL | return i;
+ | -------- if the loop doesn't execute, this value would never get returned
+LL | } else if n < 10 {
+LL | return 1;
+ | -------- if the loop doesn't execute, this value would never get returned
+LL | } else if n < 20 {
+LL | return 2;
+ | -------- if the loop doesn't execute, this value would never get returned
+ = note: if the loop doesn't execute, 3 other values would never get returned
+ = help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/typeck/issue-29124.stderr b/src/test/ui/typeck/issue-29124.stderr
index c5d2ec084..a837a7d2d 100644
--- a/src/test/ui/typeck/issue-29124.stderr
+++ b/src/test/ui/typeck/issue-29124.stderr
@@ -2,17 +2,13 @@ error[E0599]: no method named `x` found for fn item `fn() -> Ret {Obj::func}` in
--> $DIR/issue-29124.rs:15:15
|
LL | Obj::func.x();
- | --------- ^ method not found in `fn() -> Ret {Obj::func}`
- | |
- | this is a function, perhaps you wish to call it
+ | ^ method not found in `fn() -> Ret {Obj::func}`
error[E0599]: no method named `x` found for fn item `fn() -> Ret {func}` in the current scope
--> $DIR/issue-29124.rs:17:10
|
LL | func.x();
- | ---- ^ method not found in `fn() -> Ret {func}`
- | |
- | this is a function, perhaps you wish to call it
+ | ^ method not found in `fn() -> Ret {func}`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/typeck/issue-69378-ice-on-invalid-type-node-after-recovery.stderr b/src/test/ui/typeck/issue-69378-ice-on-invalid-type-node-after-recovery.stderr
index 6bc9c8498..fc7c23a22 100644
--- a/src/test/ui/typeck/issue-69378-ice-on-invalid-type-node-after-recovery.stderr
+++ b/src/test/ui/typeck/issue-69378-ice-on-invalid-type-node-after-recovery.stderr
@@ -2,7 +2,9 @@ error: expected identifier, found `0`
--> $DIR/issue-69378-ice-on-invalid-type-node-after-recovery.rs:3:14
|
LL | struct Foo { 0: u8 }
- | ^ expected identifier
+ | --- ^ expected identifier
+ | |
+ | while parsing this struct
error: aborting due to previous error
diff --git a/src/test/ui/typeck/issue-79040.stderr b/src/test/ui/typeck/issue-79040.stderr
index aec2e1ec9..c820d1e08 100644
--- a/src/test/ui/typeck/issue-79040.stderr
+++ b/src/test/ui/typeck/issue-79040.stderr
@@ -7,10 +7,10 @@ LL | const FOO = "hello" + 1;
| &str
error: missing type for `const` item
- --> $DIR/issue-79040.rs:2:11
+ --> $DIR/issue-79040.rs:2:14
|
LL | const FOO = "hello" + 1;
- | ^^^ help: provide a type for the item: `FOO: <type>`
+ | ^ help: provide a type for the item: `: <type>`
error: aborting due to 2 previous errors
diff --git a/src/test/ui/typeck/issue-87181/empty-tuple-method.rs b/src/test/ui/typeck/issue-87181/empty-tuple-method.rs
index 1875d8280..be68ad32a 100644
--- a/src/test/ui/typeck/issue-87181/empty-tuple-method.rs
+++ b/src/test/ui/typeck/issue-87181/empty-tuple-method.rs
@@ -4,7 +4,7 @@ struct Bar<T> {
struct Foo();
impl Foo {
- fn foo() { }
+ fn foo(&self) { }
}
fn main() {
diff --git a/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr b/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr
index 6ed70b301..23e7b7cc3 100644
--- a/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr
+++ b/src/test/ui/typeck/issue-87181/empty-tuple-method.stderr
@@ -2,11 +2,9 @@ error[E0599]: no method named `foo` found for fn item `fn() -> Foo {Foo}` in the
--> $DIR/empty-tuple-method.rs:12:15
|
LL | thing.bar.foo();
- | --------- ^^^ method not found in `fn() -> Foo {Foo}`
- | |
- | this is the constructor of a struct
+ | ^^^ method not found in `fn() -> Foo {Foo}`
|
-help: call the constructor
+help: use parentheses to construct this tuple struct
|
LL | (thing.bar)().foo();
| + +++
diff --git a/src/test/ui/typeck/issue-87181/enum-variant.rs b/src/test/ui/typeck/issue-87181/enum-variant.rs
index 3b926b90f..d87f99c3c 100644
--- a/src/test/ui/typeck/issue-87181/enum-variant.rs
+++ b/src/test/ui/typeck/issue-87181/enum-variant.rs
@@ -6,7 +6,7 @@ enum Foo{
Tup()
}
impl Foo {
- fn foo() { }
+ fn foo(&self) { }
}
fn main() {
diff --git a/src/test/ui/typeck/issue-87181/enum-variant.stderr b/src/test/ui/typeck/issue-87181/enum-variant.stderr
index a3a818696..2247ea270 100644
--- a/src/test/ui/typeck/issue-87181/enum-variant.stderr
+++ b/src/test/ui/typeck/issue-87181/enum-variant.stderr
@@ -2,11 +2,9 @@ error[E0599]: no method named `foo` found for fn item `fn() -> Foo {Foo::Tup}` i
--> $DIR/enum-variant.rs:14:15
|
LL | thing.bar.foo();
- | --------- ^^^ method not found in `fn() -> Foo {Foo::Tup}`
- | |
- | this is the constructor of an enum variant
+ | ^^^ method not found in `fn() -> Foo {Foo::Tup}`
|
-help: call the constructor
+help: use parentheses to construct this tuple variant
|
LL | (thing.bar)().foo();
| + +++
diff --git a/src/test/ui/typeck/issue-87181/tuple-field.stderr b/src/test/ui/typeck/issue-87181/tuple-field.stderr
index 4d22ada02..0a7d30b61 100644
--- a/src/test/ui/typeck/issue-87181/tuple-field.stderr
+++ b/src/test/ui/typeck/issue-87181/tuple-field.stderr
@@ -2,14 +2,12 @@ error[E0609]: no field `0` on type `fn(char, u16) -> Foo {Foo}`
--> $DIR/tuple-field.rs:12:15
|
LL | thing.bar.0;
- | --------- ^
- | |
- | this is the constructor of a struct
+ | ^
|
-help: call the constructor
+help: use parentheses to construct this tuple struct
|
-LL | (thing.bar)(_, _).0;
- | + +++++++
+LL | (thing.bar)(/* char */, /* u16 */).0;
+ | + ++++++++++++++++++++++++
error: aborting due to previous error
diff --git a/src/test/ui/typeck/issue-87181/tuple-method.stderr b/src/test/ui/typeck/issue-87181/tuple-method.stderr
index 1e392e179..e27c41858 100644
--- a/src/test/ui/typeck/issue-87181/tuple-method.stderr
+++ b/src/test/ui/typeck/issue-87181/tuple-method.stderr
@@ -2,14 +2,7 @@ error[E0599]: no method named `foo` found for fn item `fn(u8, i32) -> Foo {Foo}`
--> $DIR/tuple-method.rs:12:15
|
LL | thing.bar.foo();
- | --------- ^^^ method not found in `fn(u8, i32) -> Foo {Foo}`
- | |
- | this is the constructor of a struct
- |
-help: call the constructor
- |
-LL | (thing.bar)(_, _).foo();
- | + +++++++
+ | ^^^ method not found in `fn(u8, i32) -> Foo {Foo}`
error: aborting due to previous error
diff --git a/src/test/ui/typeck/issue-90101.stderr b/src/test/ui/typeck/issue-90101.stderr
index ab9a72edf..d2729d853 100644
--- a/src/test/ui/typeck/issue-90101.stderr
+++ b/src/test/ui/typeck/issue-90101.stderr
@@ -12,7 +12,7 @@ LL | func(Path::new("hello").to_path_buf().to_string_lossy(), "world")
<PathBuf as From<Cow<'a, Path>>>
<PathBuf as From<OsString>>
<PathBuf as From<String>>
- = note: required because of the requirements on the impl of `Into<PathBuf>` for `Cow<'_, str>`
+ = note: required for `Cow<'_, str>` to implement `Into<PathBuf>`
note: required by a bound in `func`
--> $DIR/issue-90101.rs:3:20
|
diff --git a/src/test/ui/typeck/issue-91210-ptr-method.stderr b/src/test/ui/typeck/issue-91210-ptr-method.stderr
index 503a32373..7a0cfb2cf 100644
--- a/src/test/ui/typeck/issue-91210-ptr-method.stderr
+++ b/src/test/ui/typeck/issue-91210-ptr-method.stderr
@@ -2,9 +2,12 @@ error[E0615]: attempted to take value of method `read` on type `*mut Foo`
--> $DIR/issue-91210-ptr-method.rs:10:7
|
LL | x.read = 4;
- | - ^^^^ method, not a field
- | |
- | help: to access the field, dereference first: `(*x)`
+ | ^^^^ method, not a field
+ |
+help: to access the field, dereference first
+ |
+LL | (*x).read = 4;
+ | ++ +
error: aborting due to previous error
diff --git a/src/test/ui/typeck/issue-91633.rs b/src/test/ui/typeck/issue-91633.rs
new file mode 100644
index 000000000..331a798dd
--- /dev/null
+++ b/src/test/ui/typeck/issue-91633.rs
@@ -0,0 +1,8 @@
+// check-pass
+fn f<T> (it: &[T])
+where
+ [T] : std::ops::Index<usize>,
+{
+ let _ = &it[0];
+}
+fn main(){}
diff --git a/src/test/ui/typeck/issue-96738.stderr b/src/test/ui/typeck/issue-96738.stderr
index 32f538498..0d4d87ef4 100644
--- a/src/test/ui/typeck/issue-96738.stderr
+++ b/src/test/ui/typeck/issue-96738.stderr
@@ -2,27 +2,13 @@ error[E0599]: no method named `nonexistent_method` found for fn item `fn(_) -> O
--> $DIR/issue-96738.rs:2:10
|
LL | Some.nonexistent_method();
- | ---- ^^^^^^^^^^^^^^^^^^ method not found in `fn(_) -> Option<_> {Option::<_>::Some}`
- | |
- | this is the constructor of an enum variant
- |
-help: call the constructor
- |
-LL | (Some)(_).nonexistent_method();
- | + ++++
+ | ^^^^^^^^^^^^^^^^^^ method not found in `fn(_) -> Option<_> {Option::<_>::Some}`
error[E0609]: no field `nonexistent_field` on type `fn(_) -> Option<_> {Option::<_>::Some}`
--> $DIR/issue-96738.rs:3:10
|
LL | Some.nonexistent_field;
- | ---- ^^^^^^^^^^^^^^^^^
- | |
- | this is the constructor of an enum variant
- |
-help: call the constructor
- |
-LL | (Some)(_).nonexistent_field;
- | + ++++
+ | ^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
diff --git a/src/test/ui/typeck/issue-98982.rs b/src/test/ui/typeck/issue-98982.rs
new file mode 100644
index 000000000..2553824bb
--- /dev/null
+++ b/src/test/ui/typeck/issue-98982.rs
@@ -0,0 +1,9 @@
+fn foo() -> i32 {
+ for i in 0..0 {
+ //~^ ERROR: mismatched types [E0308]
+ return i;
+ }
+ //~| help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
+}
+
+fn main() {}
diff --git a/src/test/ui/typeck/issue-98982.stderr b/src/test/ui/typeck/issue-98982.stderr
new file mode 100644
index 000000000..3c9806ac9
--- /dev/null
+++ b/src/test/ui/typeck/issue-98982.stderr
@@ -0,0 +1,24 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-98982.rs:2:5
+ |
+LL | fn foo() -> i32 {
+ | --- expected `i32` because of return type
+LL | / for i in 0..0 {
+LL | |
+LL | | return i;
+LL | | }
+ | |_____^ expected `i32`, found `()`
+ |
+note: the function expects a value to always be returned, but loops might run zero times
+ --> $DIR/issue-98982.rs:2:5
+ |
+LL | for i in 0..0 {
+ | ^^^^^^^^^^^^^ this might have zero elements to iterate on
+LL |
+LL | return i;
+ | -------- if the loop doesn't execute, this value would never get returned
+ = help: return a value for the case when the loop has zero elements to iterate on, or consider changing the return type to account for that possibility
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/typeck/point-at-type-param-in-path-expr.rs b/src/test/ui/typeck/point-at-type-param-in-path-expr.rs
new file mode 100644
index 000000000..9a21536f9
--- /dev/null
+++ b/src/test/ui/typeck/point-at-type-param-in-path-expr.rs
@@ -0,0 +1,6 @@
+fn foo<T: std::fmt::Display>() {}
+
+fn main() {
+ let x = foo::<()>;
+ //~^ ERROR `()` doesn't implement `std::fmt::Display`
+}
diff --git a/src/test/ui/typeck/point-at-type-param-in-path-expr.stderr b/src/test/ui/typeck/point-at-type-param-in-path-expr.stderr
new file mode 100644
index 000000000..1feaa0508
--- /dev/null
+++ b/src/test/ui/typeck/point-at-type-param-in-path-expr.stderr
@@ -0,0 +1,17 @@
+error[E0277]: `()` doesn't implement `std::fmt::Display`
+ --> $DIR/point-at-type-param-in-path-expr.rs:4:19
+ |
+LL | let x = foo::<()>;
+ | ^^ `()` 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`
+ --> $DIR/point-at-type-param-in-path-expr.rs:1:11
+ |
+LL | fn foo<T: std::fmt::Display>() {}
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/typeck/remove-extra-argument.stderr b/src/test/ui/typeck/remove-extra-argument.stderr
index 703032a83..b734bcd4e 100644
--- a/src/test/ui/typeck/remove-extra-argument.stderr
+++ b/src/test/ui/typeck/remove-extra-argument.stderr
@@ -12,7 +12,7 @@ LL | fn l(_a: Vec<u8>) {}
help: remove the extra argument
|
LL | l(vec![])
- |
+ | ~~~~~~~~
error: aborting due to previous error
diff --git a/src/test/ui/typeck/slow-lhs-suggestion.rs b/src/test/ui/typeck/slow-lhs-suggestion.rs
new file mode 100644
index 000000000..80dfd6835
--- /dev/null
+++ b/src/test/ui/typeck/slow-lhs-suggestion.rs
@@ -0,0 +1,26 @@
+fn main() {
+ 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ //~^ ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+ //~| ERROR invalid left-hand side of assignment
+}
diff --git a/src/test/ui/typeck/slow-lhs-suggestion.stderr b/src/test/ui/typeck/slow-lhs-suggestion.stderr
new file mode 100644
index 000000000..c5bf795ee
--- /dev/null
+++ b/src/test/ui/typeck/slow-lhs-suggestion.stderr
@@ -0,0 +1,187 @@
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:95
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:91
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:87
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:83
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:79
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:75
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:71
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:67
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:63
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:59
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:55
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:51
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:47
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:43
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:39
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:35
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:31
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:27
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:23
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:19
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:15
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:11
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error[E0070]: invalid left-hand side of assignment
+ --> $DIR/slow-lhs-suggestion.rs:2:7
+ |
+LL | 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1 = 1;
+ | - ^
+ | |
+ | cannot assign to this expression
+
+error: aborting due to 23 previous errors
+
+For more information about this error, try `rustc --explain E0070`.
diff --git a/src/test/ui/typeck/struct-enum-wrong-args.stderr b/src/test/ui/typeck/struct-enum-wrong-args.stderr
index f72082d53..ea94bcbc2 100644
--- a/src/test/ui/typeck/struct-enum-wrong-args.stderr
+++ b/src/test/ui/typeck/struct-enum-wrong-args.stderr
@@ -12,7 +12,7 @@ LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T),
help: remove the extra argument
|
LL | let _ = Some(3);
- | ~~~~~~~
+ | ~~~
error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:7:13
@@ -30,7 +30,7 @@ LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
help: remove the extra arguments
|
LL | let _ = Ok(3);
- | ~~~~~
+ | ~~~
error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:8:13
@@ -46,7 +46,7 @@ LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
help: provide the argument
|
LL | let _ = Ok(/* value */);
- | ~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~
error[E0061]: this struct takes 1 argument but 0 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:9:13
@@ -62,7 +62,7 @@ LL | struct Wrapper(i32);
help: provide the argument
|
LL | let _ = Wrapper(/* i32 */);
- | ~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~
error[E0061]: this struct takes 1 argument but 2 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:10:13
@@ -78,7 +78,7 @@ LL | struct Wrapper(i32);
help: remove the extra argument
|
LL | let _ = Wrapper(5);
- | ~~~~~~~~~~
+ | ~~~
error[E0061]: this struct takes 2 arguments but 0 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:11:13
@@ -94,7 +94,7 @@ LL | struct DoubleWrapper(i32, i32);
help: provide the arguments
|
LL | let _ = DoubleWrapper(/* i32 */, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0061]: this struct takes 2 arguments but 1 argument was supplied
--> $DIR/struct-enum-wrong-args.rs:12:13
@@ -110,7 +110,7 @@ LL | struct DoubleWrapper(i32, i32);
help: provide the argument
|
LL | let _ = DoubleWrapper(5, /* i32 */);
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~~~~~~~~~
error[E0061]: this struct takes 2 arguments but 3 arguments were supplied
--> $DIR/struct-enum-wrong-args.rs:13:13
@@ -126,7 +126,7 @@ LL | struct DoubleWrapper(i32, i32);
help: remove the extra argument
|
LL | let _ = DoubleWrapper(5, 2);
- | ~~~~~~~~~~~~~~~~~~~
+ | ~~~~~~
error: aborting due to 8 previous errors
diff --git a/src/test/ui/typeck/suggest-adding-missing-zero-to-floating-point-number.stderr b/src/test/ui/typeck/suggest-adding-missing-zero-to-floating-point-number.stderr
index e8e069708..503015f3b 100644
--- a/src/test/ui/typeck/suggest-adding-missing-zero-to-floating-point-number.stderr
+++ b/src/test/ui/typeck/suggest-adding-missing-zero-to-floating-point-number.stderr
@@ -4,7 +4,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | 2.e1;
| ^^
|
-help: If the number is meant to be a floating point number, consider adding a `0` after the period
+help: if intended to be a floating point literal, consider adding a `0` after the period
|
LL | 2.0e1;
| +
@@ -15,7 +15,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | 2.E1;
| ^^
|
-help: If the number is meant to be a floating point number, consider adding a `0` after the period
+help: if intended to be a floating point literal, consider adding a `0` after the period
|
LL | 2.0E1;
| +
@@ -26,7 +26,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | 2.f32;
| ^^^
|
-help: If the number is meant to be a floating point number, consider adding a `0` after the period
+help: if intended to be a floating point literal, consider adding a `0` after the period
|
LL | 2.0f32;
| +
@@ -37,7 +37,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | 2.f64;
| ^^^
|
-help: If the number is meant to be a floating point number, consider adding a `0` after the period
+help: if intended to be a floating point literal, consider adding a `0` after the period
|
LL | 2.0f64;
| +
@@ -48,7 +48,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | 2.e+12;
| ^
|
-help: If the number is meant to be a floating point number, consider adding a `0` after the period
+help: if intended to be a floating point literal, consider adding a `0` after the period
|
LL | 2.0e+12;
| +
@@ -59,7 +59,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | 2.e-12;
| ^
|
-help: If the number is meant to be a floating point number, consider adding a `0` after the period
+help: if intended to be a floating point literal, consider adding a `0` after the period
|
LL | 2.0e-12;
| +
@@ -70,7 +70,7 @@ error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
LL | 2.e1f32;
| ^^^^^
|
-help: If the number is meant to be a floating point number, consider adding a `0` after the period
+help: if intended to be a floating point literal, consider adding a `0` after the period
|
LL | 2.0e1f32;
| +
diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr
index 6bb5e1f54..b9fca1a1b 100644
--- a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr
+++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr
@@ -12,10 +12,10 @@ LL | fn is_sync<T: Sync>() {}
| ^^^^ required by this bound in `is_sync`
error[E0277]: `UnsafeCell<u8>` cannot be shared between threads safely
- --> $DIR/typeck-default-trait-impl-negation-sync.rs:36:5
+ --> $DIR/typeck-default-trait-impl-negation-sync.rs:36:15
|
LL | is_sync::<MyTypeWUnsafe>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^ `UnsafeCell<u8>` cannot be shared between threads safely
+ | ^^^^^^^^^^^^^ `UnsafeCell<u8>` cannot be shared between threads safely
|
= help: within `MyTypeWUnsafe`, the trait `Sync` is not implemented for `UnsafeCell<u8>`
note: required because it appears within the type `MyTypeWUnsafe`
@@ -30,10 +30,10 @@ LL | fn is_sync<T: Sync>() {}
| ^^^^ required by this bound in `is_sync`
error[E0277]: `Managed` cannot be shared between threads safely
- --> $DIR/typeck-default-trait-impl-negation-sync.rs:39:5
+ --> $DIR/typeck-default-trait-impl-negation-sync.rs:39:15
|
LL | is_sync::<MyTypeManaged>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^ `Managed` cannot be shared between threads safely
+ | ^^^^^^^^^^^^^ `Managed` cannot be shared between threads safely
|
= help: within `MyTypeManaged`, the trait `Sync` is not implemented for `Managed`
note: required because it appears within the type `MyTypeManaged`
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.stderr
index 3ea317dfb..c57f71b80 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_item.stderr
+++ b/src/test/ui/typeck/typeck_type_placeholder_item.stderr
@@ -189,10 +189,10 @@ LL ~ b: (T, T),
|
error: missing type for `static` item
- --> $DIR/typeck_type_placeholder_item.rs:73:12
+ --> $DIR/typeck_type_placeholder_item.rs:73:13
|
LL | static A = 42;
- | ^ help: provide a type for the static variable: `A: i32`
+ | ^ help: provide a type for the static variable: `: i32`
error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables
--> $DIR/typeck_type_placeholder_item.rs:75:15
diff --git a/src/test/ui/typeof/issue-100183.rs b/src/test/ui/typeof/issue-100183.rs
new file mode 100644
index 000000000..13e9493ea
--- /dev/null
+++ b/src/test/ui/typeof/issue-100183.rs
@@ -0,0 +1,6 @@
+struct Struct {
+ y: (typeof("hey"),),
+ //~^ ERROR `typeof` is a reserved keyword but unimplemented
+}
+
+fn main() {}
diff --git a/src/test/ui/typeof/issue-100183.stderr b/src/test/ui/typeof/issue-100183.stderr
new file mode 100644
index 000000000..01d3079b2
--- /dev/null
+++ b/src/test/ui/typeof/issue-100183.stderr
@@ -0,0 +1,14 @@
+error[E0516]: `typeof` is a reserved keyword but unimplemented
+ --> $DIR/issue-100183.rs:2:9
+ |
+LL | y: (typeof("hey"),),
+ | ^^^^^^^^^^^^^ reserved keyword
+ |
+help: consider replacing `typeof(...)` with an actual type
+ |
+LL | y: (&'static str,),
+ | ~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0516`.
diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.rs b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.rs
index 939b3c522..ec86213f8 100644
--- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.rs
+++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.rs
@@ -3,6 +3,7 @@ use std::ops::Add;
fn main() {
<i32 as Add<u32>>::add(1, 2);
//~^ ERROR cannot add `u32` to `i32`
+ //~| ERROR cannot add `u32` to `i32`
<i32 as Add<i32>>::add(1u32, 2);
//~^ ERROR mismatched types
<i32 as Add<i32>>::add(1, 2u32);
diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
index c6f9b3661..eaab6ff3d 100644
--- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
+++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
@@ -1,8 +1,10 @@
error[E0277]: cannot add `u32` to `i32`
- --> $DIR/ufcs-qpath-self-mismatch.rs:4:5
+ --> $DIR/ufcs-qpath-self-mismatch.rs:4:31
|
LL | <i32 as Add<u32>>::add(1, 2);
- | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
+ | ---------------------- ^ no implementation for `i32 + u32`
+ | |
+ | required by a bound introduced by this call
|
= help: the trait `Add<u32>` is not implemented for `i32`
= help: the following other types implement trait `Add<Rhs>`:
@@ -17,7 +19,7 @@ LL | <i32 as Add<u32>>::add(1, 2);
and 48 others
error[E0308]: mismatched types
- --> $DIR/ufcs-qpath-self-mismatch.rs:6:28
+ --> $DIR/ufcs-qpath-self-mismatch.rs:7:28
|
LL | <i32 as Add<i32>>::add(1u32, 2);
| ---------------------- ^^^^ expected `i32`, found `u32`
@@ -35,7 +37,7 @@ LL | <i32 as Add<i32>>::add(1i32, 2);
| ~~~
error[E0308]: mismatched types
- --> $DIR/ufcs-qpath-self-mismatch.rs:8:31
+ --> $DIR/ufcs-qpath-self-mismatch.rs:9:31
|
LL | <i32 as Add<i32>>::add(1, 2u32);
| ---------------------- ^^^^ expected `i32`, found `u32`
@@ -52,7 +54,25 @@ help: change the type of the numeric literal from `u32` to `i32`
LL | <i32 as Add<i32>>::add(1, 2i32);
| ~~~
-error: aborting due to 3 previous errors
+error[E0277]: cannot add `u32` to `i32`
+ --> $DIR/ufcs-qpath-self-mismatch.rs:4:5
+ |
+LL | <i32 as Add<u32>>::add(1, 2);
+ | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
+ |
+ = help: the trait `Add<u32>` is not implemented for `i32`
+ = help: the following other types implement trait `Add<Rhs>`:
+ <&'a f32 as Add<f32>>
+ <&'a f64 as Add<f64>>
+ <&'a i128 as Add<i128>>
+ <&'a i16 as Add<i16>>
+ <&'a i32 as Add<i32>>
+ <&'a i64 as Add<i64>>
+ <&'a i8 as Add<i8>>
+ <&'a isize as Add<isize>>
+ and 48 others
+
+error: aborting due to 4 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.rs b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.rs
new file mode 100644
index 000000000..925463d6d
--- /dev/null
+++ b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.rs
@@ -0,0 +1,8 @@
+#![feature(unboxed_closures)]
+
+fn a<F: Fn<usize>>(f: F) {}
+
+fn main() {
+ a(|_: usize| {});
+ //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr
new file mode 100644
index 000000000..9a24fb8c2
--- /dev/null
+++ b/src/test/ui/unboxed-closures/non-tupled-arg-mismatch.stderr
@@ -0,0 +1,17 @@
+error[E0308]: mismatched types
+ --> $DIR/non-tupled-arg-mismatch.rs:6:5
+ |
+LL | a(|_: usize| {});
+ | ^ types differ
+ |
+ = note: expected trait `Fn<usize>`
+ found trait `Fn<(usize,)>`
+note: required by a bound in `a`
+ --> $DIR/non-tupled-arg-mismatch.rs:3:9
+ |
+LL | fn a<F: Fn<usize>>(f: F) {}
+ | ^^^^^^^^^ required by this bound in `a`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-counter-not-moved.stderr b/src/test/ui/unboxed-closures/unboxed-closures-counter-not-moved.stderr
index ba4b3dac6..6450cc30a 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-counter-not-moved.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-counter-not-moved.stderr
@@ -12,8 +12,8 @@ warning: value assigned to `counter` is never read
LL | counter += 1;
| ^^^^^^^
|
- = note: `#[warn(unused_assignments)]` on by default
= help: maybe it is overwritten before being read?
+ = note: `#[warn(unused_assignments)]` on by default
warning: unused variable: `counter`
--> $DIR/unboxed-closures-counter-not-moved.rs:24:9
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr
index 85ff49d61..635ebbb71 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr
@@ -6,7 +6,17 @@ LL | let c = || drop(y.0);
| |
| this closure implements `FnOnce`, not `Fn`
LL | foo(c);
- | --- the requirement to implement `Fn` derives from here
+ | --- - the requirement to implement `Fn` derives from here
+ | |
+ | required by a bound introduced by this call
+ |
+note: required by a bound in `foo`
+ --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:4:14
+ |
+LL | fn foo<F>(f: F)
+ | --- required by a bound in this
+LL | where F: Fn()
+ | ^^^^ required by this bound in `foo`
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-move-mutable.stderr b/src/test/ui/unboxed-closures/unboxed-closures-move-mutable.stderr
index 1254f8dbc..5c06f4e62 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-move-mutable.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-move-mutable.stderr
@@ -4,8 +4,8 @@ warning: unused variable: `x`
LL | move || x += 1;
| ^
|
- = note: `#[warn(unused_variables)]` on by default
= help: did you mean to capture by reference instead?
+ = note: `#[warn(unused_variables)]` on by default
warning: unused variable: `x`
--> $DIR/unboxed-closures-move-mutable.rs:21:17
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr b/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr
index 4f89afa32..e5ca0edd7 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr
@@ -2,9 +2,7 @@ error[E0599]: no method named `call` found for closure `[closure@$DIR/unboxed-cl
--> $DIR/unboxed-closures-static-call-wrong-trait.rs:7:10
|
LL | mut_.call((0, ));
- | ---- ^^^^ method not found in `[closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:6:26: 6:29]`
- | |
- | this is a function, perhaps you wish to call it
+ | ^^^^ method not found in `[closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:6:26: 6:29]`
error: aborting due to previous error
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
index 3241c9f85..455f83f57 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr
@@ -6,11 +6,11 @@ LL | let z = f(1_usize, 2);
| |
| arguments to this function are incorrect
|
-note: closure defined here
- --> $DIR/unboxed-closures-type-mismatch.rs:4:17
+note: closure parameter defined here
+ --> $DIR/unboxed-closures-type-mismatch.rs:4:18
|
LL | let mut f = |x: isize, y: isize| -> isize { x + y };
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^
help: change the type of the numeric literal from `usize` to `isize`
|
LL | let z = f(1_isize, 2);
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
index 18e133957..802696e1b 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr
@@ -1,4 +1,4 @@
-error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
+error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:20:21
|
LL | let x = call_it(&square, 22);
@@ -6,7 +6,7 @@ LL | let x = call_it(&square, 22);
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+ = help: the trait `for<'a> Fn<(&'a isize,)>` is not implemented for fn item `for<'a> unsafe fn(&'a isize) -> isize {square}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `call_it`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:9:15
@@ -14,7 +14,7 @@ note: required by a bound in `call_it`
LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
-error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
+error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:25:25
|
LL | let y = call_it_mut(&mut square, 22);
@@ -22,7 +22,7 @@ LL | let y = call_it_mut(&mut square, 22);
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+ = help: the trait `for<'a> FnMut<(&'a isize,)>` is not implemented for fn item `for<'a> unsafe fn(&'a isize) -> isize {square}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `call_it_mut`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:19
@@ -30,7 +30,7 @@ note: required by a bound in `call_it_mut`
LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
-error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}`
+error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'a> unsafe fn(&'a isize) -> isize {square}`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:30:26
|
LL | let z = call_it_once(square, 22);
@@ -38,7 +38,7 @@ LL | let z = call_it_once(square, 22);
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}`
+ = help: the trait `for<'a> FnOnce<(&'a isize,)>` is not implemented for fn item `for<'a> unsafe fn(&'a isize) -> isize {square}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `call_it_once`
--> $DIR/unboxed-closures-unsafe-extern-fn.rs:15:20
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
index 77c176de6..0bbb9836c 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr
@@ -1,42 +1,42 @@
-error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+error[E0277]: expected a `Fn<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:20:21
|
LL | let x = call_it(&square, 22);
- | ------- ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+ | ------- ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}`
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+ = help: the trait `for<'a> Fn<(&'a isize,)>` is not implemented for fn item `for<'a> extern "C" fn(&'a isize) -> isize {square}`
note: required by a bound in `call_it`
--> $DIR/unboxed-closures-wrong-abi.rs:9:15
|
LL | fn call_it<F: Fn(&isize) -> isize>(_: &F, _: isize) -> isize {
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it`
-error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+error[E0277]: expected a `FnMut<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:25:25
|
LL | let y = call_it_mut(&mut square, 22);
- | ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+ | ----------- ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}`
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+ = help: the trait `for<'a> FnMut<(&'a isize,)>` is not implemented for fn item `for<'a> extern "C" fn(&'a isize) -> isize {square}`
note: required by a bound in `call_it_mut`
--> $DIR/unboxed-closures-wrong-abi.rs:12:19
|
LL | fn call_it_mut<F: FnMut(&isize) -> isize>(_: &mut F, _: isize) -> isize {
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call_it_mut`
-error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+error[E0277]: expected a `FnOnce<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}`
--> $DIR/unboxed-closures-wrong-abi.rs:30:26
|
LL | let z = call_it_once(square, 22);
- | ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+ | ------------ ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'a> extern "C" fn(&'a isize) -> isize {square}`
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}`
+ = help: the trait `for<'a> FnOnce<(&'a isize,)>` is not implemented for fn item `for<'a> extern "C" fn(&'a isize) -> isize {square}`
note: required by a bound in `call_it_once`
--> $DIR/unboxed-closures-wrong-abi.rs:15:20
|
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
index c826af3c4..31a66790c 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr
@@ -6,7 +6,7 @@ LL | let x = call_it(&square, 22);
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+ = help: the trait `for<'a> Fn<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `call_it`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:10:15
@@ -22,7 +22,7 @@ LL | let y = call_it_mut(&mut square, 22);
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+ = help: the trait `for<'a> FnMut<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `call_it_mut`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:19
@@ -38,7 +38,7 @@ LL | let z = call_it_once(square, 22);
| |
| required by a bound introduced by this call
|
- = help: the trait `for<'r> FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}`
+ = help: the trait `for<'a> FnOnce<(&'a isize,)>` is not implemented for fn item `unsafe fn(isize) -> isize {square}`
= note: unsafe function cannot be called generically without an unsafe block
note: required by a bound in `call_it_once`
--> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:16:20
diff --git a/src/test/ui/uninhabited/privately-uninhabited-mir-call.stderr b/src/test/ui/uninhabited/privately-uninhabited-mir-call.stderr
index 95c209f47..0dfd22a30 100644
--- a/src/test/ui/uninhabited/privately-uninhabited-mir-call.stderr
+++ b/src/test/ui/uninhabited/privately-uninhabited-mir-call.stderr
@@ -6,6 +6,11 @@ LL | let y: &mut u32;
...
LL | *y = 2;
| ^^^^^^ `y` used here but it isn't initialized
+ |
+help: consider assigning a value
+ |
+LL | let y: &mut u32 = todo!();
+ | +++++++++
error: aborting due to previous error
diff --git a/src/test/ui/uninhabited/uninhabited-irrefutable.rs b/src/test/ui/uninhabited/uninhabited-irrefutable.rs
index 661b5486a..1a0f3c5e5 100644
--- a/src/test/ui/uninhabited/uninhabited-irrefutable.rs
+++ b/src/test/ui/uninhabited/uninhabited-irrefutable.rs
@@ -24,5 +24,5 @@ enum Foo {
fn main() {
let x: Foo = Foo::D(123, 456);
- let Foo::D(_y, _z) = x; //~ ERROR refutable pattern in local binding: `A(_)` not covered
+ let Foo::D(_y, _z) = x; //~ ERROR refutable pattern in local binding: `Foo::A(_)` not covered
}
diff --git a/src/test/ui/uninhabited/uninhabited-irrefutable.stderr b/src/test/ui/uninhabited/uninhabited-irrefutable.stderr
index c571e17a7..32f287a18 100644
--- a/src/test/ui/uninhabited/uninhabited-irrefutable.stderr
+++ b/src/test/ui/uninhabited/uninhabited-irrefutable.stderr
@@ -1,8 +1,8 @@
-error[E0005]: refutable pattern in local binding: `A(_)` not covered
+error[E0005]: refutable pattern in local binding: `Foo::A(_)` not covered
--> $DIR/uninhabited-irrefutable.rs:27:9
|
LL | let Foo::D(_y, _z) = x;
- | ^^^^^^^^^^^^^^ pattern `A(_)` not covered
+ | ^^^^^^^^^^^^^^ pattern `Foo::A(_)` 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
@@ -18,7 +18,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let (_y, _z) = if let Foo::D(_y, _z) = x { (_y, _z) } else { todo!() };
| +++++++++++++++++ +++++++++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+help: alternatively, you might want to use let else to handle the variant that isn't matched
|
LL | let Foo::D(_y, _z) = x else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr
index 2c107b1f7..c78829634 100644
--- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr
+++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr
@@ -122,7 +122,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let x = if let Ok(x) = x { x } else { todo!() };
| ++++++++++ ++++++++++++++++++++++
-help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched
+help: alternatively, you might want to use let else to handle the variant that isn't matched
|
LL | let Ok(x) = x else { todo!() };
| ++++++++++++++++
diff --git a/src/test/ui/union/union-copy.stderr b/src/test/ui/union/union-copy.stderr
index 8ecdafdde..53ee4dd2e 100644
--- a/src/test/ui/union/union-copy.stderr
+++ b/src/test/ui/union/union-copy.stderr
@@ -1,11 +1,11 @@
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/union-copy.rs:12:6
+ --> $DIR/union-copy.rs:12:15
|
LL | a: std::mem::ManuallyDrop<String>
| --------------------------------- this field does not implement `Copy`
...
LL | impl Copy for W {}
- | ^^^^
+ | ^
|
note: the `Copy` impl for `ManuallyDrop<String>` requires that `String: Copy`
--> $DIR/union-copy.rs:8:8
diff --git a/src/test/ui/union/union-generic.mirunsafeck.stderr b/src/test/ui/union/union-generic.mirunsafeck.stderr
index a4f0c400d..037022a91 100644
--- a/src/test/ui/union/union-generic.mirunsafeck.stderr
+++ b/src/test/ui/union/union-generic.mirunsafeck.stderr
@@ -11,10 +11,10 @@ LL | union U<T: Copy> {
| ^^^^ required by this bound in `U`
error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied
- --> $DIR/union-generic.rs:13:13
+ --> $DIR/union-generic.rs:13:17
|
LL | let u = U::<Rc<u32>> { a: Default::default() };
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>`
+ | ^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>`
|
note: required by a bound in `U`
--> $DIR/union-generic.rs:6:12
diff --git a/src/test/ui/union/union-generic.thirunsafeck.stderr b/src/test/ui/union/union-generic.thirunsafeck.stderr
index a4f0c400d..037022a91 100644
--- a/src/test/ui/union/union-generic.thirunsafeck.stderr
+++ b/src/test/ui/union/union-generic.thirunsafeck.stderr
@@ -11,10 +11,10 @@ LL | union U<T: Copy> {
| ^^^^ required by this bound in `U`
error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied
- --> $DIR/union-generic.rs:13:13
+ --> $DIR/union-generic.rs:13:17
|
LL | let u = U::<Rc<u32>> { a: Default::default() };
- | ^^^^^^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>`
+ | ^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>`
|
note: required by a bound in `U`
--> $DIR/union-generic.rs:6:12
diff --git a/src/test/ui/union/union-nonrepresentable.stderr b/src/test/ui/union/union-nonrepresentable.stderr
index 9804b1418..c266d2e9e 100644
--- a/src/test/ui/union/union-nonrepresentable.stderr
+++ b/src/test/ui/union/union-nonrepresentable.stderr
@@ -2,15 +2,15 @@ error[E0072]: recursive type `U` has infinite size
--> $DIR/union-nonrepresentable.rs:1:1
|
LL | union U {
- | ^^^^^^^ recursive type has infinite size
+ | ^^^^^^^
LL | a: u8,
LL | b: std::mem::ManuallyDrop<U>,
- | ------------------------- recursive without indirection
+ | - recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `U` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
-LL | b: Box<std::mem::ManuallyDrop<U>>,
- | ++++ +
+LL | b: std::mem::ManuallyDrop<Box<U>>,
+ | ++++ +
error: aborting due to previous error
diff --git a/src/test/ui/union/union-repr-c.stderr b/src/test/ui/union/union-repr-c.stderr
index 9abf440f7..49124eee5 100644
--- a/src/test/ui/union/union-repr-c.stderr
+++ b/src/test/ui/union/union-repr-c.stderr
@@ -4,11 +4,6 @@ error: `extern` block uses type `W`, which is not FFI-safe
LL | static FOREIGN2: W;
| ^ not FFI-safe
|
-note: the lint level is defined here
- --> $DIR/union-repr-c.rs:2:9
- |
-LL | #![deny(improper_ctypes)]
- | ^^^^^^^^^^^^^^^
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this union
= note: this union has unspecified layout
note: the type is defined here
@@ -16,6 +11,11 @@ note: the type is defined here
|
LL | union W {
| ^^^^^^^
+note: the lint level is defined here
+ --> $DIR/union-repr-c.rs:2:9
+ |
+LL | #![deny(improper_ctypes)]
+ | ^^^^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr
index 7e6885bd7..aa73b824a 100644
--- a/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr
+++ b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-command-line.stderr
@@ -1,8 +1,8 @@
error: unknown lint: `test_unstable_lint`
|
- = note: requested on the command line with `-D unknown-lints`
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+ = note: requested on the command line with `-D unknown-lints`
error: unknown lint: `test_unstable_lint`
|
diff --git a/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr
index 2d1027dd0..2a2a9811b 100644
--- a/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr
+++ b/src/test/ui/unknown-unstable-lints/deny-unstable-lint-inline.stderr
@@ -4,13 +4,13 @@ error: unknown lint: `test_unstable_lint`
LL | #![allow(test_unstable_lint)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
note: the lint level is defined here
--> $DIR/deny-unstable-lint-inline.rs:3:9
|
LL | #![deny(unknown_lints)]
| ^^^^^^^^^^^^^
- = note: the `test_unstable_lint` lint is unstable
- = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
error: unknown lint: `test_unstable_lint`
--> $DIR/deny-unstable-lint-inline.rs:4:1
diff --git a/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr
index 799d740b0..82851c800 100644
--- a/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr
+++ b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-command-line.stderr
@@ -1,8 +1,8 @@
warning: unknown lint: `test_unstable_lint`
|
- = note: requested on the command line with `-W unknown-lints`
= note: the `test_unstable_lint` lint is unstable
= help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
+ = note: requested on the command line with `-W unknown-lints`
warning: unknown lint: `test_unstable_lint`
|
diff --git a/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr
index 142558b47..0548cd226 100644
--- a/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr
+++ b/src/test/ui/unknown-unstable-lints/warn-unknown-unstable-lint-inline.stderr
@@ -4,13 +4,13 @@ warning: unknown lint: `test_unstable_lint`
LL | #![allow(test_unstable_lint)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
+ = note: the `test_unstable_lint` lint is unstable
+ = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
note: the lint level is defined here
--> $DIR/warn-unknown-unstable-lint-inline.rs:3:9
|
LL | #![warn(unknown_lints)]
| ^^^^^^^^^^^^^
- = note: the `test_unstable_lint` lint is unstable
- = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
warning: unknown lint: `test_unstable_lint`
--> $DIR/warn-unknown-unstable-lint-inline.rs:4:1
diff --git a/src/test/ui/unpretty/avoid-crash.rs b/src/test/ui/unpretty/avoid-crash.rs
new file mode 100644
index 000000000..fd84b70d9
--- /dev/null
+++ b/src/test/ui/unpretty/avoid-crash.rs
@@ -0,0 +1,4 @@
+// normalize-stderr-test "error `.*`" -> "$$ERROR_MESSAGE"
+// compile-flags: -o/tmp/ -Zunpretty=ast-tree
+
+fn main() {}
diff --git a/src/test/ui/unpretty/avoid-crash.stderr b/src/test/ui/unpretty/avoid-crash.stderr
new file mode 100644
index 000000000..11cd3866f
--- /dev/null
+++ b/src/test/ui/unpretty/avoid-crash.stderr
@@ -0,0 +1,4 @@
+error: pretty-print failed to write `/tmp/` due to $ERROR_MESSAGE
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/unpretty/bad-literal.rs b/src/test/ui/unpretty/bad-literal.rs
new file mode 100644
index 000000000..6dcc0da30
--- /dev/null
+++ b/src/test/ui/unpretty/bad-literal.rs
@@ -0,0 +1,8 @@
+// compile-flags: -Zunpretty=hir
+// check-fail
+
+// In #100948 this caused an ICE with -Zunpretty=hir.
+fn main() {
+ 1u;
+ //~^ ERROR invalid suffix `u` for number literal
+}
diff --git a/src/test/ui/unpretty/bad-literal.stderr b/src/test/ui/unpretty/bad-literal.stderr
new file mode 100644
index 000000000..f3fcb4a4e
--- /dev/null
+++ b/src/test/ui/unpretty/bad-literal.stderr
@@ -0,0 +1,10 @@
+error: invalid suffix `u` for number literal
+ --> $DIR/bad-literal.rs:6:5
+ |
+LL | 1u;
+ | ^^ invalid suffix `u`
+ |
+ = help: the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/unpretty/bad-literal.stdout b/src/test/ui/unpretty/bad-literal.stdout
new file mode 100644
index 000000000..8df933270
--- /dev/null
+++ b/src/test/ui/unpretty/bad-literal.stdout
@@ -0,0 +1,11 @@
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// compile-flags: -Zunpretty=hir
+// check-fail
+
+// In #100948 this caused an ICE with -Zunpretty=hir.
+fn main() {
+ <bad-literal>;
+ }
diff --git a/src/test/ui/unpretty/pretty-let-else.rs b/src/test/ui/unpretty/pretty-let-else.rs
new file mode 100644
index 000000000..b5ae52969
--- /dev/null
+++ b/src/test/ui/unpretty/pretty-let-else.rs
@@ -0,0 +1,10 @@
+// compile-flags: -Zunpretty=hir
+// check-pass
+
+
+
+fn foo(x: Option<u32>) {
+ let Some(_) = x else { panic!() };
+}
+
+fn main() {}
diff --git a/src/test/ui/unpretty/pretty-let-else.stdout b/src/test/ui/unpretty/pretty-let-else.stdout
new file mode 100644
index 000000000..35ad1cd1b
--- /dev/null
+++ b/src/test/ui/unpretty/pretty-let-else.stdout
@@ -0,0 +1,18 @@
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+// compile-flags: -Zunpretty=hir
+// check-pass
+
+
+
+fn foo(x:
+ Option<u32>) {
+ let Some(_) = x else
+ {
+
+ { ::std::rt::begin_panic("explicit panic") }
+ };
+ }
+fn main() { }
diff --git a/src/test/ui/unresolved/unresolved-candidates.rs b/src/test/ui/unresolved/unresolved-candidates.rs
new file mode 100644
index 000000000..38b227f60
--- /dev/null
+++ b/src/test/ui/unresolved/unresolved-candidates.rs
@@ -0,0 +1,13 @@
+mod a {
+ pub trait Trait {}
+}
+
+mod b {
+ use Trait; //~ ERROR unresolved import `Trait`
+}
+
+mod c {
+ impl Trait for () {} //~ ERROR cannot find trait `Trait` in this scope
+}
+
+fn main() {}
diff --git a/src/test/ui/unresolved/unresolved-candidates.stderr b/src/test/ui/unresolved/unresolved-candidates.stderr
new file mode 100644
index 000000000..bbd3eec2a
--- /dev/null
+++ b/src/test/ui/unresolved/unresolved-candidates.stderr
@@ -0,0 +1,26 @@
+error[E0432]: unresolved import `Trait`
+ --> $DIR/unresolved-candidates.rs:6:9
+ |
+LL | use Trait;
+ | ^^^^^ no `Trait` in the root
+ |
+help: consider importing this trait instead
+ |
+LL | use a::Trait;
+ | ~~~~~~~~~
+
+error[E0405]: cannot find trait `Trait` in this scope
+ --> $DIR/unresolved-candidates.rs:10:10
+ |
+LL | impl Trait for () {}
+ | ^^^^^ not found in this scope
+ |
+help: consider importing this trait
+ |
+LL | use a::Trait;
+ |
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0405, E0432.
+For more information about an error, try `rustc --explain E0405`.
diff --git a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
index fd58e1b1e..6f005fe89 100644
--- a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
+++ b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr
@@ -4,12 +4,12 @@ error: call to unsafe function is unsafe and requires unsafe block (error E0133)
LL | unsf();
| ^^^^^^ call to unsafe function
|
+ = note: consult the function's documentation for information on how to avoid undefined behavior
note: the lint level is defined here
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9
|
LL | #![deny(unsafe_op_in_unsafe_fn)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = note: consult the function's documentation for information on how to avoid undefined behavior
error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:15:5
@@ -45,13 +45,13 @@ error: call to unsafe function is unsafe and requires unsafe block (error E0133)
LL | unsf();
| ^^^^^^ call to unsafe function
|
+ = note: consult the function's documentation for information on how to avoid undefined behavior
note: the lint level is defined here
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:8
|
LL | #[deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]`
- = note: consult the function's documentation for information on how to avoid undefined behavior
error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5
@@ -81,40 +81,8 @@ error: unnecessary `unsafe` block
LL | unsafe { unsafe { unsf() } }
| ^^^^^^ unnecessary `unsafe` block
-error: unnecessary `unsafe` block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:60:5
- |
-LL | unsafe fn allow_level() {
- | ----------------------- because it's nested under this `unsafe` fn
-...
-LL | unsafe { unsf() }
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:53:9
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: unnecessary `unsafe` block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:72:9
- |
-LL | unsafe fn nested_allow_level() {
- | ------------------------------ because it's nested under this `unsafe` fn
-...
-LL | unsafe { unsf() }
- | ^^^^^^ unnecessary `unsafe` block
- |
- = note: this `unsafe` block does contain unsafe operations, but those are already allowed in an `unsafe fn`
-note: the lint level is defined here
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:65:13
- |
-LL | #[allow(unsafe_op_in_unsafe_fn)]
- | ^^^^^^^^^^^^^^^^^^^^^^
-
error[E0133]: call to unsafe function is unsafe and requires unsafe block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:78:5
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:76:5
|
LL | unsf();
| ^^^^^^ call to unsafe function
@@ -122,13 +90,13 @@ LL | unsf();
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function is unsafe and requires unsafe function or block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:83:9
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:81:9
|
LL | unsf();
| ^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
-error: aborting due to 13 previous errors
+error: aborting due to 11 previous errors
For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs
index 30b072340..db1e916a3 100644
--- a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs
+++ b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs
@@ -58,7 +58,6 @@ unsafe fn allow_level() {
VOID = ();
unsafe { unsf() }
- //~^ ERROR unnecessary `unsafe` block
}
unsafe fn nested_allow_level() {
@@ -70,7 +69,6 @@ unsafe fn nested_allow_level() {
VOID = ();
unsafe { unsf() }
- //~^ ERROR unnecessary `unsafe` block
}
}
diff --git a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
index 2ba6a7293..13c080e5b 100644
--- a/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
+++ b/src/test/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr
@@ -4,12 +4,12 @@ error: call to unsafe function `unsf` is unsafe and requires unsafe block (error
LL | unsf();
| ^^^^^^ call to unsafe function
|
+ = note: consult the function's documentation for information on how to avoid undefined behavior
note: the lint level is defined here
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9
|
LL | #![deny(unsafe_op_in_unsafe_fn)]
| ^^^^^^^^^^^^^^^^^^^^^^
- = note: consult the function's documentation for information on how to avoid undefined behavior
error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:15:5
@@ -45,13 +45,13 @@ error: call to unsafe function `unsf` is unsafe and requires unsafe block (error
LL | unsf();
| ^^^^^^ call to unsafe function
|
+ = note: consult the function's documentation for information on how to avoid undefined behavior
note: the lint level is defined here
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:8
|
LL | #[deny(warnings)]
| ^^^^^^^^
= note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]`
- = note: consult the function's documentation for information on how to avoid undefined behavior
error: dereference of raw pointer is unsafe and requires unsafe block (error E0133)
--> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5
@@ -83,26 +83,8 @@ LL | unsafe { unsafe { unsf() } }
| |
| because it's nested under this `unsafe` block
-error: unnecessary `unsafe` block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:60:5
- |
-LL | unsafe fn allow_level() {
- | ----------------------- because it's nested under this `unsafe` fn
-...
-LL | unsafe { unsf() }
- | ^^^^^^ unnecessary `unsafe` block
-
-error: unnecessary `unsafe` block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:72:9
- |
-LL | unsafe fn nested_allow_level() {
- | ------------------------------ because it's nested under this `unsafe` fn
-...
-LL | unsafe { unsf() }
- | ^^^^^^ unnecessary `unsafe` block
-
error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:78:5
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:76:5
|
LL | unsf();
| ^^^^^^ call to unsafe function
@@ -110,13 +92,13 @@ LL | unsf();
= note: consult the function's documentation for information on how to avoid undefined behavior
error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe function or block
- --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:83:9
+ --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:81:9
|
LL | unsf();
| ^^^^^^ call to unsafe function
|
= note: consult the function's documentation for information on how to avoid undefined behavior
-error: aborting due to 13 previous errors
+error: aborting due to 11 previous errors
For more information about this error, try `rustc --explain E0133`.
diff --git a/src/test/ui/unsized-locals/borrow-after-move.stderr b/src/test/ui/unsized-locals/borrow-after-move.stderr
index 4f2bc06d4..28ae1c068 100644
--- a/src/test/ui/unsized-locals/borrow-after-move.stderr
+++ b/src/test/ui/unsized-locals/borrow-after-move.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals, unsized_fn_params)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0382]: borrow of moved value: `x`
--> $DIR/borrow-after-move.rs:21:24
diff --git a/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr b/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr
index 59d91bc0c..4f13ec7ac 100644
--- a/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr
+++ b/src/test/ui/unsized-locals/by-value-trait-object-safety.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error: the `foo` method cannot be invoked on a trait object
--> $DIR/by-value-trait-object-safety.rs:20:7
diff --git a/src/test/ui/unsized-locals/double-move.stderr b/src/test/ui/unsized-locals/double-move.stderr
index 4bb2ad88f..dfae6cc75 100644
--- a/src/test/ui/unsized-locals/double-move.stderr
+++ b/src/test/ui/unsized-locals/double-move.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals, unsized_fn_params)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0382]: use of moved value: `y`
--> $DIR/double-move.rs:21:22
diff --git a/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr b/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr
index 0f0ff5793..b6002cf89 100644
--- a/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr
+++ b/src/test/ui/unsized-locals/issue-30276-feature-flagged.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/issue-30276-feature-flagged.rs:7:29
diff --git a/src/test/ui/unsized-locals/issue-50940-with-feature.stderr b/src/test/ui/unsized-locals/issue-50940-with-feature.stderr
index 4523d41b6..8bbe317ec 100644
--- a/src/test/ui/unsized-locals/issue-50940-with-feature.stderr
+++ b/src/test/ui/unsized-locals/issue-50940-with-feature.stderr
@@ -4,8 +4,8 @@ warning: the feature `unsized_locals` is incomplete and may not be safe to use a
LL | #![feature(unsized_locals, unsized_fn_params)]
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(incomplete_features)]` on by default
= note: see issue #48055 <https://github.com/rust-lang/rust/issues/48055> for more information
+ = note: `#[warn(incomplete_features)]` on by default
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/issue-50940-with-feature.rs:6:5
diff --git a/src/test/ui/unsized-locals/unsized-exprs.stderr b/src/test/ui/unsized-locals/unsized-exprs.stderr
index 6960255d9..a7f57e3fd 100644
--- a/src/test/ui/unsized-locals/unsized-exprs.stderr
+++ b/src/test/ui/unsized-locals/unsized-exprs.stderr
@@ -12,9 +12,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation
--> $DIR/unsized-exprs.rs:24:22
|
LL | udrop::<A<[u8]>>(A { 0: *foo() });
- | ---------------- ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `A<[u8]>`, the trait `Sized` is not implemented for `[u8]`
note: required because it appears within the type `A<[u8]>`
diff --git a/src/test/ui/unsized/issue-71659.stderr b/src/test/ui/unsized/issue-71659.stderr
index d7b95f557..50060e53a 100644
--- a/src/test/ui/unsized/issue-71659.stderr
+++ b/src/test/ui/unsized/issue-71659.stderr
@@ -1,8 +1,10 @@
error[E0277]: the trait bound `dyn Foo: CastTo<[i32]>` is not satisfied
- --> $DIR/issue-71659.rs:30:15
+ --> $DIR/issue-71659.rs:30:13
|
LL | let x = x.cast::<[i32]>();
- | ^^^^ the trait `CastTo<[i32]>` is not implemented for `dyn Foo`
+ | ^ ---- required by a bound introduced by this call
+ | |
+ | the trait `CastTo<[i32]>` is not implemented for `dyn Foo`
|
note: required by a bound in `Cast::cast`
--> $DIR/issue-71659.rs:19:15
diff --git a/src/test/ui/unsized/issue-75707.stderr b/src/test/ui/unsized/issue-75707.stderr
index 7d0a2cb85..97618ed05 100644
--- a/src/test/ui/unsized/issue-75707.stderr
+++ b/src/test/ui/unsized/issue-75707.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `MyCall: Callback` is not satisfied
- --> $DIR/issue-75707.rs:15:5
+ --> $DIR/issue-75707.rs:15:9
|
LL | f::<dyn Processing<Call = MyCall>>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Callback` is not implemented for `MyCall`
|
note: required by a bound in `f`
--> $DIR/issue-75707.rs:9:9
diff --git a/src/test/ui/unsized/issue-75899-but-gats.rs b/src/test/ui/unsized/issue-75899-but-gats.rs
new file mode 100644
index 000000000..5716817f4
--- /dev/null
+++ b/src/test/ui/unsized/issue-75899-but-gats.rs
@@ -0,0 +1,21 @@
+// check-pass
+
+use std::fmt::Debug;
+use std::marker::PhantomData;
+
+trait Foo {
+ type Gat<'a>: ?Sized where Self: 'a;
+}
+
+struct Bar<'a, T: Foo + 'a>(T::Gat<'a>);
+
+struct Baz<T: ?Sized>(PhantomData<T>);
+
+impl<T: ?Sized> Foo for Baz<T> {
+ type Gat<'a> = T where Self: 'a;
+}
+
+fn main() {
+ let x = Bar::<'_, Baz<()>>(());
+ let y: &Bar<'_, Baz<dyn Debug>> = &x;
+}
diff --git a/src/test/ui/unsized/issue-75899.rs b/src/test/ui/unsized/issue-75899.rs
new file mode 100644
index 000000000..abff17e11
--- /dev/null
+++ b/src/test/ui/unsized/issue-75899.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+trait Trait {}
+impl<T> Trait for T {}
+
+trait Noop {
+ type Assoc: ?Sized;
+}
+impl<T: ?Sized> Noop for T {
+ type Assoc = T;
+}
+
+struct NoopNewtype<T: ?Sized + Noop>(T::Assoc);
+fn coerce_newtype<T: Trait>(x: &NoopNewtype<T>) -> &NoopNewtype<dyn Trait + '_> {
+ x
+}
+
+fn main() {}
diff --git a/src/test/ui/unsized/unsized-fn-param.stderr b/src/test/ui/unsized/unsized-fn-param.stderr
index 0221ef16b..b47726054 100644
--- a/src/test/ui/unsized/unsized-fn-param.stderr
+++ b/src/test/ui/unsized/unsized-fn-param.stderr
@@ -2,9 +2,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:11:11
|
LL | foo11("bar", &"baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<Path>`
@@ -17,9 +15,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:13:19
|
LL | foo12(&"bar", "baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<Path>`
@@ -32,9 +28,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:16:11
|
LL | foo21("bar", &"baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<str>`
@@ -47,9 +41,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t
--> $DIR/unsized-fn-param.rs:18:19
|
LL | foo22(&"bar", "baz");
- | ----- ^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `str`
= note: required for the cast from `str` to the object type `dyn AsRef<str>`
diff --git a/src/test/ui/unsized/unsized-struct.stderr b/src/test/ui/unsized/unsized-struct.stderr
index c9510e92f..dff1b0a51 100644
--- a/src/test/ui/unsized/unsized-struct.stderr
+++ b/src/test/ui/unsized/unsized-struct.stderr
@@ -25,10 +25,10 @@ LL + fn foo2<T>() { not_sized::<Foo<T>>() }
|
error[E0277]: the size for values of type `T` cannot be known at compilation time
- --> $DIR/unsized-struct.rs:13:24
+ --> $DIR/unsized-struct.rs:13:35
|
LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
- | - ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+ | - ^^^^^^ doesn't have a size known at compile-time
| |
| this type parameter needs to be `std::marker::Sized`
|
diff --git a/src/test/ui/unsized/unsized3.stderr b/src/test/ui/unsized/unsized3.stderr
index d64091b15..9ad1ac6b4 100644
--- a/src/test/ui/unsized/unsized3.stderr
+++ b/src/test/ui/unsized/unsized3.stderr
@@ -79,14 +79,12 @@ LL | fn f5<Y: ?Sized>(x: &Y) {}
| ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
- --> $DIR/unsized3.rs:40:8
+ --> $DIR/unsized3.rs:40:5
|
LL | fn f9<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `std::marker::Sized`
LL | f5(&(*x1, 34));
- | -- ^^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^ doesn't have a size known at compile-time
|
note: required because it appears within the type `S<X>`
--> $DIR/unsized3.rs:28:8
@@ -106,9 +104,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim
LL | fn f10<X: ?Sized>(x1: Box<S<X>>) {
| - this type parameter needs to be `std::marker::Sized`
LL | f5(&(32, *x1));
- | -- ^^^^^^^^^ doesn't have a size known at compile-time
- | |
- | required by a bound introduced by this call
+ | ^^^^^^^^^ doesn't have a size known at compile-time
|
note: required because it appears within the type `S<X>`
--> $DIR/unsized3.rs:28:8
diff --git a/src/test/ui/unwind-abis/feature-gate-c-unwind.stderr b/src/test/ui/unwind-abis/feature-gate-c-unwind.stderr
index a67f46cd2..214ddc45c 100644
--- a/src/test/ui/unwind-abis/feature-gate-c-unwind.stderr
+++ b/src/test/ui/unwind-abis/feature-gate-c-unwind.stderr
@@ -4,10 +4,10 @@ warning: unknown lint: `ffi_unwind_calls`
LL | #![allow(ffi_unwind_calls)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
- = note: `#[warn(unknown_lints)]` on by default
= note: the `ffi_unwind_calls` lint is unstable
= note: see issue #74990 <https://github.com/rust-lang/rust/issues/74990> for more information
= help: add `#![feature(c_unwind)]` to the crate attributes to enable
+ = note: `#[warn(unknown_lints)]` on by default
error[E0658]: C-unwind ABI is experimental and subject to change
--> $DIR/feature-gate-c-unwind.rs:8:8
diff --git a/src/test/ui/unwind-abis/ffi-unwind-calls-lint.rs b/src/test/ui/unwind-abis/ffi-unwind-calls-lint.rs
index dadf4b121..9a324f004 100644
--- a/src/test/ui/unwind-abis/ffi-unwind-calls-lint.rs
+++ b/src/test/ui/unwind-abis/ffi-unwind-calls-lint.rs
@@ -1,6 +1,5 @@
// build-pass
// needs-unwind
-// ignore-wasm32-bare compiled with panic=abort by default
#![feature(c_unwind)]
#![warn(ffi_unwind_calls)]
diff --git a/src/test/ui/unwind-abis/ffi-unwind-calls-lint.stderr b/src/test/ui/unwind-abis/ffi-unwind-calls-lint.stderr
index ed41cb746..937a2b3df 100644
--- a/src/test/ui/unwind-abis/ffi-unwind-calls-lint.stderr
+++ b/src/test/ui/unwind-abis/ffi-unwind-calls-lint.stderr
@@ -1,17 +1,17 @@
warning: call to foreign function with FFI-unwind ABI
- --> $DIR/ffi-unwind-calls-lint.rs:21:14
+ --> $DIR/ffi-unwind-calls-lint.rs:20:14
|
LL | unsafe { foo(); }
| ^^^^^ call to foreign function with FFI-unwind ABI
|
note: the lint level is defined here
- --> $DIR/ffi-unwind-calls-lint.rs:6:9
+ --> $DIR/ffi-unwind-calls-lint.rs:5:9
|
LL | #![warn(ffi_unwind_calls)]
| ^^^^^^^^^^^^^^^^
warning: call to function pointer with FFI-unwind ABI
- --> $DIR/ffi-unwind-calls-lint.rs:25:5
+ --> $DIR/ffi-unwind-calls-lint.rs:24:5
|
LL | ptr();
| ^^^^^ call to function pointer with FFI-unwind ABI
diff --git a/src/test/ui/unwind-no-uwtable.rs b/src/test/ui/unwind-no-uwtable.rs
index 0440cf488..3bc309233 100644
--- a/src/test/ui/unwind-no-uwtable.rs
+++ b/src/test/ui/unwind-no-uwtable.rs
@@ -1,7 +1,6 @@
// run-pass
// needs-unwind
// ignore-windows target requires uwtable
-// ignore-wasm32-bare no proper panic=unwind support
// compile-flags: -C panic=unwind -C force-unwind-tables=n
use std::panic::{self, AssertUnwindSafe};
diff --git a/src/test/ui/variance/variance-regions-unused-indirect.rs b/src/test/ui/variance/variance-regions-unused-indirect.rs
index 1514e3956..6c2c24ddb 100644
--- a/src/test/ui/variance/variance-regions-unused-indirect.rs
+++ b/src/test/ui/variance/variance-regions-unused-indirect.rs
@@ -1,6 +1,7 @@
// Test that disallow lifetime parameters that are unused.
enum Foo<'a> { //~ ERROR parameter `'a` is never used
+ //~^ ERROR recursive types `Foo` and `Bar` have infinite size
Foo1(Bar<'a>)
}
diff --git a/src/test/ui/variance/variance-regions-unused-indirect.stderr b/src/test/ui/variance/variance-regions-unused-indirect.stderr
index 93710cc13..14fdd8492 100644
--- a/src/test/ui/variance/variance-regions-unused-indirect.stderr
+++ b/src/test/ui/variance/variance-regions-unused-indirect.stderr
@@ -1,3 +1,26 @@
+error[E0072]: recursive types `Foo` and `Bar` have infinite size
+ --> $DIR/variance-regions-unused-indirect.rs:3:1
+ |
+LL | enum Foo<'a> {
+ | ^^^^^^^^^^^^
+LL |
+LL | Foo1(Bar<'a>)
+ | ------- recursive without indirection
+...
+LL | enum Bar<'a> {
+ | ^^^^^^^^^^^^
+LL | Bar1(Foo<'a>)
+ | ------- recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL ~ Foo1(Box<Bar<'a>>)
+LL | }
+LL |
+LL | enum Bar<'a> {
+LL ~ Bar1(Box<Foo<'a>>)
+ |
+
error[E0392]: parameter `'a` is never used
--> $DIR/variance-regions-unused-indirect.rs:3:10
|
@@ -7,13 +30,14 @@ LL | enum Foo<'a> {
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
error[E0392]: parameter `'a` is never used
- --> $DIR/variance-regions-unused-indirect.rs:7:10
+ --> $DIR/variance-regions-unused-indirect.rs:8:10
|
LL | enum Bar<'a> {
| ^^ unused parameter
|
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
-error: aborting due to 2 previous errors
+error: aborting due to 3 previous errors
-For more information about this error, try `rustc --explain E0392`.
+Some errors have detailed explanations: E0072, E0392.
+For more information about an error, try `rustc --explain E0072`.
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.rs b/src/test/ui/variance/variance-use-contravariant-struct-1.rs
index 7f5906748..40781fbf0 100644
--- a/src/test/ui/variance/variance-use-contravariant-struct-1.rs
+++ b/src/test/ui/variance/variance-use-contravariant-struct-1.rs
@@ -1,4 +1,4 @@
-// Test various uses of structs with distint variances to make sure
+// Test various uses of structs with distinct variances to make sure
// they permit lifetimes to be approximated as expected.
struct SomeStruct<T>(fn(T));
diff --git a/src/test/ui/variance/variance-use-contravariant-struct-2.rs b/src/test/ui/variance/variance-use-contravariant-struct-2.rs
index 2113eb2ad..d4b2d0834 100644
--- a/src/test/ui/variance/variance-use-contravariant-struct-2.rs
+++ b/src/test/ui/variance/variance-use-contravariant-struct-2.rs
@@ -1,4 +1,4 @@
-// Test various uses of structs with distint variances to make sure
+// Test various uses of structs with distinct variances to make sure
// they permit lifetimes to be approximated as expected.
#![allow(dead_code)]
diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.rs b/src/test/ui/variance/variance-use-invariant-struct-1.rs
index d40dbceb5..72f50f345 100644
--- a/src/test/ui/variance/variance-use-invariant-struct-1.rs
+++ b/src/test/ui/variance/variance-use-invariant-struct-1.rs
@@ -1,4 +1,4 @@
-// Test various uses of structs with distint variances to make sure
+// Test various uses of structs with distinct variances to make sure
// they permit lifetimes to be approximated as expected.
struct SomeStruct<T>(*mut T);
diff --git a/src/test/ui/wait-forked-but-failed-child.rs b/src/test/ui/wait-forked-but-failed-child.rs
index 0eb0fe071..674c26a43 100644
--- a/src/test/ui/wait-forked-but-failed-child.rs
+++ b/src/test/ui/wait-forked-but-failed-child.rs
@@ -2,6 +2,7 @@
// ignore-emscripten no processes
// ignore-sgx no processes
// ignore-vxworks no 'ps'
+// ignore-fuchsia no 'ps'
#![feature(rustc_private)]
diff --git a/src/test/ui/wf/hir-wf-check-erase-regions.stderr b/src/test/ui/wf/hir-wf-check-erase-regions.stderr
index 037f8b9f3..b04588c57 100644
--- a/src/test/ui/wf/hir-wf-check-erase-regions.stderr
+++ b/src/test/ui/wf/hir-wf-check-erase-regions.stderr
@@ -6,7 +6,7 @@ LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>;
|
= help: the trait `Iterator` is not implemented for `&T`
= help: the trait `Iterator` is implemented for `&mut I`
- = note: required because of the requirements on the impl of `IntoIterator` for `&T`
+ = note: required for `&T` to implement `IntoIterator`
note: required by a bound in `Flatten`
--> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
|
@@ -21,7 +21,7 @@ LL | fn into_iter(self) -> Self::IntoIter {
|
= help: the trait `Iterator` is not implemented for `&T`
= help: the trait `Iterator` is implemented for `&mut I`
- = note: required because of the requirements on the impl of `IntoIterator` for `&T`
+ = note: required for `&T` to implement `IntoIterator`
note: required by a bound in `Flatten`
--> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
|
diff --git a/src/test/ui/wf/issue-103573.rs b/src/test/ui/wf/issue-103573.rs
new file mode 100644
index 000000000..bcbf4f941
--- /dev/null
+++ b/src/test/ui/wf/issue-103573.rs
@@ -0,0 +1,22 @@
+trait TraitA {
+ type TypeA;
+}
+
+trait TraitD {
+ type TypeD;
+}
+
+pub trait TraitB {
+ type TypeB: TraitD;
+
+ fn f(_: &<Self::TypeB as TraitD>::TypeD);
+}
+
+pub trait TraitC<E> {
+ type TypeC<'a>: TraitB;
+
+ fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA);
+ //~^ ERROR the trait bound `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA` is not satisfied
+}
+
+fn main() {}
diff --git a/src/test/ui/wf/issue-103573.stderr b/src/test/ui/wf/issue-103573.stderr
new file mode 100644
index 000000000..fcf3f15e4
--- /dev/null
+++ b/src/test/ui/wf/issue-103573.stderr
@@ -0,0 +1,14 @@
+error[E0277]: the trait bound `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA` is not satisfied
+ --> $DIR/issue-103573.rs:18:5
+ |
+LL | fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `TraitA` is not implemented for `<<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB`
+ |
+help: consider further restricting the associated type
+ |
+LL | fn g<'a>(_: &<<Self::TypeC<'a> as TraitB>::TypeB as TraitA>::TypeA) where <<Self as TraitC<E>>::TypeC<'a> as TraitB>::TypeB: TraitA;
+ | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/wf/wf-const-type.stderr b/src/test/ui/wf/wf-const-type.stderr
index e47920d3d..85938364e 100644
--- a/src/test/ui/wf/wf-const-type.stderr
+++ b/src/test/ui/wf/wf-const-type.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
LL | const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
|
- = note: required because of the requirements on the impl of `Copy` for `Option<NotCopy>`
+ = note: required for `Option<NotCopy>` to implement `Copy`
note: required by a bound in `IsCopy`
--> $DIR/wf-const-type.rs:7:17
|
diff --git a/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr b/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr
index 29dfb585a..6cf4f33f9 100644
--- a/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr
+++ b/src/test/ui/wf/wf-convert-unsafe-trait-obj-box.stderr
@@ -11,7 +11,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
+ = note: required for `Box<S>` to implement `CoerceUnsized<Box<dyn Trait>>`
= note: required by cast to type `Box<dyn Trait>`
error[E0038]: the trait `Trait` cannot be made into an object
@@ -27,7 +27,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
+ = note: required for `Box<S>` to implement `CoerceUnsized<Box<dyn Trait>>`
= note: required by cast to type `Box<(dyn Trait + 'static)>`
error[E0038]: the trait `Trait` cannot be made into an object
@@ -43,7 +43,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn Trait>>` for `Box<S>`
+ = note: required for `Box<S>` to implement `CoerceUnsized<Box<dyn Trait>>`
= note: required by cast to type `Box<dyn Trait>`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr b/src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr
index 02169f26f..c9bd4549a 100644
--- a/src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr
+++ b/src/test/ui/wf/wf-convert-unsafe-trait-obj.stderr
@@ -11,7 +11,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Trait>` for `&S`
+ = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
= note: required by cast to type `&dyn Trait`
error[E0038]: the trait `Trait` cannot be made into an object
@@ -27,7 +27,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Trait>` for `&S`
+ = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
= note: required by cast to type `&dyn Trait`
error[E0038]: the trait `Trait` cannot be made into an object
@@ -43,7 +43,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Trait>` for `&S`
+ = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
= note: required by cast to type `&dyn Trait`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr b/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
index b03023b5f..78312a091 100644
--- a/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
+++ b/src/test/ui/wf/wf-foreign-fn-decl-ret.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `(): Foo` is not satisfied
- --> $DIR/wf-foreign-fn-decl-ret.rs:11:25
+ --> $DIR/wf-foreign-fn-decl-ret.rs:11:5
|
LL | pub fn lint_me() -> <() as Foo>::Assoc;
- | ^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `()`
error[E0277]: the trait bound `u32: Unsatisfied` is not satisfied
--> $DIR/wf-foreign-fn-decl-ret.rs:14:32
diff --git a/src/test/ui/wf/wf-static-type.stderr b/src/test/ui/wf/wf-static-type.stderr
index 4ae69cf2e..16c6124b6 100644
--- a/src/test/ui/wf/wf-static-type.stderr
+++ b/src/test/ui/wf/wf-static-type.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`
|
- = note: required because of the requirements on the impl of `Copy` for `Option<NotCopy>`
+ = note: required for `Option<NotCopy>` to implement `Copy`
note: required by a bound in `IsCopy`
--> $DIR/wf-static-type.rs:7:17
|
diff --git a/src/test/ui/wf/wf-trait-fn-ret.stderr b/src/test/ui/wf/wf-trait-fn-ret.stderr
index a59ba3400..9bd3cc771 100644
--- a/src/test/ui/wf/wf-trait-fn-ret.stderr
+++ b/src/test/ui/wf/wf-trait-fn-ret.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `Self: Eq` is not satisfied
- --> $DIR/wf-trait-fn-ret.rs:10:22
+ --> $DIR/wf-trait-fn-ret.rs:10:23
|
LL | fn bar(&self) -> &Bar<Self>;
- | ^^^^^^^^^^ the trait `Eq` is not implemented for `Self`
+ | ^^^^^^^^^ the trait `Eq` is not implemented for `Self`
|
note: required by a bound in `Bar`
--> $DIR/wf-trait-fn-ret.rs:7:14
diff --git a/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr b/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr
index 6d141a58e..96fc1d36b 100644
--- a/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr
+++ b/src/test/ui/wf/wf-unsafe-trait-obj-match.stderr
@@ -25,7 +25,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Trait>` for `&S`
+ = note: required for `&S` to implement `CoerceUnsized<&dyn Trait>`
= note: required by cast to type `&dyn Trait`
error[E0038]: the trait `Trait` cannot be made into an object
@@ -45,7 +45,7 @@ LL | trait Trait: Sized {}
| ----- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
- = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Trait>` for `&R`
+ = note: required for `&R` to implement `CoerceUnsized<&dyn Trait>`
= note: required by cast to type `&dyn Trait`
error: aborting due to 3 previous errors
diff --git a/src/test/ui/where-clauses/higher-ranked-fn-type.quiet.stderr b/src/test/ui/where-clauses/higher-ranked-fn-type.quiet.stderr
new file mode 100644
index 000000000..30248a7a3
--- /dev/null
+++ b/src/test/ui/where-clauses/higher-ranked-fn-type.quiet.stderr
@@ -0,0 +1,18 @@
+error[E0277]: the trait bound `for<'b> fn(&'b ()): Foo` is not satisfied
+ --> $DIR/higher-ranked-fn-type.rs:20:5
+ |
+LL | called()
+ | ^^^^^^ the trait `for<'b> Foo` is not implemented for `fn(&'b ())`
+ |
+note: required by a bound in `called`
+ --> $DIR/higher-ranked-fn-type.rs:12:25
+ |
+LL | fn called()
+ | ------ required by a bound in this
+LL | where
+LL | for<'b> fn(&'b ()): Foo,
+ | ^^^ required by this bound in `called`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/where-clauses/higher-ranked-fn-type.rs b/src/test/ui/where-clauses/higher-ranked-fn-type.rs
new file mode 100644
index 000000000..ab6edde4e
--- /dev/null
+++ b/src/test/ui/where-clauses/higher-ranked-fn-type.rs
@@ -0,0 +1,25 @@
+// revisions: quiet verbose
+// [verbose]compile-flags: -Zverbose
+
+#![allow(unused_parens)]
+
+trait Foo {
+ type Assoc;
+}
+
+fn called()
+where
+ for<'b> fn(&'b ()): Foo,
+{
+}
+
+fn caller()
+where
+ (for<'a> fn(&'a ())): Foo,
+{
+ called()
+ //[quiet]~^ ERROR the trait bound `for<'b> fn(&'b ()): Foo` is not satisfied
+ //[verbose]~^^ ERROR the trait bound `for<'b> fn(&ReLateBound(
+}
+
+fn main() {}
diff --git a/src/test/ui/where-clauses/higher-ranked-fn-type.verbose.stderr b/src/test/ui/where-clauses/higher-ranked-fn-type.verbose.stderr
new file mode 100644
index 000000000..24660ec35
--- /dev/null
+++ b/src/test/ui/where-clauses/higher-ranked-fn-type.verbose.stderr
@@ -0,0 +1,18 @@
+error[E0277]: the trait bound `for<'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
+ --> $DIR/higher-ranked-fn-type.rs:20:5
+ |
+LL | called()
+ | ^^^^^^ the trait `for<'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) }) ())`
+ |
+note: required by a bound in `called`
+ --> $DIR/higher-ranked-fn-type.rs:12:25
+ |
+LL | fn called()
+ | ------ required by a bound in this
+LL | where
+LL | for<'b> fn(&'b ()): Foo,
+ | ^^^ required by this bound in `called`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/where-clauses/where-clause-method-substituion.stderr b/src/test/ui/where-clauses/where-clause-method-substituion.stderr
index f431deee7..8c47ed6d4 100644
--- a/src/test/ui/where-clauses/where-clause-method-substituion.stderr
+++ b/src/test/ui/where-clauses/where-clause-method-substituion.stderr
@@ -1,8 +1,8 @@
error[E0277]: the trait bound `X: Foo<X>` is not satisfied
- --> $DIR/where-clause-method-substituion.rs:20:7
+ --> $DIR/where-clause-method-substituion.rs:20:16
|
LL | 1.method::<X>();
- | ^^^^^^ the trait `Foo<X>` is not implemented for `X`
+ | ^ the trait `Foo<X>` is not implemented for `X`
|
note: required by a bound in `Bar::method`
--> $DIR/where-clause-method-substituion.rs:6:34
diff --git a/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr b/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr
index c13552bc2..e90502977 100644
--- a/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr
+++ b/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr
@@ -1,10 +1,8 @@
error[E0277]: the trait bound `Bar: Eq` is not satisfied
- --> $DIR/where-clauses-method-unsatisfied.rs:18:14
+ --> $DIR/where-clauses-method-unsatisfied.rs:18:7
|
LL | x.equals(&x);
- | ------ ^^ the trait `Eq` is not implemented for `Bar`
- | |
- | required by a bound introduced by this call
+ | ^^^^^^ the trait `Eq` is not implemented for `Bar`
|
note: required by a bound in `Foo::<T>::equals`
--> $DIR/where-clauses-method-unsatisfied.rs:11:52