@@ -6,8 +6,8 @@ use rustc_ast::{
66 LitKind , TraitObjectSyntax , UintTy ,
77} ;
88pub use rustc_ast:: {
9- BinOp , BinOpKind , BindingMode , BorrowKind , ByRef , CaptureBy , ImplPolarity , IsAuto , Movability ,
10- Mutability , UnOp ,
9+ BinOp , BinOpKind , BindingMode , BorrowKind , BoundConstness , BoundPolarity , ByRef , CaptureBy ,
10+ ImplPolarity , IsAuto , Movability , Mutability , UnOp ,
1111} ;
1212use rustc_data_structures:: fingerprint:: Fingerprint ;
1313use rustc_data_structures:: sorted_map:: SortedMap ;
@@ -502,19 +502,16 @@ pub enum GenericArgsParentheses {
502502 ParenSugar ,
503503}
504504
505- /// A modifier on a trait bound.
505+ /// The modifiers on a trait bound.
506506#[ derive( Copy , Clone , PartialEq , Eq , Hash , Debug , HashStable_Generic ) ]
507- pub enum TraitBoundModifier {
508- /// `Type: Trait`
509- None ,
510- /// `Type: !Trait`
511- Negative ,
512- /// `Type: ?Trait`
513- Maybe ,
514- /// `Type: const Trait`
515- Const ,
516- /// `Type: ~const Trait`
517- MaybeConst ,
507+ pub struct TraitBoundModifiers {
508+ pub constness : BoundConstness ,
509+ pub polarity : BoundPolarity ,
510+ }
511+
512+ impl TraitBoundModifiers {
513+ pub const NONE : Self =
514+ TraitBoundModifiers { constness : BoundConstness :: Never , polarity : BoundPolarity :: Positive } ;
518515}
519516
520517#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
@@ -3180,7 +3177,7 @@ pub struct PolyTraitRef<'hir> {
31803177 /// The constness and polarity of the trait ref.
31813178 ///
31823179 /// The `async` modifier is lowered directly into a different trait for now.
3183- pub modifiers : TraitBoundModifier ,
3180+ pub modifiers : TraitBoundModifiers ,
31843181
31853182 /// The `Foo<&'a T>` in `for<'a> Foo<&'a T>`.
31863183 pub trait_ref : TraitRef < ' hir > ,
@@ -4085,7 +4082,7 @@ mod size_asserts {
40854082 static_assert_size ! ( ForeignItem <' _>, 88 ) ;
40864083 static_assert_size ! ( ForeignItemKind <' _>, 56 ) ;
40874084 static_assert_size ! ( GenericArg <' _>, 16 ) ;
4088- static_assert_size ! ( GenericBound <' _>, 48 ) ;
4085+ static_assert_size ! ( GenericBound <' _>, 64 ) ;
40894086 static_assert_size ! ( Generics <' _>, 56 ) ;
40904087 static_assert_size ! ( Impl <' _>, 80 ) ;
40914088 static_assert_size ! ( ImplItem <' _>, 88 ) ;
0 commit comments