0

ı'm trying to compile the smart contract with "cargo +nightly contract build" but it gives this error below. Everything is up to date. I can't seem to find the answer. Please help me on this matter.

Updating crates.io index
   Compiling flipper v0.1.0 (/private/var/folders/0n/pj5x0p_n66q348m2wdhdm3w00000gn/T/cargo-contract_43QsMb)
error[E0158]: associated consts cannot be referenced in patterns
  --> /Users/arifburakkorkmaz/flipper/lib.rs:8:5
   |
8  | /     /// Defines the storage of your contract.
9  | |     /// Add new fields to the below struct in order
10 | |     /// to add new static storage fields to your contract.
11 | |     #[ink(storage)]
...  |
14 | |         value: bool,
15 | |     }
   | |_____^

For more information about this error, try `rustc --explain E0158`.
error: could not compile `flipper` due to previous error
ERROR: `"/Users/arifburakkorkmaz/.rustup/toolchains/nightly-aarch64-apple-darwin/bin/cargo" "build" "--target=wasm32-unknown-unknown" "-Zbuild-std" "--no-default-features" "--release" "--target-dir=/Users/arifburakkorkmaz/flipper/target/ink" "--features=ink_env/ink-debug"` failed with exit code: Some(101)
2
  • 1
    This a known issue right now. An update of the nightly compiler has, unfortunately, broken the compilation process. This question contains the answer. And this issue will fix the error. Oct 3, 2022 at 19:05
  • I use cargo +nightly-2022-08-15 test rather cargo +nightly test to test and cargo +nightly-2022-08-15 contract build to build rather cargo +nightly contract build today and it works for me. My cargo contract version cargo-contract 1.5.0-unknown-x86_64-apple-darwin and rustc 1.66.0-nightly (c0983a9aa 2022-10-12))
    – Ganesh11
    Oct 14, 2022 at 2:09

0

Browse other questions tagged or ask your own question.