mirror of
https://github.com/bevyengine/bevy
synced 2024-12-18 09:03:07 +00:00
a8b9c945c7
# Objective - Contributes to #15460 ## Solution - Added two new features, `std` (default) and `alloc`, gating `std` and `alloc` behind them respectively. - Added missing `f32` functions to `std_ops` as required. These `f32` methods have been added to the `clippy.toml` deny list to aid in `no_std` development. ## Testing - CI - `cargo clippy -p bevy_math --no-default-features --features libm --target "x86_64-unknown-none"` - `cargo test -p bevy_math --no-default-features --features libm` - `cargo test -p bevy_math --no-default-features --features "libm, alloc"` - `cargo test -p bevy_math --no-default-features --features "libm, alloc, std"` - `cargo test -p bevy_math --no-default-features --features "std"` ## Notes The following items require the `alloc` feature to be enabled: - `CubicBSpline` - `CubicBezier` - `CubicCardinalSpline` - `CubicCurve` - `CubicGenerator` - `CubicHermite` - `CubicNurbs` - `CyclicCubicGenerator` - `RationalCurve` - `RationalGenerator` - `BoxedPolygon` - `BoxedPolyline2d` - `BoxedPolyline3d` - `SampleCurve` - `SampleAutoCurve` - `UnevenSampleCurve` - `UnevenSampleAutoCurve` - `EvenCore` - `UnevenCore` - `ChunkedUnevenCore` This requirement could be relaxed in certain cases, but I had erred on the side of gating rather than modifying. Since `no_std` is a new set of platforms we are adding support to, and the `alloc` feature is enabled by default, this is not a breaking change. --------- Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com> Co-authored-by: Matty <2975848+mweatherley@users.noreply.github.com> Co-authored-by: Joona Aalto <jondolf.dev@gmail.com>
38 lines
3 KiB
TOML
38 lines
3 KiB
TOML
disallowed-methods = [
|
|
{ path = "f32::powi", reason = "use ops::FloatPow::squared, ops::FloatPow::cubed, or ops::powf instead for libm determinism" },
|
|
{ path = "f32::log", reason = "use ops::ln, ops::log2, or ops::log10 instead for libm determinism" },
|
|
{ path = "f32::abs_sub", reason = "deprecated and deeply confusing method" },
|
|
{ path = "f32::powf", reason = "use ops::powf instead for libm determinism" },
|
|
{ path = "f32::exp", reason = "use ops::exp instead for libm determinism" },
|
|
{ path = "f32::exp2", reason = "use ops::exp2 instead for libm determinism" },
|
|
{ path = "f32::ln", reason = "use ops::ln instead for libm determinism" },
|
|
{ path = "f32::log2", reason = "use ops::log2 instead for libm determinism" },
|
|
{ path = "f32::log10", reason = "use ops::log10 instead for libm determinism" },
|
|
{ path = "f32::cbrt", reason = "use ops::cbrt instead for libm determinism" },
|
|
{ path = "f32::hypot", reason = "use ops::hypot instead for libm determinism" },
|
|
{ path = "f32::sin", reason = "use ops::sin instead for libm determinism" },
|
|
{ path = "f32::cos", reason = "use ops::cos instead for libm determinism" },
|
|
{ path = "f32::tan", reason = "use ops::tan instead for libm determinism" },
|
|
{ path = "f32::asin", reason = "use ops::asin instead for libm determinism" },
|
|
{ path = "f32::acos", reason = "use ops::acos instead for libm determinism" },
|
|
{ path = "f32::atan", reason = "use ops::atan instead for libm determinism" },
|
|
{ path = "f32::atan2", reason = "use ops::atan2 instead for libm determinism" },
|
|
{ path = "f32::sin_cos", reason = "use ops::sin_cos instead for libm determinism" },
|
|
{ path = "f32::exp_m1", reason = "use ops::exp_m1 instead for libm determinism" },
|
|
{ path = "f32::ln_1p", reason = "use ops::ln_1p instead for libm determinism" },
|
|
{ path = "f32::sinh", reason = "use ops::sinh instead for libm determinism" },
|
|
{ path = "f32::cosh", reason = "use ops::cosh instead for libm determinism" },
|
|
{ path = "f32::tanh", reason = "use ops::tanh instead for libm determinism" },
|
|
{ path = "f32::asinh", reason = "use ops::asinh instead for libm determinism" },
|
|
{ path = "f32::acosh", reason = "use ops::acosh instead for libm determinism" },
|
|
{ path = "f32::atanh", reason = "use ops::atanh instead for libm determinism" },
|
|
# These methods have defined precision, but are only available from the standard library,
|
|
# not in core. Using these substitutes allows for no_std compatibility.
|
|
{ path = "f32::rem_euclid", reason = "use ops::rem_euclid instead for no_std compatibility" },
|
|
{ path = "f32::abs", reason = "use ops::abs instead for no_std compatibility" },
|
|
{ path = "f32::sqrt", reason = "use ops::sqrt instead for no_std compatibility" },
|
|
{ path = "f32::copysign", reason = "use ops::copysign instead for no_std compatibility" },
|
|
{ path = "f32::round", reason = "use ops::round instead for no_std compatibility" },
|
|
{ path = "f32::floor", reason = "use ops::floor instead for no_std compatibility" },
|
|
{ path = "f32::fract", reason = "use ops::fract instead for no_std compatibility" },
|
|
]
|