-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 compile_fail tests #2984
Conversation
You could use |
I chose against this as |
bors r+ |
# Objective - Bevy has several `compile_fail` test - #2254 added `#[derive(Component)]` - Those tests now fail for a different reason. - This was not caught as these test still "successfully" failed to compile. ## Solution - Add `#[derive(Component)]` to the doctest - Also changed their cfg attribute from `doc` to `doctest`, so that these tests don't appear when running `cargo doc` with `--document-private-items`
# Objective bevy_ecs has several compile_fail tests that assert lifetime safety. In the past, these tests have been green for the wrong reasons (see e.g. #2984). This PR makes sure, that they will fail if the compiler error changes. ## Solution Use [trybuild](https://crates.io/crates/trybuild) to assert the compiler errors. The UI tests are in a separate crate that is not part of the Bevy workspace. This is to ensure that they do not break Bevy's crater builds. The tests get executed by the CI workflow on the stable toolchain.
# Objective bevy_ecs has several compile_fail tests that assert lifetime safety. In the past, these tests have been green for the wrong reasons (see e.g. #2984). This PR makes sure, that they will fail if the compiler error changes. ## Solution Use [trybuild](https://crates.io/crates/trybuild) to assert the compiler errors. The UI tests are in a separate crate that is not part of the Bevy workspace. This is to ensure that they do not break Bevy's crater builds. The tests get executed by the CI workflow on the stable toolchain.
Objective
compile_fail
test#[derive(Component)]
on all component structs #2254 added#[derive(Component)]
Solution
#[derive(Component)]
to the doctestdoc
todoctest
, so that these tests don't appear when runningcargo doc
with--document-private-items