use rustc::middle::const_val::ConstVal;
use rustc::mir::*;
use rustc::mir::transform::MirSource;
-use rustc::ty::{self, Ty};
+use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::subst::{Kind, Subst, Substs};
use rustc::ty::maps::Providers;
use rustc_const_math::{ConstInt, ConstUsize};
providers.mir_shims = make_shim;
}
-fn make_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
+fn make_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
instance: ty::InstanceDef<'tcx>)
-> &'tcx Mir<'tcx>
{
.collect()
}
-fn build_drop_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
+fn build_drop_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
ty: Option<Ty<'tcx>>)
-> Mir<'tcx>
pub struct DropShimElaborator<'a, 'tcx: 'a> {
pub mir: &'a Mir<'tcx>,
pub patch: MirPatch<'tcx>,
- pub tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
+ pub tcx: TyCtxt<'a, 'tcx, 'tcx>,
pub param_env: ty::ParamEnv<'tcx>,
}
fn patch(&mut self) -> &mut MirPatch<'tcx> { &mut self.patch }
fn mir(&self) -> &'a Mir<'tcx> { self.mir }
- fn tcx(&self) -> ty::TyCtxt<'a, 'tcx, 'tcx> { self.tcx }
+ fn tcx(&self) -> TyCtxt<'a, 'tcx, 'tcx> { self.tcx }
fn param_env(&self) -> ty::ParamEnv<'tcx> { self.param_env }
fn drop_style(&self, _path: Self::Path, mode: DropFlagMode) -> DropStyle {
}
/// Build a `Clone::clone` shim for `self_ty`. Here, `def_id` is `Clone::clone`.
-fn build_clone_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
+fn build_clone_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
- self_ty: ty::Ty<'tcx>)
+ self_ty: Ty<'tcx>)
-> Mir<'tcx>
{
debug!("build_clone_shim(def_id={:?})", def_id);
}
struct CloneShimBuilder<'a, 'tcx: 'a> {
- tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
+ tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
local_decls: IndexVec<Local, LocalDecl<'tcx>>,
blocks: IndexVec<BasicBlock, BasicBlockData<'tcx>>,
}
impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
- fn new(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Self {
+ fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Self {
let sig = tcx.fn_sig(def_id);
let sig = tcx.erase_late_bound_regions(&sig);
let span = tcx.def_span(def_id);
self.block(vec![ret_statement], TerminatorKind::Return, false);
}
- fn make_lvalue(&mut self, mutability: Mutability, ty: ty::Ty<'tcx>) -> Lvalue<'tcx> {
+ fn make_lvalue(&mut self, mutability: Mutability, ty: Ty<'tcx>) -> Lvalue<'tcx> {
let span = self.span;
Lvalue::Local(
self.local_decls.push(temp_decl(mutability, ty, span))
fn make_clone_call(
&mut self,
- ty: ty::Ty<'tcx>,
+ ty: Ty<'tcx>,
rcvr_field: Lvalue<'tcx>,
next: BasicBlock,
cleanup: BasicBlock
}
}
- fn array_shim(&mut self, ty: ty::Ty<'tcx>, len: u64) {
+ fn array_shim(&mut self, ty: Ty<'tcx>, len: u64) {
let tcx = self.tcx;
let span = self.span;
let rcvr = Lvalue::Local(Local::new(1+0)).deref();
self.block(vec![], TerminatorKind::Resume, true);
}
- fn tuple_shim(&mut self, tys: &ty::Slice<ty::Ty<'tcx>>) {
+ fn tuple_shim(&mut self, tys: &ty::Slice<Ty<'tcx>>) {
let rcvr = Lvalue::Local(Local::new(1+0)).deref();
let mut returns = Vec::new();
///
/// If `untuple_args` is a vec of types, the second argument of the
/// function will be untupled as these types.
-fn build_call_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
+fn build_call_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
def_id: DefId,
rcvr_adjustment: Adjustment,
call_kind: CallKind,