Skip to content

Commit

Permalink
Rust: Attempt to fix the stack overflow when constructing the item array
Browse files Browse the repository at this point in the history
Workaround from rust-lang/rust#53827
  • Loading branch information
ogoffart committed Jun 17, 2024
1 parent ecd790f commit 62e0fdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/compiler/generator/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ fn generate_item_tree(
static ITEM_ARRAY : sp::OnceBox<
[sp::VOffset<#inner_component_id, sp::ItemVTable, sp::AllowPin>; #item_array_len]
> = sp::OnceBox::new();
&*ITEM_ARRAY.get_or_init(|| sp::Box::new([#(#item_array),*]))
&*ITEM_ARRAY.get_or_init(|| sp::vec![#(#item_array),*].into_boxed_slice().try_into().unwrap())
}
}

Expand Down

0 comments on commit 62e0fdd

Please sign in to comment.