korken89 / fugit

`fugit` provides a comprehensive library of `Duration` and `Instant` for the handling of time in embedded systems, doing all it can at compile time.
Apache License 2.0
55 stars 16 forks source link

fugit compile problem #16

Closed pdgilbert closed 2 years ago

pdgilbert commented 2 years ago

One of the last few commits, just prior to release of v0.3.3, has started giving me compile errors

   Compiling fugit v0.3.3
error[E0658]: panicking in constants is unstable
  --> /home/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/fugit-0.3.3/src/helpers.rs:48:32
   |
48 |     pub const GREATER_EQ: () = assert!(L >= R);
   |                                ^^^^^^^^^^^^^^^
   |
   = note: see issue #51999 <https://github.com/rust-lang/rust/issues/51999> for more information
   = note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)

Any ideas?

TDHolmes commented 2 years ago

Recent commits have started to use const panic. Update your rust install to newest (1.57 at least I think?)

korken89 commented 2 years ago

Indeed fugit requires 1.57 att the moment.

pdgilbert commented 2 years ago

Thanks, that solved it. Seems like I just updated to 1.56 a few weeks ago. I guess I'm in the fast lane. Got my examples mostly building again with cortex-m-rtic release 1.0.0 (see https://github.com/pdgilbert/rust-integration-testing/actions/runs/1641101680).