@@ -4106,11 +4106,11 @@ impl<'hir> Item<'hir> {
4106
4106
4107
4107
expect_use, ( & ' hir UsePath <' hir>, UseKind ) , ItemKind :: Use ( p, uk) , ( p, * uk) ;
4108
4108
4109
- expect_static, ( Mutability , Ident , & ' hir Ty <' hir>, BodyId ) ,
4110
- ItemKind :: Static ( mutbl, ident, ty, body) , ( * mutbl, * ident, ty, * body) ;
4109
+ expect_static, ( Mutability , Ident , & ' hir Ty <' hir>, BodyId , DistributedSlice < ' hir> ) ,
4110
+ ItemKind :: Static ( mutbl, ident, ty, body, distributed_slice ) , ( * mutbl, * ident, * ty, * body, * distributed_slice ) ;
4111
4111
4112
- expect_const, ( Ident , & ' hir Generics <' hir>, & ' hir Ty <' hir>, BodyId ) ,
4113
- ItemKind :: Const ( ident, generics, ty, body) , ( * ident, generics, ty, * body) ;
4112
+ expect_const, ( Ident , & ' hir Generics <' hir>, & ' hir Ty <' hir>, BodyId , DistributedSlice < ' hir> ) ,
4113
+ ItemKind :: Const ( ident, generics, ty, body, distributed_slice ) , ( * ident, generics, * ty, * body, * distributed_slice ) ;
4114
4114
4115
4115
expect_fn, ( Ident , & FnSig <' hir>, & ' hir Generics <' hir>, BodyId ) ,
4116
4116
ItemKind :: Fn { ident, sig, generics, body, .. } , ( * ident, sig, generics, * body) ;
@@ -4263,6 +4263,14 @@ impl FnHeader {
4263
4263
}
4264
4264
}
4265
4265
4266
+ #[ derive( Debug , Clone , Copy , HashStable_Generic , Default ) ]
4267
+ pub enum DistributedSlice < ' hir > {
4268
+ #[ default]
4269
+ None ,
4270
+ Declaration ( Span ) ,
4271
+ Addition ( QPath < ' hir > ) ,
4272
+ }
4273
+
4266
4274
#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
4267
4275
pub enum ItemKind < ' hir > {
4268
4276
/// An `extern crate` item, with optional *original* crate name if the crate was renamed.
@@ -4278,9 +4286,9 @@ pub enum ItemKind<'hir> {
4278
4286
Use ( & ' hir UsePath < ' hir > , UseKind ) ,
4279
4287
4280
4288
/// A `static` item.
4281
- Static ( Mutability , Ident , & ' hir Ty < ' hir > , BodyId ) ,
4289
+ Static ( Mutability , Ident , & ' hir Ty < ' hir > , BodyId , DistributedSlice < ' hir > ) ,
4282
4290
/// A `const` item.
4283
- Const ( Ident , & ' hir Generics < ' hir > , & ' hir Ty < ' hir > , BodyId ) ,
4291
+ Const ( Ident , & ' hir Generics < ' hir > , & ' hir Ty < ' hir > , BodyId , DistributedSlice < ' hir > ) ,
4284
4292
/// A function declaration.
4285
4293
Fn {
4286
4294
sig : FnSig < ' hir > ,
@@ -4375,7 +4383,7 @@ impl ItemKind<'_> {
4375
4383
Some ( match self {
4376
4384
ItemKind :: Fn { generics, .. }
4377
4385
| ItemKind :: TyAlias ( _, generics, _)
4378
- | ItemKind :: Const ( _, generics, _, _)
4386
+ | ItemKind :: Const ( _, generics, _, _, _ )
4379
4387
| ItemKind :: Enum ( _, generics, _)
4380
4388
| ItemKind :: Struct ( _, generics, _)
4381
4389
| ItemKind :: Union ( _, generics, _)
@@ -4577,8 +4585,8 @@ impl<'hir> OwnerNode<'hir> {
4577
4585
match self {
4578
4586
OwnerNode :: Item ( Item {
4579
4587
kind :
4580
- ItemKind :: Static ( _, _, _, body)
4581
- | ItemKind :: Const ( _, _, _, body)
4588
+ ItemKind :: Static ( _, _, _, body, _ )
4589
+ | ItemKind :: Const ( _, _, _, body, _ )
4582
4590
| ItemKind :: Fn { body, .. } ,
4583
4591
..
4584
4592
} )
@@ -4803,8 +4811,8 @@ impl<'hir> Node<'hir> {
4803
4811
match self {
4804
4812
Node :: Item ( it) => match it. kind {
4805
4813
ItemKind :: TyAlias ( _, _, ty)
4806
- | ItemKind :: Static ( _, _, ty, _)
4807
- | ItemKind :: Const ( _, _, ty, _) => Some ( ty) ,
4814
+ | ItemKind :: Static ( _, _, ty, _, _ )
4815
+ | ItemKind :: Const ( _, _, ty, _, _ ) => Some ( ty) ,
4808
4816
ItemKind :: Impl ( impl_item) => Some ( & impl_item. self_ty ) ,
4809
4817
_ => None ,
4810
4818
} ,
@@ -4835,8 +4843,8 @@ impl<'hir> Node<'hir> {
4835
4843
Node :: Item ( Item {
4836
4844
owner_id,
4837
4845
kind :
4838
- ItemKind :: Const ( _, _, _, body)
4839
- | ItemKind :: Static ( .., body)
4846
+ ItemKind :: Const ( _, _, _, body, _ )
4847
+ | ItemKind :: Static ( .., body, _ )
4840
4848
| ItemKind :: Fn { body, .. } ,
4841
4849
..
4842
4850
} )
0 commit comments