@@ -20,10 +20,11 @@ use triomphe::Arc;
2020use crate :: {
2121 db:: DefDatabase ,
2222 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 ,
2728 } ,
2829} ;
2930
@@ -168,7 +169,7 @@ impl<'a> Ctx<'a> {
168169 let ast_id = self . source_ast_id_map . ast_id ( strukt) ;
169170 let shape = adt_shape ( strukt. kind ( ) ) ;
170171 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) ) ;
172173
173174 Some ( ast_id)
174175 }
@@ -178,7 +179,7 @@ impl<'a> Ctx<'a> {
178179 let name = union. name ( ) ?. as_name ( ) ;
179180 let ast_id = self . source_ast_id_map . ast_id ( union) ;
180181 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) ) ;
182183 Some ( ast_id)
183184 }
184185
@@ -187,7 +188,7 @@ impl<'a> Ctx<'a> {
187188 let name = enum_. name ( ) ?. as_name ( ) ;
188189 let ast_id = self . source_ast_id_map . ast_id ( enum_) ;
189190 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) ) ;
191192 Some ( ast_id)
192193 }
193194
@@ -199,7 +200,7 @@ impl<'a> Ctx<'a> {
199200
200201 let res = Function { name, visibility, ast_id } ;
201202
202- self . tree . data . insert ( ast_id. upcast ( ) , ModItem :: Function ( res) ) ;
203+ self . tree . small_data . insert ( ast_id. upcast ( ) , SmallModItem :: Function ( res) ) ;
203204 Some ( ast_id)
204205 }
205206
@@ -211,7 +212,7 @@ impl<'a> Ctx<'a> {
211212 let visibility = self . lower_visibility ( type_alias) ;
212213 let ast_id = self . source_ast_id_map . ast_id ( type_alias) ;
213214 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) ) ;
215216 Some ( ast_id)
216217 }
217218
@@ -220,7 +221,7 @@ impl<'a> Ctx<'a> {
220221 let visibility = self . lower_visibility ( static_) ;
221222 let ast_id = self . source_ast_id_map . ast_id ( static_) ;
222223 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) ) ;
224225 Some ( ast_id)
225226 }
226227
@@ -229,7 +230,7 @@ impl<'a> Ctx<'a> {
229230 let visibility = self . lower_visibility ( konst) ;
230231 let ast_id = self . source_ast_id_map . ast_id ( konst) ;
231232 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) ) ;
233234 ast_id
234235 }
235236
@@ -251,7 +252,7 @@ impl<'a> Ctx<'a> {
251252 } ;
252253 let ast_id = self . source_ast_id_map . ast_id ( module) ;
253254 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) ) ;
255256 Some ( ast_id)
256257 }
257258
@@ -261,7 +262,7 @@ impl<'a> Ctx<'a> {
261262 let ast_id = self . source_ast_id_map . ast_id ( trait_def) ;
262263
263264 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) ) ;
265266 Some ( ast_id)
266267 }
267268
@@ -274,7 +275,7 @@ impl<'a> Ctx<'a> {
274275 let ast_id = self . source_ast_id_map . ast_id ( trait_alias_def) ;
275276
276277 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) ) ;
278279 Some ( ast_id)
279280 }
280281
@@ -283,7 +284,7 @@ impl<'a> Ctx<'a> {
283284 // Note that trait impls don't get implicit `Self` unlike traits, because here they are a
284285 // type alias rather than a type parameter, so this is handled by the resolver.
285286 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) ) ;
287288 ast_id
288289 }
289290
@@ -295,7 +296,7 @@ impl<'a> Ctx<'a> {
295296 } ) ?;
296297
297298 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) ) ;
299300 Some ( ast_id)
300301 }
301302
@@ -311,7 +312,7 @@ impl<'a> Ctx<'a> {
311312 let ast_id = self . source_ast_id_map . ast_id ( extern_crate) ;
312313
313314 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) ) ;
315316 Some ( ast_id)
316317 }
317318
@@ -325,7 +326,7 @@ impl<'a> Ctx<'a> {
325326 let ast_id = self . source_ast_id_map . ast_id ( m) ;
326327 let expand_to = hir_expand:: ExpandTo :: from_call_site ( m) ;
327328 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) ) ;
329330 Some ( ast_id)
330331 }
331332
@@ -334,7 +335,7 @@ impl<'a> Ctx<'a> {
334335 let ast_id = self . source_ast_id_map . ast_id ( m) ;
335336
336337 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) ) ;
338339 Some ( ast_id)
339340 }
340341
@@ -345,7 +346,7 @@ impl<'a> Ctx<'a> {
345346 let visibility = self . lower_visibility ( m) ;
346347
347348 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) ) ;
349350 Some ( ast_id)
350351 }
351352
@@ -372,7 +373,7 @@ impl<'a> Ctx<'a> {
372373 } ) ;
373374
374375 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) ) ;
376377 ast_id
377378 }
378379
0 commit comments