diff options
| author | y21 <30553356+y21@users.noreply.github.com> | 2024-06-07 21:54:33 +0200 |
|---|---|---|
| committer | y21 <30553356+y21@users.noreply.github.com> | 2024-06-07 21:54:33 +0200 |
| commit | c3d3a3f30164644d64c09812c863415f28604e80 (patch) | |
| tree | 2feaffcab5119795b4843da36b0f68c52f3d7d9a | |
| parent | 973f318514cec40bd388f9e6f1acacc9e2bed436 (diff) | |
| download | rust-c3d3a3f30164644d64c09812c863415f28604e80.tar.gz rust-c3d3a3f30164644d64c09812c863415f28604e80.zip | |
remove unnecessary const error handling in `missing_const_for_fn`
| -rw-r--r-- | clippy_lints/src/missing_const_for_fn.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/clippy_lints/src/missing_const_for_fn.rs b/clippy_lints/src/missing_const_for_fn.rs index fe636f27a0f..4592324809f 100644 --- a/clippy_lints/src/missing_const_for_fn.rs +++ b/clippy_lints/src/missing_const_for_fn.rs @@ -147,11 +147,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingConstForFn { let mir = cx.tcx.optimized_mir(def_id); - if let Err((span, err)) = is_min_const_fn(cx.tcx, mir, &self.msrv) { - if cx.tcx.is_const_fn_raw(def_id.to_def_id()) { - cx.tcx.dcx().span_err(span, err); - } - } else { + if let Ok(()) = is_min_const_fn(cx.tcx, mir, &self.msrv) { span_lint(cx, MISSING_CONST_FOR_FN, span, "this could be a `const fn`"); } } |
