External Publication
Visit Post

Pre-feature request: suppress unused variable warning for unit-type arguments

Rust Internals [Unofficial] March 11, 2026
Source

@RalfJung I am not entirely sure this proposal is worth it myself (which is why I didn't just file an enhancement request on the compiler) but does it make more sense to you if I say that the main thing I don't like about shutting up the warning with a leading _, in this case, is that I will then have to remove that leading _ when, inevitably, the subcommand grows some options?

@Vorpal The struct itself has to exist because that's how clap works, and it has to be supplied as an argument to the subcommand run function in order to keep the API between main and the subcommand run functions uniform. Again, the goal is to keep churn to an absolute minimum when, inevitably, options are added to subcommands that didn't have them.

Discussion in the ATmosphere

Loading comments...