From 57a66f8ef39575448c21b179977e822c44d1d987 Mon Sep 17 00:00:00 2001 From: Nick Hamann Date: Sun, 21 Jun 2015 14:16:12 -0500 Subject: [PATCH] Add regression tests for issues #18655 and #18988. Closes #18655. Closes #18988. --- src/test/run-pass/issue-18655.rs | 31 +++++++++++++++++++++++++++++++ src/test/run-pass/issue-18988.rs | 19 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/test/run-pass/issue-18655.rs create mode 100644 src/test/run-pass/issue-18988.rs diff --git a/src/test/run-pass/issue-18655.rs b/src/test/run-pass/issue-18655.rs new file mode 100644 index 00000000000..cdb83ae5caa --- /dev/null +++ b/src/test/run-pass/issue-18655.rs @@ -0,0 +1,31 @@ +// 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. + +trait Factory { + type Product; + fn create(&self) -> ::Product; +} + +impl Factory for f64 { + type Product = f64; + fn create(&self) -> f64 { *self * *self } +} + +impl Factory for (A, B) { + type Product = (::Product, ::Product); + fn create(&self) -> (::Product, ::Product) { + let (ref a, ref b) = *self; + (a.create(), b.create()) + } +} + +fn main() { + assert_eq!((16., 25.), (4., 5.).create()); +} diff --git a/src/test/run-pass/issue-18988.rs b/src/test/run-pass/issue-18988.rs new file mode 100644 index 00000000000..e41ac6bdbeb --- /dev/null +++ b/src/test/run-pass/issue-18988.rs @@ -0,0 +1,19 @@ +// 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. + +pub trait Foo : Send { } + +pub struct MyFoo { + children: Vec>, +} + +impl Foo for MyFoo { } + +pub fn main() { }