diff options
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/operand.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_const_eval/src/interpret/util.rs | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index 6338e08380f..597ca4cfcdd 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -622,10 +622,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { /// "universe" (param_env). pub fn const_to_op( &self, - val: ty::Const<'tcx>, + c: ty::Const<'tcx>, layout: Option<TyAndLayout<'tcx>>, ) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>> { - match val.val() { + match c.kind() { ty::ConstKind::Param(_) | ty::ConstKind::Bound(..) => throw_inval!(TooGeneric), ty::ConstKind::Error(DelaySpanBugEmitted { reported, .. }) => { throw_inval!(AlreadyReported(reported)) @@ -635,9 +635,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { Ok(self.eval_to_allocation(GlobalId { instance, promoted: uv.promoted })?.into()) } ty::ConstKind::Infer(..) | ty::ConstKind::Placeholder(..) => { - span_bug!(self.cur_span(), "const_to_op: Unexpected ConstKind {:?}", val) + span_bug!(self.cur_span(), "const_to_op: Unexpected ConstKind {:?}", c) } - ty::ConstKind::Value(val_val) => self.const_val_to_op(val_val, val.ty(), layout), + ty::ConstKind::Value(val) => self.const_val_to_op(val, c.ty(), layout), } } diff --git a/compiler/rustc_const_eval/src/interpret/util.rs b/compiler/rustc_const_eval/src/interpret/util.rs index 0fddafbee79..b9866995e9f 100644 --- a/compiler/rustc_const_eval/src/interpret/util.rs +++ b/compiler/rustc_const_eval/src/interpret/util.rs @@ -55,7 +55,7 @@ where assert!(matches!(ty.kind(), ty::Param(_))) } ty::subst::GenericArgKind::Const(ct) => { - assert!(matches!(ct.val(), ty::ConstKind::Param(_))) + assert!(matches!(ct.kind(), ty::ConstKind::Param(_))) } ty::subst::GenericArgKind::Lifetime(..) => (), }, @@ -69,7 +69,7 @@ where } fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> { - match c.val() { + match c.kind() { ty::ConstKind::Param(..) => ControlFlow::Break(FoundParam), _ => c.super_visit_with(self), } |
