@@ -642,8 +642,7 @@ impl<'a: 'ast, 'ast> Visitor<'ast> for LateResolutionVisitor<'a, '_, 'ast> {
642
642
// Check whether we should interpret this as a bare trait object.
643
643
if qself. is_none ( )
644
644
&& 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 ( )
647
646
{
648
647
// This path is actually a bare trait object. In case of a bare `Fn`-trait
649
648
// 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> {
1930
1929
match ty. kind {
1931
1930
TyKind :: ImplicitSelf => true ,
1932
1931
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 ( ) ;
1934
1933
if let Res :: SelfTyParam { .. } | Res :: SelfTyAlias { .. } = path_res {
1935
1934
return true ;
1936
1935
}
@@ -1971,7 +1970,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
1971
1970
None
1972
1971
}
1973
1972
} )
1974
- . map ( |res| res. base_res ( ) )
1973
+ . map ( |res| res. expect_full_res ( ) )
1975
1974
. filter ( |res| {
1976
1975
// Permit the types that unambiguously always
1977
1976
// result in the same type constructor being used
@@ -2531,7 +2530,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2531
2530
Finalize :: new ( trait_ref. ref_id , trait_ref. path . span ) ,
2532
2531
) ;
2533
2532
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 ( ) {
2535
2534
new_id = Some ( def_id) ;
2536
2535
new_val = Some ( ( self . r . expect_module ( def_id) , trait_ref. clone ( ) ) ) ;
2537
2536
}
@@ -2860,7 +2859,10 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2860
2859
}
2861
2860
2862
2861
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
+ )
2864
2866
}
2865
2867
2866
2868
/// 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> {
3347
3349
source. defer_to_typeck ( ) ,
3348
3350
finalize,
3349
3351
) {
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 {
3353
3354
partial_res
3354
3355
} else {
3355
- report_errors ( self , Some ( partial_res . base_res ( ) ) )
3356
+ report_errors ( self , Some ( res ) )
3356
3357
}
3357
3358
}
3358
3359
@@ -3560,20 +3561,21 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
3560
3561
} ;
3561
3562
3562
3563
if path. len ( ) > 1
3563
- && result. base_res ( ) != Res :: Err
3564
+ && let Some ( res) = result. full_res ( )
3565
+ && res != Res :: Err
3564
3566
&& path[ 0 ] . ident . name != kw:: PathRoot
3565
3567
&& path[ 0 ] . ident . name != kw:: DollarCrate
3566
3568
{
3567
3569
let unqualified_result = {
3568
3570
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 ( ) ,
3570
3572
PathResult :: Module ( ModuleOrUniformRoot :: Module ( module) ) => {
3571
3573
module. res ( ) . unwrap ( )
3572
3574
}
3573
3575
_ => return Ok ( Some ( result) ) ,
3574
3576
}
3575
3577
} ;
3576
- if result . base_res ( ) == unqualified_result {
3578
+ if res == unqualified_result {
3577
3579
let lint = lint:: builtin:: UNUSED_QUALIFICATIONS ;
3578
3580
self . r . lint_buffer . buffer_lint (
3579
3581
lint,
0 commit comments