Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duration from checked_duration_since cannot be added with Instant? #89

Closed
korken89 opened this issue Dec 12, 2020 · 1 comment · Fixed by #90 · May be fixed by #114
Closed

Duration from checked_duration_since cannot be added with Instant? #89

korken89 opened this issue Dec 12, 2020 · 1 comment · Fixed by #90 · May be fixed by #114
Milestone

Comments

@korken89
Copy link
Collaborator

Hi,

I am working on moving RTIC to embedded time, however the following trivial code gives a weird trait bound error that I need help with.
What is causing this as is there a recommended fix?

Code:

let now = M::now();

match instant.checked_duration_since(&now) {
    None => {
        // ...
    }
    Some(dur) => {
        let new_instant = now + dur; // <-- error

        // ...
    }
}

Error:

error[E0277]: the trait bound `rtic_core::monotonic::Generic<<M as rtic_core::monotonic::Clock>::T>: FixedPoint` is not satisfied
  --> src/tq.rs:71:47
   |
71 |                         let new_instant = now + dur;
   |                                               ^ the trait `FixedPoint` is not implemented for `rtic_core::monotonic::Generic<<M as rtic_core::monotonic::Clock>::T>`
   |
   = note: required because of the requirements on the impl of `Add<rtic_core::monotonic::Generic<<M as rtic_core::monotonic::Clock>::T>>` for `Instant<M>`
@PTaylor-us PTaylor-us linked a pull request Aug 29, 2021 that will close this issue
4 tasks
@PTaylor-us PTaylor-us added this to the v0.13.0 milestone Aug 29, 2021
@PTaylor-us
Copy link
Member

Completed v0.13.0 release PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants