From f4a7d32c8b53649d20735c8a90469b08fe7cc3dc Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Fri, 17 Oct 2014 08:04:34 -0400 Subject: [PATCH] Correct a test. The error message changed because, with this fix, we detected (correctly) that there was only one impl and hence ignored the `Self` bound completely. I (semi-arbitrarily) elected to delect the impl, forcing the trait matcher to be more conservative and lean on the where clauses in scope, yielding the original error message. --- .../compile-fail/type-params-in-different-spaces-2.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/test/compile-fail/type-params-in-different-spaces-2.rs b/src/test/compile-fail/type-params-in-different-spaces-2.rs index d1bbda932cb..9be64bf5346 100644 --- a/src/test/compile-fail/type-params-in-different-spaces-2.rs +++ b/src/test/compile-fail/type-params-in-different-spaces-2.rs @@ -8,28 +8,25 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// Test static calls to make sure that we align the Self and input +// type parameters on a trait correctly. + trait Tr { fn op(T) -> Self; } -// these compile as if Self: Tr, even tho only Self: Tr trait A: Tr { fn test(u: U) -> Self { Tr::op(u) //~ ERROR not implemented } } + trait B: Tr { fn test(u: U) -> Self { Tr::op(u) //~ ERROR not implemented } } -impl Tr for T { - fn op(t: T) -> T { t } -} -impl A for T {} - fn main() { - std::io::println(A::test((&7306634593706211700, 8))); }