Skip to content

Commit d4f7b6b

Browse files
committed
---
yaml --- r: 147650 b: refs/heads/try2 c: ccb18f4 h: refs/heads/master v: v3
1 parent eef0cf4 commit d4f7b6b

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-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: 5c63b1febc2e618f79d07ce46c1305cfa28b6596
8+
refs/heads/try2: ccb18f47e25daee22f151f3d21774eec38abdbe3
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/check_loans.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ impl<'a> CheckLoanCtxt<'a> {
357357
mc::cat_local(id) |
358358
mc::cat_arg(id) |
359359
mc::cat_self(id) => {
360-
this.tcx().used_mut_nodes.insert(id);
360+
let mut used_mut_nodes = this.tcx()
361+
.used_mut_nodes
362+
.borrow_mut();
363+
used_mut_nodes.get().insert(id);
361364
return;
362365
}
363366

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,10 @@ impl<'a> GatherLoanCtxt<'a> {
607607
608608
match *loan_path {
609609
LpVar(local_id) => {
610-
self.tcx().used_mut_nodes.insert(local_id);
610+
let mut used_mut_nodes = self.tcx()
611+
.used_mut_nodes
612+
.borrow_mut();
613+
used_mut_nodes.get().insert(local_id);
611614
}
612615
LpExtend(base, mc::McInherited, _) => {
613616
self.mark_loan_path_as_mutated(base);

branches/try2/src/librustc/middle/lint.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,8 @@ fn check_unused_mut_pat(cx: &Context, p: &ast::Pat) {
10381038
}
10391039
};
10401040

1041-
if !initial_underscore && !cx.tcx.used_mut_nodes.contains(&p.id) {
1041+
let used_mut_nodes = cx.tcx.used_mut_nodes.borrow();
1042+
if !initial_underscore && !used_mut_nodes.get().contains(&p.id) {
10421043
cx.span_lint(unused_mut, p.span,
10431044
"variable does not need to be mutable");
10441045
}

branches/try2/src/librustc/middle/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ struct ctxt_ {
353353
// Set of nodes which mark locals as mutable which end up getting used at
354354
// some point. Local variable definitions not in this set can be warned
355355
// about.
356-
used_mut_nodes: @mut HashSet<ast::NodeId>,
356+
used_mut_nodes: RefCell<HashSet<ast::NodeId>>,
357357

358358
// vtable resolution information for impl declarations
359359
impl_vtables: typeck::impl_vtable_map,
@@ -1005,7 +1005,7 @@ pub fn mk_ctxt(s: session::Session,
10051005
inherent_impls: RefCell::new(HashMap::new()),
10061006
impls: RefCell::new(HashMap::new()),
10071007
used_unsafe: RefCell::new(HashSet::new()),
1008-
used_mut_nodes: @mut HashSet::new(),
1008+
used_mut_nodes: RefCell::new(HashSet::new()),
10091009
impl_vtables: RefCell::new(HashMap::new()),
10101010
populated_external_types: @mut HashSet::new(),
10111011
populated_external_traits: @mut HashSet::new(),

0 commit comments

Comments
 (0)