@@ -405,11 +405,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
405405 t
406406 }
407407
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 ) {
411411 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+ {
413414 return ; // Has resolution, do not create the dummy binding
414415 }
415416 let dummy_binding = self . dummy_binding ;
@@ -474,7 +475,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
474475
475476 // If this import is unresolved then create a dummy import
476477 // 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 ) ;
478479
479480 if let Some ( err) = unresolved_import_error {
480481 if let ImportKind :: Single { source, ref source_bindings, .. } = import. kind {
0 commit comments