Title: Theory / Unimportant / CS / Programming / Rust / compiler
On every note of this deck, unless a note says otherwise:
Page: --help
Prefix: rustc

Fla: --help
Effect: Display help
Flag abbreviation: -h

Fla: --cfg SPEC
Effect: Configure the compilation environment

Fla: -L [KIND=]PATH
Effect: Add a directory to the library search path.
Extra: The optional KIND can be one of dependency, crate, native, framework, or all (the default).

Fla: -g
Effect: Equivalent to -C debuginfo=2

Fla: -l [KIND[:MODIFIERS]=]NAME[:RENAME]
Effect: Link the generated crate(s) to the specified native library NAME.
Extra: The optional KIND can be one of static, framework, or dylib (the default). Optional comma separated MODIFIERS (bundle|verbatim|whole-archive|as-needed) may be specified each with a prefix of either '+' to enable or '-' to disable.

Fla: --crate-type
Effect: Comma separated list of types of crates for the compiler to emit
Extra: args are [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]

Fla: --crate-name NAME
Effect: Specify the name of the crate being built

Fla: --edition 2015|2018|2021
Effect: Specify which edition of the compiler to use when compiling code.

Fla: --emit
Effect: Comma separated list of types of output for the compiler to emit
Extra: Possible values are [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]

Fla: --print
Effect: Compiler information to print on stdout
Extra: Possible values are [crate-name|file-names|sysroot|target-libdir|cfg|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|native-static-libs|stack-protector-strategies|link-args]

Fla: -0
Effect: Equivalent to -C opt-level=2

Fla: -o FILENAME
Effect: Write output to <filename>

Fla: --out-dir DIR
Effect: Write output to compiler-chosen filename in <dir>

Fla: --explain OPT
Effect: Provide a detailed explanation of an error message

Fla: --test
Effect: Build a test harness

Fla: --target TARGET
Effect: Target triple for which the code is compiled

Fla: --allow LINT
Effect: Set lint allowed
Flag abbreviation: -a LINT

Fla: --warn LINT
Effect: set lint warning
Flag abbreviation: -w LINT

Fla: --force-warn LINT
Effect: Set lint force-warn

Fla: --deny LINT
Effect: Set lint denied
Flag abbreviation: -D deny lint

Fla: --forbid LINT
Effect: Set lint forbidden
Flag abbreviation: -F LINT

Fla: --cap-lints LEVEL
Effect: Set the most restrictive lint level. More restrictive lints are capped at this level

Fla: --codegen OPT[=value]
Effect: Set a codegen option
Flag abbreviation: -c

Fla: --version
Effect: exit
Flag abbreviation: -V
Print: Version info

Fla: --verbose
Flag abbreviation: -v
Print: verbose in output

Fla: -C help
Print: codegen options

Fla: -W help
Print: 'lint' options and default settings

Fla: --help -v
Print: the full set of options rustc accepts