Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-diagnostics/src/handlers/mutability_errors.rs')
-rw-r--r--crates/ide-diagnostics/src/handlers/mutability_errors.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/ide-diagnostics/src/handlers/mutability_errors.rs b/crates/ide-diagnostics/src/handlers/mutability_errors.rs
index 2887a32825..18280a4add 100644
--- a/crates/ide-diagnostics/src/handlers/mutability_errors.rs
+++ b/crates/ide-diagnostics/src/handlers/mutability_errors.rs
@@ -995,10 +995,6 @@ fn fn_once(mut x: impl FnOnce(u8) -> u8) -> u8 {
}
"#,
);
- // FIXME: There should be no "unused variable" here, and there should be a mutability error,
- // but our MIR infra is horribly broken and due to the order in which expressions are lowered
- // there is no `StorageLive` for `x` in the closure (in fact, `x` should not even be a variable
- // of the closure, the environment should be, but as I said, our MIR infra is horribly broken).
check_diagnostics(
r#"
//- minicore: copy, fn
@@ -1007,8 +1003,8 @@ fn f() {
|| {
|| {
let x = 2;
- // ^ 💡 warn: unused variable
|| { || { x = 5; } }
+ //^^^^^ 💡 error: cannot mutate immutable variable `x`
}
}
};