Skip to content

Commit a29eca5

Browse files
committed
Fix issue with const params in operand.rs
1 parent beb2f84 commit a29eca5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/librustc_mir/interpret/operand.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
524524
layout: Option<TyLayout<'tcx>>,
525525
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
526526
let op = match val.val {
527-
ConstValue::Param(_) | ConstValue::Infer(_) | ConstValue::Placeholder(_) => bug!(),
527+
ConstValue::Param(_) => return err!(TooGeneric),
528+
ConstValue::Infer(_) | ConstValue::Placeholder(_) => bug!(),
528529
ConstValue::ByRef(ptr, alloc) => {
529530
// We rely on mutability being set correctly in that allocation to prevent writes
530531
// where none should happen -- and for `static mut`, we copy on demand anyway.

0 commit comments

Comments
 (0)