aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/generated.rs')
-rw-r--r--crates/ra_syntax/src/ast/generated.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index d0561c495..60480c699 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -17,6 +17,35 @@ use crate::{
17 ast::{self, AstNode}, 17 ast::{self, AstNode},
18}; 18};
19 19
20// Alias
21#[derive(Debug, PartialEq, Eq, Hash)]
22#[repr(transparent)]
23pub struct Alias {
24 pub(crate) syntax: SyntaxNode,
25}
26unsafe impl TransparentNewType for Alias {
27 type Repr = rowan::SyntaxNode<RaTypes>;
28}
29
30impl AstNode for Alias {
31 fn cast(syntax: &SyntaxNode) -> Option<&Self> {
32 match syntax.kind() {
33 ALIAS => Some(Alias::from_repr(syntax.into_repr())),
34 _ => None,
35 }
36 }
37 fn syntax(&self) -> &SyntaxNode { &self.syntax }
38}
39
40impl ToOwned for Alias {
41 type Owned = TreeArc<Alias>;
42 fn to_owned(&self) -> TreeArc<Alias> { TreeArc::cast(self.syntax.to_owned()) }
43}
44
45
46impl ast::NameOwner for Alias {}
47impl Alias {}
48
20// ArgList 49// ArgList
21#[derive(Debug, PartialEq, Eq, Hash)] 50#[derive(Debug, PartialEq, Eq, Hash)]
22#[repr(transparent)] 51#[repr(transparent)]
@@ -4176,6 +4205,10 @@ impl UseTree {
4176 pub fn use_tree_list(&self) -> Option<&UseTreeList> { 4205 pub fn use_tree_list(&self) -> Option<&UseTreeList> {
4177 super::child_opt(self) 4206 super::child_opt(self)
4178 } 4207 }
4208
4209 pub fn alias(&self) -> Option<&Alias> {
4210 super::child_opt(self)
4211 }
4179} 4212}
4180 4213
4181// UseTreeList 4214// UseTreeList