@@ -2973,8 +2973,8 @@ impl<'hir> TraitItem<'hir> {
29732973 }
29742974
29752975 expect_methods_self_kind ! {
2976- expect_const, ( & ' hir Ty <' hir>, Option <BodyId >) ,
2977- TraitItemKind :: Const ( ty, body) , ( ty, * body) ;
2976+ expect_const, ( & ' hir Ty <' hir>, Option <BodyId >, Option < & ' hir ConstArg < ' hir>> ) ,
2977+ TraitItemKind :: Const ( ty, body, ct ) , ( ty, * body, * ct ) ;
29782978
29792979 expect_fn, ( & FnSig <' hir>, & TraitFn <' hir>) ,
29802980 TraitItemKind :: Fn ( ty, trfn) , ( ty, trfn) ;
@@ -2998,7 +2998,7 @@ pub enum TraitFn<'hir> {
29982998#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
29992999pub enum TraitItemKind < ' hir > {
30003000 /// An associated constant with an optional value (otherwise `impl`s must contain a value).
3001- Const ( & ' hir Ty < ' hir > , Option < BodyId > ) ,
3001+ Const ( & ' hir Ty < ' hir > , Option < BodyId > , Option < & ' hir ConstArg < ' hir > > ) ,
30023002 /// An associated function with an optional body.
30033003 Fn ( FnSig < ' hir > , TraitFn < ' hir > ) ,
30043004 /// An associated type with (possibly empty) bounds and optional concrete
@@ -3048,7 +3048,7 @@ impl<'hir> ImplItem<'hir> {
30483048 }
30493049
30503050 expect_methods_self_kind ! {
3051- expect_const, ( & ' hir Ty <' hir>, BodyId ) , ImplItemKind :: Const ( ty, body) , ( ty, * body) ;
3051+ expect_const, ( & ' hir Ty <' hir>, BodyId , Option < & ' hir ConstArg < ' hir>> ) , ImplItemKind :: Const ( ty, body, ct ) , ( ty, * body, * ct ) ;
30523052 expect_fn, ( & FnSig <' hir>, BodyId ) , ImplItemKind :: Fn ( ty, body) , ( ty, * body) ;
30533053 expect_type, & ' hir Ty <' hir>, ImplItemKind :: Type ( ty) , ty;
30543054 }
@@ -3059,7 +3059,7 @@ impl<'hir> ImplItem<'hir> {
30593059pub enum ImplItemKind < ' hir > {
30603060 /// An associated constant of the given type, set to the constant result
30613061 /// of the expression.
3062- Const ( & ' hir Ty < ' hir > , BodyId ) ,
3062+ Const ( & ' hir Ty < ' hir > , BodyId , Option < & ' hir ConstArg < ' hir > > ) ,
30633063 /// An associated function implementation with the given signature and body.
30643064 Fn ( FnSig < ' hir > , BodyId ) ,
30653065 /// An associated type.
@@ -4461,11 +4461,12 @@ impl<'hir> OwnerNode<'hir> {
44614461 } )
44624462 | OwnerNode :: TraitItem ( TraitItem {
44634463 kind :
4464- TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) | TraitItemKind :: Const ( _, Some ( body) ) ,
4464+ TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) )
4465+ | TraitItemKind :: Const ( _, Some ( body) , _) ,
44654466 ..
44664467 } )
44674468 | OwnerNode :: ImplItem ( ImplItem {
4468- kind : ImplItemKind :: Fn ( _, body) | ImplItemKind :: Const ( _, body) ,
4469+ kind : ImplItemKind :: Fn ( _, body) | ImplItemKind :: Const ( _, body, _ ) ,
44694470 ..
44704471 } ) => Some ( * body) ,
44714472 _ => None ,
@@ -4686,12 +4687,12 @@ impl<'hir> Node<'hir> {
46864687 _ => None ,
46874688 } ,
46884689 Node :: TraitItem ( it) => match it. kind {
4689- TraitItemKind :: Const ( ty, _) => Some ( ty) ,
4690+ TraitItemKind :: Const ( ty, _, _ ) => Some ( ty) ,
46904691 TraitItemKind :: Type ( _, ty) => ty,
46914692 _ => None ,
46924693 } ,
46934694 Node :: ImplItem ( it) => match it. kind {
4694- ImplItemKind :: Const ( ty, _) => Some ( ty) ,
4695+ ImplItemKind :: Const ( ty, _, _ ) => Some ( ty) ,
46954696 ImplItemKind :: Type ( ty) => Some ( ty) ,
46964697 _ => None ,
46974698 } ,
@@ -4720,12 +4721,13 @@ impl<'hir> Node<'hir> {
47204721 | Node :: TraitItem ( TraitItem {
47214722 owner_id,
47224723 kind :
4723- TraitItemKind :: Const ( _, Some ( body) ) | TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) ,
4724+ TraitItemKind :: Const ( _, Some ( body) , _)
4725+ | TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) ,
47244726 ..
47254727 } )
47264728 | Node :: ImplItem ( ImplItem {
47274729 owner_id,
4728- kind : ImplItemKind :: Const ( _, body) | ImplItemKind :: Fn ( _, body) ,
4730+ kind : ImplItemKind :: Const ( _, body, _ ) | ImplItemKind :: Fn ( _, body) ,
47294731 ..
47304732 } ) => Some ( ( owner_id. def_id , * body) ) ,
47314733
0 commit comments