[SOLVED] "const_fn" feature has been removed

Hello,
I just found quite interesting project: RPN Stack Calculator for DM42.

I was trying to build it, but building the project with a nightly toolchain causes this error:

...
   Compiling num-bigint v0.3.3
   Compiling itertools v0.9.0
   Compiling lock_api v0.3.4
error[E0557]: feature has been removed
  --> C:\Users\...\.cargo\registry\src\github.com-1ecc6299db9ec823\lock_api-0.3.4\src\lib.rs:91:42
   |
91 | #![cfg_attr(feature = "nightly", feature(const_fn))]
   |                                          ^^^^^^^^ feature has been removed
   |
   = note: split into finer-grained feature gates

Does it mean that const_fn is in a stable now? How to fix it?

Yes, const fn is now stable. The dependencies or the code should be upgraded so that they aren't trying to use the now-defunct feature flag.

Ah, Ok. How to do that - add lock-api dependency into Cargo.toml (there is no such dependency yet)

Try if cargo update works.

I did try it, the same result.

Am I correct that I have to take newer (> 0.3.4) lock_api lib into use? There is a kind of chain of dependencies in the project: rscalc_math_cargo.toml -> linked_list_allocator (v.0.8) -> spinning_top -> lock_api 0.3.4.

From Readme of the project:

This project requires the nightly Rust compiler as it has some dependencies that require it (embedded development with the alloc crate is only possible on nightly at this time, and the gtk crate has dependencies on the unstable const_fn feature).

Ok, setting linked_list_allocator from 0.8 to 0.9 in math\Cargo.toml did help - the project built with 2 warnings. Unfortunately, can't test it - can't run GTK app with Ubuntu WSL under Windows 10.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.