Rust example compiler error


I’m tring to test dfinity rust example on examples/rust/counter at master · dfinity/examples · GitHub, but failed all the time.

dfx version: 0.12.1
rust version: 1.65.0 (897e37553 2022-11-02)


  • git clone && cd rust/counter
  • make install

base docker image: ubuntu:latest

Cannot reproduce. It works on my machine, also with rust 1.65.0. Given that the errors appear come from the typenum crate and not the example code itself I would assume that this is a problem with your setup or something that happened when fetching dependencies, which we have no control over. Have you tried deleting your local caches or reinstalling rust?

Do you try in docker or local machine? Everytime I started a new docker image, so I’m sure no cache problem. What I do are only git clone and make install.

Some ideas:

  • Make sure to add “wasm32-unknown-unknown” by running

rustup target add wasm32-unknown-unknown

  • Try running this from a non-root account
1 Like