Presort restrictions to make output consistent
This commit is contained in:
parent
438c59f010
commit
1629fed4c0
|
@ -678,6 +678,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
.collect::<Vec<(usize, String)>>();
|
.collect::<Vec<(usize, String)>>();
|
||||||
for ((span, empty_where), obligations) in type_params.into_iter() {
|
for ((span, empty_where), obligations) in type_params.into_iter() {
|
||||||
restrict_type_params = true;
|
restrict_type_params = true;
|
||||||
|
// #74886: Sort here so that the output is always the same.
|
||||||
|
let mut obligations = obligations.into_iter().collect::<Vec<_>>();
|
||||||
|
obligations.sort();
|
||||||
err.span_suggestion_verbose(
|
err.span_suggestion_verbose(
|
||||||
span,
|
span,
|
||||||
&format!(
|
&format!(
|
||||||
|
@ -688,7 +691,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
format!(
|
format!(
|
||||||
"{} {}",
|
"{} {}",
|
||||||
if empty_where { " where" } else { "," },
|
if empty_where { " where" } else { "," },
|
||||||
obligations.into_iter().collect::<Vec<_>>().join(", ")
|
obligations.join(", ")
|
||||||
),
|
),
|
||||||
Applicability::MaybeIncorrect,
|
Applicability::MaybeIncorrect,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue