Skip to content

Commit 1a2f82e

Browse files
committed
address PR feedback
1 parent 4531218 commit 1a2f82e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/types/impl-trait.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
>
66
> _ImplTraitTypeOneBound_ : `impl` [_TraitBound_]
77
8-
> **Edition differences**: `impl Trait` is new in the 2018 edition.
9-
108
`impl Trait` provides ways to specify unnamed but concrete types that
119
implement a specific trait.
1210
It can appear in two sorts of places: argument position (where it can act as an anonymous type parameter to functions), and return position (where it can act as an abstract return type).
@@ -49,7 +47,8 @@ That is, `impl Trait` in argument position is syntactic sugar for a generic type
4947
> **Note:**
5048
> For function arguments, generic type parameters and `impl Trait` are not exactly equivalent.
5149
> With a generic parameter such as `<T: Trait>`, the caller has the option to explicitly specify the generic argument for `T` at the call site using [_GenericArgs_], for example, `foo::<usize>(1)`.
52-
> If `impl Trait` is the type of a function argument, then the caller can't ever specify the type of that argument by using a generic argument.
50+
> If `impl Trait` is the type of *any* function argument, then the caller can't ever provide any generic arguments when calling that function.
51+
This includes generic arguments for the return type or any const generics.
5352
>
5453
> Therefore, changing the function signature from either one to the other can constitute a breaking change for the callers of a function.
5554

0 commit comments

Comments
 (0)