File tree 1 file changed +35
-1
lines changed
1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -989,6 +989,41 @@ enum Method { GET, POST }
989
989
```
990
990
"## ,
991
991
992
+ E0229 : r##"
993
+ An associated type binding was done outside of the type parameter declaration
994
+ and `where` clause. Erroneous code example:
995
+
996
+ ```
997
+ pub trait Foo {
998
+ type A;
999
+ fn boo(&self) -> <Self as Foo>::A;
1000
+ }
1001
+
1002
+ struct Bar;
1003
+
1004
+ impl Foo for isize {
1005
+ type A = usize;
1006
+ fn boo(&self) -> usize { 42 }
1007
+ }
1008
+
1009
+ fn baz<I>(x: &<I as Foo<A=Bar>>::A) {}
1010
+ // error: associated type bindings are not allowed here
1011
+ ```
1012
+
1013
+ To solve this error, please move the type bindings in the type parameter
1014
+ declaration:
1015
+
1016
+ ```
1017
+ fn baz<I: Foo<A=Bar>>(x: &<I as Foo>::A) {} // ok!
1018
+ ```
1019
+
1020
+ or in the `where` clause:
1021
+
1022
+ ```
1023
+ fn baz<I>(x: &<I as Foo>::A) where I: Foo<A=Bar> {}
1024
+ ```
1025
+ "## ,
1026
+
992
1027
E0261 : r##"
993
1028
When using a lifetime like `'a` in a type, it must be declared before being
994
1029
used.
@@ -2241,7 +2276,6 @@ register_diagnostics! {
2241
2276
// E0006 // merged with E0005
2242
2277
// E0134,
2243
2278
// E0135,
2244
- E0229 , // associated type bindings are not allowed here
2245
2279
E0278 , // requirement is not satisfied
2246
2280
E0279 , // requirement is not satisfied
2247
2281
E0280 , // requirement is not satisfied
You can’t perform that action at this time.
0 commit comments