nrf-rs / nrf-hal

A Rust HAL for the nRF family of devices
Apache License 2.0
507 stars 140 forks source link

Fixed 1.7.0 won't compile, cargo update breaks previously working code #304

Closed nebelgrau77 closed 3 years ago

nebelgrau77 commented 3 years ago

OK, I know it's probably me doing something wrong again, but: I had some working code, running on nRF52840 boards. I wanted to experiment with PWM, so I copied my simple blink example and tried to add PWM. As it couldn't find various things, I ran cargo update and it broke everything, that is even the previously working blink example won't compile. The problem seems to be fixed 1.7.0, and the errors I'm getting are:

error: `num::<impl u8>::next_power_of_two` is not yet stable as a const fn
   --> /home/nebelgrau/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-1.7.0/src/macros_no_frac.rs:896:41
    |
896 |                           Self::from_bits(self.to_bits().next_power_of_two())
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    | 
   ::: /home/nebelgrau/.cargo/registry/src/github.com-1ecc6299db9ec823/fixed-1.7.0/src/lib.rs:497:1
    |
497 | / fixed! {
498 | |     "An eight-bit fixed-point unsigned",
499 | |     FixedU8(u8, LeEqU8, "8", "7", "6", "5", "4"),
500 | |     1, "0x12", "0x12", "[0x12]", "[0x12]",
...   |
503 | |     FixedU16, u16, True
504 | | }
    | |_- in this macro invocation
    |
    = help: add `#![feature(const_int_pow)]` to the crate attributes to enable
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

Not sure what I'm supposed to do and where to add the '#![feature...]' if that's the necessary fix.

nebelgrau77 commented 3 years ago

all it needed was rustup update (to 1.50), now it compiles again.