diff options
author | Aleksey Kladov <[email protected]> | 2019-01-11 16:59:06 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-11 16:59:06 +0000 |
commit | 2d3940d0ab862dbfaed4f4c844faaca6a38e31e9 (patch) | |
tree | 0d8412f73a0fa6f9c1e6913e6133d3daf25dcb91 /crates/ra_syntax | |
parent | aad1bf877e4ba5ce9e28e8bde14f790ef8d1551b (diff) |
rename TreePtr -> TreeArc
This is much clearer about the semantics
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r-- | crates/ra_syntax/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs | 226 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/generated.rs.tera | 6 | ||||
-rw-r--r-- | crates/ra_syntax/src/lib.rs | 14 | ||||
-rw-r--r-- | crates/ra_syntax/src/validation/byte.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/validation/byte_string.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/validation/char.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/validation/string.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/src/yellow.rs | 34 |
10 files changed, 151 insertions, 151 deletions
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml index d5b4a4a77..77cd6c804 100644 --- a/crates/ra_syntax/Cargo.toml +++ b/crates/ra_syntax/Cargo.toml | |||
@@ -13,7 +13,7 @@ unicode-xid = "0.1.0" | |||
13 | itertools = "0.8.0" | 13 | itertools = "0.8.0" |
14 | drop_bomb = "0.1.4" | 14 | drop_bomb = "0.1.4" |
15 | parking_lot = "0.7.0" | 15 | parking_lot = "0.7.0" |
16 | rowan = "0.2.0" | 16 | rowan = "0.3.0" |
17 | 17 | ||
18 | # ideally, `serde` should be enabled by `ra_lsp_serder`, but we enable it here | 18 | # ideally, `serde` should be enabled by `ra_lsp_serder`, but we enable it here |
19 | # to reduce number of compilations | 19 | # to reduce number of compilations |
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs index d25b5642b..123a7a6b9 100644 --- a/crates/ra_syntax/src/ast.rs +++ b/crates/ra_syntax/src/ast.rs | |||
@@ -6,7 +6,7 @@ use itertools::Itertools; | |||
6 | 6 | ||
7 | pub use self::generated::*; | 7 | pub use self::generated::*; |
8 | use crate::{ | 8 | use crate::{ |
9 | yellow::{SyntaxNode, SyntaxNodeChildren, TreePtr, RaTypes}, | 9 | yellow::{SyntaxNode, SyntaxNodeChildren, TreeArc, RaTypes}, |
10 | SmolStr, | 10 | SmolStr, |
11 | SyntaxKind::*, | 11 | SyntaxKind::*, |
12 | }; | 12 | }; |
@@ -20,7 +20,7 @@ pub trait AstNode: rowan::TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>> | |||
20 | where | 20 | where |
21 | Self: Sized; | 21 | Self: Sized; |
22 | fn syntax(&self) -> &SyntaxNode; | 22 | fn syntax(&self) -> &SyntaxNode; |
23 | fn to_owned(&self) -> TreePtr<Self>; | 23 | fn to_owned(&self) -> TreeArc<Self>; |
24 | } | 24 | } |
25 | 25 | ||
26 | pub trait AstToken: AstNode { | 26 | pub trait AstToken: AstNode { |
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs index 547e3c003..1f6055115 100644 --- a/crates/ra_syntax/src/ast/generated.rs +++ b/crates/ra_syntax/src/ast/generated.rs | |||
@@ -13,7 +13,7 @@ use rowan::TransparentNewType; | |||
13 | 13 | ||
14 | use crate::{ | 14 | use crate::{ |
15 | SyntaxNode, SyntaxKind::*, | 15 | SyntaxNode, SyntaxKind::*, |
16 | yellow::{RaTypes, TreePtr}, | 16 | yellow::{RaTypes, TreeArc}, |
17 | ast::{self, AstNode}, | 17 | ast::{self, AstNode}, |
18 | }; | 18 | }; |
19 | 19 | ||
@@ -35,7 +35,7 @@ impl AstNode for ArgList { | |||
35 | } | 35 | } |
36 | } | 36 | } |
37 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 37 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
38 | fn to_owned(&self) -> TreePtr<ArgList> { TreePtr::cast(self.syntax.to_owned()) } | 38 | fn to_owned(&self) -> TreeArc<ArgList> { TreeArc::cast(self.syntax.to_owned()) } |
39 | } | 39 | } |
40 | 40 | ||
41 | 41 | ||
@@ -63,7 +63,7 @@ impl AstNode for ArrayExpr { | |||
63 | } | 63 | } |
64 | } | 64 | } |
65 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 65 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
66 | fn to_owned(&self) -> TreePtr<ArrayExpr> { TreePtr::cast(self.syntax.to_owned()) } | 66 | fn to_owned(&self) -> TreeArc<ArrayExpr> { TreeArc::cast(self.syntax.to_owned()) } |
67 | } | 67 | } |
68 | 68 | ||
69 | 69 | ||
@@ -87,7 +87,7 @@ impl AstNode for ArrayType { | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 89 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
90 | fn to_owned(&self) -> TreePtr<ArrayType> { TreePtr::cast(self.syntax.to_owned()) } | 90 | fn to_owned(&self) -> TreeArc<ArrayType> { TreeArc::cast(self.syntax.to_owned()) } |
91 | } | 91 | } |
92 | 92 | ||
93 | 93 | ||
@@ -119,7 +119,7 @@ impl AstNode for Attr { | |||
119 | } | 119 | } |
120 | } | 120 | } |
121 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 121 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
122 | fn to_owned(&self) -> TreePtr<Attr> { TreePtr::cast(self.syntax.to_owned()) } | 122 | fn to_owned(&self) -> TreeArc<Attr> { TreeArc::cast(self.syntax.to_owned()) } |
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
@@ -147,7 +147,7 @@ impl AstNode for BinExpr { | |||
147 | } | 147 | } |
148 | } | 148 | } |
149 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 149 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
150 | fn to_owned(&self) -> TreePtr<BinExpr> { TreePtr::cast(self.syntax.to_owned()) } | 150 | fn to_owned(&self) -> TreeArc<BinExpr> { TreeArc::cast(self.syntax.to_owned()) } |
151 | } | 151 | } |
152 | 152 | ||
153 | 153 | ||
@@ -171,7 +171,7 @@ impl AstNode for BindPat { | |||
171 | } | 171 | } |
172 | } | 172 | } |
173 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 173 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
174 | fn to_owned(&self) -> TreePtr<BindPat> { TreePtr::cast(self.syntax.to_owned()) } | 174 | fn to_owned(&self) -> TreeArc<BindPat> { TreeArc::cast(self.syntax.to_owned()) } |
175 | } | 175 | } |
176 | 176 | ||
177 | 177 | ||
@@ -196,7 +196,7 @@ impl AstNode for Block { | |||
196 | } | 196 | } |
197 | } | 197 | } |
198 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 198 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
199 | fn to_owned(&self) -> TreePtr<Block> { TreePtr::cast(self.syntax.to_owned()) } | 199 | fn to_owned(&self) -> TreeArc<Block> { TreeArc::cast(self.syntax.to_owned()) } |
200 | } | 200 | } |
201 | 201 | ||
202 | 202 | ||
@@ -228,7 +228,7 @@ impl AstNode for BlockExpr { | |||
228 | } | 228 | } |
229 | } | 229 | } |
230 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 230 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
231 | fn to_owned(&self) -> TreePtr<BlockExpr> { TreePtr::cast(self.syntax.to_owned()) } | 231 | fn to_owned(&self) -> TreeArc<BlockExpr> { TreeArc::cast(self.syntax.to_owned()) } |
232 | } | 232 | } |
233 | 233 | ||
234 | 234 | ||
@@ -256,7 +256,7 @@ impl AstNode for BreakExpr { | |||
256 | } | 256 | } |
257 | } | 257 | } |
258 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 258 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
259 | fn to_owned(&self) -> TreePtr<BreakExpr> { TreePtr::cast(self.syntax.to_owned()) } | 259 | fn to_owned(&self) -> TreeArc<BreakExpr> { TreeArc::cast(self.syntax.to_owned()) } |
260 | } | 260 | } |
261 | 261 | ||
262 | 262 | ||
@@ -284,7 +284,7 @@ impl AstNode for Byte { | |||
284 | } | 284 | } |
285 | } | 285 | } |
286 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 286 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
287 | fn to_owned(&self) -> TreePtr<Byte> { TreePtr::cast(self.syntax.to_owned()) } | 287 | fn to_owned(&self) -> TreeArc<Byte> { TreeArc::cast(self.syntax.to_owned()) } |
288 | } | 288 | } |
289 | 289 | ||
290 | 290 | ||
@@ -309,7 +309,7 @@ impl AstNode for ByteString { | |||
309 | } | 309 | } |
310 | } | 310 | } |
311 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 311 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
312 | fn to_owned(&self) -> TreePtr<ByteString> { TreePtr::cast(self.syntax.to_owned()) } | 312 | fn to_owned(&self) -> TreeArc<ByteString> { TreeArc::cast(self.syntax.to_owned()) } |
313 | } | 313 | } |
314 | 314 | ||
315 | 315 | ||
@@ -334,7 +334,7 @@ impl AstNode for CallExpr { | |||
334 | } | 334 | } |
335 | } | 335 | } |
336 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 336 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
337 | fn to_owned(&self) -> TreePtr<CallExpr> { TreePtr::cast(self.syntax.to_owned()) } | 337 | fn to_owned(&self) -> TreeArc<CallExpr> { TreeArc::cast(self.syntax.to_owned()) } |
338 | } | 338 | } |
339 | 339 | ||
340 | 340 | ||
@@ -363,7 +363,7 @@ impl AstNode for CastExpr { | |||
363 | } | 363 | } |
364 | } | 364 | } |
365 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 365 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
366 | fn to_owned(&self) -> TreePtr<CastExpr> { TreePtr::cast(self.syntax.to_owned()) } | 366 | fn to_owned(&self) -> TreeArc<CastExpr> { TreeArc::cast(self.syntax.to_owned()) } |
367 | } | 367 | } |
368 | 368 | ||
369 | 369 | ||
@@ -395,7 +395,7 @@ impl AstNode for Char { | |||
395 | } | 395 | } |
396 | } | 396 | } |
397 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 397 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
398 | fn to_owned(&self) -> TreePtr<Char> { TreePtr::cast(self.syntax.to_owned()) } | 398 | fn to_owned(&self) -> TreeArc<Char> { TreeArc::cast(self.syntax.to_owned()) } |
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
@@ -420,7 +420,7 @@ impl AstNode for Comment { | |||
420 | } | 420 | } |
421 | } | 421 | } |
422 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 422 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
423 | fn to_owned(&self) -> TreePtr<Comment> { TreePtr::cast(self.syntax.to_owned()) } | 423 | fn to_owned(&self) -> TreeArc<Comment> { TreeArc::cast(self.syntax.to_owned()) } |
424 | } | 424 | } |
425 | 425 | ||
426 | 426 | ||
@@ -445,7 +445,7 @@ impl AstNode for Condition { | |||
445 | } | 445 | } |
446 | } | 446 | } |
447 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 447 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
448 | fn to_owned(&self) -> TreePtr<Condition> { TreePtr::cast(self.syntax.to_owned()) } | 448 | fn to_owned(&self) -> TreeArc<Condition> { TreeArc::cast(self.syntax.to_owned()) } |
449 | } | 449 | } |
450 | 450 | ||
451 | 451 | ||
@@ -477,7 +477,7 @@ impl AstNode for ConstDef { | |||
477 | } | 477 | } |
478 | } | 478 | } |
479 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 479 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
480 | fn to_owned(&self) -> TreePtr<ConstDef> { TreePtr::cast(self.syntax.to_owned()) } | 480 | fn to_owned(&self) -> TreeArc<ConstDef> { TreeArc::cast(self.syntax.to_owned()) } |
481 | } | 481 | } |
482 | 482 | ||
483 | 483 | ||
@@ -506,7 +506,7 @@ impl AstNode for ContinueExpr { | |||
506 | } | 506 | } |
507 | } | 507 | } |
508 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 508 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
509 | fn to_owned(&self) -> TreePtr<ContinueExpr> { TreePtr::cast(self.syntax.to_owned()) } | 509 | fn to_owned(&self) -> TreeArc<ContinueExpr> { TreeArc::cast(self.syntax.to_owned()) } |
510 | } | 510 | } |
511 | 511 | ||
512 | 512 | ||
@@ -530,7 +530,7 @@ impl AstNode for DynTraitType { | |||
530 | } | 530 | } |
531 | } | 531 | } |
532 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 532 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
533 | fn to_owned(&self) -> TreePtr<DynTraitType> { TreePtr::cast(self.syntax.to_owned()) } | 533 | fn to_owned(&self) -> TreeArc<DynTraitType> { TreeArc::cast(self.syntax.to_owned()) } |
534 | } | 534 | } |
535 | 535 | ||
536 | 536 | ||
@@ -554,7 +554,7 @@ impl AstNode for EnumDef { | |||
554 | } | 554 | } |
555 | } | 555 | } |
556 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 556 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
557 | fn to_owned(&self) -> TreePtr<EnumDef> { TreePtr::cast(self.syntax.to_owned()) } | 557 | fn to_owned(&self) -> TreeArc<EnumDef> { TreeArc::cast(self.syntax.to_owned()) } |
558 | } | 558 | } |
559 | 559 | ||
560 | 560 | ||
@@ -587,7 +587,7 @@ impl AstNode for EnumVariant { | |||
587 | } | 587 | } |
588 | } | 588 | } |
589 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 589 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
590 | fn to_owned(&self) -> TreePtr<EnumVariant> { TreePtr::cast(self.syntax.to_owned()) } | 590 | fn to_owned(&self) -> TreeArc<EnumVariant> { TreeArc::cast(self.syntax.to_owned()) } |
591 | } | 591 | } |
592 | 592 | ||
593 | 593 | ||
@@ -616,7 +616,7 @@ impl AstNode for EnumVariantList { | |||
616 | } | 616 | } |
617 | } | 617 | } |
618 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 618 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
619 | fn to_owned(&self) -> TreePtr<EnumVariantList> { TreePtr::cast(self.syntax.to_owned()) } | 619 | fn to_owned(&self) -> TreeArc<EnumVariantList> { TreeArc::cast(self.syntax.to_owned()) } |
620 | } | 620 | } |
621 | 621 | ||
622 | 622 | ||
@@ -701,7 +701,7 @@ impl AstNode for Expr { | |||
701 | } | 701 | } |
702 | } | 702 | } |
703 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 703 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
704 | fn to_owned(&self) -> TreePtr<Expr> { TreePtr::cast(self.syntax.to_owned()) } | 704 | fn to_owned(&self) -> TreeArc<Expr> { TreeArc::cast(self.syntax.to_owned()) } |
705 | } | 705 | } |
706 | 706 | ||
707 | impl Expr { | 707 | impl Expr { |
@@ -759,7 +759,7 @@ impl AstNode for ExprStmt { | |||
759 | } | 759 | } |
760 | } | 760 | } |
761 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 761 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
762 | fn to_owned(&self) -> TreePtr<ExprStmt> { TreePtr::cast(self.syntax.to_owned()) } | 762 | fn to_owned(&self) -> TreeArc<ExprStmt> { TreeArc::cast(self.syntax.to_owned()) } |
763 | } | 763 | } |
764 | 764 | ||
765 | 765 | ||
@@ -787,7 +787,7 @@ impl AstNode for ExternCrateItem { | |||
787 | } | 787 | } |
788 | } | 788 | } |
789 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 789 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
790 | fn to_owned(&self) -> TreePtr<ExternCrateItem> { TreePtr::cast(self.syntax.to_owned()) } | 790 | fn to_owned(&self) -> TreeArc<ExternCrateItem> { TreeArc::cast(self.syntax.to_owned()) } |
791 | } | 791 | } |
792 | 792 | ||
793 | 793 | ||
@@ -811,7 +811,7 @@ impl AstNode for FieldExpr { | |||
811 | } | 811 | } |
812 | } | 812 | } |
813 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 813 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
814 | fn to_owned(&self) -> TreePtr<FieldExpr> { TreePtr::cast(self.syntax.to_owned()) } | 814 | fn to_owned(&self) -> TreeArc<FieldExpr> { TreeArc::cast(self.syntax.to_owned()) } |
815 | } | 815 | } |
816 | 816 | ||
817 | 817 | ||
@@ -843,7 +843,7 @@ impl AstNode for FieldPatList { | |||
843 | } | 843 | } |
844 | } | 844 | } |
845 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 845 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
846 | fn to_owned(&self) -> TreePtr<FieldPatList> { TreePtr::cast(self.syntax.to_owned()) } | 846 | fn to_owned(&self) -> TreeArc<FieldPatList> { TreeArc::cast(self.syntax.to_owned()) } |
847 | } | 847 | } |
848 | 848 | ||
849 | 849 | ||
@@ -867,7 +867,7 @@ impl AstNode for FnDef { | |||
867 | } | 867 | } |
868 | } | 868 | } |
869 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 869 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
870 | fn to_owned(&self) -> TreePtr<FnDef> { TreePtr::cast(self.syntax.to_owned()) } | 870 | fn to_owned(&self) -> TreeArc<FnDef> { TreeArc::cast(self.syntax.to_owned()) } |
871 | } | 871 | } |
872 | 872 | ||
873 | 873 | ||
@@ -908,7 +908,7 @@ impl AstNode for FnPointerType { | |||
908 | } | 908 | } |
909 | } | 909 | } |
910 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 910 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
911 | fn to_owned(&self) -> TreePtr<FnPointerType> { TreePtr::cast(self.syntax.to_owned()) } | 911 | fn to_owned(&self) -> TreeArc<FnPointerType> { TreeArc::cast(self.syntax.to_owned()) } |
912 | } | 912 | } |
913 | 913 | ||
914 | 914 | ||
@@ -940,7 +940,7 @@ impl AstNode for ForExpr { | |||
940 | } | 940 | } |
941 | } | 941 | } |
942 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 942 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
943 | fn to_owned(&self) -> TreePtr<ForExpr> { TreePtr::cast(self.syntax.to_owned()) } | 943 | fn to_owned(&self) -> TreeArc<ForExpr> { TreeArc::cast(self.syntax.to_owned()) } |
944 | } | 944 | } |
945 | 945 | ||
946 | 946 | ||
@@ -973,7 +973,7 @@ impl AstNode for ForType { | |||
973 | } | 973 | } |
974 | } | 974 | } |
975 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 975 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
976 | fn to_owned(&self) -> TreePtr<ForType> { TreePtr::cast(self.syntax.to_owned()) } | 976 | fn to_owned(&self) -> TreeArc<ForType> { TreeArc::cast(self.syntax.to_owned()) } |
977 | } | 977 | } |
978 | 978 | ||
979 | 979 | ||
@@ -1001,7 +1001,7 @@ impl AstNode for IfExpr { | |||
1001 | } | 1001 | } |
1002 | } | 1002 | } |
1003 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1003 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1004 | fn to_owned(&self) -> TreePtr<IfExpr> { TreePtr::cast(self.syntax.to_owned()) } | 1004 | fn to_owned(&self) -> TreeArc<IfExpr> { TreeArc::cast(self.syntax.to_owned()) } |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | 1007 | ||
@@ -1029,7 +1029,7 @@ impl AstNode for ImplBlock { | |||
1029 | } | 1029 | } |
1030 | } | 1030 | } |
1031 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1031 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1032 | fn to_owned(&self) -> TreePtr<ImplBlock> { TreePtr::cast(self.syntax.to_owned()) } | 1032 | fn to_owned(&self) -> TreeArc<ImplBlock> { TreeArc::cast(self.syntax.to_owned()) } |
1033 | } | 1033 | } |
1034 | 1034 | ||
1035 | 1035 | ||
@@ -1066,7 +1066,7 @@ impl AstNode for ImplItem { | |||
1066 | } | 1066 | } |
1067 | } | 1067 | } |
1068 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1068 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1069 | fn to_owned(&self) -> TreePtr<ImplItem> { TreePtr::cast(self.syntax.to_owned()) } | 1069 | fn to_owned(&self) -> TreeArc<ImplItem> { TreeArc::cast(self.syntax.to_owned()) } |
1070 | } | 1070 | } |
1071 | 1071 | ||
1072 | impl ImplItem { | 1072 | impl ImplItem { |
@@ -1100,7 +1100,7 @@ impl AstNode for ImplTraitType { | |||
1100 | } | 1100 | } |
1101 | } | 1101 | } |
1102 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1102 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1103 | fn to_owned(&self) -> TreePtr<ImplTraitType> { TreePtr::cast(self.syntax.to_owned()) } | 1103 | fn to_owned(&self) -> TreeArc<ImplTraitType> { TreeArc::cast(self.syntax.to_owned()) } |
1104 | } | 1104 | } |
1105 | 1105 | ||
1106 | 1106 | ||
@@ -1124,7 +1124,7 @@ impl AstNode for IndexExpr { | |||
1124 | } | 1124 | } |
1125 | } | 1125 | } |
1126 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1126 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1127 | fn to_owned(&self) -> TreePtr<IndexExpr> { TreePtr::cast(self.syntax.to_owned()) } | 1127 | fn to_owned(&self) -> TreeArc<IndexExpr> { TreeArc::cast(self.syntax.to_owned()) } |
1128 | } | 1128 | } |
1129 | 1129 | ||
1130 | 1130 | ||
@@ -1148,7 +1148,7 @@ impl AstNode for ItemList { | |||
1148 | } | 1148 | } |
1149 | } | 1149 | } |
1150 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1150 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1151 | fn to_owned(&self) -> TreePtr<ItemList> { TreePtr::cast(self.syntax.to_owned()) } | 1151 | fn to_owned(&self) -> TreeArc<ItemList> { TreeArc::cast(self.syntax.to_owned()) } |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | 1154 | ||
@@ -1178,7 +1178,7 @@ impl AstNode for Label { | |||
1178 | } | 1178 | } |
1179 | } | 1179 | } |
1180 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1180 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1181 | fn to_owned(&self) -> TreePtr<Label> { TreePtr::cast(self.syntax.to_owned()) } | 1181 | fn to_owned(&self) -> TreeArc<Label> { TreeArc::cast(self.syntax.to_owned()) } |
1182 | } | 1182 | } |
1183 | 1183 | ||
1184 | 1184 | ||
@@ -1202,7 +1202,7 @@ impl AstNode for LambdaExpr { | |||
1202 | } | 1202 | } |
1203 | } | 1203 | } |
1204 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1204 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1205 | fn to_owned(&self) -> TreePtr<LambdaExpr> { TreePtr::cast(self.syntax.to_owned()) } | 1205 | fn to_owned(&self) -> TreeArc<LambdaExpr> { TreeArc::cast(self.syntax.to_owned()) } |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | 1208 | ||
@@ -1234,7 +1234,7 @@ impl AstNode for LetStmt { | |||
1234 | } | 1234 | } |
1235 | } | 1235 | } |
1236 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1236 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1237 | fn to_owned(&self) -> TreePtr<LetStmt> { TreePtr::cast(self.syntax.to_owned()) } | 1237 | fn to_owned(&self) -> TreeArc<LetStmt> { TreeArc::cast(self.syntax.to_owned()) } |
1238 | } | 1238 | } |
1239 | 1239 | ||
1240 | 1240 | ||
@@ -1270,7 +1270,7 @@ impl AstNode for Lifetime { | |||
1270 | } | 1270 | } |
1271 | } | 1271 | } |
1272 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1272 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1273 | fn to_owned(&self) -> TreePtr<Lifetime> { TreePtr::cast(self.syntax.to_owned()) } | 1273 | fn to_owned(&self) -> TreeArc<Lifetime> { TreeArc::cast(self.syntax.to_owned()) } |
1274 | } | 1274 | } |
1275 | 1275 | ||
1276 | 1276 | ||
@@ -1295,7 +1295,7 @@ impl AstNode for LifetimeParam { | |||
1295 | } | 1295 | } |
1296 | } | 1296 | } |
1297 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1297 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1298 | fn to_owned(&self) -> TreePtr<LifetimeParam> { TreePtr::cast(self.syntax.to_owned()) } | 1298 | fn to_owned(&self) -> TreeArc<LifetimeParam> { TreeArc::cast(self.syntax.to_owned()) } |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | 1301 | ||
@@ -1323,7 +1323,7 @@ impl AstNode for Literal { | |||
1323 | } | 1323 | } |
1324 | } | 1324 | } |
1325 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1325 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1326 | fn to_owned(&self) -> TreePtr<Literal> { TreePtr::cast(self.syntax.to_owned()) } | 1326 | fn to_owned(&self) -> TreeArc<Literal> { TreeArc::cast(self.syntax.to_owned()) } |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | 1329 | ||
@@ -1347,7 +1347,7 @@ impl AstNode for LoopExpr { | |||
1347 | } | 1347 | } |
1348 | } | 1348 | } |
1349 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1349 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1350 | fn to_owned(&self) -> TreePtr<LoopExpr> { TreePtr::cast(self.syntax.to_owned()) } | 1350 | fn to_owned(&self) -> TreeArc<LoopExpr> { TreeArc::cast(self.syntax.to_owned()) } |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | 1353 | ||
@@ -1372,7 +1372,7 @@ impl AstNode for MacroCall { | |||
1372 | } | 1372 | } |
1373 | } | 1373 | } |
1374 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1374 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1375 | fn to_owned(&self) -> TreePtr<MacroCall> { TreePtr::cast(self.syntax.to_owned()) } | 1375 | fn to_owned(&self) -> TreeArc<MacroCall> { TreeArc::cast(self.syntax.to_owned()) } |
1376 | } | 1376 | } |
1377 | 1377 | ||
1378 | 1378 | ||
@@ -1404,7 +1404,7 @@ impl AstNode for MatchArm { | |||
1404 | } | 1404 | } |
1405 | } | 1405 | } |
1406 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1406 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1407 | fn to_owned(&self) -> TreePtr<MatchArm> { TreePtr::cast(self.syntax.to_owned()) } | 1407 | fn to_owned(&self) -> TreeArc<MatchArm> { TreeArc::cast(self.syntax.to_owned()) } |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | 1410 | ||
@@ -1440,7 +1440,7 @@ impl AstNode for MatchArmList { | |||
1440 | } | 1440 | } |
1441 | } | 1441 | } |
1442 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1442 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1443 | fn to_owned(&self) -> TreePtr<MatchArmList> { TreePtr::cast(self.syntax.to_owned()) } | 1443 | fn to_owned(&self) -> TreeArc<MatchArmList> { TreeArc::cast(self.syntax.to_owned()) } |
1444 | } | 1444 | } |
1445 | 1445 | ||
1446 | 1446 | ||
@@ -1468,7 +1468,7 @@ impl AstNode for MatchExpr { | |||
1468 | } | 1468 | } |
1469 | } | 1469 | } |
1470 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1470 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1471 | fn to_owned(&self) -> TreePtr<MatchExpr> { TreePtr::cast(self.syntax.to_owned()) } | 1471 | fn to_owned(&self) -> TreeArc<MatchExpr> { TreeArc::cast(self.syntax.to_owned()) } |
1472 | } | 1472 | } |
1473 | 1473 | ||
1474 | 1474 | ||
@@ -1500,7 +1500,7 @@ impl AstNode for MatchGuard { | |||
1500 | } | 1500 | } |
1501 | } | 1501 | } |
1502 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1502 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1503 | fn to_owned(&self) -> TreePtr<MatchGuard> { TreePtr::cast(self.syntax.to_owned()) } | 1503 | fn to_owned(&self) -> TreeArc<MatchGuard> { TreeArc::cast(self.syntax.to_owned()) } |
1504 | } | 1504 | } |
1505 | 1505 | ||
1506 | 1506 | ||
@@ -1524,7 +1524,7 @@ impl AstNode for MethodCallExpr { | |||
1524 | } | 1524 | } |
1525 | } | 1525 | } |
1526 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1526 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1527 | fn to_owned(&self) -> TreePtr<MethodCallExpr> { TreePtr::cast(self.syntax.to_owned()) } | 1527 | fn to_owned(&self) -> TreeArc<MethodCallExpr> { TreeArc::cast(self.syntax.to_owned()) } |
1528 | } | 1528 | } |
1529 | 1529 | ||
1530 | 1530 | ||
@@ -1557,7 +1557,7 @@ impl AstNode for Module { | |||
1557 | } | 1557 | } |
1558 | } | 1558 | } |
1559 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1559 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1560 | fn to_owned(&self) -> TreePtr<Module> { TreePtr::cast(self.syntax.to_owned()) } | 1560 | fn to_owned(&self) -> TreeArc<Module> { TreeArc::cast(self.syntax.to_owned()) } |
1561 | } | 1561 | } |
1562 | 1562 | ||
1563 | 1563 | ||
@@ -1614,7 +1614,7 @@ impl AstNode for ModuleItem { | |||
1614 | } | 1614 | } |
1615 | } | 1615 | } |
1616 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1616 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1617 | fn to_owned(&self) -> TreePtr<ModuleItem> { TreePtr::cast(self.syntax.to_owned()) } | 1617 | fn to_owned(&self) -> TreeArc<ModuleItem> { TreeArc::cast(self.syntax.to_owned()) } |
1618 | } | 1618 | } |
1619 | 1619 | ||
1620 | impl ModuleItem { | 1620 | impl ModuleItem { |
@@ -1656,7 +1656,7 @@ impl AstNode for Name { | |||
1656 | } | 1656 | } |
1657 | } | 1657 | } |
1658 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1658 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1659 | fn to_owned(&self) -> TreePtr<Name> { TreePtr::cast(self.syntax.to_owned()) } | 1659 | fn to_owned(&self) -> TreeArc<Name> { TreeArc::cast(self.syntax.to_owned()) } |
1660 | } | 1660 | } |
1661 | 1661 | ||
1662 | 1662 | ||
@@ -1680,7 +1680,7 @@ impl AstNode for NameRef { | |||
1680 | } | 1680 | } |
1681 | } | 1681 | } |
1682 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1682 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1683 | fn to_owned(&self) -> TreePtr<NameRef> { TreePtr::cast(self.syntax.to_owned()) } | 1683 | fn to_owned(&self) -> TreeArc<NameRef> { TreeArc::cast(self.syntax.to_owned()) } |
1684 | } | 1684 | } |
1685 | 1685 | ||
1686 | 1686 | ||
@@ -1704,7 +1704,7 @@ impl AstNode for NamedField { | |||
1704 | } | 1704 | } |
1705 | } | 1705 | } |
1706 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1706 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1707 | fn to_owned(&self) -> TreePtr<NamedField> { TreePtr::cast(self.syntax.to_owned()) } | 1707 | fn to_owned(&self) -> TreeArc<NamedField> { TreeArc::cast(self.syntax.to_owned()) } |
1708 | } | 1708 | } |
1709 | 1709 | ||
1710 | 1710 | ||
@@ -1736,7 +1736,7 @@ impl AstNode for NamedFieldDef { | |||
1736 | } | 1736 | } |
1737 | } | 1737 | } |
1738 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1738 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1739 | fn to_owned(&self) -> TreePtr<NamedFieldDef> { TreePtr::cast(self.syntax.to_owned()) } | 1739 | fn to_owned(&self) -> TreeArc<NamedFieldDef> { TreeArc::cast(self.syntax.to_owned()) } |
1740 | } | 1740 | } |
1741 | 1741 | ||
1742 | 1742 | ||
@@ -1767,7 +1767,7 @@ impl AstNode for NamedFieldDefList { | |||
1767 | } | 1767 | } |
1768 | } | 1768 | } |
1769 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1769 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1770 | fn to_owned(&self) -> TreePtr<NamedFieldDefList> { TreePtr::cast(self.syntax.to_owned()) } | 1770 | fn to_owned(&self) -> TreeArc<NamedFieldDefList> { TreeArc::cast(self.syntax.to_owned()) } |
1771 | } | 1771 | } |
1772 | 1772 | ||
1773 | 1773 | ||
@@ -1795,7 +1795,7 @@ impl AstNode for NamedFieldList { | |||
1795 | } | 1795 | } |
1796 | } | 1796 | } |
1797 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1797 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1798 | fn to_owned(&self) -> TreePtr<NamedFieldList> { TreePtr::cast(self.syntax.to_owned()) } | 1798 | fn to_owned(&self) -> TreeArc<NamedFieldList> { TreeArc::cast(self.syntax.to_owned()) } |
1799 | } | 1799 | } |
1800 | 1800 | ||
1801 | 1801 | ||
@@ -1823,7 +1823,7 @@ impl AstNode for NeverType { | |||
1823 | } | 1823 | } |
1824 | } | 1824 | } |
1825 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1825 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1826 | fn to_owned(&self) -> TreePtr<NeverType> { TreePtr::cast(self.syntax.to_owned()) } | 1826 | fn to_owned(&self) -> TreeArc<NeverType> { TreeArc::cast(self.syntax.to_owned()) } |
1827 | } | 1827 | } |
1828 | 1828 | ||
1829 | 1829 | ||
@@ -1854,7 +1854,7 @@ impl AstNode for NominalDef { | |||
1854 | } | 1854 | } |
1855 | } | 1855 | } |
1856 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1856 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1857 | fn to_owned(&self) -> TreePtr<NominalDef> { TreePtr::cast(self.syntax.to_owned()) } | 1857 | fn to_owned(&self) -> TreeArc<NominalDef> { TreeArc::cast(self.syntax.to_owned()) } |
1858 | } | 1858 | } |
1859 | 1859 | ||
1860 | impl NominalDef { | 1860 | impl NominalDef { |
@@ -1890,7 +1890,7 @@ impl AstNode for Param { | |||
1890 | } | 1890 | } |
1891 | } | 1891 | } |
1892 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1892 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1893 | fn to_owned(&self) -> TreePtr<Param> { TreePtr::cast(self.syntax.to_owned()) } | 1893 | fn to_owned(&self) -> TreeArc<Param> { TreeArc::cast(self.syntax.to_owned()) } |
1894 | } | 1894 | } |
1895 | 1895 | ||
1896 | 1896 | ||
@@ -1922,7 +1922,7 @@ impl AstNode for ParamList { | |||
1922 | } | 1922 | } |
1923 | } | 1923 | } |
1924 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1924 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1925 | fn to_owned(&self) -> TreePtr<ParamList> { TreePtr::cast(self.syntax.to_owned()) } | 1925 | fn to_owned(&self) -> TreeArc<ParamList> { TreeArc::cast(self.syntax.to_owned()) } |
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | 1928 | ||
@@ -1954,7 +1954,7 @@ impl AstNode for ParenExpr { | |||
1954 | } | 1954 | } |
1955 | } | 1955 | } |
1956 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1956 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1957 | fn to_owned(&self) -> TreePtr<ParenExpr> { TreePtr::cast(self.syntax.to_owned()) } | 1957 | fn to_owned(&self) -> TreeArc<ParenExpr> { TreeArc::cast(self.syntax.to_owned()) } |
1958 | } | 1958 | } |
1959 | 1959 | ||
1960 | 1960 | ||
@@ -1982,7 +1982,7 @@ impl AstNode for ParenType { | |||
1982 | } | 1982 | } |
1983 | } | 1983 | } |
1984 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 1984 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
1985 | fn to_owned(&self) -> TreePtr<ParenType> { TreePtr::cast(self.syntax.to_owned()) } | 1985 | fn to_owned(&self) -> TreeArc<ParenType> { TreeArc::cast(self.syntax.to_owned()) } |
1986 | } | 1986 | } |
1987 | 1987 | ||
1988 | 1988 | ||
@@ -2033,7 +2033,7 @@ impl AstNode for Pat { | |||
2033 | } | 2033 | } |
2034 | } | 2034 | } |
2035 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2035 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2036 | fn to_owned(&self) -> TreePtr<Pat> { TreePtr::cast(self.syntax.to_owned()) } | 2036 | fn to_owned(&self) -> TreeArc<Pat> { TreeArc::cast(self.syntax.to_owned()) } |
2037 | } | 2037 | } |
2038 | 2038 | ||
2039 | impl Pat { | 2039 | impl Pat { |
@@ -2074,7 +2074,7 @@ impl AstNode for Path { | |||
2074 | } | 2074 | } |
2075 | } | 2075 | } |
2076 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2076 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2077 | fn to_owned(&self) -> TreePtr<Path> { TreePtr::cast(self.syntax.to_owned()) } | 2077 | fn to_owned(&self) -> TreeArc<Path> { TreeArc::cast(self.syntax.to_owned()) } |
2078 | } | 2078 | } |
2079 | 2079 | ||
2080 | 2080 | ||
@@ -2106,7 +2106,7 @@ impl AstNode for PathExpr { | |||
2106 | } | 2106 | } |
2107 | } | 2107 | } |
2108 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2108 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2109 | fn to_owned(&self) -> TreePtr<PathExpr> { TreePtr::cast(self.syntax.to_owned()) } | 2109 | fn to_owned(&self) -> TreeArc<PathExpr> { TreeArc::cast(self.syntax.to_owned()) } |
2110 | } | 2110 | } |
2111 | 2111 | ||
2112 | 2112 | ||
@@ -2134,7 +2134,7 @@ impl AstNode for PathPat { | |||
2134 | } | 2134 | } |
2135 | } | 2135 | } |
2136 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2136 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2137 | fn to_owned(&self) -> TreePtr<PathPat> { TreePtr::cast(self.syntax.to_owned()) } | 2137 | fn to_owned(&self) -> TreeArc<PathPat> { TreeArc::cast(self.syntax.to_owned()) } |
2138 | } | 2138 | } |
2139 | 2139 | ||
2140 | 2140 | ||
@@ -2158,7 +2158,7 @@ impl AstNode for PathSegment { | |||
2158 | } | 2158 | } |
2159 | } | 2159 | } |
2160 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2160 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2161 | fn to_owned(&self) -> TreePtr<PathSegment> { TreePtr::cast(self.syntax.to_owned()) } | 2161 | fn to_owned(&self) -> TreeArc<PathSegment> { TreeArc::cast(self.syntax.to_owned()) } |
2162 | } | 2162 | } |
2163 | 2163 | ||
2164 | 2164 | ||
@@ -2186,7 +2186,7 @@ impl AstNode for PathType { | |||
2186 | } | 2186 | } |
2187 | } | 2187 | } |
2188 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2188 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2189 | fn to_owned(&self) -> TreePtr<PathType> { TreePtr::cast(self.syntax.to_owned()) } | 2189 | fn to_owned(&self) -> TreeArc<PathType> { TreeArc::cast(self.syntax.to_owned()) } |
2190 | } | 2190 | } |
2191 | 2191 | ||
2192 | 2192 | ||
@@ -2214,7 +2214,7 @@ impl AstNode for PlaceholderPat { | |||
2214 | } | 2214 | } |
2215 | } | 2215 | } |
2216 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2216 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2217 | fn to_owned(&self) -> TreePtr<PlaceholderPat> { TreePtr::cast(self.syntax.to_owned()) } | 2217 | fn to_owned(&self) -> TreeArc<PlaceholderPat> { TreeArc::cast(self.syntax.to_owned()) } |
2218 | } | 2218 | } |
2219 | 2219 | ||
2220 | 2220 | ||
@@ -2238,7 +2238,7 @@ impl AstNode for PlaceholderType { | |||
2238 | } | 2238 | } |
2239 | } | 2239 | } |
2240 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2240 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2241 | fn to_owned(&self) -> TreePtr<PlaceholderType> { TreePtr::cast(self.syntax.to_owned()) } | 2241 | fn to_owned(&self) -> TreeArc<PlaceholderType> { TreeArc::cast(self.syntax.to_owned()) } |
2242 | } | 2242 | } |
2243 | 2243 | ||
2244 | 2244 | ||
@@ -2262,7 +2262,7 @@ impl AstNode for PointerType { | |||
2262 | } | 2262 | } |
2263 | } | 2263 | } |
2264 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2264 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2265 | fn to_owned(&self) -> TreePtr<PointerType> { TreePtr::cast(self.syntax.to_owned()) } | 2265 | fn to_owned(&self) -> TreeArc<PointerType> { TreeArc::cast(self.syntax.to_owned()) } |
2266 | } | 2266 | } |
2267 | 2267 | ||
2268 | 2268 | ||
@@ -2290,7 +2290,7 @@ impl AstNode for PosField { | |||
2290 | } | 2290 | } |
2291 | } | 2291 | } |
2292 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2292 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2293 | fn to_owned(&self) -> TreePtr<PosField> { TreePtr::cast(self.syntax.to_owned()) } | 2293 | fn to_owned(&self) -> TreeArc<PosField> { TreeArc::cast(self.syntax.to_owned()) } |
2294 | } | 2294 | } |
2295 | 2295 | ||
2296 | 2296 | ||
@@ -2320,7 +2320,7 @@ impl AstNode for PosFieldList { | |||
2320 | } | 2320 | } |
2321 | } | 2321 | } |
2322 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2322 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2323 | fn to_owned(&self) -> TreePtr<PosFieldList> { TreePtr::cast(self.syntax.to_owned()) } | 2323 | fn to_owned(&self) -> TreeArc<PosFieldList> { TreeArc::cast(self.syntax.to_owned()) } |
2324 | } | 2324 | } |
2325 | 2325 | ||
2326 | 2326 | ||
@@ -2348,7 +2348,7 @@ impl AstNode for PrefixExpr { | |||
2348 | } | 2348 | } |
2349 | } | 2349 | } |
2350 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2350 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2351 | fn to_owned(&self) -> TreePtr<PrefixExpr> { TreePtr::cast(self.syntax.to_owned()) } | 2351 | fn to_owned(&self) -> TreeArc<PrefixExpr> { TreeArc::cast(self.syntax.to_owned()) } |
2352 | } | 2352 | } |
2353 | 2353 | ||
2354 | 2354 | ||
@@ -2376,7 +2376,7 @@ impl AstNode for RangeExpr { | |||
2376 | } | 2376 | } |
2377 | } | 2377 | } |
2378 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2378 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2379 | fn to_owned(&self) -> TreePtr<RangeExpr> { TreePtr::cast(self.syntax.to_owned()) } | 2379 | fn to_owned(&self) -> TreeArc<RangeExpr> { TreeArc::cast(self.syntax.to_owned()) } |
2380 | } | 2380 | } |
2381 | 2381 | ||
2382 | 2382 | ||
@@ -2400,7 +2400,7 @@ impl AstNode for RangePat { | |||
2400 | } | 2400 | } |
2401 | } | 2401 | } |
2402 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2402 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2403 | fn to_owned(&self) -> TreePtr<RangePat> { TreePtr::cast(self.syntax.to_owned()) } | 2403 | fn to_owned(&self) -> TreeArc<RangePat> { TreeArc::cast(self.syntax.to_owned()) } |
2404 | } | 2404 | } |
2405 | 2405 | ||
2406 | 2406 | ||
@@ -2424,7 +2424,7 @@ impl AstNode for RefExpr { | |||
2424 | } | 2424 | } |
2425 | } | 2425 | } |
2426 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2426 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2427 | fn to_owned(&self) -> TreePtr<RefExpr> { TreePtr::cast(self.syntax.to_owned()) } | 2427 | fn to_owned(&self) -> TreeArc<RefExpr> { TreeArc::cast(self.syntax.to_owned()) } |
2428 | } | 2428 | } |
2429 | 2429 | ||
2430 | 2430 | ||
@@ -2452,7 +2452,7 @@ impl AstNode for RefPat { | |||
2452 | } | 2452 | } |
2453 | } | 2453 | } |
2454 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2454 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2455 | fn to_owned(&self) -> TreePtr<RefPat> { TreePtr::cast(self.syntax.to_owned()) } | 2455 | fn to_owned(&self) -> TreeArc<RefPat> { TreeArc::cast(self.syntax.to_owned()) } |
2456 | } | 2456 | } |
2457 | 2457 | ||
2458 | 2458 | ||
@@ -2476,7 +2476,7 @@ impl AstNode for ReferenceType { | |||
2476 | } | 2476 | } |
2477 | } | 2477 | } |
2478 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2478 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2479 | fn to_owned(&self) -> TreePtr<ReferenceType> { TreePtr::cast(self.syntax.to_owned()) } | 2479 | fn to_owned(&self) -> TreeArc<ReferenceType> { TreeArc::cast(self.syntax.to_owned()) } |
2480 | } | 2480 | } |
2481 | 2481 | ||
2482 | 2482 | ||
@@ -2504,7 +2504,7 @@ impl AstNode for RetType { | |||
2504 | } | 2504 | } |
2505 | } | 2505 | } |
2506 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2506 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2507 | fn to_owned(&self) -> TreePtr<RetType> { TreePtr::cast(self.syntax.to_owned()) } | 2507 | fn to_owned(&self) -> TreeArc<RetType> { TreeArc::cast(self.syntax.to_owned()) } |
2508 | } | 2508 | } |
2509 | 2509 | ||
2510 | 2510 | ||
@@ -2532,7 +2532,7 @@ impl AstNode for ReturnExpr { | |||
2532 | } | 2532 | } |
2533 | } | 2533 | } |
2534 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2534 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2535 | fn to_owned(&self) -> TreePtr<ReturnExpr> { TreePtr::cast(self.syntax.to_owned()) } | 2535 | fn to_owned(&self) -> TreeArc<ReturnExpr> { TreeArc::cast(self.syntax.to_owned()) } |
2536 | } | 2536 | } |
2537 | 2537 | ||
2538 | 2538 | ||
@@ -2560,7 +2560,7 @@ impl AstNode for SelfKw { | |||
2560 | } | 2560 | } |
2561 | } | 2561 | } |
2562 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2562 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2563 | fn to_owned(&self) -> TreePtr<SelfKw> { TreePtr::cast(self.syntax.to_owned()) } | 2563 | fn to_owned(&self) -> TreeArc<SelfKw> { TreeArc::cast(self.syntax.to_owned()) } |
2564 | } | 2564 | } |
2565 | 2565 | ||
2566 | 2566 | ||
@@ -2584,7 +2584,7 @@ impl AstNode for SelfParam { | |||
2584 | } | 2584 | } |
2585 | } | 2585 | } |
2586 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2586 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2587 | fn to_owned(&self) -> TreePtr<SelfParam> { TreePtr::cast(self.syntax.to_owned()) } | 2587 | fn to_owned(&self) -> TreeArc<SelfParam> { TreeArc::cast(self.syntax.to_owned()) } |
2588 | } | 2588 | } |
2589 | 2589 | ||
2590 | 2590 | ||
@@ -2616,7 +2616,7 @@ impl AstNode for SlicePat { | |||
2616 | } | 2616 | } |
2617 | } | 2617 | } |
2618 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2618 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2619 | fn to_owned(&self) -> TreePtr<SlicePat> { TreePtr::cast(self.syntax.to_owned()) } | 2619 | fn to_owned(&self) -> TreeArc<SlicePat> { TreeArc::cast(self.syntax.to_owned()) } |
2620 | } | 2620 | } |
2621 | 2621 | ||
2622 | 2622 | ||
@@ -2640,7 +2640,7 @@ impl AstNode for SliceType { | |||
2640 | } | 2640 | } |
2641 | } | 2641 | } |
2642 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2642 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2643 | fn to_owned(&self) -> TreePtr<SliceType> { TreePtr::cast(self.syntax.to_owned()) } | 2643 | fn to_owned(&self) -> TreeArc<SliceType> { TreeArc::cast(self.syntax.to_owned()) } |
2644 | } | 2644 | } |
2645 | 2645 | ||
2646 | 2646 | ||
@@ -2668,7 +2668,7 @@ impl AstNode for SourceFile { | |||
2668 | } | 2668 | } |
2669 | } | 2669 | } |
2670 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2670 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2671 | fn to_owned(&self) -> TreePtr<SourceFile> { TreePtr::cast(self.syntax.to_owned()) } | 2671 | fn to_owned(&self) -> TreeArc<SourceFile> { TreeArc::cast(self.syntax.to_owned()) } |
2672 | } | 2672 | } |
2673 | 2673 | ||
2674 | 2674 | ||
@@ -2698,7 +2698,7 @@ impl AstNode for StaticDef { | |||
2698 | } | 2698 | } |
2699 | } | 2699 | } |
2700 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2700 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2701 | fn to_owned(&self) -> TreePtr<StaticDef> { TreePtr::cast(self.syntax.to_owned()) } | 2701 | fn to_owned(&self) -> TreeArc<StaticDef> { TreeArc::cast(self.syntax.to_owned()) } |
2702 | } | 2702 | } |
2703 | 2703 | ||
2704 | 2704 | ||
@@ -2734,7 +2734,7 @@ impl AstNode for Stmt { | |||
2734 | } | 2734 | } |
2735 | } | 2735 | } |
2736 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2736 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2737 | fn to_owned(&self) -> TreePtr<Stmt> { TreePtr::cast(self.syntax.to_owned()) } | 2737 | fn to_owned(&self) -> TreeArc<Stmt> { TreeArc::cast(self.syntax.to_owned()) } |
2738 | } | 2738 | } |
2739 | 2739 | ||
2740 | impl Stmt { | 2740 | impl Stmt { |
@@ -2767,7 +2767,7 @@ impl AstNode for String { | |||
2767 | } | 2767 | } |
2768 | } | 2768 | } |
2769 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2769 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2770 | fn to_owned(&self) -> TreePtr<String> { TreePtr::cast(self.syntax.to_owned()) } | 2770 | fn to_owned(&self) -> TreeArc<String> { TreeArc::cast(self.syntax.to_owned()) } |
2771 | } | 2771 | } |
2772 | 2772 | ||
2773 | 2773 | ||
@@ -2792,7 +2792,7 @@ impl AstNode for StructDef { | |||
2792 | } | 2792 | } |
2793 | } | 2793 | } |
2794 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2794 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2795 | fn to_owned(&self) -> TreePtr<StructDef> { TreePtr::cast(self.syntax.to_owned()) } | 2795 | fn to_owned(&self) -> TreeArc<StructDef> { TreeArc::cast(self.syntax.to_owned()) } |
2796 | } | 2796 | } |
2797 | 2797 | ||
2798 | 2798 | ||
@@ -2821,7 +2821,7 @@ impl AstNode for StructLit { | |||
2821 | } | 2821 | } |
2822 | } | 2822 | } |
2823 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2823 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2824 | fn to_owned(&self) -> TreePtr<StructLit> { TreePtr::cast(self.syntax.to_owned()) } | 2824 | fn to_owned(&self) -> TreeArc<StructLit> { TreeArc::cast(self.syntax.to_owned()) } |
2825 | } | 2825 | } |
2826 | 2826 | ||
2827 | 2827 | ||
@@ -2857,7 +2857,7 @@ impl AstNode for StructPat { | |||
2857 | } | 2857 | } |
2858 | } | 2858 | } |
2859 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2859 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2860 | fn to_owned(&self) -> TreePtr<StructPat> { TreePtr::cast(self.syntax.to_owned()) } | 2860 | fn to_owned(&self) -> TreeArc<StructPat> { TreeArc::cast(self.syntax.to_owned()) } |
2861 | } | 2861 | } |
2862 | 2862 | ||
2863 | 2863 | ||
@@ -2881,7 +2881,7 @@ impl AstNode for TokenTree { | |||
2881 | } | 2881 | } |
2882 | } | 2882 | } |
2883 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2883 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2884 | fn to_owned(&self) -> TreePtr<TokenTree> { TreePtr::cast(self.syntax.to_owned()) } | 2884 | fn to_owned(&self) -> TreeArc<TokenTree> { TreeArc::cast(self.syntax.to_owned()) } |
2885 | } | 2885 | } |
2886 | 2886 | ||
2887 | 2887 | ||
@@ -2905,7 +2905,7 @@ impl AstNode for TraitDef { | |||
2905 | } | 2905 | } |
2906 | } | 2906 | } |
2907 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2907 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2908 | fn to_owned(&self) -> TreePtr<TraitDef> { TreePtr::cast(self.syntax.to_owned()) } | 2908 | fn to_owned(&self) -> TreeArc<TraitDef> { TreeArc::cast(self.syntax.to_owned()) } |
2909 | } | 2909 | } |
2910 | 2910 | ||
2911 | 2911 | ||
@@ -2933,7 +2933,7 @@ impl AstNode for TryExpr { | |||
2933 | } | 2933 | } |
2934 | } | 2934 | } |
2935 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2935 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2936 | fn to_owned(&self) -> TreePtr<TryExpr> { TreePtr::cast(self.syntax.to_owned()) } | 2936 | fn to_owned(&self) -> TreeArc<TryExpr> { TreeArc::cast(self.syntax.to_owned()) } |
2937 | } | 2937 | } |
2938 | 2938 | ||
2939 | 2939 | ||
@@ -2961,7 +2961,7 @@ impl AstNode for TupleExpr { | |||
2961 | } | 2961 | } |
2962 | } | 2962 | } |
2963 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2963 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2964 | fn to_owned(&self) -> TreePtr<TupleExpr> { TreePtr::cast(self.syntax.to_owned()) } | 2964 | fn to_owned(&self) -> TreeArc<TupleExpr> { TreeArc::cast(self.syntax.to_owned()) } |
2965 | } | 2965 | } |
2966 | 2966 | ||
2967 | 2967 | ||
@@ -2985,7 +2985,7 @@ impl AstNode for TuplePat { | |||
2985 | } | 2985 | } |
2986 | } | 2986 | } |
2987 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 2987 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
2988 | fn to_owned(&self) -> TreePtr<TuplePat> { TreePtr::cast(self.syntax.to_owned()) } | 2988 | fn to_owned(&self) -> TreeArc<TuplePat> { TreeArc::cast(self.syntax.to_owned()) } |
2989 | } | 2989 | } |
2990 | 2990 | ||
2991 | 2991 | ||
@@ -3009,7 +3009,7 @@ impl AstNode for TupleStructPat { | |||
3009 | } | 3009 | } |
3010 | } | 3010 | } |
3011 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3011 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3012 | fn to_owned(&self) -> TreePtr<TupleStructPat> { TreePtr::cast(self.syntax.to_owned()) } | 3012 | fn to_owned(&self) -> TreeArc<TupleStructPat> { TreeArc::cast(self.syntax.to_owned()) } |
3013 | } | 3013 | } |
3014 | 3014 | ||
3015 | 3015 | ||
@@ -3041,7 +3041,7 @@ impl AstNode for TupleType { | |||
3041 | } | 3041 | } |
3042 | } | 3042 | } |
3043 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3043 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3044 | fn to_owned(&self) -> TreePtr<TupleType> { TreePtr::cast(self.syntax.to_owned()) } | 3044 | fn to_owned(&self) -> TreeArc<TupleType> { TreeArc::cast(self.syntax.to_owned()) } |
3045 | } | 3045 | } |
3046 | 3046 | ||
3047 | 3047 | ||
@@ -3069,7 +3069,7 @@ impl AstNode for TypeDef { | |||
3069 | } | 3069 | } |
3070 | } | 3070 | } |
3071 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3071 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3072 | fn to_owned(&self) -> TreePtr<TypeDef> { TreePtr::cast(self.syntax.to_owned()) } | 3072 | fn to_owned(&self) -> TreeArc<TypeDef> { TreeArc::cast(self.syntax.to_owned()) } |
3073 | } | 3073 | } |
3074 | 3074 | ||
3075 | 3075 | ||
@@ -3098,7 +3098,7 @@ impl AstNode for TypeParam { | |||
3098 | } | 3098 | } |
3099 | } | 3099 | } |
3100 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3100 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3101 | fn to_owned(&self) -> TreePtr<TypeParam> { TreePtr::cast(self.syntax.to_owned()) } | 3101 | fn to_owned(&self) -> TreeArc<TypeParam> { TreeArc::cast(self.syntax.to_owned()) } |
3102 | } | 3102 | } |
3103 | 3103 | ||
3104 | 3104 | ||
@@ -3123,7 +3123,7 @@ impl AstNode for TypeParamList { | |||
3123 | } | 3123 | } |
3124 | } | 3124 | } |
3125 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3125 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3126 | fn to_owned(&self) -> TreePtr<TypeParamList> { TreePtr::cast(self.syntax.to_owned()) } | 3126 | fn to_owned(&self) -> TreeArc<TypeParamList> { TreeArc::cast(self.syntax.to_owned()) } |
3127 | } | 3127 | } |
3128 | 3128 | ||
3129 | 3129 | ||
@@ -3184,7 +3184,7 @@ impl AstNode for TypeRef { | |||
3184 | } | 3184 | } |
3185 | } | 3185 | } |
3186 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3186 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3187 | fn to_owned(&self) -> TreePtr<TypeRef> { TreePtr::cast(self.syntax.to_owned()) } | 3187 | fn to_owned(&self) -> TreeArc<TypeRef> { TreeArc::cast(self.syntax.to_owned()) } |
3188 | } | 3188 | } |
3189 | 3189 | ||
3190 | impl TypeRef { | 3190 | impl TypeRef { |
@@ -3228,7 +3228,7 @@ impl AstNode for UseItem { | |||
3228 | } | 3228 | } |
3229 | } | 3229 | } |
3230 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3230 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3231 | fn to_owned(&self) -> TreePtr<UseItem> { TreePtr::cast(self.syntax.to_owned()) } | 3231 | fn to_owned(&self) -> TreeArc<UseItem> { TreeArc::cast(self.syntax.to_owned()) } |
3232 | } | 3232 | } |
3233 | 3233 | ||
3234 | 3234 | ||
@@ -3256,7 +3256,7 @@ impl AstNode for UseTree { | |||
3256 | } | 3256 | } |
3257 | } | 3257 | } |
3258 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3258 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3259 | fn to_owned(&self) -> TreePtr<UseTree> { TreePtr::cast(self.syntax.to_owned()) } | 3259 | fn to_owned(&self) -> TreeArc<UseTree> { TreeArc::cast(self.syntax.to_owned()) } |
3260 | } | 3260 | } |
3261 | 3261 | ||
3262 | 3262 | ||
@@ -3288,7 +3288,7 @@ impl AstNode for UseTreeList { | |||
3288 | } | 3288 | } |
3289 | } | 3289 | } |
3290 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3290 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3291 | fn to_owned(&self) -> TreePtr<UseTreeList> { TreePtr::cast(self.syntax.to_owned()) } | 3291 | fn to_owned(&self) -> TreeArc<UseTreeList> { TreeArc::cast(self.syntax.to_owned()) } |
3292 | } | 3292 | } |
3293 | 3293 | ||
3294 | 3294 | ||
@@ -3316,7 +3316,7 @@ impl AstNode for Visibility { | |||
3316 | } | 3316 | } |
3317 | } | 3317 | } |
3318 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3318 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3319 | fn to_owned(&self) -> TreePtr<Visibility> { TreePtr::cast(self.syntax.to_owned()) } | 3319 | fn to_owned(&self) -> TreeArc<Visibility> { TreeArc::cast(self.syntax.to_owned()) } |
3320 | } | 3320 | } |
3321 | 3321 | ||
3322 | 3322 | ||
@@ -3340,7 +3340,7 @@ impl AstNode for WhereClause { | |||
3340 | } | 3340 | } |
3341 | } | 3341 | } |
3342 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3342 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3343 | fn to_owned(&self) -> TreePtr<WhereClause> { TreePtr::cast(self.syntax.to_owned()) } | 3343 | fn to_owned(&self) -> TreeArc<WhereClause> { TreeArc::cast(self.syntax.to_owned()) } |
3344 | } | 3344 | } |
3345 | 3345 | ||
3346 | 3346 | ||
@@ -3364,7 +3364,7 @@ impl AstNode for WhileExpr { | |||
3364 | } | 3364 | } |
3365 | } | 3365 | } |
3366 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3366 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3367 | fn to_owned(&self) -> TreePtr<WhileExpr> { TreePtr::cast(self.syntax.to_owned()) } | 3367 | fn to_owned(&self) -> TreeArc<WhileExpr> { TreeArc::cast(self.syntax.to_owned()) } |
3368 | } | 3368 | } |
3369 | 3369 | ||
3370 | 3370 | ||
@@ -3393,7 +3393,7 @@ impl AstNode for Whitespace { | |||
3393 | } | 3393 | } |
3394 | } | 3394 | } |
3395 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 3395 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
3396 | fn to_owned(&self) -> TreePtr<Whitespace> { TreePtr::cast(self.syntax.to_owned()) } | 3396 | fn to_owned(&self) -> TreeArc<Whitespace> { TreeArc::cast(self.syntax.to_owned()) } |
3397 | } | 3397 | } |
3398 | 3398 | ||
3399 | 3399 | ||
diff --git a/crates/ra_syntax/src/ast/generated.rs.tera b/crates/ra_syntax/src/ast/generated.rs.tera index 0a20fc78e..bf9db4ee8 100644 --- a/crates/ra_syntax/src/ast/generated.rs.tera +++ b/crates/ra_syntax/src/ast/generated.rs.tera | |||
@@ -15,7 +15,7 @@ use rowan::TransparentNewType; | |||
15 | 15 | ||
16 | use crate::{ | 16 | use crate::{ |
17 | SyntaxNode, SyntaxKind::*, | 17 | SyntaxNode, SyntaxKind::*, |
18 | yellow::{RaTypes, TreePtr}, | 18 | yellow::{RaTypes, TreeArc}, |
19 | ast::{self, AstNode}, | 19 | ast::{self, AstNode}, |
20 | }; | 20 | }; |
21 | {% for node, methods in ast %} | 21 | {% for node, methods in ast %} |
@@ -48,7 +48,7 @@ impl AstNode for {{ node }} { | |||
48 | } | 48 | } |
49 | } | 49 | } |
50 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 50 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
51 | fn to_owned(&self) -> TreePtr<{{ node }}> { TreePtr::cast(self.syntax.to_owned()) } | 51 | fn to_owned(&self) -> TreeArc<{{ node }}> { TreeArc::cast(self.syntax.to_owned()) } |
52 | } | 52 | } |
53 | 53 | ||
54 | impl {{ node }} { | 54 | impl {{ node }} { |
@@ -79,7 +79,7 @@ impl AstNode for {{ node }} { | |||
79 | } | 79 | } |
80 | } | 80 | } |
81 | fn syntax(&self) -> &SyntaxNode { &self.syntax } | 81 | fn syntax(&self) -> &SyntaxNode { &self.syntax } |
82 | fn to_owned(&self) -> TreePtr<{{ node }}> { TreePtr::cast(self.syntax.to_owned()) } | 82 | fn to_owned(&self) -> TreeArc<{{ node }}> { TreeArc::cast(self.syntax.to_owned()) } |
83 | } | 83 | } |
84 | 84 | ||
85 | {% endif %} | 85 | {% endif %} |
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs index 1dbfca91b..2a095817a 100644 --- a/crates/ra_syntax/src/lib.rs +++ b/crates/ra_syntax/src/lib.rs | |||
@@ -41,7 +41,7 @@ pub use crate::{ | |||
41 | ast::AstNode, | 41 | ast::AstNode, |
42 | lexer::{tokenize, Token}, | 42 | lexer::{tokenize, Token}, |
43 | syntax_kinds::SyntaxKind, | 43 | syntax_kinds::SyntaxKind, |
44 | yellow::{Direction, SyntaxError, SyntaxNode, WalkEvent, Location, TreePtr}, | 44 | yellow::{Direction, SyntaxError, SyntaxNode, WalkEvent, Location, TreeArc}, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | use ra_text_edit::AtomTextEdit; | 47 | use ra_text_edit::AtomTextEdit; |
@@ -51,29 +51,29 @@ use crate::yellow::GreenNode; | |||
51 | pub use crate::ast::SourceFile; | 51 | pub use crate::ast::SourceFile; |
52 | 52 | ||
53 | impl SourceFile { | 53 | impl SourceFile { |
54 | fn new(green: GreenNode, errors: Vec<SyntaxError>) -> TreePtr<SourceFile> { | 54 | fn new(green: GreenNode, errors: Vec<SyntaxError>) -> TreeArc<SourceFile> { |
55 | let root = SyntaxNode::new(green, errors); | 55 | let root = SyntaxNode::new(green, errors); |
56 | if cfg!(debug_assertions) { | 56 | if cfg!(debug_assertions) { |
57 | utils::validate_block_structure(&root); | 57 | utils::validate_block_structure(&root); |
58 | } | 58 | } |
59 | assert_eq!(root.kind(), SyntaxKind::SOURCE_FILE); | 59 | assert_eq!(root.kind(), SyntaxKind::SOURCE_FILE); |
60 | TreePtr::cast(root) | 60 | TreeArc::cast(root) |
61 | } | 61 | } |
62 | pub fn parse(text: &str) -> TreePtr<SourceFile> { | 62 | pub fn parse(text: &str) -> TreeArc<SourceFile> { |
63 | let tokens = tokenize(&text); | 63 | let tokens = tokenize(&text); |
64 | let (green, errors) = | 64 | let (green, errors) = |
65 | parser_impl::parse_with(yellow::GreenBuilder::new(), text, &tokens, grammar::root); | 65 | parser_impl::parse_with(yellow::GreenBuilder::new(), text, &tokens, grammar::root); |
66 | SourceFile::new(green, errors) | 66 | SourceFile::new(green, errors) |
67 | } | 67 | } |
68 | pub fn reparse(&self, edit: &AtomTextEdit) -> TreePtr<SourceFile> { | 68 | pub fn reparse(&self, edit: &AtomTextEdit) -> TreeArc<SourceFile> { |
69 | self.incremental_reparse(edit) | 69 | self.incremental_reparse(edit) |
70 | .unwrap_or_else(|| self.full_reparse(edit)) | 70 | .unwrap_or_else(|| self.full_reparse(edit)) |
71 | } | 71 | } |
72 | pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<TreePtr<SourceFile>> { | 72 | pub fn incremental_reparse(&self, edit: &AtomTextEdit) -> Option<TreeArc<SourceFile>> { |
73 | reparsing::incremental_reparse(self.syntax(), edit, self.errors()) | 73 | reparsing::incremental_reparse(self.syntax(), edit, self.errors()) |
74 | .map(|(green_node, errors)| SourceFile::new(green_node, errors)) | 74 | .map(|(green_node, errors)| SourceFile::new(green_node, errors)) |
75 | } | 75 | } |
76 | fn full_reparse(&self, edit: &AtomTextEdit) -> TreePtr<SourceFile> { | 76 | fn full_reparse(&self, edit: &AtomTextEdit) -> TreeArc<SourceFile> { |
77 | let text = edit.apply(self.syntax().text().to_string()); | 77 | let text = edit.apply(self.syntax().text().to_string()); |
78 | SourceFile::parse(&text) | 78 | SourceFile::parse(&text) |
79 | } | 79 | } |
diff --git a/crates/ra_syntax/src/validation/byte.rs b/crates/ra_syntax/src/validation/byte.rs index 9ab4b18a3..9bddabc80 100644 --- a/crates/ra_syntax/src/validation/byte.rs +++ b/crates/ra_syntax/src/validation/byte.rs | |||
@@ -106,9 +106,9 @@ fn validate_byte_code_escape(text: &str, range: TextRange, errors: &mut Vec<Synt | |||
106 | 106 | ||
107 | #[cfg(test)] | 107 | #[cfg(test)] |
108 | mod test { | 108 | mod test { |
109 | use crate::{SourceFile, TreePtr}; | 109 | use crate::{SourceFile, TreeArc}; |
110 | 110 | ||
111 | fn build_file(literal: &str) -> TreePtr<SourceFile> { | 111 | fn build_file(literal: &str) -> TreeArc<SourceFile> { |
112 | let src = format!("const C: u8 = b'{}';", literal); | 112 | let src = format!("const C: u8 = b'{}';", literal); |
113 | SourceFile::parse(&src) | 113 | SourceFile::parse(&src) |
114 | } | 114 | } |
diff --git a/crates/ra_syntax/src/validation/byte_string.rs b/crates/ra_syntax/src/validation/byte_string.rs index cd41a0a68..bdb147545 100644 --- a/crates/ra_syntax/src/validation/byte_string.rs +++ b/crates/ra_syntax/src/validation/byte_string.rs | |||
@@ -43,9 +43,9 @@ pub(crate) fn validate_byte_string_node(node: &ast::ByteString, errors: &mut Vec | |||
43 | 43 | ||
44 | #[cfg(test)] | 44 | #[cfg(test)] |
45 | mod test { | 45 | mod test { |
46 | use crate::{SourceFile, TreePtr}; | 46 | use crate::{SourceFile, TreeArc}; |
47 | 47 | ||
48 | fn build_file(literal: &str) -> TreePtr<SourceFile> { | 48 | fn build_file(literal: &str) -> TreeArc<SourceFile> { |
49 | let src = format!(r#"const S: &'static [u8] = b"{}";"#, literal); | 49 | let src = format!(r#"const S: &'static [u8] = b"{}";"#, literal); |
50 | println!("Source: {}", src); | 50 | println!("Source: {}", src); |
51 | SourceFile::parse(&src) | 51 | SourceFile::parse(&src) |
diff --git a/crates/ra_syntax/src/validation/char.rs b/crates/ra_syntax/src/validation/char.rs index 169c88f56..e3ac5836b 100644 --- a/crates/ra_syntax/src/validation/char.rs +++ b/crates/ra_syntax/src/validation/char.rs | |||
@@ -175,9 +175,9 @@ fn validate_unicode_escape(text: &str, range: TextRange, errors: &mut Vec<Syntax | |||
175 | 175 | ||
176 | #[cfg(test)] | 176 | #[cfg(test)] |
177 | mod test { | 177 | mod test { |
178 | use crate::{SourceFile, TreePtr}; | 178 | use crate::{SourceFile, TreeArc}; |
179 | 179 | ||
180 | fn build_file(literal: &str) -> TreePtr<SourceFile> { | 180 | fn build_file(literal: &str) -> TreeArc<SourceFile> { |
181 | let src = format!("const C: char = '{}';", literal); | 181 | let src = format!("const C: char = '{}';", literal); |
182 | SourceFile::parse(&src) | 182 | SourceFile::parse(&src) |
183 | } | 183 | } |
diff --git a/crates/ra_syntax/src/validation/string.rs b/crates/ra_syntax/src/validation/string.rs index cb86b765f..365fe8d2d 100644 --- a/crates/ra_syntax/src/validation/string.rs +++ b/crates/ra_syntax/src/validation/string.rs | |||
@@ -38,9 +38,9 @@ pub(crate) fn validate_string_node(node: &ast::String, errors: &mut Vec<SyntaxEr | |||
38 | 38 | ||
39 | #[cfg(test)] | 39 | #[cfg(test)] |
40 | mod test { | 40 | mod test { |
41 | use crate::{SourceFile, TreePtr}; | 41 | use crate::{SourceFile, TreeArc}; |
42 | 42 | ||
43 | fn build_file(literal: &str) -> TreePtr<SourceFile> { | 43 | fn build_file(literal: &str) -> TreeArc<SourceFile> { |
44 | let src = format!(r#"const S: &'static str = "{}";"#, literal); | 44 | let src = format!(r#"const S: &'static str = "{}";"#, literal); |
45 | println!("Source: {}", src); | 45 | println!("Source: {}", src); |
46 | SourceFile::parse(&src) | 46 | SourceFile::parse(&src) |
diff --git a/crates/ra_syntax/src/yellow.rs b/crates/ra_syntax/src/yellow.rs index 1bf1806b9..93621d08a 100644 --- a/crates/ra_syntax/src/yellow.rs +++ b/crates/ra_syntax/src/yellow.rs | |||
@@ -21,23 +21,23 @@ impl Types for RaTypes { | |||
21 | pub type GreenNode = rowan::GreenNode<RaTypes>; | 21 | pub type GreenNode = rowan::GreenNode<RaTypes>; |
22 | 22 | ||
23 | #[derive(PartialEq, Eq, Hash)] | 23 | #[derive(PartialEq, Eq, Hash)] |
24 | pub struct TreePtr<T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>>( | 24 | pub struct TreeArc<T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>>( |
25 | pub(crate) rowan::TreePtr<RaTypes, T>, | 25 | pub(crate) rowan::TreeArc<RaTypes, T>, |
26 | ); | 26 | ); |
27 | 27 | ||
28 | impl<T> TreePtr<T> | 28 | impl<T> TreeArc<T> |
29 | where | 29 | where |
30 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, | 30 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, |
31 | { | 31 | { |
32 | pub(crate) fn cast<U>(this: TreePtr<T>) -> TreePtr<U> | 32 | pub(crate) fn cast<U>(this: TreeArc<T>) -> TreeArc<U> |
33 | where | 33 | where |
34 | U: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, | 34 | U: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, |
35 | { | 35 | { |
36 | TreePtr(rowan::TreePtr::cast(this.0)) | 36 | TreeArc(rowan::TreeArc::cast(this.0)) |
37 | } | 37 | } |
38 | } | 38 | } |
39 | 39 | ||
40 | impl<T> std::ops::Deref for TreePtr<T> | 40 | impl<T> std::ops::Deref for TreeArc<T> |
41 | where | 41 | where |
42 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, | 42 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, |
43 | { | 43 | { |
@@ -47,7 +47,7 @@ where | |||
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | impl<T> PartialEq<T> for TreePtr<T> | 50 | impl<T> PartialEq<T> for TreeArc<T> |
51 | where | 51 | where |
52 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, | 52 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, |
53 | T: PartialEq<T>, | 53 | T: PartialEq<T>, |
@@ -58,16 +58,16 @@ where | |||
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | impl<T> Clone for TreePtr<T> | 61 | impl<T> Clone for TreeArc<T> |
62 | where | 62 | where |
63 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, | 63 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, |
64 | { | 64 | { |
65 | fn clone(&self) -> TreePtr<T> { | 65 | fn clone(&self) -> TreeArc<T> { |
66 | TreePtr(self.0.clone()) | 66 | TreeArc(self.0.clone()) |
67 | } | 67 | } |
68 | } | 68 | } |
69 | 69 | ||
70 | impl<T> fmt::Debug for TreePtr<T> | 70 | impl<T> fmt::Debug for TreeArc<T> |
71 | where | 71 | where |
72 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, | 72 | T: TransparentNewType<Repr = rowan::SyntaxNode<RaTypes>>, |
73 | T: fmt::Debug, | 73 | T: fmt::Debug, |
@@ -85,9 +85,9 @@ unsafe impl TransparentNewType for SyntaxNode { | |||
85 | } | 85 | } |
86 | 86 | ||
87 | impl SyntaxNode { | 87 | impl SyntaxNode { |
88 | pub(crate) fn new(green: GreenNode, errors: Vec<SyntaxError>) -> TreePtr<SyntaxNode> { | 88 | pub(crate) fn new(green: GreenNode, errors: Vec<SyntaxError>) -> TreeArc<SyntaxNode> { |
89 | let ptr = TreePtr(rowan::SyntaxNode::new(green, errors)); | 89 | let ptr = TreeArc(rowan::SyntaxNode::new(green, errors)); |
90 | TreePtr::cast(ptr) | 90 | TreeArc::cast(ptr) |
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
@@ -131,9 +131,9 @@ impl SyntaxNode { | |||
131 | pub(crate) fn replace_with(&self, replacement: GreenNode) -> GreenNode { | 131 | pub(crate) fn replace_with(&self, replacement: GreenNode) -> GreenNode { |
132 | self.0.replace_self(replacement) | 132 | self.0.replace_self(replacement) |
133 | } | 133 | } |
134 | pub fn to_owned(&self) -> TreePtr<SyntaxNode> { | 134 | pub fn to_owned(&self) -> TreeArc<SyntaxNode> { |
135 | let ptr = TreePtr(self.0.to_owned()); | 135 | let ptr = TreeArc(self.0.to_owned()); |
136 | TreePtr::cast(ptr) | 136 | TreeArc::cast(ptr) |
137 | } | 137 | } |
138 | pub fn kind(&self) -> SyntaxKind { | 138 | pub fn kind(&self) -> SyntaxKind { |
139 | self.0.kind() | 139 | self.0.kind() |