@@ -3320,7 +3320,7 @@ impl<'hir> TraitItem<'hir> {
33203320
33213321 expect_methods_self_kind ! {
33223322 expect_const, ( & ' hir Ty <' hir>, Option <ConstItemRhs <' hir>>) ,
3323- TraitItemKind :: Const ( ty, rhs, _ ) , ( ty, * rhs) ;
3323+ TraitItemKind :: Const ( ty, rhs) , ( ty, * rhs) ;
33243324
33253325 expect_fn, ( & FnSig <' hir>, & TraitFn <' hir>) ,
33263326 TraitItemKind :: Fn ( ty, trfn) , ( ty, trfn) ;
@@ -3340,32 +3340,11 @@ pub enum TraitFn<'hir> {
33403340 Provided ( BodyId ) ,
33413341}
33423342
3343- #[ derive( Debug , Clone , Copy , PartialEq , Eq , StableHash ) ]
3344- pub enum IsTypeConst {
3345- No ,
3346- Yes ,
3347- }
3348-
3349- impl From < bool > for IsTypeConst {
3350- fn from ( value : bool ) -> Self {
3351- if value { Self :: Yes } else { Self :: No }
3352- }
3353- }
3354-
3355- impl From < IsTypeConst > for bool {
3356- fn from ( value : IsTypeConst ) -> Self {
3357- matches ! ( value, IsTypeConst :: Yes )
3358- }
3359- }
3360-
33613343/// Represents a trait method or associated constant or type
33623344#[ derive( Debug , Clone , Copy , StableHash ) ]
33633345pub enum TraitItemKind < ' hir > {
3364- // FIXME(mgca) eventually want to move the option that is around `ConstItemRhs<'hir>`
3365- // into `ConstItemRhs`, much like `ast::ConstItemRhsKind`, but for now mark whether
3366- // this node is a TypeConst with a flag.
33673346 /// An associated constant with an optional value (otherwise `impl`s must contain a value).
3368- Const ( & ' hir Ty < ' hir > , Option < ConstItemRhs < ' hir > > , IsTypeConst ) ,
3347+ Const ( & ' hir Ty < ' hir > , Option < ConstItemRhs < ' hir > > ) ,
33693348 /// An associated function with an optional body.
33703349 Fn ( FnSig < ' hir > , TraitFn < ' hir > ) ,
33713350 /// An associated type with (possibly empty) bounds and optional concrete
@@ -5011,7 +4990,7 @@ impl<'hir> OwnerNode<'hir> {
50114990 | OwnerNode :: TraitItem ( TraitItem {
50124991 kind :
50134992 TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) )
5014- | TraitItemKind :: Const ( _, Some ( ConstItemRhs :: Body ( body) ) , _ ) ,
4993+ | TraitItemKind :: Const ( _, Some ( ConstItemRhs :: Body ( body) ) ) ,
50154994 ..
50164995 } )
50174996 | OwnerNode :: ImplItem ( ImplItem {
@@ -5238,7 +5217,7 @@ impl<'hir> Node<'hir> {
52385217 _ => None ,
52395218 } ,
52405219 Node :: TraitItem ( it) => match it. kind {
5241- TraitItemKind :: Const ( ty, _, _ ) => Some ( ty) ,
5220+ TraitItemKind :: Const ( ty, _) => Some ( ty) ,
52425221 TraitItemKind :: Type ( _, ty) => ty,
52435222 _ => None ,
52445223 } ,
@@ -5282,7 +5261,7 @@ impl<'hir> Node<'hir> {
52825261 | Node :: TraitItem ( TraitItem {
52835262 owner_id,
52845263 kind :
5285- TraitItemKind :: Const ( _, Some ( ConstItemRhs :: Body ( body) ) , _ )
5264+ TraitItemKind :: Const ( _, Some ( ConstItemRhs :: Body ( body) ) )
52865265 | TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) ,
52875266 ..
52885267 } )
0 commit comments