use rustc::hir::def_id::DefId;
use rustc_target::spec::abi;
-crate fn bound(tcx: ty::TyCtxt<'_, '_, 'tcx>, index: u32) -> Ty<'tcx> {
+crate fn bound(tcx: TyCtxt<'_, '_, 'tcx>, index: u32) -> Ty<'tcx> {
let ty = ty::Bound(
ty::INNERMOST,
ty::BoundVar::from_u32(index).into()
}
crate fn fn_ptr(
- tcx: ty::TyCtxt<'_, '_, 'tcx>,
+ tcx: TyCtxt<'_, '_, 'tcx>,
arity_and_output: usize,
c_variadic: bool,
unsafety: hir::Unsafety,
tcx.mk_fn_ptr(fn_sig)
}
-crate fn type_list(tcx: ty::TyCtxt<'_, '_, 'tcx>, arity: usize) -> SubstsRef<'tcx> {
+crate fn type_list(tcx: TyCtxt<'_, '_, 'tcx>, arity: usize) -> SubstsRef<'tcx> {
tcx.mk_substs(
(0..arity).into_iter()
.map(|i| ty::BoundVar::from(i))
)
}
-crate fn ref_ty(tcx: ty::TyCtxt<'_, '_, 'tcx>, mutbl: hir::Mutability) -> Ty<'tcx> {
+crate fn ref_ty(tcx: TyCtxt<'_, '_, 'tcx>, mutbl: hir::Mutability) -> Ty<'tcx> {
let region = tcx.mk_region(
ty::ReLateBound(ty::INNERMOST, ty::BoundRegion::BrAnon(0))
);
})
}
-crate fn fn_def(tcx: ty::TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
+crate fn fn_def(tcx: TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
tcx.mk_ty(ty::FnDef(def_id, InternalSubsts::bound_vars_for_item(tcx, def_id)))
}
-crate fn closure(tcx: ty::TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
+crate fn closure(tcx: TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
tcx.mk_closure(def_id, ty::ClosureSubsts {
substs: InternalSubsts::bound_vars_for_item(tcx, def_id),
})
}
-crate fn generator(tcx: ty::TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
+crate fn generator(tcx: TyCtxt<'_, '_, 'tcx>, def_id: DefId) -> Ty<'tcx> {
tcx.mk_generator(def_id, ty::GeneratorSubsts {
substs: InternalSubsts::bound_vars_for_item(tcx, def_id),
}, hir::GeneratorMovability::Movable)