diff --git a/Cargo.lock b/Cargo.lock index 006a17622d..cfb081e187 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -760,7 +760,7 @@ dependencies = [ "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "ra_text_edit 0.1.0", - "rowan 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rowan 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "smol_str 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "test_utils 0.1.0", "text_unit 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -975,7 +975,7 @@ dependencies = [ [[package]] name = "rowan" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1573,7 +1573,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum relative-path 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e7790c7f1cc73d831d28dc5a7deb316a006e7848e6a7f467cdb10a0a9e0fb1c" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" "checksum ron 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d9cb28ade964585205aaca1f3d41a6297f72e1ad097b49c4bbde033ef86b38d7" -"checksum rowan 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ae9ae7dba5e703f423ceb8646d636c73e6d858a2f8c834808b4565e42ccda9e2" +"checksum rowan 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4df666a130f870e6ac76fa525b0b6d984cfeee8f4cd675f2a125f0aced79c5f7" "checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619" "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 43fb2fc4ce..6b5be27be8 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs @@ -3,7 +3,7 @@ use std::{fs, io::Read, path::Path, time::Instant}; use clap::{App, Arg, SubCommand}; use join_to_string::join; use ra_ide_api_light::{extend_selection, file_structure, syntax_tree}; -use ra_syntax::{SourceFile, TextRange, TreePtr, AstNode}; +use ra_syntax::{SourceFile, TextRange, TreeArc, AstNode}; use tools::collect_tests; type Result = ::std::result::Result; @@ -71,7 +71,7 @@ fn main() -> Result<()> { Ok(()) } -fn file() -> Result> { +fn file() -> Result> { let text = read_stdin()?; Ok(SourceFile::parse(&text)) } diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 20e712afe3..0c4dfc8c68 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs @@ -7,7 +7,7 @@ pub mod mock; use std::panic; -use ra_syntax::{TextUnit, TextRange, SourceFile, TreePtr}; +use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc}; pub use crate::{ cancellation::{Canceled, Cancelable}, @@ -40,13 +40,13 @@ pub trait BaseDatabase: salsa::Database + panic::RefUnwindSafe { salsa::query_group! { pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { - fn source_file(file_id: FileId) -> TreePtr { + fn source_file(file_id: FileId) -> TreeArc { type SourceFileQuery; } } } -fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreePtr { +fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc { let text = db.file_text(file_id); SourceFile::parse(&*text) } diff --git a/crates/ra_db/src/syntax_ptr.rs b/crates/ra_db/src/syntax_ptr.rs index be64d417ce..5270826da3 100644 --- a/crates/ra_db/src/syntax_ptr.rs +++ b/crates/ra_db/src/syntax_ptr.rs @@ -1,4 +1,4 @@ -use ra_syntax::{AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TreePtr}; +use ra_syntax::{AstNode, SourceFile, SyntaxKind, SyntaxNode, TextRange, TreeArc}; /// A pointer to a syntax node inside a file. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] @@ -15,7 +15,7 @@ impl LocalSyntaxPtr { } } - pub fn resolve(self, file: &SourceFile) -> TreePtr { + pub fn resolve(self, file: &SourceFile) -> TreeArc { let mut curr = file.syntax(); loop { if curr.range() == self.range && curr.kind() == self.kind { diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 8ec6b9b2b0..098c7f40b4 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use relative_path::RelativePathBuf; use ra_db::{CrateId, Cancelable, FileId}; -use ra_syntax::{ast, TreePtr, SyntaxNode, AstNode}; +use ra_syntax::{ast, TreeArc, SyntaxNode, AstNode}; use crate::{ Name, DefId, Path, PerNs, ScopesWithSyntaxMapping, Ty, HirFileId, @@ -55,8 +55,8 @@ pub struct Module { } pub enum ModuleSource { - SourceFile(TreePtr), - Module(TreePtr), + SourceFile(TreeArc), + Module(TreeArc), } #[derive(Clone, Debug, Hash, PartialEq, Eq)] @@ -86,7 +86,7 @@ impl Module { pub fn declaration_source( &self, db: &impl HirDatabase, - ) -> Cancelable)>> { + ) -> Cancelable)>> { self.declaration_source_impl(db) } @@ -134,7 +134,7 @@ impl Module { pub fn problems( &self, db: &impl HirDatabase, - ) -> Cancelable, Problem)>> { + ) -> Cancelable, Problem)>> { self.problems_impl(db) } } @@ -185,7 +185,7 @@ impl Struct { pub fn source( &self, db: &impl HirDatabase, - ) -> Cancelable<(HirFileId, TreePtr)> { + ) -> Cancelable<(HirFileId, TreeArc)> { let (file_id, syntax) = self.def_id.source(db); Ok(( file_id, @@ -218,7 +218,7 @@ impl Enum { Ok(db.enum_data(self.def_id)?.variants.clone()) } - pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreePtr)> { + pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc)> { let (file_id, syntax) = self.def_id.source(db); Ok(( file_id, @@ -258,7 +258,7 @@ impl EnumVariant { pub fn source( &self, db: &impl HirDatabase, - ) -> Cancelable<(HirFileId, TreePtr)> { + ) -> Cancelable<(HirFileId, TreeArc)> { let (file_id, syntax) = self.def_id.source(db); Ok(( file_id, @@ -303,7 +303,7 @@ impl Function { self.def_id } - pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreePtr)> { + pub fn source(&self, db: &impl HirDatabase) -> Cancelable<(HirFileId, TreeArc)> { Ok(self.source_impl(db)) } diff --git a/crates/ra_hir/src/code_model_impl/function.rs b/crates/ra_hir/src/code_model_impl/function.rs index 009175bab9..daf49e7915 100644 --- a/crates/ra_hir/src/code_model_impl/function.rs +++ b/crates/ra_hir/src/code_model_impl/function.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use ra_db::Cancelable; use ra_syntax::{ - TreePtr, + TreeArc, ast::{self, AstNode, NameOwner}, }; @@ -22,7 +22,7 @@ impl Function { Function { def_id } } - pub(crate) fn source_impl(&self, db: &impl HirDatabase) -> (HirFileId, TreePtr) { + pub(crate) fn source_impl(&self, db: &impl HirDatabase) -> (HirFileId, TreeArc) { let def_loc = self.def_id.loc(db); assert!(def_loc.kind == DefKind::Function); let syntax = db.file_item(def_loc.source_item_id); diff --git a/crates/ra_hir/src/code_model_impl/module.rs b/crates/ra_hir/src/code_model_impl/module.rs index 878dc37c8a..e9ff06dc86 100644 --- a/crates/ra_hir/src/code_model_impl/module.rs +++ b/crates/ra_hir/src/code_model_impl/module.rs @@ -1,5 +1,5 @@ use ra_db::{Cancelable, SourceRootId, FileId}; -use ra_syntax::{ast, SyntaxNode, AstNode, TreePtr}; +use ra_syntax::{ast, SyntaxNode, AstNode, TreeArc}; use crate::{ Module, ModuleSource, Problem, @@ -57,7 +57,7 @@ impl Module { pub fn declaration_source_impl( &self, db: &impl HirDatabase, - ) -> Cancelable)>> { + ) -> Cancelable)>> { let loc = self.def_id.loc(db); let module_tree = db.module_tree(loc.source_root_id)?; let link = ctry!(loc.module_id.parent_link(&module_tree)); @@ -173,7 +173,7 @@ impl Module { pub fn problems_impl( &self, db: &impl HirDatabase, - ) -> Cancelable, Problem)>> { + ) -> Cancelable, Problem)>> { let loc = self.def_id.loc(db); let module_tree = db.module_tree(loc.source_root_id)?; Ok(loc.module_id.problems(&module_tree, db)) diff --git a/crates/ra_hir/src/db.rs b/crates/ra_hir/src/db.rs index 9a6ef8083c..a11c73db0c 100644 --- a/crates/ra_hir/src/db.rs +++ b/crates/ra_hir/src/db.rs @@ -1,6 +1,6 @@ use std::sync::Arc; -use ra_syntax::{SyntaxNode, TreePtr, SourceFile}; +use ra_syntax::{SyntaxNode, TreeArc, SourceFile}; use ra_db::{SourceRootId, LocationIntener, SyntaxDatabase, Cancelable}; use crate::{ @@ -22,7 +22,7 @@ pub trait HirDatabase: SyntaxDatabase + AsRef> + AsRef> { - fn hir_source_file(file_id: HirFileId) -> TreePtr { + fn hir_source_file(file_id: HirFileId) -> TreeArc { type HirSourceFileQuery; use fn HirFileId::hir_source_file; } @@ -72,7 +72,7 @@ pub trait HirDatabase: SyntaxDatabase use fn query_definitions::file_items; } - fn file_item(source_item_id: SourceItemId) -> TreePtr { + fn file_item(source_item_id: SourceItemId) -> TreeArc { type FileItemQuery; use fn query_definitions::file_item; } diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index c75ef4ae7a..0805fd3db5 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -1,5 +1,5 @@ use ra_db::{SourceRootId, LocationIntener, Cancelable, FileId}; -use ra_syntax::{TreePtr, SyntaxKind, SyntaxNode, SourceFile, AstNode, ast}; +use ra_syntax::{TreeArc, SyntaxKind, SyntaxNode, SourceFile, AstNode, ast}; use ra_arena::{Arena, RawId, impl_arena_id}; use crate::{ @@ -61,7 +61,7 @@ impl HirFileId { pub(crate) fn hir_source_file( db: &impl HirDatabase, file_id: HirFileId, - ) -> TreePtr { + ) -> TreeArc { match file_id.0 { HirFileIdRepr::File(file_id) => db.source_file(file_id), HirFileIdRepr::Macro(m) => { @@ -179,7 +179,7 @@ impl DefId { Ok(res) } - pub(crate) fn source(self, db: &impl HirDatabase) -> (HirFileId, TreePtr) { + pub(crate) fn source(self, db: &impl HirDatabase) -> (HirFileId, TreeArc) { let loc = self.loc(db); let syntax = db.file_item(loc.source_item_id); (loc.source_item_id.file_id, syntax) @@ -244,7 +244,7 @@ pub struct SourceItemId { #[derive(Debug, PartialEq, Eq)] pub struct SourceFileItems { file_id: HirFileId, - arena: Arena>, + arena: Arena>, } impl SourceFileItems { @@ -273,7 +273,7 @@ impl SourceFileItems { }) } - fn alloc(&mut self, item: TreePtr) -> SourceFileItemId { + fn alloc(&mut self, item: TreeArc) -> SourceFileItemId { self.arena.alloc(item) } pub(crate) fn id_of(&self, file_id: HirFileId, item: &SyntaxNode) -> SourceFileItemId { diff --git a/crates/ra_hir/src/macros.rs b/crates/ra_hir/src/macros.rs index e455b2ad59..220bee94e0 100644 --- a/crates/ra_hir/src/macros.rs +++ b/crates/ra_hir/src/macros.rs @@ -11,7 +11,7 @@ use std::sync::Arc; use ra_db::LocalSyntaxPtr; use ra_syntax::{ - TextRange, TextUnit, SourceFile, AstNode, SyntaxNode, TreePtr, + TextRange, TextUnit, SourceFile, AstNode, SyntaxNode, TreeArc, ast::{self, NameOwner}, }; @@ -152,11 +152,11 @@ pub struct MacroExpansion { impl MacroExpansion { // FIXME: does not really make sense, macro expansion is not neccessary a // whole file. See `MacroExpansion::ptr` as well. - pub(crate) fn file(&self) -> TreePtr { + pub(crate) fn file(&self) -> TreeArc { SourceFile::parse(&self.text) } - pub fn syntax(&self) -> TreePtr { + pub fn syntax(&self) -> TreeArc { self.ptr.resolve(&self.file()) } /// Maps range in the source code to the range in the expanded code. diff --git a/crates/ra_hir/src/module_tree.rs b/crates/ra_hir/src/module_tree.rs index 50383c6d8c..67823e9705 100644 --- a/crates/ra_hir/src/module_tree.rs +++ b/crates/ra_hir/src/module_tree.rs @@ -5,7 +5,7 @@ use arrayvec::ArrayVec; use relative_path::RelativePathBuf; use ra_db::{FileId, SourceRootId, Cancelable, SourceRoot}; use ra_syntax::{ - SyntaxNode, TreePtr, + SyntaxNode, TreeArc, algo::generate, ast::{self, AstNode, NameOwner}, }; @@ -170,7 +170,7 @@ impl ModuleId { self, tree: &ModuleTree, db: &impl HirDatabase, - ) -> Vec<(TreePtr, Problem)> { + ) -> Vec<(TreeArc, Problem)> { tree.mods[self] .children .iter() @@ -191,7 +191,7 @@ impl LinkId { pub(crate) fn name(self, tree: &ModuleTree) -> &Name { &tree.links[self].name } - pub(crate) fn source(self, tree: &ModuleTree, db: &impl HirDatabase) -> TreePtr { + pub(crate) fn source(self, tree: &ModuleTree, db: &impl HirDatabase) -> TreeArc { let syntax_node = db.file_item(tree.links[self].source); ast::Module::cast(&syntax_node).unwrap().to_owned() } diff --git a/crates/ra_hir/src/query_definitions.rs b/crates/ra_hir/src/query_definitions.rs index 32be23d8c3..214a9d68b8 100644 --- a/crates/ra_hir/src/query_definitions.rs +++ b/crates/ra_hir/src/query_definitions.rs @@ -5,7 +5,7 @@ use std::{ use rustc_hash::FxHashMap; use ra_syntax::{ - AstNode, SyntaxNode, TreePtr, + AstNode, SyntaxNode, TreeArc, ast::{self, ModuleItemOwner} }; use ra_db::{SourceRootId, Cancelable,}; @@ -33,7 +33,7 @@ pub(super) fn file_items(db: &impl HirDatabase, file_id: HirFileId) -> Arc TreePtr { +) -> TreeArc { match source_item_id.item_id { Some(id) => db.file_items(source_item_id.file_id)[id].to_owned(), None => db diff --git a/crates/ra_ide_api/src/hover.rs b/crates/ra_ide_api/src/hover.rs index f544ffa6d1..b66774cdfa 100644 --- a/crates/ra_ide_api/src/hover.rs +++ b/crates/ra_ide_api/src/hover.rs @@ -1,6 +1,6 @@ use ra_db::{Cancelable, SyntaxDatabase}; use ra_syntax::{ - AstNode, SyntaxNode, TreePtr, + AstNode, SyntaxNode, TreeArc, ast::{self, NameOwner}, algo::{find_covering_node, find_node_at_offset, find_leaf_at_offset, visit::{visitor, Visitor}}, }; @@ -87,7 +87,7 @@ fn doc_text_for(db: &RootDatabase, nav: NavigationTarget) -> Cancelable Option> { + fn node(&self, db: &RootDatabase) -> Option> { let source_file = db.source_file(self.file_id()); let source_file = source_file.syntax(); let node = source_file diff --git a/crates/ra_ide_api/src/lib.rs b/crates/ra_ide_api/src/lib.rs index 6155d903a0..abb50ff954 100644 --- a/crates/ra_ide_api/src/lib.rs +++ b/crates/ra_ide_api/src/lib.rs @@ -35,7 +35,7 @@ mod parent_module; use std::{fmt, sync::Arc}; -use ra_syntax::{SourceFile, TreePtr, TextRange, TextUnit}; +use ra_syntax::{SourceFile, TreeArc, TextRange, TextUnit}; use ra_text_edit::TextEdit; use ra_db::{SyntaxDatabase, FilesDatabase, BaseDatabase}; use rayon::prelude::*; @@ -303,7 +303,7 @@ impl Analysis { } /// Gets the syntax tree of the file. - pub fn file_syntax(&self, file_id: FileId) -> TreePtr { + pub fn file_syntax(&self, file_id: FileId) -> TreeArc { self.db.source_file(file_id).clone() } diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs index 8dd15b40e5..fdda570223 100644 --- a/crates/ra_ide_api/src/symbol_index.rs +++ b/crates/ra_ide_api/src/symbol_index.rs @@ -27,7 +27,7 @@ use std::{ use fst::{self, Streamer}; use ra_syntax::{ - SyntaxNode, SourceFile, SmolStr, TreePtr, AstNode, + SyntaxNode, SourceFile, SmolStr, TreeArc, AstNode, algo::{visit::{visitor, Visitor}, find_covering_node}, SyntaxKind::{self, *}, ast::{self, NameOwner}, @@ -141,7 +141,7 @@ impl SymbolIndex { } pub(crate) fn for_files( - files: impl ParallelIterator)>, + files: impl ParallelIterator)>, ) -> SymbolIndex { let symbols = files .flat_map(|(file_id, file)| { diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index d5b4a4a772..77cd6c8045 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml @@ -13,7 +13,7 @@ unicode-xid = "0.1.0" itertools = "0.8.0" drop_bomb = "0.1.4" parking_lot = "0.7.0" -rowan = "0.2.0" +rowan = "0.3.0" # ideally, `serde` should be enabled by `ra_lsp_serder`, but we enable it here # to reduce number of compilations diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index d25b5642b0..123a7a6b9a 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs @@ -6,7 +6,7 @@ use itertools::Itertools; pub use self::generated::*; use crate::{ - yellow::{SyntaxNode, SyntaxNodeChildren, TreePtr, RaTypes}, + yellow::{SyntaxNode, SyntaxNodeChildren, TreeArc, RaTypes}, SmolStr, SyntaxKind::*, }; @@ -20,7 +20,7 @@ pub trait AstNode: rowan::TransparentNewType> where Self: Sized; fn syntax(&self) -> &SyntaxNode; - fn to_owned(&self) -> TreePtr; + fn to_owned(&self) -> TreeArc; } pub trait AstToken: AstNode { diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 547e3c0033..1f60551154 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs @@ -13,7 +13,7 @@ use rowan::TransparentNewType; use crate::{ SyntaxNode, SyntaxKind::*, - yellow::{RaTypes, TreePtr}, + yellow::{RaTypes, TreeArc}, ast::{self, AstNode}, }; @@ -35,7 +35,7 @@ impl AstNode for ArgList { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -63,7 +63,7 @@ impl AstNode for ArrayExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -87,7 +87,7 @@ impl AstNode for ArrayType { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -119,7 +119,7 @@ impl AstNode for Attr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -147,7 +147,7 @@ impl AstNode for BinExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -171,7 +171,7 @@ impl AstNode for BindPat { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -196,7 +196,7 @@ impl AstNode for Block { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -228,7 +228,7 @@ impl AstNode for BlockExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -256,7 +256,7 @@ impl AstNode for BreakExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -284,7 +284,7 @@ impl AstNode for Byte { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -309,7 +309,7 @@ impl AstNode for ByteString { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -334,7 +334,7 @@ impl AstNode for CallExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -363,7 +363,7 @@ impl AstNode for CastExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -395,7 +395,7 @@ impl AstNode for Char { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -420,7 +420,7 @@ impl AstNode for Comment { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -445,7 +445,7 @@ impl AstNode for Condition { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -477,7 +477,7 @@ impl AstNode for ConstDef { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -506,7 +506,7 @@ impl AstNode for ContinueExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -530,7 +530,7 @@ impl AstNode for DynTraitType { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -554,7 +554,7 @@ impl AstNode for EnumDef { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -587,7 +587,7 @@ impl AstNode for EnumVariant { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -616,7 +616,7 @@ impl AstNode for EnumVariantList { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -701,7 +701,7 @@ impl AstNode for Expr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } impl Expr { @@ -759,7 +759,7 @@ impl AstNode for ExprStmt { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -787,7 +787,7 @@ impl AstNode for ExternCrateItem { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -811,7 +811,7 @@ impl AstNode for FieldExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -843,7 +843,7 @@ impl AstNode for FieldPatList { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -867,7 +867,7 @@ impl AstNode for FnDef { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -908,7 +908,7 @@ impl AstNode for FnPointerType { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -940,7 +940,7 @@ impl AstNode for ForExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -973,7 +973,7 @@ impl AstNode for ForType { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -1001,7 +1001,7 @@ impl AstNode for IfExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -1029,7 +1029,7 @@ impl AstNode for ImplBlock { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -1066,7 +1066,7 @@ impl AstNode for ImplItem { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } impl ImplItem { @@ -1100,7 +1100,7 @@ impl AstNode for ImplTraitType { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -1124,7 +1124,7 @@ impl AstNode for IndexExpr { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -1148,7 +1148,7 @@ impl AstNode for ItemList { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr { TreePtr::cast(self.syntax.to_owned()) } + fn to_owned(&self) -> TreeArc { TreeArc::cast(self.syntax.to_owned()) } } @@ -1178,7 +1178,7 @@ impl AstNode for Label { } } fn syntax(&self) -> &SyntaxNode { &self.syntax } - fn to_owned(&self) -> TreePtr