External Publication
Visit Post

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

Rust Internals [Unofficial] March 11, 2026
Source

georgebarwood:

I think it is better to keep the warning, rather than have special cases

There is a lot of value in having warnings be precise. Noisy warnings only justify false positives if the true positives commonly identify real bugs.

In this case there seems to be a lot of speculation that the warned case is ambiguous. I don't know either way. I do know that clap already has an impl Args for (), but args: () still fires the warning. Could it be relaxed in that specific case?

Discussion in the ATmosphere

Loading comments...