From b3aba94cbdde83c66d23e5560840b247250aa065 Mon Sep 17 00:00:00 2001 From: jDomantas Date: Sun, 17 Sep 2023 16:52:32 +0300 Subject: [PATCH] use code from bug report for regression test --- crates/ide-diagnostics/src/handlers/mutability_errors.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ide-diagnostics/src/handlers/mutability_errors.rs b/crates/ide-diagnostics/src/handlers/mutability_errors.rs index d03a0009c48..d056e5c85cc 100644 --- a/crates/ide-diagnostics/src/handlers/mutability_errors.rs +++ b/crates/ide-diagnostics/src/handlers/mutability_errors.rs @@ -1178,18 +1178,20 @@ fn f() { fn regression_15623() { check_diagnostics( r#" +//- minicore: fn + struct Foo; impl Foo { fn needs_mut(&mut self) {} } -fn main() { - let mut foo = Foo; - || { +fn foo(mut foo: Foo) { + let mut call_me = || { let 0 = 1 else { return }; foo.needs_mut(); }; + call_me(); } "#, );