Skip to content

Commit f599886

Browse files
committed
---
yaml --- r: 147679 b: refs/heads/try2 c: d1e23ae h: refs/heads/master i: 147677: 4eecc0d 147675: d74f1fb 147671: 493ec3a 147663: 2011be8 147647: 3c2659e v: v3
1 parent d3be521 commit f599886

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
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: 1b06a9593fe1d1ec8d1f54efcdc57689907df942
8+
refs/heads/try2: d1e23aeb0e3056a4da5c8aac86c10ae0353a8c2d
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/gather_loans/gather_moves.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use syntax::codemap::Span;
2323
use util::ppaux::{UserString};
2424

2525
pub fn gather_decl(bccx: &BorrowckCtxt,
26-
move_data: &mut MoveData,
26+
move_data: &MoveData,
2727
decl_id: ast::NodeId,
2828
_decl_span: Span,
2929
var_id: ast::NodeId) {
@@ -32,23 +32,23 @@ pub fn gather_decl(bccx: &BorrowckCtxt,
3232
}
3333

3434
pub fn gather_move_from_expr(bccx: &BorrowckCtxt,
35-
move_data: &mut MoveData,
35+
move_data: &MoveData,
3636
move_expr: @ast::Expr,
3737
cmt: mc::cmt) {
3838
gather_move_from_expr_or_pat(bccx, move_data, move_expr.id,
3939
MoveExpr(move_expr), cmt);
4040
}
4141

4242
pub fn gather_move_from_pat(bccx: &BorrowckCtxt,
43-
move_data: &mut MoveData,
43+
move_data: &MoveData,
4444
move_pat: @ast::Pat,
4545
cmt: mc::cmt) {
4646
gather_move_from_expr_or_pat(bccx, move_data, move_pat.id,
4747
MovePat(move_pat), cmt);
4848
}
4949

5050
fn gather_move_from_expr_or_pat(bccx: &BorrowckCtxt,
51-
move_data: &mut MoveData,
51+
move_data: &MoveData,
5252
move_id: ast::NodeId,
5353
move_kind: MoveKind,
5454
cmt: mc::cmt) {
@@ -67,7 +67,7 @@ fn gather_move_from_expr_or_pat(bccx: &BorrowckCtxt,
6767
}
6868

6969
pub fn gather_captures(bccx: &BorrowckCtxt,
70-
move_data: &mut MoveData,
70+
move_data: &MoveData,
7171
closure_expr: @ast::Expr) {
7272
let capture_map = bccx.capture_map.borrow();
7373
let captured_vars = capture_map.get().get(&closure_expr.id);
@@ -85,7 +85,7 @@ pub fn gather_captures(bccx: &BorrowckCtxt,
8585
}
8686

8787
pub fn gather_assignment(bccx: &BorrowckCtxt,
88-
move_data: &mut MoveData,
88+
move_data: &MoveData,
8989
assignment_id: ast::NodeId,
9090
assignment_span: Span,
9191
assignee_loan_path: @LoanPath,

branches/try2/src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ mod gather_moves;
6767
struct GatherLoanCtxt<'a> {
6868
bccx: &'a BorrowckCtxt,
6969
id_range: id_range,
70-
move_data: @mut move_data::MoveData,
70+
move_data: @move_data::MoveData,
7171
all_loans: @mut ~[Loan],
7272
item_ub: ast::NodeId,
7373
repeating_ids: ~[ast::NodeId]
@@ -103,14 +103,14 @@ impl<'a> visit::Visitor<()> for GatherLoanCtxt<'a> {
103103
pub fn gather_loans(bccx: &BorrowckCtxt,
104104
decl: &ast::fn_decl,
105105
body: ast::P<ast::Block>)
106-
-> (id_range, @mut ~[Loan], @mut move_data::MoveData) {
106+
-> (id_range, @mut ~[Loan], @move_data::MoveData) {
107107
let mut glcx = GatherLoanCtxt {
108108
bccx: bccx,
109109
id_range: id_range::max(),
110110
all_loans: @mut ~[],
111111
item_ub: body.id,
112112
repeating_ids: ~[body.id],
113-
move_data: @mut MoveData::new()
113+
move_data: @MoveData::new()
114114
};
115115
glcx.gather_fn_arg_patterns(decl, body);
116116

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ pub struct MoveData {
5353
}
5454

5555
pub struct FlowedMoveData {
56-
move_data: @mut MoveData,
57-
// ^~~~~~~~~~~~~
58-
// It makes me sad to use @mut here, except that due to
59-
// the visitor design, this is what gather_loans
60-
// must produce.
56+
move_data: @MoveData,
57+
// ^~~~~~~~~
58+
// It makes me sad to use @ here, except that due to
59+
// the old visitor design, this is what gather_loans
60+
// used to have to produce, and this code hasn't been
61+
// updated.
6162

6263
dfcx_moves: MoveDataFlow,
6364

@@ -199,14 +200,14 @@ impl MoveData {
199200
paths.get()[*index].next_sibling
200201
}
201202

202-
fn set_path_first_move(&mut self,
203+
fn set_path_first_move(&self,
203204
index: MovePathIndex,
204205
first_move: MoveIndex) {
205206
let mut paths = self.paths.borrow_mut();
206207
paths.get()[*index].first_move = first_move
207208
}
208209

209-
fn set_path_first_child(&mut self,
210+
fn set_path_first_child(&self,
210211
index: MovePathIndex,
211212
first_child: MovePathIndex) {
212213
let mut paths = self.paths.borrow_mut();
@@ -225,7 +226,7 @@ impl MoveData {
225226
self.path_parent(index) == InvalidMovePathIndex
226227
}
227228

228-
pub fn move_path(&mut self,
229+
pub fn move_path(&self,
229230
tcx: ty::ctxt,
230231
lp: @LoanPath) -> MovePathIndex {
231232
/*!
@@ -344,7 +345,7 @@ impl MoveData {
344345

345346
}
346347

347-
pub fn add_move(&mut self,
348+
pub fn add_move(&self,
348349
tcx: ty::ctxt,
349350
lp: @LoanPath,
350351
id: ast::NodeId,
@@ -379,7 +380,7 @@ impl MoveData {
379380
}
380381
}
381382

382-
pub fn add_assignment(&mut self,
383+
pub fn add_assignment(&self,
383384
tcx: ty::ctxt,
384385
lp: @LoanPath,
385386
assign_id: ast::NodeId,
@@ -556,13 +557,12 @@ impl MoveData {
556557
}
557558

558559
impl FlowedMoveData {
559-
pub fn new(move_data: @mut MoveData,
560+
pub fn new(move_data: @MoveData,
560561
tcx: ty::ctxt,
561562
method_map: typeck::method_map,
562563
id_range: ast_util::id_range,
563564
body: &ast::Block)
564-
-> FlowedMoveData
565-
{
565+
-> FlowedMoveData {
566566
let mut dfcx_moves = {
567567
let moves = move_data.moves.borrow();
568568
DataFlowContext::new(tcx,

0 commit comments

Comments
 (0)