diff --git a/crates/bevy_ecs/src/system/system.rs b/crates/bevy_ecs/src/system/system.rs index aad37c09d0..fb28ea081a 100644 --- a/crates/bevy_ecs/src/system/system.rs +++ b/crates/bevy_ecs/src/system/system.rs @@ -221,6 +221,10 @@ pub trait System: Send + Sync + 'static { /// /// This must only be implemented for system types which do not mutate the `World` /// when [`System::run_unsafe`] is called. +#[diagnostic::on_unimplemented( + message = "`{Self}` is not a read-only system", + label = "invalid read-only system" +)] pub unsafe trait ReadOnlySystem: System { /// Runs this system with the given input in the world. /// @@ -245,6 +249,9 @@ pub unsafe trait ReadOnlySystem: System { /// A convenience type alias for a boxed [`System`] trait object. pub type BoxedSystem = Box>; +/// A convenience type alias for a boxed [`ReadOnlySystem`] trait object. +pub type BoxedReadOnlySystem = Box>; + pub(crate) fn check_system_change_tick( last_run: &mut Tick, check: CheckChangeTicks,