diff --git a/Cargo.lock b/Cargo.lock index 901784bec0..c9e0d63a60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -323,7 +323,7 @@ dependencies = [ "const_fn", "crossbeam-utils 0.8.1", "lazy_static", - "memoffset 0.6.1", + "memoffset", "scopeguard", ] @@ -940,15 +940,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.6.1" @@ -1384,15 +1375,15 @@ checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "rowan" -version = "0.10.6" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0734142c18710f7214dc21908e2f054e973b908dbb1a602a3e6691615aaaae" +checksum = "b3ae0ae5091cf38acfb834dbb6adcd45bb0d6b6a72ca5798e134195d2fa33574" dependencies = [ "hashbrown", + "memoffset", "rustc-hash", "smol_str", "text-size", - "triomphe", ] [[package]] @@ -1638,12 +1629,6 @@ dependencies = [ "text_edit", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "stdx" version = "0.0.0" @@ -1871,17 +1856,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "triomphe" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9d872053cf9e5a833d8c1dd772cdc38ab66a908129d6f73c049c986161d07c" -dependencies = [ - "memoffset 0.5.6", - "serde", - "stable_deref_trait", -] - [[package]] name = "tt" version = "0.0.0" diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs index 467516eb74..cb6e233209 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 { }; let loc = db.lookup_intern_macro(id); let arg = loc.kind.arg(db)?; - Some(arg.green().clone()) + Some(arg.green().to_owned()) } fn macro_arg(db: &dyn AstDatabase, id: MacroCallId) -> Option> { diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 52394b3373..37d3faa03f 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] itertools = "0.10.0" -rowan = "0.10.3" +rowan = "0.11" rustc_lexer = { version = "697.0.0", package = "rustc-ap-rustc_lexer" } rustc-hash = "1.1.0" arrayvec = "0.5.1" diff --git a/crates/syntax/src/algo.rs b/crates/syntax/src/algo.rs index 827ae78f95..2ff92f9f62 100644 --- a/crates/syntax/src/algo.rs +++ b/crates/syntax/src/algo.rs @@ -4,6 +4,7 @@ use std::{ fmt, hash::BuildHasherDefault, ops::{self, RangeInclusive}, + ptr, }; use indexmap::IndexMap; @@ -171,7 +172,7 @@ pub fn diff(from: &SyntaxNode, to: &SyntaxNode) -> TreeDiff { && lhs.text_range().len() == rhs.text_range().len() && match (&lhs, &rhs) { (NodeOrToken::Node(lhs), NodeOrToken::Node(rhs)) => { - lhs.green() == rhs.green() || lhs.text() == rhs.text() + ptr::eq(lhs.green(), rhs.green()) || lhs.text() == rhs.text() } (NodeOrToken::Token(lhs), NodeOrToken::Token(rhs)) => lhs.text() == rhs.text(), _ => false, @@ -566,7 +567,7 @@ impl<'a> SyntaxRewriter<'a> { fn element_to_green(element: SyntaxElement) -> NodeOrToken { match element { - NodeOrToken::Node(it) => NodeOrToken::Node(it.green().clone()), + NodeOrToken::Node(it) => NodeOrToken::Node(it.green().to_owned()), NodeOrToken::Token(it) => NodeOrToken::Token(it.green().clone()), } } @@ -624,7 +625,7 @@ fn position_of_child(parent: &SyntaxNode, child: SyntaxElement) -> usize { fn to_green_element(element: SyntaxElement) -> NodeOrToken { match element { - NodeOrToken::Node(it) => it.green().clone().into(), + NodeOrToken::Node(it) => it.green().to_owned().into(), NodeOrToken::Token(it) => it.green().clone().into(), } } diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 9ffc3ae110..cc1717237d 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -478,7 +478,7 @@ fn ast_from_text(text: &str) -> N { } fn unroot(n: SyntaxNode) -> SyntaxNode { - SyntaxNode::new_root(n.green().clone()) + SyntaxNode::new_root(n.green().to_owned()) } pub mod tokens {