diff options
Diffstat (limited to 'crates/libsyntax2/src/ast/generated.rs')
-rw-r--r-- | crates/libsyntax2/src/ast/generated.rs | 436 |
1 files changed, 218 insertions, 218 deletions
diff --git a/crates/libsyntax2/src/ast/generated.rs b/crates/libsyntax2/src/ast/generated.rs index 4fc405c8a..e8a87eba5 100644 --- a/crates/libsyntax2/src/ast/generated.rs +++ b/crates/libsyntax2/src/ast/generated.rs | |||
@@ -1,45 +1,45 @@ | |||
1 | use { | 1 | use { |
2 | ast, | 2 | ast, |
3 | SyntaxNode, OwnedRoot, TreeRoot, AstNode, | 3 | SyntaxNodeRef, AstNode, |
4 | SyntaxKind::*, | 4 | SyntaxKind::*, |
5 | }; | 5 | }; |
6 | 6 | ||
7 | // ArrayType | 7 | // ArrayType |
8 | #[derive(Debug, Clone, Copy)] | 8 | #[derive(Debug, Clone, Copy)] |
9 | pub struct ArrayType<R: TreeRoot = OwnedRoot> { | 9 | pub struct ArrayType<'a> { |
10 | syntax: SyntaxNode<R>, | 10 | syntax: SyntaxNodeRef<'a>, |
11 | } | 11 | } |
12 | 12 | ||
13 | impl<R: TreeRoot> AstNode<R> for ArrayType<R> { | 13 | impl<'a> AstNode<'a> for ArrayType<'a> { |
14 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 14 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
15 | match syntax.kind() { | 15 | match syntax.kind() { |
16 | ARRAY_TYPE => Some(ArrayType { syntax }), | 16 | ARRAY_TYPE => Some(ArrayType { syntax }), |
17 | _ => None, | 17 | _ => None, |
18 | } | 18 | } |
19 | } | 19 | } |
20 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 20 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
21 | } | 21 | } |
22 | 22 | ||
23 | impl<R: TreeRoot> ArrayType<R> {} | 23 | impl<'a> ArrayType<'a> {} |
24 | 24 | ||
25 | // Attr | 25 | // Attr |
26 | #[derive(Debug, Clone, Copy)] | 26 | #[derive(Debug, Clone, Copy)] |
27 | pub struct Attr<R: TreeRoot = OwnedRoot> { | 27 | pub struct Attr<'a> { |
28 | syntax: SyntaxNode<R>, | 28 | syntax: SyntaxNodeRef<'a>, |
29 | } | 29 | } |
30 | 30 | ||
31 | impl<R: TreeRoot> AstNode<R> for Attr<R> { | 31 | impl<'a> AstNode<'a> for Attr<'a> { |
32 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 32 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
33 | match syntax.kind() { | 33 | match syntax.kind() { |
34 | ATTR => Some(Attr { syntax }), | 34 | ATTR => Some(Attr { syntax }), |
35 | _ => None, | 35 | _ => None, |
36 | } | 36 | } |
37 | } | 37 | } |
38 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 38 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
39 | } | 39 | } |
40 | 40 | ||
41 | impl<R: TreeRoot> Attr<R> { | 41 | impl<'a> Attr<'a> { |
42 | pub fn value(&self) -> Option<TokenTree<R>> { | 42 | pub fn value(self) -> Option<TokenTree<'a>> { |
43 | self.syntax() | 43 | self.syntax() |
44 | .children() | 44 | .children() |
45 | .filter_map(TokenTree::cast) | 45 | .filter_map(TokenTree::cast) |
@@ -49,80 +49,80 @@ impl<R: TreeRoot> Attr<R> { | |||
49 | 49 | ||
50 | // ConstDef | 50 | // ConstDef |
51 | #[derive(Debug, Clone, Copy)] | 51 | #[derive(Debug, Clone, Copy)] |
52 | pub struct ConstDef<R: TreeRoot = OwnedRoot> { | 52 | pub struct ConstDef<'a> { |
53 | syntax: SyntaxNode<R>, | 53 | syntax: SyntaxNodeRef<'a>, |
54 | } | 54 | } |
55 | 55 | ||
56 | impl<R: TreeRoot> AstNode<R> for ConstDef<R> { | 56 | impl<'a> AstNode<'a> for ConstDef<'a> { |
57 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 57 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
58 | match syntax.kind() { | 58 | match syntax.kind() { |
59 | CONST_DEF => Some(ConstDef { syntax }), | 59 | CONST_DEF => Some(ConstDef { syntax }), |
60 | _ => None, | 60 | _ => None, |
61 | } | 61 | } |
62 | } | 62 | } |
63 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 63 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
64 | } | 64 | } |
65 | 65 | ||
66 | impl<R: TreeRoot> ast::NameOwner<R> for ConstDef<R> {} | 66 | impl<'a> ast::NameOwner<'a> for ConstDef<'a> {} |
67 | impl<R: TreeRoot> ast::AttrsOwner<R> for ConstDef<R> {} | 67 | impl<'a> ast::AttrsOwner<'a> for ConstDef<'a> {} |
68 | impl<R: TreeRoot> ConstDef<R> {} | 68 | impl<'a> ConstDef<'a> {} |
69 | 69 | ||
70 | // DynTraitType | 70 | // DynTraitType |
71 | #[derive(Debug, Clone, Copy)] | 71 | #[derive(Debug, Clone, Copy)] |
72 | pub struct DynTraitType<R: TreeRoot = OwnedRoot> { | 72 | pub struct DynTraitType<'a> { |
73 | syntax: SyntaxNode<R>, | 73 | syntax: SyntaxNodeRef<'a>, |
74 | } | 74 | } |
75 | 75 | ||
76 | impl<R: TreeRoot> AstNode<R> for DynTraitType<R> { | 76 | impl<'a> AstNode<'a> for DynTraitType<'a> { |
77 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 77 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
78 | match syntax.kind() { | 78 | match syntax.kind() { |
79 | DYN_TRAIT_TYPE => Some(DynTraitType { syntax }), | 79 | DYN_TRAIT_TYPE => Some(DynTraitType { syntax }), |
80 | _ => None, | 80 | _ => None, |
81 | } | 81 | } |
82 | } | 82 | } |
83 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 83 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
84 | } | 84 | } |
85 | 85 | ||
86 | impl<R: TreeRoot> DynTraitType<R> {} | 86 | impl<'a> DynTraitType<'a> {} |
87 | 87 | ||
88 | // EnumDef | 88 | // EnumDef |
89 | #[derive(Debug, Clone, Copy)] | 89 | #[derive(Debug, Clone, Copy)] |
90 | pub struct EnumDef<R: TreeRoot = OwnedRoot> { | 90 | pub struct EnumDef<'a> { |
91 | syntax: SyntaxNode<R>, | 91 | syntax: SyntaxNodeRef<'a>, |
92 | } | 92 | } |
93 | 93 | ||
94 | impl<R: TreeRoot> AstNode<R> for EnumDef<R> { | 94 | impl<'a> AstNode<'a> for EnumDef<'a> { |
95 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 95 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
96 | match syntax.kind() { | 96 | match syntax.kind() { |
97 | ENUM_DEF => Some(EnumDef { syntax }), | 97 | ENUM_DEF => Some(EnumDef { syntax }), |
98 | _ => None, | 98 | _ => None, |
99 | } | 99 | } |
100 | } | 100 | } |
101 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 101 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
102 | } | 102 | } |
103 | 103 | ||
104 | impl<R: TreeRoot> ast::NameOwner<R> for EnumDef<R> {} | 104 | impl<'a> ast::NameOwner<'a> for EnumDef<'a> {} |
105 | impl<R: TreeRoot> ast::AttrsOwner<R> for EnumDef<R> {} | 105 | impl<'a> ast::AttrsOwner<'a> for EnumDef<'a> {} |
106 | impl<R: TreeRoot> EnumDef<R> {} | 106 | impl<'a> EnumDef<'a> {} |
107 | 107 | ||
108 | // File | 108 | // File |
109 | #[derive(Debug, Clone, Copy)] | 109 | #[derive(Debug, Clone, Copy)] |
110 | pub struct File<R: TreeRoot = OwnedRoot> { | 110 | pub struct File<'a> { |
111 | syntax: SyntaxNode<R>, | 111 | syntax: SyntaxNodeRef<'a>, |
112 | } | 112 | } |
113 | 113 | ||
114 | impl<R: TreeRoot> AstNode<R> for File<R> { | 114 | impl<'a> AstNode<'a> for File<'a> { |
115 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 115 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
116 | match syntax.kind() { | 116 | match syntax.kind() { |
117 | FILE => Some(File { syntax }), | 117 | FILE => Some(File { syntax }), |
118 | _ => None, | 118 | _ => None, |
119 | } | 119 | } |
120 | } | 120 | } |
121 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 121 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
122 | } | 122 | } |
123 | 123 | ||
124 | impl<R: TreeRoot> File<R> { | 124 | impl<'a> File<'a> { |
125 | pub fn functions<'a>(&'a self) -> impl Iterator<Item = FnDef<R>> + 'a { | 125 | pub fn functions(self) -> impl Iterator<Item = FnDef<'a>> + 'a { |
126 | self.syntax() | 126 | self.syntax() |
127 | .children() | 127 | .children() |
128 | .filter_map(FnDef::cast) | 128 | .filter_map(FnDef::cast) |
@@ -131,206 +131,206 @@ impl<R: TreeRoot> File<R> { | |||
131 | 131 | ||
132 | // FnDef | 132 | // FnDef |
133 | #[derive(Debug, Clone, Copy)] | 133 | #[derive(Debug, Clone, Copy)] |
134 | pub struct FnDef<R: TreeRoot = OwnedRoot> { | 134 | pub struct FnDef<'a> { |
135 | syntax: SyntaxNode<R>, | 135 | syntax: SyntaxNodeRef<'a>, |
136 | } | 136 | } |
137 | 137 | ||
138 | impl<R: TreeRoot> AstNode<R> for FnDef<R> { | 138 | impl<'a> AstNode<'a> for FnDef<'a> { |
139 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 139 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
140 | match syntax.kind() { | 140 | match syntax.kind() { |
141 | FN_DEF => Some(FnDef { syntax }), | 141 | FN_DEF => Some(FnDef { syntax }), |
142 | _ => None, | 142 | _ => None, |
143 | } | 143 | } |
144 | } | 144 | } |
145 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 145 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
146 | } | 146 | } |
147 | 147 | ||
148 | impl<R: TreeRoot> ast::NameOwner<R> for FnDef<R> {} | 148 | impl<'a> ast::NameOwner<'a> for FnDef<'a> {} |
149 | impl<R: TreeRoot> ast::AttrsOwner<R> for FnDef<R> {} | 149 | impl<'a> ast::AttrsOwner<'a> for FnDef<'a> {} |
150 | impl<R: TreeRoot> FnDef<R> {} | 150 | impl<'a> FnDef<'a> {} |
151 | 151 | ||
152 | // FnPointerType | 152 | // FnPointerType |
153 | #[derive(Debug, Clone, Copy)] | 153 | #[derive(Debug, Clone, Copy)] |
154 | pub struct FnPointerType<R: TreeRoot = OwnedRoot> { | 154 | pub struct FnPointerType<'a> { |
155 | syntax: SyntaxNode<R>, | 155 | syntax: SyntaxNodeRef<'a>, |
156 | } | 156 | } |
157 | 157 | ||
158 | impl<R: TreeRoot> AstNode<R> for FnPointerType<R> { | 158 | impl<'a> AstNode<'a> for FnPointerType<'a> { |
159 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 159 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
160 | match syntax.kind() { | 160 | match syntax.kind() { |
161 | FN_POINTER_TYPE => Some(FnPointerType { syntax }), | 161 | FN_POINTER_TYPE => Some(FnPointerType { syntax }), |
162 | _ => None, | 162 | _ => None, |
163 | } | 163 | } |
164 | } | 164 | } |
165 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 165 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
166 | } | 166 | } |
167 | 167 | ||
168 | impl<R: TreeRoot> FnPointerType<R> {} | 168 | impl<'a> FnPointerType<'a> {} |
169 | 169 | ||
170 | // ForType | 170 | // ForType |
171 | #[derive(Debug, Clone, Copy)] | 171 | #[derive(Debug, Clone, Copy)] |
172 | pub struct ForType<R: TreeRoot = OwnedRoot> { | 172 | pub struct ForType<'a> { |
173 | syntax: SyntaxNode<R>, | 173 | syntax: SyntaxNodeRef<'a>, |
174 | } | 174 | } |
175 | 175 | ||
176 | impl<R: TreeRoot> AstNode<R> for ForType<R> { | 176 | impl<'a> AstNode<'a> for ForType<'a> { |
177 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 177 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
178 | match syntax.kind() { | 178 | match syntax.kind() { |
179 | FOR_TYPE => Some(ForType { syntax }), | 179 | FOR_TYPE => Some(ForType { syntax }), |
180 | _ => None, | 180 | _ => None, |
181 | } | 181 | } |
182 | } | 182 | } |
183 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 183 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
184 | } | 184 | } |
185 | 185 | ||
186 | impl<R: TreeRoot> ForType<R> {} | 186 | impl<'a> ForType<'a> {} |
187 | 187 | ||
188 | // ImplItem | 188 | // ImplItem |
189 | #[derive(Debug, Clone, Copy)] | 189 | #[derive(Debug, Clone, Copy)] |
190 | pub struct ImplItem<R: TreeRoot = OwnedRoot> { | 190 | pub struct ImplItem<'a> { |
191 | syntax: SyntaxNode<R>, | 191 | syntax: SyntaxNodeRef<'a>, |
192 | } | 192 | } |
193 | 193 | ||
194 | impl<R: TreeRoot> AstNode<R> for ImplItem<R> { | 194 | impl<'a> AstNode<'a> for ImplItem<'a> { |
195 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 195 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
196 | match syntax.kind() { | 196 | match syntax.kind() { |
197 | IMPL_ITEM => Some(ImplItem { syntax }), | 197 | IMPL_ITEM => Some(ImplItem { syntax }), |
198 | _ => None, | 198 | _ => None, |
199 | } | 199 | } |
200 | } | 200 | } |
201 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 201 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
202 | } | 202 | } |
203 | 203 | ||
204 | impl<R: TreeRoot> ImplItem<R> {} | 204 | impl<'a> ImplItem<'a> {} |
205 | 205 | ||
206 | // ImplTraitType | 206 | // ImplTraitType |
207 | #[derive(Debug, Clone, Copy)] | 207 | #[derive(Debug, Clone, Copy)] |
208 | pub struct ImplTraitType<R: TreeRoot = OwnedRoot> { | 208 | pub struct ImplTraitType<'a> { |
209 | syntax: SyntaxNode<R>, | 209 | syntax: SyntaxNodeRef<'a>, |
210 | } | 210 | } |
211 | 211 | ||
212 | impl<R: TreeRoot> AstNode<R> for ImplTraitType<R> { | 212 | impl<'a> AstNode<'a> for ImplTraitType<'a> { |
213 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 213 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
214 | match syntax.kind() { | 214 | match syntax.kind() { |
215 | IMPL_TRAIT_TYPE => Some(ImplTraitType { syntax }), | 215 | IMPL_TRAIT_TYPE => Some(ImplTraitType { syntax }), |
216 | _ => None, | 216 | _ => None, |
217 | } | 217 | } |
218 | } | 218 | } |
219 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 219 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
220 | } | 220 | } |
221 | 221 | ||
222 | impl<R: TreeRoot> ImplTraitType<R> {} | 222 | impl<'a> ImplTraitType<'a> {} |
223 | 223 | ||
224 | // Module | 224 | // Module |
225 | #[derive(Debug, Clone, Copy)] | 225 | #[derive(Debug, Clone, Copy)] |
226 | pub struct Module<R: TreeRoot = OwnedRoot> { | 226 | pub struct Module<'a> { |
227 | syntax: SyntaxNode<R>, | 227 | syntax: SyntaxNodeRef<'a>, |
228 | } | 228 | } |
229 | 229 | ||
230 | impl<R: TreeRoot> AstNode<R> for Module<R> { | 230 | impl<'a> AstNode<'a> for Module<'a> { |
231 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 231 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
232 | match syntax.kind() { | 232 | match syntax.kind() { |
233 | MODULE => Some(Module { syntax }), | 233 | MODULE => Some(Module { syntax }), |
234 | _ => None, | 234 | _ => None, |
235 | } | 235 | } |
236 | } | 236 | } |
237 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 237 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
238 | } | 238 | } |
239 | 239 | ||
240 | impl<R: TreeRoot> ast::NameOwner<R> for Module<R> {} | 240 | impl<'a> ast::NameOwner<'a> for Module<'a> {} |
241 | impl<R: TreeRoot> ast::AttrsOwner<R> for Module<R> {} | 241 | impl<'a> ast::AttrsOwner<'a> for Module<'a> {} |
242 | impl<R: TreeRoot> Module<R> {} | 242 | impl<'a> Module<'a> {} |
243 | 243 | ||
244 | // Name | 244 | // Name |
245 | #[derive(Debug, Clone, Copy)] | 245 | #[derive(Debug, Clone, Copy)] |
246 | pub struct Name<R: TreeRoot = OwnedRoot> { | 246 | pub struct Name<'a> { |
247 | syntax: SyntaxNode<R>, | 247 | syntax: SyntaxNodeRef<'a>, |
248 | } | 248 | } |
249 | 249 | ||
250 | impl<R: TreeRoot> AstNode<R> for Name<R> { | 250 | impl<'a> AstNode<'a> for Name<'a> { |
251 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 251 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
252 | match syntax.kind() { | 252 | match syntax.kind() { |
253 | NAME => Some(Name { syntax }), | 253 | NAME => Some(Name { syntax }), |
254 | _ => None, | 254 | _ => None, |
255 | } | 255 | } |
256 | } | 256 | } |
257 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 257 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
258 | } | 258 | } |
259 | 259 | ||
260 | impl<R: TreeRoot> Name<R> {} | 260 | impl<'a> Name<'a> {} |
261 | 261 | ||
262 | // NameRef | 262 | // NameRef |
263 | #[derive(Debug, Clone, Copy)] | 263 | #[derive(Debug, Clone, Copy)] |
264 | pub struct NameRef<R: TreeRoot = OwnedRoot> { | 264 | pub struct NameRef<'a> { |
265 | syntax: SyntaxNode<R>, | 265 | syntax: SyntaxNodeRef<'a>, |
266 | } | 266 | } |
267 | 267 | ||
268 | impl<R: TreeRoot> AstNode<R> for NameRef<R> { | 268 | impl<'a> AstNode<'a> for NameRef<'a> { |
269 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 269 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
270 | match syntax.kind() { | 270 | match syntax.kind() { |
271 | NAME_REF => Some(NameRef { syntax }), | 271 | NAME_REF => Some(NameRef { syntax }), |
272 | _ => None, | 272 | _ => None, |
273 | } | 273 | } |
274 | } | 274 | } |
275 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 275 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
276 | } | 276 | } |
277 | 277 | ||
278 | impl<R: TreeRoot> NameRef<R> {} | 278 | impl<'a> NameRef<'a> {} |
279 | 279 | ||
280 | // NamedField | 280 | // NamedField |
281 | #[derive(Debug, Clone, Copy)] | 281 | #[derive(Debug, Clone, Copy)] |
282 | pub struct NamedField<R: TreeRoot = OwnedRoot> { | 282 | pub struct NamedField<'a> { |
283 | syntax: SyntaxNode<R>, | 283 | syntax: SyntaxNodeRef<'a>, |
284 | } | 284 | } |
285 | 285 | ||
286 | impl<R: TreeRoot> AstNode<R> for NamedField<R> { | 286 | impl<'a> AstNode<'a> for NamedField<'a> { |
287 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 287 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
288 | match syntax.kind() { | 288 | match syntax.kind() { |
289 | NAMED_FIELD => Some(NamedField { syntax }), | 289 | NAMED_FIELD => Some(NamedField { syntax }), |
290 | _ => None, | 290 | _ => None, |
291 | } | 291 | } |
292 | } | 292 | } |
293 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 293 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
294 | } | 294 | } |
295 | 295 | ||
296 | impl<R: TreeRoot> ast::NameOwner<R> for NamedField<R> {} | 296 | impl<'a> ast::NameOwner<'a> for NamedField<'a> {} |
297 | impl<R: TreeRoot> ast::AttrsOwner<R> for NamedField<R> {} | 297 | impl<'a> ast::AttrsOwner<'a> for NamedField<'a> {} |
298 | impl<R: TreeRoot> NamedField<R> {} | 298 | impl<'a> NamedField<'a> {} |
299 | 299 | ||
300 | // NeverType | 300 | // NeverType |
301 | #[derive(Debug, Clone, Copy)] | 301 | #[derive(Debug, Clone, Copy)] |
302 | pub struct NeverType<R: TreeRoot = OwnedRoot> { | 302 | pub struct NeverType<'a> { |
303 | syntax: SyntaxNode<R>, | 303 | syntax: SyntaxNodeRef<'a>, |
304 | } | 304 | } |
305 | 305 | ||
306 | impl<R: TreeRoot> AstNode<R> for NeverType<R> { | 306 | impl<'a> AstNode<'a> for NeverType<'a> { |
307 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 307 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
308 | match syntax.kind() { | 308 | match syntax.kind() { |
309 | NEVER_TYPE => Some(NeverType { syntax }), | 309 | NEVER_TYPE => Some(NeverType { syntax }), |
310 | _ => None, | 310 | _ => None, |
311 | } | 311 | } |
312 | } | 312 | } |
313 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 313 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
314 | } | 314 | } |
315 | 315 | ||
316 | impl<R: TreeRoot> NeverType<R> {} | 316 | impl<'a> NeverType<'a> {} |
317 | 317 | ||
318 | // NominalDef | 318 | // NominalDef |
319 | #[derive(Debug, Clone, Copy)] | 319 | #[derive(Debug, Clone, Copy)] |
320 | pub enum NominalDef<R: TreeRoot = OwnedRoot> { | 320 | pub enum NominalDef<'a> { |
321 | StructDef(StructDef<R>), | 321 | StructDef(StructDef<'a>), |
322 | EnumDef(EnumDef<R>), | 322 | EnumDef(EnumDef<'a>), |
323 | } | 323 | } |
324 | 324 | ||
325 | impl<R: TreeRoot> AstNode<R> for NominalDef<R> { | 325 | impl<'a> AstNode<'a> for NominalDef<'a> { |
326 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 326 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
327 | match syntax.kind() { | 327 | match syntax.kind() { |
328 | STRUCT_DEF => Some(NominalDef::StructDef(StructDef { syntax })), | 328 | STRUCT_DEF => Some(NominalDef::StructDef(StructDef { syntax })), |
329 | ENUM_DEF => Some(NominalDef::EnumDef(EnumDef { syntax })), | 329 | ENUM_DEF => Some(NominalDef::EnumDef(EnumDef { syntax })), |
330 | _ => None, | 330 | _ => None, |
331 | } | 331 | } |
332 | } | 332 | } |
333 | fn syntax(&self) -> &SyntaxNode<R> { | 333 | fn syntax(self) -> SyntaxNodeRef<'a> { |
334 | match self { | 334 | match self { |
335 | NominalDef::StructDef(inner) => inner.syntax(), | 335 | NominalDef::StructDef(inner) => inner.syntax(), |
336 | NominalDef::EnumDef(inner) => inner.syntax(), | 336 | NominalDef::EnumDef(inner) => inner.syntax(), |
@@ -338,157 +338,157 @@ impl<R: TreeRoot> AstNode<R> for NominalDef<R> { | |||
338 | } | 338 | } |
339 | } | 339 | } |
340 | 340 | ||
341 | impl<R: TreeRoot> ast::AttrsOwner<R> for NominalDef<R> {} | 341 | impl<'a> ast::AttrsOwner<'a> for NominalDef<'a> {} |
342 | impl<R: TreeRoot> NominalDef<R> {} | 342 | impl<'a> NominalDef<'a> {} |
343 | 343 | ||
344 | // ParenType | 344 | // ParenType |
345 | #[derive(Debug, Clone, Copy)] | 345 | #[derive(Debug, Clone, Copy)] |
346 | pub struct ParenType<R: TreeRoot = OwnedRoot> { | 346 | pub struct ParenType<'a> { |
347 | syntax: SyntaxNode<R>, | 347 | syntax: SyntaxNodeRef<'a>, |
348 | } | 348 | } |
349 | 349 | ||
350 | impl<R: TreeRoot> AstNode<R> for ParenType<R> { | 350 | impl<'a> AstNode<'a> for ParenType<'a> { |
351 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 351 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
352 | match syntax.kind() { | 352 | match syntax.kind() { |
353 | PAREN_TYPE => Some(ParenType { syntax }), | 353 | PAREN_TYPE => Some(ParenType { syntax }), |
354 | _ => None, | 354 | _ => None, |
355 | } | 355 | } |
356 | } | 356 | } |
357 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 357 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
358 | } | 358 | } |
359 | 359 | ||
360 | impl<R: TreeRoot> ParenType<R> {} | 360 | impl<'a> ParenType<'a> {} |
361 | 361 | ||
362 | // PathType | 362 | // PathType |
363 | #[derive(Debug, Clone, Copy)] | 363 | #[derive(Debug, Clone, Copy)] |
364 | pub struct PathType<R: TreeRoot = OwnedRoot> { | 364 | pub struct PathType<'a> { |
365 | syntax: SyntaxNode<R>, | 365 | syntax: SyntaxNodeRef<'a>, |
366 | } | 366 | } |
367 | 367 | ||
368 | impl<R: TreeRoot> AstNode<R> for PathType<R> { | 368 | impl<'a> AstNode<'a> for PathType<'a> { |
369 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 369 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
370 | match syntax.kind() { | 370 | match syntax.kind() { |
371 | PATH_TYPE => Some(PathType { syntax }), | 371 | PATH_TYPE => Some(PathType { syntax }), |
372 | _ => None, | 372 | _ => None, |
373 | } | 373 | } |
374 | } | 374 | } |
375 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 375 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
376 | } | 376 | } |
377 | 377 | ||
378 | impl<R: TreeRoot> PathType<R> {} | 378 | impl<'a> PathType<'a> {} |
379 | 379 | ||
380 | // PlaceholderType | 380 | // PlaceholderType |
381 | #[derive(Debug, Clone, Copy)] | 381 | #[derive(Debug, Clone, Copy)] |
382 | pub struct PlaceholderType<R: TreeRoot = OwnedRoot> { | 382 | pub struct PlaceholderType<'a> { |
383 | syntax: SyntaxNode<R>, | 383 | syntax: SyntaxNodeRef<'a>, |
384 | } | 384 | } |
385 | 385 | ||
386 | impl<R: TreeRoot> AstNode<R> for PlaceholderType<R> { | 386 | impl<'a> AstNode<'a> for PlaceholderType<'a> { |
387 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 387 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
388 | match syntax.kind() { | 388 | match syntax.kind() { |
389 | PLACEHOLDER_TYPE => Some(PlaceholderType { syntax }), | 389 | PLACEHOLDER_TYPE => Some(PlaceholderType { syntax }), |
390 | _ => None, | 390 | _ => None, |
391 | } | 391 | } |
392 | } | 392 | } |
393 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 393 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
394 | } | 394 | } |
395 | 395 | ||
396 | impl<R: TreeRoot> PlaceholderType<R> {} | 396 | impl<'a> PlaceholderType<'a> {} |
397 | 397 | ||
398 | // PointerType | 398 | // PointerType |
399 | #[derive(Debug, Clone, Copy)] | 399 | #[derive(Debug, Clone, Copy)] |
400 | pub struct PointerType<R: TreeRoot = OwnedRoot> { | 400 | pub struct PointerType<'a> { |
401 | syntax: SyntaxNode<R>, | 401 | syntax: SyntaxNodeRef<'a>, |
402 | } | 402 | } |
403 | 403 | ||
404 | impl<R: TreeRoot> AstNode<R> for PointerType<R> { | 404 | impl<'a> AstNode<'a> for PointerType<'a> { |
405 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 405 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
406 | match syntax.kind() { | 406 | match syntax.kind() { |
407 | POINTER_TYPE => Some(PointerType { syntax }), | 407 | POINTER_TYPE => Some(PointerType { syntax }), |
408 | _ => None, | 408 | _ => None, |
409 | } | 409 | } |
410 | } | 410 | } |
411 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 411 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
412 | } | 412 | } |
413 | 413 | ||
414 | impl<R: TreeRoot> PointerType<R> {} | 414 | impl<'a> PointerType<'a> {} |
415 | 415 | ||
416 | // ReferenceType | 416 | // ReferenceType |
417 | #[derive(Debug, Clone, Copy)] | 417 | #[derive(Debug, Clone, Copy)] |
418 | pub struct ReferenceType<R: TreeRoot = OwnedRoot> { | 418 | pub struct ReferenceType<'a> { |
419 | syntax: SyntaxNode<R>, | 419 | syntax: SyntaxNodeRef<'a>, |
420 | } | 420 | } |
421 | 421 | ||
422 | impl<R: TreeRoot> AstNode<R> for ReferenceType<R> { | 422 | impl<'a> AstNode<'a> for ReferenceType<'a> { |
423 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 423 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
424 | match syntax.kind() { | 424 | match syntax.kind() { |
425 | REFERENCE_TYPE => Some(ReferenceType { syntax }), | 425 | REFERENCE_TYPE => Some(ReferenceType { syntax }), |
426 | _ => None, | 426 | _ => None, |
427 | } | 427 | } |
428 | } | 428 | } |
429 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 429 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
430 | } | 430 | } |
431 | 431 | ||
432 | impl<R: TreeRoot> ReferenceType<R> {} | 432 | impl<'a> ReferenceType<'a> {} |
433 | 433 | ||
434 | // SliceType | 434 | // SliceType |
435 | #[derive(Debug, Clone, Copy)] | 435 | #[derive(Debug, Clone, Copy)] |
436 | pub struct SliceType<R: TreeRoot = OwnedRoot> { | 436 | pub struct SliceType<'a> { |
437 | syntax: SyntaxNode<R>, | 437 | syntax: SyntaxNodeRef<'a>, |
438 | } | 438 | } |
439 | 439 | ||
440 | impl<R: TreeRoot> AstNode<R> for SliceType<R> { | 440 | impl<'a> AstNode<'a> for SliceType<'a> { |
441 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 441 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
442 | match syntax.kind() { | 442 | match syntax.kind() { |
443 | SLICE_TYPE => Some(SliceType { syntax }), | 443 | SLICE_TYPE => Some(SliceType { syntax }), |
444 | _ => None, | 444 | _ => None, |
445 | } | 445 | } |
446 | } | 446 | } |
447 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 447 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
448 | } | 448 | } |
449 | 449 | ||
450 | impl<R: TreeRoot> SliceType<R> {} | 450 | impl<'a> SliceType<'a> {} |
451 | 451 | ||
452 | // StaticDef | 452 | // StaticDef |
453 | #[derive(Debug, Clone, Copy)] | 453 | #[derive(Debug, Clone, Copy)] |
454 | pub struct StaticDef<R: TreeRoot = OwnedRoot> { | 454 | pub struct StaticDef<'a> { |
455 | syntax: SyntaxNode<R>, | 455 | syntax: SyntaxNodeRef<'a>, |
456 | } | 456 | } |
457 | 457 | ||
458 | impl<R: TreeRoot> AstNode<R> for StaticDef<R> { | 458 | impl<'a> AstNode<'a> for StaticDef<'a> { |
459 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 459 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
460 | match syntax.kind() { | 460 | match syntax.kind() { |
461 | STATIC_DEF => Some(StaticDef { syntax }), | 461 | STATIC_DEF => Some(StaticDef { syntax }), |
462 | _ => None, | 462 | _ => None, |
463 | } | 463 | } |
464 | } | 464 | } |
465 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 465 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
466 | } | 466 | } |
467 | 467 | ||
468 | impl<R: TreeRoot> ast::NameOwner<R> for StaticDef<R> {} | 468 | impl<'a> ast::NameOwner<'a> for StaticDef<'a> {} |
469 | impl<R: TreeRoot> ast::AttrsOwner<R> for StaticDef<R> {} | 469 | impl<'a> ast::AttrsOwner<'a> for StaticDef<'a> {} |
470 | impl<R: TreeRoot> StaticDef<R> {} | 470 | impl<'a> StaticDef<'a> {} |
471 | 471 | ||
472 | // StructDef | 472 | // StructDef |
473 | #[derive(Debug, Clone, Copy)] | 473 | #[derive(Debug, Clone, Copy)] |
474 | pub struct StructDef<R: TreeRoot = OwnedRoot> { | 474 | pub struct StructDef<'a> { |
475 | syntax: SyntaxNode<R>, | 475 | syntax: SyntaxNodeRef<'a>, |
476 | } | 476 | } |
477 | 477 | ||
478 | impl<R: TreeRoot> AstNode<R> for StructDef<R> { | 478 | impl<'a> AstNode<'a> for StructDef<'a> { |
479 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 479 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
480 | match syntax.kind() { | 480 | match syntax.kind() { |
481 | STRUCT_DEF => Some(StructDef { syntax }), | 481 | STRUCT_DEF => Some(StructDef { syntax }), |
482 | _ => None, | 482 | _ => None, |
483 | } | 483 | } |
484 | } | 484 | } |
485 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 485 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
486 | } | 486 | } |
487 | 487 | ||
488 | impl<R: TreeRoot> ast::NameOwner<R> for StructDef<R> {} | 488 | impl<'a> ast::NameOwner<'a> for StructDef<'a> {} |
489 | impl<R: TreeRoot> ast::AttrsOwner<R> for StructDef<R> {} | 489 | impl<'a> ast::AttrsOwner<'a> for StructDef<'a> {} |
490 | impl<R: TreeRoot> StructDef<R> { | 490 | impl<'a> StructDef<'a> { |
491 | pub fn fields<'a>(&'a self) -> impl Iterator<Item = NamedField<R>> + 'a { | 491 | pub fn fields(self) -> impl Iterator<Item = NamedField<'a>> + 'a { |
492 | self.syntax() | 492 | self.syntax() |
493 | .children() | 493 | .children() |
494 | .filter_map(NamedField::cast) | 494 | .filter_map(NamedField::cast) |
@@ -497,100 +497,100 @@ impl<R: TreeRoot> StructDef<R> { | |||
497 | 497 | ||
498 | // TokenTree | 498 | // TokenTree |
499 | #[derive(Debug, Clone, Copy)] | 499 | #[derive(Debug, Clone, Copy)] |
500 | pub struct TokenTree<R: TreeRoot = OwnedRoot> { | 500 | pub struct TokenTree<'a> { |
501 | syntax: SyntaxNode<R>, | 501 | syntax: SyntaxNodeRef<'a>, |
502 | } | 502 | } |
503 | 503 | ||
504 | impl<R: TreeRoot> AstNode<R> for TokenTree<R> { | 504 | impl<'a> AstNode<'a> for TokenTree<'a> { |
505 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 505 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
506 | match syntax.kind() { | 506 | match syntax.kind() { |
507 | TOKEN_TREE => Some(TokenTree { syntax }), | 507 | TOKEN_TREE => Some(TokenTree { syntax }), |
508 | _ => None, | 508 | _ => None, |
509 | } | 509 | } |
510 | } | 510 | } |
511 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 511 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
512 | } | 512 | } |
513 | 513 | ||
514 | impl<R: TreeRoot> TokenTree<R> {} | 514 | impl<'a> TokenTree<'a> {} |
515 | 515 | ||
516 | // TraitDef | 516 | // TraitDef |
517 | #[derive(Debug, Clone, Copy)] | 517 | #[derive(Debug, Clone, Copy)] |
518 | pub struct TraitDef<R: TreeRoot = OwnedRoot> { | 518 | pub struct TraitDef<'a> { |
519 | syntax: SyntaxNode<R>, | 519 | syntax: SyntaxNodeRef<'a>, |
520 | } | 520 | } |
521 | 521 | ||
522 | impl<R: TreeRoot> AstNode<R> for TraitDef<R> { | 522 | impl<'a> AstNode<'a> for TraitDef<'a> { |
523 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 523 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
524 | match syntax.kind() { | 524 | match syntax.kind() { |
525 | TRAIT_DEF => Some(TraitDef { syntax }), | 525 | TRAIT_DEF => Some(TraitDef { syntax }), |
526 | _ => None, | 526 | _ => None, |
527 | } | 527 | } |
528 | } | 528 | } |
529 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 529 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
530 | } | 530 | } |
531 | 531 | ||
532 | impl<R: TreeRoot> ast::NameOwner<R> for TraitDef<R> {} | 532 | impl<'a> ast::NameOwner<'a> for TraitDef<'a> {} |
533 | impl<R: TreeRoot> ast::AttrsOwner<R> for TraitDef<R> {} | 533 | impl<'a> ast::AttrsOwner<'a> for TraitDef<'a> {} |
534 | impl<R: TreeRoot> TraitDef<R> {} | 534 | impl<'a> TraitDef<'a> {} |
535 | 535 | ||
536 | // TupleType | 536 | // TupleType |
537 | #[derive(Debug, Clone, Copy)] | 537 | #[derive(Debug, Clone, Copy)] |
538 | pub struct TupleType<R: TreeRoot = OwnedRoot> { | 538 | pub struct TupleType<'a> { |
539 | syntax: SyntaxNode<R>, | 539 | syntax: SyntaxNodeRef<'a>, |
540 | } | 540 | } |
541 | 541 | ||
542 | impl<R: TreeRoot> AstNode<R> for TupleType<R> { | 542 | impl<'a> AstNode<'a> for TupleType<'a> { |
543 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 543 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
544 | match syntax.kind() { | 544 | match syntax.kind() { |
545 | TUPLE_TYPE => Some(TupleType { syntax }), | 545 | TUPLE_TYPE => Some(TupleType { syntax }), |
546 | _ => None, | 546 | _ => None, |
547 | } | 547 | } |
548 | } | 548 | } |
549 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 549 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
550 | } | 550 | } |
551 | 551 | ||
552 | impl<R: TreeRoot> TupleType<R> {} | 552 | impl<'a> TupleType<'a> {} |
553 | 553 | ||
554 | // TypeDef | 554 | // TypeDef |
555 | #[derive(Debug, Clone, Copy)] | 555 | #[derive(Debug, Clone, Copy)] |
556 | pub struct TypeDef<R: TreeRoot = OwnedRoot> { | 556 | pub struct TypeDef<'a> { |
557 | syntax: SyntaxNode<R>, | 557 | syntax: SyntaxNodeRef<'a>, |
558 | } | 558 | } |
559 | 559 | ||
560 | impl<R: TreeRoot> AstNode<R> for TypeDef<R> { | 560 | impl<'a> AstNode<'a> for TypeDef<'a> { |
561 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 561 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
562 | match syntax.kind() { | 562 | match syntax.kind() { |
563 | TYPE_DEF => Some(TypeDef { syntax }), | 563 | TYPE_DEF => Some(TypeDef { syntax }), |
564 | _ => None, | 564 | _ => None, |
565 | } | 565 | } |
566 | } | 566 | } |
567 | fn syntax(&self) -> &SyntaxNode<R> { &self.syntax } | 567 | fn syntax(self) -> SyntaxNodeRef<'a> { self.syntax } |
568 | } | 568 | } |
569 | 569 | ||
570 | impl<R: TreeRoot> ast::NameOwner<R> for TypeDef<R> {} | 570 | impl<'a> ast::NameOwner<'a> for TypeDef<'a> {} |
571 | impl<R: TreeRoot> ast::AttrsOwner<R> for TypeDef<R> {} | 571 | impl<'a> ast::AttrsOwner<'a> for TypeDef<'a> {} |
572 | impl<R: TreeRoot> TypeDef<R> {} | 572 | impl<'a> TypeDef<'a> {} |
573 | 573 | ||
574 | // TypeRef | 574 | // TypeRef |
575 | #[derive(Debug, Clone, Copy)] | 575 | #[derive(Debug, Clone, Copy)] |
576 | pub enum TypeRef<R: TreeRoot = OwnedRoot> { | 576 | pub enum TypeRef<'a> { |
577 | ParenType(ParenType<R>), | 577 | ParenType(ParenType<'a>), |
578 | TupleType(TupleType<R>), | 578 | TupleType(TupleType<'a>), |
579 | NeverType(NeverType<R>), | 579 | NeverType(NeverType<'a>), |
580 | PathType(PathType<R>), | 580 | PathType(PathType<'a>), |
581 | PointerType(PointerType<R>), | 581 | PointerType(PointerType<'a>), |
582 | ArrayType(ArrayType<R>), | 582 | ArrayType(ArrayType<'a>), |
583 | SliceType(SliceType<R>), | 583 | SliceType(SliceType<'a>), |
584 | ReferenceType(ReferenceType<R>), | 584 | ReferenceType(ReferenceType<'a>), |
585 | PlaceholderType(PlaceholderType<R>), | 585 | PlaceholderType(PlaceholderType<'a>), |
586 | FnPointerType(FnPointerType<R>), | 586 | FnPointerType(FnPointerType<'a>), |
587 | ForType(ForType<R>), | 587 | ForType(ForType<'a>), |
588 | ImplTraitType(ImplTraitType<R>), | 588 | ImplTraitType(ImplTraitType<'a>), |
589 | DynTraitType(DynTraitType<R>), | 589 | DynTraitType(DynTraitType<'a>), |
590 | } | 590 | } |
591 | 591 | ||
592 | impl<R: TreeRoot> AstNode<R> for TypeRef<R> { | 592 | impl<'a> AstNode<'a> for TypeRef<'a> { |
593 | fn cast(syntax: SyntaxNode<R>) -> Option<Self> { | 593 | fn cast(syntax: SyntaxNodeRef<'a>) -> Option<Self> { |
594 | match syntax.kind() { | 594 | match syntax.kind() { |
595 | PAREN_TYPE => Some(TypeRef::ParenType(ParenType { syntax })), | 595 | PAREN_TYPE => Some(TypeRef::ParenType(ParenType { syntax })), |
596 | TUPLE_TYPE => Some(TypeRef::TupleType(TupleType { syntax })), | 596 | TUPLE_TYPE => Some(TypeRef::TupleType(TupleType { syntax })), |
@@ -608,7 +608,7 @@ impl<R: TreeRoot> AstNode<R> for TypeRef<R> { | |||
608 | _ => None, | 608 | _ => None, |
609 | } | 609 | } |
610 | } | 610 | } |
611 | fn syntax(&self) -> &SyntaxNode<R> { | 611 | fn syntax(self) -> SyntaxNodeRef<'a> { |
612 | match self { | 612 | match self { |
613 | TypeRef::ParenType(inner) => inner.syntax(), | 613 | TypeRef::ParenType(inner) => inner.syntax(), |
614 | TypeRef::TupleType(inner) => inner.syntax(), | 614 | TypeRef::TupleType(inner) => inner.syntax(), |
@@ -627,5 +627,5 @@ impl<R: TreeRoot> AstNode<R> for TypeRef<R> { | |||
627 | } | 627 | } |
628 | } | 628 | } |
629 | 629 | ||
630 | impl<R: TreeRoot> TypeRef<R> {} | 630 | impl<'a> TypeRef<'a> {} |
631 | 631 | ||