Avoid linting unreachable_code on todo!()#3928
Conversation
|
Note that rust#149543 has an implementation. |
|
Another note: The implementation is finally ready to merge, provided this RFC is accepted. |
Add another alternative Co-authored-by: Josh Triplett <josh@joshtriplett.org>
|
This is the RFC we solicited, presenting exactly what we asked for. @rfcbot merge lang |
|
Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
|
@rfcbot reviewed I'm a big fan of both this specific idea and the general trend of thinking about how our lints feel during the process of authoring code, not just once the code is done. Dead code warnings in particular are often a pain point for me ("sure, it's dead now but that's because I didn't get around to calling it yet..."). |
Because
todo!()is often used as a placeholder while working on the code, we should avoid lintingunreachable_codeon code after those macro uses. Instead let's add atodo_macro_useslint that we can selectively activate e.g. when compiling a release.This will reduce message churn and allow users to concentrate on the warnings and errors that matter while they work on the code.
Rendered