]> git.lizzy.rs Git - rust.git/commitdiff
Use successor_within_block helper
authorSantiago Pastorino <spastorino@gmail.com>
Tue, 20 Nov 2018 18:26:01 +0000 (15:26 -0300)
committerSantiago Pastorino <spastorino@gmail.com>
Wed, 20 Feb 2019 14:49:18 +0000 (11:49 -0300)
src/librustc_mir/borrow_check/nll/explain_borrow/find_use.rs

index c5aaf5b811ed7e6c956b0c6d56998544dfd32903..7d6385752c34877337051de5da7e24a96b5c2663 100644 (file)
@@ -65,10 +65,7 @@ fn find(&mut self) -> Option<Cause> {
 
                 None => {
                     if p.statement_index < block_data.statements.len() {
-                        queue.push_back(Location {
-                            statement_index: p.statement_index + 1,
-                            ..p
-                        });
+                        queue.push_back(p.successor_within_block());
                     } else {
                         queue.extend(
                             block_data