Skip to content

Commit 2554fc5

Browse files
committed
---
yaml --- r: 81787 b: refs/heads/master c: a47cdc0 h: refs/heads/master i: 81785: 94fbaff 81783: 1053b60 v: v3
1 parent 8578869 commit 2554fc5

File tree

8 files changed

+39
-34
lines changed

8 files changed

+39
-34
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7eed184dbb07c18b27dab8d444e62a96e85313cc
2+
refs/heads/master: a47cdc0f87162083a5ba22262826f90b05a1e096
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use util::ppaux::Repr;
3333

3434
#[deriving(Clone)]
3535
struct CheckLoanCtxt<'self> {
36-
bccx: &'self BorrowckCtxt,
36+
bccx: @BorrowckCtxt,
3737
dfcx_loans: &'self LoanDataFlow,
3838
move_data: @move_data::FlowedMoveData,
3939
all_loans: &'self [Loan],
@@ -60,7 +60,7 @@ impl<'self> Visitor<()> for CheckLoanCtxt<'self> {
6060
}
6161
}
6262

63-
pub fn check_loans(bccx: &BorrowckCtxt,
63+
pub fn check_loans(bccx: @BorrowckCtxt,
6464
dfcx_loans: &LoanDataFlow,
6565
move_data: move_data::FlowedMoveData,
6666
all_loans: &[Loan],

trunk/src/librustc/middle/borrowck/gather_loans/gather_moves.rs

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

25-
pub fn gather_decl(bccx: &BorrowckCtxt,
25+
pub fn gather_decl(bccx: @BorrowckCtxt,
2626
move_data: &mut MoveData,
2727
decl_id: ast::NodeId,
2828
_decl_span: Span,
@@ -31,23 +31,23 @@ pub fn gather_decl(bccx: &BorrowckCtxt,
3131
move_data.add_move(bccx.tcx, loan_path, decl_id, Declared);
3232
}
3333

34-
pub fn gather_move_from_expr(bccx: &BorrowckCtxt,
34+
pub fn gather_move_from_expr(bccx: @BorrowckCtxt,
3535
move_data: &mut 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

42-
pub fn gather_move_from_pat(bccx: &BorrowckCtxt,
42+
pub fn gather_move_from_pat(bccx: @BorrowckCtxt,
4343
move_data: &mut 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

50-
fn gather_move_from_expr_or_pat(bccx: &BorrowckCtxt,
50+
fn gather_move_from_expr_or_pat(bccx: @BorrowckCtxt,
5151
move_data: &mut MoveData,
5252
move_id: ast::NodeId,
5353
move_kind: MoveKind,
@@ -66,7 +66,7 @@ fn gather_move_from_expr_or_pat(bccx: &BorrowckCtxt,
6666
}
6767
}
6868

69-
pub fn gather_captures(bccx: &BorrowckCtxt,
69+
pub fn gather_captures(bccx: @BorrowckCtxt,
7070
move_data: &mut MoveData,
7171
closure_expr: @ast::Expr) {
7272
let captured_vars = bccx.capture_map.get(&closure_expr.id);
@@ -83,7 +83,7 @@ pub fn gather_captures(bccx: &BorrowckCtxt,
8383
}
8484
}
8585

86-
pub fn gather_assignment(bccx: &BorrowckCtxt,
86+
pub fn gather_assignment(bccx: @BorrowckCtxt,
8787
move_data: &mut MoveData,
8888
assignment_id: ast::NodeId,
8989
assignment_span: Span,
@@ -96,7 +96,7 @@ pub fn gather_assignment(bccx: &BorrowckCtxt,
9696
assignee_id);
9797
}
9898

99-
fn check_is_legal_to_move_from(bccx: &BorrowckCtxt,
99+
fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
100100
cmt0: mc::cmt,
101101
cmt: mc::cmt) -> bool {
102102
match cmt.cat {

trunk/src/librustc/middle/borrowck/gather_loans/lifetime.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use syntax::ast;
2020
use syntax::codemap::Span;
2121
use util::ppaux::{note_and_explain_region};
2222

23-
pub fn guarantee_lifetime(bccx: &BorrowckCtxt,
23+
pub fn guarantee_lifetime(bccx: @BorrowckCtxt,
2424
item_scope_id: ast::NodeId,
2525
root_scope_id: ast::NodeId,
2626
span: Span,
@@ -42,8 +42,8 @@ pub fn guarantee_lifetime(bccx: &BorrowckCtxt,
4242
///////////////////////////////////////////////////////////////////////////
4343
// Private
4444

45-
struct GuaranteeLifetimeContext<'self> {
46-
bccx: &'self BorrowckCtxt,
45+
struct GuaranteeLifetimeContext {
46+
bccx: @BorrowckCtxt,
4747

4848
// the node id of the function body for the enclosing item
4949
item_scope_id: ast::NodeId,
@@ -58,7 +58,7 @@ struct GuaranteeLifetimeContext<'self> {
5858
cmt_original: mc::cmt
5959
}
6060

61-
impl<'self> GuaranteeLifetimeContext<'self> {
61+
impl GuaranteeLifetimeContext {
6262
fn tcx(&self) -> ty::ctxt {
6363
self.bccx.tcx
6464
}

trunk/src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ mod gather_moves;
6464
/// No good. Instead what will happen is that `root_ub` will be set to the
6565
/// body of the while loop and we will refuse to root the pointer `&*x`
6666
/// because it would have to be rooted for a region greater than `root_ub`.
67-
struct GatherLoanCtxt<'self> {
68-
bccx: &'self BorrowckCtxt,
67+
struct GatherLoanCtxt {
68+
bccx: @BorrowckCtxt,
6969
id_range: id_range,
7070
move_data: @mut move_data::MoveData,
7171
all_loans: @mut ~[Loan],
7272
item_ub: ast::NodeId,
7373
repeating_ids: ~[ast::NodeId]
7474
}
7575

76-
impl<'self> visit::Visitor<()> for GatherLoanCtxt<'self> {
76+
impl visit::Visitor<()> for GatherLoanCtxt {
7777
fn visit_expr(&mut self, ex:@Expr, _:()) {
7878
gather_loans_in_expr(self, ex);
7979
}
@@ -100,7 +100,7 @@ impl<'self> visit::Visitor<()> for GatherLoanCtxt<'self> {
100100
fn visit_item(&mut self, _:@ast::item, _:()) { }
101101
}
102102

103-
pub fn gather_loans(bccx: &BorrowckCtxt,
103+
pub fn gather_loans(bccx: @BorrowckCtxt,
104104
decl: &ast::fn_decl,
105105
body: &ast::Block)
106106
-> (id_range, @mut ~[Loan], @mut move_data::MoveData) {
@@ -315,7 +315,7 @@ fn gather_loans_in_expr(this: &mut GatherLoanCtxt,
315315
}
316316
}
317317

318-
impl<'self> GatherLoanCtxt<'self> {
318+
impl GatherLoanCtxt {
319319
pub fn tcx(&self) -> ty::ctxt { self.bccx.tcx }
320320

321321
pub fn push_repeating_id(&mut self, id: ast::NodeId) {
@@ -532,7 +532,7 @@ impl<'self> GatherLoanCtxt<'self> {
532532
// }
533533
// }
534534

535-
fn check_mutability(bccx: &BorrowckCtxt,
535+
fn check_mutability(bccx: @BorrowckCtxt,
536536
borrow_span: Span,
537537
cmt: mc::cmt,
538538
req_mutbl: LoanMutability) {

trunk/src/librustc/middle/borrowck/gather_loans/restrictions.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum RestrictionResult {
2323
SafeIf(@LoanPath, ~[Restriction])
2424
}
2525

26-
pub fn compute_restrictions(bccx: &BorrowckCtxt,
26+
pub fn compute_restrictions(bccx: @BorrowckCtxt,
2727
span: Span,
2828
cmt: mc::cmt,
2929
restr: RestrictionSet) -> RestrictionResult {
@@ -39,13 +39,13 @@ pub fn compute_restrictions(bccx: &BorrowckCtxt,
3939
///////////////////////////////////////////////////////////////////////////
4040
// Private
4141

42-
struct RestrictionsContext<'self> {
43-
bccx: &'self BorrowckCtxt,
42+
struct RestrictionsContext {
43+
bccx: @BorrowckCtxt,
4444
span: Span,
4545
cmt_original: mc::cmt
4646
}
4747

48-
impl<'self> RestrictionsContext<'self> {
48+
impl RestrictionsContext {
4949
fn tcx(&self) -> ty::ctxt {
5050
self.bccx.tcx
5151
}

trunk/src/librustc/middle/borrowck/mod.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ impl Clone for LoanDataFlowOperator {
6161

6262
pub type LoanDataFlow = DataFlowContext<LoanDataFlowOperator>;
6363

64-
impl Visitor<()> for BorrowckCtxt {
64+
struct BorrowckVisitor;
65+
66+
impl Visitor<@BorrowckCtxt> for BorrowckVisitor {
6567
fn visit_fn(&mut self, fk:&fn_kind, fd:&fn_decl,
66-
b:&Block, s:Span, n:NodeId, _:()) {
67-
borrowck_fn(self, fk, fd, b, s, n);
68+
b:&Block, s:Span, n:NodeId, e:@BorrowckCtxt) {
69+
borrowck_fn(self, fk, fd, b, s, n, e);
6870
}
6971
}
7072

@@ -76,7 +78,7 @@ pub fn check_crate(
7678
capture_map: moves::CaptureMap,
7779
crate: &ast::Crate) -> (root_map, write_guard_map)
7880
{
79-
let mut bccx = BorrowckCtxt {
81+
let bccx = @BorrowckCtxt {
8082
tcx: tcx,
8183
method_map: method_map,
8284
moves_map: moves_map,
@@ -94,9 +96,9 @@ pub fn check_crate(
9496
guaranteed_paths: 0,
9597
}
9698
};
97-
let bccx = &mut bccx;
9899

99-
visit::walk_crate(bccx, crate, ());
100+
let mut v = BorrowckVisitor;
101+
visit::walk_crate(&mut v, crate, bccx);
100102

101103
if tcx.sess.borrowck_stats() {
102104
io::println("--- borrowck stats ---");
@@ -114,19 +116,20 @@ pub fn check_crate(
114116

115117
return (bccx.root_map, bccx.write_guard_map);
116118

117-
fn make_stat(bccx: &mut BorrowckCtxt, stat: uint) -> ~str {
119+
fn make_stat(bccx: &BorrowckCtxt, stat: uint) -> ~str {
118120
let stat_f = stat as float;
119121
let total = bccx.stats.guaranteed_paths as float;
120122
fmt!("%u (%.0f%%)", stat , stat_f * 100f / total)
121123
}
122124
}
123125

124-
fn borrowck_fn(this: &mut BorrowckCtxt,
126+
fn borrowck_fn(v: &mut BorrowckVisitor,
125127
fk: &visit::fn_kind,
126128
decl: &ast::fn_decl,
127129
body: &ast::Block,
128130
sp: Span,
129-
id: ast::NodeId) {
131+
id: ast::NodeId,
132+
this: @BorrowckCtxt) {
130133
match fk {
131134
&visit::fk_anon(*) |
132135
&visit::fk_fn_block(*) => {
@@ -163,7 +166,7 @@ fn borrowck_fn(this: &mut BorrowckCtxt,
163166
}
164167
}
165168

166-
visit::walk_fn(this, fk, decl, body, sp, id, ());
169+
visit::walk_fn(v, fk, decl, body, sp, id, this);
167170
}
168171

169172
// ----------------------------------------------------------------------

trunk/src/librustpkg/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ fn no_rebuilding_dep() {
985985
}
986986
987987
#[test]
988+
#[ignore]
988989
fn do_rebuild_dep_dates_change() {
989990
let p_id = PkgId::new("foo");
990991
let dep_id = PkgId::new("bar");
@@ -1001,6 +1002,7 @@ fn do_rebuild_dep_dates_change() {
10011002
}
10021003
10031004
#[test]
1005+
#[ignore]
10041006
fn do_rebuild_dep_only_contents_change() {
10051007
let p_id = PkgId::new("foo");
10061008
let dep_id = PkgId::new("bar");

0 commit comments

Comments
 (0)