struct Cx<'tcx> {
tcx: TyCtxt<'tcx>,
thir: Thir<'tcx>,
pub(crate) param_env: ParamEnv<'tcx>,
pub(crate) region_scope_tree: &'tcx ScopeTree,
pub(crate) typeck_results: &'tcx TypeckResults<'tcx>,
pub(crate) rvalue_scopes: &'tcx RvalueScopes,
adjustment_span: Option<(HirId, Span)>,
body_owner: DefId,
}
Fields
tcx: TyCtxt<'tcx>
thir: Thir<'tcx>
param_env: ParamEnv<'tcx>
region_scope_tree: &'tcx ScopeTree
typeck_results: &'tcx TypeckResults<'tcx>
rvalue_scopes: &'tcx RvalueScopes
adjustment_span: Option<(HirId, Span)>
When applying adjustments to the expression
with the given HirId
, use the given Span
,
instead of the usual span. This is used to
assign the span of an overall method call
(e.g. my_val.foo()
) to the adjustment expressions
for the receiver.
body_owner: DefId
The DefId
of the owner of this body.
Implementations
sourceimpl<'tcx> Cx<'tcx>
impl<'tcx> Cx<'tcx>
pub(crate) fn mirror_block(&mut self, block: &'tcx Block<'tcx>) -> Block
fn mirror_stmts(
&mut self,
block_id: ItemLocalId,
stmts: &'tcx [Stmt<'tcx>]
) -> Box<[StmtId]>
sourceimpl<'tcx> Cx<'tcx>
impl<'tcx> Cx<'tcx>
pub(crate) fn mirror_expr(&mut self, expr: &'tcx Expr<'tcx>) -> ExprId
pub(crate) fn mirror_exprs(
&mut self,
exprs: &'tcx [Expr<'tcx>]
) -> Box<[ExprId]>
pub(super) fn mirror_expr_inner(&mut self, hir_expr: &'tcx Expr<'tcx>) -> ExprId
fn apply_adjustment(
&mut self,
hir_expr: &'tcx Expr<'tcx>,
expr: Expr<'tcx>,
adjustment: &Adjustment<'tcx>,
span: Span
) -> Expr<'tcx>
fn make_mirror_unadjusted(&mut self, expr: &'tcx Expr<'tcx>) -> Expr<'tcx>
fn user_substs_applied_to_res(
&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<'tcx>
fn convert_arm(&mut self, arm: &'tcx Arm<'tcx>) -> ArmId
fn convert_path_expr(
&mut self,
expr: &'tcx Expr<'tcx>,
res: Res
) -> ExprKind<'tcx>
fn convert_var(&mut self, var_hir_id: HirId) -> ExprKind<'tcx>
fn overloaded_operator(
&mut self,
expr: &'tcx Expr<'tcx>,
args: Box<[ExprId]>
) -> ExprKind<'tcx>
fn overloaded_place(
&mut self,
expr: &'tcx Expr<'tcx>,
place_ty: Ty<'tcx>,
overloaded_callee: Option<(DefId, SubstsRef<'tcx>)>,
args: Box<[ExprId]>,
span: Span
) -> ExprKind<'tcx>
fn convert_captured_hir_place(
&mut self,
closure_expr: &'tcx Expr<'tcx>,
place: HirPlace<'tcx>
) -> Expr<'tcx>
fn capture_upvar(
&mut self,
closure_expr: &'tcx Expr<'tcx>,
captured_place: &'tcx CapturedPlace<'tcx>,
upvar_ty: Ty<'tcx>
) -> Expr<'tcx>
sourceimpl<'tcx> Cx<'tcx>
impl<'tcx> Cx<'tcx>
fn new(tcx: TyCtxt<'tcx>, def: WithOptConstParam<LocalDefId>) -> Cx<'tcx>
pub(crate) fn const_eval_literal(
&mut self,
lit: &'tcx LitKind,
ty: Ty<'tcx>,
sp: Span,
neg: bool
) -> ConstantKind<'tcx>
pub(crate) fn pattern_from_hir(&mut self, p: &Pat<'_>) -> Pat<'tcx>
Trait Implementations
sourceimpl<'tcx> UserAnnotatedTyHelpers<'tcx> for Cx<'tcx>
impl<'tcx> UserAnnotatedTyHelpers<'tcx> for Cx<'tcx>
fn tcx(&self) -> TyCtxt<'tcx>
fn typeck_results(&self) -> &TypeckResults<'tcx>
sourcefn user_substs_applied_to_ty_of_hir_id(
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>
fn user_substs_applied_to_ty_of_hir_id(
&self,
hir_id: HirId
) -> Option<CanonicalUserType<'tcx>>
Looks up the type associated with this hir-id and applies the user-given substitutions; the hir-id must map to a suitable type. Read more
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for Cx<'tcx>
impl<'tcx> !Send for Cx<'tcx>
impl<'tcx> !Sync for Cx<'tcx>
impl<'tcx> Unpin for Cx<'tcx>
impl<'tcx> !UnwindSafe for Cx<'tcx>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T> Captures<'a> for T where
T: ?Sized,
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 136 bytes