diff options
| author | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2025-08-02 11:27:38 +0200 |
|---|---|---|
| committer | Noratrieb <48135649+Noratrieb@users.noreply.github.com> | 2025-08-02 11:29:04 +0200 |
| commit | 870b58f4d060cc63c2969faa3f54da7802c4881e (patch) | |
| tree | 6136267c7719d1f981e31b90e6d03d54376041e5 /compiler/rustc_error_codes | |
| parent | f32b23204a0efe2fe8383ed4be1a30b56c1bbf94 (diff) | |
| download | rust-870b58f4d060cc63c2969faa3f54da7802c4881e.tar.gz rust-870b58f4d060cc63c2969faa3f54da7802c4881e.zip | |
Update E0562 to account for the new impl trait positions
Diffstat (limited to 'compiler/rustc_error_codes')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0562.md | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0562.md b/compiler/rustc_error_codes/src/error_codes/E0562.md index 95f038df56d..af7b219fb12 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0562.md +++ b/compiler/rustc_error_codes/src/error_codes/E0562.md @@ -1,5 +1,4 @@ -Abstract return types (written `impl Trait` for some trait `Trait`) are only -allowed as function and inherent impl return types. +`impl Trait` is only allowed as a function return and argument type. Erroneous code example: @@ -14,7 +13,7 @@ fn main() { } ``` -Make sure `impl Trait` only appears in return-type position. +Make sure `impl Trait` appears in a function signature. ``` fn count_to_n(n: usize) -> impl Iterator<Item=usize> { @@ -28,6 +27,6 @@ fn main() { } ``` -See [RFC 1522] for more details. +See the [reference] for more details on `impl Trait`. -[RFC 1522]: https://github.com/rust-lang/rfcs/blob/master/text/1522-conservative-impl-trait.md +[reference]: https://doc.rust-lang.org/stable/reference/types/impl-trait.html |
