about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-17 12:07:19 +0200
committerGitHub <noreply@github.com>2024-10-17 12:07:19 +0200
commit21c57f54909a0792f6e0eb30d849e3e7182ca59e (patch)
tree50e5a7f6b260be851927417e1caa78e887bdfe44
parent06d261daf62620e3449ba451898c7ad9ae750f41 (diff)
parentb89c6204da4331d5d7c181e5c999cd34bfc54e10 (diff)
downloadrust-21c57f54909a0792f6e0eb30d849e3e7182ca59e.tar.gz
rust-21c57f54909a0792f6e0eb30d849e3e7182ca59e.zip
Rollup merge of #128391 - cafce25:issue-128390, r=lcnr
Change orphan hint from "only" to "any uncovered type inside..."

Fix #128390
-rw-r--r--compiler/rustc_hir_analysis/messages.ftl6
-rw-r--r--compiler/rustc_hir_analysis/src/errors.rs9
-rw-r--r--tests/ui/coherence/coherence-cow.re_a.stderr7
-rw-r--r--tests/ui/coherence/coherence-cow.re_b.stderr7
-rw-r--r--tests/ui/coherence/coherence-cow.re_c.stderr7
-rw-r--r--tests/ui/coherence/coherence-fundamental-trait-objects.stderr7
-rw-r--r--tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr7
-rw-r--r--tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr7
-rw-r--r--tests/ui/coherence/coherence-impls-copy.stderr28
-rw-r--r--tests/ui/coherence/coherence-impls-send.stderr21
-rw-r--r--tests/ui/coherence/coherence-impls-sized.stderr21
-rw-r--r--tests/ui/coherence/coherence-negative-impls-copy-bad.stderr21
-rw-r--r--tests/ui/coherence/coherence-orphan.stderr16
-rw-r--r--tests/ui/coherence/coherence-overlapping-pairs.stderr7
-rw-r--r--tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr9
-rw-r--r--tests/ui/coherence/coherence-pair-covered-uncovered.stderr7
-rw-r--r--tests/ui/coherence/coherence-vec-local-2.stderr7
-rw-r--r--tests/ui/coherence/coherence-vec-local.stderr7
-rw-r--r--tests/ui/coherence/coherence_local_err_struct.stderr7
-rw-r--r--tests/ui/coherence/coherence_local_err_tuple.stderr7
-rw-r--r--tests/ui/coherence/impl-foreign-for-foreign.stderr7
-rw-r--r--tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr27
-rw-r--r--tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr18
-rw-r--r--tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr9
-rw-r--r--tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr33
-rw-r--r--tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr14
-rw-r--r--tests/ui/dropck/drop-on-non-struct.stderr7
-rw-r--r--tests/ui/error-codes/E0117.stderr7
-rw-r--r--tests/ui/error-codes/e0119/complex-impl.stderr7
-rw-r--r--tests/ui/errors/issue-99572-impl-trait-on-pointer.rs20
-rw-r--r--tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr16
-rw-r--r--tests/ui/issues/issue-67535.stderr27
-rw-r--r--tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr9
-rw-r--r--tests/ui/type-alias-impl-trait/coherence.classic.stderr7
-rw-r--r--tests/ui/type-alias-impl-trait/coherence.next.stderr7
-rw-r--r--tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr7
-rw-r--r--tests/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr21
37 files changed, 260 insertions, 198 deletions
diff --git a/compiler/rustc_hir_analysis/messages.ftl b/compiler/rustc_hir_analysis/messages.ftl
index a9f30ffd6da..507297ce162 100644
--- a/compiler/rustc_hir_analysis/messages.ftl
+++ b/compiler/rustc_hir_analysis/messages.ftl
@@ -356,12 +356,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 use only 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
 
 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 af4445a7fd4..77e81af3ca9 100644
--- a/compiler/rustc_hir_analysis/src/errors.rs
+++ b/compiler/rustc_hir_analysis/src/errors.rs
@@ -1434,24 +1434,27 @@ pub(crate) enum OnlyCurrentTraits {
     #[diag(hir_analysis_only_current_traits_outside, code = E0117)]
     Outside {
         #[primary_span]
-        #[label(hir_analysis_only_current_traits_label)]
         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)]
         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)]
         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 0bc017817b6..67de3629491 100644
--- a/tests/ui/coherence/coherence-cow.re_a.stderr
+++ b/tests/ui/coherence/coherence-cow.re_a.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T> Remote for Pair<T,Cover<T>> { }
    | ^^^^^^^^^^^^^^^^^^^----------------
