uuosio/rscdk

Cannot compile with Rust `nightly-1.81.0`

Opened this issue · 0 comments

Recently the Rust release 1.81.0 has introduced a breaking change for no_std environments, in particular inside the PanicInfo data structure (see the related release notes).

The rscdk needs to be updated in order to be compatible with newer compiler versions.

Steps to reproduce

Note: to avoid breaking the local workspace, it's recommended to test these steps on a Docker container or a similar non-persistent environment.

  1. Install the latest nightly version of Rust (version >= 1.81.0)
  2. Clone the rscdk repository and switch to its folder
  3. Compile using wasm32-unknown-unknown as target and no default features (to disable std)
rustup update
git clone git@github.com:uuosio/rscdk.git
cd rscdk
cargo +nightly build --target wasm32-unknown-unknown --no-default-features

The compiler returns the following error:

error[E0599]: no method named `unwrap` found for struct `PanicMessage` in the current scope
  --> crates/chain/src/lib.rs:16:46
   |
16 |     let msg = format!("{:?}", info.message().unwrap().as_str().unwrap());
   |                                              ^^^^^^ method not found in `PanicMessage<'_>`

Expected behavior

  • The project compiles both with Rust 1.81.0 and older versions