2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_variables)]
|
2015-07-18 21:40:15 +00:00
|
|
|
trait SomeTrait {}
|
|
|
|
struct Meow;
|
|
|
|
impl SomeTrait for Meow {}
|
|
|
|
|
|
|
|
struct Foo<'a> {
|
2019-05-28 18:47:21 +00:00
|
|
|
x: &'a dyn SomeTrait,
|
|
|
|
y: &'a dyn SomeTrait,
|
2015-07-18 21:40:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Foo<'a> {
|
2019-05-28 18:47:21 +00:00
|
|
|
pub fn new<'b>(x: &'b dyn SomeTrait, y: &'b dyn SomeTrait) -> Foo<'b> { Foo { x: x, y: y } }
|
2015-07-18 21:40:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let r = Meow;
|
|
|
|
let s = Meow;
|
2019-05-28 18:47:21 +00:00
|
|
|
let q = Foo::new(&r as &dyn SomeTrait, &s as &dyn SomeTrait);
|
2015-07-18 21:40:15 +00:00
|
|
|
}
|