From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../coherence/auxiliary/coherence_copy_like_lib.rs | 10 --- .../auxiliary/coherence_fundamental_trait_lib.rs | 7 -- .../auxiliary/coherence_inherent_cc_lib.rs | 11 ---- src/test/ui/coherence/auxiliary/coherence_lib.rs | 15 ----- .../ui/coherence/auxiliary/coherence_orphan_lib.rs | 3 - src/test/ui/coherence/auxiliary/error_lib.rs | 6 -- src/test/ui/coherence/auxiliary/go_trait.rs | 43 ------------ src/test/ui/coherence/auxiliary/option_future.rs | 8 --- .../auxiliary/re_rebalance_coherence_lib-rpass.rs | 31 --------- .../auxiliary/re_rebalance_coherence_lib.rs | 22 ------- .../coherence/auxiliary/trait-with-const-param.rs | 1 - .../ui/coherence/auxiliary/trait_impl_conflict.rs | 6 -- src/test/ui/coherence/coherence-all-remote.rs | 9 --- src/test/ui/coherence/coherence-all-remote.stderr | 12 ---- src/test/ui/coherence/coherence-bigint-int.rs | 13 ---- src/test/ui/coherence/coherence-bigint-param.rs | 11 ---- .../ui/coherence/coherence-bigint-param.stderr | 12 ---- src/test/ui/coherence/coherence-bigint-vecint.rs | 13 ---- ...e-blanket-conflicts-with-blanket-implemented.rs | 30 --------- ...anket-conflicts-with-blanket-implemented.stderr | 12 ---- ...blanket-conflicts-with-blanket-unimplemented.rs | 25 ------- ...ket-conflicts-with-blanket-unimplemented.stderr | 12 ---- ...-blanket-conflicts-with-specific-cross-crate.rs | 20 ------ ...nket-conflicts-with-specific-cross-crate.stderr | 13 ---- ...lanket-conflicts-with-specific-multidispatch.rs | 27 -------- ...et-conflicts-with-specific-multidispatch.stderr | 12 ---- ...erence-blanket-conflicts-with-specific-trait.rs | 29 --------- ...ce-blanket-conflicts-with-specific-trait.stderr | 12 ---- .../coherence-blanket-conflicts-with-specific.rs | 24 ------- ...oherence-blanket-conflicts-with-specific.stderr | 12 ---- src/test/ui/coherence/coherence-blanket.rs | 16 ----- .../coherence-conflicting-negative-trait-impl.rs | 17 ----- ...oherence-conflicting-negative-trait-impl.stderr | 22 ------- .../coherence/coherence-covered-type-parameter.rs | 14 ---- src/test/ui/coherence/coherence-cow.re_a.stderr | 14 ---- src/test/ui/coherence/coherence-cow.re_b.stderr | 14 ---- src/test/ui/coherence/coherence-cow.re_c.stderr | 14 ---- src/test/ui/coherence/coherence-cow.rs | 29 --------- .../ui/coherence/coherence-cross-crate-conflict.rs | 13 ---- .../coherence-cross-crate-conflict.stderr | 12 ---- .../ui/coherence/coherence-default-trait-impl.rs | 16 ----- .../coherence/coherence-default-trait-impl.stderr | 28 -------- .../ui/coherence/coherence-error-suppression.rs | 16 ----- .../coherence/coherence-error-suppression.stderr | 9 --- .../coherence-fn-covariant-bound-vs-static.rs | 26 -------- .../coherence-fn-covariant-bound-vs-static.stderr | 13 ---- .../ui/coherence/coherence-fn-implied-bounds.rs | 26 -------- .../coherence/coherence-fn-implied-bounds.stderr | 20 ------ src/test/ui/coherence/coherence-fn-inputs.rs | 25 ------- src/test/ui/coherence/coherence-fn-inputs.stderr | 13 ---- .../ui/coherence/coherence-free-vs-bound-region.rs | 21 ------ .../coherence-free-vs-bound-region.stderr | 20 ------ .../coherence-fundamental-trait-objects.rs | 15 ----- .../coherence-fundamental-trait-objects.stderr | 14 ---- src/test/ui/coherence/coherence-impl-in-fn.rs | 14 ---- ...herence-impl-trait-for-marker-trait-negative.rs | 30 --------- ...nce-impl-trait-for-marker-trait-negative.stderr | 39 ----------- ...herence-impl-trait-for-marker-trait-positive.rs | 30 --------- ...nce-impl-trait-for-marker-trait-positive.stderr | 39 ----------- .../coherence-impl-trait-for-trait-object-safe.rs | 10 --- ...herence-impl-trait-for-trait-object-safe.stderr | 18 ----- .../ui/coherence/coherence-impl-trait-for-trait.rs | 20 ------ .../coherence-impl-trait-for-trait.stderr | 21 ------ src/test/ui/coherence/coherence-impls-copy.rs | 36 ---------- src/test/ui/coherence/coherence-impls-copy.stderr | 76 ---------------------- src/test/ui/coherence/coherence-impls-send.rs | 28 -------- src/test/ui/coherence/coherence-impls-send.stderr | 43 ------------ src/test/ui/coherence/coherence-impls-sized.rs | 36 ---------- src/test/ui/coherence/coherence-impls-sized.stderr | 73 --------------------- .../coherence-inherited-assoc-ty-cycle-err.rs | 24 ------- .../coherence-inherited-assoc-ty-cycle-err.stderr | 26 -------- .../coherence-inherited-subtyping.old.stderr | 14 ---- .../coherence-inherited-subtyping.re.stderr | 14 ---- .../ui/coherence/coherence-inherited-subtyping.rs | 21 ------ .../coherence/coherence-iterator-vec-any-elem.rs | 14 ---- src/test/ui/coherence/coherence-iterator-vec.rs | 14 ---- .../ui/coherence/coherence-lone-type-parameter.rs | 10 --- .../coherence/coherence-lone-type-parameter.stderr | 12 ---- .../ui/coherence/coherence-multidispatch-tuple.rs | 24 ------- .../coherence/coherence-negative-impls-copy-bad.rs | 11 ---- .../coherence-negative-impls-copy-bad.stderr | 36 ---------- .../ui/coherence/coherence-negative-impls-copy.rs | 29 --------- .../coherence-negative-impls-safe-rpass.rs | 13 ---- .../ui/coherence/coherence-negative-impls-safe.rs | 10 --- .../coherence/coherence-negative-impls-safe.stderr | 12 ---- .../coherence-negative-inherent-where-bounds.rs | 25 ------- .../ui/coherence/coherence-negative-inherent.rs | 22 ------- .../coherence-negative-outlives-lifetimes.rs | 17 ----- ...erence-negative-outlives-lifetimes.stock.stderr | 11 ---- .../coherence-no-direct-lifetime-dispatch.rs | 9 --- .../coherence-no-direct-lifetime-dispatch.stderr | 11 ---- src/test/ui/coherence/coherence-orphan.rs | 20 ------ src/test/ui/coherence/coherence-orphan.stderr | 26 -------- .../coherence/coherence-overlap-all-t-and-tuple.rs | 20 ------ .../coherence-overlap-all-t-and-tuple.stderr | 12 ---- .../coherence/coherence-overlap-double-negative.rs | 12 ---- .../coherence-overlap-downstream-inherent.rs | 17 ----- .../coherence-overlap-downstream-inherent.stderr | 23 ------- .../ui/coherence/coherence-overlap-downstream.rs | 17 ----- .../coherence/coherence-overlap-downstream.stderr | 21 ------ .../coherence-overlap-issue-23516-inherent.rs | 13 ---- .../coherence-overlap-issue-23516-inherent.stderr | 14 ---- .../ui/coherence/coherence-overlap-issue-23516.rs | 11 ---- .../coherence/coherence-overlap-issue-23516.stderr | 13 ---- .../ui/coherence/coherence-overlap-messages.rs | 28 -------- .../ui/coherence/coherence-overlap-messages.stderr | 44 ------------- .../coherence-overlap-negate-alias-strict.rs | 19 ------ ...oherence-overlap-negate-not-use-feature-gate.rs | 8 --- ...ence-overlap-negate-not-use-feature-gate.stderr | 11 ---- .../coherence/coherence-overlap-negate-strict.rs | 18 ----- .../coherence-overlap-negate-use-feature-gate.rs | 11 ---- .../coherence/coherence-overlap-negative-trait.rs | 16 ----- .../coherence/coherence-overlap-negative-trait2.rs | 17 ----- .../coherence/coherence-overlap-super-negative.rs | 18 ----- .../ui/coherence/coherence-overlap-trait-alias.rs | 20 ------ .../coherence/coherence-overlap-trait-alias.stderr | 17 ----- .../coherence-overlap-upstream-inherent.rs | 16 ----- .../coherence-overlap-upstream-inherent.stderr | 14 ---- .../ui/coherence/coherence-overlap-upstream.rs | 16 ----- .../ui/coherence/coherence-overlap-upstream.stderr | 13 ---- .../ui/coherence/coherence-overlap-with-regions.rs | 16 ----- .../ui/coherence/coherence-overlapping-pairs.rs | 11 ---- .../coherence/coherence-overlapping-pairs.stderr | 14 ---- .../coherence-pair-covered-uncovered-1.rs | 15 ----- .../coherence-pair-covered-uncovered-1.stderr | 15 ----- .../coherence/coherence-pair-covered-uncovered.rs | 11 ---- .../coherence-pair-covered-uncovered.stderr | 14 ---- .../coherence-projection-conflict-orphan.rs | 19 ------ .../coherence-projection-conflict-orphan.stderr | 14 ---- .../coherence-projection-conflict-ty-param.rs | 13 ---- .../coherence-projection-conflict-ty-param.stderr | 12 ---- .../ui/coherence/coherence-projection-conflict.rs | 18 ----- .../coherence/coherence-projection-conflict.stderr | 12 ---- .../ui/coherence/coherence-projection-ok-orphan.rs | 17 ----- src/test/ui/coherence/coherence-projection-ok.rs | 17 ----- .../ui/coherence/coherence-rfc447-constrained.rs | 22 ------- src/test/ui/coherence/coherence-subtyping.rs | 20 ------ src/test/ui/coherence/coherence-subtyping.stderr | 16 ----- src/test/ui/coherence/coherence-tuple-conflict.rs | 20 ------ .../ui/coherence/coherence-tuple-conflict.stderr | 12 ---- .../coherence-unsafe-trait-object-impl.rs | 18 ----- .../coherence-unsafe-trait-object-impl.stderr | 17 ----- src/test/ui/coherence/coherence-vec-local-2.rs | 14 ---- src/test/ui/coherence/coherence-vec-local-2.stderr | 14 ---- src/test/ui/coherence/coherence-vec-local.rs | 14 ---- src/test/ui/coherence/coherence-vec-local.stderr | 14 ---- src/test/ui/coherence/coherence-wasm-bindgen.rs | 37 ----------- .../ui/coherence/coherence-wasm-bindgen.stderr | 21 ------ src/test/ui/coherence/coherence-where-clause.rs | 38 ----------- src/test/ui/coherence/coherence-with-closure.rs | 14 ---- .../ui/coherence/coherence-with-closure.stderr | 11 ---- src/test/ui/coherence/coherence-with-generator.rs | 18 ----- .../ui/coherence/coherence-with-generator.stderr | 11 ---- src/test/ui/coherence/coherence_copy_like.rs | 19 ------ .../coherence_copy_like_err_fundamental_struct.rs | 24 ------- ...herence_copy_like_err_fundamental_struct_ref.rs | 21 ------ ...rence_copy_like_err_fundamental_struct_tuple.rs | 20 ------ ...e_copy_like_err_fundamental_struct_tuple.stderr | 14 ---- .../ui/coherence/coherence_copy_like_err_struct.rs | 22 ------- .../coherence_copy_like_err_struct.stderr | 14 ---- .../ui/coherence/coherence_copy_like_err_tuple.rs | 21 ------ .../coherence/coherence_copy_like_err_tuple.stderr | 14 ---- src/test/ui/coherence/coherence_inherent.rs | 36 ---------- src/test/ui/coherence/coherence_inherent.stderr | 15 ----- src/test/ui/coherence/coherence_inherent_cc.rs | 28 -------- src/test/ui/coherence/coherence_inherent_cc.stderr | 15 ----- src/test/ui/coherence/coherence_local.rs | 20 ------ .../ui/coherence/coherence_local_err_struct.rs | 18 ----- .../ui/coherence/coherence_local_err_struct.stderr | 14 ---- src/test/ui/coherence/coherence_local_err_tuple.rs | 18 ----- .../ui/coherence/coherence_local_err_tuple.stderr | 14 ---- src/test/ui/coherence/coherence_local_ref.rs | 14 ---- src/test/ui/coherence/conflicting-impl-with-err.rs | 16 ----- .../ui/coherence/conflicting-impl-with-err.stderr | 15 ----- .../ui/coherence/const-generics-orphan-check-ok.rs | 28 -------- src/test/ui/coherence/deep-bad-copy-reason.rs | 40 ------------ src/test/ui/coherence/deep-bad-copy-reason.stderr | 18 ----- src/test/ui/coherence/impl-foreign-for-foreign.rs | 15 ----- .../ui/coherence/impl-foreign-for-foreign.stderr | 14 ---- .../coherence/impl-foreign-for-foreign[foreign].rs | 23 ------- .../impl-foreign-for-foreign[foreign].stderr | 39 ----------- .../coherence/impl-foreign-for-foreign[local].rs | 14 ---- .../impl-foreign-for-fundamental[foreign].rs | 19 ------ .../impl-foreign-for-fundamental[foreign].stderr | 27 -------- .../impl-foreign-for-fundamental[local].rs | 15 ----- src/test/ui/coherence/impl-foreign-for-local.rs | 13 ---- ...impl-foreign-for-locally-defined-fundamental.rs | 15 ----- ...ign-for-locally-defined-fundamental[foreign].rs | 15 ----- .../coherence/impl-foreign[foreign]-for-foreign.rs | 15 ----- .../impl-foreign[foreign]-for-foreign.stderr | 15 ----- .../coherence/impl-foreign[foreign]-for-local.rs | 14 ---- ...pl-foreign[fundemental[foreign]]-for-foreign.rs | 24 ------- ...oreign[fundemental[foreign]]-for-foreign.stderr | 42 ------------ ...impl-foreign[fundemental[local]]-for-foreign.rs | 16 ----- .../ui/coherence/impl[t]-foreign-for-foreign[t].rs | 21 ------ .../impl[t]-foreign-for-foreign[t].stderr | 25 ------- .../impl[t]-foreign-for-fundamental[t].rs | 15 ----- .../impl[t]-foreign-for-fundamental[t].stderr | 12 ---- ...mpl[t]-foreign[foreign[t]_local]-for-foreign.rs | 12 ---- .../impl[t]-foreign[foreign]-for-fundamental[t].rs | 18 ----- ...l[t]-foreign[foreign]-for-fundamental[t].stderr | 21 ------ .../ui/coherence/impl[t]-foreign[foreign]-for-t.rs | 14 ---- .../impl[t]-foreign[foreign]-for-t.stderr | 12 ---- .../impl[t]-foreign[fundamental[t]]-for-foreign.rs | 18 ----- ...l[t]-foreign[fundamental[t]]-for-foreign.stderr | 21 ------ ...]-foreign[fundamental[t]]-for-fundamental[t].rs | 17 ----- ...reign[fundamental[t]]-for-fundamental[t].stderr | 21 ------ .../impl[t]-foreign[fundamental[t]]-for-local.rs | 15 ----- .../impl[t]-foreign[fundamental[t]]-for-t.rs | 17 ----- .../impl[t]-foreign[fundamental[t]]-for-t.stderr | 21 ------ ...t]-foreign[fundamental[t]_local]-for-foreign.rs | 18 ----- ...oreign[fundamental[t]_local]-for-foreign.stderr | 21 ------ ...]-foreign[fundemental[local]]-for-foreign[t].rs | 15 ----- .../impl[t]-foreign[local]-for-foreign.rs | 14 ---- .../impl[t]-foreign[local]-for-foreign[t].rs | 15 ----- ...]-foreign[local]-for-fundamental[foreign[t]].rs | 17 ----- .../impl[t]-foreign[local]-for-fundamental[t].rs | 18 ----- ...mpl[t]-foreign[local]-for-fundamental[t].stderr | 21 ------ .../coherence/impl[t]-foreign[local]-for-local.rs | 13 ---- .../ui/coherence/impl[t]-foreign[local]-for-t.rs | 14 ---- .../coherence/impl[t]-foreign[local]-for-t.stderr | 12 ---- ...t]-foreign[local_fundamental[t]]-for-foreign.rs | 17 ----- .../ui/coherence/impl[t]-foreign[t]-for-foreign.rs | 14 ---- .../impl[t]-foreign[t]-for-foreign.stderr | 12 ---- .../impl[t]-foreign[t]-for-fundamental.rs | 18 ----- .../impl[t]-foreign[t]-for-fundamental.stderr | 21 ------ .../ui/coherence/impl[t]-foreign[t]-for-local.rs | 13 ---- src/test/ui/coherence/impl[t]-foreign[t]-for-t.rs | 14 ---- .../ui/coherence/impl[t]-foreign[t]-for-t.stderr | 12 ---- .../inter-crate-ambiguity-causes-notes.rs | 19 ------ .../inter-crate-ambiguity-causes-notes.stderr | 14 ---- src/test/ui/coherence/issue-85026.rs | 10 --- src/test/ui/coherence/issue-85026.stderr | 19 ------ src/test/ui/coherence/issue-99663-2.rs | 22 ------- src/test/ui/coherence/issue-99663.rs | 22 ------- ...ce-coherence-default-generic-associated-type.rs | 26 -------- src/test/ui/coherence/re-rebalance-coherence.rs | 11 ---- .../strict-coherence-needs-negative-coherence.rs | 7 -- ...trict-coherence-needs-negative-coherence.stderr | 10 --- 239 files changed, 4386 deletions(-) delete mode 100644 src/test/ui/coherence/auxiliary/coherence_copy_like_lib.rs delete mode 100644 src/test/ui/coherence/auxiliary/coherence_fundamental_trait_lib.rs delete mode 100644 src/test/ui/coherence/auxiliary/coherence_inherent_cc_lib.rs delete mode 100644 src/test/ui/coherence/auxiliary/coherence_lib.rs delete mode 100644 src/test/ui/coherence/auxiliary/coherence_orphan_lib.rs delete mode 100644 src/test/ui/coherence/auxiliary/error_lib.rs delete mode 100644 src/test/ui/coherence/auxiliary/go_trait.rs delete mode 100644 src/test/ui/coherence/auxiliary/option_future.rs delete mode 100644 src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib-rpass.rs delete mode 100644 src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs delete mode 100644 src/test/ui/coherence/auxiliary/trait-with-const-param.rs delete mode 100644 src/test/ui/coherence/auxiliary/trait_impl_conflict.rs delete mode 100644 src/test/ui/coherence/coherence-all-remote.rs delete mode 100644 src/test/ui/coherence/coherence-all-remote.stderr delete mode 100644 src/test/ui/coherence/coherence-bigint-int.rs delete mode 100644 src/test/ui/coherence/coherence-bigint-param.rs delete mode 100644 src/test/ui/coherence/coherence-bigint-param.stderr delete mode 100644 src/test/ui/coherence/coherence-bigint-vecint.rs delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs delete mode 100644 src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr delete mode 100644 src/test/ui/coherence/coherence-blanket.rs delete mode 100644 src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs delete mode 100644 src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr delete mode 100644 src/test/ui/coherence/coherence-covered-type-parameter.rs delete mode 100644 src/test/ui/coherence/coherence-cow.re_a.stderr delete mode 100644 src/test/ui/coherence/coherence-cow.re_b.stderr delete mode 100644 src/test/ui/coherence/coherence-cow.re_c.stderr delete mode 100644 src/test/ui/coherence/coherence-cow.rs delete mode 100644 src/test/ui/coherence/coherence-cross-crate-conflict.rs delete mode 100644 src/test/ui/coherence/coherence-cross-crate-conflict.stderr delete mode 100644 src/test/ui/coherence/coherence-default-trait-impl.rs delete mode 100644 src/test/ui/coherence/coherence-default-trait-impl.stderr delete mode 100644 src/test/ui/coherence/coherence-error-suppression.rs delete mode 100644 src/test/ui/coherence/coherence-error-suppression.stderr delete mode 100644 src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.rs delete mode 100644 src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr delete mode 100644 src/test/ui/coherence/coherence-fn-implied-bounds.rs delete mode 100644 src/test/ui/coherence/coherence-fn-implied-bounds.stderr delete mode 100644 src/test/ui/coherence/coherence-fn-inputs.rs delete mode 100644 src/test/ui/coherence/coherence-fn-inputs.stderr delete mode 100644 src/test/ui/coherence/coherence-free-vs-bound-region.rs delete mode 100644 src/test/ui/coherence/coherence-free-vs-bound-region.stderr delete mode 100644 src/test/ui/coherence/coherence-fundamental-trait-objects.rs delete mode 100644 src/test/ui/coherence/coherence-fundamental-trait-objects.stderr delete mode 100644 src/test/ui/coherence/coherence-impl-in-fn.rs delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-trait.rs delete mode 100644 src/test/ui/coherence/coherence-impl-trait-for-trait.stderr delete mode 100644 src/test/ui/coherence/coherence-impls-copy.rs delete mode 100644 src/test/ui/coherence/coherence-impls-copy.stderr delete mode 100644 src/test/ui/coherence/coherence-impls-send.rs delete mode 100644 src/test/ui/coherence/coherence-impls-send.stderr delete mode 100644 src/test/ui/coherence/coherence-impls-sized.rs delete mode 100644 src/test/ui/coherence/coherence-impls-sized.stderr delete mode 100644 src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs delete mode 100644 src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr delete mode 100644 src/test/ui/coherence/coherence-inherited-subtyping.old.stderr delete mode 100644 src/test/ui/coherence/coherence-inherited-subtyping.re.stderr delete mode 100644 src/test/ui/coherence/coherence-inherited-subtyping.rs delete mode 100644 src/test/ui/coherence/coherence-iterator-vec-any-elem.rs delete mode 100644 src/test/ui/coherence/coherence-iterator-vec.rs delete mode 100644 src/test/ui/coherence/coherence-lone-type-parameter.rs delete mode 100644 src/test/ui/coherence/coherence-lone-type-parameter.stderr delete mode 100644 src/test/ui/coherence/coherence-multidispatch-tuple.rs delete mode 100644 src/test/ui/coherence/coherence-negative-impls-copy-bad.rs delete mode 100644 src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr delete mode 100644 src/test/ui/coherence/coherence-negative-impls-copy.rs delete mode 100644 src/test/ui/coherence/coherence-negative-impls-safe-rpass.rs delete mode 100644 src/test/ui/coherence/coherence-negative-impls-safe.rs delete mode 100644 src/test/ui/coherence/coherence-negative-impls-safe.stderr delete mode 100644 src/test/ui/coherence/coherence-negative-inherent-where-bounds.rs delete mode 100644 src/test/ui/coherence/coherence-negative-inherent.rs delete mode 100644 src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs delete mode 100644 src/test/ui/coherence/coherence-negative-outlives-lifetimes.stock.stderr delete mode 100644 src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs delete mode 100644 src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr delete mode 100644 src/test/ui/coherence/coherence-orphan.rs delete mode 100644 src/test/ui/coherence/coherence-orphan.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-double-negative.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-downstream-inherent.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-downstream.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-downstream.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-issue-23516.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-issue-23516.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-messages.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-messages.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-negate-strict.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-negate-use-feature-gate.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-negative-trait.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-negative-trait2.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-super-negative.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-trait-alias.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-trait-alias.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-upstream-inherent.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-upstream.rs delete mode 100644 src/test/ui/coherence/coherence-overlap-upstream.stderr delete mode 100644 src/test/ui/coherence/coherence-overlap-with-regions.rs delete mode 100644 src/test/ui/coherence/coherence-overlapping-pairs.rs delete mode 100644 src/test/ui/coherence/coherence-overlapping-pairs.stderr delete mode 100644 src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs delete mode 100644 src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr delete mode 100644 src/test/ui/coherence/coherence-pair-covered-uncovered.rs delete mode 100644 src/test/ui/coherence/coherence-pair-covered-uncovered.stderr delete mode 100644 src/test/ui/coherence/coherence-projection-conflict-orphan.rs delete mode 100644 src/test/ui/coherence/coherence-projection-conflict-orphan.stderr delete mode 100644 src/test/ui/coherence/coherence-projection-conflict-ty-param.rs delete mode 100644 src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr delete mode 100644 src/test/ui/coherence/coherence-projection-conflict.rs delete mode 100644 src/test/ui/coherence/coherence-projection-conflict.stderr delete mode 100644 src/test/ui/coherence/coherence-projection-ok-orphan.rs delete mode 100644 src/test/ui/coherence/coherence-projection-ok.rs delete mode 100644 src/test/ui/coherence/coherence-rfc447-constrained.rs delete mode 100644 src/test/ui/coherence/coherence-subtyping.rs delete mode 100644 src/test/ui/coherence/coherence-subtyping.stderr delete mode 100644 src/test/ui/coherence/coherence-tuple-conflict.rs delete mode 100644 src/test/ui/coherence/coherence-tuple-conflict.stderr delete mode 100644 src/test/ui/coherence/coherence-unsafe-trait-object-impl.rs delete mode 100644 src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr delete mode 100644 src/test/ui/coherence/coherence-vec-local-2.rs delete mode 100644 src/test/ui/coherence/coherence-vec-local-2.stderr delete mode 100644 src/test/ui/coherence/coherence-vec-local.rs delete mode 100644 src/test/ui/coherence/coherence-vec-local.stderr delete mode 100644 src/test/ui/coherence/coherence-wasm-bindgen.rs delete mode 100644 src/test/ui/coherence/coherence-wasm-bindgen.stderr delete mode 100644 src/test/ui/coherence/coherence-where-clause.rs delete mode 100644 src/test/ui/coherence/coherence-with-closure.rs delete mode 100644 src/test/ui/coherence/coherence-with-closure.stderr delete mode 100644 src/test/ui/coherence/coherence-with-generator.rs delete mode 100644 src/test/ui/coherence/coherence-with-generator.stderr delete mode 100644 src/test/ui/coherence/coherence_copy_like.rs delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_struct.rs delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_struct.stderr delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_tuple.rs delete mode 100644 src/test/ui/coherence/coherence_copy_like_err_tuple.stderr delete mode 100644 src/test/ui/coherence/coherence_inherent.rs delete mode 100644 src/test/ui/coherence/coherence_inherent.stderr delete mode 100644 src/test/ui/coherence/coherence_inherent_cc.rs delete mode 100644 src/test/ui/coherence/coherence_inherent_cc.stderr delete mode 100644 src/test/ui/coherence/coherence_local.rs delete mode 100644 src/test/ui/coherence/coherence_local_err_struct.rs delete mode 100644 src/test/ui/coherence/coherence_local_err_struct.stderr delete mode 100644 src/test/ui/coherence/coherence_local_err_tuple.rs delete mode 100644 src/test/ui/coherence/coherence_local_err_tuple.stderr delete mode 100644 src/test/ui/coherence/coherence_local_ref.rs delete mode 100644 src/test/ui/coherence/conflicting-impl-with-err.rs delete mode 100644 src/test/ui/coherence/conflicting-impl-with-err.stderr delete mode 100644 src/test/ui/coherence/const-generics-orphan-check-ok.rs delete mode 100644 src/test/ui/coherence/deep-bad-copy-reason.rs delete mode 100644 src/test/ui/coherence/deep-bad-copy-reason.stderr delete mode 100644 src/test/ui/coherence/impl-foreign-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl-foreign-for-foreign.stderr delete mode 100644 src/test/ui/coherence/impl-foreign-for-foreign[foreign].rs delete mode 100644 src/test/ui/coherence/impl-foreign-for-foreign[foreign].stderr delete mode 100644 src/test/ui/coherence/impl-foreign-for-foreign[local].rs delete mode 100644 src/test/ui/coherence/impl-foreign-for-fundamental[foreign].rs delete mode 100644 src/test/ui/coherence/impl-foreign-for-fundamental[foreign].stderr delete mode 100644 src/test/ui/coherence/impl-foreign-for-fundamental[local].rs delete mode 100644 src/test/ui/coherence/impl-foreign-for-local.rs delete mode 100644 src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs delete mode 100644 src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs delete mode 100644 src/test/ui/coherence/impl-foreign[foreign]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr delete mode 100644 src/test/ui/coherence/impl-foreign[foreign]-for-local.rs delete mode 100644 src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr delete mode 100644 src/test/ui/coherence/impl-foreign[fundemental[local]]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign-for-foreign[t].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign-for-foreign[t].stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[foreign[t]_local]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-local.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[fundemental[local]]-for-foreign[t].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-foreign[t].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[foreign[t]].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-local.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-t.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local]-for-t.stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[local_fundamental[t]]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.stderr delete mode 100644 src/test/ui/coherence/impl[t]-foreign[t]-for-local.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[t]-for-t.rs delete mode 100644 src/test/ui/coherence/impl[t]-foreign[t]-for-t.stderr delete mode 100644 src/test/ui/coherence/inter-crate-ambiguity-causes-notes.rs delete mode 100644 src/test/ui/coherence/inter-crate-ambiguity-causes-notes.stderr delete mode 100644 src/test/ui/coherence/issue-85026.rs delete mode 100644 src/test/ui/coherence/issue-85026.stderr delete mode 100644 src/test/ui/coherence/issue-99663-2.rs delete mode 100644 src/test/ui/coherence/issue-99663.rs delete mode 100644 src/test/ui/coherence/re-rebalance-coherence-default-generic-associated-type.rs delete mode 100644 src/test/ui/coherence/re-rebalance-coherence.rs delete mode 100644 src/test/ui/coherence/strict-coherence-needs-negative-coherence.rs delete mode 100644 src/test/ui/coherence/strict-coherence-needs-negative-coherence.stderr (limited to 'src/test/ui/coherence') diff --git a/src/test/ui/coherence/auxiliary/coherence_copy_like_lib.rs b/src/test/ui/coherence/auxiliary/coherence_copy_like_lib.rs deleted file mode 100644 index b5b4802c1..000000000 --- a/src/test/ui/coherence/auxiliary/coherence_copy_like_lib.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![crate_type = "rlib"] -#![feature(fundamental)] - -pub trait MyCopy { } -impl MyCopy for i32 { } - -pub struct MyStruct(T); - -#[fundamental] -pub struct MyFundamentalStruct(T); diff --git a/src/test/ui/coherence/auxiliary/coherence_fundamental_trait_lib.rs b/src/test/ui/coherence/auxiliary/coherence_fundamental_trait_lib.rs deleted file mode 100644 index 21aaea479..000000000 --- a/src/test/ui/coherence/auxiliary/coherence_fundamental_trait_lib.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![crate_type = "rlib"] -#![feature(fundamental)] - -pub trait Misc {} - -#[fundamental] -pub trait Fundamental {} diff --git a/src/test/ui/coherence/auxiliary/coherence_inherent_cc_lib.rs b/src/test/ui/coherence/auxiliary/coherence_inherent_cc_lib.rs deleted file mode 100644 index 08d22fbed..000000000 --- a/src/test/ui/coherence/auxiliary/coherence_inherent_cc_lib.rs +++ /dev/null @@ -1,11 +0,0 @@ -// See coherence_inherent_cc.rs - -pub trait TheTrait { - fn the_fn(&self); -} - -pub struct TheStruct; - -impl TheTrait for TheStruct { - fn the_fn(&self) {} -} diff --git a/src/test/ui/coherence/auxiliary/coherence_lib.rs b/src/test/ui/coherence/auxiliary/coherence_lib.rs deleted file mode 100644 index c22819831..000000000 --- a/src/test/ui/coherence/auxiliary/coherence_lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![crate_type="lib"] - -pub trait Remote { - fn foo(&self) { } -} - -pub trait Remote1 { - fn foo(&self, _t: T) { } -} - -pub trait Remote2 { - fn foo(&self, _t: T, _u: U) { } -} - -pub struct Pair(T,U); diff --git a/src/test/ui/coherence/auxiliary/coherence_orphan_lib.rs b/src/test/ui/coherence/auxiliary/coherence_orphan_lib.rs deleted file mode 100644 index 2664ef550..000000000 --- a/src/test/ui/coherence/auxiliary/coherence_orphan_lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub trait TheTrait { - fn the_fn(&self); -} diff --git a/src/test/ui/coherence/auxiliary/error_lib.rs b/src/test/ui/coherence/auxiliary/error_lib.rs deleted file mode 100644 index 19ff9ae62..000000000 --- a/src/test/ui/coherence/auxiliary/error_lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -#![crate_type = "lib"] -#![feature(negative_impls)] -#![feature(with_negative_coherence)] - -pub trait Error {} -impl !Error for &str {} diff --git a/src/test/ui/coherence/auxiliary/go_trait.rs b/src/test/ui/coherence/auxiliary/go_trait.rs deleted file mode 100644 index aa0ec2289..000000000 --- a/src/test/ui/coherence/auxiliary/go_trait.rs +++ /dev/null @@ -1,43 +0,0 @@ -#![feature(specialization)] - -// Common code used for tests that model the Fn/FnMut/FnOnce hierarchy. - -pub trait Go { - fn go(&self, arg: isize); -} - -pub fn go(this: &G, arg: isize) { - this.go(arg) -} - -pub trait GoMut { - fn go_mut(&mut self, arg: isize); -} - -pub fn go_mut(this: &mut G, arg: isize) { - this.go_mut(arg) -} - -pub trait GoOnce { - fn go_once(self, arg: isize); -} - -pub fn go_once(this: G, arg: isize) { - this.go_once(arg) -} - -impl GoMut for G - where G : Go -{ - default fn go_mut(&mut self, arg: isize) { - go(&*self, arg) - } -} - -impl GoOnce for G - where G : GoMut -{ - default fn go_once(mut self, arg: isize) { - go_mut(&mut self, arg) - } -} diff --git a/src/test/ui/coherence/auxiliary/option_future.rs b/src/test/ui/coherence/auxiliary/option_future.rs deleted file mode 100644 index 067de1cd8..000000000 --- a/src/test/ui/coherence/auxiliary/option_future.rs +++ /dev/null @@ -1,8 +0,0 @@ -#![crate_type = "lib"] -#![feature(negative_impls)] -#![feature(rustc_attrs)] -#![feature(with_negative_coherence)] - -pub trait Future {} - -impl !Future for Option where E: Sized {} diff --git a/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib-rpass.rs b/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib-rpass.rs deleted file mode 100644 index 9a191bad8..000000000 --- a/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib-rpass.rs +++ /dev/null @@ -1,31 +0,0 @@ -pub trait Backend {} -pub trait SupportsDefaultKeyword {} - -impl SupportsDefaultKeyword for Postgres {} - -pub struct Postgres; - -impl Backend for Postgres {} - -pub struct AstPass(::std::marker::PhantomData); - -pub trait QueryFragment {} - - -#[derive(Debug, Clone, Copy)] -pub struct BatchInsert<'a, T: 'a, Tab> { - _marker: ::std::marker::PhantomData<(&'a T, Tab)>, -} - -impl<'a, T:'a, Tab, DB> QueryFragment for BatchInsert<'a, T, Tab> -where DB: SupportsDefaultKeyword + Backend, -{} - -pub trait LibToOwned { - type Owned; -} - -pub struct LibCow::Owned> { - pub t: T, - pub o: Owned, -} diff --git a/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs b/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs deleted file mode 100644 index 41b9d64d5..000000000 --- a/src/test/ui/coherence/auxiliary/re_rebalance_coherence_lib.rs +++ /dev/null @@ -1,22 +0,0 @@ -pub trait Backend {} -pub trait SupportsDefaultKeyword {} - -impl SupportsDefaultKeyword for Postgres {} - -pub struct Postgres; - -impl Backend for Postgres {} - -pub struct AstPass(::std::marker::PhantomData); - -pub trait QueryFragment {} - - -#[derive(Debug, Clone, Copy)] -pub struct BatchInsert<'a, T: 'a, Tab> { - _marker: ::std::marker::PhantomData<(&'a T, Tab)>, -} - -impl<'a, T:'a, Tab, DB> QueryFragment for BatchInsert<'a, T, Tab> -where DB: SupportsDefaultKeyword + Backend, -{} diff --git a/src/test/ui/coherence/auxiliary/trait-with-const-param.rs b/src/test/ui/coherence/auxiliary/trait-with-const-param.rs deleted file mode 100644 index a44eb14f8..000000000 --- a/src/test/ui/coherence/auxiliary/trait-with-const-param.rs +++ /dev/null @@ -1 +0,0 @@ -pub trait Trait {} diff --git a/src/test/ui/coherence/auxiliary/trait_impl_conflict.rs b/src/test/ui/coherence/auxiliary/trait_impl_conflict.rs deleted file mode 100644 index 5e5f017ed..000000000 --- a/src/test/ui/coherence/auxiliary/trait_impl_conflict.rs +++ /dev/null @@ -1,6 +0,0 @@ -pub trait Foo { - fn foo() {} -} - -impl Foo for isize { -} diff --git a/src/test/ui/coherence/coherence-all-remote.rs b/src/test/ui/coherence/coherence-all-remote.rs deleted file mode 100644 index 5c3bfee82..000000000 --- a/src/test/ui/coherence/coherence-all-remote.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::Remote1; - -impl Remote1 for isize { } -//~^ ERROR E0210 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-all-remote.stderr b/src/test/ui/coherence/coherence-all-remote.stderr deleted file mode 100644 index 7eca41753..000000000 --- a/src/test/ui/coherence/coherence-all-remote.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/coherence-all-remote.rs:6:6 - | -LL | impl Remote1 for isize { } - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/coherence-bigint-int.rs b/src/test/ui/coherence/coherence-bigint-int.rs deleted file mode 100644 index 02945e9da..000000000 --- a/src/test/ui/coherence/coherence-bigint-int.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -pub struct BigInt; - -impl Remote1 for isize { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence-bigint-param.rs b/src/test/ui/coherence/coherence-bigint-param.rs deleted file mode 100644 index c6543aaf6..000000000 --- a/src/test/ui/coherence/coherence-bigint-param.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::Remote1; - -pub struct BigInt; - -impl Remote1 for T { } -//~^ ERROR E0210 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-bigint-param.stderr b/src/test/ui/coherence/coherence-bigint-param.stderr deleted file mode 100644 index e8d74c917..000000000 --- a/src/test/ui/coherence/coherence-bigint-param.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`BigInt`) - --> $DIR/coherence-bigint-param.rs:8:6 - | -LL | impl Remote1 for T { } - | ^ type parameter `T` must be covered by another type when it appears before the first local type (`BigInt`) - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type - = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait for T0`, where `T0` is the first and `Tn` is the last - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/coherence-bigint-vecint.rs b/src/test/ui/coherence/coherence-bigint-vecint.rs deleted file mode 100644 index a5dba90be..000000000 --- a/src/test/ui/coherence/coherence-bigint-vecint.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -pub struct BigInt; - -impl Remote1 for Vec { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs deleted file mode 100644 index 93a4bc5fe..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs +++ /dev/null @@ -1,30 +0,0 @@ -use std::fmt::Debug; -use std::default::Default; - -// Test that two blanket impls conflict (at least without negative -// bounds). After all, some other crate could implement Even or Odd -// for the same type (though this crate doesn't). - -trait MyTrait { - fn get(&self) -> usize; -} - -trait Even { } - -trait Odd { } - -impl Even for isize { } - -impl Odd for usize { } - -impl MyTrait for T { - fn get(&self) -> usize { 0 } -} - -impl MyTrait for T { -//~^ ERROR E0119 - - fn get(&self) -> usize { 0 } -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr deleted file mode 100644 index 9156972a1..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` - --> $DIR/coherence-blanket-conflicts-with-blanket-implemented.rs:24:1 - | -LL | impl MyTrait for T { - | -------------------------- first implementation here -... -LL | impl MyTrait for T { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs deleted file mode 100644 index 950a08ff2..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs +++ /dev/null @@ -1,25 +0,0 @@ -use std::fmt::Debug; -use std::default::Default; - -// Test that two blanket impls conflict (at least without negative -// bounds). After all, some other crate could implement Even or Odd -// for the same type (though this crate doesn't implement them at all). - -trait MyTrait { - fn get(&self) -> usize; -} - -trait Even {} - -trait Odd {} - -impl MyTrait for T { - fn get(&self) -> usize { 0 } -} - -impl MyTrait for T { -//~^ ERROR E0119 - fn get(&self) -> usize { 0 } -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr deleted file mode 100644 index 8400968e1..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` - --> $DIR/coherence-blanket-conflicts-with-blanket-unimplemented.rs:20:1 - | -LL | impl MyTrait for T { - | -------------------------- first implementation here -... -LL | impl MyTrait for T { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs deleted file mode 100644 index bccbac2ff..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs +++ /dev/null @@ -1,20 +0,0 @@ -// aux-build:go_trait.rs - -extern crate go_trait; - -use go_trait::{Go,GoMut}; -use std::fmt::Debug; -use std::default::Default; - -struct MyThingy; - -impl Go for MyThingy { - fn go(&self, arg: isize) { } -} - -impl GoMut for MyThingy { -//~^ ERROR E0119 - fn go_mut(&mut self, arg: isize) { } -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr deleted file mode 100644 index 4d7872598..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0119]: conflicting implementations of trait `GoMut` for type `MyThingy` - --> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:15:1 - | -LL | impl GoMut for MyThingy { - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: conflicting implementation in crate `go_trait`: - - impl GoMut for G - where G: Go; - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs deleted file mode 100644 index 6a9db2173..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs +++ /dev/null @@ -1,27 +0,0 @@ -use std::fmt::Debug; -use std::default::Default; - -// Test that a blank impl for all T conflicts with an impl for some -// specific T, even when there are multiple type parameters involved. - -trait MyTrait { - fn get(&self) -> T; -} - -impl MyTrait for T { - fn get(&self) -> T { - panic!() - } -} - -#[derive(Clone)] -struct MyType { - dummy: usize -} - -impl MyTrait for MyType { -//~^ ERROR E0119 - fn get(&self) -> usize { (*self).clone() } -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr deleted file mode 100644 index c2a925213..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType` - --> $DIR/coherence-blanket-conflicts-with-specific-multidispatch.rs:22:1 - | -LL | impl MyTrait for T { - | ------------------------ first implementation here -... -LL | impl MyTrait for MyType { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs deleted file mode 100644 index 02f9217da..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Test that a blank impl for all T:PartialEq conflicts with an impl for some -// specific T when T:PartialEq. - -trait OtherTrait { - fn noop(&self); -} - -trait MyTrait { - fn get(&self) -> usize; -} - -impl MyTrait for T { - fn get(&self) -> usize { 0 } -} - -struct MyType { - dummy: usize -} - -impl MyTrait for MyType { -//~^ ERROR E0119 - fn get(&self) -> usize { self.dummy } -} - -impl OtherTrait for MyType { - fn noop(&self) { } -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr deleted file mode 100644 index e1a5dffeb..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType` - --> $DIR/coherence-blanket-conflicts-with-specific-trait.rs:20:1 - | -LL | impl MyTrait for T { - | -------------------------------- first implementation here -... -LL | impl MyTrait for MyType { - | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs deleted file mode 100644 index 5a562ff6a..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs +++ /dev/null @@ -1,24 +0,0 @@ -use std::fmt::Debug; -use std::default::Default; - -// Test that a blank impl for all T conflicts with an impl for some -// specific T. - -trait MyTrait { - fn get(&self) -> usize; -} - -impl MyTrait for T { - fn get(&self) -> usize { 0 } -} - -struct MyType { - dummy: usize -} - -impl MyTrait for MyType { -//~^ ERROR E0119 - fn get(&self) -> usize { self.dummy } -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr deleted file mode 100644 index ba60a2ea9..000000000 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType` - --> $DIR/coherence-blanket-conflicts-with-specific.rs:19:1 - | -LL | impl MyTrait for T { - | --------------------- first implementation here -... -LL | impl MyTrait for MyType { - | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-blanket.rs b/src/test/ui/coherence/coherence-blanket.rs deleted file mode 100644 index 55fa89d75..000000000 --- a/src/test/ui/coherence/coherence-blanket.rs +++ /dev/null @@ -1,16 +0,0 @@ -// run-pass -#![allow(unused_imports)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -pub trait Local { - fn foo(&self) { } -} - -impl Local for T { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs deleted file mode 100644 index 24b878927..000000000 --- a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(negative_impls)] -#![feature(marker_trait_attr)] - -#[marker] -trait MyTrait {} - -struct TestType(::std::marker::PhantomData); - -unsafe impl Send for TestType {} - -impl !Send for TestType {} //~ ERROR found both positive and negative implementation - -unsafe impl Send for TestType {} //~ ERROR conflicting implementations - -impl !Send for TestType {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr deleted file mode 100644 index 2463f38a9..000000000 --- a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`: - --> $DIR/coherence-conflicting-negative-trait-impl.rs:11:1 - | -LL | unsafe impl Send for TestType {} - | ------------------------------------------------------ positive implementation here -LL | -LL | impl !Send for TestType {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here - -error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>` - --> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1 - | -LL | unsafe impl Send for TestType {} - | ------------------------------------------------------ first implementation here -... -LL | unsafe impl Send for TestType {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0119, E0751. -For more information about an error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-covered-type-parameter.rs b/src/test/ui/coherence/coherence-covered-type-parameter.rs deleted file mode 100644 index bb95c59d1..000000000 --- a/src/test/ui/coherence/coherence-covered-type-parameter.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -#![allow(dead_code)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote; - -struct Foo(T); - -impl Remote for Foo { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence-cow.re_a.stderr b/src/test/ui/coherence/coherence-cow.re_a.stderr deleted file mode 100644 index fe4b5b410..000000000 --- a/src/test/ui/coherence/coherence-cow.re_a.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-cow.rs:18:1 - | -LL | impl Remote for Pair> { } - | ^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-cow.re_b.stderr b/src/test/ui/coherence/coherence-cow.re_b.stderr deleted file mode 100644 index da4ede325..000000000 --- a/src/test/ui/coherence/coherence-cow.re_b.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-cow.rs:22:1 - | -LL | impl Remote for Pair,T> { } - | ^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-cow.re_c.stderr b/src/test/ui/coherence/coherence-cow.re_c.stderr deleted file mode 100644 index d1a20c0ca..000000000 --- a/src/test/ui/coherence/coherence-cow.re_c.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-cow.rs:26:1 - | -LL | impl Remote for Pair,U> { } - | ^^^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-cow.rs b/src/test/ui/coherence/coherence-cow.rs deleted file mode 100644 index 86a8d0963..000000000 --- a/src/test/ui/coherence/coherence-cow.rs +++ /dev/null @@ -1,29 +0,0 @@ -// revisions: re_a re_b re_c - -#![cfg_attr(any(), re_a, re_b, re_c)] - -// aux-build:coherence_lib.rs - -// Test that the `Pair` type reports an error if it contains type -// parameters, even when they are covered by local types. This test -// was originally intended to test the opposite, but the rules changed -// with RFC 1023 and this became illegal. - -extern crate coherence_lib as lib; -use lib::{Remote,Pair}; - -pub struct Cover(T); - -#[cfg(any(re_a))] -impl Remote for Pair> { } -//[re_a]~^ ERROR E0117 - -#[cfg(any(re_b))] -impl Remote for Pair,T> { } -//[re_b]~^ ERROR E0117 - -#[cfg(any(re_c))] -impl Remote for Pair,U> { } -//[re_c]~^ ERROR E0117 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.rs b/src/test/ui/coherence/coherence-cross-crate-conflict.rs deleted file mode 100644 index 588630957..000000000 --- a/src/test/ui/coherence/coherence-cross-crate-conflict.rs +++ /dev/null @@ -1,13 +0,0 @@ -// The error here is strictly due to orphan rules; the impl here -// generalizes the one upstream - -// aux-build:trait_impl_conflict.rs - -extern crate trait_impl_conflict; -use trait_impl_conflict::Foo; - -impl Foo for A { //~ ERROR E0210 -} - -fn main() { -} diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr b/src/test/ui/coherence/coherence-cross-crate-conflict.stderr deleted file mode 100644 index 3d253d56a..000000000 --- a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/coherence-cross-crate-conflict.rs:9:6 - | -LL | impl Foo for A { - | ^ type parameter `A` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/coherence-default-trait-impl.rs b/src/test/ui/coherence/coherence-default-trait-impl.rs deleted file mode 100644 index d57fb4777..000000000 --- a/src/test/ui/coherence/coherence-default-trait-impl.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![feature(auto_traits)] -#![feature(negative_impls)] - -auto trait MySafeTrait {} - -struct Foo; - -unsafe impl MySafeTrait for Foo {} -//~^ ERROR E0199 - -unsafe auto trait MyUnsafeTrait {} - -impl MyUnsafeTrait for Foo {} -//~^ ERROR E0200 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-default-trait-impl.stderr b/src/test/ui/coherence/coherence-default-trait-impl.stderr deleted file mode 100644 index 632018782..000000000 --- a/src/test/ui/coherence/coherence-default-trait-impl.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0199]: implementing the trait `MySafeTrait` is not unsafe - --> $DIR/coherence-default-trait-impl.rs:8:1 - | -LL | unsafe impl MySafeTrait for Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | -help: remove `unsafe` from this trait implementation - | -LL - unsafe impl MySafeTrait for Foo {} -LL + impl MySafeTrait for Foo {} - | - -error[E0200]: the trait `MyUnsafeTrait` requires an `unsafe impl` declaration - --> $DIR/coherence-default-trait-impl.rs:13:1 - | -LL | impl MyUnsafeTrait for Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the trait `MyUnsafeTrait` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword -help: add `unsafe` to this trait implementation - | -LL | unsafe impl MyUnsafeTrait for Foo {} - | ++++++ - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0199, E0200. -For more information about an error, try `rustc --explain E0199`. diff --git a/src/test/ui/coherence/coherence-error-suppression.rs b/src/test/ui/coherence/coherence-error-suppression.rs deleted file mode 100644 index 909214c1b..000000000 --- a/src/test/ui/coherence/coherence-error-suppression.rs +++ /dev/null @@ -1,16 +0,0 @@ -// check that error types in coherence do not cause error cascades. - -trait Foo {} - -impl Foo for i8 {} -impl Foo for i16 {} -impl Foo for i32 {} -impl Foo for i64 {} -impl Foo for DoesNotExist {} -//~^ ERROR E0412 -impl Foo for u8 {} -impl Foo for u16 {} -impl Foo for u32 {} -impl Foo for u64 {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-error-suppression.stderr b/src/test/ui/coherence/coherence-error-suppression.stderr deleted file mode 100644 index aadc80cb1..000000000 --- a/src/test/ui/coherence/coherence-error-suppression.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0412]: cannot find type `DoesNotExist` in this scope - --> $DIR/coherence-error-suppression.rs:9:14 - | -LL | impl Foo for DoesNotExist {} - | ^^^^^^^^^^^^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.rs b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.rs deleted file mode 100644 index 99f805f7f..000000000 --- a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Test that impls for these two types are considered ovelapping: -// -// * `for<'r> fn(fn(&'r u32))` -// * `fn(fn(&'a u32)` where `'a` is free -// -// This is because, for `'a = 'static`, the two types overlap. -// Effectively for them to be equal to you get: -// -// * `for<'r> fn(fn(&'r u32)) <: fn(fn(&'static u32))` -// * true if `exists<'r> { 'r: 'static }` (obviously true) -// * `fn(fn(&'static u32)) <: for<'r> fn(fn(&'r u32))` -// * true if `forall<'r> { 'static: 'r }` (also true) - -trait Trait {} - -impl Trait for for<'r> fn(fn(&'r ())) {} -impl<'a> Trait for fn(fn(&'a ())) {} -//~^ ERROR conflicting implementations -// -// Note in particular that we do NOT get a future-compatibility warning -// here. This is because the new leak-check proposed in [MCP 295] does not -// "error" when these two types are equated. -// -// [MCP 295]: https://github.com/rust-lang/compiler-team/issues/295 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr deleted file mode 100644 index 7dabd97b9..000000000 --- a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))` - --> $DIR/coherence-fn-covariant-bound-vs-static.rs:17:1 - | -LL | impl Trait for for<'r> fn(fn(&'r ())) {} - | ------------------------------------- first implementation here -LL | impl<'a> Trait for fn(fn(&'a ())) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'r> fn(fn(&'r ()))` - | - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-fn-implied-bounds.rs b/src/test/ui/coherence/coherence-fn-implied-bounds.rs deleted file mode 100644 index 4539af9a3..000000000 --- a/src/test/ui/coherence/coherence-fn-implied-bounds.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Test that our leak-check is not smart enough to take implied bounds -// into account (yet). Here we have two types that look like they -// should not be equivalent, but because of the rules on implied -// bounds we ought to know that, in fact, `'a = 'b` must always hold, -// and hence they are. -// -// Rustc can't figure this out and hence it accepts the impls but -// gives a future-compatibility warning (because we'd like to make -// this an error someday). -// -// Note that while we would like to make this a hard error, we also -// give the same warning for `coherence-wasm-bindgen.rs`, which ought -// to be accepted. - -#![deny(coherence_leak_check)] - -trait Trait {} - -impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {} - -impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 { - //~^ ERROR conflicting implementations - //~| WARNING this was previously accepted by the compiler -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr b/src/test/ui/coherence/coherence-fn-implied-bounds.stderr deleted file mode 100644 index 201871204..000000000 --- a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32` - --> $DIR/coherence-fn-implied-bounds.rs:21:1 - | -LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {} - | ------------------------------------------------------------------ first implementation here -LL | -LL | impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32` - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #56105 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details -note: the lint level is defined here - --> $DIR/coherence-fn-implied-bounds.rs:15:9 - | -LL | #![deny(coherence_leak_check)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/coherence/coherence-fn-inputs.rs b/src/test/ui/coherence/coherence-fn-inputs.rs deleted file mode 100644 index 3afec5c54..000000000 --- a/src/test/ui/coherence/coherence-fn-inputs.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Test that we consider these two types completely equal: -// -// * `for<'a, 'b> fn(&'a u32, &'b u32)` -// * `for<'c> fn(&'c u32, &'c u32)` -// -// For a long time we considered these to be distinct types. But in fact they -// are equivalent, if you work through the implications of subtyping -- this is -// because: -// -// * `'c` can be the intersection of `'a` and `'b` (and there is always an intersection) -// * `'a` and `'b` can both be equal to `'c` - -trait Trait {} -impl Trait for for<'a, 'b> fn(&'a u32, &'b u32) {} -impl Trait for for<'c> fn(&'c u32, &'c u32) { - //~^ ERROR conflicting implementations - // - // Note in particular that we do NOT get a future-compatibility warning - // here. This is because the new leak-check proposed in [MCP 295] does not - // "error" when these two types are equated. - // - // [MCP 295]: https://github.com/rust-lang/compiler-team/issues/295 -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-fn-inputs.stderr b/src/test/ui/coherence/coherence-fn-inputs.stderr deleted file mode 100644 index 82bd8a35f..000000000 --- a/src/test/ui/coherence/coherence-fn-inputs.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a u32, &'b u32)` - --> $DIR/coherence-fn-inputs.rs:15:1 - | -LL | impl Trait for for<'a, 'b> fn(&'a u32, &'b u32) {} - | ----------------------------------------------- first implementation here -LL | impl Trait for for<'c> fn(&'c u32, &'c u32) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u32, &'b u32)` - | - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-free-vs-bound-region.rs b/src/test/ui/coherence/coherence-free-vs-bound-region.rs deleted file mode 100644 index 2f5c49d29..000000000 --- a/src/test/ui/coherence/coherence-free-vs-bound-region.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Capture a coherence pattern from wasm-bindgen that we discovered as part of -// future-compatibility warning #56105. This pattern currently receives a lint -// warning but we probably want to support it long term. -// -// Key distinction: we are implementing once for `A` (take ownership) and one -// for `&A` (borrow). -// -// c.f. #56105 - -#![deny(coherence_leak_check)] - -trait TheTrait {} - -impl<'a> TheTrait for fn(&'a u8) {} - -impl TheTrait for fn(&u8) { - //~^ ERROR conflicting implementations of trait - //~| WARNING this was previously accepted by the compiler -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr b/src/test/ui/coherence/coherence-free-vs-bound-region.stderr deleted file mode 100644 index e2d84b833..000000000 --- a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: conflicting implementations of trait `TheTrait` for type `fn(&u8)` - --> $DIR/coherence-free-vs-bound-region.rs:16:1 - | -LL | impl<'a> TheTrait for fn(&'a u8) {} - | -------------------------------- first implementation here -LL | -LL | impl TheTrait for fn(&u8) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `fn(&u8)` - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #56105 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details -note: the lint level is defined here - --> $DIR/coherence-free-vs-bound-region.rs:10:9 - | -LL | #![deny(coherence_leak_check)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/coherence/coherence-fundamental-trait-objects.rs b/src/test/ui/coherence/coherence-fundamental-trait-objects.rs deleted file mode 100644 index dd127bf7f..000000000 --- a/src/test/ui/coherence/coherence-fundamental-trait-objects.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Check that trait objects from #[fundamental] traits are not -// treated as #[fundamental] types - the 2 meanings of #[fundamental] -// are distinct. - -// aux-build:coherence_fundamental_trait_lib.rs - -extern crate coherence_fundamental_trait_lib; - -use coherence_fundamental_trait_lib::{Fundamental, Misc}; - -pub struct Local; -impl Misc for dyn Fundamental {} -//~^ ERROR E0117 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-fundamental-trait-objects.stderr b/src/test/ui/coherence/coherence-fundamental-trait-objects.stderr deleted file mode 100644 index a35a95ef4..000000000 --- a/src/test/ui/coherence/coherence-fundamental-trait-objects.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-fundamental-trait-objects.rs:12:1 - | -LL | impl Misc for dyn Fundamental {} - | ^^^^^^^^^^^^^^---------------------- - | | | - | | `dyn Fundamental` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-impl-in-fn.rs b/src/test/ui/coherence/coherence-impl-in-fn.rs deleted file mode 100644 index b97197317..000000000 --- a/src/test/ui/coherence/coherence-impl-in-fn.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -#![allow(dead_code)] -#![allow(non_camel_case_types)] - -pub fn main() { - #[derive(Copy, Clone)] - enum x { foo } - impl ::std::cmp::PartialEq for x { - fn eq(&self, other: &x) -> bool { - (*self) as isize == (*other) as isize - } - fn ne(&self, other: &x) -> bool { !(*self).eq(other) } - } -} diff --git a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs deleted file mode 100644 index 50d9a480a..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![feature(auto_traits)] -#![feature(negative_impls)] - -// Test for issue #56934 - that it is impossible to redundantly -// implement an auto-trait for a trait object type that contains it. - -// Negative impl variant. - -auto trait Marker1 {} -auto trait Marker2 {} - -trait Object: Marker1 {} - -// A supertrait marker is illegal... -impl !Marker1 for dyn Object + Marker2 { } //~ ERROR E0371 -// ...and also a direct component. -impl !Marker2 for dyn Object + Marker2 { } //~ ERROR E0371 - -// But implementing a marker if it is not present is OK. -impl !Marker2 for dyn Object {} // OK - -// A non-principal trait-object type is orphan even in its crate. -impl !Send for dyn Marker2 {} //~ ERROR E0117 - -// And impl'ing a remote marker for a local trait object is forbidden -// by one of these special orphan-like rules. -impl !Send for dyn Object {} //~ ERROR E0321 -impl !Send for dyn Object + Marker2 {} //~ ERROR E0321 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr deleted file mode 100644 index c364c707f..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker1` - --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:15:1 - | -LL | impl !Marker1 for dyn Object + Marker2 { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker1` - -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker2` - --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:17:1 - | -LL | impl !Marker2 for dyn Object + Marker2 { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker2` - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:23:1 - | -LL | impl !Send for dyn Marker2 {} - | ^^^^^^^^^^^^^^^----------- - | | | - | | `dyn Marker2` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)` - --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:27:1 - | -LL | impl !Send for dyn Object {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type - -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + Marker2 + 'static)` - --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:28:1 - | -LL | impl !Send for dyn Object + Marker2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0117, E0321, E0371. -For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs deleted file mode 100644 index faac6d983..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.rs +++ /dev/null @@ -1,30 +0,0 @@ -#![feature(auto_traits)] -#![feature(negative_impls)] - -// Test for issue #56934 - that it is impossible to redundantly -// implement an auto-trait for a trait object type that contains it. - -// Positive impl variant. - -auto trait Marker1 {} -auto trait Marker2 {} - -trait Object: Marker1 {} - -// A supertrait marker is illegal... -impl Marker1 for dyn Object + Marker2 { } //~ ERROR E0371 -// ...and also a direct component. -impl Marker2 for dyn Object + Marker2 { } //~ ERROR E0371 - -// But implementing a marker if it is not present is OK. -impl Marker2 for dyn Object {} // OK - -// A non-principal trait-object type is orphan even in its crate. -unsafe impl Send for dyn Marker2 {} //~ ERROR E0117 - -// And impl'ing a remote marker for a local trait object is forbidden -// by one of these special orphan-like rules. -unsafe impl Send for dyn Object {} //~ ERROR E0321 -unsafe impl Send for dyn Object + Marker2 {} //~ ERROR E0321 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr b/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr deleted file mode 100644 index b80429794..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker1` - --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:15:1 - | -LL | impl Marker1 for dyn Object + Marker2 { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker1` - -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker2` - --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:17:1 - | -LL | impl Marker2 for dyn Object + Marker2 { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker2` - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:23:1 - | -LL | unsafe impl Send for dyn Marker2 {} - | ^^^^^^^^^^^^^^^^^^^^^----------- - | | | - | | `dyn Marker2` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)` - --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:27:1 - | -LL | unsafe impl Send for dyn Object {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type - -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + Marker2 + 'static)` - --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:28:1 - | -LL | unsafe impl Send for dyn Object + Marker2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0117, E0321, E0371. -For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs deleted file mode 100644 index 20ff87549..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs +++ /dev/null @@ -1,10 +0,0 @@ -// Test that we give suitable error messages when the user attempts to -// impl a trait `Trait` for its own object type. - -// If the trait is not object-safe, we give a more tailored message -// because we're such schnuckels: -trait NotObjectSafe { fn eq(&self, other: Self); } -impl NotObjectSafe for dyn NotObjectSafe { } -//~^ ERROR E0038 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr deleted file mode 100644 index e9090c1b6..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0038]: the trait `NotObjectSafe` cannot be made into an object - --> $DIR/coherence-impl-trait-for-trait-object-safe.rs:7:24 - | -LL | impl NotObjectSafe for dyn NotObjectSafe { } - | ^^^^^^^^^^^^^^^^^ `NotObjectSafe` cannot be made into an object - | -note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit - --> $DIR/coherence-impl-trait-for-trait-object-safe.rs:6:43 - | -LL | trait NotObjectSafe { fn eq(&self, other: Self); } - | ------------- ^^^^ ...because method `eq` references the `Self` type in this parameter - | | - | this trait cannot be made into an object... - = help: consider moving `eq` to another trait - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait.rs b/src/test/ui/coherence/coherence-impl-trait-for-trait.rs deleted file mode 100644 index 195a37f15..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-trait.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Test that we give suitable error messages when the user attempts to -// impl a trait `Trait` for its own object type. - -trait Foo { fn dummy(&self) { } } -trait Bar: Foo { } -trait Baz: Bar { } - -// Supertraits of Baz are not legal: -impl Foo for dyn Baz { } -//~^ ERROR E0371 -impl Bar for dyn Baz { } -//~^ ERROR E0371 -impl Baz for dyn Baz { } -//~^ ERROR E0371 - -// But other random traits are: -trait Other { } -impl Other for dyn Baz { } // OK, Other not a supertrait of Baz - -fn main() { } diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait.stderr deleted file mode 100644 index cf0b38c5b..000000000 --- a/src/test/ui/coherence/coherence-impl-trait-for-trait.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Foo` - --> $DIR/coherence-impl-trait-for-trait.rs:9:1 - | -LL | impl Foo for dyn Baz { } - | ^^^^^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Foo` - -error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Bar` - --> $DIR/coherence-impl-trait-for-trait.rs:11:1 - | -LL | impl Bar for dyn Baz { } - | ^^^^^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Bar` - -error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Baz` - --> $DIR/coherence-impl-trait-for-trait.rs:13:1 - | -LL | impl Baz for dyn Baz { } - | ^^^^^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Baz` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0371`. diff --git a/src/test/ui/coherence/coherence-impls-copy.rs b/src/test/ui/coherence/coherence-impls-copy.rs deleted file mode 100644 index 4204fecc3..000000000 --- a/src/test/ui/coherence/coherence-impls-copy.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![feature(negative_impls)] - -use std::marker::Copy; - -impl Copy for i32 {} -//~^ ERROR E0117 -enum TestE { - A -} - -struct MyType; - -struct NotSync; -impl !Sync for NotSync {} - -impl Copy for TestE {} -impl Clone for TestE { fn clone(&self) -> Self { *self } } - -impl Copy for MyType {} - -impl Copy for &'static mut MyType {} -//~^ ERROR E0206 -impl Clone for MyType { fn clone(&self) -> Self { *self } } - -impl Copy for (MyType, MyType) {} -//~^ ERROR E0206 -//~| ERROR E0117 -impl Copy for &'static NotSync {} -//~^ ERROR E0119 -impl Copy for [MyType] {} -//~^ ERROR E0206 -//~| ERROR E0117 -impl Copy for &'static [NotSync] {} -//~^ ERROR E0117 -fn main() { -} diff --git a/src/test/ui/coherence/coherence-impls-copy.stderr b/src/test/ui/coherence/coherence-impls-copy.stderr deleted file mode 100644 index d40ffc48a..000000000 --- a/src/test/ui/coherence/coherence-impls-copy.stderr +++ /dev/null @@ -1,76 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/coherence-impls-copy.rs:5:1 - | -LL | impl Copy for i32 {} - | ^^^^^^^^^^^^^^--- - | | | - | | `i32` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0119]: conflicting implementations of trait `Copy` for type `&NotSync` - --> $DIR/coherence-impls-copy.rs:28:1 - | -LL | impl Copy for &'static NotSync {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: conflicting implementation in crate `core`: - - impl Copy for &T - where T: ?Sized; - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-copy.rs:33:1 - | -LL | impl Copy for &'static [NotSync] {} - | ^^^^^^^^^^^^^^------------------ - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-copy.rs:25:1 - | -LL | impl Copy for (MyType, MyType) {} - | ^^^^^^^^^^^^^^---------------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-copy.rs:30:1 - | -LL | impl Copy for [MyType] {} - | ^^^^^^^^^^^^^^-------- - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0206]: the trait `Copy` may not be implemented for this type - --> $DIR/coherence-impls-copy.rs:21:15 - | -LL | impl Copy for &'static mut MyType {} - | ^^^^^^^^^^^^^^^^^^^ type is not a structure or enumeration - -error[E0206]: the trait `Copy` may not be implemented for this type - --> $DIR/coherence-impls-copy.rs:25:15 - | -LL | impl Copy for (MyType, MyType) {} - | ^^^^^^^^^^^^^^^^ type is not a structure or enumeration - -error[E0206]: the trait `Copy` may not be implemented for this type - --> $DIR/coherence-impls-copy.rs:30:15 - | -LL | impl Copy for [MyType] {} - | ^^^^^^^^ type is not a structure or enumeration - -error: aborting due to 8 previous errors - -Some errors have detailed explanations: E0117, E0119, E0206. -For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-impls-send.rs b/src/test/ui/coherence/coherence-impls-send.rs deleted file mode 100644 index b7b57c602..000000000 --- a/src/test/ui/coherence/coherence-impls-send.rs +++ /dev/null @@ -1,28 +0,0 @@ -#![feature(negative_impls)] - -use std::marker::Copy; - -enum TestE { - A, -} - -struct MyType; - -struct NotSync; -impl !Sync for NotSync {} - -unsafe impl Send for TestE {} -unsafe impl Send for MyType {} -unsafe impl Send for (MyType, MyType) {} -//~^ ERROR E0117 - -unsafe impl Send for &'static NotSync {} -//~^ ERROR E0321 - -unsafe impl Send for [MyType] {} -//~^ ERROR E0117 - -unsafe impl Send for &'static [NotSync] {} -//~^ ERROR only traits defined in the current crate - -fn main() {} diff --git a/src/test/ui/coherence/coherence-impls-send.stderr b/src/test/ui/coherence/coherence-impls-send.stderr deleted file mode 100644 index e1071846e..000000000 --- a/src/test/ui/coherence/coherence-impls-send.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-send.rs:25:1 - | -LL | unsafe impl Send for &'static [NotSync] {} - | ^^^^^^^^^^^^^^^^^^^^^------------------ - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-send.rs:16:1 - | -LL | unsafe impl Send for (MyType, MyType) {} - | ^^^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `&'static NotSync` - --> $DIR/coherence-impls-send.rs:19:1 - | -LL | unsafe impl Send for &'static NotSync {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-send.rs:22:1 - | -LL | unsafe impl Send for [MyType] {} - | ^^^^^^^^^^^^^^^^^^^^^-------- - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0117, E0321. -For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-impls-sized.rs b/src/test/ui/coherence/coherence-impls-sized.rs deleted file mode 100644 index 231b96ad4..000000000 --- a/src/test/ui/coherence/coherence-impls-sized.rs +++ /dev/null @@ -1,36 +0,0 @@ -#![feature(negative_impls)] - -use std::marker::Copy; - -enum TestE { - A -} - -struct MyType; - -struct NotSync; -impl !Sync for NotSync {} - -impl Sized for TestE {} -//~^ ERROR E0322 - -impl Sized for MyType {} -//~^ ERROR E0322 - -impl Sized for (MyType, MyType) {} -//~^ ERROR E0322 -//~| ERROR E0117 - -impl Sized for &'static NotSync {} -//~^ ERROR E0322 - -impl Sized for [MyType] {} -//~^ ERROR E0322 -//~| ERROR E0117 - -impl Sized for &'static [NotSync] {} -//~^ ERROR E0322 -//~| ERROR E0117 - -fn main() { -} diff --git a/src/test/ui/coherence/coherence-impls-sized.stderr b/src/test/ui/coherence/coherence-impls-sized.stderr deleted file mode 100644 index 17a754452..000000000 --- a/src/test/ui/coherence/coherence-impls-sized.stderr +++ /dev/null @@ -1,73 +0,0 @@ -error[E0322]: explicit impls for the `Sized` trait are not permitted - --> $DIR/coherence-impls-sized.rs:14:1 - | -LL | impl Sized for TestE {} - | ^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed - -error[E0322]: explicit impls for the `Sized` trait are not permitted - --> $DIR/coherence-impls-sized.rs:17:1 - | -LL | impl Sized for MyType {} - | ^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed - -error[E0322]: explicit impls for the `Sized` trait are not permitted - --> $DIR/coherence-impls-sized.rs:20:1 - | -LL | impl Sized for (MyType, MyType) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-sized.rs:20:1 - | -LL | impl Sized for (MyType, MyType) {} - | ^^^^^^^^^^^^^^^---------------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0322]: explicit impls for the `Sized` trait are not permitted - --> $DIR/coherence-impls-sized.rs:24:1 - | -LL | impl Sized for &'static NotSync {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed - -error[E0322]: explicit impls for the `Sized` trait are not permitted - --> $DIR/coherence-impls-sized.rs:27:1 - | -LL | impl Sized for [MyType] {} - | ^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-sized.rs:27:1 - | -LL | impl Sized for [MyType] {} - | ^^^^^^^^^^^^^^^-------- - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0322]: explicit impls for the `Sized` trait are not permitted - --> $DIR/coherence-impls-sized.rs:31:1 - | -LL | impl Sized for &'static [NotSync] {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of `Sized` not allowed - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-impls-sized.rs:31:1 - | -LL | impl Sized for &'static [NotSync] {} - | ^^^^^^^^^^^^^^^------------------ - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 9 previous errors - -Some errors have detailed explanations: E0117, E0322. -For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs deleted file mode 100644 index d74d3a2a5..000000000 --- a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Formerly this ICEd with the following message: -// Tried to project an inherited associated type during coherence checking, -// which is currently not supported. -// -// No we expect to run into a more user-friendly cycle error instead. -#![feature(specialization)] -//~^ WARN the feature `specialization` is incomplete - -trait Trait { type Assoc; } -//~^ ERROR E0391 - -impl Trait for Vec { - type Assoc = (); -} - -impl Trait for Vec {} - -impl Trait for String { - type Assoc = (); -} - -impl Trait< as Trait>::Assoc> for String {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr deleted file mode 100644 index 7bd50649d..000000000 --- a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr +++ /dev/null @@ -1,26 +0,0 @@ -warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes - --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:6:12 - | -LL | #![feature(specialization)] - | ^^^^^^^^^^^^^^ - | - = note: see issue #31844 for more information - = help: consider using `min_specialization` instead, which is more stable and complete - = note: `#[warn(incomplete_features)]` on by default - -error[E0391]: cycle detected when building specialization graph of trait `Trait` - --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1 - | -LL | trait Trait { type Assoc; } - | ^^^^^^^^^^^^^^ - | - = note: ...which immediately requires building specialization graph of trait `Trait` again -note: cycle used when coherence checking all impls of trait `Trait` - --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1 - | -LL | trait Trait { type Assoc; } - | ^^^^^^^^^^^^^^ - -error: aborting due to previous error; 1 warning emitted - -For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/ui/coherence/coherence-inherited-subtyping.old.stderr b/src/test/ui/coherence/coherence-inherited-subtyping.old.stderr deleted file mode 100644 index 4701bc0b1..000000000 --- a/src/test/ui/coherence/coherence-inherited-subtyping.old.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0592]: duplicate definitions with name `method1` - --> $DIR/coherence-inherited-subtyping.rs:14:5 - | -LL | fn method1(&self) {} - | ^^^^^^^^^^^^^^^^^ duplicate definitions for `method1` -... -LL | fn method1(&self) {} - | ----------------- other definition for `method1` - | - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/coherence/coherence-inherited-subtyping.re.stderr b/src/test/ui/coherence/coherence-inherited-subtyping.re.stderr deleted file mode 100644 index 4701bc0b1..000000000 --- a/src/test/ui/coherence/coherence-inherited-subtyping.re.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0592]: duplicate definitions with name `method1` - --> $DIR/coherence-inherited-subtyping.rs:14:5 - | -LL | fn method1(&self) {} - | ^^^^^^^^^^^^^^^^^ duplicate definitions for `method1` -... -LL | fn method1(&self) {} - | ----------------- other definition for `method1` - | - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/coherence/coherence-inherited-subtyping.rs b/src/test/ui/coherence/coherence-inherited-subtyping.rs deleted file mode 100644 index 8587eb779..000000000 --- a/src/test/ui/coherence/coherence-inherited-subtyping.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Test that two distinct impls which match subtypes of one another -// yield coherence errors (or not) depending on the variance. -// -// Note: This scenario is currently accepted, but as part of the -// universe transition (#56105) may eventually become an error. - -// revisions: old re - -struct Foo { - t: T, -} - -impl Foo fn(&'a u8, &'b u8) -> &'a u8> { - fn method1(&self) {} //~ ERROR duplicate definitions with name `method1` -} - -impl Foo fn(&'a u8, &'a u8) -> &'a u8> { - fn method1(&self) {} -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-iterator-vec-any-elem.rs b/src/test/ui/coherence/coherence-iterator-vec-any-elem.rs deleted file mode 100644 index 43a0a5c42..000000000 --- a/src/test/ui/coherence/coherence-iterator-vec-any-elem.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -#![allow(dead_code)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -struct Foo(T); - -impl Remote1 for Foo { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence-iterator-vec.rs b/src/test/ui/coherence/coherence-iterator-vec.rs deleted file mode 100644 index 386fe40ac..000000000 --- a/src/test/ui/coherence/coherence-iterator-vec.rs +++ /dev/null @@ -1,14 +0,0 @@ -// run-pass -#![allow(dead_code)] -// aux-build:coherence_lib.rs - -// pretty-expanded FIXME #23616 - -extern crate coherence_lib as lib; -use lib::Remote1; - -struct Foo(T); - -impl Remote1 for Foo { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence-lone-type-parameter.rs b/src/test/ui/coherence/coherence-lone-type-parameter.rs deleted file mode 100644 index 5368fef76..000000000 --- a/src/test/ui/coherence/coherence-lone-type-parameter.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::Remote; - -impl Remote for T { } -//~^ ERROR E0210 - - -fn main() { } diff --git a/src/test/ui/coherence/coherence-lone-type-parameter.stderr b/src/test/ui/coherence/coherence-lone-type-parameter.stderr deleted file mode 100644 index ef5b08836..000000000 --- a/src/test/ui/coherence/coherence-lone-type-parameter.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/coherence-lone-type-parameter.rs:6:6 - | -LL | impl Remote for T { } - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/coherence-multidispatch-tuple.rs b/src/test/ui/coherence/coherence-multidispatch-tuple.rs deleted file mode 100644 index fa1d4bbb4..000000000 --- a/src/test/ui/coherence/coherence-multidispatch-tuple.rs +++ /dev/null @@ -1,24 +0,0 @@ -// run-pass -#![allow(unused_imports)] -// pretty-expanded FIXME #23616 - -use std::fmt::Debug; -use std::default::Default; - -// Test that an impl for homogeneous pairs does not conflict with a -// heterogeneous pair. - -trait MyTrait { - fn get(&self) -> usize; -} - -impl MyTrait for (T,T) { - fn get(&self) -> usize { 0 } -} - -impl MyTrait for (usize,isize) { - fn get(&self) -> usize { 0 } -} - -fn main() { -} diff --git a/src/test/ui/coherence/coherence-negative-impls-copy-bad.rs b/src/test/ui/coherence/coherence-negative-impls-copy-bad.rs deleted file mode 100644 index 563f28e22..000000000 --- a/src/test/ui/coherence/coherence-negative-impls-copy-bad.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(negative_impls)] -#![crate_type = "lib"] - -impl !Copy for str {} -//~^ ERROR only traits defined in the current crate can be implemented - -impl !Copy for fn() {} -//~^ ERROR only traits defined in the current crate can be implemented - -impl !Copy for () {} -//~^ ERROR only traits defined in the current crate can be implemented diff --git a/src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr b/src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr deleted file mode 100644 index 2295d6315..000000000 --- a/src/test/ui/coherence/coherence-negative-impls-copy-bad.stderr +++ /dev/null @@ -1,36 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-negative-impls-copy-bad.rs:4:1 - | -LL | impl !Copy for str {} - | ^^^^^^^^^^^^^^^--- - | | | - | | `str` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-negative-impls-copy-bad.rs:7:1 - | -LL | impl !Copy for fn() {} - | ^^^^^^^^^^^^^^^---- - | | | - | | `fn()` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence-negative-impls-copy-bad.rs:10:1 - | -LL | impl !Copy for () {} - | ^^^^^^^^^^^^^^^-- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-negative-impls-copy.rs b/src/test/ui/coherence/coherence-negative-impls-copy.rs deleted file mode 100644 index 7b29aade4..000000000 --- a/src/test/ui/coherence/coherence-negative-impls-copy.rs +++ /dev/null @@ -1,29 +0,0 @@ -// check-pass -// regression test for issue #101836 - -#![feature(negative_impls, extern_types)] -#![crate_type = "lib"] - -struct NonCopy; -struct NeverCopy(NonCopy); - -impl !Copy for NeverCopy {} - - -struct WithDrop; -impl Drop for WithDrop { fn drop(&mut self) {} } - -impl !Copy for WithDrop {} - - -struct Type; -trait Trait {} -extern { - type ExternType; -} - -impl !Copy for &mut Type {} - -impl !Copy for dyn Trait {} - -impl !Copy for ExternType {} diff --git a/src/test/ui/coherence/coherence-negative-impls-safe-rpass.rs b/src/test/ui/coherence/coherence-negative-impls-safe-rpass.rs deleted file mode 100644 index b87e162ac..000000000 --- a/src/test/ui/coherence/coherence-negative-impls-safe-rpass.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass -#![allow(dead_code)] -// pretty-expanded FIXME #23616 - -#![feature(negative_impls)] - -use std::marker::Send; - -struct TestType; - -impl !Send for TestType {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-negative-impls-safe.rs b/src/test/ui/coherence/coherence-negative-impls-safe.rs deleted file mode 100644 index 4821aa6b5..000000000 --- a/src/test/ui/coherence/coherence-negative-impls-safe.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(negative_impls)] - -use std::marker::Send; - -struct TestType; - -unsafe impl !Send for TestType {} -//~^ ERROR E0198 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-negative-impls-safe.stderr b/src/test/ui/coherence/coherence-negative-impls-safe.stderr deleted file mode 100644 index 1bd37f395..000000000 --- a/src/test/ui/coherence/coherence-negative-impls-safe.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0198]: negative impls cannot be unsafe - --> $DIR/coherence-negative-impls-safe.rs:7:13 - | -LL | unsafe impl !Send for TestType {} - | ------ -^^^^ - | | | - | | negative because of this - | unsafe because of this - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0198`. diff --git a/src/test/ui/coherence/coherence-negative-inherent-where-bounds.rs b/src/test/ui/coherence/coherence-negative-inherent-where-bounds.rs deleted file mode 100644 index 39ccaa6ac..000000000 --- a/src/test/ui/coherence/coherence-negative-inherent-where-bounds.rs +++ /dev/null @@ -1,25 +0,0 @@ -// check-pass - -#![feature(negative_impls)] -#![feature(rustc_attrs)] -#![feature(with_negative_coherence)] - -trait Foo {} - -impl !Foo for u32 {} - -#[rustc_strict_coherence] -struct MyStruct(T); - -impl MyStruct { - fn method(&self) {} -} - -impl MyStruct -where - T: Foo, -{ - fn method(&self) {} -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-negative-inherent.rs b/src/test/ui/coherence/coherence-negative-inherent.rs deleted file mode 100644 index a9e1acc80..000000000 --- a/src/test/ui/coherence/coherence-negative-inherent.rs +++ /dev/null @@ -1,22 +0,0 @@ -// check-pass - -#![feature(negative_impls)] -#![feature(rustc_attrs)] -#![feature(with_negative_coherence)] - -#[rustc_strict_coherence] -trait Foo {} - -impl !Foo for u32 {} - -struct MyStruct(T); - -impl MyStruct { - fn method(&self) {} -} - -impl MyStruct { - fn method(&self) {} -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs deleted file mode 100644 index 3acf0d8d3..000000000 --- a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs +++ /dev/null @@ -1,17 +0,0 @@ -// revisions: stock with_negative_coherence -//[with_negative_coherence] check-pass - -#![feature(negative_impls)] -#![cfg_attr(with_negative_coherence, feature(with_negative_coherence))] - -trait MyPredicate<'a> {} - -impl<'a, T> !MyPredicate<'a> for &'a T where T: 'a {} - -trait MyTrait<'a> {} - -impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} -impl<'a, T> MyTrait<'a> for &'a T {} -//[stock]~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_` - -fn main() {} diff --git a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.stock.stderr b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.stock.stderr deleted file mode 100644 index 097cc4e0f..000000000 --- a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.stock.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait<'_>` for type `&_` - --> $DIR/coherence-negative-outlives-lifetimes.rs:14:1 - | -LL | impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} - | ---------------------------------------------- first implementation here -LL | impl<'a, T> MyTrait<'a> for &'a T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs deleted file mode 100644 index d466dcac1..000000000 --- a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs +++ /dev/null @@ -1,9 +0,0 @@ -// Test that you cannot *directly* dispatch on lifetime requirements - -trait MyTrait { fn foo() {} } - -impl MyTrait for T {} -impl MyTrait for T {} -//~^ ERROR E0119 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr deleted file mode 100644 index 8a43ad7b7..000000000 --- a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` - --> $DIR/coherence-no-direct-lifetime-dispatch.rs:6:1 - | -LL | impl MyTrait for T {} - | --------------------- first implementation here -LL | impl MyTrait for T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-orphan.rs b/src/test/ui/coherence/coherence-orphan.rs deleted file mode 100644 index 3beac04c7..000000000 --- a/src/test/ui/coherence/coherence-orphan.rs +++ /dev/null @@ -1,20 +0,0 @@ -// aux-build:coherence_orphan_lib.rs -#![feature(negative_impls)] - -extern crate coherence_orphan_lib as lib; - -use lib::TheTrait; - -struct TheType; - -impl TheTrait for isize { } -//~^ ERROR E0117 - -impl TheTrait for isize { } - -impl TheTrait for TheType { } - -impl !Send for Vec { } -//~^ ERROR E0117 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-orphan.stderr b/src/test/ui/coherence/coherence-orphan.stderr deleted file mode 100644 index 01f166a21..000000000 --- a/src/test/ui/coherence/coherence-orphan.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/coherence-orphan.rs:10:1 - | -LL | impl TheTrait for isize { } - | ^^^^^---------------^^^^^----- - | | | | - | | | `isize` is not defined in the current crate - | | `usize` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-orphan.rs:17:1 - | -LL | impl !Send for Vec { } - | ^^^^^^^^^^^^^^^---------- - | | | - | | `Vec` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs deleted file mode 100644 index 574a16a19..000000000 --- a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Check that we detect an overlap here in the case where: -// -// for some type X: -// T = (X,) -// T11 = X, U11 = X -// -// Seems pretty basic, but then there was issue #24241. :) - -trait From { - fn foo() {} -} - -impl From for T { -} - -impl From<(U11,)> for (T11,) { -//~^ ERROR E0119 -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr deleted file mode 100644 index 6a0880334..000000000 --- a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)` - --> $DIR/coherence-overlap-all-t-and-tuple.rs:16:1 - | -LL | impl From for T { - | ---------------------- first implementation here -... -LL | impl From<(U11,)> for (T11,) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_,)` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-overlap-double-negative.rs b/src/test/ui/coherence/coherence-overlap-double-negative.rs deleted file mode 100644 index 1ea0ddc74..000000000 --- a/src/test/ui/coherence/coherence-overlap-double-negative.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass - -#![feature(negative_impls)] -#![feature(with_negative_coherence)] - -trait A {} -trait B: A {} - -impl !A for u32 {} -impl !B for u32 {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs b/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs deleted file mode 100644 index 5dea33e33..000000000 --- a/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Tests that we consider `T: Sugar + Fruit` to be ambiguous, even -// though no impls are found. - -struct Sweet(X); -pub trait Sugar {} -pub trait Fruit {} -impl Sweet { fn dummy(&self) { } } -//~^ ERROR E0592 -impl Sweet { fn dummy(&self) { } } - -trait Bar {} -struct A(T, X); -impl A where T: Bar { fn f(&self) {} } -//~^ ERROR E0592 -impl A { fn f(&self) {} } - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr b/src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr deleted file mode 100644 index bbce4b530..000000000 --- a/src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0592]: duplicate definitions with name `dummy` - --> $DIR/coherence-overlap-downstream-inherent.rs:7:26 - | -LL | impl Sweet { fn dummy(&self) { } } - | ^^^^^^^^^^^^^^^ duplicate definitions for `dummy` -LL | -LL | impl Sweet { fn dummy(&self) { } } - | --------------- other definition for `dummy` - -error[E0592]: duplicate definitions with name `f` - --> $DIR/coherence-overlap-downstream-inherent.rs:13:38 - | -LL | impl A where T: Bar { fn f(&self) {} } - | ^^^^^^^^^^^ duplicate definitions for `f` -LL | -LL | impl A { fn f(&self) {} } - | ----------- other definition for `f` - | - = note: downstream crates may implement trait `Bar<_>` for type `i32` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/coherence/coherence-overlap-downstream.rs b/src/test/ui/coherence/coherence-overlap-downstream.rs deleted file mode 100644 index 738ec0e3d..000000000 --- a/src/test/ui/coherence/coherence-overlap-downstream.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Tests that we consider `T: Sugar + Fruit` to be ambiguous, even -// though no impls are found. - -pub trait Sugar {} -pub trait Fruit {} -pub trait Sweet {} -impl Sweet for T { } -impl Sweet for T { } -//~^ ERROR E0119 - -pub trait Foo {} -pub trait Bar {} -impl Foo for T where T: Bar {} -impl Foo for i32 {} -//~^ ERROR E0119 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-overlap-downstream.stderr b/src/test/ui/coherence/coherence-overlap-downstream.stderr deleted file mode 100644 index 7f373e595..000000000 --- a/src/test/ui/coherence/coherence-overlap-downstream.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0119]: conflicting implementations of trait `Sweet` - --> $DIR/coherence-overlap-downstream.rs:8:1 - | -LL | impl Sweet for T { } - | ------------------------- first implementation here -LL | impl Sweet for T { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32` - --> $DIR/coherence-overlap-downstream.rs:14:1 - | -LL | impl Foo for T where T: Bar {} - | ----------------------- first implementation here -LL | impl Foo for i32 {} - | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32` - | - = note: downstream crates may implement trait `Bar<_>` for type `i32` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs deleted file mode 100644 index a272e620f..000000000 --- a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Tests that we consider `Box: !Sugar` to be ambiguous, even -// though we see no impl of `Sugar` for `Box`. Therefore, an overlap -// error is reported for the following pair of impls (#23516). - -pub trait Sugar {} - -struct Cake(X); - -impl Cake { fn dummy(&self) { } } -//~^ ERROR E0592 -impl Cake> { fn dummy(&self) { } } - -fn main() { } diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr deleted file mode 100644 index 3ad818cbc..000000000 --- a/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0592]: duplicate definitions with name `dummy` - --> $DIR/coherence-overlap-issue-23516-inherent.rs:9:25 - | -LL | impl Cake { fn dummy(&self) { } } - | ^^^^^^^^^^^^^^^ duplicate definitions for `dummy` -LL | -LL | impl Cake> { fn dummy(&self) { } } - | --------------- other definition for `dummy` - | - = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516.rs b/src/test/ui/coherence/coherence-overlap-issue-23516.rs deleted file mode 100644 index 63e42e8f4..000000000 --- a/src/test/ui/coherence/coherence-overlap-issue-23516.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Tests that we consider `Box: !Sugar` to be ambiguous, even -// though we see no impl of `Sugar` for `Box`. Therefore, an overlap -// error is reported for the following pair of impls (#23516). - -pub trait Sugar { fn dummy(&self) { } } -pub trait Sweet { fn dummy(&self) { } } -impl Sweet for T { } -impl Sweet for Box { } -//~^ ERROR E0119 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516.stderr deleted file mode 100644 index cd3984267..000000000 --- a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0119]: conflicting implementations of trait `Sweet` for type `Box<_>` - --> $DIR/coherence-overlap-issue-23516.rs:8:1 - | -LL | impl Sweet for T { } - | ------------------------- first implementation here -LL | impl Sweet for Box { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Box<_>` - | - = note: downstream crates may implement trait `Sugar` for type `std::boxed::Box<_>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-overlap-messages.rs b/src/test/ui/coherence/coherence-overlap-messages.rs deleted file mode 100644 index 1258a2371..000000000 --- a/src/test/ui/coherence/coherence-overlap-messages.rs +++ /dev/null @@ -1,28 +0,0 @@ -trait Foo { fn foo() {} } - -impl Foo for T {} -impl Foo for U {} -//~^ ERROR E0119 - - -trait Bar { fn bar() {} } - -impl Bar for (T, u8) {} -impl Bar for (u8, T) {} -//~^ ERROR E0119 - -trait Baz { fn baz() {} } - -impl Baz for T {} -impl Baz for u8 {} -//~^ ERROR E0119 - -trait Quux { fn quux() {} } - -impl Quux for T {} -impl Quux for T {} -//~^ ERROR E0119 -impl Quux for T {} -//~^ ERROR E0119 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-messages.stderr b/src/test/ui/coherence/coherence-overlap-messages.stderr deleted file mode 100644 index 5a97296ee..000000000 --- a/src/test/ui/coherence/coherence-overlap-messages.stderr +++ /dev/null @@ -1,44 +0,0 @@ -error[E0119]: conflicting implementations of trait `Foo` - --> $DIR/coherence-overlap-messages.rs:4:1 - | -LL | impl Foo for T {} - | ----------------- first implementation here -LL | impl Foo for U {} - | ^^^^^^^^^^^^^^^^^ conflicting implementation - -error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)` - --> $DIR/coherence-overlap-messages.rs:11:1 - | -LL | impl Bar for (T, u8) {} - | ----------------------- first implementation here -LL | impl Bar for (u8, T) {} - | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)` - -error[E0119]: conflicting implementations of trait `Baz` for type `u8` - --> $DIR/coherence-overlap-messages.rs:17:1 - | -LL | impl Baz for T {} - | --------------------- first implementation here -LL | impl Baz for u8 {} - | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8` - -error[E0119]: conflicting implementations of trait `Quux<_, _>` - --> $DIR/coherence-overlap-messages.rs:23:1 - | -LL | impl Quux for T {} - | ------------------------------ first implementation here -LL | impl Quux for T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error[E0119]: conflicting implementations of trait `Quux<_, _>` - --> $DIR/coherence-overlap-messages.rs:25:1 - | -LL | impl Quux for T {} - | ------------------------------ first implementation here -... -LL | impl Quux for T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs b/src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs deleted file mode 100644 index 48dffc921..000000000 --- a/src/test/ui/coherence/coherence-overlap-negate-alias-strict.rs +++ /dev/null @@ -1,19 +0,0 @@ -// check-pass - -#![feature(negative_impls)] -#![feature(rustc_attrs)] -#![feature(trait_alias)] -#![feature(with_negative_coherence)] - -trait A {} -trait B {} -trait AB = A + B; - -impl !A for u32 {} - -#[rustc_strict_coherence] -trait C {} -impl C for T {} -impl C for u32 {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs b/src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs deleted file mode 100644 index a067736f6..000000000 --- a/src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::ops::DerefMut; - -trait Foo {} -impl Foo for T {} -impl Foo for &U {} -//~^ ERROR: conflicting implementations of trait `Foo` for type `&_` [E0119] - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.stderr b/src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.stderr deleted file mode 100644 index 4b55001ec..000000000 --- a/src/test/ui/coherence/coherence-overlap-negate-not-use-feature-gate.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `&_` - --> $DIR/coherence-overlap-negate-not-use-feature-gate.rs:5:1 - | -LL | impl Foo for T {} - | --------------------------- first implementation here -LL | impl Foo for &U {} - | ^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-overlap-negate-strict.rs b/src/test/ui/coherence/coherence-overlap-negate-strict.rs deleted file mode 100644 index 1021d87ca..000000000 --- a/src/test/ui/coherence/coherence-overlap-negate-strict.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass - -#![feature(negative_impls)] -#![feature(rustc_attrs)] -#![feature(trait_alias)] -#![feature(with_negative_coherence)] - -trait A {} -trait B {} - -impl !A for u32 {} - -#[rustc_strict_coherence] -trait C {} -impl C for T {} -impl C for u32 {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-negate-use-feature-gate.rs b/src/test/ui/coherence/coherence-overlap-negate-use-feature-gate.rs deleted file mode 100644 index a0dd881d1..000000000 --- a/src/test/ui/coherence/coherence-overlap-negate-use-feature-gate.rs +++ /dev/null @@ -1,11 +0,0 @@ -// check-pass - -#![feature(with_negative_coherence)] - -use std::ops::DerefMut; - -trait Foo {} -impl Foo for T {} -impl Foo for &U {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-negative-trait.rs b/src/test/ui/coherence/coherence-overlap-negative-trait.rs deleted file mode 100644 index 8059d23ff..000000000 --- a/src/test/ui/coherence/coherence-overlap-negative-trait.rs +++ /dev/null @@ -1,16 +0,0 @@ -// check-pass -// aux-build:error_lib.rs -// -// Check that if we promise to not impl what would overlap it doesn't actually overlap - -#![feature(with_negative_coherence)] - -extern crate error_lib as lib; -use lib::Error; - -trait From {} - -impl From<&str> for Box {} -impl From for Box where E: Error {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-negative-trait2.rs b/src/test/ui/coherence/coherence-overlap-negative-trait2.rs deleted file mode 100644 index cc8c463b8..000000000 --- a/src/test/ui/coherence/coherence-overlap-negative-trait2.rs +++ /dev/null @@ -1,17 +0,0 @@ -// check-pass -// aux-build:option_future.rs -// -// Check that if we promise to not impl what would overlap it doesn't actually overlap - -#![feature(rustc_attrs)] -#![feature(with_negative_coherence)] - -extern crate option_future as lib; -use lib::Future; - -trait Termination {} - -impl Termination for Option where E: Sized {} -impl Termination for F where F: Future + Sized {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-super-negative.rs b/src/test/ui/coherence/coherence-overlap-super-negative.rs deleted file mode 100644 index d296a094a..000000000 --- a/src/test/ui/coherence/coherence-overlap-super-negative.rs +++ /dev/null @@ -1,18 +0,0 @@ -// check-pass - -#![feature(negative_impls)] -#![feature(rustc_attrs)] -#![feature(with_negative_coherence)] - -trait Trait1: Trait2 {} -trait Trait2 {} - -struct MyType {} -impl !Trait2 for MyType {} - -#[rustc_strict_coherence] -trait Foo {} -impl Foo for T {} -impl Foo for MyType {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-trait-alias.rs b/src/test/ui/coherence/coherence-overlap-trait-alias.rs deleted file mode 100644 index 9d9c76af9..000000000 --- a/src/test/ui/coherence/coherence-overlap-trait-alias.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![feature(rustc_attrs)] -#![feature(trait_alias)] -#![feature(with_negative_coherence)] - -trait A {} -trait B {} -trait AB = A + B; - -impl A for u32 {} -impl B for u32 {} - -#[rustc_strict_coherence] -trait C {} -impl C for T {} -impl C for u32 {} -//~^ ERROR -// FIXME it's giving an ungreat error but unsure if we care given that it's using an internal rustc -// attribute and an artificial code path for testing purposes - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-trait-alias.stderr b/src/test/ui/coherence/coherence-overlap-trait-alias.stderr deleted file mode 100644 index e324c1e79..000000000 --- a/src/test/ui/coherence/coherence-overlap-trait-alias.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0283]: type annotations needed: cannot satisfy `u32: C` - --> $DIR/coherence-overlap-trait-alias.rs:15:6 - | -LL | impl C for u32 {} - | ^ - | -note: multiple `impl`s satisfying `u32: C` found - --> $DIR/coherence-overlap-trait-alias.rs:14:1 - | -LL | impl C for T {} - | ^^^^^^^^^^^^^^^^^^^ -LL | impl C for u32 {} - | ^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs b/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs deleted file mode 100644 index 082d753de..000000000 --- a/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Tests that we consider `i16: Remote` to be ambiguous, even -// though the upstream crate doesn't implement it for now. - -// aux-build:coherence_lib.rs - - -extern crate coherence_lib; - -use coherence_lib::Remote; - -struct A(X); -impl A where T: Remote { fn dummy(&self) { } } -//~^ ERROR E0592 -impl A { fn dummy(&self) { } } - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr b/src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr deleted file mode 100644 index f355c6e85..000000000 --- a/src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0592]: duplicate definitions with name `dummy` - --> $DIR/coherence-overlap-upstream-inherent.rs:12:32 - | -LL | impl A where T: Remote { fn dummy(&self) { } } - | ^^^^^^^^^^^^^^^ duplicate definitions for `dummy` -LL | -LL | impl A { fn dummy(&self) { } } - | --------------- other definition for `dummy` - | - = note: upstream crates may add a new impl of trait `coherence_lib::Remote` for type `i16` in future versions - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/coherence/coherence-overlap-upstream.rs b/src/test/ui/coherence/coherence-overlap-upstream.rs deleted file mode 100644 index 8f1e6558b..000000000 --- a/src/test/ui/coherence/coherence-overlap-upstream.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Tests that we consider `i16: Remote` to be ambiguous, even -// though the upstream crate doesn't implement it for now. - -// aux-build:coherence_lib.rs - - -extern crate coherence_lib; - -use coherence_lib::Remote; - -trait Foo {} -impl Foo for T where T: Remote {} -impl Foo for i16 {} -//~^ ERROR E0119 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlap-upstream.stderr b/src/test/ui/coherence/coherence-overlap-upstream.stderr deleted file mode 100644 index f6145c188..000000000 --- a/src/test/ui/coherence/coherence-overlap-upstream.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `i16` - --> $DIR/coherence-overlap-upstream.rs:13:1 - | -LL | impl Foo for T where T: Remote {} - | ----------------- first implementation here -LL | impl Foo for i16 {} - | ^^^^^^^^^^^^^^^^ conflicting implementation for `i16` - | - = note: upstream crates may add a new impl of trait `coherence_lib::Remote` for type `i16` in future versions - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-overlap-with-regions.rs b/src/test/ui/coherence/coherence-overlap-with-regions.rs deleted file mode 100644 index 32f01f418..000000000 --- a/src/test/ui/coherence/coherence-overlap-with-regions.rs +++ /dev/null @@ -1,16 +0,0 @@ -// check-pass - -#![feature(negative_impls)] -#![feature(rustc_attrs)] -#![feature(with_negative_coherence)] - -#[rustc_strict_coherence] -trait Foo {} -impl !Foo for &T where T: 'static {} - -#[rustc_strict_coherence] -trait Bar {} -impl Bar for T {} -impl Bar for &T where T: 'static {} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-overlapping-pairs.rs b/src/test/ui/coherence/coherence-overlapping-pairs.rs deleted file mode 100644 index d5d18217b..000000000 --- a/src/test/ui/coherence/coherence-overlapping-pairs.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::Remote; - -struct Foo; - -impl Remote for lib::Pair { } -//~^ ERROR E0117 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-overlapping-pairs.stderr b/src/test/ui/coherence/coherence-overlapping-pairs.stderr deleted file mode 100644 index 15c92dfeb..000000000 --- a/src/test/ui/coherence/coherence-overlapping-pairs.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-overlapping-pairs.rs:8:1 - | -LL | impl Remote for lib::Pair { } - | ^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs deleted file mode 100644 index 15868ca86..000000000 --- a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Test that the same coverage rules apply even if the local type appears in the -// list of type parameters, not the self type. - -// aux-build:coherence_lib.rs - - -extern crate coherence_lib as lib; -use lib::{Remote1, Pair}; - -pub struct Local(T); - -impl Remote1>> for i32 { } -//~^ ERROR E0117 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr deleted file mode 100644 index 03d787123..000000000 --- a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/coherence-pair-covered-uncovered-1.rs:12:1 - | -LL | impl Remote1>> for i32 { } - | ^^^^^^^^^^^--------------------------^^^^^--- - | | | | - | | | `i32` is not defined in the current crate - | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered.rs b/src/test/ui/coherence/coherence-pair-covered-uncovered.rs deleted file mode 100644 index da970572f..000000000 --- a/src/test/ui/coherence/coherence-pair-covered-uncovered.rs +++ /dev/null @@ -1,11 +0,0 @@ -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::{Remote, Pair}; - -struct Local(T); - -impl Remote for Pair> { } -//~^ ERROR E0117 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered.stderr deleted file mode 100644 index 73dfe2f57..000000000 --- a/src/test/ui/coherence/coherence-pair-covered-uncovered.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-pair-covered-uncovered.rs:8:1 - | -LL | impl Remote for Pair> { } - | ^^^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.rs b/src/test/ui/coherence/coherence-projection-conflict-orphan.rs deleted file mode 100644 index 637dd2506..000000000 --- a/src/test/ui/coherence/coherence-projection-conflict-orphan.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![feature(rustc_attrs)] - -// Here we expect a coherence conflict because, even though `i32` does -// not implement `Iterator`, we cannot rely on that negative reasoning -// due to the orphan rules. Therefore, `A::Item` may yet turn out to -// be `i32`. - -pub trait Foo

