Skip to content

Commit

Permalink
Update query description.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Jun 14, 2022
1 parent 0922f41 commit 37f42cb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1591,13 +1591,16 @@ rustc_queries! {
/// for each parameter if a trait object were to be passed for that parameter.
/// For example, for `struct Foo<'a, T, U>`, this would be `['static, 'static]`.
/// For `struct Foo<'a, T: 'a, U>`, this would instead be `['a, 'static]`.
query object_lifetime_defaults(_: LocalDefId) -> Option<&'tcx [ObjectLifetimeDefault]> {
desc { "looking up lifetime defaults for a region on an item" }
}
/// Fetch the lifetimes for all the trait objects in an item-like.
query object_lifetime_map(_: LocalDefId) -> FxHashMap<ItemLocalId, Region> {
query object_lifetime_defaults(def_id: LocalDefId) -> Option<&'tcx [ObjectLifetimeDefault]> {
desc { "computing object lifetime defaults for `{:?}`'s generic parameters", def_id }
}
/// Fetch the lifetimes for all the trait objects in an item-like. This query uses
/// `object_lifetime_defaults` which returns a map `GenericParam -> ObjectLifetimeDefault`,
/// and build a map from each `dyn Trait` type to the implicit lifetime `'a`, so that
/// `dyn Trait` should be understood as `dyn Trait + 'a`
query object_lifetime_map(def_id: LocalDefId) -> FxHashMap<ItemLocalId, Region> {
storage(ArenaCacheSelector<'tcx>)
desc { "looking up lifetime defaults for a region on an item" }
desc { "looking up lifetime for trait-object types inside `{:?}`", def_id }
}
query late_bound_vars_map(_: LocalDefId)
-> Option<&'tcx FxHashMap<ItemLocalId, Vec<ty::BoundVariableKind>>> {
Expand Down

0 comments on commit 37f42cb

Please sign in to comment.