@@ -148,8 +148,10 @@ mod structural_impls;
148
148
mod sty;
149
149
mod typeck_results;
150
150
151
+ mod impl_polarity;
151
152
mod visibility;
152
153
154
+ pub use impl_polarity:: ImplPolarity ;
153
155
pub use visibility:: Visibility ;
154
156
155
157
pub struct ResolverOutputs {
@@ -245,41 +247,6 @@ pub enum ImplSubject<'tcx> {
245
247
Inherent ( Ty < ' tcx > ) ,
246
248
}
247
249
248
- #[ derive( Copy , Clone , PartialEq , Eq , Hash , TyEncodable , TyDecodable , HashStable , Debug ) ]
249
- #[ derive( TypeFoldable , TypeVisitable ) ]
250
- pub enum ImplPolarity {
251
- /// `impl Trait for Type`
252
- Positive ,
253
- /// `impl !Trait for Type`
254
- Negative ,
255
- /// `#[rustc_reservation_impl] impl Trait for Type`
256
- ///
257
- /// This is a "stability hack", not a real Rust feature.
258
- /// See #64631 for details.
259
- Reservation ,
260
- }
261
-
262
- impl ImplPolarity {
263
- /// Flips polarity by turning `Positive` into `Negative` and `Negative` into `Positive`.
264
- pub fn flip ( & self ) -> Option < ImplPolarity > {
265
- match self {
266
- ImplPolarity :: Positive => Some ( ImplPolarity :: Negative ) ,
267
- ImplPolarity :: Negative => Some ( ImplPolarity :: Positive ) ,
268
- ImplPolarity :: Reservation => None ,
269
- }
270
- }
271
- }
272
-
273
- impl fmt:: Display for ImplPolarity {
274
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
275
- match self {
276
- Self :: Positive => f. write_str ( "positive" ) ,
277
- Self :: Negative => f. write_str ( "negative" ) ,
278
- Self :: Reservation => f. write_str ( "reservation" ) ,
279
- }
280
- }
281
- }
282
-
283
250
#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , HashStable , TyEncodable , TyDecodable ) ]
284
251
pub enum BoundConstness {
285
252
/// `T: Trait`
0 commit comments