diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-14821.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-14821.rs b/src/test/ui/issues/issue-14821.rs new file mode 100644 index 000000000..00b2e3607 --- /dev/null +++ b/src/test/ui/issues/issue-14821.rs @@ -0,0 +1,21 @@ +// run-pass +#![allow(dead_code)] +#![allow(unused_variables)] +trait SomeTrait {} +struct Meow; +impl SomeTrait for Meow {} + +struct Foo<'a> { + x: &'a dyn SomeTrait, + y: &'a dyn SomeTrait, +} + +impl<'a> Foo<'a> { + pub fn new<'b>(x: &'b dyn SomeTrait, y: &'b dyn SomeTrait) -> Foo<'b> { Foo { x: x, y: y } } +} + +fn main() { + let r = Meow; + let s = Meow; + let q = Foo::new(&r as &dyn SomeTrait, &s as &dyn SomeTrait); +} |