Struct rustc_mir_build::thir::cx::Cx [−][src]
Fields
tcx: TyCtxt<'tcx>arena: &'thir Arena<'thir, 'tcx>param_env: ParamEnv<'tcx>region_scope_tree: &'tcx ScopeTreetypeck_results: &'tcx TypeckResults<'tcx>body_owner: DefIdThe 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]
&mut self,
block: &'tcx Block<'tcx>
) -> Block<'thir, 'tcx>
fn mirror_stmts(
&mut self,
block_id: ItemLocalId,
stmts: &'tcx [Stmt<'tcx>]
) -> &'thir [Stmt<'thir, 'tcx>][src]
&mut self,
block_id: ItemLocalId,
stmts: &'tcx [Stmt<'tcx>]
) -> &'thir [Stmt<'thir, 'tcx>]
impl<'thir, 'tcx> Cx<'thir, 'tcx>[src]
pub(crate) fn mirror_expr(
&mut self,
expr: &'tcx Expr<'tcx>
) -> &'thir Expr<'thir, 'tcx>[src]
&mut self,
expr: &'tcx Expr<'tcx>
) -> &'thir Expr<'thir, 'tcx>
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]
&mut self,
exprs: &'tcx [Expr<'tcx>]
) -> &'thir [Expr<'thir, 'tcx>]
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]
&mut self,
hir_expr: &'tcx Expr<'tcx>
) -> Expr<'thir, 'tcx>
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]
&mut self,
hir_expr: &'tcx Expr<'tcx>,
expr: Expr<'thir, 'tcx>,
adjustment: &Adjustment<'tcx>
) -> Expr<'thir, 'tcx>
fn make_mirror_unadjusted(
&mut self,
expr: &'tcx Expr<'tcx>
) -> Expr<'thir, 'tcx>[src]
&mut self,
expr: &'tcx Expr<'tcx>
) -> Expr<'thir, 'tcx>
fn user_substs_applied_to_res(
&mut self,
hir_id: HirId,
res: Res
) -> Option<CanonicalUserType<'tcx>>[src]
&mut self,
hir_id: HirId,
res: Res
) -> Option<CanonicalUserType<'tcx>>
fn method_callee(
&mut self,
expr: &Expr<'_>,
span: Span,
overloaded_callee: Option<(DefId, SubstsRef<'tcx>)>
) -> Expr<'thir, 'tcx>[src]
&mut self,
expr: &Expr<'_>,
span: Span,
overloaded_callee: Option<(DefId, SubstsRef<'tcx>)>
) -> Expr<'thir, 'tcx>
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]
&mut self,
expr: &'tcx Expr<'tcx>,
res: Res
) -> ExprKind<'thir, 'tcx>
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]
&mut self,
expr: &'tcx Expr<'tcx>,
args: &'thir [Expr<'thir, 'tcx>]
) -> ExprKind<'thir, 'tcx>
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]
&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>
fn convert_captured_hir_place(
&mut self,
closure_expr: &'tcx Expr<'tcx>,
place: HirPlace<'tcx>
) -> Expr<'thir, 'tcx>[src]
&mut self,
closure_expr: &'tcx Expr<'tcx>,
place: HirPlace<'tcx>
) -> Expr<'thir, 'tcx>
fn capture_upvar(
&mut self,
closure_expr: &'tcx Expr<'tcx>,
captured_place: &'tcx CapturedPlace<'tcx>,
upvar_ty: Ty<'tcx>
) -> Expr<'thir, 'tcx>[src]
&mut self,
closure_expr: &'tcx Expr<'tcx>,
captured_place: &'tcx CapturedPlace<'tcx>,
upvar_ty: Ty<'tcx>
) -> Expr<'thir, 'tcx>
fn field_refs(
&mut self,
fields: &'tcx [ExprField<'tcx>]
) -> &'thir [FieldExpr<'thir, 'tcx>][src]
&mut self,
fields: &'tcx [ExprField<'tcx>]
) -> &'thir [FieldExpr<'thir, 'tcx>]
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]
tcx: TyCtxt<'tcx>,
def: WithOptConstParam<LocalDefId>,
arena: &'thir Arena<'thir, 'tcx>
) -> Cx<'thir, 'tcx>
pub(crate) fn const_eval_literal(
&mut self,
lit: &'tcx LitKind,
ty: Ty<'tcx>,
sp: Span,
neg: bool
) -> &'tcx Const<'tcx>[src]
&mut self,
lit: &'tcx LitKind,
ty: Ty<'tcx>,
sp: Span,
neg: bool
) -> &'tcx Const<'tcx>
pub(crate) fn pattern_from_hir(&mut self, p: &Pat<'_>) -> Pat<'tcx>[src]
Trait Implementations
impl<'tcx> UserAnnotatedTyHelpers<'tcx> for Cx<'_, 'tcx>[src]
fn tcx(&self) -> TyCtxt<'tcx>[src]
fn typeck_results(&self) -> &TypeckResults<'tcx>[src]
fn user_substs_applied_to_ty_of_hir_id(
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>[src]
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>
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,
'tcx: 'thir,
impl<'thir, 'tcx> !UnwindSafe for Cx<'thir, 'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,