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.45.0+dfsg1-2+rpi1^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=449042ebdb96f4f0e8fb159f4222e20d9b22c0de;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 7ca3eb884d..3e8c5aabfd 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -676,6 +676,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!( @@ -686,7 +689,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { format!( "{} {}", if empty_where { " where" } else { "," }, - obligations.into_iter().collect::>().join(", ") + obligations.join(", ") ), Applicability::MaybeIncorrect, );