@@ -364,13 +364,13 @@ struct ImportResolution {
364
364
type_target : RefCell < Option < Target > > ,
365
365
/// The source node of the `use` directive leading to the type target
366
366
/// being non-none
367
- type_id : NodeId ,
367
+ type_id : Cell < NodeId > ,
368
368
}
369
369
370
370
impl ImportResolution {
371
371
fn new ( id : NodeId , is_public : bool ) -> ImportResolution {
372
372
ImportResolution {
373
- type_id : id ,
373
+ type_id : Cell :: new ( id ) ,
374
374
value_id : Cell :: new ( id) ,
375
375
outstanding_references : Cell :: new ( 0 ) ,
376
376
value_target : RefCell :: new ( None ) ,
@@ -389,7 +389,7 @@ impl ImportResolution {
389
389
390
390
fn id ( & self , namespace : Namespace ) -> NodeId {
391
391
match namespace {
392
- TypeNS => self . type_id ,
392
+ TypeNS => self . type_id . get ( ) ,
393
393
ValueNS => self . value_id . get ( ) ,
394
394
}
395
395
}
@@ -1973,7 +1973,7 @@ impl Resolver {
1973
1973
resolution. outstanding_references . get ( ) + 1 ) ;
1974
1974
1975
1975
// the source of this name is different now
1976
- resolution. type_id = id ;
1976
+ resolution. type_id . set ( id ) ;
1977
1977
resolution. value_id . set ( id) ;
1978
1978
}
1979
1979
None => {
@@ -2435,7 +2435,7 @@ impl Resolver {
2435
2435
name_bindings. type_def. get( ) . unwrap( ) . type_def) ;
2436
2436
import_resolution. type_target . set (
2437
2437
Some ( Target :: new ( target_module, name_bindings) ) ) ;
2438
- import_resolution. type_id = directive. id ;
2438
+ import_resolution. type_id . set ( directive. id ) ;
2439
2439
used_public = name_bindings. defined_in_public_namespace ( TypeNS ) ;
2440
2440
}
2441
2441
UnboundResult => { /* Continue. */ }
@@ -2604,7 +2604,7 @@ impl Resolver {
2604
2604
debug ! ( "(resolving glob import) ... for type target" ) ;
2605
2605
dest_import_resolution. type_target . set (
2606
2606
Some ( Target :: new ( containing_module, name_bindings) ) ) ;
2607
- dest_import_resolution. type_id = id ;
2607
+ dest_import_resolution. type_id . set ( id ) ;
2608
2608
}
2609
2609
dest_import_resolution. is_public . set ( is_public) ;
2610
2610
} ;
@@ -5392,7 +5392,8 @@ impl Resolver {
5392
5392
& mut found_traits,
5393
5393
trait_def_id, name) ;
5394
5394
self . used_imports . insert (
5395
- import_resolution. type_id ) ;
5395
+ import_resolution. type_id
5396
+ . get ( ) ) ;
5396
5397
}
5397
5398
}
5398
5399
_ => {
0 commit comments