All apps/rustc

rustc

rustc

The Rust compiler.

Runs as rustc|macOS, Linux, Windows|www.rust-lang.org

Command form

ai-draft · 3 tasks · 13 fields

Compile one source file. Lints, -C codegen options, -Z, --extern and library paths are left out; most projects should use cargo instead.

Opens the form; the finished command lands at your prompt, unrun
otty gui rustc
Compile a Rust fileExample values, fixed in this page — nothing here reaches a terminal
Basic
Source file*
file
Output file
file
Optimize (-O)
-O
TasksEach one presets the form for one job
Compile
inputoutputoptimize
Compile a library
inputcrate_typeedition
Explain an error code
explain
ParametersOnly these flags are editable in the form
Source file
path · positional 0
Output file
path
-o
Output directory
path
--out-dir
Crate type
enum
--crate-typebinlibrlibdylibcdylibstaticlibproc-macro
Crate name
string
--crate-name
Edition
enum
--edition201520182021
Emit
enum
--emitasmllvm-bcllvm-irobjmetadatalinkdep-infomir
Optimize (-O)
boolean
-O
Debug info (-g)
boolean
-g
Build test harness
boolean
--test
Target triple
string
--target
Print info instead of compiling
enum
--printcrate-namefile-namessysroottarget-libdircfgtarget-listtarget-cpustarget-features
Explain error code
string
--explain
SourcesEvery flag above is checked against these
src
completion

github.com

Before it fills your prompt, Otty checks the installed rustc against its version. A form that does not match your version is not offered.