diff options
26 files changed, 1446 insertions, 1486 deletions
diff --git a/Cargo.lock b/Cargo.lock index e2938b5f8..93814bedc 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -77,25 +77,6 @@ version = "1.1.0" | |||
77 | source = "registry+https://github.com/rust-lang/crates.io-index" | 77 | source = "registry+https://github.com/rust-lang/crates.io-index" |
78 | 78 | ||
79 | [[package]] | 79 | [[package]] |
80 | name = "block-buffer" | ||
81 | version = "0.7.3" | ||
82 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
83 | dependencies = [ | ||
84 | "block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", | ||
85 | "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
86 | "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||
87 | "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||
88 | ] | ||
89 | |||
90 | [[package]] | ||
91 | name = "block-padding" | ||
92 | version = "0.1.4" | ||
93 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
94 | dependencies = [ | ||
95 | "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
96 | ] | ||
97 | |||
98 | [[package]] | ||
99 | name = "bstr" | 80 | name = "bstr" |
100 | version = "0.2.7" | 81 | version = "0.2.7" |
101 | source = "registry+https://github.com/rust-lang/crates.io-index" | 82 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -104,11 +85,6 @@ dependencies = [ | |||
104 | ] | 85 | ] |
105 | 86 | ||
106 | [[package]] | 87 | [[package]] |
107 | name = "byte-tools" | ||
108 | version = "0.3.1" | ||
109 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
110 | |||
111 | [[package]] | ||
112 | name = "byteorder" | 88 | name = "byteorder" |
113 | version = "1.3.2" | 89 | version = "1.3.2" |
114 | source = "registry+https://github.com/rust-lang/crates.io-index" | 90 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -206,16 +182,10 @@ dependencies = [ | |||
206 | "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", | 182 | "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", |
207 | "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", | 183 | "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", |
208 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", | 184 | "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", |
209 | "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", | ||
210 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", | 185 | "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", |
211 | ] | 186 | ] |
212 | 187 | ||
213 | [[package]] | 188 | [[package]] |
214 | name = "ci_info" | ||
215 | version = "0.3.1" | ||
216 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
217 | |||
218 | [[package]] | ||
219 | name = "clap" | 189 | name = "clap" |
220 | version = "2.33.0" | 190 | version = "2.33.0" |
221 | source = "registry+https://github.com/rust-lang/crates.io-index" | 191 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -262,6 +232,21 @@ dependencies = [ | |||
262 | ] | 232 | ] |
263 | 233 | ||
264 | [[package]] | 234 | [[package]] |
235 | name = "console" | ||
236 | version = "0.8.0" | ||
237 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
238 | dependencies = [ | ||
239 | "clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||
240 | "encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||
241 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||
242 | "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", | ||
243 | "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
244 | "termios 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
245 | "unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", | ||
246 | "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", | ||
247 | ] | ||
248 | |||
249 | [[package]] | ||
265 | name = "crossbeam" | 250 | name = "crossbeam" |
266 | version = "0.7.2" | 251 | version = "0.7.2" |
267 | source = "registry+https://github.com/rust-lang/crates.io-index" | 252 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -346,14 +331,6 @@ version = "2.0.0" | |||
346 | source = "registry+https://github.com/rust-lang/crates.io-index" | 331 | source = "registry+https://github.com/rust-lang/crates.io-index" |
347 | 332 | ||
348 | [[package]] | 333 | [[package]] |
349 | name = "digest" | ||
350 | version = "0.8.1" | ||
351 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
352 | dependencies = [ | ||
353 | "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||
354 | ] | ||
355 | |||
356 | [[package]] | ||
357 | name = "drop_bomb" | 334 | name = "drop_bomb" |
358 | version = "0.1.4" | 335 | version = "0.1.4" |
359 | source = "registry+https://github.com/rust-lang/crates.io-index" | 336 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -410,11 +387,6 @@ dependencies = [ | |||
410 | ] | 387 | ] |
411 | 388 | ||
412 | [[package]] | 389 | [[package]] |
413 | name = "fake-simd" | ||
414 | version = "0.1.2" | ||
415 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
416 | |||
417 | [[package]] | ||
418 | name = "filetime" | 390 | name = "filetime" |
419 | version = "0.2.5" | 391 | version = "0.2.5" |
420 | source = "registry+https://github.com/rust-lang/crates.io-index" | 392 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -513,14 +485,6 @@ dependencies = [ | |||
513 | ] | 485 | ] |
514 | 486 | ||
515 | [[package]] | 487 | [[package]] |
516 | name = "generic-array" | ||
517 | version = "0.12.3" | ||
518 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
519 | dependencies = [ | ||
520 | "typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||
521 | ] | ||
522 | |||
523 | [[package]] | ||
524 | name = "getrandom" | 488 | name = "getrandom" |
525 | version = "0.1.10" | 489 | version = "0.1.10" |
526 | source = "registry+https://github.com/rust-lang/crates.io-index" | 490 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -602,18 +566,12 @@ dependencies = [ | |||
602 | 566 | ||
603 | [[package]] | 567 | [[package]] |
604 | name = "insta" | 568 | name = "insta" |
605 | version = "0.10.1" | 569 | version = "0.11.0" |
606 | source = "registry+https://github.com/rust-lang/crates.io-index" | 570 | source = "registry+https://github.com/rust-lang/crates.io-index" |
607 | dependencies = [ | 571 | dependencies = [ |
608 | "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", | 572 | "console 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", |
609 | "ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
610 | "console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)", | ||
611 | "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | 573 | "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", |
612 | "failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", | ||
613 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", | 574 | "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", |
614 | "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
615 | "pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||
616 | "ron 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||
617 | "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", | 575 | "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", |
618 | "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", | 576 | "serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", |
619 | "serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", | 577 | "serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -744,11 +702,6 @@ dependencies = [ | |||
744 | ] | 702 | ] |
745 | 703 | ||
746 | [[package]] | 704 | [[package]] |
747 | name = "maplit" | ||
748 | version = "1.0.1" | ||
749 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
750 | |||
751 | [[package]] | ||
752 | name = "matches" | 705 | name = "matches" |
753 | version = "0.1.8" | 706 | version = "0.1.8" |
754 | source = "registry+https://github.com/rust-lang/crates.io-index" | 707 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -880,11 +833,6 @@ dependencies = [ | |||
880 | ] | 833 | ] |
881 | 834 | ||
882 | [[package]] | 835 | [[package]] |
883 | name = "opaque-debug" | ||
884 | version = "0.2.3" | ||
885 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
886 | |||
887 | [[package]] | ||
888 | name = "ordermap" | 836 | name = "ordermap" |
889 | version = "0.3.5" | 837 | version = "0.3.5" |
890 | source = "registry+https://github.com/rust-lang/crates.io-index" | 838 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -939,45 +887,6 @@ version = "2.1.0" | |||
939 | source = "registry+https://github.com/rust-lang/crates.io-index" | 887 | source = "registry+https://github.com/rust-lang/crates.io-index" |
940 | 888 | ||
941 | [[package]] | 889 | [[package]] |
942 | name = "pest" | ||
943 | version = "2.1.1" | ||
944 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
945 | dependencies = [ | ||
946 | "ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||
947 | ] | ||
948 | |||
949 | [[package]] | ||
950 | name = "pest_derive" | ||
951 | version = "2.1.0" | ||
952 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
953 | dependencies = [ | ||
954 | "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
955 | "pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||
956 | ] | ||
957 | |||
958 | [[package]] | ||
959 | name = "pest_generator" | ||
960 | version = "2.1.0" | ||
961 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
962 | dependencies = [ | ||
963 | "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
964 | "pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
965 | "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", | ||
966 | "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", | ||
967 | "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", | ||
968 | ] | ||
969 | |||
970 | [[package]] | ||
971 | name = "pest_meta" | ||
972 | version = "2.1.1" | ||
973 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
974 | dependencies = [ | ||
975 | "maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
976 | "pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
977 | "sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
978 | ] | ||
979 | |||
980 | [[package]] | ||
981 | name = "petgraph" | 890 | name = "petgraph" |
982 | version = "0.4.13" | 891 | version = "0.4.13" |
983 | source = "registry+https://github.com/rust-lang/crates.io-index" | 892 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -1134,7 +1043,7 @@ dependencies = [ | |||
1134 | "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 1043 | "chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)", |
1135 | "chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)", | 1044 | "chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)", |
1136 | "ena 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1045 | "ena 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1137 | "insta 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1046 | "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1138 | "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1047 | "lalrpop-intern 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", |
1139 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1048 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
1140 | "once_cell 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", | 1049 | "once_cell 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1156,7 +1065,7 @@ version = "0.1.0" | |||
1156 | dependencies = [ | 1065 | dependencies = [ |
1157 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1066 | "format-buf 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1158 | "fst 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", | 1067 | "fst 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", |
1159 | "insta 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", | 1068 | "insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1160 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", | 1069 | "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", |
1161 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", | 1070 | "join_to_string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", |
1162 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", | 1071 | "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", |
@@ -1531,16 +1440,6 @@ dependencies = [ | |||
1531 | 1440 | ||
1532 | [[package]] | 1441 | [[package]] |
1533 | name = "ron" | 1442 | name = "ron" |
1534 | version = "0.4.2" | ||
1535 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1536 | dependencies = [ | ||
1537 | "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1538 | "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1539 | "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1540 | ] | ||
1541 | |||
1542 | [[package]] | ||
1543 | name = "ron" | ||
1544 | version = "0.5.1" | 1443 | version = "0.5.1" |
1545 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1444 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1546 | dependencies = [ | 1445 | dependencies = [ |
@@ -1689,17 +1588,6 @@ dependencies = [ | |||
1689 | ] | 1588 | ] |
1690 | 1589 | ||
1691 | [[package]] | 1590 | [[package]] |
1692 | name = "sha-1" | ||
1693 | version = "0.8.1" | ||
1694 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1695 | dependencies = [ | ||
1696 | "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1697 | "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1698 | "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1699 | "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", | ||
1700 | ] | ||
1701 | |||
1702 | [[package]] | ||
1703 | name = "slab" | 1591 | name = "slab" |
1704 | version = "0.4.2" | 1592 | version = "0.4.2" |
1705 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1593 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -1843,16 +1731,6 @@ dependencies = [ | |||
1843 | ] | 1731 | ] |
1844 | 1732 | ||
1845 | [[package]] | 1733 | [[package]] |
1846 | name = "typenum" | ||
1847 | version = "1.10.0" | ||
1848 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1849 | |||
1850 | [[package]] | ||
1851 | name = "ucd-trie" | ||
1852 | version = "0.1.2" | ||
1853 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1854 | |||
1855 | [[package]] | ||
1856 | name = "unicase" | 1734 | name = "unicase" |
1857 | version = "2.4.0" | 1735 | version = "2.4.0" |
1858 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1736 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -2006,10 +1884,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2006 | "checksum bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80" | 1884 | "checksum bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80" |
2007 | "checksum bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" | 1885 | "checksum bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" |
2008 | "checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" | 1886 | "checksum bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d155346769a6855b86399e9bc3814ab343cd3d62c7e985113d46a0ec3c281fd" |
2009 | "checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" | ||
2010 | "checksum block-padding 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6d4dc3af3ee2e12f3e5d224e5e1e3d73668abbeb69e566d361f7d5563a4fdf09" | ||
2011 | "checksum bstr 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94cdf78eb7e94c566c1f5dbe2abf8fc70a548fc902942a48c4b3a98b48ca9ade" | 1887 | "checksum bstr 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94cdf78eb7e94c566c1f5dbe2abf8fc70a548fc902942a48c4b3a98b48ca9ade" |
2012 | "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" | ||
2013 | "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" | 1888 | "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" |
2014 | "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" | 1889 | "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" |
2015 | "checksum cargo_metadata 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "700b3731fd7d357223d0000f4dbf1808401b694609035c3c411fbc0cd375c426" | 1890 | "checksum cargo_metadata 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "700b3731fd7d357223d0000f4dbf1808401b694609035c3c411fbc0cd375c426" |
@@ -2021,11 +1896,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2021 | "checksum chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 1896 | "checksum chalk-rust-ir 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" |
2022 | "checksum chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" | 1897 | "checksum chalk-solve 0.1.0 (git+https://github.com/rust-lang/chalk.git)" = "<none>" |
2023 | "checksum chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "77d81f58b7301084de3b958691458a53c3f7e0b1d702f77e550b6a88e3a88abe" | 1898 | "checksum chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "77d81f58b7301084de3b958691458a53c3f7e0b1d702f77e550b6a88e3a88abe" |
2024 | "checksum ci_info 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e5e881307a989a3a5e20d52a32cc05950e3c2178cccfcc9428271a6cde09f902" | ||
2025 | "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" | 1899 | "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" |
2026 | "checksum clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "73abfd4c73d003a674ce5d2933fca6ce6c42480ea84a5ffe0a2dc39ed56300f9" | 1900 | "checksum clicolors-control 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "73abfd4c73d003a674ce5d2933fca6ce6c42480ea84a5ffe0a2dc39ed56300f9" |
2027 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" | 1901 | "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" |
2028 | "checksum console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ca57c2c14b8a2bf3105bc9d15574aad80babf6a9c44b1058034cdf8bd169628" | 1902 | "checksum console 0.7.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8ca57c2c14b8a2bf3105bc9d15574aad80babf6a9c44b1058034cdf8bd169628" |
1903 | "checksum console 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b147390a412132d75d10dd3b7b175a69cf5fd95032f7503c7091b8831ba10242" | ||
2029 | "checksum crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2d818a4990769aac0c7ff1360e233ef3a41adcb009ebb2036bf6915eb0f6b23c" | 1904 | "checksum crossbeam 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2d818a4990769aac0c7ff1360e233ef3a41adcb009ebb2036bf6915eb0f6b23c" |
2030 | "checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" | 1905 | "checksum crossbeam-channel 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" |
2031 | "checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13" | 1906 | "checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13" |
@@ -2035,7 +1910,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2035 | "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" | 1910 | "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" |
2036 | "checksum derive-new 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "71f31892cd5c62e414316f2963c5689242c43d8e7bbcaaeca97e5e28c95d91d9" | 1911 | "checksum derive-new 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "71f31892cd5c62e414316f2963c5689242c43d8e7bbcaaeca97e5e28c95d91d9" |
2037 | "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" | 1912 | "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" |
2038 | "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" | ||
2039 | "checksum drop_bomb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "69b26e475fd29098530e709294e94e661974c851aed42512793f120fed4e199f" | 1913 | "checksum drop_bomb 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "69b26e475fd29098530e709294e94e661974c851aed42512793f120fed4e199f" |
2040 | "checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" | 1914 | "checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" |
2041 | "checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" | 1915 | "checksum either 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5527cfe0d098f36e3f8839852688e63c8fff1c90b2b405aef730615f9a7bcf7b" |
@@ -2044,7 +1918,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2044 | "checksum encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "90b2c9496c001e8cb61827acdefad780795c42264c137744cae6f7d9e3450abd" | 1918 | "checksum encode_unicode 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "90b2c9496c001e8cb61827acdefad780795c42264c137744cae6f7d9e3450abd" |
2045 | "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" | 1919 | "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" |
2046 | "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" | 1920 | "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" |
2047 | "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" | ||
2048 | "checksum filetime 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2f8c63033fcba1f51ef744505b3cad42510432b904c062afa67ad7ece008429d" | 1921 | "checksum filetime 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2f8c63033fcba1f51ef744505b3cad42510432b904c062afa67ad7ece008429d" |
2049 | "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" | 1922 | "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" |
2050 | "checksum flexi_logger 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2be2727ae1f60711d1991788605245e70cc500bd1d92edb909af160634e1a869" | 1923 | "checksum flexi_logger 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2be2727ae1f60711d1991788605245e70cc500bd1d92edb909af160634e1a869" |
@@ -2057,7 +1930,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2057 | "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" | 1930 | "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" |
2058 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" | 1931 | "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" |
2059 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" | 1932 | "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" |
2060 | "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" | ||
2061 | "checksum getrandom 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6171a6cc63fbabbe27c2b5ee268e8b7fe5dc1eb0dd2dfad537c1dfed6f69117e" | 1933 | "checksum getrandom 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6171a6cc63fbabbe27c2b5ee268e8b7fe5dc1eb0dd2dfad537c1dfed6f69117e" |
2062 | "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" | 1934 | "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" |
2063 | "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" | 1935 | "checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" |
@@ -2067,7 +1939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2067 | "checksum indicatif 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c60da1c9abea75996b70a931bba6c750730399005b61ccd853cee50ef3d0d0c" | 1939 | "checksum indicatif 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2c60da1c9abea75996b70a931bba6c750730399005b61ccd853cee50ef3d0d0c" |
2068 | "checksum inotify 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40b54539f3910d6f84fbf9a643efd6e3aa6e4f001426c0329576128255994718" | 1940 | "checksum inotify 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40b54539f3910d6f84fbf9a643efd6e3aa6e4f001426c0329576128255994718" |
2069 | "checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" | 1941 | "checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" |
2070 | "checksum insta 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcb8917b02e8fee27da19291be792fa53acec68ea0b7a45a914dcb80a67d42ab" | 1942 | "checksum insta 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23f83ab4ee86f38b292f0420c27fd412690a4baa9ea0ad4e3fa624bf34379b76" |
2071 | "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" | 1943 | "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" |
2072 | "checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" | 1944 | "checksum itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358" |
2073 | "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" | 1945 | "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" |
@@ -2085,7 +1957,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2085 | "checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" | 1957 | "checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" |
2086 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" | 1958 | "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" |
2087 | "checksum lsp-types 0.60.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe3edefcd66dde1f7f1df706f46520a3c93adc5ca4bc5747da6621195e894efd" | 1959 | "checksum lsp-types 0.60.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fe3edefcd66dde1f7f1df706f46520a3c93adc5ca4bc5747da6621195e894efd" |
2088 | "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" | ||
2089 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" | 1960 | "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" |
2090 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" | 1961 | "checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" |
2091 | "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" | 1962 | "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" |
@@ -2100,17 +1971,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2100 | "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" | 1971 | "checksum num_cpus 1.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273" |
2101 | "checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee" | 1972 | "checksum number_prefix 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbf9993e59c894e3c08aa1c2712914e9e6bf1fcbfc6bef283e2183df345a4fee" |
2102 | "checksum once_cell 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1824583b0e4dc0c1716eea4fb51a9ca2634943f0b07fd929e79af6aeb5a513cc" | 1973 | "checksum once_cell 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1824583b0e4dc0c1716eea4fb51a9ca2634943f0b07fd929e79af6aeb5a513cc" |
2103 | "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" | ||
2104 | "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" | 1974 | "checksum ordermap 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a86ed3f5f244b372d6b1a00b72ef7f8876d0bc6a78a4c9985c53614041512063" |
2105 | "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" | 1975 | "checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" |
2106 | "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" | 1976 | "checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" |
2107 | "checksum paste 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "423a519e1c6e828f1e73b720f9d9ed2fa643dce8a7737fb43235ce0b41eeaa49" | 1977 | "checksum paste 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "423a519e1c6e828f1e73b720f9d9ed2fa643dce8a7737fb43235ce0b41eeaa49" |
2108 | "checksum paste-impl 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4214c9e912ef61bf42b81ba9a47e8aad1b2ffaf739ab162bf96d1e011f54e6c5" | 1978 | "checksum paste-impl 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4214c9e912ef61bf42b81ba9a47e8aad1b2ffaf739ab162bf96d1e011f54e6c5" |
2109 | "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" | 1979 | "checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" |
2110 | "checksum pest 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "933085deae3f32071f135d799d75667b63c8dc1f4537159756e3d4ceab41868c" | ||
2111 | "checksum pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" | ||
2112 | "checksum pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63120576c4efd69615b5537d3d052257328a4ca82876771d6944424ccfd9f646" | ||
2113 | "checksum pest_meta 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f249ea6de7c7b7aba92b4ff4376a994c6dbd98fd2166c89d5c4947397ecb574d" | ||
2114 | "checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" | 1980 | "checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" |
2115 | "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" | 1981 | "checksum ppv-lite86 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e3cbf9f658cdb5000fcf6f362b8ea2ba154b9f146a61c7a20d647034c6b6561b" |
2116 | "checksum proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e688f31d92ffd7c1ddc57a1b4e6d773c0f2a14ee437a4b0a4f5a69c80eb221c8" | 1982 | "checksum proc-macro-hack 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e688f31d92ffd7c1ddc57a1b4e6d773c0f2a14ee437a4b0a4f5a69c80eb221c8" |
@@ -2145,7 +2011,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2145 | "checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" | 2011 | "checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" |
2146 | "checksum relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7790c7f1cc73d831d28dc5a7deb316a006e7848e6a7f467cdb10a0a9e0fb1c" | 2012 | "checksum relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7790c7f1cc73d831d28dc5a7deb316a006e7848e6a7f467cdb10a0a9e0fb1c" |
2147 | "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" | 2013 | "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" |
2148 | "checksum ron 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "17f52a24414403f81528b67488cf8edc4eda977d3af1646bb6b106a600ead78f" | ||
2149 | "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" | 2014 | "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" |
2150 | "checksum rowan 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dc2b79612dedc9004083a61448eb669d336d56690aab29fbd7249e8c8ab41d8c" | 2015 | "checksum rowan 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dc2b79612dedc9004083a61448eb669d336d56690aab29fbd7249e8c8ab41d8c" |
2151 | "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" | 2016 | "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" |
@@ -2163,7 +2028,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2163 | "checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" | 2028 | "checksum serde_json 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704" |
2164 | "checksum serde_repr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cd02c7587ec314570041b2754829f84d873ced14a96d1fd1823531e11db40573" | 2029 | "checksum serde_repr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "cd02c7587ec314570041b2754829f84d873ced14a96d1fd1823531e11db40573" |
2165 | "checksum serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "38b08a9a90e5260fe01c6480ec7c811606df6d3a660415808c3c3fa8ed95b582" | 2030 | "checksum serde_yaml 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "38b08a9a90e5260fe01c6480ec7c811606df6d3a660415808c3c3fa8ed95b582" |
2166 | "checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" | ||
2167 | "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" | 2031 | "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" |
2168 | "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" | 2032 | "checksum smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7" |
2169 | "checksum smol_str 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "590700be3630457c56f8c73c0ea39881476ad7076cd84057d44f4f38f79914fb" | 2033 | "checksum smol_str 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "590700be3630457c56f8c73c0ea39881476ad7076cd84057d44f4f38f79914fb" |
@@ -2179,8 +2043,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
2179 | "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" | 2043 | "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" |
2180 | "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" | 2044 | "checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" |
2181 | "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" | 2045 | "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" |
2182 | "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" | ||
2183 | "checksum ucd-trie 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8f00ed7be0c1ff1e24f46c3d2af4859f7e863672ba3a6e92e7cff702bf9f06c2" | ||
2184 | "checksum unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6" | 2046 | "checksum unicase 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a84e5511b2a947f3ae965dcb29b13b7b1691b6e7332cf5dbc1744138d5acb7f6" |
2185 | "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" | 2047 | "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" |
2186 | "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" | 2048 | "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" |
diff --git a/crates/ra_hir/Cargo.toml b/crates/ra_hir/Cargo.toml index 1a2f1b47c..646c96692 100644 --- a/crates/ra_hir/Cargo.toml +++ b/crates/ra_hir/Cargo.toml | |||
@@ -27,4 +27,4 @@ chalk-ir = { git = "https://github.com/rust-lang/chalk.git" } | |||
27 | lalrpop-intern = "0.15.1" | 27 | lalrpop-intern = "0.15.1" |
28 | 28 | ||
29 | [dev-dependencies] | 29 | [dev-dependencies] |
30 | insta = "0.10.0" | 30 | insta = "0.11.0" |
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs index ba33273b8..77a44a275 100644 --- a/crates/ra_hir/src/mock.rs +++ b/crates/ra_hir/src/mock.rs | |||
@@ -75,7 +75,7 @@ impl MockDatabase { | |||
75 | } | 75 | } |
76 | 76 | ||
77 | pub fn diagnostics(&self) -> String { | 77 | pub fn diagnostics(&self) -> String { |
78 | let mut buf = String::from("\n"); | 78 | let mut buf = String::new(); |
79 | let mut files: Vec<FileId> = self.files.values().copied().collect(); | 79 | let mut files: Vec<FileId> = self.files.values().copied().collect(); |
80 | files.sort(); | 80 | files.sort(); |
81 | for file in files { | 81 | for file in files { |
diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index 8b0887fb5..c1dbad283 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs | |||
@@ -6,7 +6,7 @@ mod mods; | |||
6 | 6 | ||
7 | use std::sync::Arc; | 7 | use std::sync::Arc; |
8 | 8 | ||
9 | use insta::assert_snapshot_matches; | 9 | use insta::assert_snapshot; |
10 | use ra_db::SourceDatabase; | 10 | use ra_db::SourceDatabase; |
11 | use test_utils::covers; | 11 | use test_utils::covers; |
12 | 12 | ||
@@ -97,7 +97,7 @@ fn crate_def_map_smoke_test() { | |||
97 | enum E { V } | 97 | enum E { V } |
98 | ", | 98 | ", |
99 | ); | 99 | ); |
100 | assert_snapshot_matches!(map, @r###" | 100 | assert_snapshot!(map, @r###" |
101 | ⋮crate | 101 | ⋮crate |
102 | ⋮E: t | 102 | ⋮E: t |
103 | ⋮S: t v | 103 | ⋮S: t v |
@@ -130,7 +130,7 @@ fn bogus_paths() { | |||
130 | 130 | ||
131 | ", | 131 | ", |
132 | ); | 132 | ); |
133 | assert_snapshot_matches!(map, @r###" | 133 | assert_snapshot!(map, @r###" |
134 | ⋮crate | 134 | ⋮crate |
135 | ⋮S: t v | 135 | ⋮S: t v |
136 | ⋮foo: t | 136 | ⋮foo: t |
@@ -153,7 +153,7 @@ fn use_as() { | |||
153 | pub struct Baz; | 153 | pub struct Baz; |
154 | ", | 154 | ", |
155 | ); | 155 | ); |
156 | assert_snapshot_matches!(map, | 156 | assert_snapshot!(map, |
157 | @r###" | 157 | @r###" |
158 | ⋮crate | 158 | ⋮crate |
159 | ⋮Foo: t v | 159 | ⋮Foo: t v |
@@ -182,7 +182,7 @@ fn use_trees() { | |||
182 | pub enum Quux {}; | 182 | pub enum Quux {}; |
183 | ", | 183 | ", |
184 | ); | 184 | ); |
185 | assert_snapshot_matches!(map, @r###" | 185 | assert_snapshot!(map, @r###" |
186 | ⋮crate | 186 | ⋮crate |
187 | ⋮Baz: t v | 187 | ⋮Baz: t v |
188 | ⋮Quux: t | 188 | ⋮Quux: t |
@@ -215,7 +215,7 @@ fn re_exports() { | |||
215 | pub struct Baz; | 215 | pub struct Baz; |
216 | ", | 216 | ", |
217 | ); | 217 | ); |
218 | assert_snapshot_matches!(map, @r###" | 218 | assert_snapshot!(map, @r###" |
219 | ⋮crate | 219 | ⋮crate |
220 | ⋮Baz: t v | 220 | ⋮Baz: t v |
221 | ⋮foo: t | 221 | ⋮foo: t |
@@ -250,7 +250,7 @@ fn std_prelude() { | |||
250 | "test_crate": ("/lib.rs", []), | 250 | "test_crate": ("/lib.rs", []), |
251 | }, | 251 | }, |
252 | ); | 252 | ); |
253 | assert_snapshot_matches!(map, @r###" | 253 | assert_snapshot!(map, @r###" |
254 | ⋮crate | 254 | ⋮crate |
255 | ⋮Bar: t v | 255 | ⋮Bar: t v |
256 | ⋮Baz: t v | 256 | ⋮Baz: t v |
@@ -267,7 +267,7 @@ fn can_import_enum_variant() { | |||
267 | use self::E::V; | 267 | use self::E::V; |
268 | ", | 268 | ", |
269 | ); | 269 | ); |
270 | assert_snapshot_matches!(map, @r###" | 270 | assert_snapshot!(map, @r###" |
271 | ⋮crate | 271 | ⋮crate |
272 | ⋮E: t | 272 | ⋮E: t |
273 | ⋮V: t v | 273 | ⋮V: t v |
@@ -299,7 +299,7 @@ fn edition_2015_imports() { | |||
299 | }, | 299 | }, |
300 | ); | 300 | ); |
301 | 301 | ||
302 | assert_snapshot_matches!(map, @r###" | 302 | assert_snapshot!(map, @r###" |
303 | ⋮crate | 303 | ⋮crate |
304 | ⋮bar: t | 304 | ⋮bar: t |
305 | ⋮foo: t | 305 | ⋮foo: t |
@@ -326,7 +326,7 @@ fn item_map_using_self() { | |||
326 | pub struct Baz; | 326 | pub struct Baz; |
327 | ", | 327 | ", |
328 | ); | 328 | ); |
329 | assert_snapshot_matches!(map, @r###" | 329 | assert_snapshot!(map, @r###" |
330 | ⋮crate | 330 | ⋮crate |
331 | ⋮Baz: t v | 331 | ⋮Baz: t v |
332 | ⋮foo: t | 332 | ⋮foo: t |
@@ -355,7 +355,7 @@ fn item_map_across_crates() { | |||
355 | }, | 355 | }, |
356 | ); | 356 | ); |
357 | 357 | ||
358 | assert_snapshot_matches!(map, @r###" | 358 | assert_snapshot!(map, @r###" |
359 | ⋮crate | 359 | ⋮crate |
360 | ⋮Baz: t v | 360 | ⋮Baz: t v |
361 | "###); | 361 | "###); |
@@ -383,7 +383,7 @@ fn extern_crate_rename() { | |||
383 | }, | 383 | }, |
384 | ); | 384 | ); |
385 | 385 | ||
386 | assert_snapshot_matches!(map, @r###" | 386 | assert_snapshot!(map, @r###" |
387 | ⋮crate | 387 | ⋮crate |
388 | ⋮alloc_crate: t | 388 | ⋮alloc_crate: t |
389 | ⋮sync: t | 389 | ⋮sync: t |
@@ -415,7 +415,7 @@ fn extern_crate_rename_2015_edition() { | |||
415 | }, | 415 | }, |
416 | ); | 416 | ); |
417 | 417 | ||
418 | assert_snapshot_matches!(map, | 418 | assert_snapshot!(map, |
419 | @r###" | 419 | @r###" |
420 | ⋮crate | 420 | ⋮crate |
421 | ⋮alloc_crate: t | 421 | ⋮alloc_crate: t |
@@ -449,7 +449,7 @@ fn import_across_source_roots() { | |||
449 | }, | 449 | }, |
450 | ); | 450 | ); |
451 | 451 | ||
452 | assert_snapshot_matches!(map, @r###" | 452 | assert_snapshot!(map, @r###" |
453 | ⋮crate | 453 | ⋮crate |
454 | ⋮C: t v | 454 | ⋮C: t v |
455 | "###); | 455 | "###); |
@@ -476,7 +476,7 @@ fn reexport_across_crates() { | |||
476 | }, | 476 | }, |
477 | ); | 477 | ); |
478 | 478 | ||
479 | assert_snapshot_matches!(map, @r###" | 479 | assert_snapshot!(map, @r###" |
480 | ⋮crate | 480 | ⋮crate |
481 | ⋮Baz: t v | 481 | ⋮Baz: t v |
482 | "###); | 482 | "###); |
@@ -499,7 +499,7 @@ fn values_dont_shadow_extern_crates() { | |||
499 | }, | 499 | }, |
500 | ); | 500 | ); |
501 | 501 | ||
502 | assert_snapshot_matches!(map, @r###" | 502 | assert_snapshot!(map, @r###" |
503 | ⋮crate | 503 | ⋮crate |
504 | ⋮Bar: t v | 504 | ⋮Bar: t v |
505 | ⋮foo: v | 505 | ⋮foo: v |
diff --git a/crates/ra_hir/src/nameres/tests/globs.rs b/crates/ra_hir/src/nameres/tests/globs.rs index e1519ca6b..7ac22b47b 100644 --- a/crates/ra_hir/src/nameres/tests/globs.rs +++ b/crates/ra_hir/src/nameres/tests/globs.rs | |||
@@ -17,7 +17,7 @@ fn glob_1() { | |||
17 | pub struct Baz; | 17 | pub struct Baz; |
18 | ", | 18 | ", |
19 | ); | 19 | ); |
20 | assert_snapshot_matches!(map, @r###" | 20 | assert_snapshot!(map, @r###" |
21 | ⋮crate | 21 | ⋮crate |
22 | ⋮Baz: t v | 22 | ⋮Baz: t v |
23 | ⋮Foo: t v | 23 | ⋮Foo: t v |
@@ -53,7 +53,7 @@ fn glob_2() { | |||
53 | pub use super::*; | 53 | pub use super::*; |
54 | ", | 54 | ", |
55 | ); | 55 | ); |
56 | assert_snapshot_matches!(map, @r###" | 56 | assert_snapshot!(map, @r###" |
57 | ⋮crate | 57 | ⋮crate |
58 | ⋮Baz: t v | 58 | ⋮Baz: t v |
59 | ⋮Foo: t v | 59 | ⋮Foo: t v |
@@ -89,7 +89,7 @@ fn glob_across_crates() { | |||
89 | "test_crate": ("/lib.rs", []), | 89 | "test_crate": ("/lib.rs", []), |
90 | }, | 90 | }, |
91 | ); | 91 | ); |
92 | assert_snapshot_matches!(map, @r###" | 92 | assert_snapshot!(map, @r###" |
93 | ⋮crate | 93 | ⋮crate |
94 | ⋮Baz: t v | 94 | ⋮Baz: t v |
95 | "### | 95 | "### |
@@ -108,7 +108,7 @@ fn glob_enum() { | |||
108 | use self::Foo::*; | 108 | use self::Foo::*; |
109 | ", | 109 | ", |
110 | ); | 110 | ); |
111 | assert_snapshot_matches!(map, @r###" | 111 | assert_snapshot!(map, @r###" |
112 | ⋮crate | 112 | ⋮crate |
113 | ⋮Bar: t v | 113 | ⋮Bar: t v |
114 | ⋮Baz: t v | 114 | ⋮Baz: t v |
diff --git a/crates/ra_hir/src/nameres/tests/macros.rs b/crates/ra_hir/src/nameres/tests/macros.rs index 4e04740eb..631df2cef 100644 --- a/crates/ra_hir/src/nameres/tests/macros.rs +++ b/crates/ra_hir/src/nameres/tests/macros.rs | |||
@@ -17,7 +17,7 @@ fn macro_rules_are_globally_visible() { | |||
17 | structs!(Bar, Baz); | 17 | structs!(Bar, Baz); |
18 | ", | 18 | ", |
19 | ); | 19 | ); |
20 | assert_snapshot_matches!(map, @r###" | 20 | assert_snapshot!(map, @r###" |
21 | ⋮crate | 21 | ⋮crate |
22 | ⋮Foo: t v | 22 | ⋮Foo: t v |
23 | ⋮nested: t | 23 | ⋮nested: t |
@@ -45,7 +45,7 @@ fn macro_rules_can_define_modules() { | |||
45 | struct X; | 45 | struct X; |
46 | ", | 46 | ", |
47 | ); | 47 | ); |
48 | assert_snapshot_matches!(map, @r###" | 48 | assert_snapshot!(map, @r###" |
49 | ⋮crate | 49 | ⋮crate |
50 | ⋮m: m | 50 | ⋮m: m |
51 | ⋮n1: t | 51 | ⋮n1: t |
@@ -82,7 +82,7 @@ fn macro_rules_from_other_crates_are_visible() { | |||
82 | "foo": ("/lib.rs", []), | 82 | "foo": ("/lib.rs", []), |
83 | }, | 83 | }, |
84 | ); | 84 | ); |
85 | assert_snapshot_matches!(map, @r###" | 85 | assert_snapshot!(map, @r###" |
86 | ⋮crate | 86 | ⋮crate |
87 | ⋮Bar: t v | 87 | ⋮Bar: t v |
88 | ⋮Foo: t v | 88 | ⋮Foo: t v |
@@ -129,7 +129,7 @@ fn unexpanded_macro_should_expand_by_fixedpoint_loop() { | |||
129 | "foo": ("/lib.rs", []), | 129 | "foo": ("/lib.rs", []), |
130 | }, | 130 | }, |
131 | ); | 131 | ); |
132 | assert_snapshot_matches!(map, @r###" | 132 | assert_snapshot!(map, @r###" |
133 | ⋮crate | 133 | ⋮crate |
134 | ⋮Foo: t v | 134 | ⋮Foo: t v |
135 | ⋮bar: m | 135 | ⋮bar: m |
diff --git a/crates/ra_hir/src/nameres/tests/mods.rs b/crates/ra_hir/src/nameres/tests/mods.rs index 6dd18df1a..4f8398460 100644 --- a/crates/ra_hir/src/nameres/tests/mods.rs +++ b/crates/ra_hir/src/nameres/tests/mods.rs | |||
@@ -19,7 +19,7 @@ fn name_res_works_for_broken_modules() { | |||
19 | pub struct Baz; | 19 | pub struct Baz; |
20 | ", | 20 | ", |
21 | ); | 21 | ); |
22 | assert_snapshot_matches!(map, @r###" | 22 | assert_snapshot!(map, @r###" |
23 | ⋮crate | 23 | ⋮crate |
24 | ⋮Baz: _ | 24 | ⋮Baz: _ |
25 | "###); | 25 | "###); |
@@ -41,7 +41,7 @@ fn module_resolution_works_for_non_standard_filenames() { | |||
41 | }, | 41 | }, |
42 | ); | 42 | ); |
43 | 43 | ||
44 | assert_snapshot_matches!(map, @r###" | 44 | assert_snapshot!(map, @r###" |
45 | ⋮crate | 45 | ⋮crate |
46 | ⋮Bar: t v | 46 | ⋮Bar: t v |
47 | ⋮foo: t | 47 | ⋮foo: t |
@@ -67,7 +67,7 @@ fn module_resolution_works_for_raw_modules() { | |||
67 | }, | 67 | }, |
68 | ); | 68 | ); |
69 | 69 | ||
70 | assert_snapshot_matches!(map, @r###" | 70 | assert_snapshot!(map, @r###" |
71 | ⋮crate | 71 | ⋮crate |
72 | ⋮Bar: t v | 72 | ⋮Bar: t v |
73 | ⋮async: t | 73 | ⋮async: t |
@@ -94,7 +94,7 @@ fn module_resolution_decl_path() { | |||
94 | }, | 94 | }, |
95 | ); | 95 | ); |
96 | 96 | ||
97 | assert_snapshot_matches!(map, @r###" | 97 | assert_snapshot!(map, @r###" |
98 | ⋮crate | 98 | ⋮crate |
99 | ⋮Bar: t v | 99 | ⋮Bar: t v |
100 | ⋮foo: t | 100 | ⋮foo: t |
@@ -110,7 +110,7 @@ fn module_resolution_module_with_path_in_mod_rs() { | |||
110 | r###" | 110 | r###" |
111 | //- /main.rs | 111 | //- /main.rs |
112 | mod foo; | 112 | mod foo; |
113 | 113 | ||
114 | //- /foo/mod.rs | 114 | //- /foo/mod.rs |
115 | #[path = "baz.rs"] | 115 | #[path = "baz.rs"] |
116 | pub mod bar; | 116 | pub mod bar; |
@@ -125,7 +125,7 @@ fn module_resolution_module_with_path_in_mod_rs() { | |||
125 | }, | 125 | }, |
126 | ); | 126 | ); |
127 | 127 | ||
128 | assert_snapshot_matches!(map, @r###" | 128 | assert_snapshot!(map, @r###" |
129 | ⋮crate | 129 | ⋮crate |
130 | ⋮foo: t | 130 | ⋮foo: t |
131 | ⋮ | 131 | ⋮ |
@@ -144,7 +144,7 @@ fn module_resolution_module_with_path_non_crate_root() { | |||
144 | r###" | 144 | r###" |
145 | //- /main.rs | 145 | //- /main.rs |
146 | mod foo; | 146 | mod foo; |
147 | 147 | ||
148 | //- /foo.rs | 148 | //- /foo.rs |
149 | #[path = "baz.rs"] | 149 | #[path = "baz.rs"] |
150 | pub mod bar; | 150 | pub mod bar; |
@@ -159,7 +159,7 @@ fn module_resolution_module_with_path_non_crate_root() { | |||
159 | }, | 159 | }, |
160 | ); | 160 | ); |
161 | 161 | ||
162 | assert_snapshot_matches!(map, @r###" | 162 | assert_snapshot!(map, @r###" |
163 | ⋮crate | 163 | ⋮crate |
164 | ⋮foo: t | 164 | ⋮foo: t |
165 | ⋮ | 165 | ⋮ |
@@ -189,7 +189,7 @@ fn module_resolution_module_decl_path_super() { | |||
189 | }, | 189 | }, |
190 | ); | 190 | ); |
191 | 191 | ||
192 | assert_snapshot_matches!(map, @r###" | 192 | assert_snapshot!(map, @r###" |
193 | ⋮crate | 193 | ⋮crate |
194 | ⋮Baz: t v | 194 | ⋮Baz: t v |
195 | ⋮foo: t | 195 | ⋮foo: t |
@@ -215,7 +215,7 @@ fn module_resolution_explicit_path_mod_rs() { | |||
215 | }, | 215 | }, |
216 | ); | 216 | ); |
217 | 217 | ||
218 | assert_snapshot_matches!(map, @r###" | 218 | assert_snapshot!(map, @r###" |
219 | ⋮crate | 219 | ⋮crate |
220 | ⋮foo: t | 220 | ⋮foo: t |
221 | ⋮ | 221 | ⋮ |
@@ -243,7 +243,7 @@ fn module_resolution_relative_path() { | |||
243 | }, | 243 | }, |
244 | ); | 244 | ); |
245 | 245 | ||
246 | assert_snapshot_matches!(map, @r###" | 246 | assert_snapshot!(map, @r###" |
247 | ⋮crate | 247 | ⋮crate |
248 | ⋮foo: t | 248 | ⋮foo: t |
249 | ⋮ | 249 | ⋮ |
@@ -274,7 +274,7 @@ fn module_resolution_relative_path_2() { | |||
274 | }, | 274 | }, |
275 | ); | 275 | ); |
276 | 276 | ||
277 | assert_snapshot_matches!(map, @r###" | 277 | assert_snapshot!(map, @r###" |
278 | ⋮crate | 278 | ⋮crate |
279 | ⋮foo: t | 279 | ⋮foo: t |
280 | ⋮ | 280 | ⋮ |
@@ -302,7 +302,7 @@ fn module_resolution_explicit_path_mod_rs_2() { | |||
302 | }, | 302 | }, |
303 | ); | 303 | ); |
304 | 304 | ||
305 | assert_snapshot_matches!(map, @r###" | 305 | assert_snapshot!(map, @r###" |
306 | ⋮crate | 306 | ⋮crate |
307 | ⋮foo: t | 307 | ⋮foo: t |
308 | ⋮ | 308 | ⋮ |
@@ -327,7 +327,7 @@ fn module_resolution_explicit_path_mod_rs_with_win_separator() { | |||
327 | }, | 327 | }, |
328 | ); | 328 | ); |
329 | 329 | ||
330 | assert_snapshot_matches!(map, @r###" | 330 | assert_snapshot!(map, @r###" |
331 | ⋮crate | 331 | ⋮crate |
332 | ⋮foo: t | 332 | ⋮foo: t |
333 | ⋮ | 333 | ⋮ |
@@ -354,7 +354,7 @@ fn module_resolution_decl_inside_inline_module_with_path_attribute() { | |||
354 | }, | 354 | }, |
355 | ); | 355 | ); |
356 | 356 | ||
357 | assert_snapshot_matches!(map, @r###" | 357 | assert_snapshot!(map, @r###" |
358 | ⋮crate | 358 | ⋮crate |
359 | ⋮foo: t | 359 | ⋮foo: t |
360 | ⋮ | 360 | ⋮ |
@@ -383,7 +383,7 @@ fn module_resolution_decl_inside_inline_module() { | |||
383 | }, | 383 | }, |
384 | ); | 384 | ); |
385 | 385 | ||
386 | assert_snapshot_matches!(map, @r###" | 386 | assert_snapshot!(map, @r###" |
387 | ⋮crate | 387 | ⋮crate |
388 | ⋮foo: t | 388 | ⋮foo: t |
389 | ⋮ | 389 | ⋮ |
@@ -413,7 +413,7 @@ fn module_resolution_decl_inside_inline_module_2_with_path_attribute() { | |||
413 | }, | 413 | }, |
414 | ); | 414 | ); |
415 | 415 | ||
416 | assert_snapshot_matches!(map, @r###" | 416 | assert_snapshot!(map, @r###" |
417 | ⋮crate | 417 | ⋮crate |
418 | ⋮foo: t | 418 | ⋮foo: t |
419 | ⋮ | 419 | ⋮ |
@@ -444,7 +444,7 @@ fn module_resolution_decl_inside_inline_module_3() { | |||
444 | }, | 444 | }, |
445 | ); | 445 | ); |
446 | 446 | ||
447 | assert_snapshot_matches!(map, @r###" | 447 | assert_snapshot!(map, @r###" |
448 | ⋮crate | 448 | ⋮crate |
449 | ⋮foo: t | 449 | ⋮foo: t |
450 | ⋮ | 450 | ⋮ |
@@ -475,7 +475,7 @@ fn module_resolution_decl_inside_inline_module_empty_path() { | |||
475 | }, | 475 | }, |
476 | ); | 476 | ); |
477 | 477 | ||
478 | assert_snapshot_matches!(map, @r###" | 478 | assert_snapshot!(map, @r###" |
479 | ⋮crate | 479 | ⋮crate |
480 | ⋮foo: t | 480 | ⋮foo: t |
481 | ⋮ | 481 | ⋮ |
@@ -503,7 +503,7 @@ fn module_resolution_decl_empty_path() { | |||
503 | }, | 503 | }, |
504 | ); | 504 | ); |
505 | 505 | ||
506 | assert_snapshot_matches!(map, @r###" | 506 | assert_snapshot!(map, @r###" |
507 | ⋮crate | 507 | ⋮crate |
508 | ⋮foo: t | 508 | ⋮foo: t |
509 | ⋮ | 509 | ⋮ |
@@ -530,7 +530,7 @@ fn module_resolution_decl_inside_inline_module_relative_path() { | |||
530 | }, | 530 | }, |
531 | ); | 531 | ); |
532 | 532 | ||
533 | assert_snapshot_matches!(map, @r###" | 533 | assert_snapshot!(map, @r###" |
534 | ⋮crate | 534 | ⋮crate |
535 | ⋮foo: t | 535 | ⋮foo: t |
536 | ⋮ | 536 | ⋮ |
@@ -561,7 +561,7 @@ fn module_resolution_decl_inside_inline_module_in_crate_root() { | |||
561 | }, | 561 | }, |
562 | ); | 562 | ); |
563 | 563 | ||
564 | assert_snapshot_matches!(map, @r###" | 564 | assert_snapshot!(map, @r###" |
565 | ⋮crate | 565 | ⋮crate |
566 | ⋮Baz: t v | 566 | ⋮Baz: t v |
567 | ⋮foo: t | 567 | ⋮foo: t |
@@ -596,7 +596,7 @@ fn module_resolution_decl_inside_inline_module_in_mod_rs() { | |||
596 | }, | 596 | }, |
597 | ); | 597 | ); |
598 | 598 | ||
599 | assert_snapshot_matches!(map, @r###" | 599 | assert_snapshot!(map, @r###" |
600 | ⋮crate | 600 | ⋮crate |
601 | ⋮foo: t | 601 | ⋮foo: t |
602 | ⋮ | 602 | ⋮ |
@@ -634,7 +634,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() { | |||
634 | }, | 634 | }, |
635 | ); | 635 | ); |
636 | 636 | ||
637 | assert_snapshot_matches!(map, @r###" | 637 | assert_snapshot!(map, @r###" |
638 | ⋮crate | 638 | ⋮crate |
639 | ⋮foo: t | 639 | ⋮foo: t |
640 | ⋮ | 640 | ⋮ |
@@ -672,7 +672,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() { | |||
672 | }, | 672 | }, |
673 | ); | 673 | ); |
674 | 674 | ||
675 | assert_snapshot_matches!(map, @r###" | 675 | assert_snapshot!(map, @r###" |
676 | ⋮crate | 676 | ⋮crate |
677 | ⋮foo: t | 677 | ⋮foo: t |
678 | ⋮ | 678 | ⋮ |
@@ -701,8 +701,8 @@ fn unresolved_module_diagnostics() { | |||
701 | ) | 701 | ) |
702 | .diagnostics(); | 702 | .diagnostics(); |
703 | 703 | ||
704 | assert_snapshot_matches!(diagnostics, @r###" | 704 | assert_snapshot!(diagnostics, @r###" |
705 | "mod bar;": unresolved module | 705 | "mod bar;": unresolved module |
706 | "### | 706 | "### |
707 | ); | 707 | ); |
708 | } | 708 | } |
diff --git a/crates/ra_hir/src/nameres/tests/primitives.rs b/crates/ra_hir/src/nameres/tests/primitives.rs index 734744835..0e2708658 100644 --- a/crates/ra_hir/src/nameres/tests/primitives.rs +++ b/crates/ra_hir/src/nameres/tests/primitives.rs | |||
@@ -12,7 +12,7 @@ fn primitive_reexport() { | |||
12 | pub use i32 as int; | 12 | pub use i32 as int; |
13 | ", | 13 | ", |
14 | ); | 14 | ); |
15 | assert_snapshot_matches!(map, @r###" | 15 | assert_snapshot!(map, @r###" |
16 | ⋮crate | 16 | ⋮crate |
17 | ⋮foo: t | 17 | ⋮foo: t |
18 | ⋮int: t | 18 | ⋮int: t |
diff --git a/crates/ra_hir/src/ty/tests.rs b/crates/ra_hir/src/ty/tests.rs index e3eb0c3fa..b034fd59e 100644 --- a/crates/ra_hir/src/ty/tests.rs +++ b/crates/ra_hir/src/ty/tests.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use std::fmt::Write; | 1 | use std::fmt::Write; |
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use insta::assert_snapshot_matches; | 4 | use insta::assert_snapshot; |
5 | 5 | ||
6 | use ra_db::{salsa::Database, FilePosition, SourceDatabase}; | 6 | use ra_db::{salsa::Database, FilePosition, SourceDatabase}; |
7 | use ra_syntax::{ | 7 | use ra_syntax::{ |
@@ -166,7 +166,7 @@ fn test() { | |||
166 | 166 | ||
167 | #[test] | 167 | #[test] |
168 | fn infer_basics() { | 168 | fn infer_basics() { |
169 | assert_snapshot_matches!( | 169 | assert_snapshot!( |
170 | infer(r#" | 170 | infer(r#" |
171 | fn test(a: u32, b: isize, c: !, d: &str) { | 171 | fn test(a: u32, b: isize, c: !, d: &str) { |
172 | a; | 172 | a; |
@@ -179,25 +179,27 @@ fn test(a: u32, b: isize, c: !, d: &str) { | |||
179 | 1.0f32; | 179 | 1.0f32; |
180 | }"#), | 180 | }"#), |
181 | @r###" | 181 | @r###" |
182 | [9; 10) 'a': u32 | 182 | |
183 | [17; 18) 'b': isize | 183 | [9; 10) 'a': u32 |
184 | [27; 28) 'c': ! | 184 | [17; 18) 'b': isize |
185 | [33; 34) 'd': &str | 185 | [27; 28) 'c': ! |
186 | [42; 121) '{ ...f32; }': () | 186 | [33; 34) 'd': &str |
187 | [48; 49) 'a': u32 | 187 | [42; 121) '{ ...f32; }': () |
188 | [55; 56) 'b': isize | 188 | [48; 49) 'a': u32 |
189 | [62; 63) 'c': ! | 189 | [55; 56) 'b': isize |
190 | [69; 70) 'd': &str | 190 | [62; 63) 'c': ! |
191 | [76; 82) '1usize': usize | 191 | [69; 70) 'd': &str |
192 | [88; 94) '1isize': isize | 192 | [76; 82) '1usize': usize |
193 | [100; 106) '"test"': &str | 193 | [88; 94) '1isize': isize |
194 | [112; 118) '1.0f32': f32"### | 194 | [100; 106) '"test"': &str |
195 | [112; 118) '1.0f32': f32 | ||
196 | "### | ||
195 | ); | 197 | ); |
196 | } | 198 | } |
197 | 199 | ||
198 | #[test] | 200 | #[test] |
199 | fn infer_let() { | 201 | fn infer_let() { |
200 | assert_snapshot_matches!( | 202 | assert_snapshot!( |
201 | infer(r#" | 203 | infer(r#" |
202 | fn test() { | 204 | fn test() { |
203 | let a = 1isize; | 205 | let a = 1isize; |
@@ -206,19 +208,21 @@ fn test() { | |||
206 | } | 208 | } |
207 | "#), | 209 | "#), |
208 | @r###" | 210 | @r###" |
209 | [11; 71) '{ ...= b; }': () | 211 | |
210 | [21; 22) 'a': isize | 212 | [11; 71) '{ ...= b; }': () |
211 | [25; 31) '1isize': isize | 213 | [21; 22) 'a': isize |
212 | [41; 42) 'b': usize | 214 | [25; 31) '1isize': isize |
213 | [52; 53) '1': usize | 215 | [41; 42) 'b': usize |
214 | [63; 64) 'c': usize | 216 | [52; 53) '1': usize |
215 | [67; 68) 'b': usize"### | 217 | [63; 64) 'c': usize |
218 | [67; 68) 'b': usize | ||
219 | "### | ||
216 | ); | 220 | ); |
217 | } | 221 | } |
218 | 222 | ||
219 | #[test] | 223 | #[test] |
220 | fn infer_paths() { | 224 | fn infer_paths() { |
221 | assert_snapshot_matches!( | 225 | assert_snapshot!( |
222 | infer(r#" | 226 | infer(r#" |
223 | fn a() -> u32 { 1 } | 227 | fn a() -> u32 { 1 } |
224 | 228 | ||
@@ -232,21 +236,23 @@ fn test() { | |||
232 | } | 236 | } |
233 | "#), | 237 | "#), |
234 | @r###" | 238 | @r###" |
235 | [15; 20) '{ 1 }': u32 | 239 | |
236 | [17; 18) '1': u32 | 240 | [15; 20) '{ 1 }': u32 |
237 | [48; 53) '{ 1 }': u32 | 241 | [17; 18) '1': u32 |
238 | [50; 51) '1': u32 | 242 | [48; 53) '{ 1 }': u32 |
239 | [67; 91) '{ ...c(); }': () | 243 | [50; 51) '1': u32 |
240 | [73; 74) 'a': fn a() -> u32 | 244 | [67; 91) '{ ...c(); }': () |
241 | [73; 76) 'a()': u32 | 245 | [73; 74) 'a': fn a() -> u32 |
242 | [82; 86) 'b::c': fn c() -> u32 | 246 | [73; 76) 'a()': u32 |
243 | [82; 88) 'b::c()': u32"### | 247 | [82; 86) 'b::c': fn c() -> u32 |
248 | [82; 88) 'b::c()': u32 | ||
249 | "### | ||
244 | ); | 250 | ); |
245 | } | 251 | } |
246 | 252 | ||
247 | #[test] | 253 | #[test] |
248 | fn infer_struct() { | 254 | fn infer_struct() { |
249 | assert_snapshot_matches!( | 255 | assert_snapshot!( |
250 | infer(r#" | 256 | infer(r#" |
251 | struct A { | 257 | struct A { |
252 | b: B, | 258 | b: B, |
@@ -264,28 +270,30 @@ fn test() { | |||
264 | } | 270 | } |
265 | "#), | 271 | "#), |
266 | @r###" | 272 | @r###" |
267 | [72; 154) '{ ...a.c; }': () | 273 | |
268 | [82; 83) 'c': C | 274 | [72; 154) '{ ...a.c; }': () |
269 | [86; 87) 'C': C(usize) -> C | 275 | [82; 83) 'c': C |
270 | [86; 90) 'C(1)': C | 276 | [86; 87) 'C': C(usize) -> C |
271 | [88; 89) '1': usize | 277 | [86; 90) 'C(1)': C |
272 | [96; 97) 'B': B | 278 | [88; 89) '1': usize |
273 | [107; 108) 'a': A | 279 | [96; 97) 'B': B |
274 | [114; 133) 'A { b:...C(1) }': A | 280 | [107; 108) 'a': A |
275 | [121; 122) 'B': B | 281 | [114; 133) 'A { b:...C(1) }': A |
276 | [127; 128) 'C': C(usize) -> C | 282 | [121; 122) 'B': B |
277 | [127; 131) 'C(1)': C | 283 | [127; 128) 'C': C(usize) -> C |
278 | [129; 130) '1': usize | 284 | [127; 131) 'C(1)': C |
279 | [139; 140) 'a': A | 285 | [129; 130) '1': usize |
280 | [139; 142) 'a.b': B | 286 | [139; 140) 'a': A |
281 | [148; 149) 'a': A | 287 | [139; 142) 'a.b': B |
282 | [148; 151) 'a.c': C"### | 288 | [148; 149) 'a': A |
289 | [148; 151) 'a.c': C | ||
290 | "### | ||
283 | ); | 291 | ); |
284 | } | 292 | } |
285 | 293 | ||
286 | #[test] | 294 | #[test] |
287 | fn infer_enum() { | 295 | fn infer_enum() { |
288 | assert_snapshot_matches!( | 296 | assert_snapshot!( |
289 | infer(r#" | 297 | infer(r#" |
290 | enum E { | 298 | enum E { |
291 | V1 { field: u32 }, | 299 | V1 { field: u32 }, |
@@ -296,16 +304,18 @@ fn test() { | |||
296 | E::V2; | 304 | E::V2; |
297 | }"#), | 305 | }"#), |
298 | @r###" | 306 | @r###" |
299 | [48; 82) '{ E:...:V2; }': () | 307 | |
300 | [52; 70) 'E::V1 ...d: 1 }': E | 308 | [48; 82) '{ E:...:V2; }': () |
301 | [67; 68) '1': u32 | 309 | [52; 70) 'E::V1 ...d: 1 }': E |
302 | [74; 79) 'E::V2': E"### | 310 | [67; 68) '1': u32 |
311 | [74; 79) 'E::V2': E | ||
312 | "### | ||
303 | ); | 313 | ); |
304 | } | 314 | } |
305 | 315 | ||
306 | #[test] | 316 | #[test] |
307 | fn infer_refs() { | 317 | fn infer_refs() { |
308 | assert_snapshot_matches!( | 318 | assert_snapshot!( |
309 | infer(r#" | 319 | infer(r#" |
310 | fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) { | 320 | fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) { |
311 | a; | 321 | a; |
@@ -322,35 +332,37 @@ fn test(a: &u32, b: &mut u32, c: *const u32, d: *mut u32) { | |||
322 | } | 332 | } |
323 | "#), | 333 | "#), |
324 | @r###" | 334 | @r###" |
325 | [9; 10) 'a': &u32 | 335 | |
326 | [18; 19) 'b': &mut u32 | 336 | [9; 10) 'a': &u32 |
327 | [31; 32) 'c': *const u32 | 337 | [18; 19) 'b': &mut u32 |
328 | [46; 47) 'd': *mut u32 | 338 | [31; 32) 'c': *const u32 |
329 | [59; 150) '{ ... *d; }': () | 339 | [46; 47) 'd': *mut u32 |
330 | [65; 66) 'a': &u32 | 340 | [59; 150) '{ ... *d; }': () |
331 | [72; 74) '*a': u32 | 341 | [65; 66) 'a': &u32 |
332 | [73; 74) 'a': &u32 | 342 | [72; 74) '*a': u32 |
333 | [80; 82) '&a': &&u32 | 343 | [73; 74) 'a': &u32 |
334 | [81; 82) 'a': &u32 | 344 | [80; 82) '&a': &&u32 |
335 | [88; 94) '&mut a': &mut &u32 | 345 | [81; 82) 'a': &u32 |
336 | [93; 94) 'a': &u32 | 346 | [88; 94) '&mut a': &mut &u32 |
337 | [100; 101) 'b': &mut u32 | 347 | [93; 94) 'a': &u32 |
338 | [107; 109) '*b': u32 | 348 | [100; 101) 'b': &mut u32 |
339 | [108; 109) 'b': &mut u32 | 349 | [107; 109) '*b': u32 |
340 | [115; 117) '&b': &&mut u32 | 350 | [108; 109) 'b': &mut u32 |
341 | [116; 117) 'b': &mut u32 | 351 | [115; 117) '&b': &&mut u32 |
342 | [123; 124) 'c': *const u32 | 352 | [116; 117) 'b': &mut u32 |
343 | [130; 132) '*c': u32 | 353 | [123; 124) 'c': *const u32 |
344 | [131; 132) 'c': *const u32 | 354 | [130; 132) '*c': u32 |
345 | [138; 139) 'd': *mut u32 | 355 | [131; 132) 'c': *const u32 |
346 | [145; 147) '*d': u32 | 356 | [138; 139) 'd': *mut u32 |
347 | [146; 147) 'd': *mut u32"### | 357 | [145; 147) '*d': u32 |
358 | [146; 147) 'd': *mut u32 | ||
359 | "### | ||
348 | ); | 360 | ); |
349 | } | 361 | } |
350 | 362 | ||
351 | #[test] | 363 | #[test] |
352 | fn infer_literals() { | 364 | fn infer_literals() { |
353 | assert_snapshot_matches!( | 365 | assert_snapshot!( |
354 | infer(r##" | 366 | infer(r##" |
355 | fn test() { | 367 | fn test() { |
356 | 5i32; | 368 | 5i32; |
@@ -373,26 +385,28 @@ fn test() { | |||
373 | } | 385 | } |
374 | "##), | 386 | "##), |
375 | @r###" | 387 | @r###" |
376 | [11; 221) '{ ...o"#; }': () | 388 | |
377 | [17; 21) '5i32': i32 | 389 | [11; 221) '{ ...o"#; }': () |
378 | [27; 31) '5f32': f32 | 390 | [17; 21) '5i32': i32 |
379 | [37; 41) '5f64': f64 | 391 | [27; 31) '5f32': f32 |
380 | [47; 54) '"hello"': &str | 392 | [37; 41) '5f64': f64 |
381 | [60; 68) 'b"bytes"': &[u8] | 393 | [47; 54) '"hello"': &str |
382 | [74; 77) ''c'': char | 394 | [60; 68) 'b"bytes"': &[u8] |
383 | [83; 87) 'b'b'': u8 | 395 | [74; 77) ''c'': char |
384 | [93; 97) '3.14': f64 | 396 | [83; 87) 'b'b'': u8 |
385 | [103; 107) '5000': i32 | 397 | [93; 97) '3.14': f64 |
386 | [113; 118) 'false': bool | 398 | [103; 107) '5000': i32 |
387 | [124; 128) 'true': bool | 399 | [113; 118) 'false': bool |
388 | [134; 202) 'r#" ... "#': &str | 400 | [124; 128) 'true': bool |
389 | [208; 218) 'br#"yolo"#': &[u8]"### | 401 | [134; 202) 'r#" ... "#': &str |
402 | [208; 218) 'br#"yolo"#': &[u8] | ||
403 | "### | ||
390 | ); | 404 | ); |
391 | } | 405 | } |
392 | 406 | ||
393 | #[test] | 407 | #[test] |
394 | fn infer_unary_op() { | 408 | fn infer_unary_op() { |
395 | assert_snapshot_matches!( | 409 | assert_snapshot!( |
396 | infer(r#" | 410 | infer(r#" |
397 | enum SomeType {} | 411 | enum SomeType {} |
398 | 412 | ||
@@ -415,53 +429,55 @@ fn test(x: SomeType) { | |||
415 | } | 429 | } |
416 | "#), | 430 | "#), |
417 | @r###" | 431 | @r###" |
418 | [27; 28) 'x': SomeType | 432 | |
419 | [40; 272) '{ ...lo"; }': () | 433 | [27; 28) 'x': SomeType |
420 | [50; 51) 'b': bool | 434 | [40; 272) '{ ...lo"; }': () |
421 | [54; 59) 'false': bool | 435 | [50; 51) 'b': bool |
422 | [69; 70) 'c': bool | 436 | [54; 59) 'false': bool |
423 | [73; 75) '!b': bool | 437 | [69; 70) 'c': bool |
424 | [74; 75) 'b': bool | 438 | [73; 75) '!b': bool |
425 | [85; 86) 'a': i128 | 439 | [74; 75) 'b': bool |
426 | [89; 92) '100': i128 | 440 | [85; 86) 'a': i128 |
427 | [102; 103) 'd': i128 | 441 | [89; 92) '100': i128 |
428 | [112; 114) '-a': i128 | 442 | [102; 103) 'd': i128 |
429 | [113; 114) 'a': i128 | 443 | [112; 114) '-a': i128 |
430 | [124; 125) 'e': i32 | 444 | [113; 114) 'a': i128 |
431 | [128; 132) '-100': i32 | 445 | [124; 125) 'e': i32 |
432 | [129; 132) '100': i32 | 446 | [128; 132) '-100': i32 |
433 | [142; 143) 'f': bool | 447 | [129; 132) '100': i32 |
434 | [146; 153) '!!!true': bool | 448 | [142; 143) 'f': bool |
435 | [147; 153) '!!true': bool | 449 | [146; 153) '!!!true': bool |
436 | [148; 153) '!true': bool | 450 | [147; 153) '!!true': bool |
437 | [149; 153) 'true': bool | 451 | [148; 153) '!true': bool |
438 | [163; 164) 'g': i32 | 452 | [149; 153) 'true': bool |
439 | [167; 170) '!42': i32 | 453 | [163; 164) 'g': i32 |
440 | [168; 170) '42': i32 | 454 | [167; 170) '!42': i32 |
441 | [180; 181) 'h': u32 | 455 | [168; 170) '42': i32 |
442 | [184; 190) '!10u32': u32 | 456 | [180; 181) 'h': u32 |
443 | [185; 190) '10u32': u32 | 457 | [184; 190) '!10u32': u32 |
444 | [200; 201) 'j': i128 | 458 | [185; 190) '10u32': u32 |
445 | [204; 206) '!a': i128 | 459 | [200; 201) 'j': i128 |
446 | [205; 206) 'a': i128 | 460 | [204; 206) '!a': i128 |
447 | [212; 217) '-3.14': f64 | 461 | [205; 206) 'a': i128 |
448 | [213; 217) '3.14': f64 | 462 | [212; 217) '-3.14': f64 |
449 | [223; 225) '!3': i32 | 463 | [213; 217) '3.14': f64 |
450 | [224; 225) '3': i32 | 464 | [223; 225) '!3': i32 |
451 | [231; 233) '-x': {unknown} | 465 | [224; 225) '3': i32 |
452 | [232; 233) 'x': SomeType | 466 | [231; 233) '-x': {unknown} |
453 | [239; 241) '!x': {unknown} | 467 | [232; 233) 'x': SomeType |
454 | [240; 241) 'x': SomeType | 468 | [239; 241) '!x': {unknown} |
455 | [247; 255) '-"hello"': {unknown} | 469 | [240; 241) 'x': SomeType |
456 | [248; 255) '"hello"': &str | 470 | [247; 255) '-"hello"': {unknown} |
457 | [261; 269) '!"hello"': {unknown} | 471 | [248; 255) '"hello"': &str |
458 | [262; 269) '"hello"': &str"### | 472 | [261; 269) '!"hello"': {unknown} |
473 | [262; 269) '"hello"': &str | ||
474 | "### | ||
459 | ); | 475 | ); |
460 | } | 476 | } |
461 | 477 | ||
462 | #[test] | 478 | #[test] |
463 | fn infer_backwards() { | 479 | fn infer_backwards() { |
464 | assert_snapshot_matches!( | 480 | assert_snapshot!( |
465 | infer(r#" | 481 | infer(r#" |
466 | fn takes_u32(x: u32) {} | 482 | fn takes_u32(x: u32) {} |
467 | 483 | ||
@@ -477,32 +493,34 @@ fn test() -> &mut &f64 { | |||
477 | } | 493 | } |
478 | "#), | 494 | "#), |
479 | @r###" | 495 | @r###" |
480 | [14; 15) 'x': u32 | 496 | |
481 | [22; 24) '{}': () | 497 | [14; 15) 'x': u32 |
482 | [78; 231) '{ ...t &c }': &mut &f64 | 498 | [22; 24) '{}': () |
483 | [88; 89) 'a': u32 | 499 | [78; 231) '{ ...t &c }': &mut &f64 |
484 | [92; 108) 'unknow...nction': {unknown} | 500 | [88; 89) 'a': u32 |
485 | [92; 110) 'unknow...tion()': u32 | 501 | [92; 108) 'unknow...nction': {unknown} |
486 | [116; 125) 'takes_u32': fn takes_u32(u32) -> () | 502 | [92; 110) 'unknow...tion()': u32 |
487 | [116; 128) 'takes_u32(a)': () | 503 | [116; 125) 'takes_u32': fn takes_u32(u32) -> () |
488 | [126; 127) 'a': u32 | 504 | [116; 128) 'takes_u32(a)': () |
489 | [138; 139) 'b': i32 | 505 | [126; 127) 'a': u32 |
490 | [142; 158) 'unknow...nction': {unknown} | 506 | [138; 139) 'b': i32 |
491 | [142; 160) 'unknow...tion()': i32 | 507 | [142; 158) 'unknow...nction': {unknown} |
492 | [166; 184) 'S { i3...d: b }': S | 508 | [142; 160) 'unknow...tion()': i32 |
493 | [181; 182) 'b': i32 | 509 | [166; 184) 'S { i3...d: b }': S |
494 | [194; 195) 'c': f64 | 510 | [181; 182) 'b': i32 |
495 | [198; 214) 'unknow...nction': {unknown} | 511 | [194; 195) 'c': f64 |
496 | [198; 216) 'unknow...tion()': f64 | 512 | [198; 214) 'unknow...nction': {unknown} |
497 | [222; 229) '&mut &c': &mut &f64 | 513 | [198; 216) 'unknow...tion()': f64 |
498 | [227; 229) '&c': &f64 | 514 | [222; 229) '&mut &c': &mut &f64 |
499 | [228; 229) 'c': f64"### | 515 | [227; 229) '&c': &f64 |
516 | [228; 229) 'c': f64 | ||
517 | "### | ||
500 | ); | 518 | ); |
501 | } | 519 | } |
502 | 520 | ||
503 | #[test] | 521 | #[test] |
504 | fn infer_self() { | 522 | fn infer_self() { |
505 | assert_snapshot_matches!( | 523 | assert_snapshot!( |
506 | infer(r#" | 524 | infer(r#" |
507 | struct S; | 525 | struct S; |
508 | 526 | ||
@@ -522,22 +540,24 @@ impl S { | |||
522 | } | 540 | } |
523 | "#), | 541 | "#), |
524 | @r###" | 542 | @r###" |
525 | [34; 38) 'self': &S | 543 | |
526 | [40; 61) '{ ... }': () | 544 | [34; 38) 'self': &S |
527 | [50; 54) 'self': &S | 545 | [40; 61) '{ ... }': () |
528 | [75; 79) 'self': &S | 546 | [50; 54) 'self': &S |
529 | [88; 109) '{ ... }': () | 547 | [75; 79) 'self': &S |
530 | [98; 102) 'self': &S | 548 | [88; 109) '{ ... }': () |
531 | [133; 153) '{ ... }': S | 549 | [98; 102) 'self': &S |
532 | [143; 147) 'S {}': S | 550 | [133; 153) '{ ... }': S |
533 | [177; 200) '{ ... }': S | 551 | [143; 147) 'S {}': S |
534 | [187; 194) 'Self {}': S"### | 552 | [177; 200) '{ ... }': S |
553 | [187; 194) 'Self {}': S | ||
554 | "### | ||
535 | ); | 555 | ); |
536 | } | 556 | } |
537 | 557 | ||
538 | #[test] | 558 | #[test] |
539 | fn infer_binary_op() { | 559 | fn infer_binary_op() { |
540 | assert_snapshot_matches!( | 560 | assert_snapshot!( |
541 | infer(r#" | 561 | infer(r#" |
542 | fn f(x: bool) -> i32 { | 562 | fn f(x: bool) -> i32 { |
543 | 0i32 | 563 | 0i32 |
@@ -560,62 +580,64 @@ fn test() -> bool { | |||
560 | } | 580 | } |
561 | "#), | 581 | "#), |
562 | @r###" | 582 | @r###" |
563 | [6; 7) 'x': bool | 583 | |
564 | [22; 34) '{ 0i32 }': i32 | 584 | [6; 7) 'x': bool |
565 | [28; 32) '0i32': i32 | 585 | [22; 34) '{ 0i32 }': i32 |
566 | [54; 370) '{ ... < 3 }': bool | 586 | [28; 32) '0i32': i32 |
567 | [64; 65) 'x': bool | 587 | [54; 370) '{ ... < 3 }': bool |
568 | [68; 69) 'a': bool | 588 | [64; 65) 'x': bool |
569 | [68; 74) 'a && b': bool | 589 | [68; 69) 'a': bool |
570 | [73; 74) 'b': bool | 590 | [68; 74) 'a && b': bool |
571 | [84; 85) 'y': bool | 591 | [73; 74) 'b': bool |
572 | [88; 92) 'true': bool | 592 | [84; 85) 'y': bool |
573 | [88; 101) 'true || false': bool | 593 | [88; 92) 'true': bool |
574 | [96; 101) 'false': bool | 594 | [88; 101) 'true || false': bool |
575 | [111; 112) 'z': bool | 595 | [96; 101) 'false': bool |
576 | [115; 116) 'x': bool | 596 | [111; 112) 'z': bool |
577 | [115; 121) 'x == y': bool | 597 | [115; 116) 'x': bool |
578 | [120; 121) 'y': bool | 598 | [115; 121) 'x == y': bool |
579 | [131; 132) 't': bool | 599 | [120; 121) 'y': bool |
580 | [135; 136) 'x': bool | 600 | [131; 132) 't': bool |
581 | [135; 141) 'x != y': bool | 601 | [135; 136) 'x': bool |
582 | [140; 141) 'y': bool | 602 | [135; 141) 'x != y': bool |
583 | [151; 162) 'minus_forty': isize | 603 | [140; 141) 'y': bool |
584 | [172; 180) '-40isize': isize | 604 | [151; 162) 'minus_forty': isize |
585 | [173; 180) '40isize': isize | 605 | [172; 180) '-40isize': isize |
586 | [190; 191) 'h': bool | 606 | [173; 180) '40isize': isize |
587 | [194; 205) 'minus_forty': isize | 607 | [190; 191) 'h': bool |
588 | [194; 216) 'minus_...ONST_2': bool | 608 | [194; 205) 'minus_forty': isize |
589 | [209; 216) 'CONST_2': isize | 609 | [194; 216) 'minus_...ONST_2': bool |
590 | [226; 227) 'c': i32 | 610 | [209; 216) 'CONST_2': isize |
591 | [230; 231) 'f': fn f(bool) -> i32 | 611 | [226; 227) 'c': i32 |
592 | [230; 239) 'f(z || y)': i32 | 612 | [230; 231) 'f': fn f(bool) -> i32 |
593 | [230; 243) 'f(z || y) + 5': i32 | 613 | [230; 239) 'f(z || y)': i32 |
594 | [232; 233) 'z': bool | 614 | [230; 243) 'f(z || y) + 5': i32 |
595 | [232; 238) 'z || y': bool | 615 | [232; 233) 'z': bool |
596 | [237; 238) 'y': bool | 616 | [232; 238) 'z || y': bool |
597 | [242; 243) '5': i32 | 617 | [237; 238) 'y': bool |
598 | [253; 254) 'd': {unknown} | 618 | [242; 243) '5': i32 |
599 | [257; 258) 'b': {unknown} | 619 | [253; 254) 'd': {unknown} |
600 | [268; 269) 'g': () | 620 | [257; 258) 'b': {unknown} |
601 | [272; 283) 'minus_forty': isize | 621 | [268; 269) 'g': () |
602 | [272; 288) 'minus_...y ^= i': () | 622 | [272; 283) 'minus_forty': isize |
603 | [287; 288) 'i': isize | 623 | [272; 288) 'minus_...y ^= i': () |
604 | [298; 301) 'ten': usize | 624 | [287; 288) 'i': isize |
605 | [311; 313) '10': usize | 625 | [298; 301) 'ten': usize |
606 | [323; 336) 'ten_is_eleven': bool | 626 | [311; 313) '10': usize |
607 | [339; 342) 'ten': usize | 627 | [323; 336) 'ten_is_eleven': bool |
608 | [339; 354) 'ten == some_num': bool | 628 | [339; 342) 'ten': usize |
609 | [346; 354) 'some_num': usize | 629 | [339; 354) 'ten == some_num': bool |
610 | [361; 364) 'ten': usize | 630 | [346; 354) 'some_num': usize |
611 | [361; 368) 'ten < 3': bool | 631 | [361; 364) 'ten': usize |
612 | [367; 368) '3': usize"### | 632 | [361; 368) 'ten < 3': bool |
633 | [367; 368) '3': usize | ||
634 | "### | ||
613 | ); | 635 | ); |
614 | } | 636 | } |
615 | 637 | ||
616 | #[test] | 638 | #[test] |
617 | fn infer_field_autoderef() { | 639 | fn infer_field_autoderef() { |
618 | assert_snapshot_matches!( | 640 | assert_snapshot!( |
619 | infer(r#" | 641 | infer(r#" |
620 | struct A { | 642 | struct A { |
621 | b: B, | 643 | b: B, |
@@ -641,72 +663,76 @@ fn test2(a1: *const A, a2: *mut A) { | |||
641 | } | 663 | } |
642 | "#), | 664 | "#), |
643 | @r###" | 665 | @r###" |
644 | [44; 45) 'a': A | 666 | |
645 | [50; 213) '{ ...5.b; }': () | 667 | [44; 45) 'a': A |
646 | [60; 62) 'a1': A | 668 | [50; 213) '{ ...5.b; }': () |
647 | [65; 66) 'a': A | 669 | [60; 62) 'a1': A |
648 | [72; 74) 'a1': A | 670 | [65; 66) 'a': A |
649 | [72; 76) 'a1.b': B | 671 | [72; 74) 'a1': A |
650 | [86; 88) 'a2': &A | 672 | [72; 76) 'a1.b': B |
651 | [91; 93) '&a': &A | 673 | [86; 88) 'a2': &A |
652 | [92; 93) 'a': A | 674 | [91; 93) '&a': &A |
653 | [99; 101) 'a2': &A | 675 | [92; 93) 'a': A |
654 | [99; 103) 'a2.b': B | 676 | [99; 101) 'a2': &A |
655 | [113; 115) 'a3': &mut A | 677 | [99; 103) 'a2.b': B |
656 | [118; 124) '&mut a': &mut A | 678 | [113; 115) 'a3': &mut A |
657 | [123; 124) 'a': A | 679 | [118; 124) '&mut a': &mut A |
658 | [130; 132) 'a3': &mut A | 680 | [123; 124) 'a': A |
659 | [130; 134) 'a3.b': B | 681 | [130; 132) 'a3': &mut A |
660 | [144; 146) 'a4': &&&&&&&A | 682 | [130; 134) 'a3.b': B |
661 | [149; 157) '&&&&&&&a': &&&&&&&A | 683 | [144; 146) 'a4': &&&&&&&A |
662 | [150; 157) '&&&&&&a': &&&&&&A | 684 | [149; 157) '&&&&&&&a': &&&&&&&A |
663 | [151; 157) '&&&&&a': &&&&&A | 685 | [150; 157) '&&&&&&a': &&&&&&A |
664 | [152; 157) '&&&&a': &&&&A | 686 | [151; 157) '&&&&&a': &&&&&A |
665 | [153; 157) '&&&a': &&&A | 687 | [152; 157) '&&&&a': &&&&A |
666 | [154; 157) '&&a': &&A | 688 | [153; 157) '&&&a': &&&A |
667 | [155; 157) '&a': &A | 689 | [154; 157) '&&a': &&A |
668 | [156; 157) 'a': A | 690 | [155; 157) '&a': &A |
669 | [163; 165) 'a4': &&&&&&&A | 691 | [156; 157) 'a': A |
670 | [163; 167) 'a4.b': B | 692 | [163; 165) 'a4': &&&&&&&A |
671 | [177; 179) 'a5': &mut &&mut &&mut A | 693 | [163; 167) 'a4.b': B |
672 | [182; 200) '&mut &...&mut a': &mut &&mut &&mut A | 694 | [177; 179) 'a5': &mut &&mut &&mut A |
673 | [187; 200) '&&mut &&mut a': &&mut &&mut A | 695 | [182; 200) '&mut &...&mut a': &mut &&mut &&mut A |
674 | [188; 200) '&mut &&mut a': &mut &&mut A | 696 | [187; 200) '&&mut &&mut a': &&mut &&mut A |
675 | [193; 200) '&&mut a': &&mut A | 697 | [188; 200) '&mut &&mut a': &mut &&mut A |
676 | [194; 200) '&mut a': &mut A | 698 | [193; 200) '&&mut a': &&mut A |
677 | [199; 200) 'a': A | 699 | [194; 200) '&mut a': &mut A |
678 | [206; 208) 'a5': &mut &&mut &&mut A | 700 | [199; 200) 'a': A |
679 | [206; 210) 'a5.b': B | 701 | [206; 208) 'a5': &mut &&mut &&mut A |
680 | [224; 226) 'a1': *const A | 702 | [206; 210) 'a5.b': B |
681 | [238; 240) 'a2': *mut A | 703 | [224; 226) 'a1': *const A |
682 | [250; 273) '{ ...2.b; }': () | 704 | [238; 240) 'a2': *mut A |
683 | [256; 258) 'a1': *const A | 705 | [250; 273) '{ ...2.b; }': () |
684 | [256; 260) 'a1.b': B | 706 | [256; 258) 'a1': *const A |
685 | [266; 268) 'a2': *mut A | 707 | [256; 260) 'a1.b': B |
686 | [266; 270) 'a2.b': B"### | 708 | [266; 268) 'a2': *mut A |
709 | [266; 270) 'a2.b': B | ||
710 | "### | ||
687 | ); | 711 | ); |
688 | } | 712 | } |
689 | 713 | ||
690 | #[test] | 714 | #[test] |
691 | fn bug_484() { | 715 | fn bug_484() { |
692 | assert_snapshot_matches!( | 716 | assert_snapshot!( |
693 | infer(r#" | 717 | infer(r#" |
694 | fn test() { | 718 | fn test() { |
695 | let x = if true {}; | 719 | let x = if true {}; |
696 | } | 720 | } |
697 | "#), | 721 | "#), |
698 | @r###" | 722 | @r###" |
699 | [11; 37) '{ l... {}; }': () | 723 | |
700 | [20; 21) 'x': () | 724 | [11; 37) '{ l... {}; }': () |
701 | [24; 34) 'if true {}': () | 725 | [20; 21) 'x': () |
702 | [27; 31) 'true': bool | 726 | [24; 34) 'if true {}': () |
703 | [32; 34) '{}': ()"### | 727 | [27; 31) 'true': bool |
728 | [32; 34) '{}': () | ||
729 | "### | ||
704 | ); | 730 | ); |
705 | } | 731 | } |
706 | 732 | ||
707 | #[test] | 733 | #[test] |
708 | fn infer_in_elseif() { | 734 | fn infer_in_elseif() { |
709 | assert_snapshot_matches!( | 735 | assert_snapshot!( |
710 | infer(r#" | 736 | infer(r#" |
711 | struct Foo { field: i32 } | 737 | struct Foo { field: i32 } |
712 | fn main(foo: Foo) { | 738 | fn main(foo: Foo) { |
@@ -718,24 +744,23 @@ fn main(foo: Foo) { | |||
718 | } | 744 | } |
719 | "#), | 745 | "#), |
720 | @r###" | 746 | @r###" |
721 | ⋮ | 747 | [35; 38) 'foo': Foo |
722 | ⋮[35; 38) 'foo': Foo | 748 | [45; 109) '{ ... } }': () |
723 | ⋮[45; 109) '{ ... } }': () | 749 | [51; 107) 'if tru... }': () |
724 | ⋮[51; 107) 'if tru... }': () | 750 | [54; 58) 'true': bool |
725 | ⋮[54; 58) 'true': bool | 751 | [59; 67) '{ }': () |
726 | ⋮[59; 67) '{ }': () | 752 | [73; 107) 'if fal... }': () |
727 | ⋮[73; 107) 'if fal... }': () | 753 | [76; 81) 'false': bool |
728 | ⋮[76; 81) 'false': bool | 754 | [82; 107) '{ ... }': i32 |
729 | ⋮[82; 107) '{ ... }': i32 | 755 | [92; 95) 'foo': Foo |
730 | ⋮[92; 95) 'foo': Foo | 756 | [92; 101) 'foo.field': i32 |
731 | ⋮[92; 101) 'foo.field': i32 | ||
732 | "### | 757 | "### |
733 | ) | 758 | ) |
734 | } | 759 | } |
735 | 760 | ||
736 | #[test] | 761 | #[test] |
737 | fn infer_inherent_method() { | 762 | fn infer_inherent_method() { |
738 | assert_snapshot_matches!( | 763 | assert_snapshot!( |
739 | infer(r#" | 764 | infer(r#" |
740 | struct A; | 765 | struct A; |
741 | 766 | ||
@@ -756,30 +781,32 @@ fn test(a: A) { | |||
756 | } | 781 | } |
757 | "#), | 782 | "#), |
758 | @r###" | 783 | @r###" |
759 | [32; 36) 'self': A | 784 | |
760 | [38; 39) 'x': u32 | 785 | [32; 36) 'self': A |
761 | [53; 55) '{}': () | 786 | [38; 39) 'x': u32 |
762 | [103; 107) 'self': &A | 787 | [53; 55) '{}': () |
763 | [109; 110) 'x': u64 | 788 | [103; 107) 'self': &A |
764 | [124; 126) '{}': () | 789 | [109; 110) 'x': u64 |
765 | [144; 145) 'a': A | 790 | [124; 126) '{}': () |
766 | [150; 198) '{ ...(1); }': () | 791 | [144; 145) 'a': A |
767 | [156; 157) 'a': A | 792 | [150; 198) '{ ...(1); }': () |
768 | [156; 164) 'a.foo(1)': i32 | 793 | [156; 157) 'a': A |
769 | [162; 163) '1': u32 | 794 | [156; 164) 'a.foo(1)': i32 |
770 | [170; 181) '(&a).bar(1)': i64 | 795 | [162; 163) '1': u32 |
771 | [171; 173) '&a': &A | 796 | [170; 181) '(&a).bar(1)': i64 |
772 | [172; 173) 'a': A | 797 | [171; 173) '&a': &A |
773 | [179; 180) '1': u64 | 798 | [172; 173) 'a': A |
774 | [187; 188) 'a': A | 799 | [179; 180) '1': u64 |
775 | [187; 195) 'a.bar(1)': i64 | 800 | [187; 188) 'a': A |
776 | [193; 194) '1': u64"### | 801 | [187; 195) 'a.bar(1)': i64 |
802 | [193; 194) '1': u64 | ||
803 | "### | ||
777 | ); | 804 | ); |
778 | } | 805 | } |
779 | 806 | ||
780 | #[test] | 807 | #[test] |
781 | fn infer_inherent_method_str() { | 808 | fn infer_inherent_method_str() { |
782 | assert_snapshot_matches!( | 809 | assert_snapshot!( |
783 | infer(r#" | 810 | infer(r#" |
784 | #[lang = "str"] | 811 | #[lang = "str"] |
785 | impl str { | 812 | impl str { |
@@ -791,17 +818,19 @@ fn test() { | |||
791 | } | 818 | } |
792 | "#), | 819 | "#), |
793 | @r###" | 820 | @r###" |
794 | [40; 44) 'self': &str | 821 | |
795 | [53; 55) '{}': () | 822 | [40; 44) 'self': &str |
796 | [69; 89) '{ ...o(); }': () | 823 | [53; 55) '{}': () |
797 | [75; 80) '"foo"': &str | 824 | [69; 89) '{ ...o(); }': () |
798 | [75; 86) '"foo".foo()': i32"### | 825 | [75; 80) '"foo"': &str |
826 | [75; 86) '"foo".foo()': i32 | ||
827 | "### | ||
799 | ); | 828 | ); |
800 | } | 829 | } |
801 | 830 | ||
802 | #[test] | 831 | #[test] |
803 | fn infer_tuple() { | 832 | fn infer_tuple() { |
804 | assert_snapshot_matches!( | 833 | assert_snapshot!( |
805 | infer(r#" | 834 | infer(r#" |
806 | fn test(x: &str, y: isize) { | 835 | fn test(x: &str, y: isize) { |
807 | let a: (u32, &str) = (1, "a"); | 836 | let a: (u32, &str) = (1, "a"); |
@@ -813,39 +842,41 @@ fn test(x: &str, y: isize) { | |||
813 | } | 842 | } |
814 | "#), | 843 | "#), |
815 | @r###" | 844 | @r###" |
816 | [9; 10) 'x': &str | 845 | |
817 | [18; 19) 'y': isize | 846 | [9; 10) 'x': &str |
818 | [28; 170) '{ ...d"); }': () | 847 | [18; 19) 'y': isize |
819 | [38; 39) 'a': (u32, &str) | 848 | [28; 170) '{ ...d"); }': () |
820 | [55; 63) '(1, "a")': (u32, &str) | 849 | [38; 39) 'a': (u32, &str) |
821 | [56; 57) '1': u32 | 850 | [55; 63) '(1, "a")': (u32, &str) |
822 | [59; 62) '"a"': &str | 851 | [56; 57) '1': u32 |
823 | [73; 74) 'b': ((u32, &str), &str) | 852 | [59; 62) '"a"': &str |
824 | [77; 83) '(a, x)': ((u32, &str), &str) | 853 | [73; 74) 'b': ((u32, &str), &str) |
825 | [78; 79) 'a': (u32, &str) | 854 | [77; 83) '(a, x)': ((u32, &str), &str) |
826 | [81; 82) 'x': &str | 855 | [78; 79) 'a': (u32, &str) |
827 | [93; 94) 'c': (isize, &str) | 856 | [81; 82) 'x': &str |
828 | [97; 103) '(y, x)': (isize, &str) | 857 | [93; 94) 'c': (isize, &str) |
829 | [98; 99) 'y': isize | 858 | [97; 103) '(y, x)': (isize, &str) |
830 | [101; 102) 'x': &str | 859 | [98; 99) 'y': isize |
831 | [113; 114) 'd': ((isize, &str), &str) | 860 | [101; 102) 'x': &str |
832 | [117; 123) '(c, x)': ((isize, &str), &str) | 861 | [113; 114) 'd': ((isize, &str), &str) |
833 | [118; 119) 'c': (isize, &str) | 862 | [117; 123) '(c, x)': ((isize, &str), &str) |
834 | [121; 122) 'x': &str | 863 | [118; 119) 'c': (isize, &str) |
835 | [133; 134) 'e': (i32, &str) | 864 | [121; 122) 'x': &str |
836 | [137; 145) '(1, "e")': (i32, &str) | 865 | [133; 134) 'e': (i32, &str) |
837 | [138; 139) '1': i32 | 866 | [137; 145) '(1, "e")': (i32, &str) |
838 | [141; 144) '"e"': &str | 867 | [138; 139) '1': i32 |
839 | [155; 156) 'f': ((i32, &str), &str) | 868 | [141; 144) '"e"': &str |
840 | [159; 167) '(e, "d")': ((i32, &str), &str) | 869 | [155; 156) 'f': ((i32, &str), &str) |
841 | [160; 161) 'e': (i32, &str) | 870 | [159; 167) '(e, "d")': ((i32, &str), &str) |
842 | [163; 166) '"d"': &str"### | 871 | [160; 161) 'e': (i32, &str) |
872 | [163; 166) '"d"': &str | ||
873 | "### | ||
843 | ); | 874 | ); |
844 | } | 875 | } |
845 | 876 | ||
846 | #[test] | 877 | #[test] |
847 | fn infer_array() { | 878 | fn infer_array() { |
848 | assert_snapshot_matches!( | 879 | assert_snapshot!( |
849 | infer(r#" | 880 | infer(r#" |
850 | fn test(x: &str, y: isize) { | 881 | fn test(x: &str, y: isize) { |
851 | let a = [x]; | 882 | let a = [x]; |
@@ -867,70 +898,72 @@ fn test(x: &str, y: isize) { | |||
867 | } | 898 | } |
868 | "#), | 899 | "#), |
869 | @r###" | 900 | @r###" |
870 | [9; 10) 'x': &str | 901 | |
871 | [18; 19) 'y': isize | 902 | [9; 10) 'x': &str |
872 | [28; 324) '{ ... 3]; }': () | 903 | [18; 19) 'y': isize |
873 | [38; 39) 'a': [&str;_] | 904 | [28; 324) '{ ... 3]; }': () |
874 | [42; 45) '[x]': [&str;_] | 905 | [38; 39) 'a': [&str;_] |
875 | [43; 44) 'x': &str | 906 | [42; 45) '[x]': [&str;_] |
876 | [55; 56) 'b': [[&str;_];_] | 907 | [43; 44) 'x': &str |
877 | [59; 65) '[a, a]': [[&str;_];_] | 908 | [55; 56) 'b': [[&str;_];_] |
878 | [60; 61) 'a': [&str;_] | 909 | [59; 65) '[a, a]': [[&str;_];_] |
879 | [63; 64) 'a': [&str;_] | 910 | [60; 61) 'a': [&str;_] |
880 | [75; 76) 'c': [[[&str;_];_];_] | 911 | [63; 64) 'a': [&str;_] |
881 | [79; 85) '[b, b]': [[[&str;_];_];_] | 912 | [75; 76) 'c': [[[&str;_];_];_] |
882 | [80; 81) 'b': [[&str;_];_] | 913 | [79; 85) '[b, b]': [[[&str;_];_];_] |
883 | [83; 84) 'b': [[&str;_];_] | 914 | [80; 81) 'b': [[&str;_];_] |
884 | [96; 97) 'd': [isize;_] | 915 | [83; 84) 'b': [[&str;_];_] |
885 | [100; 112) '[y, 1, 2, 3]': [isize;_] | 916 | [96; 97) 'd': [isize;_] |
886 | [101; 102) 'y': isize | 917 | [100; 112) '[y, 1, 2, 3]': [isize;_] |
887 | [104; 105) '1': isize | 918 | [101; 102) 'y': isize |
888 | [107; 108) '2': isize | 919 | [104; 105) '1': isize |
889 | [110; 111) '3': isize | 920 | [107; 108) '2': isize |
890 | [122; 123) 'd': [isize;_] | 921 | [110; 111) '3': isize |
891 | [126; 138) '[1, y, 2, 3]': [isize;_] | 922 | [122; 123) 'd': [isize;_] |
892 | [127; 128) '1': isize | 923 | [126; 138) '[1, y, 2, 3]': [isize;_] |
893 | [130; 131) 'y': isize | 924 | [127; 128) '1': isize |
894 | [133; 134) '2': isize | 925 | [130; 131) 'y': isize |
895 | [136; 137) '3': isize | 926 | [133; 134) '2': isize |
896 | [148; 149) 'e': [isize;_] | 927 | [136; 137) '3': isize |
897 | [152; 155) '[y]': [isize;_] | 928 | [148; 149) 'e': [isize;_] |
898 | [153; 154) 'y': isize | 929 | [152; 155) '[y]': [isize;_] |
899 | [165; 166) 'f': [[isize;_];_] | 930 | [153; 154) 'y': isize |
900 | [169; 175) '[d, d]': [[isize;_];_] | 931 | [165; 166) 'f': [[isize;_];_] |
901 | [170; 171) 'd': [isize;_] | 932 | [169; 175) '[d, d]': [[isize;_];_] |
902 | [173; 174) 'd': [isize;_] | 933 | [170; 171) 'd': [isize;_] |
903 | [185; 186) 'g': [[isize;_];_] | 934 | [173; 174) 'd': [isize;_] |
904 | [189; 195) '[e, e]': [[isize;_];_] | 935 | [185; 186) 'g': [[isize;_];_] |
905 | [190; 191) 'e': [isize;_] | 936 | [189; 195) '[e, e]': [[isize;_];_] |
906 | [193; 194) 'e': [isize;_] | 937 | [190; 191) 'e': [isize;_] |
907 | [206; 207) 'h': [i32;_] | 938 | [193; 194) 'e': [isize;_] |
908 | [210; 216) '[1, 2]': [i32;_] | 939 | [206; 207) 'h': [i32;_] |
909 | [211; 212) '1': i32 | 940 | [210; 216) '[1, 2]': [i32;_] |
910 | [214; 215) '2': i32 | 941 | [211; 212) '1': i32 |
911 | [226; 227) 'i': [&str;_] | 942 | [214; 215) '2': i32 |
912 | [230; 240) '["a", "b"]': [&str;_] | 943 | [226; 227) 'i': [&str;_] |
913 | [231; 234) '"a"': &str | 944 | [230; 240) '["a", "b"]': [&str;_] |
914 | [236; 239) '"b"': &str | 945 | [231; 234) '"a"': &str |
915 | [251; 252) 'b': [[&str;_];_] | 946 | [236; 239) '"b"': &str |
916 | [255; 265) '[a, ["b"]]': [[&str;_];_] | 947 | [251; 252) 'b': [[&str;_];_] |
917 | [256; 257) 'a': [&str;_] | 948 | [255; 265) '[a, ["b"]]': [[&str;_];_] |
918 | [259; 264) '["b"]': [&str;_] | 949 | [256; 257) 'a': [&str;_] |
919 | [260; 263) '"b"': &str | 950 | [259; 264) '["b"]': [&str;_] |
920 | [275; 276) 'x': [u8;_] | 951 | [260; 263) '"b"': &str |
921 | [288; 290) '[]': [u8;_] | 952 | [275; 276) 'x': [u8;_] |
922 | [300; 301) 'z': &[u8;_] | 953 | [288; 290) '[]': [u8;_] |
923 | [311; 321) '&[1, 2, 3]': &[u8;_] | 954 | [300; 301) 'z': &[u8;_] |
924 | [312; 321) '[1, 2, 3]': [u8;_] | 955 | [311; 321) '&[1, 2, 3]': &[u8;_] |
925 | [313; 314) '1': u8 | 956 | [312; 321) '[1, 2, 3]': [u8;_] |
926 | [316; 317) '2': u8 | 957 | [313; 314) '1': u8 |
927 | [319; 320) '3': u8"### | 958 | [316; 317) '2': u8 |
959 | [319; 320) '3': u8 | ||
960 | "### | ||
928 | ); | 961 | ); |
929 | } | 962 | } |
930 | 963 | ||
931 | #[test] | 964 | #[test] |
932 | fn infer_pattern() { | 965 | fn infer_pattern() { |
933 | assert_snapshot_matches!( | 966 | assert_snapshot!( |
934 | infer(r#" | 967 | infer(r#" |
935 | fn test(x: &i32) { | 968 | fn test(x: &i32) { |
936 | let y = x; | 969 | let y = x; |
@@ -955,59 +988,61 @@ fn test(x: &i32) { | |||
955 | } | 988 | } |
956 | "#), | 989 | "#), |
957 | @r###" | 990 | @r###" |
958 | [9; 10) 'x': &i32 | 991 | |
959 | [18; 369) '{ ...o_x; }': () | 992 | [9; 10) 'x': &i32 |
960 | [28; 29) 'y': &i32 | 993 | [18; 369) '{ ...o_x; }': () |
961 | [32; 33) 'x': &i32 | 994 | [28; 29) 'y': &i32 |
962 | [43; 45) '&z': &i32 | 995 | [32; 33) 'x': &i32 |
963 | [44; 45) 'z': i32 | 996 | [43; 45) '&z': &i32 |
964 | [48; 49) 'x': &i32 | 997 | [44; 45) 'z': i32 |
965 | [59; 60) 'a': i32 | 998 | [48; 49) 'x': &i32 |
966 | [63; 64) 'z': i32 | 999 | [59; 60) 'a': i32 |
967 | [74; 80) '(c, d)': (i32, &str) | 1000 | [63; 64) 'z': i32 |
968 | [75; 76) 'c': i32 | 1001 | [74; 80) '(c, d)': (i32, &str) |
969 | [78; 79) 'd': &str | 1002 | [75; 76) 'c': i32 |
970 | [83; 95) '(1, "hello")': (i32, &str) | 1003 | [78; 79) 'd': &str |
971 | [84; 85) '1': i32 | 1004 | [83; 95) '(1, "hello")': (i32, &str) |
972 | [87; 94) '"hello"': &str | 1005 | [84; 85) '1': i32 |
973 | [102; 152) 'for (e... }': () | 1006 | [87; 94) '"hello"': &str |
974 | [106; 112) '(e, f)': ({unknown}, {unknown}) | 1007 | [102; 152) 'for (e... }': () |
975 | [107; 108) 'e': {unknown} | 1008 | [106; 112) '(e, f)': ({unknown}, {unknown}) |
976 | [110; 111) 'f': {unknown} | 1009 | [107; 108) 'e': {unknown} |
977 | [116; 125) 'some_iter': {unknown} | 1010 | [110; 111) 'f': {unknown} |
978 | [126; 152) '{ ... }': () | 1011 | [116; 125) 'some_iter': {unknown} |
979 | [140; 141) 'g': {unknown} | 1012 | [126; 152) '{ ... }': () |
980 | [144; 145) 'e': {unknown} | 1013 | [140; 141) 'g': {unknown} |
981 | [158; 205) 'if let... }': () | 1014 | [144; 145) 'e': {unknown} |
982 | [165; 170) '[val]': {unknown} | 1015 | [158; 205) 'if let... }': () |
983 | [173; 176) 'opt': {unknown} | 1016 | [165; 170) '[val]': {unknown} |
984 | [177; 205) '{ ... }': () | 1017 | [173; 176) 'opt': {unknown} |
985 | [191; 192) 'h': {unknown} | 1018 | [177; 205) '{ ... }': () |
986 | [195; 198) 'val': {unknown} | 1019 | [191; 192) 'h': {unknown} |
987 | [215; 221) 'lambda': {unknown} | 1020 | [195; 198) 'val': {unknown} |
988 | [224; 256) '|a: u6...b; c }': {unknown} | 1021 | [215; 221) 'lambda': {unknown} |
989 | [225; 226) 'a': u64 | 1022 | [224; 256) '|a: u6...b; c }': {unknown} |
990 | [233; 234) 'b': u64 | 1023 | [225; 226) 'a': u64 |
991 | [236; 237) 'c': i32 | 1024 | [233; 234) 'b': u64 |
992 | [244; 256) '{ a + b; c }': i32 | 1025 | [236; 237) 'c': i32 |
993 | [246; 247) 'a': u64 | 1026 | [244; 256) '{ a + b; c }': i32 |
994 | [246; 251) 'a + b': u64 | 1027 | [246; 247) 'a': u64 |
995 | [250; 251) 'b': u64 | 1028 | [246; 251) 'a + b': u64 |
996 | [253; 254) 'c': i32 | 1029 | [250; 251) 'b': u64 |
997 | [267; 279) 'ref ref_to_x': &&i32 | 1030 | [253; 254) 'c': i32 |
998 | [282; 283) 'x': &i32 | 1031 | [267; 279) 'ref ref_to_x': &&i32 |
999 | [293; 302) 'mut mut_x': &i32 | 1032 | [282; 283) 'x': &i32 |
1000 | [305; 306) 'x': &i32 | 1033 | [293; 302) 'mut mut_x': &i32 |
1001 | [316; 336) 'ref mu...f_to_x': &mut &i32 | 1034 | [305; 306) 'x': &i32 |
1002 | [339; 340) 'x': &i32 | 1035 | [316; 336) 'ref mu...f_to_x': &mut &i32 |
1003 | [350; 351) 'k': &mut &i32 | 1036 | [339; 340) 'x': &i32 |
1004 | [354; 366) 'mut_ref_to_x': &mut &i32"### | 1037 | [350; 351) 'k': &mut &i32 |
1038 | [354; 366) 'mut_ref_to_x': &mut &i32 | ||
1039 | "### | ||
1005 | ); | 1040 | ); |
1006 | } | 1041 | } |
1007 | 1042 | ||
1008 | #[test] | 1043 | #[test] |
1009 | fn infer_pattern_match_ergonomics() { | 1044 | fn infer_pattern_match_ergonomics() { |
1010 | assert_snapshot_matches!( | 1045 | assert_snapshot!( |
1011 | infer(r#" | 1046 | infer(r#" |
1012 | struct A<T>(T); | 1047 | struct A<T>(T); |
1013 | 1048 | ||
@@ -1017,26 +1052,28 @@ fn test() { | |||
1017 | } | 1052 | } |
1018 | "#), | 1053 | "#), |
1019 | @r###" | 1054 | @r###" |
1020 | [28; 79) '{ ...(1); }': () | 1055 | |
1021 | [38; 42) 'A(n)': A<i32> | 1056 | [28; 79) '{ ...(1); }': () |
1022 | [40; 41) 'n': &i32 | 1057 | [38; 42) 'A(n)': A<i32> |
1023 | [45; 50) '&A(1)': &A<i32> | 1058 | [40; 41) 'n': &i32 |
1024 | [46; 47) 'A': A<i32>(T) -> A<T> | 1059 | [45; 50) '&A(1)': &A<i32> |
1025 | [46; 50) 'A(1)': A<i32> | 1060 | [46; 47) 'A': A<i32>(T) -> A<T> |
1026 | [48; 49) '1': i32 | 1061 | [46; 50) 'A(1)': A<i32> |
1027 | [60; 64) 'A(n)': A<i32> | 1062 | [48; 49) '1': i32 |
1028 | [62; 63) 'n': &mut i32 | 1063 | [60; 64) 'A(n)': A<i32> |
1029 | [67; 76) '&mut A(1)': &mut A<i32> | 1064 | [62; 63) 'n': &mut i32 |
1030 | [72; 73) 'A': A<i32>(T) -> A<T> | 1065 | [67; 76) '&mut A(1)': &mut A<i32> |
1031 | [72; 76) 'A(1)': A<i32> | 1066 | [72; 73) 'A': A<i32>(T) -> A<T> |
1032 | [74; 75) '1': i32"### | 1067 | [72; 76) 'A(1)': A<i32> |
1068 | [74; 75) '1': i32 | ||
1069 | "### | ||
1033 | ); | 1070 | ); |
1034 | } | 1071 | } |
1035 | 1072 | ||
1036 | #[test] | 1073 | #[test] |
1037 | fn infer_pattern_match_ergonomics_ref() { | 1074 | fn infer_pattern_match_ergonomics_ref() { |
1038 | covers!(match_ergonomics_ref); | 1075 | covers!(match_ergonomics_ref); |
1039 | assert_snapshot_matches!( | 1076 | assert_snapshot!( |
1040 | infer(r#" | 1077 | infer(r#" |
1041 | fn test() { | 1078 | fn test() { |
1042 | let v = &(1, &2); | 1079 | let v = &(1, &2); |
@@ -1044,24 +1081,26 @@ fn test() { | |||
1044 | } | 1081 | } |
1045 | "#), | 1082 | "#), |
1046 | @r###" | 1083 | @r###" |
1047 | [11; 57) '{ ...= v; }': () | 1084 | |
1048 | [21; 22) 'v': &(i32, &i32) | 1085 | [11; 57) '{ ...= v; }': () |
1049 | [25; 33) '&(1, &2)': &(i32, &i32) | 1086 | [21; 22) 'v': &(i32, &i32) |
1050 | [26; 33) '(1, &2)': (i32, &i32) | 1087 | [25; 33) '&(1, &2)': &(i32, &i32) |
1051 | [27; 28) '1': i32 | 1088 | [26; 33) '(1, &2)': (i32, &i32) |
1052 | [30; 32) '&2': &i32 | 1089 | [27; 28) '1': i32 |
1053 | [31; 32) '2': i32 | 1090 | [30; 32) '&2': &i32 |
1054 | [43; 50) '(_, &w)': (i32, &i32) | 1091 | [31; 32) '2': i32 |
1055 | [44; 45) '_': i32 | 1092 | [43; 50) '(_, &w)': (i32, &i32) |
1056 | [47; 49) '&w': &i32 | 1093 | [44; 45) '_': i32 |
1057 | [48; 49) 'w': i32 | 1094 | [47; 49) '&w': &i32 |
1058 | [53; 54) 'v': &(i32, &i32)"### | 1095 | [48; 49) 'w': i32 |
1096 | [53; 54) 'v': &(i32, &i32) | ||
1097 | "### | ||
1059 | ); | 1098 | ); |
1060 | } | 1099 | } |
1061 | 1100 | ||
1062 | #[test] | 1101 | #[test] |
1063 | fn infer_adt_pattern() { | 1102 | fn infer_adt_pattern() { |
1064 | assert_snapshot_matches!( | 1103 | assert_snapshot!( |
1065 | infer(r#" | 1104 | infer(r#" |
1066 | enum E { | 1105 | enum E { |
1067 | A { x: usize }, | 1106 | A { x: usize }, |
@@ -1087,37 +1126,39 @@ fn test() { | |||
1087 | } | 1126 | } |
1088 | "#), | 1127 | "#), |
1089 | @r###" | 1128 | @r###" |
1090 | [68; 289) '{ ... d; }': () | 1129 | |
1091 | [78; 79) 'e': E | 1130 | [68; 289) '{ ... d; }': () |
1092 | [82; 95) 'E::A { x: 3 }': E | 1131 | [78; 79) 'e': E |
1093 | [92; 93) '3': usize | 1132 | [82; 95) 'E::A { x: 3 }': E |
1094 | [106; 113) 'S(y, z)': S | 1133 | [92; 93) '3': usize |
1095 | [108; 109) 'y': u32 | 1134 | [106; 113) 'S(y, z)': S |
1096 | [111; 112) 'z': E | 1135 | [108; 109) 'y': u32 |
1097 | [116; 119) 'foo': S | 1136 | [111; 112) 'z': E |
1098 | [129; 148) 'E::A {..._var }': E | 1137 | [116; 119) 'foo': S |
1099 | [139; 146) 'new_var': usize | 1138 | [129; 148) 'E::A {..._var }': E |
1100 | [151; 152) 'e': E | 1139 | [139; 146) 'new_var': usize |
1101 | [159; 245) 'match ... }': usize | 1140 | [151; 152) 'e': E |
1102 | [165; 166) 'e': E | 1141 | [159; 245) 'match ... }': usize |
1103 | [177; 187) 'E::A { x }': E | 1142 | [165; 166) 'e': E |
1104 | [184; 185) 'x': usize | 1143 | [177; 187) 'E::A { x }': E |
1105 | [191; 192) 'x': usize | 1144 | [184; 185) 'x': usize |
1106 | [202; 206) 'E::B': E | 1145 | [191; 192) 'x': usize |
1107 | [210; 213) 'foo': bool | 1146 | [202; 206) 'E::B': E |
1108 | [217; 218) '1': usize | 1147 | [210; 213) 'foo': bool |
1109 | [228; 232) 'E::B': E | 1148 | [217; 218) '1': usize |
1110 | [236; 238) '10': usize | 1149 | [228; 232) 'E::B': E |
1111 | [256; 275) 'ref d ...{ .. }': &E | 1150 | [236; 238) '10': usize |
1112 | [264; 275) 'E::A { .. }': E | 1151 | [256; 275) 'ref d ...{ .. }': &E |
1113 | [278; 279) 'e': E | 1152 | [264; 275) 'E::A { .. }': E |
1114 | [285; 286) 'd': &E"### | 1153 | [278; 279) 'e': E |
1154 | [285; 286) 'd': &E | ||
1155 | "### | ||
1115 | ); | 1156 | ); |
1116 | } | 1157 | } |
1117 | 1158 | ||
1118 | #[test] | 1159 | #[test] |
1119 | fn infer_struct_generics() { | 1160 | fn infer_struct_generics() { |
1120 | assert_snapshot_matches!( | 1161 | assert_snapshot!( |
1121 | infer(r#" | 1162 | infer(r#" |
1122 | struct A<T> { | 1163 | struct A<T> { |
1123 | x: T, | 1164 | x: T, |
@@ -1132,27 +1173,29 @@ fn test(a1: A<u32>, i: i32) { | |||
1132 | } | 1173 | } |
1133 | "#), | 1174 | "#), |
1134 | @r###" | 1175 | @r###" |
1135 | [36; 38) 'a1': A<u32> | 1176 | |
1136 | [48; 49) 'i': i32 | 1177 | [36; 38) 'a1': A<u32> |
1137 | [56; 147) '{ ...3.x; }': () | 1178 | [48; 49) 'i': i32 |
1138 | [62; 64) 'a1': A<u32> | 1179 | [56; 147) '{ ...3.x; }': () |
1139 | [62; 66) 'a1.x': u32 | 1180 | [62; 64) 'a1': A<u32> |
1140 | [76; 78) 'a2': A<i32> | 1181 | [62; 66) 'a1.x': u32 |
1141 | [81; 91) 'A { x: i }': A<i32> | 1182 | [76; 78) 'a2': A<i32> |
1142 | [88; 89) 'i': i32 | 1183 | [81; 91) 'A { x: i }': A<i32> |
1143 | [97; 99) 'a2': A<i32> | 1184 | [88; 89) 'i': i32 |
1144 | [97; 101) 'a2.x': i32 | 1185 | [97; 99) 'a2': A<i32> |
1145 | [111; 113) 'a3': A<i128> | 1186 | [97; 101) 'a2.x': i32 |
1146 | [116; 134) 'A::<i1...x: 1 }': A<i128> | 1187 | [111; 113) 'a3': A<i128> |
1147 | [131; 132) '1': i128 | 1188 | [116; 134) 'A::<i1...x: 1 }': A<i128> |
1148 | [140; 142) 'a3': A<i128> | 1189 | [131; 132) '1': i128 |
1149 | [140; 144) 'a3.x': i128"### | 1190 | [140; 142) 'a3': A<i128> |
1191 | [140; 144) 'a3.x': i128 | ||
1192 | "### | ||
1150 | ); | 1193 | ); |
1151 | } | 1194 | } |
1152 | 1195 | ||
1153 | #[test] | 1196 | #[test] |
1154 | fn infer_tuple_struct_generics() { | 1197 | fn infer_tuple_struct_generics() { |
1155 | assert_snapshot_matches!( | 1198 | assert_snapshot!( |
1156 | infer(r#" | 1199 | infer(r#" |
1157 | struct A<T>(T); | 1200 | struct A<T>(T); |
1158 | enum Option<T> { Some(T), None } | 1201 | enum Option<T> { Some(T), None } |
@@ -1168,30 +1211,29 @@ fn test() { | |||
1168 | } | 1211 | } |
1169 | "#), | 1212 | "#), |
1170 | @r###" | 1213 | @r###" |
1171 | ⋮ | 1214 | [76; 184) '{ ...one; }': () |
1172 | ⋮[76; 184) '{ ...one; }': () | 1215 | [82; 83) 'A': A<i32>(T) -> A<T> |
1173 | ⋮[82; 83) 'A': A<i32>(T) -> A<T> | 1216 | [82; 87) 'A(42)': A<i32> |
1174 | ⋮[82; 87) 'A(42)': A<i32> | 1217 | [84; 86) '42': i32 |
1175 | ⋮[84; 86) '42': i32 | 1218 | [93; 94) 'A': A<u128>(T) -> A<T> |
1176 | ⋮[93; 94) 'A': A<u128>(T) -> A<T> | 1219 | [93; 102) 'A(42u128)': A<u128> |
1177 | ⋮[93; 102) 'A(42u128)': A<u128> | 1220 | [95; 101) '42u128': u128 |
1178 | ⋮[95; 101) '42u128': u128 | 1221 | [108; 112) 'Some': Some<&str>(T) -> Option<T> |
1179 | ⋮[108; 112) 'Some': Some<&str>(T) -> Option<T> | 1222 | [108; 117) 'Some("x")': Option<&str> |
1180 | ⋮[108; 117) 'Some("x")': Option<&str> | 1223 | [113; 116) '"x"': &str |
1181 | ⋮[113; 116) '"x"': &str | 1224 | [123; 135) 'Option::Some': Some<&str>(T) -> Option<T> |
1182 | ⋮[123; 135) 'Option::Some': Some<&str>(T) -> Option<T> | 1225 | [123; 140) 'Option...e("x")': Option<&str> |
1183 | ⋮[123; 140) 'Option...e("x")': Option<&str> | 1226 | [136; 139) '"x"': &str |
1184 | ⋮[136; 139) '"x"': &str | 1227 | [146; 150) 'None': Option<{unknown}> |
1185 | ⋮[146; 150) 'None': Option<{unknown}> | 1228 | [160; 161) 'x': Option<i64> |
1186 | ⋮[160; 161) 'x': Option<i64> | 1229 | [177; 181) 'None': Option<i64> |
1187 | ⋮[177; 181) 'None': Option<i64> | ||
1188 | "### | 1230 | "### |
1189 | ); | 1231 | ); |
1190 | } | 1232 | } |
1191 | 1233 | ||
1192 | #[test] | 1234 | #[test] |
1193 | fn infer_generics_in_patterns() { | 1235 | fn infer_generics_in_patterns() { |
1194 | assert_snapshot_matches!( | 1236 | assert_snapshot!( |
1195 | infer(r#" | 1237 | infer(r#" |
1196 | struct A<T> { | 1238 | struct A<T> { |
1197 | x: T, | 1239 | x: T, |
@@ -1212,29 +1254,31 @@ fn test(a1: A<u32>, o: Option<u64>) { | |||
1212 | } | 1254 | } |
1213 | "#), | 1255 | "#), |
1214 | @r###" | 1256 | @r###" |
1215 | [79; 81) 'a1': A<u32> | 1257 | |
1216 | [91; 92) 'o': Option<u64> | 1258 | [79; 81) 'a1': A<u32> |
1217 | [107; 244) '{ ... }; }': () | 1259 | [91; 92) 'o': Option<u64> |
1218 | [117; 128) 'A { x: x2 }': A<u32> | 1260 | [107; 244) '{ ... }; }': () |
1219 | [124; 126) 'x2': u32 | 1261 | [117; 128) 'A { x: x2 }': A<u32> |
1220 | [131; 133) 'a1': A<u32> | 1262 | [124; 126) 'x2': u32 |
1221 | [143; 161) 'A::<i6...: x3 }': A<i64> | 1263 | [131; 133) 'a1': A<u32> |
1222 | [157; 159) 'x3': i64 | 1264 | [143; 161) 'A::<i6...: x3 }': A<i64> |
1223 | [164; 174) 'A { x: 1 }': A<i64> | 1265 | [157; 159) 'x3': i64 |
1224 | [171; 172) '1': i64 | 1266 | [164; 174) 'A { x: 1 }': A<i64> |
1225 | [180; 241) 'match ... }': u64 | 1267 | [171; 172) '1': i64 |
1226 | [186; 187) 'o': Option<u64> | 1268 | [180; 241) 'match ... }': u64 |
1227 | [198; 213) 'Option::Some(t)': Option<u64> | 1269 | [186; 187) 'o': Option<u64> |
1228 | [211; 212) 't': u64 | 1270 | [198; 213) 'Option::Some(t)': Option<u64> |
1229 | [217; 218) 't': u64 | 1271 | [211; 212) 't': u64 |
1230 | [228; 229) '_': Option<u64> | 1272 | [217; 218) 't': u64 |
1231 | [233; 234) '1': u64"### | 1273 | [228; 229) '_': Option<u64> |
1274 | [233; 234) '1': u64 | ||
1275 | "### | ||
1232 | ); | 1276 | ); |
1233 | } | 1277 | } |
1234 | 1278 | ||
1235 | #[test] | 1279 | #[test] |
1236 | fn infer_function_generics() { | 1280 | fn infer_function_generics() { |
1237 | assert_snapshot_matches!( | 1281 | assert_snapshot!( |
1238 | infer(r#" | 1282 | infer(r#" |
1239 | fn id<T>(t: T) -> T { t } | 1283 | fn id<T>(t: T) -> T { t } |
1240 | 1284 | ||
@@ -1245,26 +1289,28 @@ fn test() { | |||
1245 | } | 1289 | } |
1246 | "#), | 1290 | "#), |
1247 | @r###" | 1291 | @r###" |
1248 | [10; 11) 't': T | 1292 | |
1249 | [21; 26) '{ t }': T | 1293 | [10; 11) 't': T |
1250 | [23; 24) 't': T | 1294 | [21; 26) '{ t }': T |
1251 | [38; 98) '{ ...(1); }': () | 1295 | [23; 24) 't': T |
1252 | [44; 46) 'id': fn id<u32>(T) -> T | 1296 | [38; 98) '{ ...(1); }': () |
1253 | [44; 52) 'id(1u32)': u32 | 1297 | [44; 46) 'id': fn id<u32>(T) -> T |
1254 | [47; 51) '1u32': u32 | 1298 | [44; 52) 'id(1u32)': u32 |
1255 | [58; 68) 'id::<i128>': fn id<i128>(T) -> T | 1299 | [47; 51) '1u32': u32 |
1256 | [58; 71) 'id::<i128>(1)': i128 | 1300 | [58; 68) 'id::<i128>': fn id<i128>(T) -> T |
1257 | [69; 70) '1': i128 | 1301 | [58; 71) 'id::<i128>(1)': i128 |
1258 | [81; 82) 'x': u64 | 1302 | [69; 70) '1': i128 |
1259 | [90; 92) 'id': fn id<u64>(T) -> T | 1303 | [81; 82) 'x': u64 |
1260 | [90; 95) 'id(1)': u64 | 1304 | [90; 92) 'id': fn id<u64>(T) -> T |
1261 | [93; 94) '1': u64"### | 1305 | [90; 95) 'id(1)': u64 |
1306 | [93; 94) '1': u64 | ||
1307 | "### | ||
1262 | ); | 1308 | ); |
1263 | } | 1309 | } |
1264 | 1310 | ||
1265 | #[test] | 1311 | #[test] |
1266 | fn infer_impl_generics() { | 1312 | fn infer_impl_generics() { |
1267 | assert_snapshot_matches!( | 1313 | assert_snapshot!( |
1268 | infer(r#" | 1314 | infer(r#" |
1269 | struct A<T1, T2> { | 1315 | struct A<T1, T2> { |
1270 | x: T1, | 1316 | x: T1, |
@@ -1291,44 +1337,46 @@ fn test() -> i128 { | |||
1291 | } | 1337 | } |
1292 | "#), | 1338 | "#), |
1293 | @r###" | 1339 | @r###" |
1294 | [74; 78) 'self': A<X, Y> | 1340 | |
1295 | [85; 107) '{ ... }': X | 1341 | [74; 78) 'self': A<X, Y> |
1296 | [95; 99) 'self': A<X, Y> | 1342 | [85; 107) '{ ... }': X |
1297 | [95; 101) 'self.x': X | 1343 | [95; 99) 'self': A<X, Y> |
1298 | [117; 121) 'self': A<X, Y> | 1344 | [95; 101) 'self.x': X |
1299 | [128; 150) '{ ... }': Y | 1345 | [117; 121) 'self': A<X, Y> |
1300 | [138; 142) 'self': A<X, Y> | 1346 | [128; 150) '{ ... }': Y |
1301 | [138; 144) 'self.y': Y | 1347 | [138; 142) 'self': A<X, Y> |
1302 | [163; 167) 'self': A<X, Y> | 1348 | [138; 144) 'self.y': Y |
1303 | [169; 170) 't': T | 1349 | [163; 167) 'self': A<X, Y> |
1304 | [188; 223) '{ ... }': (X, Y, T) | 1350 | [169; 170) 't': T |
1305 | [198; 217) '(self.....y, t)': (X, Y, T) | 1351 | [188; 223) '{ ... }': (X, Y, T) |
1306 | [199; 203) 'self': A<X, Y> | 1352 | [198; 217) '(self.....y, t)': (X, Y, T) |
1307 | [199; 205) 'self.x': X | 1353 | [199; 203) 'self': A<X, Y> |
1308 | [207; 211) 'self': A<X, Y> | 1354 | [199; 205) 'self.x': X |
1309 | [207; 213) 'self.y': Y | 1355 | [207; 211) 'self': A<X, Y> |
1310 | [215; 216) 't': T | 1356 | [207; 213) 'self.y': Y |
1311 | [245; 342) '{ ...(1); }': () | 1357 | [215; 216) 't': T |
1312 | [255; 256) 'a': A<u64, i64> | 1358 | [245; 342) '{ ...(1); }': () |
1313 | [259; 281) 'A { x:...1i64 }': A<u64, i64> | 1359 | [255; 256) 'a': A<u64, i64> |
1314 | [266; 270) '1u64': u64 | 1360 | [259; 281) 'A { x:...1i64 }': A<u64, i64> |
1315 | [275; 279) '1i64': i64 | 1361 | [266; 270) '1u64': u64 |
1316 | [287; 288) 'a': A<u64, i64> | 1362 | [275; 279) '1i64': i64 |
1317 | [287; 292) 'a.x()': u64 | 1363 | [287; 288) 'a': A<u64, i64> |
1318 | [298; 299) 'a': A<u64, i64> | 1364 | [287; 292) 'a.x()': u64 |
1319 | [298; 303) 'a.y()': i64 | 1365 | [298; 299) 'a': A<u64, i64> |
1320 | [309; 310) 'a': A<u64, i64> | 1366 | [298; 303) 'a.y()': i64 |
1321 | [309; 319) 'a.z(1i128)': (u64, i64, i128) | 1367 | [309; 310) 'a': A<u64, i64> |
1322 | [313; 318) '1i128': i128 | 1368 | [309; 319) 'a.z(1i128)': (u64, i64, i128) |
1323 | [325; 326) 'a': A<u64, i64> | 1369 | [313; 318) '1i128': i128 |
1324 | [325; 339) 'a.z::<u128>(1)': (u64, i64, u128) | 1370 | [325; 326) 'a': A<u64, i64> |
1325 | [337; 338) '1': u128"### | 1371 | [325; 339) 'a.z::<u128>(1)': (u64, i64, u128) |
1372 | [337; 338) '1': u128 | ||
1373 | "### | ||
1326 | ); | 1374 | ); |
1327 | } | 1375 | } |
1328 | 1376 | ||
1329 | #[test] | 1377 | #[test] |
1330 | fn infer_impl_generics_with_autoderef() { | 1378 | fn infer_impl_generics_with_autoderef() { |
1331 | assert_snapshot_matches!( | 1379 | assert_snapshot!( |
1332 | infer(r#" | 1380 | infer(r#" |
1333 | enum Option<T> { | 1381 | enum Option<T> { |
1334 | Some(T), | 1382 | Some(T), |
@@ -1343,21 +1391,23 @@ fn test(o: Option<u32>) { | |||
1343 | } | 1391 | } |
1344 | "#), | 1392 | "#), |
1345 | @r###" | 1393 | @r###" |
1346 | [78; 82) 'self': &Option<T> | 1394 | |
1347 | [98; 100) '{}': () | 1395 | [78; 82) 'self': &Option<T> |
1348 | [111; 112) 'o': Option<u32> | 1396 | [98; 100) '{}': () |
1349 | [127; 165) '{ ...f(); }': () | 1397 | [111; 112) 'o': Option<u32> |
1350 | [133; 146) '(&o).as_ref()': Option<&u32> | 1398 | [127; 165) '{ ...f(); }': () |
1351 | [134; 136) '&o': &Option<u32> | 1399 | [133; 146) '(&o).as_ref()': Option<&u32> |
1352 | [135; 136) 'o': Option<u32> | 1400 | [134; 136) '&o': &Option<u32> |
1353 | [152; 153) 'o': Option<u32> | 1401 | [135; 136) 'o': Option<u32> |
1354 | [152; 162) 'o.as_ref()': Option<&u32>"### | 1402 | [152; 153) 'o': Option<u32> |
1403 | [152; 162) 'o.as_ref()': Option<&u32> | ||
1404 | "### | ||
1355 | ); | 1405 | ); |
1356 | } | 1406 | } |
1357 | 1407 | ||
1358 | #[test] | 1408 | #[test] |
1359 | fn infer_generic_chain() { | 1409 | fn infer_generic_chain() { |
1360 | assert_snapshot_matches!( | 1410 | assert_snapshot!( |
1361 | infer(r#" | 1411 | infer(r#" |
1362 | struct A<T> { | 1412 | struct A<T> { |
1363 | x: T, | 1413 | x: T, |
@@ -1379,41 +1429,43 @@ fn test() -> i128 { | |||
1379 | } | 1429 | } |
1380 | "#), | 1430 | "#), |
1381 | @r###" | 1431 | @r###" |
1382 | [53; 57) 'self': A<T2> | 1432 | |
1383 | [65; 87) '{ ... }': T2 | 1433 | [53; 57) 'self': A<T2> |
1384 | [75; 79) 'self': A<T2> | 1434 | [65; 87) '{ ... }': T2 |
1385 | [75; 81) 'self.x': T2 | 1435 | [75; 79) 'self': A<T2> |
1386 | [99; 100) 't': T | 1436 | [75; 81) 'self.x': T2 |
1387 | [110; 115) '{ t }': T | 1437 | [99; 100) 't': T |
1388 | [112; 113) 't': T | 1438 | [110; 115) '{ t }': T |
1389 | [135; 261) '{ ....x() }': i128 | 1439 | [112; 113) 't': T |
1390 | [146; 147) 'x': i128 | 1440 | [135; 261) '{ ....x() }': i128 |
1391 | [150; 151) '1': i128 | 1441 | [146; 147) 'x': i128 |
1392 | [162; 163) 'y': i128 | 1442 | [150; 151) '1': i128 |
1393 | [166; 168) 'id': fn id<i128>(T) -> T | 1443 | [162; 163) 'y': i128 |
1394 | [166; 171) 'id(x)': i128 | 1444 | [166; 168) 'id': fn id<i128>(T) -> T |
1395 | [169; 170) 'x': i128 | 1445 | [166; 171) 'id(x)': i128 |
1396 | [182; 183) 'a': A<i128> | 1446 | [169; 170) 'x': i128 |
1397 | [186; 200) 'A { x: id(y) }': A<i128> | 1447 | [182; 183) 'a': A<i128> |
1398 | [193; 195) 'id': fn id<i128>(T) -> T | 1448 | [186; 200) 'A { x: id(y) }': A<i128> |
1399 | [193; 198) 'id(y)': i128 | 1449 | [193; 195) 'id': fn id<i128>(T) -> T |
1400 | [196; 197) 'y': i128 | 1450 | [193; 198) 'id(y)': i128 |
1401 | [211; 212) 'z': i128 | 1451 | [196; 197) 'y': i128 |
1402 | [215; 217) 'id': fn id<i128>(T) -> T | 1452 | [211; 212) 'z': i128 |
1403 | [215; 222) 'id(a.x)': i128 | 1453 | [215; 217) 'id': fn id<i128>(T) -> T |
1404 | [218; 219) 'a': A<i128> | 1454 | [215; 222) 'id(a.x)': i128 |
1405 | [218; 221) 'a.x': i128 | 1455 | [218; 219) 'a': A<i128> |
1406 | [233; 234) 'b': A<i128> | 1456 | [218; 221) 'a.x': i128 |
1407 | [237; 247) 'A { x: z }': A<i128> | 1457 | [233; 234) 'b': A<i128> |
1408 | [244; 245) 'z': i128 | 1458 | [237; 247) 'A { x: z }': A<i128> |
1409 | [254; 255) 'b': A<i128> | 1459 | [244; 245) 'z': i128 |
1410 | [254; 259) 'b.x()': i128"### | 1460 | [254; 255) 'b': A<i128> |
1461 | [254; 259) 'b.x()': i128 | ||
1462 | "### | ||
1411 | ); | 1463 | ); |
1412 | } | 1464 | } |
1413 | 1465 | ||
1414 | #[test] | 1466 | #[test] |
1415 | fn infer_associated_const() { | 1467 | fn infer_associated_const() { |
1416 | assert_snapshot_matches!( | 1468 | assert_snapshot!( |
1417 | infer(r#" | 1469 | infer(r#" |
1418 | struct Struct; | 1470 | struct Struct; |
1419 | 1471 | ||
@@ -1444,24 +1496,23 @@ fn test() { | |||
1444 | } | 1496 | } |
1445 | "#), | 1497 | "#), |
1446 | @r###" | 1498 | @r###" |
1447 | ⋮ | 1499 | [52; 53) '1': u32 |
1448 | ⋮[52; 53) '1': u32 | 1500 | [105; 106) '2': u32 |
1449 | ⋮[105; 106) '2': u32 | 1501 | [213; 214) '5': u32 |
1450 | ⋮[213; 214) '5': u32 | 1502 | [229; 307) '{ ...:ID; }': () |
1451 | ⋮[229; 307) '{ ...:ID; }': () | 1503 | [239; 240) 'x': u32 |
1452 | ⋮[239; 240) 'x': u32 | 1504 | [243; 254) 'Struct::FOO': u32 |
1453 | ⋮[243; 254) 'Struct::FOO': u32 | 1505 | [264; 265) 'y': u32 |
1454 | ⋮[264; 265) 'y': u32 | 1506 | [268; 277) 'Enum::BAR': u32 |
1455 | ⋮[268; 277) 'Enum::BAR': u32 | 1507 | [287; 288) 'z': {unknown} |
1456 | ⋮[287; 288) 'z': {unknown} | 1508 | [291; 304) 'TraitTest::ID': {unknown} |
1457 | ⋮[291; 304) 'TraitTest::ID': {unknown} | ||
1458 | "### | 1509 | "### |
1459 | ); | 1510 | ); |
1460 | } | 1511 | } |
1461 | 1512 | ||
1462 | #[test] | 1513 | #[test] |
1463 | fn infer_associated_method_struct() { | 1514 | fn infer_associated_method_struct() { |
1464 | assert_snapshot_matches!( | 1515 | assert_snapshot!( |
1465 | infer(r#" | 1516 | infer(r#" |
1466 | struct A { x: u32 } | 1517 | struct A { x: u32 } |
1467 | 1518 | ||
@@ -1476,23 +1527,22 @@ fn test() { | |||
1476 | } | 1527 | } |
1477 | "#), | 1528 | "#), |
1478 | @r###" | 1529 | @r###" |
1479 | ⋮ | 1530 | [49; 75) '{ ... }': A |
1480 | ⋮[49; 75) '{ ... }': A | 1531 | [59; 69) 'A { x: 0 }': A |
1481 | ⋮[59; 69) 'A { x: 0 }': A | 1532 | [66; 67) '0': u32 |
1482 | ⋮[66; 67) '0': u32 | 1533 | [88; 122) '{ ...a.x; }': () |
1483 | ⋮[88; 122) '{ ...a.x; }': () | 1534 | [98; 99) 'a': A |
1484 | ⋮[98; 99) 'a': A | 1535 | [102; 108) 'A::new': fn new() -> A |
1485 | ⋮[102; 108) 'A::new': fn new() -> A | 1536 | [102; 110) 'A::new()': A |
1486 | ⋮[102; 110) 'A::new()': A | 1537 | [116; 117) 'a': A |
1487 | ⋮[116; 117) 'a': A | 1538 | [116; 119) 'a.x': u32 |
1488 | ⋮[116; 119) 'a.x': u32 | ||
1489 | "### | 1539 | "### |
1490 | ); | 1540 | ); |
1491 | } | 1541 | } |
1492 | 1542 | ||
1493 | #[test] | 1543 | #[test] |
1494 | fn infer_associated_method_enum() { | 1544 | fn infer_associated_method_enum() { |
1495 | assert_snapshot_matches!( | 1545 | assert_snapshot!( |
1496 | infer(r#" | 1546 | infer(r#" |
1497 | enum A { B, C } | 1547 | enum A { B, C } |
1498 | 1548 | ||
@@ -1512,27 +1562,26 @@ fn test() { | |||
1512 | } | 1562 | } |
1513 | "#), | 1563 | "#), |
1514 | @r###" | 1564 | @r###" |
1515 | ⋮ | 1565 | [47; 67) '{ ... }': A |
1516 | ⋮[47; 67) '{ ... }': A | 1566 | [57; 61) 'A::B': A |
1517 | ⋮[57; 61) 'A::B': A | 1567 | [88; 108) '{ ... }': A |
1518 | ⋮[88; 108) '{ ... }': A | 1568 | [98; 102) 'A::C': A |
1519 | ⋮[98; 102) 'A::C': A | 1569 | [121; 178) '{ ... c; }': () |
1520 | ⋮[121; 178) '{ ... c; }': () | 1570 | [131; 132) 'a': A |
1521 | ⋮[131; 132) 'a': A | 1571 | [135; 139) 'A::b': fn b() -> A |
1522 | ⋮[135; 139) 'A::b': fn b() -> A | 1572 | [135; 141) 'A::b()': A |
1523 | ⋮[135; 141) 'A::b()': A | 1573 | [147; 148) 'a': A |
1524 | ⋮[147; 148) 'a': A | 1574 | [158; 159) 'c': A |
1525 | ⋮[158; 159) 'c': A | 1575 | [162; 166) 'A::c': fn c() -> A |
1526 | ⋮[162; 166) 'A::c': fn c() -> A | 1576 | [162; 168) 'A::c()': A |
1527 | ⋮[162; 168) 'A::c()': A | 1577 | [174; 175) 'c': A |
1528 | ⋮[174; 175) 'c': A | ||
1529 | "### | 1578 | "### |
1530 | ); | 1579 | ); |
1531 | } | 1580 | } |
1532 | 1581 | ||
1533 | #[test] | 1582 | #[test] |
1534 | fn infer_associated_method_with_modules() { | 1583 | fn infer_associated_method_with_modules() { |
1535 | assert_snapshot_matches!( | 1584 | assert_snapshot!( |
1536 | infer(r#" | 1585 | infer(r#" |
1537 | mod a { | 1586 | mod a { |
1538 | struct A; | 1587 | struct A; |
@@ -1557,28 +1606,30 @@ fn test() { | |||
1557 | } | 1606 | } |
1558 | "#), | 1607 | "#), |
1559 | @r###" | 1608 | @r###" |
1560 | [56; 64) '{ A {} }': A | 1609 | |
1561 | [58; 62) 'A {}': A | 1610 | [56; 64) '{ A {} }': A |
1562 | [126; 132) '{ 99 }': u32 | 1611 | [58; 62) 'A {}': A |
1563 | [128; 130) '99': u32 | 1612 | [126; 132) '{ 99 }': u32 |
1564 | [202; 210) '{ C {} }': C | 1613 | [128; 130) '99': u32 |
1565 | [204; 208) 'C {}': C | 1614 | [202; 210) '{ C {} }': C |
1566 | [241; 325) '{ ...g(); }': () | 1615 | [204; 208) 'C {}': C |
1567 | [251; 252) 'x': A | 1616 | [241; 325) '{ ...g(); }': () |
1568 | [255; 266) 'a::A::thing': fn thing() -> A | 1617 | [251; 252) 'x': A |
1569 | [255; 268) 'a::A::thing()': A | 1618 | [255; 266) 'a::A::thing': fn thing() -> A |
1570 | [278; 279) 'y': u32 | 1619 | [255; 268) 'a::A::thing()': A |
1571 | [282; 293) 'b::B::thing': fn thing() -> u32 | 1620 | [278; 279) 'y': u32 |
1572 | [282; 295) 'b::B::thing()': u32 | 1621 | [282; 293) 'b::B::thing': fn thing() -> u32 |
1573 | [305; 306) 'z': C | 1622 | [282; 295) 'b::B::thing()': u32 |
1574 | [309; 320) 'c::C::thing': fn thing() -> C | 1623 | [305; 306) 'z': C |
1575 | [309; 322) 'c::C::thing()': C"### | 1624 | [309; 320) 'c::C::thing': fn thing() -> C |
1625 | [309; 322) 'c::C::thing()': C | ||
1626 | "### | ||
1576 | ); | 1627 | ); |
1577 | } | 1628 | } |
1578 | 1629 | ||
1579 | #[test] | 1630 | #[test] |
1580 | fn infer_associated_method_generics() { | 1631 | fn infer_associated_method_generics() { |
1581 | assert_snapshot_matches!( | 1632 | assert_snapshot!( |
1582 | infer(r#" | 1633 | infer(r#" |
1583 | struct Gen<T> { | 1634 | struct Gen<T> { |
1584 | val: T | 1635 | val: T |
@@ -1595,21 +1646,23 @@ fn test() { | |||
1595 | } | 1646 | } |
1596 | "#), | 1647 | "#), |
1597 | @r###" | 1648 | @r###" |
1598 | [64; 67) 'val': T | 1649 | |
1599 | [82; 109) '{ ... }': Gen<T> | 1650 | [64; 67) 'val': T |
1600 | [92; 103) 'Gen { val }': Gen<T> | 1651 | [82; 109) '{ ... }': Gen<T> |
1601 | [98; 101) 'val': T | 1652 | [92; 103) 'Gen { val }': Gen<T> |
1602 | [123; 155) '{ ...32); }': () | 1653 | [98; 101) 'val': T |
1603 | [133; 134) 'a': Gen<u32> | 1654 | [123; 155) '{ ...32); }': () |
1604 | [137; 146) 'Gen::make': fn make<u32>(T) -> Gen<T> | 1655 | [133; 134) 'a': Gen<u32> |
1605 | [137; 152) 'Gen::make(0u32)': Gen<u32> | 1656 | [137; 146) 'Gen::make': fn make<u32>(T) -> Gen<T> |
1606 | [147; 151) '0u32': u32"### | 1657 | [137; 152) 'Gen::make(0u32)': Gen<u32> |
1658 | [147; 151) '0u32': u32 | ||
1659 | "### | ||
1607 | ); | 1660 | ); |
1608 | } | 1661 | } |
1609 | 1662 | ||
1610 | #[test] | 1663 | #[test] |
1611 | fn infer_associated_method_generics_with_default_param() { | 1664 | fn infer_associated_method_generics_with_default_param() { |
1612 | assert_snapshot_matches!( | 1665 | assert_snapshot!( |
1613 | infer(r#" | 1666 | infer(r#" |
1614 | struct Gen<T=u32> { | 1667 | struct Gen<T=u32> { |
1615 | val: T | 1668 | val: T |
@@ -1626,19 +1679,21 @@ fn test() { | |||
1626 | } | 1679 | } |
1627 | "#), | 1680 | "#), |
1628 | @r###" | 1681 | @r###" |
1629 | [80; 104) '{ ... }': ! | 1682 | |
1630 | [90; 98) 'loop { }': ! | 1683 | [80; 104) '{ ... }': ! |
1631 | [95; 98) '{ }': () | 1684 | [90; 98) 'loop { }': ! |
1632 | [118; 146) '{ ...e(); }': () | 1685 | [95; 98) '{ }': () |
1633 | [128; 129) 'a': Gen<u32> | 1686 | [118; 146) '{ ...e(); }': () |
1634 | [132; 141) 'Gen::make': fn make<u32>() -> Gen<T> | 1687 | [128; 129) 'a': Gen<u32> |
1635 | [132; 143) 'Gen::make()': Gen<u32>"### | 1688 | [132; 141) 'Gen::make': fn make<u32>() -> Gen<T> |
1689 | [132; 143) 'Gen::make()': Gen<u32> | ||
1690 | "### | ||
1636 | ); | 1691 | ); |
1637 | } | 1692 | } |
1638 | 1693 | ||
1639 | #[test] | 1694 | #[test] |
1640 | fn infer_associated_method_generics_without_args() { | 1695 | fn infer_associated_method_generics_without_args() { |
1641 | assert_snapshot_matches!( | 1696 | assert_snapshot!( |
1642 | infer(r#" | 1697 | infer(r#" |
1643 | struct Gen<T> { | 1698 | struct Gen<T> { |
1644 | val: T | 1699 | val: T |
@@ -1655,19 +1710,21 @@ fn test() { | |||
1655 | } | 1710 | } |
1656 | "#), | 1711 | "#), |
1657 | @r###" | 1712 | @r###" |
1658 | [76; 100) '{ ... }': ! | 1713 | |
1659 | [86; 94) 'loop { }': ! | 1714 | [76; 100) '{ ... }': ! |
1660 | [91; 94) '{ }': () | 1715 | [86; 94) 'loop { }': ! |
1661 | [114; 149) '{ ...e(); }': () | 1716 | [91; 94) '{ }': () |
1662 | [124; 125) 'a': Gen<u32> | 1717 | [114; 149) '{ ...e(); }': () |
1663 | [128; 144) 'Gen::<...::make': fn make<u32>() -> Gen<T> | 1718 | [124; 125) 'a': Gen<u32> |
1664 | [128; 146) 'Gen::<...make()': Gen<u32>"### | 1719 | [128; 144) 'Gen::<...::make': fn make<u32>() -> Gen<T> |
1720 | [128; 146) 'Gen::<...make()': Gen<u32> | ||
1721 | "### | ||
1665 | ); | 1722 | ); |
1666 | } | 1723 | } |
1667 | 1724 | ||
1668 | #[test] | 1725 | #[test] |
1669 | fn infer_associated_method_generics_2_type_params_without_args() { | 1726 | fn infer_associated_method_generics_2_type_params_without_args() { |
1670 | assert_snapshot_matches!( | 1727 | assert_snapshot!( |
1671 | infer(r#" | 1728 | infer(r#" |
1672 | struct Gen<T, U> { | 1729 | struct Gen<T, U> { |
1673 | val: T, | 1730 | val: T, |
@@ -1685,19 +1742,21 @@ fn test() { | |||
1685 | } | 1742 | } |
1686 | "#), | 1743 | "#), |
1687 | @r###" | 1744 | @r###" |
1688 | [102; 126) '{ ... }': ! | 1745 | |
1689 | [112; 120) 'loop { }': ! | 1746 | [102; 126) '{ ... }': ! |
1690 | [117; 120) '{ }': () | 1747 | [112; 120) 'loop { }': ! |
1691 | [140; 180) '{ ...e(); }': () | 1748 | [117; 120) '{ }': () |
1692 | [150; 151) 'a': Gen<u32, u64> | 1749 | [140; 180) '{ ...e(); }': () |
1693 | [154; 175) 'Gen::<...::make': fn make<u64>() -> Gen<u32, T> | 1750 | [150; 151) 'a': Gen<u32, u64> |
1694 | [154; 177) 'Gen::<...make()': Gen<u32, u64>"### | 1751 | [154; 175) 'Gen::<...::make': fn make<u64>() -> Gen<u32, T> |
1752 | [154; 177) 'Gen::<...make()': Gen<u32, u64> | ||
1753 | "### | ||
1695 | ); | 1754 | ); |
1696 | } | 1755 | } |
1697 | 1756 | ||
1698 | #[test] | 1757 | #[test] |
1699 | fn infer_type_alias() { | 1758 | fn infer_type_alias() { |
1700 | assert_snapshot_matches!( | 1759 | assert_snapshot!( |
1701 | infer(r#" | 1760 | infer(r#" |
1702 | struct A<X, Y> { x: X, y: Y } | 1761 | struct A<X, Y> { x: X, y: Y } |
1703 | type Foo = A<u32, i128>; | 1762 | type Foo = A<u32, i128>; |
@@ -1713,23 +1772,22 @@ fn test(x: Foo, y: Bar<&str>, z: Baz<i8, u8>) { | |||
1713 | } | 1772 | } |
1714 | "#), | 1773 | "#), |
1715 | @r###" | 1774 | @r###" |
1716 | ⋮ | 1775 | [116; 117) 'x': A<u32, i128> |
1717 | ⋮[116; 117) 'x': A<u32, i128> | 1776 | [124; 125) 'y': A<&str, u128> |
1718 | ⋮[124; 125) 'y': A<&str, u128> | 1777 | [138; 139) 'z': A<u8, i8> |
1719 | ⋮[138; 139) 'z': A<u8, i8> | 1778 | [154; 211) '{ ...z.y; }': () |
1720 | ⋮[154; 211) '{ ...z.y; }': () | 1779 | [160; 161) 'x': A<u32, i128> |
1721 | ⋮[160; 161) 'x': A<u32, i128> | 1780 | [160; 163) 'x.x': u32 |
1722 | ⋮[160; 163) 'x.x': u32 | 1781 | [169; 170) 'x': A<u32, i128> |
1723 | ⋮[169; 170) 'x': A<u32, i128> | 1782 | [169; 172) 'x.y': i128 |
1724 | ⋮[169; 172) 'x.y': i128 | 1783 | [178; 179) 'y': A<&str, u128> |
1725 | ⋮[178; 179) 'y': A<&str, u128> | 1784 | [178; 181) 'y.x': &str |
1726 | ⋮[178; 181) 'y.x': &str | 1785 | [187; 188) 'y': A<&str, u128> |
1727 | ⋮[187; 188) 'y': A<&str, u128> | 1786 | [187; 190) 'y.y': u128 |
1728 | ⋮[187; 190) 'y.y': u128 | 1787 | [196; 197) 'z': A<u8, i8> |
1729 | ⋮[196; 197) 'z': A<u8, i8> | 1788 | [196; 199) 'z.x': u8 |
1730 | ⋮[196; 199) 'z.x': u8 | 1789 | [205; 206) 'z': A<u8, i8> |
1731 | ⋮[205; 206) 'z': A<u8, i8> | 1790 | [205; 208) 'z.y': i8 |
1732 | ⋮[205; 208) 'z.y': i8 | ||
1733 | "### | 1791 | "### |
1734 | ) | 1792 | ) |
1735 | } | 1793 | } |
@@ -1737,7 +1795,7 @@ fn test(x: Foo, y: Bar<&str>, z: Baz<i8, u8>) { | |||
1737 | #[test] | 1795 | #[test] |
1738 | #[should_panic] // we currently can't handle this | 1796 | #[should_panic] // we currently can't handle this |
1739 | fn recursive_type_alias() { | 1797 | fn recursive_type_alias() { |
1740 | assert_snapshot_matches!( | 1798 | assert_snapshot!( |
1741 | infer(r#" | 1799 | infer(r#" |
1742 | struct A<X> {} | 1800 | struct A<X> {} |
1743 | type Foo = Foo; | 1801 | type Foo = Foo; |
@@ -1750,7 +1808,7 @@ fn test(x: Foo) {} | |||
1750 | 1808 | ||
1751 | #[test] | 1809 | #[test] |
1752 | fn no_panic_on_field_of_enum() { | 1810 | fn no_panic_on_field_of_enum() { |
1753 | assert_snapshot_matches!( | 1811 | assert_snapshot!( |
1754 | infer(r#" | 1812 | infer(r#" |
1755 | enum X {} | 1813 | enum X {} |
1756 | 1814 | ||
@@ -1759,16 +1817,18 @@ fn test(x: X) { | |||
1759 | } | 1817 | } |
1760 | "#), | 1818 | "#), |
1761 | @r###" | 1819 | @r###" |
1762 | [20; 21) 'x': X | 1820 | |
1763 | [26; 47) '{ ...eld; }': () | 1821 | [20; 21) 'x': X |
1764 | [32; 33) 'x': X | 1822 | [26; 47) '{ ...eld; }': () |
1765 | [32; 44) 'x.some_field': {unknown}"### | 1823 | [32; 33) 'x': X |
1824 | [32; 44) 'x.some_field': {unknown} | ||
1825 | "### | ||
1766 | ); | 1826 | ); |
1767 | } | 1827 | } |
1768 | 1828 | ||
1769 | #[test] | 1829 | #[test] |
1770 | fn bug_585() { | 1830 | fn bug_585() { |
1771 | assert_snapshot_matches!( | 1831 | assert_snapshot!( |
1772 | infer(r#" | 1832 | infer(r#" |
1773 | fn test() { | 1833 | fn test() { |
1774 | X {}; | 1834 | X {}; |
@@ -1779,20 +1839,22 @@ fn test() { | |||
1779 | } | 1839 | } |
1780 | "#), | 1840 | "#), |
1781 | @r###" | 1841 | @r###" |
1782 | [11; 89) '{ ... } }': () | 1842 | |
1783 | [17; 21) 'X {}': {unknown} | 1843 | [11; 89) '{ ... } }': () |
1784 | [27; 87) 'match ... }': () | 1844 | [17; 21) 'X {}': {unknown} |
1785 | [33; 34) 'x': {unknown} | 1845 | [27; 87) 'match ... }': () |
1786 | [45; 52) 'A::B {}': {unknown} | 1846 | [33; 34) 'x': {unknown} |
1787 | [56; 58) '()': () | 1847 | [45; 52) 'A::B {}': {unknown} |
1788 | [68; 74) 'A::Y()': {unknown} | 1848 | [56; 58) '()': () |
1789 | [78; 80) '()': ()"### | 1849 | [68; 74) 'A::Y()': {unknown} |
1850 | [78; 80) '()': () | ||
1851 | "### | ||
1790 | ); | 1852 | ); |
1791 | } | 1853 | } |
1792 | 1854 | ||
1793 | #[test] | 1855 | #[test] |
1794 | fn bug_651() { | 1856 | fn bug_651() { |
1795 | assert_snapshot_matches!( | 1857 | assert_snapshot!( |
1796 | infer(r#" | 1858 | infer(r#" |
1797 | fn quux() { | 1859 | fn quux() { |
1798 | let y = 92; | 1860 | let y = 92; |
@@ -1800,12 +1862,14 @@ fn quux() { | |||
1800 | } | 1862 | } |
1801 | "#), | 1863 | "#), |
1802 | @r###" | 1864 | @r###" |
1803 | [11; 41) '{ ...+ y; }': () | 1865 | |
1804 | [21; 22) 'y': i32 | 1866 | [11; 41) '{ ...+ y; }': () |
1805 | [25; 27) '92': i32 | 1867 | [21; 22) 'y': i32 |
1806 | [33; 34) '1': i32 | 1868 | [25; 27) '92': i32 |
1807 | [33; 38) '1 + y': i32 | 1869 | [33; 34) '1': i32 |
1808 | [37; 38) 'y': i32"### | 1870 | [33; 38) '1 + y': i32 |
1871 | [37; 38) 'y': i32 | ||
1872 | "### | ||
1809 | ); | 1873 | ); |
1810 | } | 1874 | } |
1811 | 1875 | ||
@@ -1813,7 +1877,7 @@ fn quux() { | |||
1813 | fn recursive_vars() { | 1877 | fn recursive_vars() { |
1814 | covers!(type_var_cycles_resolve_completely); | 1878 | covers!(type_var_cycles_resolve_completely); |
1815 | covers!(type_var_cycles_resolve_as_possible); | 1879 | covers!(type_var_cycles_resolve_as_possible); |
1816 | assert_snapshot_matches!( | 1880 | assert_snapshot!( |
1817 | infer(r#" | 1881 | infer(r#" |
1818 | fn test() { | 1882 | fn test() { |
1819 | let y = unknown; | 1883 | let y = unknown; |
@@ -1821,13 +1885,15 @@ fn test() { | |||
1821 | } | 1885 | } |
1822 | "#), | 1886 | "#), |
1823 | @r###" | 1887 | @r###" |
1824 | [11; 48) '{ ...&y]; }': () | 1888 | |
1825 | [21; 22) 'y': &{unknown} | 1889 | [11; 48) '{ ...&y]; }': () |
1826 | [25; 32) 'unknown': &{unknown} | 1890 | [21; 22) 'y': &{unknown} |
1827 | [38; 45) '[y, &y]': [&&{unknown};_] | 1891 | [25; 32) 'unknown': &{unknown} |
1828 | [39; 40) 'y': &{unknown} | 1892 | [38; 45) '[y, &y]': [&&{unknown};_] |
1829 | [42; 44) '&y': &&{unknown} | 1893 | [39; 40) 'y': &{unknown} |
1830 | [43; 44) 'y': &{unknown}"### | 1894 | [42; 44) '&y': &&{unknown} |
1895 | [43; 44) 'y': &{unknown} | ||
1896 | "### | ||
1831 | ); | 1897 | ); |
1832 | } | 1898 | } |
1833 | 1899 | ||
@@ -1835,7 +1901,7 @@ fn test() { | |||
1835 | fn recursive_vars_2() { | 1901 | fn recursive_vars_2() { |
1836 | covers!(type_var_cycles_resolve_completely); | 1902 | covers!(type_var_cycles_resolve_completely); |
1837 | covers!(type_var_cycles_resolve_as_possible); | 1903 | covers!(type_var_cycles_resolve_as_possible); |
1838 | assert_snapshot_matches!( | 1904 | assert_snapshot!( |
1839 | infer(r#" | 1905 | infer(r#" |
1840 | fn test() { | 1906 | fn test() { |
1841 | let x = unknown; | 1907 | let x = unknown; |
@@ -1844,26 +1910,28 @@ fn test() { | |||
1844 | } | 1910 | } |
1845 | "#), | 1911 | "#), |
1846 | @r###" | 1912 | @r###" |
1847 | [11; 80) '{ ...x)]; }': () | 1913 | |
1848 | [21; 22) 'x': &&{unknown} | 1914 | [11; 80) '{ ...x)]; }': () |
1849 | [25; 32) 'unknown': &&{unknown} | 1915 | [21; 22) 'x': &&{unknown} |
1850 | [42; 43) 'y': &&{unknown} | 1916 | [25; 32) 'unknown': &&{unknown} |
1851 | [46; 53) 'unknown': &&{unknown} | 1917 | [42; 43) 'y': &&{unknown} |
1852 | [59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown});_] | 1918 | [46; 53) 'unknown': &&{unknown} |
1853 | [60; 66) '(x, y)': (&&{unknown}, &&{unknown}) | 1919 | [59; 77) '[(x, y..., &x)]': [(&&{unknown}, &&{unknown});_] |
1854 | [61; 62) 'x': &&{unknown} | 1920 | [60; 66) '(x, y)': (&&{unknown}, &&{unknown}) |
1855 | [64; 65) 'y': &&{unknown} | 1921 | [61; 62) 'x': &&{unknown} |
1856 | [68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown}) | 1922 | [64; 65) 'y': &&{unknown} |
1857 | [69; 71) '&y': &&&{unknown} | 1923 | [68; 76) '(&y, &x)': (&&&{unknown}, &&&{unknown}) |
1858 | [70; 71) 'y': &&{unknown} | 1924 | [69; 71) '&y': &&&{unknown} |
1859 | [73; 75) '&x': &&&{unknown} | 1925 | [70; 71) 'y': &&{unknown} |
1860 | [74; 75) 'x': &&{unknown}"### | 1926 | [73; 75) '&x': &&&{unknown} |
1927 | [74; 75) 'x': &&{unknown} | ||
1928 | "### | ||
1861 | ); | 1929 | ); |
1862 | } | 1930 | } |
1863 | 1931 | ||
1864 | #[test] | 1932 | #[test] |
1865 | fn infer_type_param() { | 1933 | fn infer_type_param() { |
1866 | assert_snapshot_matches!( | 1934 | assert_snapshot!( |
1867 | infer(r#" | 1935 | infer(r#" |
1868 | fn id<T>(x: T) -> T { | 1936 | fn id<T>(x: T) -> T { |
1869 | x | 1937 | x |
@@ -1881,32 +1949,34 @@ fn test() { | |||
1881 | } | 1949 | } |
1882 | "#), | 1950 | "#), |
1883 | @r###" | 1951 | @r###" |
1884 | [10; 11) 'x': T | 1952 | |
1885 | [21; 30) '{ x }': T | 1953 | [10; 11) 'x': T |
1886 | [27; 28) 'x': T | 1954 | [21; 30) '{ x }': T |
1887 | [44; 45) 'x': &T | 1955 | [27; 28) 'x': T |
1888 | [56; 65) '{ x }': &T | 1956 | [44; 45) 'x': &T |
1889 | [62; 63) 'x': &T | 1957 | [56; 65) '{ x }': &T |
1890 | [77; 157) '{ ...(1); }': () | 1958 | [62; 63) 'x': &T |
1891 | [87; 88) 'y': u32 | 1959 | [77; 157) '{ ...(1); }': () |
1892 | [91; 96) '10u32': u32 | 1960 | [87; 88) 'y': u32 |
1893 | [102; 104) 'id': fn id<u32>(T) -> T | 1961 | [91; 96) '10u32': u32 |
1894 | [102; 107) 'id(y)': u32 | 1962 | [102; 104) 'id': fn id<u32>(T) -> T |
1895 | [105; 106) 'y': u32 | 1963 | [102; 107) 'id(y)': u32 |
1896 | [117; 118) 'x': bool | 1964 | [105; 106) 'y': u32 |
1897 | [127; 132) 'clone': fn clone<bool>(&T) -> T | 1965 | [117; 118) 'x': bool |
1898 | [127; 135) 'clone(z)': bool | 1966 | [127; 132) 'clone': fn clone<bool>(&T) -> T |
1899 | [133; 134) 'z': &bool | 1967 | [127; 135) 'clone(z)': bool |
1900 | [141; 151) 'id::<i128>': fn id<i128>(T) -> T | 1968 | [133; 134) 'z': &bool |
1901 | [141; 154) 'id::<i128>(1)': i128 | 1969 | [141; 151) 'id::<i128>': fn id<i128>(T) -> T |
1902 | [152; 153) '1': i128"### | 1970 | [141; 154) 'id::<i128>(1)': i128 |
1971 | [152; 153) '1': i128 | ||
1972 | "### | ||
1903 | ); | 1973 | ); |
1904 | } | 1974 | } |
1905 | 1975 | ||
1906 | #[test] | 1976 | #[test] |
1907 | fn infer_std_crash_1() { | 1977 | fn infer_std_crash_1() { |
1908 | // caused stack overflow, taken from std | 1978 | // caused stack overflow, taken from std |
1909 | assert_snapshot_matches!( | 1979 | assert_snapshot!( |
1910 | infer(r#" | 1980 | infer(r#" |
1911 | enum Maybe<T> { | 1981 | enum Maybe<T> { |
1912 | Real(T), | 1982 | Real(T), |
@@ -1920,12 +1990,14 @@ fn write() { | |||
1920 | } | 1990 | } |
1921 | "#), | 1991 | "#), |
1922 | @r###" | 1992 | @r###" |
1923 | [54; 139) '{ ... } }': () | 1993 | |
1924 | [60; 137) 'match ... }': () | 1994 | [54; 139) '{ ... } }': () |
1925 | [66; 83) 'someth...nknown': Maybe<{unknown}> | 1995 | [60; 137) 'match ... }': () |
1926 | [94; 124) 'Maybe:...thing)': Maybe<{unknown}> | 1996 | [66; 83) 'someth...nknown': Maybe<{unknown}> |
1927 | [106; 123) 'ref mu...ething': &mut {unknown} | 1997 | [94; 124) 'Maybe:...thing)': Maybe<{unknown}> |
1928 | [128; 130) '()': ()"### | 1998 | [106; 123) 'ref mu...ething': &mut {unknown} |
1999 | [128; 130) '()': () | ||
2000 | "### | ||
1929 | ); | 2001 | ); |
1930 | } | 2002 | } |
1931 | 2003 | ||
@@ -1933,27 +2005,29 @@ fn write() { | |||
1933 | fn infer_std_crash_2() { | 2005 | fn infer_std_crash_2() { |
1934 | covers!(type_var_resolves_to_int_var); | 2006 | covers!(type_var_resolves_to_int_var); |
1935 | // caused "equating two type variables, ...", taken from std | 2007 | // caused "equating two type variables, ...", taken from std |
1936 | assert_snapshot_matches!( | 2008 | assert_snapshot!( |
1937 | infer(r#" | 2009 | infer(r#" |
1938 | fn test_line_buffer() { | 2010 | fn test_line_buffer() { |
1939 | &[0, b'\n', 1, b'\n']; | 2011 | &[0, b'\n', 1, b'\n']; |
1940 | } | 2012 | } |
1941 | "#), | 2013 | "#), |
1942 | @r###" | 2014 | @r###" |
1943 | [23; 53) '{ ...n']; }': () | 2015 | |
1944 | [29; 50) '&[0, b...b'\n']': &[u8;_] | 2016 | [23; 53) '{ ...n']; }': () |
1945 | [30; 50) '[0, b'...b'\n']': [u8;_] | 2017 | [29; 50) '&[0, b...b'\n']': &[u8;_] |
1946 | [31; 32) '0': u8 | 2018 | [30; 50) '[0, b'...b'\n']': [u8;_] |
1947 | [34; 39) 'b'\n'': u8 | 2019 | [31; 32) '0': u8 |
1948 | [41; 42) '1': u8 | 2020 | [34; 39) 'b'\n'': u8 |
1949 | [44; 49) 'b'\n'': u8"### | 2021 | [41; 42) '1': u8 |
2022 | [44; 49) 'b'\n'': u8 | ||
2023 | "### | ||
1950 | ); | 2024 | ); |
1951 | } | 2025 | } |
1952 | 2026 | ||
1953 | #[test] | 2027 | #[test] |
1954 | fn infer_std_crash_3() { | 2028 | fn infer_std_crash_3() { |
1955 | // taken from rustc | 2029 | // taken from rustc |
1956 | assert_snapshot_matches!( | 2030 | assert_snapshot!( |
1957 | infer(r#" | 2031 | infer(r#" |
1958 | pub fn compute() { | 2032 | pub fn compute() { |
1959 | match nope!() { | 2033 | match nope!() { |
@@ -1962,14 +2036,13 @@ pub fn compute() { | |||
1962 | } | 2036 | } |
1963 | "#), | 2037 | "#), |
1964 | @r###" | 2038 | @r###" |
1965 | ⋮ | 2039 | [18; 108) '{ ... } }': () |
1966 | ⋮[18; 108) '{ ... } }': () | 2040 | [24; 106) 'match ... }': () |
1967 | ⋮[24; 106) 'match ... }': () | 2041 | [30; 37) 'nope!()': {unknown} |
1968 | ⋮[30; 37) 'nope!()': {unknown} | 2042 | [48; 94) 'SizeSk...tail }': {unknown} |
1969 | ⋮[48; 94) 'SizeSk...tail }': {unknown} | 2043 | [82; 86) 'true': {unknown} |
1970 | ⋮[82; 86) 'true': {unknown} | 2044 | [88; 92) 'tail': {unknown} |
1971 | ⋮[88; 92) 'tail': {unknown} | 2045 | [98; 100) '{}': () |
1972 | ⋮[98; 100) '{}': () | ||
1973 | "### | 2046 | "### |
1974 | ); | 2047 | ); |
1975 | } | 2048 | } |
@@ -1977,7 +2050,7 @@ pub fn compute() { | |||
1977 | #[test] | 2050 | #[test] |
1978 | fn infer_std_crash_4() { | 2051 | fn infer_std_crash_4() { |
1979 | // taken from rustc | 2052 | // taken from rustc |
1980 | assert_snapshot_matches!( | 2053 | assert_snapshot!( |
1981 | infer(r#" | 2054 | infer(r#" |
1982 | pub fn primitive_type() { | 2055 | pub fn primitive_type() { |
1983 | match *self { | 2056 | match *self { |
@@ -1986,15 +2059,14 @@ pub fn primitive_type() { | |||
1986 | } | 2059 | } |
1987 | "#), | 2060 | "#), |
1988 | @r###" | 2061 | @r###" |
1989 | ⋮ | 2062 | [25; 106) '{ ... } }': () |
1990 | ⋮[25; 106) '{ ... } }': () | 2063 | [31; 104) 'match ... }': () |
1991 | ⋮[31; 104) 'match ... }': () | 2064 | [37; 42) '*self': {unknown} |
1992 | ⋮[37; 42) '*self': {unknown} | 2065 | [38; 42) 'self': {unknown} |
1993 | ⋮[38; 42) 'self': {unknown} | 2066 | [53; 91) 'Borrow...), ..}': {unknown} |
1994 | ⋮[53; 91) 'Borrow...), ..}': {unknown} | 2067 | [74; 86) 'Primitive(p)': {unknown} |
1995 | ⋮[74; 86) 'Primitive(p)': {unknown} | 2068 | [84; 85) 'p': {unknown} |
1996 | ⋮[84; 85) 'p': {unknown} | 2069 | [95; 97) '{}': () |
1997 | ⋮[95; 97) '{}': () | ||
1998 | "### | 2070 | "### |
1999 | ); | 2071 | ); |
2000 | } | 2072 | } |
@@ -2002,7 +2074,7 @@ pub fn primitive_type() { | |||
2002 | #[test] | 2074 | #[test] |
2003 | fn infer_std_crash_5() { | 2075 | fn infer_std_crash_5() { |
2004 | // taken from rustc | 2076 | // taken from rustc |
2005 | assert_snapshot_matches!( | 2077 | assert_snapshot!( |
2006 | infer(r#" | 2078 | infer(r#" |
2007 | fn extra_compiler_flags() { | 2079 | fn extra_compiler_flags() { |
2008 | for content in doesnt_matter { | 2080 | for content in doesnt_matter { |
@@ -2021,36 +2093,38 @@ fn extra_compiler_flags() { | |||
2021 | } | 2093 | } |
2022 | "#), | 2094 | "#), |
2023 | @r###" | 2095 | @r###" |
2024 | [27; 323) '{ ... } }': () | 2096 | |
2025 | [33; 321) 'for co... }': () | 2097 | [27; 323) '{ ... } }': () |
2026 | [37; 44) 'content': &{unknown} | 2098 | [33; 321) 'for co... }': () |
2027 | [48; 61) 'doesnt_matter': {unknown} | 2099 | [37; 44) 'content': &{unknown} |
2028 | [62; 321) '{ ... }': () | 2100 | [48; 61) 'doesnt_matter': {unknown} |
2029 | [76; 80) 'name': &&{unknown} | 2101 | [62; 321) '{ ... }': () |
2030 | [83; 167) 'if doe... }': &&{unknown} | 2102 | [76; 80) 'name': &&{unknown} |
2031 | [86; 99) 'doesnt_matter': bool | 2103 | [83; 167) 'if doe... }': &&{unknown} |
2032 | [100; 129) '{ ... }': &&{unknown} | 2104 | [86; 99) 'doesnt_matter': bool |
2033 | [114; 119) 'first': &&{unknown} | 2105 | [100; 129) '{ ... }': &&{unknown} |
2034 | [135; 167) '{ ... }': &&{unknown} | 2106 | [114; 119) 'first': &&{unknown} |
2035 | [149; 157) '&content': &&{unknown} | 2107 | [135; 167) '{ ... }': &&{unknown} |
2036 | [150; 157) 'content': &{unknown} | 2108 | [149; 157) '&content': &&{unknown} |
2037 | [182; 189) 'content': &&{unknown} | 2109 | [150; 157) 'content': &{unknown} |
2038 | [192; 314) 'if ICE... }': &&{unknown} | 2110 | [182; 189) 'content': &&{unknown} |
2039 | [195; 232) 'ICE_RE..._VALUE': {unknown} | 2111 | [192; 314) 'if ICE... }': &&{unknown} |
2040 | [195; 248) 'ICE_RE...&name)': bool | 2112 | [195; 232) 'ICE_RE..._VALUE': {unknown} |
2041 | [242; 247) '&name': &&&{unknown} | 2113 | [195; 248) 'ICE_RE...&name)': bool |
2042 | [243; 247) 'name': &&{unknown} | 2114 | [242; 247) '&name': &&&{unknown} |
2043 | [249; 277) '{ ... }': &&{unknown} | 2115 | [243; 247) 'name': &&{unknown} |
2044 | [263; 267) 'name': &&{unknown} | 2116 | [249; 277) '{ ... }': &&{unknown} |
2045 | [283; 314) '{ ... }': &{unknown} | 2117 | [263; 267) 'name': &&{unknown} |
2046 | [297; 304) 'content': &{unknown}"### | 2118 | [283; 314) '{ ... }': &{unknown} |
2119 | [297; 304) 'content': &{unknown} | ||
2120 | "### | ||
2047 | ); | 2121 | ); |
2048 | } | 2122 | } |
2049 | 2123 | ||
2050 | #[test] | 2124 | #[test] |
2051 | fn infer_nested_generics_crash() { | 2125 | fn infer_nested_generics_crash() { |
2052 | // another crash found typechecking rustc | 2126 | // another crash found typechecking rustc |
2053 | assert_snapshot_matches!( | 2127 | assert_snapshot!( |
2054 | infer(r#" | 2128 | infer(r#" |
2055 | struct Canonical<V> { | 2129 | struct Canonical<V> { |
2056 | value: V, | 2130 | value: V, |
@@ -2063,17 +2137,19 @@ fn test<R>(query_response: Canonical<QueryResponse<R>>) { | |||
2063 | } | 2137 | } |
2064 | "#), | 2138 | "#), |
2065 | @r###" | 2139 | @r###" |
2066 | [92; 106) 'query_response': Canonical<QueryResponse<R>> | 2140 | |
2067 | [137; 167) '{ ...lue; }': () | 2141 | [92; 106) 'query_response': Canonical<QueryResponse<R>> |
2068 | [143; 164) '&query....value': &QueryResponse<R> | 2142 | [137; 167) '{ ...lue; }': () |
2069 | [144; 158) 'query_response': Canonical<QueryResponse<R>> | 2143 | [143; 164) '&query....value': &QueryResponse<R> |
2070 | [144; 164) 'query_....value': QueryResponse<R>"### | 2144 | [144; 158) 'query_response': Canonical<QueryResponse<R>> |
2145 | [144; 164) 'query_....value': QueryResponse<R> | ||
2146 | "### | ||
2071 | ); | 2147 | ); |
2072 | } | 2148 | } |
2073 | 2149 | ||
2074 | #[test] | 2150 | #[test] |
2075 | fn bug_1030() { | 2151 | fn bug_1030() { |
2076 | assert_snapshot_matches!(infer(r#" | 2152 | assert_snapshot!(infer(r#" |
2077 | struct HashSet<T, H>; | 2153 | struct HashSet<T, H>; |
2078 | struct FxHasher; | 2154 | struct FxHasher; |
2079 | type FxHashSet<T> = HashSet<T, FxHasher>; | 2155 | type FxHashSet<T> = HashSet<T, FxHasher>; |
@@ -2087,10 +2163,12 @@ pub fn main_loop() { | |||
2087 | } | 2163 | } |
2088 | "#), | 2164 | "#), |
2089 | @r###" | 2165 | @r###" |
2090 | [144; 146) '{}': () | 2166 | |
2091 | [169; 198) '{ ...t(); }': () | 2167 | [144; 146) '{}': () |
2092 | [175; 193) 'FxHash...efault': fn default<{unknown}, FxHasher>() -> HashSet<T, H> | 2168 | [169; 198) '{ ...t(); }': () |
2093 | [175; 195) 'FxHash...ault()': HashSet<{unknown}, FxHasher>"### | 2169 | [175; 193) 'FxHash...efault': fn default<{unknown}, FxHasher>() -> HashSet<T, H> |
2170 | [175; 195) 'FxHash...ault()': HashSet<{unknown}, FxHasher> | ||
2171 | "### | ||
2094 | ); | 2172 | ); |
2095 | } | 2173 | } |
2096 | 2174 | ||
@@ -2122,7 +2200,7 @@ mod foo { | |||
2122 | 2200 | ||
2123 | #[test] | 2201 | #[test] |
2124 | fn infer_const() { | 2202 | fn infer_const() { |
2125 | assert_snapshot_matches!( | 2203 | assert_snapshot!( |
2126 | infer(r#" | 2204 | infer(r#" |
2127 | struct Foo; | 2205 | struct Foo; |
2128 | impl Foo { const ASSOC_CONST: u32 = 0; } | 2206 | impl Foo { const ASSOC_CONST: u32 = 0; } |
@@ -2135,22 +2213,24 @@ fn test() { | |||
2135 | } | 2213 | } |
2136 | "#), | 2214 | "#), |
2137 | @r###" | 2215 | @r###" |
2138 | [49; 50) '0': u32 | 2216 | |
2139 | [80; 83) '101': u32 | 2217 | [49; 50) '0': u32 |
2140 | [95; 213) '{ ...NST; }': () | 2218 | [80; 83) '101': u32 |
2141 | [138; 139) 'x': {unknown} | 2219 | [95; 213) '{ ...NST; }': () |
2142 | [142; 153) 'LOCAL_CONST': {unknown} | 2220 | [138; 139) 'x': {unknown} |
2143 | [163; 164) 'z': u32 | 2221 | [142; 153) 'LOCAL_CONST': {unknown} |
2144 | [167; 179) 'GLOBAL_CONST': u32 | 2222 | [163; 164) 'z': u32 |
2145 | [189; 191) 'id': u32 | 2223 | [167; 179) 'GLOBAL_CONST': u32 |
2146 | [194; 210) 'Foo::A..._CONST': u32 | 2224 | [189; 191) 'id': u32 |
2147 | [126; 128) '99': u32"### | 2225 | [194; 210) 'Foo::A..._CONST': u32 |
2226 | [126; 128) '99': u32 | ||
2227 | "### | ||
2148 | ); | 2228 | ); |
2149 | } | 2229 | } |
2150 | 2230 | ||
2151 | #[test] | 2231 | #[test] |
2152 | fn infer_static() { | 2232 | fn infer_static() { |
2153 | assert_snapshot_matches!( | 2233 | assert_snapshot!( |
2154 | infer(r#" | 2234 | infer(r#" |
2155 | static GLOBAL_STATIC: u32 = 101; | 2235 | static GLOBAL_STATIC: u32 = 101; |
2156 | static mut GLOBAL_STATIC_MUT: u32 = 101; | 2236 | static mut GLOBAL_STATIC_MUT: u32 = 101; |
@@ -2164,26 +2244,28 @@ fn test() { | |||
2164 | } | 2244 | } |
2165 | "#), | 2245 | "#), |
2166 | @r###" | 2246 | @r###" |
2167 | [29; 32) '101': u32 | 2247 | |
2168 | [70; 73) '101': u32 | 2248 | [29; 32) '101': u32 |
2169 | [85; 280) '{ ...MUT; }': () | 2249 | [70; 73) '101': u32 |
2170 | [173; 174) 'x': {unknown} | 2250 | [85; 280) '{ ...MUT; }': () |
2171 | [177; 189) 'LOCAL_STATIC': {unknown} | 2251 | [173; 174) 'x': {unknown} |
2172 | [199; 200) 'y': {unknown} | 2252 | [177; 189) 'LOCAL_STATIC': {unknown} |
2173 | [203; 219) 'LOCAL_...IC_MUT': {unknown} | 2253 | [199; 200) 'y': {unknown} |
2174 | [229; 230) 'z': u32 | 2254 | [203; 219) 'LOCAL_...IC_MUT': {unknown} |
2175 | [233; 246) 'GLOBAL_STATIC': u32 | 2255 | [229; 230) 'z': u32 |
2176 | [256; 257) 'w': u32 | 2256 | [233; 246) 'GLOBAL_STATIC': u32 |
2177 | [260; 277) 'GLOBAL...IC_MUT': u32 | 2257 | [256; 257) 'w': u32 |
2178 | [118; 120) '99': u32 | 2258 | [260; 277) 'GLOBAL...IC_MUT': u32 |
2179 | [161; 163) '99': u32"### | 2259 | [118; 120) '99': u32 |
2260 | [161; 163) '99': u32 | ||
2261 | "### | ||
2180 | ); | 2262 | ); |
2181 | } | 2263 | } |
2182 | 2264 | ||
2183 | #[test] | 2265 | #[test] |
2184 | fn infer_trait_method_simple() { | 2266 | fn infer_trait_method_simple() { |
2185 | // the trait implementation is intentionally incomplete -- it shouldn't matter | 2267 | // the trait implementation is intentionally incomplete -- it shouldn't matter |
2186 | assert_snapshot_matches!( | 2268 | assert_snapshot!( |
2187 | infer(r#" | 2269 | infer(r#" |
2188 | trait Trait1 { | 2270 | trait Trait1 { |
2189 | fn method(&self) -> u32; | 2271 | fn method(&self) -> u32; |
@@ -2201,20 +2283,22 @@ fn test() { | |||
2201 | } | 2283 | } |
2202 | "#), | 2284 | "#), |
2203 | @r###" | 2285 | @r###" |
2204 | [31; 35) 'self': &Self | 2286 | |
2205 | [110; 114) 'self': &Self | 2287 | [31; 35) 'self': &Self |
2206 | [170; 228) '{ ...i128 }': () | 2288 | [110; 114) 'self': &Self |
2207 | [176; 178) 'S1': S1 | 2289 | [170; 228) '{ ...i128 }': () |
2208 | [176; 187) 'S1.method()': u32 | 2290 | [176; 178) 'S1': S1 |
2209 | [203; 205) 'S2': S2 | 2291 | [176; 187) 'S1.method()': u32 |
2210 | [203; 214) 'S2.method()': i128"### | 2292 | [203; 205) 'S2': S2 |
2293 | [203; 214) 'S2.method()': i128 | ||
2294 | "### | ||
2211 | ); | 2295 | ); |
2212 | } | 2296 | } |
2213 | 2297 | ||
2214 | #[test] | 2298 | #[test] |
2215 | fn infer_trait_method_scoped() { | 2299 | fn infer_trait_method_scoped() { |
2216 | // the trait implementation is intentionally incomplete -- it shouldn't matter | 2300 | // the trait implementation is intentionally incomplete -- it shouldn't matter |
2217 | assert_snapshot_matches!( | 2301 | assert_snapshot!( |
2218 | infer(r#" | 2302 | infer(r#" |
2219 | struct S; | 2303 | struct S; |
2220 | mod foo { | 2304 | mod foo { |
@@ -2247,21 +2331,23 @@ mod bar_test { | |||
2247 | } | 2331 | } |
2248 | "#), | 2332 | "#), |
2249 | @r###" | 2333 | @r###" |
2250 | [63; 67) 'self': &Self | 2334 | |
2251 | [169; 173) 'self': &Self | 2335 | [63; 67) 'self': &Self |
2252 | [300; 337) '{ ... }': () | 2336 | [169; 173) 'self': &Self |
2253 | [310; 311) 'S': S | 2337 | [300; 337) '{ ... }': () |
2254 | [310; 320) 'S.method()': u32 | 2338 | [310; 311) 'S': S |
2255 | [416; 454) '{ ... }': () | 2339 | [310; 320) 'S.method()': u32 |
2256 | [426; 427) 'S': S | 2340 | [416; 454) '{ ... }': () |
2257 | [426; 436) 'S.method()': i128"### | 2341 | [426; 427) 'S': S |
2342 | [426; 436) 'S.method()': i128 | ||
2343 | "### | ||
2258 | ); | 2344 | ); |
2259 | } | 2345 | } |
2260 | 2346 | ||
2261 | #[test] | 2347 | #[test] |
2262 | fn infer_trait_method_generic_1() { | 2348 | fn infer_trait_method_generic_1() { |
2263 | // the trait implementation is intentionally incomplete -- it shouldn't matter | 2349 | // the trait implementation is intentionally incomplete -- it shouldn't matter |
2264 | assert_snapshot_matches!( | 2350 | assert_snapshot!( |
2265 | infer(r#" | 2351 | infer(r#" |
2266 | trait Trait<T> { | 2352 | trait Trait<T> { |
2267 | fn method(&self) -> T; | 2353 | fn method(&self) -> T; |
@@ -2273,17 +2359,19 @@ fn test() { | |||
2273 | } | 2359 | } |
2274 | "#), | 2360 | "#), |
2275 | @r###" | 2361 | @r###" |
2276 | [33; 37) 'self': &Self | 2362 | |
2277 | [92; 111) '{ ...d(); }': () | 2363 | [33; 37) 'self': &Self |
2278 | [98; 99) 'S': S | 2364 | [92; 111) '{ ...d(); }': () |
2279 | [98; 108) 'S.method()': u32"### | 2365 | [98; 99) 'S': S |
2366 | [98; 108) 'S.method()': u32 | ||
2367 | "### | ||
2280 | ); | 2368 | ); |
2281 | } | 2369 | } |
2282 | 2370 | ||
2283 | #[test] | 2371 | #[test] |
2284 | fn infer_trait_method_generic_more_params() { | 2372 | fn infer_trait_method_generic_more_params() { |
2285 | // the trait implementation is intentionally incomplete -- it shouldn't matter | 2373 | // the trait implementation is intentionally incomplete -- it shouldn't matter |
2286 | assert_snapshot_matches!( | 2374 | assert_snapshot!( |
2287 | infer(r#" | 2375 | infer(r#" |
2288 | trait Trait<T1, T2, T3> { | 2376 | trait Trait<T1, T2, T3> { |
2289 | fn method1(&self) -> (T1, T2, T3); | 2377 | fn method1(&self) -> (T1, T2, T3); |
@@ -2301,24 +2389,26 @@ fn test() { | |||
2301 | } | 2389 | } |
2302 | "#), | 2390 | "#), |
2303 | @r###" | 2391 | @r###" |
2304 | [43; 47) 'self': &Self | 2392 | |
2305 | [82; 86) 'self': &Self | 2393 | [43; 47) 'self': &Self |
2306 | [210; 361) '{ ..., i8 }': () | 2394 | [82; 86) 'self': &Self |
2307 | [216; 218) 'S1': S1 | 2395 | [210; 361) '{ ..., i8 }': () |
2308 | [216; 228) 'S1.method1()': (u8, u16, u32) | 2396 | [216; 218) 'S1': S1 |
2309 | [250; 252) 'S1': S1 | 2397 | [216; 228) 'S1.method1()': (u8, u16, u32) |
2310 | [250; 262) 'S1.method2()': (u32, u16, u8) | 2398 | [250; 252) 'S1': S1 |
2311 | [284; 286) 'S2': S2 | 2399 | [250; 262) 'S1.method2()': (u32, u16, u8) |
2312 | [284; 296) 'S2.method1()': (i8, i16, {unknown}) | 2400 | [284; 286) 'S2': S2 |
2313 | [324; 326) 'S2': S2 | 2401 | [284; 296) 'S2.method1()': (i8, i16, {unknown}) |
2314 | [324; 336) 'S2.method2()': ({unknown}, i16, i8)"### | 2402 | [324; 326) 'S2': S2 |
2403 | [324; 336) 'S2.method2()': ({unknown}, i16, i8) | ||
2404 | "### | ||
2315 | ); | 2405 | ); |
2316 | } | 2406 | } |
2317 | 2407 | ||
2318 | #[test] | 2408 | #[test] |
2319 | fn infer_trait_method_generic_2() { | 2409 | fn infer_trait_method_generic_2() { |
2320 | // the trait implementation is intentionally incomplete -- it shouldn't matter | 2410 | // the trait implementation is intentionally incomplete -- it shouldn't matter |
2321 | assert_snapshot_matches!( | 2411 | assert_snapshot!( |
2322 | infer(r#" | 2412 | infer(r#" |
2323 | trait Trait<T> { | 2413 | trait Trait<T> { |
2324 | fn method(&self) -> T; | 2414 | fn method(&self) -> T; |
@@ -2330,18 +2420,20 @@ fn test() { | |||
2330 | } | 2420 | } |
2331 | "#), | 2421 | "#), |
2332 | @r###" | 2422 | @r###" |
2333 | [33; 37) 'self': &Self | 2423 | |
2334 | [102; 127) '{ ...d(); }': () | 2424 | [33; 37) 'self': &Self |
2335 | [108; 109) 'S': S<u32>(T) -> S<T> | 2425 | [102; 127) '{ ...d(); }': () |
2336 | [108; 115) 'S(1u32)': S<u32> | 2426 | [108; 109) 'S': S<u32>(T) -> S<T> |
2337 | [108; 124) 'S(1u32...thod()': u32 | 2427 | [108; 115) 'S(1u32)': S<u32> |
2338 | [110; 114) '1u32': u32"### | 2428 | [108; 124) 'S(1u32...thod()': u32 |
2429 | [110; 114) '1u32': u32 | ||
2430 | "### | ||
2339 | ); | 2431 | ); |
2340 | } | 2432 | } |
2341 | 2433 | ||
2342 | #[test] | 2434 | #[test] |
2343 | fn infer_trait_assoc_method() { | 2435 | fn infer_trait_assoc_method() { |
2344 | assert_snapshot_matches!( | 2436 | assert_snapshot!( |
2345 | infer(r#" | 2437 | infer(r#" |
2346 | trait Default { | 2438 | trait Default { |
2347 | fn default() -> Self; | 2439 | fn default() -> Self; |
@@ -2355,22 +2447,24 @@ fn test() { | |||
2355 | } | 2447 | } |
2356 | "#), | 2448 | "#), |
2357 | @r###" | 2449 | @r###" |
2358 | [87; 193) '{ ...t(); }': () | 2450 | |
2359 | [97; 99) 's1': S | 2451 | [87; 193) '{ ...t(); }': () |
2360 | [105; 121) 'Defaul...efault': {unknown} | 2452 | [97; 99) 's1': S |
2361 | [105; 123) 'Defaul...ault()': S | 2453 | [105; 121) 'Defaul...efault': {unknown} |
2362 | [133; 135) 's2': {unknown} | 2454 | [105; 123) 'Defaul...ault()': S |
2363 | [138; 148) 'S::default': {unknown} | 2455 | [133; 135) 's2': {unknown} |
2364 | [138; 150) 'S::default()': {unknown} | 2456 | [138; 148) 'S::default': {unknown} |
2365 | [160; 162) 's3': {unknown} | 2457 | [138; 150) 'S::default()': {unknown} |
2366 | [165; 188) '<S as ...efault': {unknown} | 2458 | [160; 162) 's3': {unknown} |
2367 | [165; 190) '<S as ...ault()': {unknown}"### | 2459 | [165; 188) '<S as ...efault': {unknown} |
2460 | [165; 190) '<S as ...ault()': {unknown} | ||
2461 | "### | ||
2368 | ); | 2462 | ); |
2369 | } | 2463 | } |
2370 | 2464 | ||
2371 | #[test] | 2465 | #[test] |
2372 | fn infer_from_bound_1() { | 2466 | fn infer_from_bound_1() { |
2373 | assert_snapshot_matches!( | 2467 | assert_snapshot!( |
2374 | infer(r#" | 2468 | infer(r#" |
2375 | trait Trait<T> {} | 2469 | trait Trait<T> {} |
2376 | struct S<T>(T); | 2470 | struct S<T>(T); |
@@ -2382,24 +2476,23 @@ fn test() { | |||
2382 | } | 2476 | } |
2383 | "#), | 2477 | "#), |
2384 | @r###" | 2478 | @r###" |
2385 | ⋮ | 2479 | [86; 87) 't': T |
2386 | ⋮[86; 87) 't': T | 2480 | [92; 94) '{}': () |
2387 | ⋮[92; 94) '{}': () | 2481 | [105; 144) '{ ...(s); }': () |
2388 | ⋮[105; 144) '{ ...(s); }': () | 2482 | [115; 116) 's': S<u32> |
2389 | ⋮[115; 116) 's': S<u32> | 2483 | [119; 120) 'S': S<u32>(T) -> S<T> |
2390 | ⋮[119; 120) 'S': S<u32>(T) -> S<T> | 2484 | [119; 129) 'S(unknown)': S<u32> |
2391 | ⋮[119; 129) 'S(unknown)': S<u32> | 2485 | [121; 128) 'unknown': u32 |
2392 | ⋮[121; 128) 'unknown': u32 | 2486 | [135; 138) 'foo': fn foo<S<u32>>(T) -> () |
2393 | ⋮[135; 138) 'foo': fn foo<S<u32>>(T) -> () | 2487 | [135; 141) 'foo(s)': () |
2394 | ⋮[135; 141) 'foo(s)': () | 2488 | [139; 140) 's': S<u32> |
2395 | ⋮[139; 140) 's': S<u32> | ||
2396 | "### | 2489 | "### |
2397 | ); | 2490 | ); |
2398 | } | 2491 | } |
2399 | 2492 | ||
2400 | #[test] | 2493 | #[test] |
2401 | fn infer_from_bound_2() { | 2494 | fn infer_from_bound_2() { |
2402 | assert_snapshot_matches!( | 2495 | assert_snapshot!( |
2403 | infer(r#" | 2496 | infer(r#" |
2404 | trait Trait<T> {} | 2497 | trait Trait<T> {} |
2405 | struct S<T>(T); | 2498 | struct S<T>(T); |
@@ -2411,25 +2504,24 @@ fn test() { | |||
2411 | } | 2504 | } |
2412 | "#), | 2505 | "#), |
2413 | @r###" | 2506 | @r###" |
2414 | ⋮ | 2507 | [87; 88) 't': T |
2415 | ⋮[87; 88) 't': T | 2508 | [98; 100) '{}': () |
2416 | ⋮[98; 100) '{}': () | 2509 | [111; 163) '{ ...(s); }': () |
2417 | ⋮[111; 163) '{ ...(s); }': () | 2510 | [121; 122) 's': S<u32> |
2418 | ⋮[121; 122) 's': S<u32> | 2511 | [125; 126) 'S': S<u32>(T) -> S<T> |
2419 | ⋮[125; 126) 'S': S<u32>(T) -> S<T> | 2512 | [125; 135) 'S(unknown)': S<u32> |
2420 | ⋮[125; 135) 'S(unknown)': S<u32> | 2513 | [127; 134) 'unknown': u32 |
2421 | ⋮[127; 134) 'unknown': u32 | 2514 | [145; 146) 'x': u32 |
2422 | ⋮[145; 146) 'x': u32 | 2515 | [154; 157) 'foo': fn foo<u32, S<u32>>(T) -> U |
2423 | ⋮[154; 157) 'foo': fn foo<u32, S<u32>>(T) -> U | 2516 | [154; 160) 'foo(s)': u32 |
2424 | ⋮[154; 160) 'foo(s)': u32 | 2517 | [158; 159) 's': S<u32> |
2425 | ⋮[158; 159) 's': S<u32> | ||
2426 | "### | 2518 | "### |
2427 | ); | 2519 | ); |
2428 | } | 2520 | } |
2429 | 2521 | ||
2430 | #[test] | 2522 | #[test] |
2431 | fn infer_call_trait_method_on_generic_param_1() { | 2523 | fn infer_call_trait_method_on_generic_param_1() { |
2432 | assert_snapshot_matches!( | 2524 | assert_snapshot!( |
2433 | infer(r#" | 2525 | infer(r#" |
2434 | trait Trait { | 2526 | trait Trait { |
2435 | fn method() -> u32; | 2527 | fn method() -> u32; |
@@ -2439,16 +2531,18 @@ fn test<T: Trait>(t: T) { | |||
2439 | } | 2531 | } |
2440 | "#), | 2532 | "#), |
2441 | @r###" | 2533 | @r###" |
2442 | [59; 60) 't': T | 2534 | |
2443 | [65; 84) '{ ...d(); }': () | 2535 | [59; 60) 't': T |
2444 | [71; 72) 't': T | 2536 | [65; 84) '{ ...d(); }': () |
2445 |