Closed
Description
struct Warns;
struct WarnsNot1 { a: uint }
struct WarnsNot2(uint);
fn main() {
Warns;
WarnsNot1 { a: 0 };
WarnsNot2(0u);
}
This produces a #[warn(path_statement)]
warning for the Warns
statement, but not for the WarnsNotX
statements.
This is somewhat understandable, as the later two can have side effects as part of evaluating their arguments, and also expected of functions in general.
But it might be useful to have a lint for struct and enum constructors whose result is discarded like this.