Skip to content

Commit

Permalink
Remove outdated info about impl Trait and generics in the same function
Browse files Browse the repository at this point in the history
  • Loading branch information
drewtato authored May 1, 2024
1 parent 5181795 commit c8179f6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/types/impl-trait.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ That is, `impl Trait` in argument position is syntactic sugar for a generic type
> **Note:**
> For function parameters, generic type parameters and `impl Trait` are not exactly equivalent.
> 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)`.
> If `impl Trait` is the type of *any* function parameter, then the caller can't ever provide any generic arguments when calling that function.
This includes generic arguments for the return type or any const generics.
>
> Therefore, changing the function signature from either one to the other can constitute a breaking change for the callers of a function.
> Changing a parameter from either one to the other can constitute a breaking change for the callers of a function, since this changes the number of generic arguments.
## Abstract return types

Expand Down

0 comments on commit c8179f6

Please sign in to comment.