@@ -474,6 +474,11 @@ impl<'tcx> GotocCtx<'tcx> {
474474 let binop_stmt = codegen_intrinsic_binop ! ( sub) ;
475475 self . add_finite_args_checks ( intrinsic, fargs_clone, binop_stmt, span)
476476 }
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+ }
477482 "likely" => self . codegen_expr_to_place_stable ( place, fargs. remove ( 0 ) ) ,
478483 "log10f32" => unstable_codegen ! ( codegen_simple_intrinsic!( Log10f ) ) ,
479484 "log10f64" => unstable_codegen ! ( codegen_simple_intrinsic!( Log10 ) ) ,
@@ -506,6 +511,7 @@ impl<'tcx> GotocCtx<'tcx> {
506511 "ptr_offset_from" => self . codegen_ptr_offset_from ( fargs, place, loc) ,
507512 "ptr_offset_from_unsigned" => self . codegen_ptr_offset_from_unsigned ( fargs, place, loc) ,
508513 "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) ,
509515 "rintf32" => codegen_simple_intrinsic ! ( Rintf ) ,
510516 "rintf64" => codegen_simple_intrinsic ! ( Rint ) ,
511517 "rotate_left" => codegen_intrinsic_binop ! ( rol) ,
@@ -1259,6 +1265,19 @@ impl<'tcx> GotocCtx<'tcx> {
12591265 self . codegen_expr_to_place_stable ( p, e)
12601266 }
12611267
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+
12621281 fn vtable_info (
12631282 & mut self ,
12641283 info : VTableInfo ,
0 commit comments