Stop sorting DefIds in the compiler

This commit is contained in:
Oli Scherer 2024-03-21 17:14:14 +00:00
parent 5676326c72
commit e522d2906d
2 changed files with 3 additions and 3 deletions

View file

@ -1185,7 +1185,7 @@ pub fn report_no_match_method_error(
})
.collect::<Vec<_>>();
if !inherent_impls_candidate.is_empty() {
inherent_impls_candidate.sort();
inherent_impls_candidate.sort_by_key(|id| self.tcx.def_path_str(id));
inherent_impls_candidate.dedup();
// number of types to show at most

View file

@ -35,10 +35,10 @@ LL | wrapper.method();
| ^^^^^^ method not found in `Wrapper<bool>`
|
= note: the method was found for
- `Wrapper<i8>`
- `Wrapper<i16>`
- `Wrapper<i32>`
- `Wrapper<i64>`
- `Wrapper<i8>`
and 2 more types
error[E0599]: no method named `other` found for struct `Wrapper` in the current scope
@ -60,9 +60,9 @@ LL | wrapper.method();
| ^^^^^^ method not found in `Wrapper2<'_, bool, 3>`
|
= note: the method was found for
- `Wrapper2<'a, i8, C>`
- `Wrapper2<'a, i16, C>`
- `Wrapper2<'a, i32, C>`
- `Wrapper2<'a, i8, C>`
error[E0599]: no method named `other` found for struct `Wrapper2` in the current scope
--> $DIR/method-not-found-generic-arg-elision.rs:98:13