2013-02-15 00:25:47 +00:00
|
|
|
.TH RUSTC "1" "February 2013" "rustc 0.6" "User Commands"
|
2011-10-26 03:05:41 +00:00
|
|
|
.SH NAME
|
|
|
|
rustc \- rust compiler
|
|
|
|
.SH SYNOPSIS
|
2012-05-26 15:15:28 +00:00
|
|
|
.B rustc
|
2013-02-15 00:25:47 +00:00
|
|
|
[\fIOPTIONS\fR] \fIINPUT\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
|
2011-10-26 03:05:41 +00:00
|
|
|
.SH DESCRIPTION
|
|
|
|
This program is a compiler for the Rust language, available at
|
2012-01-13 03:10:30 +00:00
|
|
|
<\fBhttps://www.rust-lang.org\fR>.
|
2012-01-31 03:02:20 +00:00
|
|
|
|
2011-10-26 03:05:41 +00:00
|
|
|
.SH OPTIONS
|
2012-05-26 15:15:28 +00:00
|
|
|
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-bin\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Compile an executable crate (default)
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-c\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Compile and assemble, but do not link
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-\-cfg\fR SPEC
|
2012-01-31 03:02:20 +00:00
|
|
|
Configure the compilation environment
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-emit\-llvm\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Produce an LLVM bitcode file
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-h\fR, \fB\-\-help\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Display this message
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-L\fR PATH
|
2012-01-31 03:02:20 +00:00
|
|
|
Add a directory to the library search path
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-lib\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Compile a library crate
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-ls\fR
|
2013-02-15 00:25:47 +00:00
|
|
|
List the symbols defined by a library crate
|
2012-10-10 22:29:01 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-no\-trans\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Run all passes except translation; no output
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-O\fR
|
2013-02-15 00:25:47 +00:00
|
|
|
Equivalent to \fI\-\-opt\-level=2\fR
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-o\fR FILENAME
|
2012-01-31 03:02:20 +00:00
|
|
|
Write output to <filename>
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-\-opt\-level\fR LEVEL
|
|
|
|
Optimize with possible levels 0-3
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-\-out\-dir\fR DIR
|
|
|
|
Write output to compiler-chosen filename in <dir>
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-parse\-only\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Parse only; do not compile, assemble, or link
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-\-pretty\fR [TYPE]
|
|
|
|
Pretty-print the input instead of compiling; valid types are: normal
|
|
|
|
(un-annotated source), expanded (crates expanded), typed (crates
|
|
|
|
expanded, with type annotations), or identified (fully parenthesized,
|
|
|
|
AST nodes and blocks with IDs)
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-S\fR
|
2012-01-31 03:02:20 +00:00
|
|
|
Compile only; do not assemble or link
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-save\-temps\fR
|
2013-02-15 00:25:47 +00:00
|
|
|
Write intermediate files (.bc, .opt.bc, .o) in addition to normal output
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-\-sysroot\fR PATH
|
2012-01-31 03:02:20 +00:00
|
|
|
Override the system root
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2012-05-26 15:15:28 +00:00
|
|
|
\fB\-\-test\fR
|
|
|
|
Build a test harness
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-\-target\fR TRIPLE
|
|
|
|
Target triple cpu-manufacturer-kernel[-os] to compile for (see
|
|
|
|
http://sources.redhat.com/autobook/autobook/autobook_17.html
|
|
|
|
for detail)
|
2012-10-10 22:29:01 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-W\fR help
|
2012-10-10 23:35:52 +00:00
|
|
|
Print 'lint' options and default settings
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-W\fR OPT, \fB\-\-warn\fR OPT
|
|
|
|
Set lint warnings
|
|
|
|
.TP
|
|
|
|
\fB\-A\fR OPT, \fB\-\-allow\fR OPT
|
|
|
|
Set lint allowed
|
2011-10-26 03:05:41 +00:00
|
|
|
.TP
|
2013-02-15 00:25:47 +00:00
|
|
|
\fB\-D\fR OPT, \fB\-\-deny\fR OPT
|
|
|
|
Set lint denied
|
|
|
|
.TP
|
|
|
|
\fB\-F\fR OPT, \fB\-\-forbid\fR OPT
|
|
|
|
Set lint forbidden
|
|
|
|
.TP
|
|
|
|
\fB\-Z\fR FLAG
|
|
|
|
Set internal debugging options. Use "-Z help" to print available options.
|
|
|
|
|
|
|
|
Available debug flags are:
|
|
|
|
.RS
|
|
|
|
.IP \[bu]
|
|
|
|
\fBverbose\fR - in general, enable more debug printouts
|
|
|
|
.IP \[bu]
|
|
|
|
\fBtime\-passes\fR - measure time of each rustc pass
|
|
|
|
.IP \[bu]
|
|
|
|
\fBcount\-llvm\-insns\fR - count where LLVM instrs originate
|
|
|
|
.IP \[bu]
|
|
|
|
\fBtime\-llvm\-passes\fR - measure time of each LLVM pass
|
|
|
|
.IP \[bu]
|
|
|
|
\fBtrans\-stats\fR - gather trans statistics
|
|
|
|
.IP \[bu]
|
|
|
|
\fBno\-asm\-comments\fR - omit comments when using \fI\-S\fR
|
|
|
|
.IP \[bu]
|
|
|
|
\fBno\-verify\fR - skip LLVM verification
|
|
|
|
.IP \[bu]
|
|
|
|
\fBtrace\fR - emit trace logs
|
|
|
|
.IP \[bu]
|
|
|
|
\fBcoherence\fR - perform coherence checking
|
|
|
|
.IP \[bu]
|
|
|
|
\fBborrowck\-stats\fR - gather borrowck statistics
|
|
|
|
.IP \[bu]
|
|
|
|
\fBborrowck\-note\-pure\fR - note where purity is req'd
|
|
|
|
.IP \[bu]
|
|
|
|
\fBborrowck\-note\-loan\fR - note where loans are req'd
|
|
|
|
.IP \[bu]
|
|
|
|
\fBno\-landing\-pads\fR - omit landing pads for unwinding
|
|
|
|
.IP \[bu]
|
|
|
|
\fBdebug\-llvm\fR - enable debug output from LLVM
|
|
|
|
.IP \[bu]
|
|
|
|
\fBcount\-type\-sizes\fR - count the sizes of aggregate types
|
|
|
|
.IP \[bu]
|
|
|
|
\fBmeta\-stats\fR - gather metadata statistics
|
|
|
|
.IP \[bu]
|
|
|
|
\fBno\-opt\fR - do not optimize, even if \fI\-O\fR is passed
|
|
|
|
.IP \[bu]
|
|
|
|
\fBno\-monomorphic\-collapse\fR - do not collapse template instantiations
|
|
|
|
.IP \[bu]
|
|
|
|
\fBgc\fR - Garbage collect shared data (experimental)
|
|
|
|
.IP \[bu]
|
|
|
|
\fBjit\fR - Execute using JIT (experimental)
|
|
|
|
.IP \[bu]
|
|
|
|
\fBextra\-debug\-info\fR - Extra debugging info (experimental)
|
|
|
|
.IP \[bu]
|
|
|
|
\fBdebug\-info\fR - Produce debug info (experimental)
|
|
|
|
.IP \[bu]
|
|
|
|
\fBstatic\fR - Use or produce static libraries or binaries (experimental)
|
|
|
|
.RE
|
|
|
|
.TP
|
|
|
|
\fB\-v\fR, \fB\-\-version\fR
|
2012-05-26 15:15:28 +00:00
|
|
|
Print version info and exit
|
2012-01-31 03:02:20 +00:00
|
|
|
|
|
|
|
.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
|
|
|
|
|
2013-02-15 00:25:47 +00:00
|
|
|
To build an executable with debug info (experimental):
|
|
|
|
$ rustc -Z debug-info -o hello hello.rs
|
|
|
|
|
|
|
|
|
2011-10-26 03:05:41 +00:00
|
|
|
.SH "BUGS"
|
2012-10-10 22:29:01 +00:00
|
|
|
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
|
2012-01-31 03:02:20 +00:00
|
|
|
|
2011-10-26 03:05:41 +00:00
|
|
|
.SH "AUTHOR"
|
|
|
|
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
|
|
|
|
<\fIgraydon@mozilla.com\fR> is the project leader.
|
2012-01-31 03:02:20 +00:00
|
|
|
|
2011-10-26 03:05:41 +00:00
|
|
|
.SH "COPYRIGHT"
|
2012-10-10 22:29:01 +00:00
|
|
|
This work is licensed under MIT-like terms. See \fBLICENSE.txt\fR
|
|
|
|
in the rust source distribution.
|