From c1327360024cae9c4556125b17114cf18887c540 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Mon, 23 Nov 2015 14:57:28 -0500 Subject: [PATCH] Add tests for #25810 and #29276 Closes #25810. Closes #29276. --- src/test/run-pass/issue-25810.rs | 35 ++++++++++++++++++++++++++++++++ src/test/run-pass/issue-29276.rs | 13 ++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/test/run-pass/issue-25810.rs create mode 100644 src/test/run-pass/issue-29276.rs diff --git a/src/test/run-pass/issue-25810.rs b/src/test/run-pass/issue-25810.rs new file mode 100644 index 00000000000..49a0642ce18 --- /dev/null +++ b/src/test/run-pass/issue-25810.rs @@ -0,0 +1,35 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x = X(15); + let y = x.foo(); + println!("{:?}",y); +} + +trait Foo { + fn foo<'a>(&'a self) -> <&'a Self as Bar>::Output; +} + +trait Bar { + type Output; +} + +struct X(i32); + +impl<'a> Bar for &'a X { + type Output = &'a i32; +} + +impl Foo for X { + fn foo<'a>(&'a self) -> <&'a Self as Bar>::Output { + &self.0 + } +} diff --git a/src/test/run-pass/issue-29276.rs b/src/test/run-pass/issue-29276.rs new file mode 100644 index 00000000000..393b2226031 --- /dev/null +++ b/src/test/run-pass/issue-29276.rs @@ -0,0 +1,13 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct S([u8; { struct Z; 0 }]); + +fn main() {}