8076: Add test for self-calling inner function r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4438 (and duplicates)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2021-03-17 21:33:41 +00:00 committed by GitHub
commit 62c059ea74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3253,3 +3253,24 @@ fn f() {
"#,
);
}
#[test]
fn nested_inner_function_calling_self() {
check_infer(
r#"
struct S;
fn f() {
fn inner() -> S {
let s = inner();
}
}
"#,
expect![[r#"
17..73 '{ ... } }': ()
39..71 '{ ... }': ()
53..54 's': S
57..62 'inner': fn inner() -> S
57..64 'inner()': S
"#]],
)
}