@@ -456,8 +456,12 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
456456 base:: unsize_ptr ( bx, lldata, operand. layout . ty , cast. ty , llextra) ;
457457 OperandValue :: Pair ( lldata, llextra)
458458 }
459- mir:: CastKind :: PointerCoercion ( PointerCoercion :: MutToConstPointer )
460- | mir:: CastKind :: PtrToPtr
459+ mir:: CastKind :: PointerCoercion (
460+ PointerCoercion :: MutToConstPointer | PointerCoercion :: ArrayToPointer ,
461+ ) => {
462+ bug ! ( "{kind:?} is for borrowck, and should never appear in codegen" ) ;
463+ }
464+ mir:: CastKind :: PtrToPtr
461465 if bx. cx ( ) . is_backend_scalar_pair ( operand. layout ) =>
462466 {
463467 if let OperandValue :: Pair ( data_ptr, meta) = operand. val {
@@ -477,9 +481,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
477481 base:: cast_to_dyn_star ( bx, lldata, operand. layout , cast. ty , llextra) ;
478482 OperandValue :: Pair ( lldata, llextra)
479483 }
480- mir:: CastKind :: PointerCoercion (
481- PointerCoercion :: MutToConstPointer | PointerCoercion :: ArrayToPointer ,
482- )
483484 | mir:: CastKind :: IntToInt
484485 | mir:: CastKind :: FloatToInt
485486 | mir:: CastKind :: FloatToFloat
0 commit comments