]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-14821.rs
Rollup merge of #91804 - woppopo:const_clone, r=oli-obk
[rust.git] / src / test / ui / issues / issue-14821.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(unused_variables)]
4 trait SomeTrait {}
5 struct Meow;
6 impl SomeTrait for Meow {}
7
8 struct Foo<'a> {
9     x: &'a dyn SomeTrait,
10     y: &'a dyn SomeTrait,
11 }
12
13 impl<'a> Foo<'a> {
14     pub fn new<'b>(x: &'b dyn SomeTrait, y: &'b dyn SomeTrait) -> Foo<'b> { Foo { x: x, y: y } }
15 }
16
17 fn main() {
18     let r = Meow;
19     let s = Meow;
20     let q = Foo::new(&r as &dyn SomeTrait, &s as &dyn SomeTrait);
21 }