Module wfcheck

Source

Structs§

CollectUsageSpans 🔒
Collect usages of the param_def_id and Res::SelfTyAlias in the HIR.
GATArgsCollector 🔒
TypeVisitor that looks for uses of GATs like <P0 as Trait<P1..Pn>>::GAT<Pn..Pm> and adds the arguments P0..Pm into the two vectors, regions and types (depending on their kind). For each parameter Pi also track the index i.
HasErrorDeep 🔒
Look for ErrorGuaranteed deeply within structs’ (unsubstituted) fields.
IsProbablyCyclical 🔒
Detects cases where an ADT/LTA is trivially cyclical – we want to detect this so we only mention that its parameters are used cyclically if the ADT/LTA is truly cyclical.
RedundantLifetimeArgsLint 🔒
WfCheckingCtxt 🔒

Enums§

ArbitrarySelfTypesLevel 🔒
The arbitrary_self_types_pointers feature implies arbitrary_self_types.
ReceiverValidityError 🔒
Error cases which may be returned from receiver_is_valid. These error cases are generated in this function as they may be unearthed as we explore the autoderef chain, but they’re converted to diagnostics in the caller.
UnsizedHandling 🔒

Functions§

augment_param_env 🔒
Add a new set of predicates to the caller_bounds of an existing param_env.
check_associated_item 🔒
check_associated_type_bounds 🔒
Checks all associated type defaults of trait trait_def_id.
check_dyn_incompatible_self_trait_by_name 🔒
Detect when a dyn-incompatible trait is referring to itself in one of its associated items.
check_fn_or_method 🔒
check_foreign_item 🔒
check_gat_where_clauses 🔒
Require that the user writes where clauses on GATs for the implicit outlives bounds involving trait parameters in trait functions and lifetimes passed as GAT args. See self-outlives-lint test.
check_impl 🔒
check_impl_item 🔒
check_item 🔒
Checks that the field types (in a struct def’n) or argument types (in an enum def’n) are well-formed, meaning that they do not require any constraints not declared in the struct definition itself. For example, this definition would be illegal:
check_item_fn 🔒
check_item_type 🔒
check_method_receiver 🔒
check_mod_type_wf 🔒
check_param_wf 🔒
check_trait 🔒
check_trait_item 🔒
check_type_defn 🔒
In a type definition, we check that to ensure that the types of the fields are well-formed.
check_variances_for_type_defn 🔒
check_well_formed 🔒
check_where_clauses 🔒
Checks where-clauses and inline bounds that are declared on def_id.
confirm_type_is_not_a_method_generic_param 🔒
Confirms that a type is not a type parameter referring to one of the method’s type params.
could_be_self 🔒
enter_wf_checking_ctxt 🔒
gather_gat_bounds 🔒
We use the following trait as an example throughout this function. Specifically, let’s assume that to_check here is the return type of into_iter, and the GAT we are checking this for is Iter.
legacy_receiver_is_implemented 🔒
lint_item_shadowing_supertrait_item 🔒
lint_redundant_lifetimes 🔒
provide
receiver_is_valid 🔒
Returns whether receiver_ty would be considered a valid receiver type for self_ty. If arbitrary_self_types is enabled, receiver_ty must transitively deref to self_ty, possibly through a *const/mut T raw pointer if arbitrary_self_types_pointers is also enabled. If neither feature is enabled, the requirements are more strict: receiver_ty must implement Receiver and directly implement Deref<Target = self_ty>.
region_known_to_outlive 🔒
Given a known param_env and a set of well formed types, can we prove that region_a outlives region_b
report_bivariance 🔒
test_region_obligations 🔒
Given a known param_env and a set of well formed types, set up an InferCtxt, call the passed function (to e.g. set up region constraints to be tested), then resolve region and return errors
ty_known_to_outlive 🔒
Given a known param_env and a set of well formed types, can we prove that ty outlives region.