@@ -2973,8 +2973,8 @@ impl<'hir> TraitItem<'hir> {
2973
2973
}
2974
2974
2975
2975
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 ) ;
2978
2978
2979
2979
expect_fn, ( & FnSig <' hir>, & TraitFn <' hir>) ,
2980
2980
TraitItemKind :: Fn ( ty, trfn) , ( ty, trfn) ;
@@ -2998,7 +2998,7 @@ pub enum TraitFn<'hir> {
2998
2998
#[ derive( Debug , Clone , Copy , HashStable_Generic ) ]
2999
2999
pub enum TraitItemKind < ' hir > {
3000
3000
/// 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 > > ) ,
3002
3002
/// An associated function with an optional body.
3003
3003
Fn ( FnSig < ' hir > , TraitFn < ' hir > ) ,
3004
3004
/// An associated type with (possibly empty) bounds and optional concrete
@@ -3048,7 +3048,7 @@ impl<'hir> ImplItem<'hir> {
3048
3048
}
3049
3049
3050
3050
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 ) ;
3052
3052
expect_fn, ( & FnSig <' hir>, BodyId ) , ImplItemKind :: Fn ( ty, body) , ( ty, * body) ;
3053
3053
expect_type, & ' hir Ty <' hir>, ImplItemKind :: Type ( ty) , ty;
3054
3054
}
@@ -3059,7 +3059,7 @@ impl<'hir> ImplItem<'hir> {
3059
3059
pub enum ImplItemKind < ' hir > {
3060
3060
/// An associated constant of the given type, set to the constant result
3061
3061
/// of the expression.
3062
- Const ( & ' hir Ty < ' hir > , BodyId ) ,
3062
+ Const ( & ' hir Ty < ' hir > , BodyId , Option < & ' hir ConstArg < ' hir > > ) ,
3063
3063
/// An associated function implementation with the given signature and body.
3064
3064
Fn ( FnSig < ' hir > , BodyId ) ,
3065
3065
/// An associated type.
@@ -4461,11 +4461,12 @@ impl<'hir> OwnerNode<'hir> {
4461
4461
} )
4462
4462
| OwnerNode :: TraitItem ( TraitItem {
4463
4463
kind :
4464
- TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) | TraitItemKind :: Const ( _, Some ( body) ) ,
4464
+ TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) )
4465
+ | TraitItemKind :: Const ( _, Some ( body) , _) ,
4465
4466
..
4466
4467
} )
4467
4468
| OwnerNode :: ImplItem ( ImplItem {
4468
- kind : ImplItemKind :: Fn ( _, body) | ImplItemKind :: Const ( _, body) ,
4469
+ kind : ImplItemKind :: Fn ( _, body) | ImplItemKind :: Const ( _, body, _ ) ,
4469
4470
..
4470
4471
} ) => Some ( * body) ,
4471
4472
_ => None ,
@@ -4686,12 +4687,12 @@ impl<'hir> Node<'hir> {
4686
4687
_ => None ,
4687
4688
} ,
4688
4689
Node :: TraitItem ( it) => match it. kind {
4689
- TraitItemKind :: Const ( ty, _) => Some ( ty) ,
4690
+ TraitItemKind :: Const ( ty, _, _ ) => Some ( ty) ,
4690
4691
TraitItemKind :: Type ( _, ty) => ty,
4691
4692
_ => None ,
4692
4693
} ,
4693
4694
Node :: ImplItem ( it) => match it. kind {
4694
- ImplItemKind :: Const ( ty, _) => Some ( ty) ,
4695
+ ImplItemKind :: Const ( ty, _, _ ) => Some ( ty) ,
4695
4696
ImplItemKind :: Type ( ty) => Some ( ty) ,
4696
4697
_ => None ,
4697
4698
} ,
@@ -4720,12 +4721,13 @@ impl<'hir> Node<'hir> {
4720
4721
| Node :: TraitItem ( TraitItem {
4721
4722
owner_id,
4722
4723
kind :
4723
- TraitItemKind :: Const ( _, Some ( body) ) | TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) ,
4724
+ TraitItemKind :: Const ( _, Some ( body) , _)
4725
+ | TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) ,
4724
4726
..
4725
4727
} )
4726
4728
| Node :: ImplItem ( ImplItem {
4727
4729
owner_id,
4728
- kind : ImplItemKind :: Const ( _, body) | ImplItemKind :: Fn ( _, body) ,
4730
+ kind : ImplItemKind :: Const ( _, body, _ ) | ImplItemKind :: Fn ( _, body) ,
4729
4731
..
4730
4732
} ) => Some ( ( owner_id. def_id , * body) ) ,
4731
4733
0 commit comments