|
6 | 6 | use rustc::ty::layout::LayoutOf;
|
7 | 7 | use rustc::ty::{Ty, TyCtxt, ParamEnv, self};
|
8 | 8 | use rustc::mir::interpret::{
|
9 |
| - EvalResult, ErrorHandled, |
| 9 | + InterpResult, ErrorHandled, |
10 | 10 | };
|
11 | 11 | use rustc::hir;
|
12 | 12 | use rustc::hir::def_id::DefId;
|
@@ -63,7 +63,7 @@ impl<'rt, 'a, 'mir, 'tcx> InternVisitor<'rt, 'a, 'mir, 'tcx> {
|
63 | 63 | &mut self,
|
64 | 64 | ptr: Pointer,
|
65 | 65 | mutability: Mutability,
|
66 |
| - ) -> EvalResult<'tcx, Option<IsStaticOrFn>> { |
| 66 | + ) -> InterpResult<'tcx, Option<IsStaticOrFn>> { |
67 | 67 | trace!(
|
68 | 68 | "InternVisitor::intern {:?} with {:?}",
|
69 | 69 | ptr, mutability,
|
|
117 | 117 | fn visit_aggregate(
|
118 | 118 | &mut self,
|
119 | 119 | mplace: MPlaceTy<'tcx>,
|
120 |
| - fields: impl Iterator<Item=EvalResult<'tcx, Self::V>>, |
121 |
| - ) -> EvalResult<'tcx> { |
| 120 | + fields: impl Iterator<Item=InterpResult<'tcx, Self::V>>, |
| 121 | + ) -> InterpResult<'tcx> { |
122 | 122 | if let Some(def) = mplace.layout.ty.ty_adt_def() {
|
123 | 123 | if Some(def.did) == self.ecx.tcx.lang_items().unsafe_cell_type() {
|
124 | 124 | // We are crossing over an `UnsafeCell`, we can mutate again
|
|
138 | 138 | self.walk_aggregate(mplace, fields)
|
139 | 139 | }
|
140 | 140 |
|
141 |
| - fn visit_primitive(&mut self, mplace: MPlaceTy<'tcx>) -> EvalResult<'tcx> { |
| 141 | + fn visit_primitive(&mut self, mplace: MPlaceTy<'tcx>) -> InterpResult<'tcx> { |
142 | 142 | // Handle Reference types, as these are the only relocations supported by const eval.
|
143 | 143 | // Raw pointers (and boxes) are handled by the `leftover_relocations` logic.
|
144 | 144 | let ty = mplace.layout.ty;
|
@@ -245,7 +245,7 @@ pub fn intern_const_alloc_recursive(
|
245 | 245 | // FIXME(oli-obk): can we scrap the param env? I think we can, the final value of a const eval
|
246 | 246 | // must always be monomorphic, right?
|
247 | 247 | param_env: ty::ParamEnv<'tcx>,
|
248 |
| -) -> EvalResult<'tcx> { |
| 248 | +) -> InterpResult<'tcx> { |
249 | 249 | let tcx = ecx.tcx;
|
250 | 250 | let (mutability, base_intern_mode) = match tcx.static_mutability(def_id) {
|
251 | 251 | Some(hir::Mutability::MutImmutable) => (Mutability::Immutable, InternMode::Static),
|
|
0 commit comments