paritytech / substrate-up

Scripts for working with new Substrate projects
Apache License 2.0
67 stars 21 forks source link

type annotations needed #42

Closed Vibes-INS closed 3 years ago

Vibes-INS commented 3 years ago
> substrate-node-new demo-node ins

  Substrate Node Template Setup 
  Downloading project...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 71537  100 71537    0     0  10965      0  0:00:06  0:00:06 --:--:-- 15414

Customizing project...
Initializing repository...
Initializing WebAssembly build environment...
Building webassembly binary in runtime/wasm...
Compiling proc-macro2 v0.4.30
...
error[E0282]: type annotations needed
   --> /Users/ins/.cargo/git/checkouts/substrate-7e08433d4c370a21/cc1d67e/srml/indices/src/lib.rs:128:7
    |
128 |         let i = (try_index % enum_set_size).as_();
    |             ^ consider giving `i` a type

error[E0282]: type annotations needed
   --> /Users/ins/.cargo/git/checkouts/substrate-7e08433d4c370a21/cc1d67e/srml/indices/src/lib.rs:156:8
    |
156 |             let item_index = (try_index % enum_set_size).as_();
    |                 ^^^^^^^^^^ consider giving `item_index` a type

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0282`.
error: could not compile `srml-indices`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
shawntabrizi commented 3 years ago

@Vibes-INS you are dealing with a very old version of substrate which has compatibility issues with the latest rust compiler.

What you can do is downgrade your compiler to something from the same era as the substrate code, or you can use the latest substrate templates and code found here: https://github.com/paritytech/substrate-node-template