You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
@SiegeLord: Well, both structs constructors have no side effects and only exist to return a value. So I guess what I want is something like #[must_use] automatically applied to all of them :P
This produces a
#[warn(path_statement)]
warning for theWarns
statement, but not for theWarnsNotX
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.
The text was updated successfully, but these errors were encountered: