]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-unused-tps-inherent.rs
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / ui / impl-unused-tps-inherent.rs
1 struct MyType;
2
3 struct MyType1<T>(T);
4
5 trait Bar {
6     type Out;
7 }
8
9 impl<T> MyType {
10     //~^ ERROR  the type parameter `T` is not constrained
11 }
12
13 impl<T> MyType1<T> {
14     // OK, T is used in `Foo<T>`.
15 }
16
17 impl<T,U> MyType1<T> {
18     //~^ ERROR  the type parameter `U` is not constrained
19 }
20
21 impl<T,U> MyType1<T> where T: Bar<Out=U> {
22     // OK, T is used in `Foo<T>`.
23 }
24
25 fn main() { }