File tree Expand file tree Collapse file tree 3 files changed +55
-89
lines changed Expand file tree Collapse file tree 3 files changed +55
-89
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ impl AstIdMap {
137
137
}
138
138
139
139
pub fn get < N : AstNode > ( & self , id : FileAstId < N > ) -> AstPtr < N > {
140
- self . arena [ id. raw ] . clone ( ) . cast :: < N > ( ) . unwrap ( )
140
+ AstPtr :: try_from_raw ( self . arena [ id. raw ] . clone ( ) ) . unwrap ( )
141
141
}
142
142
143
143
fn alloc ( & mut self , item : & SyntaxNode ) -> ErasedFileAstId {
Original file line number Diff line number Diff line change 21
21
),
22
22
),
23
23
ptr: SyntaxNodePtr {
24
- range: 0..22,
25
24
kind: STRUCT,
25
+ range: 0..22,
26
26
},
27
27
name_ptr: SyntaxNodePtr {
28
- range: 6..21,
29
28
kind: NAME,
29
+ range: 6..21,
30
30
},
31
31
},
32
32
kind: Struct,
43
43
),
44
44
),
45
45
ptr: SyntaxNodePtr {
46
- range: 170..184,
47
46
kind: STRUCT,
47
+ range: 170..184,
48
48
},
49
49
name_ptr: SyntaxNodePtr {
50
- range: 177..183,
51
50
kind: NAME,
51
+ range: 177..183,
52
52
},
53
53
},
54
54
kind: Struct,
65
65
),
66
66
),
67
67
ptr: SyntaxNodePtr {
68
- range: 185..207,
69
68
kind: ENUM,
69
+ range: 185..207,
70
70
},
71
71
name_ptr: SyntaxNodePtr {
72
- range: 190..194,
73
72
kind: NAME,
73
+ range: 190..194,
74
74
},
75
75
},
76
76
kind: Enum,
87
87
),
88
88
),
89
89
ptr: SyntaxNodePtr {
90
- range: 208..222,
91
90
kind: UNION,
91
+ range: 208..222,
92
92
},
93
93
name_ptr: SyntaxNodePtr {
94
- range: 214..219,
95
94
kind: NAME,
95
+ range: 214..219,
96
96
},
97
97
},
98
98
kind: Union,
109
109
),
110
110
),
111
111
ptr: SyntaxNodePtr {
112
- range: 261..300,
113
112
kind: TRAIT,
113
+ range: 261..300,
114
114
},
115
115
name_ptr: SyntaxNodePtr {
116
- range: 267..272,
117
116
kind: NAME,
117
+ range: 267..272,
118
118
},
119
119
},
120
120
kind: Trait,
131
131
),
132
132
),
133
133
ptr: SyntaxNodePtr {
134
- range: 279..298,
135
134
kind: FN,
135
+ range: 279..298,
136
136
},
137
137
name_ptr: SyntaxNodePtr {
138
- range: 282..290,
139
138
kind: NAME,
139
+ range: 282..290,
140
140
},
141
141
},
142
142
kind: Function,
155
155
),
156
156
),
157
157
ptr: SyntaxNodePtr {
158
- range: 302..338,
159
158
kind: FN,
159
+ range: 302..338,
160
160
},
161
161
name_ptr: SyntaxNodePtr {
162
- range: 305..309,
163
162
kind: NAME,
163
+ range: 305..309,
164
164
},
165
165
},
166
166
kind: Function,
177
177
),
178
178
),
179
179
ptr: SyntaxNodePtr {
180
- range: 340..361,
181
180
kind: CONST,
181
+ range: 340..361,
182
182
},
183
183
name_ptr: SyntaxNodePtr {
184
- range: 346..351,
185
184
kind: NAME,
185
+ range: 346..351,
186
186
},
187
187
},
188
188
kind: Const,
199
199
),
200
200
),
201
201
ptr: SyntaxNodePtr {
202
- range: 362..396,
203
202
kind: STATIC,
203
+ range: 362..396,
204
204
},
205
205
name_ptr: SyntaxNodePtr {
206
- range: 369..375,
207
206
kind: NAME,
207
+ range: 369..375,
208
208
},
209
209
},
210
210
kind: Static,
221
221
),
222
222
),
223
223
ptr: SyntaxNodePtr {
224
- range: 397..417,
225
224
kind: TYPE_ALIAS,
225
+ range: 397..417,
226
226
},
227
227
name_ptr: SyntaxNodePtr {
228
- range: 402..407,
229
228
kind: NAME,
229
+ range: 402..407,
230
230
},
231
231
},
232
232
kind: TypeAlias,
243
243
),
244
244
),
245
245
ptr: SyntaxNodePtr {
246
- range: 419..457,
247
246
kind: MODULE,
247
+ range: 419..457,
248
248
},
249
249
name_ptr: SyntaxNodePtr {
250
- range: 423..428,
251
250
kind: NAME,
251
+ range: 423..428,
252
252
},
253
253
},
254
254
kind: Module,
265
265
),
266
266
),
267
267
ptr: SyntaxNodePtr {
268
- range: 520..592,
269
268
kind: CONST,
269
+ range: 520..592,
270
270
},
271
271
name_ptr: SyntaxNodePtr {
272
- range: 526..542,
273
272
kind: NAME,
273
+ range: 526..542,
274
274
},
275
275
},
276
276
kind: Const,
287
287
),
288
288
),
289
289
ptr: SyntaxNodePtr {
290
- range: 594..604,
291
290
kind: MODULE,
291
+ range: 594..604,
292
292
},
293
293
name_ptr: SyntaxNodePtr {
294
- range: 598..603,
295
294
kind: NAME,
295
+ range: 598..603,
296
296
},
297
297
},
298
298
kind: Module,
309
309
),
310
310
),
311
311
ptr: SyntaxNodePtr {
312
- range: 242..257,
313
312
kind: FN,
313
+ range: 242..257,
314
314
},
315
315
name_ptr: SyntaxNodePtr {
316
- range: 245..252,
317
316
kind: NAME,
317
+ range: 245..252,
318
318
},
319
319
},
320
320
kind: Function,
331
331
),
332
332
),
333
333
ptr: SyntaxNodePtr {
334
- range: 1..48,
335
334
kind: MACRO_RULES,
335
+ range: 1..48,
336
336
},
337
337
name_ptr: SyntaxNodePtr {
338
- range: 14..31,
339
338
kind: NAME,
339
+ range: 14..31,
340
340
},
341
341
},
342
342
kind: Macro,
353
353
),
354
354
),
355
355
ptr: SyntaxNodePtr {
356
- range: 51..131,
357
356
kind: MACRO_RULES,
357
+ range: 51..131,
358
358
},
359
359
name_ptr: SyntaxNodePtr {
360
- range: 64..77,
361
360
kind: NAME,
361
+ range: 64..77,
362
362
},
363
363
},
364
364
kind: Macro,
375
375
),
376
376
),
377
377
ptr: SyntaxNodePtr {
378
- range: 153..168,
379
378
kind: MACRO_DEF,
379
+ range: 153..168,
380
380
},
381
381
name_ptr: SyntaxNodePtr {
382
- range: 159..164,
383
382
kind: NAME,
383
+ range: 159..164,
384
384
},
385
385
},
386
386
kind: Macro,
397
397
),
398
398
),
399
399
ptr: SyntaxNodePtr {
400
- range: 479..507,
401
400
kind: STRUCT,
401
+ range: 479..507,
402
402
},
403
403
name_ptr: SyntaxNodePtr {
404
- range: 486..506,
405
404
kind: NAME,
405
+ range: 486..506,
406
406
},
407
407
},
408
408
kind: Struct,
419
419
),
420
420
),
421
421
ptr: SyntaxNodePtr {
422
- range: 555..581,
423
422
kind: STRUCT,
423
+ range: 555..581,
424
424
},
425
425
name_ptr: SyntaxNodePtr {
426
- range: 562..580,
427
426
kind: NAME,
427
+ range: 562..580,
428
428
},
429
429
},
430
430
kind: Struct,
443
443
),
444
444
),
445
445
ptr: SyntaxNodePtr {
446
- range: 318..336,
447
446
kind: STRUCT,
447
+ range: 318..336,
448
448
},
449
449
name_ptr: SyntaxNodePtr {
450
- range: 325..335,
451
450
kind: NAME,
451
+ range: 325..335,
452
452
},
453
453
},
454
454
kind: Struct,
478
478
),
479
479
),
480
480
ptr: SyntaxNodePtr {
481
- range: 435..455,
482
481
kind: STRUCT,
482
+ range: 435..455,
483
483
},
484
484
name_ptr: SyntaxNodePtr {
485
- range: 442..454,
486
485
kind: NAME,
486
+ range: 442..454,
487
487
},
488
488
},
489
489
kind: Struct,
511
511
),
512
512
),
513
513
ptr: SyntaxNodePtr {
514
- range: 0..20,
515
514
kind: STRUCT,
515
+ range: 0..20,
516
516
},
517
517
name_ptr: SyntaxNodePtr {
518
- range: 7..19,
519
518
kind: NAME,
519
+ range: 7..19,
520
520
},
521
521
},
522
522
kind: Struct,
You can’t perform that action at this time.
0 commit comments