Skip to content

Commit a77789e

Browse files
committed
regression test
1 parent 9d0ccf0 commit a77789e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

crates/ide-diagnostics/src/handlers/mutability_errors.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,27 @@ fn f() {
11701170
loop {}
11711171
for _ in 0..2 {}
11721172
}
1173+
"#,
1174+
);
1175+
}
1176+
1177+
#[test]
1178+
fn regression_15623() {
1179+
check_diagnostics(
1180+
r#"
1181+
struct Foo;
1182+
1183+
impl Foo {
1184+
fn needs_mut(&mut self) {}
1185+
}
1186+
1187+
fn main() {
1188+
let mut foo = Foo;
1189+
|| {
1190+
let 0 = 1 else { return };
1191+
foo.needs_mut();
1192+
};
1193+
}
11731194
"#,
11741195
);
11751196
}

0 commit comments

Comments
 (0)