make const_err a hard error
This commit is contained in:
parent
5854680388
commit
fd59d44f58
254 changed files with 1460 additions and 5402 deletions
|
@ -263,37 +263,6 @@ declare_lint! {
|
|||
"operation will cause a panic at runtime"
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
/// The `const_err` lint detects an erroneous expression while doing
|
||||
/// constant evaluation.
|
||||
///
|
||||
/// ### Example
|
||||
///
|
||||
/// ```rust,compile_fail
|
||||
/// #![allow(unconditional_panic)]
|
||||
/// const C: i32 = 1/0;
|
||||
/// ```
|
||||
///
|
||||
/// {{produces}}
|
||||
///
|
||||
/// ### Explanation
|
||||
///
|
||||
/// This lint detects constants that fail to evaluate. Allowing the lint will accept the
|
||||
/// constant declaration, but any use of this constant will still lead to a hard error. This is
|
||||
/// a future incompatibility lint; the plan is to eventually entirely forbid even declaring
|
||||
/// constants that cannot be evaluated. See [issue #71800] for more details.
|
||||
///
|
||||
/// [issue #71800]: https://github.com/rust-lang/rust/issues/71800
|
||||
pub CONST_ERR,
|
||||
Deny,
|
||||
"constant evaluation encountered erroneous expression",
|
||||
@future_incompatible = FutureIncompatibleInfo {
|
||||
reference: "issue #71800 <https://github.com/rust-lang/rust/issues/71800>",
|
||||
reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow,
|
||||
};
|
||||
report_in_external_macro
|
||||
}
|
||||
|
||||
declare_lint! {
|
||||
/// The `unused_imports` lint detects imports that are never used.
|
||||
///
|
||||
|
@ -3295,7 +3264,6 @@ declare_lint_pass! {
|
|||
EXPORTED_PRIVATE_DEPENDENCIES,
|
||||
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
|
||||
INVALID_TYPE_PARAM_DEFAULT,
|
||||
CONST_ERR,
|
||||
RENAMED_AND_REMOVED_LINTS,
|
||||
UNALIGNED_REFERENCES,
|
||||
CONST_ITEM_MUTATION,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue