RUSTC(1)

NAME
rustc - rust compiler

SYNOPSIS
rustc [options] <input>

DESCRIPTION
This program is a compiler for the Rust language, available at <https://www.rust-lang.org>.

OPTIONS

--bin
    Compile an executable crate (default)

-c  Compile and assemble, but do not link

--cfg <cfgspec>
    Configure the compilation environment

--emit-llvm
    Produce an LLVM bitcode file

-g  Produce debug info (experimental)

--gc
    Garbage collect shared data (experimental/temporary)

-h --help
    Display this message

-L <path>
    Add a directory to the library search path

--lib
    Compile a library crate

--ls
    List the symbols defined by a compiled library crate

--jit
    Execute using JIT (experimental)

--no-trans
    Run all passes except translation; no output

-O  Equivalent to --opt-level=2

-o <filename>
    Write output to <filename>

--opt-level <lvl>
    Optimize with possible levels 0-3

--out-dir <dir>
    Write output to compiler-chosen filename in <dir>

--parse-only
    Parse only; do not compile, assemble, or link

--pretty [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)

-S  Compile only; do not assemble or link

--save-temps
    Write intermediate files (.bc, .opt.bc, .o) in addition to normal output

--static
    Use or produce static libraries or binaries (experimental)

--sysroot <path>
    Override the system root

--test
    Build a test harness

--target <triple>
    Target cpu-manufacturer-kernel[-os] to compile for (default: host triple) (see http://sources.redhat.com/autobook/autobook/ autobook_17.html for detail)

-W help
    Print 'lint' options and default settings

-Z help
    Print internal options for debugging rustc

-v --version
    Print version info and exit

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

BUGS
See <https://github.com/mozilla/rust/issues> for issues.

AUTHOR
See AUTHORS.txt in the rust source distribution. Graydon Hoare <graydon@mozilla.com> is the project leader.

COPYRIGHT
This work is licensed under MIT-like terms. See LICENSE.txt in the rust source distribution.