Skip to content

Creating a bundle complains about mem::forget #4601

@SUPERCILEX

Description

@SUPERCILEX

Bevy version

0.7.0

What you did

#[derive(Component, Default)]
pub struct NominoMarker;

#[derive(Component, Deref)]
pub struct BoundingBoxes(&'static [Rect<f32>]);

#[derive(Bundle)]
pub struct NominoBundle {
    #[bundle]
    shape: bevy_prototype_lyon::entity::ShapeBundle,
    bounding_boxes: BoundingBoxes,
    _marker: NominoMarker,
}

What you expected to happen

No warnings

What actually happened

warning: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
   --> src/nominos.rs:106:10
    |
106 | #[derive(Bundle)]
    |          ^^^^^^
    |
    = note: `#[warn(clippy::forget_non_drop)]` on by default
note: argument has type `nominos::BoundingBoxes`
   --> src/nominos.rs:106:10
    |
106 | #[derive(Bundle)]
    |          ^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop
    = note: this warning originates in the derive macro `Bundle` (in Nightly builds, run with -Z macro-backtrace for more info)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions