aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock88
-rw-r--r--crates/ra_syntax/Cargo.toml2
-rw-r--r--crates/ra_syntax/src/parsing/lexer.rs24
-rw-r--r--crates/rust-analyzer/Cargo.toml2
4 files changed, 62 insertions, 54 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fe71b9971..a70c22a94 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -17,9 +17,9 @@ checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d"
17 17
18[[package]] 18[[package]]
19name = "aho-corasick" 19name = "aho-corasick"
20version = "0.7.10" 20version = "0.7.13"
21source = "registry+https://github.com/rust-lang/crates.io-index" 21source = "registry+https://github.com/rust-lang/crates.io-index"
22checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" 22checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
23dependencies = [ 23dependencies = [
24 "memchr", 24 "memchr",
25] 25]
@@ -59,7 +59,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
59dependencies = [ 59dependencies = [
60 "hermit-abi", 60 "hermit-abi",
61 "libc", 61 "libc",
62 "winapi 0.3.8", 62 "winapi 0.3.9",
63] 63]
64 64
65[[package]] 65[[package]]
@@ -84,9 +84,9 @@ dependencies = [
84 84
85[[package]] 85[[package]]
86name = "base64" 86name = "base64"
87version = "0.12.2" 87version = "0.12.3"
88source = "registry+https://github.com/rust-lang/crates.io-index" 88source = "registry+https://github.com/rust-lang/crates.io-index"
89checksum = "e223af0dc48c96d4f8342ec01a4974f139df863896b316681efd36742f22cc67" 89checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
90 90
91[[package]] 91[[package]]
92name = "bitflags" 92name = "bitflags"
@@ -123,9 +123,9 @@ dependencies = [
123 123
124[[package]] 124[[package]]
125name = "cc" 125name = "cc"
126version = "1.0.54" 126version = "1.0.55"
127source = "registry+https://github.com/rust-lang/crates.io-index" 127source = "registry+https://github.com/rust-lang/crates.io-index"
128checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" 128checksum = "b1be3409f94d7bdceeb5f5fac551039d9b3f00e25da7a74fc4d33400a0d96368"
129 129
130[[package]] 130[[package]]
131name = "cfg-if" 131name = "cfg-if"
@@ -200,14 +200,14 @@ dependencies = [
200 "atty", 200 "atty",
201 "lazy_static", 201 "lazy_static",
202 "libc", 202 "libc",
203 "winapi 0.3.8", 203 "winapi 0.3.9",
204] 204]
205 205
206[[package]] 206[[package]]
207name = "cloudabi" 207name = "cloudabi"
208version = "0.0.3" 208version = "0.1.0"
209source = "registry+https://github.com/rust-lang/crates.io-index" 209source = "registry+https://github.com/rust-lang/crates.io-index"
210checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 210checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
211dependencies = [ 211dependencies = [
212 "bitflags", 212 "bitflags",
213] 213]
@@ -224,7 +224,7 @@ dependencies = [
224 "libc", 224 "libc",
225 "terminal_size", 225 "terminal_size",
226 "termios", 226 "termios",
227 "winapi 0.3.8", 227 "winapi 0.3.9",
228] 228]
229 229
230[[package]] 230[[package]]
@@ -356,7 +356,7 @@ dependencies = [
356 "cfg-if", 356 "cfg-if",
357 "libc", 357 "libc",
358 "redox_syscall", 358 "redox_syscall",
359 "winapi 0.3.8", 359 "winapi 0.3.9",
360] 360]
361 361
362[[package]] 362[[package]]
@@ -495,7 +495,7 @@ version = "0.5.3"
495source = "registry+https://github.com/rust-lang/crates.io-index" 495source = "registry+https://github.com/rust-lang/crates.io-index"
496checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" 496checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
497dependencies = [ 497dependencies = [
498 "winapi 0.3.8", 498 "winapi 0.3.9",
499] 499]
500 500
501[[package]] 501[[package]]
@@ -553,6 +553,12 @@ dependencies = [
553] 553]
554 554
555[[package]] 555[[package]]
556name = "instant"
557version = "0.1.4"
558source = "registry+https://github.com/rust-lang/crates.io-index"
559checksum = "7777a24a1ce5de49fcdde84ec46efa487c3af49d5b6e6e0a50367cc5c1096182"
560
561[[package]]
556name = "iovec" 562name = "iovec"
557version = "0.1.4" 563version = "0.1.4"
558source = "registry+https://github.com/rust-lang/crates.io-index" 564source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -648,7 +654,7 @@ version = "0.6.2"
648source = "registry+https://github.com/rust-lang/crates.io-index" 654source = "registry+https://github.com/rust-lang/crates.io-index"
649checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c" 655checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c"
650dependencies = [ 656dependencies = [
651 "winapi 0.3.8", 657 "winapi 0.3.9",
652] 658]
653 659
654[[package]] 660[[package]]
@@ -659,9 +665,9 @@ checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
659 665
660[[package]] 666[[package]]
661name = "lock_api" 667name = "lock_api"
662version = "0.3.4" 668version = "0.4.0"
663source = "registry+https://github.com/rust-lang/crates.io-index" 669source = "registry+https://github.com/rust-lang/crates.io-index"
664checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" 670checksum = "de302ce1fe7482db13738fbaf2e21cfb06a986b89c0bf38d88abf16681aada4e"
665dependencies = [ 671dependencies = [
666 "scopeguard", 672 "scopeguard",
667] 673]
@@ -735,7 +741,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
735checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" 741checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
736dependencies = [ 742dependencies = [
737 "libc", 743 "libc",
738 "winapi 0.3.8", 744 "winapi 0.3.9",
739] 745]
740 746
741[[package]] 747[[package]]
@@ -807,7 +813,7 @@ checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7"
807dependencies = [ 813dependencies = [
808 "cfg-if", 814 "cfg-if",
809 "libc", 815 "libc",
810 "winapi 0.3.8", 816 "winapi 0.3.9",
811] 817]
812 818
813[[package]] 819[[package]]
@@ -827,7 +833,7 @@ dependencies = [
827 "mio", 833 "mio",
828 "mio-extras", 834 "mio-extras",
829 "walkdir", 835 "walkdir",
830 "winapi 0.3.8", 836 "winapi 0.3.9",
831] 837]
832 838
833[[package]] 839[[package]]
@@ -873,26 +879,28 @@ checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d"
873 879
874[[package]] 880[[package]]
875name = "parking_lot" 881name = "parking_lot"
876version = "0.10.2" 882version = "0.11.0"
877source = "registry+https://github.com/rust-lang/crates.io-index" 883source = "registry+https://github.com/rust-lang/crates.io-index"
878checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" 884checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
879dependencies = [ 885dependencies = [
886 "instant",
880 "lock_api", 887 "lock_api",
881 "parking_lot_core", 888 "parking_lot_core",
882] 889]
883 890
884[[package]] 891[[package]]
885name = "parking_lot_core" 892name = "parking_lot_core"
886version = "0.7.2" 893version = "0.8.0"
887source = "registry+https://github.com/rust-lang/crates.io-index" 894source = "registry+https://github.com/rust-lang/crates.io-index"
888checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" 895checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
889dependencies = [ 896dependencies = [
890 "cfg-if", 897 "cfg-if",
891 "cloudabi", 898 "cloudabi",
899 "instant",
892 "libc", 900 "libc",
893 "redox_syscall", 901 "redox_syscall",
894 "smallvec", 902 "smallvec",
895 "winapi 0.3.8", 903 "winapi 0.3.9",
896] 904]
897 905
898[[package]] 906[[package]]
@@ -936,9 +944,9 @@ dependencies = [
936 944
937[[package]] 945[[package]]
938name = "pico-args" 946name = "pico-args"
939version = "0.3.2" 947version = "0.3.3"
940source = "registry+https://github.com/rust-lang/crates.io-index" 948source = "registry+https://github.com/rust-lang/crates.io-index"
941checksum = "6a71836ceac43f0349e3bd964f5bb902f7b003916f32a4ad00354dafc447fa8f" 949checksum = "1b1eee8b1f4966c8343d7ca0f5a8452cd35d5610a2e0efbe2a68cae44bef2046"
942 950
943[[package]] 951[[package]]
944name = "plain" 952name = "plain"
@@ -1414,7 +1422,7 @@ version = "0.5.3"
1414source = "registry+https://github.com/rust-lang/crates.io-index" 1422source = "registry+https://github.com/rust-lang/crates.io-index"
1415checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1423checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
1416dependencies = [ 1424dependencies = [
1417 "winapi 0.3.8", 1425 "winapi 0.3.9",
1418] 1426]
1419 1427
1420[[package]] 1428[[package]]
@@ -1470,14 +1478,14 @@ dependencies = [
1470 "threadpool", 1478 "threadpool",
1471 "vfs", 1479 "vfs",
1472 "vfs-notify", 1480 "vfs-notify",
1473 "winapi 0.3.8", 1481 "winapi 0.3.9",
1474] 1482]
1475 1483
1476[[package]] 1484[[package]]
1477name = "rustc-ap-rustc_lexer" 1485name = "rustc-ap-rustc_lexer"
1478version = "661.0.0" 1486version = "666.0.0"
1479source = "registry+https://github.com/rust-lang/crates.io-index" 1487source = "registry+https://github.com/rust-lang/crates.io-index"
1480checksum = "a6d88abd7c634b52557e46fc7ba47644f0cbe45c358c33f51c532d60d1da239e" 1488checksum = "4e00c526f9f8430ea4cd2178d25b02bfc7debe6677350c57292f92f50e65d2fe"
1481dependencies = [ 1489dependencies = [
1482 "unicode-xid", 1490 "unicode-xid",
1483] 1491]
@@ -1502,9 +1510,9 @@ checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
1502 1510
1503[[package]] 1511[[package]]
1504name = "salsa" 1512name = "salsa"
1505version = "0.14.1" 1513version = "0.14.2"
1506source = "registry+https://github.com/rust-lang/crates.io-index" 1514source = "registry+https://github.com/rust-lang/crates.io-index"
1507checksum = "4a006c56096acaaa5e82e5974c28d05ff1e84aa70615f19c53fecf8a1afb2fd2" 1515checksum = "6a976dce155e392af3f1aa540ca23a6fc7303a7fef425cb431c464deb263eb54"
1508dependencies = [ 1516dependencies = [
1509 "crossbeam", 1517 "crossbeam",
1510 "indexmap", 1518 "indexmap",
@@ -1713,7 +1721,7 @@ dependencies = [
1713 "rand", 1721 "rand",
1714 "redox_syscall", 1722 "redox_syscall",
1715 "remove_dir_all", 1723 "remove_dir_all",
1716 "winapi 0.3.8", 1724 "winapi 0.3.9",
1717] 1725]
1718 1726
1719[[package]] 1727[[package]]
@@ -1723,7 +1731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1723checksum = "8038f95fc7a6f351163f4b964af631bd26c9e828f7db085f2a84aca56f70d13b" 1731checksum = "8038f95fc7a6f351163f4b964af631bd26c9e828f7db085f2a84aca56f70d13b"
1724dependencies = [ 1732dependencies = [
1725 "libc", 1733 "libc",
1726 "winapi 0.3.8", 1734 "winapi 0.3.9",
1727] 1735]
1728 1736
1729[[package]] 1737[[package]]
@@ -1890,9 +1898,9 @@ checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
1890 1898
1891[[package]] 1899[[package]]
1892name = "unicode-xid" 1900name = "unicode-xid"
1893version = "0.2.0" 1901version = "0.2.1"
1894source = "registry+https://github.com/rust-lang/crates.io-index" 1902source = "registry+https://github.com/rust-lang/crates.io-index"
1895checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 1903checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
1896 1904
1897[[package]] 1905[[package]]
1898name = "url" 1906name = "url"
@@ -1936,7 +1944,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1936checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" 1944checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
1937dependencies = [ 1945dependencies = [
1938 "same-file", 1946 "same-file",
1939 "winapi 0.3.8", 1947 "winapi 0.3.9",
1940 "winapi-util", 1948 "winapi-util",
1941] 1949]
1942 1950
@@ -1954,9 +1962,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
1954 1962
1955[[package]] 1963[[package]]
1956name = "winapi" 1964name = "winapi"
1957version = "0.3.8" 1965version = "0.3.9"
1958source = "registry+https://github.com/rust-lang/crates.io-index" 1966source = "registry+https://github.com/rust-lang/crates.io-index"
1959checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 1967checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1960dependencies = [ 1968dependencies = [
1961 "winapi-i686-pc-windows-gnu", 1969 "winapi-i686-pc-windows-gnu",
1962 "winapi-x86_64-pc-windows-gnu", 1970 "winapi-x86_64-pc-windows-gnu",
@@ -1980,7 +1988,7 @@ version = "0.1.5"
1980source = "registry+https://github.com/rust-lang/crates.io-index" 1988source = "registry+https://github.com/rust-lang/crates.io-index"
1981checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 1989checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
1982dependencies = [ 1990dependencies = [
1983 "winapi 0.3.8", 1991 "winapi 0.3.9",
1984] 1992]
1985 1993
1986[[package]] 1994[[package]]
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index a8ff2e74f..49696ce75 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
13[dependencies] 13[dependencies]
14itertools = "0.9.0" 14itertools = "0.9.0"
15rowan = "0.10.0" 15rowan = "0.10.0"
16rustc_lexer = { version = "661.0.0", package = "rustc-ap-rustc_lexer" } 16rustc_lexer = { version = "666.0.0", package = "rustc-ap-rustc_lexer" }
17rustc-hash = "1.1.0" 17rustc-hash = "1.1.0"
18arrayvec = "0.5.1" 18arrayvec = "0.5.1"
19once_cell = "1.3.1" 19once_cell = "1.3.1"
diff --git a/crates/ra_syntax/src/parsing/lexer.rs b/crates/ra_syntax/src/parsing/lexer.rs
index 1a5a6dc06..fa3be1016 100644
--- a/crates/ra_syntax/src/parsing/lexer.rs
+++ b/crates/ra_syntax/src/parsing/lexer.rs
@@ -1,6 +1,8 @@
1//! Lexer analyzes raw input string and produces lexemes (tokens). 1//! Lexer analyzes raw input string and produces lexemes (tokens).
2//! It is just a bridge to `rustc_lexer`. 2//! It is just a bridge to `rustc_lexer`.
3 3
4use rustc_lexer::{LiteralKind as LK, RawStrError};
5
4use std::convert::TryInto; 6use std::convert::TryInto;
5 7
6use crate::{ 8use crate::{
@@ -180,8 +182,6 @@ fn rustc_token_kind_to_syntax_kind(
180 return (syntax_kind, None); 182 return (syntax_kind, None);
181 183
182 fn match_literal_kind(kind: &rustc_lexer::LiteralKind) -> (SyntaxKind, Option<&'static str>) { 184 fn match_literal_kind(kind: &rustc_lexer::LiteralKind) -> (SyntaxKind, Option<&'static str>) {
183 use rustc_lexer::{LexRawStrError, LiteralKind as LK};
184
185 #[rustfmt::skip] 185 #[rustfmt::skip]
186 let syntax_kind = match *kind { 186 let syntax_kind = match *kind {
187 LK::Int { empty_int: false, .. } => INT_NUMBER, 187 LK::Int { empty_int: false, .. } => INT_NUMBER,
@@ -215,27 +215,27 @@ fn rustc_token_kind_to_syntax_kind(
215 return (BYTE_STRING, Some("Missing trailing `\"` symbol to terminate the byte string literal")) 215 return (BYTE_STRING, Some("Missing trailing `\"` symbol to terminate the byte string literal"))
216 } 216 }
217 217
218 LK::RawStr(str) => match str.validate() { 218 LK::RawStr { err, .. } => match err {
219 Ok(_) => RAW_STRING, 219 None => RAW_STRING,
220 Err(LexRawStrError::InvalidStarter) => return (RAW_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw string literal")), 220 Some(RawStrError::InvalidStarter { .. }) => return (RAW_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw string literal")),
221 Err(LexRawStrError::NoTerminator { expected, found, .. }) => if expected == found { 221 Some(RawStrError::NoTerminator { expected, found, .. }) => if expected == found {
222 return (RAW_STRING, Some("Missing trailing `\"` to terminate the raw string literal")) 222 return (RAW_STRING, Some("Missing trailing `\"` to terminate the raw string literal"))
223 } else { 223 } else {
224 return (RAW_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw string literal")) 224 return (RAW_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw string literal"))
225 225
226 }, 226 },
227 Err(LexRawStrError::TooManyDelimiters { .. }) => return (RAW_STRING, Some("Too many `#` symbols: raw strings may be delimited by up to 65535 `#` symbols")), 227 Some(RawStrError::TooManyDelimiters { .. }) => return (RAW_STRING, Some("Too many `#` symbols: raw strings may be delimited by up to 65535 `#` symbols")),
228 }, 228 },
229 LK::RawByteStr(str) => match str.validate() { 229 LK::RawByteStr { err, .. } => match err {
230 Ok(_) => RAW_BYTE_STRING, 230 None => RAW_BYTE_STRING,
231 Err(LexRawStrError::InvalidStarter) => return (RAW_BYTE_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw byte string literal")), 231 Some(RawStrError::InvalidStarter { .. }) => return (RAW_BYTE_STRING, Some("Missing `\"` symbol after `#` symbols to begin the raw byte string literal")),
232 Err(LexRawStrError::NoTerminator { expected, found, .. }) => if expected == found { 232 Some(RawStrError::NoTerminator { expected, found, .. }) => if expected == found {
233 return (RAW_BYTE_STRING, Some("Missing trailing `\"` to terminate the raw byte string literal")) 233 return (RAW_BYTE_STRING, Some("Missing trailing `\"` to terminate the raw byte string literal"))
234 } else { 234 } else {
235 return (RAW_BYTE_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw byte string literal")) 235 return (RAW_BYTE_STRING, Some("Missing trailing `\"` with `#` symbols to terminate the raw byte string literal"))
236 236
237 }, 237 },
238 Err(LexRawStrError::TooManyDelimiters { .. }) => return (RAW_BYTE_STRING, Some("Too many `#` symbols: raw byte strings may be delimited by up to 65535 `#` symbols")), 238 Some(RawStrError::TooManyDelimiters { .. }) => return (RAW_BYTE_STRING, Some("Too many `#` symbols: raw byte strings may be delimited by up to 65535 `#` symbols")),
239 }, 239 },
240 }; 240 };
241 241
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 122a1605f..53621fb44 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -21,7 +21,7 @@ itertools = "0.9.0"
21jod-thread = "0.1.0" 21jod-thread = "0.1.0"
22log = "0.4.8" 22log = "0.4.8"
23lsp-types = { version = "0.74.0", features = ["proposed"] } 23lsp-types = { version = "0.74.0", features = ["proposed"] }
24parking_lot = "0.10.0" 24parking_lot = "0.11.0"
25pico-args = "0.3.1" 25pico-args = "0.3.1"
26rand = { version = "0.7.3", features = ["small_rng"] } 26rand = { version = "0.7.3", features = ["small_rng"] }
27rustc-hash = "1.1.0" 27rustc-hash = "1.1.0"