summaryrefslogtreecommitdiffstats
path: root/vendor/ra-ap-rustc_lexer
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ra-ap-rustc_lexer')
-rw-r--r--vendor/ra-ap-rustc_lexer/.cargo-checksum.json2
-rw-r--r--vendor/ra-ap-rustc_lexer/Cargo.toml10
-rw-r--r--vendor/ra-ap-rustc_lexer/src/cursor.rs4
-rw-r--r--vendor/ra-ap-rustc_lexer/src/lib.rs11
-rw-r--r--vendor/ra-ap-rustc_lexer/src/unescape.rs2
5 files changed, 16 insertions, 13 deletions
diff --git a/vendor/ra-ap-rustc_lexer/.cargo-checksum.json b/vendor/ra-ap-rustc_lexer/.cargo-checksum.json
index 090276c27..cb8ccb6d1 100644
--- a/vendor/ra-ap-rustc_lexer/.cargo-checksum.json
+++ b/vendor/ra-ap-rustc_lexer/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"4999bf349766c3a72dc8e2b760ca5ad8ae37ef42d8fe6131023dd5c7e475eda3","src/cursor.rs":"669ee4cf5b0bde41c18dcfe206b224cef0bbaa4e9400adaa0e37cb9e942f855b","src/lib.rs":"6823810b92d70b72b86c9a278dfc6f2e60610759505cbf9395b6cf5be43c8f6f","src/tests.rs":"bab7446fa7eb773d6e6b8bdb48213390167e83ee1ca008ae4630a5e85336cfbf","src/unescape.rs":"d6dabd9d7aabdac9cd1f648de5df96a25766757ca63e8b2e8a6c39ca6f288827","src/unescape/tests.rs":"5da0043e4a48f27b910d19c28ca443a5eb7d59d2aa16e8f08d4273d4f3754244"},"package":"e1c145702ed3f237918e512685185dc8a4d0edc3a5326c63d20361d8ba9b45b3"} \ No newline at end of file
+{"files":{"Cargo.toml":"ee8081cd111db56133f1daa2c794986fe77d1bc4350edc28c589f7d190d368ca","src/cursor.rs":"a6a293574beb202165fd5ec1f8be30f33e2bcddaf41c27f5ba242c3b878e1d7d","src/lib.rs":"694af3036cc1b90c98b2cf0ab15a2591a83aeb027cc40295ccd437f3f86d0c89","src/tests.rs":"bab7446fa7eb773d6e6b8bdb48213390167e83ee1ca008ae4630a5e85336cfbf","src/unescape.rs":"cdd9156cff4ce879fdda40e6b16030f229d33ed95d248a46f7f78dc354cbb4a9","src/unescape/tests.rs":"5da0043e4a48f27b910d19c28ca443a5eb7d59d2aa16e8f08d4273d4f3754244"},"package":"f2e2f6b48422e4eed5218277ab7cc9733e60dd8f3167f4f36a49a0cafe4dc195"} \ No newline at end of file
diff --git a/vendor/ra-ap-rustc_lexer/Cargo.toml b/vendor/ra-ap-rustc_lexer/Cargo.toml
index 662b3cea4..eb5deaf8d 100644
--- a/vendor/ra-ap-rustc_lexer/Cargo.toml
+++ b/vendor/ra-ap-rustc_lexer/Cargo.toml
@@ -12,11 +12,11 @@
[package]
edition = "2021"
name = "ra-ap-rustc_lexer"
-version = "0.1.0"
+version = "0.10.0"
description = """
Automatically published version of the package `rustc_lexer`
-in the rust-lang/rust repository from commit 77c836e1ae582661924d3b6ec4d57a2de120f59f
+in the rust-lang/rust repository from commit d5573d708d548f07070f4052509cdd137a035e7f
The publishing script for this crate lives at:
https://github.com/rust-analyzer/rustc-auto-publish
@@ -26,8 +26,10 @@ repository = "https://github.com/rust-lang/rust"
[lib]
-[dependencies.unic-emoji-char]
-version = "0.9.0"
+[dependencies.unicode-properties]
+version = "0.1.0"
+features = ["emoji"]
+default-features = false
[dependencies.unicode-xid]
version = "0.2.0"
diff --git a/vendor/ra-ap-rustc_lexer/src/cursor.rs b/vendor/ra-ap-rustc_lexer/src/cursor.rs
index eceef5980..aba7f9548 100644
--- a/vendor/ra-ap-rustc_lexer/src/cursor.rs
+++ b/vendor/ra-ap-rustc_lexer/src/cursor.rs
@@ -24,6 +24,10 @@ impl<'a> Cursor<'a> {
}
}
+ pub fn as_str(&self) -> &'a str {
+ self.chars.as_str()
+ }
+
/// Returns the last eaten symbol (or `'\0'` in release builds).
/// (For debug assertions only.)
pub(crate) fn prev(&self) -> char {
diff --git a/vendor/ra-ap-rustc_lexer/src/lib.rs b/vendor/ra-ap-rustc_lexer/src/lib.rs
index d511d2b12..43dfd34a6 100644
--- a/vendor/ra-ap-rustc_lexer/src/lib.rs
+++ b/vendor/ra-ap-rustc_lexer/src/lib.rs
@@ -34,6 +34,7 @@ pub use crate::cursor::Cursor;
use self::LiteralKind::*;
use self::TokenKind::*;
use crate::cursor::EOF_CHAR;
+use unicode_properties::UnicodeEmoji;
/// Parsed token.
/// It doesn't contain information about data that has been parsed,
@@ -428,9 +429,7 @@ impl Cursor<'_> {
Literal { kind, suffix_start }
}
// Identifier starting with an emoji. Only lexed for graceful error recovery.
- c if !c.is_ascii() && unic_emoji_char::is_emoji(c) => {
- self.fake_ident_or_unknown_prefix()
- }
+ c if !c.is_ascii() && c.is_emoji_char() => self.fake_ident_or_unknown_prefix(),
_ => Unknown,
};
let res = Token::new(token_kind, self.pos_within_token());
@@ -514,9 +513,7 @@ impl Cursor<'_> {
// we see a prefix here, it is definitely an unknown prefix.
match self.first() {
'#' | '"' | '\'' => UnknownPrefix,
- c if !c.is_ascii() && unic_emoji_char::is_emoji(c) => {
- self.fake_ident_or_unknown_prefix()
- }
+ c if !c.is_ascii() && c.is_emoji_char() => self.fake_ident_or_unknown_prefix(),
_ => Ident,
}
}
@@ -525,7 +522,7 @@ impl Cursor<'_> {
// Start is already eaten, eat the rest of identifier.
self.eat_while(|c| {
unicode_xid::UnicodeXID::is_xid_continue(c)
- || (!c.is_ascii() && unic_emoji_char::is_emoji(c))
+ || (!c.is_ascii() && c.is_emoji_char())
|| c == '\u{200d}'
});
// Known prefixes must have been handled earlier. So if
diff --git a/vendor/ra-ap-rustc_lexer/src/unescape.rs b/vendor/ra-ap-rustc_lexer/src/unescape.rs
index c9ad54d8d..717b042fb 100644
--- a/vendor/ra-ap-rustc_lexer/src/unescape.rs
+++ b/vendor/ra-ap-rustc_lexer/src/unescape.rs
@@ -372,7 +372,7 @@ where
callback(start..end, EscapeError::MultipleSkippedLinesWarning);
}
let tail = &tail[first_non_space..];
- if let Some(c) = tail.chars().nth(0) {
+ if let Some(c) = tail.chars().next() {
if c.is_whitespace() {
// For error reporting, we would like the span to contain the character that was not
// skipped. The +1 is necessary to account for the leading \ that started the escape.