Skip to content

Conversation

@compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 7, 2024

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.

>
> _GenericArgsBinding_ :\
> &nbsp;&nbsp; [IDENTIFIER] `=` [_Type_]
> &nbsp;&nbsp; [IDENTIFIER] _GenericArgs_<sup>?</sup> `=` [_Type_]
Copy link
Member Author

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>

@jackh726
Copy link
Member

Associated type bounds should be trait bounds, since they can contain a for.

@compiler-errors
Copy link
Member Author

https://doc.rust-lang.org/reference/trait-bounds.html -- TypeParamBound is correct here.

Copy link
Contributor

@ehuss ehuss left a 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.

@ehuss ehuss added this pull request to the merge queue Mar 20, 2024
Merged via the queue into rust-lang:master with commit b6779f4 Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants