rustc_const_eval: remove ref patterns (+some pattern matching imps)

This commit is contained in:
Maybe Waffle
2022-12-23 15:15:21 +00:00
parent 85357e3e2e
commit 3dca58e249
14 changed files with 125 additions and 139 deletions

View File

@@ -533,7 +533,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir,
let eval_to_int =
|op| ecx.read_immediate(&ecx.eval_operand(op, None)?).map(|x| x.to_const_int());
let err = match msg {
BoundsCheck { ref len, ref index } => {
BoundsCheck { len, index } => {
let len = eval_to_int(len)?;
let index = eval_to_int(index)?;
BoundsCheck { len, index }