bevy/crates
SpecificProtagonist a7051a4815
Diagnostics for label traits (#17441)
# Objective

Diagnostics for labels don't suggest how to best implement them.
```
error[E0277]: the trait bound `Label: ScheduleLabel` is not satisfied
   --> src/main.rs:15:35
    |
15  |     let mut sched = Schedule::new(Label);
    |                     ------------- ^^^^^ the trait `ScheduleLabel` is not implemented for `Label`
    |                     |
    |                     required by a bound introduced by this call
    |
    = help: the trait `ScheduleLabel` is implemented for `Interned<(dyn ScheduleLabel + 'static)>`
note: required by a bound in `bevy_ecs::schedule::Schedule::new`
   --> /home/vj/workspace/rust/bevy/crates/bevy_ecs/src/schedule/schedule.rs:297:28
    |
297 |     pub fn new(label: impl ScheduleLabel) -> Self {
    |                            ^^^^^^^^^^^^^ required by this bound in `Schedule::new`
```

## Solution

`diagnostics::on_unimplemented` and `diagnostics::do_not_recommend`

## Showcase

New error message:
```
error[E0277]: the trait bound `Label: ScheduleLabel` is not satisfied
   --> src/main.rs:15:35
    |
15  |     let mut sched = Schedule::new(Label);
    |                     ------------- ^^^^^ the trait `ScheduleLabel` is not implemented for `Label`
    |                     |
    |                     required by a bound introduced by this call
    |
    = note: consider annotating `Label` with `#[derive(ScheduleLabel)]`
note: required by a bound in `bevy_ecs::schedule::Schedule::new`
   --> /home/vj/workspace/rust/bevy/crates/bevy_ecs/src/schedule/schedule.rs:297:28
    |
297 |     pub fn new(label: impl ScheduleLabel) -> Self {
    |                            ^^^^^^^^^^^^^ required by this bound in `Schedule::new`
```
2025-01-20 21:51:26 +00:00
..
bevy_a11y Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_animation Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
bevy_app Diagnostics for label traits (#17441) 2025-01-20 21:51:26 +00:00
bevy_asset Switch bevy_asset to core::prelude (#17442) 2025-01-20 04:14:48 +00:00
bevy_audio Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
bevy_color Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_core_pipeline Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
bevy_derive Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_dev_tools Rename TargetCamera to UiTargetCamera (#17403) 2025-01-19 19:56:57 +00:00
bevy_diagnostic Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_dylib Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_ecs Diagnostics for label traits (#17441) 2025-01-20 21:51:26 +00:00
bevy_encase_derive Bump Version after Release (#17176) 2025-01-06 00:04:44 +00:00
bevy_gilrs Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
bevy_gizmos Reworked Segment types into their cartesian forms (#17404) 2025-01-19 03:54:45 +00:00
bevy_gltf Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
bevy_image Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_input Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_input_focus Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
bevy_internal Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_log Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_macro_utils Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_math Reworked Segment types into their cartesian forms (#17404) 2025-01-19 03:54:45 +00:00
bevy_mesh Expose a few primitive builders, which seemed to be missed? (#17454) 2025-01-20 21:29:38 +00:00
bevy_mikktspace Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_pbr Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
bevy_picking Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_platform_support Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_ptr Update safety docs for Ptr::assert_unique (#17394) 2025-01-16 03:25:19 +00:00
bevy_reflect Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_remote Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
bevy_render Diagnostics for label traits (#17441) 2025-01-20 21:51:26 +00:00
bevy_scene Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
bevy_sprite Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_state Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_tasks Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_text Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
bevy_time Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_transform Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
bevy_ui Fixing ui antialiasing clamp call parameters order (#14970) (#17456) 2025-01-20 21:31:20 +00:00
bevy_utils Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
bevy_window Move #![warn(clippy::allow_attributes, clippy::allow_attributes_without_reason)] to the workspace Cargo.toml (#17374) 2025-01-15 01:14:58 +00:00
bevy_winit Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00