1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-04 11:39:42 +02:00

Add speaker notes for impl Trait.

This commit is contained in:
Andrew Walbran 2023-01-16 14:15:00 +00:00
parent 832c7e9963
commit a1861ef900

View File

@ -18,3 +18,14 @@ fn main() {
* `impl Trait` cannot be used with the `::<>` turbo fish syntax.
* `impl Trait` allows you to work with types which you cannot name.
<details>
The meaning of `impl Trait` is a bit different in the different positions.
* For a parameter, `impl Trait` is like an anonymous generic parameter with a trait bound.
* For a return type, it means that the return type is some concrete type that implements the trait,
without naming the type. This can be useful when you don't want to expose the concrete type in a
public API.
</details>