about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2022-03-27 01:49:01 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2022-04-04 21:06:35 +0000
commitef91519b45d2bbf0ce8c0180118160562eaaa0ca (patch)
treeab798e750270dc35abaadabf38e6946025faf9b8
parente2bba0708a1e4b0c21f94de56c2bd5d66d3b825f (diff)
downloadrust-ef91519b45d2bbf0ce8c0180118160562eaaa0ca.tar.gz
rust-ef91519b45d2bbf0ce8c0180118160562eaaa0ca.zip
Dedup logic and improve output for other types that impl trait
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs121
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs7
-rw-r--r--src/test/ui/binop/binop-mul-i32-f32.stderr10
-rw-r--r--src/test/ui/binop/issue-77910-1.stderr18
-rw-r--r--src/test/ui/binop/shift-various-bad-types.stderr6
-rw-r--r--src/test/ui/chalkify/chalk_initial_program.stderr6
-rw-r--r--src/test/ui/chalkify/type_inference.stderr6
-rw-r--r--src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr6
-rw-r--r--src/test/ui/const-generics/exhaustive-value.stderr2
-rw-r--r--src/test/ui/const-generics/issues/issue-67185-2.stderr36
-rw-r--r--src/test/ui/const-generics/occurs-check/unused-substs-1.stderr2
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr10
-rw-r--r--src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr10
-rw-r--r--src/test/ui/consts/too_generic_eval_ice.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr14
-rw-r--r--src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr2
-rw-r--r--src/test/ui/generic-associated-types/bugs/issue-88460.stderr2
-rw-r--r--src/test/ui/impl-trait/equality.stderr10
-rw-r--r--src/test/ui/issues/issue-11771.stderr4
-rw-r--r--src/test/ui/issues/issue-24352.stderr10
-rw-r--r--src/test/ui/issues/issue-50582.stderr2
-rw-r--r--src/test/ui/issues/issue-59488.stderr18
-rw-r--r--src/test/ui/kindck/kindck-copy.stderr36
-rw-r--r--src/test/ui/lexer/lex-bad-char-literals-6.stderr20
-rw-r--r--src/test/ui/mismatched_types/binops.stderr52
-rw-r--r--src/test/ui/never_type/issue-13352.stderr10
-rw-r--r--src/test/ui/numbers-arithmetic/not-suggest-float-literal.stderr122
-rw-r--r--src/test/ui/numbers-arithmetic/suggest-float-literal.stderr72
-rw-r--r--src/test/ui/on-unimplemented/multiple-impls.stderr12
-rw-r--r--src/test/ui/on-unimplemented/slice-index.stderr2
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr8
-rw-r--r--src/test/ui/span/multiline-span-simple.stderr10
-rw-r--r--src/test/ui/suggestions/into-str.stderr2
-rw-r--r--src/test/ui/suggestions/issue-71394-no-from-impl.stderr2
-rw-r--r--src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs2
-rw-r--r--src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr2
-rw-r--r--src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr10
-rw-r--r--src/test/ui/traits/issue-79458.stderr8
-rw-r--r--src/test/ui/traits/map-types.stderr2
-rw-r--r--src/test/ui/try-trait/bad-interconversion.stderr6
-rw-r--r--src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr2
-rw-r--r--src/test/ui/type/type-check-defaults.stderr10
-rw-r--r--src/test/ui/typeck/issue-81293.stderr10
-rw-r--r--src/test/ui/typeck/issue-90101.stderr2
-rw-r--r--src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr10
47 files changed, 363 insertions, 357 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index fdafb2d3d41..09b445058c0 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -30,7 +30,7 @@ use rustc_middle::traits::select::OverflowError;
 use rustc_middle::ty::error::ExpectedFound;
 use rustc_middle::ty::fold::TypeFolder;
 use rustc_middle::ty::{
-    self, SubtypePredicate, ToPolyTraitRef, ToPredicate, Ty, TyCtxt, TypeFoldable,
+    self, SubtypePredicate, ToPolyTraitRef, ToPredicate, TraitRef, Ty, TyCtxt, TypeFoldable,
 };
 use rustc_span::symbol::{kw, sym};
 use rustc_span::{ExpnKind, MultiSpan, Span, DUMMY_SP};
@@ -1756,6 +1756,60 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
         trait_ref: ty::PolyTraitRef<'tcx>,
         err: &mut Diagnostic,
     ) -> bool {
+        let report = |mut candidates: Vec<TraitRef<'_>>, err: &mut Diagnostic| {
+            candidates.sort();
+            candidates.dedup();
+            let len = candidates.len();
+            if candidates.len() == 0 {
+                return false;
+            }
+            let trait_ref = candidates[0];
+            if candidates.len() == 1 {
+                err.highlighted_help(vec![
+                    (
+                        format!(
+                            "the trait `{}` is implemented for `",
+                            trait_ref.print_only_trait_path()
+                        ),
+                        Style::NoStyle,
+                    ),
+                    (candidates[0].self_ty().to_string(), Style::Highlight),
+                    ("`".to_string(), Style::NoStyle),
+                ]);
+                return true;
+            }
+            // Check if the trait is the same in all cases. If so, we'll only show the type.
+            // FIXME: there *has* to be a better way!
+            let mut traits: Vec<_> = candidates
+                .iter()
+                .map(|c| format!("{}", c).split(" as ").last().unwrap().to_string())
+                .collect();
+            traits.sort();
+            traits.dedup();
+
+            let mut candidates: Vec<String> = candidates
+                .into_iter()
+                .map(|c| {
+                    if traits.len() == 1 {
+                        format!("\n  {}", c.self_ty())
+                    } else {
+                        format!("\n  {}", c)
+                    }
+                })
+                .collect();
+
+            candidates.sort();
+            candidates.dedup();
+            let end = if candidates.len() <= 9 { candidates.len() } else { 8 };
+            err.help(&format!(
+                "the following other types implement trait `{}`:{}{}",
+                trait_ref.print_only_trait_path(),
+                candidates[..end].join(""),
+                if len > 9 { format!("\nand {} others", len - 8) } else { String::new() }
+            ));
+            true
+        };
+
         let def_id = trait_ref.def_id();
         if impl_candidates.is_empty() {
             if self.tcx.trait_is_auto(def_id)
@@ -1765,7 +1819,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
                 // Mentioning implementers of `Copy`, `Debug` and friends is not useful.
                 return false;
             }
-            let mut normalized_impl_candidates: Vec<_> = self
+            let normalized_impl_candidates: Vec<_> = self
                 .tcx
                 .all_impls(def_id)
                 // Ignore automatically derived impls and `!Trait` impls.
@@ -1776,45 +1830,10 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
                 .filter_map(|def_id| self.tcx.impl_trait_ref(def_id))
                 // Avoid mentioning type parameters.
                 .filter(|trait_ref| !matches!(trait_ref.self_ty().kind(), ty::Param(_)))
-                .map(|trait_ref| format!("\n  {}", trait_ref.self_ty()))
                 .collect();
-            normalized_impl_candidates.sort();
-            normalized_impl_candidates.dedup();
-            let len = normalized_impl_candidates.len();
-            if len == 0 {
-                return false;
-            }
-            if len == 1 {
-                err.highlighted_help(vec![
-                    (
-                        format!(
-                            "the trait `{}` is implemented for `",
-                            trait_ref.print_only_trait_path()
-                        ),
-                        Style::NoStyle,
-                    ),
-                    (normalized_impl_candidates[0].trim().to_string(), Style::Highlight),
-                    ("`".to_string(), Style::NoStyle),
-                ]);
-                return true;
-            }
-            let end = if normalized_impl_candidates.len() <= 9 {
-                normalized_impl_candidates.len()
-            } else {
-                8
-            };
-            err.help(&format!(
-                "the following other types implement trait `{}`:{}{}",
-                trait_ref.print_only_trait_path(),
-                normalized_impl_candidates[..end].join(""),
-                if len > 9 { format!("\nand {} others", len - 8) } else { String::new() }
-            ));
-            return true;
+            return report(normalized_impl_candidates, err);
         }
 
-        let len = impl_candidates.len();
-        let end = if impl_candidates.len() <= 9 { impl_candidates.len() } else { 8 };
-
         let normalize = |candidate| {
             self.tcx.infer_ctxt().enter(|ref infcx| {
                 let normalized = infcx
@@ -1822,8 +1841,8 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
                     .normalize(candidate)
                     .ok();
                 match normalized {
-                    Some(normalized) => format!("\n  {}", normalized.value),
-                    None => format!("\n  {}", candidate),
+                    Some(normalized) => normalized.value,
+                    None => candidate,
                 }
             })
         };
