]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-18655.rs
New upstream version 1.50.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-18655.rs
CommitLineData
b7449926 1// run-pass
62682a34
SL
2trait Factory {
3 type Product;
4 fn create(&self) -> <Self as Factory>::Product;
5}
6
7impl Factory for f64 {
8 type Product = f64;
9 fn create(&self) -> f64 { *self * *self }
10}
11
12impl<A: Factory, B: Factory> Factory for (A, B) {
13 type Product = (<A as Factory>::Product, <B as Factory>::Product);
14 fn create(&self) -> (<A as Factory>::Product, <B as Factory>::Product) {
15 let (ref a, ref b) = *self;
16 (a.create(), b.create())
17 }
18}
19
20fn main() {
21 assert_eq!((16., 25.), (4., 5.).create());
22}