bevy/crates/bevy_render/src
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
..
batching Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
camera Use multi_draw_indirect_count where available, in preparation for two-phase occlusion culling. (#17211) 2025-01-14 21:19:20 +00:00
diagnostic Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
mesh Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
primitives Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
render_graph Diagnostics for label traits (#17441) 2025-01-20 21:51:26 +00:00
render_phase Use multi_draw_indirect_count where available, in preparation for two-phase occlusion culling. (#17211) 2025-01-14 21:19:20 +00:00
render_resource Fix some punctuation (#17368) 2025-01-14 21:51:12 +00:00
renderer Create bevy_platform_support Crate (#17250) 2025-01-20 20:45:30 +00:00
texture Change GpuImage::size from UVec2 to Extent3d (#16815) 2024-12-17 19:08:09 +00:00
view Support non-Vec data structures in relations (#17447) 2025-01-20 21:26:08 +00:00
alpha.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
color_operations.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
extract_component.rs Remove ExtractComponent::Out (#15926) 2024-10-15 23:42:35 +00:00
extract_instances.rs Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
extract_param.rs Implement WorldQuery for MainWorld and RenderWorld components (#15745) 2024-10-13 20:58:46 +00:00
extract_resource.rs Fix "Unrecognized Option" error when using Criterion-specific arguments in benchmarks (#17222) 2025-01-08 00:09:31 +00:00
globals.rs Remove bevy_core (#16897) 2024-12-19 18:36:51 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
gpu_readback.rs Remove tracing re-export from bevy_utils (#17161) 2025-01-05 23:06:34 +00:00
lib.rs Relationships (non-fragmenting, one-to-many) (#17398) 2025-01-18 22:20:30 +00:00
maths.wgsl Forward decals (port of bevy_contact_projective_decals) (#16600) 2025-01-15 02:31:30 +00:00
pipelined_rendering.rs Remove tracing re-export from bevy_utils (#17161) 2025-01-05 23:06:34 +00:00
render_asset.rs bevy_render: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17194) 2025-01-06 23:10:58 +00:00
settings.rs bevy_render: Apply #![deny(clippy::allow_attributes, clippy::allow_attributes_without_reason)] (#17194) 2025-01-06 23:10:58 +00:00
storage.rs Add a bindless mode to AsBindGroup. (#16368) 2024-12-03 18:00:34 +00:00
sync_component.rs Synchronize removed components with the render world (#15582) 2024-10-08 22:23:17 +00:00
sync_world.rs impl EntityBorrow for more types (#16917) 2024-12-24 02:47:03 +00:00