diff --git a/typecheck/src/widen.rs b/typecheck/src/widen.rs index f5199c78..6ed689a9 100644 --- a/typecheck/src/widen.rs +++ b/typecheck/src/widen.rs @@ -32,8 +32,7 @@ fn widen_inner( } } -pub fn widen(fir: &Fir>, mut type_ctx: TypeCtx) -> TypeCtx { - let primitives = core::mem::take(&mut type_ctx.primitives); +pub fn widen(fir: &Fir>, type_ctx: TypeCtx) -> TypeCtx { let types = type_ctx .types .types @@ -49,5 +48,8 @@ pub fn widen(fir: &Fir>, mut type_ctx: TypeCtx) -> Type tymap }); - TypeCtx { primitives, types } + TypeCtx { + primitives: type_ctx.primitives, + types, + } }