Ask coding questions

← Back to all posts
Can I use nightly Rust in a Repl?
h
CaptainAnon (150)

Rust includes both nightly and stable builds. For an application I'm building I'd like to use nightly builds instead of the stable build (which I think is the default option). Is there a way to do this (I've tried using the rustup command)?

Comments
hotnewtop
Coder100 (18939)

Method 1:
Make a bash repl and then use the terminal like you would on desktop. This might not be possible, but you can see. A common error is that you don't have write access to the disk.
Go search up "Install rust nightly shell".
This is what I found that you can use (not tested):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs

EDIT

curl -s https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
# or
curl -f -L https://static.rust-lang.org/rustup.sh -O
sh rustup.sh --channel=nightly

Method 2:
Create a .replit file in your rust file and then add

run="shell commands"
language="rust"

NOTE: Without the correct configuration, your project will not be able to run as it used to.

[deleted]

I would like to help, but I don’t understand. Can you please explain?

CaptainAnon (150)

@CodeABC123 There are two builds of Rust (a programming language made by Mozilla). In one version of Rust, unstable features (which haven't been tested enough to be stable) are included – the nightly version – while in the other version unstable features are not included – the stable version.

[deleted]

I don’t think repl.it let’s you do that. If you want to, you can suggest repl.it to do that. @CaptainAnon

CaptainAnon (150)

@CodeABC123 I doubt it as well, but I'll suggest it as a new feature.

[deleted]

@CaptainAnon What is the advantage of the the nightly version and why would you like to use the unstable version?

CaptainAnon (150)

@MrHackman The nightly version includes features which aren't in the stable build that are useful to me. In addition, some packages only support the nightly build.

[deleted]

@CaptainAnon where can we code it outside Repl.it?Is any Software or IDE available for it?

CaptainAnon (150)

@MrHackman You can download Rust from the official website. There's an IntelliJ plugin for Rust and I'm sure that VSCode/Atom also have similar extensions.

[deleted]

@CaptainAnon So can we code the unstable version there?

CaptainAnon (150)

@MrHackman I don't think so, but that was my question.