File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
branches/dist-snap/src/librustc/middle/typeck Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: d7b152701eba5f78bb9295c4fa60ad0a9ec3ff50
9
+ refs/heads/dist-snap: ff23e1202f782adbd1b9f08dbcfbea5d257770ce
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change 11
11
12
12
use middle:: ty;
13
13
14
+ use std:: cell:: Cell ;
14
15
use std:: vec;
15
16
use syntax:: ast;
16
17
use syntax:: codemap:: Span ;
@@ -49,14 +50,14 @@ impl RegionScope for ExplicitRscope {
49
50
/// omitted regions. This occurs in function signatures.
50
51
pub struct BindingRscope {
51
52
binder_id : ast:: NodeId ,
52
- anon_bindings : @ mut uint
53
+ anon_bindings : Cell < uint > ,
53
54
}
54
55
55
56
impl BindingRscope {
56
57
pub fn new ( binder_id : ast:: NodeId ) -> BindingRscope {
57
58
BindingRscope {
58
59
binder_id : binder_id,
59
- anon_bindings : @ mut 0
60
+ anon_bindings : Cell :: new ( 0 ) ,
60
61
}
61
62
}
62
63
}
@@ -66,8 +67,8 @@ impl RegionScope for BindingRscope {
66
67
_: Span ,
67
68
count : uint )
68
69
-> Result < ~[ ty:: Region ] , ( ) > {
69
- let idx = * self . anon_bindings ;
70
- * self . anon_bindings += count;
70
+ let idx = self . anon_bindings . get ( ) ;
71
+ self . anon_bindings . set ( idx + count) ;
71
72
Ok ( vec:: from_fn ( count, |i| ty:: ReLateBound ( self . binder_id ,
72
73
ty:: BrAnon ( idx + i) ) ) )
73
74
}
You can’t perform that action at this time.
0 commit comments