bevy/crates/bevy_math
Matty 6521e759ea
Improve PhantomData held by curve adaptors (#15881)
# Objective

The previous `PhantomData` instances were written somewhat lazily, so
they were just things like `PhantomData<T>` for curves with an output
type of `T`. This looks innocuous, but it unnecessarily constrains
`Send/Sync` inference based on `T`. See
[here](https://doc.rust-lang.org/nomicon/phantom-data.html#table-of-phantomdata-patterns).

## Solution

Switch to `PhantomData` of the form `PhantomData<fn() -> T>` for most of
these adaptors. Since they only have a functional relationship to `T`
(i.e. it shows up in the return type of trait methods), this is more
accurate.

## Testing

Tested by compiling Bevy.

Co-authored-by: François Mockers <mockersf@gmail.com>
2024-10-13 17:06:21 +00:00
..
src Improve PhantomData held by curve adaptors (#15881) 2024-10-13 17:06:21 +00:00
Cargo.toml Put curve-related stuff behind a feature (#15790) 2024-10-09 16:38:23 +00:00
clippy.toml Make bevy_math's libm feature use libm for all f32methods with unspecified precision (#14693) 2024-08-12 16:13:36 +00:00
README.md Add README.md to all crates (#13184) 2024-05-02 18:56:00 +00:00

Bevy Math

License Crates.io Downloads Docs Discord