Skip to content

Commit 0b2e9e5

Browse files
committed
---
yaml --- r: 147667 b: refs/heads/try2 c: 211c6d5 h: refs/heads/master i: 147665: 33c30b0 147663: 2011be8 v: v3
1 parent 0dea7e3 commit 0b2e9e5

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 2ba1b0bc0682235293c963d5638a8306acdfa097
8+
refs/heads/try2: 211c6d522b727f0e29994d84a7d53bb7b0d68bcd
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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)