diff --git a/crates/bevy_ecs/src/schedule/label.rs b/crates/bevy_ecs/src/schedule/label.rs index ac6b144e5b6f71..a8733edde3d306 100644 --- a/crates/bevy_ecs/src/schedule/label.rs +++ b/crates/bevy_ecs/src/schedule/label.rs @@ -179,6 +179,8 @@ impl Labels { let mut set = IndexSet::default(); let (idx, _) = set.insert_full(val.clone()); let old = type_map.insert(set); + // We already checked that there is no set for type `L`, + // so let's avoid generating useless drop code for the "previous" entry. std::mem::forget(old); idx as u64 }