Skip to content

Commit

Permalink
Rollup merge of #80578 - RalfJung:panic-lint-description, r=lcnr
Browse files Browse the repository at this point in the history
improve unconditional_panic description

The fact that the lint is triggered by the ConstProp pass is an implementation detail, I do not think that this should be mentioned in the description.

Cc `@oli-obk` `@ehuss`
  • Loading branch information
m-ou-se authored Jan 2, 2021
2 parents 4890c06 + b31400a commit bb70305
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,10 @@ declare_lint! {
///
/// ### Explanation
///
/// This lint detects code that is very likely incorrect. When possible,
/// the compiler will attempt to detect situations where code can be
/// evaluated at compile-time to generate more efficient code. While
/// evaluating such code, if it detects that the code will unconditionally
/// panic, this usually indicates that it is doing something incorrectly.
/// If this lint is allowed, then the code will not be evaluated at
/// compile-time, and instead continue to generate code to evaluate at
/// runtime, which may panic during runtime.
/// This lint detects code that is very likely incorrect because it will
/// always panic, such as division by zero and out-of-bounds array
/// accesses. Consider adjusting your code if this is a bug, or using the
/// `panic!` or `unreachable!` macro instead in case the panic is intended.
pub UNCONDITIONAL_PANIC,
Deny,
"operation will cause a panic at runtime"
Expand Down

0 comments on commit bb70305

Please sign in to comment.