@@ -514,7 +514,11 @@ fn codegen_stmt<'tcx>(
514514 } ;
515515 lval. write_cvalue ( fx, res) ;
516516 }
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+ ) => {
518522 let from_ty = fx. monomorphize ( operand. ty ( & fx. mir . local_decls , fx. tcx ) ) ;
519523 let to_layout = fx. layout_of ( fx. monomorphize ( to_ty) ) ;
520524 match * from_ty. kind ( ) {
@@ -535,9 +539,21 @@ fn codegen_stmt<'tcx>(
535539 _ => bug ! ( "Trying to ReifyFnPointer on non FnDef {:?}" , from_ty) ,
536540 }
537541 }
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+ ) => {
541557 let to_layout = fx. layout_of ( fx. monomorphize ( to_ty) ) ;
542558 let operand = codegen_operand ( fx, operand) ;
543559 lval. write_cvalue ( fx, operand. cast_pointer_to ( to_layout) ) ;
0 commit comments