RUST(1)

NAME
rust - a front-end to the Rust toolchain

SYNOPSIS
rust [COMMAND] [OPTIONS] INPUT

DESCRIPTION
This tool is a front-end for the Rust language, available at <https://www.rust-lang.org>. It provides commands to run, test and package Rust programs.

COMMANDS

build
    compile rust source files

run build an executable, and run it

test
    build a test executable, and run it

doc generate documentation from doc comments

pkg download, build, install rust packages

sketch
    run a rust interpreter

help
    show detailed usage of a command The build, run and test commands take the same parameters as the rustc command.

  BUILD COMMAND
The build command is a shortcut for the rustc command line. All options will be passed to the compiler verbatim. For example, to build an optimised version:
    $ rust build -O <filename>

  RUN COMMAND
The run command is a shortcut for the rustc command line. All options will be passed to the compiler verbatim, and if the compilation is successful, the resultant executable will be invoked. For example, to build and run an optimised version:
    $ rust run -O <filename>

  TEST COMMAND
The test command is a shortcut for the command line:
    $ rustc --test <filename> -o <filestem>test~ && ./<filestem>test~

  DOC COMMAND
The doc command is an alias for the rustdoc program. It is equivalent to:
    $ rustdoc [options] <cratefile>

  PKG COMMAND
The pkg command is an alias for the rustpkg program. It is equivalent to:
    $ rustpkg [options] <cratefile>

  SKETCH COMMAND
The sketch command launches the rusti interactive shell.

  HELP COMMAND
The help command displays a summary of available commands (ie. this text).

EXAMPLES
To build an executable (with a main function):
    $ rust build hello.rs To build a library from a source file:
    $ rust build --lib hello-lib.rs To build and run an executable:
    $ rust run hello.rs To build an executable with unit tests and execute the tests:
    $ rust test hello.rs To create a package

SEE ALSO
rustc, rustdoc, rustpkg, rusti

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 dual-licensed under Apache 2.0 and MIT terms. See COPYRIGHT file in the rust source distribution.