#Feedback on lint phrasing

13 messages · Page 1 of 1 (latest)

ebon skiff
#

I've been working on a new lint. It's been merged and is available in beta. We then got a bunch of people who don't worship me had comments on the phrasing of the lint, so it's being reworded. Against my better judgement, I figured I'd ask for feedback from y'all as well!

This is the complete test for the lint, but a single common example is:

error: hiding a lifetime that's elided elsewhere is confusing
  --> $DIR/mismatched-lifetime-syntaxes.rs:46:37
   |
LL | fn implicit_ref_to_implicit_path(v: &u8) -> ContainsLifetime {
   |                                     ^^^     ---------------- the same lifetime is hidden here
   |                                     |
   |                                     the lifetime is elided here
   |
   = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: remove the lifetime name from references and use `'_` for paths
   |
LL | fn implicit_ref_to_implicit_path(v: &u8) -> ContainsLifetime<'_> {
   |                                                             ++++
nimble sentinel
#

"remove the lifetime name from references" definitely needs to be removed when it is not applicable as in this example

#

people trying to understand compiler recommendations will be poring over every single word, so it is valuable to make as many of them as Gricean as possible

candid marsh
#

'paths' referring to ContainsLifetime is definitely going to hurt

nimble sentinel
#

oh yes, that's jargony. is there a reason saying "type name" instead of "path" would be wrong here? …I suppose because &u8 is also the name of a type

candid marsh
#

I'd say 'generic types', even if there are non-type lifetimed paths I'm not thinking of, unless one of them is actually being used

#

even if &u8 is technically a generic type, the meaning is clear

nimble sentinel
#

also I kind of feel this should really have an error code and info page with a more detailed explanation … can warnings have error codes?

candid marsh
#

not sure what to think about 'hiding' vs 'omitting'

ebon skiff
#

For clarity...

  1. The central place of discussion is on Zulip. Since I asked for feedback here, I'll do my best to copy it back to there. You may or may not want to also say things there.
  2. Not all suggestions will be acted on / acted on in the way you want. 🙂
ebon skiff
ebon skiff
ebon skiff