mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
cd497152bb
# Objective - `bevy_ui` does not build without the `bevy_text` feature due to improper feature gating. - Specifically, `MeasureArgs<'a>` had an unused lifetime `'a` without `bevy_text` enabled. This is because it stores a reference to a `cosmic_text::FontSystem`. - This was caught by `flag-frenzy` in [this run](https://github.com/TheBevyFlock/flag-frenzy/actions/runs/10024258523/job/27706132250). ## Solution - Add a `PhantomData` to `MeasureArgs<'a>` in order to maintain its lifetime argument. - I also named it `font_system`, after the feature-gated argument that actually needs a lifetime, for usability. Please comment if you have a better solution! - Move some unused imports to be behind the `bevy_text` feature gate. ## Testing ```bash # Fails on main. cargo check -p bevy_ui --no-default-features # Succeeds on main. cargo check -p bevy_ui --no-default-features -F bevy_text ``` --- ## Migration Guide **This is not a breaking change for users migrating from 0.14, since `MeasureArgs` did not exist then.** When the `bevy_text` feature is disabled for `bevy_ui`, the type of the `MeasureArgs::font_system` field is now a `PhantomData` instead of being removed entirely. This is in order to keep the lifetime parameter, even though it is unused without text being enabled. |
||
---|---|---|
.. | ||
bevy_a11y | ||
bevy_animation | ||
bevy_app | ||
bevy_asset | ||
bevy_audio | ||
bevy_color | ||
bevy_core | ||
bevy_core_pipeline | ||
bevy_derive | ||
bevy_dev_tools | ||
bevy_diagnostic | ||
bevy_dylib | ||
bevy_dynamic_plugin | ||
bevy_ecs | ||
bevy_encase_derive | ||
bevy_gilrs | ||
bevy_gizmos | ||
bevy_gltf | ||
bevy_hierarchy | ||
bevy_input | ||
bevy_internal | ||
bevy_log | ||
bevy_macro_utils | ||
bevy_math | ||
bevy_mikktspace | ||
bevy_pbr | ||
bevy_picking | ||
bevy_ptr | ||
bevy_reflect | ||
bevy_render | ||
bevy_scene | ||
bevy_sprite | ||
bevy_state | ||
bevy_tasks | ||
bevy_text | ||
bevy_time | ||
bevy_transform | ||
bevy_ui | ||
bevy_utils | ||
bevy_window | ||
bevy_winit |