Skip to content

Commit c3d3a3f

Browse files
committed
remove unnecessary const error handling in missing_const_for_fn
1 parent 973f318 commit c3d3a3f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clippy_lints/src/missing_const_for_fn.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingConstForFn {
147147

148148
let mir = cx.tcx.optimized_mir(def_id);
149149

150-
if let Err((span, err)) = is_min_const_fn(cx.tcx, mir, &self.msrv) {
151-
if cx.tcx.is_const_fn_raw(def_id.to_def_id()) {
152-
cx.tcx.dcx().span_err(span, err);
153-
}
154-
} else {
150+
if let Ok(()) = is_min_const_fn(cx.tcx, mir, &self.msrv) {
155151
span_lint(cx, MISSING_CONST_FOR_FN, span, "this could be a `const fn`");
156152
}
157153
}

0 commit comments

Comments
 (0)