rust/man/rustc.1

128 lines
2.8 KiB
Groff
Raw Normal View History

2012-07-12 21:34:28 +02:00
.TH RUSTC "1" "July 2012" "rustc 0.3" "User Commands"
.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
.SH DESCRIPTION
This program is a compiler for the Rust language, available at
<\fBhttps://www.rust-lang.org\fR>.
2012-01-31 04:02:20 +01:00
.SH OPTIONS
2012-05-26 17:15:28 +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)
.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
.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
.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
.TP
2012-05-26 17:15:28 +02:00
\fB\-g\fR
2012-07-03 02:21:08 +02:00
Produce debug info (experimental)
.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)
.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
.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
.TP
2012-05-26 17:15:28 +02:00
\fB\-\-lib\fR
2012-01-31 04:02:20 +01:00
Compile a library crate
.TP
2012-05-26 17:15:28 +02:00
\fB\-\-ls\fR
List the symbols defined by a compiled library crate
.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
.TP
2012-05-26 17:15:28 +02:00
\fB\-O\fR
Equivalent to \fB\-\-opt\-level\fR=\fI2\fR
.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>
.TP
2012-05-26 17:15:28 +02:00
\fB\-\-opt\-level\fR <lvl>
Optimize with possible levels 0\-3
.TP
2012-05-26 17:15:28 +02:00
\fB\-\-out\-dir\fR <dir>
Write output to compiler\-chosen filename in <dir>
.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
.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)
.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
.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
.TP
2012-05-26 17:15:28 +02:00
\fB\-\-static\fR
Use or produce static libraries or binaries (experimental)
.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
.TP
2012-05-26 17:15:28 +02:00
\fB\-\-test\fR
Build a test harness
.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 <\fBhttp://sources.redhat.com/autobook/autobook/autobook_17.html\fR> for
detail)
.TP
2012-05-26 17:15:28 +02:00
\fB\-W\fR <foo>
enable warning <foo>
.TP
2012-05-26 17:15:28 +02:00
\fB\-W\fR no\-<foo>
disable warning <foo>
.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
.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
.SH "BUGS"
See <\fBhttps://github.com/mozilla/rust/issues\fR> for a list of known bugs.
2012-01-31 04:02:20 +01: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
.SH "COPYRIGHT"
See \fBLICENSE.txt\fR in the rust source distribution.