diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-17 21:33:41 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-17 21:33:41 +0000 |
commit | 62c059ea74be10abe594d56daf9ee44480c06dfb (patch) | |
tree | 4eb8186596acd62264d5537d213a983a6da9a18c /crates/hir_ty/src/tests | |
parent | afcc0da3a1e71c12e2d4b152ee3b6b786ce06513 (diff) | |
parent | a85b32abdc7a9f742e21b1624852eeb04334d4fd (diff) |
Merge #8076
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 <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/tests')
-rw-r--r-- | crates/hir_ty/src/tests/traits.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 93d3ad020..8270fa219 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs | |||
@@ -3253,3 +3253,24 @@ fn f() { | |||
3253 | "#, | 3253 | "#, |
3254 | ); | 3254 | ); |
3255 | } | 3255 | } |
3256 | |||
3257 | #[test] | ||
3258 | fn nested_inner_function_calling_self() { | ||
3259 | check_infer( | ||
3260 | r#" | ||
3261 | struct S; | ||
3262 | fn f() { | ||
3263 | fn inner() -> S { | ||
3264 | let s = inner(); | ||
3265 | } | ||
3266 | } | ||
3267 | "#, | ||
3268 | expect![[r#" | ||
3269 | 17..73 '{ ... } }': () | ||
3270 | 39..71 '{ ... }': () | ||
3271 | 53..54 's': S | ||
3272 | 57..62 'inner': fn inner() -> S | ||
3273 | 57..64 'inner()': S | ||
3274 | "#]], | ||
3275 | ) | ||
3276 | } | ||