-
Notifications
You must be signed in to change notification settings - Fork 488
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
add grammar for associated_type_bounds
in reference
#1481
Conversation
@@ -62,7 +62,10 @@ mod m { | |||
> | [_SimplePathSegment_] | |||
> | |||
> _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 -- |
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.
Update books ## rust-lang/edition-guide 1 commits in e1eead1181a691e56299294d5f1d62fe7a26d317..98b33e9a441457b0a491fe1be90e7de64eafc3e5 2024-03-23 14:17:26 UTC to 2024-03-23 14:17:26 UTC - remove indication that C string literals don't exist yet (rust-lang/edition-guide#295) ## rust-lang/reference 4 commits in 5afb503a4c1ea3c84370f8f4c08a1cddd1cdf6ad..984b36eca4b9293df04d5ba4eb5c4f77db0f51dc 2024-03-25 14:05:19 UTC to 2024-03-19 20:01:14 UTC - Fix typo of shebang (rust-lang/reference#1486) - Document importing `main` (rust-lang/reference#1461) - add grammar for `associated_type_bounds` in reference (rust-lang/reference#1481) - Literal expressions: fix mistake in the definition of unicode escapes (rust-lang/reference#1483) ## rust-lang/rust-by-example 1 commits in e093099709456e6fd74fecd2505fdf49a2471c10..7601e0c5ad29d5bd3b518700ea63fddfff5915a7 2024-03-17 21:37:25 UTC to 2024-03-17 21:37:25 UTC - Update enum_use.md to use a more neutral theme (rust-lang/rust-by-example#1828) ## rust-lang/rustc-dev-guide 12 commits in 8a5d647f19b08998612146b1cb2ca47083db63e0..ffa246b7fd95a96e1cd54883e613aed42c32547d 2024-03-23 07:44:42 UTC to 2024-03-11 18:17:28 UTC - [MCP 723] Rename AstConv to HIR ty lowering (rust-lang/rustc-dev-guide#1916) - add chapter to summary (rust-lang/rustc-dev-guide#1947) - document difference between solvers + new solver normalization (rust-lang/rustc-dev-guide#1945) - Fix broken link in chapter '1. How to build and run the compiler' (rust-lang/rustc-dev-guide#1946) - typo (rust-lang/rustc-dev-guide#1944) - Reflect rustc_codegen_cranelift move (rust-lang/rustc-dev-guide#1941) - Update rustdoc-internals.md (rust-lang/rustc-dev-guide#1911) - Update test-implementation.md (rust-lang/rustc-dev-guide#1937) - Extract Bootstrap into its own section (rust-lang/rustc-dev-guide#1939) - typos (rust-lang/rustc-dev-guide#1938) - More updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1936) - Update bibliography.md (rust-lang/rustc-dev-guide#1912)
Update books ## rust-lang/edition-guide 1 commits in e1eead1181a691e56299294d5f1d62fe7a26d317..98b33e9a441457b0a491fe1be90e7de64eafc3e5 2024-03-23 14:17:26 UTC to 2024-03-23 14:17:26 UTC - remove indication that C string literals don't exist yet (rust-lang/edition-guide#295) ## rust-lang/reference 4 commits in 5afb503a4c1ea3c84370f8f4c08a1cddd1cdf6ad..984b36eca4b9293df04d5ba4eb5c4f77db0f51dc 2024-03-25 14:05:19 UTC to 2024-03-19 20:01:14 UTC - Fix typo of shebang (rust-lang/reference#1486) - Document importing `main` (rust-lang/reference#1461) - add grammar for `associated_type_bounds` in reference (rust-lang/reference#1481) - Literal expressions: fix mistake in the definition of unicode escapes (rust-lang/reference#1483) ## rust-lang/rust-by-example 1 commits in e093099709456e6fd74fecd2505fdf49a2471c10..7601e0c5ad29d5bd3b518700ea63fddfff5915a7 2024-03-17 21:37:25 UTC to 2024-03-17 21:37:25 UTC - Update enum_use.md to use a more neutral theme (rust-lang/rust-by-example#1828) ## rust-lang/rustc-dev-guide 12 commits in 8a5d647f19b08998612146b1cb2ca47083db63e0..ffa246b7fd95a96e1cd54883e613aed42c32547d 2024-03-23 07:44:42 UTC to 2024-03-11 18:17:28 UTC - [MCP 723] Rename AstConv to HIR ty lowering (rust-lang/rustc-dev-guide#1916) - add chapter to summary (rust-lang/rustc-dev-guide#1947) - document difference between solvers + new solver normalization (rust-lang/rustc-dev-guide#1945) - Fix broken link in chapter '1. How to build and run the compiler' (rust-lang/rustc-dev-guide#1946) - typo (rust-lang/rustc-dev-guide#1944) - Reflect rustc_codegen_cranelift move (rust-lang/rustc-dev-guide#1941) - Update rustdoc-internals.md (rust-lang/rustc-dev-guide#1911) - Update test-implementation.md (rust-lang/rustc-dev-guide#1937) - Extract Bootstrap into its own section (rust-lang/rustc-dev-guide#1939) - typos (rust-lang/rustc-dev-guide#1938) - More updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1936) - Update bibliography.md (rust-lang/rustc-dev-guide#1912)
Rollup merge of rust-lang#123039 - rustbot:docs-update, r=ehuss Update books ## rust-lang/edition-guide 1 commits in e1eead1181a691e56299294d5f1d62fe7a26d317..98b33e9a441457b0a491fe1be90e7de64eafc3e5 2024-03-23 14:17:26 UTC to 2024-03-23 14:17:26 UTC - remove indication that C string literals don't exist yet (rust-lang/edition-guide#295) ## rust-lang/reference 4 commits in 5afb503a4c1ea3c84370f8f4c08a1cddd1cdf6ad..984b36eca4b9293df04d5ba4eb5c4f77db0f51dc 2024-03-25 14:05:19 UTC to 2024-03-19 20:01:14 UTC - Fix typo of shebang (rust-lang/reference#1486) - Document importing `main` (rust-lang/reference#1461) - add grammar for `associated_type_bounds` in reference (rust-lang/reference#1481) - Literal expressions: fix mistake in the definition of unicode escapes (rust-lang/reference#1483) ## rust-lang/rust-by-example 1 commits in e093099709456e6fd74fecd2505fdf49a2471c10..7601e0c5ad29d5bd3b518700ea63fddfff5915a7 2024-03-17 21:37:25 UTC to 2024-03-17 21:37:25 UTC - Update enum_use.md to use a more neutral theme (rust-lang/rust-by-example#1828) ## rust-lang/rustc-dev-guide 12 commits in 8a5d647f19b08998612146b1cb2ca47083db63e0..ffa246b7fd95a96e1cd54883e613aed42c32547d 2024-03-23 07:44:42 UTC to 2024-03-11 18:17:28 UTC - [MCP 723] Rename AstConv to HIR ty lowering (rust-lang/rustc-dev-guide#1916) - add chapter to summary (rust-lang/rustc-dev-guide#1947) - document difference between solvers + new solver normalization (rust-lang/rustc-dev-guide#1945) - Fix broken link in chapter '1. How to build and run the compiler' (rust-lang/rustc-dev-guide#1946) - typo (rust-lang/rustc-dev-guide#1944) - Reflect rustc_codegen_cranelift move (rust-lang/rustc-dev-guide#1941) - Update rustdoc-internals.md (rust-lang/rustc-dev-guide#1911) - Update test-implementation.md (rust-lang/rustc-dev-guide#1937) - Extract Bootstrap into its own section (rust-lang/rustc-dev-guide#1939) - typos (rust-lang/rustc-dev-guide#1938) - More updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1936) - Update bibliography.md (rust-lang/rustc-dev-guide#1912)
Update books ## rust-lang/edition-guide 1 commits in e1eead1181a691e56299294d5f1d62fe7a26d317..98b33e9a441457b0a491fe1be90e7de64eafc3e5 2024-03-23 14:17:26 UTC to 2024-03-23 14:17:26 UTC - remove indication that C string literals don't exist yet (rust-lang/edition-guide#295) ## rust-lang/reference 4 commits in 5afb503a4c1ea3c84370f8f4c08a1cddd1cdf6ad..984b36eca4b9293df04d5ba4eb5c4f77db0f51dc 2024-03-25 14:05:19 UTC to 2024-03-19 20:01:14 UTC - Fix typo of shebang (rust-lang/reference#1486) - Document importing `main` (rust-lang/reference#1461) - add grammar for `associated_type_bounds` in reference (rust-lang/reference#1481) - Literal expressions: fix mistake in the definition of unicode escapes (rust-lang/reference#1483) ## rust-lang/rust-by-example 1 commits in e093099709456e6fd74fecd2505fdf49a2471c10..7601e0c5ad29d5bd3b518700ea63fddfff5915a7 2024-03-17 21:37:25 UTC to 2024-03-17 21:37:25 UTC - Update enum_use.md to use a more neutral theme (rust-lang/rust-by-example#1828) ## rust-lang/rustc-dev-guide 12 commits in 8a5d647f19b08998612146b1cb2ca47083db63e0..ffa246b7fd95a96e1cd54883e613aed42c32547d 2024-03-23 07:44:42 UTC to 2024-03-11 18:17:28 UTC - [MCP 723] Rename AstConv to HIR ty lowering (rust-lang/rustc-dev-guide#1916) - add chapter to summary (rust-lang/rustc-dev-guide#1947) - document difference between solvers + new solver normalization (rust-lang/rustc-dev-guide#1945) - Fix broken link in chapter '1. How to build and run the compiler' (rust-lang/rustc-dev-guide#1946) - typo (rust-lang/rustc-dev-guide#1944) - Reflect rustc_codegen_cranelift move (rust-lang/rustc-dev-guide#1941) - Update rustdoc-internals.md (rust-lang/rustc-dev-guide#1911) - Update test-implementation.md (rust-lang/rustc-dev-guide#1937) - Extract Bootstrap into its own section (rust-lang/rustc-dev-guide#1939) - typos (rust-lang/rustc-dev-guide#1938) - More updates for recent diagnostics changes. (rust-lang/rustc-dev-guide#1936) - Update bibliography.md (rust-lang/rustc-dev-guide#1912)
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.