@@ -644,40 +644,39 @@ fn convert_item(tcx: TyCtxt<'_>, item_id: hir::ItemId) {
644
644
}
645
645
}
646
646
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
-
653
647
// Don't call `type_of` on opaque types, since that depends on type
654
648
// checking function bodies. `check_item_type` ensures that it's called
655
649
// instead.
656
650
hir:: ItemKind :: OpaqueTy ( ..) => {
657
651
tcx. ensure ( ) . generics_of ( def_id) ;
658
652
tcx. ensure ( ) . predicates_of ( def_id) ;
659
653
tcx. ensure ( ) . explicit_item_bounds ( def_id) ;
654
+ tcx. ensure ( ) . item_bounds ( def_id) ;
660
655
}
661
- hir:: ItemKind :: TyAlias ( ..)
662
- | hir:: ItemKind :: Static ( ..)
663
- | hir:: ItemKind :: Const ( ..)
664
- | hir:: ItemKind :: Fn ( ..) => {
656
+
657
+ hir:: ItemKind :: TyAlias ( ..) => {
665
658
tcx. ensure ( ) . generics_of ( def_id) ;
666
659
tcx. ensure ( ) . type_of ( def_id) ;
667
660
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 ( ) ) ;
679
671
}
680
672
}
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
+ }
681
680
}
682
681
}
683
682
0 commit comments