Skip to content
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] - Fix type parameter name conflicts of derive(Bundle) #4636

Closed
wants to merge 1 commit into from

Conversation

infmagic2047
Copy link
Contributor

Objective

This code currently fails to compile with error the name `T` is already used for a generic parameter in this item's generic parameters, because T is also used in code generated by derive(Bundle).

#[derive(Bundle)]
struct MyBundle<T: Component> {
    component: T,
}

Solution

Add double underscores to type parameter names in derive(Bundle).

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label May 1, 2022
@BoxyUwU BoxyUwU added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled labels May 1, 2022
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request May 2, 2022
# Objective

This code currently fails to compile with error ``the name `T` is already used for a generic parameter in this item's generic parameters``, because `T` is also used in code generated by `derive(Bundle)`.

```rust
#[derive(Bundle)]
struct MyBundle<T: Component> {
    component: T,
}
```

## Solution

Add double underscores to type parameter names in `derive(Bundle)`.
@bors bors bot changed the title Fix type parameter name conflicts of derive(Bundle) [Merged by Bors] - Fix type parameter name conflicts of derive(Bundle) May 2, 2022
@bors bors bot closed this May 2, 2022
exjam pushed a commit to exjam/bevy that referenced this pull request May 22, 2022
# Objective

This code currently fails to compile with error ``the name `T` is already used for a generic parameter in this item's generic parameters``, because `T` is also used in code generated by `derive(Bundle)`.

```rust
#[derive(Bundle)]
struct MyBundle<T: Component> {
    component: T,
}
```

## Solution

Add double underscores to type parameter names in `derive(Bundle)`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

This code currently fails to compile with error ``the name `T` is already used for a generic parameter in this item's generic parameters``, because `T` is also used in code generated by `derive(Bundle)`.

```rust
#[derive(Bundle)]
struct MyBundle<T: Component> {
    component: T,
}
```

## Solution

Add double underscores to type parameter names in `derive(Bundle)`.
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 S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants