]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_borrowck/src/location.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / compiler / rustc_borrowck / src / location.rs
index 70a3116949894f7a8a423ca266277206a547a0a4..877944d3d70cb961195ac89e926ca12a39ef2467 100644 (file)
@@ -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;