diff options
| author | jDomantas <djadenkus@gmail.com> | 2023-09-17 11:54:42 +0300 |
|---|---|---|
| committer | jDomantas <djadenkus@gmail.com> | 2023-09-17 11:54:42 +0300 |
| commit | a77789e7aa50a652cbd15cfd400acdfc4602167c (patch) | |
| tree | 039a7858c0752134c0e8dbaeb8a4cffc0d34e5b5 | |
| parent | 9d0ccf01a16f4ab72417a804c5a7414f312d95a0 (diff) | |
regression test
| -rw-r--r-- | crates/ide-diagnostics/src/handlers/mutability_errors.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/ide-diagnostics/src/handlers/mutability_errors.rs b/crates/ide-diagnostics/src/handlers/mutability_errors.rs index 8976a3de67b..d03a0009c48 100644 --- a/crates/ide-diagnostics/src/handlers/mutability_errors.rs +++ b/crates/ide-diagnostics/src/handlers/mutability_errors.rs @@ -1173,4 +1173,25 @@ fn f() { "#, ); } + + #[test] + fn regression_15623() { + check_diagnostics( + r#" +struct Foo; + +impl Foo { + fn needs_mut(&mut self) {} +} + +fn main() { + let mut foo = Foo; + || { + let 0 = 1 else { return }; + foo.needs_mut(); + }; +} +"#, + ); + } } |