-   | |                  |
-   | |                  `Pair` is not defined in the current crate
-   | impl doesn't use only types from inside 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-cow.re_b.stderr b/tests/ui/coherence/coherence-cow.re_b.stderr
index 9bdb49dcc04..360900cc7ff 100644
--- a/tests/ui/coherence/coherence-cow.re_b.stderr
+++ b/tests/ui/coherence/coherence-cow.re_b.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T> Remote for Pair<Cover<T>,T> { }
    | ^^^^^^^^^^^^^^^^^^^----------------
-   | |                  |
-   | |                  `Pair` is not defined in the current crate
-   | impl doesn't use only types from inside 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-cow.re_c.stderr b/tests/ui/coherence/coherence-cow.re_c.stderr
index dfff2667ebb..73f2aa196fd 100644
--- a/tests/ui/coherence/coherence-cow.re_c.stderr
+++ b/tests/ui/coherence/coherence-cow.re_c.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T,U> Remote for Pair<Cover<T>,U> { }
    | ^^^^^^^^^^^^^^^^^^^^^----------------
-   | |                    |
-   | |                    `Pair` is not defined in the current crate
-   | impl doesn't use only types from inside 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-fundamental-trait-objects.stderr b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr
index db6a9474804..ca43d70e0b1 100644
--- a/tests/ui/coherence/coherence-fundamental-trait-objects.stderr
+++ b/tests/ui/coherence/coherence-fundamental-trait-objects.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
    |
 LL | impl Misc for dyn Fundamental<Local> {}
    | ^^^^^^^^^^^^^^----------------------
-   | |             |
-   | |             `dyn Fundamental<Local>` is not defined in the current crate
-   | impl doesn't use only types from inside the current crate
+   |               |
+   |               `dyn Fundamental<Local>` 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 ea38afc40ce..77d1bdee5ac 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,10 +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 use only types from inside the current crate
+   |                |
+   |                `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 2a8713bc327..f38aeaed0aa 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,10 +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 use only types from inside the current crate
+   |                      |
+   |                      `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 f529a056b0f..79fe044c4cf 100644
--- a/tests/ui/coherence/coherence-impls-copy.stderr
+++ b/tests/ui/coherence/coherence-impls-copy.stderr
@@ -13,10 +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 use only types from inside the current crate
+   |               |
+   |               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
@@ -24,10 +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 use only types from inside 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[E0206]: the trait `Copy` cannot be implemented for this type
@@ -41,10 +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 use only types from inside the current crate
+   |               |
+   |               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
@@ -58,10 +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 use only types from inside the current crate
+   |               |
+   |               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 e1071846e14..78e89eb5540 100644
--- a/tests/ui/coherence/coherence-impls-send.stderr
+++ b/tests/ui/coherence/coherence-impls-send.stderr
@@ -3,10 +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 use only types from inside the current crate
+   |                      |
+   |                      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
@@ -14,10 +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 use only types from inside the current crate
+   |                      |
+   |                      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`
@@ -31,10 +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 use only types from inside the current crate
+   |                      |
+   |                      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 17a7544521d..3201f1b25de 100644
--- a/tests/ui/coherence/coherence-impls-sized.stderr
+++ b/tests/ui/coherence/coherence-impls-sized.stderr
@@ -21,10 +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 use only types from inside the current crate
+   |                |
+   |                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
@@ -44,10 +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 use only types from inside the current crate
+   |                |
+   |                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
@@ -61,10 +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 use only types from inside the current crate
+   |                |
+   |                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 2295d6315d1..074cd87ba92 100644
--- a/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr
+++ b/tests/ui/coherence/coherence-negative-impls-copy-bad.stderr
@@ -3,10 +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 use only types from inside the current crate
+   |                |
+   |                `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
@@ -14,10 +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 use only types from inside the current crate
+   |                |
+   |                `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
@@ -25,10 +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 use only types from inside the current crate
+   |                |
+   |                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 f6ffae34290..dcf423e24ee 100644
--- a/tests/ui/coherence/coherence-orphan.stderr
+++ b/tests/ui/coherence/coherence-orphan.stderr
@@ -3,11 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl TheTrait<usize> 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
+   |      |                   |
+   |      |                   `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
@@ -15,10 +16,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl !Send for Vec<isize> {}
    | ^^^^^^^^^^^^^^^----------
