Skip to content

Commit f4a7d32

Browse files
committed
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.
1 parent 590a61f commit f4a7d32

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/test/compile-fail/type-params-in-different-spaces-2.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,25 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// Test static calls to make sure that we align the Self and input
12+
// type parameters on a trait correctly.
13+
1114
trait Tr<T> {
1215
fn op(T) -> Self;
1316
}
1417

15-
// these compile as if Self: Tr<U>, even tho only Self: Tr<Self or T>
1618
trait A: Tr<Self> {
1719
fn test<U>(u: U) -> Self {
1820
Tr::op(u) //~ ERROR not implemented
1921
}
2022
}
23+
2124
trait B<T>: Tr<T> {
2225
fn test<U>(u: U) -> Self {
2326
Tr::op(u) //~ ERROR not implemented
2427
}
2528
}
2629

27-
impl<T> Tr<T> for T {
28-
fn op(t: T) -> T { t }
29-
}
30-
impl<T> A for T {}
31-
3230
fn main() {
33-
std::io::println(A::test((&7306634593706211700, 8)));
3431
}
3532

0 commit comments

Comments
 (0)