diff options
36 files changed, 118 insertions, 134 deletions
diff --git a/Cargo.lock b/Cargo.lock index efc17c430..18c979b39 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -16,15 +16,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
16 | checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" | 16 | checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" |
17 | 17 | ||
18 | [[package]] | 18 | [[package]] |
19 | name = "aho-corasick" | ||
20 | version = "0.7.13" | ||
21 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
22 | checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" | ||
23 | dependencies = [ | ||
24 | "memchr", | ||
25 | ] | ||
26 | |||
27 | [[package]] | ||
28 | name = "ansi_term" | 19 | name = "ansi_term" |
29 | version = "0.12.1" | 20 | version = "0.12.1" |
30 | source = "registry+https://github.com/rust-lang/crates.io-index" | 21 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -122,6 +113,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
122 | checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" | 113 | checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" |
123 | 114 | ||
124 | [[package]] | 115 | [[package]] |
116 | name = "cfg" | ||
117 | version = "0.0.0" | ||
118 | dependencies = [ | ||
119 | "mbe", | ||
120 | "rustc-hash", | ||
121 | "syntax", | ||
122 | "tt", | ||
123 | ] | ||
124 | |||
125 | [[package]] | ||
125 | name = "cfg-if" | 126 | name = "cfg-if" |
126 | version = "0.1.10" | 127 | version = "0.1.10" |
127 | source = "registry+https://github.com/rust-lang/crates.io-index" | 128 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -289,9 +290,9 @@ checksum = "9bda8e21c04aca2ae33ffc2fd8c23134f3cac46db123ba97bd9d3f3b8a4a85e1" | |||
289 | 290 | ||
290 | [[package]] | 291 | [[package]] |
291 | name = "either" | 292 | name = "either" |
292 | version = "1.5.3" | 293 | version = "1.6.0" |
293 | source = "registry+https://github.com/rust-lang/crates.io-index" | 294 | source = "registry+https://github.com/rust-lang/crates.io-index" |
294 | checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" | 295 | checksum = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f" |
295 | 296 | ||
296 | [[package]] | 297 | [[package]] |
297 | name = "ena" | 298 | name = "ena" |
@@ -551,9 +552,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" | |||
551 | 552 | ||
552 | [[package]] | 553 | [[package]] |
553 | name = "lazycell" | 554 | name = "lazycell" |
554 | version = "1.2.1" | 555 | version = "1.3.0" |
555 | source = "registry+https://github.com/rust-lang/crates.io-index" | 556 | source = "registry+https://github.com/rust-lang/crates.io-index" |
556 | checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" | 557 | checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" |
557 | 558 | ||
558 | [[package]] | 559 | [[package]] |
559 | name = "libc" | 560 | name = "libc" |
@@ -645,10 +646,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
645 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" | 646 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" |
646 | 647 | ||
647 | [[package]] | 648 | [[package]] |
648 | name = "memchr" | 649 | name = "mbe" |
649 | version = "2.3.3" | 650 | version = "0.0.0" |
650 | source = "registry+https://github.com/rust-lang/crates.io-index" | 651 | dependencies = [ |
651 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" | 652 | "log", |
653 | "parser", | ||
654 | "rustc-hash", | ||
655 | "smallvec", | ||
656 | "syntax", | ||
657 | "test_utils", | ||
658 | "tt", | ||
659 | ] | ||
652 | 660 | ||
653 | [[package]] | 661 | [[package]] |
654 | name = "memmap" | 662 | name = "memmap" |
@@ -902,6 +910,23 @@ dependencies = [ | |||
902 | ] | 910 | ] |
903 | 911 | ||
904 | [[package]] | 912 | [[package]] |
913 | name = "proc_macro_srv" | ||
914 | version = "0.0.0" | ||
915 | dependencies = [ | ||
916 | "cargo_metadata", | ||
917 | "difference", | ||
918 | "goblin", | ||
919 | "libloading", | ||
920 | "mbe", | ||
921 | "memmap", | ||
922 | "ra_proc_macro", | ||
923 | "serde_derive", | ||
924 | "test_utils", | ||
925 | "toolchain", | ||
926 | "tt", | ||
927 | ] | ||
928 | |||
929 | [[package]] | ||
905 | name = "profile" | 930 | name = "profile" |
906 | version = "0.0.0" | 931 | version = "0.0.0" |
907 | dependencies = [ | 932 | dependencies = [ |
@@ -941,21 +966,11 @@ dependencies = [ | |||
941 | ] | 966 | ] |
942 | 967 | ||
943 | [[package]] | 968 | [[package]] |
944 | name = "ra_cfg" | ||
945 | version = "0.1.0" | ||
946 | dependencies = [ | ||
947 | "ra_mbe", | ||
948 | "rustc-hash", | ||
949 | "syntax", | ||
950 | "tt", | ||
951 | ] | ||
952 | |||
953 | [[package]] | ||
954 | name = "ra_db" | 969 | name = "ra_db" |
955 | version = "0.1.0" | 970 | version = "0.1.0" |
956 | dependencies = [ | 971 | dependencies = [ |
972 | "cfg", | ||
957 | "profile", | 973 | "profile", |
958 | "ra_cfg", | ||
959 | "rustc-hash", | 974 | "rustc-hash", |
960 | "salsa", | 975 | "salsa", |
961 | "stdx", | 976 | "stdx", |
@@ -997,6 +1012,7 @@ version = "0.1.0" | |||
997 | dependencies = [ | 1012 | dependencies = [ |
998 | "anymap", | 1013 | "anymap", |
999 | "arena", | 1014 | "arena", |
1015 | "cfg", | ||
1000 | "drop_bomb", | 1016 | "drop_bomb", |
1001 | "either", | 1017 | "either", |
1002 | "expect", | 1018 | "expect", |
@@ -1004,12 +1020,11 @@ dependencies = [ | |||
1004 | "indexmap", | 1020 | "indexmap", |
1005 | "itertools", | 1021 | "itertools", |
1006 | "log", | 1022 | "log", |
1023 | "mbe", | ||
1007 | "once_cell", | 1024 | "once_cell", |
1008 | "profile", | 1025 | "profile", |
1009 | "ra_cfg", | ||
1010 | "ra_db", | 1026 | "ra_db", |
1011 | "ra_hir_expand", | 1027 | "ra_hir_expand", |
1012 | "ra_mbe", | ||
1013 | "rustc-hash", | 1028 | "rustc-hash", |
1014 | "smallvec", | 1029 | "smallvec", |
1015 | "stdx", | 1030 | "stdx", |
@@ -1025,10 +1040,10 @@ dependencies = [ | |||
1025 | "arena", | 1040 | "arena", |
1026 | "either", | 1041 | "either", |
1027 | "log", | 1042 | "log", |
1043 | "mbe", | ||
1028 | "parser", | 1044 | "parser", |
1029 | "profile", | 1045 | "profile", |
1030 | "ra_db", | 1046 | "ra_db", |
1031 | "ra_mbe", | ||
1032 | "rustc-hash", | 1047 | "rustc-hash", |
1033 | "syntax", | 1048 | "syntax", |
1034 | "test_utils", | 1049 | "test_utils", |
@@ -1067,6 +1082,7 @@ dependencies = [ | |||
1067 | name = "ra_ide" | 1082 | name = "ra_ide" |
1068 | version = "0.1.0" | 1083 | version = "0.1.0" |
1069 | dependencies = [ | 1084 | dependencies = [ |
1085 | "cfg", | ||
1070 | "either", | 1086 | "either", |
1071 | "expect", | 1087 | "expect", |
1072 | "indexmap", | 1088 | "indexmap", |
@@ -1075,7 +1091,6 @@ dependencies = [ | |||
1075 | "oorandom", | 1091 | "oorandom", |
1076 | "profile", | 1092 | "profile", |
1077 | "ra_assists", | 1093 | "ra_assists", |
1078 | "ra_cfg", | ||
1079 | "ra_db", | 1094 | "ra_db", |
1080 | "ra_fmt", | 1095 | "ra_fmt", |
1081 | "ra_hir", | 1096 | "ra_hir", |
@@ -1108,19 +1123,6 @@ dependencies = [ | |||
1108 | ] | 1123 | ] |
1109 | 1124 | ||
1110 | [[package]] | 1125 | [[package]] |
1111 | name = "ra_mbe" | ||
1112 | version = "0.1.0" | ||
1113 | dependencies = [ | ||
1114 | "log", | ||
1115 | "parser", | ||
1116 | "rustc-hash", | ||
1117 | "smallvec", | ||
1118 | "syntax", | ||
1119 | "test_utils", | ||
1120 | "tt", | ||
1121 | ] | ||
1122 | |||
1123 | [[package]] | ||
1124 | name = "ra_proc_macro" | 1126 | name = "ra_proc_macro" |
1125 | version = "0.1.0" | 1127 | version = "0.1.0" |
1126 | dependencies = [ | 1128 | dependencies = [ |
@@ -1133,32 +1135,15 @@ dependencies = [ | |||
1133 | ] | 1135 | ] |
1134 | 1136 | ||
1135 | [[package]] | 1137 | [[package]] |
1136 | name = "proc_macro_srv" | ||
1137 | version = "0.0.0" | ||
1138 | dependencies = [ | ||
1139 | "cargo_metadata", | ||
1140 | "difference", | ||
1141 | "goblin", | ||
1142 | "libloading", | ||
1143 | "memmap", | ||
1144 | "ra_mbe", | ||
1145 | "ra_proc_macro", | ||
1146 | "serde_derive", | ||
1147 | "test_utils", | ||
1148 | "toolchain", | ||
1149 | "tt", | ||
1150 | ] | ||
1151 | |||
1152 | [[package]] | ||
1153 | name = "ra_project_model" | 1138 | name = "ra_project_model" |
1154 | version = "0.1.0" | 1139 | version = "0.1.0" |
1155 | dependencies = [ | 1140 | dependencies = [ |
1156 | "anyhow", | 1141 | "anyhow", |
1157 | "arena", | 1142 | "arena", |
1158 | "cargo_metadata", | 1143 | "cargo_metadata", |
1144 | "cfg", | ||
1159 | "log", | 1145 | "log", |
1160 | "paths", | 1146 | "paths", |
1161 | "ra_cfg", | ||
1162 | "ra_db", | 1147 | "ra_db", |
1163 | "ra_proc_macro", | 1148 | "ra_proc_macro", |
1164 | "rustc-hash", | 1149 | "rustc-hash", |
@@ -1219,10 +1204,7 @@ version = "1.3.9" | |||
1219 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1204 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1220 | checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" | 1205 | checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" |
1221 | dependencies = [ | 1206 | dependencies = [ |
1222 | "aho-corasick", | ||
1223 | "memchr", | ||
1224 | "regex-syntax", | 1207 | "regex-syntax", |
1225 | "thread_local", | ||
1226 | ] | 1208 | ] |
1227 | 1209 | ||
1228 | [[package]] | 1210 | [[package]] |
@@ -1258,6 +1240,7 @@ name = "rust-analyzer" | |||
1258 | version = "0.1.0" | 1240 | version = "0.1.0" |
1259 | dependencies = [ | 1241 | dependencies = [ |
1260 | "anyhow", | 1242 | "anyhow", |
1243 | "cfg", | ||
1261 | "crossbeam-channel", | 1244 | "crossbeam-channel", |
1262 | "env_logger", | 1245 | "env_logger", |
1263 | "expect", | 1246 | "expect", |
@@ -1267,20 +1250,19 @@ dependencies = [ | |||
1267 | "log", | 1250 | "log", |
1268 | "lsp-server", | 1251 | "lsp-server", |
1269 | "lsp-types", | 1252 | "lsp-types", |
1253 | "mbe", | ||
1270 | "mimalloc", | 1254 | "mimalloc", |
1271 | "oorandom", | 1255 | "oorandom", |
1272 | "parking_lot", | 1256 | "parking_lot", |
1273 | "pico-args", | 1257 | "pico-args", |
1258 | "proc_macro_srv", | ||
1274 | "profile", | 1259 | "profile", |
1275 | "ra_cfg", | ||
1276 | "ra_db", | 1260 | "ra_db", |
1277 | "ra_hir", | 1261 | "ra_hir", |
1278 | "ra_hir_def", | 1262 | "ra_hir_def", |
1279 | "ra_hir_ty", | 1263 | "ra_hir_ty", |
1280 | "ra_ide", | 1264 | "ra_ide", |
1281 | "ra_ide_db", | 1265 | "ra_ide_db", |
1282 | "ra_mbe", | ||
1283 | "proc_macro_srv", | ||
1284 | "ra_project_model", | 1266 | "ra_project_model", |
1285 | "ra_ssr", | 1267 | "ra_ssr", |
1286 | "rayon", | 1268 | "rayon", |
@@ -1414,18 +1396,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" | |||
1414 | 1396 | ||
1415 | [[package]] | 1397 | [[package]] |
1416 | name = "serde" | 1398 | name = "serde" |
1417 | version = "1.0.114" | 1399 | version = "1.0.115" |
1418 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1419 | checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" | 1401 | checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5" |
1420 | dependencies = [ | 1402 | dependencies = [ |
1421 | "serde_derive", | 1403 | "serde_derive", |
1422 | ] | 1404 | ] |
1423 | 1405 | ||
1424 | [[package]] | 1406 | [[package]] |
1425 | name = "serde_derive" | 1407 | name = "serde_derive" |
1426 | version = "1.0.114" | 1408 | version = "1.0.115" |
1427 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1409 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1428 | checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" | 1410 | checksum = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48" |
1429 | dependencies = [ | 1411 | dependencies = [ |
1430 | "proc-macro2", | 1412 | "proc-macro2", |
1431 | "quote", | 1413 | "quote", |
@@ -1471,9 +1453,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" | |||
1471 | 1453 | ||
1472 | [[package]] | 1454 | [[package]] |
1473 | name = "smallvec" | 1455 | name = "smallvec" |
1474 | version = "1.4.1" | 1456 | version = "1.4.2" |
1475 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1457 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1476 | checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" | 1458 | checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" |
1477 | 1459 | ||
1478 | [[package]] | 1460 | [[package]] |
1479 | name = "smol_str" | 1461 | name = "smol_str" |
@@ -1614,9 +1596,9 @@ dependencies = [ | |||
1614 | 1596 | ||
1615 | [[package]] | 1597 | [[package]] |
1616 | name = "tracing" | 1598 | name = "tracing" |
1617 | version = "0.1.18" | 1599 | version = "0.1.19" |
1618 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1619 | checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178" | 1601 | checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" |
1620 | dependencies = [ | 1602 | dependencies = [ |
1621 | "cfg-if", | 1603 | "cfg-if", |
1622 | "tracing-attributes", | 1604 | "tracing-attributes", |
@@ -1625,9 +1607,9 @@ dependencies = [ | |||
1625 | 1607 | ||
1626 | [[package]] | 1608 | [[package]] |
1627 | name = "tracing-attributes" | 1609 | name = "tracing-attributes" |
1628 | version = "0.1.9" | 1610 | version = "0.1.10" |
1629 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1611 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1630 | checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b" | 1612 | checksum = "1fe233f4227389ab7df5b32649239da7ebe0b281824b4e84b342d04d3fd8c25e" |
1631 | dependencies = [ | 1613 | dependencies = [ |
1632 | "proc-macro2", | 1614 | "proc-macro2", |
1633 | "quote", | 1615 | "quote", |
@@ -1636,9 +1618,9 @@ dependencies = [ | |||
1636 | 1618 | ||
1637 | [[package]] | 1619 | [[package]] |
1638 | name = "tracing-core" | 1620 | name = "tracing-core" |
1639 | version = "0.1.13" | 1621 | version = "0.1.14" |
1640 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1622 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1641 | checksum = "d593f98af59ebc017c0648f0117525db358745a8894a8d684e185ba3f45954f9" | 1623 | checksum = "db63662723c316b43ca36d833707cc93dff82a02ba3d7e354f342682cc8b3545" |
1642 | dependencies = [ | 1624 | dependencies = [ |
1643 | "lazy_static", | 1625 | "lazy_static", |
1644 | ] | 1626 | ] |
@@ -1666,9 +1648,9 @@ dependencies = [ | |||
1666 | 1648 | ||
1667 | [[package]] | 1649 | [[package]] |
1668 | name = "tracing-subscriber" | 1650 | name = "tracing-subscriber" |
1669 | version = "0.2.10" | 1651 | version = "0.2.11" |
1670 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1652 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1671 | checksum = "f7b33f8b2ef2ab0c3778c12646d9c42a24f7772bee4cdafc72199644a9f58fdc" | 1653 | checksum = "abd165311cc4d7a555ad11cc77a37756df836182db0d81aac908c8184c584f40" |
1672 | dependencies = [ | 1654 | dependencies = [ |
1673 | "ansi_term", | 1655 | "ansi_term", |
1674 | "chrono", | 1656 | "chrono", |
@@ -1679,6 +1661,7 @@ dependencies = [ | |||
1679 | "serde_json", | 1661 | "serde_json", |
1680 | "sharded-slab", | 1662 | "sharded-slab", |
1681 | "smallvec", | 1663 | "smallvec", |
1664 | "thread_local", | ||
1682 | "tracing-core", | 1665 | "tracing-core", |
1683 | "tracing-log", | 1666 | "tracing-log", |
1684 | "tracing-serde", | 1667 | "tracing-serde", |
diff --git a/crates/ra_cfg/Cargo.toml b/crates/cfg/Cargo.toml index cb0d2b9d7..d2ea551d1 100644 --- a/crates/ra_cfg/Cargo.toml +++ b/crates/cfg/Cargo.toml | |||
@@ -1,9 +1,9 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | name = "cfg" |
3 | name = "ra_cfg" | 3 | version = "0.0.0" |
4 | version = "0.1.0" | ||
5 | authors = ["rust-analyzer developers"] | ||
6 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
@@ -11,8 +11,8 @@ doctest = false | |||
11 | [dependencies] | 11 | [dependencies] |
12 | rustc-hash = "1.1.0" | 12 | rustc-hash = "1.1.0" |
13 | 13 | ||
14 | syntax = { path = "../syntax" } | ||
15 | tt = { path = "../tt" } | 14 | tt = { path = "../tt" } |
16 | 15 | ||
17 | [dev-dependencies] | 16 | [dev-dependencies] |
18 | mbe = { path = "../ra_mbe", package = "ra_mbe" } | 17 | mbe = { path = "../mbe" } |
18 | syntax = { path = "../syntax" } | ||
diff --git a/crates/ra_cfg/src/cfg_expr.rs b/crates/cfg/src/cfg_expr.rs index 940091465..336fe25bc 100644 --- a/crates/ra_cfg/src/cfg_expr.rs +++ b/crates/cfg/src/cfg_expr.rs | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | use std::slice::Iter as SliceIter; | 5 | use std::slice::Iter as SliceIter; |
6 | 6 | ||
7 | use syntax::SmolStr; | 7 | use tt::SmolStr; |
8 | 8 | ||
9 | #[derive(Debug, Clone, PartialEq, Eq)] | 9 | #[derive(Debug, Clone, PartialEq, Eq)] |
10 | pub enum CfgExpr { | 10 | pub enum CfgExpr { |
@@ -86,17 +86,15 @@ fn next_cfg_expr(it: &mut SliceIter<tt::TokenTree>) -> Option<CfgExpr> { | |||
86 | mod tests { | 86 | mod tests { |
87 | use super::*; | 87 | use super::*; |
88 | 88 | ||
89 | use mbe::{ast_to_token_tree, TokenMap}; | 89 | use mbe::ast_to_token_tree; |
90 | use syntax::ast::{self, AstNode}; | 90 | use syntax::ast::{self, AstNode}; |
91 | 91 | ||
92 | fn get_token_tree_generated(input: &str) -> (tt::Subtree, TokenMap) { | ||
93 | let source_file = ast::SourceFile::parse(input).ok().unwrap(); | ||
94 | let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap(); | ||
95 | ast_to_token_tree(&tt).unwrap() | ||
96 | } | ||
97 | |||
98 | fn assert_parse_result(input: &str, expected: CfgExpr) { | 92 | fn assert_parse_result(input: &str, expected: CfgExpr) { |
99 | let (tt, _) = get_token_tree_generated(input); | 93 | let (tt, _) = { |
94 | let source_file = ast::SourceFile::parse(input).ok().unwrap(); | ||
95 | let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap(); | ||
96 | ast_to_token_tree(&tt).unwrap() | ||
97 | }; | ||
100 | let cfg = CfgExpr::parse(&tt); | 98 | let cfg = CfgExpr::parse(&tt); |
101 | assert_eq!(cfg, expected); | 99 | assert_eq!(cfg, expected); |
102 | } | 100 | } |
diff --git a/crates/ra_cfg/src/lib.rs b/crates/cfg/src/lib.rs index 7e025143b..a9d50e698 100644 --- a/crates/ra_cfg/src/lib.rs +++ b/crates/cfg/src/lib.rs | |||
@@ -1,9 +1,9 @@ | |||
1 | //! ra_cfg defines conditional compiling options, `cfg` attibute parser and evaluator | 1 | //! cfg defines conditional compiling options, `cfg` attibute parser and evaluator |
2 | 2 | ||
3 | mod cfg_expr; | 3 | mod cfg_expr; |
4 | 4 | ||
5 | use rustc_hash::FxHashSet; | 5 | use rustc_hash::FxHashSet; |
6 | use syntax::SmolStr; | 6 | use tt::SmolStr; |
7 | 7 | ||
8 | pub use cfg_expr::CfgExpr; | 8 | pub use cfg_expr::CfgExpr; |
9 | 9 | ||
diff --git a/crates/ra_mbe/Cargo.toml b/crates/mbe/Cargo.toml index 4a4be65eb..1aba8b7c4 100644 --- a/crates/ra_mbe/Cargo.toml +++ b/crates/mbe/Cargo.toml | |||
@@ -1,20 +1,21 @@ | |||
1 | [package] | 1 | [package] |
2 | edition = "2018" | 2 | name = "mbe" |
3 | name = "ra_mbe" | 3 | version = "0.0.0" |
4 | version = "0.1.0" | ||
5 | authors = ["rust-analyzer developers"] | ||
6 | license = "MIT OR Apache-2.0" | 4 | license = "MIT OR Apache-2.0" |
5 | authors = ["rust-analyzer developers"] | ||
6 | edition = "2018" | ||
7 | 7 | ||
8 | [lib] | 8 | [lib] |
9 | doctest = false | 9 | doctest = false |
10 | 10 | ||
11 | [dependencies] | 11 | [dependencies] |
12 | syntax = { path = "../syntax" } | ||
13 | parser = { path = "../parser" } | ||
14 | tt = { path = "../tt" } | ||
15 | rustc-hash = "1.1.0" | 12 | rustc-hash = "1.1.0" |
16 | smallvec = "1.2.0" | 13 | smallvec = "1.2.0" |
17 | log = "0.4.8" | 14 | log = "0.4.8" |
18 | 15 | ||
16 | syntax = { path = "../syntax" } | ||
17 | parser = { path = "../parser" } | ||
18 | tt = { path = "../tt" } | ||
19 | |||
19 | [dev-dependencies] | 20 | [dev-dependencies] |
20 | test_utils = { path = "../test_utils" } | 21 | test_utils = { path = "../test_utils" } |
diff --git a/crates/ra_mbe/src/lib.rs b/crates/mbe/src/lib.rs index f854ca09a..f854ca09a 100644 --- a/crates/ra_mbe/src/lib.rs +++ b/crates/mbe/src/lib.rs | |||
diff --git a/crates/ra_mbe/src/mbe_expander.rs b/crates/mbe/src/mbe_expander.rs index 1ad8b9f8a..1ad8b9f8a 100644 --- a/crates/ra_mbe/src/mbe_expander.rs +++ b/crates/mbe/src/mbe_expander.rs | |||
diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/mbe/src/mbe_expander/matcher.rs index b698b9832..b698b9832 100644 --- a/crates/ra_mbe/src/mbe_expander/matcher.rs +++ b/crates/mbe/src/mbe_expander/matcher.rs | |||
diff --git a/crates/ra_mbe/src/mbe_expander/transcriber.rs b/crates/mbe/src/mbe_expander/transcriber.rs index c9525c5bf..c9525c5bf 100644 --- a/crates/ra_mbe/src/mbe_expander/transcriber.rs +++ b/crates/mbe/src/mbe_expander/transcriber.rs | |||
diff --git a/crates/ra_mbe/src/parser.rs b/crates/mbe/src/parser.rs index 6b46a1673..6b46a1673 100644 --- a/crates/ra_mbe/src/parser.rs +++ b/crates/mbe/src/parser.rs | |||
diff --git a/crates/ra_mbe/src/subtree_source.rs b/crates/mbe/src/subtree_source.rs index 41461b315..41461b315 100644 --- a/crates/ra_mbe/src/subtree_source.rs +++ b/crates/mbe/src/subtree_source.rs | |||
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/mbe/src/syntax_bridge.rs index a8ad917fb..a8ad917fb 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/mbe/src/syntax_bridge.rs | |||
diff --git a/crates/ra_mbe/src/tests.rs b/crates/mbe/src/tests.rs index 0796ceee1..0796ceee1 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/mbe/src/tests.rs | |||
diff --git a/crates/ra_mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs index 46c420718..46c420718 100644 --- a/crates/ra_mbe/src/tt_iter.rs +++ b/crates/mbe/src/tt_iter.rs | |||
diff --git a/crates/proc_macro_srv/Cargo.toml b/crates/proc_macro_srv/Cargo.toml index 775af890e..0954ffb66 100644 --- a/crates/proc_macro_srv/Cargo.toml +++ b/crates/proc_macro_srv/Cargo.toml | |||
@@ -9,12 +9,13 @@ edition = "2018" | |||
9 | doctest = false | 9 | doctest = false |
10 | 10 | ||
11 | [dependencies] | 11 | [dependencies] |
12 | tt = { path = "../tt" } | ||
13 | ra_mbe = { path = "../ra_mbe" } | ||
14 | ra_proc_macro = { path = "../ra_proc_macro" } | ||
15 | goblin = "0.2.1" | 12 | goblin = "0.2.1" |
16 | libloading = "0.6.0" | 13 | libloading = "0.6.0" |
17 | memmap = "0.7" | 14 | memmap = "0.7" |
15 | |||
16 | tt = { path = "../tt" } | ||
17 | mbe = { path = "../mbe" } | ||
18 | ra_proc_macro = { path = "../ra_proc_macro" } | ||
18 | test_utils = { path = "../test_utils" } | 19 | test_utils = { path = "../test_utils" } |
19 | 20 | ||
20 | [dev-dependencies] | 21 | [dev-dependencies] |
@@ -22,4 +23,5 @@ cargo_metadata = "0.11.1" | |||
22 | difference = "2.0.0" | 23 | difference = "2.0.0" |
23 | # used as proc macro test target | 24 | # used as proc macro test target |
24 | serde_derive = "1.0.106" | 25 | serde_derive = "1.0.106" |
26 | |||
25 | toolchain = { path = "../toolchain" } | 27 | toolchain = { path = "../toolchain" } |
diff --git a/crates/proc_macro_srv/src/rustc_server.rs b/crates/proc_macro_srv/src/rustc_server.rs index d534d1337..7d1695c86 100644 --- a/crates/proc_macro_srv/src/rustc_server.rs +++ b/crates/proc_macro_srv/src/rustc_server.rs | |||
@@ -182,7 +182,7 @@ pub mod token_stream { | |||
182 | 182 | ||
183 | fn from_str(src: &str) -> Result<TokenStream, LexError> { | 183 | fn from_str(src: &str) -> Result<TokenStream, LexError> { |
184 | let (subtree, _token_map) = | 184 | let (subtree, _token_map) = |
185 | ra_mbe::parse_to_token_tree(src).ok_or("Failed to parse from mbe")?; | 185 | mbe::parse_to_token_tree(src).ok_or("Failed to parse from mbe")?; |
186 | 186 | ||
187 | let tt: tt::TokenTree = subtree.into(); | 187 | let tt: tt::TokenTree = subtree.into(); |
188 | Ok(tt.into()) | 188 | Ok(tt.into()) |
diff --git a/crates/ra_db/Cargo.toml b/crates/ra_db/Cargo.toml index 156ea1ee4..ad432f096 100644 --- a/crates/ra_db/Cargo.toml +++ b/crates/ra_db/Cargo.toml | |||
@@ -13,7 +13,7 @@ salsa = "0.15.2" | |||
13 | rustc-hash = "1.1.0" | 13 | rustc-hash = "1.1.0" |
14 | 14 | ||
15 | syntax = { path = "../syntax" } | 15 | syntax = { path = "../syntax" } |
16 | ra_cfg = { path = "../ra_cfg" } | 16 | cfg = { path = "../cfg" } |
17 | profile = { path = "../profile" } | 17 | profile = { path = "../profile" } |
18 | tt = { path = "../tt" } | 18 | tt = { path = "../tt" } |
19 | test_utils = { path = "../test_utils" } | 19 | test_utils = { path = "../test_utils" } |
diff --git a/crates/ra_db/src/fixture.rs b/crates/ra_db/src/fixture.rs index 2aafb9965..5ff8ead0e 100644 --- a/crates/ra_db/src/fixture.rs +++ b/crates/ra_db/src/fixture.rs | |||
@@ -59,7 +59,7 @@ | |||
59 | //! ``` | 59 | //! ``` |
60 | use std::{str::FromStr, sync::Arc}; | 60 | use std::{str::FromStr, sync::Arc}; |
61 | 61 | ||
62 | use ra_cfg::CfgOptions; | 62 | use cfg::CfgOptions; |
63 | use rustc_hash::FxHashMap; | 63 | use rustc_hash::FxHashMap; |
64 | use test_utils::{extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER}; | 64 | use test_utils::{extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER}; |
65 | use vfs::{file_set::FileSet, VfsPath}; | 65 | use vfs::{file_set::FileSet, VfsPath}; |
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 12a863499..f3d65cdf0 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | use std::{fmt, iter::FromIterator, ops, str::FromStr, sync::Arc}; | 9 | use std::{fmt, iter::FromIterator, ops, str::FromStr, sync::Arc}; |
10 | 10 | ||
11 | use ra_cfg::CfgOptions; | 11 | use cfg::CfgOptions; |
12 | use rustc_hash::{FxHashMap, FxHashSet}; | 12 | use rustc_hash::{FxHashMap, FxHashSet}; |
13 | use syntax::SmolStr; | 13 | use syntax::SmolStr; |
14 | use tt::TokenExpander; | 14 | use tt::TokenExpander; |
diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml index 38129782f..e7d3c4d5b 100644 --- a/crates/ra_hir_def/Cargo.toml +++ b/crates/ra_hir_def/Cargo.toml | |||
@@ -28,8 +28,8 @@ syntax = { path = "../syntax" } | |||
28 | profile = { path = "../profile" } | 28 | profile = { path = "../profile" } |
29 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } | 29 | hir_expand = { path = "../ra_hir_expand", package = "ra_hir_expand" } |
30 | test_utils = { path = "../test_utils" } | 30 | test_utils = { path = "../test_utils" } |
31 | mbe = { path = "../ra_mbe", package = "ra_mbe" } | 31 | mbe = { path = "../mbe" } |
32 | ra_cfg = { path = "../ra_cfg" } | 32 | cfg = { path = "../cfg" } |
33 | tt = { path = "../tt" } | 33 | tt = { path = "../tt" } |
34 | 34 | ||
35 | [dev-dependencies] | 35 | [dev-dependencies] |
diff --git a/crates/ra_hir_def/src/adt.rs b/crates/ra_hir_def/src/adt.rs index c83219d77..d69ff2fc7 100644 --- a/crates/ra_hir_def/src/adt.rs +++ b/crates/ra_hir_def/src/adt.rs | |||
@@ -23,7 +23,7 @@ use crate::{ | |||
23 | EnumId, HasModule, LocalEnumVariantId, LocalFieldId, Lookup, ModuleId, StructId, UnionId, | 23 | EnumId, HasModule, LocalEnumVariantId, LocalFieldId, Lookup, ModuleId, StructId, UnionId, |
24 | VariantId, | 24 | VariantId, |
25 | }; | 25 | }; |
26 | use ra_cfg::CfgOptions; | 26 | use cfg::CfgOptions; |
27 | 27 | ||
28 | /// Note that we use `StructData` for unions as well! | 28 | /// Note that we use `StructData` for unions as well! |
29 | #[derive(Debug, Clone, PartialEq, Eq)] | 29 | #[derive(Debug, Clone, PartialEq, Eq)] |
diff --git a/crates/ra_hir_def/src/attr.rs b/crates/ra_hir_def/src/attr.rs index 36dc8b816..dea552a60 100644 --- a/crates/ra_hir_def/src/attr.rs +++ b/crates/ra_hir_def/src/attr.rs | |||
@@ -2,10 +2,10 @@ | |||
2 | 2 | ||
3 | use std::{ops, sync::Arc}; | 3 | use std::{ops, sync::Arc}; |
4 | 4 | ||
5 | use cfg::{CfgExpr, CfgOptions}; | ||
5 | use either::Either; | 6 | use either::Either; |
6 | use hir_expand::{hygiene::Hygiene, AstId, InFile}; | 7 | use hir_expand::{hygiene::Hygiene, AstId, InFile}; |
7 | use mbe::ast_to_token_tree; | 8 | use mbe::ast_to_token_tree; |
8 | use ra_cfg::{CfgExpr, CfgOptions}; | ||
9 | use syntax::{ | 9 | use syntax::{ |
10 | ast::{self, AstNode, AttrsOwner}, | 10 | ast::{self, AstNode, AttrsOwner}, |
11 | SmolStr, | 11 | SmolStr, |
diff --git a/crates/ra_hir_def/src/body.rs b/crates/ra_hir_def/src/body.rs index 7c33966a7..fe659386a 100644 --- a/crates/ra_hir_def/src/body.rs +++ b/crates/ra_hir_def/src/body.rs | |||
@@ -6,10 +6,10 @@ pub mod scope; | |||
6 | use std::{mem, ops::Index, sync::Arc}; | 6 | use std::{mem, ops::Index, sync::Arc}; |
7 | 7 | ||
8 | use arena::{map::ArenaMap, Arena}; | 8 | use arena::{map::ArenaMap, Arena}; |
9 | use cfg::CfgOptions; | ||
9 | use drop_bomb::DropBomb; | 10 | use drop_bomb::DropBomb; |
10 | use either::Either; | 11 | use either::Either; |
11 | use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; | 12 | use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, AstId, HirFileId, InFile, MacroDefId}; |
12 | use ra_cfg::CfgOptions; | ||
13 | use ra_db::CrateId; | 13 | use ra_db::CrateId; |
14 | use rustc_hash::FxHashMap; | 14 | use rustc_hash::FxHashMap; |
15 | use syntax::{ast, AstNode, AstPtr}; | 15 | use syntax::{ast, AstNode, AstPtr}; |
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index f7270ec91..6a5891936 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -3,6 +3,7 @@ | |||
3 | //! `DefCollector::collect` contains the fixed-point iteration loop which | 3 | //! `DefCollector::collect` contains the fixed-point iteration loop which |
4 | //! resolves imports and expands macros. | 4 | //! resolves imports and expands macros. |
5 | 5 | ||
6 | use cfg::CfgOptions; | ||
6 | use hir_expand::{ | 7 | use hir_expand::{ |
7 | ast_id_map::FileAstId, | 8 | ast_id_map::FileAstId, |
8 | builtin_derive::find_builtin_derive, | 9 | builtin_derive::find_builtin_derive, |
@@ -11,7 +12,6 @@ use hir_expand::{ | |||
11 | proc_macro::ProcMacroExpander, | 12 | proc_macro::ProcMacroExpander, |
12 | HirFileId, MacroCallId, MacroDefId, MacroDefKind, | 13 | HirFileId, MacroCallId, MacroDefId, MacroDefKind, |
13 | }; | 14 | }; |
14 | use ra_cfg::CfgOptions; | ||
15 | use ra_db::{CrateId, FileId, ProcMacroId}; | 15 | use ra_db::{CrateId, FileId, ProcMacroId}; |
16 | use rustc_hash::FxHashMap; | 16 | use rustc_hash::FxHashMap; |
17 | use syntax::ast; | 17 | use syntax::ast; |
diff --git a/crates/ra_hir_expand/Cargo.toml b/crates/ra_hir_expand/Cargo.toml index 153a70bdf..cbb0ac29b 100644 --- a/crates/ra_hir_expand/Cargo.toml +++ b/crates/ra_hir_expand/Cargo.toml | |||
@@ -19,5 +19,5 @@ syntax = { path = "../syntax" } | |||
19 | parser = { path = "../parser" } | 19 | parser = { path = "../parser" } |
20 | profile = { path = "../profile" } | 20 | profile = { path = "../profile" } |
21 | tt = { path = "../tt" } | 21 | tt = { path = "../tt" } |
22 | mbe = { path = "../ra_mbe", package = "ra_mbe" } | 22 | mbe = { path = "../mbe" } |
23 | test_utils = { path = "../test_utils"} | 23 | test_utils = { path = "../test_utils"} |
diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml index 8e0fa5917..c60e55545 100644 --- a/crates/ra_ide/Cargo.toml +++ b/crates/ra_ide/Cargo.toml | |||
@@ -25,7 +25,7 @@ syntax = { path = "../syntax" } | |||
25 | text_edit = { path = "../text_edit" } | 25 | text_edit = { path = "../text_edit" } |
26 | ra_db = { path = "../ra_db" } | 26 | ra_db = { path = "../ra_db" } |
27 | ra_ide_db = { path = "../ra_ide_db" } | 27 | ra_ide_db = { path = "../ra_ide_db" } |
28 | ra_cfg = { path = "../ra_cfg" } | 28 | cfg = { path = "../cfg" } |
29 | ra_fmt = { path = "../ra_fmt" } | 29 | ra_fmt = { path = "../ra_fmt" } |
30 | profile = { path = "../profile" } | 30 | profile = { path = "../profile" } |
31 | test_utils = { path = "../test_utils" } | 31 | test_utils = { path = "../test_utils" } |
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 20967ba99..1fdf17800 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs | |||
@@ -47,7 +47,7 @@ mod typing; | |||
47 | 47 | ||
48 | use std::sync::Arc; | 48 | use std::sync::Arc; |
49 | 49 | ||
50 | use ra_cfg::CfgOptions; | 50 | use cfg::CfgOptions; |
51 | use ra_db::{ | 51 | use ra_db::{ |
52 | salsa::{self, ParallelDatabase}, | 52 | salsa::{self, ParallelDatabase}, |
53 | CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, | 53 | CheckCanceled, Env, FileLoader, FileSet, SourceDatabase, VfsPath, |
diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs index c7e0f4b58..a4691f028 100644 --- a/crates/ra_ide/src/mock_analysis.rs +++ b/crates/ra_ide/src/mock_analysis.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | use std::sync::Arc; | 2 | use std::sync::Arc; |
3 | 3 | ||
4 | use ra_cfg::CfgOptions; | 4 | use cfg::CfgOptions; |
5 | use ra_db::{CrateName, FileSet, SourceRoot, VfsPath}; | 5 | use ra_db::{CrateName, FileSet, SourceRoot, VfsPath}; |
6 | use test_utils::{ | 6 | use test_utils::{ |
7 | extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER, | 7 | extract_annotations, extract_range_or_offset, Fixture, RangeOrOffset, CURSOR_MARKER, |
diff --git a/crates/ra_ide/src/parent_module.rs b/crates/ra_ide/src/parent_module.rs index 69af0c86a..b78388e6b 100644 --- a/crates/ra_ide/src/parent_module.rs +++ b/crates/ra_ide/src/parent_module.rs | |||
@@ -63,7 +63,7 @@ pub(crate) fn crate_for(db: &RootDatabase, file_id: FileId) -> Vec<CrateId> { | |||
63 | 63 | ||
64 | #[cfg(test)] | 64 | #[cfg(test)] |
65 | mod tests { | 65 | mod tests { |
66 | use ra_cfg::CfgOptions; | 66 | use cfg::CfgOptions; |
67 | use ra_db::Env; | 67 | use ra_db::Env; |
68 | use test_utils::mark; | 68 | use test_utils::mark; |
69 | 69 | ||
diff --git a/crates/ra_ide/src/runnables.rs b/crates/ra_ide/src/runnables.rs index 54cb3b309..fb40762cf 100644 --- a/crates/ra_ide/src/runnables.rs +++ b/crates/ra_ide/src/runnables.rs | |||
@@ -1,8 +1,8 @@ | |||
1 | use std::fmt; | 1 | use std::fmt; |
2 | 2 | ||
3 | use cfg::CfgExpr; | ||
3 | use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics}; | 4 | use hir::{AsAssocItem, Attrs, HirFileId, InFile, Semantics}; |
4 | use itertools::Itertools; | 5 | use itertools::Itertools; |
5 | use ra_cfg::CfgExpr; | ||
6 | use ra_ide_db::RootDatabase; | 6 | use ra_ide_db::RootDatabase; |
7 | use syntax::{ | 7 | use syntax::{ |
8 | ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner}, | 8 | ast::{self, AstNode, AttrsOwner, DocCommentsOwner, ModuleItemOwner, NameOwner}, |
diff --git a/crates/ra_project_model/Cargo.toml b/crates/ra_project_model/Cargo.toml index 171fe8626..52f2d57b3 100644 --- a/crates/ra_project_model/Cargo.toml +++ b/crates/ra_project_model/Cargo.toml | |||
@@ -15,7 +15,7 @@ rustc-hash = "1.1.0" | |||
15 | cargo_metadata = "0.11.1" | 15 | cargo_metadata = "0.11.1" |
16 | 16 | ||
17 | arena = { path = "../arena" } | 17 | arena = { path = "../arena" } |
18 | ra_cfg = { path = "../ra_cfg" } | 18 | cfg = { path = "../cfg" } |
19 | ra_db = { path = "../ra_db" } | 19 | ra_db = { path = "../ra_db" } |
20 | toolchain = { path = "../toolchain" } | 20 | toolchain = { path = "../toolchain" } |
21 | ra_proc_macro = { path = "../ra_proc_macro" } | 21 | ra_proc_macro = { path = "../ra_proc_macro" } |
diff --git a/crates/ra_project_model/src/cfg_flag.rs b/crates/ra_project_model/src/cfg_flag.rs index bd50056c6..e92962cf6 100644 --- a/crates/ra_project_model/src/cfg_flag.rs +++ b/crates/ra_project_model/src/cfg_flag.rs | |||
@@ -3,7 +3,7 @@ | |||
3 | //! rustc main.rs --cfg foo --cfg 'feature="bar"' | 3 | //! rustc main.rs --cfg foo --cfg 'feature="bar"' |
4 | use std::str::FromStr; | 4 | use std::str::FromStr; |
5 | 5 | ||
6 | use ra_cfg::CfgOptions; | 6 | use cfg::CfgOptions; |
7 | use stdx::split_once; | 7 | use stdx::split_once; |
8 | 8 | ||
9 | #[derive(Clone, Eq, PartialEq, Debug)] | 9 | #[derive(Clone, Eq, PartialEq, Debug)] |
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index 46f44910c..ee42198f3 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -12,8 +12,8 @@ use std::{ | |||
12 | }; | 12 | }; |
13 | 13 | ||
14 | use anyhow::{bail, Context, Result}; | 14 | use anyhow::{bail, Context, Result}; |
15 | use cfg::CfgOptions; | ||
15 | use paths::{AbsPath, AbsPathBuf}; | 16 | use paths::{AbsPath, AbsPathBuf}; |
16 | use ra_cfg::CfgOptions; | ||
17 | use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId}; | 17 | use ra_db::{CrateGraph, CrateId, CrateName, Edition, Env, FileId}; |
18 | use rustc_hash::{FxHashMap, FxHashSet}; | 18 | use rustc_hash::{FxHashMap, FxHashSet}; |
19 | 19 | ||
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 7713ed7ea..440b1cd13 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml | |||
@@ -42,7 +42,7 @@ syntax = { path = "../syntax" } | |||
42 | text_edit = { path = "../text_edit" } | 42 | text_edit = { path = "../text_edit" } |
43 | vfs = { path = "../vfs" } | 43 | vfs = { path = "../vfs" } |
44 | vfs-notify = { path = "../vfs-notify" } | 44 | vfs-notify = { path = "../vfs-notify" } |
45 | ra_cfg = { path = "../ra_cfg" } | 45 | cfg = { path = "../cfg" } |
46 | toolchain = { path = "../toolchain" } | 46 | toolchain = { path = "../toolchain" } |
47 | 47 | ||
48 | # This should only be used in CLI | 48 | # This should only be used in CLI |
@@ -60,5 +60,5 @@ winapi = "0.3.8" | |||
60 | [dev-dependencies] | 60 | [dev-dependencies] |
61 | expect = { path = "../expect" } | 61 | expect = { path = "../expect" } |
62 | test_utils = { path = "../test_utils" } | 62 | test_utils = { path = "../test_utils" } |
63 | mbe = { path = "../ra_mbe", package = "ra_mbe" } | 63 | mbe = { path = "../mbe" } |
64 | tt = { path = "../tt" } | 64 | tt = { path = "../tt" } |
diff --git a/crates/rust-analyzer/src/cargo_target_spec.rs b/crates/rust-analyzer/src/cargo_target_spec.rs index 7929368c0..9c7a9cce6 100644 --- a/crates/rust-analyzer/src/cargo_target_spec.rs +++ b/crates/rust-analyzer/src/cargo_target_spec.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | //! See `CargoTargetSpec` | 1 | //! See `CargoTargetSpec` |
2 | 2 | ||
3 | use ra_cfg::CfgExpr; | 3 | use cfg::CfgExpr; |
4 | use ra_ide::{FileId, RunnableKind, TestId}; | 4 | use ra_ide::{FileId, RunnableKind, TestId}; |
5 | use ra_project_model::{self, TargetKind}; | 5 | use ra_project_model::{self, TargetKind}; |
6 | use vfs::AbsPathBuf; | 6 | use vfs::AbsPathBuf; |
@@ -177,8 +177,8 @@ fn required_features(cfg_expr: &CfgExpr, features: &mut Vec<String>) { | |||
177 | mod tests { | 177 | mod tests { |
178 | use super::*; | 178 | use super::*; |
179 | 179 | ||
180 | use cfg::CfgExpr; | ||
180 | use mbe::ast_to_token_tree; | 181 | use mbe::ast_to_token_tree; |
181 | use ra_cfg::CfgExpr; | ||
182 | use syntax::{ | 182 | use syntax::{ |
183 | ast::{self, AstNode}, | 183 | ast::{self, AstNode}, |
184 | SmolStr, | 184 | SmolStr, |
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index 8c608284a..0188aaa2e 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs | |||
@@ -195,7 +195,7 @@ impl TidyDocs { | |||
195 | "ra_hir", | 195 | "ra_hir", |
196 | "ra_hir_expand", | 196 | "ra_hir_expand", |
197 | "ra_ide", | 197 | "ra_ide", |
198 | "ra_mbe", | 198 | "mbe", |
199 | "parser", | 199 | "parser", |
200 | "profile", | 200 | "profile", |
201 | "ra_project_model", | 201 | "ra_project_model", |