diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-03-21 12:55:28 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-03-27 14:02:15 +0000 |
| commit | ae24fef028ca9b27c3209fca1229a99d45873774 (patch) | |
| tree | 1cabd087b78232cb4b25caefcb0807a0a26bb1b3 /compiler/rustc_trait_selection/src | |
| parent | 2707ac96067bf9d9e7ad1a7887be4ef90c939220 (diff) | |
| download | rust-ae24fef028ca9b27c3209fca1229a99d45873774.tar.gz rust-ae24fef028ca9b27c3209fca1229a99d45873774.zip | |
Use `TraitRef::to_string` sorting in favor of `TraitRef::ord`, as the latter compares `DefId`s which we need to avoid
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs index 3cc46b5c638..9186241d607 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs @@ -2117,7 +2117,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { }) .collect(); - impl_candidates.sort(); + impl_candidates.sort_by_key(|tr| tr.to_string()); impl_candidates.dedup(); return report(impl_candidates, err); } @@ -2143,7 +2143,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { cand }) .collect(); - impl_candidates.sort_by_key(|cand| (cand.similarity, cand.trait_ref)); + impl_candidates.sort_by_key(|cand| (cand.similarity, cand.trait_ref.to_string())); let mut impl_candidates: Vec<_> = impl_candidates.into_iter().map(|cand| cand.trait_ref).collect(); impl_candidates.dedup(); |
