2012-01-31 04:02:20 +01:00
.TH RUSTC "1" "January 2012" "Rust" "User Commands"
2011-10-26 05:05:41 +02:00
.SH NAME
rustc \- rust compiler
2012-01-31 04:02:20 +01:00
2011-10-26 05:05:41 +02:00
.SH SYNOPSIS
rustc [\fB -h\fR ] [\fB -v\fR ] [\fB -o\fR \fI outfile\fR ]
[\fB --lib\fR ] [\fB --static\fR ] [\fB -L\fR \fI path\fR ]
[\fB -g\fR ] [\fB -S\fR ] [\fB -c\fR ] <\fI input\fR >
.PP
Only the most commonly-used options are listed here. All options are listed and
described below.
2012-01-31 04:02:20 +01:00
2011-10-26 05:05:41 +02:00
.SH DESCRIPTION
This program is a compiler for the Rust language, available at
2012-01-13 04:10:30 +01:00
<\fB https://www.rust-lang.org\fR >.
2012-01-31 04:02:20 +01:00
2011-10-26 05:05:41 +02:00
.SH OPTIONS
.TP
2012-01-31 04:02:20 +01:00
\fB --bin\fR
Compile an executable crate (default)
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -c\fR
Compile and assemble, but do not link
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --cfg <cfgspec>\fR
Configure the compilation environment
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --emit-llvm\fR
Produce an LLVM bitcode file
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -g\fR
Produce debug info
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --gc\fR
Garbage collect shared data (experimental/temporary)
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -h --help\fR
Display this message
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -L <path>\fR
Add a directory to the library search path
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --lib\fR
Compile a library crate
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --ls\fR
List the symbols defined by a compiled librar crate
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --no-asm-comments\fR
Do not add comments into the assembly source
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --no-lint-ctypes\fR
Suppress warnings for possibly incorrect ctype usage
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --no-trans\fR
Run all passes except translation; no output
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --no-verify\fR
Suppress LLVM verification step (slight speedup)
(see http://llvm.org/docs/Passes.html for detail)
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -O\fR
Equivalent to --opt-level=2
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -o <filename>\fR
Write output to <filename>
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --opt-level <lvl>\fR
Optimize with possible levels 0-3
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --out-dir <dir>\fR
Write output to compiler-chosen filename in <dir>
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --parse-only\fR
Parse only; do not compile, assemble, or link
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --pretty [type]\fR
Pretty-print the input instead of compiling; valid types are: \fB normal\fR (un-annotated source), \fB expanded\fR (crates expanded), \fB typed\fR (crates expanded, with type annotations), or \fB identified\fR (fully parenthesized, AST nodes and blocks with IDs)
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -S\fR
Compile only; do not assemble or link
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --save-temps\fR
Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --static\fR
Use or produce static libraries or binaries
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --stats\fR
Print compilation statistics
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --sysroot <path>\fR
Override the system root
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --test\fR
Build test harness
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --target <triple>\fR
Target cpu-manufacturer-kernel[-os] to compile for (default: host triple)
(see http://sources.redhat.com/autobook/autobook/autobook_17.html for detail)
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --time-passes\fR
Time the individual phases of the compiler
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --time-llvm-passes\fR
Time the individual phases of the LLVM backend
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB -v --version\fR
Print version info and exit
2011-10-26 05:05:41 +02:00
.TP
2012-01-31 04:02:20 +01:00
\fB --warn-unused-imports\fR
Warn about unnecessary imports
.SH "EXAMPLES"
To build an executable from a source file with a main function:
$ rustc -o hello hello.rs
To build a library from a source file:
$ rustc --lib hello-lib.rs
To build either with a crate (.rc) file:
$ rustc hello.rc
2011-10-26 05:05:41 +02:00
.SH "BUGS"
2012-01-13 04:10:30 +01:00
See \fB https://github.com/mozilla/rust/issues\fR for a list of known bugs.
2012-01-31 04:02:20 +01:00
2011-10-26 05:05:41 +02:00
.SH "AUTHOR"
See \fB AUTHORS.txt\fR in the rust source distribution. Graydon Hoare
<\fI graydon@mozilla.com\fR > is the project leader.
2012-01-31 04:02:20 +01:00
2011-10-26 05:05:41 +02:00
.SH "COPYRIGHT"
See \fB LICENSE.txt\fR in the rust source distribution.
2012-01-31 04:02:20 +01:00