]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir/src/hir.rs
Rollup merge of #101690 - kadiwa4:avoid_iterator_last, r=oli-obk
[rust.git] / compiler / rustc_hir / src / hir.rs
index f38919a63e1fcca16e609763e84ef1e526b8b4a7..1d62caef9b7a312cca3e7962680da0ece84bb87a 100644 (file)
@@ -576,8 +576,7 @@ pub fn tail_span_for_predicate_suggestion(&self) -> Span {
         if self.has_where_clause_predicates {
             self.predicates
                 .iter()
-                .filter(|p| p.in_where_clause())
-                .last()
+                .rfind(|&p| p.in_where_clause())
                 .map_or(end, |p| p.span())
                 .shrink_to_hi()
                 .to(end)