@@ -18,7 +18,7 @@ use rustc_middle::ty::{List, TypeFoldable};
1818use rustc_smir:: rustc_internal;
1919use rustc_span:: def_id:: DefId ;
2020use rustc_target:: abi:: {
21- Abi :: Vector , FieldIdx , FieldsShape , Integer , LayoutS , Primitive , Size , TagEncoding ,
21+ Abi :: Vector , FieldIdx , FieldsShape , Float , Integer , LayoutS , Primitive , Size , TagEncoding ,
2222 TyAndLayout , VariantIdx , Variants ,
2323} ;
2424use stable_mir:: abi:: { ArgAbi , FnAbi , PassMode } ;
@@ -1354,13 +1354,18 @@ impl<'tcx> GotocCtx<'tcx> {
13541354 }
13551355 }
13561356 } ,
1357+ Primitive :: Float ( f) => self . codegen_float_type ( f) ,
1358+ Primitive :: Pointer ( _) => Ty :: new_ptr ( self . tcx , self . tcx . types . u8 , Mutability :: Not ) ,
1359+ }
1360+ }
13571361
1358- Primitive :: F32 => self . tcx . types . f32 ,
1359- Primitive :: F64 => self . tcx . types . f64 ,
1362+ pub fn codegen_float_type ( & self , f : Float ) -> Ty < ' tcx > {
1363+ match f {
1364+ Float :: F32 => self . tcx . types . f32 ,
1365+ Float :: F64 => self . tcx . types . f64 ,
13601366 // `F16` and `F128` are not yet handled.
13611367 // Tracked here: <https://github.com/model-checking/kani/issues/3069>
1362- Primitive :: F16 | Primitive :: F128 => unimplemented ! ( ) ,
1363- Primitive :: Pointer ( _) => Ty :: new_ptr ( self . tcx , self . tcx . types . u8 , Mutability :: Not ) ,
1368+ Float :: F16 | Float :: F128 => unimplemented ! ( ) ,
13641369 }
13651370 }
13661371
@@ -1672,7 +1677,7 @@ pub fn pointee_type(mir_type: Ty) -> Option<Ty> {
16721677/// Extracts the pointee type if the given mir type is either a known smart pointer (Box, Rc, ..)
16731678/// or a regular pointer.
16741679pub fn std_pointee_type ( mir_type : Ty ) -> Option < Ty > {
1675- mir_type. builtin_deref ( true ) . map ( |tm| tm . ty )
1680+ mir_type. builtin_deref ( true )
16761681}
16771682
16781683/// This is a place holder function that should normalize the given type.
0 commit comments