`#![feature]` may not be used on the stable release channel

When typed, cargo concordium build, we are getting some error as attached in the screenshot below. Rust version used is 1.70.
We have tried by downgrading the version to 1.69 and 1.68 as well. But the error persists.

You do not have the std feature enabled by the looks of it.

The library without the std feature is only usable on nightly rust compiler versions, precisely because some features are not standardized yet.

So you have two options

  • use the std feature
  • use a nightly compiler version.

Thank you @abizjak .

We enabled the std library in Cargo.toml file. Now when executed the command “cargo concordium build”. It compiles the code. But says “Error: Could not build smart contract.”. The error is attached below.

Which version of cargo-concordium are you using?

I believe if you use version 3+ this error should not be there anymore. Version 3 introduces more allowed instructions.

Thank you @abizjak.
We are using cargo-concordium version as 2.9.0. Could you tell us the way to upgrade the version.

That depends a bit on how you installed it.

But the recommended way of installing cargo concordium is to do

cargo install --locked cargo-concordium