File tree 1 file changed +11
-7
lines changed
src/librustc_error_codes/error_codes
1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1
- ` impl Trait ` types cannot appear nested in the
2
- generic arguments of other ` impl Trait ` types.
1
+ ` impl Trait ` types cannot appear nested in the generic arguments of other
2
+ ` impl Trait ` types.
3
3
4
- Example of erroneous code:
4
+ Erroneous code example :
5
5
6
6
``` compile_fail,E0666
7
7
trait MyGenericTrait<T> {}
8
8
trait MyInnerTrait {}
9
9
10
- fn foo(bar: impl MyGenericTrait<impl MyInnerTrait>) {}
10
+ fn foo(
11
+ bar: impl MyGenericTrait<impl MyInnerTrait>, // error!
12
+ ) {}
11
13
```
12
14
13
- Type parameters for ` impl Trait ` types must be
14
- explicitly defined as named generic parameters:
15
+ Type parameters for ` impl Trait ` types must be explicitly defined as named
16
+ generic parameters:
15
17
16
18
```
17
19
trait MyGenericTrait<T> {}
18
20
trait MyInnerTrait {}
19
21
20
- fn foo<T: MyInnerTrait>(bar: impl MyGenericTrait<T>) {}
22
+ fn foo<T: MyInnerTrait>(
23
+ bar: impl MyGenericTrait<T>, // ok!
24
+ ) {}
21
25
```
You can’t perform that action at this time.
0 commit comments