diff options
Diffstat (limited to 'crates/ra_hir/src/ty/snapshots')
9 files changed, 122 insertions, 74 deletions
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 index 2719f592e..48c83cbb2 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_adt_pattern.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_adt_pattern.snap | |||
@@ -1,10 +1,10 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:44:59.880187500+00:00" | 2 | created: "2019-01-28T21:58:55.559331849+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [68; 262) '{ ... d; }': () | 7 | [68; 289) '{ ... d; }': () |
8 | [78; 79) 'e': E | 8 | [78; 79) 'e': E |
9 | [82; 95) 'E::A { x: 3 }': E | 9 | [82; 95) 'E::A { x: 3 }': E |
10 | [92; 93) '3': usize | 10 | [92; 93) '3': usize |
@@ -15,15 +15,18 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs" | |||
15 | [129; 148) 'E::A {..._var }': E | 15 | [129; 148) 'E::A {..._var }': E |
16 | [139; 146) 'new_var': usize | 16 | [139; 146) 'new_var': usize |
17 | [151; 152) 'e': E | 17 | [151; 152) 'e': E |
18 | [159; 218) 'match ... }': usize | 18 | [159; 245) 'match ... }': usize |
19 | [165; 166) 'e': E | 19 | [165; 166) 'e': E |
20 | [177; 187) 'E::A { x }': E | 20 | [177; 187) 'E::A { x }': E |
21 | [184; 185) 'x': usize | 21 | [184; 185) 'x': usize |
22 | [191; 192) 'x': usize | 22 | [191; 192) 'x': usize |
23 | [202; 206) 'E::B': E | 23 | [202; 206) 'E::B': E |
24 | [210; 211) '1': usize | 24 | [210; 213) 'foo': bool |
25 | [229; 248) 'ref d ...{ .. }': &E | 25 | [217; 218) '1': usize |
26 | [237; 248) 'E::A { .. }': E | 26 | [228; 232) 'E::B': E |
27 | [251; 252) 'e': E | 27 | [236; 238) '10': usize |
28 | [258; 259) 'd': &E | 28 | [256; 275) 'ref d ...{ .. }': &E |
29 | [264; 275) 'E::A { .. }': E | ||
30 | [278; 279) 'e': E | ||
31 | [285; 286) 'd': &E | ||
29 | 32 | ||
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_array.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_array.snap index 3f2faa598..042248c35 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_array.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_array.snap | |||
@@ -1,12 +1,12 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:44:59.880187500+00:00" | 2 | created: "2019-01-30T20:08:05.185312835+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [9; 10) 'x': &str | 7 | [9; 10) 'x': &str |
8 | [18; 19) 'y': isize | 8 | [18; 19) 'y': isize |
9 | [28; 293) '{ ... []; }': () | 9 | [28; 324) '{ ... 3]; }': () |
10 | [38; 39) 'a': [&str] | 10 | [38; 39) 'a': [&str] |
11 | [42; 45) '[x]': [&str] | 11 | [42; 45) '[x]': [&str] |
12 | [43; 44) 'x': &str | 12 | [43; 44) 'x': &str |
@@ -56,4 +56,10 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs" | |||
56 | [260; 263) '"b"': &str | 56 | [260; 263) '"b"': &str |
57 | [275; 276) 'x': [u8] | 57 | [275; 276) 'x': [u8] |
58 | [288; 290) '[]': [u8] | 58 | [288; 290) '[]': [u8] |
59 | [300; 301) 'z': &[u8] | ||
60 | [311; 321) '&[1, 2, 3]': &[u8] | ||
61 | [312; 321) '[1, 2, 3]': [u8] | ||
62 | [313; 314) '1': u8 | ||
63 | [316; 317) '2': u8 | ||
64 | [319; 320) '3': u8 | ||
59 | 65 | ||
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap index 5c74bd8c7..f5840a934 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_backwards.snap | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:44:59.880187500+00:00" | 2 | created: "2019-01-26T17:46:03.842478456+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [14; 15) 'x': u32 | 7 | [14; 15) 'x': u32 |
8 | [22; 24) '{}': () | 8 | [22; 24) '{}': () |
@@ -10,7 +10,7 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs" | |||
10 | [88; 89) 'a': u32 | 10 | [88; 89) 'a': u32 |
11 | [92; 108) 'unknow...nction': [unknown] | 11 | [92; 108) 'unknow...nction': [unknown] |
12 | [92; 110) 'unknow...tion()': u32 | 12 | [92; 110) 'unknow...tion()': u32 |
13 | [116; 125) 'takes_u32': fn(u32) -> () | 13 | [116; 125) 'takes_u32': fn takes_u32(u32) -> () |
14 | [116; 128) 'takes_u32(a)': () | 14 | [116; 128) 'takes_u32(a)': () |
15 | [126; 127) 'a': u32 | 15 | [126; 127) 'a': u32 |
16 | [138; 139) 'b': i32 | 16 | [138; 139) 'b': i32 |
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 index c506bcadd..b9dda2bc0 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_binary_op.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_binary_op.snap | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:44:59.880187500+00:00" | 2 | created: "2019-01-26T17:46:03.853259898+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [6; 7) 'x': bool | 7 | [6; 7) 'x': bool |
8 | [22; 34) '{ 0i32 }': i32 | 8 | [22; 34) '{ 0i32 }': i32 |
@@ -28,7 +28,7 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs" | |||
28 | [174; 196) 'minus_...ONST_2': bool | 28 | [174; 196) 'minus_...ONST_2': bool |
29 | [189; 196) 'CONST_2': isize | 29 | [189; 196) 'CONST_2': isize |
30 | [206; 207) 'c': i32 | 30 | [206; 207) 'c': i32 |
31 | [210; 211) 'f': fn(bool) -> i32 | 31 | [210; 211) 'f': fn f(bool) -> i32 |
32 | [210; 219) 'f(z || y)': i32 | 32 | [210; 219) 'f(z || y)': i32 |
33 | [210; 223) 'f(z || y) + 5': i32 | 33 | [210; 223) 'f(z || y) + 5': i32 |
34 | [212; 213) 'z': bool | 34 | [212; 213) 'z': bool |
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 index 7203ad1e2..8ff6e55a6 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_function_generics.snap | |||
@@ -1,21 +1,21 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:44:59.954958500+00:00" | 2 | created: "2019-01-26T18:16:16.530712344+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [10; 11) 't': [unknown] | 7 | [10; 11) 't': [unknown] |
8 | [21; 26) '{ t }': [unknown] | 8 | [21; 26) '{ t }': [unknown] |
9 | [23; 24) 't': [unknown] | 9 | [23; 24) 't': [unknown] |
10 | [38; 98) '{ ...(1); }': () | 10 | [38; 98) '{ ...(1); }': () |
11 | [44; 46) 'id': fn(T) -> T | 11 | [44; 46) 'id': fn id<u32>(T) -> T |
12 | [44; 52) 'id(1u32)': T | 12 | [44; 52) 'id(1u32)': u32 |
13 | [47; 51) '1u32': u32 | 13 | [47; 51) '1u32': u32 |
14 | [58; 68) 'id::<i128>': fn(T) -> T | 14 | [58; 68) 'id::<i128>': fn id<i128>(T) -> T |
15 | [58; 71) 'id::<i128>(1)': T | 15 | [58; 71) 'id::<i128>(1)': i128 |
16 | [69; 70) '1': T | 16 | [69; 70) '1': i128 |
17 | [81; 82) 'x': T | 17 | [81; 82) 'x': u64 |
18 | [90; 92) 'id': fn(T) -> T | 18 | [90; 92) 'id': fn id<u64>(T) -> T |
19 | [90; 95) 'id(1)': T | 19 | [90; 95) 'id(1)': u64 |
20 | [93; 94) '1': T | 20 | [93; 94) '1': u64 |
21 | 21 | ||
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 index 4435180a1..f21bffa75 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_generic_chain.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_generic_chain.snap | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:44:59.961936900+00:00" | 2 | created: "2019-01-26T17:46:03.866825843+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [53; 57) 'self': A<[unknown]> | 7 | [53; 57) 'self': A<[unknown]> |
8 | [65; 87) '{ ... }': [unknown] | 8 | [65; 87) '{ ... }': [unknown] |
@@ -12,25 +12,25 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs" | |||
12 | [110; 115) '{ t }': [unknown] | 12 | [110; 115) '{ t }': [unknown] |
13 | [112; 113) 't': [unknown] | 13 | [112; 113) 't': [unknown] |
14 | [135; 261) '{ ....x() }': i128 | 14 | [135; 261) '{ ....x() }': i128 |
15 | [146; 147) 'x': T | 15 | [146; 147) 'x': i32 |
16 | [150; 151) '1': T | 16 | [150; 151) '1': i32 |
17 | [162; 163) 'y': T | 17 | [162; 163) 'y': i32 |
18 | [166; 168) 'id': fn(T) -> T | 18 | [166; 168) 'id': fn id<i32>(T) -> T |
19 | [166; 171) 'id(x)': T | 19 | [166; 171) 'id(x)': i32 |
20 | [169; 170) 'x': T | 20 | [169; 170) 'x': i32 |
21 | [182; 183) 'a': A<T> | 21 | [182; 183) 'a': A<i32> |
22 | [186; 200) 'A { x: id(y) }': A<T> | 22 | [186; 200) 'A { x: id(y) }': A<i32> |
23 | [193; 195) 'id': fn(T) -> T | 23 | [193; 195) 'id': fn id<i32>(T) -> T |
24 | [193; 198) 'id(y)': T | 24 | [193; 198) 'id(y)': i32 |
25 | [196; 197) 'y': T | 25 | [196; 197) 'y': i32 |
26 | [211; 212) 'z': T | 26 | [211; 212) 'z': i32 |
27 | [215; 217) 'id': fn(T) -> T | 27 | [215; 217) 'id': fn id<i32>(T) -> T |
28 | [215; 222) 'id(a.x)': T | 28 | [215; 222) 'id(a.x)': i32 |
29 | [218; 219) 'a': A<T> | 29 | [218; 219) 'a': A<i32> |
30 | [218; 221) 'a.x': T | 30 | [218; 221) 'a.x': i32 |
31 | [233; 234) 'b': A<T> | 31 | [233; 234) 'b': A<i32> |
32 | [237; 247) 'A { x: z }': A<T> | 32 | [237; 247) 'A { x: z }': A<i32> |
33 | [244; 245) 'z': T | 33 | [244; 245) 'z': i32 |
34 | [254; 255) 'b': A<T> | 34 | [254; 255) 'b': A<i32> |
35 | [254; 259) 'b.x()': i128 | 35 | [254; 259) 'b.x()': i128 |
36 | 36 | ||
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap index 0bceffaef..afbe2f747 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_paths.snap | |||
@@ -1,16 +1,16 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:44:59.975899500+00:00" | 2 | created: "2019-01-26T17:46:03.928773630+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [15; 20) '{ 1 }': u32 | 7 | [15; 20) '{ 1 }': u32 |
8 | [17; 18) '1': u32 | 8 | [17; 18) '1': u32 |
9 | [48; 53) '{ 1 }': u32 | 9 | [48; 53) '{ 1 }': u32 |
10 | [50; 51) '1': u32 | 10 | [50; 51) '1': u32 |
11 | [67; 91) '{ ...c(); }': () | 11 | [67; 91) '{ ...c(); }': () |
12 | [73; 74) 'a': fn() -> u32 | 12 | [73; 74) 'a': fn a() -> u32 |
13 | [73; 76) 'a()': u32 | 13 | [73; 76) 'a()': u32 |
14 | [82; 86) 'b::c': fn() -> u32 | 14 | [82; 86) 'b::c': fn c() -> u32 |
15 | [82; 88) 'b::c()': u32 | 15 | [82; 88) 'b::c()': u32 |
16 | 16 | ||
diff --git a/crates/ra_hir/src/ty/snapshots/tests__infer_type_param.snap b/crates/ra_hir/src/ty/snapshots/tests__infer_type_param.snap new file mode 100644 index 000000000..a99323264 --- /dev/null +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_type_param.snap | |||
@@ -0,0 +1,26 @@ | |||
1 | --- | ||
2 | created: "2019-01-27T16:54:18.368427685+00:00" | ||
3 | creator: [email protected] | ||
4 | expression: "&result" | ||
5 | source: crates/ra_hir/src/ty/tests.rs | ||
6 | --- | ||
7 | [10; 11) 'x': [unknown] | ||
8 | [21; 30) '{ x }': [unknown] | ||
9 | [27; 28) 'x': [unknown] | ||
10 | [44; 45) 'x': &[unknown] | ||
11 | [56; 65) '{ x }': &[unknown] | ||
12 | [62; 63) 'x': &[unknown] | ||
13 | [77; 157) '{ ...(1); }': () | ||
14 | [87; 88) 'y': u32 | ||
15 | [91; 96) '10u32': u32 | ||
16 | [102; 104) 'id': fn id<u32>(T) -> T | ||
17 | [102; 107) 'id(y)': u32 | ||
18 | [105; 106) 'y': u32 | ||
19 | [117; 118) 'x': bool | ||
20 | [127; 132) 'clone': fn clone<bool>(&T) -> T | ||
21 | [127; 135) 'clone(z)': bool | ||
22 | [133; 134) 'z': &bool | ||
23 | [141; 151) 'id::<i128>': fn id<i128>(T) -> T | ||
24 | [141; 154) 'id::<i128>(1)': i128 | ||
25 | [152; 153) '1': i128 | ||
26 | |||
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 index 10aa61954..5021d0eeb 100644 --- a/crates/ra_hir/src/ty/snapshots/tests__infer_unary_op.snap +++ b/crates/ra_hir/src/ty/snapshots/tests__infer_unary_op.snap | |||
@@ -1,11 +1,11 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:00.059676600+00:00" | 2 | created: "2019-01-28T14:51:16.185273502+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.2 |
4 | expression: "&result" | 4 | expression: "&result" |
5 | source: "crates\\ra_hir\\src\\ty\\tests.rs" | 5 | source: crates/ra_hir/src/ty/tests.rs |
6 | --- | 6 | --- |
7 | [27; 28) 'x': SomeType | 7 | [27; 28) 'x': SomeType |
8 | [40; 197) '{ ...lo"; }': () | 8 | [40; 272) '{ ...lo"; }': () |
9 | [50; 51) 'b': bool | 9 | [50; 51) 'b': bool |
10 | [54; 59) 'false': bool | 10 | [54; 59) 'false': bool |
11 | [69; 70) 'c': bool | 11 | [69; 70) 'c': bool |
@@ -24,12 +24,25 @@ source: "crates\\ra_hir\\src\\ty\\tests.rs" | |||
24 | [147; 153) '!!true': bool | 24 | [147; 153) '!!true': bool |
25 | [148; 153) '!true': bool | 25 | [148; 153) '!true': bool |
26 | [149; 153) 'true': bool | 26 | [149; 153) 'true': bool |
27 | [159; 164) '-3.14': f64 | 27 | [163; 164) 'g': i32 |
28 | [160; 164) '3.14': f64 | 28 | [167; 170) '!42': i32 |
29 | [170; 172) '-x': [unknown] | 29 | [168; 170) '42': i32 |
30 | [171; 172) 'x': SomeType | 30 | [180; 181) 'h': u32 |
31 | [178; 180) '!x': [unknown] | 31 | [184; 190) '!10u32': u32 |
32 | [179; 180) 'x': SomeType | 32 | [185; 190) '10u32': u32 |
33 | [186; 194) '-"hello"': [unknown] | 33 | [200; 201) 'j': i128 |
34 | [187; 194) '"hello"': &str | 34 | [204; 206) '!a': i128 |
35 | [205; 206) 'a': i128 | ||
36 | [212; 217) '-3.14': f64 | ||
37 | [213; 217) '3.14': f64 | ||
38 | [223; 225) '!3': i32 | ||
39 | [224; 225) '3': i32 | ||
40 | [231; 233) '-x': [unknown] | ||
41 | [232; 233) 'x': SomeType | ||
42 | [239; 241) '!x': [unknown] | ||
43 | [240; 241) 'x': SomeType | ||
44 | [247; 255) '-"hello"': [unknown] | ||
45 | [248; 255) '"hello"': &str | ||
46 | [261; 269) '!"hello"': [unknown] | ||
47 | [262; 269) '"hello"': &str | ||
35 | 48 | ||