rust/tests/ui/issues/issue-14821.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
428 B
Rust
Raw Normal View History

// run-pass
#![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
}