aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock96
-rw-r--r--crates/hir/src/display.rs2
-rw-r--r--crates/hir_def/src/data.rs4
-rw-r--r--crates/hir_def/src/generics.rs20
-rw-r--r--crates/hir_def/src/intern.rs2
-rw-r--r--crates/hir_def/src/item_tree.rs4
-rw-r--r--crates/hir_def/src/item_tree/lower.rs13
-rw-r--r--crates/hir_def/src/item_tree/pretty.rs4
-rw-r--r--crates/hir_def/src/path.rs9
-rw-r--r--crates/hir_def/src/path/lower.rs15
-rw-r--r--crates/hir_def/src/type_ref.rs14
-rw-r--r--crates/hir_ty/Cargo.toml6
-rw-r--r--crates/hir_ty/src/display.rs7
-rw-r--r--crates/hir_ty/src/lower.rs3
-rw-r--r--crates/ide/src/doc_links.rs6
-rw-r--r--crates/proc_macro_api/Cargo.toml2
-rw-r--r--crates/proc_macro_srv/Cargo.toml2
-rw-r--r--crates/proc_macro_srv/src/dylib.rs2
-rw-r--r--crates/proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt2
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt11
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt2
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt7
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt2
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt2
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt5
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt5
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt5
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt6
-rw-r--r--crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt11
-rw-r--r--crates/rust-analyzer/src/to_proto.rs2
-rw-r--r--crates/syntax/Cargo.toml2
-rw-r--r--docs/user/manual.adoc10
32 files changed, 180 insertions, 103 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 76a26ea4e..557d5f5f3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
4 4
5[[package]] 5[[package]]
6name = "addr2line" 6name = "addr2line"
7version = "0.14.1" 7version = "0.15.1"
8source = "registry+https://github.com/rust-lang/crates.io-index" 8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" 9checksum = "03345e98af8f3d786b6d9f656ccfa6ac316d954e92bc4841f0bba20789d5fb5a"
10dependencies = [ 10dependencies = [
11 "gimli", 11 "gimli",
12] 12]
@@ -72,9 +72,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
72 72
73[[package]] 73[[package]]
74name = "backtrace" 74name = "backtrace"
75version = "0.3.58" 75version = "0.3.59"
76source = "registry+https://github.com/rust-lang/crates.io-index" 76source = "registry+https://github.com/rust-lang/crates.io-index"
77checksum = "88fb5a785d6b44fd9d6700935608639af1b8356de1e55d5f7c2740f4faa15d82" 77checksum = "4717cfcbfaa661a0fd48f8453951837ae7e8f81e481fbb136e3202d72805a744"
78dependencies = [ 78dependencies = [
79 "addr2line", 79 "addr2line",
80 "cc", 80 "cc",
@@ -169,9 +169,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
169 169
170[[package]] 170[[package]]
171name = "chalk-derive" 171name = "chalk-derive"
172version = "0.64.0" 172version = "0.67.0"
173source = "registry+https://github.com/rust-lang/crates.io-index" 173source = "registry+https://github.com/rust-lang/crates.io-index"
174checksum = "d9acf2a9eab79ae7d44cd77ad86a8b1569d7a5e6d9a7db4a0a57a7344dd82c24" 174checksum = "751a3cd9eeb24d7165e9f90daf1f10a23ffa16a7986f349027f8dfb60f51ee0c"
175dependencies = [ 175dependencies = [
176 "proc-macro2", 176 "proc-macro2",
177 "quote", 177 "quote",
@@ -181,9 +181,9 @@ dependencies = [
181 181
182[[package]] 182[[package]]
183name = "chalk-ir" 183name = "chalk-ir"
184version = "0.64.0" 184version = "0.67.0"
185source = "registry+https://github.com/rust-lang/crates.io-index" 185source = "registry+https://github.com/rust-lang/crates.io-index"
186checksum = "877661627f54ba3666a72943c43b326cb170d60899e50a8426111e7a657ff032" 186checksum = "4236da905504740d3f72cc8f0509aa01321cc236208e2c33b55eda2db74bc495"
187dependencies = [ 187dependencies = [
188 "bitflags", 188 "bitflags",
189 "chalk-derive", 189 "chalk-derive",
@@ -192,9 +192,9 @@ dependencies = [
192 192
193[[package]] 193[[package]]
194name = "chalk-recursive" 194name = "chalk-recursive"
195version = "0.64.0" 195version = "0.67.0"
196source = "registry+https://github.com/rust-lang/crates.io-index" 196source = "registry+https://github.com/rust-lang/crates.io-index"
197checksum = "072ffcf17243c2aa3e4b9ea6de3d29e7ef64cfdb0ceccaa431965070a1dc1475" 197checksum = "7d0b123fe45a34c4cd5cb329650a0d163525d2acbe9d754a4538d3340884002e"
198dependencies = [ 198dependencies = [
199 "chalk-derive", 199 "chalk-derive",
200 "chalk-ir", 200 "chalk-ir",
@@ -205,9 +205,9 @@ dependencies = [
205 205
206[[package]] 206[[package]]
207name = "chalk-solve" 207name = "chalk-solve"
208version = "0.64.0" 208version = "0.67.0"
209source = "registry+https://github.com/rust-lang/crates.io-index" 209source = "registry+https://github.com/rust-lang/crates.io-index"
210checksum = "97d4920c9ef2b26dd0b98ffdf070e27fa31e0b6f637463132083cee597e3d326" 210checksum = "9c54788f0ae3b38e2bb2266f395d462d988c64f92dbd55c68219908fd1ce7ddc"
211dependencies = [ 211dependencies = [
212 "chalk-derive", 212 "chalk-derive",
213 "chalk-ir", 213 "chalk-ir",
@@ -452,9 +452,9 @@ checksum = "e398fae362f4124bbe630d99519fb2d68a03e2e3a23b441028cdcdc4f4895687"
452 452
453[[package]] 453[[package]]
454name = "gimli" 454name = "gimli"
455version = "0.23.0" 455version = "0.24.0"
456source = "registry+https://github.com/rust-lang/crates.io-index" 456source = "registry+https://github.com/rust-lang/crates.io-index"
457checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" 457checksum = "0e4075386626662786ddb0ec9081e7c7eeb1ba31951f447ca780ef9f5d568189"
458 458
459[[package]] 459[[package]]
460name = "hashbrown" 460name = "hashbrown"
@@ -715,9 +715,9 @@ dependencies = [
715 715
716[[package]] 716[[package]]
717name = "inotify" 717name = "inotify"
718version = "0.9.2" 718version = "0.9.3"
719source = "registry+https://github.com/rust-lang/crates.io-index" 719source = "registry+https://github.com/rust-lang/crates.io-index"
720checksum = "d19f57db1baad9d09e43a3cd76dcf82ebdafd37d75c9498b87762dba77c93f15" 720checksum = "b031475cb1b103ee221afb806a23d35e0570bf7271d7588762ceba8127ed43b3"
721dependencies = [ 721dependencies = [
722 "bitflags", 722 "bitflags",
723 "inotify-sys", 723 "inotify-sys",
@@ -830,9 +830,9 @@ dependencies = [
830 830
831[[package]] 831[[package]]
832name = "lsp-types" 832name = "lsp-types"
833version = "0.89.0" 833version = "0.89.1"
834source = "registry+https://github.com/rust-lang/crates.io-index" 834source = "registry+https://github.com/rust-lang/crates.io-index"
835checksum = "07731ecd4ee0654728359a5b95e2a254c857876c04b85225496a35d60345daa7" 835checksum = "48b8a871b0a450bcec0e26d74a59583c8173cb9fb7d7f98889e18abb84838e0f"
836dependencies = [ 836dependencies = [
837 "bitflags", 837 "bitflags",
838 "serde", 838 "serde",
@@ -995,9 +995,9 @@ dependencies = [
995 995
996[[package]] 996[[package]]
997name = "object" 997name = "object"
998version = "0.23.0" 998version = "0.24.0"
999source = "registry+https://github.com/rust-lang/crates.io-index" 999source = "registry+https://github.com/rust-lang/crates.io-index"
1000checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" 1000checksum = "1a5b3dd1c072ee7963717671d1ca129f1048fda25edea6b752bfc71ac8854170"
1001 1001
1002[[package]] 1002[[package]]
1003name = "once_cell" 1003name = "once_cell"
@@ -1124,9 +1124,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
1124 1124
1125[[package]] 1125[[package]]
1126name = "proc-macro2" 1126name = "proc-macro2"
1127version = "1.0.26" 1127version = "1.0.27"
1128source = "registry+https://github.com/rust-lang/crates.io-index" 1128source = "registry+https://github.com/rust-lang/crates.io-index"
1129checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" 1129checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038"
1130dependencies = [ 1130dependencies = [
1131 "unicode-xid", 1131 "unicode-xid",
1132] 1132]
@@ -1235,9 +1235,9 @@ dependencies = [
1235 1235
1236[[package]] 1236[[package]]
1237name = "rayon" 1237name = "rayon"
1238version = "1.5.0" 1238version = "1.5.1"
1239source = "registry+https://github.com/rust-lang/crates.io-index" 1239source = "registry+https://github.com/rust-lang/crates.io-index"
1240checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" 1240checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
1241dependencies = [ 1241dependencies = [
1242 "autocfg", 1242 "autocfg",
1243 "crossbeam-deque", 1243 "crossbeam-deque",
@@ -1247,9 +1247,9 @@ dependencies = [
1247 1247
1248[[package]] 1248[[package]]
1249name = "rayon-core" 1249name = "rayon-core"
1250version = "1.9.0" 1250version = "1.9.1"
1251source = "registry+https://github.com/rust-lang/crates.io-index" 1251source = "registry+https://github.com/rust-lang/crates.io-index"
1252checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" 1252checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
1253dependencies = [ 1253dependencies = [
1254 "crossbeam-channel", 1254 "crossbeam-channel",
1255 "crossbeam-deque", 1255 "crossbeam-deque",
@@ -1260,18 +1260,18 @@ dependencies = [
1260 1260
1261[[package]] 1261[[package]]
1262name = "redox_syscall" 1262name = "redox_syscall"
1263version = "0.2.7" 1263version = "0.2.8"
1264source = "registry+https://github.com/rust-lang/crates.io-index" 1264source = "registry+https://github.com/rust-lang/crates.io-index"
1265checksum = "85dd92e586f7355c633911e11f77f3d12f04b1b1bd76a198bd34ae3af8341ef2" 1265checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc"
1266dependencies = [ 1266dependencies = [
1267 "bitflags", 1267 "bitflags",
1268] 1268]
1269 1269
1270[[package]] 1270[[package]]
1271name = "regex" 1271name = "regex"
1272version = "1.5.3" 1272version = "1.5.4"
1273source = "registry+https://github.com/rust-lang/crates.io-index" 1273source = "registry+https://github.com/rust-lang/crates.io-index"
1274checksum = "ce5f1ceb7f74abbce32601642fcf8e8508a8a8991e0621c7d750295b9095702b" 1274checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
1275dependencies = [ 1275dependencies = [
1276 "regex-syntax", 1276 "regex-syntax",
1277] 1277]
@@ -1359,18 +1359,18 @@ dependencies = [
1359 1359
1360[[package]] 1360[[package]]
1361name = "rustc-ap-rustc_lexer" 1361name = "rustc-ap-rustc_lexer"
1362version = "716.0.0" 1362version = "720.0.0"
1363source = "registry+https://github.com/rust-lang/crates.io-index" 1363source = "registry+https://github.com/rust-lang/crates.io-index"
1364checksum = "12eac7554c1d3f49f105f14d53c0f3402220e875983113562701d8e597a0995c" 1364checksum = "a025b453b0ae85335336f991f920ca9af5c0dc851171cb9035a16cea5619e9b2"
1365dependencies = [ 1365dependencies = [
1366 "unicode-xid", 1366 "unicode-xid",
1367] 1367]
1368 1368
1369[[package]] 1369[[package]]
1370name = "rustc-demangle" 1370name = "rustc-demangle"
1371version = "0.1.18" 1371version = "0.1.19"
1372source = "registry+https://github.com/rust-lang/crates.io-index" 1372source = "registry+https://github.com/rust-lang/crates.io-index"
1373checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" 1373checksum = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce"
1374 1374
1375[[package]] 1375[[package]]
1376name = "rustc-hash" 1376name = "rustc-hash"
@@ -1455,18 +1455,18 @@ dependencies = [
1455 1455
1456[[package]] 1456[[package]]
1457name = "serde" 1457name = "serde"
1458version = "1.0.125" 1458version = "1.0.126"
1459source = "registry+https://github.com/rust-lang/crates.io-index" 1459source = "registry+https://github.com/rust-lang/crates.io-index"
1460checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" 1460checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03"
1461dependencies = [ 1461dependencies = [
1462 "serde_derive", 1462 "serde_derive",
1463] 1463]
1464 1464
1465[[package]] 1465[[package]]
1466name = "serde_derive" 1466name = "serde_derive"
1467version = "1.0.125" 1467version = "1.0.126"
1468source = "registry+https://github.com/rust-lang/crates.io-index" 1468source = "registry+https://github.com/rust-lang/crates.io-index"
1469checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" 1469checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43"
1470dependencies = [ 1470dependencies = [
1471 "proc-macro2", 1471 "proc-macro2",
1472 "quote", 1472 "quote",
@@ -1496,9 +1496,9 @@ dependencies = [
1496 1496
1497[[package]] 1497[[package]]
1498name = "serde_repr" 1498name = "serde_repr"
1499version = "0.1.6" 1499version = "0.1.7"
1500source = "registry+https://github.com/rust-lang/crates.io-index" 1500source = "registry+https://github.com/rust-lang/crates.io-index"
1501checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76" 1501checksum = "98d0516900518c29efa217c298fa1f4e6c6ffc85ae29fd7f4ee48f176e1a9ed5"
1502dependencies = [ 1502dependencies = [
1503 "proc-macro2", 1503 "proc-macro2",
1504 "quote", 1504 "quote",
@@ -1548,9 +1548,9 @@ dependencies = [
1548 1548
1549[[package]] 1549[[package]]
1550name = "syn" 1550name = "syn"
1551version = "1.0.71" 1551version = "1.0.72"
1552source = "registry+https://github.com/rust-lang/crates.io-index" 1552source = "registry+https://github.com/rust-lang/crates.io-index"
1553checksum = "ad184cc9470f9117b2ac6817bfe297307418819ba40552f9b3846f05c33d5373" 1553checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82"
1554dependencies = [ 1554dependencies = [
1555 "proc-macro2", 1555 "proc-macro2",
1556 "quote", 1556 "quote",
@@ -1848,9 +1848,9 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
1848 1848
1849[[package]] 1849[[package]]
1850name = "url" 1850name = "url"
1851version = "2.2.1" 1851version = "2.2.2"
1852source = "registry+https://github.com/rust-lang/crates.io-index" 1852source = "registry+https://github.com/rust-lang/crates.io-index"
1853checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" 1853checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
1854dependencies = [ 1854dependencies = [
1855 "form_urlencoded", 1855 "form_urlencoded",
1856 "idna", 1856 "idna",
@@ -1957,18 +1957,18 @@ dependencies = [
1957 1957
1958[[package]] 1958[[package]]
1959name = "xshell" 1959name = "xshell"
1960version = "0.1.10" 1960version = "0.1.13"
1961source = "registry+https://github.com/rust-lang/crates.io-index" 1961source = "registry+https://github.com/rust-lang/crates.io-index"
1962checksum = "aa25217c682f9f991d7889238a99e65eb8431c266d36e0f4e850a73773415473" 1962checksum = "eb15bb1b41eb14efe628006294c294e10c366e03a0283b9c2063fc27d97934c6"
1963dependencies = [ 1963dependencies = [
1964 "xshell-macros", 1964 "xshell-macros",
1965] 1965]
1966 1966
1967[[package]] 1967[[package]]
1968name = "xshell-macros" 1968name = "xshell-macros"
1969version = "0.1.10" 1969version = "0.1.13"
1970source = "registry+https://github.com/rust-lang/crates.io-index" 1970source = "registry+https://github.com/rust-lang/crates.io-index"
1971checksum = "4404d53d2113af4fa31c58326eb7b37d6d7bf11ba87520787cddeaff45385c72" 1971checksum = "cf7ed94a2c75b9bcc57031229be2b57ee47ba71122f71aabef8610ec66a97e52"
1972 1972
1973[[package]] 1973[[package]]
1974name = "xtask" 1974name = "xtask"
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs
index 508ac37c2..c5cf803fd 100644
--- a/crates/hir/src/display.rs
+++ b/crates/hir/src/display.rs
@@ -92,7 +92,7 @@ impl HirDisplay for Function {
92 &data.ret_type 92 &data.ret_type
93 } else { 93 } else {
94 match &*data.ret_type { 94 match &*data.ret_type {
95 TypeRef::ImplTrait(bounds) => match &bounds[0] { 95 TypeRef::ImplTrait(bounds) => match bounds[0].as_ref() {
96 TypeBound::Path(path) => { 96 TypeBound::Path(path) => {
97 path.segments().iter().last().unwrap().args_and_bindings.unwrap().bindings 97 path.segments().iter().last().unwrap().args_and_bindings.unwrap().bindings
98 [0] 98 [0]
diff --git a/crates/hir_def/src/data.rs b/crates/hir_def/src/data.rs
index 135a6698e..8bcac60ef 100644
--- a/crates/hir_def/src/data.rs
+++ b/crates/hir_def/src/data.rs
@@ -112,7 +112,7 @@ pub struct TypeAliasData {
112 pub visibility: RawVisibility, 112 pub visibility: RawVisibility,
113 pub is_extern: bool, 113 pub is_extern: bool,
114 /// Bounds restricting the type alias itself (eg. `type Ty: Bound;` in a trait or impl). 114 /// Bounds restricting the type alias itself (eg. `type Ty: Bound;` in a trait or impl).
115 pub bounds: Vec<TypeBound>, 115 pub bounds: Vec<Interned<TypeBound>>,
116} 116}
117 117
118impl TypeAliasData { 118impl TypeAliasData {
@@ -141,7 +141,7 @@ pub struct TraitData {
141 pub is_auto: bool, 141 pub is_auto: bool,
142 pub is_unsafe: bool, 142 pub is_unsafe: bool,
143 pub visibility: RawVisibility, 143 pub visibility: RawVisibility,
144 pub bounds: Box<[TypeBound]>, 144 pub bounds: Box<[Interned<TypeBound>]>,
145} 145}
146 146
147impl TraitData { 147impl TraitData {
diff --git a/crates/hir_def/src/generics.rs b/crates/hir_def/src/generics.rs
index de5acced8..44d22b918 100644
--- a/crates/hir_def/src/generics.rs
+++ b/crates/hir_def/src/generics.rs
@@ -68,9 +68,19 @@ pub struct GenericParams {
68/// associated type bindings like `Iterator<Item = u32>`. 68/// associated type bindings like `Iterator<Item = u32>`.
69#[derive(Clone, PartialEq, Eq, Debug, Hash)] 69#[derive(Clone, PartialEq, Eq, Debug, Hash)]
70pub enum WherePredicate { 70pub enum WherePredicate {
71 TypeBound { target: WherePredicateTypeTarget, bound: TypeBound }, 71 TypeBound {
72 Lifetime { target: LifetimeRef, bound: LifetimeRef }, 72 target: WherePredicateTypeTarget,
73 ForLifetime { lifetimes: Box<[Name]>, target: WherePredicateTypeTarget, bound: TypeBound }, 73 bound: Interned<TypeBound>,
74 },
75 Lifetime {
76 target: LifetimeRef,
77 bound: LifetimeRef,
78 },
79 ForLifetime {
80 lifetimes: Box<[Name]>,
81 target: WherePredicateTypeTarget,
82 bound: Interned<TypeBound>,
83 },
74} 84}
75 85
76#[derive(Clone, PartialEq, Eq, Debug, Hash)] 86#[derive(Clone, PartialEq, Eq, Debug, Hash)]
@@ -339,11 +349,11 @@ impl GenericParams {
339 Some(hrtb_lifetimes) => WherePredicate::ForLifetime { 349 Some(hrtb_lifetimes) => WherePredicate::ForLifetime {
340 lifetimes: hrtb_lifetimes.clone(), 350 lifetimes: hrtb_lifetimes.clone(),
341 target: WherePredicateTypeTarget::TypeRef(Interned::new(type_ref)), 351 target: WherePredicateTypeTarget::TypeRef(Interned::new(type_ref)),
342 bound, 352 bound: Interned::new(bound),
343 }, 353 },
344 None => WherePredicate::TypeBound { 354 None => WherePredicate::TypeBound {
345 target: WherePredicateTypeTarget::TypeRef(Interned::new(type_ref)), 355 target: WherePredicateTypeTarget::TypeRef(Interned::new(type_ref)),
346 bound, 356 bound: Interned::new(bound),
347 }, 357 },
348 }, 358 },
349 (Either::Right(lifetime), TypeBound::Lifetime(bound)) => { 359 (Either::Right(lifetime), TypeBound::Lifetime(bound)) => {
diff --git a/crates/hir_def/src/intern.rs b/crates/hir_def/src/intern.rs
index 5cc7f2df6..1189c9327 100644
--- a/crates/hir_def/src/intern.rs
+++ b/crates/hir_def/src/intern.rs
@@ -216,7 +216,9 @@ pub use crate::_impl_internable as impl_internable;
216impl_internable!( 216impl_internable!(
217 crate::type_ref::TypeRef, 217 crate::type_ref::TypeRef,
218 crate::type_ref::TraitRef, 218 crate::type_ref::TraitRef,
219 crate::type_ref::TypeBound,
219 crate::path::ModPath, 220 crate::path::ModPath,
221 crate::path::GenericArgs,
220 GenericParams, 222 GenericParams,
221 str, 223 str,
222); 224);
diff --git a/crates/hir_def/src/item_tree.rs b/crates/hir_def/src/item_tree.rs
index 4a5f44027..11767d100 100644
--- a/crates/hir_def/src/item_tree.rs
+++ b/crates/hir_def/src/item_tree.rs
@@ -644,7 +644,7 @@ pub struct Trait {
644 pub generic_params: Interned<GenericParams>, 644 pub generic_params: Interned<GenericParams>,
645 pub is_auto: bool, 645 pub is_auto: bool,
646 pub is_unsafe: bool, 646 pub is_unsafe: bool,
647 pub bounds: Box<[TypeBound]>, 647 pub bounds: Box<[Interned<TypeBound>]>,
648 pub items: Box<[AssocItem]>, 648 pub items: Box<[AssocItem]>,
649 pub ast_id: FileAstId<ast::Trait>, 649 pub ast_id: FileAstId<ast::Trait>,
650} 650}
@@ -664,7 +664,7 @@ pub struct TypeAlias {
664 pub name: Name, 664 pub name: Name,
665 pub visibility: RawVisibilityId, 665 pub visibility: RawVisibilityId,
666 /// Bounds on the type alias itself. Only valid in trait declarations, eg. `type Assoc: Copy;`. 666 /// Bounds on the type alias itself. Only valid in trait declarations, eg. `type Assoc: Copy;`.
667 pub bounds: Box<[TypeBound]>, 667 pub bounds: Box<[Interned<TypeBound>]>,
668 pub generic_params: Interned<GenericParams>, 668 pub generic_params: Interned<GenericParams>,
669 pub type_ref: Option<Interned<TypeRef>>, 669 pub type_ref: Option<Interned<TypeRef>>,
670 pub is_extern: bool, 670 pub is_extern: bool,
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index 91cf75371..b4389371f 100644
--- a/crates/hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
@@ -384,7 +384,7 @@ impl<'a> Ctx<'a> {
384 384
385 let ret_type = if func.async_token().is_some() { 385 let ret_type = if func.async_token().is_some() {
386 let future_impl = desugar_future_path(ret_type); 386 let future_impl = desugar_future_path(ret_type);
387 let ty_bound = TypeBound::Path(future_impl); 387 let ty_bound = Interned::new(TypeBound::Path(future_impl));
388 TypeRef::ImplTrait(vec![ty_bound]) 388 TypeRef::ImplTrait(vec![ty_bound])
389 } else { 389 } else {
390 ret_type 390 ret_type
@@ -738,11 +738,12 @@ impl<'a> Ctx<'a> {
738 Interned::new(generics) 738 Interned::new(generics)
739 } 739 }
740 740
741 fn lower_type_bounds(&mut self, node: &impl ast::TypeBoundsOwner) -> Vec<TypeBound> { 741 fn lower_type_bounds(&mut self, node: &impl ast::TypeBoundsOwner) -> Vec<Interned<TypeBound>> {
742 match node.type_bound_list() { 742 match node.type_bound_list() {
743 Some(bound_list) => { 743 Some(bound_list) => bound_list
744 bound_list.bounds().map(|it| TypeBound::from_ast(&self.body_ctx, it)).collect() 744 .bounds()
745 } 745 .map(|it| Interned::new(TypeBound::from_ast(&self.body_ctx, it)))
746 .collect(),
746 None => Vec::new(), 747 None => Vec::new(),
747 } 748 }
748 } 749 }
@@ -810,7 +811,7 @@ fn desugar_future_path(orig: TypeRef) -> Path {
810 let binding = 811 let binding =
811 AssociatedTypeBinding { name: name![Output], type_ref: Some(orig), bounds: Vec::new() }; 812 AssociatedTypeBinding { name: name![Output], type_ref: Some(orig), bounds: Vec::new() };
812 last.bindings.push(binding); 813 last.bindings.push(binding);
813 generic_args.push(Some(Arc::new(last))); 814 generic_args.push(Some(Interned::new(last)));
814 815
815 Path::from_known_path(path, generic_args) 816 Path::from_known_path(path, generic_args)
816} 817}
diff --git a/crates/hir_def/src/item_tree/pretty.rs b/crates/hir_def/src/item_tree/pretty.rs
index 4bc87a0e2..9394a5de6 100644
--- a/crates/hir_def/src/item_tree/pretty.rs
+++ b/crates/hir_def/src/item_tree/pretty.rs
@@ -513,13 +513,13 @@ impl<'a> Printer<'a> {
513 } 513 }
514 } 514 }
515 515
516 fn print_type_bounds(&mut self, bounds: &[TypeBound]) { 516 fn print_type_bounds(&mut self, bounds: &[Interned<TypeBound>]) {
517 for (i, bound) in bounds.iter().enumerate() { 517 for (i, bound) in bounds.iter().enumerate() {
518 if i != 0 { 518 if i != 0 {
519 w!(self, " + "); 519 w!(self, " + ");
520 } 520 }
521 521
522 match bound { 522 match bound.as_ref() {
523 TypeBound::Path(path) => self.print_path(path), 523 TypeBound::Path(path) => self.print_path(path),
524 TypeBound::Lifetime(lt) => w!(self, "{}", lt.name), 524 TypeBound::Lifetime(lt) => w!(self, "{}", lt.name),
525 TypeBound::Error => w!(self, "{{unknown}}"), 525 TypeBound::Error => w!(self, "{{unknown}}"),
diff --git a/crates/hir_def/src/path.rs b/crates/hir_def/src/path.rs
index 9b8873fd2..45ab9d0ff 100644
--- a/crates/hir_def/src/path.rs
+++ b/crates/hir_def/src/path.rs
@@ -4,7 +4,6 @@ mod lower;
4use std::{ 4use std::{
5 fmt::{self, Display}, 5 fmt::{self, Display},
6 iter, 6 iter,
7 sync::Arc,
8}; 7};
9 8
10use crate::{body::LowerCtx, db::DefDatabase, intern::Interned, type_ref::LifetimeRef}; 9use crate::{body::LowerCtx, db::DefDatabase, intern::Interned, type_ref::LifetimeRef};
@@ -136,7 +135,7 @@ pub struct Path {
136 type_anchor: Option<Interned<TypeRef>>, 135 type_anchor: Option<Interned<TypeRef>>,
137 mod_path: Interned<ModPath>, 136 mod_path: Interned<ModPath>,
138 /// Invariant: the same len as `self.mod_path.segments` 137 /// Invariant: the same len as `self.mod_path.segments`
139 generic_args: Vec<Option<Arc<GenericArgs>>>, 138 generic_args: Vec<Option<Interned<GenericArgs>>>,
140} 139}
141 140
142/// Generic arguments to a path segment (e.g. the `i32` in `Option<i32>`). This 141/// Generic arguments to a path segment (e.g. the `i32` in `Option<i32>`). This
@@ -165,7 +164,7 @@ pub struct AssociatedTypeBinding {
165 /// Bounds for the associated type, like in `Iterator<Item: 164 /// Bounds for the associated type, like in `Iterator<Item:
166 /// SomeOtherTrait>`. (This is the unstable `associated_type_bounds` 165 /// SomeOtherTrait>`. (This is the unstable `associated_type_bounds`
167 /// feature.) 166 /// feature.)
168 pub bounds: Vec<TypeBound>, 167 pub bounds: Vec<Interned<TypeBound>>,
169} 168}
170 169
171/// A single generic argument. 170/// A single generic argument.
@@ -185,7 +184,7 @@ impl Path {
185 /// Converts a known mod path to `Path`. 184 /// Converts a known mod path to `Path`.
186 pub(crate) fn from_known_path( 185 pub(crate) fn from_known_path(
187 path: ModPath, 186 path: ModPath,
188 generic_args: Vec<Option<Arc<GenericArgs>>>, 187 generic_args: Vec<Option<Interned<GenericArgs>>>,
189 ) -> Path { 188 ) -> Path {
190 Path { type_anchor: None, mod_path: Interned::new(path), generic_args } 189 Path { type_anchor: None, mod_path: Interned::new(path), generic_args }
191 } 190 }
@@ -239,7 +238,7 @@ pub struct PathSegment<'a> {
239 238
240pub struct PathSegments<'a> { 239pub struct PathSegments<'a> {
241 segments: &'a [Name], 240 segments: &'a [Name],
242 generic_args: &'a [Option<Arc<GenericArgs>>], 241 generic_args: &'a [Option<Interned<GenericArgs>>],
243} 242}
244 243
245impl<'a> PathSegments<'a> { 244impl<'a> PathSegments<'a> {
diff --git a/crates/hir_def/src/path/lower.rs b/crates/hir_def/src/path/lower.rs
index a873325b2..5d5dd9c8f 100644
--- a/crates/hir_def/src/path/lower.rs
+++ b/crates/hir_def/src/path/lower.rs
@@ -3,7 +3,6 @@
3mod lower_use; 3mod lower_use;
4 4
5use crate::intern::Interned; 5use crate::intern::Interned;
6use std::sync::Arc;
7 6
8use either::Either; 7use either::Either;
9use hir_expand::name::{name, AsName}; 8use hir_expand::name::{name, AsName};
@@ -48,7 +47,7 @@ pub(super) fn lower_path(mut path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
48 segment.ret_type(), 47 segment.ret_type(),
49 ) 48 )
50 }) 49 })
51 .map(Arc::new); 50 .map(Interned::new);
52 segments.push(name); 51 segments.push(name);
53 generic_args.push(args) 52 generic_args.push(args)
54 } 53 }
@@ -87,13 +86,13 @@ pub(super) fn lower_path(mut path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
87 // Insert the type reference (T in the above example) as Self parameter for the trait 86 // Insert the type reference (T in the above example) as Self parameter for the trait
88 let last_segment = 87 let last_segment =
89 generic_args.iter_mut().rev().nth(num_segments.saturating_sub(1))?; 88 generic_args.iter_mut().rev().nth(num_segments.saturating_sub(1))?;
90 if last_segment.is_none() { 89 let mut args_inner = match last_segment {
91 *last_segment = Some(Arc::new(GenericArgs::empty())); 90 Some(it) => it.as_ref().clone(),
91 None => GenericArgs::empty(),
92 }; 92 };
93 let args = last_segment.as_mut().unwrap();
94 let mut args_inner = Arc::make_mut(args);
95 args_inner.has_self_type = true; 93 args_inner.has_self_type = true;
96 args_inner.args.insert(0, GenericArg::Type(self_type)); 94 args_inner.args.insert(0, GenericArg::Type(self_type));
95 *last_segment = Some(Interned::new(args_inner));
97 } 96 }
98 } 97 }
99 } 98 }
@@ -171,7 +170,9 @@ pub(super) fn lower_generic_args(
171 let name = name_ref.as_name(); 170 let name = name_ref.as_name();
172 let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it)); 171 let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it));
173 let bounds = if let Some(l) = assoc_type_arg.type_bound_list() { 172 let bounds = if let Some(l) = assoc_type_arg.type_bound_list() {
174 l.bounds().map(|it| TypeBound::from_ast(lower_ctx, it)).collect() 173 l.bounds()
174 .map(|it| Interned::new(TypeBound::from_ast(lower_ctx, it)))
175 .collect()
175 } else { 176 } else {
176 Vec::new() 177 Vec::new()
177 }; 178 };
diff --git a/crates/hir_def/src/type_ref.rs b/crates/hir_def/src/type_ref.rs
index cdcab7110..cbde6b940 100644
--- a/crates/hir_def/src/type_ref.rs
+++ b/crates/hir_def/src/type_ref.rs
@@ -5,7 +5,7 @@ use hir_expand::{name::Name, AstId, InFile};
5use std::convert::TryInto; 5use std::convert::TryInto;
6use syntax::ast; 6use syntax::ast;
7 7
8use crate::{body::LowerCtx, path::Path}; 8use crate::{body::LowerCtx, intern::Interned, path::Path};
9 9
10#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] 10#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
11pub enum Mutability { 11pub enum Mutability {
@@ -91,8 +91,8 @@ pub enum TypeRef {
91 /// A fn pointer. Last element of the vector is the return type. 91 /// A fn pointer. Last element of the vector is the return type.
92 Fn(Vec<TypeRef>, bool /*varargs*/), 92 Fn(Vec<TypeRef>, bool /*varargs*/),
93 // For 93 // For
94 ImplTrait(Vec<TypeBound>), 94 ImplTrait(Vec<Interned<TypeBound>>),
95 DynTrait(Vec<TypeBound>), 95 DynTrait(Vec<Interned<TypeBound>>),
96 Macro(AstId<ast::MacroCall>), 96 Macro(AstId<ast::MacroCall>),
97 Error, 97 Error,
98} 98}
@@ -232,7 +232,7 @@ impl TypeRef {
232 | TypeRef::Slice(type_ref) => go(&type_ref, f), 232 | TypeRef::Slice(type_ref) => go(&type_ref, f),
233 TypeRef::ImplTrait(bounds) | TypeRef::DynTrait(bounds) => { 233 TypeRef::ImplTrait(bounds) | TypeRef::DynTrait(bounds) => {
234 for bound in bounds { 234 for bound in bounds {
235 match bound { 235 match bound.as_ref() {
236 TypeBound::Path(path) => go_path(path, f), 236 TypeBound::Path(path) => go_path(path, f),
237 TypeBound::Lifetime(_) | TypeBound::Error => (), 237 TypeBound::Lifetime(_) | TypeBound::Error => (),
238 } 238 }
@@ -262,7 +262,7 @@ impl TypeRef {
262 go(type_ref, f); 262 go(type_ref, f);
263 } 263 }
264 for bound in &binding.bounds { 264 for bound in &binding.bounds {
265 match bound { 265 match bound.as_ref() {
266 TypeBound::Path(path) => go_path(path, f), 266 TypeBound::Path(path) => go_path(path, f),
267 TypeBound::Lifetime(_) | TypeBound::Error => (), 267 TypeBound::Lifetime(_) | TypeBound::Error => (),
268 } 268 }
@@ -277,9 +277,9 @@ impl TypeRef {
277pub(crate) fn type_bounds_from_ast( 277pub(crate) fn type_bounds_from_ast(
278 lower_ctx: &LowerCtx, 278 lower_ctx: &LowerCtx,
279 type_bounds_opt: Option<ast::TypeBoundList>, 279 type_bounds_opt: Option<ast::TypeBoundList>,
280) -> Vec<TypeBound> { 280) -> Vec<Interned<TypeBound>> {
281 if let Some(type_bounds) = type_bounds_opt { 281 if let Some(type_bounds) = type_bounds_opt {
282 type_bounds.bounds().map(|it| TypeBound::from_ast(lower_ctx, it)).collect() 282 type_bounds.bounds().map(|it| Interned::new(TypeBound::from_ast(lower_ctx, it))).collect()
283 } else { 283 } else {
284 vec![] 284 vec![]
285 } 285 }
diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml
index 66b3418f2..a9994082a 100644
--- a/crates/hir_ty/Cargo.toml
+++ b/crates/hir_ty/Cargo.toml
@@ -18,9 +18,9 @@ ena = "0.14.0"
18log = "0.4.8" 18log = "0.4.8"
19rustc-hash = "1.1.0" 19rustc-hash = "1.1.0"
20scoped-tls = "1" 20scoped-tls = "1"
21chalk-solve = { version = "0.64", default-features = false } 21chalk-solve = { version = "0.67", default-features = false }
22chalk-ir = "0.64" 22chalk-ir = "0.67"
23chalk-recursive = "0.64" 23chalk-recursive = "0.67"
24la-arena = { version = "0.2.0", path = "../../lib/arena" } 24la-arena = { version = "0.2.0", path = "../../lib/arena" }
25 25
26stdx = { path = "../stdx", version = "0.0.0" } 26stdx = { path = "../stdx", version = "0.0.0" }
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 7bbd1a1f7..637bbc634 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -13,6 +13,7 @@ use hir_def::{
13 db::DefDatabase, 13 db::DefDatabase,
14 find_path, 14 find_path,
15 generics::TypeParamProvenance, 15 generics::TypeParamProvenance,
16 intern::{Internable, Interned},
16 item_scope::ItemInNs, 17 item_scope::ItemInNs,
17 path::{Path, PathKind}, 18 path::{Path, PathKind},
18 type_ref::{TypeBound, TypeRef}, 19 type_ref::{TypeBound, TypeRef},
@@ -256,6 +257,12 @@ impl<T: HirDisplay> HirDisplay for &'_ T {
256 } 257 }
257} 258}
258 259
260impl<T: HirDisplay + Internable> HirDisplay for Interned<T> {
261 fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
262 HirDisplay::hir_fmt(self.as_ref(), f)
263 }
264}
265
259impl HirDisplay for ProjectionTy { 266impl HirDisplay for ProjectionTy {
260 fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> { 267 fn hir_fmt(&self, f: &mut HirFormatter) -> Result<(), HirDisplayError> {
261 if f.should_truncate() { 268 if f.should_truncate() {
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs
index 8a375b973..1645ac533 100644
--- a/crates/hir_ty/src/lower.rs
+++ b/crates/hir_ty/src/lower.rs
@@ -10,6 +10,7 @@ use std::{iter, sync::Arc};
10 10
11use base_db::CrateId; 11use base_db::CrateId;
12use chalk_ir::{cast::Cast, fold::Shift, interner::HasInterner, Mutability, Safety}; 12use chalk_ir::{cast::Cast, fold::Shift, interner::HasInterner, Mutability, Safety};
13use hir_def::intern::Interned;
13use hir_def::{ 14use hir_def::{
14 adt::StructKind, 15 adt::StructKind,
15 body::{Expander, LowerCtx}, 16 body::{Expander, LowerCtx},
@@ -843,7 +844,7 @@ impl<'a> TyLoweringContext<'a> {
843 }) 844 })
844 } 845 }
845 846
846 fn lower_impl_trait(&self, bounds: &[TypeBound]) -> ReturnTypeImplTrait { 847 fn lower_impl_trait(&self, bounds: &[Interned<TypeBound>]) -> ReturnTypeImplTrait {
847 cov_mark::hit!(lower_rpit); 848 cov_mark::hit!(lower_rpit);
848 let self_ty = 849 let self_ty =
849 TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)).intern(&Interner); 850 TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)).intern(&Interner);
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs
index 320694a17..ec3828ab2 100644
--- a/crates/ide/src/doc_links.rs
+++ b/crates/ide/src/doc_links.rs
@@ -286,7 +286,7 @@ fn get_doc_link(db: &RootDatabase, definition: Definition) -> Option<String> {
286 .and_then( 286 .and_then(
287 |url| if let Some(fragment) = fragment { url.join(&fragment).ok() } else { Some(url) }, 287 |url| if let Some(fragment) = fragment { url.join(&fragment).ok() } else { Some(url) },
288 ) 288 )
289 .map(|url| url.into_string()) 289 .map(|url| url.into())
290} 290}
291 291
292fn rewrite_intra_doc_link( 292fn rewrite_intra_doc_link(
@@ -325,7 +325,7 @@ fn rewrite_intra_doc_link(
325 }; 325 };
326 } 326 }
327 327
328 Some((new_url.into_string(), strip_prefixes_suffixes(title).to_string())) 328 Some((new_url.into(), strip_prefixes_suffixes(title).to_string()))
329} 329}
330 330
331/// Try to resolve path to local documentation via path-based links (i.e. `../gateway/struct.Shard.html`). 331/// Try to resolve path to local documentation via path-based links (i.e. `../gateway/struct.Shard.html`).
@@ -345,7 +345,7 @@ fn rewrite_url_link(db: &RootDatabase, def: ModuleDef, target: &str) -> Option<S
345 get_symbol_filename(db, &def).as_deref().map(|f| url.join(f).ok()).flatten() 345 get_symbol_filename(db, &def).as_deref().map(|f| url.join(f).ok()).flatten()
346 }) 346 })
347 .and_then(|url| url.join(target).ok()) 347 .and_then(|url| url.join(target).ok())
348 .map(|url| url.into_string()) 348 .map(|url| url.into())
349} 349}
350 350
351/// Rewrites a markdown document, applying 'callback' to each link. 351/// Rewrites a markdown document, applying 'callback' to each link.
diff --git a/crates/proc_macro_api/Cargo.toml b/crates/proc_macro_api/Cargo.toml
index 2ce5eeedd..2c4da394b 100644
--- a/crates/proc_macro_api/Cargo.toml
+++ b/crates/proc_macro_api/Cargo.toml
@@ -16,7 +16,7 @@ log = "0.4.8"
16crossbeam-channel = "0.5.0" 16crossbeam-channel = "0.5.0"
17jod-thread = "0.1.1" 17jod-thread = "0.1.1"
18memmap2 = "0.2.0" 18memmap2 = "0.2.0"
19object = { version = "0.23.0", default-features = false, features = ["std", "read_core", "elf", "macho", "pe", "unaligned"] } 19object = { version = "0.24", default-features = false, features = ["std", "read_core", "elf", "macho", "pe"] }
20snap = "1.0" 20snap = "1.0"
21 21
22tt = { path = "../tt", version = "0.0.0" } 22tt = { path = "../tt", version = "0.0.0" }
diff --git a/crates/proc_macro_srv/Cargo.toml b/crates/proc_macro_srv/Cargo.toml
index 63b3f1532..4ea41175e 100644
--- a/crates/proc_macro_srv/Cargo.toml
+++ b/crates/proc_macro_srv/Cargo.toml
@@ -10,7 +10,7 @@ edition = "2018"
10doctest = false 10doctest = false
11 11
12[dependencies] 12[dependencies]
13object = { version = "0.23", default-features = false, features = ["std", "read_core", "elf", "macho", "pe"] } 13object = { version = "0.24", default-features = false, features = ["std", "read_core", "elf", "macho", "pe"] }
14libloading = "0.7.0" 14libloading = "0.7.0"
15memmap2 = "0.2.0" 15memmap2 = "0.2.0"
16 16
diff --git a/crates/proc_macro_srv/src/dylib.rs b/crates/proc_macro_srv/src/dylib.rs
index baf10fea9..cccc53220 100644
--- a/crates/proc_macro_srv/src/dylib.rs
+++ b/crates/proc_macro_srv/src/dylib.rs
@@ -27,7 +27,7 @@ fn find_registrar_symbol(file: &Path) -> io::Result<Option<String>> {
27 let file = File::open(file)?; 27 let file = File::open(file)?;
28 let buffer = unsafe { Mmap::map(&file)? }; 28 let buffer = unsafe { Mmap::map(&file)? };
29 29
30 Ok(object::File::parse(&buffer) 30 Ok(object::File::parse(&*buffer)
31 .map_err(invalid_data_err)? 31 .map_err(invalid_data_err)?
32 .exports() 32 .exports()
33 .map_err(invalid_data_err)? 33 .map_err(invalid_data_err)?
diff --git a/crates/proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt b/crates/proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt
index fa581f110..eb67c7134 100644
--- a/crates/proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt
+++ b/crates/proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt
@@ -23,7 +23,7 @@ SUBTREE $
23 SUBTREE [] 4294967295 23 SUBTREE [] 4294967295
24 IDENT allow 4294967295 24 IDENT allow 4294967295
25 SUBTREE () 4294967295 25 SUBTREE () 4294967295
26 IDENT rust_2018_idioms 4294967295 26 IDENT unused_extern_crates 4294967295
27 PUNCH , [alone] 4294967295 27 PUNCH , [alone] 4294967295
28 IDENT clippy 4294967295 28 IDENT clippy 4294967295
29 PUNCH : [joint] 4294967295 29 PUNCH : [joint] 4294967295
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
index 227d96d51..bcc889681 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -33,6 +34,7 @@
33 CodeDescription { 34 CodeDescription {
34 href: Url { 35 href: Url {
35 scheme: "https", 36 scheme: "https",
37 cannot_be_a_base: false,
36 username: "", 38 username: "",
37 password: None, 39 password: None,
38 host: Some( 40 host: Some(
@@ -59,6 +61,7 @@
59 location: Location { 61 location: Location {
60 uri: Url { 62 uri: Url {
61 scheme: "file", 63 scheme: "file",
64 cannot_be_a_base: false,
62 username: "", 65 username: "",
63 password: None, 66 password: None,
64 host: None, 67 host: None,
@@ -84,6 +87,7 @@
84 location: Location { 87 location: Location {
85 uri: Url { 88 uri: Url {
86 scheme: "file", 89 scheme: "file",
90 cannot_be_a_base: false,
87 username: "", 91 username: "",
88 password: None, 92 password: None,
89 host: None, 93 host: None,
@@ -115,6 +119,7 @@
115 MappedRustDiagnostic { 119 MappedRustDiagnostic {
116 url: Url { 120 url: Url {
117 scheme: "file", 121 scheme: "file",
122 cannot_be_a_base: false,
118 username: "", 123 username: "",
119 password: None, 124 password: None,
120 host: None, 125 host: None,
@@ -146,6 +151,7 @@
146 CodeDescription { 151 CodeDescription {
147 href: Url { 152 href: Url {
148 scheme: "https", 153 scheme: "https",
154 cannot_be_a_base: false,
149 username: "", 155 username: "",
150 password: None, 156 password: None,
151 host: Some( 157 host: Some(
@@ -172,6 +178,7 @@
172 location: Location { 178 location: Location {
173 uri: Url { 179 uri: Url {
174 scheme: "file", 180 scheme: "file",
181 cannot_be_a_base: false,
175 username: "", 182 username: "",
176 password: None, 183 password: None,
177 host: None, 184 host: None,
@@ -203,6 +210,7 @@
203 MappedRustDiagnostic { 210 MappedRustDiagnostic {
204 url: Url { 211 url: Url {
205 scheme: "file", 212 scheme: "file",
213 cannot_be_a_base: false,
206 username: "", 214 username: "",
207 password: None, 215 password: None,
208 host: None, 216 host: None,
@@ -234,6 +242,7 @@
234 CodeDescription { 242 CodeDescription {
235 href: Url { 243 href: Url {
236 scheme: "https", 244 scheme: "https",
245 cannot_be_a_base: false,
237 username: "", 246 username: "",
238 password: None, 247 password: None,
239 host: Some( 248 host: Some(
@@ -260,6 +269,7 @@
260 location: Location { 269 location: Location {
261 uri: Url { 270 uri: Url {
262 scheme: "file", 271 scheme: "file",
272 cannot_be_a_base: false,
263 username: "", 273 username: "",
264 password: None, 274 password: None,
265 host: None, 275 host: None,
@@ -301,6 +311,7 @@
301 { 311 {
302 Url { 312 Url {
303 scheme: "file", 313 scheme: "file",
314 cannot_be_a_base: false,
304 username: "", 315 username: "",
305 password: None, 316 password: None,
306 host: None, 317 host: None,
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt
index e5f01fb33..d5ab03576 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -33,6 +34,7 @@
33 CodeDescription { 34 CodeDescription {
34 href: Url { 35 href: Url {
35 scheme: "https", 36 scheme: "https",
37 cannot_be_a_base: false,
36 username: "", 38 username: "",
37 password: None, 39 password: None,
38 host: Some( 40 host: Some(
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
index c847bbb35..8bee4cfe1 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -36,6 +37,7 @@
36 location: Location { 37 location: Location {
37 uri: Url { 38 uri: Url {
38 scheme: "file", 39 scheme: "file",
40 cannot_be_a_base: false,
39 username: "", 41 username: "",
40 password: None, 42 password: None,
41 host: None, 43 host: None,
@@ -67,6 +69,7 @@
67 MappedRustDiagnostic { 69 MappedRustDiagnostic {
68 url: Url { 70 url: Url {
69 scheme: "file", 71 scheme: "file",
72 cannot_be_a_base: false,
70 username: "", 73 username: "",
71 password: None, 74 password: None,
72 host: None, 75 host: None,
@@ -101,6 +104,7 @@
101 location: Location { 104 location: Location {
102 uri: Url { 105 uri: Url {
103 scheme: "file", 106 scheme: "file",
107 cannot_be_a_base: false,
104 username: "", 108 username: "",
105 password: None, 109 password: None,
106 host: None, 110 host: None,
@@ -132,6 +136,7 @@
132 MappedRustDiagnostic { 136 MappedRustDiagnostic {
133 url: Url { 137 url: Url {
134 scheme: "file", 138 scheme: "file",
139 cannot_be_a_base: false,
135 username: "", 140 username: "",
136 password: None, 141 password: None,
137 host: None, 142 host: None,
@@ -166,6 +171,7 @@
166 location: Location { 171 location: Location {
167 uri: Url { 172 uri: Url {
168 scheme: "file", 173 scheme: "file",
174 cannot_be_a_base: false,
169 username: "", 175 username: "",
170 password: None, 176 password: None,
171 host: None, 177 host: None,
@@ -191,6 +197,7 @@
191 location: Location { 197 location: Location {
192 uri: Url { 198 uri: Url {
193 scheme: "file", 199 scheme: "file",
200 cannot_be_a_base: false,
194 username: "", 201 username: "",
195 password: None, 202 password: None,
196 host: None, 203 host: None,
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt
index 0d16af232..ada540ea6 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -33,6 +34,7 @@
33 CodeDescription { 34 CodeDescription {
34 href: Url { 35 href: Url {
35 scheme: "https", 36 scheme: "https",
37 cannot_be_a_base: false,
36 username: "", 38 username: "",
37 password: None, 39 password: None,
38 host: Some( 40 host: Some(
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt
index 31b6a12ce..05074a914 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -33,6 +34,7 @@
33 CodeDescription { 34 CodeDescription {
34 href: Url { 35 href: Url {
35 scheme: "https", 36 scheme: "https",
37 cannot_be_a_base: false,
36 username: "", 38 username: "",
37 password: None, 39 password: None,
38 host: Some( 40 host: Some(
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt
index f8adfad3b..749f49438 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -40,6 +41,7 @@
40 location: Location { 41 location: Location {
41 uri: Url { 42 uri: Url {
42 scheme: "file", 43 scheme: "file",
44 cannot_be_a_base: false,
43 username: "", 45 username: "",
44 password: None, 46 password: None,
45 host: None, 47 host: None,
@@ -75,6 +77,7 @@
75 MappedRustDiagnostic { 77 MappedRustDiagnostic {
76 url: Url { 78 url: Url {
77 scheme: "file", 79 scheme: "file",
80 cannot_be_a_base: false,
78 username: "", 81 username: "",
79 password: None, 82 password: None,
80 host: None, 83 host: None,
@@ -113,6 +116,7 @@
113 location: Location { 116 location: Location {
114 uri: Url { 117 uri: Url {
115 scheme: "file", 118 scheme: "file",
119 cannot_be_a_base: false,
116 username: "", 120 username: "",
117 password: None, 121 password: None,
118 host: None, 122 host: None,
@@ -154,6 +158,7 @@
154 { 158 {
155 Url { 159 Url {
156 scheme: "file", 160 scheme: "file",
161 cannot_be_a_base: false,
157 username: "", 162 username: "",
158 password: None, 163 password: None,
159 host: None, 164 host: None,
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt
index 5a70d2ed7..d20a91b39 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -40,6 +41,7 @@
40 location: Location { 41 location: Location {
41 uri: Url { 42 uri: Url {
42 scheme: "file", 43 scheme: "file",
44 cannot_be_a_base: false,
43 username: "", 45 username: "",
44 password: None, 46 password: None,
45 host: None, 47 host: None,
@@ -75,6 +77,7 @@
75 MappedRustDiagnostic { 77 MappedRustDiagnostic {
76 url: Url { 78 url: Url {
77 scheme: "file", 79 scheme: "file",
80 cannot_be_a_base: false,
78 username: "", 81 username: "",
79 password: None, 82 password: None,
80 host: None, 83 host: None,
@@ -113,6 +116,7 @@
113 location: Location { 116 location: Location {
114 uri: Url { 117 uri: Url {
115 scheme: "file", 118 scheme: "file",
119 cannot_be_a_base: false,
116 username: "", 120 username: "",
117 password: None, 121 password: None,
118 host: None, 122 host: None,
@@ -154,6 +158,7 @@
154 { 158 {
155 Url { 159 Url {
156 scheme: "file", 160 scheme: "file",
161 cannot_be_a_base: false,
157 username: "", 162 username: "",
158 password: None, 163 password: None,
159 host: None, 164 host: None,
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt
index 04ca0c9c2..2a9c3a9af 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -40,6 +41,7 @@
40 location: Location { 41 location: Location {
41 uri: Url { 42 uri: Url {
42 scheme: "file", 43 scheme: "file",
44 cannot_be_a_base: false,
43 username: "", 45 username: "",
44 password: None, 46 password: None,
45 host: None, 47 host: None,
@@ -75,6 +77,7 @@
75 MappedRustDiagnostic { 77 MappedRustDiagnostic {
76 url: Url { 78 url: Url {
77 scheme: "file", 79 scheme: "file",
80 cannot_be_a_base: false,
78 username: "", 81 username: "",
79 password: None, 82 password: None,
80 host: None, 83 host: None,
@@ -113,6 +116,7 @@
113 location: Location { 116 location: Location {
114 uri: Url { 117 uri: Url {
115 scheme: "file", 118 scheme: "file",
119 cannot_be_a_base: false,
116 username: "", 120 username: "",
117 password: None, 121 password: None,
118 host: None, 122 host: None,
@@ -154,6 +158,7 @@
154 { 158 {
155 Url { 159 Url {
156 scheme: "file", 160 scheme: "file",
161 cannot_be_a_base: false,
157 username: "", 162 username: "",
158 password: None, 163 password: None,
159 host: None, 164 host: None,
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt
index f7a313cf1..5ea27a152 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -33,6 +34,7 @@
33 CodeDescription { 34 CodeDescription {
34 href: Url { 35 href: Url {
35 scheme: "https", 36 scheme: "https",
37 cannot_be_a_base: false,
36 username: "", 38 username: "",
37 password: None, 39 password: None,
38 host: Some( 40 host: Some(
@@ -59,6 +61,7 @@
59 location: Location { 61 location: Location {
60 uri: Url { 62 uri: Url {
61 scheme: "file", 63 scheme: "file",
64 cannot_be_a_base: false,
62 username: "", 65 username: "",
63 password: None, 66 password: None,
64 host: None, 67 host: None,
@@ -90,6 +93,7 @@
90 MappedRustDiagnostic { 93 MappedRustDiagnostic {
91 url: Url { 94 url: Url {
92 scheme: "file", 95 scheme: "file",
96 cannot_be_a_base: false,
93 username: "", 97 username: "",
94 password: None, 98 password: None,
95 host: None, 99 host: None,
@@ -121,6 +125,7 @@
121 CodeDescription { 125 CodeDescription {
122 href: Url { 126 href: Url {
123 scheme: "https", 127 scheme: "https",
128 cannot_be_a_base: false,
124 username: "", 129 username: "",
125 password: None, 130 password: None,
126 host: Some( 131 host: Some(
@@ -147,6 +152,7 @@
147 location: Location { 152 location: Location {
148 uri: Url { 153 uri: Url {
149 scheme: "file", 154 scheme: "file",
155 cannot_be_a_base: false,
150 username: "", 156 username: "",
151 password: None, 157 password: None,
152 host: None, 158 host: None,
diff --git a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt
index 57d2f1ae3..43b1ea765 100644
--- a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt
+++ b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt
@@ -2,6 +2,7 @@
2 MappedRustDiagnostic { 2 MappedRustDiagnostic {
3 url: Url { 3 url: Url {
4 scheme: "file", 4 scheme: "file",
5 cannot_be_a_base: false,
5 username: "", 6 username: "",
6 password: None, 7 password: None,
7 host: None, 8 host: None,
@@ -33,6 +34,7 @@
33 CodeDescription { 34 CodeDescription {
34 href: Url { 35 href: Url {
35 scheme: "https", 36 scheme: "https",
37 cannot_be_a_base: false,
36 username: "", 38 username: "",
37 password: None, 39 password: None,
38 host: Some( 40 host: Some(
@@ -59,6 +61,7 @@
59 location: Location { 61 location: Location {
60 uri: Url { 62 uri: Url {
61 scheme: "file", 63 scheme: "file",
64 cannot_be_a_base: false,
62 username: "", 65 username: "",
63 password: None, 66 password: None,
64 host: None, 67 host: None,
@@ -84,6 +87,7 @@
84 location: Location { 87 location: Location {
85 uri: Url { 88 uri: Url {
86 scheme: "file", 89 scheme: "file",
90 cannot_be_a_base: false,
87 username: "", 91 username: "",
88 password: None, 92 password: None,
89 host: None, 93 host: None,
@@ -115,6 +119,7 @@
115 MappedRustDiagnostic { 119 MappedRustDiagnostic {
116 url: Url { 120 url: Url {
117 scheme: "file", 121 scheme: "file",
122 cannot_be_a_base: false,
118 username: "", 123 username: "",
119 password: None, 124 password: None,
120 host: None, 125 host: None,
@@ -146,6 +151,7 @@
146 CodeDescription { 151 CodeDescription {
147 href: Url { 152 href: Url {
148 scheme: "https", 153 scheme: "https",
154 cannot_be_a_base: false,
149 username: "", 155 username: "",
150 password: None, 156 password: None,
151 host: Some( 157 host: Some(
@@ -172,6 +178,7 @@
172 location: Location { 178 location: Location {
173 uri: Url { 179 uri: Url {
174 scheme: "file", 180 scheme: "file",
181 cannot_be_a_base: false,
175 username: "", 182 username: "",
176 password: None, 183 password: None,
177 host: None, 184 host: None,
@@ -203,6 +210,7 @@
203 MappedRustDiagnostic { 210 MappedRustDiagnostic {
204 url: Url { 211 url: Url {
205 scheme: "file", 212 scheme: "file",
213 cannot_be_a_base: false,
206 username: "", 214 username: "",
207 password: None, 215 password: None,
208 host: None, 216 host: None,
@@ -234,6 +242,7 @@
234 CodeDescription { 242 CodeDescription {
235 href: Url { 243 href: Url {
236 scheme: "https", 244 scheme: "https",
245 cannot_be_a_base: false,
237 username: "", 246 username: "",
238 password: None, 247 password: None,
239 host: Some( 248 host: Some(
@@ -260,6 +269,7 @@
260 location: Location { 269 location: Location {
261 uri: Url { 270 uri: Url {
262 scheme: "file", 271 scheme: "file",
272 cannot_be_a_base: false,
263 username: "", 273 username: "",
264 password: None, 274 password: None,
265 host: None, 275 host: None,
@@ -301,6 +311,7 @@
301 { 311 {
302 Url { 312 Url {
303 scheme: "file", 313 scheme: "file",
314 cannot_be_a_base: false,
304 username: "", 315 username: "",
305 password: None, 316 password: None,
306 host: None, 317 host: None,
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 0a3a56773..410384ae5 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -604,7 +604,7 @@ pub(crate) fn url_from_abs_path(path: &Path) -> lsp_types::Url {
604 // Note: lowercasing the `path` itself doesn't help, the `Url::parse` 604 // Note: lowercasing the `path` itself doesn't help, the `Url::parse`
605 // machinery *also* canonicalizes the drive letter. So, just massage the 605 // machinery *also* canonicalizes the drive letter. So, just massage the
606 // string in place. 606 // string in place.
607 let mut url = url.into_string(); 607 let mut url: String = url.into();
608 url[driver_letter_range].make_ascii_lowercase(); 608 url[driver_letter_range].make_ascii_lowercase();
609 lsp_types::Url::parse(&url).unwrap() 609 lsp_types::Url::parse(&url).unwrap()
610} 610}
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml
index 747f0b9eb..a6c294245 100644
--- a/crates/syntax/Cargo.toml
+++ b/crates/syntax/Cargo.toml
@@ -14,7 +14,7 @@ doctest = false
14cov-mark = { version = "1.1", features = ["thread-local"] } 14cov-mark = { version = "1.1", features = ["thread-local"] }
15itertools = "0.10.0" 15itertools = "0.10.0"
16rowan = "=0.13.0-pre.6" 16rowan = "=0.13.0-pre.6"
17rustc_lexer = { version = "716.0.0", package = "rustc-ap-rustc_lexer" } 17rustc_lexer = { version = "720.0.0", package = "rustc-ap-rustc_lexer" }
18rustc-hash = "1.1.0" 18rustc-hash = "1.1.0"
19arrayvec = "0.7" 19arrayvec = "0.7"
20once_cell = "1.3.1" 20once_cell = "1.3.1"
diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc
index ad367511b..1f95df56e 100644
--- a/docs/user/manual.adoc
+++ b/docs/user/manual.adoc
@@ -139,18 +139,18 @@ $ cargo xtask install --server
139=== rust-analyzer Language Server Binary 139=== rust-analyzer Language Server Binary
140 140
141Other editors generally require the `rust-analyzer` binary to be in `$PATH`. 141Other editors generally require the `rust-analyzer` binary to be in `$PATH`.
142You can download the pre-built binary from the https://github.com/rust-analyzer/rust-analyzer/releases[releases] page. 142You can download pre-built binaries from the https://github.com/rust-analyzer/rust-analyzer/releases[releases] page.
143Typically, you then need to rename the binary for your platform, e.g. `rust-analyzer-mac` if you're on Mac OS, to `rust-analyzer` and make it executable in addition to moving it into a directory in your `$PATH`. 143You will need to uncompress and rename the binary for your platform, e.g. from `rust-analyzer-aarch64-apple-darwin.gz` on Mac OS to `rust-analyzer`, make it executable, then move it into a directory in your `$PATH`.
144 144
145On Linux to install the `rust-analyzer` binary into `~/.local/bin`, this commands could be used 145On Linux to install the `rust-analyzer` binary into `~/.local/bin`, these commands should work:
146 146
147[source,bash] 147[source,bash]
148---- 148----
149$ curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-linux -o ~/.local/bin/rust-analyzer 149$ curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-x86_64-unknown-linux-gnu.gz | gunzip -c - > ~/.local/bin/rust-analyzer
150$ chmod +x ~/.local/bin/rust-analyzer 150$ chmod +x ~/.local/bin/rust-analyzer
151---- 151----
152 152
153Ensure `~/.local/bin` is listed in the `$PATH` variable. 153Make sure that `~/.local/bin` is listed in the `$PATH` variable and use the appropriate URL if you're not on a `x86-64` system.
154 154
155Alternatively, you can install it from source using the command below. 155Alternatively, you can install it from source using the command below.
156You'll need the latest stable version of the Rust toolchain. 156You'll need the latest stable version of the Rust toolchain.