avr-rust / ruduino

Reusable components for the Arduino Uno.
Apache License 2.0
702 stars 50 forks source link

#[feature(const_fn)] removed on latest rust nightly #39

Closed gui2maraes closed 2 years ago

gui2maraes commented 3 years ago

When trying to compile an example program, I get this error from the ruduino crate:

error[E0557]: feature has been removed
 --> /home/ggsvr/.cargo/registry/src/github.com-1ecc6299db9ec823/ruduino-0.3.2/src/lib.rs:4:12
  |
4 | #![feature(const_fn)]
  |            ^^^^^^^^ feature has been removed
  |
  = note: split into finer-grained feature gates

I get another error from LLVM "Not supported instr", but I don't think they're related.

lord-ne commented 3 years ago

It seems like the only reason const_fn was removed as a feature flag is because it's now in stable. So just removing the line #![feature(const_fn)] will probably work.

I only actually found one use of const fn in the code anyway, here: https://github.com/avr-rust/ruduino/blob/e6ebb190376a5fb6eb5062a65008bfa8fc982ab8/src/register.rs#L159