rustc_const_eval: remove ref patterns (+some pattern matching imps)
This commit is contained in:
@@ -363,11 +363,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
src: &OpTy<'tcx, M::Provenance>,
|
||||
) -> InterpResult<'tcx, Either<MPlaceTy<'tcx, M::Provenance>, ImmTy<'tcx, M::Provenance>>> {
|
||||
Ok(match src.as_mplace_or_imm() {
|
||||
Left(ref mplace) => {
|
||||
if let Some(val) = self.read_immediate_from_mplace_raw(mplace)? {
|
||||
Left(mplace) => {
|
||||
if let Some(val) = self.read_immediate_from_mplace_raw(&mplace)? {
|
||||
Right(val)
|
||||
} else {
|
||||
Left(*mplace)
|
||||
Left(mplace)
|
||||
}
|
||||
}
|
||||
Right(val) => Right(val),
|
||||
@@ -533,11 +533,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
layout: Option<TyAndLayout<'tcx>>,
|
||||
) -> InterpResult<'tcx, OpTy<'tcx, M::Provenance>> {
|
||||
use rustc_middle::mir::Operand::*;
|
||||
let op = match *mir_op {
|
||||
let op = match mir_op {
|
||||
// FIXME: do some more logic on `move` to invalidate the old location
|
||||
Copy(place) | Move(place) => self.eval_place_to_op(place, layout)?,
|
||||
&(Copy(place) | Move(place)) => self.eval_place_to_op(place, layout)?,
|
||||
|
||||
Constant(ref constant) => {
|
||||
Constant(constant) => {
|
||||
let c =
|
||||
self.subst_from_current_frame_and_normalize_erasing_regions(constant.literal)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user