Pre-RFC: warning for assignment to temporary

For simple useless code:

    fn main() {
        (0, ).0 = 1;
    }

Compiler not generate any warnings/errors, but clippy generate one warning:

warning: assignment to temporary
 --> src/main.rs:4:5
  |
4 |     (0, ).0 = 1;
  |     ^^^^^^^^^^^
  |

I think this warning need to implement in compiler too.

2 Likes

Please create an issue at https://github.com/rust-lang/rust-clippy.

Thanks, I do it.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.