Trait InternalCx

Source
pub trait InternalCx<'tcx>: Copy + Clone {
    // Required methods
    fn tcx(self) -> TyCtxt<'tcx>;
    fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted>;
    fn mk_args_from_iter<I, T>(self, iter: I) -> T::Output
       where I: Iterator<Item = T>,
             T: CollectAndApply<GenericArg<'tcx>, GenericArgsRef<'tcx>>;
    fn mk_pat(self, v: PatternKind<'tcx>) -> Pattern<'tcx>;
    fn mk_poly_existential_predicates(
        self,
        eps: &[PolyExistentialPredicate<'tcx>],
    ) -> &'tcx List<PolyExistentialPredicate<'tcx>>;
    fn mk_type_list(self, v: &[Ty<'tcx>]) -> &'tcx List<Ty<'tcx>>;
    fn lifetimes_re_erased(self) -> Region<'tcx>;
    fn mk_bound_variable_kinds_from_iter<I, T>(self, iter: I) -> T::Output
       where I: Iterator<Item = T>,
             T: CollectAndApply<BoundVariableKind, &'tcx List<BoundVariableKind>>;
    fn mk_place_elems(
        self,
        v: &[PlaceElem<'tcx>],
    ) -> &'tcx List<PlaceElem<'tcx>>;
    fn adt_def(self, def_id: DefId) -> AdtDef<'tcx>;
}
Expand description

Trait that defines the methods that are fine to call from [RustcInternal].

This trait is only for [RustcInternal]. Any other other access to rustc’s internals should go through rustc_smir::context::SmirCtxt.

Required Methods§

Source

fn tcx(self) -> TyCtxt<'tcx>

Source

fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted>

Source

fn mk_args_from_iter<I, T>(self, iter: I) -> T::Output
where I: Iterator<Item = T>, T: CollectAndApply<GenericArg<'tcx>, GenericArgsRef<'tcx>>,

Source

fn mk_pat(self, v: PatternKind<'tcx>) -> Pattern<'tcx>

Source

fn mk_poly_existential_predicates( self, eps: &[PolyExistentialPredicate<'tcx>], ) -> &'tcx List<PolyExistentialPredicate<'tcx>>

Source

fn mk_type_list(self, v: &[Ty<'tcx>]) -> &'tcx List<Ty<'tcx>>

Source

fn lifetimes_re_erased(self) -> Region<'tcx>

Source

fn mk_bound_variable_kinds_from_iter<I, T>(self, iter: I) -> T::Output

Source

fn mk_place_elems(self, v: &[PlaceElem<'tcx>]) -> &'tcx List<PlaceElem<'tcx>>

Source

fn adt_def(self, def_id: DefId) -> AdtDef<'tcx>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'tcx> InternalCx<'tcx> for TyCtxt<'tcx>

Source§

fn tcx(self) -> TyCtxt<'tcx>

Source§

fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted>

Source§

fn mk_args_from_iter<I, T>(self, iter: I) -> T::Output
where I: Iterator<Item = T>, T: CollectAndApply<GenericArg<'tcx>, GenericArgsRef<'tcx>>,

Source§

fn mk_pat(self, v: PatternKind<'tcx>) -> Pattern<'tcx>

Source§

fn mk_poly_existential_predicates( self, eps: &[PolyExistentialPredicate<'tcx>], ) -> &'tcx List<PolyExistentialPredicate<'tcx>>

Source§

fn mk_type_list(self, v: &[Ty<'tcx>]) -> &'tcx List<Ty<'tcx>>

Source§

fn lifetimes_re_erased(self) -> Region<'tcx>

Source§

fn mk_bound_variable_kinds_from_iter<I, T>(self, iter: I) -> T::Output

Source§

fn mk_place_elems(self, v: &[PlaceElem<'tcx>]) -> &'tcx List<PlaceElem<'tcx>>

Source§

fn adt_def(self, def_id: DefId) -> AdtDef<'tcx>

Implementors§