@@ -1391,8 +1391,13 @@ impl Const {
13911391 db. const_data ( self . id ) . name . clone ( )
13921392 }
13931393
1394- pub fn type_ref ( self , db : & dyn HirDatabase ) -> TypeRef {
1395- db. const_data ( self . id ) . type_ref . as_ref ( ) . clone ( )
1394+ pub fn ty ( self , db : & dyn HirDatabase ) -> Type {
1395+ let data = db. const_data ( self . id ) ;
1396+ let resolver = self . id . resolver ( db. upcast ( ) ) ;
1397+ let krate = self . id . lookup ( db. upcast ( ) ) . container . krate ( db) ;
1398+ let ctx = hir_ty:: TyLoweringContext :: new ( db, & resolver) ;
1399+ let ty = ctx. lower_ty ( & data. type_ref ) ;
1400+ Type :: new_with_resolver_inner ( db, krate. id , & resolver, ty)
13961401 }
13971402}
13981403
@@ -1421,6 +1426,15 @@ impl Static {
14211426 pub fn is_mut ( self , db : & dyn HirDatabase ) -> bool {
14221427 db. static_data ( self . id ) . mutable
14231428 }
1429+
1430+ pub fn ty ( self , db : & dyn HirDatabase ) -> Type {
1431+ let data = db. static_data ( self . id ) ;
1432+ let resolver = self . id . resolver ( db. upcast ( ) ) ;
1433+ let krate = self . id . lookup ( db. upcast ( ) ) . container . krate ( ) ;
1434+ let ctx = hir_ty:: TyLoweringContext :: new ( db, & resolver) ;
1435+ let ty = ctx. lower_ty ( & data. type_ref ) ;
1436+ Type :: new_with_resolver_inner ( db, krate, & resolver, ty)
1437+ }
14241438}
14251439
14261440impl HasVisibility for Static {
0 commit comments