-   | |              |
-   | |              `Vec` is not defined in the current crate
-   | impl doesn't use only types from inside the current crate
+   |                |
+   |                `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 4d0a9c6ee14..6e7a90ac369 100644
--- a/tests/ui/coherence/coherence-overlapping-pairs.stderr
+++ b/tests/ui/coherence/coherence-overlapping-pairs.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T> Remote for lib::Pair<T,Foo> { }
    | ^^^^^^^^^^^^^^^^^^^----------------
-   | |                  |
-   | |                  `Pair` is not defined in the current crate
-   | impl doesn't use only types from inside 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-1.stderr b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr
index 15cd66e9d09..d7890d156ca 100644
--- a/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr
+++ b/tests/ui/coherence/coherence-pair-covered-uncovered-1.stderr
@@ -3,11 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl<T, U> Remote1<Pair<T, Local<U>>> 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
+   |            |                              |
+   |            |                              `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 359dbe8509d..fa3d170f81d 100644
--- a/tests/ui/coherence/coherence-pair-covered-uncovered.stderr
+++ b/tests/ui/coherence/coherence-pair-covered-uncovered.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T,U> Remote for Pair<T,Local<U>> { }
    | ^^^^^^^^^^^^^^^^^^^^^----------------
-   | |                    |
-   | |                    `Pair` is not defined in the current crate
-   | impl doesn't use only types from inside 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-vec-local-2.stderr b/tests/ui/coherence/coherence-vec-local-2.stderr
index e4249710d00..cb12275cf01 100644
--- a/tests/ui/coherence/coherence-vec-local-2.stderr
+++ b/tests/ui/coherence/coherence-vec-local-2.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T> Remote for Vec<Local<T>> { }
    | ^^^^^^^^^^^^^^^^^^^-------------
-   | |                  |
-   | |                  `Vec` is not defined in the current crate
-   | impl doesn't use only types from inside the current crate
+   |                    |
+   |                    `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 c465fb1966e..9278b9458d5 100644
--- a/tests/ui/coherence/coherence-vec-local.stderr
+++ b/tests/ui/coherence/coherence-vec-local.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl Remote for Vec<Local> { }
    | ^^^^^^^^^^^^^^^^----------
-   | |               |
-   | |               `Vec` is not defined in the current crate
-   | impl doesn't use only types from inside the current crate
+   |                 |
+   |                 `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 96572b5a716..280dd57bd42 100644
--- a/tests/ui/coherence/coherence_local_err_struct.stderr
+++ b/tests/ui/coherence/coherence_local_err_struct.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl lib::MyCopy for lib::MyStruct<MyType> { }
    | ^^^^^^^^^^^^^^^^^^^^^---------------------
