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

Generic Associated Types in Trait Paths - Ast part #79266

Merged
merged 3 commits into from
Nov 27, 2020

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented Nov 21, 2020

The Ast part of #78978

r? @petrochenkov

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 21, 2020
compiler/rustc_ast/src/ast.rs Outdated Show resolved Hide resolved
compiler/rustc_ast_passes/src/ast_validation.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
compiler/rustc_parse/src/parser/path.rs Outdated Show resolved Hide resolved
@petrochenkov
Copy link
Contributor

Looks great, I left some comments, mostly about error wording and formatting.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 21, 2020
@b-naber
Copy link
Contributor Author

b-naber commented Nov 23, 2020

Implemented the suggestions and addressed one of your comments on raising an error when gen_argis None.

@b-naber
Copy link
Contributor Author

b-naber commented Nov 23, 2020

Failing the CI tests because of formatting issues. I did call ./x.py fmt. Is there some way to automatically format the tests? How do I split a long error or warning annotation in a test file into multiple lines?

@petrochenkov
Copy link
Contributor

r=me after waiting for green CI and squashing commits.

|
LL | let sr: Vec<(u32, _, _) = vec![];
| -- ^ expected one of `,` or `>`
| -- ^^^^^^^^^^^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this diagnostic is somewhat unfortunate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Improving diagnostics will be done in a separate PR.

@petrochenkov
Copy link
Contributor

Not sure what is the status here.
Some commits were squashed, but other commits changing the same code back and forth still remain.

@b-naber, could you address #79266 (comment) and squash the remaining commits?

b-naber added 2 commits November 25, 2020 19:55
…ents in AssocTyConstraints haven't been fully implemented
@b-naber
Copy link
Contributor Author

b-naber commented Nov 25, 2020

Should be fixed now.

@b-naber
Copy link
Contributor Author

b-naber commented Nov 25, 2020

Also addressed your comment, not sure why it's not shown as outdated yet.

@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Nov 25, 2020

📌 Commit 5c4568d has been approved by petrochenkov

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 25, 2020
@bors
Copy link
Contributor

bors commented Nov 25, 2020

⌛ Testing commit 5c4568d with merge 585713a038fc284d0a7d79e2daac755d17446b89...

@bors
Copy link
Contributor

bors commented Nov 25, 2020

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 25, 2020
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 25, 2020
@jonas-schievink
Copy link
Contributor

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 26, 2020
@b-naber b-naber closed this Nov 26, 2020
@b-naber b-naber reopened this Nov 26, 2020
@b-naber
Copy link
Contributor Author

b-naber commented Nov 26, 2020

Sorry, accidentally closed this on my cell phone.

@petrochenkov
Copy link
Contributor

@bors retry

@bors
Copy link
Contributor

bors commented Nov 27, 2020

⌛ Testing commit 5c4568d with merge cfed918...

@camelid camelid added A-traits Area: Trait system F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs A-parser Area: The parsing of Rust source code to an AST labels Nov 27, 2020
@bors
Copy link
Contributor

bors commented Nov 27, 2020

☀️ Test successful - checks-actions
Approved by: petrochenkov
Pushing cfed918 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 27, 2020
@bors bors merged commit cfed918 into rust-lang:master Nov 27, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 27, 2020
@b-naber b-naber deleted the gat_trait_path_parser branch November 27, 2020 13:12
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 23, 2021
…r=petrochenkov

Improve diagnostics when parsing angle args

rust-lang#79266 introduced parsing of generic arguments in associated type constraints, this however resulted in possibly very confusing error messages in cases in which closing angle brackets were missing such as in `Vec<(u32, _, _) = vec![]`, which outputs an incorrectly parsed equality constraint error, as noted by `@cynecx.`

This PR tries to provide better error messages in such cases.

r? `@petrochenkov`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST A-traits Area: Trait system F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants