Skip to content

WorldQuery macro hygiene is poor #6593

@bzm3r

Description

@bzm3r

Bevy version

0.9

What you did

Trying to derive WorldQuery on something.

What went wrong

Got the following error:

error[E0412]: cannot find type `Entity` in this scope
  --> src\ability_state.rs:24:10
   |
24 | #[derive(WorldQuery)]
   |          ^^^^^^^^^^ not found in this scope
   |
   = note: this error originates in the derive macro `WorldQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider importing one of these items
   |
4  | use bevy::ecs::entity::Entity;
   |
4  | use crate::Entity;
   |

Additional information

Importing Entity, using use bevy::ecs::entity:Entity allows the macro to see it, but this is a hygiene issue because the macro should use fully qualified paths to Entity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions