Fix panic in const eval and parameter destructing

This commit is contained in:
hkalbasi 2023-04-24 00:49:57 +03:30
parent 2feabc4dc4
commit 01c1b3dc71
6 changed files with 57 additions and 17 deletions

View file

@ -544,6 +544,15 @@ fn f(x: i32) {
x = 5;
//^^^^^ 💡 error: cannot mutate immutable variable `x`
}
"#,
);
check_diagnostics(
r#"
fn f((x, y): (i32, i32)) {
let t = [0; 2];
x = 5;
//^^^^^ 💡 error: cannot mutate immutable variable `x`
}
"#,
);
}