File tree Expand file tree Collapse file tree 5 files changed +13
-6
lines changed
branches/try2/src/librustc/middle Expand file tree Collapse file tree 5 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 5c63b1febc2e618f79d07ce46c1305cfa28b6596
8
+ refs/heads/try2: ccb18f47e25daee22f151f3d21774eec38abdbe3
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -357,7 +357,10 @@ impl<'a> CheckLoanCtxt<'a> {
357
357
mc:: cat_local( id) |
358
358
mc:: cat_arg( id) |
359
359
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) ;
361
364
return ;
362
365
}
363
366
Original file line number Diff line number Diff line change @@ -607,7 +607,10 @@ impl<'a> GatherLoanCtxt<'a> {
607
607
608
608
match * loan_path {
609
609
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) ;
611
614
}
612
615
LpExtend ( base, mc:: McInherited , _) => {
613
616
self . mark_loan_path_as_mutated ( base) ;
Original file line number Diff line number Diff line change @@ -1038,7 +1038,8 @@ fn check_unused_mut_pat(cx: &Context, p: &ast::Pat) {
1038
1038
}
1039
1039
} ;
1040
1040
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 ) {
1042
1043
cx. span_lint ( unused_mut, p. span ,
1043
1044
"variable does not need to be mutable" ) ;
1044
1045
}
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ struct ctxt_ {
353
353
// Set of nodes which mark locals as mutable which end up getting used at
354
354
// some point. Local variable definitions not in this set can be warned
355
355
// about.
356
- used_mut_nodes : @ mut HashSet < ast:: NodeId > ,
356
+ used_mut_nodes : RefCell < HashSet < ast:: NodeId > > ,
357
357
358
358
// vtable resolution information for impl declarations
359
359
impl_vtables : typeck:: impl_vtable_map ,
@@ -1005,7 +1005,7 @@ pub fn mk_ctxt(s: session::Session,
1005
1005
inherent_impls : RefCell :: new ( HashMap :: new ( ) ) ,
1006
1006
impls : RefCell :: new ( HashMap :: new ( ) ) ,
1007
1007
used_unsafe : RefCell :: new ( HashSet :: new ( ) ) ,
1008
- used_mut_nodes : @ mut HashSet :: new ( ) ,
1008
+ used_mut_nodes : RefCell :: new ( HashSet :: new ( ) ) ,
1009
1009
impl_vtables : RefCell :: new ( HashMap :: new ( ) ) ,
1010
1010
populated_external_types : @mut HashSet :: new ( ) ,
1011
1011
populated_external_traits : @mut HashSet :: new ( ) ,
You can’t perform that action at this time.
0 commit comments