From 449042ebdb96f4f0e8fb159f4222e20d9b22c0de Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Fri, 31 Jul 2020 09:03:14 +0900 Subject: [PATCH] [PATCH] Presort restrictions to make output consistent Gbp-Pq: Name u-1629fed4c0bdc6d3246ea63a91f600bcb8874626.patch --- src/librustc_typeck/check/method/suggest.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, ); -- 2.30.2