From: Yuki Okushi Date: Fri, 31 Jul 2020 00:03:14 +0000 (+0900) Subject: [PATCH] Presort restrictions to make output consistent X-Git-Tag: archive/raspbian/1.46.0+dfsg1-1+rpi1^2~23 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=510a83fc919e69b31695dfba59bcf9d9a1774e0d;p=rustc.git [PATCH] Presort restrictions to make output consistent Gbp-Pq: Name u-1629fed4c0bdc6d3246ea63a91f600bcb8874626.patch --- diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 44ffabc4c2..e63c7c14be 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -674,6 +674,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { .collect::>(); for ((span, empty_where), obligations) in type_params.into_iter() { restrict_type_params = true; + // #74886: Sort here so that the output is always the same. + let mut obligations = obligations.into_iter().collect::>(); + obligations.sort(); err.span_suggestion_verbose( span, &format!( @@ -684,7 +687,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { format!( "{} {}", if empty_where { " where" } else { "," }, - obligations.into_iter().collect::>().join(", ") + obligations.join(", ") ), Applicability::MaybeIncorrect, );