Skip to content

Commit f7cbe7c

Browse files
authored
Unrolled build for #144816
Rollup merge of #144816 - Noratrieb:e0562-impl-trait, r=WaffleLapkin Update E0562 to account for the new impl trait positions fixes #142683
2 parents f34ba77 + 870b58f commit f7cbe7c

File tree

1 file changed

+4
-5
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+4
-5
lines changed

compiler/rustc_error_codes/src/error_codes/E0562.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
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

43
Erroneous 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
```
2019
fn 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

0 commit comments

Comments
 (0)