From 0488afd9677ee987d3c80c18639105ea26dd6f40 Mon Sep 17 00:00:00 2001 From: Steve Heindel Date: Thu, 4 Feb 2021 21:17:55 -0500 Subject: [PATCH 01/10] Fix doc test for Vec::retain(), now passes clippy::eval_order_dependence --- library/alloc/src/vec/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index ede1601fa33cc..e808665837b08 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1385,13 +1385,14 @@ impl Vec { /// assert_eq!(vec, [2, 4]); /// ``` /// - /// The exact order may be useful for tracking external state, like an index. + /// Because the elements are visited exactly once in the original order, + /// external state may be used to decide which elements to keep. /// /// ``` /// let mut vec = vec![1, 2, 3, 4, 5]; /// let keep = [false, true, true, false, true]; - /// let mut i = 0; - /// vec.retain(|_| (keep[i], i += 1).0); + /// let mut iter = keep.iter(); + /// vec.retain(|_| *iter.next().unwrap()); /// assert_eq!(vec, [2, 3, 5]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] From 0d96a79fb875a38df6d8f7216f094959c4de3761 Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Mon, 8 Feb 2021 23:15:45 +0100 Subject: [PATCH 02/10] Organize trait test files --- .../ambiguous.rs} | 0 .../ambiguous.stderr} | 6 +- .../auxiliary/greeter.rs} | 0 .../auxiliary/send_sync.rs} | 0 .../trait-alias.rs => alias/basic.rs} | 0 .../trait-alias-bounds.rs => alias/bounds.rs} | 0 .../cross-crate.rs} | 6 +- .../cross-crate.stderr} | 4 +- .../trait-alias-impl.rs => alias/impl.rs} | 0 .../impl.stderr} | 2 +- .../import-cross-crate.rs} | 6 +- .../import.rs} | 0 .../issue-60021-assoc-method-resolve.rs | 0 .../issue-72415-assoc-const-resolve.rs | 0 .../{trait-alias => alias}/issue-75983.rs | 0 .../maybe-bound.rs} | 0 .../no-duplicates.rs} | 0 .../no-duplicates.stderr} | 54 +++++++++--------- .../no-extra-traits.rs} | 0 .../no-extra-traits.stderr} | 56 +++++++++---------- .../object-fail.rs} | 0 .../object-fail.stderr} | 4 +- .../object-wf.rs} | 0 .../trait-alias-object.rs => alias/object.rs} | 0 .../only-maybe-bound.rs} | 0 .../only-maybe-bound.stderr} | 4 +- .../syntax-fail.rs} | 0 .../syntax-fail.stderr} | 8 +-- .../trait-alias-syntax.rs => alias/syntax.rs} | 0 .../trait-alias-wf.rs => alias/wf.rs} | 0 .../trait-alias-wf.stderr => alias/wf.stderr} | 2 +- ...static-method.rs => anon-static-method.rs} | 0 ...onstructor.rs => as-struct-constructor.rs} | 0 ...or.stderr => as-struct-constructor.stderr} | 2 +- ...trait-bad.rs => assoc-type-in-superbad.rs} | 0 ...d.stderr => assoc-type-in-superbad.stderr} | 2 +- ...ertrait.rs => assoc-type-in-supertrait.rs} | 0 .../assoc_type_bound_with_struct.rs | 0 .../assoc_type_bound_with_struct.stderr | 0 .../check-trait-object-bounds-1.rs | 0 .../check-trait-object-bounds-1.stderr | 0 .../check-trait-object-bounds-2-ok.rs | 0 .../check-trait-object-bounds-2.rs | 0 .../check-trait-object-bounds-2.stderr | 0 .../check-trait-object-bounds-3.rs | 0 .../check-trait-object-bounds-3.stderr | 0 .../check-trait-object-bounds-4.rs | 0 .../check-trait-object-bounds-4.stderr | 0 .../check-trait-object-bounds-5.rs | 0 .../check-trait-object-bounds-5.stderr | 0 .../check-trait-object-bounds-6.rs | 0 .../check-trait-object-bounds-6.stderr | 0 ...e.rs => astconv-cycle-between-and-type.rs} | 0 .../traits/{ => bound}/auxiliary/crate_a1.rs | 0 .../traits/{ => bound}/auxiliary/crate_a2.rs | 0 .../auxiliary/on_structs_and_enums_xc.rs} | 0 .../{trait-bounds-basic.rs => bound/basic.rs} | 0 .../generic_trait.rs} | 0 .../impl-comparison-duplicates.rs} | 0 .../in-arc.rs} | 0 .../multiple.rs} | 0 .../not-on-bare-trait.rs} | 0 .../not-on-bare-trait.stderr} | 4 +- .../not-on-struct.rs} | 0 .../not-on-struct.stderr} | 38 ++++++------- .../on-structs-and-enums-in-fns.rs} | 0 .../on-structs-and-enums-in-fns.stderr} | 4 +- .../on-structs-and-enums-in-impls.rs} | 0 .../on-structs-and-enums-in-impls.stderr} | 2 +- .../on-structs-and-enums-locals.rs} | 0 .../on-structs-and-enums-locals.stderr} | 4 +- .../on-structs-and-enums-rpass.rs} | 0 .../on-structs-and-enums-static.rs} | 0 .../on-structs-and-enums-static.stderr} | 2 +- .../traits/bound/on-structs-and-enums-xc.rs | 14 +++++ .../on-structs-and-enums-xc.stderr} | 8 +-- .../traits/bound/on-structs-and-enums-xc1.rs | 15 +++++ .../on-structs-and-enums-xc1.stderr} | 6 +- .../on-structs-and-enums.rs} | 0 .../on-structs-and-enums.stderr} | 14 ++--- .../recursion.rs} | 0 .../same-crate-name.rs} | 0 .../same-crate-name.stderr} | 8 +-- .../{trait-bounds-sugar.rs => bound/sugar.rs} | 0 .../sugar.stderr} | 2 +- ...he-issue-18209.rs => cache-issue-18209.rs} | 0 ...generic-bad.rs => coercion-generic-bad.rs} | 0 ...bad.stderr => coercion-generic-bad.stderr} | 2 +- ...regions.rs => coercion-generic-regions.rs} | 0 ...stderr => coercion-generic-regions.stderr} | 2 +- ...oercion-generic.rs => coercion-generic.rs} | 0 .../traits/{trait-coercion.rs => coercion.rs} | 0 ...tion-trivial.rs => composition-trivial.rs} | 0 ...al-dispatch.rs => conditional-dispatch.rs} | 0 ...al-model-fn.rs => conditional-model-fn.rs} | 0 ...rait-copy-guessing.rs => copy-guessing.rs} | 0 ...rait-type-trait.rs => cycle-type-trait.rs} | 0 .../auxiliary/xc.rs} | 0 .../auxiliary/xc_2.rs} | 4 +- .../bound-subst.rs} | 0 .../bound-subst2.rs} | 0 .../bound-subst3.rs} | 0 .../bound-subst4.rs} | 0 .../bound.rs} | 0 .../macro.rs} | 0 .../mut.rs} | 0 .../self.rs} | 0 .../supervtable.rs} | 0 .../trivial.rs} | 0 .../xc-2.rs} | 8 +-- .../xc.rs} | 4 +- ...licate-methods.rs => duplicate-methods.rs} | 0 ...ethods.stderr => duplicate-methods.stderr} | 2 +- ...ype-region.rs => elaborate-type-region.rs} | 0 ...e-ambiguity-where-clause-builtin-bound.rs} | 0 .../traits/{trait-generic.rs => generic.rs} | 0 .../ui/traits/{trait-impl-1.rs => impl-1.rs} | 0 .../{trait-impl-1.stderr => impl-1.stderr} | 2 +- .../ui/traits/{trait-impl-2.rs => impl-2.rs} | 0 ... => impl-can-not-have-untraitful-items.rs} | 0 ...impl-can-not-have-untraitful-items.stderr} | 6 +- ...params.rs => impl-different-num-params.rs} | 0 ...tderr => impl-different-num-params.stderr} | 2 +- ...-impl-for-module.rs => impl-for-module.rs} | 0 ...r-module.stderr => impl-for-module.stderr} | 2 +- ...od-mismatch.rs => impl-method-mismatch.rs} | 0 ...tch.stderr => impl-method-mismatch.stderr} | 2 +- ....rs => impl-object-overlap-issue-23853.rs} | 0 ...pertrait-has-wrong-lifetime-parameters.rs} | 0 ...rait-has-wrong-lifetime-parameters.stderr} | 8 +-- src/test/ui/traits/{trait-impl.rs => impl.rs} | 0 .../lifetime.rs} | 0 .../lifetime.stderr} | 2 +- .../simultaneous.rs} | 0 .../simultaneous.stderr} | 2 +- .../supertrait-auto-trait.rs} | 0 .../supertrait-auto-trait.stderr} | 4 +- .../supertrait.rs} | 0 .../supertrait.stderr} | 2 +- .../two-traits.rs} | 0 .../two-traits.stderr} | 4 +- ...52.rs => infer-from-object-issue-26952.rs} | 0 ...thod-order.rs => inherent-method-order.rs} | 0 .../auto-xc-2.rs} | 4 +- .../auto-xc.rs} | 4 +- .../auto.rs} | 0 .../auxiliary/auto_xc.rs} | 0 .../auxiliary/auto_xc_2.rs} | 0 .../auxiliary/overloading_xc.rs} | 0 .../auxiliary/xc_call.rs} | 0 .../basic.rs} | 0 .../call-bound-inherited.rs} | 0 .../call-bound-inherited2.rs} | 0 .../cast-without-call-to-supertrait.rs} | 0 .../cast.rs} | 0 .../cross-trait-call-xc.rs} | 4 +- .../cross-trait-call.rs} | 0 .../diamond.rs} | 0 .../multiple-inheritors.rs} | 0 .../multiple-params.rs} | 0 .../num.rs} | 0 .../num0.rs} | 0 .../num1.rs} | 0 .../num2.rs} | 0 .../num3.rs} | 0 .../num5.rs} | 0 .../overloading-simple.rs} | 0 .../overloading-xc-exe.rs} | 6 +- .../overloading.rs} | 0 .../repeated-supertrait-ambig.rs} | 0 .../repeated-supertrait-ambig.stderr} | 10 ++-- .../repeated-supertrait.rs} | 0 .../self-in-supertype.rs} | 0 .../self.rs} | 0 .../simple.rs} | 0 .../static.rs} | 0 .../static2.rs} | 0 .../subst.rs} | 0 .../subst2.rs} | 0 .../visibility.rs} | 0 .../{traits-issue-22019.rs => issue-22019.rs} | 0 .../{traits-issue-22110.rs => issue-22110.rs} | 0 .../{traits-issue-22655.rs => issue-22655.rs} | 0 ...03-overflow.rs => issue-23003-overflow.rs} | 0 .../{traits-issue-23003.rs => issue-23003.rs} | 0 .../{traits-issue-26339.rs => issue-26339.rs} | 0 .../{traits-issue-71136.rs => issue-71136.rs} | 0 ...-issue-71136.stderr => issue-71136.stderr} | 2 +- ...calls.rs => issue-9394-inherited-calls.rs} | 0 ...m-inside-macro.rs => item-inside-macro.rs} | 0 ...{trait-item-privacy.rs => item-privacy.rs} | 0 ...tem-privacy.stderr => item-privacy.stderr} | 38 ++++++------- ...ntains-1.rs => kindck-owned-contains-1.rs} | 0 ...ing-lifetimes.rs => matching-lifetimes.rs} | 0 ...times.stderr => matching-lifetimes.stderr} | 12 ++-- ...it-method-private.rs => method-private.rs} | 0 ...d-private.stderr => method-private.stderr} | 2 +- ...tidispatch-bad.rs => multidispatch-bad.rs} | 0 ...ch-bad.stderr => multidispatch-bad.stderr} | 2 +- ...rs => multidispatch-convert-ambig-dest.rs} | 0 ...> multidispatch-convert-ambig-dest.stderr} | 2 +- ... => multidispatch-infer-convert-target.rs} | 0 .../auto-dedup-in-impl.rs} | 0 .../auto-dedup-in-impl.stderr} | 2 +- .../auto-dedup.rs} | 0 .../bounds-cycle-1.rs} | 0 .../bounds-cycle-2.rs} | 0 .../bounds-cycle-3.rs} | 0 .../bounds-cycle-4.rs} | 0 .../exclusion.rs} | 0 .../generics.rs} | 0 .../lifetime-first.rs} | 0 .../macro-matcher.rs} | 0 .../macro-matcher.stderr} | 4 +- .../safety.rs} | 0 .../safety.stderr} | 8 +-- .../supertrait-lifetime-bound.rs} | 0 .../vs-lifetime-2.rs} | 0 .../vs-lifetime-2.stderr} | 2 +- .../vs-lifetime.rs} | 0 .../vs-lifetime.stderr} | 14 ++--- .../with-lifetime-bound.rs} | 0 .../with-self-in-projection-output-bad.rs} | 0 ...with-self-in-projection-output-bad.stderr} | 4 +- .../with-self-in-projection-output-good.rs} | 0 ...-projection-output-repeated-supertrait.rs} | 0 ...s => param-without-lifetime-constraint.rs} | 0 ... param-without-lifetime-constraint.stderr} | 4 +- ...bounds.rs => parameterized-with-bounds.rs} | 0 ...t-objects.rs => principal-less-objects.rs} | 0 .../traits/{trait-privacy.rs => privacy.rs} | 0 ...ter-simple.rs => region-pointer-simple.rs} | 0 .../coherence-conflict.rs} | 0 .../coherence-conflict.stderr} | 2 +- .../no-use.rs} | 0 .../no-use.stderr} | 2 +- .../non-lattice-ok.rs} | 0 .../ok.rs} | 0 ...d-op.rs => resolution-in-overloaded-op.rs} | 0 ...err => resolution-in-overloaded-op.stderr} | 2 +- ...it-safety-fn-body.rs => safety-fn-body.rs} | 0 ...y-fn-body.stderr => safety-fn-body.stderr} | 2 +- ...herent-impl.rs => safety-inherent-impl.rs} | 0 ...mpl.stderr => safety-inherent-impl.stderr} | 2 +- ...{trait-safety-ok-cc.rs => safety-ok-cc.rs} | 0 .../{trait-safety-ok.rs => safety-ok.rs} | 0 ...ait-impl-cc.rs => safety-trait-impl-cc.rs} | 0 ...-cc.stderr => safety-trait-impl-cc.stderr} | 2 +- ...ety-trait-impl.rs => safety-trait-impl.rs} | 0 ...t-impl.stderr => safety-trait-impl.stderr} | 4 +- ....rs => static-method-generic-inference.rs} | 0 ...=> static-method-generic-inference.stderr} | 2 +- ...riting.rs => static-method-overwriting.rs} | 0 ...e.rs => static-outlives-a-where-clause.rs} | 0 .../issue-39029.fixed} | 0 .../issue-39029.rs} | 0 .../issue-39029.stderr} | 2 +- .../issue-62530.fixed} | 0 .../issue-62530.rs} | 0 .../issue-62530.stderr} | 2 +- .../multiple-0.fixed} | 0 .../multiple-0.rs} | 0 .../multiple-0.stderr} | 2 +- .../multiple-1.rs} | 0 .../multiple-1.stderr} | 2 +- ...here-clause.rs => suggest-where-clause.rs} | 0 ...use.stderr => suggest-where-clause.stderr} | 14 ++--- ...t-generics.rs => superdefault-generics.rs} | 0 ...x-trait-polarity.rs => syntax-polarity.rs} | 0 .../ui/traits/{trait-test-2.rs => test-2.rs} | 0 .../{trait-test-2.stderr => test-2.stderr} | 16 +++--- src/test/ui/traits/{trait-test.rs => test.rs} | 0 .../traits/{trait-test.stderr => test.stderr} | 2 +- .../ui/traits/{trait-to-str.rs => to-str.rs} | 0 .../trait-bounds-on-structs-and-enums-xc.rs | 14 ----- .../trait-bounds-on-structs-and-enums-xc1.rs | 15 ----- .../{ufcs-trait-object.rs => ufcs-object.rs} | 0 ...-trait-before-def.rs => use-before-def.rs} | 0 .../maybe-bound.rs} | 0 .../maybe-bound.stderr} | 10 ++-- .../no-duplicates.rs} | 0 .../no-duplicates.stderr} | 10 ++-- .../only-maybe-bound.rs} | 0 .../only-maybe-bound.stderr} | 4 +- .../reverse-order.rs} | 0 ...use-vs-impl.rs => where-clause-vs-impl.rs} | 0 ...unds-default.rs => with-bounds-default.rs} | 0 .../traits/{trait-with-dst.rs => with-dst.rs} | 0 288 files changed, 285 insertions(+), 285 deletions(-) rename src/test/ui/traits/{trait-alias-ambiguous.rs => alias/ambiguous.rs} (100%) rename src/test/ui/traits/{trait-alias-ambiguous.stderr => alias/ambiguous.stderr} (85%) rename src/test/ui/traits/{auxiliary/trait_alias.rs => alias/auxiliary/greeter.rs} (100%) rename src/test/ui/traits/{trait-alias/auxiliary/trait_alias.rs => alias/auxiliary/send_sync.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias.rs => alias/basic.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-bounds.rs => alias/bounds.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-cross-crate.rs => alias/cross-crate.rs} (78%) rename src/test/ui/traits/{trait-alias/trait-alias-cross-crate.stderr => alias/cross-crate.stderr} (90%) rename src/test/ui/traits/{trait-alias/trait-alias-impl.rs => alias/impl.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-impl.stderr => alias/impl.stderr} (87%) rename src/test/ui/traits/{trait-alias-import-cross-crate.rs => alias/import-cross-crate.rs} (66%) rename src/test/ui/traits/{trait-alias-import.rs => alias/import.rs} (100%) rename src/test/ui/traits/{trait-alias => alias}/issue-60021-assoc-method-resolve.rs (100%) rename src/test/ui/traits/{trait-alias => alias}/issue-72415-assoc-const-resolve.rs (100%) rename src/test/ui/traits/{trait-alias => alias}/issue-75983.rs (100%) rename src/test/ui/traits/{trait-alias/trait-alias-maybe-bound.rs => alias/maybe-bound.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-no-duplicates.rs => alias/no-duplicates.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-no-duplicates.stderr => alias/no-duplicates.stderr} (95%) rename src/test/ui/traits/{trait-alias/trait-alias-no-extra-traits.rs => alias/no-extra-traits.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-no-extra-traits.stderr => alias/no-extra-traits.stderr} (95%) rename src/test/ui/traits/{trait-alias/trait-alias-object-fail.rs => alias/object-fail.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-object-fail.stderr => alias/object-fail.stderr} (92%) rename src/test/ui/traits/{trait-alias/trait-alias-object-wf.rs => alias/object-wf.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-object.rs => alias/object.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-only-maybe-bound.rs => alias/only-maybe-bound.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-only-maybe-bound.stderr => alias/only-maybe-bound.stderr} (77%) rename src/test/ui/traits/{trait-alias/trait-alias-syntax-fail.rs => alias/syntax-fail.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-syntax-fail.stderr => alias/syntax-fail.stderr} (74%) rename src/test/ui/traits/{trait-alias/trait-alias-syntax.rs => alias/syntax.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-wf.rs => alias/wf.rs} (100%) rename src/test/ui/traits/{trait-alias/trait-alias-wf.stderr => alias/wf.stderr} (92%) rename src/test/ui/traits/{anon-trait-static-method.rs => anon-static-method.rs} (100%) rename src/test/ui/traits/{trait-as-struct-constructor.rs => as-struct-constructor.rs} (100%) rename src/test/ui/traits/{trait-as-struct-constructor.stderr => as-struct-constructor.stderr} (86%) rename src/test/ui/traits/{traits-assoc-type-in-supertrait-bad.rs => assoc-type-in-superbad.rs} (100%) rename src/test/ui/traits/{traits-assoc-type-in-supertrait-bad.stderr => assoc-type-in-superbad.stderr} (83%) rename src/test/ui/traits/{traits-assoc-type-in-supertrait.rs => assoc-type-in-supertrait.rs} (100%) rename src/test/ui/traits/{ => associated_type_bound}/assoc_type_bound_with_struct.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/assoc_type_bound_with_struct.stderr (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-1.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-1.stderr (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-2-ok.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-2.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-2.stderr (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-3.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-3.stderr (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-4.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-4.stderr (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-5.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-5.stderr (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-6.rs (100%) rename src/test/ui/traits/{ => associated_type_bound}/check-trait-object-bounds-6.stderr (100%) rename src/test/ui/traits/{astconv-cycle-between-trait-and-type.rs => astconv-cycle-between-and-type.rs} (100%) rename src/test/ui/traits/{ => bound}/auxiliary/crate_a1.rs (100%) rename src/test/ui/traits/{ => bound}/auxiliary/crate_a2.rs (100%) rename src/test/ui/traits/{auxiliary/trait_bounds_on_structs_and_enums_xc.rs => bound/auxiliary/on_structs_and_enums_xc.rs} (100%) rename src/test/ui/traits/{trait-bounds-basic.rs => bound/basic.rs} (100%) rename src/test/ui/traits/{trait-bounds.rs => bound/generic_trait.rs} (100%) rename src/test/ui/traits/{trait-bounds-impl-comparison-duplicates.rs => bound/impl-comparison-duplicates.rs} (100%) rename src/test/ui/traits/{trait-bounds-in-arc.rs => bound/in-arc.rs} (100%) rename src/test/ui/traits/{multiple-trait-bounds.rs => bound/multiple.rs} (100%) rename src/test/ui/traits/{trait-bounds-not-on-bare-trait.rs => bound/not-on-bare-trait.rs} (100%) rename src/test/ui/traits/{trait-bounds-not-on-bare-trait.stderr => bound/not-on-bare-trait.stderr} (89%) rename src/test/ui/traits/{trait-bounds-not-on-struct.rs => bound/not-on-struct.rs} (100%) rename src/test/ui/traits/{trait-bounds-not-on-struct.stderr => bound/not-on-struct.stderr} (86%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-in-fns.rs => bound/on-structs-and-enums-in-fns.rs} (100%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-in-fns.stderr => bound/on-structs-and-enums-in-fns.stderr} (83%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-in-impls.rs => bound/on-structs-and-enums-in-impls.rs} (100%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-in-impls.stderr => bound/on-structs-and-enums-in-impls.stderr} (85%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-locals.rs => bound/on-structs-and-enums-locals.rs} (100%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-locals.stderr => bound/on-structs-and-enums-locals.stderr} (83%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-rpass.rs => bound/on-structs-and-enums-rpass.rs} (100%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-static.rs => bound/on-structs-and-enums-static.rs} (100%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-static.stderr => bound/on-structs-and-enums-static.stderr} (86%) create mode 100644 src/test/ui/traits/bound/on-structs-and-enums-xc.rs rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-xc.stderr => bound/on-structs-and-enums-xc.stderr} (72%) create mode 100644 src/test/ui/traits/bound/on-structs-and-enums-xc1.rs rename src/test/ui/traits/{trait-bounds-on-structs-and-enums-xc1.stderr => bound/on-structs-and-enums-xc1.stderr} (76%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums.rs => bound/on-structs-and-enums.rs} (100%) rename src/test/ui/traits/{trait-bounds-on-structs-and-enums.stderr => bound/on-structs-and-enums.stderr} (85%) rename src/test/ui/traits/{trait-bounds-recursion.rs => bound/recursion.rs} (100%) rename src/test/ui/traits/{trait-bounds-same-crate-name.rs => bound/same-crate-name.rs} (100%) rename src/test/ui/traits/{trait-bounds-same-crate-name.stderr => bound/same-crate-name.stderr} (92%) rename src/test/ui/traits/{trait-bounds-sugar.rs => bound/sugar.rs} (100%) rename src/test/ui/traits/{trait-bounds-sugar.stderr => bound/sugar.stderr} (90%) rename src/test/ui/traits/{trait-cache-issue-18209.rs => cache-issue-18209.rs} (100%) rename src/test/ui/traits/{trait-coercion-generic-bad.rs => coercion-generic-bad.rs} (100%) rename src/test/ui/traits/{trait-coercion-generic-bad.stderr => coercion-generic-bad.stderr} (92%) rename src/test/ui/traits/{trait-coercion-generic-regions.rs => coercion-generic-regions.rs} (100%) rename src/test/ui/traits/{trait-coercion-generic-regions.stderr => coercion-generic-regions.stderr} (91%) rename src/test/ui/traits/{trait-coercion-generic.rs => coercion-generic.rs} (100%) rename src/test/ui/traits/{trait-coercion.rs => coercion.rs} (100%) rename src/test/ui/traits/{trait-composition-trivial.rs => composition-trivial.rs} (100%) rename src/test/ui/traits/{traits-conditional-dispatch.rs => conditional-dispatch.rs} (100%) rename src/test/ui/traits/{traits-conditional-model-fn.rs => conditional-model-fn.rs} (100%) rename src/test/ui/traits/{trait-copy-guessing.rs => copy-guessing.rs} (100%) rename src/test/ui/traits/{cycle-trait-type-trait.rs => cycle-type-trait.rs} (100%) rename src/test/ui/traits/{auxiliary/trait_default_method_xc_aux.rs => default-method/auxiliary/xc.rs} (100%) rename src/test/ui/traits/{auxiliary/trait_default_method_xc_aux_2.rs => default-method/auxiliary/xc_2.rs} (73%) rename src/test/ui/traits/{trait-default-method-bound-subst.rs => default-method/bound-subst.rs} (100%) rename src/test/ui/traits/{trait-default-method-bound-subst2.rs => default-method/bound-subst2.rs} (100%) rename src/test/ui/traits/{trait-default-method-bound-subst3.rs => default-method/bound-subst3.rs} (100%) rename src/test/ui/traits/{trait-default-method-bound-subst4.rs => default-method/bound-subst4.rs} (100%) rename src/test/ui/traits/{trait-default-method-bound.rs => default-method/bound.rs} (100%) rename src/test/ui/traits/{traits-default-method-macro.rs => default-method/macro.rs} (100%) rename src/test/ui/traits/{traits-default-method-mut.rs => default-method/mut.rs} (100%) rename src/test/ui/traits/{traits-default-method-self.rs => default-method/self.rs} (100%) rename src/test/ui/traits/{default-method-supertrait-vtable.rs => default-method/supervtable.rs} (100%) rename src/test/ui/traits/{traits-default-method-trivial.rs => default-method/trivial.rs} (100%) rename src/test/ui/traits/{trait-default-method-xc-2.rs => default-method/xc-2.rs} (63%) rename src/test/ui/traits/{trait-default-method-xc.rs => default-method/xc.rs} (94%) rename src/test/ui/traits/{trait-duplicate-methods.rs => duplicate-methods.rs} (100%) rename src/test/ui/traits/{trait-duplicate-methods.stderr => duplicate-methods.stderr} (91%) rename src/test/ui/traits/{traits-elaborate-type-region.rs => elaborate-type-region.rs} (100%) rename src/test/ui/traits/{trait-false-ambiguity-where-clause-builtin-bound.rs => false-ambiguity-where-clause-builtin-bound.rs} (100%) rename src/test/ui/traits/{trait-generic.rs => generic.rs} (100%) rename src/test/ui/traits/{trait-impl-1.rs => impl-1.rs} (100%) rename src/test/ui/traits/{trait-impl-1.stderr => impl-1.stderr} (88%) rename src/test/ui/traits/{trait-impl-2.rs => impl-2.rs} (100%) rename src/test/ui/traits/{trait-impl-can-not-have-untraitful-items.rs => impl-can-not-have-untraitful-items.rs} (100%) rename src/test/ui/traits/{trait-impl-can-not-have-untraitful-items.stderr => impl-can-not-have-untraitful-items.stderr} (76%) rename src/test/ui/traits/{trait-impl-different-num-params.rs => impl-different-num-params.rs} (100%) rename src/test/ui/traits/{trait-impl-different-num-params.stderr => impl-different-num-params.stderr} (88%) rename src/test/ui/traits/{trait-impl-for-module.rs => impl-for-module.rs} (100%) rename src/test/ui/traits/{trait-impl-for-module.stderr => impl-for-module.stderr} (88%) rename src/test/ui/traits/{trait-impl-method-mismatch.rs => impl-method-mismatch.rs} (100%) rename src/test/ui/traits/{trait-impl-method-mismatch.stderr => impl-method-mismatch.stderr} (92%) rename src/test/ui/traits/{traits-impl-object-overlap-issue-23853.rs => impl-object-overlap-issue-23853.rs} (100%) rename src/test/ui/traits/{trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs => impl-of-supertrait-has-wrong-lifetime-parameters.rs} (100%) rename src/test/ui/traits/{trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr => impl-of-supertrait-has-wrong-lifetime-parameters.stderr} (72%) rename src/test/ui/traits/{trait-impl.rs => impl.rs} (100%) rename src/test/ui/traits/{traits-inductive-overflow-lifetime.rs => inductive-overflow/lifetime.rs} (100%) rename src/test/ui/traits/{traits-inductive-overflow-lifetime.stderr => inductive-overflow/lifetime.stderr} (89%) rename src/test/ui/traits/{traits-inductive-overflow-simultaneous.rs => inductive-overflow/simultaneous.rs} (100%) rename src/test/ui/traits/{traits-inductive-overflow-simultaneous.stderr => inductive-overflow/simultaneous.stderr} (87%) rename src/test/ui/traits/{traits-inductive-overflow-supertrait-auto-trait.rs => inductive-overflow/supertrait-auto-trait.rs} (100%) rename src/test/ui/traits/{traits-inductive-overflow-supertrait-auto-trait.stderr => inductive-overflow/supertrait-auto-trait.stderr} (85%) rename src/test/ui/traits/{traits-inductive-overflow-supertrait.rs => inductive-overflow/supertrait.rs} (100%) rename src/test/ui/traits/{traits-inductive-overflow-supertrait.stderr => inductive-overflow/supertrait.stderr} (88%) rename src/test/ui/traits/{traits-inductive-overflow-two-traits.rs => inductive-overflow/two-traits.rs} (100%) rename src/test/ui/traits/{traits-inductive-overflow-two-traits.stderr => inductive-overflow/two-traits.stderr} (87%) rename src/test/ui/traits/{infer-from-object-trait-issue-26952.rs => infer-from-object-issue-26952.rs} (100%) rename src/test/ui/traits/{inherent-trait-method-order.rs => inherent-method-order.rs} (100%) rename src/test/ui/traits/{trait-inheritance-auto-xc-2.rs => inheritance/auto-xc-2.rs} (78%) rename src/test/ui/traits/{trait-inheritance-auto-xc.rs => inheritance/auto-xc.rs} (80%) rename src/test/ui/traits/{trait-inheritance-auto.rs => inheritance/auto.rs} (100%) rename src/test/ui/traits/{auxiliary/trait_inheritance_auto_xc_aux.rs => inheritance/auxiliary/auto_xc.rs} (100%) rename src/test/ui/traits/{auxiliary/trait_inheritance_auto_xc_2_aux.rs => inheritance/auxiliary/auto_xc_2.rs} (100%) rename src/test/ui/traits/{auxiliary/trait_inheritance_overloading_xc.rs => inheritance/auxiliary/overloading_xc.rs} (100%) rename src/test/ui/traits/{auxiliary/trait_xc_call_aux.rs => inheritance/auxiliary/xc_call.rs} (100%) rename src/test/ui/traits/{trait-inheritance2.rs => inheritance/basic.rs} (100%) rename src/test/ui/traits/{trait-inheritance-call-bound-inherited.rs => inheritance/call-bound-inherited.rs} (100%) rename src/test/ui/traits/{trait-inheritance-call-bound-inherited2.rs => inheritance/call-bound-inherited2.rs} (100%) rename src/test/ui/traits/{trait-inheritance-cast-without-call-to-supertrait.rs => inheritance/cast-without-call-to-supertrait.rs} (100%) rename src/test/ui/traits/{trait-inheritance-cast.rs => inheritance/cast.rs} (100%) rename src/test/ui/traits/{trait-inheritance-cross-trait-call-xc.rs => inheritance/cross-trait-call-xc.rs} (74%) rename src/test/ui/traits/{trait-inheritance-cross-trait-call.rs => inheritance/cross-trait-call.rs} (100%) rename src/test/ui/traits/{trait-inheritance-diamond.rs => inheritance/diamond.rs} (100%) rename src/test/ui/traits/{trait-inheritance-multiple-inheritors.rs => inheritance/multiple-inheritors.rs} (100%) rename src/test/ui/traits/{trait-inheritance-multiple-params.rs => inheritance/multiple-params.rs} (100%) rename src/test/ui/traits/{trait-inheritance-num.rs => inheritance/num.rs} (100%) rename src/test/ui/traits/{trait-inheritance-num0.rs => inheritance/num0.rs} (100%) rename src/test/ui/traits/{trait-inheritance-num1.rs => inheritance/num1.rs} (100%) rename src/test/ui/traits/{trait-inheritance-num2.rs => inheritance/num2.rs} (100%) rename src/test/ui/traits/{trait-inheritance-num3.rs => inheritance/num3.rs} (100%) rename src/test/ui/traits/{trait-inheritance-num5.rs => inheritance/num5.rs} (100%) rename src/test/ui/traits/{trait-inheritance-overloading-simple.rs => inheritance/overloading-simple.rs} (100%) rename src/test/ui/traits/{trait-inheritance-overloading-xc-exe.rs => inheritance/overloading-xc-exe.rs} (68%) rename src/test/ui/traits/{trait-inheritance-overloading.rs => inheritance/overloading.rs} (100%) rename src/test/ui/traits/{traits-repeated-supertrait-ambig.rs => inheritance/repeated-supertrait-ambig.rs} (100%) rename src/test/ui/traits/{traits-repeated-supertrait-ambig.stderr => inheritance/repeated-supertrait-ambig.stderr} (87%) rename src/test/ui/traits/{traits-repeated-supertrait.rs => inheritance/repeated-supertrait.rs} (100%) rename src/test/ui/traits/{trait-inheritance-self-in-supertype.rs => inheritance/self-in-supertype.rs} (100%) rename src/test/ui/traits/{trait-inheritance-self.rs => inheritance/self.rs} (100%) rename src/test/ui/traits/{trait-inheritance-simple.rs => inheritance/simple.rs} (100%) rename src/test/ui/traits/{trait-inheritance-static.rs => inheritance/static.rs} (100%) rename src/test/ui/traits/{trait-inheritance-static2.rs => inheritance/static2.rs} (100%) rename src/test/ui/traits/{trait-inheritance-subst.rs => inheritance/subst.rs} (100%) rename src/test/ui/traits/{trait-inheritance-subst2.rs => inheritance/subst2.rs} (100%) rename src/test/ui/traits/{trait-inheritance-visibility.rs => inheritance/visibility.rs} (100%) rename src/test/ui/traits/{traits-issue-22019.rs => issue-22019.rs} (100%) rename src/test/ui/traits/{traits-issue-22110.rs => issue-22110.rs} (100%) rename src/test/ui/traits/{traits-issue-22655.rs => issue-22655.rs} (100%) rename src/test/ui/traits/{traits-issue-23003-overflow.rs => issue-23003-overflow.rs} (100%) rename src/test/ui/traits/{traits-issue-23003.rs => issue-23003.rs} (100%) rename src/test/ui/traits/{traits-issue-26339.rs => issue-26339.rs} (100%) rename src/test/ui/traits/{traits-issue-71136.rs => issue-71136.rs} (100%) rename src/test/ui/traits/{traits-issue-71136.stderr => issue-71136.stderr} (93%) rename src/test/ui/traits/{issue-9394-inherited-trait-calls.rs => issue-9394-inherited-calls.rs} (100%) rename src/test/ui/traits/{trait-item-inside-macro.rs => item-inside-macro.rs} (100%) rename src/test/ui/traits/{trait-item-privacy.rs => item-privacy.rs} (100%) rename src/test/ui/traits/{trait-item-privacy.stderr => item-privacy.stderr} (86%) rename src/test/ui/traits/{kindck-owned-trait-contains-1.rs => kindck-owned-contains-1.rs} (100%) rename src/test/ui/traits/{trait-matching-lifetimes.rs => matching-lifetimes.rs} (100%) rename src/test/ui/traits/{trait-matching-lifetimes.stderr => matching-lifetimes.stderr} (80%) rename src/test/ui/traits/{trait-method-private.rs => method-private.rs} (100%) rename src/test/ui/traits/{trait-method-private.stderr => method-private.stderr} (91%) rename src/test/ui/traits/{traits-multidispatch-bad.rs => multidispatch-bad.rs} (100%) rename src/test/ui/traits/{traits-multidispatch-bad.stderr => multidispatch-bad.stderr} (88%) rename src/test/ui/traits/{traits-multidispatch-convert-ambig-dest.rs => multidispatch-convert-ambig-dest.rs} (100%) rename src/test/ui/traits/{traits-multidispatch-convert-ambig-dest.stderr => multidispatch-convert-ambig-dest.stderr} (83%) rename src/test/ui/traits/{traits-multidispatch-infer-convert-target.rs => multidispatch-infer-convert-target.rs} (100%) rename src/test/ui/traits/{trait-object-auto-dedup-in-impl.rs => object/auto-dedup-in-impl.rs} (100%) rename src/test/ui/traits/{trait-object-auto-dedup-in-impl.stderr => object/auto-dedup-in-impl.stderr} (87%) rename src/test/ui/traits/{trait-object-auto-dedup.rs => object/auto-dedup.rs} (100%) rename src/test/ui/traits/{trait-object-bounds-cycle-1.rs => object/bounds-cycle-1.rs} (100%) rename src/test/ui/traits/{trait-object-bounds-cycle-2.rs => object/bounds-cycle-2.rs} (100%) rename src/test/ui/traits/{trait-object-bounds-cycle-3.rs => object/bounds-cycle-3.rs} (100%) rename src/test/ui/traits/{trait-object-bounds-cycle-4.rs => object/bounds-cycle-4.rs} (100%) rename src/test/ui/traits/{trait-object-exclusion.rs => object/exclusion.rs} (100%) rename src/test/ui/traits/{trait-object-generics.rs => object/generics.rs} (100%) rename src/test/ui/traits/{trait-object-lifetime-first.rs => object/lifetime-first.rs} (100%) rename src/test/ui/traits/{trait-object-macro-matcher.rs => object/macro-matcher.rs} (100%) rename src/test/ui/traits/{trait-object-macro-matcher.stderr => object/macro-matcher.stderr} (89%) rename src/test/ui/traits/{trait-object-safety.rs => object/safety.rs} (100%) rename src/test/ui/traits/{trait-object-safety.stderr => object/safety.stderr} (92%) rename src/test/ui/traits/{trait-object-supertrait-lifetime-bound.rs => object/supertrait-lifetime-bound.rs} (100%) rename src/test/ui/traits/{trait-object-vs-lifetime-2.rs => object/vs-lifetime-2.rs} (100%) rename src/test/ui/traits/{trait-object-vs-lifetime-2.stderr => object/vs-lifetime-2.stderr} (84%) rename src/test/ui/traits/{trait-object-vs-lifetime.rs => object/vs-lifetime.rs} (100%) rename src/test/ui/traits/{trait-object-vs-lifetime.stderr => object/vs-lifetime.stderr} (81%) rename src/test/ui/traits/{trait-object-with-lifetime-bound.rs => object/with-lifetime-bound.rs} (100%) rename src/test/ui/traits/{trait-object-with-self-in-projection-output-bad.rs => object/with-self-in-projection-output-bad.rs} (100%) rename src/test/ui/traits/{trait-object-with-self-in-projection-output-bad.stderr => object/with-self-in-projection-output-bad.stderr} (86%) rename src/test/ui/traits/{trait-object-with-self-in-projection-output-good.rs => object/with-self-in-projection-output-good.rs} (100%) rename src/test/ui/traits/{trait-object-with-self-in-projection-output-repeated-supertrait.rs => object/with-self-in-projection-output-repeated-supertrait.rs} (100%) rename src/test/ui/traits/{trait-param-without-lifetime-constraint.rs => param-without-lifetime-constraint.rs} (100%) rename src/test/ui/traits/{trait-param-without-lifetime-constraint.stderr => param-without-lifetime-constraint.stderr} (85%) rename src/test/ui/traits/{parameterized-trait-with-bounds.rs => parameterized-with-bounds.rs} (100%) rename src/test/ui/traits/{principal-less-trait-objects.rs => principal-less-objects.rs} (100%) rename src/test/ui/traits/{trait-privacy.rs => privacy.rs} (100%) rename src/test/ui/traits/{trait-region-pointer-simple.rs => region-pointer-simple.rs} (100%) rename src/test/ui/traits/{reservation-impls/reservation-impl-coherence-conflict.rs => reservation-impl/coherence-conflict.rs} (100%) rename src/test/ui/traits/{reservation-impls/reservation-impl-coherence-conflict.stderr => reservation-impl/coherence-conflict.stderr} (88%) rename src/test/ui/traits/{reservation-impls/reservation-impl-no-use.rs => reservation-impl/no-use.rs} (100%) rename src/test/ui/traits/{reservation-impls/reservation-impl-no-use.stderr => reservation-impl/no-use.stderr} (91%) rename src/test/ui/traits/{reservation-impls/reservation-impl-non-lattice-ok.rs => reservation-impl/non-lattice-ok.rs} (100%) rename src/test/ui/traits/{reservation-impls/reservation-impl-ok.rs => reservation-impl/ok.rs} (100%) rename src/test/ui/traits/{trait-resolution-in-overloaded-op.rs => resolution-in-overloaded-op.rs} (100%) rename src/test/ui/traits/{trait-resolution-in-overloaded-op.stderr => resolution-in-overloaded-op.stderr} (88%) rename src/test/ui/traits/{trait-safety-fn-body.rs => safety-fn-body.rs} (100%) rename src/test/ui/traits/{trait-safety-fn-body.stderr => safety-fn-body.stderr} (91%) rename src/test/ui/traits/{trait-safety-inherent-impl.rs => safety-inherent-impl.rs} (100%) rename src/test/ui/traits/{trait-safety-inherent-impl.stderr => safety-inherent-impl.stderr} (85%) rename src/test/ui/traits/{trait-safety-ok-cc.rs => safety-ok-cc.rs} (100%) rename src/test/ui/traits/{trait-safety-ok.rs => safety-ok.rs} (100%) rename src/test/ui/traits/{trait-safety-trait-impl-cc.rs => safety-trait-impl-cc.rs} (100%) rename src/test/ui/traits/{trait-safety-trait-impl-cc.stderr => safety-trait-impl-cc.stderr} (87%) rename src/test/ui/traits/{trait-safety-trait-impl.rs => safety-trait-impl.rs} (100%) rename src/test/ui/traits/{trait-safety-trait-impl.stderr => safety-trait-impl.stderr} (84%) rename src/test/ui/traits/{trait-static-method-generic-inference.rs => static-method-generic-inference.rs} (100%) rename src/test/ui/traits/{trait-static-method-generic-inference.stderr => static-method-generic-inference.stderr} (87%) rename src/test/ui/traits/{trait-static-method-overwriting.rs => static-method-overwriting.rs} (100%) rename src/test/ui/traits/{traits-static-outlives-a-where-clause.rs => static-outlives-a-where-clause.rs} (100%) rename src/test/ui/traits/{trait-suggest-deferences-issue-39029.fixed => suggest-deferences/issue-39029.fixed} (100%) rename src/test/ui/traits/{trait-suggest-deferences-issue-39029.rs => suggest-deferences/issue-39029.rs} (100%) rename src/test/ui/traits/{trait-suggest-deferences-issue-39029.stderr => suggest-deferences/issue-39029.stderr} (93%) rename src/test/ui/traits/{trait-suggest-deferences-issue-62530.fixed => suggest-deferences/issue-62530.fixed} (100%) rename src/test/ui/traits/{trait-suggest-deferences-issue-62530.rs => suggest-deferences/issue-62530.rs} (100%) rename src/test/ui/traits/{trait-suggest-deferences-issue-62530.stderr => suggest-deferences/issue-62530.stderr} (91%) rename src/test/ui/traits/{trait-suggest-deferences-multiple-0.fixed => suggest-deferences/multiple-0.fixed} (100%) rename src/test/ui/traits/{trait-suggest-deferences-multiple-0.rs => suggest-deferences/multiple-0.rs} (100%) rename src/test/ui/traits/{trait-suggest-deferences-multiple-0.stderr => suggest-deferences/multiple-0.stderr} (89%) rename src/test/ui/traits/{trait-suggest-deferences-multiple-1.rs => suggest-deferences/multiple-1.rs} (100%) rename src/test/ui/traits/{trait-suggest-deferences-multiple-1.stderr => suggest-deferences/multiple-1.stderr} (87%) rename src/test/ui/traits/{trait-suggest-where-clause.rs => suggest-where-clause.rs} (100%) rename src/test/ui/traits/{trait-suggest-where-clause.stderr => suggest-where-clause.stderr} (89%) rename src/test/ui/traits/{supertrait-default-generics.rs => superdefault-generics.rs} (100%) rename src/test/ui/traits/{syntax-trait-polarity.rs => syntax-polarity.rs} (100%) rename src/test/ui/traits/{trait-test-2.rs => test-2.rs} (100%) rename src/test/ui/traits/{trait-test-2.stderr => test-2.stderr} (91%) rename src/test/ui/traits/{trait-test.rs => test.rs} (100%) rename src/test/ui/traits/{trait-test.stderr => test.stderr} (89%) rename src/test/ui/traits/{trait-to-str.rs => to-str.rs} (100%) delete mode 100644 src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.rs delete mode 100644 src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.rs rename src/test/ui/traits/{ufcs-trait-object.rs => ufcs-object.rs} (100%) rename src/test/ui/traits/{use-trait-before-def.rs => use-before-def.rs} (100%) rename src/test/ui/traits/{wf-trait-object-maybe-bound.rs => wf-object/maybe-bound.rs} (100%) rename src/test/ui/traits/{wf-trait-object-maybe-bound.stderr => wf-object/maybe-bound.stderr} (74%) rename src/test/ui/traits/{wf-trait-object-no-duplicates.rs => wf-object/no-duplicates.rs} (100%) rename src/test/ui/traits/{wf-trait-object-no-duplicates.stderr => wf-object/no-duplicates.stderr} (92%) rename src/test/ui/traits/{wf-trait-object-only-maybe-bound.rs => wf-object/only-maybe-bound.rs} (100%) rename src/test/ui/traits/{wf-trait-object-only-maybe-bound.stderr => wf-object/only-maybe-bound.stderr} (76%) rename src/test/ui/traits/{wf-trait-object-reverse-order.rs => wf-object/reverse-order.rs} (100%) rename src/test/ui/traits/{trait-where-clause-vs-impl.rs => where-clause-vs-impl.rs} (100%) rename src/test/ui/traits/{trait-with-bounds-default.rs => with-bounds-default.rs} (100%) rename src/test/ui/traits/{trait-with-dst.rs => with-dst.rs} (100%) diff --git a/src/test/ui/traits/trait-alias-ambiguous.rs b/src/test/ui/traits/alias/ambiguous.rs similarity index 100% rename from src/test/ui/traits/trait-alias-ambiguous.rs rename to src/test/ui/traits/alias/ambiguous.rs diff --git a/src/test/ui/traits/trait-alias-ambiguous.stderr b/src/test/ui/traits/alias/ambiguous.stderr similarity index 85% rename from src/test/ui/traits/trait-alias-ambiguous.stderr rename to src/test/ui/traits/alias/ambiguous.stderr index f692e92d861d8..649ce72604e2d 100644 --- a/src/test/ui/traits/trait-alias-ambiguous.stderr +++ b/src/test/ui/traits/alias/ambiguous.stderr @@ -1,16 +1,16 @@ error[E0034]: multiple applicable items in scope - --> $DIR/trait-alias-ambiguous.rs:21:7 + --> $DIR/ambiguous.rs:21:7 | LL | t.foo(); | ^^^ multiple `foo` found | note: candidate #1 is defined in an impl of the trait `A` for the type `u8` - --> $DIR/trait-alias-ambiguous.rs:8:9 + --> $DIR/ambiguous.rs:8:9 | LL | fn foo(&self) {} | ^^^^^^^^^^^^^ note: candidate #2 is defined in an impl of the trait `B` for the type `u8` - --> $DIR/trait-alias-ambiguous.rs:11:9 + --> $DIR/ambiguous.rs:11:9 | LL | fn foo(&self) {} | ^^^^^^^^^^^^^ diff --git a/src/test/ui/traits/auxiliary/trait_alias.rs b/src/test/ui/traits/alias/auxiliary/greeter.rs similarity index 100% rename from src/test/ui/traits/auxiliary/trait_alias.rs rename to src/test/ui/traits/alias/auxiliary/greeter.rs diff --git a/src/test/ui/traits/trait-alias/auxiliary/trait_alias.rs b/src/test/ui/traits/alias/auxiliary/send_sync.rs similarity index 100% rename from src/test/ui/traits/trait-alias/auxiliary/trait_alias.rs rename to src/test/ui/traits/alias/auxiliary/send_sync.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias.rs b/src/test/ui/traits/alias/basic.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias.rs rename to src/test/ui/traits/alias/basic.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-bounds.rs b/src/test/ui/traits/alias/bounds.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-bounds.rs rename to src/test/ui/traits/alias/bounds.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-cross-crate.rs b/src/test/ui/traits/alias/cross-crate.rs similarity index 78% rename from src/test/ui/traits/trait-alias/trait-alias-cross-crate.rs rename to src/test/ui/traits/alias/cross-crate.rs index 14edfdd7a3d45..8919c643400a5 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-cross-crate.rs +++ b/src/test/ui/traits/alias/cross-crate.rs @@ -1,11 +1,11 @@ -// aux-build:trait_alias.rs +// aux-build:send_sync.rs #![feature(trait_alias)] -extern crate trait_alias; +extern crate send_sync; use std::rc::Rc; -use trait_alias::SendSync; +use send_sync::SendSync; fn use_alias() {} diff --git a/src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr b/src/test/ui/traits/alias/cross-crate.stderr similarity index 90% rename from src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr rename to src/test/ui/traits/alias/cross-crate.stderr index 60a4a46a0556d..3b8fee8e8dfab 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr +++ b/src/test/ui/traits/alias/cross-crate.stderr @@ -1,5 +1,5 @@ error[E0277]: `Rc` cannot be sent between threads safely - --> $DIR/trait-alias-cross-crate.rs:14:17 + --> $DIR/cross-crate.rs:14:17 | LL | fn use_alias() {} | -------- required by this bound in `use_alias` @@ -10,7 +10,7 @@ LL | use_alias::>(); = help: the trait `Send` is not implemented for `Rc` error[E0277]: `Rc` cannot be shared between threads safely - --> $DIR/trait-alias-cross-crate.rs:14:17 + --> $DIR/cross-crate.rs:14:17 | LL | fn use_alias() {} | -------- required by this bound in `use_alias` diff --git a/src/test/ui/traits/trait-alias/trait-alias-impl.rs b/src/test/ui/traits/alias/impl.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-impl.rs rename to src/test/ui/traits/alias/impl.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-impl.stderr b/src/test/ui/traits/alias/impl.stderr similarity index 87% rename from src/test/ui/traits/trait-alias/trait-alias-impl.stderr rename to src/test/ui/traits/alias/impl.stderr index 301db4fb71c65..cedcd10213da7 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-impl.stderr +++ b/src/test/ui/traits/alias/impl.stderr @@ -1,5 +1,5 @@ error[E0404]: expected trait, found trait alias `DefaultAlias` - --> $DIR/trait-alias-impl.rs:5:6 + --> $DIR/impl.rs:5:6 | LL | impl DefaultAlias for () {} | ^^^^^^^^^^^^ not a trait diff --git a/src/test/ui/traits/trait-alias-import-cross-crate.rs b/src/test/ui/traits/alias/import-cross-crate.rs similarity index 66% rename from src/test/ui/traits/trait-alias-import-cross-crate.rs rename to src/test/ui/traits/alias/import-cross-crate.rs index 975542ab49b59..868585cd09789 100644 --- a/src/test/ui/traits/trait-alias-import-cross-crate.rs +++ b/src/test/ui/traits/alias/import-cross-crate.rs @@ -1,12 +1,12 @@ // run-pass -// aux-build:trait_alias.rs +// aux-build:greeter.rs #![feature(trait_alias)] -extern crate trait_alias; +extern crate greeter; // Import only the alias, not the real trait. -use trait_alias::{Greet, Hi}; +use greeter::{Greet, Hi}; fn main() { let hi = Hi; diff --git a/src/test/ui/traits/trait-alias-import.rs b/src/test/ui/traits/alias/import.rs similarity index 100% rename from src/test/ui/traits/trait-alias-import.rs rename to src/test/ui/traits/alias/import.rs diff --git a/src/test/ui/traits/trait-alias/issue-60021-assoc-method-resolve.rs b/src/test/ui/traits/alias/issue-60021-assoc-method-resolve.rs similarity index 100% rename from src/test/ui/traits/trait-alias/issue-60021-assoc-method-resolve.rs rename to src/test/ui/traits/alias/issue-60021-assoc-method-resolve.rs diff --git a/src/test/ui/traits/trait-alias/issue-72415-assoc-const-resolve.rs b/src/test/ui/traits/alias/issue-72415-assoc-const-resolve.rs similarity index 100% rename from src/test/ui/traits/trait-alias/issue-72415-assoc-const-resolve.rs rename to src/test/ui/traits/alias/issue-72415-assoc-const-resolve.rs diff --git a/src/test/ui/traits/trait-alias/issue-75983.rs b/src/test/ui/traits/alias/issue-75983.rs similarity index 100% rename from src/test/ui/traits/trait-alias/issue-75983.rs rename to src/test/ui/traits/alias/issue-75983.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-maybe-bound.rs b/src/test/ui/traits/alias/maybe-bound.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-maybe-bound.rs rename to src/test/ui/traits/alias/maybe-bound.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-no-duplicates.rs b/src/test/ui/traits/alias/no-duplicates.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-no-duplicates.rs rename to src/test/ui/traits/alias/no-duplicates.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-no-duplicates.stderr b/src/test/ui/traits/alias/no-duplicates.stderr similarity index 95% rename from src/test/ui/traits/trait-alias/trait-alias-no-duplicates.stderr rename to src/test/ui/traits/alias/no-duplicates.stderr index b297d54375c79..9f38dd40c3acb 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-no-duplicates.stderr +++ b/src/test/ui/traits/alias/no-duplicates.stderr @@ -1,5 +1,5 @@ error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:16:22 + --> $DIR/no-duplicates.rs:16:22 | LL | trait _0 = Obj; | --- @@ -16,7 +16,7 @@ LL | type _T00 = dyn _0 + _0; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:19:22 + --> $DIR/no-duplicates.rs:19:22 | LL | trait _0 = Obj; | --- @@ -35,7 +35,7 @@ LL | type _T01 = dyn _1 + _0; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:22:22 + --> $DIR/no-duplicates.rs:22:22 | LL | trait _0 = Obj; | --- @@ -57,7 +57,7 @@ LL | type _T02 = dyn _1 + _1; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:25:23 + --> $DIR/no-duplicates.rs:25:23 | LL | trait _0 = Obj; | --- additional non-auto trait @@ -73,7 +73,7 @@ LL | type _T03 = dyn Obj + _1; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:28:22 + --> $DIR/no-duplicates.rs:28:22 | LL | trait _0 = Obj; | --- first non-auto trait @@ -89,7 +89,7 @@ LL | type _T04 = dyn _1 + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:37:17 + --> $DIR/no-duplicates.rs:37:17 | LL | trait _0 = Obj; | --- @@ -114,7 +114,7 @@ LL | type _T10 = dyn _2 + _3; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:40:22 + --> $DIR/no-duplicates.rs:40:22 | LL | trait _0 = Obj; | --- additional non-auto trait @@ -133,7 +133,7 @@ LL | type _T11 = dyn _3 + _2; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:43:23 + --> $DIR/no-duplicates.rs:43:23 | LL | trait _0 = Obj; | --- additional non-auto trait @@ -150,7 +150,7 @@ LL | type _T12 = dyn Obj + _2; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:46:17 + --> $DIR/no-duplicates.rs:46:17 | LL | trait _0 = Obj; | --- @@ -175,7 +175,7 @@ LL | type _T13 = dyn _2 + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:49:22 + --> $DIR/no-duplicates.rs:49:22 | LL | trait _0 = Obj; | --- first non-auto trait @@ -194,7 +194,7 @@ LL | type _T14 = dyn _1 + _3; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:52:22 + --> $DIR/no-duplicates.rs:52:22 | LL | trait _0 = Obj; | --- additional non-auto trait @@ -213,7 +213,7 @@ LL | type _T15 = dyn _3 + _1; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:55:22 + --> $DIR/no-duplicates.rs:55:22 | LL | trait _0 = Obj; | --- first non-auto trait @@ -234,7 +234,7 @@ LL | type _T16 = dyn _1 + _4; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:58:22 + --> $DIR/no-duplicates.rs:58:22 | LL | trait _0 = Obj; | --- additional non-auto trait @@ -255,7 +255,7 @@ LL | type _T17 = dyn _4 + _1; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:65:22 + --> $DIR/no-duplicates.rs:65:22 | LL | trait _5 = Obj + Send; | --- @@ -272,7 +272,7 @@ LL | type _T20 = dyn _5 + _5; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:68:23 + --> $DIR/no-duplicates.rs:68:23 | LL | trait _5 = Obj + Send; | --- additional non-auto trait @@ -286,7 +286,7 @@ LL | type _T21 = dyn Obj + _5; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:71:22 + --> $DIR/no-duplicates.rs:71:22 | LL | trait _5 = Obj + Send; | --- first non-auto trait @@ -300,7 +300,7 @@ LL | type _T22 = dyn _5 + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:74:36 + --> $DIR/no-duplicates.rs:74:36 | LL | trait _5 = Obj + Send; | --- first non-auto trait @@ -314,7 +314,7 @@ LL | type _T23 = dyn _5 + Send + Sync + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:81:17 + --> $DIR/no-duplicates.rs:81:17 | LL | trait _5 = Obj + Send; | --- @@ -337,7 +337,7 @@ LL | type _T30 = dyn _6; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:84:17 + --> $DIR/no-duplicates.rs:84:17 | LL | trait _5 = Obj + Send; | --- @@ -360,7 +360,7 @@ LL | type _T31 = dyn _6 + Send; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:87:24 + --> $DIR/no-duplicates.rs:87:24 | LL | trait _5 = Obj + Send; | --- @@ -383,7 +383,7 @@ LL | type _T32 = dyn Send + _6; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:95:22 + --> $DIR/no-duplicates.rs:95:22 | LL | trait _5 = Obj + Send; | --- first non-auto trait @@ -402,7 +402,7 @@ LL | type _T40 = dyn _8 + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:98:23 + --> $DIR/no-duplicates.rs:98:23 | LL | trait _5 = Obj + Send; | --- additional non-auto trait @@ -421,7 +421,7 @@ LL | type _T41 = dyn Obj + _8; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:101:22 + --> $DIR/no-duplicates.rs:101:22 | LL | trait _3 = Obj; | --- additional non-auto trait @@ -445,7 +445,7 @@ LL | type _T42 = dyn _8 + _4; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:104:22 + --> $DIR/no-duplicates.rs:104:22 | LL | trait _3 = Obj; | --- first non-auto trait @@ -469,7 +469,7 @@ LL | type _T43 = dyn _4 + _8; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:107:36 + --> $DIR/no-duplicates.rs:107:36 | LL | trait _3 = Obj; | --- first non-auto trait @@ -493,7 +493,7 @@ LL | type _T44 = dyn _4 + Send + Sync + _8; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:117:22 + --> $DIR/no-duplicates.rs:117:22 | LL | trait _9 = for<'a> ObjL<'a>; | ---------------- first non-auto trait @@ -508,7 +508,7 @@ LL | type _T50 = dyn _9 + _10; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-duplicates.rs:123:23 + --> $DIR/no-duplicates.rs:123:23 | LL | trait _11 = ObjT fn(&'a u8)>; | ------------------------ first non-auto trait diff --git a/src/test/ui/traits/trait-alias/trait-alias-no-extra-traits.rs b/src/test/ui/traits/alias/no-extra-traits.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-no-extra-traits.rs rename to src/test/ui/traits/alias/no-extra-traits.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-no-extra-traits.stderr b/src/test/ui/traits/alias/no-extra-traits.stderr similarity index 95% rename from src/test/ui/traits/trait-alias/trait-alias-no-extra-traits.stderr rename to src/test/ui/traits/alias/no-extra-traits.stderr index 1d7b3fa112b00..cdb5cd90b85c6 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-no-extra-traits.stderr +++ b/src/test/ui/traits/alias/no-extra-traits.stderr @@ -1,5 +1,5 @@ error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:16:22 + --> $DIR/no-extra-traits.rs:16:22 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -13,7 +13,7 @@ LL | type _T00 = dyn _0 + ObjB; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:19:24 + --> $DIR/no-extra-traits.rs:19:24 | LL | trait _0 = ObjA; | ---- additional non-auto trait @@ -27,7 +27,7 @@ LL | type _T01 = dyn ObjB + _0; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:22:24 + --> $DIR/no-extra-traits.rs:22:24 | LL | trait _0 = ObjA; | ---- additional non-auto trait @@ -43,7 +43,7 @@ LL | type _T02 = dyn ObjB + _1; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:25:22 + --> $DIR/no-extra-traits.rs:25:22 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -59,7 +59,7 @@ LL | type _T03 = dyn _1 + ObjB; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:34:22 + --> $DIR/no-extra-traits.rs:34:22 | LL | trait _2 = ObjB; | ---- @@ -78,7 +78,7 @@ LL | type _T10 = dyn _2 + _3; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:37:22 + --> $DIR/no-extra-traits.rs:37:22 | LL | trait _2 = ObjB; | ---- @@ -97,7 +97,7 @@ LL | type _T11 = dyn _3 + _2; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:40:22 + --> $DIR/no-extra-traits.rs:40:22 | LL | trait _2 = ObjB; | ---- @@ -118,7 +118,7 @@ LL | type _T12 = dyn _2 + _4; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:43:22 + --> $DIR/no-extra-traits.rs:43:22 | LL | trait _2 = ObjB; | ---- @@ -139,7 +139,7 @@ LL | type _T13 = dyn _4 + _2; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:50:22 + --> $DIR/no-extra-traits.rs:50:22 | LL | trait _0 = ObjA; | ---- additional non-auto trait @@ -158,7 +158,7 @@ LL | type _T20 = dyn _5 + _1; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:53:22 + --> $DIR/no-extra-traits.rs:53:22 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -177,7 +177,7 @@ LL | type _T21 = dyn _1 + _5; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:56:22 + --> $DIR/no-extra-traits.rs:56:22 | LL | trait _5 = Sync + ObjB + Send; | ---- first non-auto trait @@ -191,7 +191,7 @@ LL | type _T22 = dyn _5 + ObjA; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:59:24 + --> $DIR/no-extra-traits.rs:59:24 | LL | trait _5 = Sync + ObjB + Send; | ---- additional non-auto trait @@ -205,7 +205,7 @@ LL | type _T23 = dyn ObjA + _5; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:62:29 + --> $DIR/no-extra-traits.rs:62:29 | LL | trait _0 = ObjA; | ---- additional non-auto trait @@ -224,7 +224,7 @@ LL | type _T24 = dyn Send + _5 + _1 + Sync; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:65:29 + --> $DIR/no-extra-traits.rs:65:29 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -243,7 +243,7 @@ LL | type _T25 = dyn _1 + Sync + _5 + Send; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:68:36 + --> $DIR/no-extra-traits.rs:68:36 | LL | trait _5 = Sync + ObjB + Send; | ---- first non-auto trait @@ -257,7 +257,7 @@ LL | type _T26 = dyn Sync + Send + _5 + ObjA; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:71:38 + --> $DIR/no-extra-traits.rs:71:38 | LL | trait _5 = Sync + ObjB + Send; | ---- additional non-auto trait @@ -271,7 +271,7 @@ LL | type _T27 = dyn Send + Sync + ObjA + _5; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:80:17 + --> $DIR/no-extra-traits.rs:80:17 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -296,7 +296,7 @@ LL | type _T30 = dyn _6; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:83:17 + --> $DIR/no-extra-traits.rs:83:17 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -321,7 +321,7 @@ LL | type _T31 = dyn _6 + Send; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:86:24 + --> $DIR/no-extra-traits.rs:86:24 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -346,7 +346,7 @@ LL | type _T32 = dyn Send + _6; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:89:17 + --> $DIR/no-extra-traits.rs:89:17 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -381,7 +381,7 @@ LL | type _T33 = dyn _8; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:92:17 + --> $DIR/no-extra-traits.rs:92:17 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -416,7 +416,7 @@ LL | type _T34 = dyn _8 + Send; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:95:24 + --> $DIR/no-extra-traits.rs:95:24 | LL | trait _0 = ObjA; | ---- first non-auto trait @@ -451,7 +451,7 @@ LL | type _T35 = dyn Send + _8; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:103:23 + --> $DIR/no-extra-traits.rs:103:23 | LL | trait _5 = Sync + ObjB + Send; | ---- first non-auto trait @@ -470,7 +470,7 @@ LL | type _T40 = dyn _10 + ObjA; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:106:24 + --> $DIR/no-extra-traits.rs:106:24 | LL | trait _5 = Sync + ObjB + Send; | ---- additional non-auto trait @@ -489,7 +489,7 @@ LL | type _T41 = dyn ObjA + _10; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:109:23 + --> $DIR/no-extra-traits.rs:109:23 | LL | trait _0 = ObjA; | ---- additional non-auto trait @@ -513,7 +513,7 @@ LL | type _T42 = dyn _10 + _1; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:112:37 + --> $DIR/no-extra-traits.rs:112:37 | LL | trait _5 = Sync + ObjB + Send; | ---- first non-auto trait @@ -532,7 +532,7 @@ LL | type _T43 = dyn Send + _10 + Sync + ObjA; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:115:24 + --> $DIR/no-extra-traits.rs:115:24 | LL | trait _5 = Sync + ObjB + Send; | ---- additional non-auto trait @@ -551,7 +551,7 @@ LL | type _T44 = dyn ObjA + _10 + Send + Sync; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/trait-alias-no-extra-traits.rs:118:37 + --> $DIR/no-extra-traits.rs:118:37 | LL | trait _0 = ObjA; | ---- additional non-auto trait diff --git a/src/test/ui/traits/trait-alias/trait-alias-object-fail.rs b/src/test/ui/traits/alias/object-fail.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-object-fail.rs rename to src/test/ui/traits/alias/object-fail.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-object-fail.stderr b/src/test/ui/traits/alias/object-fail.stderr similarity index 92% rename from src/test/ui/traits/trait-alias/trait-alias-object-fail.stderr rename to src/test/ui/traits/alias/object-fail.stderr index 1118a75e0850e..325bc6d280859 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-object-fail.stderr +++ b/src/test/ui/traits/alias/object-fail.stderr @@ -1,5 +1,5 @@ error[E0038]: the trait `Eq` cannot be made into an object - --> $DIR/trait-alias-object-fail.rs:7:13 + --> $DIR/object-fail.rs:7:13 | LL | let _: &dyn EqAlias = &123; | ^^^^^^^^^^^ `Eq` cannot be made into an object @@ -11,7 +11,7 @@ LL | pub trait Eq: PartialEq { | ^^^^^^^^^^^^^^^ the trait cannot be made into an object because it uses `Self` as a type parameter error[E0191]: the value of the associated type `Item` (from trait `Iterator`) must be specified - --> $DIR/trait-alias-object-fail.rs:9:17 + --> $DIR/object-fail.rs:9:17 | LL | let _: &dyn IteratorAlias = &vec![123].into_iter(); | ^^^^^^^^^^^^^ help: specify the associated type: `IteratorAlias` diff --git a/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs b/src/test/ui/traits/alias/object-wf.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-object-wf.rs rename to src/test/ui/traits/alias/object-wf.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-object.rs b/src/test/ui/traits/alias/object.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-object.rs rename to src/test/ui/traits/alias/object.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-only-maybe-bound.rs b/src/test/ui/traits/alias/only-maybe-bound.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-only-maybe-bound.rs rename to src/test/ui/traits/alias/only-maybe-bound.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-only-maybe-bound.stderr b/src/test/ui/traits/alias/only-maybe-bound.stderr similarity index 77% rename from src/test/ui/traits/trait-alias/trait-alias-only-maybe-bound.stderr rename to src/test/ui/traits/alias/only-maybe-bound.stderr index 594115d980c8b..99589edb535ff 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-only-maybe-bound.stderr +++ b/src/test/ui/traits/alias/only-maybe-bound.stderr @@ -1,11 +1,11 @@ error[E0224]: at least one trait is required for an object type - --> $DIR/trait-alias-only-maybe-bound.rs:13:12 + --> $DIR/only-maybe-bound.rs:13:12 | LL | type _T0 = dyn _1; | ^^^^^^ error[E0224]: at least one trait is required for an object type - --> $DIR/trait-alias-only-maybe-bound.rs:19:12 + --> $DIR/only-maybe-bound.rs:19:12 | LL | type _T1 = dyn _2; | ^^^^^^ diff --git a/src/test/ui/traits/trait-alias/trait-alias-syntax-fail.rs b/src/test/ui/traits/alias/syntax-fail.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-syntax-fail.rs rename to src/test/ui/traits/alias/syntax-fail.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-syntax-fail.stderr b/src/test/ui/traits/alias/syntax-fail.stderr similarity index 74% rename from src/test/ui/traits/trait-alias/trait-alias-syntax-fail.stderr rename to src/test/ui/traits/alias/syntax-fail.stderr index 18c22133bc780..748b92056d105 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-syntax-fail.stderr +++ b/src/test/ui/traits/alias/syntax-fail.stderr @@ -1,23 +1,23 @@ error: trait aliases cannot be `auto` - --> $DIR/trait-alias-syntax-fail.rs:4:1 + --> $DIR/syntax-fail.rs:4:1 | LL | auto trait A = Foo; | ^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `auto` error: trait aliases cannot be `unsafe` - --> $DIR/trait-alias-syntax-fail.rs:5:1 + --> $DIR/syntax-fail.rs:5:1 | LL | unsafe trait B = Foo; | ^^^^^^^^^^^^^^^^^^^^^ trait aliases cannot be `unsafe` error: bounds are not allowed on trait aliases - --> $DIR/trait-alias-syntax-fail.rs:7:8 + --> $DIR/syntax-fail.rs:7:8 | LL | trait C: Ord = Eq; | ^^^^^ error: bounds are not allowed on trait aliases - --> $DIR/trait-alias-syntax-fail.rs:8:8 + --> $DIR/syntax-fail.rs:8:8 | LL | trait D: = Eq; | ^ diff --git a/src/test/ui/traits/trait-alias/trait-alias-syntax.rs b/src/test/ui/traits/alias/syntax.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-syntax.rs rename to src/test/ui/traits/alias/syntax.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-wf.rs b/src/test/ui/traits/alias/wf.rs similarity index 100% rename from src/test/ui/traits/trait-alias/trait-alias-wf.rs rename to src/test/ui/traits/alias/wf.rs diff --git a/src/test/ui/traits/trait-alias/trait-alias-wf.stderr b/src/test/ui/traits/alias/wf.stderr similarity index 92% rename from src/test/ui/traits/trait-alias/trait-alias-wf.stderr rename to src/test/ui/traits/alias/wf.stderr index e0df76381e088..b07145f4d38f0 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-wf.stderr +++ b/src/test/ui/traits/alias/wf.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `T: Foo` is not satisfied - --> $DIR/trait-alias-wf.rs:5:14 + --> $DIR/wf.rs:5:14 | LL | trait A {} | --- required by this bound in `A` diff --git a/src/test/ui/traits/anon-trait-static-method.rs b/src/test/ui/traits/anon-static-method.rs similarity index 100% rename from src/test/ui/traits/anon-trait-static-method.rs rename to src/test/ui/traits/anon-static-method.rs diff --git a/src/test/ui/traits/trait-as-struct-constructor.rs b/src/test/ui/traits/as-struct-constructor.rs similarity index 100% rename from src/test/ui/traits/trait-as-struct-constructor.rs rename to src/test/ui/traits/as-struct-constructor.rs diff --git a/src/test/ui/traits/trait-as-struct-constructor.stderr b/src/test/ui/traits/as-struct-constructor.stderr similarity index 86% rename from src/test/ui/traits/trait-as-struct-constructor.stderr rename to src/test/ui/traits/as-struct-constructor.stderr index e1d54fbf8aa7b..d06e85f3a2038 100644 --- a/src/test/ui/traits/trait-as-struct-constructor.stderr +++ b/src/test/ui/traits/as-struct-constructor.stderr @@ -1,5 +1,5 @@ error[E0574]: expected struct, variant or union type, found trait `TraitNotAStruct` - --> $DIR/trait-as-struct-constructor.rs:4:5 + --> $DIR/as-struct-constructor.rs:4:5 | LL | TraitNotAStruct{ value: 0 }; | ^^^^^^^^^^^^^^^ not a struct, variant or union type diff --git a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.rs b/src/test/ui/traits/assoc-type-in-superbad.rs similarity index 100% rename from src/test/ui/traits/traits-assoc-type-in-supertrait-bad.rs rename to src/test/ui/traits/assoc-type-in-superbad.rs diff --git a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr b/src/test/ui/traits/assoc-type-in-superbad.stderr similarity index 83% rename from src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr rename to src/test/ui/traits/assoc-type-in-superbad.stderr index 5ac7b08e52f67..cbdb6b96f468f 100644 --- a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr +++ b/src/test/ui/traits/assoc-type-in-superbad.stderr @@ -1,5 +1,5 @@ error[E0271]: type mismatch resolving ` as Iterator>::Item == u32` - --> $DIR/traits-assoc-type-in-supertrait-bad.rs:12:16 + --> $DIR/assoc-type-in-superbad.rs:12:16 | LL | type Key = u32; | ^^^ expected `i32`, found `u32` diff --git a/src/test/ui/traits/traits-assoc-type-in-supertrait.rs b/src/test/ui/traits/assoc-type-in-supertrait.rs similarity index 100% rename from src/test/ui/traits/traits-assoc-type-in-supertrait.rs rename to src/test/ui/traits/assoc-type-in-supertrait.rs diff --git a/src/test/ui/traits/assoc_type_bound_with_struct.rs b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs similarity index 100% rename from src/test/ui/traits/assoc_type_bound_with_struct.rs rename to src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.rs diff --git a/src/test/ui/traits/assoc_type_bound_with_struct.stderr b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr similarity index 100% rename from src/test/ui/traits/assoc_type_bound_with_struct.stderr rename to src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr diff --git a/src/test/ui/traits/check-trait-object-bounds-1.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-1.rs rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.rs diff --git a/src/test/ui/traits/check-trait-object-bounds-1.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-1.stderr rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr diff --git a/src/test/ui/traits/check-trait-object-bounds-2-ok.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2-ok.rs similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-2-ok.rs rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2-ok.rs diff --git a/src/test/ui/traits/check-trait-object-bounds-2.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.rs similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-2.rs rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.rs diff --git a/src/test/ui/traits/check-trait-object-bounds-2.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-2.stderr rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr diff --git a/src/test/ui/traits/check-trait-object-bounds-3.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-3.rs similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-3.rs rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-3.rs diff --git a/src/test/ui/traits/check-trait-object-bounds-3.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-3.stderr similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-3.stderr rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-3.stderr diff --git a/src/test/ui/traits/check-trait-object-bounds-4.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.rs similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-4.rs rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.rs diff --git a/src/test/ui/traits/check-trait-object-bounds-4.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-4.stderr rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr diff --git a/src/test/ui/traits/check-trait-object-bounds-5.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.rs similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-5.rs rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.rs diff --git a/src/test/ui/traits/check-trait-object-bounds-5.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-5.stderr rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr diff --git a/src/test/ui/traits/check-trait-object-bounds-6.rs b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.rs similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-6.rs rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.rs diff --git a/src/test/ui/traits/check-trait-object-bounds-6.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr similarity index 100% rename from src/test/ui/traits/check-trait-object-bounds-6.stderr rename to src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr diff --git a/src/test/ui/traits/astconv-cycle-between-trait-and-type.rs b/src/test/ui/traits/astconv-cycle-between-and-type.rs similarity index 100% rename from src/test/ui/traits/astconv-cycle-between-trait-and-type.rs rename to src/test/ui/traits/astconv-cycle-between-and-type.rs diff --git a/src/test/ui/traits/auxiliary/crate_a1.rs b/src/test/ui/traits/bound/auxiliary/crate_a1.rs similarity index 100% rename from src/test/ui/traits/auxiliary/crate_a1.rs rename to src/test/ui/traits/bound/auxiliary/crate_a1.rs diff --git a/src/test/ui/traits/auxiliary/crate_a2.rs b/src/test/ui/traits/bound/auxiliary/crate_a2.rs similarity index 100% rename from src/test/ui/traits/auxiliary/crate_a2.rs rename to src/test/ui/traits/bound/auxiliary/crate_a2.rs diff --git a/src/test/ui/traits/auxiliary/trait_bounds_on_structs_and_enums_xc.rs b/src/test/ui/traits/bound/auxiliary/on_structs_and_enums_xc.rs similarity index 100% rename from src/test/ui/traits/auxiliary/trait_bounds_on_structs_and_enums_xc.rs rename to src/test/ui/traits/bound/auxiliary/on_structs_and_enums_xc.rs diff --git a/src/test/ui/traits/trait-bounds-basic.rs b/src/test/ui/traits/bound/basic.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-basic.rs rename to src/test/ui/traits/bound/basic.rs diff --git a/src/test/ui/traits/trait-bounds.rs b/src/test/ui/traits/bound/generic_trait.rs similarity index 100% rename from src/test/ui/traits/trait-bounds.rs rename to src/test/ui/traits/bound/generic_trait.rs diff --git a/src/test/ui/traits/trait-bounds-impl-comparison-duplicates.rs b/src/test/ui/traits/bound/impl-comparison-duplicates.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-impl-comparison-duplicates.rs rename to src/test/ui/traits/bound/impl-comparison-duplicates.rs diff --git a/src/test/ui/traits/trait-bounds-in-arc.rs b/src/test/ui/traits/bound/in-arc.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-in-arc.rs rename to src/test/ui/traits/bound/in-arc.rs diff --git a/src/test/ui/traits/multiple-trait-bounds.rs b/src/test/ui/traits/bound/multiple.rs similarity index 100% rename from src/test/ui/traits/multiple-trait-bounds.rs rename to src/test/ui/traits/bound/multiple.rs diff --git a/src/test/ui/traits/trait-bounds-not-on-bare-trait.rs b/src/test/ui/traits/bound/not-on-bare-trait.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-not-on-bare-trait.rs rename to src/test/ui/traits/bound/not-on-bare-trait.rs diff --git a/src/test/ui/traits/trait-bounds-not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr similarity index 89% rename from src/test/ui/traits/trait-bounds-not-on-bare-trait.stderr rename to src/test/ui/traits/bound/not-on-bare-trait.stderr index 48eedc0b0ea43..e7fc0fa5ec0ec 100644 --- a/src/test/ui/traits/trait-bounds-not-on-bare-trait.stderr +++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr @@ -1,5 +1,5 @@ warning: trait objects without an explicit `dyn` are deprecated - --> $DIR/trait-bounds-not-on-bare-trait.rs:7:12 + --> $DIR/not-on-bare-trait.rs:7:12 | LL | fn foo(_x: Foo + Send) { | ^^^^^^^^^^ help: use `dyn`: `dyn Foo + Send` @@ -7,7 +7,7 @@ LL | fn foo(_x: Foo + Send) { = note: `#[warn(bare_trait_objects)]` on by default error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time - --> $DIR/trait-bounds-not-on-bare-trait.rs:7:8 + --> $DIR/not-on-bare-trait.rs:7:8 | LL | fn foo(_x: Foo + Send) { | ^^ doesn't have a size known at compile-time diff --git a/src/test/ui/traits/trait-bounds-not-on-struct.rs b/src/test/ui/traits/bound/not-on-struct.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-not-on-struct.rs rename to src/test/ui/traits/bound/not-on-struct.rs diff --git a/src/test/ui/traits/trait-bounds-not-on-struct.stderr b/src/test/ui/traits/bound/not-on-struct.stderr similarity index 86% rename from src/test/ui/traits/trait-bounds-not-on-struct.stderr rename to src/test/ui/traits/bound/not-on-struct.stderr index 0f97e3bdf1872..951e974ad2677 100644 --- a/src/test/ui/traits/trait-bounds-not-on-struct.stderr +++ b/src/test/ui/traits/bound/not-on-struct.stderr @@ -1,23 +1,23 @@ error[E0226]: only a single explicit lifetime bound is permitted - --> $DIR/trait-bounds-not-on-struct.rs:25:25 + --> $DIR/not-on-struct.rs:25:25 | LL | fn e() -> 'static + A + 'static { | ^^^^^^^ error[E0226]: only a single explicit lifetime bound is permitted - --> $DIR/trait-bounds-not-on-struct.rs:29:53 + --> $DIR/not-on-struct.rs:29:53 | LL | fn f<'a,T,E>(iter: Iterator + 'a>) { | ^^ error[E0404]: expected trait, found struct `Foo` - --> $DIR/trait-bounds-not-on-struct.rs:8:16 + --> $DIR/not-on-struct.rs:8:16 | LL | fn foo(_x: Box) { } | ^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:8:22 + --> $DIR/not-on-struct.rs:8:22 | LL | fn foo(_x: Box) { } | --- ^^^^ ...because of this bound @@ -25,19 +25,19 @@ LL | fn foo(_x: Box) { } | expected this type to be a trait... error[E0404]: expected trait, found struct `Vec` - --> $DIR/trait-bounds-not-on-struct.rs:10:29 + --> $DIR/not-on-struct.rs:10:29 | LL | type TypeAlias = Box>; | ^^^^^^ not a trait error[E0404]: expected trait, found struct `A` - --> $DIR/trait-bounds-not-on-struct.rs:13:11 + --> $DIR/not-on-struct.rs:13:11 | LL | fn a() -> A + 'static { | ^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:13:15 + --> $DIR/not-on-struct.rs:13:15 | LL | fn a() -> A + 'static { | - ^^^^^^^ ...because of this bound @@ -49,13 +49,13 @@ LL | fn a() -> A { | -- error[E0404]: expected trait, found enum `Result` - --> $DIR/trait-bounds-not-on-struct.rs:16:34 + --> $DIR/not-on-struct.rs:16:34 | LL | fn b<'a,T,E>(iter: Iterator + 'a>) { | ^^^^^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:16:48 + --> $DIR/not-on-struct.rs:16:48 | LL | fn b<'a,T,E>(iter: Iterator + 'a>) { | ----------- ^^ ...because of this bound @@ -67,13 +67,13 @@ LL | fn b<'a,T,E>(iter: Iterator>) { | -- error[E0404]: expected trait, found struct `A` - --> $DIR/trait-bounds-not-on-struct.rs:19:21 + --> $DIR/not-on-struct.rs:19:21 | LL | fn c() -> 'static + A { | ^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:19:11 + --> $DIR/not-on-struct.rs:19:11 | LL | fn c() -> 'static + A { | ^^^^^^^ - expected this type to be a trait... @@ -85,13 +85,13 @@ LL | fn c() -> A { | -- error[E0404]: expected trait, found enum `Result` - --> $DIR/trait-bounds-not-on-struct.rs:22:39 + --> $DIR/not-on-struct.rs:22:39 | LL | fn d<'a,T,E>(iter: Iterator>) { | ^^^^^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:22:34 + --> $DIR/not-on-struct.rs:22:34 | LL | fn d<'a,T,E>(iter: Iterator>) { | ^^ ----------- expected this type to be a trait... @@ -103,13 +103,13 @@ LL | fn d<'a,T,E>(iter: Iterator>) { | -- error[E0404]: expected trait, found struct `A` - --> $DIR/trait-bounds-not-on-struct.rs:25:21 + --> $DIR/not-on-struct.rs:25:21 | LL | fn e() -> 'static + A + 'static { | ^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:25:11 + --> $DIR/not-on-struct.rs:25:11 | LL | fn e() -> 'static + A + 'static { | ^^^^^^^ - ^^^^^^^ ...because of these bounds @@ -121,13 +121,13 @@ LL | fn e() -> A { | --- error[E0404]: expected trait, found enum `Result` - --> $DIR/trait-bounds-not-on-struct.rs:29:39 + --> $DIR/not-on-struct.rs:29:39 | LL | fn f<'a,T,E>(iter: Iterator + 'a>) { | ^^^^^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:29:34 + --> $DIR/not-on-struct.rs:29:34 | LL | fn f<'a,T,E>(iter: Iterator + 'a>) { | ^^ ----------- ^^ ...because of these bounds @@ -139,7 +139,7 @@ LL | fn f<'a,T,E>(iter: Iterator>) { | -- -- error[E0404]: expected trait, found struct `Traitor` - --> $DIR/trait-bounds-not-on-struct.rs:35:11 + --> $DIR/not-on-struct.rs:35:11 | LL | trait Trait {} | ----------- similarly named trait `Trait` defined here @@ -147,7 +147,7 @@ LL | fn g() -> Traitor + 'static { | ^^^^^^^ not a trait | help: `+` is used to constrain a "trait object" type with lifetimes or auto-traits; structs and enums can't be bound in that way - --> $DIR/trait-bounds-not-on-struct.rs:35:21 + --> $DIR/not-on-struct.rs:35:21 | LL | fn g() -> Traitor + 'static { | ------- ^^^^^^^ ...because of this bound diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.rs b/src/test/ui/traits/bound/on-structs-and-enums-in-fns.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.rs rename to src/test/ui/traits/bound/on-structs-and-enums-in-fns.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr b/src/test/ui/traits/bound/on-structs-and-enums-in-fns.stderr similarity index 83% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr rename to src/test/ui/traits/bound/on-structs-and-enums-in-fns.stderr index 6ca8ce0707f8c..346b690d441da 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-in-fns.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `u32: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:13:15 + --> $DIR/on-structs-and-enums-in-fns.rs:13:15 | LL | struct Foo { | ----- required by this bound in `Foo` @@ -8,7 +8,7 @@ LL | fn explode(x: Foo) {} | ^^^^^^^^ the trait `Trait` is not implemented for `u32` error[E0277]: the trait bound `f32: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:16:14 + --> $DIR/on-structs-and-enums-in-fns.rs:16:14 | LL | enum Bar { | ----- required by this bound in `Bar` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.rs b/src/test/ui/traits/bound/on-structs-and-enums-in-impls.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.rs rename to src/test/ui/traits/bound/on-structs-and-enums-in-impls.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr b/src/test/ui/traits/bound/on-structs-and-enums-in-impls.stderr similarity index 85% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr rename to src/test/ui/traits/bound/on-structs-and-enums-in-impls.stderr index 87271e7f1ee15..47bab6c375f7a 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-in-impls.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `u16: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-in-impls.rs:20:6 + --> $DIR/on-structs-and-enums-in-impls.rs:20:6 | LL | struct Foo { | ----- required by this bound in `Foo` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.rs b/src/test/ui/traits/bound/on-structs-and-enums-locals.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.rs rename to src/test/ui/traits/bound/on-structs-and-enums-locals.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr similarity index 83% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr rename to src/test/ui/traits/bound/on-structs-and-enums-locals.stderr index df016a7727428..967b7320ab6cd 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-locals.rs:15:14 + --> $DIR/on-structs-and-enums-locals.rs:15:14 | LL | struct Foo { | ----- required by this bound in `Foo` @@ -8,7 +8,7 @@ LL | let baz: Foo = loop { }; | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` error[E0277]: the trait bound `{integer}: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-locals.rs:10:15 + --> $DIR/on-structs-and-enums-locals.rs:10:15 | LL | struct Foo { | ------------------- required by `Foo` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-rpass.rs b/src/test/ui/traits/bound/on-structs-and-enums-rpass.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-rpass.rs rename to src/test/ui/traits/bound/on-structs-and-enums-rpass.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.rs b/src/test/ui/traits/bound/on-structs-and-enums-static.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-static.rs rename to src/test/ui/traits/bound/on-structs-and-enums-static.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr b/src/test/ui/traits/bound/on-structs-and-enums-static.stderr similarity index 86% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr rename to src/test/ui/traits/bound/on-structs-and-enums-static.stderr index 4b650e78badf9..2cf8a623b3fb3 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-static.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-static.rs:9:11 + --> $DIR/on-structs-and-enums-static.rs:9:11 | LL | struct Foo { | ----- required by this bound in `Foo` diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc.rs b/src/test/ui/traits/bound/on-structs-and-enums-xc.rs new file mode 100644 index 0000000000000..94316d2404057 --- /dev/null +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc.rs @@ -0,0 +1,14 @@ +// aux-build:on_structs_and_enums_xc.rs + +extern crate on_structs_and_enums_xc; + +use on_structs_and_enums_xc::{Bar, Foo, Trait}; + +fn explode(x: Foo) {} +//~^ ERROR E0277 + +fn kaboom(y: Bar) {} +//~^ ERROR E0277 + +fn main() { +} diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr similarity index 72% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr rename to src/test/ui/traits/bound/on-structs-and-enums-xc.stderr index 3e8c727dda03c..0adb20d482877 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr @@ -1,21 +1,21 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-xc.rs:7:15 + --> $DIR/on-structs-and-enums-xc.rs:7:15 | LL | fn explode(x: Foo) {} | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` | - ::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:5:18 + ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:5:18 | LL | pub struct Foo { | ----- required by this bound in `Foo` error[E0277]: the trait bound `f32: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-xc.rs:10:14 + --> $DIR/on-structs-and-enums-xc.rs:10:14 | LL | fn kaboom(y: Bar) {} | ^^^^^^^^ the trait `Trait` is not implemented for `f32` | - ::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:9:16 + ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16 | LL | pub enum Bar { | ----- required by this bound in `Bar` 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 new file mode 100644 index 0000000000000..8156868e048d9 --- /dev/null +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs @@ -0,0 +1,15 @@ +// aux-build:on_structs_and_enums_xc.rs + +extern crate on_structs_and_enums_xc; + +use on_structs_and_enums_xc::{Bar, Foo, Trait}; + +fn main() { + let foo = Foo { + //~^ ERROR E0277 + x: 3 + }; + let bar: Bar = return; + //~^ ERROR E0277 + let _ = bar; +} diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr similarity index 76% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr rename to src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr index 899e9941995ed..08f0f20e7480a 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr @@ -1,16 +1,16 @@ error[E0277]: the trait bound `f64: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-xc1.rs:12:14 + --> $DIR/on-structs-and-enums-xc1.rs:12:14 | LL | let bar: Bar = return; | ^^^^^^^^ the trait `Trait` is not implemented for `f64` | - ::: $DIR/auxiliary/trait_bounds_on_structs_and_enums_xc.rs:9:16 + ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16 | LL | pub enum Bar { | ----- required by this bound in `Bar` error[E0277]: the trait bound `{integer}: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums-xc1.rs:8:15 + --> $DIR/on-structs-and-enums-xc1.rs:8:15 | LL | let foo = Foo { | ^^^ the trait `Trait` is not implemented for `{integer}` diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums.rs b/src/test/ui/traits/bound/on-structs-and-enums.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums.rs rename to src/test/ui/traits/bound/on-structs-and-enums.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr b/src/test/ui/traits/bound/on-structs-and-enums.stderr similarity index 85% rename from src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr rename to src/test/ui/traits/bound/on-structs-and-enums.stderr index d7549835a0905..0c69e7b6feef6 100644 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `T: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums.rs:13:9 + --> $DIR/on-structs-and-enums.rs:13:9 | LL | struct Foo { | ----- required by this bound in `Foo` @@ -13,7 +13,7 @@ LL | impl Foo { | ^^^^^^^ error[E0277]: the trait bound `isize: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums.rs:19:8 + --> $DIR/on-structs-and-enums.rs:19:8 | LL | struct Foo { | ----- required by this bound in `Foo` @@ -22,7 +22,7 @@ LL | a: Foo, | ^^^^^^^^^^ the trait `Trait` is not implemented for `isize` error[E0277]: the trait bound `usize: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums.rs:23:10 + --> $DIR/on-structs-and-enums.rs:23:10 | LL | enum Bar { | ----- required by this bound in `Bar` @@ -31,7 +31,7 @@ LL | Quux(Bar), | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` error[E0277]: the trait bound `U: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums.rs:27:8 + --> $DIR/on-structs-and-enums.rs:27:8 | LL | struct Foo { | ----- required by this bound in `Foo` @@ -45,7 +45,7 @@ LL | struct Badness { | ^^^^^^^ error[E0277]: the trait bound `V: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums.rs:31:21 + --> $DIR/on-structs-and-enums.rs:31:21 | LL | enum Bar { | ----- required by this bound in `Bar` @@ -59,7 +59,7 @@ LL | enum MoreBadness { | ^^^^^^^ error[E0277]: the trait bound `i32: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums.rs:35:5 + --> $DIR/on-structs-and-enums.rs:35:5 | LL | struct Foo { | ----- required by this bound in `Foo` @@ -68,7 +68,7 @@ LL | Foo, | ^^^^^^^^ the trait `Trait` is not implemented for `i32` error[E0277]: the trait bound `u8: Trait` is not satisfied - --> $DIR/trait-bounds-on-structs-and-enums.rs:39:29 + --> $DIR/on-structs-and-enums.rs:39:29 | LL | enum Bar { | ----- required by this bound in `Bar` diff --git a/src/test/ui/traits/trait-bounds-recursion.rs b/src/test/ui/traits/bound/recursion.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-recursion.rs rename to src/test/ui/traits/bound/recursion.rs diff --git a/src/test/ui/traits/trait-bounds-same-crate-name.rs b/src/test/ui/traits/bound/same-crate-name.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-same-crate-name.rs rename to src/test/ui/traits/bound/same-crate-name.rs diff --git a/src/test/ui/traits/trait-bounds-same-crate-name.stderr b/src/test/ui/traits/bound/same-crate-name.stderr similarity index 92% rename from src/test/ui/traits/trait-bounds-same-crate-name.stderr rename to src/test/ui/traits/bound/same-crate-name.stderr index af5ba8808ff71..c48f2f0efcfb2 100644 --- a/src/test/ui/traits/trait-bounds-same-crate-name.stderr +++ b/src/test/ui/traits/bound/same-crate-name.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `Foo: main::a::Bar` is not satisfied - --> $DIR/trait-bounds-same-crate-name.rs:31:20 + --> $DIR/same-crate-name.rs:31:20 | LL | a::try_foo(foo); | ^^^ the trait `main::a::Bar` is not implemented for `Foo` @@ -17,7 +17,7 @@ LL | impl Bar for Foo {} = note: perhaps two different versions of crate `crate_a2` are being used? error[E0277]: the trait bound `DoesNotImplementTrait: main::a::Bar` is not satisfied - --> $DIR/trait-bounds-same-crate-name.rs:38:20 + --> $DIR/same-crate-name.rs:38:20 | LL | a::try_foo(implements_no_traits); | ^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `DoesNotImplementTrait` @@ -28,7 +28,7 @@ LL | pub fn try_foo(x: impl Bar) {} | --- required by this bound in `try_foo` error[E0277]: the trait bound `ImplementsWrongTraitConditionally: main::a::Bar` is not satisfied - --> $DIR/trait-bounds-same-crate-name.rs:45:20 + --> $DIR/same-crate-name.rs:45:20 | LL | a::try_foo(other_variant_implements_mismatched_trait); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsWrongTraitConditionally` @@ -46,7 +46,7 @@ LL | impl Bar for ImplementsWrongTraitConditionally {} = note: perhaps two different versions of crate `crate_a2` are being used? error[E0277]: the trait bound `ImplementsTraitForUsize: main::a::Bar` is not satisfied - --> $DIR/trait-bounds-same-crate-name.rs:51:20 + --> $DIR/same-crate-name.rs:51:20 | LL | a::try_foo(other_variant_implements_correct_trait); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsTraitForUsize` diff --git a/src/test/ui/traits/trait-bounds-sugar.rs b/src/test/ui/traits/bound/sugar.rs similarity index 100% rename from src/test/ui/traits/trait-bounds-sugar.rs rename to src/test/ui/traits/bound/sugar.rs diff --git a/src/test/ui/traits/trait-bounds-sugar.stderr b/src/test/ui/traits/bound/sugar.stderr similarity index 90% rename from src/test/ui/traits/trait-bounds-sugar.stderr rename to src/test/ui/traits/bound/sugar.stderr index 6bd335fe4739a..feb0c73a09d3d 100644 --- a/src/test/ui/traits/trait-bounds-sugar.stderr +++ b/src/test/ui/traits/bound/sugar.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/trait-bounds-sugar.rs:12:7 + --> $DIR/sugar.rs:12:7 | LL | a(x); | ^ expected trait `Foo + Send`, found trait `Foo + Sync` diff --git a/src/test/ui/traits/trait-cache-issue-18209.rs b/src/test/ui/traits/cache-issue-18209.rs similarity index 100% rename from src/test/ui/traits/trait-cache-issue-18209.rs rename to src/test/ui/traits/cache-issue-18209.rs diff --git a/src/test/ui/traits/trait-coercion-generic-bad.rs b/src/test/ui/traits/coercion-generic-bad.rs similarity index 100% rename from src/test/ui/traits/trait-coercion-generic-bad.rs rename to src/test/ui/traits/coercion-generic-bad.rs diff --git a/src/test/ui/traits/trait-coercion-generic-bad.stderr b/src/test/ui/traits/coercion-generic-bad.stderr similarity index 92% rename from src/test/ui/traits/trait-coercion-generic-bad.stderr rename to src/test/ui/traits/coercion-generic-bad.stderr index f2710dea0952f..f367d396da0c2 100644 --- a/src/test/ui/traits/trait-coercion-generic-bad.stderr +++ b/src/test/ui/traits/coercion-generic-bad.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `Struct: Trait` is not satisfied - --> $DIR/trait-coercion-generic-bad.rs:16:36 + --> $DIR/coercion-generic-bad.rs:16:36 | LL | let s: Box> = Box::new(Struct { person: "Fred" }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `Struct` diff --git a/src/test/ui/traits/trait-coercion-generic-regions.rs b/src/test/ui/traits/coercion-generic-regions.rs similarity index 100% rename from src/test/ui/traits/trait-coercion-generic-regions.rs rename to src/test/ui/traits/coercion-generic-regions.rs diff --git a/src/test/ui/traits/trait-coercion-generic-regions.stderr b/src/test/ui/traits/coercion-generic-regions.stderr similarity index 91% rename from src/test/ui/traits/trait-coercion-generic-regions.stderr rename to src/test/ui/traits/coercion-generic-regions.stderr index d21b48e571df9..5cfb64901233e 100644 --- a/src/test/ui/traits/trait-coercion-generic-regions.stderr +++ b/src/test/ui/traits/coercion-generic-regions.stderr @@ -1,5 +1,5 @@ error[E0597]: `person` does not live long enough - --> $DIR/trait-coercion-generic-regions.rs:17:24 + --> $DIR/coercion-generic-regions.rs:17:24 | LL | let person: &str = &person; | ^^^^^^^ diff --git a/src/test/ui/traits/trait-coercion-generic.rs b/src/test/ui/traits/coercion-generic.rs similarity index 100% rename from src/test/ui/traits/trait-coercion-generic.rs rename to src/test/ui/traits/coercion-generic.rs diff --git a/src/test/ui/traits/trait-coercion.rs b/src/test/ui/traits/coercion.rs similarity index 100% rename from src/test/ui/traits/trait-coercion.rs rename to src/test/ui/traits/coercion.rs diff --git a/src/test/ui/traits/trait-composition-trivial.rs b/src/test/ui/traits/composition-trivial.rs similarity index 100% rename from src/test/ui/traits/trait-composition-trivial.rs rename to src/test/ui/traits/composition-trivial.rs diff --git a/src/test/ui/traits/traits-conditional-dispatch.rs b/src/test/ui/traits/conditional-dispatch.rs similarity index 100% rename from src/test/ui/traits/traits-conditional-dispatch.rs rename to src/test/ui/traits/conditional-dispatch.rs diff --git a/src/test/ui/traits/traits-conditional-model-fn.rs b/src/test/ui/traits/conditional-model-fn.rs similarity index 100% rename from src/test/ui/traits/traits-conditional-model-fn.rs rename to src/test/ui/traits/conditional-model-fn.rs diff --git a/src/test/ui/traits/trait-copy-guessing.rs b/src/test/ui/traits/copy-guessing.rs similarity index 100% rename from src/test/ui/traits/trait-copy-guessing.rs rename to src/test/ui/traits/copy-guessing.rs diff --git a/src/test/ui/traits/cycle-trait-type-trait.rs b/src/test/ui/traits/cycle-type-trait.rs similarity index 100% rename from src/test/ui/traits/cycle-trait-type-trait.rs rename to src/test/ui/traits/cycle-type-trait.rs diff --git a/src/test/ui/traits/auxiliary/trait_default_method_xc_aux.rs b/src/test/ui/traits/default-method/auxiliary/xc.rs similarity index 100% rename from src/test/ui/traits/auxiliary/trait_default_method_xc_aux.rs rename to src/test/ui/traits/default-method/auxiliary/xc.rs diff --git a/src/test/ui/traits/auxiliary/trait_default_method_xc_aux_2.rs b/src/test/ui/traits/default-method/auxiliary/xc_2.rs similarity index 73% rename from src/test/ui/traits/auxiliary/trait_default_method_xc_aux_2.rs rename to src/test/ui/traits/default-method/auxiliary/xc_2.rs index 15480132a23f0..9792338204c70 100644 --- a/src/test/ui/traits/auxiliary/trait_default_method_xc_aux_2.rs +++ b/src/test/ui/traits/default-method/auxiliary/xc_2.rs @@ -1,6 +1,6 @@ -// aux-build:trait_default_method_xc_aux.rs +// aux-build:xc.rs -extern crate trait_default_method_xc_aux as aux; +extern crate xc as aux; use aux::A; pub struct a_struct { pub x: isize } diff --git a/src/test/ui/traits/trait-default-method-bound-subst.rs b/src/test/ui/traits/default-method/bound-subst.rs similarity index 100% rename from src/test/ui/traits/trait-default-method-bound-subst.rs rename to src/test/ui/traits/default-method/bound-subst.rs diff --git a/src/test/ui/traits/trait-default-method-bound-subst2.rs b/src/test/ui/traits/default-method/bound-subst2.rs similarity index 100% rename from src/test/ui/traits/trait-default-method-bound-subst2.rs rename to src/test/ui/traits/default-method/bound-subst2.rs diff --git a/src/test/ui/traits/trait-default-method-bound-subst3.rs b/src/test/ui/traits/default-method/bound-subst3.rs similarity index 100% rename from src/test/ui/traits/trait-default-method-bound-subst3.rs rename to src/test/ui/traits/default-method/bound-subst3.rs diff --git a/src/test/ui/traits/trait-default-method-bound-subst4.rs b/src/test/ui/traits/default-method/bound-subst4.rs similarity index 100% rename from src/test/ui/traits/trait-default-method-bound-subst4.rs rename to src/test/ui/traits/default-method/bound-subst4.rs diff --git a/src/test/ui/traits/trait-default-method-bound.rs b/src/test/ui/traits/default-method/bound.rs similarity index 100% rename from src/test/ui/traits/trait-default-method-bound.rs rename to src/test/ui/traits/default-method/bound.rs diff --git a/src/test/ui/traits/traits-default-method-macro.rs b/src/test/ui/traits/default-method/macro.rs similarity index 100% rename from src/test/ui/traits/traits-default-method-macro.rs rename to src/test/ui/traits/default-method/macro.rs diff --git a/src/test/ui/traits/traits-default-method-mut.rs b/src/test/ui/traits/default-method/mut.rs similarity index 100% rename from src/test/ui/traits/traits-default-method-mut.rs rename to src/test/ui/traits/default-method/mut.rs diff --git a/src/test/ui/traits/traits-default-method-self.rs b/src/test/ui/traits/default-method/self.rs similarity index 100% rename from src/test/ui/traits/traits-default-method-self.rs rename to src/test/ui/traits/default-method/self.rs diff --git a/src/test/ui/traits/default-method-supertrait-vtable.rs b/src/test/ui/traits/default-method/supervtable.rs similarity index 100% rename from src/test/ui/traits/default-method-supertrait-vtable.rs rename to src/test/ui/traits/default-method/supervtable.rs diff --git a/src/test/ui/traits/traits-default-method-trivial.rs b/src/test/ui/traits/default-method/trivial.rs similarity index 100% rename from src/test/ui/traits/traits-default-method-trivial.rs rename to src/test/ui/traits/default-method/trivial.rs diff --git a/src/test/ui/traits/trait-default-method-xc-2.rs b/src/test/ui/traits/default-method/xc-2.rs similarity index 63% rename from src/test/ui/traits/trait-default-method-xc-2.rs rename to src/test/ui/traits/default-method/xc-2.rs index 5fa1a6cba7295..1de61dcf89689 100644 --- a/src/test/ui/traits/trait-default-method-xc-2.rs +++ b/src/test/ui/traits/default-method/xc-2.rs @@ -1,11 +1,11 @@ // run-pass -// aux-build:trait_default_method_xc_aux.rs -// aux-build:trait_default_method_xc_aux_2.rs +// aux-build:xc.rs +// aux-build:xc_2.rs -extern crate trait_default_method_xc_aux as aux; -extern crate trait_default_method_xc_aux_2 as aux2; +extern crate xc as aux; +extern crate xc_2 as aux2; use aux::A; use aux2::{a_struct, welp}; diff --git a/src/test/ui/traits/trait-default-method-xc.rs b/src/test/ui/traits/default-method/xc.rs similarity index 94% rename from src/test/ui/traits/trait-default-method-xc.rs rename to src/test/ui/traits/default-method/xc.rs index 3c20a64961303..76a1573d6c767 100644 --- a/src/test/ui/traits/trait-default-method-xc.rs +++ b/src/test/ui/traits/default-method/xc.rs @@ -2,10 +2,10 @@ #![allow(dead_code)] #![allow(non_camel_case_types)] -// aux-build:trait_default_method_xc_aux.rs +// aux-build:xc.rs -extern crate trait_default_method_xc_aux as aux; +extern crate xc as aux; use aux::{A, TestEquality, Something}; use aux::B; diff --git a/src/test/ui/traits/trait-duplicate-methods.rs b/src/test/ui/traits/duplicate-methods.rs similarity index 100% rename from src/test/ui/traits/trait-duplicate-methods.rs rename to src/test/ui/traits/duplicate-methods.rs diff --git a/src/test/ui/traits/trait-duplicate-methods.stderr b/src/test/ui/traits/duplicate-methods.stderr similarity index 91% rename from src/test/ui/traits/trait-duplicate-methods.stderr rename to src/test/ui/traits/duplicate-methods.stderr index 7cba4cb63e6b0..6aa88d0dff4fa 100644 --- a/src/test/ui/traits/trait-duplicate-methods.stderr +++ b/src/test/ui/traits/duplicate-methods.stderr @@ -1,5 +1,5 @@ error[E0428]: the name `orange` is defined multiple times - --> $DIR/trait-duplicate-methods.rs:3:5 + --> $DIR/duplicate-methods.rs:3:5 | LL | fn orange(&self); | ----------------- previous definition of the value `orange` here diff --git a/src/test/ui/traits/traits-elaborate-type-region.rs b/src/test/ui/traits/elaborate-type-region.rs similarity index 100% rename from src/test/ui/traits/traits-elaborate-type-region.rs rename to src/test/ui/traits/elaborate-type-region.rs diff --git a/src/test/ui/traits/trait-false-ambiguity-where-clause-builtin-bound.rs b/src/test/ui/traits/false-ambiguity-where-clause-builtin-bound.rs similarity index 100% rename from src/test/ui/traits/trait-false-ambiguity-where-clause-builtin-bound.rs rename to src/test/ui/traits/false-ambiguity-where-clause-builtin-bound.rs diff --git a/src/test/ui/traits/trait-generic.rs b/src/test/ui/traits/generic.rs similarity index 100% rename from src/test/ui/traits/trait-generic.rs rename to src/test/ui/traits/generic.rs diff --git a/src/test/ui/traits/trait-impl-1.rs b/src/test/ui/traits/impl-1.rs similarity index 100% rename from src/test/ui/traits/trait-impl-1.rs rename to src/test/ui/traits/impl-1.rs diff --git a/src/test/ui/traits/trait-impl-1.stderr b/src/test/ui/traits/impl-1.stderr similarity index 88% rename from src/test/ui/traits/trait-impl-1.stderr rename to src/test/ui/traits/impl-1.stderr index da0936e8eebdc..7694e3f5cfae6 100644 --- a/src/test/ui/traits/trait-impl-1.stderr +++ b/src/test/ui/traits/impl-1.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `foo` found for reference `&i32` in the current scope - --> $DIR/trait-impl-1.rs:15:7 + --> $DIR/impl-1.rs:15:7 | LL | x.foo(); | ^^^ method not found in `&i32` diff --git a/src/test/ui/traits/trait-impl-2.rs b/src/test/ui/traits/impl-2.rs similarity index 100% rename from src/test/ui/traits/trait-impl-2.rs rename to src/test/ui/traits/impl-2.rs diff --git a/src/test/ui/traits/trait-impl-can-not-have-untraitful-items.rs b/src/test/ui/traits/impl-can-not-have-untraitful-items.rs similarity index 100% rename from src/test/ui/traits/trait-impl-can-not-have-untraitful-items.rs rename to src/test/ui/traits/impl-can-not-have-untraitful-items.rs diff --git a/src/test/ui/traits/trait-impl-can-not-have-untraitful-items.stderr b/src/test/ui/traits/impl-can-not-have-untraitful-items.stderr similarity index 76% rename from src/test/ui/traits/trait-impl-can-not-have-untraitful-items.stderr rename to src/test/ui/traits/impl-can-not-have-untraitful-items.stderr index 0abed79d38470..7f56f34ea1574 100644 --- a/src/test/ui/traits/trait-impl-can-not-have-untraitful-items.stderr +++ b/src/test/ui/traits/impl-can-not-have-untraitful-items.stderr @@ -1,17 +1,17 @@ error[E0438]: const `BAR` is not a member of trait `A` - --> $DIR/trait-impl-can-not-have-untraitful-items.rs:4:5 + --> $DIR/impl-can-not-have-untraitful-items.rs:4:5 | LL | const BAR: () = (); | ^^^^^^^^^^^^^^^^^^^ not a member of trait `A` error[E0437]: type `Baz` is not a member of trait `A` - --> $DIR/trait-impl-can-not-have-untraitful-items.rs:5:5 + --> $DIR/impl-can-not-have-untraitful-items.rs:5:5 | LL | type Baz = (); | ^^^^^^^^^^^^^^ not a member of trait `A` error[E0407]: method `foo` is not a member of trait `A` - --> $DIR/trait-impl-can-not-have-untraitful-items.rs:6:5 + --> $DIR/impl-can-not-have-untraitful-items.rs:6:5 | LL | fn foo(&self) { } | ^^^^^^^^^^^^^^^^^ not a member of trait `A` diff --git a/src/test/ui/traits/trait-impl-different-num-params.rs b/src/test/ui/traits/impl-different-num-params.rs similarity index 100% rename from src/test/ui/traits/trait-impl-different-num-params.rs rename to src/test/ui/traits/impl-different-num-params.rs diff --git a/src/test/ui/traits/trait-impl-different-num-params.stderr b/src/test/ui/traits/impl-different-num-params.stderr similarity index 88% rename from src/test/ui/traits/trait-impl-different-num-params.stderr rename to src/test/ui/traits/impl-different-num-params.stderr index 5ab93614f2474..910ba35106410 100644 --- a/src/test/ui/traits/trait-impl-different-num-params.stderr +++ b/src/test/ui/traits/impl-different-num-params.stderr @@ -1,5 +1,5 @@ error[E0050]: method `bar` has 1 parameter but the declaration in trait `Foo::bar` has 2 - --> $DIR/trait-impl-different-num-params.rs:5:12 + --> $DIR/impl-different-num-params.rs:5:12 | LL | fn bar(&self, x: usize) -> Self; | --------------- trait requires 2 parameters diff --git a/src/test/ui/traits/trait-impl-for-module.rs b/src/test/ui/traits/impl-for-module.rs similarity index 100% rename from src/test/ui/traits/trait-impl-for-module.rs rename to src/test/ui/traits/impl-for-module.rs diff --git a/src/test/ui/traits/trait-impl-for-module.stderr b/src/test/ui/traits/impl-for-module.stderr similarity index 88% rename from src/test/ui/traits/trait-impl-for-module.stderr rename to src/test/ui/traits/impl-for-module.stderr index cd2713a5bd50c..6ec4083b513db 100644 --- a/src/test/ui/traits/trait-impl-for-module.stderr +++ b/src/test/ui/traits/impl-for-module.stderr @@ -1,5 +1,5 @@ error[E0573]: expected type, found module `a` - --> $DIR/trait-impl-for-module.rs:7:12 + --> $DIR/impl-for-module.rs:7:12 | LL | trait A { | ------- similarly named trait `A` defined here diff --git a/src/test/ui/traits/trait-impl-method-mismatch.rs b/src/test/ui/traits/impl-method-mismatch.rs similarity index 100% rename from src/test/ui/traits/trait-impl-method-mismatch.rs rename to src/test/ui/traits/impl-method-mismatch.rs diff --git a/src/test/ui/traits/trait-impl-method-mismatch.stderr b/src/test/ui/traits/impl-method-mismatch.stderr similarity index 92% rename from src/test/ui/traits/trait-impl-method-mismatch.stderr rename to src/test/ui/traits/impl-method-mismatch.stderr index 52e4918624168..c909446d9dcb4 100644 --- a/src/test/ui/traits/trait-impl-method-mismatch.stderr +++ b/src/test/ui/traits/impl-method-mismatch.stderr @@ -1,5 +1,5 @@ error[E0053]: method `jumbo` has an incompatible type for trait - --> $DIR/trait-impl-method-mismatch.rs:7:5 + --> $DIR/impl-method-mismatch.rs:7:5 | LL | fn jumbo(&self, x: &usize) -> usize; | ------------------------------------ type in trait diff --git a/src/test/ui/traits/traits-impl-object-overlap-issue-23853.rs b/src/test/ui/traits/impl-object-overlap-issue-23853.rs similarity index 100% rename from src/test/ui/traits/traits-impl-object-overlap-issue-23853.rs rename to src/test/ui/traits/impl-object-overlap-issue-23853.rs diff --git a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs b/src/test/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.rs similarity index 100% rename from src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs rename to src/test/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.rs diff --git a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr b/src/test/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.stderr similarity index 72% rename from src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr rename to src/test/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.stderr index 46aa7db967ad4..539a56f010a84 100644 --- a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr +++ b/src/test/ui/traits/impl-of-supertrait-has-wrong-lifetime-parameters.stderr @@ -1,21 +1,21 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements - --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:13 + --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:13 | LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { | ^^^^^^^^^^ | note: first, the lifetime cannot outlive the lifetime `'a` as defined on the impl at 24:6... - --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:6 + --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:6 | LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { | ^^ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on the impl at 24:9... - --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:9 + --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:9 | LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { | ^^ note: ...so that the types are compatible - --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:13 + --> $DIR/impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:13 | LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { | ^^^^^^^^^^ diff --git a/src/test/ui/traits/trait-impl.rs b/src/test/ui/traits/impl.rs similarity index 100% rename from src/test/ui/traits/trait-impl.rs rename to src/test/ui/traits/impl.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs similarity index 100% rename from src/test/ui/traits/traits-inductive-overflow-lifetime.rs rename to src/test/ui/traits/inductive-overflow/lifetime.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr similarity index 89% rename from src/test/ui/traits/traits-inductive-overflow-lifetime.stderr rename to src/test/ui/traits/inductive-overflow/lifetime.stderr index b904826081f99..659f9e26e3e62 100644 --- a/src/test/ui/traits/traits-inductive-overflow-lifetime.stderr +++ b/src/test/ui/traits/inductive-overflow/lifetime.stderr @@ -1,5 +1,5 @@ error[E0275]: overflow evaluating the requirement `Box>>: NotAuto` - --> $DIR/traits-inductive-overflow-lifetime.rs:27:5 + --> $DIR/lifetime.rs:27:5 | LL | fn is_send() {} | ------- required by this bound in `is_send` diff --git a/src/test/ui/traits/traits-inductive-overflow-simultaneous.rs b/src/test/ui/traits/inductive-overflow/simultaneous.rs similarity index 100% rename from src/test/ui/traits/traits-inductive-overflow-simultaneous.rs rename to src/test/ui/traits/inductive-overflow/simultaneous.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr b/src/test/ui/traits/inductive-overflow/simultaneous.stderr similarity index 87% rename from src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr rename to src/test/ui/traits/inductive-overflow/simultaneous.stderr index a0d2d13fbf3d1..484ac8511790f 100644 --- a/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr +++ b/src/test/ui/traits/inductive-overflow/simultaneous.stderr @@ -1,5 +1,5 @@ error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum` - --> $DIR/traits-inductive-overflow-simultaneous.rs:18:5 + --> $DIR/simultaneous.rs:18:5 | LL | fn is_ee(t: T) { | ----- required by this bound in `is_ee` diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.rs b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.rs similarity index 100% rename from src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.rs rename to src/test/ui/traits/inductive-overflow/supertrait-auto-trait.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.stderr b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr similarity index 85% rename from src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.stderr rename to src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr index 140ffa4b079a3..6a0f7398cf139 100644 --- a/src/test/ui/traits/traits-inductive-overflow-supertrait-auto-trait.stderr +++ b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr @@ -1,5 +1,5 @@ error[E0568]: auto traits cannot have super traits - --> $DIR/traits-inductive-overflow-supertrait-auto-trait.rs:8:19 + --> $DIR/supertrait-auto-trait.rs:8:19 | LL | auto trait Magic: Copy {} | ----- ^^^^ help: remove the super traits @@ -7,7 +7,7 @@ LL | auto trait Magic: Copy {} | auto trait cannot have super traits error[E0277]: the trait bound `NoClone: Copy` is not satisfied - --> $DIR/traits-inductive-overflow-supertrait-auto-trait.rs:16:23 + --> $DIR/supertrait-auto-trait.rs:16:23 | LL | fn copy(x: T) -> (T, T) { (x, x) } | ----- required by this bound in `copy` diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait.rs b/src/test/ui/traits/inductive-overflow/supertrait.rs similarity index 100% rename from src/test/ui/traits/traits-inductive-overflow-supertrait.rs rename to src/test/ui/traits/inductive-overflow/supertrait.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr b/src/test/ui/traits/inductive-overflow/supertrait.stderr similarity index 88% rename from src/test/ui/traits/traits-inductive-overflow-supertrait.stderr rename to src/test/ui/traits/inductive-overflow/supertrait.stderr index a86648d9a1749..dfb967601e987 100644 --- a/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr +++ b/src/test/ui/traits/inductive-overflow/supertrait.stderr @@ -1,5 +1,5 @@ error[E0275]: overflow evaluating the requirement `NoClone: Magic` - --> $DIR/traits-inductive-overflow-supertrait.rs:13:18 + --> $DIR/supertrait.rs:13:18 | LL | fn copy(x: T) -> (T, T) { (x, x) } | ----- required by this bound in `copy` diff --git a/src/test/ui/traits/traits-inductive-overflow-two-traits.rs b/src/test/ui/traits/inductive-overflow/two-traits.rs similarity index 100% rename from src/test/ui/traits/traits-inductive-overflow-two-traits.rs rename to src/test/ui/traits/inductive-overflow/two-traits.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr b/src/test/ui/traits/inductive-overflow/two-traits.stderr similarity index 87% rename from src/test/ui/traits/traits-inductive-overflow-two-traits.stderr rename to src/test/ui/traits/inductive-overflow/two-traits.stderr index 996544ae5162d..d3f2931f25d47 100644 --- a/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr +++ b/src/test/ui/traits/inductive-overflow/two-traits.stderr @@ -1,5 +1,5 @@ error[E0277]: `T` cannot be shared between threads safely - --> $DIR/traits-inductive-overflow-two-traits.rs:11:5 + --> $DIR/two-traits.rs:11:5 | LL | type X: Trait; | ----- required by this bound in `Magic::X` @@ -13,7 +13,7 @@ LL | impl Magic for T { | ^^^^^^ error[E0275]: overflow evaluating the requirement `*mut (): Magic` - --> $DIR/traits-inductive-overflow-two-traits.rs:20:5 + --> $DIR/two-traits.rs:20:5 | LL | fn wizard() { check::<::X>(); } | ----- required by this bound in `wizard` diff --git a/src/test/ui/traits/infer-from-object-trait-issue-26952.rs b/src/test/ui/traits/infer-from-object-issue-26952.rs similarity index 100% rename from src/test/ui/traits/infer-from-object-trait-issue-26952.rs rename to src/test/ui/traits/infer-from-object-issue-26952.rs diff --git a/src/test/ui/traits/inherent-trait-method-order.rs b/src/test/ui/traits/inherent-method-order.rs similarity index 100% rename from src/test/ui/traits/inherent-trait-method-order.rs rename to src/test/ui/traits/inherent-method-order.rs diff --git a/src/test/ui/traits/trait-inheritance-auto-xc-2.rs b/src/test/ui/traits/inheritance/auto-xc-2.rs similarity index 78% rename from src/test/ui/traits/trait-inheritance-auto-xc-2.rs rename to src/test/ui/traits/inheritance/auto-xc-2.rs index 62c3ce8030c90..f2130228d51db 100644 --- a/src/test/ui/traits/trait-inheritance-auto-xc-2.rs +++ b/src/test/ui/traits/inheritance/auto-xc-2.rs @@ -1,8 +1,8 @@ // run-pass -// aux-build:trait_inheritance_auto_xc_2_aux.rs +// aux-build:auto_xc_2.rs -extern crate trait_inheritance_auto_xc_2_aux as aux; +extern crate auto_xc_2 as aux; // aux defines impls of Foo, Bar and Baz for A use aux::{Foo, Bar, Baz, A}; diff --git a/src/test/ui/traits/trait-inheritance-auto-xc.rs b/src/test/ui/traits/inheritance/auto-xc.rs similarity index 80% rename from src/test/ui/traits/trait-inheritance-auto-xc.rs rename to src/test/ui/traits/inheritance/auto-xc.rs index e8e651091ad00..3d5ae182af118 100644 --- a/src/test/ui/traits/trait-inheritance-auto-xc.rs +++ b/src/test/ui/traits/inheritance/auto-xc.rs @@ -1,9 +1,9 @@ // run-pass #![allow(dead_code)] -// aux-build:trait_inheritance_auto_xc_aux.rs +// aux-build:auto_xc.rs -extern crate trait_inheritance_auto_xc_aux as aux; +extern crate auto_xc as aux; use aux::{Foo, Bar, Baz, Quux}; diff --git a/src/test/ui/traits/trait-inheritance-auto.rs b/src/test/ui/traits/inheritance/auto.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-auto.rs rename to src/test/ui/traits/inheritance/auto.rs diff --git a/src/test/ui/traits/auxiliary/trait_inheritance_auto_xc_aux.rs b/src/test/ui/traits/inheritance/auxiliary/auto_xc.rs similarity index 100% rename from src/test/ui/traits/auxiliary/trait_inheritance_auto_xc_aux.rs rename to src/test/ui/traits/inheritance/auxiliary/auto_xc.rs diff --git a/src/test/ui/traits/auxiliary/trait_inheritance_auto_xc_2_aux.rs b/src/test/ui/traits/inheritance/auxiliary/auto_xc_2.rs similarity index 100% rename from src/test/ui/traits/auxiliary/trait_inheritance_auto_xc_2_aux.rs rename to src/test/ui/traits/inheritance/auxiliary/auto_xc_2.rs diff --git a/src/test/ui/traits/auxiliary/trait_inheritance_overloading_xc.rs b/src/test/ui/traits/inheritance/auxiliary/overloading_xc.rs similarity index 100% rename from src/test/ui/traits/auxiliary/trait_inheritance_overloading_xc.rs rename to src/test/ui/traits/inheritance/auxiliary/overloading_xc.rs diff --git a/src/test/ui/traits/auxiliary/trait_xc_call_aux.rs b/src/test/ui/traits/inheritance/auxiliary/xc_call.rs similarity index 100% rename from src/test/ui/traits/auxiliary/trait_xc_call_aux.rs rename to src/test/ui/traits/inheritance/auxiliary/xc_call.rs diff --git a/src/test/ui/traits/trait-inheritance2.rs b/src/test/ui/traits/inheritance/basic.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance2.rs rename to src/test/ui/traits/inheritance/basic.rs diff --git a/src/test/ui/traits/trait-inheritance-call-bound-inherited.rs b/src/test/ui/traits/inheritance/call-bound-inherited.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-call-bound-inherited.rs rename to src/test/ui/traits/inheritance/call-bound-inherited.rs diff --git a/src/test/ui/traits/trait-inheritance-call-bound-inherited2.rs b/src/test/ui/traits/inheritance/call-bound-inherited2.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-call-bound-inherited2.rs rename to src/test/ui/traits/inheritance/call-bound-inherited2.rs diff --git a/src/test/ui/traits/trait-inheritance-cast-without-call-to-supertrait.rs b/src/test/ui/traits/inheritance/cast-without-call-to-supertrait.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-cast-without-call-to-supertrait.rs rename to src/test/ui/traits/inheritance/cast-without-call-to-supertrait.rs diff --git a/src/test/ui/traits/trait-inheritance-cast.rs b/src/test/ui/traits/inheritance/cast.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-cast.rs rename to src/test/ui/traits/inheritance/cast.rs diff --git a/src/test/ui/traits/trait-inheritance-cross-trait-call-xc.rs b/src/test/ui/traits/inheritance/cross-trait-call-xc.rs similarity index 74% rename from src/test/ui/traits/trait-inheritance-cross-trait-call-xc.rs rename to src/test/ui/traits/inheritance/cross-trait-call-xc.rs index dbefb22cb72b4..99fbb5c6148dc 100644 --- a/src/test/ui/traits/trait-inheritance-cross-trait-call-xc.rs +++ b/src/test/ui/traits/inheritance/cross-trait-call-xc.rs @@ -1,8 +1,8 @@ // run-pass -// aux-build:trait_xc_call_aux.rs +// aux-build:xc_call.rs -extern crate trait_xc_call_aux as aux; +extern crate xc_call as aux; use aux::Foo; diff --git a/src/test/ui/traits/trait-inheritance-cross-trait-call.rs b/src/test/ui/traits/inheritance/cross-trait-call.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-cross-trait-call.rs rename to src/test/ui/traits/inheritance/cross-trait-call.rs diff --git a/src/test/ui/traits/trait-inheritance-diamond.rs b/src/test/ui/traits/inheritance/diamond.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-diamond.rs rename to src/test/ui/traits/inheritance/diamond.rs diff --git a/src/test/ui/traits/trait-inheritance-multiple-inheritors.rs b/src/test/ui/traits/inheritance/multiple-inheritors.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-multiple-inheritors.rs rename to src/test/ui/traits/inheritance/multiple-inheritors.rs diff --git a/src/test/ui/traits/trait-inheritance-multiple-params.rs b/src/test/ui/traits/inheritance/multiple-params.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-multiple-params.rs rename to src/test/ui/traits/inheritance/multiple-params.rs diff --git a/src/test/ui/traits/trait-inheritance-num.rs b/src/test/ui/traits/inheritance/num.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-num.rs rename to src/test/ui/traits/inheritance/num.rs diff --git a/src/test/ui/traits/trait-inheritance-num0.rs b/src/test/ui/traits/inheritance/num0.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-num0.rs rename to src/test/ui/traits/inheritance/num0.rs diff --git a/src/test/ui/traits/trait-inheritance-num1.rs b/src/test/ui/traits/inheritance/num1.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-num1.rs rename to src/test/ui/traits/inheritance/num1.rs diff --git a/src/test/ui/traits/trait-inheritance-num2.rs b/src/test/ui/traits/inheritance/num2.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-num2.rs rename to src/test/ui/traits/inheritance/num2.rs diff --git a/src/test/ui/traits/trait-inheritance-num3.rs b/src/test/ui/traits/inheritance/num3.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-num3.rs rename to src/test/ui/traits/inheritance/num3.rs diff --git a/src/test/ui/traits/trait-inheritance-num5.rs b/src/test/ui/traits/inheritance/num5.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-num5.rs rename to src/test/ui/traits/inheritance/num5.rs diff --git a/src/test/ui/traits/trait-inheritance-overloading-simple.rs b/src/test/ui/traits/inheritance/overloading-simple.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-overloading-simple.rs rename to src/test/ui/traits/inheritance/overloading-simple.rs diff --git a/src/test/ui/traits/trait-inheritance-overloading-xc-exe.rs b/src/test/ui/traits/inheritance/overloading-xc-exe.rs similarity index 68% rename from src/test/ui/traits/trait-inheritance-overloading-xc-exe.rs rename to src/test/ui/traits/inheritance/overloading-xc-exe.rs index 2a9acfdd04a91..08778061ba1c2 100644 --- a/src/test/ui/traits/trait-inheritance-overloading-xc-exe.rs +++ b/src/test/ui/traits/inheritance/overloading-xc-exe.rs @@ -1,9 +1,9 @@ // run-pass -// aux-build:trait_inheritance_overloading_xc.rs +// aux-build:overloading_xc.rs -extern crate trait_inheritance_overloading_xc; -use trait_inheritance_overloading_xc::{MyNum, MyInt}; +extern crate overloading_xc; +use overloading_xc::{MyNum, MyInt}; fn f(x: T, y: T) -> (T, T, T) { return (x.clone() + y.clone(), x.clone() - y.clone(), x * y); diff --git a/src/test/ui/traits/trait-inheritance-overloading.rs b/src/test/ui/traits/inheritance/overloading.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-overloading.rs rename to src/test/ui/traits/inheritance/overloading.rs diff --git a/src/test/ui/traits/traits-repeated-supertrait-ambig.rs b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.rs similarity index 100% rename from src/test/ui/traits/traits-repeated-supertrait-ambig.rs rename to src/test/ui/traits/inheritance/repeated-supertrait-ambig.rs diff --git a/src/test/ui/traits/traits-repeated-supertrait-ambig.stderr b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr similarity index 87% rename from src/test/ui/traits/traits-repeated-supertrait-ambig.stderr rename to src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr index 4107c49bd80ce..5353b5e2260d4 100644 --- a/src/test/ui/traits/traits-repeated-supertrait-ambig.stderr +++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `dyn CompareToInts: CompareTo` is not satisfied - --> $DIR/traits-repeated-supertrait-ambig.rs:26:7 + --> $DIR/repeated-supertrait-ambig.rs:26:7 | LL | c.same_as(22) | ^^^^^^^ the trait `CompareTo` is not implemented for `dyn CompareToInts` error[E0277]: the trait bound `C: CompareTo` is not satisfied - --> $DIR/traits-repeated-supertrait-ambig.rs:30:7 + --> $DIR/repeated-supertrait-ambig.rs:30:7 | LL | c.same_as(22) | ^^^^^^^ the trait `CompareTo` is not implemented for `C` @@ -16,7 +16,7 @@ LL | fn with_trait>(c: &C) -> bool { | ^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `dyn CompareToInts: CompareTo` is not satisfied - --> $DIR/traits-repeated-supertrait-ambig.rs:34:5 + --> $DIR/repeated-supertrait-ambig.rs:34:5 | LL | fn same_as(&self, t: T) -> bool; | -------------------------------- required by `CompareTo::same_as` @@ -25,7 +25,7 @@ LL | CompareToInts::same_as(c, 22) | ^^^^^^^^^^^^^^^^^^^^^^ the trait `CompareTo` is not implemented for `dyn CompareToInts` error[E0277]: the trait bound `C: CompareTo` is not satisfied - --> $DIR/traits-repeated-supertrait-ambig.rs:38:5 + --> $DIR/repeated-supertrait-ambig.rs:38:5 | LL | fn same_as(&self, t: T) -> bool; | -------------------------------- required by `CompareTo::same_as` @@ -39,7 +39,7 @@ LL | fn with_ufcs2>(c: &C) -> bool { | ^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `i64: CompareTo` is not satisfied - --> $DIR/traits-repeated-supertrait-ambig.rs:42:23 + --> $DIR/repeated-supertrait-ambig.rs:42:23 | LL | assert_eq!(22_i64.same_as(22), true); | ^^^^^^^ the trait `CompareTo` is not implemented for `i64` diff --git a/src/test/ui/traits/traits-repeated-supertrait.rs b/src/test/ui/traits/inheritance/repeated-supertrait.rs similarity index 100% rename from src/test/ui/traits/traits-repeated-supertrait.rs rename to src/test/ui/traits/inheritance/repeated-supertrait.rs diff --git a/src/test/ui/traits/trait-inheritance-self-in-supertype.rs b/src/test/ui/traits/inheritance/self-in-supertype.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-self-in-supertype.rs rename to src/test/ui/traits/inheritance/self-in-supertype.rs diff --git a/src/test/ui/traits/trait-inheritance-self.rs b/src/test/ui/traits/inheritance/self.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-self.rs rename to src/test/ui/traits/inheritance/self.rs diff --git a/src/test/ui/traits/trait-inheritance-simple.rs b/src/test/ui/traits/inheritance/simple.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-simple.rs rename to src/test/ui/traits/inheritance/simple.rs diff --git a/src/test/ui/traits/trait-inheritance-static.rs b/src/test/ui/traits/inheritance/static.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-static.rs rename to src/test/ui/traits/inheritance/static.rs diff --git a/src/test/ui/traits/trait-inheritance-static2.rs b/src/test/ui/traits/inheritance/static2.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-static2.rs rename to src/test/ui/traits/inheritance/static2.rs diff --git a/src/test/ui/traits/trait-inheritance-subst.rs b/src/test/ui/traits/inheritance/subst.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-subst.rs rename to src/test/ui/traits/inheritance/subst.rs diff --git a/src/test/ui/traits/trait-inheritance-subst2.rs b/src/test/ui/traits/inheritance/subst2.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-subst2.rs rename to src/test/ui/traits/inheritance/subst2.rs diff --git a/src/test/ui/traits/trait-inheritance-visibility.rs b/src/test/ui/traits/inheritance/visibility.rs similarity index 100% rename from src/test/ui/traits/trait-inheritance-visibility.rs rename to src/test/ui/traits/inheritance/visibility.rs diff --git a/src/test/ui/traits/traits-issue-22019.rs b/src/test/ui/traits/issue-22019.rs similarity index 100% rename from src/test/ui/traits/traits-issue-22019.rs rename to src/test/ui/traits/issue-22019.rs diff --git a/src/test/ui/traits/traits-issue-22110.rs b/src/test/ui/traits/issue-22110.rs similarity index 100% rename from src/test/ui/traits/traits-issue-22110.rs rename to src/test/ui/traits/issue-22110.rs diff --git a/src/test/ui/traits/traits-issue-22655.rs b/src/test/ui/traits/issue-22655.rs similarity index 100% rename from src/test/ui/traits/traits-issue-22655.rs rename to src/test/ui/traits/issue-22655.rs diff --git a/src/test/ui/traits/traits-issue-23003-overflow.rs b/src/test/ui/traits/issue-23003-overflow.rs similarity index 100% rename from src/test/ui/traits/traits-issue-23003-overflow.rs rename to src/test/ui/traits/issue-23003-overflow.rs diff --git a/src/test/ui/traits/traits-issue-23003.rs b/src/test/ui/traits/issue-23003.rs similarity index 100% rename from src/test/ui/traits/traits-issue-23003.rs rename to src/test/ui/traits/issue-23003.rs diff --git a/src/test/ui/traits/traits-issue-26339.rs b/src/test/ui/traits/issue-26339.rs similarity index 100% rename from src/test/ui/traits/traits-issue-26339.rs rename to src/test/ui/traits/issue-26339.rs diff --git a/src/test/ui/traits/traits-issue-71136.rs b/src/test/ui/traits/issue-71136.rs similarity index 100% rename from src/test/ui/traits/traits-issue-71136.rs rename to src/test/ui/traits/issue-71136.rs diff --git a/src/test/ui/traits/traits-issue-71136.stderr b/src/test/ui/traits/issue-71136.stderr similarity index 93% rename from src/test/ui/traits/traits-issue-71136.stderr rename to src/test/ui/traits/issue-71136.stderr index 23a8040f6ffb8..ba47fdb152239 100644 --- a/src/test/ui/traits/traits-issue-71136.stderr +++ b/src/test/ui/traits/issue-71136.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `Foo: Clone` is not satisfied - --> $DIR/traits-issue-71136.rs:5:5 + --> $DIR/issue-71136.rs:5:5 | LL | the_foos: Vec, | ^^^^^^^^^^^^^^^^^^ expected an implementor of trait `Clone` diff --git a/src/test/ui/traits/issue-9394-inherited-trait-calls.rs b/src/test/ui/traits/issue-9394-inherited-calls.rs similarity index 100% rename from src/test/ui/traits/issue-9394-inherited-trait-calls.rs rename to src/test/ui/traits/issue-9394-inherited-calls.rs diff --git a/src/test/ui/traits/trait-item-inside-macro.rs b/src/test/ui/traits/item-inside-macro.rs similarity index 100% rename from src/test/ui/traits/trait-item-inside-macro.rs rename to src/test/ui/traits/item-inside-macro.rs diff --git a/src/test/ui/traits/trait-item-privacy.rs b/src/test/ui/traits/item-privacy.rs similarity index 100% rename from src/test/ui/traits/trait-item-privacy.rs rename to src/test/ui/traits/item-privacy.rs diff --git a/src/test/ui/traits/trait-item-privacy.stderr b/src/test/ui/traits/item-privacy.stderr similarity index 86% rename from src/test/ui/traits/trait-item-privacy.stderr rename to src/test/ui/traits/item-privacy.stderr index 4d97d934376bf..6fd82142d61f7 100644 --- a/src/test/ui/traits/trait-item-privacy.stderr +++ b/src/test/ui/traits/item-privacy.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `a` found for struct `S` in the current scope - --> $DIR/trait-item-privacy.rs:67:7 + --> $DIR/item-privacy.rs:67:7 | LL | struct S; | --------- method `a` not found for this @@ -9,13 +9,13 @@ LL | S.a(); | = help: items from traits can only be used if the trait is implemented and in scope note: `method::A` defines an item `a`, perhaps you need to implement it - --> $DIR/trait-item-privacy.rs:6:5 + --> $DIR/item-privacy.rs:6:5 | LL | trait A { | ^^^^^^^ error[E0599]: no method named `b` found for struct `S` in the current scope - --> $DIR/trait-item-privacy.rs:68:7 + --> $DIR/item-privacy.rs:68:7 | LL | struct S; | --------- method `b` not found for this @@ -30,13 +30,13 @@ LL | use method::B; | error[E0624]: associated function `a` is private - --> $DIR/trait-item-privacy.rs:72:7 + --> $DIR/item-privacy.rs:72:7 | LL | c.a(); | ^ private associated function error[E0599]: no function or associated item named `a` found for struct `S` in the current scope - --> $DIR/trait-item-privacy.rs:78:8 + --> $DIR/item-privacy.rs:78:8 | LL | struct S; | --------- function or associated item `a` not found for this @@ -46,13 +46,13 @@ LL | S::a(&S); | = help: items from traits can only be used if the trait is implemented and in scope note: `method::A` defines an item `a`, perhaps you need to implement it - --> $DIR/trait-item-privacy.rs:6:5 + --> $DIR/item-privacy.rs:6:5 | LL | trait A { | ^^^^^^^ error[E0599]: no function or associated item named `b` found for struct `S` in the current scope - --> $DIR/trait-item-privacy.rs:80:8 + --> $DIR/item-privacy.rs:80:8 | LL | struct S; | --------- function or associated item `b` not found for this @@ -67,13 +67,13 @@ LL | use method::B; | error[E0624]: associated function `a` is private - --> $DIR/trait-item-privacy.rs:84:8 + --> $DIR/item-privacy.rs:84:8 | LL | C::a(&S); | ^ private associated function error[E0599]: no associated item named `A` found for struct `S` in the current scope - --> $DIR/trait-item-privacy.rs:97:8 + --> $DIR/item-privacy.rs:97:8 | LL | struct S; | --------- associated item `A` not found for this @@ -83,13 +83,13 @@ LL | S::A; | = help: items from traits can only be used if the trait is implemented and in scope note: `assoc_const::A` defines an item `A`, perhaps you need to implement it - --> $DIR/trait-item-privacy.rs:24:5 + --> $DIR/item-privacy.rs:24:5 | LL | trait A { | ^^^^^^^ error[E0599]: no associated item named `B` found for struct `S` in the current scope - --> $DIR/trait-item-privacy.rs:98:8 + --> $DIR/item-privacy.rs:98:8 | LL | struct S; | --------- associated item `B` not found for this @@ -104,13 +104,13 @@ LL | use assoc_const::B; | error[E0624]: associated constant `A` is private - --> $DIR/trait-item-privacy.rs:101:8 + --> $DIR/item-privacy.rs:101:8 | LL | C::A; | ^ private associated constant error[E0038]: the trait `assoc_const::C` cannot be made into an object - --> $DIR/trait-item-privacy.rs:101:5 + --> $DIR/item-privacy.rs:101:5 | LL | C::A; | ^^^^ `assoc_const::C` cannot be made into an object @@ -119,7 +119,7 @@ LL | C::A; = help: consider moving `B` to another trait = help: consider moving `A` to another trait 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 - --> $DIR/trait-item-privacy.rs:25:15 + --> $DIR/item-privacy.rs:25:15 | LL | const A: u8 = 0; | ^ ...because it contains this associated `const` @@ -133,31 +133,31 @@ LL | const C: u8 = 0; | ^ ...because it contains this associated `const` error[E0223]: ambiguous associated type - --> $DIR/trait-item-privacy.rs:115:12 + --> $DIR/item-privacy.rs:115:12 | LL | let _: S::A; | ^^^^ help: use fully-qualified syntax: `::A` error[E0223]: ambiguous associated type - --> $DIR/trait-item-privacy.rs:116:12 + --> $DIR/item-privacy.rs:116:12 | LL | let _: S::B; | ^^^^ help: use fully-qualified syntax: `::B` error[E0223]: ambiguous associated type - --> $DIR/trait-item-privacy.rs:117:12 + --> $DIR/item-privacy.rs:117:12 | LL | let _: S::C; | ^^^^ help: use fully-qualified syntax: `::C` error: associated type `A` is private - --> $DIR/trait-item-privacy.rs:119:12 + --> $DIR/item-privacy.rs:119:12 | LL | let _: T::A; | ^^^^ private associated type error: associated type `A` is private - --> $DIR/trait-item-privacy.rs:128:9 + --> $DIR/item-privacy.rs:128:9 | LL | A = u8, | ^^^^^^ private associated type diff --git a/src/test/ui/traits/kindck-owned-trait-contains-1.rs b/src/test/ui/traits/kindck-owned-contains-1.rs similarity index 100% rename from src/test/ui/traits/kindck-owned-trait-contains-1.rs rename to src/test/ui/traits/kindck-owned-contains-1.rs diff --git a/src/test/ui/traits/trait-matching-lifetimes.rs b/src/test/ui/traits/matching-lifetimes.rs similarity index 100% rename from src/test/ui/traits/trait-matching-lifetimes.rs rename to src/test/ui/traits/matching-lifetimes.rs diff --git a/src/test/ui/traits/trait-matching-lifetimes.stderr b/src/test/ui/traits/matching-lifetimes.stderr similarity index 80% rename from src/test/ui/traits/trait-matching-lifetimes.stderr rename to src/test/ui/traits/matching-lifetimes.stderr index 17ebdb7c82592..5c28d40160d0c 100644 --- a/src/test/ui/traits/trait-matching-lifetimes.stderr +++ b/src/test/ui/traits/matching-lifetimes.stderr @@ -1,5 +1,5 @@ error[E0308]: method not compatible with trait - --> $DIR/trait-matching-lifetimes.rs:14:5 + --> $DIR/matching-lifetimes.rs:14:5 | LL | fn foo(x: Foo<'b,'a>) { | ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch @@ -7,18 +7,18 @@ LL | fn foo(x: Foo<'b,'a>) { = note: expected fn pointer `fn(Foo<'a, 'b>)` found fn pointer `fn(Foo<'b, 'a>)` note: the lifetime `'b` as defined on the impl at 13:9... - --> $DIR/trait-matching-lifetimes.rs:13:9 + --> $DIR/matching-lifetimes.rs:13:9 | LL | impl<'a,'b> Tr for Foo<'a,'b> { | ^^ note: ...does not necessarily outlive the lifetime `'a` as defined on the impl at 13:6 - --> $DIR/trait-matching-lifetimes.rs:13:6 + --> $DIR/matching-lifetimes.rs:13:6 | LL | impl<'a,'b> Tr for Foo<'a,'b> { | ^^ error[E0308]: method not compatible with trait - --> $DIR/trait-matching-lifetimes.rs:14:5 + --> $DIR/matching-lifetimes.rs:14:5 | LL | fn foo(x: Foo<'b,'a>) { | ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch @@ -26,12 +26,12 @@ LL | fn foo(x: Foo<'b,'a>) { = note: expected fn pointer `fn(Foo<'a, 'b>)` found fn pointer `fn(Foo<'b, 'a>)` note: the lifetime `'a` as defined on the impl at 13:6... - --> $DIR/trait-matching-lifetimes.rs:13:6 + --> $DIR/matching-lifetimes.rs:13:6 | LL | impl<'a,'b> Tr for Foo<'a,'b> { | ^^ note: ...does not necessarily outlive the lifetime `'b` as defined on the impl at 13:9 - --> $DIR/trait-matching-lifetimes.rs:13:9 + --> $DIR/matching-lifetimes.rs:13:9 | LL | impl<'a,'b> Tr for Foo<'a,'b> { | ^^ diff --git a/src/test/ui/traits/trait-method-private.rs b/src/test/ui/traits/method-private.rs similarity index 100% rename from src/test/ui/traits/trait-method-private.rs rename to src/test/ui/traits/method-private.rs diff --git a/src/test/ui/traits/trait-method-private.stderr b/src/test/ui/traits/method-private.stderr similarity index 91% rename from src/test/ui/traits/trait-method-private.stderr rename to src/test/ui/traits/method-private.stderr index c33673aea4d79..99f330b38ae3d 100644 --- a/src/test/ui/traits/trait-method-private.stderr +++ b/src/test/ui/traits/method-private.stderr @@ -1,5 +1,5 @@ error[E0624]: associated function `method` is private - --> $DIR/trait-method-private.rs:19:9 + --> $DIR/method-private.rs:19:9 | LL | foo.method(); | ^^^^^^ private associated function diff --git a/src/test/ui/traits/traits-multidispatch-bad.rs b/src/test/ui/traits/multidispatch-bad.rs similarity index 100% rename from src/test/ui/traits/traits-multidispatch-bad.rs rename to src/test/ui/traits/multidispatch-bad.rs diff --git a/src/test/ui/traits/traits-multidispatch-bad.stderr b/src/test/ui/traits/multidispatch-bad.stderr similarity index 88% rename from src/test/ui/traits/traits-multidispatch-bad.stderr rename to src/test/ui/traits/multidispatch-bad.stderr index 671faf45178f9..8d4813c453e17 100644 --- a/src/test/ui/traits/traits-multidispatch-bad.stderr +++ b/src/test/ui/traits/multidispatch-bad.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/traits-multidispatch-bad.rs:19:17 + --> $DIR/multidispatch-bad.rs:19:17 | LL | test(22i32, 44i32); | ^^^^^ expected `u32`, found `i32` diff --git a/src/test/ui/traits/traits-multidispatch-convert-ambig-dest.rs b/src/test/ui/traits/multidispatch-convert-ambig-dest.rs similarity index 100% rename from src/test/ui/traits/traits-multidispatch-convert-ambig-dest.rs rename to src/test/ui/traits/multidispatch-convert-ambig-dest.rs diff --git a/src/test/ui/traits/traits-multidispatch-convert-ambig-dest.stderr b/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr similarity index 83% rename from src/test/ui/traits/traits-multidispatch-convert-ambig-dest.stderr rename to src/test/ui/traits/multidispatch-convert-ambig-dest.stderr index 338c8cbf2e4f2..62f5f5aaa88e0 100644 --- a/src/test/ui/traits/traits-multidispatch-convert-ambig-dest.stderr +++ b/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr @@ -1,5 +1,5 @@ error[E0282]: type annotations needed - --> $DIR/traits-multidispatch-convert-ambig-dest.rs:26:5 + --> $DIR/multidispatch-convert-ambig-dest.rs:26:5 | LL | test(22, std::default::Default::default()); | ^^^^ cannot infer type for type parameter `U` declared on the function `test` diff --git a/src/test/ui/traits/traits-multidispatch-infer-convert-target.rs b/src/test/ui/traits/multidispatch-infer-convert-target.rs similarity index 100% rename from src/test/ui/traits/traits-multidispatch-infer-convert-target.rs rename to src/test/ui/traits/multidispatch-infer-convert-target.rs diff --git a/src/test/ui/traits/trait-object-auto-dedup-in-impl.rs b/src/test/ui/traits/object/auto-dedup-in-impl.rs similarity index 100% rename from src/test/ui/traits/trait-object-auto-dedup-in-impl.rs rename to src/test/ui/traits/object/auto-dedup-in-impl.rs diff --git a/src/test/ui/traits/trait-object-auto-dedup-in-impl.stderr b/src/test/ui/traits/object/auto-dedup-in-impl.stderr similarity index 87% rename from src/test/ui/traits/trait-object-auto-dedup-in-impl.stderr rename to src/test/ui/traits/object/auto-dedup-in-impl.stderr index d10e58629cce7..5f13c781341c4 100644 --- a/src/test/ui/traits/trait-object-auto-dedup-in-impl.stderr +++ b/src/test/ui/traits/object/auto-dedup-in-impl.stderr @@ -1,5 +1,5 @@ error[E0592]: duplicate definitions with name `test` - --> $DIR/trait-object-auto-dedup-in-impl.rs:14:5 + --> $DIR/auto-dedup-in-impl.rs:14:5 | LL | fn test(&self) { println!("one"); } | ^^^^^^^^^^^^^^ duplicate definitions for `test` diff --git a/src/test/ui/traits/trait-object-auto-dedup.rs b/src/test/ui/traits/object/auto-dedup.rs similarity index 100% rename from src/test/ui/traits/trait-object-auto-dedup.rs rename to src/test/ui/traits/object/auto-dedup.rs diff --git a/src/test/ui/traits/trait-object-bounds-cycle-1.rs b/src/test/ui/traits/object/bounds-cycle-1.rs similarity index 100% rename from src/test/ui/traits/trait-object-bounds-cycle-1.rs rename to src/test/ui/traits/object/bounds-cycle-1.rs diff --git a/src/test/ui/traits/trait-object-bounds-cycle-2.rs b/src/test/ui/traits/object/bounds-cycle-2.rs similarity index 100% rename from src/test/ui/traits/trait-object-bounds-cycle-2.rs rename to src/test/ui/traits/object/bounds-cycle-2.rs diff --git a/src/test/ui/traits/trait-object-bounds-cycle-3.rs b/src/test/ui/traits/object/bounds-cycle-3.rs similarity index 100% rename from src/test/ui/traits/trait-object-bounds-cycle-3.rs rename to src/test/ui/traits/object/bounds-cycle-3.rs diff --git a/src/test/ui/traits/trait-object-bounds-cycle-4.rs b/src/test/ui/traits/object/bounds-cycle-4.rs similarity index 100% rename from src/test/ui/traits/trait-object-bounds-cycle-4.rs rename to src/test/ui/traits/object/bounds-cycle-4.rs diff --git a/src/test/ui/traits/trait-object-exclusion.rs b/src/test/ui/traits/object/exclusion.rs similarity index 100% rename from src/test/ui/traits/trait-object-exclusion.rs rename to src/test/ui/traits/object/exclusion.rs diff --git a/src/test/ui/traits/trait-object-generics.rs b/src/test/ui/traits/object/generics.rs similarity index 100% rename from src/test/ui/traits/trait-object-generics.rs rename to src/test/ui/traits/object/generics.rs diff --git a/src/test/ui/traits/trait-object-lifetime-first.rs b/src/test/ui/traits/object/lifetime-first.rs similarity index 100% rename from src/test/ui/traits/trait-object-lifetime-first.rs rename to src/test/ui/traits/object/lifetime-first.rs diff --git a/src/test/ui/traits/trait-object-macro-matcher.rs b/src/test/ui/traits/object/macro-matcher.rs similarity index 100% rename from src/test/ui/traits/trait-object-macro-matcher.rs rename to src/test/ui/traits/object/macro-matcher.rs diff --git a/src/test/ui/traits/trait-object-macro-matcher.stderr b/src/test/ui/traits/object/macro-matcher.stderr similarity index 89% rename from src/test/ui/traits/trait-object-macro-matcher.stderr rename to src/test/ui/traits/object/macro-matcher.stderr index 335eeb8f1515b..6d1e236c0483c 100644 --- a/src/test/ui/traits/trait-object-macro-matcher.stderr +++ b/src/test/ui/traits/object/macro-matcher.stderr @@ -1,11 +1,11 @@ error[E0224]: at least one trait is required for an object type - --> $DIR/trait-object-macro-matcher.rs:11:8 + --> $DIR/macro-matcher.rs:11:8 | LL | m!(dyn 'static +); | ^^^^^^^^^^^^^ error[E0038]: the trait `Copy` cannot be made into an object - --> $DIR/trait-object-macro-matcher.rs:8:8 + --> $DIR/macro-matcher.rs:8:8 | LL | m!(dyn Copy + Send + 'static); | ^^^^^^^^^^^^^^^^^^^^^^^^^ `Copy` cannot be made into an object diff --git a/src/test/ui/traits/trait-object-safety.rs b/src/test/ui/traits/object/safety.rs similarity index 100% rename from src/test/ui/traits/trait-object-safety.rs rename to src/test/ui/traits/object/safety.rs diff --git a/src/test/ui/traits/trait-object-safety.stderr b/src/test/ui/traits/object/safety.stderr similarity index 92% rename from src/test/ui/traits/trait-object-safety.stderr rename to src/test/ui/traits/object/safety.stderr index 16f60962cc1d7..6784689072e70 100644 --- a/src/test/ui/traits/trait-object-safety.stderr +++ b/src/test/ui/traits/object/safety.stderr @@ -1,11 +1,11 @@ error[E0038]: the trait `Tr` cannot be made into an object - --> $DIR/trait-object-safety.rs:15:22 + --> $DIR/safety.rs:15:22 | LL | let _: &dyn Tr = &St; | ^^^ `Tr` 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 - --> $DIR/trait-object-safety.rs:4:8 + --> $DIR/safety.rs:4:8 | LL | trait Tr { | -- this trait cannot be made into an object... @@ -23,13 +23,13 @@ LL | fn foo() where Self: Sized; | ^^^^^^^^^^^^^^^^^ error[E0038]: the trait `Tr` cannot be made into an object - --> $DIR/trait-object-safety.rs:15:12 + --> $DIR/safety.rs:15:12 | LL | let _: &dyn Tr = &St; | ^^^^^^^ `Tr` 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 - --> $DIR/trait-object-safety.rs:4:8 + --> $DIR/safety.rs:4:8 | LL | trait Tr { | -- this trait cannot be made into an object... diff --git a/src/test/ui/traits/trait-object-supertrait-lifetime-bound.rs b/src/test/ui/traits/object/supertrait-lifetime-bound.rs similarity index 100% rename from src/test/ui/traits/trait-object-supertrait-lifetime-bound.rs rename to src/test/ui/traits/object/supertrait-lifetime-bound.rs diff --git a/src/test/ui/traits/trait-object-vs-lifetime-2.rs b/src/test/ui/traits/object/vs-lifetime-2.rs similarity index 100% rename from src/test/ui/traits/trait-object-vs-lifetime-2.rs rename to src/test/ui/traits/object/vs-lifetime-2.rs diff --git a/src/test/ui/traits/trait-object-vs-lifetime-2.stderr b/src/test/ui/traits/object/vs-lifetime-2.stderr similarity index 84% rename from src/test/ui/traits/trait-object-vs-lifetime-2.stderr rename to src/test/ui/traits/object/vs-lifetime-2.stderr index 28b8e11f1330c..9b8e793dfd2ff 100644 --- a/src/test/ui/traits/trait-object-vs-lifetime-2.stderr +++ b/src/test/ui/traits/object/vs-lifetime-2.stderr @@ -1,5 +1,5 @@ error[E0224]: at least one trait is required for an object type - --> $DIR/trait-object-vs-lifetime-2.rs:7:5 + --> $DIR/vs-lifetime-2.rs:7:5 | LL | dyn 'static +: 'static + Copy, | ^^^^^^^^^^^^^ diff --git a/src/test/ui/traits/trait-object-vs-lifetime.rs b/src/test/ui/traits/object/vs-lifetime.rs similarity index 100% rename from src/test/ui/traits/trait-object-vs-lifetime.rs rename to src/test/ui/traits/object/vs-lifetime.rs diff --git a/src/test/ui/traits/trait-object-vs-lifetime.stderr b/src/test/ui/traits/object/vs-lifetime.stderr similarity index 81% rename from src/test/ui/traits/trait-object-vs-lifetime.stderr rename to src/test/ui/traits/object/vs-lifetime.stderr index 620c816d6d984..6673472e4a967 100644 --- a/src/test/ui/traits/trait-object-vs-lifetime.stderr +++ b/src/test/ui/traits/object/vs-lifetime.stderr @@ -1,11 +1,11 @@ error[E0224]: at least one trait is required for an object type - --> $DIR/trait-object-vs-lifetime.rs:9:23 + --> $DIR/vs-lifetime.rs:9:23 | LL | let _: S<'static, dyn 'static +>; | ^^^^^^^^^^^^^ error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied - --> $DIR/trait-object-vs-lifetime.rs:11:12 + --> $DIR/vs-lifetime.rs:11:12 | LL | let _: S<'static, 'static>; | ^ --------- help: remove this lifetime argument @@ -13,19 +13,19 @@ LL | let _: S<'static, 'static>; | expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` - --> $DIR/trait-object-vs-lifetime.rs:4:8 + --> $DIR/vs-lifetime.rs:4:8 | LL | struct S<'a, T>(&'a u8, T); | ^ -- error[E0107]: this struct takes 1 type argument but 0 type arguments were supplied - --> $DIR/trait-object-vs-lifetime.rs:11:12 + --> $DIR/vs-lifetime.rs:11:12 | LL | let _: S<'static, 'static>; | ^ expected 1 type argument | note: struct defined here, with 1 type parameter: `T` - --> $DIR/trait-object-vs-lifetime.rs:4:8 + --> $DIR/vs-lifetime.rs:4:8 | LL | struct S<'a, T>(&'a u8, T); | ^ - @@ -35,13 +35,13 @@ LL | let _: S<'static, 'static, T>; | ^^^ error[E0224]: at least one trait is required for an object type - --> $DIR/trait-object-vs-lifetime.rs:14:14 + --> $DIR/vs-lifetime.rs:14:14 | LL | let _: S; | ^^^^^^^^^^^^^ error[E0747]: type provided when a lifetime was expected - --> $DIR/trait-object-vs-lifetime.rs:14:14 + --> $DIR/vs-lifetime.rs:14:14 | LL | let _: S; | ^^^^^^^^^^^^^ diff --git a/src/test/ui/traits/trait-object-with-lifetime-bound.rs b/src/test/ui/traits/object/with-lifetime-bound.rs similarity index 100% rename from src/test/ui/traits/trait-object-with-lifetime-bound.rs rename to src/test/ui/traits/object/with-lifetime-bound.rs diff --git a/src/test/ui/traits/trait-object-with-self-in-projection-output-bad.rs b/src/test/ui/traits/object/with-self-in-projection-output-bad.rs similarity index 100% rename from src/test/ui/traits/trait-object-with-self-in-projection-output-bad.rs rename to src/test/ui/traits/object/with-self-in-projection-output-bad.rs diff --git a/src/test/ui/traits/trait-object-with-self-in-projection-output-bad.stderr b/src/test/ui/traits/object/with-self-in-projection-output-bad.stderr similarity index 86% rename from src/test/ui/traits/trait-object-with-self-in-projection-output-bad.stderr rename to src/test/ui/traits/object/with-self-in-projection-output-bad.stderr index 79eb27e101a9b..45978a84068de 100644 --- a/src/test/ui/traits/trait-object-with-self-in-projection-output-bad.stderr +++ b/src/test/ui/traits/object/with-self-in-projection-output-bad.stderr @@ -1,5 +1,5 @@ error[E0191]: the value of the associated type `Output` (from trait `Base`) must be specified - --> $DIR/trait-object-with-self-in-projection-output-bad.rs:45:21 + --> $DIR/with-self-in-projection-output-bad.rs:45:21 | LL | type Output; | ------------ `Output` defined here @@ -8,7 +8,7 @@ LL | let _x: Box> = Box::new(2u32); | ^^^^^^^^^^^^^^^^^^ help: specify the associated type: `Helper` error[E0191]: the value of the associated type `Output` (from trait `Base`) must be specified - --> $DIR/trait-object-with-self-in-projection-output-bad.rs:48:21 + --> $DIR/with-self-in-projection-output-bad.rs:48:21 | LL | type Output; | ------------ `Output` defined here diff --git a/src/test/ui/traits/trait-object-with-self-in-projection-output-good.rs b/src/test/ui/traits/object/with-self-in-projection-output-good.rs similarity index 100% rename from src/test/ui/traits/trait-object-with-self-in-projection-output-good.rs rename to src/test/ui/traits/object/with-self-in-projection-output-good.rs diff --git a/src/test/ui/traits/trait-object-with-self-in-projection-output-repeated-supertrait.rs b/src/test/ui/traits/object/with-self-in-projection-output-repeated-supertrait.rs similarity index 100% rename from src/test/ui/traits/trait-object-with-self-in-projection-output-repeated-supertrait.rs rename to src/test/ui/traits/object/with-self-in-projection-output-repeated-supertrait.rs diff --git a/src/test/ui/traits/trait-param-without-lifetime-constraint.rs b/src/test/ui/traits/param-without-lifetime-constraint.rs similarity index 100% rename from src/test/ui/traits/trait-param-without-lifetime-constraint.rs rename to src/test/ui/traits/param-without-lifetime-constraint.rs diff --git a/src/test/ui/traits/trait-param-without-lifetime-constraint.stderr b/src/test/ui/traits/param-without-lifetime-constraint.stderr similarity index 85% rename from src/test/ui/traits/trait-param-without-lifetime-constraint.stderr rename to src/test/ui/traits/param-without-lifetime-constraint.stderr index 4942dbe480ba3..763fb5186cc9a 100644 --- a/src/test/ui/traits/trait-param-without-lifetime-constraint.stderr +++ b/src/test/ui/traits/param-without-lifetime-constraint.stderr @@ -1,5 +1,5 @@ error: `impl` item signature doesn't match `trait` item signature - --> $DIR/trait-param-without-lifetime-constraint.rs:14:5 + --> $DIR/param-without-lifetime-constraint.rs:14:5 | LL | fn get_relation(&self) -> To; | ----------------------------- expected `fn(&Article) -> &ProofReader` @@ -10,7 +10,7 @@ LL | fn get_relation(&self) -> &ProofReader { = note: expected `fn(&Article) -> &ProofReader` found `fn(&Article) -> &ProofReader` help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` - --> $DIR/trait-param-without-lifetime-constraint.rs:10:31 + --> $DIR/param-without-lifetime-constraint.rs:10:31 | LL | fn get_relation(&self) -> To; | ^^ consider borrowing this type parameter in the trait diff --git a/src/test/ui/traits/parameterized-trait-with-bounds.rs b/src/test/ui/traits/parameterized-with-bounds.rs similarity index 100% rename from src/test/ui/traits/parameterized-trait-with-bounds.rs rename to src/test/ui/traits/parameterized-with-bounds.rs diff --git a/src/test/ui/traits/principal-less-trait-objects.rs b/src/test/ui/traits/principal-less-objects.rs similarity index 100% rename from src/test/ui/traits/principal-less-trait-objects.rs rename to src/test/ui/traits/principal-less-objects.rs diff --git a/src/test/ui/traits/trait-privacy.rs b/src/test/ui/traits/privacy.rs similarity index 100% rename from src/test/ui/traits/trait-privacy.rs rename to src/test/ui/traits/privacy.rs diff --git a/src/test/ui/traits/trait-region-pointer-simple.rs b/src/test/ui/traits/region-pointer-simple.rs similarity index 100% rename from src/test/ui/traits/trait-region-pointer-simple.rs rename to src/test/ui/traits/region-pointer-simple.rs diff --git a/src/test/ui/traits/reservation-impls/reservation-impl-coherence-conflict.rs b/src/test/ui/traits/reservation-impl/coherence-conflict.rs similarity index 100% rename from src/test/ui/traits/reservation-impls/reservation-impl-coherence-conflict.rs rename to src/test/ui/traits/reservation-impl/coherence-conflict.rs diff --git a/src/test/ui/traits/reservation-impls/reservation-impl-coherence-conflict.stderr b/src/test/ui/traits/reservation-impl/coherence-conflict.stderr similarity index 88% rename from src/test/ui/traits/reservation-impls/reservation-impl-coherence-conflict.stderr rename to src/test/ui/traits/reservation-impl/coherence-conflict.stderr index d76d3a91c8d3f..1a227a85c06f6 100644 --- a/src/test/ui/traits/reservation-impls/reservation-impl-coherence-conflict.stderr +++ b/src/test/ui/traits/reservation-impl/coherence-conflict.stderr @@ -1,5 +1,5 @@ error[E0119]: conflicting implementations of trait `OtherTrait` for type `()`: - --> $DIR/reservation-impl-coherence-conflict.rs:11:1 + --> $DIR/coherence-conflict.rs:11:1 | LL | impl OtherTrait for () {} | ---------------------- first implementation here diff --git a/src/test/ui/traits/reservation-impls/reservation-impl-no-use.rs b/src/test/ui/traits/reservation-impl/no-use.rs similarity index 100% rename from src/test/ui/traits/reservation-impls/reservation-impl-no-use.rs rename to src/test/ui/traits/reservation-impl/no-use.rs diff --git a/src/test/ui/traits/reservation-impls/reservation-impl-no-use.stderr b/src/test/ui/traits/reservation-impl/no-use.stderr similarity index 91% rename from src/test/ui/traits/reservation-impls/reservation-impl-no-use.stderr rename to src/test/ui/traits/reservation-impl/no-use.stderr index 794faff8848fe..fb4a443435fa5 100644 --- a/src/test/ui/traits/reservation-impls/reservation-impl-no-use.stderr +++ b/src/test/ui/traits/reservation-impl/no-use.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): MyTrait` is not satisfied - --> $DIR/reservation-impl-no-use.rs:10:26 + --> $DIR/no-use.rs:10:26 | LL | trait MyTrait { fn foo(&self); } | -------------- required by `MyTrait::foo` diff --git a/src/test/ui/traits/reservation-impls/reservation-impl-non-lattice-ok.rs b/src/test/ui/traits/reservation-impl/non-lattice-ok.rs similarity index 100% rename from src/test/ui/traits/reservation-impls/reservation-impl-non-lattice-ok.rs rename to src/test/ui/traits/reservation-impl/non-lattice-ok.rs diff --git a/src/test/ui/traits/reservation-impls/reservation-impl-ok.rs b/src/test/ui/traits/reservation-impl/ok.rs similarity index 100% rename from src/test/ui/traits/reservation-impls/reservation-impl-ok.rs rename to src/test/ui/traits/reservation-impl/ok.rs diff --git a/src/test/ui/traits/trait-resolution-in-overloaded-op.rs b/src/test/ui/traits/resolution-in-overloaded-op.rs similarity index 100% rename from src/test/ui/traits/trait-resolution-in-overloaded-op.rs rename to src/test/ui/traits/resolution-in-overloaded-op.rs diff --git a/src/test/ui/traits/trait-resolution-in-overloaded-op.stderr b/src/test/ui/traits/resolution-in-overloaded-op.stderr similarity index 88% rename from src/test/ui/traits/trait-resolution-in-overloaded-op.stderr rename to src/test/ui/traits/resolution-in-overloaded-op.stderr index ada76cd8b7720..6a641ed214dfa 100644 --- a/src/test/ui/traits/trait-resolution-in-overloaded-op.stderr +++ b/src/test/ui/traits/resolution-in-overloaded-op.stderr @@ -1,5 +1,5 @@ error[E0369]: cannot multiply `&T` by `f64` - --> $DIR/trait-resolution-in-overloaded-op.rs:8:7 + --> $DIR/resolution-in-overloaded-op.rs:8:7 | LL | a * b | - ^ - f64 diff --git a/src/test/ui/traits/trait-safety-fn-body.rs b/src/test/ui/traits/safety-fn-body.rs similarity index 100% rename from src/test/ui/traits/trait-safety-fn-body.rs rename to src/test/ui/traits/safety-fn-body.rs diff --git a/src/test/ui/traits/trait-safety-fn-body.stderr b/src/test/ui/traits/safety-fn-body.stderr similarity index 91% rename from src/test/ui/traits/trait-safety-fn-body.stderr rename to src/test/ui/traits/safety-fn-body.stderr index a27cd869da565..4f784a020d915 100644 --- a/src/test/ui/traits/trait-safety-fn-body.stderr +++ b/src/test/ui/traits/safety-fn-body.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/trait-safety-fn-body.rs:11:9 + --> $DIR/safety-fn-body.rs:11:9 | LL | *self += 1; | ^^^^^^^^^^ dereference of raw pointer diff --git a/src/test/ui/traits/trait-safety-inherent-impl.rs b/src/test/ui/traits/safety-inherent-impl.rs similarity index 100% rename from src/test/ui/traits/trait-safety-inherent-impl.rs rename to src/test/ui/traits/safety-inherent-impl.rs diff --git a/src/test/ui/traits/trait-safety-inherent-impl.stderr b/src/test/ui/traits/safety-inherent-impl.stderr similarity index 85% rename from src/test/ui/traits/trait-safety-inherent-impl.stderr rename to src/test/ui/traits/safety-inherent-impl.stderr index 0738d2973e2d7..1c8f43feca431 100644 --- a/src/test/ui/traits/trait-safety-inherent-impl.stderr +++ b/src/test/ui/traits/safety-inherent-impl.stderr @@ -1,5 +1,5 @@ error[E0197]: inherent impls cannot be unsafe - --> $DIR/trait-safety-inherent-impl.rs:5:13 + --> $DIR/safety-inherent-impl.rs:5:13 | LL | unsafe impl SomeStruct { | ------ ^^^^^^^^^^ inherent impl for this type diff --git a/src/test/ui/traits/trait-safety-ok-cc.rs b/src/test/ui/traits/safety-ok-cc.rs similarity index 100% rename from src/test/ui/traits/trait-safety-ok-cc.rs rename to src/test/ui/traits/safety-ok-cc.rs diff --git a/src/test/ui/traits/trait-safety-ok.rs b/src/test/ui/traits/safety-ok.rs similarity index 100% rename from src/test/ui/traits/trait-safety-ok.rs rename to src/test/ui/traits/safety-ok.rs diff --git a/src/test/ui/traits/trait-safety-trait-impl-cc.rs b/src/test/ui/traits/safety-trait-impl-cc.rs similarity index 100% rename from src/test/ui/traits/trait-safety-trait-impl-cc.rs rename to src/test/ui/traits/safety-trait-impl-cc.rs diff --git a/src/test/ui/traits/trait-safety-trait-impl-cc.stderr b/src/test/ui/traits/safety-trait-impl-cc.stderr similarity index 87% rename from src/test/ui/traits/trait-safety-trait-impl-cc.stderr rename to src/test/ui/traits/safety-trait-impl-cc.stderr index 2fcedc5cc520f..5a0f8d3b8caca 100644 --- a/src/test/ui/traits/trait-safety-trait-impl-cc.stderr +++ b/src/test/ui/traits/safety-trait-impl-cc.stderr @@ -1,5 +1,5 @@ error[E0200]: the trait `Foo` requires an `unsafe impl` declaration - --> $DIR/trait-safety-trait-impl-cc.rs:9:1 + --> $DIR/safety-trait-impl-cc.rs:9:1 | LL | / impl lib::Foo for Bar { LL | | fn foo(&self) -> isize { diff --git a/src/test/ui/traits/trait-safety-trait-impl.rs b/src/test/ui/traits/safety-trait-impl.rs similarity index 100% rename from src/test/ui/traits/trait-safety-trait-impl.rs rename to src/test/ui/traits/safety-trait-impl.rs diff --git a/src/test/ui/traits/trait-safety-trait-impl.stderr b/src/test/ui/traits/safety-trait-impl.stderr similarity index 84% rename from src/test/ui/traits/trait-safety-trait-impl.stderr rename to src/test/ui/traits/safety-trait-impl.stderr index 5b29fd12ab5fd..fc0f6c6930891 100644 --- a/src/test/ui/traits/trait-safety-trait-impl.stderr +++ b/src/test/ui/traits/safety-trait-impl.stderr @@ -1,11 +1,11 @@ error[E0200]: the trait `UnsafeTrait` requires an `unsafe impl` declaration - --> $DIR/trait-safety-trait-impl.rs:14:1 + --> $DIR/safety-trait-impl.rs:14:1 | LL | impl UnsafeTrait for u16 { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0199]: implementing the trait `SafeTrait` is not unsafe - --> $DIR/trait-safety-trait-impl.rs:16:1 + --> $DIR/safety-trait-impl.rs:16:1 | LL | unsafe impl SafeTrait for u32 { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/traits/trait-static-method-generic-inference.rs b/src/test/ui/traits/static-method-generic-inference.rs similarity index 100% rename from src/test/ui/traits/trait-static-method-generic-inference.rs rename to src/test/ui/traits/static-method-generic-inference.rs diff --git a/src/test/ui/traits/trait-static-method-generic-inference.stderr b/src/test/ui/traits/static-method-generic-inference.stderr similarity index 87% rename from src/test/ui/traits/trait-static-method-generic-inference.stderr rename to src/test/ui/traits/static-method-generic-inference.stderr index 6a7e8f59d8792..2b9ce7321eeae 100644 --- a/src/test/ui/traits/trait-static-method-generic-inference.stderr +++ b/src/test/ui/traits/static-method-generic-inference.stderr @@ -1,5 +1,5 @@ error[E0283]: type annotations needed - --> $DIR/trait-static-method-generic-inference.rs:24:25 + --> $DIR/static-method-generic-inference.rs:24:25 | LL | fn new() -> T; | -------------- required by `HasNew::new` diff --git a/src/test/ui/traits/trait-static-method-overwriting.rs b/src/test/ui/traits/static-method-overwriting.rs similarity index 100% rename from src/test/ui/traits/trait-static-method-overwriting.rs rename to src/test/ui/traits/static-method-overwriting.rs diff --git a/src/test/ui/traits/traits-static-outlives-a-where-clause.rs b/src/test/ui/traits/static-outlives-a-where-clause.rs similarity index 100% rename from src/test/ui/traits/traits-static-outlives-a-where-clause.rs rename to src/test/ui/traits/static-outlives-a-where-clause.rs diff --git a/src/test/ui/traits/trait-suggest-deferences-issue-39029.fixed b/src/test/ui/traits/suggest-deferences/issue-39029.fixed similarity index 100% rename from src/test/ui/traits/trait-suggest-deferences-issue-39029.fixed rename to src/test/ui/traits/suggest-deferences/issue-39029.fixed diff --git a/src/test/ui/traits/trait-suggest-deferences-issue-39029.rs b/src/test/ui/traits/suggest-deferences/issue-39029.rs similarity index 100% rename from src/test/ui/traits/trait-suggest-deferences-issue-39029.rs rename to src/test/ui/traits/suggest-deferences/issue-39029.rs diff --git a/src/test/ui/traits/trait-suggest-deferences-issue-39029.stderr b/src/test/ui/traits/suggest-deferences/issue-39029.stderr similarity index 93% rename from src/test/ui/traits/trait-suggest-deferences-issue-39029.stderr rename to src/test/ui/traits/suggest-deferences/issue-39029.stderr index 4273b8e3f3e44..1005231d396e7 100644 --- a/src/test/ui/traits/trait-suggest-deferences-issue-39029.stderr +++ b/src/test/ui/traits/suggest-deferences/issue-39029.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `NoToSocketAddrs: ToSocketAddrs` is not satisfied - --> $DIR/trait-suggest-deferences-issue-39029.rs:16:37 + --> $DIR/issue-39029.rs:16:37 | LL | let _errors = TcpListener::bind(&bad); | ^^^^ diff --git a/src/test/ui/traits/trait-suggest-deferences-issue-62530.fixed b/src/test/ui/traits/suggest-deferences/issue-62530.fixed similarity index 100% rename from src/test/ui/traits/trait-suggest-deferences-issue-62530.fixed rename to src/test/ui/traits/suggest-deferences/issue-62530.fixed diff --git a/src/test/ui/traits/trait-suggest-deferences-issue-62530.rs b/src/test/ui/traits/suggest-deferences/issue-62530.rs similarity index 100% rename from src/test/ui/traits/trait-suggest-deferences-issue-62530.rs rename to src/test/ui/traits/suggest-deferences/issue-62530.rs diff --git a/src/test/ui/traits/trait-suggest-deferences-issue-62530.stderr b/src/test/ui/traits/suggest-deferences/issue-62530.stderr similarity index 91% rename from src/test/ui/traits/trait-suggest-deferences-issue-62530.stderr rename to src/test/ui/traits/suggest-deferences/issue-62530.stderr index eaec87d01da69..4f1165b17c53c 100644 --- a/src/test/ui/traits/trait-suggest-deferences-issue-62530.stderr +++ b/src/test/ui/traits/suggest-deferences/issue-62530.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `&String: SomeTrait` is not satisfied - --> $DIR/trait-suggest-deferences-issue-62530.rs:13:26 + --> $DIR/issue-62530.rs:13:26 | LL | fn takes_type_parameter(_x: T) where T: SomeTrait {} | --------- required by this bound in `takes_type_parameter` diff --git a/src/test/ui/traits/trait-suggest-deferences-multiple-0.fixed b/src/test/ui/traits/suggest-deferences/multiple-0.fixed similarity index 100% rename from src/test/ui/traits/trait-suggest-deferences-multiple-0.fixed rename to src/test/ui/traits/suggest-deferences/multiple-0.fixed diff --git a/src/test/ui/traits/trait-suggest-deferences-multiple-0.rs b/src/test/ui/traits/suggest-deferences/multiple-0.rs similarity index 100% rename from src/test/ui/traits/trait-suggest-deferences-multiple-0.rs rename to src/test/ui/traits/suggest-deferences/multiple-0.rs diff --git a/src/test/ui/traits/trait-suggest-deferences-multiple-0.stderr b/src/test/ui/traits/suggest-deferences/multiple-0.stderr similarity index 89% rename from src/test/ui/traits/trait-suggest-deferences-multiple-0.stderr rename to src/test/ui/traits/suggest-deferences/multiple-0.stderr index add34a553bc9f..f76c73cbb6354 100644 --- a/src/test/ui/traits/trait-suggest-deferences-multiple-0.stderr +++ b/src/test/ui/traits/suggest-deferences/multiple-0.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `&Baz: Happy` is not satisfied - --> $DIR/trait-suggest-deferences-multiple-0.rs:34:9 + --> $DIR/multiple-0.rs:34:9 | LL | fn foo(_: T) where T: Happy {} | ----- required by this bound in `foo` diff --git a/src/test/ui/traits/trait-suggest-deferences-multiple-1.rs b/src/test/ui/traits/suggest-deferences/multiple-1.rs similarity index 100% rename from src/test/ui/traits/trait-suggest-deferences-multiple-1.rs rename to src/test/ui/traits/suggest-deferences/multiple-1.rs diff --git a/src/test/ui/traits/trait-suggest-deferences-multiple-1.stderr b/src/test/ui/traits/suggest-deferences/multiple-1.stderr similarity index 87% rename from src/test/ui/traits/trait-suggest-deferences-multiple-1.stderr rename to src/test/ui/traits/suggest-deferences/multiple-1.stderr index e90278fa16f0e..f98cc54227f68 100644 --- a/src/test/ui/traits/trait-suggest-deferences-multiple-1.stderr +++ b/src/test/ui/traits/suggest-deferences/multiple-1.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `&mut Baz: Happy` is not satisfied - --> $DIR/trait-suggest-deferences-multiple-1.rs:52:9 + --> $DIR/multiple-1.rs:52:9 | LL | fn foo(_: T) where T: Happy {} | ----- required by this bound in `foo` diff --git a/src/test/ui/traits/trait-suggest-where-clause.rs b/src/test/ui/traits/suggest-where-clause.rs similarity index 100% rename from src/test/ui/traits/trait-suggest-where-clause.rs rename to src/test/ui/traits/suggest-where-clause.rs diff --git a/src/test/ui/traits/trait-suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr similarity index 89% rename from src/test/ui/traits/trait-suggest-where-clause.stderr rename to src/test/ui/traits/suggest-where-clause.stderr index 0f6f8d75c5e0a..b50017afa4d63 100644 --- a/src/test/ui/traits/trait-suggest-where-clause.stderr +++ b/src/test/ui/traits/suggest-where-clause.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `U` cannot be known at compilation time - --> $DIR/trait-suggest-where-clause.rs:7:20 + --> $DIR/suggest-where-clause.rs:7:20 | LL | fn check() { | - this type parameter needs to be `Sized` @@ -13,7 +13,7 @@ LL | pub const fn size_of() -> usize { | - required by this bound in `std::mem::size_of` error[E0277]: the size for values of type `U` cannot be known at compilation time - --> $DIR/trait-suggest-where-clause.rs:10:5 + --> $DIR/suggest-where-clause.rs:10:5 | LL | fn check() { | - this type parameter needs to be `Sized` @@ -29,7 +29,7 @@ LL | pub const fn size_of() -> usize { = note: required because it appears within the type `Misc` error[E0277]: the trait bound `u64: From` is not satisfied - --> $DIR/trait-suggest-where-clause.rs:15:5 + --> $DIR/suggest-where-clause.rs:15:5 | LL | >::from; | ^^^^^^^^^^^^^^^^^^^^^^ the trait `From` is not implemented for `u64` @@ -37,7 +37,7 @@ LL | >::from; = note: required by `from` error[E0277]: the trait bound `u64: From<::Item>` is not satisfied - --> $DIR/trait-suggest-where-clause.rs:18:5 + --> $DIR/suggest-where-clause.rs:18:5 | LL | ::Item>>::from; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<::Item>` is not implemented for `u64` @@ -45,7 +45,7 @@ LL | ::Item>>::from; = note: required by `from` error[E0277]: the trait bound `Misc<_>: From` is not satisfied - --> $DIR/trait-suggest-where-clause.rs:23:5 + --> $DIR/suggest-where-clause.rs:23:5 | LL | as From>::from; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `From` is not implemented for `Misc<_>` @@ -53,7 +53,7 @@ LL | as From>::from; = note: required by `from` error[E0277]: the size for values of type `[T]` cannot be known at compilation time - --> $DIR/trait-suggest-where-clause.rs:28:20 + --> $DIR/suggest-where-clause.rs:28:20 | LL | mem::size_of::<[T]>(); | ^^^ doesn't have a size known at compile-time @@ -66,7 +66,7 @@ LL | pub const fn size_of() -> usize { = help: the trait `Sized` is not implemented for `[T]` error[E0277]: the size for values of type `[&U]` cannot be known at compilation time - --> $DIR/trait-suggest-where-clause.rs:31:5 + --> $DIR/suggest-where-clause.rs:31:5 | LL | mem::size_of::<[&U]>(); | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/traits/supertrait-default-generics.rs b/src/test/ui/traits/superdefault-generics.rs similarity index 100% rename from src/test/ui/traits/supertrait-default-generics.rs rename to src/test/ui/traits/superdefault-generics.rs diff --git a/src/test/ui/traits/syntax-trait-polarity.rs b/src/test/ui/traits/syntax-polarity.rs similarity index 100% rename from src/test/ui/traits/syntax-trait-polarity.rs rename to src/test/ui/traits/syntax-polarity.rs diff --git a/src/test/ui/traits/trait-test-2.rs b/src/test/ui/traits/test-2.rs similarity index 100% rename from src/test/ui/traits/trait-test-2.rs rename to src/test/ui/traits/test-2.rs diff --git a/src/test/ui/traits/trait-test-2.stderr b/src/test/ui/traits/test-2.stderr similarity index 91% rename from src/test/ui/traits/trait-test-2.stderr rename to src/test/ui/traits/test-2.stderr index a38d3387c8d7b..12b55c3a4fdf9 100644 --- a/src/test/ui/traits/trait-test-2.stderr +++ b/src/test/ui/traits/test-2.stderr @@ -1,5 +1,5 @@ error[E0107]: this associated function takes 0 type arguments but 1 type argument was supplied - --> $DIR/trait-test-2.rs:9:8 + --> $DIR/test-2.rs:9:8 | LL | 10.dup::(); | ^^^------- help: remove these generics @@ -7,13 +7,13 @@ LL | 10.dup::(); | expected 0 type arguments | note: associated function defined here, with 0 type parameters - --> $DIR/trait-test-2.rs:4:16 + --> $DIR/test-2.rs:4:16 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | ^^^ error[E0107]: this associated function takes 1 type argument but 2 type arguments were supplied - --> $DIR/trait-test-2.rs:11:8 + --> $DIR/test-2.rs:11:8 | LL | 10.blah::(); | ^^^^ ----- help: remove this type argument @@ -21,13 +21,13 @@ LL | 10.blah::(); | expected 1 type argument | note: associated function defined here, with 1 type parameter: `X` - --> $DIR/trait-test-2.rs:4:39 + --> $DIR/test-2.rs:4:39 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | ^^^^ - error[E0038]: the trait `bar` cannot be made into an object - --> $DIR/trait-test-2.rs:13:16 + --> $DIR/test-2.rs:13:16 | LL | (box 10 as Box).dup(); | ^^^^^^^^^^^^ `bar` cannot be made into an object @@ -35,7 +35,7 @@ LL | (box 10 as Box).dup(); = help: consider moving `dup` to another trait = help: consider moving `blah` to another trait 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 - --> $DIR/trait-test-2.rs:4:30 + --> $DIR/test-2.rs:4:30 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | --- ^^^^ ^^^^ ...because method `blah` has generic type parameters @@ -44,7 +44,7 @@ LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | this trait cannot be made into an object... error[E0038]: the trait `bar` cannot be made into an object - --> $DIR/trait-test-2.rs:13:6 + --> $DIR/test-2.rs:13:6 | LL | (box 10 as Box).dup(); | ^^^^^^ `bar` cannot be made into an object @@ -52,7 +52,7 @@ LL | (box 10 as Box).dup(); = help: consider moving `dup` to another trait = help: consider moving `blah` to another trait 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 - --> $DIR/trait-test-2.rs:4:30 + --> $DIR/test-2.rs:4:30 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | --- ^^^^ ^^^^ ...because method `blah` has generic type parameters diff --git a/src/test/ui/traits/trait-test.rs b/src/test/ui/traits/test.rs similarity index 100% rename from src/test/ui/traits/trait-test.rs rename to src/test/ui/traits/test.rs diff --git a/src/test/ui/traits/trait-test.stderr b/src/test/ui/traits/test.stderr similarity index 89% rename from src/test/ui/traits/trait-test.stderr rename to src/test/ui/traits/test.stderr index f5e47e51526c6..668228abe0936 100644 --- a/src/test/ui/traits/trait-test.stderr +++ b/src/test/ui/traits/test.stderr @@ -1,5 +1,5 @@ error[E0404]: expected trait, found builtin type `isize` - --> $DIR/trait-test.rs:4:6 + --> $DIR/test.rs:4:6 | LL | impl isize for usize { fn foo(&self) {} } | ^^^^^ not a trait diff --git a/src/test/ui/traits/trait-to-str.rs b/src/test/ui/traits/to-str.rs similarity index 100% rename from src/test/ui/traits/trait-to-str.rs rename to src/test/ui/traits/to-str.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.rs b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.rs deleted file mode 100644 index 901a2c4391f6d..0000000000000 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.rs +++ /dev/null @@ -1,14 +0,0 @@ -// aux-build:trait_bounds_on_structs_and_enums_xc.rs - -extern crate trait_bounds_on_structs_and_enums_xc; - -use trait_bounds_on_structs_and_enums_xc::{Bar, Foo, Trait}; - -fn explode(x: Foo) {} -//~^ ERROR E0277 - -fn kaboom(y: Bar) {} -//~^ ERROR E0277 - -fn main() { -} diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.rs b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.rs deleted file mode 100644 index 2a4ba9677efb0..0000000000000 --- a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.rs +++ /dev/null @@ -1,15 +0,0 @@ -// aux-build:trait_bounds_on_structs_and_enums_xc.rs - -extern crate trait_bounds_on_structs_and_enums_xc; - -use trait_bounds_on_structs_and_enums_xc::{Bar, Foo, Trait}; - -fn main() { - let foo = Foo { - //~^ ERROR E0277 - x: 3 - }; - let bar: Bar = return; - //~^ ERROR E0277 - let _ = bar; -} diff --git a/src/test/ui/traits/ufcs-trait-object.rs b/src/test/ui/traits/ufcs-object.rs similarity index 100% rename from src/test/ui/traits/ufcs-trait-object.rs rename to src/test/ui/traits/ufcs-object.rs diff --git a/src/test/ui/traits/use-trait-before-def.rs b/src/test/ui/traits/use-before-def.rs similarity index 100% rename from src/test/ui/traits/use-trait-before-def.rs rename to src/test/ui/traits/use-before-def.rs diff --git a/src/test/ui/traits/wf-trait-object-maybe-bound.rs b/src/test/ui/traits/wf-object/maybe-bound.rs similarity index 100% rename from src/test/ui/traits/wf-trait-object-maybe-bound.rs rename to src/test/ui/traits/wf-object/maybe-bound.rs diff --git a/src/test/ui/traits/wf-trait-object-maybe-bound.stderr b/src/test/ui/traits/wf-object/maybe-bound.stderr similarity index 74% rename from src/test/ui/traits/wf-trait-object-maybe-bound.stderr rename to src/test/ui/traits/wf-object/maybe-bound.stderr index 4a570efcb5dbc..2fe3f0fc39f40 100644 --- a/src/test/ui/traits/wf-trait-object-maybe-bound.stderr +++ b/src/test/ui/traits/wf-object/maybe-bound.stderr @@ -1,29 +1,29 @@ error: `?Trait` is not permitted in trait object types - --> $DIR/wf-trait-object-maybe-bound.rs:5:15 + --> $DIR/maybe-bound.rs:5:15 | LL | type _0 = dyn ?Sized + Foo; | ^^^^^^ error: `?Trait` is not permitted in trait object types - --> $DIR/wf-trait-object-maybe-bound.rs:8:21 + --> $DIR/maybe-bound.rs:8:21 | LL | type _1 = dyn Foo + ?Sized; | ^^^^^^ error: `?Trait` is not permitted in trait object types - --> $DIR/wf-trait-object-maybe-bound.rs:11:21 + --> $DIR/maybe-bound.rs:11:21 | LL | type _2 = dyn Foo + ?Sized + ?Sized; | ^^^^^^ error: `?Trait` is not permitted in trait object types - --> $DIR/wf-trait-object-maybe-bound.rs:11:30 + --> $DIR/maybe-bound.rs:11:30 | LL | type _2 = dyn Foo + ?Sized + ?Sized; | ^^^^^^ error: `?Trait` is not permitted in trait object types - --> $DIR/wf-trait-object-maybe-bound.rs:15:15 + --> $DIR/maybe-bound.rs:15:15 | LL | type _3 = dyn ?Sized + Foo; | ^^^^^^ diff --git a/src/test/ui/traits/wf-trait-object-no-duplicates.rs b/src/test/ui/traits/wf-object/no-duplicates.rs similarity index 100% rename from src/test/ui/traits/wf-trait-object-no-duplicates.rs rename to src/test/ui/traits/wf-object/no-duplicates.rs diff --git a/src/test/ui/traits/wf-trait-object-no-duplicates.stderr b/src/test/ui/traits/wf-object/no-duplicates.stderr similarity index 92% rename from src/test/ui/traits/wf-trait-object-no-duplicates.stderr rename to src/test/ui/traits/wf-object/no-duplicates.stderr index ed5409d01596a..b9506894f82c9 100644 --- a/src/test/ui/traits/wf-trait-object-no-duplicates.stderr +++ b/src/test/ui/traits/wf-object/no-duplicates.stderr @@ -1,5 +1,5 @@ error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/wf-trait-object-no-duplicates.rs:8:21 + --> $DIR/no-duplicates.rs:8:21 | LL | type _0 = dyn Obj + Obj; | --- ^^^ additional non-auto trait @@ -10,7 +10,7 @@ LL | type _0 = dyn Obj + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/wf-trait-object-no-duplicates.rs:13:28 + --> $DIR/no-duplicates.rs:13:28 | LL | type _1 = dyn Send + Obj + Obj; | --- ^^^ additional non-auto trait @@ -21,7 +21,7 @@ LL | type _1 = dyn Send + Obj + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/wf-trait-object-no-duplicates.rs:16:28 + --> $DIR/no-duplicates.rs:16:28 | LL | type _2 = dyn Obj + Send + Obj; | --- ^^^ additional non-auto trait @@ -32,7 +32,7 @@ LL | type _2 = dyn Obj + Send + Obj; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/wf-trait-object-no-duplicates.rs:26:34 + --> $DIR/no-duplicates.rs:26:34 | LL | type _4 = dyn for<'a> ObjL<'a> + for<'b> ObjL<'b>; | ---------------- ^^^^^^^^^^^^^^^^ additional non-auto trait @@ -43,7 +43,7 @@ LL | type _4 = dyn for<'a> ObjL<'a> + for<'b> ObjL<'b>; = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit error[E0225]: only auto traits can be used as additional traits in a trait object - --> $DIR/wf-trait-object-no-duplicates.rs:30:42 + --> $DIR/no-duplicates.rs:30:42 | LL | type _5 = dyn ObjT fn(&'a u8)> + ObjT fn(&'b u8)>; | ------------------------ ^^^^^^^^^^^^^^^^^^^^^^^^ additional non-auto trait diff --git a/src/test/ui/traits/wf-trait-object-only-maybe-bound.rs b/src/test/ui/traits/wf-object/only-maybe-bound.rs similarity index 100% rename from src/test/ui/traits/wf-trait-object-only-maybe-bound.rs rename to src/test/ui/traits/wf-object/only-maybe-bound.rs diff --git a/src/test/ui/traits/wf-trait-object-only-maybe-bound.stderr b/src/test/ui/traits/wf-object/only-maybe-bound.stderr similarity index 76% rename from src/test/ui/traits/wf-trait-object-only-maybe-bound.stderr rename to src/test/ui/traits/wf-object/only-maybe-bound.stderr index 482410886329e..cbc41feec1e8c 100644 --- a/src/test/ui/traits/wf-trait-object-only-maybe-bound.stderr +++ b/src/test/ui/traits/wf-object/only-maybe-bound.stderr @@ -1,11 +1,11 @@ error: `?Trait` is not permitted in trait object types - --> $DIR/wf-trait-object-only-maybe-bound.rs:3:15 + --> $DIR/only-maybe-bound.rs:3:15 | LL | type _0 = dyn ?Sized; | ^^^^^^ error[E0224]: at least one trait is required for an object type - --> $DIR/wf-trait-object-only-maybe-bound.rs:3:11 + --> $DIR/only-maybe-bound.rs:3:11 | LL | type _0 = dyn ?Sized; | ^^^^^^^^^^ diff --git a/src/test/ui/traits/wf-trait-object-reverse-order.rs b/src/test/ui/traits/wf-object/reverse-order.rs similarity index 100% rename from src/test/ui/traits/wf-trait-object-reverse-order.rs rename to src/test/ui/traits/wf-object/reverse-order.rs diff --git a/src/test/ui/traits/trait-where-clause-vs-impl.rs b/src/test/ui/traits/where-clause-vs-impl.rs similarity index 100% rename from src/test/ui/traits/trait-where-clause-vs-impl.rs rename to src/test/ui/traits/where-clause-vs-impl.rs diff --git a/src/test/ui/traits/trait-with-bounds-default.rs b/src/test/ui/traits/with-bounds-default.rs similarity index 100% rename from src/test/ui/traits/trait-with-bounds-default.rs rename to src/test/ui/traits/with-bounds-default.rs diff --git a/src/test/ui/traits/trait-with-dst.rs b/src/test/ui/traits/with-dst.rs similarity index 100% rename from src/test/ui/traits/trait-with-dst.rs rename to src/test/ui/traits/with-dst.rs From 788e4bb4e5e1454904cdf0f80a81d02f88d7612d Mon Sep 17 00:00:00 2001 From: 0yoyoyo <60439919+0yoyoyo@users.noreply.github.com> Date: Fri, 12 Feb 2021 00:40:54 +0900 Subject: [PATCH 03/10] Fix suggestion to introduce explicit lifetime --- .../src/infer/error_reporting/mod.rs | 7 ++++- .../missing-lifetimes-in-signature-2.rs | 26 +++++++++++++++++++ .../missing-lifetimes-in-signature-2.stderr | 21 +++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs create mode 100644 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr diff --git a/compiler/rustc_infer/src/infer/error_reporting/mod.rs b/compiler/rustc_infer/src/infer/error_reporting/mod.rs index 84aa19aedebf8..63f8a7293d899 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/mod.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/mod.rs @@ -2248,13 +2248,18 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { "...", ); if let Some(infer::RelateParamBound(_, t)) = origin { + let return_impl_trait = self + .in_progress_typeck_results + .map(|typeck_results| typeck_results.borrow().hir_owner) + .and_then(|owner| self.tcx.return_type_impl_trait(owner)) + .is_some(); let t = self.resolve_vars_if_possible(t); match t.kind() { // We've got: // fn get_later(g: G, dest: &mut T) -> impl FnOnce() + '_ // suggest: // fn get_later<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a - ty::Closure(_, _substs) | ty::Opaque(_, _substs) => { + ty::Closure(_, _substs) | ty::Opaque(_, _substs) if return_impl_trait => { new_binding_suggestion(&mut err, type_param_span, bound_kind); } _ => { diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs new file mode 100644 index 0000000000000..c6802ac6cc704 --- /dev/null +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.rs @@ -0,0 +1,26 @@ +// Regression test for #81650 + +struct Foo<'a> { + x: &'a mut &'a i32, +} + +impl<'a> Foo<'a> { + fn bar(&self, f: F) + where + F: FnOnce(&Foo<'a>) -> T, + F: 'a, + {} +} + +trait Test { + fn test(&self); +} + +fn func(foo: &Foo, t: T) { + foo.bar(move |_| { + //~^ ERROR the parameter type `T` may not live long enough + t.test(); + }); +} + +fn main() {} 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 new file mode 100644 index 0000000000000..c7def9b668d9c --- /dev/null +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.stderr @@ -0,0 +1,21 @@ +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/missing-lifetimes-in-signature-2.rs:20:9 + | +LL | fn func(foo: &Foo, t: T) { + | -- help: consider adding an explicit lifetime bound...: `T: 'a +` +LL | foo.bar(move |_| { + | ^^^ + | +note: the parameter type `T` must be valid for the anonymous lifetime #2 defined on the function body at 19:1... + --> $DIR/missing-lifetimes-in-signature-2.rs:19:1 + | +LL | fn func(foo: &Foo, t: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...so that the type `[closure@$DIR/missing-lifetimes-in-signature-2.rs:20:13: 23:6]` will meet its required lifetime bounds + --> $DIR/missing-lifetimes-in-signature-2.rs:20:9 + | +LL | foo.bar(move |_| { + | ^^^ + +error: aborting due to previous error + From fcce998d564678d7736f8382861f0fbb5e549dd2 Mon Sep 17 00:00:00 2001 From: 0yoyoyo <60439919+0yoyoyo@users.noreply.github.com> Date: Fri, 12 Feb 2021 21:51:00 +0900 Subject: [PATCH 04/10] Add nll test --- .../missing-lifetimes-in-signature-2.nll.stderr | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr diff --git a/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr new file mode 100644 index 0000000000000..b359826cb4ae4 --- /dev/null +++ b/src/test/ui/suggestions/lifetimes/missing-lifetimes-in-signature-2.nll.stderr @@ -0,0 +1,17 @@ +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/missing-lifetimes-in-signature-2.rs:20:5 + | +LL | / foo.bar(move |_| { +LL | | +LL | | t.test(); +LL | | }); + | |______^ + | +note: the parameter type `T` must be valid for the anonymous lifetime #2 defined on the function body at 19:1... + --> $DIR/missing-lifetimes-in-signature-2.rs:19:1 + | +LL | fn func(foo: &Foo, t: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + From 28347ebdb3946b4298629bbaca72318ef890e04b Mon Sep 17 00:00:00 2001 From: LingMan Date: Fri, 12 Feb 2021 14:08:14 +0100 Subject: [PATCH 05/10] Drop an unnecessary intermediate variable Neither does it shorten the code nor does it provide a helpful name. --- compiler/rustc_typeck/src/check/upvar.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/rustc_typeck/src/check/upvar.rs b/compiler/rustc_typeck/src/check/upvar.rs index 04a9e65e6647d..411f3bbbf630f 100644 --- a/compiler/rustc_typeck/src/check/upvar.rs +++ b/compiler/rustc_typeck/src/check/upvar.rs @@ -260,8 +260,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // local crate or were inlined into it along with some function. // This may change if abstract return types of some sort are // implemented. - let tcx = self.tcx; - self.typeck_results .borrow() .closure_min_captures_flattened(closure_id) @@ -276,7 +274,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { match capture { ty::UpvarCapture::ByValue(_) => upvar_ty, - ty::UpvarCapture::ByRef(borrow) => tcx.mk_ref( + ty::UpvarCapture::ByRef(borrow) => self.tcx.mk_ref( borrow.region, ty::TypeAndMut { ty: upvar_ty, mutbl: borrow.kind.to_mutbl_lossy() }, ), From 715c19e75e0e2a88f6c0a5ec8c13ee77737c4798 Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Sat, 13 Feb 2021 01:13:50 +0900 Subject: [PATCH 06/10] Refactor `get_word_attr` to return only `Option` --- src/librustdoc/clean/mod.rs | 3 ++- src/librustdoc/clean/types.rs | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 331bb2a73f962..9a4a9e19e2247 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2163,7 +2163,8 @@ fn clean_use_statement( return Vec::new(); } - let (doc_meta_item, please_inline) = import.attrs.lists(sym::doc).get_word_attr(sym::inline); + let doc_meta_item = import.attrs.lists(sym::doc).get_word_attr(sym::inline); + let please_inline = doc_meta_item.is_some(); let pub_underscore = import.vis.node.is_pub() && name == kw::Underscore; if pub_underscore && please_inline { diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 754f1c2eeeb21..a691819ab7740 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -438,7 +438,7 @@ impl AttributesExt for [ast::Attribute] { crate trait NestedAttributesExt { /// Returns `true` if the attribute list contains a specific `Word` fn has_word(self, word: Symbol) -> bool; - fn get_word_attr(self, word: Symbol) -> (Option, bool); + fn get_word_attr(self, word: Symbol) -> Option; } impl + IntoIterator> @@ -448,11 +448,8 @@ impl + IntoIterator (Option, bool) { - match self.find(|attr| attr.is_word() && attr.has_name(word)) { - Some(a) => (Some(a), true), - None => (None, false), - } + fn get_word_attr(mut self, word: Symbol) -> Option { + self.find(|attr| attr.is_word() && attr.has_name(word)) } } From 681cccad571c99673be4e2ad14bc2048e8894ac8 Mon Sep 17 00:00:00 2001 From: Yusuke Tanaka Date: Sat, 13 Feb 2021 01:48:00 +0900 Subject: [PATCH 07/10] Rename to `inline_attr` and use if-let to extract `NestedMetaItem` --- src/librustdoc/clean/mod.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 9a4a9e19e2247..7fc7d9f541cbb 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2163,19 +2163,20 @@ fn clean_use_statement( return Vec::new(); } - let doc_meta_item = import.attrs.lists(sym::doc).get_word_attr(sym::inline); - let please_inline = doc_meta_item.is_some(); + let inline_attr = import.attrs.lists(sym::doc).get_word_attr(sym::inline); let pub_underscore = import.vis.node.is_pub() && name == kw::Underscore; - if pub_underscore && please_inline { - rustc_errors::struct_span_err!( - cx.tcx.sess, - doc_meta_item.unwrap().span(), - E0780, - "anonymous imports cannot be inlined" - ) - .span_label(import.span, "anonymous import") - .emit(); + if pub_underscore { + if let Some(ref inline) = inline_attr { + rustc_errors::struct_span_err!( + cx.tcx.sess, + inline.span(), + E0780, + "anonymous imports cannot be inlined" + ) + .span_label(import.span, "anonymous import") + .emit(); + } } // We consider inlining the documentation of `pub use` statements, but we @@ -2208,7 +2209,7 @@ fn clean_use_statement( } Import::new_glob(resolve_use_source(cx, path), true) } else { - if !please_inline { + if inline_attr.is_none() { if let Res::Def(DefKind::Mod, did) = path.res { if !did.is_local() && did.index == CRATE_DEF_INDEX { // if we're `pub use`ing an extern crate root, don't inline it unless we From 95c984a4a359f68c19c6eb08697b898b40806de5 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 12 Feb 2021 20:27:57 +0100 Subject: [PATCH 08/10] Add test to prevent src link regression --- src/test/rustdoc/ensure-src-link.rs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/test/rustdoc/ensure-src-link.rs diff --git a/src/test/rustdoc/ensure-src-link.rs b/src/test/rustdoc/ensure-src-link.rs new file mode 100644 index 0000000000000..b7e7b11d27a83 --- /dev/null +++ b/src/test/rustdoc/ensure-src-link.rs @@ -0,0 +1,6 @@ +#![crate_name = "foo"] + +// This test ensures that the [src] link is present on traits items. + +// @has foo/trait.Iterator.html '//h3[@id="method.zip"]/a[@class="srclink"]' "[src]" +pub use std::iter::Iterator; From 7fafa4d0cae0d74dcb42016e51945866a1bd9f6f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 12 Feb 2021 13:24:35 -0700 Subject: [PATCH 09/10] Add docs for shared_from_slice From impls The advantage of making these docs is mostly in pointing out that these functions all make new allocations and copy/clone/move the source into them. These docs are on the function, and not the `impl` block, to avoid showing the "[+] show undocumented items" button. CC #51430 --- library/alloc/src/rc.rs | 49 +++++++++++++++++++++++++++++++++++++++ library/alloc/src/sync.rs | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs index f67f5fc533b49..dac4acc4692a2 100644 --- a/library/alloc/src/rc.rs +++ b/library/alloc/src/rc.rs @@ -1652,6 +1652,16 @@ impl From for Rc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From<&[T]> for Rc<[T]> { + /// Allocate a reference-counted slice and fill it by cloning `v`'s items. + /// + /// # Example + /// + /// ``` + /// # use std::rc::Rc; + /// let original: &[i32] = &[1, 2, 3]; + /// let shared: Rc<[i32]> = Rc::from(original); + /// assert_eq!(&[1, 2, 3], &shared[..]); + /// ``` #[inline] fn from(v: &[T]) -> Rc<[T]> { >::from_slice(v) @@ -1660,6 +1670,15 @@ impl From<&[T]> for Rc<[T]> { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From<&str> for Rc { + /// Allocate a reference-counted string slice and copy `v` into it. + /// + /// # Example + /// + /// ``` + /// # use std::rc::Rc; + /// let shared: Rc = Rc::from("statue"); + /// assert_eq!("statue", &shared[..]); + /// ``` #[inline] fn from(v: &str) -> Rc { let rc = Rc::<[u8]>::from(v.as_bytes()); @@ -1669,6 +1688,16 @@ impl From<&str> for Rc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From for Rc { + /// Allocate a reference-counted string slice and copy `v` into it. + /// + /// # Example + /// + /// ``` + /// # use std::rc::Rc; + /// let original: String = "statue".to_owned(); + /// let shared: Rc = Rc::from(original); + /// assert_eq!("statue", &shared[..]); + /// ``` #[inline] fn from(v: String) -> Rc { Rc::from(&v[..]) @@ -1677,6 +1706,16 @@ impl From for Rc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From> for Rc { + /// Move a boxed object to a new, reference counted, allocation. + /// + /// # Example + /// + /// ``` + /// # use std::rc::Rc; + /// let original: Box = Box::new(1); + /// let shared: Rc = Rc::from(original); + /// assert_eq!(1, *shared); + /// ``` #[inline] fn from(v: Box) -> Rc { Rc::from_box(v) @@ -1685,6 +1724,16 @@ impl From> for Rc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From> for Rc<[T]> { + /// Allocate a reference-counted slice and move `v`'s items into it. + /// + /// # Example + /// + /// ``` + /// # use std::rc::Rc; + /// let original: Box> = Box::new(vec![1, 2, 3]); + /// let shared: Rc> = Rc::from(original); + /// assert_eq!(vec![1, 2, 3], *shared); + /// ``` #[inline] fn from(mut v: Vec) -> Rc<[T]> { unsafe { diff --git a/library/alloc/src/sync.rs b/library/alloc/src/sync.rs index 461ca85c0305d..aeae888dddc03 100644 --- a/library/alloc/src/sync.rs +++ b/library/alloc/src/sync.rs @@ -2285,6 +2285,16 @@ impl From for Arc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From<&[T]> for Arc<[T]> { + /// Allocate a reference-counted slice and fill it by cloning `v`'s items. + /// + /// # Example + /// + /// ``` + /// # use std::sync::Arc; + /// let original: &[i32] = &[1, 2, 3]; + /// let shared: Arc<[i32]> = Arc::from(original); + /// assert_eq!(&[1, 2, 3], &shared[..]); + /// ``` #[inline] fn from(v: &[T]) -> Arc<[T]> { >::from_slice(v) @@ -2293,6 +2303,15 @@ impl From<&[T]> for Arc<[T]> { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From<&str> for Arc { + /// Allocate a reference-counted `str` and copy `v` into it. + /// + /// # Example + /// + /// ``` + /// # use std::sync::Arc; + /// let shared: Arc = Arc::from("eggplant"); + /// assert_eq!("eggplant", &shared[..]); + /// ``` #[inline] fn from(v: &str) -> Arc { let arc = Arc::<[u8]>::from(v.as_bytes()); @@ -2302,6 +2321,16 @@ impl From<&str> for Arc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From for Arc { + /// Allocate a reference-counted `str` and copy `v` into it. + /// + /// # Example + /// + /// ``` + /// # use std::sync::Arc; + /// let unique: String = "eggplant".to_owned(); + /// let shared: Arc = Arc::from(unique); + /// assert_eq!("eggplant", &shared[..]); + /// ``` #[inline] fn from(v: String) -> Arc { Arc::from(&v[..]) @@ -2310,6 +2339,16 @@ impl From for Arc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From> for Arc { + /// Move a boxed object to a new, reference-counted allocation. + /// + /// # Example + /// + /// ``` + /// # use std::sync::Arc; + /// let unique: Box = Box::from("eggplant"); + /// let shared: Arc = Arc::from(unique); + /// assert_eq!("eggplant", &shared[..]); + /// ``` #[inline] fn from(v: Box) -> Arc { Arc::from_box(v) @@ -2318,6 +2357,16 @@ impl From> for Arc { #[stable(feature = "shared_from_slice", since = "1.21.0")] impl From> for Arc<[T]> { + /// Allocate a reference-counted slice and move `v`'s items into it. + /// + /// # Example + /// + /// ``` + /// # use std::sync::Arc; + /// let unique: Vec = vec![1, 2, 3]; + /// let shared: Arc<[i32]> = Arc::from(unique); + /// assert_eq!(&[1, 2, 3], &shared[..]); + /// ``` #[inline] fn from(mut v: Vec) -> Arc<[T]> { unsafe { From fa9af6a9be72e80c7c86adf656bee5964cb2f6a2 Mon Sep 17 00:00:00 2001 From: Hanif Bin Ariffin Date: Sat, 13 Feb 2021 11:18:36 +0800 Subject: [PATCH 10/10] Added tests to drain an empty vec Discovered this kind of issue in an unrelated library. The author copied the tests from here and AFAIK, there are no tests for this particular case. Signed-off-by: Hanif Bin Ariffin --- library/alloc/tests/vec.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/alloc/tests/vec.rs b/library/alloc/tests/vec.rs index e3d74791dcf46..2969da58d4268 100644 --- a/library/alloc/tests/vec.rs +++ b/library/alloc/tests/vec.rs @@ -609,6 +609,17 @@ fn test_move_items_zero_sized() { assert_eq!(vec2, [(), (), ()]); } +#[test] +fn test_drain_empty_vec() { + let mut vec: Vec = vec![]; + let mut vec2: Vec = vec![]; + for i in vec.drain(..) { + vec2.push(i); + } + assert!(vec.is_empty()); + assert!(vec2.is_empty()); +} + #[test] fn test_drain_items() { let mut vec = vec![1, 2, 3];