-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Reword mismatched-lifetime-syntaxes text based on feedback #143914
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
base: master
Are you sure you want to change the base?
Reword mismatched-lifetime-syntaxes text based on feedback #143914
Conversation
This comment has been minimized.
This comment has been minimized.
I'll look at this on Wednesday. |
677cf7b
to
14baad4
Compare
Key changes include: - Removal of the word "syntax" from the lint message. More accurately, it could have been something like "syntax group" or "syntax category", but avoiding it completely is easier. - The primary lint message now reflects exactly which mismatch is occurring, instead of trying to be general. A new `help` line is general across the mismatch kinds. - Suggestions have been reduced to be more minimal, no longer also changing non-idiomatic but unrelated aspects. - Suggestion text no longer mentions changes when those changes don't occur in that specific suggestion.
14baad4
to
5530744
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the follow-up! At least for me, I find this revised wording and diagnostics much clearer in terms of "why is this a problem" and "what am I expected to do".
error: hiding or eliding a lifetime that's named elsewhere is confusing | ||
--> $DIR/mismatched-lifetime-syntaxes.rs:232:53 | ||
| | ||
LL | fn all_three_categories<'a>(v: ContainsLifetime<'a>) -> (&u8, ContainsLifetime) { | ||
| ^^ --- ---------------- the same lifetime is hidden here | ||
| | | | ||
| | the same lifetime is elided here | ||
| the lifetime is named here | ||
| | ||
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing | ||
help: consistently use `'a` | ||
| | ||
LL | fn all_three_categories<'a>(v: ContainsLifetime<'a>) -> (&'a u8, ContainsLifetime<'a>) { | ||
| ++ ++++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remark: this is very nice :)
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
/cc @traviscross. Since you effectively proposed the wording in this PR, I'm going to assume that you also approve of it. We've got an approval from the compiler team, so I'm inclined to merge this sooner rather than later so it can get beta-nominated faster. |
r? @traviscross (for wording) |
I'm also going to jump the gun here and nominate for this to be backported to beta. The current wording has been reported to be suboptimal, so hopefully we can skip having a 6-week period of confusion. If not, it wouldn't be the end of the world. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @shepmaster for making these updates.
Oh I forgot to say, impl looks good, so r=me on the impl side. |
@bors r=traviscross,jieyouxu rollup |
…taxes-rewording, r=traviscross,jieyouxu Reword mismatched-lifetime-syntaxes text based on feedback Key changes include: - Removal of the word "syntax" from the lint message. More accurately, it could have been something like "syntax group" or "syntax category", but avoiding it completely is easier. - The primary lint message now reflects exactly which mismatch is occurring, instead of trying to be general. A new `help` line is general across the mismatch kinds. - Suggestions have been reduced to be more minimal, no longer also changing non-idiomatic but unrelated aspects. - Suggestion text no longer mentions changes when those changes don't occur in that specific suggestion. r? `@jieyouxu`
…taxes-rewording, r=traviscross,jieyouxu Reword mismatched-lifetime-syntaxes text based on feedback Key changes include: - Removal of the word "syntax" from the lint message. More accurately, it could have been something like "syntax group" or "syntax category", but avoiding it completely is easier. - The primary lint message now reflects exactly which mismatch is occurring, instead of trying to be general. A new `help` line is general across the mismatch kinds. - Suggestions have been reduced to be more minimal, no longer also changing non-idiomatic but unrelated aspects. - Suggestion text no longer mentions changes when those changes don't occur in that specific suggestion. r? ``@jieyouxu``
…taxes-rewording, r=traviscross,jieyouxu Reword mismatched-lifetime-syntaxes text based on feedback Key changes include: - Removal of the word "syntax" from the lint message. More accurately, it could have been something like "syntax group" or "syntax category", but avoiding it completely is easier. - The primary lint message now reflects exactly which mismatch is occurring, instead of trying to be general. A new `help` line is general across the mismatch kinds. - Suggestions have been reduced to be more minimal, no longer also changing non-idiomatic but unrelated aspects. - Suggestion text no longer mentions changes when those changes don't occur in that specific suggestion. r? ```@jieyouxu```
Key changes include:
help
line is general across the mismatch kinds.r? @jieyouxu