Rollup merge of #126127 - Alexendoo:other-trait-diag, r=pnkfelix

Spell out other trait diagnostic

I recently saw somebody confused about the diagnostic thinking it was suggesting to add an `as` cast. This change is longer but I think it's clearer
This commit is contained in:
Jacob Pratt 2024-06-16 03:41:57 -04:00 committed by GitHub
commit 936d76009b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 348 additions and 348 deletions

View file

@ -2068,7 +2068,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
if all_traits_equal {
format!("\n {}", c.self_ty())
} else {
format!("\n {c}")
format!("\n `{}` implements `{}`", c.self_ty(), c.print_only_trait_path())
}
})
.collect();