diff --git a/fiat-constify/src/main.rs b/fiat-constify/src/main.rs index d65fadb4..8f9c36d3 100644 --- a/fiat-constify/src/main.rs +++ b/fiat-constify/src/main.rs @@ -199,6 +199,21 @@ fn rewrite_fn_body(stmts: &[Stmt], outputs: &Outputs) -> Vec { } } else if let Stmt::Expr(Expr::Call(expr), Some(_)) = stmt { rewritten.push(Stmt::Local(rewrite_fn_call(expr.clone()))); + } else if let Stmt::Local(Local { + pat: Pat::Type(pat), + .. + }) = stmt + { + let unboxed = pat.pat.as_ref(); + if let Pat::Ident(PatIdent { + mutability: Some(_), + .. + }) = unboxed + { + // This is a mut var, in the case of fiat-crypto transformation dead code + } else { + rewritten.push(stmt.clone()); + } } else { rewritten.push(stmt.clone()); }