In Salsa, there is a higher-ranked trait bound on a trait. I've seen HRTBs on function definitions but not on a trait. What does it mean?
pub trait Query: Debug + Default + Sized + for<'d> QueryDb<'d> {
...
fn query_storage<'a>(
group_storage: &'a <Self as QueryDb<'_>>::GroupStorage,
) -> &'a Arc<Self::Storage>;
}
https://github.com/salsa-rs/salsa/blob/fc6806a/src/lib.rs#L370
As in, how should I read this? Is it saying that, for any Query, there is a corresponding QueryDB that has some lifetime?
How is this different from
pub trait Query<'d>: Debug + Default + Sized + QueryDb<'d>
aside from that impls cannot specify 'd?