[−][src]Module rustc_typeck::check::wfcheck

Structs

AdtField
AdtVariant
CheckTypeWellFormedVisitor
CheckWfFcxBuilder

Helper type of a temporary returned by .for_item(...). This is necessary because we can't write the following bound:

Constants

HELP_FOR_SELF_TYPE

Functions

check_associated_item
check_associated_type_bounds

Checks all associated type defaults of trait trait_def_id.

check_false_global_bounds

Feature gates RFC 2056 -- trivial bounds, checking for global bounds that aren't true.

check_fn_or_method
check_impl
check_impl_item
check_item_fn
check_item_type
check_item_well_formed

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_method_receiver
check_object_unsafe_self_trait_by_name

Detect when an object unsafe trait is referring to itself in one of its associated items. When this is done, suggest using Self instead.

check_opaque_types

Checks "defining uses" of opaque impl Trait types to ensure that they meet the restrictions laid for "higher-order pattern unification". This ensures that inference is tractable. In particular, definitions of opaque types can only use other generics as arguments, and they cannot repeat an argument. Example:

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_where_clauses

Checks where-clauses and inline bounds that are declared on def_id.

could_be_self
e0307
error_392
for_id
for_item
item_adt_kind
receiver_is_implemented
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 the feature is not enabled, the requirements are more strict: receiver_ty must implement Receiver and directly implement Deref<Target = self_ty>.

report_bivariance