diff options
-rw-r--r-- | Cargo.lock | 34 | ||||
-rw-r--r-- | crates/hir_expand/src/db.rs | 2 | ||||
-rw-r--r-- | crates/syntax/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/syntax/src/algo.rs | 7 | ||||
-rw-r--r-- | crates/syntax/src/ast/make.rs | 2 |
5 files changed, 11 insertions, 36 deletions
diff --git a/Cargo.lock b/Cargo.lock index 901784bec..c9e0d63a6 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -323,7 +323,7 @@ dependencies = [ | |||
323 | "const_fn", | 323 | "const_fn", |
324 | "crossbeam-utils 0.8.1", | 324 | "crossbeam-utils 0.8.1", |
325 | "lazy_static", | 325 | "lazy_static", |
326 | "memoffset 0.6.1", | 326 | "memoffset", |
327 | "scopeguard", | 327 | "scopeguard", |
328 | ] | 328 | ] |
329 | 329 | ||
@@ -942,15 +942,6 @@ dependencies = [ | |||
942 | 942 | ||
943 | [[package]] | 943 | [[package]] |
944 | name = "memoffset" | 944 | name = "memoffset" |
945 | version = "0.5.6" | ||
946 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
947 | checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" | ||
948 | dependencies = [ | ||
949 | "autocfg", | ||
950 | ] | ||
951 | |||
952 | [[package]] | ||
953 | name = "memoffset" | ||
954 | version = "0.6.1" | 945 | version = "0.6.1" |
955 | source = "registry+https://github.com/rust-lang/crates.io-index" | 946 | source = "registry+https://github.com/rust-lang/crates.io-index" |
956 | checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" | 947 | checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" |
@@ -1384,15 +1375,15 @@ checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" | |||
1384 | 1375 | ||
1385 | [[package]] | 1376 | [[package]] |
1386 | name = "rowan" | 1377 | name = "rowan" |
1387 | version = "0.10.6" | 1378 | version = "0.11.0" |
1388 | source = "registry+https://github.com/rust-lang/crates.io-index" | 1379 | source = "registry+https://github.com/rust-lang/crates.io-index" |
1389 | checksum = "8a0734142c18710f7214dc21908e2f054e973b908dbb1a602a3e6691615aaaae" | 1380 | checksum = "b3ae0ae5091cf38acfb834dbb6adcd45bb0d6b6a72ca5798e134195d2fa33574" |
1390 | dependencies = [ | 1381 | dependencies = [ |
1391 | "hashbrown", | 1382 | "hashbrown", |
1383 | "memoffset", | ||
1392 | "rustc-hash", | 1384 | "rustc-hash", |
1393 | "smol_str", | 1385 | "smol_str", |
1394 | "text-size", | 1386 | "text-size", |
1395 | "triomphe", | ||
1396 | ] | 1387 | ] |
1397 | 1388 | ||
1398 | [[package]] | 1389 | [[package]] |
@@ -1639,12 +1630,6 @@ dependencies = [ | |||
1639 | ] | 1630 | ] |
1640 | 1631 | ||
1641 | [[package]] | 1632 | [[package]] |
1642 | name = "stable_deref_trait" | ||
1643 | version = "1.2.0" | ||
1644 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1645 | checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" | ||
1646 | |||
1647 | [[package]] | ||
1648 | name = "stdx" | 1633 | name = "stdx" |
1649 | version = "0.0.0" | 1634 | version = "0.0.0" |
1650 | dependencies = [ | 1635 | dependencies = [ |
@@ -1872,17 +1857,6 @@ dependencies = [ | |||
1872 | ] | 1857 | ] |
1873 | 1858 | ||
1874 | [[package]] | 1859 | [[package]] |
1875 | name = "triomphe" | ||
1876 | version = "0.1.2" | ||
1877 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
1878 | checksum = "6e9d872053cf9e5a833d8c1dd772cdc38ab66a908129d6f73c049c986161d07c" | ||
1879 | dependencies = [ | ||
1880 | "memoffset 0.5.6", | ||
1881 | "serde", | ||
1882 | "stable_deref_trait", | ||
1883 | ] | ||
1884 | |||
1885 | [[package]] | ||
1886 | name = "tt" | 1860 | name = "tt" |
1887 | version = "0.0.0" | 1861 | version = "0.0.0" |
1888 | dependencies = [ | 1862 | dependencies = [ |
diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs index 467516eb7..cb6e23320 100644 --- a/crates/hir_expand/src/db.rs +++ b/crates/hir_expand/src/db.rs | |||
@@ -173,7 +173,7 @@ fn macro_arg_text(db: &dyn AstDatabase, id: MacroCallId) -> Option<GreenNode> { | |||
173 | }; | 173 | }; |
174 | let loc = db.lookup_intern_macro(id); | 174 | let loc = db.lookup_intern_macro(id); |
175 | let arg = loc.kind.arg(db)?; | 175 | let arg = loc.kind.arg(db)?; |
176 | Some(arg.green().clone()) | 176 | Some(arg.green().to_owned()) |
177 | } | 177 | } |
178 | 178 | ||
179 | fn macro_arg(db: &dyn AstDatabase, id: MacroCallId) -> Option<Arc<(tt::Subtree, mbe::TokenMap)>> { | 179 | fn macro_arg(db: &dyn AstDatabase, id: MacroCallId) -> Option<Arc<(tt::Subtree, mbe::TokenMap)>> { |
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 52394b337..37d3faa03 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml | |||
@@ -12,7 +12,7 @@ doctest = false | |||
12 | 12 | ||
13 | [dependencies] | 13 | [dependencies] |
14 | itertools = "0.10.0" | 14 | itertools = "0.10.0" |
15 | rowan = "0.10.3" | 15 | rowan = "0.11" |
16 | rustc_lexer = { version = "697.0.0", package = "rustc-ap-rustc_lexer" } | 16 | rustc_lexer = { version = "697.0.0", package = "rustc-ap-rustc_lexer" } |
17 | rustc-hash = "1.1.0" | 17 | rustc-hash = "1.1.0" |
18 | arrayvec = "0.5.1" | 18 | arrayvec = "0.5.1" |
diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 827ae78f9..2ff92f9f6 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs | |||
@@ -4,6 +4,7 @@ use std::{ | |||
4 | fmt, | 4 | fmt, |
5 | hash::BuildHasherDefault, | 5 | hash::BuildHasherDefault, |
6 | ops::{self, RangeInclusive}, | 6 | ops::{self, RangeInclusive}, |
7 | ptr, | ||
7 | }; | 8 | }; |
8 | 9 | ||
9 | use indexmap::IndexMap; | 10 | use indexmap::IndexMap; |
@@ -171,7 +172,7 @@ pub fn diff(from: &SyntaxNode, to: &SyntaxNode) -> TreeDiff { | |||
171 | && lhs.text_range().len() == rhs.text_range().len() | 172 | && lhs.text_range().len() == rhs.text_range().len() |
172 | && match (&lhs, &rhs) { | 173 | && match (&lhs, &rhs) { |
173 | (NodeOrToken::Node(lhs), NodeOrToken::Node(rhs)) => { | 174 | (NodeOrToken::Node(lhs), NodeOrToken::Node(rhs)) => { |
174 | lhs.green() == rhs.green() || lhs.text() == rhs.text() | 175 | ptr::eq(lhs.green(), rhs.green()) || lhs.text() == rhs.text() |
175 | } | 176 | } |
176 | (NodeOrToken::Token(lhs), NodeOrToken::Token(rhs)) => lhs.text() == rhs.text(), | 177 | (NodeOrToken::Token(lhs), NodeOrToken::Token(rhs)) => lhs.text() == rhs.text(), |
177 | _ => false, | 178 | _ => false, |
@@ -566,7 +567,7 @@ impl<'a> SyntaxRewriter<'a> { | |||
566 | 567 | ||
567 | fn element_to_green(element: SyntaxElement) -> NodeOrToken<rowan::GreenNode, rowan::GreenToken> { | 568 | fn element_to_green(element: SyntaxElement) -> NodeOrToken<rowan::GreenNode, rowan::GreenToken> { |
568 | match element { | 569 | match element { |
569 | NodeOrToken::Node(it) => NodeOrToken::Node(it.green().clone()), | 570 | NodeOrToken::Node(it) => NodeOrToken::Node(it.green().to_owned()), |
570 | NodeOrToken::Token(it) => NodeOrToken::Token(it.green().clone()), | 571 | NodeOrToken::Token(it) => NodeOrToken::Token(it.green().clone()), |
571 | } | 572 | } |
572 | } | 573 | } |
@@ -624,7 +625,7 @@ fn position_of_child(parent: &SyntaxNode, child: SyntaxElement) -> usize { | |||
624 | 625 | ||
625 | fn to_green_element(element: SyntaxElement) -> NodeOrToken<rowan::GreenNode, rowan::GreenToken> { | 626 | fn to_green_element(element: SyntaxElement) -> NodeOrToken<rowan::GreenNode, rowan::GreenToken> { |
626 | match element { | 627 | match element { |
627 | NodeOrToken::Node(it) => it.green().clone().into(), | 628 | NodeOrToken::Node(it) => it.green().to_owned().into(), |
628 | NodeOrToken::Token(it) => it.green().clone().into(), | 629 | NodeOrToken::Token(it) => it.green().clone().into(), |
629 | } | 630 | } |
630 | } | 631 | } |
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 9ffc3ae11..cc1717237 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs | |||
@@ -478,7 +478,7 @@ fn ast_from_text<N: AstNode>(text: &str) -> N { | |||
478 | } | 478 | } |
479 | 479 | ||
480 | fn unroot(n: SyntaxNode) -> SyntaxNode { | 480 | fn unroot(n: SyntaxNode) -> SyntaxNode { |
481 | SyntaxNode::new_root(n.green().clone()) | 481 | SyntaxNode::new_root(n.green().to_owned()) |
482 | } | 482 | } |
483 | 483 | ||
484 | pub mod tokens { | 484 | pub mod tokens { |