From 3e358805136950b039364e6e589aa825034bec16 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Fri, 28 Jan 2022 13:05:06 +0000 Subject: [PATCH] repl: fix lifetime problem with app_memory in Env --- cli/src/repl/eval.rs | 4 ++-- cli/src/repl/gen.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/src/repl/eval.rs b/cli/src/repl/eval.rs index 85f2bd6879..66381c7cc9 100644 --- a/cli/src/repl/eval.rs +++ b/cli/src/repl/eval.rs @@ -22,7 +22,7 @@ use super::from_memory::AppMemory; struct Env<'a, 'env, M> { arena: &'a Bump, subs: &'env Subs, - app_memory: M, + app_memory: &'a M, target_info: TargetInfo, interns: &'env Interns, home: ModuleId, @@ -51,7 +51,7 @@ pub unsafe fn jit_to_ast<'a, M: AppMemory>( home: ModuleId, subs: &'a Subs, target_info: TargetInfo, - app_memory: M, + app_memory: &'a M, ) -> Result, ToAstProblem> { let env = Env { arena, diff --git a/cli/src/repl/gen.rs b/cli/src/repl/gen.rs index 2ad4075baa..f2f18878fb 100644 --- a/cli/src/repl/gen.rs +++ b/cli/src/repl/gen.rs @@ -239,7 +239,7 @@ pub fn gen_and_eval<'a>( home, &subs, target_info, - AppMemoryInternal, + &AppMemoryInternal, ) }; let mut expr = roc_fmt::Buf::new_in(&arena);