Skip to content

A slightly clearer diagnostic when misusing const - #79697

Merged
bors merged 2 commits into
rust-lang:masterfrom
rylev:clearer-const-diagnostic
Dec 6, 2020
Merged

A slightly clearer diagnostic when misusing const#79697
bors merged 2 commits into
rust-lang:masterfrom
rylev:clearer-const-diagnostic

Conversation

@rylev

@rylev rylev commented Dec 4, 2020

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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 A-const-generics Area: const generics (parameters and arguments) labels Dec 4, 2020
@oli-obk

oli-obk commented Dec 4, 2020

Copy link
Copy Markdown
Contributor

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

r? @oli-obk

@bors r+ rollup

@bors

bors commented Dec 4, 2020

Copy link
Copy Markdown
Collaborator

📌 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

bors commented Dec 5, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1900351 with merge 4243bf56bfb2409283ba378d99dd7705cd282f9b...

@bors

bors commented Dec 5, 2020

Copy link
Copy Markdown
Collaborator

💔 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
Copy Markdown
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

bors commented Dec 5, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 1900351 with merge bb0d481...

@bors

bors commented Dec 6, 2020

Copy link
Copy Markdown
Collaborator

☀️ 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) 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