I have two crates that I use in my projects that I have on Github, one is for maths and one is for graphics. The graphics crate uses some features for the maths crate for camera maths and mesh generation.
When using cargo check on the graphics crate, it reports that the Ord trait is not implemented for my Vector 3 type despite the fact that it is:
error[E0277]: the trait bound `Vector3: Ord` is not satisfied
impl Ord for Vector3 {
(I have excluded the ordering code as it is quite long and not relevant here)
Furthermore, in another project that uses both, cargo check also claims the camera maths file has an issue as I cannot multiply my Matrix3 type by Vector3 despite, again, this being possible:
error[E0277]: cannot multiply `Matrix3` by `Vector3`
impl Mul<Vector3> for Matrix3 {
type Output = Vector3;
fn mul(self, rhs: Vector3) -> Self::Output {
let x = rhs.dot(self.x);
let y = rhs.dot(self.y);
let z = rhs.dot(self.z);
Vector3::new(x, y, z)
}
}
Despite cargo check claiming there are issues, the code all compiles fine and runs as expected, the main issue is that it seems to cause issues with my rust extension in VSCode so it doesn't give me syntax highlighting or proper intellisense. Running cargo update doesn't fix the issue either as the crates are all up to date.
I would be interested to know if there is a fix for this, or if it's just a problem I'll have to deal with.
Github links if needed: