From 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:03:36 +0200 Subject: Adding upstream version 1.65.0+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_borrowck/src/location.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler/rustc_borrowck/src/location.rs') diff --git a/compiler/rustc_borrowck/src/location.rs b/compiler/rustc_borrowck/src/location.rs index 70a311694..877944d3d 100644 --- a/compiler/rustc_borrowck/src/location.rs +++ b/compiler/rustc_borrowck/src/location.rs @@ -33,7 +33,7 @@ impl LocationTable { pub(crate) fn new(body: &Body<'_>) -> Self { let mut num_points = 0; let statements_before_block = body - .basic_blocks() + .basic_blocks .iter() .map(|block_data| { let v = num_points; @@ -86,8 +86,7 @@ impl LocationTable { 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; -- cgit v1.2.3