Skip to content

[Merged by Bors] - better error message on failed derive #1491

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

Closed

Conversation

jakobhellermann
Copy link
Contributor

Before, when deriving SystemLabel for a type without Clone, the error message was:

the trait `SystemLabel` is not implemented for `&TransformSystem`

Now it is

the trait `Clone` is not implemented for `TransformSystem`

which directly shows what's needed to fix the problem.

@DJMcNab DJMcNab added the A-ECS Entities, components, systems, and events label Feb 21, 2021
Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

Since we use Box as a raw identifier here, it should be fine, but it's worth considering whether we want to require that crates which use our macros should always require the prelude be included.

In this case however, this change is a clear win and these thoughts are unrelated to the changes here.

@DJMcNab DJMcNab added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Feb 21, 2021
@Ratysz Ratysz added C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 21, 2021
@cart
Copy link
Member

cart commented Feb 22, 2021

bors r+

bors bot pushed a commit that referenced this pull request Feb 22, 2021
Before, when deriving `SystemLabel` for a type without `Clone`, the error message was:
```
the trait `SystemLabel` is not implemented for `&TransformSystem`
```
Now it is
```
the trait `Clone` is not implemented for `TransformSystem`
```
which directly shows what's needed to fix the problem.
@bors
Copy link
Contributor

bors bot commented Feb 22, 2021

@bors bors bot changed the title better error message on failed derive [Merged by Bors] - better error message on failed derive Feb 22, 2021
@bors bors bot closed this Feb 22, 2021
@jakobhellermann jakobhellermann deleted the better-error-msg branch February 22, 2021 09:14
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-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use 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.

5 participants