@@ -6,8 +6,8 @@ use rustc_ast::{
6
6
LitKind , TraitObjectSyntax , UintTy ,
7
7
} ;
8
8
pub 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 ,
11
11
} ;
12
12
use rustc_data_structures:: fingerprint:: Fingerprint ;
13
13
use rustc_data_structures:: sorted_map:: SortedMap ;
@@ -502,19 +502,16 @@ pub enum GenericArgsParentheses {
502
502
ParenSugar ,
503
503
}
504
504
505
- /// A modifier on a trait bound.
505
+ /// The modifiers on a trait bound.
506
506
#[ 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 } ;
518
515
}
519
516
520
517
#[ derive( Clone , Copy , Debug , HashStable_Generic ) ]
@@ -3180,7 +3177,7 @@ pub struct PolyTraitRef<'hir> {
3180
3177
/// The constness and polarity of the trait ref.
3181
3178
///
3182
3179
/// The `async` modifier is lowered directly into a different trait for now.
3183
- pub modifiers : TraitBoundModifier ,
3180
+ pub modifiers : TraitBoundModifiers ,
3184
3181
3185
3182
/// The `Foo<&'a T>` in `for<'a> Foo<&'a T>`.
3186
3183
pub trait_ref : TraitRef < ' hir > ,
@@ -4085,7 +4082,7 @@ mod size_asserts {
4085
4082
static_assert_size ! ( ForeignItem <' _>, 88 ) ;
4086
4083
static_assert_size ! ( ForeignItemKind <' _>, 56 ) ;
4087
4084
static_assert_size ! ( GenericArg <' _>, 16 ) ;
4088
- static_assert_size ! ( GenericBound <' _>, 48 ) ;
4085
+ static_assert_size ! ( GenericBound <' _>, 64 ) ;
4089
4086
static_assert_size ! ( Generics <' _>, 56 ) ;
4090
4087
static_assert_size ! ( Impl <' _>, 80 ) ;
4091
4088
static_assert_size ! ( ImplItem <' _>, 88 ) ;
0 commit comments