@@ -346,7 +346,7 @@ struct ImportResolution {
346
346
/// should *not* be used whenever resolution is being performed, this is
347
347
/// only looked at for glob imports statements currently. Privacy testing
348
348
/// occurs during a later phase of compilation.
349
- is_public : bool ,
349
+ is_public : Cell < bool > ,
350
350
351
351
// The number of outstanding references to this name. When this reaches
352
352
// zero, outside modules can count on the targets being correct. Before
@@ -374,7 +374,7 @@ impl ImportResolution {
374
374
outstanding_references : Cell :: new ( 0 ) ,
375
375
value_target : None ,
376
376
type_target : None ,
377
- is_public : is_public,
377
+ is_public : Cell :: new ( is_public) ,
378
378
}
379
379
}
380
380
@@ -2340,7 +2340,7 @@ impl Resolver {
2340
2340
2341
2341
// Import resolutions must be declared with "pub"
2342
2342
// in order to be exported.
2343
- if !import_resolution. is_public {
2343
+ if !import_resolution. is_public . get ( ) {
2344
2344
return UnboundResult ;
2345
2345
}
2346
2346
@@ -2363,12 +2363,12 @@ impl Resolver {
2363
2363
if value_result. is_unknown ( ) {
2364
2364
value_result = get_binding ( self , * import_resolution,
2365
2365
ValueNS ) ;
2366
- used_reexport = import_resolution. is_public ;
2366
+ used_reexport = import_resolution. is_public . get ( ) ;
2367
2367
}
2368
2368
if type_result. is_unknown ( ) {
2369
2369
type_result = get_binding ( self , * import_resolution,
2370
2370
TypeNS ) ;
2371
- used_reexport = import_resolution. is_public ;
2371
+ used_reexport = import_resolution. is_public . get ( ) ;
2372
2372
}
2373
2373
2374
2374
}
@@ -2521,7 +2521,7 @@ impl Resolver {
2521
2521
target_import_resolution. type_target. is_none( ) ,
2522
2522
self . module_to_str( module_) ) ;
2523
2523
2524
- if !target_import_resolution. is_public {
2524
+ if !target_import_resolution. is_public . get ( ) {
2525
2525
debug ! ( "(resolving glob import) nevermind, just kidding" ) ;
2526
2526
continue
2527
2527
}
@@ -2564,7 +2564,7 @@ impl Resolver {
2564
2564
Some ( type_target) ;
2565
2565
}
2566
2566
}
2567
- dest_import_resolution. is_public = is_public;
2567
+ dest_import_resolution. is_public . set ( is_public) ;
2568
2568
}
2569
2569
}
2570
2570
}
@@ -2605,7 +2605,7 @@ impl Resolver {
2605
2605
Some ( Target :: new ( containing_module, name_bindings) ) ;
2606
2606
dest_import_resolution. type_id = id;
2607
2607
}
2608
- dest_import_resolution. is_public = is_public;
2608
+ dest_import_resolution. is_public . set ( is_public) ;
2609
2609
} ;
2610
2610
2611
2611
// Add all children from the containing module.
@@ -3182,7 +3182,7 @@ impl Resolver {
3182
3182
let import_resolutions = module_. import_resolutions . borrow ( ) ;
3183
3183
match import_resolutions. get ( ) . find ( & name. name ) {
3184
3184
Some ( import_resolution) => {
3185
- if import_resolution. is_public &&
3185
+ if import_resolution. is_public . get ( ) &&
3186
3186
import_resolution. outstanding_references . get ( ) != 0 {
3187
3187
debug ! ( "(resolving name in module) import \
3188
3188
unresolved; bailing out") ;
@@ -3374,7 +3374,7 @@ impl Resolver {
3374
3374
module_: @Module) {
3375
3375
let import_resolutions = module_.import_resolutions.borrow();
3376
3376
for (name, importresolution) in import_resolutions.get().iter() {
3377
- if !importresolution.is_public {
3377
+ if !importresolution.is_public.get() {
3378
3378
continue
3379
3379
}
3380
3380
let xs = [TypeNS, ValueNS];
@@ -4744,7 +4744,7 @@ impl Resolver {
4744
4744
let import_resolutions = containing_module. import_resolutions
4745
4745
. borrow ( ) ;
4746
4746
match import_resolutions. get ( ) . find ( & name. name ) {
4747
- Some ( import_resolution) if import_resolution. is_public => {
4747
+ Some ( import_resolution) if import_resolution. is_public . get ( ) => {
4748
4748
match ( * import_resolution) . target_for_namespace ( namespace) {
4749
4749
Some ( target) => {
4750
4750
match target. bindings . def_for_namespace ( namespace) {
0 commit comments