mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Fix panic in const eval and parameter destructing
This commit is contained in:
parent
2feabc4dc4
commit
01c1b3dc71
6 changed files with 57 additions and 17 deletions
|
@ -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`
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue