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.
This commit is contained in:
Niko Matsakis 2014-10-17 08:04:34 -04:00
parent 590a61f788
commit f4a7d32c8b
1 changed files with 4 additions and 7 deletions

View File

@ -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<T> {
fn op(T) -> Self;
}
// these compile as if Self: Tr<U>, even tho only Self: Tr<Self or T>
trait A: Tr<Self> {
fn test<U>(u: U) -> Self {
Tr::op(u) //~ ERROR not implemented
}
}
trait B<T>: Tr<T> {
fn test<U>(u: U) -> Self {
Tr::op(u) //~ ERROR not implemented
}
}
impl<T> Tr<T> for T {
fn op(t: T) -> T { t }
}
impl<T> A for T {}
fn main() {
std::io::println(A::test((&7306634593706211700, 8)));
}