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

Recover from where clauses placed before tuple struct bodies #106537

Merged

Conversation

fmease
Copy link
Member

@fmease fmease commented Jan 6, 2023

Open to any suggestions regarding the phrasing of the diagnostic.

Fixes #100790.
@rustbot label A-diagnostics
r? diagnostics

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 6, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 6, 2023

rustc_error_messages was changed

cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki

@rustbot rustbot added the A-diagnostics Area: Messages for errors, warnings, and lints label Jan 6, 2023
help: consider moving the where clause after the body
|
LL - where
LL + (pub usize, usize) where (): Sized, String: Clone;
Copy link
Member Author

@fmease fmease Jan 6, 2023

Choose a reason for hiding this comment

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

Personally, I am not a fan of how this diff is rendered. In my eyes, it looks as if it's only the where keyword that needs to be replaced and as if the trait bounds are allowed to stay.
I would have expected it to like this (nested diff incoming):

- - where
- + (pub usize, usize) where (): Sized, String: Clone;
+ - where
+ -     (): Sized,
+ -     String: Clone,
+ + (pub usize, usize) where (): Sized, String: Clone;

I've double-checked that the span is correct by running rustfix, so it's only the rendering that's off.

Copy link
Contributor

Choose a reason for hiding this comment

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

File a ticket for it. It is definitely in the Emitter.

@compiler-errors
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 6, 2023
@bors
Copy link
Contributor

bors commented Jan 6, 2023

⌛ Trying commit f9e3934000d4cc6021ee137f534add1d89e6ce96 with merge 1f760d25d5966701f7b2485ad562295fd23c55d7...

@fmease fmease force-pushed the recover-where-clause-before-tuple-struct-body branch from f9e3934 to 7128f81 Compare January 6, 2023 17:37
@fmease
Copy link
Member Author

fmease commented Jan 6, 2023

I hope my force-push (of a tiny superfluous change) does not disrupt the try-build & the timing procedure. I will try to implement Esteban's suggestion locally (re. the parser cloning).

@compiler-errors
Copy link
Member

restarting try-build, @bors try

@bors
Copy link
Contributor

bors commented Jan 6, 2023

⌛ Trying commit 7128f813a5eb922b67484a89f58ebffe5283dda5 with merge eaf94153e7aaf83e8915bc3a09df0298be5cb31e...

@bors
Copy link
Contributor

bors commented Jan 6, 2023

☀️ Try build successful - checks-actions
Build commit: eaf94153e7aaf83e8915bc3a09df0298be5cb31e (eaf94153e7aaf83e8915bc3a09df0298be5cb31e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (eaf94153e7aaf83e8915bc3a09df0298be5cb31e): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

@rustbot rustbot 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-perf Status: Waiting on a perf run to be completed. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 6, 2023
@fmease fmease force-pushed the recover-where-clause-before-tuple-struct-body branch from 7128f81 to 3bfd2e8 Compare January 9, 2023 03:22
@fmease
Copy link
Member Author

fmease commented Jan 9, 2023

Sorry for the delay, I couldn't find time earlier.
@rustbot review

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 9, 2023
@bors
Copy link
Contributor

bors commented Jan 9, 2023

⌛ Testing commit c9f6f2efe4219283a5fe63ffc91aa42bf3afc284 with merge a5c4c38f991a61a94339059bdc0db329ed613de3...

@bors
Copy link
Contributor

bors commented Jan 9, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 9, 2023
@rust-log-analyzer

This comment has been minimized.

@fmease
Copy link
Member Author

fmease commented Jan 9, 2023

Test failure is unrelated to my PR. It looks like a flaky rustdoc GUI test (CC @GuillaumeGomez). Edit: Fixed in #106689.

Could someone please reapprove my PR? Thanks! :)

@GuillaumeGomez
Copy link
Member

O.o

What the hell happened...

@bors r=estebank

@bors
Copy link
Contributor

bors commented Jan 9, 2023

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Jan 9, 2023

📌 Commit c9f6f2efe4219283a5fe63ffc91aa42bf3afc284 has been approved by estebank

It is now in the queue for this repository.

@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 Jan 9, 2023
@GuillaumeGomez
Copy link
Member

Ah it should have been a retry instead, my bad. Also, are you fully rebased on master? If not that would explain why this error occurred...

@fmease
Copy link
Member Author

fmease commented Jan 9, 2023

Ah it should have been a retry instead, my bad. Also, are you fully rebased on master? If not that would explain why this error occurred...

I am not. I didn't know that it could lead to such problems. I'm gonna rebase onto latest master, then you can retry again. Thanks a lot! Sorry for the noise.

@fmease fmease force-pushed the recover-where-clause-before-tuple-struct-body branch from c9f6f2e to 926604e Compare January 9, 2023 14:12
@GuillaumeGomez
Copy link
Member

It's really just a wild guess because the error doesn't look flaky at all this time.

@fmease
Copy link
Member Author

fmease commented Jan 9, 2023

#105670 is probably going to get merged first making my PR unmergeable soon. So please hold off from r+'ing at the moment.

@fmease fmease force-pushed the recover-where-clause-before-tuple-struct-body branch from 926604e to 70ddde7 Compare January 11, 2023 16:55
@fmease
Copy link
Member Author

fmease commented Jan 11, 2023

It looks like it's gonna take a short while for #105670 (the PR I tried to wait for) to be ready again for merging (after failing tests & the src/test migration etc.).

Could someone please bors-reapprove this PR? CI is green. Thanks a lot in advance! ❤️

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 11, 2023

📌 Commit 70ddde7 has been approved by estebank

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 12, 2023

⌛ Testing commit 70ddde7 with merge d4203ed...

@bors
Copy link
Contributor

bors commented Jan 12, 2023

☀️ Test successful - checks-actions
Approved by: estebank
Pushing d4203ed to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 12, 2023
@bors bors merged commit d4203ed into rust-lang:master Jan 12, 2023
@rustbot rustbot added this to the 1.68.0 milestone Jan 12, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d4203ed): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.7% [2.7%, 2.7%] 1
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.1% [-1.1%, -1.1%] 1
All ❌✅ (primary) 2.7% [2.7%, 2.7%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.8% [4.5%, 5.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

@fmease fmease deleted the recover-where-clause-before-tuple-struct-body branch January 12, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad generic error for incorrectly placed where clause for tuple struct
9 participants