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

Resolve inconsistency in error messages between "parameter" and "variable". #60037

Merged
merged 1 commit into from
Apr 18, 2019

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Apr 17, 2019

The inconsistency was introduced in 104fe1c (#33619), when a label saying type variable was added to an error with a message talking about type parameters.
Given that parameter is far more prevalent when referring to generics in the context of Rust, IMO it should be that in both the message and the label.

r? @nikomatsakis or @estebank

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…able".
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 17, 2019
@@ -23,7 +23,7 @@ error[E0401]: can't use generic parameters from outer function
--> $DIR/resolve-type-param-in-item-in-trait.rs:23:28
|
LL | trait TraitC<A> {
| - type variable from outer function
| - type parameter from outer function
Copy link
Contributor

Choose a reason for hiding this comment

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

The diagnostic makes no sense here as there's no outer function, just an outer trait.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe there's already a ticket for this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

@estebank can you cc it perhaps?

Copy link
Contributor

@estebank estebank Apr 17, 2019

Choose a reason for hiding this comment

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

CC #37892, #56794, #53241. I believe there's another one but couldn't find it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks; I skimmed those issues and they all seem a bit different. I think the fix for this one is to customize the diagnostic based on what the parent def_id refers to... e.g. say "function" if it is one, and "trait" if it is one...

@Centril
Copy link
Contributor

Centril commented Apr 17, 2019

Niko is too busy with other things... ;)

r? @estebank

@estebank
Copy link
Contributor

@bors r+ rollup r=estebank

@bors
Copy link
Contributor

bors commented Apr 17, 2019

📌 Commit 5f70559 has been approved by estebank

@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 Apr 17, 2019
@bors
Copy link
Contributor

bors commented Apr 17, 2019

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

@bors
Copy link
Contributor

bors commented Apr 17, 2019

📌 Commit 5f70559 has been approved by estebank

Centril added a commit to Centril/rust that referenced this pull request Apr 17, 2019
Resolve inconsistency in error messages between "parameter" and "variable".

The inconsistency was introduced in 104fe1c (rust-lang#33619), when a label saying `type variable` was added to an error with a message talking about `type parameters`.
Given that `parameter` is far more prevalent when referring to generics in the context of Rust, IMO it should be that in both the message and the label.

r? @nikomatsakis or @estebank
bors added a commit that referenced this pull request Apr 17, 2019
Rollup of 4 pull requests

Successful merges:

 - #59908 (Re-export core::str::{EscapeDebug, EscapeDefault, EscapeUnicode} in std)
 - #59984 (Remove collection-specific `with_capacity` documentation from `std::collections`)
 - #60036 (Remove nrc from toolstate pings)
 - #60037 (Resolve inconsistency in error messages between "parameter" and "variable".)

Failed merges:

r? @ghost
@bors bors merged commit 5f70559 into rust-lang:master Apr 18, 2019
@eddyb eddyb deleted the actually-its-param branch April 18, 2019 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

6 participants