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

A slightly clearer diagnostic when misusing const #79697

Merged
merged 2 commits into from
Dec 6, 2020

Conversation

rylev
Copy link
Member

@rylev rylev commented Dec 4, 2020

Fixes #79598

This produces the following diagnostic:
"expected one of >, a const expression, lifetime, or type, found keyword const"

Instead of the previous, more confusing:
"expected one of >, const, lifetime, or type, found keyword const"

This might not be completely clear as some users might not understand what a const expression is, but I do believe this is an improvement.

@rust-highfive
Copy link
Collaborator

r? @ecstatic-morse

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 4, 2020
@oli-obk oli-obk added const-generics-bad-diagnostics An error is correctly emitted, but is confusing, for `min_const_generics`. A-const-generics Area: const generics (parameters and arguments) labels Dec 4, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Dec 4, 2020

Oh... that makes sense. I completely blanked on the issue wrt what the actual problem is.

r? @oli-obk

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 4, 2020

📌 Commit 1900351 has been approved by oli-obk

@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 Dec 4, 2020
@bors
Copy link
Contributor

bors commented Dec 5, 2020

⌛ Testing commit 1900351 with merge 4243bf56bfb2409283ba378d99dd7705cd282f9b...

@bors
Copy link
Contributor

bors commented Dec 5, 2020

💔 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 Dec 5, 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 Dec 5, 2020
@bors
Copy link
Contributor

bors commented Dec 5, 2020

⌛ Testing commit 1900351 with merge bb0d481...

@bors
Copy link
Contributor

bors commented Dec 6, 2020

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing bb0d481 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 6, 2020
@bors bors merged commit bb0d481 into rust-lang:master Dec 6, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) const-generics-bad-diagnostics An error is correctly emitted, but is confusing, for `min_const_generics`. 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.

Wrong diagnostic when incorrectly using const generics in impl block
7 participants