Skip to content

Commit

Permalink
Clarify that provided methods work too
Browse files Browse the repository at this point in the history
  • Loading branch information
tmandry committed Jun 13, 2023
1 parent 6adfb20 commit 80f1b44
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions text/0000-return-position-impl-trait-in-traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ impl NewIntoIterator for Vec<u32> {
}
```

The desugaring works the same for provided methods of traits.

## Scoping rules for generic parameters

We say a generic parameter is "in scope" for an `impl Trait` type if the actual revealed type is allowed to name that parameter. The scoping rules for return position `impl Trait` in traits are the same as [those for return position `impl Trait` generally][scoping]: All type and const parameters are considered in-scope, while lifetime parameters are only considered in-scope if they are mentioned in the `impl Trait` type directly.
Expand Down

0 comments on commit 80f1b44

Please sign in to comment.