Skip to content

Generic Associated Types in Trait Paths - Ast part - #79266

Merged
bors merged 3 commits into
rust-lang:masterfrom
b-naber:gat_trait_path_parser
Nov 27, 2020
Merged

Generic Associated Types in Trait Paths - Ast part#79266
bors merged 3 commits into
rust-lang:masterfrom
b-naber:gat_trait_path_parser

Conversation

@b-naber

Copy link
Copy Markdown
Contributor

The Ast part of #78978

r? @petrochenkov

@rust-highfive

Copy link
Copy Markdown
Contributor

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-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 21, 2020
Comment threadcompiler/rustc_ast/src/ast.rs Outdated
Comment threadcompiler/rustc_ast_passes/src/ast_validation.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

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

@petrochenkovpetrochenkov 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
Copy Markdown
ContributorAuthor

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

@b-naber

Copy link
Copy Markdown
ContributorAuthor

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?

Comment threadsrc/test/ui/generic-associated-types/parse/issue-67510.rs Outdated
Comment threadsrc/test/ui/generic-associated-types/parse/issue-67510-9.rs Outdated
Comment threadsrc/test/ui/generic-associated-types/parse/issue-67510-8.rs Outdated
Comment threadsrc/test/ui/generic-associated-types/parse/issue-67510-6.stderr Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadcompiler/rustc_parse/src/parser/path.rs Outdated
Comment threadsrc/test/ui/generic-associated-types/parse/trait-path-expressions.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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.

@b-naber
b-naberforce-pushed the gat_trait_path_parser branch from 41d899d to 1206495CompareNovember 25, 2020 08:10
@petrochenkov

Copy link
Copy Markdown
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
@b-naber
b-naberforce-pushed the gat_trait_path_parser branch from 1206495 to 2d18e88CompareNovember 25, 2020 19:05
@b-naber
b-naberforce-pushed the gat_trait_path_parser branch from 2d18e88 to 5c4568dCompareNovember 25, 2020 19:09
@b-naber

Copy link
Copy Markdown
ContributorAuthor

Should be fixed now.

@b-naber

Copy link
Copy Markdown
ContributorAuthor

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

@petrochenkov

Copy link
Copy Markdown
Contributor

Thanks!
@bors r+

@bors

bors commented Nov 25, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 5c4568d has been approved by petrochenkov

@borsbors 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

bors commented Nov 25, 2020

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Nov 25, 2020

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors 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
@borsbors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 25, 2020
@jonas-schievink

Copy link
Copy Markdown
Contributor

@bors retry

@borsbors 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-naberb-naber closed this Nov 26, 2020
@b-naberb-naber reopened this Nov 26, 2020
@b-naber

Copy link
Copy Markdown
ContributorAuthor

Sorry, accidentally closed this on my cell phone.

@petrochenkov

Copy link
Copy Markdown
Contributor

@bors retry

@bors

bors commented Nov 27, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 5c4568d with merge cfed918...

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

bors commented Nov 27, 2020

Copy link
Copy Markdown
Collaborator

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

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Nov 27, 2020
@bors
bors merged commit cfed918 into rust-lang:masterNov 27, 2020
@rustbotrustbot 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-parserArea: The lexing & parsing of Rust source code to an ASTA-trait-systemArea: Trait systemF-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsmerged-by-borsThis PR was explicitly merged by bors.S-waiting-on-borsStatus: 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

@b-naber@rust-highfive@petrochenkov@bors@jonas-schievink@cynecx@camelid@rustbot