use code from bug report for regression test

This commit is contained in:
jDomantas 2023-09-17 16:52:32 +03:00
parent a0c31b73d8
commit b3aba94cbd

View File

@ -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();
}
"#,
);