Skip to content

Commit 7055c9e

Browse files
committed
Fix unintended drop on panic in tuple Bundle get_components()
1 parent 49b4071 commit 7055c9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_ecs/src/bundle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ macro_rules! tuple_impl {
109109
#[allow(non_snake_case)]
110110
let ($(mut $name,)*) = self;
111111
$(
112-
func((&mut $name as *mut $name).cast::<u8>());
113-
std::mem::forget($name);
112+
let mut value = ::std::mem::ManuallyDrop::new($name);
113+
func((&mut *value as *mut $name).cast::<u8>());
114114
)*
115115
}
116116
}

0 commit comments

Comments
 (0)