Skip to content

Conversation

@Fachep
Copy link

@Fachep Fachep commented Dec 31, 2025

Objective

Fix non_camel_case_types warning emitted by generic type parameters generated by #[system_param(builder)].

#[derive(SystemParam)]
#[system_param(builder)]
struct MySystemParam<'w, 's> {
    query_field: Query<'w, 's ,Entity>,
}
> cargo check
...
warning: type parameter `Bquery_field` should have an upper camel case name
   --> src\lib.rs:171:9
    |
171 |         query_field: Query<'w, 's ,Entity>,
    |         ^^^^^^^^^^^ help: convert the identifier to upper camel case: `BqueryField`
...

Solution

Add #[allow(non_camel_case_types)] to each generated type parameter when declaring, in the SystemParam derive macro.

Testing

By referencing this branch in Cargo.toml, the warning no longer occurs for the usage above when running cargo check.

Copilot AI review requested due to automatic review settings December 31, 2025 14:36
@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a compiler warning for generated type parameters in the SystemParam derive macro when using the #[system_param(builder)] attribute. The macro generates type parameters by prefixing field names with "B", which creates non-camel-case identifiers (e.g., Bquery_field) that trigger linting warnings.

  • Added #[allow(non_camel_case_types)] attribute to generated type parameters to suppress the warning

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-ECS Entities, components, systems, and events S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Macros Code that generates Rust code labels Dec 31, 2025
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

A comment here might be nice, but this is a perfectly fine fix.

@Fachep Fachep force-pushed the fix-system-param-builder-generic-naming branch from 3efff92 to 61da471 Compare January 1, 2026 05:45
@alice-i-cecile alice-i-cecile added D-Straightforward Simple bug fixes and API improvements, docs, test and examples X-Uncontroversial This work is generally agreed upon labels Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Macros Code that generates Rust code D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants