@@ -644,40 +644,39 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::ItemId) {
644644 }
645645 }
646646
647- // Desugared from `impl Trait`, so visited by the function's return type.
648- hir:: ItemKind :: OpaqueTy ( hir:: OpaqueTy {
649- origin : hir:: OpaqueTyOrigin :: FnReturn ( ..) | hir:: OpaqueTyOrigin :: AsyncFn ( ..) ,
650- ..
651- } ) => { }
652-
653647 // Don't call `type_of` on opaque types, since that depends on type
654648 // checking function bodies. `check_item_type` ensures that it's called
655649 // instead.
656650 hir:: ItemKind :: OpaqueTy ( ..) => {
657651 tcx. ensure ( ) . generics_of ( def_id) ;
658652 tcx. ensure ( ) . predicates_of ( def_id) ;
659653 tcx. ensure ( ) . explicit_item_bounds ( def_id) ;
654+ tcx. ensure ( ) . item_bounds ( def_id) ;
660655 }
661- hir:: ItemKind :: TyAlias ( ..)
662- | hir:: ItemKind :: Static ( ..)
663- | hir:: ItemKind :: Const ( ..)
664- | hir:: ItemKind :: Fn ( ..) => {
656+
657+ hir:: ItemKind :: TyAlias ( ..) => {
665658 tcx. ensure ( ) . generics_of ( def_id) ;
666659 tcx. ensure ( ) . type_of ( def_id) ;
667660 tcx. ensure ( ) . predicates_of ( def_id) ;
668- match it. kind {
669- hir:: ItemKind :: Fn ( ..) => tcx. ensure ( ) . fn_sig ( def_id) ,
670- hir:: ItemKind :: OpaqueTy ( ..) => tcx. ensure ( ) . item_bounds ( def_id) ,
671- hir:: ItemKind :: Const ( ty, ..) | hir:: ItemKind :: Static ( ty, ..) => {
672- if !is_suggestable_infer_ty ( ty) {
673- let mut visitor = HirPlaceholderCollector :: default ( ) ;
674- visitor. visit_item ( it) ;
675- placeholder_type_error ( tcx, None , visitor. 0 , false , None , it. kind . descr ( ) ) ;
676- }
677- }
678- _ => ( ) ,
661+ }
662+
663+ hir:: ItemKind :: Static ( ty, ..) | hir:: ItemKind :: Const ( ty, ..) => {
664+ tcx. ensure ( ) . generics_of ( def_id) ;
665+ tcx. ensure ( ) . type_of ( def_id) ;
666+ tcx. ensure ( ) . predicates_of ( def_id) ;
667+ if !is_suggestable_infer_ty ( ty) {
668+ let mut visitor = HirPlaceholderCollector :: default ( ) ;
669+ visitor. visit_item ( it) ;
670+ placeholder_type_error ( tcx, None , visitor. 0 , false , None , it. kind . descr ( ) ) ;
679671 }
680672 }
673+
674+ hir:: ItemKind :: Fn ( ..) => {
675+ tcx. ensure ( ) . generics_of ( def_id) ;
676+ tcx. ensure ( ) . type_of ( def_id) ;
677+ tcx. ensure ( ) . predicates_of ( def_id) ;
678+ tcx. ensure ( ) . fn_sig ( def_id) ;
679+ }
681680 }
682681}
683682
0 commit comments