Skip to content

Commit 37f42cb

Browse files
committed
Update query description.
1 parent 0922f41 commit 37f42cb

File tree

1 file changed

+9
-6
lines changed
  • compiler/rustc_middle/src/query

1 file changed

+9
-6
lines changed

compiler/rustc_middle/src/query/mod.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -1591,13 +1591,16 @@ rustc_queries! {
15911591
/// for each parameter if a trait object were to be passed for that parameter.
15921592
/// For example, for `struct Foo<'a, T, U>`, this would be `['static, 'static]`.
15931593
/// For `struct Foo<'a, T: 'a, U>`, this would instead be `['a, 'static]`.
1594-
query object_lifetime_defaults(_: LocalDefId) -> Option<&'tcx [ObjectLifetimeDefault]> {
1595-
desc { "looking up lifetime defaults for a region on an item" }
1596-
}
1597-
/// Fetch the lifetimes for all the trait objects in an item-like.
1598-
query object_lifetime_map(_: LocalDefId) -> FxHashMap<ItemLocalId, Region> {
1594+
query object_lifetime_defaults(def_id: LocalDefId) -> Option<&'tcx [ObjectLifetimeDefault]> {
1595+
desc { "computing object lifetime defaults for `{:?}`'s generic parameters", def_id }
1596+
}
1597+
/// Fetch the lifetimes for all the trait objects in an item-like. This query uses
1598+
/// `object_lifetime_defaults` which returns a map `GenericParam -> ObjectLifetimeDefault`,
1599+
/// and build a map from each `dyn Trait` type to the implicit lifetime `'a`, so that
1600+
/// `dyn Trait` should be understood as `dyn Trait + 'a`
1601+
query object_lifetime_map(def_id: LocalDefId) -> FxHashMap<ItemLocalId, Region> {
15991602
storage(ArenaCacheSelector<'tcx>)
1600-
desc { "looking up lifetime defaults for a region on an item" }
1603+
desc { "looking up lifetime for trait-object types inside `{:?}`", def_id }
16011604
}
16021605
query late_bound_vars_map(_: LocalDefId)
16031606
-> Option<&'tcx FxHashMap<ItemLocalId, Vec<ty::BoundVariableKind>>> {

0 commit comments

Comments
 (0)