Add warning about side-effect free expression-statement #32108
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
A programming beginner could write something like
I would expect to see a warning about this side effect free expression statement in line 2. However, I can imagine that it could be quite hard to determine if such an expression is side effect free. After all, operators for non-standard types could have side effects, too.
Now I don't think some crazy analysis about side-effect-behavior of an expression is useful in this situation. I just thought that some very basic and specialized lints (just for primitive types for example) could be very helpful -- especially for beginners.
The text was updated successfully, but these errors were encountered: