aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/snapshots
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2019-01-21 21:52:35 +0000
committerFlorian Diebold <[email protected]>2019-01-21 21:52:35 +0000
commita2521106163d3aaeeecfb28cae42d6aba99bba3f (patch)
tree4ade9a3c88710600ca4375ea5f1790e6a23eabc4 /crates/ra_hir/src/ty/snapshots
parent0d2cb60f93c5e73c0171e83fef36b696cc5dd4ff (diff)
Use insta for ty tests
Diffstat (limited to 'crates/ra_hir/src/ty/snapshots')
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__bug_484.snap10
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__bug_585.snap13
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_adt_pattern.snap27
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_array.snap57
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap25
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_basics.snap18
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_binary_op.snap51
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_enum.snap9
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_field_autoderef.snap48
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap19
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_generic_chain.snap34
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_generics_in_patterns.snap22
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_inherent_method.snap23
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_let.snap12
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_literals.snap17
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap14
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_pattern.snap52
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_refs.snap28
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_self.snap11
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_struct.snap21
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_struct_generics.snap20
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_tuple.snap32
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__infer_unary_op.snap33
-rw-r--r--crates/ra_hir/src/ty/snapshots/tests__no_panic_on_field_of_enum.snap9
24 files changed, 605 insertions, 0 deletions
diff --git a/crates/ra_hir/src/ty/snapshots/tests__bug_484.snap b/crates/ra_hir/src/ty/snapshots/tests__bug_484.snap
new file mode 100644
index 000000000..eeb3061d3
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__bug_484.snap
@@ -0,0 +1,10 @@
1Created: 2019-01-21T21:48:20.662863951+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[11; 37) '{ l... {}; }': ()
6[20; 21) 'x': ()
7[24; 34) 'if true {}': ()
8[27; 31) 'true': bool
9[32; 34) '{}': ()
10
diff --git a/crates/ra_hir/src/ty/snapshots/tests__bug_585.snap b/crates/ra_hir/src/ty/snapshots/tests__bug_585.snap
new file mode 100644
index 000000000..073009bbc
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__bug_585.snap
@@ -0,0 +1,13 @@
1Created: 2019-01-21T21:48:20.662863969+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[11; 89) '{ ... } }': ()
6[17; 21) 'X {}': [unknown]
7[27; 87) 'match ... }': ()
8[33; 34) 'x': [unknown]
9[45; 52) 'A::B {}': [unknown]
10[56; 58) '()': ()
11[68; 74) 'A::Y()': [unknown]
12[78; 80) '()': ()
13
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_adt_pattern.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_adt_pattern.snap
new file mode 100644
index 000000000..fb261f1c0
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_adt_pattern.snap
@@ -0,0 +1,27 @@
1Created: 2019-01-21T21:48:20.662935249+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[68; 262) '{ ... d; }': ()
6[78; 79) 'e': E
7[82; 95) 'E::A { x: 3 }': E
8[92; 93) '3': usize
9[106; 113) 'S(y, z)': S
10[108; 109) 'y': u32
11[111; 112) 'z': E
12[116; 119) 'foo': S
13[129; 148) 'E::A {..._var }': E
14[139; 146) 'new_var': usize
15[151; 152) 'e': E
16[159; 218) 'match ... }': usize
17[165; 166) 'e': E
18[177; 187) 'E::A { x }': E
19[184; 185) 'x': usize
20[191; 192) 'x': usize
21[202; 206) 'E::B': E
22[210; 211) '1': usize
23[229; 248) 'ref d ...{ .. }': &E
24[237; 248) 'E::A { .. }': E
25[251; 252) 'e': E
26[258; 259) 'd': &E
27
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_array.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_array.snap
new file mode 100644
index 000000000..2fc613e26
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_array.snap
@@ -0,0 +1,57 @@
1Created: 2019-01-21T21:48:20.662961921+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[9; 10) 'x': &str
6[18; 19) 'y': isize
7[28; 293) '{ ... []; }': ()
8[38; 39) 'a': [&str]
9[42; 45) '[x]': [&str]
10[43; 44) 'x': &str
11[55; 56) 'b': [[&str]]
12[59; 65) '[a, a]': [[&str]]
13[60; 61) 'a': [&str]
14[63; 64) 'a': [&str]
15[75; 76) 'c': [[[&str]]]
16[79; 85) '[b, b]': [[[&str]]]
17[80; 81) 'b': [[&str]]
18[83; 84) 'b': [[&str]]
19[96; 97) 'd': [isize]
20[100; 112) '[y, 1, 2, 3]': [isize]
21[101; 102) 'y': isize
22[104; 105) '1': isize
23[107; 108) '2': isize
24[110; 111) '3': isize
25[122; 123) 'd': [isize]
26[126; 138) '[1, y, 2, 3]': [isize]
27[127; 128) '1': isize
28[130; 131) 'y': isize
29[133; 134) '2': isize
30[136; 137) '3': isize
31[148; 149) 'e': [isize]
32[152; 155) '[y]': [isize]
33[153; 154) 'y': isize
34[165; 166) 'f': [[isize]]
35[169; 175) '[d, d]': [[isize]]
36[170; 171) 'd': [isize]
37[173; 174) 'd': [isize]
38[185; 186) 'g': [[isize]]
39[189; 195) '[e, e]': [[isize]]
40[190; 191) 'e': [isize]
41[193; 194) 'e': [isize]
42[206; 207) 'h': [i32]
43[210; 216) '[1, 2]': [i32]
44[211; 212) '1': i32
45[214; 215) '2': i32
46[226; 227) 'i': [&str]
47[230; 240) '["a", "b"]': [&str]
48[231; 234) '"a"': &str
49[236; 239) '"b"': &str
50[251; 252) 'b': [[&str]]
51[255; 265) '[a, ["b"]]': [[&str]]
52[256; 257) 'a': [&str]
53[259; 264) '["b"]': [&str]
54[260; 263) '"b"': &str
55[275; 276) 'x': [u8]
56[288; 290) '[]': [u8]
57
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap
new file mode 100644
index 000000000..12f0d8c90
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap
@@ -0,0 +1,25 @@
1Created: 2019-01-21T21:48:20.662902243+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[14; 15) 'x': u32
6[22; 24) '{}': ()
7[78; 231) '{ ...t &c }': &mut &f64
8[88; 89) 'a': u32
9[92; 108) 'unknow...nction': [unknown]
10[92; 110) 'unknow...tion()': u32
11[116; 125) 'takes_u32': fn(u32) -> ()
12[116; 128) 'takes_u32(a)': ()
13[126; 127) 'a': u32
14[138; 139) 'b': i32
15[142; 158) 'unknow...nction': [unknown]
16[142; 160) 'unknow...tion()': i32
17[166; 184) 'S { i3...d: b }': S
18[181; 182) 'b': i32
19[194; 195) 'c': f64
20[198; 214) 'unknow...nction': [unknown]
21[198; 216) 'unknow...tion()': f64
22[222; 229) '&mut &c': &mut &f64
23[227; 229) '&c': &f64
24[228; 229) 'c': f64
25
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_basics.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_basics.snap
new file mode 100644
index 000000000..eba8126e9
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_basics.snap
@@ -0,0 +1,18 @@
1Created: 2019-01-21T21:48:20.662874226+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[9; 10) 'a': u32
6[17; 18) 'b': isize
7[27; 28) 'c': !
8[33; 34) 'd': &str
9[42; 121) '{ ...f32; }': ()
10[48; 49) 'a': u32
11[55; 56) 'b': isize
12[62; 63) 'c': !
13[69; 70) 'd': &str
14[76; 82) '1usize': usize
15[88; 94) '1isize': isize
16[100; 106) '"test"': &str
17[112; 118) '1.0f32': f32
18
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_binary_op.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_binary_op.snap
new file mode 100644
index 000000000..3b750ec45
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_binary_op.snap
@@ -0,0 +1,51 @@
1Created: 2019-01-21T21:48:20.662972146+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[6; 7) 'x': bool
6[22; 34) '{ 0i32 }': i32
7[28; 32) '0i32': i32
8[54; 350) '{ ... < 3 }': bool
9[64; 65) 'x': bool
10[68; 69) 'a': bool
11[68; 74) 'a && b': bool
12[73; 74) 'b': bool
13[84; 85) 'y': bool
14[88; 92) 'true': bool
15[88; 101) 'true || false': bool
16[96; 101) 'false': bool
17[111; 112) 'z': bool
18[115; 116) 'x': bool
19[115; 121) 'x == y': bool
20[120; 121) 'y': bool
21[131; 142) 'minus_forty': isize
22[152; 160) '-40isize': isize
23[153; 160) '40isize': isize
24[170; 171) 'h': bool
25[174; 185) 'minus_forty': isize
26[174; 196) 'minus_...ONST_2': bool
27[189; 196) 'CONST_2': isize
28[206; 207) 'c': i32
29[210; 211) 'f': fn(bool) -> i32
30[210; 219) 'f(z || y)': i32
31[210; 223) 'f(z || y) + 5': i32
32[212; 213) 'z': bool
33[212; 218) 'z || y': bool
34[217; 218) 'y': bool
35[222; 223) '5': i32
36[233; 234) 'd': [unknown]
37[237; 238) 'b': [unknown]
38[248; 249) 'g': ()
39[252; 263) 'minus_forty': isize
40[252; 268) 'minus_...y ^= i': ()
41[267; 268) 'i': isize
42[278; 281) 'ten': usize
43[291; 293) '10': usize
44[303; 316) 'ten_is_eleven': bool
45[319; 322) 'ten': usize
46[319; 334) 'ten == some_num': bool
47[326; 334) 'some_num': usize
48[341; 344) 'ten': usize
49[341; 348) 'ten < 3': bool
50[347; 348) '3': usize
51
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_enum.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_enum.snap
new file mode 100644
index 000000000..8018ff025
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_enum.snap
@@ -0,0 +1,9 @@
1Created: 2019-01-21T21:48:20.662949719+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[48; 82) '{ E:...:V2; }': ()
6[52; 70) 'E::V1 ...d: 1 }': E
7[67; 68) '1': u32
8[74; 79) 'E::V2': E
9
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_field_autoderef.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_field_autoderef.snap
new file mode 100644
index 000000000..1943ef079
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_field_autoderef.snap
@@ -0,0 +1,48 @@
1Created: 2019-01-21T21:48:20.671554939+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[44; 45) 'a': A
6[50; 213) '{ ...5.b; }': ()
7[60; 62) 'a1': A
8[65; 66) 'a': A
9[72; 74) 'a1': A
10[72; 76) 'a1.b': B
11[86; 88) 'a2': &A
12[91; 93) '&a': &A
13[92; 93) 'a': A
14[99; 101) 'a2': &A
15[99; 103) 'a2.b': B
16[113; 115) 'a3': &mut A
17[118; 124) '&mut a': &mut A
18[123; 124) 'a': A
19[130; 132) 'a3': &mut A
20[130; 134) 'a3.b': B
21[144; 146) 'a4': &&&&&&&A
22[149; 157) '&&&&&&&a': &&&&&&&A
23[150; 157) '&&&&&&a': &&&&&&A
24[151; 157) '&&&&&a': &&&&&A
25[152; 157) '&&&&a': &&&&A
26[153; 157) '&&&a': &&&A
27[154; 157) '&&a': &&A
28[155; 157) '&a': &A
29[156; 157) 'a': A
30[163; 165) 'a4': &&&&&&&A
31[163; 167) 'a4.b': B
32[177; 179) 'a5': &mut &&mut &&mut A
33[182; 200) '&mut &...&mut a': &mut &&mut &&mut A
34[187; 200) '&&mut &&mut a': &&mut &&mut A
35[188; 200) '&mut &&mut a': &mut &&mut A
36[193; 200) '&&mut a': &&mut A
37[194; 200) '&mut a': &mut A
38[199; 200) 'a': A
39[206; 208) 'a5': &mut &&mut &&mut A
40[206; 210) 'a5.b': B
41[224; 226) 'a1': *const A
42[238; 240) 'a2': *mut A
43[250; 273) '{ ...2.b; }': ()
44[256; 258) 'a1': *const A
45[256; 260) 'a1.b': B
46[266; 268) 'a2': *mut A
47[266; 270) 'a2.b': B
48
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap
new file mode 100644
index 000000000..386acc0b3
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap
@@ -0,0 +1,19 @@
1Created: 2019-01-21T21:48:20.669112954+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[10; 11) 't': [unknown]
6[21; 26) '{ t }': [unknown]
7[23; 24) 't': [unknown]
8[38; 98) '{ ...(1); }': ()
9[44; 46) 'id': fn(T) -> T
10[44; 52) 'id(1u32)': T
11[47; 51) '1u32': u32
12[58; 68) 'id::<i128>': fn(T) -> T
13[58; 71) 'id::<i128>(1)': T
14[69; 70) '1': T
15[81; 82) 'x': T
16[90; 92) 'id': fn(T) -> T
17[90; 95) 'id(1)': T
18[93; 94) '1': T
19
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_generic_chain.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_generic_chain.snap
new file mode 100644
index 000000000..7a64e4f95
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_generic_chain.snap
@@ -0,0 +1,34 @@
1Created: 2019-01-21T21:48:20.672467086+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[53; 57) 'self': A<[unknown]>
6[65; 87) '{ ... }': [unknown]
7[75; 79) 'self': A<[unknown]>
8[75; 81) 'self.x': [unknown]
9[99; 100) 't': [unknown]
10[110; 115) '{ t }': [unknown]
11[112; 113) 't': [unknown]
12[135; 261) '{ ....x() }': i128
13[146; 147) 'x': T
14[150; 151) '1': T
15[162; 163) 'y': T
16[166; 168) 'id': fn(T) -> T
17[166; 171) 'id(x)': T
18[169; 170) 'x': T
19[182; 183) 'a': A<T>
20[186; 200) 'A { x: id(y) }': A<T>
21[193; 195) 'id': fn(T) -> T
22[193; 198) 'id(y)': T
23[196; 197) 'y': T
24[211; 212) 'z': T
25[215; 217) 'id': fn(T) -> T
26[215; 222) 'id(a.x)': T
27[218; 219) 'a': A<T>
28[218; 221) 'a.x': T
29[233; 234) 'b': A<T>
30[237; 247) 'A { x: z }': A<T>
31[244; 245) 'z': T
32[254; 255) 'b': A<T>
33[254; 259) 'b.x()': i128
34
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_generics_in_patterns.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_generics_in_patterns.snap
new file mode 100644
index 000000000..ae38ec2fb
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_generics_in_patterns.snap
@@ -0,0 +1,22 @@
1Created: 2019-01-21T21:48:20.683908196+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[79; 81) 'a1': A<u32>
6[91; 92) 'o': Option<u64>
7[107; 244) '{ ... }; }': ()
8[117; 128) 'A { x: x2 }': A<u32>
9[124; 126) 'x2': u32
10[131; 133) 'a1': A<u32>
11[143; 161) 'A::<i6...: x3 }': A<i64>
12[157; 159) 'x3': i64
13[164; 174) 'A { x: 1 }': A<i64>
14[171; 172) '1': i64
15[180; 241) 'match ... }': u64
16[186; 187) 'o': Option<u64>
17[198; 213) 'Option::Some(t)': Option<u64>
18[211; 212) 't': u64
19[217; 218) 't': u64
20[228; 229) '_': Option<u64>
21[233; 234) '1': u64
22
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_inherent_method.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_inherent_method.snap
new file mode 100644
index 000000000..298dac585
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_inherent_method.snap
@@ -0,0 +1,23 @@
1Created: 2019-01-21T21:48:20.670255659+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[32; 36) 'self': A
6[38; 39) 'x': u32
7[53; 55) '{}': ()
8[103; 107) 'self': &A
9[109; 110) 'x': u64
10[124; 126) '{}': ()
11[144; 145) 'a': A
12[150; 198) '{ ...(1); }': ()
13[156; 157) 'a': A
14[156; 164) 'a.foo(1)': i32
15[162; 163) '1': u32
16[170; 181) '(&a).bar(1)': i64
17[171; 173) '&a': &A
18[172; 173) 'a': A
19[179; 180) '1': u64
20[187; 188) 'a': A
21[187; 195) 'a.bar(1)': i64
22[193; 194) '1': u64
23
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_let.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_let.snap
new file mode 100644
index 000000000..aa4e4cc63
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_let.snap
@@ -0,0 +1,12 @@
1Created: 2019-01-21T21:48:20.666406651+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[11; 71) '{ ...= b; }': ()
6[21; 22) 'a': isize
7[25; 31) '1isize': isize
8[41; 42) 'b': usize
9[52; 53) '1': usize
10[63; 64) 'c': usize
11[67; 68) 'b': usize
12
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_literals.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_literals.snap
new file mode 100644
index 000000000..00c7e639e
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_literals.snap
@@ -0,0 +1,17 @@
1Created: 2019-01-21T21:48:20.666200994+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[11; 201) '{ ...o"#; }': ()
6[17; 21) '5i32': i32
7[27; 34) '"hello"': &str
8[40; 48) 'b"bytes"': &[u8]
9[54; 57) ''c'': char
10[63; 67) 'b'b'': u8
11[73; 77) '3.14': f64
12[83; 87) '5000': i32
13[93; 98) 'false': bool
14[104; 108) 'true': bool
15[114; 182) 'r#" ... "#': &str
16[188; 198) 'br#"yolo"#': &[u8]
17
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap
new file mode 100644
index 000000000..0924cdc80
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap
@@ -0,0 +1,14 @@
1Created: 2019-01-21T21:48:20.671399345+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[15; 20) '{ 1 }': u32
6[17; 18) '1': u32
7[48; 53) '{ 1 }': u32
8[50; 51) '1': u32
9[67; 91) '{ ...c(); }': ()
10[73; 74) 'a': fn() -> u32
11[73; 76) 'a()': u32
12[82; 86) 'b::c': fn() -> u32
13[82; 88) 'b::c()': u32
14
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_pattern.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_pattern.snap
new file mode 100644
index 000000000..b22b71765
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_pattern.snap
@@ -0,0 +1,52 @@
1Created: 2019-01-21T21:48:20.677661229+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[9; 10) 'x': &i32
6[18; 369) '{ ...o_x; }': ()
7[28; 29) 'y': &i32
8[32; 33) 'x': &i32
9[43; 45) '&z': &i32
10[44; 45) 'z': i32
11[48; 49) 'x': &i32
12[59; 60) 'a': i32
13[63; 64) 'z': i32
14[74; 80) '(c, d)': (i32, &str)
15[75; 76) 'c': i32
16[78; 79) 'd': &str
17[83; 95) '(1, "hello")': (i32, &str)
18[84; 85) '1': i32
19[87; 94) '"hello"': &str
20[102; 152) 'for (e... }': ()
21[106; 112) '(e, f)': ([unknown], [unknown])
22[107; 108) 'e': [unknown]
23[110; 111) 'f': [unknown]
24[116; 125) 'some_iter': [unknown]
25[126; 152) '{ ... }': ()
26[140; 141) 'g': [unknown]
27[144; 145) 'e': [unknown]
28[158; 205) 'if let... }': ()
29[165; 170) '[val]': [unknown]
30[173; 176) 'opt': [unknown]
31[177; 205) '{ ... }': ()
32[191; 192) 'h': [unknown]
33[195; 198) 'val': [unknown]
34[215; 221) 'lambda': [unknown]
35[224; 256) '|a: u6...b; c }': [unknown]
36[225; 226) 'a': u64
37[233; 234) 'b': u64
38[236; 237) 'c': i32
39[244; 256) '{ a + b; c }': i32
40[246; 247) 'a': u64
41[246; 251) 'a + b': u64
42[250; 251) 'b': u64
43[253; 254) 'c': i32
44[267; 279) 'ref ref_to_x': &&i32
45[282; 283) 'x': &i32
46[293; 302) 'mut mut_x': &i32
47[305; 306) 'x': &i32
48[316; 336) 'ref mu...f_to_x': &mut &i32
49[339; 340) 'x': &i32
50[350; 351) 'k': &mut &i32
51[354; 366) 'mut_ref_to_x': &mut &i32
52
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_refs.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_refs.snap
new file mode 100644
index 000000000..fc5bfe677
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_refs.snap
@@ -0,0 +1,28 @@
1Created: 2019-01-21T21:48:20.674183006+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[9; 10) 'a': &u32
6[18; 19) 'b': &mut u32
7[31; 32) 'c': *const u32
8[46; 47) 'd': *mut u32
9[59; 150) '{ ... *d; }': ()
10[65; 66) 'a': &u32
11[72; 74) '*a': u32
12[73; 74) 'a': &u32
13[80; 82) '&a': &&u32
14[81; 82) 'a': &u32
15[88; 94) '&mut a': &mut &u32
16[93; 94) 'a': &u32
17[100; 101) 'b': &mut u32
18[107; 109) '*b': u32
19[108; 109) 'b': &mut u32
20[115; 117) '&b': &&mut u32
21[116; 117) 'b': &mut u32
22[123; 124) 'c': *const u32
23[130; 132) '*c': u32
24[131; 132) 'c': *const u32
25[138; 139) 'd': *mut u32
26[145; 147) '*d': u32
27[146; 147) 'd': *mut u32
28
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_self.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_self.snap
new file mode 100644
index 000000000..76cb62055
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_self.snap
@@ -0,0 +1,11 @@
1Created: 2019-01-21T21:50:17.870325361+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[34; 38) 'self': &S
6[40; 61) '{ ... }': ()
7[50; 54) 'self': &S
8[75; 79) 'self': &S
9[88; 109) '{ ... }': ()
10[98; 102) 'self': &S
11
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_struct.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_struct.snap
new file mode 100644
index 000000000..0c94d6837
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_struct.snap
@@ -0,0 +1,21 @@
1Created: 2019-01-21T21:48:20.677495622+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[72; 154) '{ ...a.c; }': ()
6[82; 83) 'c': [unknown]
7[86; 87) 'C': [unknown]
8[86; 90) 'C(1)': [unknown]
9[88; 89) '1': i32
10[96; 97) 'B': [unknown]
11[107; 108) 'a': A
12[114; 133) 'A { b:...C(1) }': A
13[121; 122) 'B': B
14[127; 128) 'C': [unknown]
15[127; 131) 'C(1)': C
16[129; 130) '1': i32
17[139; 140) 'a': A
18[139; 142) 'a.b': B
19[148; 149) 'a': A
20[148; 151) 'a.c': C
21
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_struct_generics.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_struct_generics.snap
new file mode 100644
index 000000000..7cf947d4d
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_struct_generics.snap
@@ -0,0 +1,20 @@
1Created: 2019-01-21T21:48:20.678274444+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[36; 38) 'a1': A<u32>
6[48; 49) 'i': i32
7[56; 147) '{ ...3.x; }': ()
8[62; 64) 'a1': A<u32>
9[62; 66) 'a1.x': u32
10[76; 78) 'a2': A<i32>
11[81; 91) 'A { x: i }': A<i32>
12[88; 89) 'i': i32
13[97; 99) 'a2': A<i32>
14[97; 101) 'a2.x': i32
15[111; 113) 'a3': A<i128>
16[116; 134) 'A::<i1...x: 1 }': A<i128>
17[131; 132) '1': i128
18[140; 142) 'a3': A<i128>
19[140; 144) 'a3.x': i128
20
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_tuple.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_tuple.snap
new file mode 100644
index 000000000..862644145
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_tuple.snap
@@ -0,0 +1,32 @@
1Created: 2019-01-21T21:48:20.676903109+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[9; 10) 'x': &str
6[18; 19) 'y': isize
7[28; 170) '{ ...d"); }': ()
8[38; 39) 'a': (u32, &str)
9[55; 63) '(1, "a")': (u32, &str)
10[56; 57) '1': u32
11[59; 62) '"a"': &str
12[73; 74) 'b': ((u32, &str), &str)
13[77; 83) '(a, x)': ((u32, &str), &str)
14[78; 79) 'a': (u32, &str)
15[81; 82) 'x': &str
16[93; 94) 'c': (isize, &str)
17[97; 103) '(y, x)': (isize, &str)
18[98; 99) 'y': isize
19[101; 102) 'x': &str
20[113; 114) 'd': ((isize, &str), &str)
21[117; 123) '(c, x)': ((isize, &str), &str)
22[118; 119) 'c': (isize, &str)
23[121; 122) 'x': &str
24[133; 134) 'e': (i32, &str)
25[137; 145) '(1, "e")': (i32, &str)
26[138; 139) '1': i32
27[141; 144) '"e"': &str
28[155; 156) 'f': ((i32, &str), &str)
29[159; 167) '(e, "d")': ((i32, &str), &str)
30[160; 161) 'e': (i32, &str)
31[163; 166) '"d"': &str
32
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_unary_op.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_unary_op.snap
new file mode 100644
index 000000000..8906bb9c0
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__infer_unary_op.snap
@@ -0,0 +1,33 @@
1Created: 2019-01-21T21:48:20.676213204+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[27; 28) 'x': SomeType
6[40; 197) '{ ...lo"; }': ()
7[50; 51) 'b': bool
8[54; 59) 'false': bool
9[69; 70) 'c': bool
10[73; 75) '!b': bool
11[74; 75) 'b': bool
12[85; 86) 'a': i128
13[89; 92) '100': i128
14[102; 103) 'd': i128
15[112; 114) '-a': i128
16[113; 114) 'a': i128
17[124; 125) 'e': i32
18[128; 132) '-100': i32
19[129; 132) '100': i32
20[142; 143) 'f': bool
21[146; 153) '!!!true': bool
22[147; 153) '!!true': bool
23[148; 153) '!true': bool
24[149; 153) 'true': bool
25[159; 164) '-3.14': f64
26[160; 164) '3.14': f64
27[170; 172) '-x': [unknown]
28[171; 172) 'x': SomeType
29[178; 180) '!x': [unknown]
30[179; 180) 'x': SomeType
31[186; 194) '-"hello"': [unknown]
32[187; 194) '"hello"': &str
33
diff --git a/crates/ra_hir/src/ty/snapshots/tests__no_panic_on_field_of_enum.snap b/crates/ra_hir/src/ty/snapshots/tests__no_panic_on_field_of_enum.snap
new file mode 100644
index 000000000..024fbf929
--- /dev/null
+++ b/crates/ra_hir/src/ty/snapshots/tests__no_panic_on_field_of_enum.snap
@@ -0,0 +1,9 @@
1Created: 2019-01-21T21:48:20.676654355+00:00
2Creator: [email protected]
3Source: crates/ra_hir/src/ty/tests.rs
4
5[20; 21) 'x': X
6[26; 47) '{ ...eld; }': ()
7[32; 33) 'x': X
8[32; 44) 'x.some_field': [unknown]
9