bevy/crates
Chris Russell 85448b767e
Make DebugName work when building with no default features (#19824)
# Objective

Let `bevy_utils` build with no default features.  

`cargo build -p bevy_utils --no-default-features` currently fails with 

```
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `alloc`
 --> crates\bevy_utils\src\debug_info.rs:1:5
  |
1 | use alloc::{borrow::Cow, fmt, string::String};
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  |
  = help: add `extern crate alloc` to use the `alloc` crate

error[E0432]: unresolved import `alloc`
 --> crates\bevy_utils\src\debug_info.rs:1:5
  |
1 | use alloc::{borrow::Cow, fmt, string::String};
  |     ^^^^^ help: a similar path exists: `core::alloc`
```

I would have expected CI to catch this earlier, but I have not
investigated why it did not.

## Solution

Wrap the parts of `DebugName` that use `Cow` and `String` in
`cfg::alloc!`.

If the `debug` feature is enabled, then `DebugName` itself stores a
`Cow`, so make the `debug` feature require `bevy_platform/alloc`.

That is, you can use `DebugName` in no-std contexts when it's just a
ZST! (I bet it's even possible to support no-std `debug` by storing
`&'static str` instead of `Cow<'static, str>`, but that seemed like too
much complexity for now.)
2025-06-29 02:45:41 +00:00
..
bevy_a11y Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_animation Update derive_more requirement from 1 to 2 (#19671) 2025-06-24 11:13:04 +00:00
bevy_anti_aliasing Add UVec to_extents helper method (#19807) 2025-06-26 20:53:49 +00:00
bevy_app Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_asset Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_audio Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_color Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
bevy_core_pipeline Resolution override (#19817) 2025-06-27 16:30:54 +00:00
bevy_core_widgets Bevy Feathers: an opinionated widget toolkit for building Bevy tooling (#19730) 2025-06-28 19:52:13 +00:00
bevy_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_dev_tools Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_diagnostic updating: very very minorly (#19827) 2025-06-26 21:48:20 +00:00
bevy_dylib Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_ecs Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_encase_derive Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_feathers Bevy Feathers: an opinionated widget toolkit for building Bevy tooling (#19730) 2025-06-28 19:52:13 +00:00
bevy_gilrs Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_gizmos Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
bevy_gltf Nudge users into migrating to new default glTF coordinate conversion (#19816) 2025-06-28 18:35:41 +00:00
bevy_image use wgpu TextureDataOrder (#19829) 2025-06-27 06:57:29 +00:00
bevy_input Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_input_focus Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_internal Bevy Feathers: an opinionated widget toolkit for building Bevy tooling (#19730) 2025-06-28 19:52:13 +00:00
bevy_log Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_macro_utils Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_math Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_mesh Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
bevy_mikktspace Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_pbr Meshlet BVH Culling (#19318) 2025-06-29 00:04:21 +00:00
bevy_picking Upstream raycasting UVs (#19791) 2025-06-24 18:10:59 +00:00
bevy_platform Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_ptr Add newlines before impl blocks (#19746) 2025-06-22 23:07:02 +00:00
bevy_reflect Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00
bevy_remote Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_render Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
bevy_scene Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_solari Add UVec to_extents helper method (#19807) 2025-06-26 20:53:49 +00:00
bevy_sprite Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
bevy_state Upgrade to Rust 1.88 (#19825) 2025-06-26 19:38:19 +00:00
bevy_tasks Update derive_more requirement from 1 to 2 (#19671) 2025-06-24 11:13:04 +00:00
bevy_text Bevy Feathers: an opinionated widget toolkit for building Bevy tooling (#19730) 2025-06-28 19:52:13 +00:00
bevy_time Bump Version after Release (#19774) 2025-06-22 23:06:43 +00:00
bevy_transform Update derive_more requirement from 1 to 2 (#19671) 2025-06-24 11:13:04 +00:00
bevy_ui Type erased materials (#19667) 2025-06-27 22:57:24 +00:00
bevy_utils Make DebugName work when building with no default features (#19824) 2025-06-29 02:45:41 +00:00
bevy_window Doc for X11 CursorGrabMode support (#19811) 2025-06-28 18:54:21 +00:00
bevy_winit Ugrade to wgpu version 25.0 (#19563) 2025-06-26 19:41:47 +00:00