use rustc::mir::interpret::{
sign_extend, truncate, AllocId, ConstValue, GlobalId, InterpResult, Pointer, Scalar,
};
+use rustc_ast::ast;
use rustc_macros::HashStable;
-use syntax::ast;
/// An `Immediate` represents a single immediate self-contained Rust value.
///
&self,
ops: &[mir::Operand<'tcx>],
) -> InterpResult<'tcx, Vec<OpTy<'tcx, M::PointerTag>>> {
- ops.into_iter().map(|op| self.eval_operand(op, None)).collect()
+ ops.iter().map(|op| self.eval_operand(op, None)).collect()
}
// Used when the miri-engine runs into a constant and for extracting information from constants
/// "universe" (param_env).
crate fn eval_const_to_op(
&self,
- val: &'tcx ty::Const<'tcx>,
+ val: &ty::Const<'tcx>,
layout: Option<TyLayout<'tcx>>,
) -> InterpResult<'tcx, OpTy<'tcx, M::PointerTag>> {
let tag_scalar = |scalar| match scalar {
// potentially requiring the current static to be evaluated again. This is not a
// problem here, because we are building an operand which means an actual read is
// happening.
- return Ok(OpTy::from(self.const_eval(GlobalId { instance, promoted })?));
+ return Ok(self.const_eval(GlobalId { instance, promoted }, val.ty)?);
}
ty::ConstKind::Infer(..)
| ty::ConstKind::Bound(..)