Skip to content

WorldQuery generates structs with public fields without documentation, breaking builds with #![deny(missing_docs)] #8333

@vladbat00

Description

@vladbat00

Bevy version

0.10.1

What you did

I tried to compile bevy_egui with Bevy 0.10.1 version, which has the following code triggering the issue:

https://github.com/mvlabat/bevy_egui/blob/main/src/lib.rs#L610-L628

/// Queries all the Egui related components.
#[derive(WorldQuery)]
#[world_query(mutable)]
pub struct EguiContextQuery {
    /// Window entity.
    pub window_entity: Entity,
    /// Egui context associated with the window.
    pub ctx: &'static mut EguiContext,
    /// Encapsulates [`egui::RawInput`].
    pub egui_input: &'static mut EguiInput,
    /// Egui shapes and textures delta.
    pub render_output: &'static mut EguiRenderOutput,
    /// Encapsulates [`egui::PlatformOutput`].
    pub egui_output: &'static mut EguiOutput,
    /// Stores physical size of the window and its scale factor.
    pub window_size: &'static mut WindowSize,
    /// [`Window`] component.
    pub window: &'static mut Window,
}

What went wrong

The build failed with the following error (as there's crate level #![deny(missing_docs)]):

error: missing documentation for a struct field
Error:    --> src/lib.rs:611:10
    |
611 | #[derive(WorldQuery)]
    |          ^^^^^^^^^^
    |
    = note: `-D missing-docs` implied by `-D warnings`
    = note: this error originates in the derive macro `WorldQuery` (in Nightly builds, run with -Z macro-backtrace for more info)

Additional information

It seems that this regression was introduced specifically in 0.10.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-BugAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationD-TrivialNice and easy! A great choice to get started with BevyP-RegressionFunctionality that used to work but no longer does. Add a test for this!

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions