2021-12-01 13:00:27 -06:00
|
|
|
// check-pass
|
2022-09-19 20:45:00 -05:00
|
|
|
// compile-flags: -Znormalize-docs
|
2022-08-17 21:13:37 -05:00
|
|
|
// Regression test for <https://github.com/rust-lang/rust/issues/79459>.
|
2021-12-01 13:00:27 -06:00
|
|
|
pub trait Query {}
|
|
|
|
|
|
|
|
pub trait AsQuery {
|
|
|
|
type Query;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T: Query> AsQuery for T {
|
|
|
|
type Query = T;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait SelectDsl<Selection> {
|
|
|
|
type Output;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T, Selection> SelectDsl<Selection> for T
|
|
|
|
where
|
|
|
|
T: AsQuery,
|
|
|
|
T::Query: SelectDsl<Selection>,
|
|
|
|
{
|
|
|
|
type Output = <T::Query as SelectDsl<Selection>>::Output;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type Select<Source, Selection> = <Source as SelectDsl<Selection>>::Output;
|