Skip to content

Commit 5249456

Browse files
committed
---
yaml --- r: 94715 b: refs/heads/try c: 211c6d5 h: refs/heads/master i: 94713: 15e49b9 94711: a84d035 v: v3
1 parent 1238e1b commit 5249456

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 2ba1b0bc0682235293c963d5638a8306acdfa097
5+
refs/heads/try: 211c6d522b727f0e29994d84a7d53bb7b0d68bcd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/borrowck/move_data.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ comments in the section "Moves and initialization" and in `doc.rs`.
1515
1616
*/
1717

18-
1918
use std::hashmap::{HashMap, HashSet};
2019
use std::uint;
2120
use middle::borrowck::*;
@@ -174,6 +173,10 @@ impl MoveData {
174173
}
175174
}
176175

176+
fn path_loan_path(&self, index: MovePathIndex) -> @LoanPath {
177+
self.paths[*index].loan_path
178+
}
179+
177180
fn path<'a>(&'a self, index: MovePathIndex) -> &'a MovePath {
178181
//! Type safe indexing operator
179182
&self.paths[*index]
@@ -400,7 +403,7 @@ impl MoveData {
400403

401404
// Kill all assignments when the variable goes out of scope:
402405
for (assignment_index, assignment) in self.var_assignments.iter().enumerate() {
403-
match *self.path(assignment.path).loan_path {
406+
match *self.path_loan_path(assignment.path) {
404407
LpVar(id) => {
405408
let kill_id = tcx.region_maps.encl_scope(id);
406409
dfcx_assign.add_kill(kill_id, assignment_index);
@@ -514,7 +517,7 @@ impl FlowedMoveData {
514517
self.dfcx_moves.each_gen_bit_frozen(id, |index| {
515518
let move = &self.move_data.moves[index];
516519
let moved_path = move.path;
517-
f(move, self.move_data.path(moved_path).loan_path)
520+
f(move, self.move_data.path_loan_path(moved_path))
518521
})
519522
}
520523

@@ -555,7 +558,7 @@ impl FlowedMoveData {
555558
if base_indices.iter().any(|x| x == &moved_path) {
556559
// Scenario 1 or 2: `loan_path` or some base path of
557560
// `loan_path` was moved.
558-
if !f(move, self.move_data.path(moved_path).loan_path) {
561+
if !f(move, self.move_data.path_loan_path(moved_path)) {
559562
ret = false;
560563
}
561564
} else {
@@ -564,7 +567,7 @@ impl FlowedMoveData {
564567
if p == loan_path_index {
565568
// Scenario 3: some extension of `loan_path`
566569
// was moved
567-
f(move, self.move_data.path(moved_path).loan_path)
570+
f(move, self.move_data.path_loan_path(moved_path))
568571
} else {
569572
true
570573
}

0 commit comments

Comments
 (0)