@@ -20,10 +20,11 @@ use triomphe::Arc;
20
20
use crate :: {
21
21
db:: DefDatabase ,
22
22
item_tree:: {
23
- Const , Enum , ExternBlock , ExternCrate , FieldsShape , Function , Impl , ImportAlias , Interned ,
24
- ItemTree , ItemTreeAstId , Macro2 , MacroCall , MacroRules , Mod , ModItem , ModItemId , ModKind ,
25
- ModPath , RawAttrs , RawVisibility , RawVisibilityId , Static , Struct , StructKind , Trait ,
26
- TraitAlias , TypeAlias , Union , Use , UseTree , UseTreeKind , VisibilityExplicitness ,
23
+ BigModItem , Const , Enum , ExternBlock , ExternCrate , FieldsShape , Function , Impl ,
24
+ ImportAlias , Interned , ItemTree , ItemTreeAstId , Macro2 , MacroCall , MacroRules , Mod ,
25
+ ModItemId , ModKind , ModPath , RawAttrs , RawVisibility , RawVisibilityId , SmallModItem ,
26
+ Static , Struct , StructKind , Trait , TraitAlias , TypeAlias , Union , Use , UseTree , UseTreeKind ,
27
+ VisibilityExplicitness ,
27
28
} ,
28
29
} ;
29
30
@@ -168,7 +169,7 @@ impl<'a> Ctx<'a> {
168
169
let ast_id = self . source_ast_id_map . ast_id ( strukt) ;
169
170
let shape = adt_shape ( strukt. kind ( ) ) ;
170
171
let res = Struct { name, visibility, shape, ast_id } ;
171
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Struct ( res) ) ;
172
+ self . tree . big_data . insert ( ast_id. upcast ( ) , BigModItem :: Struct ( res) ) ;
172
173
173
174
Some ( ast_id)
174
175
}
@@ -178,7 +179,7 @@ impl<'a> Ctx<'a> {
178
179
let name = union. name ( ) ?. as_name ( ) ;
179
180
let ast_id = self . source_ast_id_map . ast_id ( union) ;
180
181
let res = Union { name, visibility, ast_id } ;
181
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Union ( res) ) ;
182
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Union ( res) ) ;
182
183
Some ( ast_id)
183
184
}
184
185
@@ -187,7 +188,7 @@ impl<'a> Ctx<'a> {
187
188
let name = enum_. name ( ) ?. as_name ( ) ;
188
189
let ast_id = self . source_ast_id_map . ast_id ( enum_) ;
189
190
let res = Enum { name, visibility, ast_id } ;
190
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Enum ( res) ) ;
191
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Enum ( res) ) ;
191
192
Some ( ast_id)
192
193
}
193
194
@@ -199,7 +200,7 @@ impl<'a> Ctx<'a> {
199
200
200
201
let res = Function { name, visibility, ast_id } ;
201
202
202
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Function ( res) ) ;
203
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Function ( res) ) ;
203
204
Some ( ast_id)
204
205
}
205
206
@@ -211,7 +212,7 @@ impl<'a> Ctx<'a> {
211
212
let visibility = self . lower_visibility ( type_alias) ;
212
213
let ast_id = self . source_ast_id_map . ast_id ( type_alias) ;
213
214
let res = TypeAlias { name, visibility, ast_id } ;
214
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: TypeAlias ( res) ) ;
215
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: TypeAlias ( res) ) ;
215
216
Some ( ast_id)
216
217
}
217
218
@@ -220,7 +221,7 @@ impl<'a> Ctx<'a> {
220
221
let visibility = self . lower_visibility ( static_) ;
221
222
let ast_id = self . source_ast_id_map . ast_id ( static_) ;
222
223
let res = Static { name, visibility, ast_id } ;
223
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Static ( res) ) ;
224
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Static ( res) ) ;
224
225
Some ( ast_id)
225
226
}
226
227
@@ -229,7 +230,7 @@ impl<'a> Ctx<'a> {
229
230
let visibility = self . lower_visibility ( konst) ;
230
231
let ast_id = self . source_ast_id_map . ast_id ( konst) ;
231
232
let res = Const { name, visibility, ast_id } ;
232
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Const ( res) ) ;
233
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Const ( res) ) ;
233
234
ast_id
234
235
}
235
236
@@ -251,7 +252,7 @@ impl<'a> Ctx<'a> {
251
252
} ;
252
253
let ast_id = self . source_ast_id_map . ast_id ( module) ;
253
254
let res = Mod { name, visibility, kind, ast_id } ;
254
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Mod ( res) ) ;
255
+ self . tree . big_data . insert ( ast_id. upcast ( ) , BigModItem :: Mod ( res) ) ;
255
256
Some ( ast_id)
256
257
}
257
258
@@ -261,7 +262,7 @@ impl<'a> Ctx<'a> {
261
262
let ast_id = self . source_ast_id_map . ast_id ( trait_def) ;
262
263
263
264
let def = Trait { name, visibility, ast_id } ;
264
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Trait ( def) ) ;
265
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Trait ( def) ) ;
265
266
Some ( ast_id)
266
267
}
267
268
@@ -274,7 +275,7 @@ impl<'a> Ctx<'a> {
274
275
let ast_id = self . source_ast_id_map . ast_id ( trait_alias_def) ;
275
276
276
277
let alias = TraitAlias { name, visibility, ast_id } ;
277
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: TraitAlias ( alias) ) ;
278
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: TraitAlias ( alias) ) ;
278
279
Some ( ast_id)
279
280
}
280
281
@@ -283,7 +284,7 @@ impl<'a> Ctx<'a> {
283
284
// Note that trait impls don't get implicit `Self` unlike traits, because here they are a
284
285
// type alias rather than a type parameter, so this is handled by the resolver.
285
286
let res = Impl { ast_id } ;
286
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Impl ( res) ) ;
287
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Impl ( res) ) ;
287
288
ast_id
288
289
}
289
290
@@ -295,7 +296,7 @@ impl<'a> Ctx<'a> {
295
296
} ) ?;
296
297
297
298
let res = Use { visibility, ast_id, use_tree } ;
298
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Use ( res) ) ;
299
+ self . tree . big_data . insert ( ast_id. upcast ( ) , BigModItem :: Use ( res) ) ;
299
300
Some ( ast_id)
300
301
}
301
302
@@ -311,7 +312,7 @@ impl<'a> Ctx<'a> {
311
312
let ast_id = self . source_ast_id_map . ast_id ( extern_crate) ;
312
313
313
314
let res = ExternCrate { name, alias, visibility, ast_id } ;
314
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: ExternCrate ( res) ) ;
315
+ self . tree . big_data . insert ( ast_id. upcast ( ) , BigModItem :: ExternCrate ( res) ) ;
315
316
Some ( ast_id)
316
317
}
317
318
@@ -325,7 +326,7 @@ impl<'a> Ctx<'a> {
325
326
let ast_id = self . source_ast_id_map . ast_id ( m) ;
326
327
let expand_to = hir_expand:: ExpandTo :: from_call_site ( m) ;
327
328
let res = MacroCall { path, ast_id, expand_to, ctxt : span_map. span_for_range ( range) . ctx } ;
328
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: MacroCall ( res) ) ;
329
+ self . tree . big_data . insert ( ast_id. upcast ( ) , BigModItem :: MacroCall ( res) ) ;
329
330
Some ( ast_id)
330
331
}
331
332
@@ -334,7 +335,7 @@ impl<'a> Ctx<'a> {
334
335
let ast_id = self . source_ast_id_map . ast_id ( m) ;
335
336
336
337
let res = MacroRules { name : name. as_name ( ) , ast_id } ;
337
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: MacroRules ( res) ) ;
338
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: MacroRules ( res) ) ;
338
339
Some ( ast_id)
339
340
}
340
341
@@ -345,7 +346,7 @@ impl<'a> Ctx<'a> {
345
346
let visibility = self . lower_visibility ( m) ;
346
347
347
348
let res = Macro2 { name : name. as_name ( ) , ast_id, visibility } ;
348
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Macro2 ( res) ) ;
349
+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Macro2 ( res) ) ;
349
350
Some ( ast_id)
350
351
}
351
352
@@ -372,7 +373,7 @@ impl<'a> Ctx<'a> {
372
373
} ) ;
373
374
374
375
let res = ExternBlock { ast_id, children } ;
375
- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: ExternBlock ( res) ) ;
376
+ self . tree . big_data . insert ( ast_id. upcast ( ) , BigModItem :: ExternBlock ( res) ) ;
376
377
ast_id
377
378
}
378
379
0 commit comments