-
Notifications
You must be signed in to change notification settings - Fork 565
add grammar for associated_type_bounds in reference
#1481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| > | ||
| > _GenericArgsBinding_ :\ | ||
| > [IDENTIFIER] `=` [_Type_] | ||
| > [IDENTIFIER] _GenericArgs_<sup>?</sup> `=` [_Type_] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, only thing this adds is GenericArgs?, so you can write T: Trait<Assoc<i32> = Ty>
|
Associated type bounds should be trait bounds, since they can contain a |
|
https://doc.rust-lang.org/reference/trait-bounds.html -- |
ehuss
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Merging now that rust-lang/rust#122055 is out.
This also edits the grammar to capture the fact that associated type bounds (both
:and=) may have GAT parameters, e.g.T: Trait<Foo<'a> = i32>.Not sure if I should also add a section on associated type bounds, and if so, where. Maybe
trait-bounds.md?cc rust-lang/rust#122055, which is in FCP.