Skip to content

Commit 93fa7a4

Browse files
committed
librustc: Remove & inside @ from borrowck/check_loans.
1 parent bb8b83a commit 93fa7a4

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

src/librustc/middle/borrowck/check_loans.rs

+18-17
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ use syntax::codemap::span;
3131
use syntax::visit;
3232
use util::ppaux::Repr;
3333

34+
#[deriving(Clone)]
3435
struct CheckLoanCtxt<'self> {
3536
bccx: @BorrowckCtxt,
3637
dfcx_loans: &'self LoanDataFlow,
37-
move_data: move_data::FlowedMoveData,
38+
move_data: @move_data::FlowedMoveData,
3839
all_loans: &'self [Loan],
3940
reported: @mut HashSet<ast::node_id>,
4041
}
@@ -46,10 +47,10 @@ pub fn check_loans(bccx: @BorrowckCtxt,
4647
body: &ast::blk) {
4748
debug!("check_loans(body id=%?)", body.id);
4849

49-
let clcx = @mut CheckLoanCtxt {
50+
let clcx = CheckLoanCtxt {
5051
bccx: bccx,
5152
dfcx_loans: dfcx_loans,
52-
move_data: move_data,
53+
move_data: @move_data,
5354
all_loans: all_loans,
5455
reported: @mut HashSet::new(),
5556
};
@@ -139,7 +140,7 @@ impl<'self> CheckLoanCtxt<'self> {
139140
return result;
140141
}
141142

142-
pub fn check_for_conflicting_loans(&mut self, scope_id: ast::node_id) {
143+
pub fn check_for_conflicting_loans(&self, scope_id: ast::node_id) {
143144
//! Checks to see whether any of the loans that are issued
144145
//! by `scope_id` conflict with loans that have already been
145146
//! issued when we enter `scope_id` (for example, we do not
@@ -596,7 +597,7 @@ impl<'self> CheckLoanCtxt<'self> {
596597
MoveOk
597598
}
598599

599-
pub fn check_call(&mut self,
600+
pub fn check_call(&self,
600601
_expr: @ast::expr,
601602
_callee: Option<@ast::expr>,
602603
_callee_id: ast::node_id,
@@ -617,8 +618,8 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
617618
body: &ast::blk,
618619
sp: span,
619620
id: ast::node_id,
620-
(this, visitor): (@mut CheckLoanCtxt<'a>,
621-
visit::vt<@mut CheckLoanCtxt<'a>>)) {
621+
(this, visitor): (CheckLoanCtxt<'a>,
622+
visit::vt<CheckLoanCtxt<'a>>)) {
622623
match *fk {
623624
visit::fk_item_fn(*) |
624625
visit::fk_method(*) => {
@@ -634,7 +635,7 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
634635

635636
visit::visit_fn(fk, decl, body, sp, id, (this, visitor));
636637

637-
fn check_captured_variables(this: @mut CheckLoanCtxt,
638+
fn check_captured_variables(this: CheckLoanCtxt,
638639
closure_id: ast::node_id,
639640
span: span) {
640641
let cap_vars = this.bccx.capture_map.get(&closure_id);
@@ -652,7 +653,7 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
652653
}
653654
return;
654655

655-
fn check_by_move_capture(this: @mut CheckLoanCtxt,
656+
fn check_by_move_capture(this: CheckLoanCtxt,
656657
closure_id: ast::node_id,
657658
cap_var: &moves::CaptureVar,
658659
move_path: @LoanPath) {
@@ -676,14 +677,14 @@ fn check_loans_in_fn<'a>(fk: &visit::fn_kind,
676677
}
677678

678679
fn check_loans_in_local<'a>(local: @ast::local,
679-
(this, vt): (@mut CheckLoanCtxt<'a>,
680-
visit::vt<@mut CheckLoanCtxt<'a>>)) {
680+
(this, vt): (CheckLoanCtxt<'a>,
681+
visit::vt<CheckLoanCtxt<'a>>)) {
681682
visit::visit_local(local, (this, vt));
682683
}
683684

684685
fn check_loans_in_expr<'a>(expr: @ast::expr,
685-
(this, vt): (@mut CheckLoanCtxt<'a>,
686-
visit::vt<@mut CheckLoanCtxt<'a>>)) {
686+
(this, vt): (CheckLoanCtxt<'a>,
687+
visit::vt<CheckLoanCtxt<'a>>)) {
687688
visit::visit_expr(expr, (this, vt));
688689

689690
debug!("check_loans_in_expr(expr=%s)",
@@ -736,17 +737,17 @@ fn check_loans_in_expr<'a>(expr: @ast::expr,
736737
}
737738

738739
fn check_loans_in_pat<'a>(pat: @ast::pat,
739-
(this, vt): (@mut CheckLoanCtxt<'a>,
740-
visit::vt<@mut CheckLoanCtxt<'a>>))
740+
(this, vt): (CheckLoanCtxt<'a>,
741+
visit::vt<CheckLoanCtxt<'a>>))
741742
{
742743
this.check_for_conflicting_loans(pat.id);
743744
this.check_move_out_from_id(pat.id, pat.span);
744745
visit::visit_pat(pat, (this, vt));
745746
}
746747

747748
fn check_loans_in_block<'a>(blk: &ast::blk,
748-
(this, vt): (@mut CheckLoanCtxt<'a>,
749-
visit::vt<@mut CheckLoanCtxt<'a>>))
749+
(this, vt): (CheckLoanCtxt<'a>,
750+
visit::vt<CheckLoanCtxt<'a>>))
750751
{
751752
visit::visit_block(blk, (this, vt));
752753
this.check_for_conflicting_loans(blk.id);

0 commit comments

Comments
 (0)