@@ -11,11 +11,11 @@ use crate::{
1111 diagnostics:: DiagnosticSink ,
1212 ids:: ImplId ,
1313 name_resolution:: Namespace ,
14- primitive_type:: PrimitiveType ,
1514 resolve:: { HasResolver , Resolver , TypeNs } ,
1615 ty:: { FnSig , Substitution , Ty , TyKind } ,
1716 type_ref:: { LocalTypeRefId , TypeRef , TypeRefMap , TypeRefSourceMap } ,
18- Function , HasVisibility , HirDatabase , ModuleDef , Path , Struct , TypeAlias , Visibility ,
17+ Function , HasVisibility , HirDatabase , ModuleDef , Path , PrimitiveType , Struct , TypeAlias ,
18+ Visibility ,
1919} ;
2020
2121/// A struct which holds resolved type references to `Ty`s.
@@ -138,7 +138,7 @@ impl Ty {
138138 TypeNs :: SelfType ( id) => Some ( db. type_for_impl_self ( id) ) ,
139139 TypeNs :: StructId ( id) => type_for_def_fn ( TypableDef :: Struct ( id. into ( ) ) ) ,
140140 TypeNs :: TypeAliasId ( id) => type_for_def_fn ( TypableDef :: TypeAlias ( id. into ( ) ) ) ,
141- TypeNs :: PrimitiveType ( id) => type_for_def_fn ( TypableDef :: PrimitiveType ( id) ) ,
141+ TypeNs :: PrimitiveType ( id) => type_for_def_fn ( TypableDef :: PrimitiveType ( id. into ( ) ) ) ,
142142 }
143143 }
144144}
@@ -260,11 +260,11 @@ pub(crate) fn type_for_impl_self(db: &dyn HirDatabase, i: ImplId) -> Ty {
260260}
261261
262262/// Build the declared type of a static.
263- fn type_for_primitive ( def : PrimitiveType ) -> Ty {
264- match def {
265- PrimitiveType :: Float ( f) => TyKind :: Float ( f. into ( ) ) ,
266- PrimitiveType :: Int ( i) => TyKind :: Int ( i. into ( ) ) ,
267- PrimitiveType :: Bool => TyKind :: Bool ,
263+ pub ( crate ) fn type_for_primitive ( def : PrimitiveType ) -> Ty {
264+ match def. inner {
265+ crate :: primitive_type :: PrimitiveType :: Float ( f) => TyKind :: Float ( f. into ( ) ) ,
266+ crate :: primitive_type :: PrimitiveType :: Int ( i) => TyKind :: Int ( i. into ( ) ) ,
267+ crate :: primitive_type :: PrimitiveType :: Bool => TyKind :: Bool ,
268268 }
269269 . intern ( )
270270}
0 commit comments