Expand description
Core logic responsible for determining what it means for various type system primitives to be “well formed”. Actually checking whether these primitives are well formed is performed elsewhere (e.g. during type checking or item well formedness checking).
Structs§
Enums§
- Elaborate 🔒
- Controls whether we “elaborate” supertraits and so forth on the WF predicates. This is a kind of hack to address #43784. The underlying problem in that issue was a trait structure like:
Functions§
- clause_
obligations - Returns the requirements for
clause
to be well-formed. - extend_
cause_ 🔒with_ original_ assoc_ item_ obligation - Points the cause span of a super predicate at the relevant associated type.
- object_
region_ bounds - Given an object type like
SomeTrait + Send
, computes the lifetime bounds that must hold on the elided self type. These are derived from the declarations ofSomeTrait
,Send
, and friends – if they declaretrait SomeTrait : 'static
, for example, then'static
would appear in the list. - obligations
- Returns the set of obligations needed to make
arg
well-formed. Ifarg
contains unresolved inference variables, this may include further WF obligations. However, ifarg
IS an unresolved inference variable, returnsNone
, because we are not able to make any progress at all. This is to prevent cycles where we say “?0 is WF if ?0 is WF”. - trait_
obligations - Returns the obligations that make this trait reference
well-formed. For example, if there is a trait
Set
defined liketrait Set<K: Eq>
, then the trait boundFoo: Set<Bar>
is WF ifBar: Eq
. - unnormalized_
obligations - Compute the predicates that are required for a type to be well-formed.