]> git.lizzy.rs Git - rust.git/commitdiff
Add tests for #25810 and #29276
authorAndrew Paseltiner <apaseltiner@gmail.com>
Mon, 23 Nov 2015 19:57:28 +0000 (14:57 -0500)
committerAndrew Paseltiner <apaseltiner@gmail.com>
Mon, 23 Nov 2015 19:57:28 +0000 (14:57 -0500)
Closes #25810.
Closes #29276.

src/test/run-pass/issue-25810.rs [new file with mode: 0644]
src/test/run-pass/issue-29276.rs [new file with mode: 0644]

diff --git a/src/test/run-pass/issue-25810.rs b/src/test/run-pass/issue-25810.rs
new file mode 100644 (file)
index 0000000..49a0642
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 (file)
index 0000000..393b222
--- /dev/null
@@ -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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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() {}