From af3cde2c9760fa3efc061c9e64e17f0aa8b355ff Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Mon, 2 Sep 2013 23:19:04 +0200 Subject: [PATCH] Long awaited test case for #2355. --- src/test/run-pass/trait-bounds-recursion.rs | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/run-pass/trait-bounds-recursion.rs diff --git a/src/test/run-pass/trait-bounds-recursion.rs b/src/test/run-pass/trait-bounds-recursion.rs new file mode 100644 index 0000000000000..043aa358fa07a --- /dev/null +++ b/src/test/run-pass/trait-bounds-recursion.rs @@ -0,0 +1,27 @@ +// Copyright 2013 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 I { fn i(&self) -> Self; } + +trait A { + fn id(x:T) -> T { x.i() } +} + +trait J { fn j(&self) -> Self; } + +trait B> { + fn id(x:T) -> T { x.j() } +} + +trait C { + fn id>(x:T) -> T { x.j() } +} + +fn main() { }