lox-space / lox

Oxidized Astrodynamics
Mozilla Public License 2.0
23 stars 1 forks source link

Qualify into trait #109

Closed matzipan closed 3 months ago

matzipan commented 3 months ago

I am not sure if this is the right way forward, but it's a temporary way to fix master:

error[E0283]: type annotations needed
   --> crates/lox-time/src/subsecond.rs:192:35
    |
192 |         assert_eq!(0.0, subsecond.into());
    |                                   ^^^^
    |
note: multiple `impl`s satisfying `subsecond::Subsecond: Into<_>` found
   --> crates/lox-time/src/subsecond.rs:115:1
    |
115 | impl Into<f64> for Subsecond {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: and another `impl` found in the `core` crate:
            - impl<T, U> Into<U> for T
              where U: From<T>;
help: try using a fully qualified path to specify the expected types
    |
192 |         assert_eq!(0.0, <subsecond::Subsecond as Into<T>>::into(subsecond));
    |                         ++++++++++++++++++++++++++++++++++++++++         ~

error[E0283]: type annotations needed
   --> crates/lox-time/src/subsecond.rs:192:35
    |
192 |         assert_eq!(0.0, subsecond.into());
    |         --------------------------^^^^--- type must be known at this point
    |
    = note: multiple `impl`s satisfying `f64: PartialEq<_>` found in the following crates: `core`, `serde_json`:
            - impl PartialEq<serde_json::value::Value> for f64;
            - impl<host> PartialEq for f64
              where the constant `host` has type `bool`;
help: try using a fully qualified path to specify the expected types
    |
192 |         assert_eq!(0.0, <subsecond::Subsecond as Into<T>>::into(subsecond));
    |                         ++++++++++++++++++++++++++++++++++++++++         ~
codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.82%. Comparing base (152f2ec) to head (089dddb).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #109 +/- ## ======================================= Coverage 97.82% 97.82% ======================================= Files 59 59 Lines 20732 20733 +1 ======================================= + Hits 20281 20282 +1 Misses 451 451 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

helgee commented 3 months ago

Problem is that the problem does not exist on main. It seems that adding serde does some spooky action at a distance or did you implement any additional traits on Subsecond @matzipan?

matzipan commented 3 months ago

Problem is that the problem does not exist on main. It seems that adding serde does some spooky action at a distance or did you implement any additional traits on Subsecond @matzipan?

I did not implement any such traits. It might be serde. I'll look into it a bit more.

I guess the solution that Angus suggested is a good way forward. I can make it part of my MR.