Struct rustc_mir_build::thir::cx::Cx[−][src]

struct Cx<'thir, 'tcx> {
    tcx: TyCtxt<'tcx>,
    arena: &'thir Arena<'thir, 'tcx>,
    pub(crate) param_env: ParamEnv<'tcx>,
    pub(crate) region_scope_tree: &'tcx ScopeTree,
    pub(crate) typeck_results: &'tcx TypeckResults<'tcx>,
    body_owner: DefId,
}

Fields

tcx: TyCtxt<'tcx>arena: &'thir Arena<'thir, 'tcx>param_env: ParamEnv<'tcx>region_scope_tree: &'tcx ScopeTreetypeck_results: &'tcx TypeckResults<'tcx>body_owner: DefId

The DefId of the owner of this body.

Implementations

impl<'thir, 'tcx> Cx<'thir, 'tcx>[src]

pub(crate) fn mirror_block(
    &mut self,
    block: &'tcx Block<'tcx>
) -> Block<'thir, 'tcx>
[src]

fn mirror_stmts(
    &mut self,
    block_id: ItemLocalId,
    stmts: &'tcx [Stmt<'tcx>]
) -> &'thir [Stmt<'thir, 'tcx>]
[src]

impl<'thir, 'tcx> Cx<'thir, 'tcx>[src]

pub(crate) fn mirror_expr(
    &mut self,
    expr: &'tcx Expr<'tcx>
) -> &'thir Expr<'thir, 'tcx>
[src]

Mirrors and allocates a single hir::Expr. If you need to mirror a whole slice of expressions, prefer using mirror_exprs.

pub(crate) fn mirror_exprs(
    &mut self,
    exprs: &'tcx [Expr<'tcx>]
) -> &'thir [Expr<'thir, 'tcx>]
[src]

Mirrors and allocates a slice of hir::Exprs. They will be allocated as a contiguous sequence in memory.

pub(super) fn mirror_expr_inner(
    &mut self,
    hir_expr: &'tcx Expr<'tcx>
) -> Expr<'thir, 'tcx>
[src]

Mirrors a hir::Expr without allocating it into the arena. This is a separate, private function so that mirror_expr and mirror_exprs can decide how to allocate this expression (alone or within a slice).

fn apply_adjustment(
    &mut self,
    hir_expr: &'tcx Expr<'tcx>,
    expr: Expr<'thir, 'tcx>,
    adjustment: &Adjustment<'tcx>
) -> Expr<'thir, 'tcx>
[src]

fn make_mirror_unadjusted(
    &mut self,
    expr: &'tcx Expr<'tcx>
) -> Expr<'thir, 'tcx>
[src]

fn user_substs_applied_to_res(
    &mut self,
    hir_id: HirId,
    res: Res
) -> Option<CanonicalUserType<'tcx>>
[src]

fn method_callee(
    &mut self,
    expr: &Expr<'_>,
    span: Span,
    overloaded_callee: Option<(DefId, SubstsRef<'tcx>)>
) -> Expr<'thir, 'tcx>
[src]

fn convert_arm(&mut self, arm: &'tcx Arm<'tcx>) -> Arm<'thir, 'tcx>[src]

fn convert_path_expr(
    &mut self,
    expr: &'tcx Expr<'tcx>,
    res: Res
) -> ExprKind<'thir, 'tcx>
[src]

fn convert_var(&mut self, var_hir_id: HirId) -> ExprKind<'thir, 'tcx>[src]

fn overloaded_operator(
    &mut self,
    expr: &'tcx Expr<'tcx>,
    args: &'thir [Expr<'thir, 'tcx>]
) -> ExprKind<'thir, 'tcx>
[src]

fn overloaded_place(
    &mut self,
    expr: &'tcx Expr<'tcx>,
    place_ty: Ty<'tcx>,
    overloaded_callee: Option<(DefId, SubstsRef<'tcx>)>,
    args: &'thir [Expr<'thir, 'tcx>],
    span: Span
) -> ExprKind<'thir, 'tcx>
[src]

fn convert_captured_hir_place(
    &mut self,
    closure_expr: &'tcx Expr<'tcx>,
    place: HirPlace<'tcx>
) -> Expr<'thir, 'tcx>
[src]

fn capture_upvar(
    &mut self,
    closure_expr: &'tcx Expr<'tcx>,
    captured_place: &'tcx CapturedPlace<'tcx>,
    upvar_ty: Ty<'tcx>
) -> Expr<'thir, 'tcx>
[src]

fn field_refs(
    &mut self,
    fields: &'tcx [ExprField<'tcx>]
) -> &'thir [FieldExpr<'thir, 'tcx>]
[src]

Converts a list of named fields (i.e., for struct-like struct/enum ADTs) into FieldExpr.

impl<'thir, 'tcx> Cx<'thir, 'tcx>[src]

fn new(
    tcx: TyCtxt<'tcx>,
    def: WithOptConstParam<LocalDefId>,
    arena: &'thir Arena<'thir, 'tcx>
) -> Cx<'thir, 'tcx>
[src]

pub(crate) fn const_eval_literal(
    &mut self,
    lit: &'tcx LitKind,
    ty: Ty<'tcx>,
    sp: Span,
    neg: bool
) -> &'tcx Const<'tcx>
[src]

pub(crate) fn pattern_from_hir(&mut self, p: &Pat<'_>) -> Pat<'tcx>[src]

Trait Implementations

impl<'tcx> UserAnnotatedTyHelpers<'tcx> for Cx<'_, 'tcx>[src]

Auto Trait Implementations

impl<'thir, 'tcx> !RefUnwindSafe for Cx<'thir, 'tcx>

impl<'thir, 'tcx> !Send for Cx<'thir, 'tcx>

impl<'thir, 'tcx> !Sync for Cx<'thir, 'tcx>

impl<'thir, 'tcx> Unpin for Cx<'thir, 'tcx> where
    'tcx: 'thir, 

impl<'thir, 'tcx> !UnwindSafe for Cx<'thir, 'tcx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized, 
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized, 
[src]

impl<'a, T> Captures<'a> for T where
    T: ?Sized, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.