mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
Fix issue with const params in operand.rs
This commit is contained in:
@@ -524,7 +524,8 @@ pub(super) fn eval_operands(
|
||||
layout: Option<TyLayout<'tcx>>,
|
||||
) -> EvalResult<'tcx, OpTy<'tcx, M::PointerTag>> {
|
||||
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) => {
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user