Skip to content

Commit e614f66

Browse files
committed
Auto merge of #74965 - JohnTitor:sort-params, r=estebank
Presort restrictions to make output consistent The const test part is already adjusted so this should fix #74886. r? @estebank
2 parents 3a92b99 + 1629fed commit e614f66

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_typeck/check/method/suggest.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
678678
.collect::<Vec<(usize, String)>>();
679679
for ((span, empty_where), obligations) in type_params.into_iter() {
680680
restrict_type_params = true;
681+
// #74886: Sort here so that the output is always the same.
682+
let mut obligations = obligations.into_iter().collect::<Vec<_>>();
683+
obligations.sort();
681684
err.span_suggestion_verbose(
682685
span,
683686
&format!(
@@ -688,7 +691,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
688691
format!(
689692
"{} {}",
690693
if empty_where { " where" } else { "," },
691-
obligations.into_iter().collect::<Vec<_>>().join(", ")
694+
obligations.join(", ")
692695
),
693696
Applicability::MaybeIncorrect,
694697
);

0 commit comments

Comments
 (0)