]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_borrowck/src/location.rs
Rollup merge of #101864 - notriddle:notriddle/h1-h2-h3-h4, r=GuillaumeGomez
[rust.git] / compiler / rustc_borrowck / src / location.rs
index 5ca3f2f4d033c1c8dc27815369c9db4338ff6790..877944d3d70cb961195ac89e926ca12a39ef2467 100644 (file)
@@ -86,8 +86,7 @@ pub fn to_location(&self, index: LocationIndex) -> RichLocation {
         let (block, &first_index) = self
             .statements_before_block
             .iter_enumerated()
-            .filter(|(_, first_index)| **first_index <= point_index)
-            .last()
+            .rfind(|&(_, &first_index)| first_index <= point_index)
             .unwrap();
 
         let statement_index = (point_index - first_index) / 2;