New error appearing in rust 1.72?

This simple code snippet used to work just fine. Now, suddenly, I get errors that hem should be mut.
However, when I make it mut, I then get warnings: 'remove unnecessary mut' !?!
What gives?

    let mut hemis = vec![0_f64; 2*dims]; 
    hemis.iter_mut().for_each(|hem| *hem /= wsum );

That snippet works fine: Rust Playground

Can you provide a more complete example that demonstrates the error on the playground?

1 Like

Other things to try:

  • Might be your IDE etc if you have one: run cargo directly
  • Might be a cache problem: cargo clean

Yeah, it is really weird, keeps coming and going. I suspect the VSCode.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.