Resolve inconsistency in error messages between "parameter" and "variable".#60037
Merged
bors merged 1 commit intorust-lang:masterfrom Apr 18, 2019
Merged
Resolve inconsistency in error messages between "parameter" and "variable".#60037bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Centril
reviewed
Apr 17, 2019
| | | ||
| LL | trait TraitC<A> { | ||
| | - type variable from outer function | ||
| | - type parameter from outer function |
Contributor
There was a problem hiding this comment.
The diagnostic makes no sense here as there's no outer function, just an outer trait.
Contributor
There was a problem hiding this comment.
I believe there's already a ticket for this case.
Contributor
Contributor
There was a problem hiding this comment.
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...
Contributor
|
Niko is too busy with other things... ;) r? @estebank |
Contributor
|
@bors r+ rollup r=estebank |
Collaborator
|
📌 Commit 5f70559 has been approved by |
Collaborator
|
💡 This pull request was already approved, no need to approve it again.
|
Collaborator
|
📌 Commit 5f70559 has been approved by |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The inconsistency was introduced in 104fe1c (#33619), when a label saying
type variablewas added to an error with a message talking abouttype parameters.Given that
parameteris 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