aboutsummaryrefslogtreecommitdiff
path: root/crates/libsyntax2/src/ast/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/libsyntax2/src/ast/mod.rs')
-rw-r--r--crates/libsyntax2/src/ast/mod.rs8
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 @@
1mod generated; 1mod generated;
2 2
3use std::sync::Arc;
4
5use itertools::Itertools; 3use itertools::Itertools;
6use smol_str::SmolStr; 4use smol_str::SmolStr;
7 5
8use { 6use {
9 SyntaxNode, SyntaxNodeRef, SyntaxRoot, TreeRoot, SyntaxError, 7 SyntaxNode, SyntaxNodeRef, OwnedRoot, TreeRoot, SyntaxError,
10 SyntaxKind::*, 8 SyntaxKind::*,
11}; 9};
12pub use self::generated::*; 10pub use self::generated::*;
@@ -37,7 +35,7 @@ pub trait AttrsOwner<R: TreeRoot>: AstNode<R> {
37 } 35 }
38} 36}
39 37
40impl File<Arc<SyntaxRoot>> { 38impl 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
46impl<R: TreeRoot> File<R> { 44impl<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