@@ -9,7 +9,7 @@ use rustc_errors::codes::*;
99use rustc_errors:: { Applicability , MultiSpan , pluralize, struct_span_code_err} ;
1010use rustc_hir:: def:: { self , DefKind , PartialRes } ;
1111use rustc_hir:: def_id:: { DefId , LocalDefIdMap } ;
12- use rustc_middle:: metadata:: { AmbigModChild , AmbigModChildKind , ModChild , Reexport } ;
12+ use rustc_middle:: metadata:: { AmbigModChild , ModChild , Reexport } ;
1313use rustc_middle:: span_bug;
1414use rustc_middle:: ty:: Visibility ;
1515use rustc_session:: lint:: BuiltinLintDiag ;
@@ -32,10 +32,9 @@ use crate::errors::{
3232} ;
3333use crate :: ref_mut:: CmCell ;
3434use crate :: {
35- AmbiguityError , AmbiguityKind , BindingKey , CmResolver , Determinacy , Finalize , ImportSuggestion ,
36- Module , ModuleOrUniformRoot , NameBinding , NameBindingData , NameBindingKind , ParentScope ,
37- PathResult , PerNS , ResolutionError , Resolver , ScopeSet , Segment , Used , module_to_string,
38- names_to_string,
35+ AmbiguityError , BindingKey , CmResolver , Determinacy , Finalize , ImportSuggestion , Module ,
36+ ModuleOrUniformRoot , NameBinding , NameBindingData , NameBindingKind , ParentScope , PathResult ,
37+ PerNS , ResolutionError , Resolver , ScopeSet , Segment , Used , module_to_string, names_to_string,
3938} ;
4039
4140type Res = def:: Res < NodeId > ;
@@ -373,7 +372,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
373372 resolution. glob_binding = Some ( glob_binding) ;
374373 } else if res != old_glob_binding. res ( ) {
375374 resolution. glob_binding = Some ( this. new_ambiguity_binding (
376- AmbiguityKind :: GlobVsGlob ,
377375 old_glob_binding,
378376 glob_binding,
379377 warn_ambiguity,
@@ -394,7 +392,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
394392 assert ! ( old_glob_binding. is_glob_import( ) ) ;
395393 if glob_binding. res ( ) != old_glob_binding. res ( ) {
396394 resolution. glob_binding = Some ( this. new_ambiguity_binding (
397- AmbiguityKind :: GlobVsGlob ,
398395 old_glob_binding,
399396 glob_binding,
400397 false ,
@@ -424,12 +421,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
424421
425422 fn new_ambiguity_binding (
426423 & self ,
427- ambiguity_kind : AmbiguityKind ,
428424 primary_binding : NameBinding < ' ra > ,
429425 secondary_binding : NameBinding < ' ra > ,
430426 warn_ambiguity : bool ,
431427 ) -> NameBinding < ' ra > {
432- let ambiguity = Some ( ( secondary_binding, ambiguity_kind ) ) ;
428+ let ambiguity = Some ( secondary_binding) ;
433429 let data = NameBindingData { ambiguity, warn_ambiguity, ..* primary_binding } ;
434430 self . arenas . alloc_name_binding ( data)
435431 }
@@ -645,7 +641,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
645641 let Some ( binding) = resolution. best_binding ( ) else { continue } ;
646642
647643 if let NameBindingKind :: Import { import, .. } = binding. kind
648- && let Some ( ( amb_binding, _ ) ) = binding. ambiguity
644+ && let Some ( amb_binding) = binding. ambiguity
649645 && binding. res ( ) != Res :: Err
650646 && exported_ambiguities. contains ( & binding)
651647 {
@@ -1553,23 +1549,15 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
15531549 vis : binding. vis ,
15541550 reexport_chain,
15551551 } ;
1556- if let Some ( ( ambig_binding1, ambig_binding2, ambig_kind) ) =
1557- binding. descent_to_ambiguity ( )
1558- {
1552+ if let Some ( ( ambig_binding1, ambig_binding2) ) = binding. descent_to_ambiguity ( ) {
15591553 let main = child ( ambig_binding1. reexport_chain ( this) ) ;
15601554 let second = ModChild {
15611555 ident : ident. 0 ,
15621556 res : ambig_binding2. res ( ) . expect_non_local ( ) ,
15631557 vis : ambig_binding2. vis ,
15641558 reexport_chain : ambig_binding2. reexport_chain ( this) ,
15651559 } ;
1566- let kind = match ambig_kind {
1567- AmbiguityKind :: GlobVsGlob => AmbigModChildKind :: GlobVsGlob ,
1568- AmbiguityKind :: GlobVsExpanded => AmbigModChildKind :: GlobVsExpanded ,
1569- _ => unreachable ! ( ) ,
1570- } ;
1571-
1572- ambig_children. push ( AmbigModChild { main, second, kind } )
1560+ ambig_children. push ( AmbigModChild { main, second } )
15731561 } else {
15741562 children. push ( child ( binding. reexport_chain ( this) ) ) ;
15751563 }
0 commit comments