flux_fhir_analysis::wf::param_usage

Struct ParamUsesChecker

Source
struct ParamUsesChecker<'a, 'genv, 'tcx> {
    infcx: &'a InferCtxt<'genv, 'tcx>,
    xi: SnapshotMap<ParamId, ()>,
    errors: Errors<'genv>,
}

Fields§

§infcx: &'a InferCtxt<'genv, 'tcx>§xi: SnapshotMap<ParamId, ()>

Keeps track of all refinement parameters that are used as an index such that their value is fully determined. The name xi is taken from 1, where the well-formedness judgment uses an uppercase Xi (Ξ) for a context that is similar in purpose.

This is basically a set of fhir::ParamId implemented with a snapshot map such that elements can be removed in batch when there’s a change in polarity.

§errors: Errors<'genv>

Implementations§

Source§

impl<'a, 'genv, 'tcx> ParamUsesChecker<'a, 'genv, 'tcx>

Source

fn new(infcx: &'a InferCtxt<'genv, 'tcx>) -> Self

Source

fn run(self, f: impl FnOnce(&mut Self)) -> Result<(), ErrorGuaranteed>

Source

fn check_func_params_uses( &mut self, expr: &Expr<'_>, is_top_level_conj: bool, is_top_level_var: bool, )

Checks that refinement parameters of function sort are used in allowed positions.

Source

fn check_params_are_value_determined(&mut self, params: &[RefineParam<'_>])

Trait Implementations§

Source§

impl<'genv> Visitor<'genv> for ParamUsesChecker<'_, 'genv, '_>

Source§

fn visit_node(&mut self, node: &OwnerNode<'genv>)

Source§

fn visit_ty_alias(&mut self, ty_alias: &TyAlias<'genv>)

Source§

fn visit_struct_def(&mut self, struct_def: &StructDef<'genv>)

Source§

fn visit_variant(&mut self, variant: &VariantDef<'genv>)

Source§

fn visit_variant_ret(&mut self, ret: &VariantRet<'genv>)

Source§

fn visit_fn_output(&mut self, output: &FnOutput<'genv>)

Source§

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

Source§

fn visit_expr(&mut self, expr: &Expr<'_>)

Source§

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

Source§

fn visit_item(&mut self, item: &Item<'v>)

Source§

fn visit_trait_item(&mut self, trait_item: &TraitItem<'v>)

Source§

fn visit_impl_item(&mut self, impl_item: &ImplItem<'v>)

Source§

fn visit_generics(&mut self, generics: &Generics<'v>)

Source§

fn visit_where_predicate(&mut self, predicate: &WhereBoundPredicate<'v>)

Source§

fn visit_impl(&mut self, impl_: &Impl<'v>)

Source§

fn visit_impl_assoc_reft(&mut self, assoc_reft: &ImplAssocReft<'v>)

Source§

fn visit_trait_assoc_reft(&mut self, assoc_reft: &TraitAssocReft<'v>)

Source§

fn visit_enum_def(&mut self, enum_def: &EnumDef<'v>)

Source§

fn visit_field_def(&mut self, field: &FieldDef<'v>)

Source§

fn visit_opaque_ty(&mut self, opaque_ty: &OpaqueTy<'v>)

Source§

fn visit_generic_bound(&mut self, bound: &GenericBound<'v>)

Source§

fn visit_poly_trait_ref(&mut self, trait_ref: &PolyTraitRef<'v>)

Source§

fn visit_fn_sig(&mut self, sig: &FnSig<'v>)

Source§

fn visit_fn_decl(&mut self, decl: &FnDecl<'v>)

Source§

fn visit_refine_param(&mut self, param: &RefineParam<'v>)

Source§

fn visit_requires(&mut self, requires: &Requires<'v>)

Source§

fn visit_ensures(&mut self, ensures: &Ensures<'v>)

Source§

fn visit_generic_arg(&mut self, arg: &GenericArg<'v>)

Source§

fn visit_lifetime(&mut self, _lft: &Lifetime)

Source§

fn visit_bty(&mut self, bty: &BaseTy<'v>)

Source§

fn visit_qpath(&mut self, qpath: &QPath<'v>)

Source§

fn visit_path(&mut self, path: &Path<'v>)

Source§

fn visit_assoc_item_constraint(&mut self, constraint: &AssocItemConstraint<'v>)

Source§

fn visit_sort(&mut self, sort: &Sort<'v>)

Source§

fn visit_sort_path(&mut self, path: &SortPath<'v>)

Source§

fn visit_poly_func_sort(&mut self, func: &PolyFuncSort<'v>)

Source§

fn visit_func_sort(&mut self, func: &FuncSort<'v>)

Source§

fn visit_field_expr(&mut self, expr: &FieldExpr<'v>)

Source§

fn visit_alias_reft(&mut self, alias_reft: &AliasReft<'v>)

Source§

fn visit_literal(&mut self, _lit: &Lit)

Source§

fn visit_path_expr(&mut self, _path: &PathExpr<'v>)

Auto Trait Implementations§

§

impl<'a, 'genv, 'tcx> !Freeze for ParamUsesChecker<'a, 'genv, 'tcx>

§

impl<'a, 'genv, 'tcx> !RefUnwindSafe for ParamUsesChecker<'a, 'genv, 'tcx>

§

impl<'a, 'genv, 'tcx> !Send for ParamUsesChecker<'a, 'genv, 'tcx>

§

impl<'a, 'genv, 'tcx> !Sync for ParamUsesChecker<'a, 'genv, 'tcx>

§

impl<'a, 'genv, 'tcx> Unpin for ParamUsesChecker<'a, 'genv, 'tcx>

§

impl<'a, 'genv, 'tcx> !UnwindSafe for ParamUsesChecker<'a, '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.