-   | |                    |
-   | |                    `MyStruct` is not defined in the current crate
-   | impl doesn't use only types from inside the current crate
+   |                      |
+   |                      `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 85a063bb34a..d07adab0014 100644
--- a/tests/ui/coherence/coherence_local_err_tuple.stderr
+++ b/tests/ui/coherence/coherence_local_err_tuple.stderr
@@ -3,10 +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 use only types from inside the current crate
+   |                      |
+   |                      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 6c74b47a1c4..4ff965290c8 100644
--- a/tests/ui/coherence/impl-foreign-for-foreign.stderr
+++ b/tests/ui/coherence/impl-foreign-for-foreign.stderr
@@ -3,10 +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 use only types from inside 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 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 e24537bce22..ce5376f98cb 100644
--- a/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr
+++ b/tests/ui/coherence/impl-foreign-for-foreign[foreign].stderr
@@ -3,11 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl Remote1<Rc<i32>> 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
+   |      |                    |
+   |      |                    `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
@@ -15,11 +16,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl Remote1<Rc<Local>> 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
+   |      |                      |
+   |      |                      `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
@@ -27,11 +29,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl<T> Remote1<Rc<T>> 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
+   |         |                  |
+   |         |                  `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 55ea4409e6f..596f8436567 100644
--- a/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr
+++ b/tests/ui/coherence/impl-foreign-for-fundamental[foreign].stderr
@@ -3,11 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl Remote for Box<i32> {
    | ^^^^^------^^^^^--------
-   | |    |          |
-   | |    |          `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
+   |      |          |
+   |      |          `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
@@ -15,11 +16,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T> Remote for Box<Rc<T>> {
    | ^^^^^^^^------^^^^^----------
-   | |       |          |
-   | |       |          `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
+   |         |          |
+   |         |          `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 fe8a34b78cf..d9dd2b8a8c6 100644
--- a/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr
+++ b/tests/ui/coherence/impl-foreign[foreign]-for-foreign.stderr
@@ -3,11 +3,12 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl Remote1<u32> 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
+   |      |                |
+   |      |                `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 8e77c13e111..91f1886142c 100644
--- a/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr
+++ b/tests/ui/coherence/impl-foreign[fundemental[foreign]]-for-foreign.stderr
@@ -3,12 +3,13 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl Remote1<Box<String>> 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
+   |      |                        |
+   |      |                        `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
@@ -16,12 +17,13 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl Remote1<Box<Rc<i32>>> 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
+   |      |                         |
+   |      |                         `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
@@ -29,12 +31,13 @@ error[E0117]: only traits defined in the current crate can be implemented for pr
    |
 LL | impl<T> Remote1<Box<Rc<T>>> 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
+   |         |                       |
+   |         |                       `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 92346c29198..306a5d1610d 100644
--- a/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr
+++ b/tests/ui/coherence/impl[t]-foreign-for-foreign[t].stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl Remote for Rc<Local> {
    | ^^^^^^^^^^^^^^^^---------
-   | |               |
-   | |               `Rc` is not defined in the current crate
-   | impl doesn't use only types from inside 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 types defined outside of the crate
@@ -14,10 +15,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl<T> Remote for Arc<T> {
    | ^^^^^^^^^^^^^^^^^^^------
-   | |                  |
-   | |                  `Arc` is not defined in the current crate
-   | impl doesn't use only types from inside the current crate
+   |                    |
+   |                    `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 e8fbe5e9726..9495642e45e 100644
--- a/tests/ui/dropck/drop-on-non-struct.stderr
+++ b/tests/ui/dropck/drop-on-non-struct.stderr
@@ -9,10 +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 use only types from inside the current crate
+   |                   |
+   |                   `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 f144aa9f72c..f6e80e59304 100644
--- a/tests/ui/error-codes/E0117.stderr
+++ b/tests/ui/error-codes/E0117.stderr
@@ -3,10 +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 use only types from inside 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[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 c0519c60e42..b7e434c4afe 100644
--- a/tests/ui/error-codes/e0119/complex-impl.stderr
+++ b/tests/ui/error-codes/e0119/complex-impl.stderr
@@ -3,10 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
    |
 LL | impl<R> 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
+   |                      |
+   |                      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.rs b/tests/ui/errors/issue-99572-impl-trait-on-pointer.rs
index 272c6bd3fb7..61f11a88c61 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,23 @@ 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 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
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         write!(f, "This not compile")
     }
 }
 
 impl<T> 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 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
 }
 
 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 78d7a47deaa..bd40b059e58 100644
--- a/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr
+++ b/tests/ui/errors/issue-99572-impl-trait-on-pointer.stderr
@@ -3,10 +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 use only types from inside the current crate
+   |                       |
+   |                       `*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
    |
@@ -16,14 +17,15 @@ 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<T> 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
+   |                          |
+   |                          `*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 4d7a02a5096..2afa2199a6a 100644
--- a/tests/ui/issues/issue-67535.stderr
+++ b/tests/ui/issues/issue-67535.stderr
@@ -3,11 +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 use only types from inside the current crate
+   |      |                       |
+   |      |                       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
@@ -15,11 +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 use only types from inside the current crate
+   |      |                       |
+   |      |                       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
@@ -27,11 +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 use only types from inside the current crate
+   |      |                       |
+   |      |                       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 9c1c8df8da4..cf7af41cd4e 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,11 +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 use only types from inside the current crate
+   |            |                 |
+   |            |                 `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 ff059bc5806..98badeef382 100644
--- a/tests/ui/type-alias-impl-trait/coherence.classic.stderr
+++ b/tests/ui/type-alias-impl-trait/coherence.classic.stderr
@@ -3,10 +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 use only types from inside the current crate
+   |                                      |
+   |                                      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 dab2786c1f0..8d718383110 100644
--- a/tests/ui/type-alias-impl-trait/coherence.next.stderr
+++ b/tests/ui/type-alias-impl-trait/coherence.next.stderr
@@ -3,10 +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 use only types from inside the current crate
+   |                                      |
+   |                                      `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 41f42455bde..df56db031ed 100644
--- a/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr
+++ b/tests/ui/type/pattern_types/range_patterns_trait_impls2.stderr
@@ -3,10 +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 use only types from inside the current crate
+   |             |
+   |             `(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 32e6e88fc48..c7d714dcb1a 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,10 +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 use only types from inside the current crate
+   |                         |
+   |                         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
@@ -14,10 +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 use only types from inside the current crate
+   |                          |
+   |                          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
@@ -31,10 +33,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
    |
 LL | impl DefaultedTrait for lib::Something<C> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^-----------------
-   | |                       |
-   | |                       `Something` is not defined in the current crate
-   | impl doesn't use only types from inside the current crate
+   |                         |
+   |                         `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