Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
eddyb:actually-its-param
Apr 18, 2019
Merged

Resolve inconsistency in error messages between "parameter" and "variable".#60037
bors merged 1 commit into
rust-lang:masterfrom
eddyb:actually-its-param

Conversation

@eddyb

Copy link
Copy Markdown
Contributor

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 17, 2019
|
LL | trait TraitC<A> {
| - type variable from outer function
| - type parameter from outer function

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.

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

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.

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

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.

@estebank can you cc it perhaps?

@estebankestebankApr 17, 2019

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.

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

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.

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

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

r? @estebank

@estebank

Copy link
Copy Markdown
Contributor

@bors r+ rollup r=estebank

@bors

bors commented Apr 17, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 5f70559 has been approved by estebank

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

bors commented Apr 17, 2019

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Apr 17, 2019

Copy link
Copy Markdown
Collaborator

📌 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
@CentrilCentril mentioned this pull request Apr 17, 2019
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:masterApr 18, 2019
@eddyb
eddyb deleted the actually-its-param branch April 18, 2019 08:38
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

6 participants

@eddyb@Centril@estebank@bors@nikomatsakis@rust-highfive