aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/generated.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-02-02 08:20:50 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-02-02 08:20:50 +0000
commitda3802b2ce4796461a9fff22f4e9c6fd890879b2 (patch)
treeb3df38ae7b749178d854be9f2e6b16070a373216 /crates/ra_syntax/src/ast/generated.rs
parent4447019f4b5f24728bb7b91b161755ddb373c74c (diff)
parentd8ef8acb47b1be92da97a2d5cd4334bceed5b919 (diff)
Merge #725
725: Implement `use as` r=matklad a=flodiebold Co-authored-by: Florian Diebold <[email protected]>
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