mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Add test for self-calling inner function
This commit is contained in:
parent
9d691530d5
commit
a85b32abdc
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||||
|
"#]],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue