Module rustc_resolve::late::lifetimes[−][src]

Expand description

Name resolution for lifetimes.

Name resolution for lifetimes follows much simpler rules than the full resolve. For example, lifetime names are never exported or used between functions, and they operate in a purely top-down way. Therefore, we break lifetime name resolution into a separate pass.

Structs

ElisionFailureInfo
LifetimeContext
NamedRegionMap

Maps the id of each lifetime reference to the lifetime decl that it corresponds to.

Original
Shadower
TruncatedScopeDebug

Enums

BinderScopeType
Elide
LifetimeUseSet
Scope
ShadowKind

Constants

ROOT_SCOPE

Traits

RegionExt

Functions

check_mixed_explicit_and_in_band_defs
compute_object_lifetime_defaults
convert_named_region_map
do_resolve
extract_labels
get_lifetime_scopes_for_path
insert_late_bound_lifetimes

Detects late-bound lifetimes and inserts them into map.late_bound.

is_late_bound_map
item_for

Finds the Item that contains the given LocalDefId

late_region_as_bound_region
object_lifetime_defaults_for_item

Scan the bounds and where-clauses on parameters to extract bounds of the form T:'a so as to determine the ObjectLifetimeDefault for each type parameter.

original_label
original_lifetime
provide
resolve_lifetimes

Computes the ResolveLifetimes map that contains data for an entire Item. You should not read the result of this query directly, but rather use named_region_map, is_late_bound_map, etc.

resolve_lifetimes_for

Given any owner (structs, traits, trait methods, etc.), does lifetime resolution. There are two important things this does. First, we have to resolve lifetimes for the entire Item that contains this owner, because that’s the largest “scope” where we can have relevant lifetimes. Second, if we are asking for lifetimes in a trait definition, we use resolve_lifetimes_trait_definition instead of resolve_lifetimes, which does not descend into the trait items and does not emit diagnostics. This allows us to avoid cycles. Importantly, if we ask for lifetimes for lifetimes that have an owner other than the trait itself (like the trait methods or associated types), then we just use the regular resolve_lifetimes.

resolve_lifetimes_trait_definition

Like resolve_lifetimes, but does not resolve lifetimes for trait items. Also does not generate any diagnostics.

shadower_label
shadower_lifetime
signal_shadowing_problem
sub_items_have_self_param

In traits, there is an implicit Self type parameter which comes before the generics. We have to account for this when computing the index of the other generic parameters. This function returns whether there is such an implicit parameter defined on the given item.

Type Definitions

ScopeRef