@@ -514,8 +514,7 @@ impl Field {
514514
515515 /// Returns the type as in the signature of the struct (i.e., with
516516 /// placeholder types for type parameters). Only use this in the context of
517- /// the field *definition*; if you've already got a variable of the struct
518- /// type, use `Type::field_type` to get to the field type.
517+ /// the field definition.
519518 pub fn ty ( & self , db : & dyn HirDatabase ) -> Type {
520519 let var_id = self . parent . into ( ) ;
521520 let generic_def_id: GenericDefId = match self . parent {
@@ -1944,18 +1943,6 @@ impl Type {
19441943 }
19451944 }
19461945
1947- pub fn field_type ( & self , db : & dyn HirDatabase , field : Field ) -> Option < Type > {
1948- let ( adt_id, substs) = self . ty . as_adt ( ) ?;
1949- let variant_id: hir_def:: VariantId = field. parent . into ( ) ;
1950- if variant_id. adt_id ( ) != adt_id {
1951- return None ;
1952- }
1953-
1954- let ty = db. field_types ( variant_id) . get ( field. id ) ?. clone ( ) ;
1955- let ty = ty. substitute ( & Interner , substs) ;
1956- Some ( self . derived ( ty) )
1957- }
1958-
19591946 pub fn fields ( & self , db : & dyn HirDatabase ) -> Vec < ( Field , Type ) > {
19601947 let ( variant_id, substs) = match self . ty . kind ( & Interner ) {
19611948 & TyKind :: Adt ( hir_ty:: AdtId ( AdtId :: StructId ( s) ) , ref substs) => ( s. into ( ) , substs) ,
0 commit comments