about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-09-25 18:28:22 +0200
committerRalf Jung <post@ralfj.de>2023-09-25 19:05:10 +0200
commita1d6fc43403fadc5564af50d6212d45d9aace84d (patch)
treea22918f18069804125d0c62957794a6ea0a3d9c9
parentb589976606c7f03b2000bed41ddf6149d96c587b (diff)
downloadrust-a1d6fc43403fadc5564af50d6212d45d9aace84d.tar.gz
rust-a1d6fc43403fadc5564af50d6212d45d9aace84d.zip
rename lint; add tracking issue
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs10
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs2
-rw-r--r--tests/ui/consts/const_in_pattern/issue-65466.stderr8
-rw-r--r--tests/ui/match/issue-72896-non-partial-eq-const.stderr8
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! {
 }
 
 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 @@ declare_lint! {
     /// 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 <https://github.com/rust-lang/rust/issues/X>",
+        reference: "issue #116122 <https://github.com/rust-lang/rust/issues/116122>",
     };
 }
 
@@ -3407,6 +3407,7 @@ declare_lint_pass! {
         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 @@ declare_lint_pass! {
         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 @@ impl<'tcx> ConstToPat<'tcx> {
             // 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 <https://github.com/rust-lang/rust/issues/X>
-   = note: `#[warn(match_without_partial_eq)]` on by default
+   = note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/X>
-   = note: `#[warn(match_without_partial_eq)]` on by default
+   = note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/X>
-   = note: `#[warn(match_without_partial_eq)]` on by default
+   = note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/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 <https://github.com/rust-lang/rust/issues/X>
-   = note: `#[warn(match_without_partial_eq)]` on by default
+   = note: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122>
+   = note: `#[warn(const_patterns_without_partial_eq)]` on by default