Skip to content

Commit 3c8d7fe

Browse files
committed
---
yaml --- r: 147656 b: refs/heads/try2 c: 4b53a2c h: refs/heads/master v: v3
1 parent 23c2a4c commit 3c8d7fe

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9253df1844985ded53a3d5353b506b5ec8a33131
8+
refs/heads/try2: 4b53a2cdd8e567a40d93e9879617989c89080e5f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/resolve.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,13 @@ struct ImportResolution {
364364
type_target: RefCell<Option<Target>>,
365365
/// The source node of the `use` directive leading to the type target
366366
/// being non-none
367-
type_id: NodeId,
367+
type_id: Cell<NodeId>,
368368
}
369369

370370
impl ImportResolution {
371371
fn new(id: NodeId, is_public: bool) -> ImportResolution {
372372
ImportResolution {
373-
type_id: id,
373+
type_id: Cell::new(id),
374374
value_id: Cell::new(id),
375375
outstanding_references: Cell::new(0),
376376
value_target: RefCell::new(None),
@@ -389,7 +389,7 @@ impl ImportResolution {
389389

390390
fn id(&self, namespace: Namespace) -> NodeId {
391391
match namespace {
392-
TypeNS => self.type_id,
392+
TypeNS => self.type_id.get(),
393393
ValueNS => self.value_id.get(),
394394
}
395395
}
@@ -1973,7 +1973,7 @@ impl Resolver {
19731973
resolution.outstanding_references.get() + 1);
19741974

19751975
// the source of this name is different now
1976-
resolution.type_id = id;
1976+
resolution.type_id.set(id);
19771977
resolution.value_id.set(id);
19781978
}
19791979
None => {
@@ -2435,7 +2435,7 @@ impl Resolver {
24352435
name_bindings.type_def.get().unwrap().type_def);
24362436
import_resolution.type_target.set(
24372437
Some(Target::new(target_module, name_bindings)));
2438-
import_resolution.type_id = directive.id;
2438+
import_resolution.type_id.set(directive.id);
24392439
used_public = name_bindings.defined_in_public_namespace(TypeNS);
24402440
}
24412441
UnboundResult => { /* Continue. */ }
@@ -2604,7 +2604,7 @@ impl Resolver {
26042604
debug!("(resolving glob import) ... for type target");
26052605
dest_import_resolution.type_target.set(
26062606
Some(Target::new(containing_module, name_bindings)));
2607-
dest_import_resolution.type_id = id;
2607+
dest_import_resolution.type_id.set(id);
26082608
}
26092609
dest_import_resolution.is_public.set(is_public);
26102610
};
@@ -5392,7 +5392,8 @@ impl Resolver {
53925392
&mut found_traits,
53935393
trait_def_id, name);
53945394
self.used_imports.insert(
5395-
import_resolution.type_id);
5395+
import_resolution.type_id
5396+
.get());
53965397
}
53975398
}
53985399
_ => {

0 commit comments

Comments
 (0)