flux_fhir_analysis::conv

Struct ConvCtxt

Source
#[repr(transparent)]
pub struct ConvCtxt<P>(P);
Expand description

Wrapper over a type implementing ConvPhase. We have this to implement most functionality as inherent methods instead of defining them as default implementation in the trait definition.

Tuple Fields§

§0: P

Implementations§

Source§

impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P>

Delegate methods to P

Source

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

Source

fn tcx(&self) -> TyCtxt<'tcx>

Source

fn owner(&self) -> FluxOwnerId

Source

fn results(&self) -> &P::Results

Source

fn next_sort_vid(&mut self) -> SortVid

Source

fn next_type_vid(&mut self) -> TyVid

Source

fn next_region_vid(&mut self) -> RegionVid

Source

fn next_const_vid(&mut self) -> ConstVid

Source§

impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P>

Conversion of definitions

Source

pub(crate) fn conv_enum_variants( &mut self, enum_id: MaybeExternId, enum_def: &EnumDef<'_>, ) -> QueryResult<Vec<PolyVariant>>

Source

fn conv_enum_variant( &mut self, enum_id: MaybeExternId, variant: &VariantDef<'_>, ) -> QueryResult<PolyVariant>

Source

pub(crate) fn conv_struct_variant( &mut self, struct_id: MaybeExternId, struct_def: &StructDef<'_>, ) -> QueryResult<Opaqueness<PolyVariant>>

Source

pub(crate) fn conv_type_alias( &mut self, ty_alias_id: MaybeExternId, ty_alias: &TyAlias<'_>, ) -> QueryResult<TyCtor>

Source

pub(crate) fn conv_fn_sig( &mut self, fn_id: MaybeExternId, fn_sig: &FnSig<'_>, ) -> QueryResult<PolyFnSig>

Source

pub(crate) fn conv_generic_predicates( &mut self, def_id: MaybeExternId, generics: &Generics<'_>, ) -> QueryResult<EarlyBinder<GenericPredicates>>

Source

pub(crate) fn conv_opaque_ty( &mut self, opaque_ty: &OpaqueTy<'_>, ) -> QueryResult<Clauses>

Source

pub(crate) fn conv_assoc_reft_body( &mut self, params: &[RefineParam<'_>], body: &Expr<'_>, output: &Sort<'_>, ) -> QueryResult<Lambda>

Source§

impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P>

Conversion of sorts

Source

pub(crate) fn conv_sort(&mut self, sort: &Sort<'_>) -> QueryResult<Sort>

Source

fn conv_poly_func_sort( &mut self, sort: &PolyFuncSort<'_>, ) -> QueryResult<PolyFuncSort>

Source

fn conv_func_sort(&mut self, fsort: &FuncSort<'_>) -> QueryResult<FuncSort>

Source

fn conv_sort_path(&mut self, path: &SortPath<'_>) -> QueryResult<Sort>

Source

fn check_prim_sort_generics( &mut self, path: &SortPath<'_>, prim_sort: PrimSort, ) -> QueryResult

Source§

impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P>

Conversion of types

Source

fn conv_fn_decl( &mut self, env: &mut Env, safety: Safety, abi: Abi, decl: &FnDecl<'_>, ) -> QueryResult<FnSig>

Source

fn conv_requires( &mut self, env: &mut Env, requires: &Requires<'_>, ) -> QueryResult<Expr>

Source

fn conv_ensures( &mut self, env: &mut Env, ensures: &Ensures<'_>, ) -> QueryResult<Ensures>

Source

fn conv_fn_output( &mut self, env: &mut Env, output: &FnOutput<'_>, ) -> QueryResult<Binder<FnOutput>>

Source

fn conv_generic_bounds( &mut self, env: &mut Env, bounded_ty_span: Span, bounded_ty: Ty, bounds: GenericBounds<'_>, ) -> QueryResult<Vec<Clause>>

Source

fn conv_poly_trait_ref( &mut self, env: &mut Env, span: Span, bounded_ty: &Ty, poly_trait_ref: &PolyTraitRef<'_>, clauses: &mut Vec<Clause>, ) -> QueryResult

Converts a T: Trait<T0, ..., A0 = S0, ...> bound

Source

fn conv_assoc_item_constraint( &mut self, env: &mut Env, poly_trait_ref: &PolyTraitRef, constraint: &AssocItemConstraint<'_>, clauses: &mut Vec<Clause>, ) -> QueryResult

Source

fn trait_defines_associated_item_named( &self, trait_def_id: DefId, assoc_kind: AssocKind, assoc_name: Ident, ) -> Option<&'tcx AssocItem>

Source

fn conv_ty(&mut self, env: &mut Env, ty: &Ty<'_>) -> QueryResult<Ty>

Source

fn conv_opaque_def( &mut self, env: &mut Env, opaque_ty: &OpaqueTy<'_>, ) -> QueryResult<Ty>

Source

fn conv_trait_object( &mut self, env: &mut Env, trait_bounds: &[PolyTraitRef<'_>], lifetime: Lifetime, ) -> QueryResult<Ty>

Source

pub(crate) fn conv_bty( &mut self, env: &mut Env, bty: &BaseTy<'_>, ) -> QueryResult<TyOrCtor>

Source

fn conv_type_relative_path( &mut self, env: &mut Env, qself_span: Span, qself_res: Res, assoc_segment: &PathSegment<'_>, ) -> QueryResult<AliasTy>

Source

fn refiner(&self) -> QueryResult<Refiner<'genv, 'tcx>>

Return the generics of the containing owner item

Source

fn probe_type_param_bounds( &self, param_id: DefId, assoc_ident: Ident, ) -> EarlyBinder<'tcx, &'tcx [(Clause<'tcx>, Span)]>

Source

fn probe_single_bound_for_assoc_item<I>( &self, all_candidates: impl Fn() -> I, assoc_ident: Ident, ) -> Result<PolyTraitRef<'tcx>, ErrorGuaranteed>
where I: Iterator<Item = PolyTraitRef<'tcx>>,

Source

fn conv_lifetime(&mut self, env: &Env, lft: Lifetime) -> Region

Source

fn conv_resolved_lifetime(&mut self, env: &Env, res: ResolvedArg) -> Region

Source

fn conv_const_arg(&mut self, cst: ConstArg) -> Const

Source

fn conv_qpath( &mut self, env: &mut Env, qself: Option<&Ty<'_>>, path: &Path<'_>, ) -> QueryResult<TyOrCtor>

Source

fn param_as_bound_var( &mut self, param: &GenericParam<'_>, ) -> QueryResult<BoundVariableKind>

Source

fn conv_generic_args( &mut self, env: &mut Env, def_id: DefId, segment: &PathSegment<'_>, ) -> QueryResult<Vec<GenericArg>>

Source

fn conv_generic_args_into( &mut self, env: &mut Env, def_id: DefId, segment: &PathSegment<'_>, into: &mut Vec<GenericArg>, ) -> QueryResult

Source

fn check_generic_arg_count( &mut self, generics: &Generics, def_id: DefId, segment: &PathSegment<'_>, ) -> QueryResult

Source

fn fill_generic_args_defaults( &mut self, def_id: DefId, into: &mut Vec<GenericArg>, ) -> QueryResult

Source

fn conv_ty_to_generic_arg( &mut self, env: &mut Env, param: &GenericParamDef, ty: &Ty<'_>, ) -> QueryResult<GenericArg>

Source

fn try_to_ty_or_base( &mut self, kind: GenericParamDefKind, span: Span, ty: &Ty, ) -> QueryResult<TyOrBase>

Source

fn ty_to_subset_ty_ctor( &mut self, span: Span, ty: &Ty, ) -> QueryResult<SubsetTyCtor>

Source

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

Source§

impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P>

Conversion of expressions

Source

fn conv_expr(&mut self, env: &mut Env, expr: &Expr<'_>) -> QueryResult<Expr>

Source

fn conv_constructor_exprs( &mut self, struct_def_id: DefId, env: &mut Env, exprs: &[FieldExpr<'_>], spread: &Option<&Spread<'_>>, ) -> QueryResult<List<Expr>>

Source

fn conv_exprs( &mut self, env: &mut Env, exprs: &[Expr<'_>], ) -> QueryResult<List<Expr>>

Source

fn conv_bin_op(&self, op: BinOp, fhir_id: FhirId) -> BinOp

Source

fn add_coercions(&self, expr: Expr, fhir_id: FhirId) -> Expr

Source

fn conv_func(&self, env: &Env, func: &PathExpr<'_>) -> Expr

Source

fn conv_alias_reft( &mut self, env: &mut Env, fhir_id: FhirId, alias: &AliasReft<'_>, ) -> QueryResult<AliasReft>

Source

fn conv_invariants( &mut self, env: &mut Env, invariants: &[Expr<'_>], ) -> QueryResult<Vec<Invariant>>

Source

fn conv_invariant( &mut self, env: &mut Env, invariant: &Expr<'_>, ) -> QueryResult<Invariant>

Auto Trait Implementations§

§

impl<P> Freeze for ConvCtxt<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for ConvCtxt<P>
where P: RefUnwindSafe,

§

impl<P> Send for ConvCtxt<P>
where P: Send,

§

impl<P> Sync for ConvCtxt<P>
where P: Sync,

§

impl<P> Unpin for ConvCtxt<P>
where P: Unpin,

§

impl<P> UnwindSafe for ConvCtxt<P>
where P: UnwindSafe,

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.