diff options
Diffstat (limited to 'crates/libsyntax2/src/ast/mod.rs')
-rw-r--r-- | crates/libsyntax2/src/ast/mod.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/libsyntax2/src/ast/mod.rs b/crates/libsyntax2/src/ast/mod.rs index 9b9200f99..b52230e9c 100644 --- a/crates/libsyntax2/src/ast/mod.rs +++ b/crates/libsyntax2/src/ast/mod.rs | |||
@@ -1,12 +1,10 @@ | |||
1 | mod generated; | 1 | mod generated; |
2 | 2 | ||
3 | use std::sync::Arc; | ||
4 | |||
5 | use itertools::Itertools; | 3 | use itertools::Itertools; |
6 | use smol_str::SmolStr; | 4 | use smol_str::SmolStr; |
7 | 5 | ||
8 | use { | 6 | use { |
9 | SyntaxNode, SyntaxNodeRef, SyntaxRoot, TreeRoot, SyntaxError, | 7 | SyntaxNode, SyntaxNodeRef, OwnedRoot, TreeRoot, SyntaxError, |
10 | SyntaxKind::*, | 8 | SyntaxKind::*, |
11 | }; | 9 | }; |
12 | pub use self::generated::*; | 10 | pub use self::generated::*; |
@@ -37,7 +35,7 @@ pub trait AttrsOwner<R: TreeRoot>: AstNode<R> { | |||
37 | } | 35 | } |
38 | } | 36 | } |
39 | 37 | ||
40 | impl File<Arc<SyntaxRoot>> { | 38 | impl File<OwnedRoot> { |
41 | pub fn parse(text: &str) -> Self { | 39 | pub fn parse(text: &str) -> Self { |
42 | File::cast(::parse(text)).unwrap() | 40 | File::cast(::parse(text)).unwrap() |
43 | } | 41 | } |
@@ -45,7 +43,7 @@ impl File<Arc<SyntaxRoot>> { | |||
45 | 43 | ||
46 | impl<R: TreeRoot> File<R> { | 44 | impl<R: TreeRoot> File<R> { |
47 | pub fn errors(&self) -> Vec<SyntaxError> { | 45 | pub fn errors(&self) -> Vec<SyntaxError> { |
48 | self.syntax().root.errors.clone() | 46 | self.syntax().root.syntax_root().errors.clone() |
49 | } | 47 | } |
50 | } | 48 | } |
51 | 49 | ||