File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 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.
33
4- Example of erroneous code:
4+ Erroneous code example :
55
66``` compile_fail,E0666
77trait MyGenericTrait<T> {}
88trait MyInnerTrait {}
99
10- fn foo(bar: impl MyGenericTrait<impl MyInnerTrait>) {}
10+ fn foo(
11+ bar: impl MyGenericTrait<impl MyInnerTrait>, // error!
12+ ) {}
1113```
1214
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:
1517
1618```
1719trait MyGenericTrait<T> {}
1820trait MyInnerTrait {}
1921
20- fn foo<T: MyInnerTrait>(bar: impl MyGenericTrait<T>) {}
22+ fn foo<T: MyInnerTrait>(
23+ bar: impl MyGenericTrait<T>, // ok!
24+ ) {}
2125```
You can’t perform that action at this time.
0 commit comments