@@ -405,11 +405,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
405
405
t
406
406
}
407
407
408
- // Define a dummy resolution containing a `Res::Err` as a placeholder for a failed resolution,
409
- // also mark such failed imports as used to avoid duplicate diagnostics.
410
- fn import_dummy_binding ( & mut self , import : & ' a Import < ' a > ) {
408
+ // Define a dummy resolution containing a `Res::Err` as a placeholder for a failed
409
+ // or indeterminate resolution, also mark such failed imports as used to avoid duplicate diagnostics.
410
+ fn import_dummy_binding ( & mut self , import : & ' a Import < ' a > , is_indeterminate : bool ) {
411
411
if let ImportKind :: Single { target, ref target_bindings, .. } = import. kind {
412
- if target_bindings. iter ( ) . any ( |binding| binding. get ( ) . is_some ( ) ) {
412
+ if !( is_indeterminate || target_bindings. iter ( ) . all ( |binding| binding. get ( ) . is_none ( ) ) )
413
+ {
413
414
return ; // Has resolution, do not create the dummy binding
414
415
}
415
416
let dummy_binding = self . dummy_binding ;
@@ -474,7 +475,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
474
475
475
476
// If this import is unresolved then create a dummy import
476
477
// resolution for it so that later resolve stages won't complain.
477
- self . import_dummy_binding ( import) ;
478
+ self . import_dummy_binding ( import, is_indeterminate ) ;
478
479
479
480
if let Some ( err) = unresolved_import_error {
480
481
if let ImportKind :: Single { source, ref source_bindings, .. } = import. kind {
0 commit comments