]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-14821.rs
New upstream version 1.60.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-14821.rs
CommitLineData
b7449926 1// run-pass
0bf4aa26
XL
2#![allow(dead_code)]
3#![allow(unused_variables)]
c1a9b12d
SL
4trait SomeTrait {}
5struct Meow;
6impl SomeTrait for Meow {}
85aaf69f 7
c1a9b12d 8struct Foo<'a> {
dc9dc135
XL
9 x: &'a dyn SomeTrait,
10 y: &'a dyn SomeTrait,
c1a9b12d 11}
223e47cc 12
c1a9b12d 13impl<'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
17fn 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}