X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_borrowck%2Fsrc%2Flocation.rs;h=877944d3d70cb961195ac89e926ca12a39ef2467;hb=18d3063350809de08f98fb74479a28d7149a3d14;hp=5ca3f2f4d033c1c8dc27815369c9db4338ff6790;hpb=93177758fccdaac08d606348f79b20e9cd9df022;p=rust.git diff --git a/compiler/rustc_borrowck/src/location.rs b/compiler/rustc_borrowck/src/location.rs index 5ca3f2f4d03..877944d3d70 100644 --- a/compiler/rustc_borrowck/src/location.rs +++ b/compiler/rustc_borrowck/src/location.rs @@ -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;