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

#[derive(Bundle)] is not hygienic #5817

Closed
derivator opened this issue Aug 27, 2022 · 1 comment
Closed

#[derive(Bundle)] is not hygienic #5817

derivator opened this issue Aug 27, 2022 · 1 comment
Labels
A-ECS Entities, components, systems, and events C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy

Comments

@derivator
Copy link

Bevy version

0.8

What you did

use egui::Shape::Vec;

#[derive(Bundle)]
pub struct MyBundle {
    f: Foo,
}

What went wrong

Compilation fails with:

error[E0573]: expected type, found variant `Vec`

because this does not use the fully qualified type name std::vec::Vec and proc-macros are not hygienic.

Additional information

Yes, egui has an enum-variant called Vec and my IDE sometimes randomly tries to be helpful and imports it for me. 😄

impl_param_set also uses lots of bevy-specific types without fully qualified names, but I'm not sure if that's a problem.

@derivator derivator added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Aug 27, 2022
@nicopap nicopap added A-Reflection Runtime information about types A-ECS Entities, components, systems, and events and removed S-Needs-Triage This issue needs to be labelled A-Reflection Runtime information about types labels Aug 27, 2022
@alice-i-cecile alice-i-cecile added the D-Trivial Nice and easy! A great choice to get started with Bevy label Aug 27, 2022
jgoday added a commit to jgoday/bevy that referenced this issue Aug 29, 2022
@jgoday
Copy link
Contributor

jgoday commented Aug 29, 2022

Hi, just started to look and play with bevy.
This is a simple #5835 PR that tries to address this issue.

@bors bors bot closed this as completed in 46f6816 Aug 30, 2022
james7132 pushed a commit to james7132/bevy that referenced this issue Oct 28, 2022
# Objective
- Fixes bevyengine#5817.
- Removes std::vec::Vec ambiguities in derive_bundle macro

## Solution
Prepend :: to standard library full Vec qualified type name (::std::vec::Vec)
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective
- Fixes bevyengine#5817.
- Removes std::vec::Vec ambiguities in derive_bundle macro

## Solution
Prepend :: to standard library full Vec qualified type name (::std::vec::Vec)
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-Trivial Nice and easy! A great choice to get started with Bevy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants