@@ -474,6 +474,11 @@ impl<'tcx> GotocCtx<'tcx> {
474
474
let binop_stmt = codegen_intrinsic_binop ! ( sub) ;
475
475
self . add_finite_args_checks ( intrinsic, fargs_clone, binop_stmt, span)
476
476
}
477
+ "is_val_statically_known" => {
478
+ // Returning false is sound according do this intrinsic's documentation:
479
+ // https://doc.rust-lang.org/nightly/std/intrinsics/fn.is_val_statically_known.html
480
+ self . codegen_expr_to_place_stable ( place, Expr :: c_false ( ) )
481
+ }
477
482
"likely" => self . codegen_expr_to_place_stable ( place, fargs. remove ( 0 ) ) ,
478
483
"log10f32" => unstable_codegen ! ( codegen_simple_intrinsic!( Log10f ) ) ,
479
484
"log10f64" => unstable_codegen ! ( codegen_simple_intrinsic!( Log10 ) ) ,
@@ -506,6 +511,7 @@ impl<'tcx> GotocCtx<'tcx> {
506
511
"ptr_offset_from" => self . codegen_ptr_offset_from ( fargs, place, loc) ,
507
512
"ptr_offset_from_unsigned" => self . codegen_ptr_offset_from_unsigned ( fargs, place, loc) ,
508
513
"raw_eq" => self . codegen_intrinsic_raw_eq ( instance, fargs, place, loc) ,
514
+ "retag_box_to_raw" => self . codegen_retag_box_to_raw ( fargs, place, loc) ,
509
515
"rintf32" => codegen_simple_intrinsic ! ( Rintf ) ,
510
516
"rintf64" => codegen_simple_intrinsic ! ( Rint ) ,
511
517
"rotate_left" => codegen_intrinsic_binop ! ( rol) ,
@@ -1259,6 +1265,19 @@ impl<'tcx> GotocCtx<'tcx> {
1259
1265
self . codegen_expr_to_place_stable ( p, e)
1260
1266
}
1261
1267
1268
+ // This is an operation that is primarily relevant for stacked borrow
1269
+ // checks. For Kani, we simply return the pointer.
1270
+ fn codegen_retag_box_to_raw (
1271
+ & mut self ,
1272
+ mut fargs : Vec < Expr > ,
1273
+ p : & Place ,
1274
+ _loc : Location ,
1275
+ ) -> Stmt {
1276
+ assert_eq ! ( fargs. len( ) , 1 , "raw_box_to_box expected one argument" ) ;
1277
+ let arg = fargs. remove ( 0 ) ;
1278
+ self . codegen_expr_to_place_stable ( p, arg)
1279
+ }
1280
+
1262
1281
fn vtable_info (
1263
1282
& mut self ,
1264
1283
info : VTableInfo ,
0 commit comments