Skip to content

Commit e1dbbe5

Browse files
committed
Rustup
1 parent 9143a69 commit e1dbbe5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use rustc::ty::layout::{TyLayout, LayoutOf, Size};
2424
use rustc::ty::subst::Subst;
2525
use rustc::hir::def_id::DefId;
2626
use rustc::mir;
27-
use rustc::middle::const_val;
2827

2928
use syntax::ast::Mutability;
3029
use syntax::codemap::Span;
@@ -270,10 +269,10 @@ pub fn eval_main<'a, 'tcx: 'a>(
270269
block.terminator().source_info.span
271270
};
272271

273-
let mut err = const_val::struct_error(ecx.tcx.tcx.at(span), "constant evaluation error");
272+
let mut err = mir::interpret::struct_error(ecx.tcx.tcx.at(span), "constant evaluation error");
274273
let (frames, span) = ecx.generate_stacktrace(None);
275274
err.span_label(span, e.to_string());
276-
for const_val::FrameInfo { span, location, .. } in frames {
275+
for mir::interpret::FrameInfo { span, location, .. } in frames {
277276
err.span_note(span, &format!("inside call to `{}`", location));
278277
}
279278
err.emit();

src/validation.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use rustc::ty::subst::{Substs, Subst};
88
use rustc::traits::{self, TraitEngine};
99
use rustc::infer::InferCtxt;
1010
use rustc::middle::region;
11-
use rustc::middle::const_val::ConstVal;
1211
use rustc_data_structures::indexed_vec::Idx;
1312
use rustc_mir::interpret::HasMemory;
1413

@@ -719,14 +718,14 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx> for EvalContext<'a, 'mir, '
719718
}
720719
TyArray(elem_ty, len) => {
721720
let len = match len.val {
722-
ConstVal::Unevaluated(def_id, substs) => {
721+
mir::interpret::ConstValue::Unevaluated(def_id, substs) => {
723722
self.tcx.const_eval(self.tcx.param_env(def_id).and(GlobalId {
724723
instance: Instance::new(def_id, substs),
725724
promoted: None,
726725
}))
727726
.map_err(|_err|EvalErrorKind::MachineError("<already reported>".to_string()))?
728727
}
729-
ConstVal::Value(_) => len,
728+
_ => len,
730729
};
731730
let len = len.unwrap_usize(self.tcx.tcx);
732731
for i in 0..len {

0 commit comments

Comments
 (0)