-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Lift the 16-field limit from the SystemParam
derive
#6867
Changes from all commits
d5d0a2a
768b8e1
19da0e0
2c8518c
c8d64f0
17568f8
5aabe45
513afbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1661,6 +1661,35 @@ mod tests { | |
_local: Local<'s, T>, | ||
} | ||
|
||
#[derive(Resource)] | ||
pub struct R<const I: usize>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason why you added this over re-using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want each field to be a distinct type, to make sure the derive macro doesn't mess up the order of the fields. |
||
|
||
#[derive(SystemParam)] | ||
pub struct LongParam<'w> { | ||
_r0: Res<'w, R<0>>, | ||
_r1: Res<'w, R<1>>, | ||
_r2: Res<'w, R<2>>, | ||
_r3: Res<'w, R<3>>, | ||
_r4: Res<'w, R<4>>, | ||
_r5: Res<'w, R<5>>, | ||
_r6: Res<'w, R<6>>, | ||
_r7: Res<'w, R<7>>, | ||
_r8: Res<'w, R<8>>, | ||
_r9: Res<'w, R<9>>, | ||
_r10: Res<'w, R<10>>, | ||
_r11: Res<'w, R<11>>, | ||
_r12: Res<'w, R<12>>, | ||
_r13: Res<'w, R<13>>, | ||
_r14: Res<'w, R<14>>, | ||
_r15: Res<'w, R<15>>, | ||
_r16: Res<'w, R<16>>, | ||
} | ||
|
||
#[allow(dead_code)] | ||
fn long_system(_param: LongParam) { | ||
crate::system::assert_is_system(long_system); | ||
} | ||
|
||
#[derive(SystemParam)] | ||
pub struct UnitParam; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit difficult to follow this but does this make a tuple of tuples? Wouldn't that just raise the limit to 256 instead of removing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait I think I see what this is doing. My god this is going to have a lot of codgen for anything more than 32 entries, but you probably already should be expecting that with a ParamSet that big.