Skip to content

Commit e79dc76

Browse files
committed
bug! more uses of these in runtime stuff
1 parent afef64c commit e79dc76

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/base.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -677,21 +677,22 @@ fn codegen_stmt<'tcx>(
677677
CastKind::PointerCoercion(PointerCoercion::UnsafeFnPointer),
678678
ref operand,
679679
to_ty,
680-
)
681-
| Rvalue::Cast(
682-
CastKind::PointerCoercion(PointerCoercion::MutToConstPointer),
683-
ref operand,
684-
to_ty,
685-
)
686-
| Rvalue::Cast(
687-
CastKind::PointerCoercion(PointerCoercion::ArrayToPointer),
688-
ref operand,
689-
to_ty,
690680
) => {
691681
let to_layout = fx.layout_of(fx.monomorphize(to_ty));
692682
let operand = codegen_operand(fx, operand);
693683
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
694684
}
685+
Rvalue::Cast(
686+
CastKind::PointerCoercion(
687+
PointerCoercion::MutToConstPointer | PointerCoercion::ArrayToPointer,
688+
),
689+
..,
690+
) => {
691+
bug!(
692+
"{:?} is for borrowck, and should never appear in codegen",
693+
to_place_and_rval.1
694+
);
695+
}
695696
Rvalue::Cast(
696697
CastKind::IntToInt
697698
| CastKind::FloatToFloat

0 commit comments

Comments
 (0)