Module rustc::ty::wf [] [src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Functions

object_region_bounds [
Experimental
]

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 of SomeTrait, Send, and friends -- if they declare trait SomeTrait : 'static, for example, then 'static would appear in the list. The hard work is done by ty::required_region_bounds, see that for more information.

obligations [
Experimental
]

Returns the set of obligations needed to make ty well-formed. If ty contains unresolved inference variables, this may include further WF obligations. However, if ty IS an unresolved inference variable, returns None, because we are not able to make any progress at all. This is to prevent "livelock" where we say "$0 is WF if $0 is WF".

predicate_obligations [
Experimental
]
trait_obligations [
Experimental
]

Returns the obligations that make this trait reference well-formed. For example, if there is a trait Set defined like trait Set<K:Eq>, then the trait reference Foo: Set<Bar> is WF if Bar: Eq.