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