@@ -642,8 +642,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
642642 // Check whether we should interpret this as a bare trait object.
643643 if qself. is_none ( )
644644 && let Some ( partial_res) = self . r . partial_res_map . get ( & ty. id )
645- && partial_res. unresolved_segments ( ) == 0
646- && let Res :: Def ( DefKind :: Trait | DefKind :: TraitAlias , _) = partial_res. base_res ( )
645+ && let Some ( Res :: Def ( DefKind :: Trait | DefKind :: TraitAlias , _) ) = partial_res. full_res ( )
647646 {
648647 // This path is actually a bare trait object. In case of a bare `Fn`-trait
649648 // object with anonymous lifetimes, we need this rib to correctly place the
@@ -1930,7 +1929,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
19301929 match ty. kind {
19311930 TyKind :: ImplicitSelf => true ,
19321931 TyKind :: Path ( None , _) => {
1933- let path_res = self . r . partial_res_map [ & ty. id ] . base_res ( ) ;
1932+ let path_res = self . r . partial_res_map [ & ty. id ] . expect_full_res ( ) ;
19341933 if let Res :: SelfTyParam { .. } | Res :: SelfTyAlias { .. } = path_res {
19351934 return true ;
19361935 }
@@ -1971,7 +1970,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
19711970 None
19721971 }
19731972 } )
1974- . map ( |res| res. base_res ( ) )
1973+ . map ( |res| res. expect_full_res ( ) )
19751974 . filter ( |res| {
19761975 // Permit the types that unambiguously always
19771976 // result in the same type constructor being used
@@ -2531,7 +2530,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
25312530 Finalize :: new ( trait_ref. ref_id , trait_ref. path . span ) ,
25322531 ) ;
25332532 self . diagnostic_metadata . currently_processing_impl_trait = None ;
2534- if let Some ( def_id) = res. base_res ( ) . opt_def_id ( ) {
2533+ if let Some ( def_id) = res. expect_full_res ( ) . opt_def_id ( ) {
25352534 new_id = Some ( def_id) ;
25362535 new_val = Some ( ( self . r . expect_module ( def_id) , trait_ref. clone ( ) ) ) ;
25372536 }
@@ -2860,7 +2859,10 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
28602859 }
28612860
28622861 fn is_base_res_local ( & self , nid : NodeId ) -> bool {
2863- matches ! ( self . r. partial_res_map. get( & nid) . map( |res| res. base_res( ) ) , Some ( Res :: Local ( ..) ) )
2862+ matches ! (
2863+ self . r. partial_res_map. get( & nid) . map( |res| res. expect_full_res( ) ) ,
2864+ Some ( Res :: Local ( ..) )
2865+ )
28642866 }
28652867
28662868 /// Checks that all of the arms in an or-pattern have exactly the
@@ -3347,12 +3349,11 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
33473349 source. defer_to_typeck ( ) ,
33483350 finalize,
33493351 ) {
3350- Ok ( Some ( partial_res) ) if partial_res. unresolved_segments ( ) == 0 => {
3351- if source. is_expected ( partial_res. base_res ( ) ) || partial_res. base_res ( ) == Res :: Err
3352- {
3352+ Ok ( Some ( partial_res) ) if let Some ( res) = partial_res. full_res ( ) => {
3353+ if source. is_expected ( res) || res == Res :: Err {
33533354 partial_res
33543355 } else {
3355- report_errors ( self , Some ( partial_res . base_res ( ) ) )
3356+ report_errors ( self , Some ( res ) )
33563357 }
33573358 }
33583359
@@ -3560,20 +3561,21 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
35603561 } ;
35613562
35623563 if path. len ( ) > 1
3563- && result. base_res ( ) != Res :: Err
3564+ && let Some ( res) = result. full_res ( )
3565+ && res != Res :: Err
35643566 && path[ 0 ] . ident . name != kw:: PathRoot
35653567 && path[ 0 ] . ident . name != kw:: DollarCrate
35663568 {
35673569 let unqualified_result = {
35683570 match self . resolve_path ( & [ * path. last ( ) . unwrap ( ) ] , Some ( ns) , None ) {
3569- PathResult :: NonModule ( path_res) => path_res. base_res ( ) ,
3571+ PathResult :: NonModule ( path_res) => path_res. expect_full_res ( ) ,
35703572 PathResult :: Module ( ModuleOrUniformRoot :: Module ( module) ) => {
35713573 module. res ( ) . unwrap ( )
35723574 }
35733575 _ => return Ok ( Some ( result) ) ,
35743576 }
35753577 } ;
3576- if result . base_res ( ) == unqualified_result {
3578+ if res == unqualified_result {
35773579 let lint = lint:: builtin:: UNUSED_QUALIFICATIONS ;
35783580 self . r . lint_buffer . buffer_lint (
35793581 lint,
0 commit comments