rename lint; add tracking issue
This commit is contained in:
@@ -2311,13 +2311,13 @@ declare_lint! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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`.
|
/// whose type does not implement `PartialEq`.
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
///
|
///
|
||||||
/// ```rust,compile_fail
|
/// ```rust,compile_fail
|
||||||
/// #![deny(match_without_partial_eq)]
|
/// #![deny(const_patterns_without_partial_eq)]
|
||||||
///
|
///
|
||||||
/// trait EnumSetType {
|
/// trait EnumSetType {
|
||||||
/// type Repr;
|
/// type Repr;
|
||||||
@@ -2352,12 +2352,12 @@ declare_lint! {
|
|||||||
/// field-by-field. In the future we'd like to ensure that pattern matching always
|
/// 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
|
/// follows `PartialEq` semantics, so that trait bound will become a requirement for
|
||||||
/// matching on constants.
|
/// matching on constants.
|
||||||
pub MATCH_WITHOUT_PARTIAL_EQ,
|
pub CONST_PATTERNS_WITHOUT_PARTIAL_EQ,
|
||||||
Warn,
|
Warn,
|
||||||
"constant in pattern does not implement `PartialEq`",
|
"constant in pattern does not implement `PartialEq`",
|
||||||
@future_incompatible = FutureIncompatibleInfo {
|
@future_incompatible = FutureIncompatibleInfo {
|
||||||
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
|
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,
|
CONFLICTING_REPR_HINTS,
|
||||||
CONST_EVALUATABLE_UNCHECKED,
|
CONST_EVALUATABLE_UNCHECKED,
|
||||||
CONST_ITEM_MUTATION,
|
CONST_ITEM_MUTATION,
|
||||||
|
CONST_PATTERNS_WITHOUT_PARTIAL_EQ,
|
||||||
DEAD_CODE,
|
DEAD_CODE,
|
||||||
DEPRECATED,
|
DEPRECATED,
|
||||||
DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME,
|
DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME,
|
||||||
@@ -3440,7 +3441,6 @@ declare_lint_pass! {
|
|||||||
LOSSY_PROVENANCE_CASTS,
|
LOSSY_PROVENANCE_CASTS,
|
||||||
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
|
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
|
||||||
MACRO_USE_EXTERN_CRATE,
|
MACRO_USE_EXTERN_CRATE,
|
||||||
MATCH_WITHOUT_PARTIAL_EQ,
|
|
||||||
META_VARIABLE_MISUSE,
|
META_VARIABLE_MISUSE,
|
||||||
MISSING_ABI,
|
MISSING_ABI,
|
||||||
MISSING_FRAGMENT_SPECIFIER,
|
MISSING_FRAGMENT_SPECIFIER,
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ impl<'tcx> ConstToPat<'tcx> {
|
|||||||
// any errors.) This ensures it shows up in cargo's future-compat reports as well.
|
// any errors.) This ensures it shows up in cargo's future-compat reports as well.
|
||||||
if !self.type_has_partial_eq_impl(cv.ty()) {
|
if !self.type_has_partial_eq_impl(cv.ty()) {
|
||||||
self.tcx().emit_spanned_lint(
|
self.tcx().emit_spanned_lint(
|
||||||
lint::builtin::MATCH_WITHOUT_PARTIAL_EQ,
|
lint::builtin::CONST_PATTERNS_WITHOUT_PARTIAL_EQ,
|
||||||
self.id,
|
self.id,
|
||||||
self.span,
|
self.span,
|
||||||
NonPartialEqMatch { non_peq_ty: cv.ty() },
|
NonPartialEqMatch { non_peq_ty: cv.ty() },
|
||||||
|
|||||||
@@ -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!
|
= 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: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122>
|
||||||
= note: `#[warn(match_without_partial_eq)]` on by default
|
= note: `#[warn(const_patterns_without_partial_eq)]` on by default
|
||||||
|
|
||||||
warning: 1 warning emitted
|
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!
|
= 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: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122>
|
||||||
= note: `#[warn(match_without_partial_eq)]` on by default
|
= note: `#[warn(const_patterns_without_partial_eq)]` on by default
|
||||||
|
|
||||||
|
|||||||
@@ -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!
|
= 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: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122>
|
||||||
= note: `#[warn(match_without_partial_eq)]` on by default
|
= note: `#[warn(const_patterns_without_partial_eq)]` on by default
|
||||||
|
|
||||||
warning: 1 warning emitted
|
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!
|
= 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: for more information, see issue #116122 <https://github.com/rust-lang/rust/issues/116122>
|
||||||
= note: `#[warn(match_without_partial_eq)]` on by default
|
= note: `#[warn(const_patterns_without_partial_eq)]` on by default
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user