File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
compiler/rustc_error_codes/src/error_codes Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1- Abstract return types (written ` impl Trait ` for some trait ` Trait ` ) are only
2- allowed as function and inherent impl return types.
1+ ` impl Trait ` is only allowed as a function return and argument type.
32
43Erroneous code example:
54
@@ -14,7 +13,7 @@ fn main() {
1413}
1514```
1615
17- Make sure ` impl Trait ` only appears in return-type position .
16+ Make sure ` impl Trait ` appears in a function signature .
1817
1918```
2019fn count_to_n(n: usize) -> impl Iterator<Item=usize> {
@@ -28,6 +27,6 @@ fn main() {
2827}
2928```
3029
31- See [ RFC 1522 ] for more details.
30+ See the [ reference ] for more details on ` impl Trait ` .
3231
33- [ RFC 1522 ] : https://github.com/ rust-lang/rfcs/blob/master/text/1522-conservative- impl-trait.md
32+ [ reference ] : https://doc. rust-lang.org/stable/reference/types/ impl-trait.html
You can’t perform that action at this time.
0 commit comments