Skip to content

Commit ef32b12

Browse files
committed
librustc: Remove the unused stmt_map from the borrow checker
1 parent 2de1e36 commit ef32b12

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

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

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'a> visit::Visitor<()> for GatherLoanCtxt<'a> {
8585
gather_loans_in_fn(self, fk, fd, b, s, n);
8686
}
8787
fn visit_stmt(&mut self, s:@Stmt, _:()) {
88-
add_stmt_to_map(self, s);
88+
visit::walk_stmt(self, s, ());
8989
}
9090
fn visit_pat(&mut self, p:&Pat, _:()) {
9191
add_pat_to_id_range(self, p);
@@ -824,15 +824,3 @@ impl<'a> GatherLoanCtxt<'a> {
824824
}
825825
}
826826

827-
// Setting up info that preserve needs.
828-
// This is just the most convenient place to do it.
829-
fn add_stmt_to_map(this: &mut GatherLoanCtxt,
830-
stmt: @ast::Stmt) {
831-
match stmt.node {
832-
ast::StmtExpr(_, id) | ast::StmtSemi(_, id) => {
833-
this.bccx.stmt_map.insert(id);
834-
}
835-
_ => ()
836-
}
837-
visit::walk_stmt(this, stmt, ());
838-
}

src/librustc/middle/borrowck/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use middle::typeck;
1717
use middle::moves;
1818
use middle::dataflow::DataFlowContext;
1919
use middle::dataflow::DataFlowOperator;
20-
use util::common::stmt_set;
2120
use util::ppaux::{note_and_explain_region, Repr, UserString};
2221

2322
use std::cell::RefCell;
@@ -85,7 +84,6 @@ pub fn check_crate(
8584
root_map: root_map(),
8685
loan_map: @mut HashMap::new(),
8786
write_guard_map: @mut HashSet::new(),
88-
stmt_map: @mut HashSet::new(),
8987
stats: @mut BorrowStats {
9088
loaned_paths_same: 0,
9189
loaned_paths_imm: 0,
@@ -177,7 +175,6 @@ pub struct BorrowckCtxt {
177175
root_map: root_map,
178176
loan_map: LoanMap,
179177
write_guard_map: write_guard_map,
180-
stmt_map: stmt_set,
181178

182179
// Statistics:
183180
stats: @mut BorrowStats

src/librustc/util/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ use syntax::codemap::{Span};
1414
use syntax::visit;
1515
use syntax::visit::Visitor;
1616

17-
use std::hashmap::HashSet;
1817
use std::local_data;
1918
use extra;
2019

@@ -132,5 +131,3 @@ pub fn pluralize(n: uint, s: ~str) -> ~str {
132131
else { format!("{}s", s) }
133132
}
134133

135-
// A set of node IDs (used to keep track of which node IDs are for statements)
136-
pub type stmt_set = @mut HashSet<ast::NodeId>;

0 commit comments

Comments
 (0)