]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/synthetic_auto/self-referential.rs
Test drop_tracking_mir before querying generator.
[rust.git] / tests / rustdoc / synthetic_auto / self-referential.rs
1 // Some unusual code minimized from
2 // https://github.com/sile/handy_async/tree/7b619b762c06544fc67792c8ff8ebc24a88fdb98
3
4 pub trait Pattern {
5     type Value;
6 }
7
8 pub struct Constrain<A, B = A, C = A>(A, B, C);
9
10 impl<A, B, C> Pattern for Constrain<A, B, C>
11     where A: Pattern,
12           B: Pattern<Value = A::Value>,
13           C: Pattern<Value = A::Value>,
14 {
15     type Value = A::Value;
16 }
17
18 pub struct Wrapper<T>(T);
19
20 impl<T> Pattern for Wrapper<T> {
21     type Value = T;
22 }
23
24
25 // @has self_referential/struct.WriteAndThen.html
26 // @has - '//*[@id="synthetic-implementations-list"]//*[@class="impl has-srclink"]//h3[@class="code-header"]' \
27 // "impl<P1> Send for WriteAndThen<P1>where    <P1 as Pattern>::Value: Send"
28 pub struct WriteAndThen<P1>(pub P1::Value,pub <Constrain<P1, Wrapper<P1::Value>> as Pattern>::Value)
29     where P1: Pattern;