File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
crates/bevy_ecs/src/storage Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -472,7 +472,7 @@ mod tests {
472
472
use crate :: { component:: Component , ptr:: OwningPtr , world:: World } ;
473
473
474
474
use super :: BlobVec ;
475
- use std:: { alloc:: Layout , cell:: RefCell , rc:: Rc } ;
475
+ use std:: { alloc:: Layout , cell:: RefCell , mem , rc:: Rc } ;
476
476
477
477
// SAFETY: The pointer points to a valid value of type `T` and it is safe to drop this value.
478
478
unsafe fn drop_ptr < T > ( x : OwningPtr < ' _ > ) {
@@ -626,7 +626,9 @@ mod tests {
626
626
let mut count = 0 ;
627
627
628
628
let mut q = world. query :: < & Zst > ( ) ;
629
- for & Zst in q. iter ( & world) {
629
+ for zst in q. iter ( & world) {
630
+ // Ensure that the references returned are properly aligned.
631
+ assert_eq ! ( zst as * const Zst as usize % mem:: align_of:: <Zst >( ) , 0 ) ;
630
632
count += 1 ;
631
633
}
632
634
You can’t perform that action at this time.
0 commit comments