{ fn foo() {} } - -pub trait Bar { - type Output: 'static; -} - -impl Foo for i32 { } - -impl Foo for A { } -//~^ ERROR E0119 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr deleted file mode 100644 index b1ee0795b..000000000 --- a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `i32` - --> $DIR/coherence-projection-conflict-orphan.rs:16:1 - | -LL | impl Foo for i32 { } - | --------------------- first implementation here -LL | -LL | impl Foo for A { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32` - | - = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `i32` in future versions - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.rs b/src/test/ui/coherence/coherence-projection-conflict-ty-param.rs deleted file mode 100644 index 3e4141fa8..000000000 --- a/src/test/ui/coherence/coherence-projection-conflict-ty-param.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Coherence error results because we do not know whether `T: Foo

` or not -// for the second impl. - -use std::marker::PhantomData; - -pub trait Foo

{ fn foo() {} } - -impl > Foo

for Option {} - -impl Foo for Option { } -//~^ ERROR E0119 - -fn main() {} diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr b/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr deleted file mode 100644 index 94d242eaa..000000000 --- a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `Foo<_>` for type `Option<_>` - --> $DIR/coherence-projection-conflict-ty-param.rs:10:1 - | -LL | impl > Foo

for Option {} - | ---------------------------------------- first implementation here -LL | -LL | impl Foo for Option { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Option<_>` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-projection-conflict.rs b/src/test/ui/coherence/coherence-projection-conflict.rs deleted file mode 100644 index daab2a2f8..000000000 --- a/src/test/ui/coherence/coherence-projection-conflict.rs +++ /dev/null @@ -1,18 +0,0 @@ -use std::marker::PhantomData; - -pub trait Foo

{ fn foo() {} } - -pub trait Bar { - type Output: 'static; -} - -impl Foo for i32 { } - -impl Foo for A { } -//~^ ERROR E0119 - -impl Bar for i32 { - type Output = i32; -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-projection-conflict.stderr b/src/test/ui/coherence/coherence-projection-conflict.stderr deleted file mode 100644 index 7d2c584c3..000000000 --- a/src/test/ui/coherence/coherence-projection-conflict.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `i32` - --> $DIR/coherence-projection-conflict.rs:11:1 - | -LL | impl Foo for i32 { } - | --------------------- first implementation here -LL | -LL | impl Foo for A { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-projection-ok-orphan.rs b/src/test/ui/coherence/coherence-projection-ok-orphan.rs deleted file mode 100644 index 42b4b1912..000000000 --- a/src/test/ui/coherence/coherence-projection-ok-orphan.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Here we do not get a coherence conflict because `Baz: Iterator` -// does not hold and (due to the orphan rules), we can rely on that. - -// check-pass - -pub trait Foo

{} - -pub trait Bar { - type Output: 'static; -} - -struct Baz; -impl Foo for Baz { } - -impl Foo for A { } - -fn main() {} diff --git a/src/test/ui/coherence/coherence-projection-ok.rs b/src/test/ui/coherence/coherence-projection-ok.rs deleted file mode 100644 index 44fc02a5c..000000000 --- a/src/test/ui/coherence/coherence-projection-ok.rs +++ /dev/null @@ -1,17 +0,0 @@ -// check-pass - -pub trait Foo

{} - -pub trait Bar { - type Output: 'static; -} - -impl Foo for i32 { } - -impl Foo for A { } - -impl Bar for i32 { - type Output = u32; -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-rfc447-constrained.rs b/src/test/ui/coherence/coherence-rfc447-constrained.rs deleted file mode 100644 index 9d1d86883..000000000 --- a/src/test/ui/coherence/coherence-rfc447-constrained.rs +++ /dev/null @@ -1,22 +0,0 @@ -// run-pass -// check that trait matching can handle impls whose types are only -// constrained by a projection. - -trait IsU32 {} -impl IsU32 for u32 {} - -trait Mirror { type Image: ?Sized; } -impl Mirror for T { type Image = T; } - -trait Bar {} -impl, L: Mirror> Bar for V - where U::Image: IsU32 {} - -trait Foo { fn name() -> &'static str; } -impl Foo for u64 { fn name() -> &'static str { "u64" } } -impl Foo for T { fn name() -> &'static str { "Bar" }} - -fn main() { - assert_eq!(::name(), "u64"); - assert_eq!(::name(), "Bar"); -} diff --git a/src/test/ui/coherence/coherence-subtyping.rs b/src/test/ui/coherence/coherence-subtyping.rs deleted file mode 100644 index b3ed728a8..000000000 --- a/src/test/ui/coherence/coherence-subtyping.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Test that two distinct impls which match subtypes of one another -// yield coherence errors (or not) depending on the variance. -// -// Note: This scenario is currently accepted, but as part of the -// universe transition (#56105) may eventually become an error. - -// check-pass - -trait TheTrait { - fn foo(&self) {} -} - -impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} - -impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { - //~^ WARNING conflicting implementation - //~^^ WARNING this was previously accepted by the compiler but is being phased out -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-subtyping.stderr b/src/test/ui/coherence/coherence-subtyping.stderr deleted file mode 100644 index 9d90019a5..000000000 --- a/src/test/ui/coherence/coherence-subtyping.stderr +++ /dev/null @@ -1,16 +0,0 @@ -warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` - --> $DIR/coherence-subtyping.rs:15:1 - | -LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {} - | ---------------------------------------------------------- first implementation here -LL | -LL | impl TheTrait for for<'a> fn(&'a u8, &'a u8) -> &'a u8 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8` - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #56105 - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details - = note: `#[warn(coherence_leak_check)]` on by default - -warning: 1 warning emitted - diff --git a/src/test/ui/coherence/coherence-tuple-conflict.rs b/src/test/ui/coherence/coherence-tuple-conflict.rs deleted file mode 100644 index 8cc829726..000000000 --- a/src/test/ui/coherence/coherence-tuple-conflict.rs +++ /dev/null @@ -1,20 +0,0 @@ -use std::fmt::Debug; -use std::default::Default; - -// Test that a blank impl for all T conflicts with an impl for some -// specific T. - -trait MyTrait { - fn get(&self) -> usize; -} - -impl MyTrait for (T,T) { - fn get(&self) -> usize { 0 } -} - -impl MyTrait for (A,B) { -//~^ ERROR E0119 - fn get(&self) -> usize { self.dummy } -} - -fn main() { } diff --git a/src/test/ui/coherence/coherence-tuple-conflict.stderr b/src/test/ui/coherence/coherence-tuple-conflict.stderr deleted file mode 100644 index 09ad5e5b2..000000000 --- a/src/test/ui/coherence/coherence-tuple-conflict.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)` - --> $DIR/coherence-tuple-conflict.rs:15:1 - | -LL | impl MyTrait for (T,T) { - | ------------------------- first implementation here -... -LL | impl MyTrait for (A,B) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_, _)` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-unsafe-trait-object-impl.rs b/src/test/ui/coherence/coherence-unsafe-trait-object-impl.rs deleted file mode 100644 index 9859a226e..000000000 --- a/src/test/ui/coherence/coherence-unsafe-trait-object-impl.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Check that unsafe trait object do not implement themselves -// automatically - -#![feature(object_safe_for_dispatch)] - -trait Trait: Sized { - fn call(&self); -} - -fn takes_t(s: S) { - s.call(); -} - -fn takes_t_obj(t: &dyn Trait) { - takes_t(t); //~ ERROR E0277 -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr b/src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr deleted file mode 100644 index 2e2dac288..000000000 --- a/src/test/ui/coherence/coherence-unsafe-trait-object-impl.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0277]: the trait bound `&dyn Trait: Trait` is not satisfied - --> $DIR/coherence-unsafe-trait-object-impl.rs:15:13 - | -LL | takes_t(t); - | ------- ^ the trait `Trait` is not implemented for `&dyn Trait` - | | - | required by a bound introduced by this call - | -note: required by a bound in `takes_t` - --> $DIR/coherence-unsafe-trait-object-impl.rs:10:15 - | -LL | fn takes_t(s: S) { - | ^^^^^ required by this bound in `takes_t` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/coherence/coherence-vec-local-2.rs b/src/test/ui/coherence/coherence-vec-local-2.rs deleted file mode 100644 index 47df06bac..000000000 --- a/src/test/ui/coherence/coherence-vec-local-2.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Test that a local, generic type appearing within a -// *non-fundamental* remote type like `Vec` is not considered local. - -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::Remote; - -struct Local(T); - -impl Remote for Vec> { } -//~^ ERROR E0117 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-vec-local-2.stderr b/src/test/ui/coherence/coherence-vec-local-2.stderr deleted file mode 100644 index 95fdf172e..000000000 --- a/src/test/ui/coherence/coherence-vec-local-2.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-vec-local-2.rs:11:1 - | -LL | impl Remote for Vec> { } - | ^^^^^^^^^^^^^^^^^^^------------- - | | | - | | `Vec` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-vec-local.rs b/src/test/ui/coherence/coherence-vec-local.rs deleted file mode 100644 index 130cc39d0..000000000 --- a/src/test/ui/coherence/coherence-vec-local.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Test that a local type (with no type parameters) appearing within a -// *non-fundamental* remote type like `Vec` is not considered local. - -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::Remote; - -struct Local; - -impl Remote for Vec { } -//~^ ERROR E0117 - -fn main() { } diff --git a/src/test/ui/coherence/coherence-vec-local.stderr b/src/test/ui/coherence/coherence-vec-local.stderr deleted file mode 100644 index 4835e771a..000000000 --- a/src/test/ui/coherence/coherence-vec-local.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence-vec-local.rs:11:1 - | -LL | impl Remote for Vec { } - | ^^^^^^^^^^^^^^^^---------- - | | | - | | `Vec` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence-wasm-bindgen.rs b/src/test/ui/coherence/coherence-wasm-bindgen.rs deleted file mode 100644 index ee09a7244..000000000 --- a/src/test/ui/coherence/coherence-wasm-bindgen.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Capture a coherence pattern from wasm-bindgen that we discovered as part of -// future-compatibility warning #56105. This pattern currently receives a lint -// warning but we probably want to support it long term. -// -// Key distinction: we are implementing once for `A` (take ownership) and one -// for `&A` (borrow). -// -// c.f. #56105 - -#![deny(coherence_leak_check)] - -trait IntoWasmAbi { - fn some_method(&self) {} -} - -trait FromWasmAbi {} -trait RefFromWasmAbi {} -trait ReturnWasmAbi {} - -impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b) -where - A: FromWasmAbi, - R: ReturnWasmAbi, -{ -} - -// Explicitly writing the bound lifetime. -impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b) -where - A: RefFromWasmAbi, - R: ReturnWasmAbi, -{ - //~^^^^^ ERROR conflicting implementation - //~| WARNING this was previously accepted -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence-wasm-bindgen.stderr b/src/test/ui/coherence/coherence-wasm-bindgen.stderr deleted file mode 100644 index 89615f0fb..000000000 --- a/src/test/ui/coherence/coherence-wasm-bindgen.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn Fn(&_) -> _` - --> $DIR/coherence-wasm-bindgen.rs:28:1 - | -LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b) - | ------------------------------------------------------------ first implementation here -... -LL | impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn for<'x> Fn(&'x A) -> R + 'b) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&dyn Fn(&_) -> _` - | - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #56105 - = note: downstream crates may implement trait `FromWasmAbi` for type `&_` - = note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details -note: the lint level is defined here - --> $DIR/coherence-wasm-bindgen.rs:10:9 - | -LL | #![deny(coherence_leak_check)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/coherence/coherence-where-clause.rs b/src/test/ui/coherence/coherence-where-clause.rs deleted file mode 100644 index 5c40def86..000000000 --- a/src/test/ui/coherence/coherence-where-clause.rs +++ /dev/null @@ -1,38 +0,0 @@ -// run-pass - -use std::fmt::Debug; -use std::default::Default; - -trait MyTrait { - fn get(&self) -> Self; -} - -impl MyTrait for T - where T : Default -{ - fn get(&self) -> T { - Default::default() - } -} - -#[derive(Clone, Copy, Debug, PartialEq)] -struct MyType { - dummy: usize -} - -impl MyTrait for MyType { - fn get(&self) -> MyType { (*self).clone() } -} - -fn test_eq(m: M, n: M) -where M : MyTrait + Debug + PartialEq -{ - assert_eq!(m.get(), n); -} - -pub fn main() { - test_eq(0_usize, 0_usize); - - let value = MyType { dummy: 256 + 22 }; - test_eq(value, value); -} diff --git a/src/test/ui/coherence/coherence-with-closure.rs b/src/test/ui/coherence/coherence-with-closure.rs deleted file mode 100644 index 5b6a62b24..000000000 --- a/src/test/ui/coherence/coherence-with-closure.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Test that encountering closures during coherence does not cause issues. -#![feature(type_alias_impl_trait)] -type OpaqueClosure = impl Sized; -fn defining_use() -> OpaqueClosure { - || () -} - -struct Wrapper(T); -trait Trait {} -impl Trait for Wrapper {} -impl Trait for Wrapper {} -//~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper` - -fn main() {} diff --git a/src/test/ui/coherence/coherence-with-closure.stderr b/src/test/ui/coherence/coherence-with-closure.stderr deleted file mode 100644 index 431108e14..000000000 --- a/src/test/ui/coherence/coherence-with-closure.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `Wrapper` - --> $DIR/coherence-with-closure.rs:11:1 - | -LL | impl Trait for Wrapper {} - | ------------------------------------- first implementation here -LL | impl Trait for Wrapper {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Wrapper` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-with-generator.rs b/src/test/ui/coherence/coherence-with-generator.rs deleted file mode 100644 index 70665ba06..000000000 --- a/src/test/ui/coherence/coherence-with-generator.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Test that encountering closures during coherence does not cause issues. -#![feature(type_alias_impl_trait, generators)] -type OpaqueGenerator = impl Sized; -fn defining_use() -> OpaqueGenerator { - || { - for i in 0..10 { - yield i; - } - } -} - -struct Wrapper(T); -trait Trait {} -impl Trait for Wrapper {} -impl Trait for Wrapper {} -//~^ ERROR conflicting implementations of trait `Trait` for type `Wrapper` - -fn main() {} diff --git a/src/test/ui/coherence/coherence-with-generator.stderr b/src/test/ui/coherence/coherence-with-generator.stderr deleted file mode 100644 index 6d3be2e16..000000000 --- a/src/test/ui/coherence/coherence-with-generator.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `Wrapper` - --> $DIR/coherence-with-generator.rs:15:1 - | -LL | impl Trait for Wrapper {} - | --------------------------------------- first implementation here -LL | impl Trait for Wrapper {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Wrapper` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence_copy_like.rs b/src/test/ui/coherence/coherence_copy_like.rs deleted file mode 100644 index 92af341cc..000000000 --- a/src/test/ui/coherence/coherence_copy_like.rs +++ /dev/null @@ -1,19 +0,0 @@ -// run-pass -#![allow(dead_code)] -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// aux-build:coherence_copy_like_lib.rs - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -trait MyTrait { } -impl MyTrait for T { } -impl MyTrait for MyType { } -impl<'a> MyTrait for &'a MyType { } -impl MyTrait for Box { } -impl<'a> MyTrait for &'a Box { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs deleted file mode 100644 index edee6cd7b..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// aux-build:coherence_copy_like_lib.rs -// build-pass (FIXME(62277): could be check-pass?) -// skip-codgen -#![allow(dead_code)] - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -trait MyTrait { fn foo() {} } -impl MyTrait for T { } - -// `MyFundamentalStruct` is declared fundamental, so we can test that -// -// MyFundamentalStruct: !MyTrait -// -// Huzzah. -impl MyTrait for lib::MyFundamentalStruct { } - - -fn main() { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs deleted file mode 100644 index 599c804d2..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// check-pass -// aux-build:coherence_copy_like_lib.rs - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -trait MyTrait { fn foo() {} } -impl MyTrait for T { } - -// `MyFundamentalStruct` is declared fundamental, so we can test that -// -// MyFundamentalStruct<&MyTrait>: !MyTrait -// -// Huzzah. -impl<'a> MyTrait for lib::MyFundamentalStruct<&'a MyType> { } - -fn main() { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs deleted file mode 100644 index 7d851b528..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// aux-build:coherence_copy_like_lib.rs - - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -trait MyTrait { fn foo() {} } - -impl MyTrait for T { } - -// Tuples are not fundamental. -impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } -//~^ ERROR E0119 - - -fn main() { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr deleted file mode 100644 index 93486fa5f..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFundamentalStruct<(MyType,)>` - --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:16:1 - | -LL | impl MyTrait for T { } - | ---------------------------------- first implementation here -... -LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyFundamentalStruct<(MyType,)>` - | - = note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.rs b/src/test/ui/coherence/coherence_copy_like_err_struct.rs deleted file mode 100644 index fe39370c9..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_struct.rs +++ /dev/null @@ -1,22 +0,0 @@ -// aux-build:coherence_copy_like_lib.rs - -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -trait MyTrait { fn foo() {} } -impl MyTrait for T { } - -// `MyStruct` is not declared fundamental, therefore this would -// require that -// -// MyStruct: !MyTrait -// -// which we cannot approve. -impl MyTrait for lib::MyStruct { } -//~^ ERROR E0119 - -fn main() { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr b/src/test/ui/coherence/coherence_copy_like_err_struct.stderr deleted file mode 100644 index 7432733b9..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyStruct` - --> $DIR/coherence_copy_like_err_struct.rs:19:1 - | -LL | impl MyTrait for T { } - | ---------------------------------- first implementation here -... -LL | impl MyTrait for lib::MyStruct { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyStruct` - | - = note: upstream crates may add a new impl of trait `lib::MyCopy` for type `lib::MyStruct` in future versions - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.rs b/src/test/ui/coherence/coherence_copy_like_err_tuple.rs deleted file mode 100644 index f63e205c9..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_tuple.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// aux-build:coherence_copy_like_lib.rs - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -trait MyTrait { fn foo() {} } -impl MyTrait for T { } - -// Tuples are not fundamental, therefore this would require that -// -// (MyType,): !MyTrait -// -// which we cannot approve. -impl MyTrait for (MyType,) { } -//~^ ERROR E0119 - -fn main() { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr deleted file mode 100644 index 090497ec1..000000000 --- a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)` - --> $DIR/coherence_copy_like_err_tuple.rs:18:1 - | -LL | impl MyTrait for T { } - | ---------------------------------- first implementation here -... -LL | impl MyTrait for (MyType,) { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(MyType,)` - | - = note: upstream crates may add a new impl of trait `lib::MyCopy` for type `(MyType,)` in future versions - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence_inherent.rs b/src/test/ui/coherence/coherence_inherent.rs deleted file mode 100644 index f3ebf0003..000000000 --- a/src/test/ui/coherence/coherence_inherent.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Tests that methods that implement a trait cannot be invoked -// unless the trait is imported. - -mod Lib { - pub trait TheTrait { - fn the_fn(&self); - } - - pub struct TheStruct; - - impl TheTrait for TheStruct { - fn the_fn(&self) {} - } -} - -mod Import { - // Trait is in scope here: - use Lib::TheStruct; - use Lib::TheTrait; - - fn call_the_fn(s: &TheStruct) { - s.the_fn(); - } -} - -mod NoImport { - // Trait is not in scope here: - use Lib::TheStruct; - - fn call_the_fn(s: &TheStruct) { - s.the_fn(); - //~^ ERROR E0599 - } -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence_inherent.stderr b/src/test/ui/coherence/coherence_inherent.stderr deleted file mode 100644 index 46b128c08..000000000 --- a/src/test/ui/coherence/coherence_inherent.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0599]: no method named `the_fn` found for reference `&TheStruct` in the current scope - --> $DIR/coherence_inherent.rs:31:11 - | -LL | s.the_fn(); - | ^^^^^^ method not found in `&TheStruct` - | - = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope; perhaps add a `use` for it: - | -LL | use Lib::TheTrait; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/coherence/coherence_inherent_cc.rs b/src/test/ui/coherence/coherence_inherent_cc.rs deleted file mode 100644 index 759ada248..000000000 --- a/src/test/ui/coherence/coherence_inherent_cc.rs +++ /dev/null @@ -1,28 +0,0 @@ -// aux-build:coherence_inherent_cc_lib.rs - -// Tests that methods that implement a trait cannot be invoked -// unless the trait is imported. - -extern crate coherence_inherent_cc_lib; - -mod Import { - // Trait is in scope here: - use coherence_inherent_cc_lib::TheStruct; - use coherence_inherent_cc_lib::TheTrait; - - fn call_the_fn(s: &TheStruct) { - s.the_fn(); - } -} - -mod NoImport { - // Trait is not in scope here: - use coherence_inherent_cc_lib::TheStruct; - - fn call_the_fn(s: &TheStruct) { - s.the_fn(); - //~^ ERROR E0599 - } -} - -fn main() {} diff --git a/src/test/ui/coherence/coherence_inherent_cc.stderr b/src/test/ui/coherence/coherence_inherent_cc.stderr deleted file mode 100644 index af0ef3b69..000000000 --- a/src/test/ui/coherence/coherence_inherent_cc.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0599]: no method named `the_fn` found for reference `&TheStruct` in the current scope - --> $DIR/coherence_inherent_cc.rs:23:11 - | -LL | s.the_fn(); - | ^^^^^^ method not found in `&TheStruct` - | - = help: items from traits can only be used if the trait is in scope -help: the following trait is implemented but not in scope; perhaps add a `use` for it: - | -LL | use coherence_inherent_cc_lib::TheTrait; - | - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/coherence/coherence_local.rs b/src/test/ui/coherence/coherence_local.rs deleted file mode 100644 index ea724ada7..000000000 --- a/src/test/ui/coherence/coherence_local.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// check-pass -// aux-build:coherence_copy_like_lib.rs - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -// These are all legal because they are all fundamental types: - -impl lib::MyCopy for MyType { } -impl<'a> lib::MyCopy for &'a MyType { } -impl<'a> lib::MyCopy for &'a Box { } -impl lib::MyCopy for Box { } -impl lib::MyCopy for lib::MyFundamentalStruct { } -impl lib::MyCopy for lib::MyFundamentalStruct> { } - -fn main() {} diff --git a/src/test/ui/coherence/coherence_local_err_struct.rs b/src/test/ui/coherence/coherence_local_err_struct.rs deleted file mode 100644 index a24038eb2..000000000 --- a/src/test/ui/coherence/coherence_local_err_struct.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// aux-build:coherence_copy_like_lib.rs -#![allow(dead_code)] - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -// These are all legal because they are all fundamental types: - -// MyStruct is not fundamental. -impl lib::MyCopy for lib::MyStruct { } -//~^ ERROR E0117 - - -fn main() { } diff --git a/src/test/ui/coherence/coherence_local_err_struct.stderr b/src/test/ui/coherence/coherence_local_err_struct.stderr deleted file mode 100644 index afc6fc45d..000000000 --- a/src/test/ui/coherence/coherence_local_err_struct.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/coherence_local_err_struct.rs:14:1 - | -LL | impl lib::MyCopy for lib::MyStruct { } - | ^^^^^^^^^^^^^^^^^^^^^--------------------- - | | | - | | `MyStruct` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence_local_err_tuple.rs b/src/test/ui/coherence/coherence_local_err_tuple.rs deleted file mode 100644 index f4033862a..000000000 --- a/src/test/ui/coherence/coherence_local_err_tuple.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// aux-build:coherence_copy_like_lib.rs -#![allow(dead_code)] - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -// These are all legal because they are all fundamental types: - -// Tuples are not fundamental, so this is not a local impl. -impl lib::MyCopy for (MyType,) { } -//~^ ERROR E0117 - - -fn main() { } diff --git a/src/test/ui/coherence/coherence_local_err_tuple.stderr b/src/test/ui/coherence/coherence_local_err_tuple.stderr deleted file mode 100644 index a4953859f..000000000 --- a/src/test/ui/coherence/coherence_local_err_tuple.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/coherence_local_err_tuple.rs:14:1 - | -LL | impl lib::MyCopy for (MyType,) { } - | ^^^^^^^^^^^^^^^^^^^^^--------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/coherence_local_ref.rs b/src/test/ui/coherence/coherence_local_ref.rs deleted file mode 100644 index 2e28839c8..000000000 --- a/src/test/ui/coherence/coherence_local_ref.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Test that we are able to introduce a negative constraint that -// `MyType: !MyTrait` along with other "fundamental" wrappers. - -// check-pass -// aux-build:coherence_copy_like_lib.rs - -extern crate coherence_copy_like_lib as lib; - -struct MyType { x: i32 } - -// naturally, legal -impl lib::MyCopy for MyType { } - -fn main() { } diff --git a/src/test/ui/coherence/conflicting-impl-with-err.rs b/src/test/ui/coherence/conflicting-impl-with-err.rs deleted file mode 100644 index 3e0234b87..000000000 --- a/src/test/ui/coherence/conflicting-impl-with-err.rs +++ /dev/null @@ -1,16 +0,0 @@ -struct ErrorKind; -struct Error(ErrorKind); - -impl From for Error { //~ ERROR failed to resolve - fn from(_: nope::Thing) -> Self { //~ ERROR failed to resolve - unimplemented!() - } -} - -impl From for Error { - fn from(_: ErrorKind) -> Self { - unimplemented!() - } -} - -fn main() {} diff --git a/src/test/ui/coherence/conflicting-impl-with-err.stderr b/src/test/ui/coherence/conflicting-impl-with-err.stderr deleted file mode 100644 index 3009b452d..000000000 --- a/src/test/ui/coherence/conflicting-impl-with-err.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `nope` - --> $DIR/conflicting-impl-with-err.rs:4:11 - | -LL | impl From for Error { - | ^^^^ use of undeclared crate or module `nope` - -error[E0433]: failed to resolve: use of undeclared crate or module `nope` - --> $DIR/conflicting-impl-with-err.rs:5:16 - | -LL | fn from(_: nope::Thing) -> Self { - | ^^^^ use of undeclared crate or module `nope` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/coherence/const-generics-orphan-check-ok.rs b/src/test/ui/coherence/const-generics-orphan-check-ok.rs deleted file mode 100644 index 217e8aed2..000000000 --- a/src/test/ui/coherence/const-generics-orphan-check-ok.rs +++ /dev/null @@ -1,28 +0,0 @@ -// check-pass -// aux-build:trait-with-const-param.rs -extern crate trait_with_const_param; -use trait_with_const_param::*; - -// Trivial case, const param after local type. -struct Local1; -impl Trait for Local1 {} - -// Concrete consts behave the same as foreign types, -// so this also trivially works. -impl Trait<3, Local1> for i32 {} - -// This case isn't as trivial as we would forbid type -// parameters here, we do allow const parameters though. -// -// The reason that type parameters are forbidden for -// `impl Trait for i32 {}` is that another -// downstream crate can add `impl Trait for i32`. -// As these two impls would overlap we forbid any impls which -// have a type parameter in front of a local type. -// -// With const parameters this issue does not exist as there are no -// constants local to another downstream crate. -struct Local2; -impl Trait for i32 {} - -fn main() {} diff --git a/src/test/ui/coherence/deep-bad-copy-reason.rs b/src/test/ui/coherence/deep-bad-copy-reason.rs deleted file mode 100644 index 80bbe387a..000000000 --- a/src/test/ui/coherence/deep-bad-copy-reason.rs +++ /dev/null @@ -1,40 +0,0 @@ -#![feature(extern_types)] - -extern "Rust" { - type OpaqueListContents; -} - -pub struct ListS { - len: usize, - data: [T; 0], - opaque: OpaqueListContents, -} - -pub struct Interned<'a, T>(&'a T); - -impl<'a, T> Clone for Interned<'a, T> { - fn clone(&self) -> Self { - *self - } -} - -impl<'a, T> Copy for Interned<'a, T> {} - -pub struct List<'tcx, T>(Interned<'tcx, ListS>); -//~^ NOTE this field does not implement `Copy` -//~| NOTE the `Copy` impl for `Interned<'tcx, ListS>` requires that `OpaqueListContents: Sized` - -impl<'tcx, T> Clone for List<'tcx, T> { - fn clone(&self) -> Self { - *self - } -} - -impl<'tcx, T> Copy for List<'tcx, T> {} -//~^ ERROR the trait `Copy` may not be implemented for this type - -fn assert_is_copy() {} - -fn main() { - assert_is_copy::>(); -} diff --git a/src/test/ui/coherence/deep-bad-copy-reason.stderr b/src/test/ui/coherence/deep-bad-copy-reason.stderr deleted file mode 100644 index 168ee5726..000000000 --- a/src/test/ui/coherence/deep-bad-copy-reason.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0204]: the trait `Copy` may not be implemented for this type - --> $DIR/deep-bad-copy-reason.rs:33:24 - | -LL | pub struct List<'tcx, T>(Interned<'tcx, ListS>); - | ------------------------ this field does not implement `Copy` -... -LL | impl<'tcx, T> Copy for List<'tcx, T> {} - | ^^^^^^^^^^^^^ - | -note: the `Copy` impl for `Interned<'tcx, ListS>` requires that `OpaqueListContents: Sized` - --> $DIR/deep-bad-copy-reason.rs:23:26 - | -LL | pub struct List<'tcx, T>(Interned<'tcx, ListS>); - | ^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0204`. diff --git a/src/test/ui/coherence/impl-foreign-for-foreign.rs b/src/test/ui/coherence/impl-foreign-for-foreign.rs deleted file mode 100644 index 4c0d46045..000000000 --- a/src/test/ui/coherence/impl-foreign-for-foreign.rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote for i32 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign-for-foreign.stderr b/src/test/ui/coherence/impl-foreign-for-foreign.stderr deleted file mode 100644 index 93f7a6fdc..000000000 --- a/src/test/ui/coherence/impl-foreign-for-foreign.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign-for-foreign.rs:10:1 - | -LL | impl Remote for i32 { - | ^^^^^^^^^^^^^^^^--- - | | | - | | `i32` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/impl-foreign-for-foreign[foreign].rs b/src/test/ui/coherence/impl-foreign-for-foreign[foreign].rs deleted file mode 100644 index e79f66c0e..000000000 --- a/src/test/ui/coherence/impl-foreign-for-foreign[foreign].rs +++ /dev/null @@ -1,23 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1> for i32 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} -impl Remote1> for f64 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} -impl Remote1> for f32 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign-for-foreign[foreign].stderr b/src/test/ui/coherence/impl-foreign-for-foreign[foreign].stderr deleted file mode 100644 index e24537bce..000000000 --- a/src/test/ui/coherence/impl-foreign-for-foreign[foreign].stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign-for-foreign[foreign].rs:10:1 - | -LL | impl Remote1> for i32 { - | ^^^^^----------------^^^^^--- - | | | | - | | | `i32` is not defined in the current crate - | | `Rc` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign-for-foreign[foreign].rs:14:1 - | -LL | impl Remote1> for f64 { - | ^^^^^------------------^^^^^--- - | | | | - | | | `f64` is not defined in the current crate - | | `Rc` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign-for-foreign[foreign].rs:18:1 - | -LL | impl Remote1> for f32 { - | ^^^^^^^^--------------^^^^^--- - | | | | - | | | `f32` is not defined in the current crate - | | `Rc` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/impl-foreign-for-foreign[local].rs b/src/test/ui/coherence/impl-foreign-for-foreign[local].rs deleted file mode 100644 index 0b1413edf..000000000 --- a/src/test/ui/coherence/impl-foreign-for-foreign[local].rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local(Rc); - -impl Remote1> for i32 {} -impl Remote1> for f32 {} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign-for-fundamental[foreign].rs b/src/test/ui/coherence/impl-foreign-for-fundamental[foreign].rs deleted file mode 100644 index 10bdf2db8..000000000 --- a/src/test/ui/coherence/impl-foreign-for-fundamental[foreign].rs +++ /dev/null @@ -1,19 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote for Box { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} -impl Remote for Box> { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign-for-fundamental[foreign].stderr b/src/test/ui/coherence/impl-foreign-for-fundamental[foreign].stderr deleted file mode 100644 index 55ea4409e..000000000 --- a/src/test/ui/coherence/impl-foreign-for-fundamental[foreign].stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/impl-foreign-for-fundamental[foreign].rs:10:1 - | -LL | impl Remote for Box { - | ^^^^^------^^^^^-------- - | | | | - | | | `i32` is not defined in the current crate - | | `std::alloc::Global` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/impl-foreign-for-fundamental[foreign].rs:14:1 - | -LL | impl Remote for Box> { - | ^^^^^^^^------^^^^^---------- - | | | | - | | | `Rc` is not defined in the current crate - | | `std::alloc::Global` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/impl-foreign-for-fundamental[local].rs b/src/test/ui/coherence/impl-foreign-for-fundamental[local].rs deleted file mode 100644 index c3fc0e6b8..000000000 --- a/src/test/ui/coherence/impl-foreign-for-fundamental[local].rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -struct Local1(Rc); - -impl Remote for Box {} -impl Remote for Box> {} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign-for-local.rs b/src/test/ui/coherence/impl-foreign-for-local.rs deleted file mode 100644 index 04405bc46..000000000 --- a/src/test/ui/coherence/impl-foreign-for-local.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote for Local {} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs b/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs deleted file mode 100644 index bc1e18b65..000000000 --- a/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental.rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(fundamental)] - -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; - -#[fundamental] -struct Local(T); - -impl Remote for Local<()> {} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs b/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs deleted file mode 100644 index 1e11789ef..000000000 --- a/src/test/ui/coherence/impl-foreign-for-locally-defined-fundamental[foreign].rs +++ /dev/null @@ -1,15 +0,0 @@ -#![feature(fundamental)] - -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; - -#[fundamental] -struct MyBox(T); - -impl Remote for MyBox {} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.rs b/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.rs deleted file mode 100644 index 99a399ddc..000000000 --- a/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for f64 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr b/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr deleted file mode 100644 index 65b3aa394..000000000 --- a/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign[foreign]-for-foreign.rs:10:1 - | -LL | impl Remote1 for f64 { - | ^^^^^------------^^^^^--- - | | | | - | | | `f64` is not defined in the current crate - | | `u32` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/impl-foreign[foreign]-for-local.rs b/src/test/ui/coherence/impl-foreign[foreign]-for-local.rs deleted file mode 100644 index bc6595bb3..000000000 --- a/src/test/ui/coherence/impl-foreign[foreign]-for-local.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for Local { -} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.rs b/src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.rs deleted file mode 100644 index 0476cdaff..000000000 --- a/src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.rs +++ /dev/null @@ -1,24 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -struct Local1(Rc); - -impl Remote1> for i32 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} -impl Remote1>> for f64 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} -impl Remote1>> for f32 { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} - -fn main() {} diff --git a/src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr b/src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr deleted file mode 100644 index 8e77c13e1..000000000 --- a/src/test/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign[fundemental[foreign]]-for-foreign.rs:11:1 - | -LL | impl Remote1> for i32 { - | ^^^^^--------------------^^^^^--- - | | | | - | | | `i32` is not defined in the current crate - | | `String` is not defined in the current crate - | | `std::alloc::Global` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign[fundemental[foreign]]-for-foreign.rs:15:1 - | -LL | impl Remote1>> for f64 { - | ^^^^^---------------------^^^^^--- - | | | | - | | | `f64` is not defined in the current crate - | | `Rc` is not defined in the current crate - | | `std::alloc::Global` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for primitive types - --> $DIR/impl-foreign[fundemental[foreign]]-for-foreign.rs:19:1 - | -LL | impl Remote1>> for f32 { - | ^^^^^^^^-------------------^^^^^--- - | | | | - | | | `f32` is not defined in the current crate - | | `Rc` is not defined in the current crate - | | `std::alloc::Global` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/impl-foreign[fundemental[local]]-for-foreign.rs b/src/test/ui/coherence/impl-foreign[fundemental[local]]-for-foreign.rs deleted file mode 100644 index 7b83b0485..000000000 --- a/src/test/ui/coherence/impl-foreign[fundemental[local]]-for-foreign.rs +++ /dev/null @@ -1,16 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -struct Local1(Rc); - -impl Remote1> for i32 {} -impl Remote1>> for f64 {} -impl Remote1>> for f32 {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign-for-foreign[t].rs b/src/test/ui/coherence/impl[t]-foreign-for-foreign[t].rs deleted file mode 100644 index 5282de4b2..000000000 --- a/src/test/ui/coherence/impl[t]-foreign-for-foreign[t].rs +++ /dev/null @@ -1,21 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; -use std::sync::Arc; - -struct Local; - -impl Remote for Rc { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} - -impl Remote for Arc { - //~^ ERROR only traits defined in the current crate - // | can be implemented for arbitrary types [E0117] -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign-for-foreign[t].stderr b/src/test/ui/coherence/impl[t]-foreign-for-foreign[t].stderr deleted file mode 100644 index 92346c291..000000000 --- a/src/test/ui/coherence/impl[t]-foreign-for-foreign[t].stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/impl[t]-foreign-for-foreign[t].rs:11:1 - | -LL | impl Remote for Rc { - | ^^^^^^^^^^^^^^^^--------- - | | | - | | `Rc` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate - --> $DIR/impl[t]-foreign-for-foreign[t].rs:16:1 - | -LL | impl Remote for Arc { - | ^^^^^^^^^^^^^^^^^^^------ - | | | - | | `Arc` is not defined in the current crate - | impl doesn't use only types from inside the current crate - | - = note: define and implement a trait or new type instead - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].rs b/src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].rs deleted file mode 100644 index 6f5605a21..000000000 --- a/src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote for Box { - //~^ ERROR type parameter `T` must be used as the type parameter for - // | some local type (e.g., `MyStruct`) -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].stderr b/src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].stderr deleted file mode 100644 index 249a5c44c..000000000 --- a/src/test/ui/coherence/impl[t]-foreign-for-fundamental[t].stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign-for-fundamental[t].rs:10:6 - | -LL | impl Remote for Box { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[foreign[t]_local]-for-foreign.rs b/src/test/ui/coherence/impl[t]-foreign[foreign[t]_local]-for-foreign.rs deleted file mode 100644 index 99f3ce447..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[foreign[t]_local]-for-foreign.rs +++ /dev/null @@ -1,12 +0,0 @@ -// check-pass -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -impl Remote2, Local> for usize { } - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].rs b/src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].rs deleted file mode 100644 index 81044cd05..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for Box { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -impl<'a, T> Remote1 for &'a T { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].stderr b/src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].stderr deleted file mode 100644 index 95a20cc5b..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-fundamental[t].stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:10:6 - | -LL | impl Remote1 for Box { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[foreign]-for-fundamental[t].rs:14:10 - | -LL | impl<'a, T> Remote1 for &'a T { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.rs b/src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.rs deleted file mode 100644 index 680ba9f22..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for T { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.stderr b/src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.stderr deleted file mode 100644 index aed184767..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[foreign]-for-t.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[foreign]-for-t.rs:10:6 - | -LL | impl Remote1 for T { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.rs b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.rs deleted file mode 100644 index fc7649085..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1> for u32 { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -impl<'a, T> Remote1<&'a T> for u32 { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.stderr b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.stderr deleted file mode 100644 index 73b1e2c6e..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-foreign.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:10:6 - | -LL | impl Remote1> for u32 { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[fundamental[t]]-for-foreign.rs:14:10 - | -LL | impl<'a, T> Remote1<&'a T> for u32 { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs deleted file mode 100644 index 703f25dd6..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl<'a, T> Remote1> for &'a T { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} -impl<'a, T> Remote1<&'a T> for Box { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].stderr b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].stderr deleted file mode 100644 index 5f89a7aa4..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-fundamental[t].stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:10:10 - | -LL | impl<'a, T> Remote1> for &'a T { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[fundamental[t]]-for-fundamental[t].rs:13:10 - | -LL | impl<'a, T> Remote1<&'a T> for Box { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-local.rs b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-local.rs deleted file mode 100644 index ec21fdd4e..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-local.rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1> for Local {} - -impl<'a, T> Remote1<&'a T> for Local {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.rs b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.rs deleted file mode 100644 index 5bdab87bf..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1> for T { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} -impl<'a, T> Remote1<&'a T> for T { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.stderr b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.stderr deleted file mode 100644 index 45559d8b6..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]]-for-t.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:10:6 - | -LL | impl Remote1> for T { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[fundamental[t]]-for-t.rs:13:10 - | -LL | impl<'a, T> Remote1<&'a T> for T { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs deleted file mode 100644 index c9e3594cd..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote2, Local> for u32 { - //~^ ERROR type parameter `T` must be covered by another type -} - -impl<'a, T> Remote2<&'a T, Local> for u32 { - //~^ ERROR type parameter `T` must be covered by another type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.stderr b/src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.stderr deleted file mode 100644 index f94f04c8d..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundamental[t]_local]-for-foreign.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - --> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:10:6 - | -LL | impl Remote2, Local> for u32 { - | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type - = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait for T0`, where `T0` is the first and `Tn` is the last - -error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - --> $DIR/impl[t]-foreign[fundamental[t]_local]-for-foreign.rs:14:10 - | -LL | impl<'a, T> Remote2<&'a T, Local> for u32 { - | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type - = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait for T0`, where `T0` is the first and `Tn` is the last - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[fundemental[local]]-for-foreign[t].rs b/src/test/ui/coherence/impl[t]-foreign[fundemental[local]]-for-foreign[t].rs deleted file mode 100644 index 62e69357e..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[fundemental[local]]-for-foreign[t].rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -struct Local1(Rc); - -impl Remote1> for Rc {} -impl Remote1>> for Rc {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-foreign.rs b/src/test/ui/coherence/impl[t]-foreign[local]-for-foreign.rs deleted file mode 100644 index 1fec19bba..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-foreign.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for Rc {} -impl Remote1 for Vec> {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-foreign[t].rs b/src/test/ui/coherence/impl[t]-foreign[local]-for-foreign[t].rs deleted file mode 100644 index c8ed28be6..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-foreign[t].rs +++ /dev/null @@ -1,15 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -struct Local1(Rc); - -impl Remote1 for Rc {} -impl Remote1> for Rc {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[foreign[t]].rs b/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[foreign[t]].rs deleted file mode 100644 index f9b88c645..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[foreign[t]].rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -struct Local1(Rc); - -impl Remote1 for Box> {} -impl Remote1> for Box> {} -impl Remote1> for Box> {} -impl Remote1>> for Box> {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs b/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs deleted file mode 100644 index 7709bd9c8..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for Box { - //~^ ERROR type parameter `T` must be covered by another type -} - -impl Remote1 for &T { - //~^ ERROR type parameter `T` must be covered by another type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].stderr b/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].stderr deleted file mode 100644 index e68f2fe58..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-fundamental[t].stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - --> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:10:6 - | -LL | impl Remote1 for Box { - | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type - = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait for T0`, where `T0` is the first and `Tn` is the last - -error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - --> $DIR/impl[t]-foreign[local]-for-fundamental[t].rs:14:6 - | -LL | impl Remote1 for &T { - | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type - = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait for T0`, where `T0` is the first and `Tn` is the last - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-local.rs b/src/test/ui/coherence/impl[t]-foreign[local]-for-local.rs deleted file mode 100644 index 9c14eea1b..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-local.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for Local {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-t.rs b/src/test/ui/coherence/impl[t]-foreign[local]-for-t.rs deleted file mode 100644 index eed3a4b5c..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-t.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for T { - //~^ ERROR type parameter `T` must be covered by another type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[local]-for-t.stderr b/src/test/ui/coherence/impl[t]-foreign[local]-for-t.stderr deleted file mode 100644 index d97e85dcb..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local]-for-t.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - --> $DIR/impl[t]-foreign[local]-for-t.rs:10:6 - | -LL | impl Remote1 for T { - | ^ type parameter `T` must be covered by another type when it appears before the first local type (`Local`) - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type - = note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait for T0`, where `T0` is the first and `Tn` is the last - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[local_fundamental[t]]-for-foreign.rs b/src/test/ui/coherence/impl[t]-foreign[local_fundamental[t]]-for-foreign.rs deleted file mode 100644 index 63c342b76..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[local_fundamental[t]]-for-foreign.rs +++ /dev/null @@ -1,17 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; -struct Local2(Rc); - -impl Remote2> for u32 {} -impl<'a, T> Remote2 for u32 {} -impl Remote2, Box> for u32 {} -impl<'a, T> Remote2, &'a T> for u32 {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.rs b/src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.rs deleted file mode 100644 index 9bb37c2ba..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for u32 { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.stderr b/src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.stderr deleted file mode 100644 index 44e3b7eed..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[t]-for-foreign.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[t]-for-foreign.rs:10:6 - | -LL | impl Remote1 for u32 { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.rs b/src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.rs deleted file mode 100644 index 79b5aa3fc..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.rs +++ /dev/null @@ -1,18 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for Box { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -impl<'a, A, B> Remote1 for &'a B { - //~^ ERROR type parameter `B` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.stderr b/src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.stderr deleted file mode 100644 index 80fb5dbec..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[t]-for-fundamental.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[t]-for-fundamental.rs:10:6 - | -LL | impl Remote1 for Box { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error[E0210]: type parameter `B` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[t]-for-fundamental.rs:14:13 - | -LL | impl<'a, A, B> Remote1 for &'a B { - | ^ type parameter `B` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/impl[t]-foreign[t]-for-local.rs b/src/test/ui/coherence/impl[t]-foreign[t]-for-local.rs deleted file mode 100644 index bc59721c0..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[t]-for-local.rs +++ /dev/null @@ -1,13 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs -// check-pass - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for Local {} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[t]-for-t.rs b/src/test/ui/coherence/impl[t]-foreign[t]-for-t.rs deleted file mode 100644 index bcd6b269a..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[t]-for-t.rs +++ /dev/null @@ -1,14 +0,0 @@ -// compile-flags:--crate-name=test -// aux-build:coherence_lib.rs - -extern crate coherence_lib as lib; -use lib::*; -use std::rc::Rc; - -struct Local; - -impl Remote1 for T { - //~^ ERROR type parameter `T` must be used as the type parameter for some local type -} - -fn main() {} diff --git a/src/test/ui/coherence/impl[t]-foreign[t]-for-t.stderr b/src/test/ui/coherence/impl[t]-foreign[t]-for-t.stderr deleted file mode 100644 index ff72969dc..000000000 --- a/src/test/ui/coherence/impl[t]-foreign[t]-for-t.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct`) - --> $DIR/impl[t]-foreign[t]-for-t.rs:10:6 - | -LL | impl Remote1 for T { - | ^ type parameter `T` must be used as the type parameter for some local type - | - = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local - = note: only traits defined in the current crate can be implemented for a type parameter - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/coherence/inter-crate-ambiguity-causes-notes.rs b/src/test/ui/coherence/inter-crate-ambiguity-causes-notes.rs deleted file mode 100644 index 5b11c78ab..000000000 --- a/src/test/ui/coherence/inter-crate-ambiguity-causes-notes.rs +++ /dev/null @@ -1,19 +0,0 @@ -struct S; - -impl From<()> for S { - fn from(x: ()) -> Self { - S - } -} - -impl From for S -//~^ ERROR conflicting implementations of trait -where - I: Iterator, -{ - fn from(x: I) -> Self { - S - } -} - -fn main() {} diff --git a/src/test/ui/coherence/inter-crate-ambiguity-causes-notes.stderr b/src/test/ui/coherence/inter-crate-ambiguity-causes-notes.stderr deleted file mode 100644 index 4ddd712b2..000000000 --- a/src/test/ui/coherence/inter-crate-ambiguity-causes-notes.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error[E0119]: conflicting implementations of trait `From<()>` for type `S` - --> $DIR/inter-crate-ambiguity-causes-notes.rs:9:1 - | -LL | impl From<()> for S { - | ------------------- first implementation here -... -LL | impl From for S - | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `S` - | - = note: upstream crates may add a new impl of trait `std::iter::Iterator` for type `()` in future versions - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/issue-85026.rs b/src/test/ui/coherence/issue-85026.rs deleted file mode 100644 index 8b116545a..000000000 --- a/src/test/ui/coherence/issue-85026.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![feature(auto_traits)] -auto trait AutoTrait {} - -// You cannot impl your own `dyn AutoTrait`. -impl dyn AutoTrait {} //~ERROR E0785 - -// You cannot impl someone else's `dyn AutoTrait` -impl dyn Unpin {} //~ERROR E0785 - -fn main() {} diff --git a/src/test/ui/coherence/issue-85026.stderr b/src/test/ui/coherence/issue-85026.stderr deleted file mode 100644 index a5da19bbf..000000000 --- a/src/test/ui/coherence/issue-85026.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0785]: cannot define inherent `impl` for a dyn auto trait - --> $DIR/issue-85026.rs:5:6 - | -LL | impl dyn AutoTrait {} - | ^^^^^^^^^^^^^ impl requires at least one non-auto trait - | - = note: define and implement a new trait or type instead - -error[E0785]: cannot define inherent `impl` for a dyn auto trait - --> $DIR/issue-85026.rs:8:6 - | -LL | impl dyn Unpin {} - | ^^^^^^^^^ impl requires at least one non-auto trait - | - = note: define and implement a new trait or type instead - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0785`. diff --git a/src/test/ui/coherence/issue-99663-2.rs b/src/test/ui/coherence/issue-99663-2.rs deleted file mode 100644 index 10a0a5688..000000000 --- a/src/test/ui/coherence/issue-99663-2.rs +++ /dev/null @@ -1,22 +0,0 @@ -// check-pass - -#![feature(type_alias_impl_trait)] - -struct Outer { - i: InnerSend, -} - -type InnerSend = impl Send; - -fn constrain() -> InnerSend { - () -} - -trait SendMustNotImplDrop {} - -#[allow(drop_bounds)] -impl SendMustNotImplDrop for T {} - -impl SendMustNotImplDrop for Outer {} - -fn main() {} diff --git a/src/test/ui/coherence/issue-99663.rs b/src/test/ui/coherence/issue-99663.rs deleted file mode 100644 index a2d4d398c..000000000 --- a/src/test/ui/coherence/issue-99663.rs +++ /dev/null @@ -1,22 +0,0 @@ -// check-pass - -#![feature(type_alias_impl_trait)] - -struct Send { - i: InnerSend, -} - -type InnerSend = impl Sized; - -fn constrain() -> InnerSend { - () -} - -trait SendMustNotImplDrop {} - -#[allow(drop_bounds)] -impl SendMustNotImplDrop for T {} - -impl SendMustNotImplDrop for Send {} - -fn main() {} diff --git a/src/test/ui/coherence/re-rebalance-coherence-default-generic-associated-type.rs b/src/test/ui/coherence/re-rebalance-coherence-default-generic-associated-type.rs deleted file mode 100644 index d18e3f453..000000000 --- a/src/test/ui/coherence/re-rebalance-coherence-default-generic-associated-type.rs +++ /dev/null @@ -1,26 +0,0 @@ -// run-pass -// aux-build:re_rebalance_coherence_lib-rpass.rs - -#![allow(dead_code)] -// check that a generic type with a default value from an associated type can be used without -// specifying the value, and without invoking coherence errors. - -extern crate re_rebalance_coherence_lib_rpass as lib; -use lib::*; - -struct MyString {} - -impl LibToOwned for MyString { - type Owned = String; -} - -impl PartialEq for LibCow { - fn eq(&self, _other: &MyString) -> bool { - // Test that the default type is used. - let _s: &String = &self.o; - - false - } -} - -fn main() {} diff --git a/src/test/ui/coherence/re-rebalance-coherence.rs b/src/test/ui/coherence/re-rebalance-coherence.rs deleted file mode 100644 index 38d096b08..000000000 --- a/src/test/ui/coherence/re-rebalance-coherence.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass -// aux-build:re_rebalance_coherence_lib.rs - -extern crate re_rebalance_coherence_lib as lib; -use lib::*; - -struct Oracle; -impl Backend for Oracle {} -impl<'a, T:'a, Tab> QueryFragment for BatchInsert<'a, T, Tab> {} - -fn main() {} diff --git a/src/test/ui/coherence/strict-coherence-needs-negative-coherence.rs b/src/test/ui/coherence/strict-coherence-needs-negative-coherence.rs deleted file mode 100644 index 221683dd5..000000000 --- a/src/test/ui/coherence/strict-coherence-needs-negative-coherence.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![feature(rustc_attrs)] - -#[rustc_strict_coherence] -trait Foo {} -//~^ ERROR to use `strict_coherence` on this trait, the `with_negative_coherence` feature must be enabled - -fn main() {} diff --git a/src/test/ui/coherence/strict-coherence-needs-negative-coherence.stderr b/src/test/ui/coherence/strict-coherence-needs-negative-coherence.stderr deleted file mode 100644 index b54729287..000000000 --- a/src/test/ui/coherence/strict-coherence-needs-negative-coherence.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: to use `strict_coherence` on this trait, the `with_negative_coherence` feature must be enabled - --> $DIR/strict-coherence-needs-negative-coherence.rs:4:1 - | -LL | #[rustc_strict_coherence] - | ------------------------- due to this attribute -LL | trait Foo {} - | ^^^^^^^^^ - -error: aborting due to previous error - -- cgit v1.2.3