9 unstable releases (4 breaking)

0.5.2 Mar 7, 2023
0.4.0 Nov 13, 2022
0.3.0 Apr 15, 2022
0.2.0 Jan 19, 2022
0.1.1 Apr 9, 2021

#628 in Procedural macros

Download history 1/week @ 2023-12-04 9/week @ 2023-12-11 10/week @ 2023-12-18 2/week @ 2023-12-25 7/week @ 2024-01-01 8/week @ 2024-01-08 3/week @ 2024-01-29 3/week @ 2024-02-05 4/week @ 2024-02-12 33/week @ 2024-02-19 28/week @ 2024-02-26 22/week @ 2024-03-04 25/week @ 2024-03-11 25/week @ 2024-03-18

100 downloads per month

MIT license

19KB

bevycheck

Bevycheck helps debug bevy errors by adding procedural macros which aid the compiler in emitting better compilation errors.

If you get an error like the trait `IntoSystem<(), (), _>` is not implemented for fn item `for<'a> fn(bevy::prelude::ResMut<'a, [type error]>) {system}, simply add #[bevycheck::system] to your function, and a more helpful error messages should appear:

#[bevycheck::system]
fn system(commands: &mut Commands, query: Query<(Entity, &GlobalTransform)>) {
    // ...
}

How does it work?

It works by replacing

fn system(commands: &mut Commands, query: Query<(Entity, &GlobalTransform)>) {
  // ...
}

with

fn system() {
  assert_is_system_param::<&mut Commands>();
  assert_is_system_param::<Query<(Entity, &GlobalTransform)>>();
  panic!("remove bevycheck before running");
}

That way, without parameters the system is a valid system and the add_system call doesn't error anymore, and by asserting that each specific parameter must be a valid system param, rust can figure out which one's the culprit and print a more directed error message.

Bevy support table

bevy bevycheck
0.10 0.5
0.9 0.4
0.7 0.3
0.6 0.2
0.5 0.1

Dependencies

~1.5MB
~34K SLoC