struct ThirBuildCx<'tcx> {
tcx: TyCtxt<'tcx>,
thir: Thir<'tcx>,
typing_env: TypingEnv<'tcx>,
region_scope_tree: &'tcx ScopeTree,
typeck_results: &'tcx TypeckResults<'tcx>,
rvalue_scopes: &'tcx RvalueScopes,
apply_adjustments: bool,
body_owner: DefId,
}
Expand description
Context for lowering HIR to THIR for a single function body (or other kind of body).
Fields§
§tcx: TyCtxt<'tcx>
§thir: Thir<'tcx>
The THIR data that this context is building.
typing_env: TypingEnv<'tcx>
§region_scope_tree: &'tcx ScopeTree
§typeck_results: &'tcx TypeckResults<'tcx>
§rvalue_scopes: &'tcx RvalueScopes
§apply_adjustments: bool
False to indicate that adjustments should not be applied. Only used for custom_mir
body_owner: DefId
The DefId
of the owner of this body.
Implementations§
Source§impl<'tcx> ThirBuildCx<'tcx>
impl<'tcx> ThirBuildCx<'tcx>
pub(crate) fn mirror_block(&mut self, block: &'tcx Block<'tcx>) -> BlockId
fn mirror_stmts( &mut self, block_id: ItemLocalId, stmts: &'tcx [Stmt<'tcx>], ) -> Box<[StmtId]>
Source§impl<'tcx> ThirBuildCx<'tcx>
impl<'tcx> ThirBuildCx<'tcx>
Sourcepub(crate) fn mirror_expr(&mut self, expr: &'tcx Expr<'tcx>) -> ExprId
pub(crate) fn mirror_expr(&mut self, expr: &'tcx Expr<'tcx>) -> ExprId
Create a THIR expression for the given HIR expression. This expands all
adjustments and directly adds the type information from the
typeck_results
. See the dev-guide for more details.
(The term “mirror” in this case does not refer to “flipped” or “reversed”.)
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>
Sourcefn mirror_expr_cast(
&mut self,
source: &'tcx Expr<'tcx>,
temp_lifetime: TempLifetime,
span: Span,
) -> ExprKind<'tcx>
fn mirror_expr_cast( &mut self, source: &'tcx Expr<'tcx>, temp_lifetime: TempLifetime, span: Span, ) -> ExprKind<'tcx>
Lowers a cast expression.
Dealing with user type annotations is left to the caller.
fn make_mirror_unadjusted(&mut self, expr: &'tcx Expr<'tcx>) -> Expr<'tcx>
fn user_args_applied_to_res( &mut self, hir_id: HirId, res: Res, ) -> Option<Box<CanonicalUserType<'tcx>>>
fn method_callee( &mut self, expr: &Expr<'_>, span: Span, overloaded_callee: Option<Ty<'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<Ty<'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>
Sourcefn field_refs(&mut self, fields: &'tcx [ExprField<'tcx>]) -> Box<[FieldExpr]>
fn field_refs(&mut self, fields: &'tcx [ExprField<'tcx>]) -> Box<[FieldExpr]>
Converts a list of named fields (i.e., for struct-like struct/enum ADTs) into FieldExpr.
Source§impl<'tcx> ThirBuildCx<'tcx>
impl<'tcx> ThirBuildCx<'tcx>
fn new(tcx: TyCtxt<'tcx>, def: LocalDefId) -> Self
fn pattern_from_hir(&mut self, p: &'tcx Pat<'tcx>) -> Box<Pat<'tcx>>
fn closure_env_param( &self, owner_def: LocalDefId, expr_id: HirId, ) -> Option<Param<'tcx>>
fn explicit_params<'a>( &'a mut self, owner_id: HirId, fn_decl: &'tcx FnDecl<'tcx>, body: &'tcx Body<'tcx>, ) -> impl Iterator<Item = Param<'tcx>> + 'a
fn user_args_applied_to_ty_of_hir_id( &self, hir_id: HirId, ) -> Option<CanonicalUserType<'tcx>>
Auto Trait Implementations§
impl<'tcx> DynSend for ThirBuildCx<'tcx>
impl<'tcx> DynSync for ThirBuildCx<'tcx>
impl<'tcx> Freeze for ThirBuildCx<'tcx>
impl<'tcx> !RefUnwindSafe for ThirBuildCx<'tcx>
impl<'tcx> !Send for ThirBuildCx<'tcx>
impl<'tcx> !Sync for ThirBuildCx<'tcx>
impl<'tcx> Unpin for ThirBuildCx<'tcx>
impl<'tcx> !UnwindSafe for ThirBuildCx<'tcx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
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: 208 bytes