Struct FluxItemCtxt

Source
struct FluxItemCtxt<'genv, 'tcx> {
    genv: GlobalEnv<'genv, 'tcx>,
    resolver_output: &'genv ResolverOutput,
    local_id_gen: IndexGen<ItemLocalId>,
    owner: FluxLocalDefId,
    errors: Errors<'genv>,
}

Fields§

§genv: GlobalEnv<'genv, 'tcx>§resolver_output: &'genv ResolverOutput§local_id_gen: IndexGen<ItemLocalId>§owner: FluxLocalDefId§errors: Errors<'genv>

Implementations§

Source§

impl<'genv, 'tcx> FluxItemCtxt<'genv, 'tcx>

Source

fn with<T>( genv: GlobalEnv<'genv, 'tcx>, resolver_output: &'genv ResolverOutput, owner: FluxLocalDefId, f: impl FnOnce(&mut Self) -> T, ) -> Result<T, ErrorGuaranteed>

Trait Implementations§

Source§

impl<'genv, 'tcx> DesugarCtxt<'genv, 'tcx> for FluxItemCtxt<'genv, 'tcx>

Source§

fn next_fhir_id(&self) -> FhirId

Source§

fn genv(&self) -> GlobalEnv<'genv, 'tcx>

Source§

fn resolver_output(&self) -> &'genv ResolverOutput

Source§

fn desugar_impl_trait(&mut self, _: NodeId, _: &[TraitRef]) -> TyKind<'genv>

Source§

fn resolve_implicit_param( &self, node_id: NodeId, ) -> Option<(ParamId, ParamKind)>

Source§

fn desugar_epath(&self, path: &ExprPath) -> PathExpr<'genv>

Source§

fn desugar_loc( &self, ident: Ident, node_id: NodeId, ) -> Result<ExprRes, ErrorGuaranteed>

Source§

fn resolve_param(&self, node_id: NodeId) -> (ParamId, ParamKind)

Source§

fn resolve_implicit_params( &self, scope: NodeId, ) -> impl ExactSizeIterator<Item = (Ident, ParamId, ParamKind)>

Source§

fn implicit_params_to_params( &self, scope: NodeId, ) -> impl ExactSizeIterator<Item = RefineParam<'genv>>

Source§

fn desugar_refine_params( &mut self, params: &[RefineParam], ) -> &'genv [RefineParam<'genv>]

Source§

fn desugar_refine_params_iter( &mut self, params: &[RefineParam], ) -> impl ExactSizeIterator<Item = RefineParam<'genv>>

Source§

fn desugar_refine_param(&mut self, param: &RefineParam) -> RefineParam<'genv>

Source§

fn desugar_sort( &mut self, sort: &Sort, generic_id_to_var_idx: Option<&FxIndexSet<DefId>>, ) -> Sort<'genv>

Source§

fn desugar_base_sort( &mut self, sort: &BaseSort, generic_id_to_var_idx: Option<&FxIndexSet<DefId>>, ) -> Sort<'genv>

Source§

fn desugar_generic_args( &mut self, res: Res, args: &[GenericArg], ) -> (&'genv [GenericArg<'genv>], &'genv [AssocItemConstraint<'genv>])

Source§

fn desugar_ty(&mut self, ty: &Ty) -> Ty<'genv>

This is the mega desugaring function surface::Ty -> fhir::Ty. These are both similar representations. The most important difference is that fhir::Ty has explicit refinement parameters and surface::Ty does not. Refinements are implicitly scoped in surface.
Source§

fn desugar_const_arg(const_arg: &ConstArg) -> ConstArg

Source§

fn desugar_bty(&mut self, bty: &BaseTy) -> BaseTy<'genv>

Source§

fn desugar_path_to_bty( &mut self, qself: Option<&Ty>, path: &Path, ) -> BaseTy<'genv>

Source§

fn desugar_qpath(&mut self, qself: Option<&Ty>, path: &Path) -> QPath<'genv>

Source§

fn desugar_path_segment(&mut self, segment: &PathSegment) -> PathSegment<'genv>

Source§

fn ty_path(&self, qpath: QPath<'genv>) -> Ty<'genv>

Source§

fn mk_lft_hole(&self) -> Lifetime

Source§

fn desugar_indices(&mut self, idxs: &Indices) -> Expr<'genv>

Source§

fn desugar_refine_arg(&mut self, arg: &RefineArg) -> Expr<'genv>

Source§

fn implicit_param_into_refine_arg( &self, ident: Ident, node_id: NodeId, ) -> Option<Expr<'genv>>

Source§

fn desugar_expr(&mut self, expr: &Expr) -> Expr<'genv>

Source§

fn desugar_call(&mut self, callee: &Expr, args: &[Expr]) -> ExprKind<'genv>

Source§

fn desugar_constructor( &mut self, path: Option<&ExprPath>, args: &[ConstructorArg], ) -> ExprKind<'genv>

Source§

fn desugar_exprs(&mut self, exprs: &[Expr]) -> &'genv [Expr<'genv>]

Source§

fn try_parse_int_lit( &self, span: Span, s: &str, ) -> Result<u128, ErrorGuaranteed>

Source§

fn desugar_lit(&self, span: Span, lit: Lit) -> ExprKind<'genv>

Desugar surface literal
Source§

impl ErrorCollector<ErrorGuaranteed> for FluxItemCtxt<'_, '_>

Source§

impl ErrorEmitter for FluxItemCtxt<'_, '_>

Source§

fn emit<'a>(&'a self, err: impl Diagnostic<'a>) -> ErrorGuaranteed

Auto Trait Implementations§

§

impl<'genv, 'tcx> !Freeze for FluxItemCtxt<'genv, 'tcx>

§

impl<'genv, 'tcx> !RefUnwindSafe for FluxItemCtxt<'genv, 'tcx>

§

impl<'genv, 'tcx> !Send for FluxItemCtxt<'genv, 'tcx>

§

impl<'genv, 'tcx> !Sync for FluxItemCtxt<'genv, 'tcx>

§

impl<'genv, 'tcx> Unpin for FluxItemCtxt<'genv, 'tcx>

§

impl<'genv, 'tcx> !UnwindSafe for FluxItemCtxt<'genv, 'tcx>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.