Forrest logo
back to the rustc tool

rustc:tldr:b53fa

rustc: Compile a single file.
$ rustc ${filename-rs}
try on your machine

The command rustc is the Rust compiler command-line utility. It is used to compile Rust source code files into executable binaries.

${filename-rs} is a placeholder that represents the name of a Rust source code file. The .rs extension is typical for Rust source files.

Therefore, the command rustc ${filename-rs} is a command template for compiling a Rust source code file. You need to replace ${filename-rs} with the actual name of the Rust file you want to compile, including the .rs extension.

For example, if you have a file named main.rs, the command would be rustc main.rs. This command will compile the main.rs file and generate an executable binary if there are no compilation errors.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the rustc tool