Skip to content

Conversation

@Bleachfuel
Copy link
Contributor

Objective

Some macros were handling Idents and indexes as seperate things, we can use syn::Member to make this more readable and nicer.

Testing

ran all revelant crate tests.

@Bleachfuel
Copy link
Contributor Author

Bleachfuel commented Mar 8, 2025

#[derive(QueryData)]
#[query_data(mutable(foo))]
//~^ ERROR: `mutable` does not take any arguments
struct MutableInvalidAttributeParameters {
    a: &'static mut Foo,
}

should we really give a error for this? seems so unnessesary and extra code. When u do this it already says "expected ,". I removed 2 of them, since the errors that syn gives are already clear. Maybe even clearer.

@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Macros Code that generates Rust code labels Mar 8, 2025
@alice-i-cecile alice-i-cecile requested a review from chescock April 2, 2025 19:25
@alice-i-cecile alice-i-cecile added the A-Cross-Cutting Impacts the entire engine label Apr 2, 2025
Copy link
Contributor

@chescock chescock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this seems cleaner!

It's a little unfortunate that syn::Member doesn't have the rest of the Field value, forcing most of the uses here to do fields.iter().enumerate().filter().map() instead of just field.members(). Would it ever make sense to add our own wrapper type around a &Field and its index, along with a function to iterate them from a Fields, so that we could share a little more code here?

@Bleachfuel
Copy link
Contributor Author

Yeah we could do that, but would be better as a follow up pr

Copy link
Member

@james7132 james7132 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so much cleaner! LGTM.

@james7132 james7132 requested a review from MrGVSV September 4, 2025 08:50
@james7132 james7132 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 4, 2025
@alice-i-cecile
Copy link
Member

@Bleachfuel, I would rather like to merge this, but the merge conflicts are non-trivial. Could you take a look?

@alice-i-cecile
Copy link
Member

CI is still failing unfortunately :(

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Sep 14, 2025
@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-18199

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

1 similar comment
@github-actions
Copy link
Contributor

Your PR caused a change in the graphical output of an example or rendering test. This might be intentional, but it could also mean that something broke!
You can review it at https://pixel-eagle.com/project/B04F67C0-C054-4A6F-92EC-F599FEC2FD1D?filter=PR-18199

If it's expected, please add the M-Deliberate-Rendering-Change label.

If this change seems unrelated to your PR, you can consider updating your PR to target the latest main branch, either by rebasing or merging main into it.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Oct 29, 2025
@alice-i-cecile
Copy link
Member

Closing as adopted.

github-merge-queue bot pushed a commit that referenced this pull request Oct 30, 2025
# Objective

Some macros were handling Idents and indexes as seperate things, we can
use syn::Member to make this more readable and nicer.

revive of #18199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Cross-Cutting Impacts the entire engine C-Code-Quality A section of code that is hard to understand or change D-Macros Code that generates Rust code D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants