Skip to content

Commit e522d29

Browse files
committed
Stop sorting DefIds in the compiler
1 parent 5676326 commit e522d29

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_hir_typeck/src/method/suggest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11851185
})
11861186
.collect::<Vec<_>>();
11871187
if !inherent_impls_candidate.is_empty() {
1188-
inherent_impls_candidate.sort();
1188+
inherent_impls_candidate.sort_by_key(|id| self.tcx.def_path_str(id));
11891189
inherent_impls_candidate.dedup();
11901190

11911191
// number of types to show at most

tests/ui/methods/method-not-found-generic-arg-elision.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ LL | wrapper.method();
3535
| ^^^^^^ method not found in `Wrapper<bool>`
3636
|
3737
= note: the method was found for
38-
- `Wrapper<i8>`
3938
- `Wrapper<i16>`
4039
- `Wrapper<i32>`
4140
- `Wrapper<i64>`
41+
- `Wrapper<i8>`
4242
and 2 more types
4343

4444
error[E0599]: no method named `other` found for struct `Wrapper` in the current scope
@@ -60,9 +60,9 @@ LL | wrapper.method();
6060
| ^^^^^^ method not found in `Wrapper2<'_, bool, 3>`
6161
|
6262
= note: the method was found for
63-
- `Wrapper2<'a, i8, C>`
6463
- `Wrapper2<'a, i16, C>`
6564
- `Wrapper2<'a, i32, C>`
65+
- `Wrapper2<'a, i8, C>`
6666

6767
error[E0599]: no method named `other` found for struct `Wrapper2` in the current scope
6868
--> $DIR/method-not-found-generic-arg-elision.rs:98:13

0 commit comments

Comments
 (0)