Skip to content

Commit 00f5b6a

Browse files
WaffleLapkinmockersf
authored andcommitted
Don't use [!Default; 0]: Default impl (#21660)
# Objective - See rust-lang/rust#145457, we want to remove unconditional `[T; 0]: Default` impl. That would be a breaking change breaking `bevy_ecs` and (a test of) `bevy_camera`. ## Solution - Replace `<[T; 0]>::default()` calls with `[]` ## Testing - It compiles, the `<[T; 0]>::default()` is equivalent to `[]`, no additional testing required
1 parent 09995e3 commit 00f5b6a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

crates/bevy_camera/src/primitives.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ mod tests {
631631

632632
#[test]
633633
fn aabb_enclosing() {
634-
assert_eq!(Aabb::enclosing(<[Vec3; 0]>::default()), None);
634+
assert_eq!(Aabb::enclosing([] as [Vec3; 0]), None);
635635
assert_eq!(
636636
Aabb::enclosing(vec![Vec3::ONE]).unwrap(),
637637
Aabb::from_min_max(Vec3::ONE, Vec3::ONE)

crates/bevy_ecs/src/entity/unique_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl<T: EntityEquivalent, const N: usize> DerefMut for UniqueEntityEquivalentArr
157157

158158
impl<T: EntityEquivalent> Default for UniqueEntityEquivalentArray<T, 0> {
159159
fn default() -> Self {
160-
Self(Default::default())
160+
Self([])
161161
}
162162
}
163163

0 commit comments

Comments
 (0)