@@ -32,7 +32,6 @@ declare_lint_pass! {
32
32
CONFLICTING_REPR_HINTS ,
33
33
CONST_EVALUATABLE_UNCHECKED ,
34
34
CONST_ITEM_MUTATION ,
35
- CONST_PATTERNS_WITHOUT_PARTIAL_EQ ,
36
35
DEAD_CODE ,
37
36
DEPRECATED ,
38
37
DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME ,
@@ -2342,57 +2341,6 @@ declare_lint! {
2342
2341
} ;
2343
2342
}
2344
2343
2345
- declare_lint ! {
2346
- /// The `const_patterns_without_partial_eq` lint detects constants that are used in patterns,
2347
- /// whose type does not implement `PartialEq`.
2348
- ///
2349
- /// ### Example
2350
- ///
2351
- /// ```rust,compile_fail
2352
- /// #![deny(const_patterns_without_partial_eq)]
2353
- ///
2354
- /// trait EnumSetType {
2355
- /// type Repr;
2356
- /// }
2357
- ///
2358
- /// enum Enum8 { }
2359
- /// impl EnumSetType for Enum8 {
2360
- /// type Repr = u8;
2361
- /// }
2362
- ///
2363
- /// #[derive(PartialEq, Eq)]
2364
- /// struct EnumSet<T: EnumSetType> {
2365
- /// __enumset_underlying: T::Repr,
2366
- /// }
2367
- ///
2368
- /// const CONST_SET: EnumSet<Enum8> = EnumSet { __enumset_underlying: 3 };
2369
- ///
2370
- /// fn main() {
2371
- /// match CONST_SET {
2372
- /// CONST_SET => { /* ok */ }
2373
- /// _ => panic!("match fell through?"),
2374
- /// }
2375
- /// }
2376
- /// ```
2377
- ///
2378
- /// {{produces}}
2379
- ///
2380
- /// ### Explanation
2381
- ///
2382
- /// Previous versions of Rust accepted constants in patterns, even if those constants' types
2383
- /// did not have `PartialEq` implemented. The compiler falls back to comparing the value
2384
- /// field-by-field. In the future we'd like to ensure that pattern matching always
2385
- /// follows `PartialEq` semantics, so that trait bound will become a requirement for
2386
- /// matching on constants.
2387
- pub CONST_PATTERNS_WITHOUT_PARTIAL_EQ ,
2388
- Warn ,
2389
- "constant in pattern does not implement `PartialEq`" ,
2390
- @future_incompatible = FutureIncompatibleInfo {
2391
- reason: FutureIncompatibilityReason :: FutureReleaseErrorReportInDeps ,
2392
- reference: "issue #116122 <https://github.com/rust-lang/rust/issues/116122>" ,
2393
- } ;
2394
- }
2395
-
2396
2344
declare_lint ! {
2397
2345
/// The `ambiguous_associated_items` lint detects ambiguity between
2398
2346
/// [associated items] and [enum variants].
0 commit comments