Skip to content

Error cannot mutate immutable variable when using itertools #16994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
art-den opened this issue Apr 2, 2024 · 1 comment
Closed

Error cannot mutate immutable variable when using itertools #16994

art-den opened this issue Apr 2, 2024 · 1 comment
Labels
C-bug Category: bug

Comments

@art-den
Copy link

art-den commented Apr 2, 2024

rust-analyzer version: 0.4.1907-standalone

rustc version: rustc 1.77.0 (aedd173a2 2024-03-17)

editor or extension: VSCodium

code snippet to reproduce:

fn main() {
    // [dependencies]
    // itertools = "0.12"

    use itertools::*;

    for (m1, m2, (s1, s2))
    in izip!(&mut [1; 10], &mut [1; 10], [1; 10].iter().tuples()) {
        *m1 = *s1;
        *m2 = *s2; // cannot mutate immutable variable `m2` rust-analyzer (E0384)
    }
}
@art-den art-den added the C-bug Category: bug label Apr 2, 2024
@Veykril
Copy link
Member

Veykril commented Apr 2, 2024

Duplicate of #11681

@Veykril Veykril marked this as a duplicate of #11681 Apr 2, 2024
@Veykril Veykril closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants