@@ -508,7 +508,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
508508 let mut resolutions = self . expect_full_res_from_use ( id) . fuse ( ) ;
509509 // We want to return *something* from this function, so hold onto the first item
510510 // for later.
511- let ret_res = self . lower_res ( resolutions. next ( ) . unwrap_or ( Res :: Err ) ) ;
511+ let ret_res = smallvec ! [ self . lower_res( resolutions. next( ) . unwrap_or( Res :: Err ) ) ] ;
512512
513513 // Here, we are looping over namespaces, if they exist for the definition
514514 // being imported. We only handle type and value namespaces because we
@@ -538,8 +538,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
538538 let span = path. span ;
539539
540540 self . with_hir_id_owner ( new_node_id, |this| {
541- let res = this. lower_res ( res) ;
542- let path = this. lower_path_extra ( res, & path, ParamMode :: Explicit ) ;
541+ let res = smallvec ! [ this. lower_res( res) ] ;
542+ let path = this. lower_use_path ( res, & path, ParamMode :: Explicit ) ;
543543 let kind = hir:: ItemKind :: Use ( path, hir:: UseKind :: Single ) ;
544544 if let Some ( attrs) = attrs {
545545 this. attrs . insert ( hir:: ItemLocalId :: new ( 0 ) , attrs) ;
@@ -556,15 +556,14 @@ impl<'hir> LoweringContext<'_, 'hir> {
556556 } ) ;
557557 }
558558
559- let path = self . lower_path_extra ( ret_res, & path, ParamMode :: Explicit ) ;
559+ let path = self . lower_use_path ( ret_res, & path, ParamMode :: Explicit ) ;
560560 hir:: ItemKind :: Use ( path, hir:: UseKind :: Single )
561561 }
562562 UseTreeKind :: Glob => {
563- let path = self . lower_path (
564- id,
565- & Path { segments, span : path. span , tokens : None } ,
566- ParamMode :: Explicit ,
567- ) ;
563+ let res = self . expect_full_res ( id) ;
564+ let res = smallvec ! [ self . lower_res( res) ] ;
565+ let path = Path { segments, span : path. span , tokens : None } ;
566+ let path = self . lower_use_path ( res, & path, ParamMode :: Explicit ) ;
568567 hir:: ItemKind :: Use ( path, hir:: UseKind :: Glob )
569568 }
570569 UseTreeKind :: Nested ( ref trees) => {
@@ -635,8 +634,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
635634 }
636635
637636 let res = self . expect_full_res_from_use ( id) . next ( ) . unwrap_or ( Res :: Err ) ;
638- let res = self . lower_res ( res) ;
639- let path = self . lower_path_extra ( res, & prefix, ParamMode :: Explicit ) ;
637+ let res = smallvec ! [ self . lower_res( res) ] ;
638+ let path = self . lower_use_path ( res, & prefix, ParamMode :: Explicit ) ;
640639 hir:: ItemKind :: Use ( path, hir:: UseKind :: ListStem )
641640 }
642641 }
0 commit comments