@@ -641,8 +641,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
641
641
// Check whether we should interpret this as a bare trait object.
642
642
if qself. is_none ( )
643
643
&& let Some ( partial_res) = self . r . partial_res_map . get ( & ty. id )
644
- && partial_res. unresolved_segments ( ) == 0
645
- && let Res :: Def ( DefKind :: Trait | DefKind :: TraitAlias , _) = partial_res. base_res ( )
644
+ && let Some ( Res :: Def ( DefKind :: Trait | DefKind :: TraitAlias , _) ) = partial_res. full_res ( )
646
645
{
647
646
// This path is actually a bare trait object. In case of a bare `Fn`-trait
648
647
// object with anonymous lifetimes, we need this rib to correctly place the
@@ -1929,7 +1928,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
1929
1928
match ty. kind {
1930
1929
TyKind :: ImplicitSelf => true ,
1931
1930
TyKind :: Path ( None , _) => {
1932
- let path_res = self . r . partial_res_map [ & ty. id ] . base_res ( ) ;
1931
+ let path_res = self . r . partial_res_map [ & ty. id ] . expect_full_res ( ) ;
1933
1932
if let Res :: SelfTyParam { .. } | Res :: SelfTyAlias { .. } = path_res {
1934
1933
return true ;
1935
1934
}
@@ -1970,7 +1969,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
1970
1969
None
1971
1970
}
1972
1971
} )
1973
- . map ( |res| res. base_res ( ) )
1972
+ . map ( |res| res. expect_full_res ( ) )
1974
1973
. filter ( |res| {
1975
1974
// Permit the types that unambiguously always
1976
1975
// result in the same type constructor being used
@@ -2530,7 +2529,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2530
2529
Finalize :: new ( trait_ref. ref_id , trait_ref. path . span ) ,
2531
2530
) ;
2532
2531
self . diagnostic_metadata . currently_processing_impl_trait = None ;
2533
- if let Some ( def_id) = res. base_res ( ) . opt_def_id ( ) {
2532
+ if let Some ( def_id) = res. expect_full_res ( ) . opt_def_id ( ) {
2534
2533
new_id = Some ( def_id) ;
2535
2534
new_val = Some ( ( self . r . expect_module ( def_id) , trait_ref. clone ( ) ) ) ;
2536
2535
}
@@ -2886,7 +2885,10 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2886
2885
}
2887
2886
2888
2887
fn is_base_res_local ( & self , nid : NodeId ) -> bool {
2889
- matches ! ( self . r. partial_res_map. get( & nid) . map( |res| res. base_res( ) ) , Some ( Res :: Local ( ..) ) )
2888
+ matches ! (
2889
+ self . r. partial_res_map. get( & nid) . map( |res| res. expect_full_res( ) ) ,
2890
+ Some ( Res :: Local ( ..) )
2891
+ )
2890
2892
}
2891
2893
2892
2894
/// Checks that all of the arms in an or-pattern have exactly the
@@ -3373,12 +3375,11 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
3373
3375
source. defer_to_typeck ( ) ,
3374
3376
finalize,
3375
3377
) {
3376
- Ok ( Some ( partial_res) ) if partial_res. unresolved_segments ( ) == 0 => {
3377
- if source. is_expected ( partial_res. base_res ( ) ) || partial_res. base_res ( ) == Res :: Err
3378
- {
3378
+ Ok ( Some ( partial_res) ) if let Some ( res) = partial_res. full_res ( ) => {
3379
+ if source. is_expected ( res) || res == Res :: Err {
3379
3380
partial_res
3380
3381
} else {
3381
- report_errors ( self , Some ( partial_res . base_res ( ) ) )
3382
+ report_errors ( self , Some ( res ) )
3382
3383
}
3383
3384
}
3384
3385
@@ -3586,20 +3587,21 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
3586
3587
} ;
3587
3588
3588
3589
if path. len ( ) > 1
3589
- && result. base_res ( ) != Res :: Err
3590
+ && let Some ( res) = result. full_res ( )
3591
+ && res != Res :: Err
3590
3592
&& path[ 0 ] . ident . name != kw:: PathRoot
3591
3593
&& path[ 0 ] . ident . name != kw:: DollarCrate
3592
3594
{
3593
3595
let unqualified_result = {
3594
3596
match self . resolve_path ( & [ * path. last ( ) . unwrap ( ) ] , Some ( ns) , None ) {
3595
- PathResult :: NonModule ( path_res) => path_res. base_res ( ) ,
3597
+ PathResult :: NonModule ( path_res) => path_res. expect_full_res ( ) ,
3596
3598
PathResult :: Module ( ModuleOrUniformRoot :: Module ( module) ) => {
3597
3599
module. res ( ) . unwrap ( )
3598
3600
}
3599
3601
_ => return Ok ( Some ( result) ) ,
3600
3602
}
3601
3603
} ;
3602
- if result . base_res ( ) == unqualified_result {
3604
+ if res == unqualified_result {
3603
3605
let lint = lint:: builtin:: UNUSED_QUALIFICATIONS ;
3604
3606
self . r . lint_buffer . buffer_lint (
3605
3607
lint,
0 commit comments