Unify the names of const eval queries and their return types
This commit is contained in:
@@ -875,7 +875,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn const_eval(
|
||||
pub fn eval_to_allocation(
|
||||
&self,
|
||||
gid: GlobalId<'tcx>,
|
||||
) -> InterpResult<'tcx, MPlaceTy<'tcx, M::PointerTag>> {
|
||||
@@ -889,7 +889,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
} else {
|
||||
self.param_env
|
||||
};
|
||||
let val = self.tcx.const_eval(param_env.and(gid))?;
|
||||
let val = self.tcx.eval_to_allocation_raw(param_env.and(gid))?;
|
||||
self.raw_const_to_mplace(val)
|
||||
}
|
||||
|
||||
|
||||
@@ -553,7 +553,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
ty::ConstKind::Error(_) => throw_inval!(TypeckError(ErrorReported)),
|
||||
ty::ConstKind::Unevaluated(def, substs, promoted) => {
|
||||
let instance = self.resolve(def.did, substs)?;
|
||||
return Ok(self.const_eval(GlobalId { instance, promoted })?.into());
|
||||
return Ok(self.eval_to_allocation(GlobalId { instance, promoted })?.into());
|
||||
}
|
||||
ty::ConstKind::Infer(..)
|
||||
| ty::ConstKind::Bound(..)
|
||||
|
||||
Reference in New Issue
Block a user