Skip to content
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

Merged
merged 3 commits into from
Mar 20, 2024

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.

src/paths.md Outdated Show resolved Hide resolved
src/paths.md Outdated Show resolved Hide resolved
src/paths.md Outdated Show resolved Hide resolved
@@ -62,7 +62,10 @@ mod m {
> &nbsp;&nbsp; | [_SimplePathSegment_]
>
> _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
1 check passed
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 25, 2024
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)
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 25, 2024
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)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 26, 2024
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)
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Mar 26, 2024
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)
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