Repository navigation
[Merged by Bors] - Lift the 16-field limit from the SystemParam derive - #6867
joseph-gio wants to merge 8 commits into
Conversation
| pub struct UnitParam {} | ||
|
|
||
| #[derive(Resource)] | ||
| pub struct R<const I: usize>; |
There was a problem hiding this comment.
Any reason why you added this over re-using UnitParam?
There was a problem hiding this comment.
I want each field to be a distinct type, to make sure the derive macro doesn't mess up the order of the fields.
| const LIMIT: usize = 16; | ||
| while tuple_types.len() > LIMIT { | ||
| let end = Vec::from_iter(tuple_types.drain(..LIMIT)); | ||
| tuple_types.push(parse_quote!( (#(#end,)*) )); |
There was a problem hiding this comment.
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.
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.
| const LIMIT: usize = 16; | ||
| while tuple_types.len() > LIMIT { | ||
| let end = Vec::from_iter(tuple_types.drain(..LIMIT)); | ||
| tuple_types.push(parse_quote!( (#(#end,)*) )); |
There was a problem hiding this comment.
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.
|
Resolve conflicts and this is good to go! |
|
They are resolved :) |
|
bors r+ |
# Objective
* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
* The error message if you exceed this limit is abysmal.
* Supercedes #5965 -- this does the same thing, but is simpler.
## Solution
If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
SystemParam deriveSystemParam derive
* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
* The error message if you exceed this limit is abysmal.
* Supercedes bevyengine#5965 -- this does the same thing, but is simpler.
If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
# Objective * Currently, the `SystemParam` derive does not support types with const generic parameters. * If you try to use const generics, the error message is cryptic and unhelpful. * Continuation of the work started in #6867 and #6957. ## Solution Allow const generic parameters to be used with `#[derive(SystemParam)]`.
# Objective
* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
* The error message if you exceed this limit is abysmal.
* Supercedes bevyengine#5965 -- this does the same thing, but is simpler.
## Solution
If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
# Objective * Currently, the `SystemParam` derive does not support types with const generic parameters. * If you try to use const generics, the error message is cryptic and unhelpful. * Continuation of the work started in bevyengine#6867 and bevyengine#6957. ## Solution Allow const generic parameters to be used with `#[derive(SystemParam)]`.
# Objective
* The `SystemParam` derive internally uses tuples, which means it is constrained by the 16-field limit on `all_tuples`.
* The error message if you exceed this limit is abysmal.
* Supercedes bevyengine#5965 -- this does the same thing, but is simpler.
## Solution
If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.
# Objective * Currently, the `SystemParam` derive does not support types with const generic parameters. * If you try to use const generics, the error message is cryptic and unhelpful. * Continuation of the work started in bevyengine#6867 and bevyengine#6957. ## Solution Allow const generic parameters to be used with `#[derive(SystemParam)]`.
Objective
SystemParamderive internally uses tuples, which means it is constrained by the 16-field limit onall_tuples.Solution
If any tuples have more than 16 fields, they are folded into tuples of tuples until they are under the 16-field limit.