-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f844ea1
commit 633d1a5
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
An `impl Trait` type expands to a recursive type. | ||
|
||
An `impl Trait` type must be expandable to a concrete type that contains no | ||
`impl Trait` types. For example the following example tries to create an | ||
`impl Trait` type `T` that is equal to `[T, T]`: | ||
Erroneous code example: | ||
|
||
```compile_fail,E0720 | ||
fn make_recursive_type() -> impl Sized { | ||
[make_recursive_type(), make_recursive_type()] | ||
} | ||
``` | ||
|
||
An `impl Trait` type must be expandable to a concrete type that contains no | ||
`impl Trait` types. For example the previous example tries to create an | ||
`impl Trait` type `T` that is equal to `[T, T]`. |