use rustc::mir::*;
use rustc::middle::const_val::{ConstInt, ConstVal};
use rustc::middle::lang_items;
-use rustc::ty::{self, Ty};
+use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::subst::{Kind, Substs};
use rustc::ty::util::IntTypeExt;
use rustc_data_structures::indexed_vec::Idx;
fn patch(&mut self) -> &mut MirPatch<'tcx>;
fn mir(&self) -> &'a Mir<'tcx>;
- fn tcx(&self) -> ty::TyCtxt<'a, 'tcx, 'tcx>;
+ fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx>;
fn param_env(&self) -> ty::ParamEnv<'tcx>;
fn drop_style(&self, path: Self::Path, mode: DropFlagMode) -> DropStyle;
lvalue.ty(self.elaborator.mir(), self.tcx()).to_ty(self.tcx())
}
- fn tcx(&self) -> ty::TyCtxt<'b, 'tcx, 'tcx> {
+ fn tcx(&self) -> TyCtxt<'b, 'tcx, 'tcx> {
self.elaborator.tcx()
}
{
debug!("destructor_call_block({:?}, {:?})", self, succ);
let tcx = self.tcx();
- let drop_trait = tcx.lang_items.drop_trait().unwrap();
+ let drop_trait = tcx.lang_items().drop_trait().unwrap();
let drop_fn = tcx.associated_items(drop_trait).next().unwrap();
let ty = self.lvalue_ty(self.lvalue);
let substs = tcx.mk_substs(iter::once(Kind::from(ty)));
Operand::Constant(box Constant {
span: self.source_info.span,
ty: self.tcx().types.usize,
- literal: Literal::Value { value: ConstVal::Integral(self.tcx().const_usize(val)) }
+ literal: Literal::Value {
+ value: self.tcx().mk_const(ty::Const {
+ val: ConstVal::Integral(self.tcx().const_usize(val)),
+ ty: self.tcx().types.usize
+ })
+ }
})
}