@@ -514,7 +514,11 @@ fn codegen_stmt<'tcx>(
514
514
} ;
515
515
lval. write_cvalue ( fx, res) ;
516
516
}
517
- Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: ReifyFnPointer ) , ref operand, to_ty) => {
517
+ Rvalue :: Cast (
518
+ CastKind :: Pointer ( PointerCast :: ReifyFnPointer ) ,
519
+ ref operand,
520
+ to_ty,
521
+ ) => {
518
522
let from_ty = fx. monomorphize ( operand. ty ( & fx. mir . local_decls , fx. tcx ) ) ;
519
523
let to_layout = fx. layout_of ( fx. monomorphize ( to_ty) ) ;
520
524
match * from_ty. kind ( ) {
@@ -535,9 +539,21 @@ fn codegen_stmt<'tcx>(
535
539
_ => bug ! ( "Trying to ReifyFnPointer on non FnDef {:?}" , from_ty) ,
536
540
}
537
541
}
538
- Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: UnsafeFnPointer ) , ref operand, to_ty)
539
- | Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: MutToConstPointer ) , ref operand, to_ty)
540
- | Rvalue :: Cast ( CastKind :: Pointer ( PointerCast :: ArrayToPointer ) , ref operand, to_ty) => {
542
+ Rvalue :: Cast (
543
+ CastKind :: Pointer ( PointerCast :: UnsafeFnPointer ) ,
544
+ ref operand,
545
+ to_ty,
546
+ )
547
+ | Rvalue :: Cast (
548
+ CastKind :: Pointer ( PointerCast :: MutToConstPointer ) ,
549
+ ref operand,
550
+ to_ty,
551
+ )
552
+ | Rvalue :: Cast (
553
+ CastKind :: Pointer ( PointerCast :: ArrayToPointer ) ,
554
+ ref operand,
555
+ to_ty,
556
+ ) => {
541
557
let to_layout = fx. layout_of ( fx. monomorphize ( to_ty) ) ;
542
558
let operand = codegen_operand ( fx, operand) ;
543
559
lval. write_cvalue ( fx, operand. cast_pointer_to ( to_layout) ) ;
0 commit comments