Stream: contributing

Topic: rust toolchain on main


view this post on Zulip Chris (Mar 28 2023 at 12:06):

Hi! Which rust toolchain should I use to run builds and tests on main? After running tests in nix developfirst I got error about this-error crate using nightly feature provide_any, but after switching to nightly in rust-toolchain.toml I got another error in gen_llvm crate about let ... else statement being unstable. I tried adding the #![feature(let_else)] but I'm not sure where to put it.

view this post on Zulip Folkert de Vries (Mar 28 2023 at 12:16):

I suspect your rust version is old

view this post on Zulip Folkert de Vries (Mar 28 2023 at 12:17):

hmm actually, maybe the compiler rust version is old? @Anton the toolchain toml says it's 1.65 still. rust is on 1.68 at this point. maybe we can upgrade again?

view this post on Zulip Folkert de Vries (Mar 28 2023 at 12:18):

to anwer the question: the roc compiler uses the stable toolchain

view this post on Zulip Folkert de Vries (Mar 28 2023 at 12:19):

and based on the rust-toolchain.toml it uses rust 1.65

view this post on Zulip Folkert de Vries (Mar 28 2023 at 12:19):

you can run e.g. cargo --version to see which version you actually have

view this post on Zulip Anton (Mar 28 2023 at 12:19):

I'll make a note to upgrade.
But with nix you can basically not use the wrong rust version, so I think something is off

view this post on Zulip Folkert de Vries (Mar 28 2023 at 12:20):

well based on the errors, the compiler used is too old for the code that it is compiling

view this post on Zulip Anton (Mar 28 2023 at 12:20):

@ziutech can you tell me what OS you are on and the sequence of commands you executed?

view this post on Zulip Anton (Mar 28 2023 at 12:21):

Are you using the main branch without any changes?

view this post on Zulip Chris (Mar 28 2023 at 12:25):

I'm on linux
I'm directly on main, without any changes
I updated my fork, pulled changes, then run nix develop and cargo run

view this post on Zulip Anton (Mar 28 2023 at 12:27):

While in a nix shell (=after having executed nix develop), can you do a cargo clean, followed by cargo run repl?

view this post on Zulip Anton (Mar 28 2023 at 12:27):

I suspect that you have some rust crates in play from once executing cargo without nix.

view this post on Zulip Chris (Mar 28 2023 at 12:35):

Okay, now everything works, thank you

view this post on Zulip Anton (Mar 28 2023 at 12:44):

Several people have encountered this issue. I wonder if we could alias cargo in the flake to quickly inspect some metadata before running so that we can provide a nice error message when crates compiled outside of nix are detected :thinking:


Last updated: Jul 06 2025 at 12:14 UTC