Skip to main content

InternalCx

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) -> 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>, &'tcx List<BoundVariableKind<'tcx>>>;
    fn mk_place_elems(
        self,
        v: &[PlaceElem<'tcx>],
    ) -> &'tcx List<PlaceElem<'tcx>>;
    fn adt_def(self, def_id: DefId) -> AdtDef<'tcx>;
    fn mk_patterns_from_iter<I, T>(self, iter: I) -> T::Output
       where I: Iterator<Item = T>,
             T: CollectAndApply<Pattern<'tcx>, &'tcx List<Pattern<'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_public_bridge::context::CompilerCtxt].

Required Methods§

Source

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

Source

fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> 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
where I: Iterator<Item = T>, T: CollectAndApply<BoundVariableKind<'tcx>, &'tcx List<BoundVariableKind<'tcx>>>,

Source

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

Source

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

Source

fn mk_patterns_from_iter<I, T>(self, iter: I) -> T::Output
where I: Iterator<Item = T>, T: CollectAndApply<Pattern<'tcx>, &'tcx List<Pattern<'tcx>>>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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) -> 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
where I: Iterator<Item = T>, T: CollectAndApply<BoundVariableKind<'tcx>, &'tcx List<BoundVariableKind<'tcx>>>,

Source§

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

Source§

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

Source§

fn mk_patterns_from_iter<I, T>(self, iter: I) -> T::Output
where I: Iterator<Item = T>, T: CollectAndApply<Pattern<'tcx>, &'tcx List<Pattern<'tcx>>>,

Implementors§