Fix issue with const params in operand.rs
This commit is contained in:
parent
beb2f84b31
commit
a29eca5d82
1 changed files with 2 additions and 1 deletions
|
@ -524,7 +524,8 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
|
||||||
layout: Option<TyLayout<'tcx>>,
|
layout: Option<TyLayout<'tcx>>,
|
||||||
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
|
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
|
||||||
let op = match val.val {
|
let op = match val.val {
|
||||||
ConstValue::Param(_) | ConstValue::Infer(_) | ConstValue::Placeholder(_) => bug!(),
|
ConstValue::Param(_) => return err!(TooGeneric),
|
||||||
|
ConstValue::Infer(_) | ConstValue::Placeholder(_) => bug!(),
|
||||||
ConstValue::ByRef(ptr, alloc) => {
|
ConstValue::ByRef(ptr, alloc) => {
|
||||||
// We rely on mutability being set correctly in that allocation to prevent writes
|
// We rely on mutability being set correctly in that allocation to prevent writes
|
||||||
// where none should happen -- and for `static mut`, we copy on demand anyway.
|
// where none should happen -- and for `static mut`, we copy on demand anyway.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue