Skip to content

Commit c96b7ff

Browse files
Remove ambiguity sets (#5916)
# Objective Ambiguity sets are used to ignore system order ambiguities between groups of systems. However, they are not very useful: they are clunky, poorly integrated, and generally hampered by the difficulty using (or discovering) the ambiguity detector. As a first step to the work in #4299, we're removing them. ## Migration Guide Ambiguity sets have been removed.
1 parent 54e32ee commit c96b7ff

File tree

7 files changed

+12
-496
lines changed

7 files changed

+12
-496
lines changed

crates/bevy_ecs/macros/src/lib.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -462,21 +462,6 @@ pub fn derive_stage_label(input: TokenStream) -> TokenStream {
462462
derive_label(input, &trait_path, "stage_label")
463463
}
464464

465-
/// Generates an impl of the `AmbiguitySetLabel` trait.
466-
///
467-
/// This works only for unit structs, or enums with only unit variants.
468-
/// You may force a struct or variant to behave as if it were fieldless with `#[ambiguity_set_label(ignore_fields)]`.
469-
#[proc_macro_derive(AmbiguitySetLabel, attributes(ambiguity_set_label))]
470-
pub fn derive_ambiguity_set_label(input: TokenStream) -> TokenStream {
471-
let input = parse_macro_input!(input as DeriveInput);
472-
let mut trait_path = bevy_ecs_path();
473-
trait_path.segments.push(format_ident!("schedule").into());
474-
trait_path
475-
.segments
476-
.push(format_ident!("AmbiguitySetLabel").into());
477-
derive_label(input, &trait_path, "ambiguity_set_label")
478-
}
479-
480465
/// Generates an impl of the `RunCriteriaLabel` trait.
481466
///
482467
/// This works only for unit structs, or enums with only unit variants.

crates/bevy_ecs/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ pub mod prelude {
3434
event::{EventReader, EventWriter, Events},
3535
query::{Added, AnyOf, ChangeTrackers, Changed, Or, QueryState, With, Without},
3636
schedule::{
37-
AmbiguitySetLabel, ExclusiveSystemDescriptorCoercion, ParallelSystemDescriptorCoercion,
38-
RunCriteria, RunCriteriaDescriptorCoercion, RunCriteriaLabel, Schedule, Stage,
39-
StageLabel, State, SystemLabel, SystemSet, SystemStage,
37+
ExclusiveSystemDescriptorCoercion, ParallelSystemDescriptorCoercion, RunCriteria,
38+
RunCriteriaDescriptorCoercion, RunCriteriaLabel, Schedule, Stage, StageLabel, State,
39+
SystemLabel, SystemSet, SystemStage,
4040
},
4141
system::{
4242
adapter as system_adapter, Commands, In, IntoChainSystem, IntoExclusiveSystem,

crates/bevy_ecs/src/schedule/label.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub use bevy_ecs_macros::{AmbiguitySetLabel, RunCriteriaLabel, StageLabel, SystemLabel};
1+
pub use bevy_ecs_macros::{RunCriteriaLabel, StageLabel, SystemLabel};
22
use bevy_utils::define_label;
33

44
define_label!(
@@ -13,12 +13,6 @@ define_label!(
1313
/// Strongly-typed identifier for a [`SystemLabel`].
1414
SystemLabelId,
1515
);
16-
define_label!(
17-
/// A strongly-typed class of labels used to identify sets of systems with intentionally ambiguous execution order.
18-
AmbiguitySetLabel,
19-
/// Strongly-typed identifier for an [`AmbiguitySetLabel`].
20-
AmbiguitySetLabelId,
21-
);
2216
define_label!(
2317
/// A strongly-typed class of labels used to identify [run criteria](crate::schedule::RunCriteria).
2418
RunCriteriaLabel,

0 commit comments

Comments
 (0)