mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-17 01:05:02 +00:00
Fix lifetime errors due to interner
In the llvm backend, there are the lifetimes `'a` (lifetime of the global arena) and `'ctx` (lifetime of constructed LLVM values). `'a` lives longer than `'ctx`, but the compiler didn't enforce this until the layout interner was introduced, for some reason. We have to make sure that containers of lifetime `'a` have no `'ctx` references.
This commit is contained in:
parent
512a1721ae
commit
759f8d86af
6 changed files with 54 additions and 55 deletions
|
@ -134,15 +134,15 @@ fn bytes_as_ascii(bytes: &[u8]) -> String {
|
|||
buf
|
||||
}
|
||||
|
||||
pub fn spec_program<'a, I>(
|
||||
pub fn spec_program<'a, 'r, I>(
|
||||
arena: &'a Bump,
|
||||
interner: &mut STLayoutInterner<'a>,
|
||||
interner: &'r mut STLayoutInterner<'a>,
|
||||
opt_level: OptLevel,
|
||||
entry_point: roc_mono::ir::EntryPoint<'a>,
|
||||
procs: I,
|
||||
) -> Result<morphic_lib::Solutions>
|
||||
where
|
||||
I: Iterator<Item = &'a Proc<'a>>,
|
||||
I: Iterator<Item = &'r Proc<'a>>,
|
||||
{
|
||||
let main_module = {
|
||||
let mut m = ModDefBuilder::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue