diff options
author | Florian Diebold <[email protected]> | 2018-12-24 20:00:14 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2018-12-25 14:16:42 +0000 |
commit | 6fcd38cc81bdcc9921da767872dfce65ee7d2d27 (patch) | |
tree | 5d5ae0f57cc25d0bf8b0613a5e05de1f773b42ef /crates/ra_hir/src/ty | |
parent | 4ff161852016c6c15954d6f30bd637834a2b2b68 (diff) |
Infer result of struct literals, and recurse into their child expressions
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/tests.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/tests/data/0004_struct.txt | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index 170eef147..9bb58ec85 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -82,7 +82,7 @@ struct C(usize); | |||
82 | fn test() { | 82 | fn test() { |
83 | let c = C(1); | 83 | let c = C(1); |
84 | B; | 84 | B; |
85 | let a: A = A { b: B, c: C() }; | 85 | let a: A = A { b: B, c: C(1) }; |
86 | a.b; | 86 | a.b; |
87 | a.c; | 87 | a.c; |
88 | } | 88 | } |
diff --git a/crates/ra_hir/src/ty/tests/data/0004_struct.txt b/crates/ra_hir/src/ty/tests/data/0004_struct.txt index a4371c5a5..41357749f 100644 --- a/crates/ra_hir/src/ty/tests/data/0004_struct.txt +++ b/crates/ra_hir/src/ty/tests/data/0004_struct.txt | |||
@@ -1,10 +1,14 @@ | |||
1 | [86; 90) 'C(1)': [unknown] | 1 | [86; 90) 'C(1)': [unknown] |
2 | [72; 153) '{ ...a.c; }': () | 2 | [121; 122) 'B': [unknown] |
3 | [86; 87) 'C': [unknown] | 3 | [86; 87) 'C': [unknown] |
4 | [129; 130) '1': [unknown] | ||
4 | [107; 108) 'a': A | 5 | [107; 108) 'a': A |
5 | [114; 132) 'A { b:... C() }': [unknown] | 6 | [127; 128) 'C': [unknown] |
6 | [138; 141) 'a.b': [unknown] | 7 | [139; 142) 'a.b': [unknown] |
7 | [147; 150) 'a.c': [unknown] | 8 | [114; 133) 'A { b:...C(1) }': A |
9 | [148; 151) 'a.c': [unknown] | ||
10 | [72; 154) '{ ...a.c; }': () | ||
8 | [96; 97) 'B': [unknown] | 11 | [96; 97) 'B': [unknown] |
9 | [88; 89) '1': [unknown] | 12 | [88; 89) '1': [unknown] |
10 | [82; 83) 'c': [unknown] | 13 | [82; 83) 'c': [unknown] |
14 | [127; 131) 'C(1)': [unknown] | ||