From a1d6fc43403fadc5564af50d6212d45d9aace84d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 25 Sep 2023 18:28:22 +0200 Subject: [PATCH] rename lint; add tracking issue --- compiler/rustc_lint_defs/src/builtin.rs | 10 +++++----- .../rustc_mir_build/src/thir/pattern/const_to_pat.rs | 2 +- tests/ui/consts/const_in_pattern/issue-65466.stderr | 8 ++++---- tests/ui/match/issue-72896-non-partial-eq-const.stderr | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index a749c52e2dd..00d07cbb2e3 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -2311,13 +2311,13 @@ } declare_lint! { - /// The `match_without_partial_eq` lint detects constants that are used in patterns, + /// The `const_patterns_without_partial_eq` lint detects constants that are used in patterns, /// whose type does not implement `PartialEq`. /// /// ### Example /// /// ```rust,compile_fail - /// #![deny(match_without_partial_eq)] + /// #![deny(const_patterns_without_partial_eq)] /// /// trait EnumSetType { /// type Repr; @@ -2352,12 +2352,12 @@ /// field-by-field. In the future we'd like to ensure that pattern matching always /// follows `PartialEq` semantics, so that trait bound will become a requirement for /// matching on constants. - pub MATCH_WITHOUT_PARTIAL_EQ, + pub CONST_PATTERNS_WITHOUT_PARTIAL_EQ, Warn, "constant in pattern does not implement `PartialEq`", @future_incompatible = FutureIncompatibleInfo { reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps, - reference: "issue #X ", + reference: "issue #116122 ", }; } @@ -3407,6 +3407,7 @@ CONFLICTING_REPR_HINTS, CONST_EVALUATABLE_UNCHECKED, CONST_ITEM_MUTATION, + CONST_PATTERNS_WITHOUT_PARTIAL_EQ, DEAD_CODE, DEPRECATED, DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME, @@ -3440,7 +3441,6 @@ LOSSY_PROVENANCE_CASTS, MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS, MACRO_USE_EXTERN_CRATE, - MATCH_WITHOUT_PARTIAL_EQ, META_VARIABLE_MISUSE, MISSING_ABI, MISSING_FRAGMENT_SPECIFIER, diff --git a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs index ed20ed4a84f..4758ace73b6 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs @@ -246,7 +246,7 @@ fn to_pat( // any errors.) This ensures it shows up in cargo's future-compat reports as well. if !self.type_has_partial_eq_impl(cv.ty()) { self.tcx().emit_spanned_lint( - lint::builtin::MATCH_WITHOUT_PARTIAL_EQ, + lint::builtin::CONST_PATTERNS_WITHOUT_PARTIAL_EQ, self.id, self.span, NonPartialEqMatch { non_peq_ty: cv.ty() }, diff --git a/tests/ui/consts/const_in_pattern/issue-65466.stderr b/tests/ui/consts/const_in_pattern/issue-65466.stderr index 89fddbf853d..9c80cb3a849 100644 --- a/tests/ui/consts/const_in_pattern/issue-65466.stderr +++ b/tests/ui/consts/const_in_pattern/issue-65466.stderr @@ -5,8 +5,8 @@ LL | C => (), | ^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #X - = note: `#[warn(match_without_partial_eq)]` on by default + = note: for more information, see issue #116122 + = note: `#[warn(const_patterns_without_partial_eq)]` on by default warning: 1 warning emitted @@ -18,6 +18,6 @@ LL | C => (), | ^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #X - = note: `#[warn(match_without_partial_eq)]` on by default + = note: for more information, see issue #116122 + = note: `#[warn(const_patterns_without_partial_eq)]` on by default diff --git a/tests/ui/match/issue-72896-non-partial-eq-const.stderr b/tests/ui/match/issue-72896-non-partial-eq-const.stderr index f32cf439531..a7fc0cfc054 100644 --- a/tests/ui/match/issue-72896-non-partial-eq-const.stderr +++ b/tests/ui/match/issue-72896-non-partial-eq-const.stderr @@ -5,8 +5,8 @@ LL | CONST_SET => { /* ok */ } | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #X - = note: `#[warn(match_without_partial_eq)]` on by default + = note: for more information, see issue #116122 + = note: `#[warn(const_patterns_without_partial_eq)]` on by default warning: 1 warning emitted @@ -18,6 +18,6 @@ LL | CONST_SET => { /* ok */ } | ^^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: for more information, see issue #X - = note: `#[warn(match_without_partial_eq)]` on by default + = note: for more information, see issue #116122 + = note: `#[warn(const_patterns_without_partial_eq)]` on by default