aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/tests/data/binary_op.txt
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-07 20:05:44 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-07 20:05:44 +0000
commit812e47785b4f14a961f97414d0ca69d8c9bf5c9c (patch)
treef4e1936de76bee89502613ce038f4ecaef19ec4b /crates/ra_hir/src/ty/tests/data/binary_op.txt
parente2592cf09087ae0a6cad5b588cbf1ab1161440e9 (diff)
parent5d15dd70b037b3d1623ebd83d8ef0f66ad6950af (diff)
Merge #451
451: More type inference for more binary expressions r=flodiebold a=marcusklaas Implements more of https://github.com/rust-analyzer/rust-analyzer/issues/390. Just works for primitive (numeric) types for now. Found an issue where `let x: Ty = expr;` doesn't actually propagate the type information unless `Ty` is primitive and numeric. I'll open an issue for this. Co-authored-by: Marcus Klaas de Vries <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/ty/tests/data/binary_op.txt')
-rw-r--r--crates/ra_hir/src/ty/tests/data/binary_op.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/tests/data/binary_op.txt b/crates/ra_hir/src/ty/tests/data/binary_op.txt
new file mode 100644
index 000000000..59c07ff43
--- /dev/null
+++ b/crates/ra_hir/src/ty/tests/data/binary_op.txt
@@ -0,0 +1,46 @@
1[6; 7) 'x': [unknown]
2[22; 34) '{ 0i32 }': i32
3[28; 32) '0i32': i32
4[46; 342) '{ ... < 3 }': bool
5[56; 57) 'x': bool
6[60; 61) 'a': bool
7[60; 66) 'a && b': bool
8[65; 66) 'b': bool
9[76; 77) 'y': bool
10[80; 84) 'true': bool
11[80; 93) 'true || false': bool
12[88; 93) 'false': bool
13[103; 104) 'z': bool
14[107; 108) 'x': bool
15[107; 113) 'x == y': bool
16[112; 113) 'y': bool
17[123; 134) 'minus_forty': isize
18[144; 152) '-40isize': isize
19[145; 152) '40isize': [unknown]
20[162; 163) 'h': bool
21[166; 177) 'minus_forty': isize
22[166; 188) 'minus_...ONST_2': bool
23[181; 188) 'CONST_2': isize
24[198; 199) 'c': i32
25[202; 203) 'f': fn([unknown],) -> i32
26[202; 211) 'f(z || y)': i32
27[202; 215) 'f(z || y) + 5': i32
28[204; 205) 'z': bool
29[204; 210) 'z || y': bool
30[209; 210) 'y': bool
31[214; 215) '5': i32
32[225; 226) 'd': [unknown]
33[229; 230) 'b': [unknown]
34[240; 241) 'g': ()
35[244; 255) 'minus_forty': isize
36[244; 260) 'minus_...y ^= i': ()
37[259; 260) 'i': isize
38[270; 273) 'ten': usize
39[283; 285) '10': usize
40[295; 308) 'ten_is_eleven': bool
41[311; 314) 'ten': usize
42[311; 326) 'ten == some_num': bool
43[318; 326) 'some_num': usize
44[333; 336) 'ten': usize
45[333; 340) 'ten < 3': bool
46[339; 340) '3': usize