-use rustc::hir;
-use rustc::hir::def_id::DefId;
use rustc::mir::*;
use rustc::ty::{self, adjustment::PointerCast, Predicate, Ty, TyCtxt};
+use rustc_hir as hir;
+use rustc_hir::def_id::DefId;
+use rustc_span::symbol::{sym, Symbol};
+use rustc_span::Span;
use std::borrow::Cow;
use syntax::attr;
-use syntax::symbol::{sym, Symbol};
-use syntax_pos::Span;
type McfResult = Result<(), (Span, Cow<'static, str>)>;
ProjectionElem::Downcast(_symbol, _variant_index) => {}
ProjectionElem::Field(..) => {
- let base_ty = Place::ty_from(&place.base, &proj_base, body, tcx).ty;
+ let base_ty = Place::ty_from(&place.local, &proj_base, body, tcx).ty;
if let Some(def) = base_ty.ty_adt_def() {
// No union field accesses in `const fn`
if def.is_union() {
TerminatorKind::Call { func, args, from_hir_call: _, destination: _, cleanup: _ } => {
let fn_ty = func.ty(body, tcx);
if let ty::FnDef(def_id, _) = fn_ty.kind {
- if !tcx.is_min_const_fn(def_id) {
+ if !crate::const_eval::is_min_const_fn(tcx, def_id) {
return Err((
span,
format!(