Skip to content

Commit c0068ba

Browse files
committed
manual_slice_size_calculation: Delay constant check.
1 parent 0311702 commit c0068ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/manual_slice_size_calculation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ declare_lint_pass!(ManualSliceSizeCalculation => [MANUAL_SLICE_SIZE_CALCULATION]
4040

4141
impl<'tcx> LateLintPass<'tcx> for ManualSliceSizeCalculation {
4242
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
43-
// Does not apply inside const because size_of_val is not cost in stable.
44-
if !in_constant(cx, expr.hir_id)
45-
&& let ExprKind::Binary(ref op, left, right) = expr.kind
43+
if let ExprKind::Binary(ref op, left, right) = expr.kind
4644
&& BinOpKind::Mul == op.node
4745
&& !expr.span.from_expansion()
46+
// Does not apply inside const because size_of_val is not cost in stable.
47+
&& !in_constant(cx, expr.hir_id)
4848
&& let Some(receiver) = simplify(cx, left, right)
4949
{
5050
let ctxt = expr.span.ctxt();

0 commit comments

Comments
 (0)