@@ -18,7 +18,7 @@ use rustc_middle::ty::{List, TypeFoldable};
18
18
use rustc_smir:: rustc_internal;
19
19
use rustc_span:: def_id:: DefId ;
20
20
use rustc_target:: abi:: {
21
- Abi :: Vector , FieldIdx , FieldsShape , Integer , LayoutS , Primitive , Size , TagEncoding ,
21
+ Abi :: Vector , FieldIdx , FieldsShape , Float , Integer , LayoutS , Primitive , Size , TagEncoding ,
22
22
TyAndLayout , VariantIdx , Variants ,
23
23
} ;
24
24
use stable_mir:: abi:: { ArgAbi , FnAbi , PassMode } ;
@@ -1354,13 +1354,18 @@ impl<'tcx> GotocCtx<'tcx> {
1354
1354
}
1355
1355
}
1356
1356
} ,
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
+ }
1357
1361
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 ,
1360
1366
// `F16` and `F128` are not yet handled.
1361
1367
// 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 ! ( ) ,
1364
1369
}
1365
1370
}
1366
1371
@@ -1672,7 +1677,7 @@ pub fn pointee_type(mir_type: Ty) -> Option<Ty> {
1672
1677
/// Extracts the pointee type if the given mir type is either a known smart pointer (Box, Rc, ..)
1673
1678
/// or a regular pointer.
1674
1679
pub 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 )
1676
1681
}
1677
1682
1678
1683
/// This is a place holder function that should normalize the given type.
0 commit comments