Skip to content

Commit 166c2cf

Browse files
committed
---
yaml --- r: 89035 b: refs/heads/snap-stage3 c: de6eb2b h: refs/heads/master i: 89033: 5fcf03a 89031: 30e3b80 v: v3
1 parent 04bf201 commit 166c2cf

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: deeca5d586bfaa4aa60246f671a8d611d38f6248
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ccb18f47e25daee22f151f3d21774eec38abdbe3
4+
refs/heads/snap-stage3: de6eb2b2906cb959ce374306c28c535c5e799982
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/resolve.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ struct ImportResolution {
351351
// The number of outstanding references to this name. When this reaches
352352
// zero, outside modules can count on the targets being correct. Before
353353
// then, all bets are off; future imports could override this name.
354-
outstanding_references: uint,
354+
outstanding_references: Cell<uint>,
355355

356356
/// The value that this `use` directive names, if there is one.
357357
value_target: Option<Target>,
@@ -371,7 +371,7 @@ impl ImportResolution {
371371
ImportResolution {
372372
type_id: id,
373373
value_id: id,
374-
outstanding_references: 0,
374+
outstanding_references: Cell::new(0),
375375
value_target: None,
376376
type_target: None,
377377
is_public: is_public,
@@ -1968,7 +1968,8 @@ impl Resolver {
19681968
Some(&resolution) => {
19691969
debug!("(building import directive) bumping \
19701970
reference");
1971-
resolution.outstanding_references += 1;
1971+
resolution.outstanding_references.set(
1972+
resolution.outstanding_references.get() + 1);
19721973

19731974
// the source of this name is different now
19741975
resolution.type_id = id;
@@ -1977,7 +1978,7 @@ impl Resolver {
19771978
None => {
19781979
debug!("(building import directive) creating new");
19791980
let resolution = @mut ImportResolution::new(id, is_public);
1980-
resolution.outstanding_references = 1;
1981+
resolution.outstanding_references.set(1);
19811982
import_resolutions.get().insert(target.name,
19821983
resolution);
19831984
}
@@ -2328,7 +2329,7 @@ impl Resolver {
23282329
}
23292330
}
23302331
Some(import_resolution)
2331-
if import_resolution.outstanding_references
2332+
if import_resolution.outstanding_references.get()
23322333
== 0 => {
23332334

23342335
fn get_binding(this: &mut Resolver,
@@ -2453,8 +2454,9 @@ impl Resolver {
24532454
}
24542455
let used_public = used_reexport || used_public;
24552456

2456-
assert!(import_resolution.outstanding_references >= 1);
2457-
import_resolution.outstanding_references -= 1;
2457+
assert!(import_resolution.outstanding_references.get() >= 1);
2458+
import_resolution.outstanding_references.set(
2459+
import_resolution.outstanding_references.get() - 1);
24582460

24592461
// record what this import resolves to for later uses in documentation,
24602462
// this may resolve to either a value or a type, but for documentation
@@ -3181,7 +3183,7 @@ impl Resolver {
31813183
match import_resolutions.get().find(&name.name) {
31823184
Some(import_resolution) => {
31833185
if import_resolution.is_public &&
3184-
import_resolution.outstanding_references != 0 {
3186+
import_resolution.outstanding_references.get() != 0 {
31853187
debug!("(resolving name in module) import \
31863188
unresolved; bailing out");
31873189
return Indeterminate;

0 commit comments

Comments
 (0)