11

Make ForceWarn a lint level. by cjgillot · Pull Request #86009 · rust-lang/rust...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/86009
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

rylev commented 24 days ago

Hmmm error is not a lint level. Did you mean deny? If so, then I see where you're coming from.

My issue is that Level is also used for lint definitions, and it didn't make sense to me for a lint to define its level as being ForceWarn. However, I now see that it might make sense for there to be a level that is logically like Warn but that cannot be turned off. Just like Forbid is like Deny but cannot be turned off.

I believe my issue is one of nomenclature. From the command line, the user is logically forcing a certain lint to warn so the name "force-warn" makes sense. But at the lint definition site, if you sent level to ForceWarn you're really saying, we want that this always emits a warning so perhaps the name AlwaysWarn makes more sense.

I'm largely in favor this change now, but two questions:

  • Does the name ForceWarn actually make sense? Since the command line option is unstable, it's easy for us to change the name.
  • Can we document somewhere the analogy of force-warn is to warn as forbid is to deny? This should clarify things.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK