diff options
| author | Ralf Jung <post@ralfj.de> | 2021-01-01 14:44:19 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2021-01-01 15:00:27 +0100 |
| commit | b31400a226aa494c4b245a0cfc4234a4edcd02a3 (patch) | |
| tree | 4394c8e3336973e5bc3bac01208b747f5550bfca | |
| parent | a6bd5246da7806786b5c1f61d05a957c9ae68903 (diff) | |
| download | rust-b31400a226aa494c4b245a0cfc4234a4edcd02a3.tar.gz rust-b31400a226aa494c4b245a0cfc4234a4edcd02a3.zip | |
improve unconditional_panic description
| -rw-r--r-- | compiler/rustc_lint_defs/src/builtin.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 1c692d4f207..f90fc7fc9ab 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -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" |
