@@ -4106,11 +4106,11 @@ impl<'hir> Item<'hir> {
41064106
41074107 expect_use, ( & ' hir UsePath <' hir>, UseKind ) , ItemKind :: Use ( p, uk) , ( p, * uk) ;
41084108
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 ) ;
41114111
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 ) ;
41144114
41154115 expect_fn, ( Ident , & FnSig <' hir>, & ' hir Generics <' hir>, BodyId ) ,
41164116 ItemKind :: Fn { ident, sig, generics, body, .. } , ( * ident, sig, generics, * body) ;
@@ -4263,6 +4263,14 @@ impl FnHeader {
42634263 }
42644264}
42654265
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+
42664274#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
42674275pub enum ItemKind < ' hir > {
42684276 /// An `extern crate` item, with optional *original* crate name if the crate was renamed.
@@ -4278,9 +4286,9 @@ pub enum ItemKind<'hir> {
42784286 Use ( & ' hir UsePath < ' hir > , UseKind ) ,
42794287
42804288 /// A `static` item.
4281- Static ( Mutability , Ident , & ' hir Ty < ' hir > , BodyId ) ,
4289+ Static ( Mutability , Ident , & ' hir Ty < ' hir > , BodyId , DistributedSlice < ' hir > ) ,
42824290 /// 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 > ) ,
42844292 /// A function declaration.
42854293 Fn {
42864294 sig : FnSig < ' hir > ,
@@ -4375,7 +4383,7 @@ impl ItemKind<'_> {
43754383 Some ( match self {
43764384 ItemKind :: Fn { generics, .. }
43774385 | ItemKind :: TyAlias ( _, generics, _)
4378- | ItemKind :: Const ( _, generics, _, _)
4386+ | ItemKind :: Const ( _, generics, _, _, _ )
43794387 | ItemKind :: Enum ( _, generics, _)
43804388 | ItemKind :: Struct ( _, generics, _)
43814389 | ItemKind :: Union ( _, generics, _)
@@ -4577,8 +4585,8 @@ impl<'hir> OwnerNode<'hir> {
45774585 match self {
45784586 OwnerNode :: Item ( Item {
45794587 kind :
4580- ItemKind :: Static ( _, _, _, body)
4581- | ItemKind :: Const ( _, _, _, body)
4588+ ItemKind :: Static ( _, _, _, body, _ )
4589+ | ItemKind :: Const ( _, _, _, body, _ )
45824590 | ItemKind :: Fn { body, .. } ,
45834591 ..
45844592 } )
@@ -4803,8 +4811,8 @@ impl<'hir> Node<'hir> {
48034811 match self {
48044812 Node :: Item ( it) => match it. kind {
48054813 ItemKind :: TyAlias ( _, _, ty)
4806- | ItemKind :: Static ( _, _, ty, _)
4807- | ItemKind :: Const ( _, _, ty, _) => Some ( ty) ,
4814+ | ItemKind :: Static ( _, _, ty, _, _ )
4815+ | ItemKind :: Const ( _, _, ty, _, _ ) => Some ( ty) ,
48084816 ItemKind :: Impl ( impl_item) => Some ( & impl_item. self_ty ) ,
48094817 _ => None ,
48104818 } ,
@@ -4835,8 +4843,8 @@ impl<'hir> Node<'hir> {
48354843 Node :: Item ( Item {
48364844 owner_id,
48374845 kind :
4838- ItemKind :: Const ( _, _, _, body)
4839- | ItemKind :: Static ( .., body)
4846+ ItemKind :: Const ( _, _, _, body, _ )
4847+ | ItemKind :: Static ( .., body, _ )
48404848 | ItemKind :: Fn { body, .. } ,
48414849 ..
48424850 } )
0 commit comments