1use crate::{
2 change_detection::{CheckChangeTicks, Tick},
3 error::{BevyError, Result},
4 never::Never,
5 prelude::FromWorld,
6 schedule::{InternedSystemSet, SystemSet},
7 system::{
8 check_system_change_tick, FromInput, ReadOnlySystemParam, System, SystemAccess, SystemIn,
9 SystemInput, SystemParam, SystemParamItem,
10 },
11 world::{unsafe_world_cell::UnsafeWorldCell, DeferredWorld, World, WorldId},
12};
13
14use alloc::{borrow::Cow, vec, vec::Vec};
15use bevy_utils::prelude::DebugName;
16use core::marker::PhantomData;
17use variadics_please::all_tuples;
18
19#[cfg(feature = "trace")]
20use tracing::{info_span, Span};
21
22#[cfg(feature = "trace")]
23use alloc::string::ToString as _;
24
25use super::{
26 IntoSystem, ReadOnlySystem, RunSystemError, SystemParamBuilder, SystemParamValidationError,
27 SystemStateFlags,
28};
29
30#[derive(#[automatically_derived]impl ::core::clone::Clone for SystemMeta {
#[inline]
fn clone(&self) -> Self {
SystemMeta {
name: ::core::clone::Clone::clone(&self.name),
flags: ::core::clone::Clone::clone(&self.flags),
last_run: ::core::clone::Clone::clone(&self.last_run),
system_span: ::core::clone::Clone::clone(&self.system_span),
commands_span: ::core::clone::Clone::clone(&self.commands_span),
}
}
}Clone)]
32pub struct SystemMeta {
33 pub(crate) name: DebugName,
34 flags: SystemStateFlags,
37 pub(crate) last_run: Tick,
38 #[cfg(feature = "trace")]
39 pub(crate) system_span: Span,
40 #[cfg(feature = "trace")]
41 pub(crate) commands_span: Span,
42}
43
44impl SystemMeta {
45 pub(crate) fn new<T>() -> Self {
46 let name = DebugName::type_name::<T>();
47 Self {
48 #[cfg(feature = "trace")]
51 system_span: {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::__macro_support::MacroCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("system",
"bevy_ecs::system::function_system", ::tracing::Level::INFO,
::tracing_core::__macro_support::Option::Some("src/system/function_system.rs"),
::tracing_core::__macro_support::Option::Some(51u32),
::tracing_core::__macro_support::Option::Some("bevy_ecs::system::function_system"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("name")
}> =
::tracing::__macro_support::FieldName::new("name");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::INFO <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::INFO <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() } &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::child_of(None, meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&name.clone().to_string()
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
}info_span!(parent: None, "system", name = name.clone().to_string()),
52 #[cfg(feature = "trace")]
53 commands_span: {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::__macro_support::MacroCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("system_commands",
"bevy_ecs::system::function_system", ::tracing::Level::INFO,
::tracing_core::__macro_support::Option::Some("src/system/function_system.rs"),
::tracing_core::__macro_support::Option::Some(53u32),
::tracing_core::__macro_support::Option::Some("bevy_ecs::system::function_system"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("name")
}> =
::tracing::__macro_support::FieldName::new("name");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::INFO <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::INFO <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() } &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::child_of(None, meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&name.clone().to_string()
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
}info_span!(parent: None, "system_commands", name = name.clone().to_string()),
54 name,
55 flags: SystemStateFlags::empty(),
56 last_run: Tick::new(0),
57 }
58 }
59
60 #[inline]
62 pub fn name(&self) -> &DebugName {
63 &self.name
64 }
65
66 pub fn flags(&self) -> SystemStateFlags {
68 self.flags
69 }
70
71 #[inline]
75 pub fn set_name(&mut self, new_name: impl Into<Cow<'static, str>>) {
76 let new_name: Cow<'static, str> = new_name.into();
77 #[cfg(feature = "trace")]
78 {
79 let name = new_name.as_ref();
80 self.system_span = {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::__macro_support::MacroCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("system",
"bevy_ecs::system::function_system", ::tracing::Level::INFO,
::tracing_core::__macro_support::Option::Some("src/system/function_system.rs"),
::tracing_core::__macro_support::Option::Some(80u32),
::tracing_core::__macro_support::Option::Some("bevy_ecs::system::function_system"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("name")
}> =
::tracing::__macro_support::FieldName::new("name");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::INFO <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::INFO <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() } &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::child_of(None, meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&name
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
}info_span!(parent: None, "system", name = name);
81 self.commands_span = {
use ::tracing::__macro_support::Callsite as _;
static __CALLSITE: ::tracing::__macro_support::MacroCallsite =
{
static META: ::tracing::Metadata<'static> =
{
::tracing_core::metadata::Metadata::new("system_commands",
"bevy_ecs::system::function_system", ::tracing::Level::INFO,
::tracing_core::__macro_support::Option::Some("src/system/function_system.rs"),
::tracing_core::__macro_support::Option::Some(81u32),
::tracing_core::__macro_support::Option::Some("bevy_ecs::system::function_system"),
::tracing_core::field::FieldSet::new(&[{
const NAME:
::tracing::__macro_support::FieldName<{
::tracing::__macro_support::FieldName::len("name")
}> =
::tracing::__macro_support::FieldName::new("name");
NAME.as_str()
}], ::tracing_core::callsite::Identifier(&__CALLSITE)),
::tracing::metadata::Kind::SPAN)
};
::tracing::callsite::DefaultCallsite::new(&META)
};
let mut interest = ::tracing::subscriber::Interest::never();
if ::tracing::Level::INFO <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
::tracing::Level::INFO <=
::tracing::level_filters::LevelFilter::current() &&
{ interest = __CALLSITE.interest(); !interest.is_never() } &&
::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
interest) {
let meta = __CALLSITE.metadata();
::tracing::Span::child_of(None, meta,
&{
#[allow(unused_imports)]
use ::tracing::field::{debug, display, Value};
meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&name
as &dyn ::tracing::field::Value))])
})
} else {
let span =
::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
{};
span
}
}info_span!(parent: None, "system_commands", name = name);
82 }
83 self.name = new_name.into();
84 }
85
86 #[inline]
88 pub fn get_last_run(&self) -> Tick {
89 self.last_run
90 }
91
92 #[inline]
94 pub fn set_last_run(&mut self, last_run: Tick) {
95 self.last_run = last_run;
96 }
97
98 #[inline]
100 pub fn is_send(&self) -> bool {
101 !self.flags.intersects(SystemStateFlags::NON_SEND)
102 }
103
104 #[inline]
108 pub fn set_non_send(&mut self) {
109 self.flags |= SystemStateFlags::NON_SEND;
110 }
111
112 #[inline]
114 pub fn has_deferred(&self) -> bool {
115 self.flags.intersects(SystemStateFlags::DEFERRED)
116 }
117
118 #[inline]
121 pub fn set_has_deferred(&mut self) {
122 self.flags |= SystemStateFlags::DEFERRED;
123 }
124}
125
126pub struct SystemState<Param: SystemParam + 'static> {
234 meta: SystemMeta,
235 param_state: Param::State,
236 world_id: WorldId,
237}
238
239macro_rules! impl_build_system {
245 ($(#[$meta:meta])* $($param: ident),*) => {
246 $(#[$meta])*
247 impl<$($param: SystemParam),*> SystemState<($($param,)*)> {
248 #[inline]
252 pub fn build_system<
253 InnerOut: IntoResult<Out>,
254 Out,
255 Marker,
256 F: FnMut($(SystemParamItem<$param>),*) -> InnerOut
257 + SystemParamFunction<Marker, In = (), Out = InnerOut, Param = ($($param,)*)>
258 >
259 (
260 self,
261 func: F,
262 ) -> FunctionSystem<Marker, (), Out, F>
263 {
264 self.build_any_system(func)
265 }
266
267 #[inline]
271 pub fn build_system_with_input<
272 InnerIn: SystemInput + FromInput<In>,
273 In: SystemInput,
274 InnerOut: IntoResult<Out>,
275 Out,
276 Marker,
277 F: FnMut(InnerIn, $(SystemParamItem<$param>),*) -> InnerOut
278 + SystemParamFunction<Marker, In = InnerIn, Out = InnerOut, Param = ($($param,)*)>
279 >
280 (
281 self,
282 func: F,
283 ) -> FunctionSystem<Marker, In, Out, F> {
284 self.build_any_system(func)
285 }
286 }
287 }
288}
289
290#[doc(hidden)]
impl<P0: SystemParam, P1: SystemParam, P2: SystemParam, P3: SystemParam,
P4: SystemParam, P5: SystemParam, P6: SystemParam, P7: SystemParam,
P8: SystemParam, P9: SystemParam, P10: SystemParam, P11: SystemParam,
P12: SystemParam, P13: SystemParam, P14: SystemParam, P15: SystemParam>
SystemState<(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13,
P14, P15)> {
#[inline]
pub fn build_system<InnerOut: IntoResult<Out>, Out, Marker,
F: FnMut(SystemParamItem<P0>, SystemParamItem<P1>,
SystemParamItem<P2>, SystemParamItem<P3>, SystemParamItem<P4>,
SystemParamItem<P5>, SystemParamItem<P6>, SystemParamItem<P7>,
SystemParamItem<P8>, SystemParamItem<P9>, SystemParamItem<P10>,
SystemParamItem<P11>, SystemParamItem<P12>, SystemParamItem<P13>,
SystemParamItem<P14>, SystemParamItem<P15>) -> InnerOut +
SystemParamFunction<Marker, In = (), Out = InnerOut, Param =
(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14,
P15)>>(self, func: F) -> FunctionSystem<Marker, (), Out, F> {
self.build_any_system(func)
}
#[inline]
pub fn build_system_with_input<InnerIn: SystemInput + FromInput<In>,
In: SystemInput, InnerOut: IntoResult<Out>, Out, Marker,
F: FnMut(InnerIn, SystemParamItem<P0>, SystemParamItem<P1>,
SystemParamItem<P2>, SystemParamItem<P3>, SystemParamItem<P4>,
SystemParamItem<P5>, SystemParamItem<P6>, SystemParamItem<P7>,
SystemParamItem<P8>, SystemParamItem<P9>, SystemParamItem<P10>,
SystemParamItem<P11>, SystemParamItem<P12>, SystemParamItem<P13>,
SystemParamItem<P14>, SystemParamItem<P15>) -> InnerOut +
SystemParamFunction<Marker, In = InnerIn, Out = InnerOut, Param =
(P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14,
P15)>>(self, func: F) -> FunctionSystem<Marker, In, Out, F> {
self.build_any_system(func)
}
}all_tuples!(
291 #[doc(fake_variadic)]
292 impl_build_system,
293 0,
294 16,
295 P
296);
297
298impl<Param: SystemParam> SystemState<Param> {
299 #[track_caller]
301 pub fn new(world: &mut World) -> Self {
302 let mut meta = SystemMeta::new::<Param>();
303 meta.last_run = world.change_tick().relative_to(Tick::MAX);
304 let param_state = Param::init_state(world);
305 let mut access = SystemAccess::default();
306 Param::init_access(¶m_state, &mut meta, &mut access, world);
309 Self {
310 meta,
311 param_state,
312 world_id: world.id(),
313 }
314 }
315
316 pub(crate) fn from_builder(world: &mut World, builder: impl SystemParamBuilder<Param>) -> Self {
318 let mut meta = SystemMeta::new::<Param>();
319 meta.last_run = world.change_tick().relative_to(Tick::MAX);
320 let param_state = builder.build(world);
321 let mut access = SystemAccess::default();
322 Param::init_access(¶m_state, &mut meta, &mut access, world);
325 Self {
326 meta,
327 param_state,
328 world_id: world.id(),
329 }
330 }
331
332 #[inline]
336 pub fn build_any_system<Marker, In, Out, F>(self, func: F) -> FunctionSystem<Marker, In, Out, F>
337 where
338 In: SystemInput,
339 F: SystemParamFunction<Marker, In: FromInput<In>, Out: IntoResult<Out>, Param = Param>,
340 {
341 FunctionSystem::new(
342 func,
343 self.meta,
344 Some(FunctionSystemState {
345 param: self.param_state,
346 world_id: self.world_id,
347 }),
348 )
349 }
350
351 #[inline]
353 pub fn meta(&self) -> &SystemMeta {
354 &self.meta
355 }
356
357 #[inline]
359 pub fn meta_mut(&mut self) -> &mut SystemMeta {
360 &mut self.meta
361 }
362
363 #[inline]
367 pub fn get<'w, 's>(
368 &'s mut self,
369 world: &'w World,
370 ) -> Result<SystemParamItem<'w, 's, Param>, SystemParamValidationError>
371 where
372 Param: ReadOnlySystemParam,
373 {
374 self.validate_world(world.id());
375 unsafe { self.get_unchecked(world.as_unsafe_world_cell_readonly()) }
378 }
379
380 #[inline]
384 #[track_caller]
385 pub fn get_mut<'w, 's>(
386 &'s mut self,
387 world: &'w mut World,
388 ) -> Result<SystemParamItem<'w, 's, Param>, SystemParamValidationError> {
389 self.validate_world(world.id());
390 unsafe { self.get_unchecked(world.as_unsafe_world_cell()) }
392 }
393
394 pub fn apply(&mut self, world: &mut World) {
399 Param::apply(&mut self.param_state, &self.meta, world);
400 }
401
402 #[inline]
405 pub fn matches_world(&self, world_id: WorldId) -> bool {
406 self.world_id == world_id
407 }
408
409 #[inline]
411 #[track_caller]
412 fn validate_world(&self, world_id: WorldId) {
413 #[inline(never)]
414 #[track_caller]
415 #[cold]
416 fn panic_mismatched(this: WorldId, other: WorldId) -> ! {
417 {
::core::panicking::panic_fmt(format_args!("Encountered a mismatched World. This SystemState was created from {0:?}, but a method was called using {1:?}.",
this, other));
};panic!("Encountered a mismatched World. This SystemState was created from {this:?}, but a method was called using {other:?}.");
418 }
419
420 if !self.matches_world(world_id) {
421 panic_mismatched(self.world_id, world_id);
422 }
423 }
424
425 #[inline]
434 #[track_caller]
435 pub unsafe fn get_unchecked<'w, 's>(
436 &'s mut self,
437 world: UnsafeWorldCell<'w>,
438 ) -> Result<SystemParamItem<'w, 's, Param>, SystemParamValidationError> {
439 let change_tick = world.increment_change_tick();
440 unsafe { self.fetch(world, change_tick) }
442 }
443
444 #[inline]
449 #[track_caller]
450 unsafe fn fetch<'w, 's>(
451 &'s mut self,
452 world: UnsafeWorldCell<'w>,
453 change_tick: Tick,
454 ) -> Result<SystemParamItem<'w, 's, Param>, SystemParamValidationError> {
455 let param =
457 unsafe { Param::get_param(&mut self.param_state, &self.meta, world, change_tick) }?;
458 self.meta.last_run = change_tick;
459 Ok(param)
460 }
461
462 pub fn param_state(&self) -> &Param::State {
464 &self.param_state
465 }
466
467 pub unsafe fn param_state_mut(&mut self) -> &mut Param::State {
477 &mut self.param_state
478 }
479}
480
481impl<Param: SystemParam> FromWorld for SystemState<Param> {
482 fn from_world(world: &mut World) -> Self {
483 Self::new(world)
484 }
485}
486
487pub struct FunctionSystem<Marker, In, Out, F>
498where
499 F: SystemParamFunction<Marker>,
500{
501 func: F,
502 #[cfg(feature = "hotpatching")]
503 current_ptr: subsecond::HotFnPtr,
504 state: Option<FunctionSystemState<F::Param>>,
505 system_meta: SystemMeta,
506 is_exclusive: bool,
510 marker: PhantomData<fn(In) -> (Marker, Out)>,
512}
513
514struct FunctionSystemState<P: SystemParam> {
518 param: P::State,
520 world_id: WorldId,
524}
525
526impl<Marker, In, Out, F> FunctionSystem<Marker, In, Out, F>
527where
528 F: SystemParamFunction<Marker>,
529{
530 #[inline]
531 fn new(func: F, system_meta: SystemMeta, state: Option<FunctionSystemState<F::Param>>) -> Self {
532 Self {
533 func,
534 #[cfg(feature = "hotpatching")]
535 current_ptr: subsecond::HotFn::current(<F as SystemParamFunction<Marker>>::run)
536 .ptr_address(),
537 state,
538 system_meta,
539 is_exclusive: false,
540 marker: PhantomData,
541 }
542 }
543
544 pub fn with_name(mut self, new_name: impl Into<Cow<'static, str>>) -> Self {
548 self.system_meta.set_name(new_name.into());
549 self
550 }
551}
552
553impl<Marker, In, Out, F> Clone for FunctionSystem<Marker, In, Out, F>
555where
556 F: SystemParamFunction<Marker> + Clone,
557{
558 fn clone(&self) -> Self {
559 Self {
560 func: self.func.clone(),
561 #[cfg(feature = "hotpatching")]
562 current_ptr: subsecond::HotFn::current(<F as SystemParamFunction<Marker>>::run)
563 .ptr_address(),
564 state: None,
565 system_meta: SystemMeta::new::<F>(),
566 is_exclusive: false,
567 marker: PhantomData,
568 }
569 }
570}
571
572#[doc(hidden)]
574pub struct IsFunctionSystem;
575
576impl<Marker, In, Out, F> IntoSystem<In, Out, (IsFunctionSystem, Marker)> for F
577where
578 Marker: 'static,
579 In: SystemInput + 'static,
580 Out: 'static,
581 F: SystemParamFunction<Marker, In: FromInput<In>, Out: IntoResult<Out>>,
582{
583 type System = FunctionSystem<Marker, In, Out, F>;
584 fn into_system(func: Self) -> Self::System {
585 FunctionSystem::new(func, SystemMeta::new::<F>(), None)
586 }
587}
588
589pub trait IntoResult<Out>: Sized {
592 fn into_result(self) -> Result<Out, RunSystemError>;
594}
595
596impl<T> IntoResult<T> for T {
597 fn into_result(self) -> Result<T, RunSystemError> {
598 Ok(self)
599 }
600}
601
602impl<T> IntoResult<T> for Result<T, RunSystemError> {
603 fn into_result(self) -> Result<T, RunSystemError> {
604 self
605 }
606}
607
608impl<T> IntoResult<T> for Result<T, BevyError> {
609 fn into_result(self) -> Result<T, RunSystemError> {
610 Ok(self?)
611 }
612}
613
614impl IntoResult<()> for Never {
619 fn into_result(self) -> Result<(), RunSystemError> {
620 self
621 }
622}
623
624impl IntoResult<bool> for Never {
625 fn into_result(self) -> Result<bool, RunSystemError> {
626 self
627 }
628}
629
630impl<Marker, In, Out, F> FunctionSystem<Marker, In, Out, F>
631where
632 F: SystemParamFunction<Marker>,
633{
634 const ERROR_UNINITIALIZED: &'static str =
638 "System's state was not found. Did you forget to initialize this system before running it?";
639}
640
641impl<Marker, In, Out, F> System for FunctionSystem<Marker, In, Out, F>
642where
643 Marker: 'static,
644 In: SystemInput + 'static,
645 Out: 'static,
646 F: SystemParamFunction<Marker, In: FromInput<In>, Out: IntoResult<Out>>,
647{
648 type In = In;
649 type Out = Out;
650
651 #[inline]
652 fn name(&self) -> DebugName {
653 self.system_meta.name.clone()
654 }
655
656 #[inline]
657 fn flags(&self) -> SystemStateFlags {
658 self.system_meta.flags
659 }
660
661 #[inline]
662 unsafe fn run_unsafe(
663 &mut self,
664 input: SystemIn<'_, Self>,
665 world: UnsafeWorldCell,
666 ) -> Result<Self::Out, RunSystemError> {
667 struct LastTickGuard<'a> {
672 world: UnsafeWorldCell<'a>,
673 last_tick: Tick,
674 }
675 impl Drop for LastTickGuard<'_> {
678 fn drop(&mut self) {
679 let world = unsafe { self.world.world_mut() };
683 world.last_change_tick = self.last_tick;
684 }
685 }
686
687 #[cfg(feature = "trace")]
688 let _span_guard = self.system_meta.system_span.enter();
689
690 let input = F::In::from_inner(input);
691
692 let state = self.state.as_mut().expect(Self::ERROR_UNINITIALIZED);
693 {
match (&state.world_id, &world.id()) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(kind, &*left_val,
&*right_val,
::core::option::Option::Some(format_args!("Encountered a mismatched World. A System cannot be used with Worlds other than the one it was initialized with.")));
}
}
}
};assert_eq!(state.world_id, world.id(), "Encountered a mismatched World. A System cannot be used with Worlds other than the one it was initialized with.");
694
695 let (change_tick, _guard) = if self.is_exclusive {
696 let exclusive_world = unsafe { world.world_mut() };
698 let change_tick = exclusive_world.change_tick();
699 let previous_tick = exclusive_world.last_change_tick();
700 exclusive_world.last_change_tick = self.system_meta.last_run;
701
702 (
703 change_tick,
704 Some(LastTickGuard {
705 world,
706 last_tick: previous_tick,
707 }),
708 )
709 } else {
710 (world.increment_change_tick(), None)
711 };
712
713 let params = unsafe {
718 F::Param::get_param(&mut state.param, &self.system_meta, world, change_tick)
719 }?;
720
721 #[cfg(feature = "hotpatching")]
722 let out = {
723 let mut hot_fn = subsecond::HotFn::current(<F as SystemParamFunction<Marker>>::run);
724 unsafe {
727 hot_fn
728 .try_call_with_ptr(self.current_ptr, (&mut self.func, input, params))
729 .expect("Error calling hotpatched system. Run a full rebuild")
730 }
731 };
732 #[cfg(not(feature = "hotpatching"))]
733 let out = self.func.run(input, params);
734
735 if self.is_exclusive {
736 let world = unsafe { world.world_mut() };
738 world.flush();
739 self.system_meta.last_run = world.increment_change_tick();
740 } else {
741 self.system_meta.last_run = change_tick;
742 }
743 IntoResult::into_result(out)
744 }
745
746 #[cfg(feature = "hotpatching")]
747 #[inline]
748 fn refresh_hotpatch(&mut self) {
749 let new = subsecond::HotFn::current(<F as SystemParamFunction<Marker>>::run).ptr_address();
750 if new != self.current_ptr {
751 {
{
let lvl = ::log::Level::Debug;
if lvl <= ::log::STATIC_MAX_LEVEL && lvl <= ::log::max_level() {
::log::__private_api::log({ ::log::__private_api::GlobalLogger },
format_args!("system {0} hotpatched", self.name()), lvl,
&("bevy_ecs::system::function_system",
"bevy_ecs::system::function_system",
::log::__private_api::loc()), ());
}
}
};log::debug!("system {} hotpatched", self.name());
752 }
753 self.current_ptr = new;
754 }
755
756 #[inline]
757 fn apply_deferred(&mut self, world: &mut World) {
758 let param_state = &mut self.state.as_mut().expect(Self::ERROR_UNINITIALIZED).param;
759 F::Param::apply(param_state, &self.system_meta, world);
760 }
761
762 #[inline]
763 fn queue_deferred(&mut self, world: DeferredWorld) {
764 let param_state = &mut self.state.as_mut().expect(Self::ERROR_UNINITIALIZED).param;
765 F::Param::queue(param_state, &self.system_meta, world);
766 }
767
768 #[inline]
769 fn initialize(&mut self, world: &mut World) -> SystemAccess {
770 if let Some(state) = &self.state {
771 {
match (&state.world_id, &world.id()) {
(left_val, right_val) => {
if !(*left_val == *right_val) {
let kind = ::core::panicking::AssertKind::Eq;
::core::panicking::assert_failed(kind, &*left_val,
&*right_val,
::core::option::Option::Some(format_args!("System built with a different world than the one it was added to.")));
}
}
}
};assert_eq!(
772 state.world_id,
773 world.id(),
774 "System built with a different world than the one it was added to.",
775 );
776 }
777 let state = self.state.get_or_insert_with(|| FunctionSystemState {
778 param: F::Param::init_state(world),
779 world_id: world.id(),
780 });
781 self.system_meta.last_run = world.change_tick().relative_to(Tick::MAX);
782 let mut system_access = SystemAccess::default();
783 F::Param::init_access(
784 &state.param,
785 &mut self.system_meta,
786 &mut system_access,
787 world,
788 );
789 self.is_exclusive = system_access.is_exclusive();
790 system_access
791 }
792
793 #[inline]
794 fn check_change_tick(&mut self, check: CheckChangeTicks) {
795 check_system_change_tick(
796 &mut self.system_meta.last_run,
797 check,
798 self.system_meta.name.clone(),
799 );
800 }
801
802 fn default_system_sets(&self) -> Vec<InternedSystemSet> {
803 let set = crate::schedule::SystemTypeSet::<F>::new();
804 ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
[set.intern()]))vec![set.intern()]
805 }
806
807 fn get_last_run(&self) -> Tick {
808 self.system_meta.last_run
809 }
810
811 fn set_last_run(&mut self, last_run: Tick) {
812 self.system_meta.last_run = last_run;
813 }
814}
815
816unsafe impl<Marker, In, Out, F> ReadOnlySystem for FunctionSystem<Marker, In, Out, F>
818where
819 Marker: 'static,
820 In: SystemInput + 'static,
821 Out: 'static,
822 F: SystemParamFunction<
823 Marker,
824 In: FromInput<In>,
825 Out: IntoResult<Out>,
826 Param: ReadOnlySystemParam,
827 >,
828{
829}
830
831#[diagnostic::on_unimplemented(
895 message = "`{Self}` is not a valid system",
896 label = "invalid system"
897)]
898pub trait SystemParamFunction<Marker>: Send + Sync + 'static {
899 type In: SystemInput;
901 type Out;
903
904 type Param: SystemParam;
906
907 fn run(
909 &mut self,
910 input: <Self::In as SystemInput>::Inner<'_>,
911 param_value: SystemParamItem<Self::Param>,
912 ) -> Self::Out;
913}
914
915#[doc(hidden)]
917pub struct HasSystemInput;
918
919macro_rules! impl_system_function {
920 ($($param: ident),*) => {
921 #[expect(
922 clippy::allow_attributes,
923 reason = "This is within a macro, and as such, the below lints may not always apply."
924 )]
925 #[allow(
926 non_snake_case,
927 reason = "Certain variable names are provided by the caller, not by us."
928 )]
929 impl<Out, Func, $($param: SystemParam),*> SystemParamFunction<fn($($param,)*) -> Out> for Func
930 where
931 Func: Send + Sync + 'static,
932 for <'a> &'a mut Func:
933 FnMut($($param),*) -> Out +
934 FnMut($(SystemParamItem<$param>),*) -> Out,
935 Out: 'static
936 {
937 type In = ();
938 type Out = Out;
939 type Param = ($($param,)*);
940 #[inline]
941 fn run(&mut self, _input: (), param_value: SystemParamItem< ($($param,)*)>) -> Out {
942 fn call_inner<Out, $($param,)*>(
946 mut f: impl FnMut($($param,)*)->Out,
947 $($param: $param,)*
948 )->Out{
949 f($($param,)*)
950 }
951 let ($($param,)*) = param_value;
952 call_inner(self, $($param),*)
953 }
954 }
955
956 #[expect(
957 clippy::allow_attributes,
958 reason = "This is within a macro, and as such, the below lints may not always apply."
959 )]
960 #[allow(
961 non_snake_case,
962 reason = "Certain variable names are provided by the caller, not by us."
963 )]
964 impl<In, Out, Func, $($param: SystemParam),*> SystemParamFunction<(HasSystemInput, fn(In, $($param,)*) -> Out)> for Func
965 where
966 Func: Send + Sync + 'static,
967 for <'a> &'a mut Func:
968 FnMut(In, $($param),*) -> Out +
969 FnMut(In::Param<'_>, $(SystemParamItem<$param>),*) -> Out,
970 In: SystemInput + 'static,
971 Out: 'static
972 {
973 type In = In;
974 type Out = Out;
975 type Param = ($($param,)*);
976 #[inline]
977 fn run(&mut self, input: In::Inner<'_>, param_value: SystemParamItem< ($($param,)*)>) -> Out {
978 fn call_inner<In: SystemInput, Out, $($param,)*>(
979 _: PhantomData<In>,
980 mut f: impl FnMut(In::Param<'_>, $($param,)*)->Out,
981 input: In::Inner<'_>,
982 $($param: $param,)*
983 )->Out{
984 f(In::wrap(input), $($param,)*)
985 }
986 let ($($param,)*) = param_value;
987 call_inner(PhantomData::<In>, self, input, $($param),*)
988 }
989 }
990 };
991}
992
993#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func> SystemParamFunction<fn() -> Out> for Func where Func: Send +
Sync + 'static, for<'a> &'a mut Func: FnMut() -> Out + FnMut() -> Out,
Out: 'static {
type In = ();
type Out = Out;
type Param = ();
#[inline]
fn run(&mut self, _input: (), param_value: SystemParamItem<()>) -> Out {
fn call_inner<Out>(mut f: impl FnMut() -> Out) -> Out { f() }
let () = param_value;
call_inner(self)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func> SystemParamFunction<(HasSystemInput, fn(In) -> Out)> for
Func where Func: Send + Sync + 'static, for<'a> &'a mut Func: FnMut(In)
-> Out + FnMut(In::Param<'_>) -> Out, In: SystemInput + 'static,
Out: 'static {
type In = In;
type Out = Out;
type Param = ();
#[inline]
fn run(&mut self, input: In::Inner<'_>, param_value: SystemParamItem<()>)
-> Out {
fn call_inner<In: SystemInput,
Out>(_: PhantomData<In>, mut f: impl FnMut(In::Param<'_>) -> Out,
input: In::Inner<'_>) -> Out {
f(In::wrap(input))
}
let () = param_value;
call_inner(PhantomData::<In>, self, input)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam> SystemParamFunction<fn(F0) -> Out> for Func
where Func: Send + Sync + 'static, for<'a> &'a mut Func: FnMut(F0)
-> Out + FnMut(SystemParamItem<F0>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0,);
#[inline]
fn run(&mut self, _input: (), param_value: SystemParamItem<(F0,)>)
-> Out {
fn call_inner<Out, F0>(mut f: impl FnMut(F0) -> Out, F0: F0) -> Out {
f(F0)
}
let (F0,) = param_value;
call_inner(self, F0)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam>
SystemParamFunction<(HasSystemInput, fn(In, F0) -> Out)> for Func where
Func: Send + Sync + 'static, for<'a> &'a mut Func: FnMut(In, F0) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>) -> Out, In: SystemInput +
'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0,);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0,)>) -> Out {
fn call_inner<In: SystemInput, Out,
F0>(_: PhantomData<In>,
mut f: impl FnMut(In::Param<'_>, F0) -> Out, input: In::Inner<'_>,
F0: F0) -> Out {
f(In::wrap(input), F0)
}
let (F0,) = param_value;
call_inner(PhantomData::<In>, self, input, F0)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam>
SystemParamFunction<fn(F0, F1) -> Out> for Func where Func: Send + Sync +
'static, for<'a> &'a mut Func: FnMut(F0, F1) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1);
#[inline]
fn run(&mut self, _input: (), param_value: SystemParamItem<(F0, F1)>)
-> Out {
fn call_inner<Out, F0,
F1>(mut f: impl FnMut(F0, F1) -> Out, F0: F0, F1: F1) -> Out {
f(F0, F1)
}
let (F0, F1) = param_value;
call_inner(self, F0, F1)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam>
SystemParamFunction<(HasSystemInput, fn(In, F0, F1) -> Out)> for Func
where Func: Send + Sync + 'static, for<'a> &'a mut Func: FnMut(In, F0, F1)
-> Out + FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>)
-> Out, In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1)>) -> Out {
fn call_inner<In: SystemInput, Out, F0,
F1>(_: PhantomData<In>,
mut f: impl FnMut(In::Param<'_>, F0, F1) -> Out,
input: In::Inner<'_>, F0: F0, F1: F1) -> Out {
f(In::wrap(input), F0, F1)
}
let (F0, F1) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam>
SystemParamFunction<fn(F0, F1, F2) -> Out> for Func where Func: Send +
Sync + 'static, for<'a> &'a mut Func: FnMut(F0, F1, F2) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>)
-> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2);
#[inline]
fn run(&mut self, _input: (), param_value: SystemParamItem<(F0, F1, F2)>)
-> Out {
fn call_inner<Out, F0, F1,
F2>(mut f: impl FnMut(F0, F1, F2) -> Out, F0: F0, F1: F1, F2: F2)
-> Out {
f(F0, F1, F2)
}
let (F0, F1, F2) = param_value;
call_inner(self, F0, F1, F2)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam>
SystemParamFunction<(HasSystemInput, fn(In, F0, F1, F2) -> Out)> for Func
where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>) -> Out, In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1, F2)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1,
F2>(_: PhantomData<In>,
mut f: impl FnMut(In::Param<'_>, F0, F1, F2) -> Out,
input: In::Inner<'_>, F0: F0, F1: F1, F2: F2) -> Out {
f(In::wrap(input), F0, F1, F2)
}
let (F0, F1, F2) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam> SystemParamFunction<fn(F0, F1, F2, F3) -> Out> for Func
where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3);
#[inline]
fn run(&mut self, _input: (),
param_value: SystemParamItem<(F0, F1, F2, F3)>) -> Out {
fn call_inner<Out, F0, F1, F2,
F3>(mut f: impl FnMut(F0, F1, F2, F3) -> Out, F0: F0, F1: F1,
F2: F2, F3: F3) -> Out {
f(F0, F1, F2, F3)
}
let (F0, F1, F2, F3) = param_value;
call_inner(self, F0, F1, F2, F3)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam>
SystemParamFunction<(HasSystemInput, fn(In, F0, F1, F2, F3) -> Out)> for
Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>) -> Out, In: SystemInput +
'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1, F2, F3)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2,
F3>(_: PhantomData<In>,
mut f: impl FnMut(In::Param<'_>, F0, F1, F2, F3) -> Out,
input: In::Inner<'_>, F0: F0, F1: F1, F2: F2, F3: F3) -> Out {
f(In::wrap(input), F0, F1, F2, F3)
}
let (F0, F1, F2, F3) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4) -> Out> for Func where
Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4);
#[inline]
fn run(&mut self, _input: (),
param_value: SystemParamItem<(F0, F1, F2, F3, F4)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3,
F4>(mut f: impl FnMut(F0, F1, F2, F3, F4) -> Out, F0: F0, F1: F1,
F2: F2, F3: F3, F4: F4) -> Out {
f(F0, F1, F2, F3, F4)
}
let (F0, F1, F2, F3, F4) = param_value;
call_inner(self, F0, F1, F2, F3, F4)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam>
SystemParamFunction<(HasSystemInput, fn(In, F0, F1, F2, F3, F4) -> Out)>
for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>) -> Out,
In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1, F2, F3, F4)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3,
F4>(_: PhantomData<In>,
mut f: impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4) -> Out,
input: In::Inner<'_>, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4)
-> Out {
f(In::wrap(input), F0, F1, F2, F3, F4)
}
let (F0, F1, F2, F3, F4) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5) -> Out> for Func where
Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>) -> Out,
Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5);
#[inline]
fn run(&mut self, _input: (),
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3, F4,
F5>(mut f: impl FnMut(F0, F1, F2, F3, F4, F5) -> Out, F0: F0,
F1: F1, F2: F2, F3: F3, F4: F4, F5: F5) -> Out {
f(F0, F1, F2, F3, F4, F5)
}
let (F0, F1, F2, F3, F4, F5) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5) -> Out)> for Func where Func: Send + Sync +
'static, for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>) -> Out, In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4,
F5>(_: PhantomData<In>,
mut f: impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5) -> Out,
input: In::Inner<'_>, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4,
F5: F5) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5)
}
let (F0, F1, F2, F3, F4, F5) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6) -> Out> for Func where
Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6);
#[inline]
fn run(&mut self, _input: (),
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5, F6)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5,
F6>(mut f: impl FnMut(F0, F1, F2, F3, F4, F5, F6) -> Out, F0: F0,
F1: F1, F2: F2, F3: F3, F4: F4, F5: F5, F6: F6) -> Out {
f(F0, F1, F2, F3, F4, F5, F6)
}
let (F0, F1, F2, F3, F4, F5, F6) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6) -> Out)> for Func where Func: Send +
Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>) -> Out, In: SystemInput +
'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5, F6)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5,
F6>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6) -> Out,
input: In::Inner<'_>, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4,
F5: F5, F6: F6) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6)
}
let (F0, F1, F2, F3, F4, F5, F6) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7) -> Out> for Func
where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7);
#[inline]
fn run(&mut self, _input: (),
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7)>)
-> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6,
F7>(mut f: impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7) -> Out,
F0: F0, F1: F1, F2: F2, F3: F3, F4: F4, F5: F5, F6: F6, F7: F7)
-> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7)
}
let (F0, F1, F2, F3, F4, F5, F6, F7) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7) -> Out)> for Func where
Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>) -> Out,
In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7)>)
-> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6,
F7>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7)
-> Out, input: In::Inner<'_>, F0: F0, F1: F1, F2: F2, F3: F3,
F4: F4, F5: F5, F6: F6, F7: F7) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7)
}
let (F0, F1, F2, F3, F4, F5, F6, F7) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8) -> Out> for
Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>) -> Out,
Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8);
#[inline]
fn run(&mut self, _input: (),
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8)>)
-> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8>(mut f: impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8) -> Out,
F0: F0, F1: F1, F2: F2, F3: F3, F4: F4, F5: F5, F6: F6, F7: F7,
F8: F8) -> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8) -> Out)> for Func where
Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8)
-> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>) -> Out, In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value: SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8)>)
-> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8)
-> Out, input: In::Inner<'_>, F0: F0, F1: F1, F2: F2, F3: F3,
F4: F4, F5: F5, F6: F6, F7: F7, F8: F8) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9) -> Out> for
Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9)
-> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>,
SystemParamItem<F9>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9);
#[inline]
fn run(&mut self, _input: (),
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9)>)
-> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9>(mut f:
impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9) -> Out,
F0: F0, F1: F1, F2: F2, F3: F3, F4: F4, F5: F5, F6: F6, F7: F7,
F8: F8, F9: F9) -> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9) -> Out)> for Func where
Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9)
-> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>, SystemParamItem<F9>) -> Out, In: SystemInput +
'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9)>)
-> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8,
F9>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9) -> Out, input: In::Inner<'_>, F0: F0, F1: F1, F2: F2,
F3: F3, F4: F4, F5: F5, F6: F6, F7: F7, F8: F8, F9: F9) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8, F9)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8, F9)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)
-> Out> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)
-> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>,
SystemParamItem<F9>, SystemParamItem<F10>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10);
#[inline]
fn run(&mut self, _input: (),
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)>)
-> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10>(mut f:
impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)
-> Out, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4, F5: F5,
F6: F6, F7: F7, F8: F8, F9: F9, F10: F10) -> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10) -> Out)> for Func
where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>, SystemParamItem<F9>, SystemParamItem<F10>) -> Out,
In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)>)
-> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8, F9,
F10>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10) -> Out, input: In::Inner<'_>, F0: F0, F1: F1, F2: F2,
F3: F3, F4: F4, F5: F5, F6: F6, F7: F7, F8: F8, F9: F9, F10: F10)
-> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8, F9, F10)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11)
-> Out> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>,
SystemParamItem<F9>, SystemParamItem<F10>, SystemParamItem<F11>) -> Out,
Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11);
#[inline]
fn run(&mut self, _input: (),
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11>(mut f:
impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11)
-> Out, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4, F5: F5,
F6: F6, F7: F7, F8: F8, F9: F9, F10: F10, F11: F11) -> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11) -> Out)> for Func
where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>, SystemParamItem<F9>, SystemParamItem<F10>,
SystemParamItem<F11>) -> Out, In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8, F9, F10,
F11>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11) -> Out, input: In::Inner<'_>, F0: F0, F1: F1,
F2: F2, F3: F3, F4: F4, F5: F5, F6: F6, F7: F7, F8: F8, F9: F9,
F10: F10, F11: F11) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8, F9, F10, F11)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12) -> Out> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>,
SystemParamItem<F9>, SystemParamItem<F10>, SystemParamItem<F11>,
SystemParamItem<F12>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12);
#[inline]
fn run(&mut self, _input: (),
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12>(mut f:
impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12) -> Out, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4, F5: F5,
F6: F6, F7: F7, F8: F8, F9: F9, F10: F10, F11: F11, F12: F12)
-> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12) =
param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12) -> Out)> for
Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11, F12) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>, SystemParamItem<F9>, SystemParamItem<F10>,
SystemParamItem<F11>, SystemParamItem<F12>) -> Out, In: SystemInput +
'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8, F9, F10, F11,
F12>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12) -> Out, input: In::Inner<'_>, F0: F0,
F1: F1, F2: F2, F3: F3, F4: F4, F5: F5, F6: F6, F7: F7, F8: F8,
F9: F9, F10: F10, F11: F11, F12: F12) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12) =
param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8, F9, F10, F11, F12)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam, F13: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13) -> Out> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12, F13) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>,
SystemParamItem<F9>, SystemParamItem<F10>, SystemParamItem<F11>,
SystemParamItem<F12>, SystemParamItem<F13>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13);
#[inline]
fn run(&mut self, _input: (),
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12,
F13>(mut f:
impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13) -> Out, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4,
F5: F5, F6: F6, F7: F7, F8: F8, F9: F9, F10: F10, F11: F11,
F12: F12, F13: F13) -> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13) =
param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam, F13: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13)
-> Out)> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11, F12, F13) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>, SystemParamItem<F9>, SystemParamItem<F10>,
SystemParamItem<F11>, SystemParamItem<F12>, SystemParamItem<F13>) -> Out,
In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param = (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8, F9, F10, F11, F12,
F13>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12, F13) -> Out, input: In::Inner<'_>, F0: F0,
F1: F1, F2: F2, F3: F3, F4: F4, F5: F5, F6: F6, F7: F7, F8: F8,
F9: F9, F10: F10, F11: F11, F12: F12, F13: F13) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12, F13)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13) =
param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8, F9, F10, F11, F12, F13)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam, F13: SystemParam, F14: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14) -> Out> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12, F13, F14) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>,
SystemParamItem<F9>, SystemParamItem<F10>, SystemParamItem<F11>,
SystemParamItem<F12>, SystemParamItem<F13>, SystemParamItem<F14>) -> Out,
Out: 'static {
type In = ();
type Out = Out;
type Param =
(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14);
#[inline]
fn run(&mut self, _input: (),
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13,
F14>(mut f:
impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14) -> Out, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4,
F5: F5, F6: F6, F7: F7, F8: F8, F9: F9, F10: F10, F11: F11,
F12: F12, F13: F13, F14: F14) -> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13,
F14) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam, F13: SystemParam, F14: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14)
-> Out)> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11, F12, F13, F14) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>, SystemParamItem<F9>, SystemParamItem<F10>,
SystemParamItem<F11>, SystemParamItem<F12>, SystemParamItem<F13>,
SystemParamItem<F14>) -> Out, In: SystemInput + 'static, Out: 'static {
type In = In;
type Out = Out;
type Param =
(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8, F9, F10, F11, F12, F13,
F14>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12, F13, F14) -> Out, input: In::Inner<'_>,
F0: F0, F1: F1, F2: F2, F3: F3, F4: F4, F5: F5, F6: F6, F7: F7,
F8: F8, F9: F9, F10: F10, F11: F11, F12: F12, F13: F13, F14: F14)
-> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12, F13, F14)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13,
F14) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8, F9, F10, F11, F12, F13, F14)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam, F13: SystemParam, F14: SystemParam,
F15: SystemParam>
SystemParamFunction<fn(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14, F15) -> Out> for Func where Func: Send + Sync +
'static,
for<'a> &'a mut Func: FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12, F13, F14, F15) -> Out +
FnMut(SystemParamItem<F0>, SystemParamItem<F1>, SystemParamItem<F2>,
SystemParamItem<F3>, SystemParamItem<F4>, SystemParamItem<F5>,
SystemParamItem<F6>, SystemParamItem<F7>, SystemParamItem<F8>,
SystemParamItem<F9>, SystemParamItem<F10>, SystemParamItem<F11>,
SystemParamItem<F12>, SystemParamItem<F13>, SystemParamItem<F14>,
SystemParamItem<F15>) -> Out, Out: 'static {
type In = ();
type Out = Out;
type Param =
(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14,
F15);
#[inline]
fn run(&mut self, _input: (),
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14, F15)>) -> Out {
fn call_inner<Out, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14,
F15>(mut f:
impl FnMut(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14, F15) -> Out, F0: F0, F1: F1, F2: F2, F3: F3,
F4: F4, F5: F5, F6: F6, F7: F7, F8: F8, F9: F9, F10: F10,
F11: F11, F12: F12, F13: F13, F14: F14, F15: F15) -> Out {
f(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14,
F15)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14,
F15) = param_value;
call_inner(self, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14, F15)
}
}
#[expect(clippy :: allow_attributes, reason =
"This is within a macro, and as such, the below lints may not always apply.")]
#[allow(non_snake_case, reason =
"Certain variable names are provided by the caller, not by us.")]
impl<In, Out, Func, F0: SystemParam, F1: SystemParam, F2: SystemParam,
F3: SystemParam, F4: SystemParam, F5: SystemParam, F6: SystemParam,
F7: SystemParam, F8: SystemParam, F9: SystemParam, F10: SystemParam,
F11: SystemParam, F12: SystemParam, F13: SystemParam, F14: SystemParam,
F15: SystemParam>
SystemParamFunction<(HasSystemInput,
fn(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14,
F15) -> Out)> for Func where Func: Send + Sync + 'static,
for<'a> &'a mut Func: FnMut(In, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11, F12, F13, F14, F15) -> Out +
FnMut(In::Param<'_>, SystemParamItem<F0>, SystemParamItem<F1>,
SystemParamItem<F2>, SystemParamItem<F3>, SystemParamItem<F4>,
SystemParamItem<F5>, SystemParamItem<F6>, SystemParamItem<F7>,
SystemParamItem<F8>, SystemParamItem<F9>, SystemParamItem<F10>,
SystemParamItem<F11>, SystemParamItem<F12>, SystemParamItem<F13>,
SystemParamItem<F14>, SystemParamItem<F15>) -> Out, In: SystemInput +
'static, Out: 'static {
type In = In;
type Out = Out;
type Param =
(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14,
F15);
#[inline]
fn run(&mut self, input: In::Inner<'_>,
param_value:
SystemParamItem<(F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
F12, F13, F14, F15)>) -> Out {
fn call_inner<In: SystemInput, Out, F0, F1, F2, F3, F4, F5, F6, F7,
F8, F9, F10, F11, F12, F13, F14,
F15>(_: PhantomData<In>,
mut f:
impl FnMut(In::Param<'_>, F0, F1, F2, F3, F4, F5, F6, F7, F8,
F9, F10, F11, F12, F13, F14, F15) -> Out,
input: In::Inner<'_>, F0: F0, F1: F1, F2: F2, F3: F3, F4: F4,
F5: F5, F6: F6, F7: F7, F8: F8, F9: F9, F10: F10, F11: F11,
F12: F12, F13: F13, F14: F14, F15: F15) -> Out {
f(In::wrap(input), F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12, F13, F14, F15)
}
let (F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14,
F15) = param_value;
call_inner(PhantomData::<In>, self, input, F0, F1, F2, F3, F4, F5, F6,
F7, F8, F9, F10, F11, F12, F13, F14, F15)
}
}all_tuples!(impl_system_function, 0, 16, F);
996
997#[cfg(test)]
998mod tests {
999 use super::*;
1000
1001 #[test]
1002 fn into_system_type_id_consistency() {
1003 fn test<T, In: SystemInput, Out, Marker>(function: T)
1004 where
1005 T: IntoSystem<In, Out, Marker> + Copy,
1006 {
1007 fn reference_system() {}
1008
1009 use core::any::TypeId;
1010
1011 let system = IntoSystem::into_system(function);
1012
1013 assert_eq!(
1014 system.system_type(),
1015 function.system_type_id(),
1016 "System::system_type should be consistent with IntoSystem::system_type_id"
1017 );
1018
1019 assert_eq!(
1020 system.system_type(),
1021 TypeId::of::<T::System>(),
1022 "System::system_type should be consistent with TypeId::of::<T::System>()"
1023 );
1024
1025 assert_ne!(
1026 system.system_type(),
1027 IntoSystem::into_system(reference_system).system_type(),
1028 "Different systems should have different TypeIds"
1029 );
1030 }
1031
1032 fn function_system() {}
1033
1034 test(function_system);
1035 }
1036}