Skip to content

Commit 3c75ef1

Browse files
committed
---
yaml --- r: 97166 b: refs/heads/dist-snap c: ff23e12 h: refs/heads/master v: v3
1 parent 7348673 commit 3c75ef1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: d7b152701eba5f78bb9295c4fa60ad0a9ec3ff50
9+
refs/heads/dist-snap: ff23e1202f782adbd1b9f08dbcfbea5d257770ce
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/middle/typeck/rscope.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
use middle::ty;
1313

14+
use std::cell::Cell;
1415
use std::vec;
1516
use syntax::ast;
1617
use syntax::codemap::Span;
@@ -49,14 +50,14 @@ impl RegionScope for ExplicitRscope {
4950
/// omitted regions. This occurs in function signatures.
5051
pub struct BindingRscope {
5152
binder_id: ast::NodeId,
52-
anon_bindings: @mut uint
53+
anon_bindings: Cell<uint>,
5354
}
5455

5556
impl BindingRscope {
5657
pub fn new(binder_id: ast::NodeId) -> BindingRscope {
5758
BindingRscope {
5859
binder_id: binder_id,
59-
anon_bindings: @mut 0
60+
anon_bindings: Cell::new(0),
6061
}
6162
}
6263
}
@@ -66,8 +67,8 @@ impl RegionScope for BindingRscope {
6667
_: Span,
6768
count: uint)
6869
-> 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);
7172
Ok(vec::from_fn(count, |i| ty::ReLateBound(self.binder_id,
7273
ty::BrAnon(idx + i))))
7374
}

0 commit comments

Comments
 (0)