@@ -276,12 +276,6 @@ impl<'a> ::ModuleS<'a> {
276
276
. increment_outstanding_references ( is_public) ;
277
277
}
278
278
279
- fn decrement_outstanding_references_for ( & self , name : Name , ns : Namespace , is_public : bool ) {
280
- self . update_resolution ( name, ns, |resolution| {
281
- resolution. decrement_outstanding_references ( is_public) ;
282
- } )
283
- }
284
-
285
279
// Use `update` to mutate the resolution for the name.
286
280
// If the resolution becomes a success, define it in the module's glob importers.
287
281
fn update_resolution < T , F > ( & self , name : Name , ns : Namespace , update : F ) -> T
@@ -485,7 +479,8 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
485
479
// Temporarily count the directive as determined so that the resolution fails
486
480
// (as opposed to being indeterminate) when it can only be defined by the directive.
487
481
if !determined {
488
- module_. decrement_outstanding_references_for ( target, ns, directive. is_public )
482
+ module_. resolutions . borrow_mut ( ) . get_mut ( & ( target, ns) ) . unwrap ( )
483
+ . decrement_outstanding_references ( directive. is_public ) ;
489
484
}
490
485
let result =
491
486
self . resolver . resolve_name_in_module ( target_module, source, ns, false , true ) ;
@@ -522,7 +517,10 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
522
517
self . report_conflict ( target, ns, & directive. import ( binding, None ) , old_binding) ;
523
518
}
524
519
}
525
- module_. decrement_outstanding_references_for ( target, ns, directive. is_public ) ;
520
+
521
+ module_. update_resolution ( target, ns, |resolution| {
522
+ resolution. decrement_outstanding_references ( directive. is_public ) ;
523
+ } )
526
524
}
527
525
528
526
match ( & value_result, & type_result) {
0 commit comments