]>
Commit | Line | Data |
---|---|---|
3c0e092e XL |
1 | // check-pass |
2 | ||
3 | trait Base<'f> { | |
4 | type Assoc; | |
5 | ||
6 | fn do_something(&self); | |
7 | } | |
8 | ||
9 | trait ForAnyLifetime: for<'f> Base<'f> {} | |
10 | ||
11 | impl<T> ForAnyLifetime for T where T: for<'f> Base<'f> {} | |
12 | ||
13 | trait CanBeDynamic: ForAnyLifetime + for<'f> Base<'f, Assoc = ()> {} | |
14 | ||
15 | fn foo(a: &dyn CanBeDynamic) { | |
16 | a.do_something(); | |
17 | } | |
18 | ||
19 | struct S; | |
20 | ||
21 | impl<'a> Base<'a> for S { | |
22 | type Assoc = (); | |
23 | ||
24 | fn do_something(&self) {} | |
25 | } | |
26 | ||
27 | impl CanBeDynamic for S {} | |
28 | ||
29 | fn main() { | |
30 | let s = S; | |
31 | foo(&s); | |
32 | } |