Expand description
“Collection” is the process of determining the type and other external details of each item in Rust. Collection is specifically concerned with inter-procedural things – for example, for a function definition, collection will figure out the type and signature of the function, but it will not visit the body of the function in any way, nor examine type annotations on local variables (that’s the job of type checking).
Collecting is ultimately defined by a bundle of queries that
inquire after various facts about the items in the crate (e.g.,
type_of
, generics_of
, predicates_of
, etc). See the provide
function
for the full set.
At present, however, we do run collection across all items in the crate as a kind of pass. This should eventually be factored away.
Modules§
- dump 🔒
- generics_
of 🔒 - item_
bounds 🔒 - predicates_
of 🔒 - resolve_
bound_ 🔒vars - Resolution of early vs late bound lifetimes.
- type_of 🔒
Structs§
- Collect
Item 🔒Types Visitor - Field
Uniqueness 🔒Check Context - HirPlaceholder
Collector 🔒 - Item
Ctxt 🔒 - Context specific to some particular item. This is what implements
HirTyLowerer
. - Nested
Span 🔒
Enums§
Functions§
- adt_def 🔒
- bad_
placeholder 🔒 - check_
impl_ 🔒constness - compute_
sig_ 🔒of_ foreign_ fn_ decl - const_
param_ 🔒default - coroutine_
for_ 🔒closure - coroutine_
kind 🔒 - early_
bound_ 🔒lifetimes_ from_ generics - Returns the early-bound lifetimes declared in this generics
listing. For anything other than fns/methods, this is just all
the lifetimes that are declared. For fns or methods, we have to
screen out those that do not appear in any where-clauses etc using
resolve_lifetime::early_bound_lifetimes
. - fn_sig 🔒
- get_
new_ 🔒lifetime_ name - Synthesize a new lifetime name that doesn’t clash with any of the lifetimes already present.
- impl_
trait_ 🔒header - lower_
enum_ 🔒variant_ types - lower_
fn_ 🔒sig_ recovering_ infer_ ret_ ty - lower_
impl_ 🔒item - lower_
item 🔒 - lower_
trait_ 🔒item - lower_
variant 🔒 - lower_
variant_ 🔒ctor - opaque_
ty_ 🔒origin - placeholder_
type_ 🔒error - If there are any placeholder types (
_
), emit an error explaining that this is not allowed and suggest adding type parameters in the appropriate place, taking into consideration any and all already existing generic type parameters to avoid suggesting a name that is already in use. - placeholder_
type_ 🔒error_ diag - polarity_
of_ 🔒impl - provide 🔒
- recover_
infer_ 🔒ret_ ty - reject_
placeholder_ 🔒type_ signatures_ in_ item - rendered_
precise_ 🔒capturing_ args - suggest_
impl_ trait - trait_
def 🔒