diff --git a/src/doc/man/README.md b/src/doc/man/README.md new file mode 100644 index 0000000000000..1e4cd3b12e1aa --- /dev/null +++ b/src/doc/man/README.md @@ -0,0 +1,73 @@ +# Generating the `rustc(1)` Man Page + +This document describes how the `rustc(1)` man page is generated, where the logic lives, and how it robustly targets the correct `rustc` binary regardless of execution context. + +## Goal + +Ensure the `rustc(1)` man page is generated **entirely from `rustc --help -v` output** so that documentation reflects the real compiler and does not drift. + +## Source of Truth + +The man page is generated from: + +``` +rustc --help -v +``` + +This output is treated as authoritative. No manual sections are maintained. + +## Tooling + +- [`help2man`](https://www.gnu.org/software/help2man/) to generate the man page: + - Parses CLI help output (`rustc --help -v`) + - Provides a formatted groff man page + +## Script Location + +- All logic and artifacts are in `src/doc/man`. +- This avoids coupling to the main build system. + +## Generation Script + +`generate-rustc-man.sh` is the reproducible way to regenerate the man page. + +- The script resolves its own location and output directory. +- The path to the *actual* `rustc` binary is passed as an argument. +- No assumptions made about the working directory. + +### Script Behavior + +- Resolves absolute path to provided `rustc` binary. +- Runs `help2man` with `--help -v` on that binary. +- Writes output to `src/doc/man/rustc.1`. + +The build or release tooling invoking this script **must pass the correct `rustc` binary** (e.g., a freshly built compiler). + +## Regenerating the Man Page + +From the repository root *after building rustc*: + +```bash +./src/doc/man/generate-rustc-man.sh path/to/rustc +``` + +This guarantees: +- The correct (built) compiler is documented +- Output always lands in the right place + +## Prerequisites + +- `help2man` must be installed and in your `$PATH`. + +On most Linux distros: `sudo apt install help2man` (Debian/Ubuntu) or `sudo dnf install help2man` (Fedora). + +## Rationale + +- Keeps the man page in sync with real compiler behavior +- Avoids manual duplication of CLI documentation +- Regeneration is explicit and reproducible + +## Notes + +- The generated `rustc.1` can be `.gitignore`d as desired, depending on release/build process. +- If you change how `rustc` outputs help, rerun this process to update the man page diff --git a/src/doc/man/generate-rustc-man.sh b/src/doc/man/generate-rustc-man.sh new file mode 100755 index 0000000000000..3dcef22a39d67 --- /dev/null +++ b/src/doc/man/generate-rustc-man.sh @@ -0,0 +1,97 @@ +#!/bin/bash +set -euo pipefail + +RUSTC="${1:?Usage: $0 }" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +OUTPUT="$SCRIPT_DIR/rustc.1" +INCLUDE_FILE="$(mktemp)" +trap "rm -f '$INCLUDE_FILE'" EXIT + +# Parse -C help output into man format +generate_codegen_section() { + "$RUSTC" -C help 2>&1 | awk ' + /^ -C / { + sub(/^ -C +/, "") + split($0, parts, / -- /) + option = parts[1] + desc = parts[2] + gsub(/=val$/, "", option) + printf ".TP\n\\fB-C %s\\fR=\\fIval\\fR\n%s\n", option, desc + }' +} + +# Build the include file with proper section ordering +generate_include_file() { + cat <<'EOF' +[name] +rustc \- The Rust compiler + +[description] +This program is a compiler for the Rust language, available at https://www.rust-lang.org. + +[>options] +.SH "CODEGEN OPTIONS" +These options affect code generation. Run \fBrustc -C help\fR for the full list. + +EOF + + # Dynamic codegen options + generate_codegen_section + + cat <<'EOF' + +.SH ENVIRONMENT +Some of these affect only test harness programs (generated via rustc --test); +others affect all programs which link to the Rust standard library. +.TP +\fBRUST_BACKTRACE\fR +If set to a value different than "0", produces a backtrace in the output of a program which panics. +.TP +\fBRUST_TEST_THREADS\fR +The test framework Rust provides executes tests in parallel. This variable sets the maximum number of threads used for this purpose. This setting is overridden by the --test-threads option. +.TP +\fBRUST_TEST_NOCAPTURE\fR +If set to a value other than "0", a synonym for the --nocapture flag. +.TP +\fBRUST_MIN_STACK\fR +Sets the minimum stack size for new threads. + +.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 --crate-type=lib hello-lib.rs + +To build either with a crate (.rs) file: + $ rustc hello.rs + +To build an executable with debug info: + $ rustc -g -o hello hello.rs + +[see also] +.BR rustdoc (1) + +[bugs] +See https://github.com/rust-lang/rust/issues for issues. + +[author] +See https://github.com/rust-lang/rust/graphs/contributors or use `git log --all --format='%cN <%cE>' | sort -u` in the rust source distribution. + +[copyright] +This work is dual-licensed under Apache 2.0 and MIT terms. +See COPYRIGHT file in the rust source distribution. +EOF +} + +# Generate the include file +generate_include_file >"$INCLUDE_FILE" + +# Generate man page +help2man \ + --include="$INCLUDE_FILE" \ + --no-info \ + --no-discard-stderr \ + "$RUSTC" >"$OUTPUT" + +echo "Generated $OUTPUT from $RUSTC help output" diff --git a/src/doc/man/rustc.1 b/src/doc/man/rustc.1 index 534af3f85bb96..87542f2e2d182 100644 --- a/src/doc/man/rustc.1 +++ b/src/doc/man/rustc.1 @@ -1,314 +1,319 @@ -.TH RUSTC "1" "April 2019" "rustc " "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. +.TH RUSTC "1" "December 2025" "rustc 1.92.0 (ded5c06cf 2025-12-08)" "User Commands" .SH NAME rustc \- The Rust compiler .SH SYNOPSIS .B rustc -[\fIOPTIONS\fR] \fIINPUT\fR - +[\fI\,OPTIONS\/\fR] \fI\,INPUT\/\fR .SH DESCRIPTION -This program is a compiler for the Rust language, available at https://www.rust\-lang.org. - +This program is a compiler for the Rust language, available at https://www.rust-lang.org. .SH OPTIONS - .TP \fB\-h\fR, \fB\-\-help\fR -Display the help message. +Display this message .TP -\fB\-\-cfg\fR \fISPEC\fR +\fB\-\-cfg\fR Configure the compilation environment. +SPEC supports the syntax `[=""]`. +.TP +\fB\-\-check\-cfg\fR +Provide list of expected cfgs for checking +.TP +\fB\-L\fR [=] +Add a directory to the library search path. The +optional KIND can be one of + (default: +all). +.TP +\fB\-l\fR [[:]=][:] +Link the generated crate(s) to the specified native +library NAME. The optional KIND can be one of + (default: dylib). +Optional comma separated MODIFIERS + +may be specified each with a prefix of either '+' to +enable or '\-' to disable. +.TP +\fB\-\-crate\-type\fR +Comma separated list of types of crates +for the compiler to emit +.TP +\fB\-\-crate\-name\fR +Specify the name of the crate being built +.TP +\fB\-\-edition\fR <2015|2018|2021|2024|future> +Specify which edition of the compiler to use when +compiling code. The default is 2015 and the latest +stable edition is 2024. +.TP +\fB\-\-emit\fR [=] +Comma separated list of types of output for the +compiler to emit. +Each TYPE has the default FILE name: +* asm \- CRATE_NAME.s +* llvm\-bc \- CRATE_NAME.bc +* dep\-info \- CRATE_NAME.d +* link \- (platform and crate\-type dependent) +* llvm\-ir \- CRATE_NAME.ll +* metadata \- libCRATE_NAME.rmeta +* mir \- CRATE_NAME.mir +* obj \- CRATE_NAME.o +* thin\-link\-bitcode \- CRATE_NAME.indexing.o +.TP +\fB\-\-print\fR [=] +Compiler information to print on stdout (or to a file) +INFO may be one of +. .TP -\fB\-L\fR [\fIKIND\fR=]\fIPATH\fR -Add a directory to the library search path. -The optional \fIKIND\fR can be one of: -.RS +\fB\-g\fR +Equivalent to \fB\-C\fR debuginfo=2 .TP -\fBdependency\fR -only lookup transitive dependencies here +\fB\-O\fR +Equivalent to \fB\-C\fR opt\-level=3 .TP -.B crate -only lookup local `extern crate` directives here +\fB\-o\fR +Write output to FILENAME +.HP +\fB\-\-out\-dir\fR Write output to compiler\-chosen filename in DIR +.HP +\fB\-\-explain\fR Provide a detailed explanation of an error message .TP -.B native -only lookup native libraries here +\fB\-\-test\fR +Build a test harness .TP -.B framework -only look for OSX frameworks here +\fB\-\-target\fR +Target triple for which the code is compiled .TP -.B all -look for anything here (the default) -.RE +\fB\-A\fR, \fB\-\-allow\fR +Set lint allowed .TP -\fB\-l\fR [\fIKIND\fR=]\fINAME\fR -Link the generated crate(s) to the specified library \fINAME\fR. -The optional \fIKIND\fR can be one of \fIstatic\fR, \fIdylib\fR, or -\fIframework\fR. -If omitted, \fIdylib\fR is assumed. +\fB\-W\fR, \fB\-\-warn\fR +Set lint warnings .TP -\fB\-\-crate\-type\fR [bin|lib|rlib|dylib|cdylib|staticlib|proc\-macro] -Comma separated list of types of crates for the compiler to emit. +\fB\-\-force\-warn\fR +Set lint force\-warn .TP -\fB\-\-crate\-name\fR \fINAME\fR -Specify the name of the crate being built. +\fB\-D\fR, \fB\-\-deny\fR +Set lint denied +.HP +\fB\-F\fR, \fB\-\-forbid\fR Set lint forbidden .TP -\fB\-\-emit\fR [asm|llvm\-bc|llvm\-ir|obj|metadata|link|dep\-info|mir][=\fIPATH\fR] -Configure the output that \fBrustc\fR will produce. Each emission may also have -an optional explicit output \fIPATH\fR specified for that particular emission -kind. This path takes precedence over the \fB-o\fR option. +\fB\-\-cap\-lints\fR +Set the most restrictive lint level. More restrictive +lints are capped at this level .TP -\fB\-\-print\fR [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] -Comma separated list of compiler information to print on stdout. +\fB\-C\fR, \fB\-\-codegen\fR [=] +Set a codegen option .TP -\fB\-g\fR -Equivalent to \fI\-C\ debuginfo=2\fR. +\fB\-V\fR, \fB\-\-version\fR +Print version info and exit .TP -\fB\-O\fR -Equivalent to \fI\-C\ opt\-level=2\fR. +\fB\-v\fR, \fB\-\-verbose\fR +Use verbose output +.SS "Additional help:" .TP -\fB\-o\fR \fIFILENAME\fR -Write output to \fIFILENAME\fR. Ignored if multiple \fI\-\-emit\fR outputs are specified which -don't have an explicit path otherwise. +\fB\-C\fR help +Print codegen options .TP -\fB\-\-out\-dir\fR \fIDIR\fR -Write output to compiler\[hy]chosen filename in \fIDIR\fR. Ignored if \fI\-o\fR is specified. -Defaults to the current directory. +\fB\-W\fR help +Print 'lint' options and default settings .TP -\fB\-\-explain\fR \fIOPT\fR -Provide a detailed explanation of an error message. +\fB\-\-help\fR \fB\-v\fR +Print the full set of options rustc accepts +.SH "CODEGEN OPTIONS" +These options affect code generation. Run \fBrustc -C help\fR for the full list. + .TP -\fB\-\-test\fR -Build a test harness. +\fB-C ar\fR=\fIval\fR +this option is deprecated and does nothing .TP -\fB\-\-target\fR \fITARGET\fR -Target triple for which the code is compiled. This option defaults to the host’s target -triple. The target triple has the general format \-\-\-, where: -.RS +\fB-C code-model\fR=\fIval\fR +choose the code model to use (`rustc --print code-models` for details) .TP -.B -x86, arm, thumb, mips, etc. +\fB-C codegen-units\fR=\fIval\fR +divide crate into N units to optimize in parallel .TP -.B -for example on ARM: v5, v6m, v7a, v7m, etc. +\fB-C collapse-macro-debuginfo\fR=\fIval\fR +set option to collapse debuginfo for macros .TP -.B -pc, apple, nvidia, ibm, etc. +\fB-C control-flow-guard\fR=\fIval\fR +use Windows Control Flow Guard (default: no) .TP -.B -none, linux, win32, darwin, cuda, etc. +\fB-C debug-assertions\fR=\fIval\fR +explicitly enable the `cfg(debug_assertions)` directive .TP -.B -eabi, gnu, android, macho, elf, etc. -.RE +\fB-C debuginfo\fR=\fIval\fR +debug info emission level (0-2, none, line-directives-only, line-tables-only, limited, or full; default: 0) .TP -\fB\-W help\fR -Print 'lint' options and default settings. +\fB-C default-linker-libraries\fR=\fIval\fR +allow the linker to link its default libraries (default: no) .TP -\fB\-W\fR \fIOPT\fR, \fB\-\-warn\fR \fIOPT\fR -Set lint warnings. +\fB-C dlltool\fR=\fIval\fR +import library generation tool (ignored except when targeting windows-gnu) .TP -\fB\-A\fR \fIOPT\fR, \fB\-\-allow\fR \fIOPT\fR -Set lint allowed. +\fB-C dwarf-version\fR=\fIval\fR +version of DWARF debug information to emit (default: 2 or 4, depending on platform) .TP -\fB\-D\fR \fIOPT\fR, \fB\-\-deny\fR \fIOPT\fR -Set lint denied. +\fB-C embed-bitcode\fR=\fIval\fR +emit bitcode in rlibs (default: yes) .TP -\fB\-F\fR \fIOPT\fR, \fB\-\-forbid\fR \fIOPT\fR -Set lint forbidden. +\fB-C extra-filename\fR=\fIval\fR +extra data to put in each output filename .TP -\fB\-C\fR \fIFLAG\fR[=\fIVAL\fR], \fB\-\-codegen\fR \fIFLAG\fR[=\fIVAL\fR] -Set a codegen\[hy]related flag to the value specified. -Use \fI\-C help\fR to print available flags. -See CODEGEN OPTIONS below. +\fB-C force-frame-pointers\fR=\fIval\fR +force use of the frame pointers .TP -\fB\-V\fR, \fB\-\-version\fR -Print version info and exit. +\fB-C force-unwind-tables\fR=\fIval\fR +force use of unwind tables .TP -\fB\-v\fR, \fB\-\-verbose\fR -Use verbose output. +\fB-C incremental\fR=\fIval\fR +enable incremental compilation .TP -\fB\-\-remap\-path\-prefix\fR \fIfrom\fR=\fIto\fR -Remap source path prefixes in all output, including compiler diagnostics, debug information, -macro expansions, etc. The \fIfrom\fR=\fIto\fR parameter is scanned from right to left, so \fIfrom\fR -may contain '=', but \fIto\fR may not. - -This is useful for normalizing build products, for example by removing the current directory out of -pathnames emitted into the object files. The replacement is purely textual, with no consideration of -the current system's pathname syntax. For example \fI\-\-remap\-path\-prefix foo=bar\fR will -match \fBfoo/lib.rs\fR but not \fB./foo/lib.rs\fR. +\fB-C inline-threshold\fR=\fIval\fR +this option is deprecated and does nothing (consider using `-Cllvm-args=--inline-threshold=...`) .TP -\fB\-\-extern\fR \fINAME\fR=\fIPATH\fR -Specify where an external rust library is located. These should match -\fIextern\fR declarations in the crate's source code. +\fB-C instrument-coverage\fR=\fIval\fR +instrument the generated code to support LLVM source-based code coverage reports (note, the compiler build config must include `profiler = true`); implies `-C symbol-mangling-version=v0` .TP -\fB\-\-sysroot\fR \fIPATH\fR -Override the system root. +\fB-C link-arg\fR=\fIval\fR +a single extra argument to append to the linker invocation (can be used several times) .TP -\fB\-Z\fR \fIFLAG\fR -Set unstable / perma-unstable options. -Use \fI\-Z help\fR to print available options. +\fB-C link-args\fR=\fIval\fR +extra arguments to append to the linker invocation (space separated) .TP -\fB\-\-color\fR auto|always|never -Configure coloring of output: -.RS +\fB-C link-dead-code\fR=\fIval\fR +try to generate and link dead code (default: no) .TP -.B auto -colorize, if output goes to a tty (default); +\fB-C link-self-contained\fR=\fIval\fR +control whether to link Rust provided C objects/libraries or rely on a C toolchain or linker installed in the system .TP -.B always -always colorize output; +\fB-C linker\fR=\fIval\fR +system linker to link outputs with .TP -.B never -never colorize output. -.RE - -.SH CODEGEN OPTIONS - +\fB-C linker-features\fR=\fIval\fR +a comma-separated list of linker features to enable (+) or disable (-): `lld` .TP -\fBlinker\fR=\fI/path/to/cc\fR -Path to the linker utility to use when linking libraries, executables, and -objects. +\fB-C linker-flavor\fR=\fIval\fR +linker flavor .TP -\fBlink\-args\fR='\fI\-flag1 \-flag2\fR' -A space\[hy]separated list of extra arguments to pass to the linker when the linker -is invoked. +\fB-C linker-plugin-lto\fR=\fIval\fR +generate build artifacts that are compatible with linker-based LTO .TP -\fBlto\fR -Perform LLVM link\[hy]time optimizations. +\fB-C llvm-args\fR=\fIval\fR +a list of arguments to pass to LLVM (space separated) .TP -\fBtarget\-cpu\fR=\fIhelp\fR -Selects a target processor. -If the value is 'help', then a list of available CPUs is printed. +\fB-C lto\fR=\fIval\fR +perform LLVM link-time optimizations .TP -\fBtarget\-feature\fR='\fI+feature1\fR,\fI\-feature2\fR' -A comma\[hy]separated list of features to enable or disable for the target. -A preceding '+' enables a feature while a preceding '\-' disables it. -Available features can be discovered through \fIllc -mcpu=help\fR. +\fB-C metadata\fR=\fIval\fR +metadata to mangle symbol names with .TP -\fBpasses\fR=\fIval\fR -A space\[hy]separated list of extra LLVM passes to run. -A value of 'list' will cause \fBrustc\fR to print all known passes and -exit. -The passes specified are appended at the end of the normal pass manager. +\fB-C no-prepopulate-passes\fR=\fIval\fR +give an empty list of passes to the pass manager .TP -\fBllvm\-args\fR='\fI\-arg1\fR \fI\-arg2\fR' -A space\[hy]separated list of arguments to pass through to LLVM. +\fB-C no-redzone\fR=\fIval\fR +disable the use of the redzone .TP -\fBsave\-temps\fR -If specified, the compiler will save more files (.bc, .o, .no\-opt.bc) generated -throughout compilation in the output directory. +\fB-C no-stack-check\fR=\fIval\fR +this option is deprecated and does nothing .TP -\fBrpath\fR -If specified, then the rpath value for dynamic libraries will be set in -either dynamic library or executable outputs. +\fB-C no-vectorize-loops\fR=\fIval\fR +disable loop vectorization optimization passes .TP -\fBno\-prepopulate\-passes\fR -Suppresses pre\[hy]population of the LLVM pass manager that is run over the module. +\fB-C no-vectorize-slp\fR=\fIval\fR +disable LLVM's SLP vectorization pass .TP -\fBno\-vectorize\-loops\fR -Suppresses running the loop vectorization LLVM pass, regardless of optimization -level. +\fB-C opt-level\fR=\fIval\fR +optimization level (0-3, s, or z; default: 0) .TP -\fBno\-vectorize\-slp\fR -Suppresses running the LLVM SLP vectorization pass, regardless of optimization -level. +\fB-C overflow-checks\fR=\fIval\fR +use overflow checks for integer arithmetic .TP -\fBsoft\-float\fR -Generates software floating point library calls instead of hardware -instructions. +\fB-C panic\fR=\fIval\fR +panic strategy to compile crate with .TP -\fBprefer\-dynamic\fR -Prefers dynamic linking to static linking. +\fB-C passes\fR=\fIval\fR +a list of extra LLVM passes to run (space separated) .TP -\fBno\-integrated\-as\fR -Force usage of an external assembler rather than LLVM's integrated one. +\fB-C prefer-dynamic\fR=\fIval\fR +prefer dynamic linking to static linking (default: no) .TP -\fBno\-redzone\fR -Disable the use of the redzone. +\fB-C profile-generate\fR=\fIval\fR +compile the program with profiling instrumentation .TP -\fBrelocation\-model\fR=[pic,static,dynamic\-no\-pic] -The relocation model to use. -(Default: \fIpic\fR) +\fB-C profile-use\fR=\fIval\fR +use the given `.profdata` file for profile-guided optimization .TP -\fBcode\-model\fR=[small,kernel,medium,large] -Choose the code model to use. +\fB-C relocation-model\fR=\fIval\fR +control generation of position-independent code (PIC) (`rustc --print relocation-models` for details) .TP -\fBmetadata\fR=\fIval\fR -Metadata to mangle symbol names with. +\fB-C relro-level\fR=\fIval\fR +choose which RELRO level to use .TP -\fBextra\-filename\fR=\fIval\fR -Extra data to put in each output filename. +\fB-C remark\fR=\fIval\fR +output remarks for these optimization passes (space separated, or "all") .TP -\fBcodegen\-units\fR=\fIn\fR -Divide crate into \fIn\fR units to optimize in parallel. +\fB-C rpath\fR=\fIval\fR +set rpath values in libs/exes (default: no) .TP -\fBremark\fR=\fIval\fR -Print remarks for these optimization passes (space separated, or "all"). +\fB-C save-temps\fR=\fIval\fR +save all temporary output files during compilation (default: no) .TP -\fBno\-stack\-check\fR -Disable checks for stack exhaustion (a memory\[hy]safety hazard!). +\fB-C soft-float\fR=\fIval\fR +deprecated option: use soft float ABI (*eabihf targets only) (default: no) .TP -\fBdebuginfo\fR=\fIval\fR -Debug info emission level: -.RS +\fB-C split-debuginfo\fR=\fIval\fR +how to handle split-debuginfo, a platform-specific option .TP -.B 0 -no debug info; +\fB-C strip\fR=\fIval\fR +tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`) .TP -.B 1 -line\[hy]tables only (for stacktraces and breakpoints); +\fB-C symbol-mangling-version\fR=\fIval\fR +which mangling version to use for symbol names ('legacy' (default), 'v0', or 'hashed') .TP -.B 2 -full debug info with variable and type information. -.RE +\fB-C target-cpu\fR=\fIval\fR +select target processor (`rustc --print target-cpus` for details) .TP -\fBopt\-level\fR=\fIVAL\fR -Optimize with possible levels 0\[en]3, s (optimize for size), or z (for minimal size) +\fB-C target-feature\fR=\fIval\fR +target specific attributes. (`rustc --print target-features` for details). This feature is unsafe. +.TP +\fB-C unsafe-allow-abi-mismatch\fR=\fIval\fR +Allow incompatible target modifiers in dependency crates (comma separated list) .SH ENVIRONMENT - Some of these affect only test harness programs (generated via rustc --test); others affect all programs which link to the Rust standard library. - +.TP +\fBRUST_BACKTRACE\fR +If set to a value different than "0", produces a backtrace in the output of a program which panics. .TP \fBRUST_TEST_THREADS\fR -The test framework Rust provides executes tests in parallel. This variable sets -the maximum number of threads used for this purpose. This setting is overridden -by the --test-threads option. - +The test framework Rust provides executes tests in parallel. This variable sets the maximum number of threads used for this purpose. This setting is overridden by the --test-threads option. .TP \fBRUST_TEST_NOCAPTURE\fR If set to a value other than "0", a synonym for the --nocapture flag. - .TP \fBRUST_MIN_STACK\fR Sets the minimum stack size for new threads. -.TP -\fBRUST_BACKTRACE\fR -If set to a value different than "0", produces a backtrace in the output of a program which panics. - -.SH "EXAMPLES" +.SH EXAMPLES To build an executable from a source file with a main function: - $ rustc \-o hello hello.rs + $ rustc -o hello hello.rs To build a library from a source file: - $ rustc \-\-crate\-type=lib hello\-lib.rs + $ rustc --crate-type=lib hello-lib.rs To build either with a crate (.rs) file: $ rustc hello.rs To build an executable with debug info: - $ rustc \-g \-o hello hello.rs - + $ rustc -g -o hello hello.rs +.SH BUGS +See https://github.com/rust-lang/rust/issues for issues. +.SH AUTHOR +See https://github.com/rust-lang/rust/graphs/contributors or use `git log --all --format='%cN <%cE>' | sort -u` in the rust source distribution. +.SH COPYRIGHT +This work is dual-licensed under Apache 2.0 and MIT terms. +See COPYRIGHT file in the rust source distribution. .SH "SEE ALSO" - .BR rustdoc (1) - -.SH "BUGS" -See https://github.com/rust\-lang/rust/issues for issues. - -.SH "AUTHOR" -See https://github.com/rust\-lang/rust/graphs/contributors or use `git log --all --format='%cN <%cE>' | sort -u` in the rust source distribution. - -.SH "COPYRIGHT" -This work is dual\[hy]licensed under Apache\ 2.0 and MIT terms. -See \fICOPYRIGHT\fR file in the rust source distribution.