diff --git a/crates/generate/src/prepare_grammar/process_inlines.rs b/crates/generate/src/prepare_grammar/process_inlines.rs index d4b7dc18..460d2359 100644 --- a/crates/generate/src/prepare_grammar/process_inlines.rs +++ b/crates/generate/src/prepare_grammar/process_inlines.rs @@ -70,12 +70,13 @@ impl InlinedProductionMapBuilder { let production_map = production_indices_by_step_id .into_iter() .map(|(step_id, production_indices)| { - let production = step_id.variable_index.map_or_else( - || &productions[step_id.production_index], - |variable_index| { - &grammar.variables[variable_index].productions[step_id.production_index] - }, - ) as *const Production; + let production = + core::ptr::from_ref::(step_id.variable_index.map_or_else( + || &productions[step_id.production_index], + |variable_index| { + &grammar.variables[variable_index].productions[step_id.production_index] + }, + )); ((production, step_id.step_index as u32), production_indices) }) .collect();