Skip to content

Commit f0fcd2d

Browse files
committed
Solve clippy::forget-non-drop lint error
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 issue was reported to Bevy team here bevyengine/bevy#5166.
1 parent 62228c7 commit f0fcd2d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

crates/spawner/src/draft.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::forget_non_drop)] // Needed because of #[derive(Bundle)]
2+
13
//! This module implements a Bevy plugin for drafting new objects on the map.
24
//! An entity marked with a component [`Draft`] is automatically handled and
35
//! visualized by the plugin.

crates/spawner/src/spawner.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::forget_non_drop)] // Needed because of #[derive(Bundle)]
2+
13
use bevy::prelude::*;
24
use de_core::{
35
gconfig::GameConfig,

0 commit comments

Comments
 (0)