diff --git a/src/term/transform/linearize_vars.rs b/src/term/transform/linearize_vars.rs index ad7591c02..b82ef717b 100644 --- a/src/term/transform/linearize_vars.rs +++ b/src/term/transform/linearize_vars.rs @@ -90,8 +90,8 @@ fn term_to_affine(term: &mut Term, inst_count: &mut HashMap) { term_to_affine(val, inst_count); } else { let Term::Let { nxt, .. } = term else { unreachable!() }; - let nxt = std::mem::take(nxt); - *term = *nxt; + let nxt = std::mem::take(nxt.as_mut()); + *term = nxt; } }