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

Use static_assertions for compilation tests #11181

Closed
alice-i-cecile opened this issue Jan 2, 2024 · 0 comments · Fixed by #11182
Closed

Use static_assertions for compilation tests #11181

alice-i-cecile opened this issue Jan 2, 2024 · 0 comments · Fixed by #11182
Labels
C-Code-Quality A section of code that is hard to understand or change C-Testing A change that impacts how we test Bevy or how users test their apps

Comments

@alice-i-cecile
Copy link
Member

          I'm pretty partial to having something similar to `static_assertions` (it's already in our dependency tree), which includes a assertion that will fail compilation if a type does not implement a trait. I think it should be fine to use it as a dev dependency over these tests which actually need to run when running our test suites.

This is a strict non-blocker and we can tackle this in a separate PR.

Originally posted by @james7132 in #11178 (comment)

@alice-i-cecile alice-i-cecile added C-Code-Quality A section of code that is hard to understand or change C-Testing A change that impacts how we test Bevy or how users test their apps labels Jan 2, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 2, 2024
# Objective

- We want to use `static_assertions` to perform precise compile time
checks at testing time. In this PR, we add those checks to make sure
that `EntityHashMap` and `PreHashMap` are `Clone` (and we replace the
more clumsy previous tests)
- Fixes #11181 

(will need to be rebased once
#11178 is merged)

---------

Co-authored-by: Charles Bournhonesque <cbournhonesque@snapchat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Code-Quality A section of code that is hard to understand or change C-Testing A change that impacts how we test Bevy or how users test their apps
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant