Enum rustc::middle::resolve_lifetime::Scope [−][src]
enum Scope<'a> { Binder { lifetimes: FxHashMap<LifetimeName, Region>, next_early_index: u32, abstract_type_parent: bool, s: &'a Scope<'a>, }, Body { id: BodyId, s: &'a Scope<'a>, }, Elision { elide: Elide, s: &'a Scope<'a>, }, ObjectLifetimeDefault { lifetime: Option<Region>, s: &'a Scope<'a>, }, Root, }
🔬 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?
Variants
Binder
🔬 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?
Declares lifetimes, and each can be early-bound or late-bound.
The DebruijnIndex
of late-bound lifetimes starts at 1
and
it should be shifted by the number of Binder
s in between the
declaration Binder
and the location it's referenced from.
Fields of Binder
lifetimes: FxHashMap<LifetimeName, Region> | 🔬 This is a nightly-only experimental API. ( |
next_early_index: u32 | 🔬 This is a nightly-only experimental API. ( |
abstract_type_parent: bool | 🔬 This is a nightly-only experimental API. ( |
s: &'a Scope<'a> | 🔬 This is a nightly-only experimental API. ( |
Body
🔬 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?
Lifetimes introduced by a fn are scoped to the call-site for that fn,
if this is a fn body, otherwise the original definitions are used.
Unspecified lifetimes are inferred, unless an elision scope is nested,
e.g. (&T, fn(&T) -> &T);
becomes (&'_ T, for<'a> fn(&'a T) -> &'a T)
.
Fields of Body
id: BodyId | 🔬 This is a nightly-only experimental API. ( |
s: &'a Scope<'a> | 🔬 This is a nightly-only experimental API. ( |
Elision
🔬 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?
A scope which either determines unspecified lifetimes or errors
on them (e.g. due to ambiguity). For more details, see Elide
.
Fields of Elision
elide: Elide | 🔬 This is a nightly-only experimental API. ( |
s: &'a Scope<'a> | 🔬 This is a nightly-only experimental API. ( |
ObjectLifetimeDefault
🔬 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?
Use a specific lifetime (if Some
) or leave it unset (to be
inferred in a function body or potentially error outside one),
for the default choice of lifetime in a trait object type.
Fields of ObjectLifetimeDefault
lifetime: Option<Region> | 🔬 This is a nightly-only experimental API. ( |
s: &'a Scope<'a> | 🔬 This is a nightly-only experimental API. ( |
Root
🔬 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?