@@ -2558,6 +2558,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
25582558 let length = self . lower_const_arg ( length, FeedConstTy :: No ) ;
25592559 Ty :: new_array_with_const_len ( tcx, self . lower_ty ( ty) , length)
25602560 }
2561+ hir:: TyKind :: FieldOf ( container, fields) => {
2562+ self . lower_field_of ( hir_ty, container, fields)
2563+ }
25612564 hir:: TyKind :: Typeof ( e) => tcx. type_of ( e. def_id ) . instantiate_identity ( ) ,
25622565 hir:: TyKind :: Infer ( ( ) ) => {
25632566 // Infer also appears as the type of arguments or return
@@ -2724,6 +2727,24 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
27242727 fn_ptr_ty
27252728 }
27262729
2730+ fn lower_field_of (
2731+ & self ,
2732+ hir_ty : & hir:: Ty < ' tcx > ,
2733+ container : & hir:: Ty < ' tcx > ,
2734+ fields : & [ Ident ] ,
2735+ ) -> Ty < ' tcx > {
2736+ match self . lower_field_path (
2737+ container,
2738+ fields,
2739+ hir_ty. span ,
2740+ hir_ty. hir_id ,
2741+ FieldPathKind :: FieldOf ,
2742+ ) {
2743+ Ok ( ( container, field_path) ) => Ty :: new_field_type ( self . tcx ( ) , container, field_path) ,
2744+ Err ( err) => Ty :: new_error ( self . tcx ( ) , err) ,
2745+ }
2746+ }
2747+
27272748 /// Given a fn_hir_id for a impl function, suggest the type that is found on the
27282749 /// corresponding function in the trait that the impl implements, if it exists.
27292750 /// If arg_idx is Some, then it corresponds to an input type index, otherwise it
0 commit comments