Change item indices from usize to u32

So that the compiler and run-time can never disagree on the
number of bytes the item index can use.
This commit is contained in:
Simon Hausmann 2023-09-11 17:49:40 +02:00 committed by Simon Hausmann
parent e01e9685be
commit 3652f58a3f
24 changed files with 216 additions and 204 deletions

View file

@ -603,9 +603,9 @@ pub struct Element {
/// This is the component-local index of this item in the item tree array.
/// It is generated after the last pass and before the generators run.
pub item_index: once_cell::unsync::OnceCell<usize>,
pub item_index: once_cell::unsync::OnceCell<u32>,
/// the index of the first children in the tree, set with item_index
pub item_index_of_first_children: once_cell::unsync::OnceCell<usize>,
pub item_index_of_first_children: once_cell::unsync::OnceCell<u32>,
/// True when this element is in a component was declared with the `:=` symbol instead of the `component` keyword
pub is_legacy_syntax: bool,