@@ -1834,7 +1853,6 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
         //
         // Prefer more similar candidates first, then sort lexicographically
         // by their normalized string representation.
-        let first_candidate = impl_candidates.get(0).map(|candidate| candidate.trait_ref);
         let mut normalized_impl_candidates_and_similarities = impl_candidates
             .into_iter()
             .map(|ImplCandidate { trait_ref, similarity }| {
@@ -1850,26 +1868,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
             .map(|(_, normalized)| normalized)
             .collect::<Vec<_>>();
 
-        if normalized_impl_candidates.len() == 1 {
-            err.highlighted_help(vec![
-                (
-                    format!(
-                        "the trait `{}` is implemented for `",
-                        first_candidate.unwrap().print_only_trait_path()
-                    ),
-                    Style::NoStyle,
-                ),
-                (first_candidate.unwrap().self_ty().to_string(), Style::Highlight),
-                ("`".to_string(), Style::NoStyle),
-            ]);
-        } else {
-            err.help(&format!(
-                "the following implementations were found:{}{}",
-                normalized_impl_candidates[..end].join(""),
-                if len > 9 { format!("\nand {} others", len - 8) } else { String::new() }
-            ));
-        }
-        true
+        report(normalized_impl_candidates, err)
     }
 
     /// Gets the parent trait chain start
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index b369c733871..16ecca254c7 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -557,8 +557,11 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
                     }
                 } else if real_trait_pred != trait_pred {
                     // This branch addresses #87437.
-                    let obligation =
-                        self.mk_trait_obligation_with_new_self_ty(param_env, real_trait_pred, base_ty);
+                    let obligation = self.mk_trait_obligation_with_new_self_ty(
+                        param_env,
+                        real_trait_pred,
+                        base_ty,
+                    );
                     if self.predicate_may_hold(&obligation) {
                         err.span_suggestion_verbose(
                             span.shrink_to_lo(),
diff --git a/src/test/ui/binop/binop-mul-i32-f32.stderr b/src/test/ui/binop/binop-mul-i32-f32.stderr
index 715e52b41e7..453333fb56a 100644
--- a/src/test/ui/binop/binop-mul-i32-f32.stderr
+++ b/src/test/ui/binop/binop-mul-i32-f32.stderr
@@ -5,15 +5,15 @@ LL |     x * y
    |       ^ no implementation for `i32 * f32`
    |
    = help: the trait `Mul<f32>` is not implemented for `i32`
-   = help: the following implementations were found:
-             <&'a i32 as Mul<i32>>
-             <&i32 as Mul<&i32>>
-             <i32 as Mul<&i32>>
-             <i32 as Mul>
+   = help: the following other types implement trait `Mul`:
              <&'a f32 as Mul<f32>>
              <&'a f64 as Mul<f64>>
              <&'a i128 as Mul<i128>>
              <&'a i16 as Mul<i16>>
+             <&'a i32 as Mul<i32>>
+             <&'a i64 as Mul<i64>>
+             <&'a i8 as Mul<i8>>
+             <&'a isize as Mul<isize>>
            and 49 others
 
 error: aborting due to previous error
diff --git a/src/test/ui/binop/issue-77910-1.stderr b/src/test/ui/binop/issue-77910-1.stderr
index 16b06a0198b..95ee51a8826 100644
--- a/src/test/ui/binop/issue-77910-1.stderr
+++ b/src/test/ui/binop/issue-77910-1.stderr
@@ -16,15 +16,15 @@ LL |     assert_eq!(foo, y);
    |     ^^^^^^^^^^^^^^^^^^ `for<'r> fn(&'r i32) -> &'r i32 {foo}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
    |
    = help: the trait `Debug` is not implemented for `for<'r> fn(&'r i32) -> &'r i32 {foo}`
-   = help: the following implementations were found:
-             <extern "C" fn() -> Ret as Debug>
-             <extern "C" fn(A) -> Ret as Debug>
-             <extern "C" fn(A, ...) -> Ret as Debug>
-             <extern "C" fn(A, B) -> Ret as Debug>
-             <extern "C" fn(A, B, ...) -> Ret as Debug>
-             <extern "C" fn(A, B, C) -> Ret as Debug>
-             <extern "C" fn(A, B, C, ...) -> Ret as Debug>
-             <extern "C" fn(A, B, C, D) -> Ret as Debug>
+   = help: the following other types implement trait `Debug`:
+             extern "C" fn() -> Ret
+             extern "C" fn(A) -> Ret
+             extern "C" fn(A, ...) -> Ret
+             extern "C" fn(A, B) -> Ret
+             extern "C" fn(A, B, ...) -> Ret
+             extern "C" fn(A, B, C) -> Ret
+             extern "C" fn(A, B, C, ...) -> Ret
+             extern "C" fn(A, B, C, D) -> Ret
            and 68 others
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/src/test/ui/binop/shift-various-bad-types.stderr b/src/test/ui/binop/shift-various-bad-types.stderr
index 8fdb377751c..bb0bb63b22d 100644
--- a/src/test/ui/binop/shift-various-bad-types.stderr
+++ b/src/test/ui/binop/shift-various-bad-types.stderr
@@ -5,7 +5,7 @@ LL |     22 >> p.char;
    |        ^^ no implementation for `{integer} >> char`
    |
    = help: the trait `Shr<char>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Shr`:
              <&'a i128 as Shr<i128>>
              <&'a i128 as Shr<i16>>
              <&'a i128 as Shr<i32>>
@@ -23,7 +23,7 @@ LL |     22 >> p.str;
    |        ^^ no implementation for `{integer} >> &str`
    |
    = help: the trait `Shr<&str>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Shr`:
              <&'a i128 as Shr<i128>>
              <&'a i128 as Shr<i16>>
              <&'a i128 as Shr<i32>>
@@ -41,7 +41,7 @@ LL |     22 >> p;
    |        ^^ no implementation for `{integer} >> &Panolpy`
    |
    = help: the trait `Shr<&Panolpy>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Shr`:
              <&'a i128 as Shr<i128>>
              <&'a i128 as Shr<i16>>
              <&'a i128 as Shr<i32>>
diff --git a/src/test/ui/chalkify/chalk_initial_program.stderr b/src/test/ui/chalkify/chalk_initial_program.stderr
index 7b0b3f85b39..343c0a31862 100644
--- a/src/test/ui/chalkify/chalk_initial_program.stderr
+++ b/src/test/ui/chalkify/chalk_initial_program.stderr
@@ -4,9 +4,9 @@ error[E0277]: the trait bound `f32: Foo` is not satisfied
 LL |     gimme::<f32>();
    |             ^^^ the trait `Foo` is not implemented for `f32`
    |
-   = help: the following implementations were found:
-             <i32 as Foo>
-             <u32 as Foo>
+   = help: the following other types implement trait `Foo`:
+             i32
+             u32
 note: required by a bound in `gimme`
   --> $DIR/chalk_initial_program.rs:9:13
    |
diff --git a/src/test/ui/chalkify/type_inference.stderr b/src/test/ui/chalkify/type_inference.stderr
index 14d43c1474c..508a6dd1388 100644
--- a/src/test/ui/chalkify/type_inference.stderr
+++ b/src/test/ui/chalkify/type_inference.stderr
@@ -6,9 +6,9 @@ LL |     only_bar(x);
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the following implementations were found:
-             <i32 as Bar>
-             <u32 as Bar>
+   = help: the following other types implement trait `Bar`:
+             i32
+             u32
 note: required by a bound in `only_bar`
   --> $DIR/type_inference.rs:12:16
    |
diff --git a/src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr b/src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr
index 9cadc4110e1..4c9ab6901b1 100644
--- a/src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr
+++ b/src/test/ui/const-generics/defaults/rp_impl_trait_fail.stderr
@@ -25,7 +25,7 @@ error[E0277]: the trait bound `u32: Traitor<N, N>` is not satisfied
 LL | fn uwu<const N: u8>() -> impl Traitor<N> {
    |                          ^^^^^^^^^^^^^^^ the trait `Traitor<N, N>` is not implemented for `u32`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Traitor<N, 2_u8>`:
              <u32 as Traitor<N, 2_u8>>
              <u64 as Traitor<1_u8, 2_u8>>
 
@@ -50,9 +50,9 @@ error[E0277]: the trait bound `u64: Traitor<1_u8, 1_u8>` is not satisfied
 LL | fn owo() -> impl Traitor {
    |             ^^^^^^^^^^^^ the trait `Traitor<1_u8, 1_u8>` is not implemented for `u64`
    |
-   = help: the following implementations were found:
-             <u64 as Traitor<1_u8, 2_u8>>
+   = help: the following other types implement trait `Traitor<N, 2_u8>`:
              <u32 as Traitor<N, 2_u8>>
+             <u64 as Traitor<1_u8, 2_u8>>
 
 error[E0277]: the trait bound `u64: Traitor<1_u8, 1_u8>` is not satisfied
   --> $DIR/rp_impl_trait_fail.rs:24:26
diff --git a/src/test/ui/const-generics/exhaustive-value.stderr b/src/test/ui/const-generics/exhaustive-value.stderr
index fcbb41bb4fc..5613ed27cb2 100644
--- a/src/test/ui/const-generics/exhaustive-value.stderr
+++ b/src/test/ui/const-generics/exhaustive-value.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `(): Foo<N>` is not satisfied
 LL |     <() as Foo<N>>::test()
    |     ^^^^^^^^^^^^^^^^^^^^ the trait `Foo<N>` is not implemented for `()`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Foo<0_u8>`:
              <() as Foo<0_u8>>
              <() as Foo<100_u8>>
              <() as Foo<101_u8>>
diff --git a/src/test/ui/const-generics/issues/issue-67185-2.stderr b/src/test/ui/const-generics/issues/issue-67185-2.stderr
index 89aa3d395e2..c7be8e14a10 100644
--- a/src/test/ui/const-generics/issues/issue-67185-2.stderr
+++ b/src/test/ui/const-generics/issues/issue-67185-2.stderr
@@ -4,9 +4,9 @@ error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
 LL |     <u8 as Baz>::Quaks: Bar,
    |     ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `[u16; 3]`
    |
-   = help: the following implementations were found:
-             <[[u16; 3]; 3] as Bar>
-             <[u16; 4] as Bar>
+   = help: the following other types implement trait `Bar`:
+             [[u16; 3]; 3]
+             [u16; 4]
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
 
@@ -16,9 +16,9 @@ error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
 LL |     [<u8 as Baz>::Quaks; 2]: Bar,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
    |
-   = help: the following implementations were found:
-             <[[u16; 3]; 3] as Bar>
-             <[u16; 4] as Bar>
+   = help: the following other types implement trait `Bar`:
+             [[u16; 3]; 3]
+             [u16; 4]
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
 
@@ -28,9 +28,9 @@ error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
 LL | impl Foo for FooImpl {}
    |      ^^^ the trait `Bar` is not implemented for `[u16; 3]`
    |
-   = help: the following implementations were found:
-             <[[u16; 3]; 3] as Bar>
-             <[u16; 4] as Bar>
+   = help: the following other types implement trait `Bar`:
+             [[u16; 3]; 3]
+             [u16; 4]
 note: required by a bound in `Foo`
   --> $DIR/issue-67185-2.rs:15:25
    |
@@ -46,9 +46,9 @@ error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
 LL | impl Foo for FooImpl {}
    |      ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
    |
-   = help: the following implementations were found:
-             <[[u16; 3]; 3] as Bar>
-             <[u16; 4] as Bar>
+   = help: the following other types implement trait `Bar`:
+             [[u16; 3]; 3]
+             [u16; 4]
 note: required by a bound in `Foo`
   --> $DIR/issue-67185-2.rs:14:30
    |
@@ -64,9 +64,9 @@ error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
 LL | fn f(_: impl Foo) {}
    |              ^^^ the trait `Bar` is not implemented for `[[u16; 3]; 2]`
    |
-   = help: the following implementations were found:
-             <[[u16; 3]; 3] as Bar>
-             <[u16; 4] as Bar>
+   = help: the following other types implement trait `Bar`:
+             [[u16; 3]; 3]
+             [u16; 4]
 note: required by a bound in `Foo`
   --> $DIR/issue-67185-2.rs:14:30
    |
@@ -82,9 +82,9 @@ error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
 LL | fn f(_: impl Foo) {}
    |              ^^^ the trait `Bar` is not implemented for `[u16; 3]`
    |
-   = help: the following implementations were found:
-             <[[u16; 3]; 3] as Bar>
-             <[u16; 4] as Bar>
+   = help: the following other types implement trait `Bar`:
+             [[u16; 3]; 3]
+             [u16; 4]
 note: required by a bound in `Foo`
   --> $DIR/issue-67185-2.rs:15:25
    |
diff --git a/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr b/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr
index aedf44658db..8431d989278 100644
--- a/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr
+++ b/src/test/ui/const-generics/occurs-check/unused-substs-1.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `A<{_: usize}>: Bar<{_: usize}>` is not satisfied
 LL |     let _ = A;
    |             ^ the trait `Bar<{_: usize}>` is not implemented for `A<{_: usize}>`
    |
-   = help: the trait `Bar<N>` is implemented for `A<{ 6 + 1 }>`
+   = help: the trait `Bar<N>` is implemented for `A<7_usize>`
 note: required by a bound in `A`
   --> $DIR/unused-substs-1.rs:9:11
    |
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr
index d2d68506d4e..5fde557a32a 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr
@@ -11,15 +11,15 @@ LL |     = [0; (i8::MAX + 1u8) as usize];
    |                    ^ no implementation for `i8 + u8`
    |
    = help: the trait `Add<u8>` is not implemented for `i8`
-   = help: the following implementations were found:
-             <&'a i8 as Add<i8>>
-             <&i8 as Add<&i8>>
-             <i8 as Add<&i8>>
-             <i8 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error: aborting due to 2 previous errors
diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
index 818e3bc15b1..3c192eef14f 100644
--- a/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
+++ b/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr
@@ -11,15 +11,15 @@ LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
    |                            ^ no implementation for `i8 + u8`
    |
    = help: the trait `Add<u8>` is not implemented for `i8`
-   = help: the following implementations were found:
-             <&'a i8 as Add<i8>>
-             <&i8 as Add<&i8>>
-             <i8 as Add<&i8>>
-             <i8 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error[E0604]: only `u8` can be cast as `char`, not `i8`
diff --git a/src/test/ui/consts/too_generic_eval_ice.stderr b/src/test/ui/consts/too_generic_eval_ice.stderr
index 45459b931ca..5544350c34c 100644
--- a/src/test/ui/consts/too_generic_eval_ice.stderr
+++ b/src/test/ui/consts/too_generic_eval_ice.stderr
@@ -21,7 +21,7 @@ LL |         [5; Self::HOST_SIZE] == [6; 0]
    |                              ^^ no implementation for `[{integer}; _] == [{integer}; 0]`
    |
    = help: the trait `PartialEq<[{integer}; 0]>` is not implemented for `[{integer}; _]`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `PartialEq<[B; N]>`:
              <&[B] as PartialEq<[A; N]>>
              <&[T] as PartialEq<Vec<U, A>>>
              <&mut [B] as PartialEq<[A; N]>>
diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr
index 8aedb4229e6..1c83f75ffb9 100644
--- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr
+++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-1.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
 LL |     f1.foo(1usize);
    |        ^^^ the trait `Foo<usize>` is not implemented for `Bar`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Foo<i32>`:
              <Bar as Foo<i32>>
              <Bar as Foo<u8>>
 
diff --git a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
index f25c7ce00e5..85f3eba927d 100644
--- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
+++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `Bar: Foo<usize>` is not satisfied
 LL |     f1.foo(1usize);
    |        ^^^ the trait `Foo<usize>` is not implemented for `Bar`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Foo<i8>`:
              <Bar as Foo<i16>>
              <Bar as Foo<i32>>
              <Bar as Foo<i8>>
diff --git a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr
index 3aa863e900f..e1d80313bc4 100644
--- a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr
+++ b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr
@@ -6,7 +6,7 @@ LL |     Foo::<i32>::bar(&1i8);
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Foo<bool>`:
              <i8 as Foo<bool>>
              <i8 as Foo<u16>>
              <i8 as Foo<u32>>
@@ -25,16 +25,16 @@ LL |     Foo::<i32>::bar(&1u8);
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the following implementations were found:
-             <u8 as Foo<bool>>
-             <u8 as Foo<u16>>
-             <u8 as Foo<u32>>
-             <u8 as Foo<u64>>
+   = help: the following other types implement trait `Foo<bool>`:
              <i8 as Foo<bool>>
              <i8 as Foo<u16>>
              <i8 as Foo<u32>>
              <i8 as Foo<u64>>
              <i8 as Foo<u8>>
+             <u8 as Foo<bool>>
+             <u8 as Foo<u16>>
+             <u8 as Foo<u32>>
+             <u8 as Foo<u64>>
 
 error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
   --> $DIR/issue-39802-show-5-trait-impls.rs:26:21
@@ -44,7 +44,7 @@ LL |     Foo::<i32>::bar(&true);
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Foo<bool>`:
              <bool as Foo<bool>>
              <bool as Foo<i8>>
              <bool as Foo<u16>>
diff --git a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
index bd9d9e086e0..15af2c26e8f 100644
--- a/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
+++ b/src/test/ui/did_you_mean/issue-49746-unicode-confusable-in-float-literal-expt.stderr
@@ -22,7 +22,7 @@ LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e−11; // m³⋅kg⁻¹
    |                                                     ^ no implementation for `{float} - {integer}`
    |
    = help: the trait `Sub<{integer}>` is not implemented for `{float}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
              <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
diff --git a/src/test/ui/generic-associated-types/bugs/issue-88460.stderr b/src/test/ui/generic-associated-types/bugs/issue-88460.stderr
index ec8de15dc39..98c304cc90b 100644
--- a/src/test/ui/generic-associated-types/bugs/issue-88460.stderr
+++ b/src/test/ui/generic-associated-types/bugs/issue-88460.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `for<'a> <_ as Trait>::Assoc<'a>: Marker` is not s
 LL |     test(Foo);
    |     ^^^^ the trait `for<'a> Marker` is not implemented for `<_ as Trait>::Assoc<'a>`
    |
-   = help: the trait `for<'a> Marker` is implemented for `()`
+   = help: the trait `Marker` is implemented for `()`
 note: required by a bound in `test`
   --> $DIR/issue-88460.rs:17:27
    |
diff --git a/src/test/ui/impl-trait/equality.stderr b/src/test/ui/impl-trait/equality.stderr
index 9137183375a..48cfcb4ad3e 100644
--- a/src/test/ui/impl-trait/equality.stderr
+++ b/src/test/ui/impl-trait/equality.stderr
@@ -24,15 +24,15 @@ LL |         n + sum_to(n - 1)
    |           ^ no implementation for `u32 + impl Foo`
    |
    = help: the trait `Add<impl Foo>` is not implemented for `u32`
-   = help: the following implementations were found:
-             <&'a u32 as Add<u32>>
-             <&u32 as Add<&u32>>
-             <u32 as Add<&u32>>
-             <u32 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error: aborting due to 2 previous errors; 1 warning emitted
diff --git a/src/test/ui/issues/issue-11771.stderr b/src/test/ui/issues/issue-11771.stderr
index 01967777598..ef15aa58404 100644
--- a/src/test/ui/issues/issue-11771.stderr
+++ b/src/test/ui/issues/issue-11771.stderr
@@ -5,7 +5,7 @@ LL |     1 +
    |       ^ no implementation for `{integer} + ()`
    |
    = help: the trait `Add<()>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
@@ -23,7 +23,7 @@ LL |     1 +
    |       ^ no implementation for `{integer} + ()`
    |
    = help: the trait `Add<()>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
diff --git a/src/test/ui/issues/issue-24352.stderr b/src/test/ui/issues/issue-24352.stderr
index 364fbbc981e..1fa2d356c68 100644
--- a/src/test/ui/issues/issue-24352.stderr
+++ b/src/test/ui/issues/issue-24352.stderr
@@ -5,15 +5,15 @@ LL |     1.0f64 - 1
    |            ^ no implementation for `f64 - {integer}`
    |
    = help: the trait `Sub<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Sub<f64>>
-             <&f64 as Sub<&f64>>
-             <f64 as Sub<&f64>>
-             <f64 as Sub>
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
+             <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
              <&'a i16 as Sub<i16>>
              <&'a i32 as Sub<i32>>
+             <&'a i64 as Sub<i64>>
+             <&'a i8 as Sub<i8>>
+             <&'a isize as Sub<isize>>
            and 48 others
 help: consider using a floating-point literal by writing it with `.0`
    |
diff --git a/src/test/ui/issues/issue-50582.stderr b/src/test/ui/issues/issue-50582.stderr
index a1e614807de..d4e29030c16 100644
--- a/src/test/ui/issues/issue-50582.stderr
+++ b/src/test/ui/issues/issue-50582.stderr
@@ -14,7 +14,7 @@ LL |     Vec::<[(); 1 + for x in 0..1 {}]>::new();
    |                  ^ no implementation for `{integer} + ()`
    |
    = help: the trait `Add<()>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
diff --git a/src/test/ui/issues/issue-59488.stderr b/src/test/ui/issues/issue-59488.stderr
index c61d44bf895..76a47c49bba 100644
--- a/src/test/ui/issues/issue-59488.stderr
+++ b/src/test/ui/issues/issue-59488.stderr
@@ -94,15 +94,15 @@ LL |     assert_eq!(Foo::Bar, i);
    |     ^^^^^^^^^^^^^^^^^^^^^^^ `fn(usize) -> Foo {Foo::Bar}` cannot be formatted using `{:?}` because it doesn't implement `Debug`
    |
    = help: the trait `Debug` is not implemented for `fn(usize) -> Foo {Foo::Bar}`
-   = help: the following implementations were found:
-             <extern "C" fn() -> Ret as Debug>
-             <extern "C" fn(A) -> Ret as Debug>
-             <extern "C" fn(A, ...) -> Ret as Debug>
-             <extern "C" fn(A, B) -> Ret as Debug>
-             <extern "C" fn(A, B, ...) -> Ret as Debug>
-             <extern "C" fn(A, B, C) -> Ret as Debug>
-             <extern "C" fn(A, B, C, ...) -> Ret as Debug>
-             <extern "C" fn(A, B, C, D) -> Ret as Debug>
+   = help: the following other types implement trait `Debug`:
+             extern "C" fn() -> Ret
+             extern "C" fn(A) -> Ret
+             extern "C" fn(A, ...) -> Ret
+             extern "C" fn(A, B) -> Ret
+             extern "C" fn(A, B, ...) -> Ret
+             extern "C" fn(A, B, C) -> Ret
+             extern "C" fn(A, B, C, ...) -> Ret
+             extern "C" fn(A, B, C, D) -> Ret
            and 68 others
    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/src/test/ui/kindck/kindck-copy.stderr b/src/test/ui/kindck/kindck-copy.stderr
index 29c9b872b58..1c61c85368b 100644
--- a/src/test/ui/kindck/kindck-copy.stderr
+++ b/src/test/ui/kindck/kindck-copy.stderr
@@ -4,15 +4,15 @@ error[E0277]: the trait bound `&'static mut isize: Copy` is not satisfied
 LL |     assert_copy::<&'static mut isize>();
    |                   ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'static mut isize`
    |
-   = help: the following implementations were found:
-             <isize as Copy>
-             <f32 as Copy>
-             <f64 as Copy>
-             <i128 as Copy>
-             <i16 as Copy>
-             <i32 as Copy>
-             <i64 as Copy>
-             <i8 as Copy>
+   = help: the following other types implement trait `Copy`:
+             f32
+             f64
+             i128
+             i16
+             i32
+             i64
+             i8
+             isize
            and 6 others
 note: required by a bound in `assert_copy`
   --> $DIR/kindck-copy.rs:5:18
@@ -26,15 +26,15 @@ error[E0277]: the trait bound `&'a mut isize: Copy` is not satisfied
 LL |     assert_copy::<&'a mut isize>();
    |                   ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `&'a mut isize`
    |
-   = help: the following implementations were found:
-             <isize as Copy>
-             <f32 as Copy>
-             <f64 as Copy>
-             <i128 as Copy>
-             <i16 as Copy>
-             <i32 as Copy>
-             <i64 as Copy>
-             <i8 as Copy>
+   = help: the following other types implement trait `Copy`:
+             f32
+             f64
+             i128
+             i16
+             i32
+             i64
+             i8
+             isize
            and 6 others
 note: required by a bound in `assert_copy`
   --> $DIR/kindck-copy.rs:5:18
diff --git a/src/test/ui/lexer/lex-bad-char-literals-6.stderr b/src/test/ui/lexer/lex-bad-char-literals-6.stderr
index 9df6c92d1e5..199958bc7e4 100644
--- a/src/test/ui/lexer/lex-bad-char-literals-6.stderr
+++ b/src/test/ui/lexer/lex-bad-char-literals-6.stderr
@@ -38,15 +38,15 @@ LL |     if x == y {}
    |          ^^ no implementation for `&str == char`
    |
    = help: the trait `PartialEq<char>` is not implemented for `&str`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `PartialEq<Cow<'a, str>>`:
              <&'a str as PartialEq<OsString>>
              <&'a str as PartialEq<String>>
              <&'b str as PartialEq<Cow<'a, str>>>
+             <String as PartialEq<&'a str>>
+             <String as PartialEq<Cow<'a, str>>>
+             <String as PartialEq<str>>
+             <String as PartialEq>
              <str as PartialEq<Cow<'a, str>>>
-             <str as PartialEq<OsStr>>
-             <str as PartialEq<OsString>>
-             <str as PartialEq<String>>
-             <str as PartialEq>
            and 4 others
 
 error[E0308]: mismatched types
@@ -64,15 +64,15 @@ LL |     if x == z {}
    |          ^^ no implementation for `&str == char`
    |
    = help: the trait `PartialEq<char>` is not implemented for `&str`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `PartialEq<Cow<'a, str>>`:
              <&'a str as PartialEq<OsString>>
              <&'a str as PartialEq<String>>
              <&'b str as PartialEq<Cow<'a, str>>>
+             <String as PartialEq<&'a str>>
+             <String as PartialEq<Cow<'a, str>>>
+             <String as PartialEq<str>>
+             <String as PartialEq>
              <str as PartialEq<Cow<'a, str>>>
-             <str as PartialEq<OsStr>>
-             <str as PartialEq<OsString>>
-             <str as PartialEq<String>>
-             <str as PartialEq>
            and 4 others
 
 error: aborting due to 6 previous errors
diff --git a/src/test/ui/mismatched_types/binops.stderr b/src/test/ui/mismatched_types/binops.stderr
index 843ae5044c3..16d12228993 100644
--- a/src/test/ui/mismatched_types/binops.stderr
+++ b/src/test/ui/mismatched_types/binops.stderr
@@ -5,7 +5,7 @@ LL |     1 + Some(1);
    |       ^ no implementation for `{integer} + Option<{integer}>`
    |
    = help: the trait `Add<Option<{integer}>>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
@@ -23,15 +23,15 @@ LL |     2 as usize - Some(1);
    |                ^ no implementation for `usize - Option<{integer}>`
    |
    = help: the trait `Sub<Option<{integer}>>` is not implemented for `usize`
-   = help: the following implementations were found:
-             <&'a usize as Sub<usize>>
-             <&usize as Sub<&usize>>
-             <usize as Sub<&usize>>
-             <usize as Sub>
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
              <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
              <&'a i16 as Sub<i16>>
+             <&'a i32 as Sub<i32>>
+             <&'a i64 as Sub<i64>>
+             <&'a i8 as Sub<i8>>
+             <&'a isize as Sub<isize>>
            and 48 others
 
 error[E0277]: cannot multiply `{integer}` by `()`
@@ -41,7 +41,7 @@ LL |     3 * ();
    |       ^ no implementation for `{integer} * ()`
    |
    = help: the trait `Mul<()>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Mul`:
              <&'a f32 as Mul<f32>>
              <&'a f64 as Mul<f64>>
              <&'a i128 as Mul<i128>>
@@ -59,7 +59,7 @@ LL |     4 / "";
    |       ^ no implementation for `{integer} / &str`
    |
    = help: the trait `Div<&str>` is not implemented for `{integer}`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Div`:
              <&'a f32 as Div<f32>>
              <&'a f64 as Div<f64>>
              <&'a i128 as Div<i128>>
@@ -77,15 +77,15 @@ LL |     5 < String::new();
    |       ^ no implementation for `{integer} < String` and `{integer} > String`
    |
    = help: the trait `PartialOrd<String>` is not implemented for `{integer}`
-   = help: the following implementations were found:
-             <f32 as PartialOrd>
-             <f64 as PartialOrd>
-             <i128 as PartialOrd>
-             <i16 as PartialOrd>
-             <i32 as PartialOrd>
-             <i64 as PartialOrd>
-             <i8 as PartialOrd>
-             <isize as PartialOrd>
+   = help: the following other types implement trait `PartialOrd`:
+             f32
+             f64
+             i128
+             i16
+             i32
+             i64
+             i8
+             isize
            and 6 others
 
 error[E0277]: can't compare `{integer}` with `Result<{integer}, _>`
@@ -95,15 +95,15 @@ LL |     6 == Ok(1);
    |       ^^ no implementation for `{integer} == Result<{integer}, _>`
    |
    = help: the trait `PartialEq<Result<{integer}, _>>` is not implemented for `{integer}`
-   = help: the following implementations were found:
-             <f32 as PartialEq>
-             <f64 as PartialEq>
-             <i128 as PartialEq>
-             <i16 as PartialEq>
-             <i32 as PartialEq>
-             <i64 as PartialEq>
-             <i8 as PartialEq>
-             <isize as PartialEq>
+   = help: the following other types implement trait `PartialEq`:
+             f32
+             f64
+             i128
+             i16
+             i32
+             i64
+             i8
+             isize
            and 6 others
 
 error: aborting due to 6 previous errors
diff --git a/src/test/ui/never_type/issue-13352.stderr b/src/test/ui/never_type/issue-13352.stderr
index cfb5d28e767..449b0756012 100644
--- a/src/test/ui/never_type/issue-13352.stderr
+++ b/src/test/ui/never_type/issue-13352.stderr
@@ -5,15 +5,15 @@ LL |     2_usize + (loop {});
    |             ^ no implementation for `usize + ()`
    |
    = help: the trait `Add<()>` is not implemented for `usize`
-   = help: the following implementations were found:
-             <&'a usize as Add<usize>>
-             <&usize as Add<&usize>>
-             <usize as Add<&usize>>
-             <usize as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error: aborting due to previous error
diff --git a/src/test/ui/numbers-arithmetic/not-suggest-float-literal.stderr b/src/test/ui/numbers-arithmetic/not-suggest-float-literal.stderr
index 431cbf81b01..72cc4f6ec64 100644
--- a/src/test/ui/numbers-arithmetic/not-suggest-float-literal.stderr
+++ b/src/test/ui/numbers-arithmetic/not-suggest-float-literal.stderr
@@ -5,15 +5,15 @@ LL |     x + 100.0
    |       ^ no implementation for `u8 + {float}`
    |
    = help: the trait `Add<{float}>` is not implemented for `u8`
-   = help: the following implementations were found:
-             <&'a u8 as Add<u8>>
-             <&u8 as Add<&u8>>
-             <u8 as Add<&u8>>
-             <u8 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error[E0277]: cannot add `&str` to `f64`
@@ -23,15 +23,15 @@ LL |     x + "foo"
    |       ^ no implementation for `f64 + &str`
    |
    = help: the trait `Add<&str>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Add<f64>>
-             <&f64 as Add<&f64>>
-             <f64 as Add<&f64>>
-             <f64 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
+             <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
              <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error[E0277]: cannot add `{integer}` to `f64`
@@ -41,15 +41,15 @@ LL |     x + y
    |       ^ no implementation for `f64 + {integer}`
    |
    = help: the trait `Add<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Add<f64>>
-             <&f64 as Add<&f64>>
-             <f64 as Add<&f64>>
-             <f64 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
+             <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
              <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error[E0277]: cannot subtract `{float}` from `u8`
@@ -59,15 +59,15 @@ LL |     x - 100.0
    |       ^ no implementation for `u8 - {float}`
    |
    = help: the trait `Sub<{float}>` is not implemented for `u8`
-   = help: the following implementations were found:
-             <&'a u8 as Sub<u8>>
-             <&u8 as Sub<&u8>>
-             <u8 as Sub<&u8>>
-             <u8 as Sub>
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
              <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
              <&'a i16 as Sub<i16>>
+             <&'a i32 as Sub<i32>>
+             <&'a i64 as Sub<i64>>
+             <&'a i8 as Sub<i8>>
+             <&'a isize as Sub<isize>>
            and 48 others
 
 error[E0277]: cannot subtract `&str` from `f64`
@@ -77,15 +77,15 @@ LL |     x - "foo"
    |       ^ no implementation for `f64 - &str`
    |
    = help: the trait `Sub<&str>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Sub<f64>>
-             <&f64 as Sub<&f64>>
-             <f64 as Sub<&f64>>
-             <f64 as Sub>
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
+             <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
              <&'a i16 as Sub<i16>>
              <&'a i32 as Sub<i32>>
+             <&'a i64 as Sub<i64>>
+             <&'a i8 as Sub<i8>>
+             <&'a isize as Sub<isize>>
            and 48 others
 
 error[E0277]: cannot subtract `{integer}` from `f64`
@@ -95,15 +95,15 @@ LL |     x - y
    |       ^ no implementation for `f64 - {integer}`
    |
    = help: the trait `Sub<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Sub<f64>>
-             <&f64 as Sub<&f64>>
-             <f64 as Sub<&f64>>
-             <f64 as Sub>
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
+             <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
              <&'a i16 as Sub<i16>>
              <&'a i32 as Sub<i32>>
+             <&'a i64 as Sub<i64>>
+             <&'a i8 as Sub<i8>>
+             <&'a isize as Sub<isize>>
            and 48 others
 
 error[E0277]: cannot multiply `u8` by `{float}`
@@ -113,15 +113,15 @@ LL |     x * 100.0
    |       ^ no implementation for `u8 * {float}`
    |
    = help: the trait `Mul<{float}>` is not implemented for `u8`
-   = help: the following implementations were found:
-             <&'a u8 as Mul<u8>>
-             <&u8 as Mul<&u8>>
-             <u8 as Mul<&u8>>
-             <u8 as Mul>
+   = help: the following other types implement trait `Mul`:
              <&'a f32 as Mul<f32>>
              <&'a f64 as Mul<f64>>
              <&'a i128 as Mul<i128>>
              <&'a i16 as Mul<i16>>
+             <&'a i32 as Mul<i32>>
+             <&'a i64 as Mul<i64>>
+             <&'a i8 as Mul<i8>>
+             <&'a isize as Mul<isize>>
            and 49 others
 
 error[E0277]: cannot multiply `f64` by `&str`
@@ -131,15 +131,15 @@ LL |     x * "foo"
    |       ^ no implementation for `f64 * &str`
    |
    = help: the trait `Mul<&str>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Mul<f64>>
-             <&f64 as Mul<&f64>>
-             <f64 as Mul<&f64>>
-             <f64 as Mul>
+   = help: the following other types implement trait `Mul`:
              <&'a f32 as Mul<f32>>
+             <&'a f64 as Mul<f64>>
              <&'a i128 as Mul<i128>>
              <&'a i16 as Mul<i16>>
              <&'a i32 as Mul<i32>>
+             <&'a i64 as Mul<i64>>
+             <&'a i8 as Mul<i8>>
+             <&'a isize as Mul<isize>>
            and 49 others
 
 error[E0277]: cannot multiply `f64` by `{integer}`
@@ -149,15 +149,15 @@ LL |     x * y
    |       ^ no implementation for `f64 * {integer}`
    |
    = help: the trait `Mul<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Mul<f64>>
-             <&f64 as Mul<&f64>>
-             <f64 as Mul<&f64>>
-             <f64 as Mul>
+   = help: the following other types implement trait `Mul`:
              <&'a f32 as Mul<f32>>
+             <&'a f64 as Mul<f64>>
              <&'a i128 as Mul<i128>>
              <&'a i16 as Mul<i16>>
              <&'a i32 as Mul<i32>>
+             <&'a i64 as Mul<i64>>
+             <&'a i8 as Mul<i8>>
+             <&'a isize as Mul<isize>>
            and 49 others
 
 error[E0277]: cannot divide `u8` by `{float}`
@@ -167,15 +167,15 @@ LL |     x / 100.0
    |       ^ no implementation for `u8 / {float}`
    |
    = help: the trait `Div<{float}>` is not implemented for `u8`
-   = help: the following implementations were found:
-             <&'a u8 as Div<u8>>
-             <&u8 as Div<&u8>>
-             <u8 as Div<&u8>>
-             <u8 as Div<NonZeroU8>>
-             <u8 as Div>
+   = help: the following other types implement trait `Div`:
              <&'a f32 as Div<f32>>
              <&'a f64 as Div<f64>>
              <&'a i128 as Div<i128>>
+             <&'a i16 as Div<i16>>
+             <&'a i32 as Div<i32>>
+             <&'a i64 as Div<i64>>
+             <&'a i8 as Div<i8>>
+             <&'a isize as Div<isize>>
            and 54 others
 
 error[E0277]: cannot divide `f64` by `&str`
@@ -185,15 +185,15 @@ LL |     x / "foo"
    |       ^ no implementation for `f64 / &str`
    |
    = help: the trait `Div<&str>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Div<f64>>
-             <&f64 as Div<&f64>>
-             <f64 as Div<&f64>>
-             <f64 as Div>
+   = help: the following other types implement trait `Div`:
              <&'a f32 as Div<f32>>
+             <&'a f64 as Div<f64>>
              <&'a i128 as Div<i128>>
              <&'a i16 as Div<i16>>
              <&'a i32 as Div<i32>>
+             <&'a i64 as Div<i64>>
+             <&'a i8 as Div<i8>>
+             <&'a isize as Div<isize>>
            and 54 others
 
 error[E0277]: cannot divide `f64` by `{integer}`
@@ -203,15 +203,15 @@ LL |     x / y
    |       ^ no implementation for `f64 / {integer}`
    |
    = help: the trait `Div<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Div<f64>>
-             <&f64 as Div<&f64>>
-             <f64 as Div<&f64>>
-             <f64 as Div>
+   = help: the following other types implement trait `Div`:
              <&'a f32 as Div<f32>>
+             <&'a f64 as Div<f64>>
              <&'a i128 as Div<i128>>
              <&'a i16 as Div<i16>>
              <&'a i32 as Div<i32>>
+             <&'a i64 as Div<i64>>
+             <&'a i8 as Div<i8>>
+             <&'a isize as Div<isize>>
            and 54 others
 
 error: aborting due to 12 previous errors
diff --git a/src/test/ui/numbers-arithmetic/suggest-float-literal.stderr b/src/test/ui/numbers-arithmetic/suggest-float-literal.stderr
index 543e3137fdd..fd3996416b6 100644
--- a/src/test/ui/numbers-arithmetic/suggest-float-literal.stderr
+++ b/src/test/ui/numbers-arithmetic/suggest-float-literal.stderr
@@ -5,15 +5,15 @@ LL |     x + 100
    |       ^ no implementation for `f32 + {integer}`
    |
    = help: the trait `Add<{integer}>` is not implemented for `f32`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
-             <&f32 as Add<&f32>>
-             <f32 as Add<&f32>>
-             <f32 as Add>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
              <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 help: consider using a floating-point literal by writing it with `.0`
    |
@@ -27,15 +27,15 @@ LL |     x + 100
    |       ^ no implementation for `f64 + {integer}`
    |
    = help: the trait `Add<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Add<f64>>
-             <&f64 as Add<&f64>>
-             <f64 as Add<&f64>>
-             <f64 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
+             <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
              <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 help: consider using a floating-point literal by writing it with `.0`
    |
@@ -49,15 +49,15 @@ LL |     x - 100
    |       ^ no implementation for `f32 - {integer}`
    |
    = help: the trait `Sub<{integer}>` is not implemented for `f32`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
-             <&f32 as Sub<&f32>>
-             <f32 as Sub<&f32>>
-             <f32 as Sub>
              <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
              <&'a i16 as Sub<i16>>
              <&'a i32 as Sub<i32>>
+             <&'a i64 as Sub<i64>>
+             <&'a i8 as Sub<i8>>
+             <&'a isize as Sub<isize>>
            and 48 others
 help: consider using a floating-point literal by writing it with `.0`
    |
@@ -71,15 +71,15 @@ LL |     x - 100
    |       ^ no implementation for `f64 - {integer}`
    |
    = help: the trait `Sub<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Sub<f64>>
-             <&f64 as Sub<&f64>>
-             <f64 as Sub<&f64>>
-             <f64 as Sub>
+   = help: the following other types implement trait `Sub`:
              <&'a f32 as Sub<f32>>
+             <&'a f64 as Sub<f64>>
              <&'a i128 as Sub<i128>>
              <&'a i16 as Sub<i16>>
              <&'a i32 as Sub<i32>>
+             <&'a i64 as Sub<i64>>
+             <&'a i8 as Sub<i8>>
+             <&'a isize as Sub<isize>>
            and 48 others
 help: consider using a floating-point literal by writing it with `.0`
    |
@@ -93,15 +93,15 @@ LL |     x * 100
    |       ^ no implementation for `f32 * {integer}`
    |
    = help: the trait `Mul<{integer}>` is not implemented for `f32`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Mul`:
              <&'a f32 as Mul<f32>>
-             <&f32 as Mul<&f32>>
-             <f32 as Mul<&f32>>
-             <f32 as Mul>
              <&'a f64 as Mul<f64>>
              <&'a i128 as Mul<i128>>
              <&'a i16 as Mul<i16>>
              <&'a i32 as Mul<i32>>
+             <&'a i64 as Mul<i64>>
+             <&'a i8 as Mul<i8>>
+             <&'a isize as Mul<isize>>
            and 49 others
 help: consider using a floating-point literal by writing it with `.0`
    |
@@ -115,15 +115,15 @@ LL |     x * 100
    |       ^ no implementation for `f64 * {integer}`
    |
    = help: the trait `Mul<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Mul<f64>>
-             <&f64 as Mul<&f64>>
-             <f64 as Mul<&f64>>
-             <f64 as Mul>
+   = help: the following other types implement trait `Mul`:
              <&'a f32 as Mul<f32>>
+             <&'a f64 as Mul<f64>>
              <&'a i128 as Mul<i128>>
              <&'a i16 as Mul<i16>>
              <&'a i32 as Mul<i32>>
+             <&'a i64 as Mul<i64>>
+             <&'a i8 as Mul<i8>>
+             <&'a isize as Mul<isize>>
            and 49 others
 help: consider using a floating-point literal by writing it with `.0`
    |
@@ -137,15 +137,15 @@ LL |     x / 100
    |       ^ no implementation for `f32 / {integer}`
    |
    = help: the trait `Div<{integer}>` is not implemented for `f32`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Div`:
              <&'a f32 as Div<f32>>
-             <&f32 as Div<&f32>>
-             <f32 as Div<&f32>>
-             <f32 as Div>
              <&'a f64 as Div<f64>>
              <&'a i128 as Div<i128>>
              <&'a i16 as Div<i16>>
              <&'a i32 as Div<i32>>
+             <&'a i64 as Div<i64>>
+             <&'a i8 as Div<i8>>
+             <&'a isize as Div<isize>>
            and 54 others
 help: consider using a floating-point literal by writing it with `.0`
    |
@@ -159,15 +159,15 @@ LL |     x / 100
    |       ^ no implementation for `f64 / {integer}`
    |
    = help: the trait `Div<{integer}>` is not implemented for `f64`
-   = help: the following implementations were found:
-             <&'a f64 as Div<f64>>
-             <&f64 as Div<&f64>>
-             <f64 as Div<&f64>>
-             <f64 as Div>
+   = help: the following other types implement trait `Div`:
              <&'a f32 as Div<f32>>
+             <&'a f64 as Div<f64>>
              <&'a i128 as Div<i128>>
              <&'a i16 as Div<i16>>
              <&'a i32 as Div<i32>>
+             <&'a i64 as Div<i64>>
+             <&'a i8 as Div<i8>>
+             <&'a isize as Div<isize>>
            and 54 others
 help: consider using a floating-point literal by writing it with `.0`
    |
diff --git a/src/test/ui/on-unimplemented/multiple-impls.stderr b/src/test/ui/on-unimplemented/multiple-impls.stderr
index be29d31d97b..ebe7f1f7a34 100644
--- a/src/test/ui/on-unimplemented/multiple-impls.stderr
+++ b/src/test/ui/on-unimplemented/multiple-impls.stderr
@@ -7,7 +7,7 @@ LL |     Index::index(&[] as &[i32], 2u32);
    |     required by a bound introduced by this call
    |
    = help: the trait `Index<u32>` is not implemented for `[i32]`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Index<Foo<usize>>`:
              <[i32] as Index<Bar<usize>>>
              <[i32] as Index<Foo<usize>>>
 
@@ -20,7 +20,7 @@ LL |     Index::index(&[] as &[i32], Foo(2u32));
    |     required by a bound introduced by this call
    |
    = help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Index<Foo<usize>>`:
              <[i32] as Index<Bar<usize>>>
              <[i32] as Index<Foo<usize>>>
 
@@ -33,7 +33,7 @@ LL |     Index::index(&[] as &[i32], Bar(2u32));
    |     required by a bound introduced by this call
    |
    = help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Index<Foo<usize>>`:
              <[i32] as Index<Bar<usize>>>
              <[i32] as Index<Foo<usize>>>
 
@@ -44,7 +44,7 @@ LL |     Index::index(&[] as &[i32], 2u32);
    |     ^^^^^^^^^^^^ trait message
    |
    = help: the trait `Index<u32>` is not implemented for `[i32]`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Index<Foo<usize>>`:
              <[i32] as Index<Bar<usize>>>
              <[i32] as Index<Foo<usize>>>
 
@@ -55,7 +55,7 @@ LL |     Index::index(&[] as &[i32], Foo(2u32));
    |     ^^^^^^^^^^^^ on impl for Foo
    |
    = help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Index<Foo<usize>>`:
              <[i32] as Index<Bar<usize>>>
              <[i32] as Index<Foo<usize>>>
 
@@ -66,7 +66,7 @@ LL |     Index::index(&[] as &[i32], Bar(2u32));
    |     ^^^^^^^^^^^^ on impl for Bar
    |
    = help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Index<Foo<usize>>`:
              <[i32] as Index<Bar<usize>>>
              <[i32] as Index<Foo<usize>>>
 
diff --git a/src/test/ui/on-unimplemented/slice-index.stderr b/src/test/ui/on-unimplemented/slice-index.stderr
index 6dc27b5d4cc..e90d08187ed 100644
--- a/src/test/ui/on-unimplemented/slice-index.stderr
+++ b/src/test/ui/on-unimplemented/slice-index.stderr
@@ -15,7 +15,7 @@ LL |     x[..1i32];
    |     ^^^^^^^^^ slice indices are of type `usize` or ranges of `usize`
    |
    = help: the trait `SliceIndex<[i32]>` is not implemented for `RangeTo<i32>`
-   = help: the following implementations were found:
+   = help: the following other types implement trait `SliceIndex<str>`:
              <RangeTo<usize> as SliceIndex<[T]>>
              <RangeTo<usize> as SliceIndex<str>>
    = note: required because of the requirements on the impl of `Index<RangeTo<i32>>` for `[i32]`
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
index d87eceb1c9a..96a899ecca5 100644
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
@@ -9,10 +9,10 @@ LL | | }
    | |_^ `main` can only return types that implement `Termination`
    |
    = help: the trait `Termination` is not implemented for `Result<f32, ParseFloatError>`
-   = help: the following implementations were found:
-             <Result<!, E> as Termination>
-             <Result<(), E> as Termination>
-             <Result<Infallible, E> as Termination>
+   = help: the following other types implement trait `Termination`:
+             Result<!, E>
+             Result<(), E>
+             Result<Infallible, E>
 note: required by a bound in `assert_test_result`
   --> $SRC_DIR/test/src/lib.rs:LL:COL
    |
diff --git a/src/test/ui/span/multiline-span-simple.stderr b/src/test/ui/span/multiline-span-simple.stderr
index dee457ebd7f..81dd7d03f91 100644
--- a/src/test/ui/span/multiline-span-simple.stderr
+++ b/src/test/ui/span/multiline-span-simple.stderr
@@ -5,15 +5,15 @@ LL |     foo(1 as u32 +
    |                  ^ no implementation for `u32 + ()`
    |
    = help: the trait `Add<()>` is not implemented for `u32`
-   = help: the following implementations were found:
-             <&'a u32 as Add<u32>>
-             <&u32 as Add<&u32>>
-             <u32 as Add<&u32>>
-             <u32 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error: aborting due to previous error
diff --git a/src/test/ui/suggestions/into-str.stderr b/src/test/ui/suggestions/into-str.stderr
index 88a0f8f0650..b7b92e03534 100644
--- a/src/test/ui/suggestions/into-str.stderr
+++ b/src/test/ui/suggestions/into-str.stderr
@@ -7,7 +7,7 @@ LL |     foo(String::new());
    |     required by a bound introduced by this call
    |
    = note: to coerce a `String` into a `&str`, use `&*` as a prefix
-   = help: the following implementations were found:
+   = help: the following other types implement trait `From<char>`:
              <String as From<&String>>
              <String as From<&mut str>>
              <String as From<&str>>
diff --git a/src/test/ui/suggestions/issue-71394-no-from-impl.stderr b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr
index 79724377713..0f3d0e59e19 100644
--- a/src/test/ui/suggestions/issue-71394-no-from-impl.stderr
+++ b/src/test/ui/suggestions/issue-71394-no-from-impl.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `&[i8]: From<&[u8]>` is not satisfied
 LL |     let _: &[i8] = data.into();
    |                         ^^^^ the trait `From<&[u8]>` is not implemented for `&[i8]`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `From<Mask<T, LANES>>`:
              <[T; LANES] as From<Simd<T, LANES>>>
              <[bool; LANES] as From<Mask<T, LANES>>>
    = note: required because of the requirements on the impl of `Into<&[i8]>` for `&[u8]`
diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
index 2720f94a3c1..1d234518056 100644
--- a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
+++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs
@@ -4,7 +4,7 @@ fn strip_lf(s: &str) -> &str {
     //~| NOTE expected an `FnMut<(char,)>` closure, found `u8`
     //~| NOTE required by a bound introduced by this call
     //~| HELP the trait `FnMut<(char,)>` is not implemented for `u8`
-    //~| HELP the following other types implement trait `Pattern<'_>`:
+    //~| HELP the following other types implement trait `Pattern<'a>`:
     //~| NOTE required because of the requirements on the impl of `Pattern<'_>` for `u8`
 
 }
diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
index 37cba4189d7..115539a6dc2 100644
--- a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
+++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr
@@ -7,7 +7,7 @@ LL |     s.strip_suffix(b'\n').unwrap_or(s)
    |       required by a bound introduced by this call
    |
    = help: the trait `FnMut<(char,)>` is not implemented for `u8`
-   = help: the following other types implement trait `Pattern<'_>`:
+   = help: the following other types implement trait `Pattern<'a>`:
              &'b String
              &'b [char; N]
              &'b [char]
diff --git a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
index 3645ad03cb9..0220cf4127e 100644
--- a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
+++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr
@@ -4,7 +4,9 @@ error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfi
 LL |     c.same_as(22)
    |       ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts`
    |
-   = help: the trait `CompareTo<i32>` is implemented for `i64`
+   = help: the following other types implement trait `CompareTo<i64>`:
+             <i64 as CompareTo<i64>>
+             <i64 as CompareTo<u64>>
 
 error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied
   --> $DIR/repeated-supertrait-ambig.rs:30:7
@@ -23,7 +25,9 @@ error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfi
 LL |     <dyn CompareToInts>::same_as(c, 22)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts`
    |
-   = help: the trait `CompareTo<i32>` is implemented for `i64`
+   = help: the following other types implement trait `CompareTo<i64>`:
+             <i64 as CompareTo<i64>>
+             <i64 as CompareTo<u64>>
 
 error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied
   --> $DIR/repeated-supertrait-ambig.rs:38:5
@@ -42,7 +46,7 @@ error[E0277]: the trait bound `i64: CompareTo<i32>` is not satisfied
 LL |     assert_eq!(22_i64.same_as(22), true);
    |                       ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `i64`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `CompareTo<i64>`:
              <i64 as CompareTo<i64>>
              <i64 as CompareTo<u64>>
 
diff --git a/src/test/ui/traits/issue-79458.stderr b/src/test/ui/traits/issue-79458.stderr
index b9700128373..cf2e4edf9f0 100644
--- a/src/test/ui/traits/issue-79458.stderr
+++ b/src/test/ui/traits/issue-79458.stderr
@@ -7,10 +7,10 @@ LL | struct Foo<'a, T> {
 LL |     bar: &'a mut T
    |     ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `&mut T`
    |
-   = help: the following implementations were found:
-             <&T as Clone>
-             <*const T as Clone>
-             <*mut T as Clone>
+   = help: the following other types implement trait `Clone`:
+             &T
+             *const T
+             *mut T
    = note: `Clone` is implemented for `&T`, but not for `&mut T`
    = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
 
diff --git a/src/test/ui/traits/map-types.stderr b/src/test/ui/traits/map-types.stderr
index 37bc5c6badc..a4686edb717 100644
--- a/src/test/ui/traits/map-types.stderr
+++ b/src/test/ui/traits/map-types.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `Box<dyn Map<isize, isize>>: Map<usize, isize>` is
 LL |     let y: Box<dyn Map<usize, isize>> = Box::new(x);
    |                                         ^^^^^^^^^^^ the trait `Map<usize, isize>` is not implemented for `Box<dyn Map<isize, isize>>`
    |
-   = help: the trait `Map<usize, isize>` is implemented for `HashMap<K, V>`
+   = help: the trait `Map<K, V>` is implemented for `HashMap<K, V>`
    = note: required for the cast to the object type `dyn Map<usize, isize>`
 
 error: aborting due to previous error
diff --git a/src/test/ui/try-trait/bad-interconversion.stderr b/src/test/ui/try-trait/bad-interconversion.stderr
index 6567eca38c8..1b46252ae89 100644
--- a/src/test/ui/try-trait/bad-interconversion.stderr
+++ b/src/test/ui/try-trait/bad-interconversion.stderr
@@ -7,15 +7,15 @@ LL |     Ok(Err(123_i32)?)
    |                    ^ the trait `From<i32>` is not implemented for `u8`
    |
    = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
-   = help: the following implementations were found:
-             <u8 as From<NonZeroU8>>
-             <u8 as From<bool>>
+   = help: the following other types implement trait `From<bool>`:
              <f32 as From<i16>>
              <f32 as From<i8>>
              <f32 as From<u16>>
              <f32 as From<u8>>
              <f64 as From<f32>>
              <f64 as From<i16>>
+             <f64 as From<i32>>
+             <f64 as From<i8>>
            and 67 others
    = note: required because of the requirements on the impl of `FromResidual<Result<Infallible, i32>>` for `Result<u64, u8>`
 
diff --git a/src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr b/src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr
index 1372a018667..2fe115927c0 100644
--- a/src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr
+++ b/src/test/ui/type-alias-impl-trait/nested-tait-inference2.stderr
@@ -4,7 +4,7 @@ error[E0277]: the trait bound `(): Foo<FooX>` is not satisfied
 LL | fn foo() -> impl Foo<FooX> {
    |             ^^^^^^^^^^^^^^ the trait `Foo<FooX>` is not implemented for `()`
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `Foo<u32>`:
              <() as Foo<()>>
              <() as Foo<u32>>
 
diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr
index 15bbfeb87c6..15deade2cd8 100644
--- a/src/test/ui/type/type-check-defaults.stderr
+++ b/src/test/ui/type/type-check-defaults.stderr
@@ -65,15 +65,15 @@ LL | trait ProjectionPred<T:Iterator = IntoIter<i32>> where T::Item : Add<u8> {}
    |                                                                  ^^^^^^^ no implementation for `i32 + u8`
    |
    = help: the trait `Add<u8>` is not implemented for `i32`
-   = help: the following implementations were found:
-             <&'a i32 as Add<i32>>
-             <&i32 as Add<&i32>>
-             <i32 as Add<&i32>>
-             <i32 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error: aborting due to 7 previous errors
diff --git a/src/test/ui/typeck/issue-81293.stderr b/src/test/ui/typeck/issue-81293.stderr
index 9e2d8a6159c..00f490c4653 100644
--- a/src/test/ui/typeck/issue-81293.stderr
+++ b/src/test/ui/typeck/issue-81293.stderr
@@ -20,15 +20,15 @@ LL |     a = c + b * 5;
    |           ^ no implementation for `usize + u16`
    |
    = help: the trait `Add<u16>` is not implemented for `usize`
-   = help: the following implementations were found:
-             <&'a usize as Add<usize>>
-             <&usize as Add<&usize>>
-             <usize as Add<&usize>>
-             <usize as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error: aborting due to 3 previous errors
diff --git a/src/test/ui/typeck/issue-90101.stderr b/src/test/ui/typeck/issue-90101.stderr
index 998b636887f..b6d02285bd2 100644
--- a/src/test/ui/typeck/issue-90101.stderr
+++ b/src/test/ui/typeck/issue-90101.stderr
@@ -6,7 +6,7 @@ LL |     func(Path::new("hello").to_path_buf().to_string_lossy(), "world")
    |     |
    |     required by a bound introduced by this call
    |
-   = help: the following implementations were found:
+   = help: the following other types implement trait `From<Box<Path>>`:
              <PathBuf as From<&T>>
              <PathBuf as From<Box<Path>>>
              <PathBuf as From<Cow<'a, Path>>>
diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
index 64da15c5055..09208527210 100644
--- a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
+++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
@@ -5,15 +5,15 @@ LL |     <i32 as Add<u32>>::add(1, 2);
    |     ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
    |
    = help: the trait `Add<u32>` is not implemented for `i32`
-   = help: the following implementations were found:
-             <&'a i32 as Add<i32>>
-             <&i32 as Add<&i32>>
-             <i32 as Add<&i32>>
-             <i32 as Add>
+   = help: the following other types implement trait `Add`:
              <&'a f32 as Add<f32>>
              <&'a f64 as Add<f64>>
              <&'a i128 as Add<i128>>
              <&'a i16 as Add<i16>>
+             <&'a i32 as Add<i32>>
+             <&'a i64 as Add<i64>>
+             <&'a i8 as Add<i8>>
+             <&'a isize as Add<isize>>
            and 48 others
 
 error[E0308]: mismatched types