2021-12-01 19:00:27 +00:00
|
|
|
//@ check-pass
|
2022-09-20 01:45:00 +00:00
|
|
|
//@ compile-flags: -Znormalize-docs
|
2022-08-18 02:13:37 +00:00
|
|
|
// Regression test for <https://github.com/rust-lang/rust/issues/79459>.
|
2021-12-01 19:00:27 +00: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;
|