bevy/crates
Chris Russell 4362b52a01
Add a note to the on_unimplemented message for QueryData recommending &T and &mut T. (#16449)
# Objective

A new user is likely to try `Query<Component>` instead of
`Query<&Component>`. The error message should guide them to the right
solution.

## Solution

Add a note to the on_unimplemented message for `QueryData` recommending
`&T` and `&mut T`.

The full error message now looks like: 

```
error[E0277]: `A` is not valid to request as data in a `Query`
   --> crates\bevy_ecs\src\query\world_query.rs:260:18
    |
260 | fn system(query: Query<A>) {}
    |                  ^^^^^^^^ invalid `Query` data
    |
    = help: the trait `fetch::QueryData` is not implemented for `A`
    = note: if `A` is a component type, try using `&A` or `&mut A`
    = help: the following other types implement trait `fetch::QueryData`:
              &'__w mut T
              &Archetype
              &T
              ()
              (F,)
              (F0, F1)
              (F0, F1, F2)
              (F0, F1, F2, F3)
            and 41 others
note: required by a bound in `system::query::Query`
   --> crates\bevy_ecs\src\system\query.rs:362:37
    |
362 | pub struct Query<'world, 'state, D: QueryData, F: QueryFilter = ()> {
    |                                     ^^^^^^^^^ required by this bound in `Query`
```
2024-11-21 03:52:10 +00:00
..
bevy_a11y Remove accesskit re-export from bevy_a11y (#16257) 2024-11-08 21:01:16 +00:00
bevy_animation Use normal constructors for EasingCurve, FunctionCurve, ConstantCurve (#16367) 2024-11-13 15:30:05 +00:00
bevy_app Improve SubApp documentation example (#16160) 2024-10-30 22:12:25 +00:00
bevy_asset Support creating asset directories (#16220) 2024-11-04 22:06:00 +00:00
bevy_audio AudioPlayer::new() (#16287) 2024-11-08 01:51:50 +00:00
bevy_color Fix MSRVs for standalone crates (#16333) 2024-11-17 09:38:13 +00:00
bevy_core Support on_thread_spawn and on_thread_destroy for TaskPoolPlugin (#13045) 2024-11-11 20:00:01 +00:00
bevy_core_pipeline Fix missing import (#16337) 2024-11-11 18:48:41 +00:00
bevy_derive move ANDROID_APP to bevy_window (#15585) 2024-10-02 03:01:06 +00:00
bevy_dev_tools Headless by features (#16401) 2024-11-16 21:33:37 +00:00
bevy_diagnostic Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_dylib Generate links to definition in source code pages on docs.rs and dev-docs.bevyengine.org (#12965) 2024-07-29 23:10:16 +00:00
bevy_ecs Add a note to the on_unimplemented message for QueryData recommending &T and &mut T. (#16449) 2024-11-21 03:52:10 +00:00
bevy_encase_derive Update `glam to 0.29, encase` to 0.10. (#15249) 2024-09-23 19:44:02 +00:00
bevy_gilrs Use Name component for gamepad (#16233) 2024-11-05 00:30:48 +00:00
bevy_gizmos Use normal constructors for EasingCurve, FunctionCurve, ConstantCurve (#16367) 2024-11-13 15:30:05 +00:00
bevy_gltf Use normal constructors for EasingCurve, FunctionCurve, ConstantCurve (#16367) 2024-11-13 15:30:05 +00:00
bevy_hierarchy Fix bevy_hierarchy failing to compile without reflect feature (#16428) 2024-11-19 01:28:42 +00:00
bevy_image Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
bevy_input Revert most of #16222 and add gamepad accessors (#16425) 2024-11-19 00:00:16 +00:00
bevy_internal Fix detailed_trace! (#16452) 2024-11-20 22:01:33 +00:00
bevy_log Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_macro_utils Modify derive_label to support no_std environments (#15465) 2024-09-27 20:23:26 +00:00
bevy_math Fix MSRVs for standalone crates (#16333) 2024-11-17 09:38:13 +00:00
bevy_mesh Upgrade to wgpu 23 (#15988) 2024-11-05 21:18:48 +00:00
bevy_mikktspace Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_pbr Fix meshlet private item regression (#16404) 2024-11-16 22:06:26 +00:00
bevy_picking Picking out order (#16231) 2024-11-15 15:39:02 +00:00
bevy_ptr Fix MSRVs for standalone crates (#16333) 2024-11-17 09:38:13 +00:00
bevy_reflect bevy_reflect: Add ReflectSerializerProcessor (#15548) 2024-11-17 14:05:39 +00:00
bevy_remote Expose BRP system scheduling and add system set (#16400) 2024-11-16 23:34:06 +00:00
bevy_render Fix detailed_trace! (#16452) 2024-11-20 22:01:33 +00:00
bevy_scene fix: add reflect to SceneInstanceReady and other observers/events (#16018) 2024-10-20 13:51:41 +00:00
bevy_sprite Fix sprite picking backend not considering the viewport of the camera. (#16386) 2024-11-14 13:04:52 +00:00
bevy_state Fix typo in bevy_ecs (#16195) 2024-10-31 19:20:01 +00:00
bevy_tasks Support on_thread_spawn and on_thread_destroy for TaskPoolPlugin (#13045) 2024-11-11 20:00:01 +00:00
bevy_text Adds some helpful methods to TextFont (#16370) 2024-11-19 01:30:39 +00:00
bevy_time Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
bevy_transform Improved the global transform api to access rotation and scale (#16211) 2024-11-04 15:35:16 +00:00
bevy_ui Rename box shadow rendering variable names (#16393) 2024-11-19 01:28:34 +00:00
bevy_utils Fix detailed_trace! (#16452) 2024-11-20 22:01:33 +00:00
bevy_window Support prefers_home_indicator_hidden (#16005) 2024-10-31 16:09:30 +00:00
bevy_winit Handle failed cursor grab mode changes so that the cursor grab mode change can be attempted again (#16293) 2024-11-09 23:30:57 +00:00