@@ -148,9 +148,11 @@ mod structural_impls;
148
148
mod sty;
149
149
mod typeck_results;
150
150
151
+ mod bound_constness;
151
152
mod impl_polarity;
152
153
mod visibility;
153
154
155
+ pub use bound_constness:: BoundConstness ;
154
156
pub use impl_polarity:: ImplPolarity ;
155
157
pub use visibility:: Visibility ;
156
158
@@ -247,38 +249,6 @@ pub enum ImplSubject<'tcx> {
247
249
Inherent ( Ty < ' tcx > ) ,
248
250
}
249
251
250
- #[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , HashStable , TyEncodable , TyDecodable ) ]
251
- pub enum BoundConstness {
252
- /// `T: Trait`
253
- NotConst ,
254
- /// `T: ~const Trait`
255
- ///
256
- /// Requires resolving to const only when we are in a const context.
257
- ConstIfConst ,
258
- }
259
-
260
- impl BoundConstness {
261
- /// Reduce `self` and `constness` to two possible combined states instead of four.
262
- pub fn and ( & mut self , constness : hir:: Constness ) -> hir:: Constness {
263
- match ( constness, self ) {
264
- ( hir:: Constness :: Const , BoundConstness :: ConstIfConst ) => hir:: Constness :: Const ,
265
- ( _, this) => {
266
- * this = BoundConstness :: NotConst ;
267
- hir:: Constness :: NotConst
268
- }
269
- }
270
- }
271
- }
272
-
273
- impl fmt:: Display for BoundConstness {
274
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
275
- match self {
276
- Self :: NotConst => f. write_str ( "normal" ) ,
277
- Self :: ConstIfConst => f. write_str ( "`~const`" ) ,
278
- }
279
- }
280
- }
281
-
282
252
#[ derive( Clone , Debug , PartialEq , Eq , Copy , Hash , TyEncodable , TyDecodable , HashStable ) ]
283
253
#[ derive( TypeFoldable , TypeVisitable ) ]
284
254
pub struct ClosureSizeProfileData < ' tcx > {
0 commit comments