diff options
| author | daxpedda <daxpedda@gmail.com> | 2021-04-10 23:37:18 +0200 |
|---|---|---|
| committer | daxpedda <daxpedda@gmail.com> | 2021-04-10 23:37:18 +0200 |
| commit | cb14e7ebf40bb6edf9307813b341a9119800ef49 (patch) | |
| tree | 6ea9d3a1bf4735c8a2699bc6d351affc50141d69 /clippy_lints/src/panic_unimplemented.rs | |
| parent | fd5cf4e82d3422887585fd148369b592f95cd169 (diff) | |
| download | rust-cb14e7ebf40bb6edf9307813b341a9119800ef49.tar.gz rust-cb14e7ebf40bb6edf9307813b341a9119800ef49.zip | |
Fix false-positive `debug_assert` in `panic`
Diffstat (limited to 'clippy_lints/src/panic_unimplemented.rs')
| -rw-r--r-- | clippy_lints/src/panic_unimplemented.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/panic_unimplemented.rs b/clippy_lints/src/panic_unimplemented.rs index 1e946858947..1a680e7607e 100644 --- a/clippy_lints/src/panic_unimplemented.rs +++ b/clippy_lints/src/panic_unimplemented.rs @@ -74,7 +74,7 @@ declare_lint_pass!(PanicUnimplemented => [UNIMPLEMENTED, UNREACHABLE, TODO, PANI impl<'tcx> LateLintPass<'tcx> for PanicUnimplemented { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { - if match_panic_call(cx, expr).is_some() { + if match_panic_call(cx, expr).is_some() && is_expn_of(expr.span, "debug_assert").is_none() { let span = get_outer_span(expr); if is_expn_of(expr.span, "unimplemented").is_some() { span_lint( |
