Fix velocity_projection bench never compiling - #1040
Open
francisdb wants to merge 1 commit into
Open
Conversation
Author
|
|
The velocity_projection bench target required a "test" feature that was never declared, so cargo skipped the bench and printed an invalid-feature warning on every build. Since the bench never compiled, it had also bit-rotted: it imported the since-removed avian3d::math::PI along with an unused Vec3. Declare the test feature in avian2d and avian3d, gate the shared test utilities module on cfg(any(test, feature = "test")) so benches can use QuasiRandomDirection, and drop the stale bench imports. Enable the feature in the CI clippy invocation so the bench keeps compiling. The bench now runs with: cargo bench -p avian3d --features test
francisdb
force-pushed
the
fix/velocity-projection-bench
branch
from
August 5, 2026 09:53
7627a8d to
d1615da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Remove invalid-feature warning on every build
Solution
The velocity_projection bench target required a "test" feature that was never declared, so cargo skipped the bench and printed an invalid-feature warning on every build. Since the bench never compiled, it had also bit-rotted: it imported the since-removed avian3d::math::PI along with an unused Vec3.
Declare the test feature in avian2d and avian3d, gate the shared test utilities module on cfg(any(test, feature = "test")) so benches can use QuasiRandomDirection, and drop the stale bench imports. The bench now compiles and runs with: cargo bench -p avian3d --features test
I kept the
testfeature name from the bench's originalrequired-features, but can rename it to something liketest-utilif you prefer, sincecfg(any(test, feature = "test"))is confusing.AI assisted
Testing
The CI clippy step now runs cargo clippy --locked --all-targets --features avian2d/test,avian3d/test, which compiles and lints the bench on every PR. Verified locally with CI's deny-warnings flags