2012-10-10 17:29:01 -05:00
|
|
|
.TH RUSTC "1" "October 2012" "rustc 0.4" "User Commands"
|
2011-10-25 22:05:41 -05:00
|
|
|
.SH NAME
|
|
|
|
rustc \- rust compiler
|
|
|
|
.SH SYNOPSIS
|
2012-05-26 10:15:28 -05:00
|
|
|
.B rustc
|
|
|
|
[\fIoptions\fR] \fI<input>\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
|
2011-10-25 22:05:41 -05:00
|
|
|
.SH DESCRIPTION
|
|
|
|
This program is a compiler for the Rust language, available at
|
2012-01-12 21:10:30 -06:00
|
|
|
<\fBhttps://www.rust-lang.org\fR>.
|
2012-01-30 21:02:20 -06:00
|
|
|
|
2011-10-25 22:05:41 -05:00
|
|
|
.SH OPTIONS
|
2012-05-26 10:15:28 -05:00
|
|
|
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-bin\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Compile an executable crate (default)
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-c\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Compile and assemble, but do not link
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-cfg\fR <cfgspec>
|
2012-01-30 21:02:20 -06:00
|
|
|
Configure the compilation environment
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-emit\-llvm\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Produce an LLVM bitcode file
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-g\fR
|
2012-07-02 19:21:08 -05:00
|
|
|
Produce debug info (experimental)
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-gc\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Garbage collect shared data (experimental/temporary)
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-h\fR \fB\-\-help\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Display this message
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-L\fR <path>
|
2012-01-30 21:02:20 -06:00
|
|
|
Add a directory to the library search path
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-lib\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Compile a library crate
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-ls\fR
|
|
|
|
List the symbols defined by a compiled library crate
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-10-10 17:29:01 -05:00
|
|
|
\fB\-\-jit\fR
|
|
|
|
Execute using JIT (experimental)
|
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-no\-trans\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Run all passes except translation; no output
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-O\fR
|
|
|
|
Equivalent to \fB\-\-opt\-level\fR=\fI2\fR
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-o\fR <filename>
|
2012-01-30 21:02:20 -06:00
|
|
|
Write output to <filename>
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-opt\-level\fR <lvl>
|
|
|
|
Optimize with possible levels 0\-3
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-out\-dir\fR <dir>
|
|
|
|
Write output to compiler\-chosen filename in <dir>
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-parse\-only\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Parse only; do not compile, assemble, or link
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-pretty\fR [type]
|
|
|
|
Pretty\-print the input instead of compiling;
|
2012-10-10 17:29:01 -05:00
|
|
|
valid types are: normal (un\-annotated source),
|
|
|
|
expanded (crates expanded), typed (crates expanded,
|
|
|
|
with type annotations), or identified (fully
|
2012-05-26 10:15:28 -05:00
|
|
|
parenthesized, AST nodes and blocks with IDs)
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-S\fR
|
2012-01-30 21:02:20 -06:00
|
|
|
Compile only; do not assemble or link
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-save\-temps\fR
|
|
|
|
Write intermediate files (.bc, .opt.bc, .o)
|
|
|
|
in addition to normal output
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-static\fR
|
2012-10-10 17:29:01 -05:00
|
|
|
Use or produce static libraries or binaries
|
|
|
|
(experimental)
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-sysroot\fR <path>
|
2012-01-30 21:02:20 -06:00
|
|
|
Override the system root
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-test\fR
|
|
|
|
Build a test harness
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-\-target\fR <triple>
|
2012-10-10 17:29:01 -05:00
|
|
|
Target cpu\-manufacturer\-kernel[\-os] to compile for
|
|
|
|
(default: host triple)
|
|
|
|
(see http://sources.redhat.com/autobook/autobook/
|
|
|
|
autobook_17.html for detail)
|
|
|
|
.TP
|
|
|
|
\-(W|A|D|F) help
|
|
|
|
Print available 'lint' checks and default settings
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-W\fR <foo>
|
2012-10-10 17:29:01 -05:00
|
|
|
warn about <foo> by default
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-10-10 17:29:01 -05:00
|
|
|
\fB\-A\fR <foo>
|
|
|
|
allow <foo> by default
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-10-10 17:29:01 -05:00
|
|
|
\fB\-D\fR <foo>
|
|
|
|
deny <foo> by default
|
2012-05-26 10:15:28 -05:00
|
|
|
.TP
|
2012-10-10 17:29:01 -05:00
|
|
|
\fB\-F\fR <foo>
|
|
|
|
forbid <foo> (deny, and deny all overrides)
|
2012-05-26 10:15:28 -05:00
|
|
|
.TP
|
|
|
|
\fB\-Z\fR help
|
|
|
|
list internal options for debugging rustc
|
2011-10-25 22:05:41 -05:00
|
|
|
.TP
|
2012-05-26 10:15:28 -05:00
|
|
|
\fB\-v\fR \fB\-\-version\fR
|
|
|
|
Print version info and exit
|
2012-01-30 21:02:20 -06: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
|
|
|
|
|
2011-10-25 22:05:41 -05:00
|
|
|
.SH "BUGS"
|
2012-10-10 17:29:01 -05:00
|
|
|
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
|
2012-01-30 21:02:20 -06:00
|
|
|
|
2011-10-25 22:05:41 -05:00
|
|
|
.SH "AUTHOR"
|
|
|
|
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
|
|
|
|
<\fIgraydon@mozilla.com\fR> is the project leader.
|
2012-01-30 21:02:20 -06:00
|
|
|
|
2011-10-25 22:05:41 -05:00
|
|
|
.SH "COPYRIGHT"
|
2012-10-10 17:29:01 -05:00
|
|
|
This work is licensed under MIT-like terms. See \fBLICENSE.txt\fR
|
|
|
|
in the rust source distribution.
|