Parameterized lints (unused_must_use)


#1

Some lints should be parameterized, an good example is unused_must_use. Sometimes you want to ignore Result but not ignore anything else:

#[allow(unused_must_use(std::result::Result))]
fn main() {
use std::fs::write as w;
w("foo", foo());
w("bar", bar());
// ...
}

This should be possible.


#2

I think this would require an RFC.

Personally, I’d want to see a lot more use-cases to be convinced that the extra complexity would be worth the gain in functionality. (Why would you want to ignore specifically all Results in a given scope? What other lints would benefit from parametrization?)


#3

Why not use question-mark-in-main and then ? on those writes?