Skip to content

Commit 4f034b4

Browse files
committed
---
yaml --- r: 97111 b: refs/heads/dist-snap c: de6eb2b h: refs/heads/master i: 97109: 9c10228 97107: 774fcde 97103: ab29003 v: v3
1 parent 9c18e38 commit 4f034b4

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
@@ -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: ccb18f47e25daee22f151f3d21774eec38abdbe3
9+
refs/heads/dist-snap: de6eb2b2906cb959ce374306c28c535c5e799982
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/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)