diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index 38cb4ee66cac515a4949b14c392c2aab0863ff93..9bb4af16a8f53fac2637f0b5b531cacd554a0c01 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -586,6 +586,11 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool { false } + ty::Closure(..) => { + // Similar to the `Opaque` case (#83613). + false + } + ty::Dynamic(ref tt, ..) => { if let Some(principal) = tt.principal() { def_id_is_local(principal.def_id(), in_crate) @@ -596,7 +601,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool { ty::Error(_) => true, - ty::Closure(..) | ty::Generator(..) | ty::GeneratorWitness(..) => { + ty::Generator(..) | ty::GeneratorWitness(..) => { bug!("ty_is_local invoked on unexpected type: {:?}", ty) } } diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs index 264cc4f248cec9fe14ecbc19e36f097051c87a61..4b563a87a158536c378891bd0710ed344061af3f 100644 --- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs @@ -395,14 +395,14 @@ fn report_conflicting_impls( // that's passed in. let decorate = |err: LintDiagnosticBuilder<'_>| { let msg = format!( - "conflicting implementations of trait `{}`{}:{}", + "conflicting implementations of trait `{}`{}{}", overlap.trait_desc, overlap .self_desc .clone() .map_or_else(String::new, |ty| { format!(" for type `{}`", ty) }), match used_to_be_allowed { - Some(FutureCompatOverlapErrorKind::Issue33140) => " (E0119)", + Some(FutureCompatOverlapErrorKind::Issue33140) => ": (E0119)", _ => "", } ); diff --git a/src/test/ui/associated-types/associated-types-coherence-failure.stderr b/src/test/ui/associated-types/associated-types-coherence-failure.stderr index 2c53b0a2248fa170df4aacb1953715b896837169..211613b3714920a9a7989a56cc58abe6215d04ff 100644 --- a/src/test/ui/associated-types/associated-types-coherence-failure.stderr +++ b/src/test/ui/associated-types/associated-types-coherence-failure.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `Cow<'_, _>`: +error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `Cow<'_, _>` --> $DIR/associated-types-coherence-failure.rs:21:1 | LL | impl<'a, B: ?Sized> IntoCow<'a, B> for ::Owned where B: ToOwned { @@ -7,7 +7,7 @@ LL | impl<'a, B: ?Sized> IntoCow<'a, B> for ::Owned where B: ToOwn LL | impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Cow<'_, _>` -error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `&_`: +error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `&_` --> $DIR/associated-types-coherence-failure.rs:28:1 | LL | impl<'a, B: ?Sized> IntoCow<'a, B> for ::Owned where B: ToOwned { diff --git a/src/test/ui/async-await/issue-67651.stderr b/src/test/ui/async-await/issue-67651.stderr index 99857c215eb8f483024918ff5c9bdac8ff599d3b..89017f6cc3ec66f3d000d62254a2a864a9bbc1d0 100644 --- a/src/test/ui/async-await/issue-67651.stderr +++ b/src/test/ui/async-await/issue-67651.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `From` for type `()`: +error[E0119]: conflicting implementations of trait `From` for type `()` --> $DIR/issue-67651.rs:11:1 | LL | impl From for () { 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 index e95826ed4d53ddfdfd91c6261d966e1c1cb8901d..9156972a1df99935fae01da938e22355a8dd9d04 100644 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr +++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait`: +error[E0119]: conflicting implementations of trait `MyTrait` --> $DIR/coherence-blanket-conflicts-with-blanket-implemented.rs:24:1 | LL | impl MyTrait for T { 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 index ea9838b4520e0beac9f801756072694e91778f91..8400968e1227d2afce3c7518256af65e6c1ba7a9 100644 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr +++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait`: +error[E0119]: conflicting implementations of trait `MyTrait` --> $DIR/coherence-blanket-conflicts-with-blanket-unimplemented.rs:20:1 | LL | impl MyTrait for T { 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 index a2008f04265dcb475292d3e7f3b7ce8bfbfcc489..c25c43692928af13c3f75aa79dcc01e2563877cb 100644 --- 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 @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`: +error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy` --> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:15:1 | LL | impl GoMut for MyThingy { 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 index af4f4d09d7abd797e0af321df9cfebbf090a6b97..c2a925213da2dd478e8797fccaeed73c8d42903f 100644 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr +++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`: +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 { 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 index 6922f3ebffaff27c1ecef8a6f2b6f302b0950a0c..e1a5dffebdaad5fd1813386af56929fe96201c0f 100644 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr +++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`: +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 { diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr index 4bc282764796b4c898cf6e3aaef02ed5f6911d2e..ba60a2ea92947eb4576bf0910d456d5f1b2cd86c 100644 --- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr +++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`: +error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType` --> $DIR/coherence-blanket-conflicts-with-specific.rs:19:1 | LL | impl MyTrait for T { diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr index 4d9f815c7958184e4d4c2440ea400446fc20a401..5295170cd8bf37539be877c8719c78869f46c871 100644 --- a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr +++ b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr @@ -7,7 +7,7 @@ LL | LL | impl !Send for TestType {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here -error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`: +error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>` --> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1 | LL | unsafe impl Send for TestType {} diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr b/src/test/ui/coherence/coherence-cross-crate-conflict.stderr index 827d26ab43443100f5eab56caba21ee06ff8b674..d0d86c72ffc68ebe5d11ba76a26e43933cfa83d4 100644 --- a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr +++ b/src/test/ui/coherence/coherence-cross-crate-conflict.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`: +error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize` --> $DIR/coherence-cross-crate-conflict.rs:9:1 | LL | impl Foo for A { diff --git a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr index 49271edf8e5e4bd42cd24663d613716ee55e1a73..7dabd97b94e823d93462b0cc5c8b61ff4789cddf 100644 --- a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr +++ b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))`: +error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))` --> $DIR/coherence-fn-covariant-bound-vs-static.rs:17:1 | LL | impl Trait for for<'r> fn(fn(&'r ())) {} diff --git a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr b/src/test/ui/coherence/coherence-fn-implied-bounds.stderr index a3e7f0bcde376f7af6153cd8b2e0e84d27f0dd7d..c8accc9974791c6dfc32d31bfd4bd35a8a9f390e 100644 --- a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr +++ b/src/test/ui/coherence/coherence-fn-implied-bounds.stderr @@ -1,4 +1,4 @@ -error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`: +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 {} diff --git a/src/test/ui/coherence/coherence-fn-inputs.stderr b/src/test/ui/coherence/coherence-fn-inputs.stderr index 56ab873a393201ff2434056271b4662a8da6682a..82bd8a35f45757cfbacf6d69b8c2454de1d580fa 100644 --- a/src/test/ui/coherence/coherence-fn-inputs.stderr +++ b/src/test/ui/coherence/coherence-fn-inputs.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a u32, &'b u32)`: +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) {} diff --git a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr b/src/test/ui/coherence/coherence-free-vs-bound-region.stderr index 97aa4912721434631a773a8226973c7100179aa6..c249fa43c3b6058c2d2a91f0c37916a2bd4ce6df 100644 --- a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr +++ b/src/test/ui/coherence/coherence-free-vs-bound-region.stderr @@ -1,4 +1,4 @@ -error: conflicting implementations of trait `TheTrait` for type `fn(&u8)`: +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) {} diff --git a/src/test/ui/coherence/coherence-impls-copy.stderr b/src/test/ui/coherence/coherence-impls-copy.stderr index 8cc24f099e382c065ad6fdb34cd3f5376cfda82c..2ac0706d72e57cf24e1207e190dbb0cf10fdce61 100644 --- a/src/test/ui/coherence/coherence-impls-copy.stderr +++ b/src/test/ui/coherence/coherence-impls-copy.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32`: +error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32` --> $DIR/coherence-impls-copy.rs:5:1 | LL | impl Copy for i32 {} @@ -7,7 +7,7 @@ LL | impl Copy for i32 {} = note: conflicting implementation in crate `core`: - impl Copy for i32; -error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`: +error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync` --> $DIR/coherence-impls-copy.rs:29:1 | LL | impl Copy for &'static NotSync {} @@ -17,7 +17,7 @@ LL | impl Copy for &'static NotSync {} - impl Copy for &T where T: ?Sized; -error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`: +error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]` --> $DIR/coherence-impls-copy.rs:34:1 | LL | impl Copy for &'static [NotSync] {} diff --git a/src/test/ui/coherence/coherence-impls-send.stderr b/src/test/ui/coherence/coherence-impls-send.stderr index edca31b5daee97bce47a460c910dd64e3e48df2c..46e9e7e986c3432da3abb4afd27bc40adf157c76 100644 --- a/src/test/ui/coherence/coherence-impls-send.stderr +++ b/src/test/ui/coherence/coherence-impls-send.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::marker::Send` for type `&[NotSync]`: +error[E0119]: conflicting implementations of trait `std::marker::Send` for type `&[NotSync]` --> $DIR/coherence-impls-send.rs:25:1 | LL | unsafe impl Send for &'static [NotSync] {} diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr index a74ffbb3afd9622248051666d9c3309219413180..8a43ad7b7f0e806c3508e32b3f09a2211c460857 100644 --- a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr +++ b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait`: +error[E0119]: conflicting implementations of trait `MyTrait` --> $DIR/coherence-no-direct-lifetime-dispatch.rs:6:1 | LL | impl MyTrait for T {} 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 index 5e8bfbcc3cafa0b1cfe54e954790e6f3098b51d2..6a0880334b6e058f2a29767f1c7bc47d04dc9c24 100644 --- a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr +++ b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)`: +error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)` --> $DIR/coherence-overlap-all-t-and-tuple.rs:16:1 | LL | impl From for T { diff --git a/src/test/ui/coherence/coherence-overlap-downstream.stderr b/src/test/ui/coherence/coherence-overlap-downstream.stderr index 6fb398562d6be382f2be170e4e512b8321c6cbe1..9ab099489d9e582af5e92e2f7d2f914b713642e0 100644 --- a/src/test/ui/coherence/coherence-overlap-downstream.stderr +++ b/src/test/ui/coherence/coherence-overlap-downstream.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Sweet`: +error[E0119]: conflicting implementations of trait `Sweet` --> $DIR/coherence-overlap-downstream.rs:8:1 | LL | impl Sweet for T { } @@ -6,7 +6,7 @@ LL | impl Sweet for T { } LL | impl Sweet for T { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation -error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`: +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 {} diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516.stderr index fe4c5cf3490dd2557c2cdbb12baa9b94adb39c3f..85eb189e10eeee540fd9b50b1e1b851ec129ddb2 100644 --- a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr +++ b/src/test/ui/coherence/coherence-overlap-issue-23516.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`: +error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>` --> $DIR/coherence-overlap-issue-23516.rs:8:1 | LL | impl Sweet for T { } diff --git a/src/test/ui/coherence/coherence-overlap-messages.stderr b/src/test/ui/coherence/coherence-overlap-messages.stderr index 28147f52fa614f69038d47cce6face579a8ee7df..5a97296eebd9b777e607ead9ba49d763ff397b81 100644 --- a/src/test/ui/coherence/coherence-overlap-messages.stderr +++ b/src/test/ui/coherence/coherence-overlap-messages.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Foo`: +error[E0119]: conflicting implementations of trait `Foo` --> $DIR/coherence-overlap-messages.rs:4:1 | LL | impl Foo for T {} @@ -6,7 +6,7 @@ LL | impl Foo for T {} LL | impl Foo for U {} | ^^^^^^^^^^^^^^^^^ conflicting implementation -error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`: +error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)` --> $DIR/coherence-overlap-messages.rs:11:1 | LL | impl Bar for (T, u8) {} @@ -14,7 +14,7 @@ LL | impl Bar for (T, u8) {} LL | impl Bar for (u8, T) {} | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)` -error[E0119]: conflicting implementations of trait `Baz` for type `u8`: +error[E0119]: conflicting implementations of trait `Baz` for type `u8` --> $DIR/coherence-overlap-messages.rs:17:1 | LL | impl Baz for T {} @@ -22,7 +22,7 @@ LL | impl Baz for T {} LL | impl Baz for u8 {} | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8` -error[E0119]: conflicting implementations of trait `Quux<_, _>`: +error[E0119]: conflicting implementations of trait `Quux<_, _>` --> $DIR/coherence-overlap-messages.rs:23:1 | LL | impl Quux for T {} @@ -30,7 +30,7 @@ LL | impl Quux for T {} LL | impl Quux for T {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation -error[E0119]: conflicting implementations of trait `Quux<_, _>`: +error[E0119]: conflicting implementations of trait `Quux<_, _>` --> $DIR/coherence-overlap-messages.rs:25:1 | LL | impl Quux for T {} diff --git a/src/test/ui/coherence/coherence-overlap-upstream.stderr b/src/test/ui/coherence/coherence-overlap-upstream.stderr index 8d3de9a243e8e460ec2720c7ed9c1bbf983e62f9..8272c8875860792ffb6ca196935c6684a586eaa3 100644 --- a/src/test/ui/coherence/coherence-overlap-upstream.stderr +++ b/src/test/ui/coherence/coherence-overlap-upstream.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `i16`: +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 {} diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr index 06a840255bd9a0b4b292b45f72471870c7f9d015..51f6faab3c7e48bde89e253cb8a580fee7f0dfa0 100644 --- a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr +++ b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `i32`: +error[E0119]: conflicting implementations of trait `Foo` for type `i32` --> $DIR/coherence-projection-conflict-orphan.rs:16:1 | LL | impl Foo for i32 { } diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr b/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr index c5c9b0ac33c2a3372385d6d2e9866fc9ee38c280..85d3d358f83cf8ea5aba1e7db543e4b4d48ccd31 100644 --- a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr +++ b/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`: +error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>` --> $DIR/coherence-projection-conflict-ty-param.rs:10:1 | LL | impl > Foo

for Option {} diff --git a/src/test/ui/coherence/coherence-projection-conflict.stderr b/src/test/ui/coherence/coherence-projection-conflict.stderr index aed6910b529091a4f921fa192592fa108dcfd901..e7d1fb293466197249a9a3a3831eac7518cc5a51 100644 --- a/src/test/ui/coherence/coherence-projection-conflict.stderr +++ b/src/test/ui/coherence/coherence-projection-conflict.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `i32`: +error[E0119]: conflicting implementations of trait `Foo` for type `i32` --> $DIR/coherence-projection-conflict.rs:11:1 | LL | impl Foo for i32 { } diff --git a/src/test/ui/coherence/coherence-subtyping.stderr b/src/test/ui/coherence/coherence-subtyping.stderr index 7f751a24c75c95d6e5c384f7f0d223c240eeb2e0..6f95f0a06b5fa1beb93988bb669407e57c79ce11 100644 --- a/src/test/ui/coherence/coherence-subtyping.stderr +++ b/src/test/ui/coherence/coherence-subtyping.stderr @@ -1,4 +1,4 @@ -warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`: +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 {} diff --git a/src/test/ui/coherence/coherence-tuple-conflict.stderr b/src/test/ui/coherence/coherence-tuple-conflict.stderr index f6c2bc32aa8705b785b6a6b82dcf6990137bd995..09ad5e5b22435e4099704695ec34ac4b3bb0f74d 100644 --- a/src/test/ui/coherence/coherence-tuple-conflict.stderr +++ b/src/test/ui/coherence/coherence-tuple-conflict.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)`: +error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)` --> $DIR/coherence-tuple-conflict.rs:15:1 | LL | impl MyTrait for (T,T) { diff --git a/src/test/ui/coherence/coherence-wasm-bindgen.stderr b/src/test/ui/coherence/coherence-wasm-bindgen.stderr index c77483bb847f5b5df4b395da95ad5574e172a2d7..432646e5321eb86eb20f72013252e66f8e5cda37 100644 --- a/src/test/ui/coherence/coherence-wasm-bindgen.stderr +++ b/src/test/ui/coherence/coherence-wasm-bindgen.stderr @@ -1,4 +1,4 @@ -error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _`: +error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _` --> $DIR/coherence-wasm-bindgen.rs:28:1 | LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b) 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 index cf6c6fb8c7a9dac76d8a3553d07c5fc378ac7b17..db730650185e306e8e2832a6c0833f7ee2be4cbc 100644 --- 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 @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`: +error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>` --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:16:1 | LL | impl MyTrait for T { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr b/src/test/ui/coherence/coherence_copy_like_err_struct.stderr index cf79e851bf4ab21ec454e06bf2ccf08b2cf0241f..3bc3dffda5d1bbbf95dc29ef8c23aceba0d511eb 100644 --- a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr +++ b/src/test/ui/coherence/coherence_copy_like_err_struct.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct`: +error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct` --> $DIR/coherence_copy_like_err_struct.rs:19:1 | LL | impl MyTrait for T { } diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr index 52f66427dfae4aa3f63d583da8b1d8e69576dbff..090497ec18977a6027e00f4b01514b987c131ecd 100644 --- a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr +++ b/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)`: +error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)` --> $DIR/coherence_copy_like_err_tuple.rs:18:1 | LL | impl MyTrait for T { } diff --git a/src/test/ui/const-generics/issues/issue-64494.min.stderr b/src/test/ui/const-generics/issues/issue-64494.min.stderr index 936ab7f6e7e338ab2dc1ccbd62a2692570149a5b..846db0c91b6e758948e9337e922ceb0ba8bf33fe 100644 --- a/src/test/ui/const-generics/issues/issue-64494.min.stderr +++ b/src/test/ui/const-generics/issues/issue-64494.min.stderr @@ -16,7 +16,7 @@ LL | impl MyTrait for T where Is<{T::VAL == 6}>: True {} = note: type parameters may not be used in const expressions = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions -error[E0119]: conflicting implementations of trait `MyTrait`: +error[E0119]: conflicting implementations of trait `MyTrait` --> $DIR/issue-64494.rs:18:1 | LL | impl MyTrait for T where Is<{T::VAL == 5}>: True {} diff --git a/src/test/ui/error-codes/E0119.stderr b/src/test/ui/error-codes/E0119.stderr index e7690aa30bd201c03b9b9ce432dd9a0826149943..e08a2c7fcbbd0ff0992e2995ee3bc351f9d51f1b 100644 --- a/src/test/ui/error-codes/E0119.stderr +++ b/src/test/ui/error-codes/E0119.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `Foo`: +error[E0119]: conflicting implementations of trait `MyTrait` for type `Foo` --> $DIR/E0119.rs:13:1 | LL | impl MyTrait for T { diff --git a/src/test/ui/error-codes/e0119/complex-impl.stderr b/src/test/ui/error-codes/e0119/complex-impl.stderr index d617d8129248a77edb6b33140d26056508a0d581..04babb0644718fa37121e1c1e00876d6d0d923a5 100644 --- a/src/test/ui/error-codes/e0119/complex-impl.stderr +++ b/src/test/ui/error-codes/e0119/complex-impl.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `complex_impl_support::External` for type `(Q, complex_impl_support::M<'_, '_, '_, std::boxed::Box<_>, _, _>)`: +error[E0119]: conflicting implementations of trait `complex_impl_support::External` for type `(Q, complex_impl_support::M<'_, '_, '_, std::boxed::Box<_>, _, _>)` --> $DIR/complex-impl.rs:9:1 | LL | impl External for (Q, R) {} diff --git a/src/test/ui/error-codes/e0119/conflict-with-std.stderr b/src/test/ui/error-codes/e0119/conflict-with-std.stderr index 68551f437759176e9eec88e03cf2912428a77a62..3ff96a6a4d65dfc5599b2ec30e9a7a1abe3ede55 100644 --- a/src/test/ui/error-codes/e0119/conflict-with-std.stderr +++ b/src/test/ui/error-codes/e0119/conflict-with-std.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::convert::AsRef` for type `std::boxed::Box`: +error[E0119]: conflicting implementations of trait `std::convert::AsRef` for type `std::boxed::Box` --> $DIR/conflict-with-std.rs:5:1 | LL | impl AsRef for Box { @@ -8,7 +8,7 @@ LL | impl AsRef for Box { - impl AsRef for Box where A: Allocator, T: ?Sized; -error[E0119]: conflicting implementations of trait `std::convert::From` for type `S`: +error[E0119]: conflicting implementations of trait `std::convert::From` for type `S` --> $DIR/conflict-with-std.rs:12:1 | LL | impl From for S { @@ -17,7 +17,7 @@ LL | impl From for S { = note: conflicting implementation in crate `core`: - impl From for T; -error[E0119]: conflicting implementations of trait `std::convert::TryFrom` for type `X`: +error[E0119]: conflicting implementations of trait `std::convert::TryFrom` for type `X` --> $DIR/conflict-with-std.rs:19:1 | LL | impl TryFrom for X { diff --git a/src/test/ui/error-codes/e0119/issue-23563.stderr b/src/test/ui/error-codes/e0119/issue-23563.stderr index 912a80fec75510bf57c1db13363b8adc56abe9d7..f149cef587f2550219afb4d79506154629310d9d 100644 --- a/src/test/ui/error-codes/e0119/issue-23563.stderr +++ b/src/test/ui/error-codes/e0119/issue-23563.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`: +error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>` --> $DIR/issue-23563.rs:13:1 | LL | impl<'a, T> LolFrom<&'a [T]> for LocalType { diff --git a/src/test/ui/error-codes/e0119/issue-27403.stderr b/src/test/ui/error-codes/e0119/issue-27403.stderr index ea74c9b21bd4a6f5d6866b49c27593cd82263886..c11a50487479e6cc4c415f19d3f09f352affb9f7 100644 --- a/src/test/ui/error-codes/e0119/issue-27403.stderr +++ b/src/test/ui/error-codes/e0119/issue-27403.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`: +error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>` --> $DIR/issue-27403.rs:5:1 | LL | impl Into for GenX { diff --git a/src/test/ui/error-codes/e0119/issue-28981.stderr b/src/test/ui/error-codes/e0119/issue-28981.stderr index e12dd7623310dc55a1777fcc5c7c15399a77b641..56e8e1eb5400242783f4c3d2fb35438adedbf48b 100644 --- a/src/test/ui/error-codes/e0119/issue-28981.stderr +++ b/src/test/ui/error-codes/e0119/issue-28981.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_`: +error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_` --> $DIR/issue-28981.rs:5:1 | LL | impl Deref for Foo { } diff --git a/src/test/ui/error-codes/e0119/so-37347311.stderr b/src/test/ui/error-codes/e0119/so-37347311.stderr index a9fbd0fee4981047da3389f68bd09d19c40aa834..f1c2b0d29742e30ddf60d1953e24e2552f618cf5 100644 --- a/src/test/ui/error-codes/e0119/so-37347311.stderr +++ b/src/test/ui/error-codes/e0119/so-37347311.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::convert::From>` for type `MyError<_>`: +error[E0119]: conflicting implementations of trait `std::convert::From>` for type `MyError<_>` --> $DIR/so-37347311.rs:11:1 | LL | impl From for MyError { diff --git a/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr b/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr index 5ce4c5cccb31e8ac62eb41a082864a92fc1c6caf..0526c6dc8398043d8561e9337040d608065d21ca 100644 --- a/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr +++ b/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyMarker`: +error[E0119]: conflicting implementations of trait `MyMarker` --> $DIR/feature-gate-overlapping_marker_traits.rs:6:1 | LL | impl MyMarker for T {} diff --git a/src/test/ui/impl-trait/auto-trait.full_tait.stderr b/src/test/ui/impl-trait/auto-trait.full_tait.stderr index 7ac08ab492129b4e31075addb1ea09780c751a65..314617748b0ba25427a38e0d35bde7b5b1fa0299 100644 --- a/src/test/ui/impl-trait/auto-trait.full_tait.stderr +++ b/src/test/ui/impl-trait/auto-trait.full_tait.stderr @@ -7,7 +7,7 @@ LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] = note: `#[warn(incomplete_features)]` on by default = note: see issue #63063 for more information -error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D`: +error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D` --> $DIR/auto-trait.rs:24:1 | LL | impl AnotherTrait for T {} diff --git a/src/test/ui/impl-trait/auto-trait.min_tait.stderr b/src/test/ui/impl-trait/auto-trait.min_tait.stderr index a497dd67e9e088b9ed28321dd2fbb41f878bc00d..75a5b0cb87db139a9f491e54937d36a66c891542 100644 --- a/src/test/ui/impl-trait/auto-trait.min_tait.stderr +++ b/src/test/ui/impl-trait/auto-trait.min_tait.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D`: +error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D` --> $DIR/auto-trait.rs:24:1 | LL | impl AnotherTrait for T {} diff --git a/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr b/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr index 2611205893f48e543474ba10bdf06e290209b347..bccbc8cb36b157d0a21334550978c0903f16682c 100644 --- a/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr +++ b/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr @@ -7,7 +7,7 @@ LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] = note: `#[warn(incomplete_features)]` on by default = note: see issue #63063 for more information -error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D`: +error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D` --> $DIR/negative-reasoning.rs:22:1 | LL | impl AnotherTrait for T {} diff --git a/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr b/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr index bd74b56fecc1054dca29f05780f0343135772591..5727a372ddbe838b4bffbb36d8d7514bdbd48d83 100644 --- a/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr +++ b/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D`: +error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D` --> $DIR/negative-reasoning.rs:22:1 | LL | impl AnotherTrait for T {} diff --git a/src/test/ui/issues/issue-28568.stderr b/src/test/ui/issues/issue-28568.stderr index 7729b9d240d28dfda41d204289ac2757f52eeb67..be3f7c627800dc135f5a5fc3330dc2072da94197 100644 --- a/src/test/ui/issues/issue-28568.stderr +++ b/src/test/ui/issues/issue-28568.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct`: +error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct` --> $DIR/issue-28568.rs:7:1 | LL | impl Drop for MyStruct { diff --git a/src/test/ui/issues/issue-41974.stderr b/src/test/ui/issues/issue-41974.stderr index cde285f73d6b80fbeeac985dd1692931f797d10d..11d77857d60cc96eb941ead57238bb92ece47586 100644 --- a/src/test/ui/issues/issue-41974.stderr +++ b/src/test/ui/issues/issue-41974.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_, _>`: +error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_, _>` --> $DIR/issue-41974.rs:7:1 | LL | impl Drop for T where T: A { diff --git a/src/test/ui/issues/issue-43355.stderr b/src/test/ui/issues/issue-43355.stderr index 75c69e5b3e3f506866f7f4a0cd8f127af8401f1d..23d8ed1848f59202335f8d51c914f2357c47e719 100644 --- a/src/test/ui/issues/issue-43355.stderr +++ b/src/test/ui/issues/issue-43355.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Trait1>` for type `A`: +error[E0119]: conflicting implementations of trait `Trait1>` for type `A` --> $DIR/issue-43355.rs:13:1 | LL | impl Trait1 for T where T: Trait2 { diff --git a/src/test/ui/issues/issue-48728.stderr b/src/test/ui/issues/issue-48728.stderr index a0698c20798356fe628e685972e71860d03a189f..ca2e234cee668d1623bf0800deb391609a66d787 100644 --- a/src/test/ui/issues/issue-48728.stderr +++ b/src/test/ui/issues/issue-48728.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `Node<[_]>`: +error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `Node<[_]>` --> $DIR/issue-48728.rs:4:10 | LL | #[derive(Clone)] diff --git a/src/test/ui/never_type/never-from-impl-is-reserved.stderr b/src/test/ui/never_type/never-from-impl-is-reserved.stderr index 8b8d0f4ea73bea6f27ca5e1e6efb48cd9d337e7f..871c512052821eae062ebdc38e666d299c6badf8 100644 --- a/src/test/ui/never_type/never-from-impl-is-reserved.stderr +++ b/src/test/ui/never_type/never-from-impl-is-reserved.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFoo`: +error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFoo` --> $DIR/never-from-impl-is-reserved.rs:10:1 | LL | impl MyTrait for MyFoo {} diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr index 2b4fa66ecf2820561246e54823601eadcdfcbe34..99560ed06888aeab78a1e16d1f2c0a2b3e950597 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::ops::Add` for type `i32`: +error[E0119]: conflicting implementations of trait `std::ops::Add` for type `i32` --> $DIR/const-and-non-const-impl.rs:6:1 | LL | impl const std::ops::Add for i32 { @@ -7,7 +7,7 @@ LL | impl const std::ops::Add for i32 { = note: conflicting implementation in crate `core`: - impl Add for i32; -error[E0119]: conflicting implementations of trait `std::ops::Add` for type `Int`: +error[E0119]: conflicting implementations of trait `std::ops::Add` for type `Int` --> $DIR/const-and-non-const-impl.rs:24:1 | LL | impl std::ops::Add for Int { diff --git a/src/test/ui/specialization/issue-52050.stderr b/src/test/ui/specialization/issue-52050.stderr index 27070f8e4a1ca88fe03bb1c2cd8b50aafe626ce4..ab3cf27d0d05922c7e37667b02ed06edb3c72459 100644 --- a/src/test/ui/specialization/issue-52050.stderr +++ b/src/test/ui/specialization/issue-52050.stderr @@ -8,7 +8,7 @@ LL | #![feature(specialization)] = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete -error[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()`: +error[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()` --> $DIR/issue-52050.rs:28:1 | LL | / impl IntoPyDictPointer for I diff --git a/src/test/ui/specialization/specialization-feature-gate-overlap.stderr b/src/test/ui/specialization/specialization-feature-gate-overlap.stderr index baaf7aa43321a4386dc75848cd51cb1697882ab0..9157ad0d46a1a57de04c3eeb422567eb347ea589 100644 --- a/src/test/ui/specialization/specialization-feature-gate-overlap.stderr +++ b/src/test/ui/specialization/specialization-feature-gate-overlap.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Foo` for type `u8`: +error[E0119]: conflicting implementations of trait `Foo` for type `u8` --> $DIR/specialization-feature-gate-overlap.rs:13:1 | LL | impl Foo for T { diff --git a/src/test/ui/specialization/specialization-overlap.stderr b/src/test/ui/specialization/specialization-overlap.stderr index 7e5c96ac1c88464407b6e5884b4bb5a9945a1d35..3ccbe1616e803c60d4842d92cf124dba0bed43a5 100644 --- a/src/test/ui/specialization/specialization-overlap.stderr +++ b/src/test/ui/specialization/specialization-overlap.stderr @@ -8,7 +8,7 @@ LL | #![feature(specialization)] = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete -error[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>`: +error[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>` --> $DIR/specialization-overlap.rs:5:1 | LL | impl Foo for T {} @@ -16,7 +16,7 @@ LL | impl Foo for T {} LL | impl Foo for Vec {} | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::vec::Vec<_>` -error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`: +error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)` --> $DIR/specialization-overlap.rs:9:1 | LL | impl Bar for (T, u8) {} @@ -24,7 +24,7 @@ LL | impl Bar for (T, u8) {} LL | impl Bar for (u8, T) {} | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)` -error[E0119]: conflicting implementations of trait `Baz` for type `u8`: +error[E0119]: conflicting implementations of trait `Baz` for type `u8` --> $DIR/specialization-overlap.rs:13:1 | LL | impl Baz for u8 {} @@ -32,7 +32,7 @@ LL | impl Baz for u8 {} LL | impl Baz for T {} | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8` -error[E0119]: conflicting implementations of trait `Qux`: +error[E0119]: conflicting implementations of trait `Qux` --> $DIR/specialization-overlap.rs:17:1 | LL | impl Qux for T {} diff --git a/src/test/ui/traits/alias/issue-83613.rs b/src/test/ui/traits/alias/issue-83613.rs new file mode 100644 index 0000000000000000000000000000000000000000..146920ac685bb1af95edeeaef6d1ae0b46fac4c5 --- /dev/null +++ b/src/test/ui/traits/alias/issue-83613.rs @@ -0,0 +1,13 @@ +#![feature(min_type_alias_impl_trait)] +trait OpaqueTrait {} +impl OpaqueTrait for T {} +type OpaqueType = impl OpaqueTrait; +fn mk_opaque() -> OpaqueType { + || 0 +} +trait AnotherTrait {} +impl AnotherTrait for T {} +impl AnotherTrait for OpaqueType {} +//~^ ERROR conflicting implementations of trait `AnotherTrait` for type `impl OpaqueTrait` +//~| ERROR cannot implement trait on type alias impl trait +fn main() {} diff --git a/src/test/ui/traits/alias/issue-83613.stderr b/src/test/ui/traits/alias/issue-83613.stderr new file mode 100644 index 0000000000000000000000000000000000000000..0ab39ae66728817fe79532d06078e3c82ecaed18 --- /dev/null +++ b/src/test/ui/traits/alias/issue-83613.stderr @@ -0,0 +1,23 @@ +error[E0119]: conflicting implementations of trait `AnotherTrait` for type `impl OpaqueTrait` + --> $DIR/issue-83613.rs:10:1 + | +LL | impl AnotherTrait for T {} + | -------------------------------- first implementation here +LL | impl AnotherTrait for OpaqueType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `impl OpaqueTrait` + +error: cannot implement trait on type alias impl trait + --> $DIR/issue-83613.rs:10:1 + | +LL | impl AnotherTrait for OpaqueType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: type alias impl trait defined here + --> $DIR/issue-83613.rs:4:19 + | +LL | type OpaqueType = impl OpaqueTrait; + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/traits/issue-33140-hack-boundaries.stderr b/src/test/ui/traits/issue-33140-hack-boundaries.stderr index ae65701ecb52ab96683b5baf458b46df79a97618..c87f1ff1f3f15130121b99318ccbc293ba8f03f4 100644 --- a/src/test/ui/traits/issue-33140-hack-boundaries.stderr +++ b/src/test/ui/traits/issue-33140-hack-boundaries.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn std::marker::Send + 'static)`: +error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn std::marker::Send + 'static)` --> $DIR/issue-33140-hack-boundaries.rs:18:1 | LL | impl Trait1 for dyn Send {} @@ -14,7 +14,7 @@ LL | impl Trait2 for dyn Send {} LL | impl !Trait2 for dyn Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here -error[E0119]: conflicting implementations of trait `Trait3<(dyn std::marker::Sync + 'static)>` for type `(dyn std::marker::Send + 'static)`: +error[E0119]: conflicting implementations of trait `Trait3<(dyn std::marker::Sync + 'static)>` for type `(dyn std::marker::Send + 'static)` --> $DIR/issue-33140-hack-boundaries.rs:32:1 | LL | impl Trait3 for dyn Send {} @@ -22,7 +22,7 @@ LL | impl Trait3 for dyn Send {} LL | impl Trait3 for dyn Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` -error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn std::marker::Send + 'static)`: +error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn std::marker::Send + 'static)` --> $DIR/issue-33140-hack-boundaries.rs:39:1 | LL | impl Trait4a for T {} @@ -30,7 +30,7 @@ LL | impl Trait4a for T {} LL | impl Trait4a for dyn Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)` -error[E0119]: conflicting implementations of trait `Trait4b` for type `()`: +error[E0119]: conflicting implementations of trait `Trait4b` for type `()` --> $DIR/issue-33140-hack-boundaries.rs:46:1 | LL | impl Trait4b for () {} @@ -38,7 +38,7 @@ LL | impl Trait4b for () {} LL | impl Trait4b for () {} | ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()` -error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + std::marker::Send + 'static)`: +error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + std::marker::Send + 'static)` --> $DIR/issue-33140-hack-boundaries.rs:53:1 | LL | impl Trait4c for dyn Trait1 + Send {} @@ -46,7 +46,7 @@ LL | impl Trait4c for dyn Trait1 + Send {} LL | impl Trait4c for dyn Trait1 + Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + std::marker::Send + 'static)` -error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn std::marker::Send`: +error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn std::marker::Send` --> $DIR/issue-33140-hack-boundaries.rs:60:1 | LL | impl<'a> Trait4d for dyn Send + 'a {} @@ -54,7 +54,7 @@ LL | impl<'a> Trait4d for dyn Send + 'a {} LL | impl<'a> Trait4d for dyn Send + 'a {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn std::marker::Send` -error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std::marker::Send + 'static)`: +error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std::marker::Send + 'static)` --> $DIR/issue-33140-hack-boundaries.rs:67:1 | LL | impl Trait5 for dyn Send {} diff --git a/src/test/ui/traits/issue-33140.stderr b/src/test/ui/traits/issue-33140.stderr index 9a900d2fc9404b108d038512d9691a11c459b5e3..392c56a282d7e5eb86c21789ecf74d999dd1db44 100644 --- a/src/test/ui/traits/issue-33140.stderr +++ b/src/test/ui/traits/issue-33140.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: +error[E0119]: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)` --> $DIR/issue-33140.rs:9:1 | LL | impl Trait for dyn Send + Sync { @@ -7,7 +7,7 @@ LL | impl Trait for dyn Send + Sync { LL | impl Trait for dyn Sync + Send { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)` -error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`: +error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn std::marker::Send + std::marker::Sync + 'static)` --> $DIR/issue-33140.rs:22:1 | LL | impl Trait2 for dyn Send + Sync { diff --git a/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr b/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr index 7cce45d2c8f8f1929ace12f1f52aa867d9f0bd68..b970ad762088d9880641bbab7c58a2115465633a 100644 --- a/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr +++ b/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `LocalTrait` for type `std::string::String`: +error[E0119]: conflicting implementations of trait `LocalTrait` for type `std::string::String` --> $DIR/rely-on-negative-impl-in-coherence.rs:19:1 | LL | impl LocalTrait for T { } diff --git a/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr b/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr index 94a0c287f4a32d693a43873fabc5e47b05fdee24..910c5e29dac0ea7fdefd12c57a7fd7533a368180 100644 --- a/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr +++ b/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::marker::Send` for type `MyStruct`: +error[E0119]: conflicting implementations of trait `std::marker::Send` for type `MyStruct` --> $DIR/overlap-not-permitted-for-builtin-trait.rs:7:1 | LL | impl !Send for MyStruct {} diff --git a/src/test/ui/traits/reservation-impl/coherence-conflict.stderr b/src/test/ui/traits/reservation-impl/coherence-conflict.stderr index 1a227a85c06f6e9c33265f0ae1d1d91e79d8df35..a811d7e32016b1a950508ad96ab97ddaa3dcca14 100644 --- a/src/test/ui/traits/reservation-impl/coherence-conflict.stderr +++ b/src/test/ui/traits/reservation-impl/coherence-conflict.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `OtherTrait` for type `()`: +error[E0119]: conflicting implementations of trait `OtherTrait` for type `()` --> $DIR/coherence-conflict.rs:11:1 | LL | impl OtherTrait for () {} diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr index 30521b8bf7d9198b921a552db39ae6a1d865a54b..6d1a59aafeda4080070d28558ab4495223513b92 100644 --- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr @@ -7,7 +7,7 @@ LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))] = note: `#[warn(incomplete_features)]` on by default = note: see issue #63063 for more information -error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`: +error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_` --> $DIR/incoherent-assoc-imp-trait.rs:13:1 | LL | impl FnOnce<()> for &F { diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr index a0427624ec3fe5050a15f42b3cbdb27727a720a0..5c02b602d528bc52f54f1d18cbfe21ce1452f549 100644 --- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr +++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`: +error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_` --> $DIR/incoherent-assoc-imp-trait.rs:13:1 | LL | impl FnOnce<()> for &F {