-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Description
Here's a minimal example of what I'm trying to do:
#![allow(dead_code)]
use bevy::prelude::*;
use bevy::ecs::system::SystemParam;
fn main() {
App::build()
.add_system(generic_system::<NullImpl>.system())
.add_system(bound_generic_system.system())
.run()
}
fn generic_system<T>(t: T) {}
fn bound_generic_system(t: NullImpl) {}
#[derive(SystemParam)]
pub struct NullImpl<'a> {
marker: Res<'a, ()>,
}AFAIU, the problem is that generic_system::<NullImpl> is implicitly binding NullImpl<'_>, so that it doesn't satisfy for<'a>. I would think it should work if I were able to write something like: generic_system::<for<'a> NullImpl<'a>>.system(), but that doesn't parse.
Is there something I can do to make this compile? I've tried to make a non-bevy example to ask the broader Rust community, but I haven't been able to reproduce.
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished