2012-05-26 17:15:28 +02:00
|
|
|
.TH RUSTC "1" "May 2012" "rustc 0.2 (23fcab9)" "User Commands"
|
2011-10-26 05:05:41 +02:00
|
|
|
.SH NAME
|
|
|
|
rustc \- rust compiler
|
|
|
|
.SH SYNOPSIS
|
2012-05-26 17:15:28 +02:00
|
|
|
.B rustc
|
|
|
|
[\fIoptions\fR] \fI<input>\fR
|
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
|
|
|
<\fBhttps://www.rust-lang.org\fR>.
|
2012-01-31 04:02:20 +01:00
|
|
|
|
2011-10-26 05:05:41 +02:00
|
|
|
.SH OPTIONS
|
2012-05-26 17:15:28 +02:00
|
|
|
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-bin\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Compile an executable crate (default)
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-c\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Compile and assemble, but do not link
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-cfg\fR <cfgspec>
|
2012-01-31 04:02:20 +01:00
|
|
|
Configure the compilation environment
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-emit\-llvm\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Produce an LLVM bitcode file
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-g\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Produce debug info
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-gc\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Garbage collect shared data (experimental/temporary)
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-h\fR \fB\-\-help\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Display this message
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-L\fR <path>
|
2012-01-31 04:02:20 +01:00
|
|
|
Add a directory to the library search path
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-lib\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Compile a library crate
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-ls\fR
|
|
|
|
List the symbols defined by a compiled library crate
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-no\-trans\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Run all passes except translation; no output
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-O\fR
|
|
|
|
Equivalent to \fB\-\-opt\-level\fR=\fI2\fR
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-o\fR <filename>
|
2012-01-31 04:02:20 +01:00
|
|
|
Write output to <filename>
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-opt\-level\fR <lvl>
|
|
|
|
Optimize with possible levels 0\-3
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-out\-dir\fR <dir>
|
|
|
|
Write output to compiler\-chosen filename in <dir>
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-parse\-only\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Parse only; do not compile, assemble, or link
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-pretty\fR [type]
|
|
|
|
Pretty\-print the input instead of compiling;
|
|
|
|
valid types are: \fBnormal\fR (un\-annotated source),
|
|
|
|
\fBexpanded\fR (crates expanded), \fBtyped\fR (crates expanded,
|
|
|
|
with type annotations), or \fBidentified\fR (fully
|
|
|
|
parenthesized, AST nodes and blocks with IDs)
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-S\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Compile only; do not assemble or link
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02: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-05-26 17:15:28 +02:00
|
|
|
\fB\-\-static\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Use or produce static libraries or binaries
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-stats\fR
|
2012-01-31 04:02:20 +01:00
|
|
|
Print compilation statistics
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-sysroot\fR <path>
|
2012-01-31 04:02:20 +01:00
|
|
|
Override the system root
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-test\fR
|
|
|
|
Build a test harness
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-\-target\fR <triple>
|
|
|
|
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-05-26 17:15:28 +02:00
|
|
|
\fB\-W\fR <foo>
|
|
|
|
enable warning <foo>
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-W\fR no\-<foo>
|
|
|
|
disable warning <foo>
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-W\fR err\-<foo>
|
|
|
|
enable warning <foo> as an error
|
|
|
|
.TP
|
|
|
|
\fB\-W\fR help
|
|
|
|
Print available warnings and default settings
|
|
|
|
.TP
|
|
|
|
\fB\-Z\fR help
|
|
|
|
list internal options for debugging rustc
|
2011-10-26 05:05:41 +02:00
|
|
|
.TP
|
2012-05-26 17:15:28 +02:00
|
|
|
\fB\-v\fR \fB\-\-version\fR
|
|
|
|
Print version info and exit
|
2012-01-31 04:02:20 +01: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-26 05:05:41 +02:00
|
|
|
.SH "BUGS"
|
2012-01-13 04:10:30 +01:00
|
|
|
See \fBhttps://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 \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
|
|
|
|
<\fIgraydon@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 \fBLICENSE.txt\fR in the rust source distribution.
|