]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 XL |
2 | #![allow(dead_code)] |
3 | #![allow(unused_variables)] | |
c1a9b12d SL |
4 | trait SomeTrait {} |
5 | struct Meow; | |
6 | impl SomeTrait for Meow {} | |
85aaf69f | 7 | |
c1a9b12d | 8 | struct Foo<'a> { |
dc9dc135 XL |
9 | x: &'a dyn SomeTrait, |
10 | y: &'a dyn SomeTrait, | |
c1a9b12d | 11 | } |
223e47cc | 12 | |
c1a9b12d | 13 | impl<'a> Foo<'a> { |
dc9dc135 | 14 | pub fn new<'b>(x: &'b dyn SomeTrait, y: &'b dyn SomeTrait) -> Foo<'b> { Foo { x: x, y: y } } |
c1a9b12d SL |
15 | } |
16 | ||
17 | fn main() { | |
18 | let r = Meow; | |
19 | let s = Meow; | |
dc9dc135 | 20 | let q = Foo::new(&r as &dyn SomeTrait, &s as &dyn SomeTrait); |
c1a9b12d | 21 | } |