Skip to content

Commit e279d52

Browse files
bors[bot]azdavis
andauthored
Merge #10692
10692: Migrate to new rowan r=lnicola a=azdavis Since rust-analyzer/rowan#122 was merged into rowan, this could be how rust-analyzer migrates. Co-authored-by: Ariel Davis <[email protected]>
2 parents 355a4bd + d4262f4 commit e279d52

File tree

3 files changed

+55
-89
lines changed

3 files changed

+55
-89
lines changed

crates/hir_expand/src/ast_id_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl AstIdMap {
137137
}
138138

139139
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()
141141
}
142142

143143
fn alloc(&mut self, item: &SyntaxNode) -> ErasedFileAstId {

crates/ide_db/src/test_data/test_symbol_index_collection.txt

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
),
2222
),
2323
ptr: SyntaxNodePtr {
24-
range: 0..22,
2524
kind: STRUCT,
25+
range: 0..22,
2626
},
2727
name_ptr: SyntaxNodePtr {
28-
range: 6..21,
2928
kind: NAME,
29+
range: 6..21,
3030
},
3131
},
3232
kind: Struct,
@@ -43,12 +43,12 @@
4343
),
4444
),
4545
ptr: SyntaxNodePtr {
46-
range: 170..184,
4746
kind: STRUCT,
47+
range: 170..184,
4848
},
4949
name_ptr: SyntaxNodePtr {
50-
range: 177..183,
5150
kind: NAME,
51+
range: 177..183,
5252
},
5353
},
5454
kind: Struct,
@@ -65,12 +65,12 @@
6565
),
6666
),
6767
ptr: SyntaxNodePtr {
68-
range: 185..207,
6968
kind: ENUM,
69+
range: 185..207,
7070
},
7171
name_ptr: SyntaxNodePtr {
72-
range: 190..194,
7372
kind: NAME,
73+
range: 190..194,
7474
},
7575
},
7676
kind: Enum,
@@ -87,12 +87,12 @@
8787
),
8888
),
8989
ptr: SyntaxNodePtr {
90-
range: 208..222,
9190
kind: UNION,
91+
range: 208..222,
9292
},
9393
name_ptr: SyntaxNodePtr {
94-
range: 214..219,
9594
kind: NAME,
95+
range: 214..219,
9696
},
9797
},
9898
kind: Union,
@@ -109,12 +109,12 @@
109109
),
110110
),
111111
ptr: SyntaxNodePtr {
112-
range: 261..300,
113112
kind: TRAIT,
113+
range: 261..300,
114114
},
115115
name_ptr: SyntaxNodePtr {
116-
range: 267..272,
117116
kind: NAME,
117+
range: 267..272,
118118
},
119119
},
120120
kind: Trait,
@@ -131,12 +131,12 @@
131131
),
132132
),
133133
ptr: SyntaxNodePtr {
134-
range: 279..298,
135134
kind: FN,
135+
range: 279..298,
136136
},
137137
name_ptr: SyntaxNodePtr {
138-
range: 282..290,
139138
kind: NAME,
139+
range: 282..290,
140140
},
141141
},
142142
kind: Function,
@@ -155,12 +155,12 @@
155155
),
156156
),
157157
ptr: SyntaxNodePtr {
158-
range: 302..338,
159158
kind: FN,
159+
range: 302..338,
160160
},
161161
name_ptr: SyntaxNodePtr {
162-
range: 305..309,
163162
kind: NAME,
163+
range: 305..309,
164164
},
165165
},
166166
kind: Function,
@@ -177,12 +177,12 @@
177177
),
178178
),
179179
ptr: SyntaxNodePtr {
180-
range: 340..361,
181180
kind: CONST,
181+
range: 340..361,
182182
},
183183
name_ptr: SyntaxNodePtr {
184-
range: 346..351,
185184
kind: NAME,
185+
range: 346..351,
186186
},
187187
},
188188
kind: Const,
@@ -199,12 +199,12 @@
199199
),
200200
),
201201
ptr: SyntaxNodePtr {
202-
range: 362..396,
203202
kind: STATIC,
203+
range: 362..396,
204204
},
205205
name_ptr: SyntaxNodePtr {
206-
range: 369..375,
207206
kind: NAME,
207+
range: 369..375,
208208
},
209209
},
210210
kind: Static,
@@ -221,12 +221,12 @@
221221
),
222222
),
223223
ptr: SyntaxNodePtr {
224-
range: 397..417,
225224
kind: TYPE_ALIAS,
225+
range: 397..417,
226226
},
227227
name_ptr: SyntaxNodePtr {
228-
range: 402..407,
229228
kind: NAME,
229+
range: 402..407,
230230
},
231231
},
232232
kind: TypeAlias,
@@ -243,12 +243,12 @@
243243
),
244244
),
245245
ptr: SyntaxNodePtr {
246-
range: 419..457,
247246
kind: MODULE,
247+
range: 419..457,
248248
},
249249
name_ptr: SyntaxNodePtr {
250-
range: 423..428,
251250
kind: NAME,
251+
range: 423..428,
252252
},
253253
},
254254
kind: Module,
@@ -265,12 +265,12 @@
265265
),
266266
),
267267
ptr: SyntaxNodePtr {
268-
range: 520..592,
269268
kind: CONST,
269+
range: 520..592,
270270
},
271271
name_ptr: SyntaxNodePtr {
272-
range: 526..542,
273272
kind: NAME,
273+
range: 526..542,
274274
},
275275
},
276276
kind: Const,
@@ -287,12 +287,12 @@
287287
),
288288
),
289289
ptr: SyntaxNodePtr {
290-
range: 594..604,
291290
kind: MODULE,
291+
range: 594..604,
292292
},
293293
name_ptr: SyntaxNodePtr {
294-
range: 598..603,
295294
kind: NAME,
295+
range: 598..603,
296296
},
297297
},
298298
kind: Module,
@@ -309,12 +309,12 @@
309309
),
310310
),
311311
ptr: SyntaxNodePtr {
312-
range: 242..257,
313312
kind: FN,
313+
range: 242..257,
314314
},
315315
name_ptr: SyntaxNodePtr {
316-
range: 245..252,
317316
kind: NAME,
317+
range: 245..252,
318318
},
319319
},
320320
kind: Function,
@@ -331,12 +331,12 @@
331331
),
332332
),
333333
ptr: SyntaxNodePtr {
334-
range: 1..48,
335334
kind: MACRO_RULES,
335+
range: 1..48,
336336
},
337337
name_ptr: SyntaxNodePtr {
338-
range: 14..31,
339338
kind: NAME,
339+
range: 14..31,
340340
},
341341
},
342342
kind: Macro,
@@ -353,12 +353,12 @@
353353
),
354354
),
355355
ptr: SyntaxNodePtr {
356-
range: 51..131,
357356
kind: MACRO_RULES,
357+
range: 51..131,
358358
},
359359
name_ptr: SyntaxNodePtr {
360-
range: 64..77,
361360
kind: NAME,
361+
range: 64..77,
362362
},
363363
},
364364
kind: Macro,
@@ -375,12 +375,12 @@
375375
),
376376
),
377377
ptr: SyntaxNodePtr {
378-
range: 153..168,
379378
kind: MACRO_DEF,
379+
range: 153..168,
380380
},
381381
name_ptr: SyntaxNodePtr {
382-
range: 159..164,
383382
kind: NAME,
383+
range: 159..164,
384384
},
385385
},
386386
kind: Macro,
@@ -397,12 +397,12 @@
397397
),
398398
),
399399
ptr: SyntaxNodePtr {
400-
range: 479..507,
401400
kind: STRUCT,
401+
range: 479..507,
402402
},
403403
name_ptr: SyntaxNodePtr {
404-
range: 486..506,
405404
kind: NAME,
405+
range: 486..506,
406406
},
407407
},
408408
kind: Struct,
@@ -419,12 +419,12 @@
419419
),
420420
),
421421
ptr: SyntaxNodePtr {
422-
range: 555..581,
423422
kind: STRUCT,
423+
range: 555..581,
424424
},
425425
name_ptr: SyntaxNodePtr {
426-
range: 562..580,
427426
kind: NAME,
427+
range: 562..580,
428428
},
429429
},
430430
kind: Struct,
@@ -443,12 +443,12 @@
443443
),
444444
),
445445
ptr: SyntaxNodePtr {
446-
range: 318..336,
447446
kind: STRUCT,
447+
range: 318..336,
448448
},
449449
name_ptr: SyntaxNodePtr {
450-
range: 325..335,
451450
kind: NAME,
451+
range: 325..335,
452452
},
453453
},
454454
kind: Struct,
@@ -478,12 +478,12 @@
478478
),
479479
),
480480
ptr: SyntaxNodePtr {
481-
range: 435..455,
482481
kind: STRUCT,
482+
range: 435..455,
483483
},
484484
name_ptr: SyntaxNodePtr {
485-
range: 442..454,
486485
kind: NAME,
486+
range: 442..454,
487487
},
488488
},
489489
kind: Struct,
@@ -511,12 +511,12 @@
511511
),
512512
),
513513
ptr: SyntaxNodePtr {
514-
range: 0..20,
515514
kind: STRUCT,
515+
range: 0..20,
516516
},
517517
name_ptr: SyntaxNodePtr {
518-
range: 7..19,
519518
kind: NAME,
519+
range: 7..19,
520520
},
521521
},
522522
kind: Struct,

0 commit comments

Comments
 (0)