@@ -382,7 +382,7 @@ impl<'c> Translation<'c> {
382382 res = mk ( ) . unary_expr ( UnOp :: Deref ( Default :: default ( ) ) , res) ;
383383 }
384384
385- WithStmts :: new_unsafe_val ( res)
385+ WithStmts :: new_val ( res) . set_unsafe ( )
386386 }
387387
388388 /// Construct an expression for a NULL at any type, including forward declarations,
@@ -450,7 +450,7 @@ impl<'c> Translation<'c> {
450450 self . import_type ( target_cty) ;
451451
452452 Ok ( val. and_then ( |val| {
453- WithStmts :: new_unsafe_val ( transmute_expr ( source_ty, target_ty, val) )
453+ WithStmts :: new_val ( transmute_expr ( source_ty, target_ty, val) ) . set_unsafe ( )
454454 } ) )
455455 } else {
456456 // Normal case
@@ -483,7 +483,7 @@ impl<'c> Translation<'c> {
483483 let intptr_t = mk ( ) . abs_path_ty ( vec ! [ "libc" , "intptr_t" ] ) ;
484484 val = mk ( ) . cast_expr ( val, intptr_t. clone ( ) ) ;
485485
486- WithStmts :: new_unsafe_val ( transmute_expr ( intptr_t, target_ty, val) )
486+ WithStmts :: new_val ( transmute_expr ( intptr_t, target_ty, val) ) . set_unsafe ( )
487487 } ) )
488488 } else if source_ty_kind. is_bool ( ) {
489489 self . use_crate ( ExternCrate :: Libc ) ;
@@ -520,7 +520,7 @@ impl<'c> Translation<'c> {
520520
521521 if self . ast_context . is_function_pointer ( source_cty) {
522522 Ok ( val. and_then ( |val| {
523- WithStmts :: new_unsafe_val ( transmute_expr ( source_ty, target_ty, val) )
523+ WithStmts :: new_val ( transmute_expr ( source_ty, target_ty, val) ) . set_unsafe ( )
524524 } ) )
525525 } else if let & CTypeKind :: Enum ( enum_decl_id) = target_ty_kind {
526526 val. try_map ( |val| self . convert_cast_to_enum ( ctx, target_cty, enum_decl_id, expr, val) )
0 commit comments