-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a bundle complains about mem::forget #4601
Comments
Are you on Rust nightly? Can you reproduce this with a simpler bundle? |
Yeah: #[derive(Component, Default)]
pub struct NominoMarker;
#[derive(Bundle)]
pub struct TestBundle {
_marker: NominoMarker,
} |
The A temporary workaround is just to allow that lint for your entire crate. |
Running into this on nightly too for my own projects, which breaks my clippy-checking CI. For those looking for a workaround, add |
We started to get a Clippy error in CI: error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it --> crates/spawner/src/spawner.rs:19:10 | 19 | #[derive(Bundle)] | ^^^^^^ | = note: `-D clippy::forget-non-drop` implied by `-D warnings` note: argument has type `spawner::Spawn` --> crates/spawner/src/spawner.rs:19:10 | 19 | #[derive(Bundle)] | ^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#forget_non_drop = note: this error originates in the derive macro `Bundle` (in Nightly builds, run with -Z macro-backtrace for more info) The failing lint was recently added in rust-lang/rust-clippy#8630. Unfortunately, it is not possible to disable linting of code generated by external macros rust-lang/rust-clippy#407. The issues on Bevy site is tracked here bevyengine/bevy#4601
This problem seems to be fixed in This code generates a warning when running use bevy::prelude::*;
#[derive(Bundle)]
pub struct Foo {
bar: Bar,
}
#[derive(Component)]
struct Bar;
fn main() {} |
Bevy version
0.7.0
What you did
What you expected to happen
No warnings
What actually happened
The text was updated successfully, but these errors were encountered: