From 9ce811cd004e4f1bb7042d0f3fa4b54ffbe9421f Mon Sep 17 00:00:00 2001 From: Jonathan Birk <1965620+cafce25@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:55:27 +0200 Subject: [PATCH 1/4] Change orphan hint from "only" to "any uncovered type inside..." --- compiler/rustc_hir_analysis/messages.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index 367f6e17e7fe6..33bda77e3353b 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -351,7 +351,7 @@ hir_analysis_only_current_traits_arbitrary = only traits defined in the current hir_analysis_only_current_traits_foreign = this is not defined in the current crate because this is a foreign trait -hir_analysis_only_current_traits_label = impl doesn't use only types from inside the current crate +hir_analysis_only_current_traits_label = impl doesn't use any uncovered types from inside the current crate hir_analysis_only_current_traits_name = this is not defined in the current crate because {$name} are always foreign From 86a9959466dd996bd9bc926bd79289fdf7f1790d Mon Sep 17 00:00:00 2001 From: Jonathan Birk Date: Tue, 30 Jul 2024 15:39:04 +0000 Subject: [PATCH 2/4] Adjust orphan note in tests --- tests/ui/coherence/coherence-cow.re_a.stderr | 2 +- tests/ui/coherence/coherence-cow.re_b.stderr | 2 +- tests/ui/coherence/coherence-cow.re_c.stderr | 2 +- .../coherence-fundamental-trait-objects.stderr | 2 +- ...impl-trait-for-marker-trait-negative.stderr | 2 +- ...impl-trait-for-marker-trait-positive.stderr | 2 +- tests/ui/coherence/coherence-impls-copy.stderr | 8 ++++---- tests/ui/coherence/coherence-impls-send.stderr | 6 +++--- .../ui/coherence/coherence-impls-sized.stderr | 6 +++--- .../coherence-negative-impls-copy-bad.stderr | 6 +++--- tests/ui/coherence/coherence-orphan.stderr | 4 ++-- .../coherence-overlapping-pairs.stderr | 2 +- .../coherence-pair-covered-uncovered-1.stderr | 2 +- .../coherence-pair-covered-uncovered.stderr | 2 +- .../ui/coherence/coherence-vec-local-2.stderr | 2 +- tests/ui/coherence/coherence-vec-local.stderr | 2 +- .../coherence_local_err_struct.stderr | 2 +- .../coherence/coherence_local_err_tuple.stderr | 2 +- .../coherence/impl-foreign-for-foreign.stderr | 2 +- .../impl-foreign-for-foreign[foreign].stderr | 6 +++--- ...mpl-foreign-for-fundamental[foreign].stderr | 4 ++-- .../impl-foreign[foreign]-for-foreign.stderr | 2 +- ...gn[fundemental[foreign]]-for-foreign.stderr | 6 +++--- .../impl[t]-foreign-for-foreign[t].stderr | 4 ++-- tests/ui/dropck/drop-on-non-struct.stderr | 2 +- tests/ui/error-codes/E0117.stderr | 2 +- tests/ui/error-codes/e0119/complex-impl.stderr | 2 +- .../issue-99572-impl-trait-on-pointer.rs | 18 +++++++++--------- .../issue-99572-impl-trait-on-pointer.stderr | 4 ++-- tests/ui/issues/issue-67535.stderr | 6 +++--- .../const-and-non-const-impl.stderr | 2 +- .../coherence.classic.stderr | 2 +- .../coherence.next.stderr | 2 +- .../range_patterns_trait_impls2.stderr | 2 +- ...ult-trait-impl-cross-crate-coherence.stderr | 6 +++--- 35 files changed, 64 insertions(+), 64 deletions(-) diff --git a/tests/ui/coherence/coherence-cow.re_a.stderr b/tests/ui/coherence/coherence-cow.re_a.stderr index 0bc017817b67d..3e929d4fb3379 100644 --- a/tests/ui/coherence/coherence-cow.re_a.stderr +++ b/tests/ui/coherence/coherence-cow.re_a.stderr @@ -5,7 +5,7 @@ LL | impl Remote for Pair> { } | ^^^^^^^^^^^^^^^^^^^---------------- | | | | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-cow.re_b.stderr b/tests/ui/coherence/coherence-cow.re_b.stderr index 9bdb49dcc04ff..d267f859aea28 100644 --- a/tests/ui/coherence/coherence-cow.re_b.stderr +++ b/tests/ui/coherence/coherence-cow.re_b.stderr @@ -5,7 +5,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-cow.re_c.stderr b/tests/ui/coherence/coherence-cow.re_c.stderr index dfff2667ebbcc..e2671cc3dd155 100644 --- a/tests/ui/coherence/coherence-cow.re_c.stderr +++ b/tests/ui/coherence/coherence-cow.re_c.stderr @@ -5,7 +5,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-fundamental-trait-objects.stderr b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr index db6a94748042d..a0bf8f23f2c61 100644 --- a/tests/ui/coherence/coherence-fundamental-trait-objects.stderr +++ b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr @@ -5,7 +5,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr index ea38afc40ce80..abe752cb65e99 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr @@ -41,7 +41,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr index 2a8713bc32794..99a32f1bf9347 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr @@ -41,7 +41,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impls-copy.stderr b/tests/ui/coherence/coherence-impls-copy.stderr index f529a056b0fd5..e8db69fa983d9 100644 --- a/tests/ui/coherence/coherence-impls-copy.stderr +++ b/tests/ui/coherence/coherence-impls-copy.stderr @@ -15,7 +15,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -26,7 +26,7 @@ LL | impl Copy for i32 {} | ^^^^^^^^^^^^^^--- | | | | | `i32` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -43,7 +43,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -60,7 +60,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impls-send.stderr b/tests/ui/coherence/coherence-impls-send.stderr index e1071846e146e..2432e6f22d13a 100644 --- a/tests/ui/coherence/coherence-impls-send.stderr +++ b/tests/ui/coherence/coherence-impls-send.stderr @@ -5,7 +5,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -16,7 +16,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -33,7 +33,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impls-sized.stderr b/tests/ui/coherence/coherence-impls-sized.stderr index 17a7544521de5..5069f752f7434 100644 --- a/tests/ui/coherence/coherence-impls-sized.stderr +++ b/tests/ui/coherence/coherence-impls-sized.stderr @@ -23,7 +23,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -46,7 +46,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -63,7 +63,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr b/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr index 2295d6315d1c2..2994d1ce0e54a 100644 --- a/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr +++ b/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr @@ -5,7 +5,7 @@ LL | impl !Copy for str {} | ^^^^^^^^^^^^^^^--- | | | | | `str` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -16,7 +16,7 @@ LL | impl !Copy for fn() {} | ^^^^^^^^^^^^^^^---- | | | | | `fn()` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -27,7 +27,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-orphan.stderr b/tests/ui/coherence/coherence-orphan.stderr index f6ffae342908a..11b90d8bf2a3f 100644 --- a/tests/ui/coherence/coherence-orphan.stderr +++ b/tests/ui/coherence/coherence-orphan.stderr @@ -6,7 +6,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -17,7 +17,7 @@ LL | impl !Send for Vec {} | ^^^^^^^^^^^^^^^---------- | | | | | `Vec` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-overlapping-pairs.stderr b/tests/ui/coherence/coherence-overlapping-pairs.stderr index 4d0a9c6ee1400..17bb8dc314d20 100644 --- a/tests/ui/coherence/coherence-overlapping-pairs.stderr +++ b/tests/ui/coherence/coherence-overlapping-pairs.stderr @@ -5,7 +5,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr index 15cd66e9d09d0..f2a3ec4daae6f 100644 --- a/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr +++ b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr @@ -6,7 +6,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-pair-covered-uncovered.stderr b/tests/ui/coherence/coherence-pair-covered-uncovered.stderr index 359dbe8509d80..e3f85c3215374 100644 --- a/tests/ui/coherence/coherence-pair-covered-uncovered.stderr +++ b/tests/ui/coherence/coherence-pair-covered-uncovered.stderr @@ -5,7 +5,7 @@ LL | impl Remote for Pair> { } | ^^^^^^^^^^^^^^^^^^^^^---------------- | | | | | `Pair` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-vec-local-2.stderr b/tests/ui/coherence/coherence-vec-local-2.stderr index e4249710d0028..1998dedbbc895 100644 --- a/tests/ui/coherence/coherence-vec-local-2.stderr +++ b/tests/ui/coherence/coherence-vec-local-2.stderr @@ -5,7 +5,7 @@ LL | impl Remote for Vec> { } | ^^^^^^^^^^^^^^^^^^^------------- | | | | | `Vec` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-vec-local.stderr b/tests/ui/coherence/coherence-vec-local.stderr index c465fb1966eb8..6e95eb7251f6d 100644 --- a/tests/ui/coherence/coherence-vec-local.stderr +++ b/tests/ui/coherence/coherence-vec-local.stderr @@ -5,7 +5,7 @@ LL | impl Remote for Vec { } | ^^^^^^^^^^^^^^^^---------- | | | | | `Vec` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence_local_err_struct.stderr b/tests/ui/coherence/coherence_local_err_struct.stderr index 96572b5a71648..bbf968d5d131c 100644 --- a/tests/ui/coherence/coherence_local_err_struct.stderr +++ b/tests/ui/coherence/coherence_local_err_struct.stderr @@ -5,7 +5,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence_local_err_tuple.stderr b/tests/ui/coherence/coherence_local_err_tuple.stderr index 85a063bb34ae2..c988e738af4d8 100644 --- a/tests/ui/coherence/coherence_local_err_tuple.stderr +++ b/tests/ui/coherence/coherence_local_err_tuple.stderr @@ -5,7 +5,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign-for-foreign.stderr b/tests/ui/coherence/impl-foreign-for-foreign.stderr index 6c74b47a1c48e..81ae36c6a53db 100644 --- a/tests/ui/coherence/impl-foreign-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign-for-foreign.stderr @@ -5,7 +5,7 @@ LL | impl Remote for i32 { | ^^^^^^^^^^^^^^^^--- | | | | | `i32` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr b/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr index e24537bce229a..9ac7aeff46122 100644 --- a/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr +++ b/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr @@ -6,7 +6,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -18,7 +18,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -30,7 +30,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr b/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr index 55ea4409e6f36..fff6a6b511e17 100644 --- a/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr +++ b/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr @@ -6,7 +6,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -18,7 +18,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr b/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr index fe8a34b78cfd0..ca85063986215 100644 --- a/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr @@ -6,7 +6,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr b/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr index 8e77c13e1116a..cc0882095e22f 100644 --- a/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr @@ -7,7 +7,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -20,7 +20,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -33,7 +33,7 @@ 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 + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr b/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr index 92346c29198ce..11260b7d64a33 100644 --- a/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr +++ b/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr @@ -5,7 +5,7 @@ LL | impl Remote for Rc { | ^^^^^^^^^^^^^^^^--------- | | | | | `Rc` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -16,7 +16,7 @@ LL | impl Remote for Arc { | ^^^^^^^^^^^^^^^^^^^------ | | | | | `Arc` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/dropck/drop-on-non-struct.stderr b/tests/ui/dropck/drop-on-non-struct.stderr index e8fbe5e972642..ec0b2e0d0b645 100644 --- a/tests/ui/dropck/drop-on-non-struct.stderr +++ b/tests/ui/dropck/drop-on-non-struct.stderr @@ -11,7 +11,7 @@ LL | impl<'a> Drop for &'a mut isize { | ^^^^^^^^^^^^^^^^^^------------- | | | | | `isize` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/error-codes/E0117.stderr b/tests/ui/error-codes/E0117.stderr index f144aa9f72c13..86328e8131ac0 100644 --- a/tests/ui/error-codes/E0117.stderr +++ b/tests/ui/error-codes/E0117.stderr @@ -5,7 +5,7 @@ LL | impl Drop for u32 {} | ^^^^^^^^^^^^^^--- | | | | | `u32` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/error-codes/e0119/complex-impl.stderr b/tests/ui/error-codes/e0119/complex-impl.stderr index c0519c60e4227..6562593adfafc 100644 --- a/tests/ui/error-codes/e0119/complex-impl.stderr +++ b/tests/ui/error-codes/e0119/complex-impl.stderr @@ -5,7 +5,7 @@ LL | impl External for (Q, R) {} | ^^^^^^^^^^^^^^^^^^^^^------ | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs b/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs index 272c6bd3fb782..ae2329ec9c8ca 100644 --- a/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs +++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs @@ -5,21 +5,21 @@ use std::{fmt, marker}; struct LocalType; impl fmt::Display for *mut LocalType { -//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types -//~| NOTE impl doesn't use only types from inside the current crate -//~| NOTE `*mut LocalType` is not defined in the current crate because raw pointers are always foreign -//~| NOTE define and implement a trait or new type instead -//~| HELP consider introducing a new wrapper type + //~^ ERROR only traits defined in the current crate can be implemented for arbitrary types + //~| NOTE impl doesn't use any uncovered types from inside the current crate + //~| NOTE `*mut LocalType` is not defined in the current crate because raw pointers are always foreign + //~| NOTE define and implement a trait or new type instead + //~| HELP consider introducing a new wrapper type fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "This not compile") } } impl marker::Copy for *mut T { -//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types -//~| NOTE impl doesn't use only types from inside the current crate -//~| NOTE `*mut T` is not defined in the current crate because raw pointers are always foreign -//~| NOTE define and implement a trait or new type instead + //~^ ERROR only traits defined in the current crate can be implemented for arbitrary types + //~| NOTE impl doesn't use any uncovered types from inside the current crate + //~| NOTE `*mut T` is not defined in the current crate because raw pointers are always foreign + //~| NOTE define and implement a trait or new type instead } fn main() {} diff --git a/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr index 78d7a47deaac3..5809387e91716 100644 --- a/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr +++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr @@ -5,7 +5,7 @@ LL | impl fmt::Display for *mut LocalType { | ^^^^^^^^^^^^^^^^^^^^^^-------------- | | | | | `*mut LocalType` is not defined in the current crate because raw pointers are always foreign - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead help: consider introducing a new wrapper type @@ -22,7 +22,7 @@ LL | impl marker::Copy for *mut T { | ^^^^^^^^^^^^^^^^^^^^^^^^^------ | | | | | `*mut T` is not defined in the current crate because raw pointers are always foreign - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/issues/issue-67535.stderr b/tests/ui/issues/issue-67535.stderr index 4d7a02a50969f..4bfbf1bffdbe7 100644 --- a/tests/ui/issues/issue-67535.stderr +++ b/tests/ui/issues/issue-67535.stderr @@ -6,7 +6,7 @@ LL | impl std::ops::AddAssign for () { | | | | | | | this is not defined in the current crate because tuples are always foreign | | this is not defined in the current crate because this is a foreign trait - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -18,7 +18,7 @@ LL | impl std::ops::AddAssign for [(); 1] { | | | | | | | this is not defined in the current crate because arrays are always foreign | | this is not defined in the current crate because this is a foreign trait - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -30,7 +30,7 @@ LL | impl std::ops::AddAssign for &[u8] { | | | | | | | this is not defined in the current crate because slices are always foreign | | this is not defined in the current crate because this is a foreign trait - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr index 9c1c8df8da459..056cd76075e1b 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr @@ -33,7 +33,7 @@ LL | impl const std::ops::Add for i32 { | | | | | | | `i32` is not defined in the current crate | | `i32` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/type-alias-impl-trait/coherence.classic.stderr b/tests/ui/type-alias-impl-trait/coherence.classic.stderr index ff059bc5806de..3930a7513d879 100644 --- a/tests/ui/type-alias-impl-trait/coherence.classic.stderr +++ b/tests/ui/type-alias-impl-trait/coherence.classic.stderr @@ -5,7 +5,7 @@ LL | impl foreign_crate::ForeignTrait for AliasOfForeignType<()> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------- | | | | | type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/type-alias-impl-trait/coherence.next.stderr b/tests/ui/type-alias-impl-trait/coherence.next.stderr index dab2786c1f0fb..bbda986818848 100644 --- a/tests/ui/type-alias-impl-trait/coherence.next.stderr +++ b/tests/ui/type-alias-impl-trait/coherence.next.stderr @@ -5,7 +5,7 @@ LL | impl foreign_crate::ForeignTrait for AliasOfForeignType<()> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------- | | | | | `AliasOfForeignType<()>` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr b/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr index 41f42455bde0a..5403b4fd2dc87 100644 --- a/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr +++ b/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr @@ -5,7 +5,7 @@ LL | impl Eq for Y {} | ^^^^^^^^^^^^- | | | | | `(u32) is 1..=` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead diff --git a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr index 32e6e88fc4834..65202c1369160 100644 --- a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr +++ b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr @@ -5,7 +5,7 @@ LL | impl DefaultedTrait for (A,) {} | ^^^^^^^^^^^^^^^^^^^^^^^^---- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -16,7 +16,7 @@ LL | impl !DefaultedTrait for (B,) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^---- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead @@ -33,7 +33,7 @@ LL | impl DefaultedTrait for lib::Something {} | ^^^^^^^^^^^^^^^^^^^^^^^^----------------- | | | | | `Something` is not defined in the current crate - | impl doesn't use only types from inside the current crate + | impl doesn't use any uncovered types from inside the current crate | = note: define and implement a trait or new type instead From ca94dd5beac8252f03047a1eeb6a7c456b467c03 Mon Sep 17 00:00:00 2001 From: Jonathan Birk Date: Sun, 11 Aug 2024 10:13:50 +0000 Subject: [PATCH 3/4] Add more information link to orphan impls --- compiler/rustc_hir_analysis/messages.ftl | 4 +++- compiler/rustc_hir_analysis/src/errors.rs | 3 +++ tests/ui/coherence/coherence-cow.re_a.stderr | 3 ++- tests/ui/coherence/coherence-cow.re_b.stderr | 3 ++- tests/ui/coherence/coherence-cow.re_c.stderr | 3 ++- .../coherence-fundamental-trait-objects.stderr | 3 ++- ...rence-impl-trait-for-marker-trait-negative.stderr | 3 ++- ...rence-impl-trait-for-marker-trait-positive.stderr | 3 ++- tests/ui/coherence/coherence-impls-copy.stderr | 12 ++++++++---- tests/ui/coherence/coherence-impls-send.stderr | 9 ++++++--- tests/ui/coherence/coherence-impls-sized.stderr | 9 ++++++--- .../coherence-negative-impls-copy-bad.stderr | 9 ++++++--- tests/ui/coherence/coherence-orphan.stderr | 6 ++++-- .../ui/coherence/coherence-overlapping-pairs.stderr | 3 ++- .../coherence-pair-covered-uncovered-1.stderr | 3 ++- .../coherence-pair-covered-uncovered.stderr | 3 ++- tests/ui/coherence/coherence-vec-local-2.stderr | 3 ++- tests/ui/coherence/coherence-vec-local.stderr | 3 ++- tests/ui/coherence/coherence_local_err_struct.stderr | 3 ++- tests/ui/coherence/coherence_local_err_tuple.stderr | 3 ++- tests/ui/coherence/impl-foreign-for-foreign.stderr | 3 ++- .../impl-foreign-for-foreign[foreign].stderr | 9 ++++++--- .../impl-foreign-for-fundamental[foreign].stderr | 6 ++++-- .../impl-foreign[foreign]-for-foreign.stderr | 3 ++- ...-foreign[fundemental[foreign]]-for-foreign.stderr | 9 ++++++--- .../coherence/impl[t]-foreign-for-foreign[t].stderr | 6 ++++-- tests/ui/dropck/drop-on-non-struct.stderr | 3 ++- tests/ui/error-codes/E0117.stderr | 3 ++- tests/ui/error-codes/e0119/complex-impl.stderr | 3 ++- tests/ui/errors/issue-99572-impl-trait-on-pointer.rs | 6 ++++-- .../errors/issue-99572-impl-trait-on-pointer.stderr | 8 +++++--- tests/ui/issues/issue-67535.stderr | 9 ++++++--- .../const-and-non-const-impl.stderr | 3 ++- .../type-alias-impl-trait/coherence.classic.stderr | 3 ++- tests/ui/type-alias-impl-trait/coherence.next.stderr | 3 ++- .../pattern_types/range_patterns_trait_impls2.stderr | 3 ++- ...k-default-trait-impl-cross-crate-coherence.stderr | 9 ++++++--- 37 files changed, 121 insertions(+), 59 deletions(-) diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index 33bda77e3353b..c81f1c62be9cc 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -351,7 +351,9 @@ hir_analysis_only_current_traits_arbitrary = only traits defined in the current hir_analysis_only_current_traits_foreign = this is not defined in the current crate because this is a foreign trait -hir_analysis_only_current_traits_label = impl doesn't use any uncovered types from inside the current crate +hir_analysis_only_current_traits_label = impl doesn't have any local type before any uncovered type parameters + +hir_analysis_only_current_traits_label_more_info = for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules hir_analysis_only_current_traits_name = this is not defined in the current crate because {$name} are always foreign diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index b1ac973ef2e00..9488f2f86cb3e 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -1441,6 +1441,7 @@ pub enum OnlyCurrentTraits { Outside { #[primary_span] #[label(hir_analysis_only_current_traits_label)] + #[label(hir_analysis_only_current_traits_label_more_info)] span: Span, #[note(hir_analysis_only_current_traits_note)] note: (), @@ -1449,6 +1450,7 @@ pub enum OnlyCurrentTraits { Primitive { #[primary_span] #[label(hir_analysis_only_current_traits_label)] + #[label(hir_analysis_only_current_traits_label_more_info)] span: Span, #[note(hir_analysis_only_current_traits_note)] note: (), @@ -1457,6 +1459,7 @@ pub enum OnlyCurrentTraits { Arbitrary { #[primary_span] #[label(hir_analysis_only_current_traits_label)] + #[label(hir_analysis_only_current_traits_label_more_info)] span: Span, #[note(hir_analysis_only_current_traits_note)] note: (), diff --git a/tests/ui/coherence/coherence-cow.re_a.stderr b/tests/ui/coherence/coherence-cow.re_a.stderr index 3e929d4fb3379..b4331fc475b1e 100644 --- a/tests/ui/coherence/coherence-cow.re_a.stderr +++ b/tests/ui/coherence/coherence-cow.re_a.stderr @@ -5,7 +5,8 @@ LL | impl Remote for Pair> { } | ^^^^^^^^^^^^^^^^^^^---------------- | | | | | `Pair` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-cow.re_b.stderr b/tests/ui/coherence/coherence-cow.re_b.stderr index d267f859aea28..b401d96459885 100644 --- a/tests/ui/coherence/coherence-cow.re_b.stderr +++ b/tests/ui/coherence/coherence-cow.re_b.stderr @@ -5,7 +5,8 @@ LL | impl Remote for Pair,T> { } | ^^^^^^^^^^^^^^^^^^^---------------- | | | | | `Pair` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-cow.re_c.stderr b/tests/ui/coherence/coherence-cow.re_c.stderr index e2671cc3dd155..d95beee8139e2 100644 --- a/tests/ui/coherence/coherence-cow.re_c.stderr +++ b/tests/ui/coherence/coherence-cow.re_c.stderr @@ -5,7 +5,8 @@ LL | impl Remote for Pair,U> { } | ^^^^^^^^^^^^^^^^^^^^^---------------- | | | | | `Pair` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-fundamental-trait-objects.stderr b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr index a0bf8f23f2c61..4933fb155f732 100644 --- a/tests/ui/coherence/coherence-fundamental-trait-objects.stderr +++ b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr @@ -5,7 +5,8 @@ LL | impl Misc for dyn Fundamental {} | ^^^^^^^^^^^^^^---------------------- | | | | | `dyn Fundamental` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr index abe752cb65e99..c8b215037b9ef 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr @@ -41,7 +41,8 @@ LL | impl !Send for dyn Marker2 {} | ^^^^^^^^^^^^^^^----------- | | | | | `dyn Marker2` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr index 99a32f1bf9347..02107453a9ff3 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr @@ -41,7 +41,8 @@ LL | unsafe impl Send for dyn Marker2 {} | ^^^^^^^^^^^^^^^^^^^^^----------- | | | | | `dyn Marker2` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impls-copy.stderr b/tests/ui/coherence/coherence-impls-copy.stderr index e8db69fa983d9..2de854ed58430 100644 --- a/tests/ui/coherence/coherence-impls-copy.stderr +++ b/tests/ui/coherence/coherence-impls-copy.stderr @@ -15,7 +15,8 @@ LL | impl Copy for &'static [NotSync] {} | ^^^^^^^^^^^^^^------------------ | | | | | this is not defined in the current crate because slices are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -26,7 +27,8 @@ LL | impl Copy for i32 {} | ^^^^^^^^^^^^^^--- | | | | | `i32` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -43,7 +45,8 @@ LL | impl Copy for (MyType, MyType) {} | ^^^^^^^^^^^^^^---------------- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -60,7 +63,8 @@ LL | impl Copy for [MyType] {} | ^^^^^^^^^^^^^^-------- | | | | | this is not defined in the current crate because slices are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impls-send.stderr b/tests/ui/coherence/coherence-impls-send.stderr index 2432e6f22d13a..a41e9d620e01c 100644 --- a/tests/ui/coherence/coherence-impls-send.stderr +++ b/tests/ui/coherence/coherence-impls-send.stderr @@ -5,7 +5,8 @@ LL | unsafe impl Send for &'static [NotSync] {} | ^^^^^^^^^^^^^^^^^^^^^------------------ | | | | | this is not defined in the current crate because slices are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -16,7 +17,8 @@ LL | unsafe impl Send for (MyType, MyType) {} | ^^^^^^^^^^^^^^^^^^^^^---------------- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -33,7 +35,8 @@ LL | unsafe impl Send for [MyType] {} | ^^^^^^^^^^^^^^^^^^^^^-------- | | | | | this is not defined in the current crate because slices are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-impls-sized.stderr b/tests/ui/coherence/coherence-impls-sized.stderr index 5069f752f7434..080d19e075b5f 100644 --- a/tests/ui/coherence/coherence-impls-sized.stderr +++ b/tests/ui/coherence/coherence-impls-sized.stderr @@ -23,7 +23,8 @@ LL | impl Sized for (MyType, MyType) {} | ^^^^^^^^^^^^^^^---------------- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -46,7 +47,8 @@ LL | impl Sized for [MyType] {} | ^^^^^^^^^^^^^^^-------- | | | | | this is not defined in the current crate because slices are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -63,7 +65,8 @@ LL | impl Sized for &'static [NotSync] {} | ^^^^^^^^^^^^^^^------------------ | | | | | this is not defined in the current crate because slices are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr b/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr index 2994d1ce0e54a..85937c5f02a81 100644 --- a/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr +++ b/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr @@ -5,7 +5,8 @@ LL | impl !Copy for str {} | ^^^^^^^^^^^^^^^--- | | | | | `str` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -16,7 +17,8 @@ LL | impl !Copy for fn() {} | ^^^^^^^^^^^^^^^---- | | | | | `fn()` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -27,7 +29,8 @@ LL | impl !Copy for () {} | ^^^^^^^^^^^^^^^-- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-orphan.stderr b/tests/ui/coherence/coherence-orphan.stderr index 11b90d8bf2a3f..c10ed013ef251 100644 --- a/tests/ui/coherence/coherence-orphan.stderr +++ b/tests/ui/coherence/coherence-orphan.stderr @@ -6,7 +6,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -17,7 +18,8 @@ LL | impl !Send for Vec {} | ^^^^^^^^^^^^^^^---------- | | | | | `Vec` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-overlapping-pairs.stderr b/tests/ui/coherence/coherence-overlapping-pairs.stderr index 17bb8dc314d20..448e7b9d5ef15 100644 --- a/tests/ui/coherence/coherence-overlapping-pairs.stderr +++ b/tests/ui/coherence/coherence-overlapping-pairs.stderr @@ -5,7 +5,8 @@ LL | impl Remote for lib::Pair { } | ^^^^^^^^^^^^^^^^^^^---------------- | | | | | `Pair` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr index f2a3ec4daae6f..2e616fefe0ee3 100644 --- a/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr +++ b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr @@ -6,7 +6,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-pair-covered-uncovered.stderr b/tests/ui/coherence/coherence-pair-covered-uncovered.stderr index e3f85c3215374..71a1e4c7ac3fb 100644 --- a/tests/ui/coherence/coherence-pair-covered-uncovered.stderr +++ b/tests/ui/coherence/coherence-pair-covered-uncovered.stderr @@ -5,7 +5,8 @@ LL | impl Remote for Pair> { } | ^^^^^^^^^^^^^^^^^^^^^---------------- | | | | | `Pair` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-vec-local-2.stderr b/tests/ui/coherence/coherence-vec-local-2.stderr index 1998dedbbc895..50788e4a990eb 100644 --- a/tests/ui/coherence/coherence-vec-local-2.stderr +++ b/tests/ui/coherence/coherence-vec-local-2.stderr @@ -5,7 +5,8 @@ LL | impl Remote for Vec> { } | ^^^^^^^^^^^^^^^^^^^------------- | | | | | `Vec` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence-vec-local.stderr b/tests/ui/coherence/coherence-vec-local.stderr index 6e95eb7251f6d..cd102fa1c6d1b 100644 --- a/tests/ui/coherence/coherence-vec-local.stderr +++ b/tests/ui/coherence/coherence-vec-local.stderr @@ -5,7 +5,8 @@ LL | impl Remote for Vec { } | ^^^^^^^^^^^^^^^^---------- | | | | | `Vec` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence_local_err_struct.stderr b/tests/ui/coherence/coherence_local_err_struct.stderr index bbf968d5d131c..97a26b54a1be0 100644 --- a/tests/ui/coherence/coherence_local_err_struct.stderr +++ b/tests/ui/coherence/coherence_local_err_struct.stderr @@ -5,7 +5,8 @@ LL | impl lib::MyCopy for lib::MyStruct { } | ^^^^^^^^^^^^^^^^^^^^^--------------------- | | | | | `MyStruct` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/coherence_local_err_tuple.stderr b/tests/ui/coherence/coherence_local_err_tuple.stderr index c988e738af4d8..cdd73be86bfa0 100644 --- a/tests/ui/coherence/coherence_local_err_tuple.stderr +++ b/tests/ui/coherence/coherence_local_err_tuple.stderr @@ -5,7 +5,8 @@ LL | impl lib::MyCopy for (MyType,) { } | ^^^^^^^^^^^^^^^^^^^^^--------- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign-for-foreign.stderr b/tests/ui/coherence/impl-foreign-for-foreign.stderr index 81ae36c6a53db..0f8af5ef0280b 100644 --- a/tests/ui/coherence/impl-foreign-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign-for-foreign.stderr @@ -5,7 +5,8 @@ LL | impl Remote for i32 { | ^^^^^^^^^^^^^^^^--- | | | | | `i32` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr b/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr index 9ac7aeff46122..ae1807f6dd055 100644 --- a/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr +++ b/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr @@ -6,7 +6,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -18,7 +19,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -30,7 +32,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr b/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr index fff6a6b511e17..a3522a75c86cf 100644 --- a/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr +++ b/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr @@ -6,7 +6,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -18,7 +19,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr b/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr index ca85063986215..bf22e73dd09d8 100644 --- a/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr @@ -6,7 +6,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr b/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr index cc0882095e22f..2ab5cca7983cb 100644 --- a/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr @@ -7,7 +7,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -20,7 +21,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -33,7 +35,8 @@ 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 any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr b/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr index 11260b7d64a33..ca9a7d5cd930a 100644 --- a/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr +++ b/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr @@ -5,7 +5,8 @@ LL | impl Remote for Rc { | ^^^^^^^^^^^^^^^^--------- | | | | | `Rc` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -16,7 +17,8 @@ LL | impl Remote for Arc { | ^^^^^^^^^^^^^^^^^^^------ | | | | | `Arc` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/dropck/drop-on-non-struct.stderr b/tests/ui/dropck/drop-on-non-struct.stderr index ec0b2e0d0b645..78b7212b6d9fd 100644 --- a/tests/ui/dropck/drop-on-non-struct.stderr +++ b/tests/ui/dropck/drop-on-non-struct.stderr @@ -11,7 +11,8 @@ LL | impl<'a> Drop for &'a mut isize { | ^^^^^^^^^^^^^^^^^^------------- | | | | | `isize` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/error-codes/E0117.stderr b/tests/ui/error-codes/E0117.stderr index 86328e8131ac0..2bfa78d1954d7 100644 --- a/tests/ui/error-codes/E0117.stderr +++ b/tests/ui/error-codes/E0117.stderr @@ -5,7 +5,8 @@ LL | impl Drop for u32 {} | ^^^^^^^^^^^^^^--- | | | | | `u32` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/error-codes/e0119/complex-impl.stderr b/tests/ui/error-codes/e0119/complex-impl.stderr index 6562593adfafc..36618cee0e837 100644 --- a/tests/ui/error-codes/e0119/complex-impl.stderr +++ b/tests/ui/error-codes/e0119/complex-impl.stderr @@ -5,7 +5,8 @@ LL | impl External for (Q, R) {} | ^^^^^^^^^^^^^^^^^^^^^------ | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs b/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs index ae2329ec9c8ca..61f11a88c6144 100644 --- a/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs +++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs @@ -6,7 +6,8 @@ struct LocalType; impl fmt::Display for *mut LocalType { //~^ ERROR only traits defined in the current crate can be implemented for arbitrary types - //~| NOTE impl doesn't use any uncovered types from inside the current crate + //~| NOTE impl doesn't have any local type before any uncovered type parameters + //~| NOTE for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules //~| NOTE `*mut LocalType` is not defined in the current crate because raw pointers are always foreign //~| NOTE define and implement a trait or new type instead //~| HELP consider introducing a new wrapper type @@ -17,7 +18,8 @@ impl fmt::Display for *mut LocalType { impl marker::Copy for *mut T { //~^ ERROR only traits defined in the current crate can be implemented for arbitrary types - //~| NOTE impl doesn't use any uncovered types from inside the current crate + //~| NOTE impl doesn't have any local type before any uncovered type parameters + //~| NOTE for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules //~| NOTE `*mut T` is not defined in the current crate because raw pointers are always foreign //~| NOTE define and implement a trait or new type instead } diff --git a/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr index 5809387e91716..214618d6636fb 100644 --- a/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr +++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr @@ -5,7 +5,8 @@ LL | impl fmt::Display for *mut LocalType { | ^^^^^^^^^^^^^^^^^^^^^^-------------- | | | | | `*mut LocalType` is not defined in the current crate because raw pointers are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead help: consider introducing a new wrapper type @@ -16,13 +17,14 @@ LL ~ impl fmt::Display for WrapperType { | error[E0117]: only traits defined in the current crate can be implemented for arbitrary types - --> $DIR/issue-99572-impl-trait-on-pointer.rs:18:1 + --> $DIR/issue-99572-impl-trait-on-pointer.rs:19:1 | LL | impl marker::Copy for *mut T { | ^^^^^^^^^^^^^^^^^^^^^^^^^------ | | | | | `*mut T` is not defined in the current crate because raw pointers are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/issues/issue-67535.stderr b/tests/ui/issues/issue-67535.stderr index 4bfbf1bffdbe7..a953a9152144f 100644 --- a/tests/ui/issues/issue-67535.stderr +++ b/tests/ui/issues/issue-67535.stderr @@ -6,7 +6,8 @@ LL | impl std::ops::AddAssign for () { | | | | | | | this is not defined in the current crate because tuples are always foreign | | this is not defined in the current crate because this is a foreign trait - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -18,7 +19,8 @@ LL | impl std::ops::AddAssign for [(); 1] { | | | | | | | this is not defined in the current crate because arrays are always foreign | | this is not defined in the current crate because this is a foreign trait - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -30,7 +32,8 @@ LL | impl std::ops::AddAssign for &[u8] { | | | | | | | this is not defined in the current crate because slices are always foreign | | this is not defined in the current crate because this is a foreign trait - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr index 056cd76075e1b..4dff35c46e840 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr @@ -33,7 +33,8 @@ LL | impl const std::ops::Add for i32 { | | | | | | | `i32` is not defined in the current crate | | `i32` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/type-alias-impl-trait/coherence.classic.stderr b/tests/ui/type-alias-impl-trait/coherence.classic.stderr index 3930a7513d879..4cd87253b3079 100644 --- a/tests/ui/type-alias-impl-trait/coherence.classic.stderr +++ b/tests/ui/type-alias-impl-trait/coherence.classic.stderr @@ -5,7 +5,8 @@ LL | impl foreign_crate::ForeignTrait for AliasOfForeignType<()> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------- | | | | | type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/type-alias-impl-trait/coherence.next.stderr b/tests/ui/type-alias-impl-trait/coherence.next.stderr index bbda986818848..886b667b8c8bb 100644 --- a/tests/ui/type-alias-impl-trait/coherence.next.stderr +++ b/tests/ui/type-alias-impl-trait/coherence.next.stderr @@ -5,7 +5,8 @@ LL | impl foreign_crate::ForeignTrait for AliasOfForeignType<()> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------- | | | | | `AliasOfForeignType<()>` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr b/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr index 5403b4fd2dc87..2d3f8403315dc 100644 --- a/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr +++ b/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr @@ -5,7 +5,8 @@ LL | impl Eq for Y {} | ^^^^^^^^^^^^- | | | | | `(u32) is 1..=` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead diff --git a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr index 65202c1369160..8ee6846eac28a 100644 --- a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr +++ b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr @@ -5,7 +5,8 @@ LL | impl DefaultedTrait for (A,) {} | ^^^^^^^^^^^^^^^^^^^^^^^^---- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -16,7 +17,8 @@ LL | impl !DefaultedTrait for (B,) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^---- | | | | | this is not defined in the current crate because tuples are always foreign - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead @@ -33,7 +35,8 @@ LL | impl DefaultedTrait for lib::Something {} | ^^^^^^^^^^^^^^^^^^^^^^^^----------------- | | | | | `Something` is not defined in the current crate - | impl doesn't use any uncovered types from inside the current crate + | impl doesn't have any local type before any uncovered type parameters + | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules | = note: define and implement a trait or new type instead From b89c6204da4331d5d7c181e5c999cd34bfc54e10 Mon Sep 17 00:00:00 2001 From: Jonathan Birk Date: Thu, 26 Sep 2024 17:10:03 +0000 Subject: [PATCH 4/4] Make new information notes instead of labels --- compiler/rustc_hir_analysis/messages.ftl | 8 ++--- compiler/rustc_hir_analysis/src/errors.rs | 12 +++---- tests/ui/coherence/coherence-cow.re_a.stderr | 8 ++--- tests/ui/coherence/coherence-cow.re_b.stderr | 8 ++--- tests/ui/coherence/coherence-cow.re_c.stderr | 8 ++--- ...coherence-fundamental-trait-objects.stderr | 8 ++--- ...mpl-trait-for-marker-trait-negative.stderr | 8 ++--- ...mpl-trait-for-marker-trait-positive.stderr | 8 ++--- .../ui/coherence/coherence-impls-copy.stderr | 32 ++++++++--------- .../ui/coherence/coherence-impls-send.stderr | 24 ++++++------- .../ui/coherence/coherence-impls-sized.stderr | 24 ++++++------- .../coherence-negative-impls-copy-bad.stderr | 24 ++++++------- tests/ui/coherence/coherence-orphan.stderr | 18 +++++----- .../coherence-overlapping-pairs.stderr | 8 ++--- .../coherence-pair-covered-uncovered-1.stderr | 10 +++--- .../coherence-pair-covered-uncovered.stderr | 8 ++--- .../ui/coherence/coherence-vec-local-2.stderr | 8 ++--- tests/ui/coherence/coherence-vec-local.stderr | 8 ++--- .../coherence_local_err_struct.stderr | 8 ++--- .../coherence_local_err_tuple.stderr | 8 ++--- .../coherence/impl-foreign-for-foreign.stderr | 8 ++--- .../impl-foreign-for-foreign[foreign].stderr | 30 ++++++++-------- ...pl-foreign-for-fundamental[foreign].stderr | 20 +++++------ .../impl-foreign[foreign]-for-foreign.stderr | 10 +++--- ...n[fundemental[foreign]]-for-foreign.stderr | 36 +++++++++---------- .../impl[t]-foreign-for-foreign[t].stderr | 16 ++++----- tests/ui/dropck/drop-on-non-struct.stderr | 8 ++--- tests/ui/error-codes/E0117.stderr | 8 ++--- .../ui/error-codes/e0119/complex-impl.stderr | 8 ++--- .../issue-99572-impl-trait-on-pointer.stderr | 16 ++++----- tests/ui/issues/issue-67535.stderr | 30 ++++++++-------- .../const-and-non-const-impl.stderr | 10 +++--- .../coherence.classic.stderr | 8 ++--- .../coherence.next.stderr | 8 ++--- .../range_patterns_trait_impls2.stderr | 8 ++--- ...lt-trait-impl-cross-crate-coherence.stderr | 24 ++++++------- 36 files changed, 248 insertions(+), 248 deletions(-) diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl index c81f1c62be9cc..444c4548ccbdd 100644 --- a/compiler/rustc_hir_analysis/messages.ftl +++ b/compiler/rustc_hir_analysis/messages.ftl @@ -351,14 +351,14 @@ hir_analysis_only_current_traits_arbitrary = only traits defined in the current hir_analysis_only_current_traits_foreign = this is not defined in the current crate because this is a foreign trait -hir_analysis_only_current_traits_label = impl doesn't have any local type before any uncovered type parameters - -hir_analysis_only_current_traits_label_more_info = for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules - hir_analysis_only_current_traits_name = this is not defined in the current crate because {$name} are always foreign hir_analysis_only_current_traits_note = define and implement a trait or new type instead +hir_analysis_only_current_traits_note_more_info = for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + +hir_analysis_only_current_traits_note_uncovered = impl doesn't have any local type before any uncovered type parameters + hir_analysis_only_current_traits_opaque = type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate hir_analysis_only_current_traits_outside = only traits defined in the current crate can be implemented for types defined outside of the crate diff --git a/compiler/rustc_hir_analysis/src/errors.rs b/compiler/rustc_hir_analysis/src/errors.rs index 9488f2f86cb3e..25b79518dbb63 100644 --- a/compiler/rustc_hir_analysis/src/errors.rs +++ b/compiler/rustc_hir_analysis/src/errors.rs @@ -1440,27 +1440,27 @@ pub enum OnlyCurrentTraits { #[diag(hir_analysis_only_current_traits_outside, code = E0117)] Outside { #[primary_span] - #[label(hir_analysis_only_current_traits_label)] - #[label(hir_analysis_only_current_traits_label_more_info)] span: Span, + #[note(hir_analysis_only_current_traits_note_uncovered)] + #[note(hir_analysis_only_current_traits_note_more_info)] #[note(hir_analysis_only_current_traits_note)] note: (), }, #[diag(hir_analysis_only_current_traits_primitive, code = E0117)] Primitive { #[primary_span] - #[label(hir_analysis_only_current_traits_label)] - #[label(hir_analysis_only_current_traits_label_more_info)] span: Span, + #[note(hir_analysis_only_current_traits_note_uncovered)] + #[note(hir_analysis_only_current_traits_note_more_info)] #[note(hir_analysis_only_current_traits_note)] note: (), }, #[diag(hir_analysis_only_current_traits_arbitrary, code = E0117)] Arbitrary { #[primary_span] - #[label(hir_analysis_only_current_traits_label)] - #[label(hir_analysis_only_current_traits_label_more_info)] span: Span, + #[note(hir_analysis_only_current_traits_note_uncovered)] + #[note(hir_analysis_only_current_traits_note_more_info)] #[note(hir_analysis_only_current_traits_note)] note: (), }, diff --git a/tests/ui/coherence/coherence-cow.re_a.stderr b/tests/ui/coherence/coherence-cow.re_a.stderr index b4331fc475b1e..67de3629491dd 100644 --- a/tests/ui/coherence/coherence-cow.re_a.stderr +++ b/tests/ui/coherence/coherence-cow.re_a.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Pair> { } | ^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Pair` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-cow.re_b.stderr b/tests/ui/coherence/coherence-cow.re_b.stderr index b401d96459885..360900cc7fff6 100644 --- a/tests/ui/coherence/coherence-cow.re_b.stderr +++ b/tests/ui/coherence/coherence-cow.re_b.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Pair,T> { } | ^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Pair` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-cow.re_c.stderr b/tests/ui/coherence/coherence-cow.re_c.stderr index d95beee8139e2..73f2aa196fd4b 100644 --- a/tests/ui/coherence/coherence-cow.re_c.stderr +++ b/tests/ui/coherence/coherence-cow.re_c.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Pair,U> { } | ^^^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Pair` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-fundamental-trait-objects.stderr b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr index 4933fb155f732..ca43d70e0b1b8 100644 --- a/tests/ui/coherence/coherence-fundamental-trait-objects.stderr +++ b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Misc for dyn Fundamental {} | ^^^^^^^^^^^^^^---------------------- - | | | - | | `dyn Fundamental` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `dyn Fundamental` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr index c8b215037b9ef..77d1bdee5acf1 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr @@ -39,11 +39,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl !Send for dyn Marker2 {} | ^^^^^^^^^^^^^^^----------- - | | | - | | `dyn Marker2` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `dyn Marker2` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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)` diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr index 02107453a9ff3..f38aeaed0aaca 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr @@ -39,11 +39,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | unsafe impl Send for dyn Marker2 {} | ^^^^^^^^^^^^^^^^^^^^^----------- - | | | - | | `dyn Marker2` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `dyn Marker2` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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)` diff --git a/tests/ui/coherence/coherence-impls-copy.stderr b/tests/ui/coherence/coherence-impls-copy.stderr index 2de854ed58430..79fe044c4cf4a 100644 --- a/tests/ui/coherence/coherence-impls-copy.stderr +++ b/tests/ui/coherence/coherence-impls-copy.stderr @@ -13,11 +13,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Copy for &'static [NotSync] {} | ^^^^^^^^^^^^^^------------------ - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because slices are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -25,11 +25,11 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Copy for i32 {} | ^^^^^^^^^^^^^^--- - | | | - | | `i32` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `i32` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0206]: the trait `Copy` cannot be implemented for this type @@ -43,11 +43,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Copy for (MyType, MyType) {} | ^^^^^^^^^^^^^^---------------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0206]: the trait `Copy` cannot be implemented for this type @@ -61,11 +61,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Copy for [MyType] {} | ^^^^^^^^^^^^^^-------- - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because slices are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0206]: the trait `Copy` cannot be implemented for this type diff --git a/tests/ui/coherence/coherence-impls-send.stderr b/tests/ui/coherence/coherence-impls-send.stderr index a41e9d620e01c..78e89eb55409f 100644 --- a/tests/ui/coherence/coherence-impls-send.stderr +++ b/tests/ui/coherence/coherence-impls-send.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | unsafe impl Send for &'static [NotSync] {} | ^^^^^^^^^^^^^^^^^^^^^------------------ - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because slices are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -15,11 +15,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | unsafe impl Send for (MyType, MyType) {} | ^^^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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` @@ -33,11 +33,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | unsafe impl Send for [MyType] {} | ^^^^^^^^^^^^^^^^^^^^^-------- - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because slices are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 4 previous errors diff --git a/tests/ui/coherence/coherence-impls-sized.stderr b/tests/ui/coherence/coherence-impls-sized.stderr index 080d19e075b5f..3201f1b25def8 100644 --- a/tests/ui/coherence/coherence-impls-sized.stderr +++ b/tests/ui/coherence/coherence-impls-sized.stderr @@ -21,11 +21,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Sized for (MyType, MyType) {} | ^^^^^^^^^^^^^^^---------------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0322]: explicit impls for the `Sized` trait are not permitted @@ -45,11 +45,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Sized for [MyType] {} | ^^^^^^^^^^^^^^^-------- - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because slices are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0322]: explicit impls for the `Sized` trait are not permitted @@ -63,11 +63,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Sized for &'static [NotSync] {} | ^^^^^^^^^^^^^^^------------------ - | | | - | | this is not defined in the current crate because slices are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because slices are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 9 previous errors diff --git a/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr b/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr index 85937c5f02a81..074cd87ba9246 100644 --- a/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr +++ b/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl !Copy for str {} | ^^^^^^^^^^^^^^^--- - | | | - | | `str` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `str` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -15,11 +15,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl !Copy for fn() {} | ^^^^^^^^^^^^^^^---- - | | | - | | `fn()` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `fn()` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -27,11 +27,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl !Copy for () {} | ^^^^^^^^^^^^^^^-- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 3 previous errors diff --git a/tests/ui/coherence/coherence-orphan.stderr b/tests/ui/coherence/coherence-orphan.stderr index c10ed013ef251..dcf423e24eedb 100644 --- a/tests/ui/coherence/coherence-orphan.stderr +++ b/tests/ui/coherence/coherence-orphan.stderr @@ -3,12 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl TheTrait for isize {} | ^^^^^---------------^^^^^----- - | | | | - | | | `isize` is not defined in the current crate - | | `usize` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `isize` is not defined in the current crate + | `usize` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -16,11 +16,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl !Send for Vec {} | ^^^^^^^^^^^^^^^---------- - | | | - | | `Vec` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Vec` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 2 previous errors diff --git a/tests/ui/coherence/coherence-overlapping-pairs.stderr b/tests/ui/coherence/coherence-overlapping-pairs.stderr index 448e7b9d5ef15..6e7a90ac369c4 100644 --- a/tests/ui/coherence/coherence-overlapping-pairs.stderr +++ b/tests/ui/coherence/coherence-overlapping-pairs.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for lib::Pair { } | ^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Pair` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr index 2e616fefe0ee3..d7890d156cae9 100644 --- a/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr +++ b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr @@ -3,12 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Remote1>> for i32 { } | ^^^^^^^^^^^--------------------------^^^^^--- - | | | | - | | | `i32` is not defined in the current crate - | | `Pair` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `i32` is not defined in the current crate + | `Pair` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-pair-covered-uncovered.stderr b/tests/ui/coherence/coherence-pair-covered-uncovered.stderr index 71a1e4c7ac3fb..fa3d170f81d4f 100644 --- a/tests/ui/coherence/coherence-pair-covered-uncovered.stderr +++ b/tests/ui/coherence/coherence-pair-covered-uncovered.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Pair> { } | ^^^^^^^^^^^^^^^^^^^^^---------------- - | | | - | | `Pair` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Pair` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-vec-local-2.stderr b/tests/ui/coherence/coherence-vec-local-2.stderr index 50788e4a990eb..cb12275cf01cb 100644 --- a/tests/ui/coherence/coherence-vec-local-2.stderr +++ b/tests/ui/coherence/coherence-vec-local-2.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Vec> { } | ^^^^^^^^^^^^^^^^^^^------------- - | | | - | | `Vec` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Vec` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence-vec-local.stderr b/tests/ui/coherence/coherence-vec-local.stderr index cd102fa1c6d1b..9278b9458d56e 100644 --- a/tests/ui/coherence/coherence-vec-local.stderr +++ b/tests/ui/coherence/coherence-vec-local.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Vec { } | ^^^^^^^^^^^^^^^^---------- - | | | - | | `Vec` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Vec` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence_local_err_struct.stderr b/tests/ui/coherence/coherence_local_err_struct.stderr index 97a26b54a1be0..280dd57bd42d4 100644 --- a/tests/ui/coherence/coherence_local_err_struct.stderr +++ b/tests/ui/coherence/coherence_local_err_struct.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl lib::MyCopy for lib::MyStruct { } | ^^^^^^^^^^^^^^^^^^^^^--------------------- - | | | - | | `MyStruct` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `MyStruct` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/coherence_local_err_tuple.stderr b/tests/ui/coherence/coherence_local_err_tuple.stderr index cdd73be86bfa0..d07adab0014e2 100644 --- a/tests/ui/coherence/coherence_local_err_tuple.stderr +++ b/tests/ui/coherence/coherence_local_err_tuple.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl lib::MyCopy for (MyType,) { } | ^^^^^^^^^^^^^^^^^^^^^--------- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/impl-foreign-for-foreign.stderr b/tests/ui/coherence/impl-foreign-for-foreign.stderr index 0f8af5ef0280b..4ff965290c883 100644 --- a/tests/ui/coherence/impl-foreign-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign-for-foreign.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Remote for i32 { | ^^^^^^^^^^^^^^^^--- - | | | - | | `i32` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `i32` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr b/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr index ae1807f6dd055..ce5376f98cb72 100644 --- a/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr +++ b/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr @@ -3,12 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Remote1> for i32 { | ^^^^^----------------^^^^^--- - | | | | - | | | `i32` is not defined in the current crate - | | `Rc` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `i32` is not defined in the current crate + | `Rc` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -16,12 +16,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Remote1> for f64 { | ^^^^^------------------^^^^^--- - | | | | - | | | `f64` is not defined in the current crate - | | `Rc` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `f64` is not defined in the current crate + | `Rc` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -29,12 +29,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Remote1> for f32 { | ^^^^^^^^--------------^^^^^--- - | | | | - | | | `f32` is not defined in the current crate - | | `Rc` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `f32` is not defined in the current crate + | `Rc` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 3 previous errors diff --git a/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr b/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr index a3522a75c86cf..596f8436567ae 100644 --- a/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr +++ b/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr @@ -3,12 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | 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 have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `i32` is not defined in the current crate + | `std::alloc::Global` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -16,12 +16,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | 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 have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `Rc` is not defined in the current crate + | `std::alloc::Global` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 2 previous errors diff --git a/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr b/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr index bf22e73dd09d8..d9dd2b8a8c625 100644 --- a/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr @@ -3,12 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Remote1 for f64 { | ^^^^^------------^^^^^--- - | | | | - | | | `f64` is not defined in the current crate - | | `u32` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `f64` is not defined in the current crate + | `u32` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr b/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr index 2ab5cca7983cb..91f1886142cf6 100644 --- a/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr +++ b/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr @@ -3,13 +3,13 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | 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 have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `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 | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -17,13 +17,13 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | 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 have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `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 | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -31,13 +31,13 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | 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 have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `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 | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 3 previous errors diff --git a/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr b/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr index ca9a7d5cd930a..306a5d1610d70 100644 --- a/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr +++ b/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Rc { | ^^^^^^^^^^^^^^^^--------- - | | | - | | `Rc` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Rc` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -15,11 +15,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl Remote for Arc { | ^^^^^^^^^^^^^^^^^^^------ - | | | - | | `Arc` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Arc` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 2 previous errors diff --git a/tests/ui/dropck/drop-on-non-struct.stderr b/tests/ui/dropck/drop-on-non-struct.stderr index 78b7212b6d9fd..9495642e45e4d 100644 --- a/tests/ui/dropck/drop-on-non-struct.stderr +++ b/tests/ui/dropck/drop-on-non-struct.stderr @@ -9,11 +9,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl<'a> Drop for &'a mut isize { | ^^^^^^^^^^^^^^^^^^------------- - | | | - | | `isize` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `isize` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions diff --git a/tests/ui/error-codes/E0117.stderr b/tests/ui/error-codes/E0117.stderr index 2bfa78d1954d7..f6e80e5930447 100644 --- a/tests/ui/error-codes/E0117.stderr +++ b/tests/ui/error-codes/E0117.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl Drop for u32 {} | ^^^^^^^^^^^^^^--- - | | | - | | `u32` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `u32` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions diff --git a/tests/ui/error-codes/e0119/complex-impl.stderr b/tests/ui/error-codes/e0119/complex-impl.stderr index 36618cee0e837..b7e434c4afe3c 100644 --- a/tests/ui/error-codes/e0119/complex-impl.stderr +++ b/tests/ui/error-codes/e0119/complex-impl.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl External for (Q, R) {} | ^^^^^^^^^^^^^^^^^^^^^------ - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr index 214618d6636fb..bd40b059e5809 100644 --- a/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr +++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl fmt::Display for *mut LocalType { | ^^^^^^^^^^^^^^^^^^^^^^-------------- - | | | - | | `*mut LocalType` is not defined in the current crate because raw pointers are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `*mut LocalType` is not defined in the current crate because raw pointers are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead help: consider introducing a new wrapper type | @@ -21,11 +21,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl marker::Copy for *mut T { | ^^^^^^^^^^^^^^^^^^^^^^^^^------ - | | | - | | `*mut T` is not defined in the current crate because raw pointers are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `*mut T` is not defined in the current crate because raw pointers are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-67535.stderr b/tests/ui/issues/issue-67535.stderr index a953a9152144f..2afa2199a6afe 100644 --- a/tests/ui/issues/issue-67535.stderr +++ b/tests/ui/issues/issue-67535.stderr @@ -3,12 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl std::ops::AddAssign for () { | ^^^^^-------------------^^^^^-- - | | | | - | | | this is not defined in the current crate because tuples are always foreign - | | this is not defined in the current crate because this is a foreign trait - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | this is not defined in the current crate because tuples are always foreign + | this is not defined in the current crate because this is a foreign trait | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -16,12 +16,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl std::ops::AddAssign for [(); 1] { | ^^^^^-------------------^^^^^------- - | | | | - | | | this is not defined in the current crate because arrays are always foreign - | | this is not defined in the current crate because this is a foreign trait - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | this is not defined in the current crate because arrays are always foreign + | this is not defined in the current crate because this is a foreign trait | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -29,12 +29,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl std::ops::AddAssign for &[u8] { | ^^^^^-------------------^^^^^----- - | | | | - | | | this is not defined in the current crate because slices are always foreign - | | this is not defined in the current crate because this is a foreign trait - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | this is not defined in the current crate because slices are always foreign + | this is not defined in the current crate because this is a foreign trait | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 3 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr index 4dff35c46e840..cf7af41cd4e47 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr @@ -30,12 +30,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr | LL | impl const std::ops::Add for i32 { | ^^^^^^^^^^^-------------^^^^^--- - | | | | - | | | `i32` is not defined in the current crate - | | `i32` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | | + | | `i32` is not defined in the current crate + | `i32` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 4 previous errors diff --git a/tests/ui/type-alias-impl-trait/coherence.classic.stderr b/tests/ui/type-alias-impl-trait/coherence.classic.stderr index 4cd87253b3079..98badeef382de 100644 --- a/tests/ui/type-alias-impl-trait/coherence.classic.stderr +++ b/tests/ui/type-alias-impl-trait/coherence.classic.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl foreign_crate::ForeignTrait for AliasOfForeignType<()> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------- - | | | - | | type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/type-alias-impl-trait/coherence.next.stderr b/tests/ui/type-alias-impl-trait/coherence.next.stderr index 886b667b8c8bb..8d7183831109a 100644 --- a/tests/ui/type-alias-impl-trait/coherence.next.stderr +++ b/tests/ui/type-alias-impl-trait/coherence.next.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl foreign_crate::ForeignTrait for AliasOfForeignType<()> {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------- - | | | - | | `AliasOfForeignType<()>` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `AliasOfForeignType<()>` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr b/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr index 2d3f8403315dc..df56db031ed18 100644 --- a/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr +++ b/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl Eq for Y {} | ^^^^^^^^^^^^- - | | | - | | `(u32) is 1..=` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `(u32) is 1..=` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 1 previous error diff --git a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr index 8ee6846eac28a..c7d714dcb1adb 100644 --- a/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr +++ b/tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl DefaultedTrait for (A,) {} | ^^^^^^^^^^^^^^^^^^^^^^^^---- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = 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 @@ -15,11 +15,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar | LL | impl !DefaultedTrait for (B,) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^---- - | | | - | | this is not defined in the current crate because tuples are always foreign - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | this is not defined in the current crate because tuples are always foreign | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error[E0321]: cross-crate traits with a default impl, like `DefaultedTrait`, can only be implemented for a struct/enum type defined in the current crate @@ -33,11 +33,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty | LL | impl DefaultedTrait for lib::Something {} | ^^^^^^^^^^^^^^^^^^^^^^^^----------------- - | | | - | | `Something` is not defined in the current crate - | impl doesn't have any local type before any uncovered type parameters - | for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules + | | + | `Something` is not defined in the current crate | + = note: impl doesn't have any local type before any uncovered type parameters + = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead error: aborting due to 4 previous errors