# Feature catalog — rust-lang/rust

> Canonical page: https://codevetter.com/unpack/rust/feature-catalog

# Feature catalog — rust-lang/rust

Scanned commit c64de18c55c70d62aa88a5722dea8f8e263bacf3 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

User-facing surface = the rustc CLI plus the ./x build CLI plus the bundled tools and libraries. rustc supports the usual compile driver flags plus --print, --explain, -Zunpretty pretty-printing, --check-cfg validation, pluggable codegen backends via -Zcodegen-backend, incremental compilation, MIR emission, and hundreds of lints. ./x exposes subcommands like build/check/test/doc/dist/fmt/miri implemented as bootstrap Steps. The repo also ships rustdoc (with JSON output), the test harness crate library/test, and subtrees for clippy/rustfmt/miri/rust-analyzer.
- rustc CLI option handling lives in rustc_driver_impl: handle_options supports -Zhelp/--help early-exit modes, --explain <code> routes to handle_explain, and --print requests are served by print_crate_info before any input is required. — [compiler/rustc_driver_impl/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_driver_impl/src/lib.rs)
- --check-cfg arguments are parsed by rustc_interface::parse_check_cfg into a CheckCfg of expected cfg names/values supporting cfg(name, values(...)), any(), none(); passing any --check-cfg enables exhaustive_names and exhaustive_values by default. — [compiler/rustc_interface/src/interface.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_interface/src/interface.rs)
- Pretty-printing/unpretty modes (-Zunpretty) are handled in rustc_driver_impl::pretty::print, with PrintExtra::NeedsAstMap running early_lint_checks through TyCtxt when an AST map is needed, and MIR emission via pretty::emit_mir when OutputType::Mir is requested. — [compiler/rustc_driver_impl/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_driver_impl/src/lib.rs) [compiler/rustc_driver_impl/src/pretty.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_driver_impl/src/pretty.rs)
- Codegen backends are pluggable: rustc_interface::util::get_codegen_backend loads a backend dylib and resolves the __rustc_codegen_backend symbol (load_backend_from_dylib), selected via -Zcodegen-backend=<name> or Config::make_codegen_backend. — [compiler/rustc_interface/src/util.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_interface/src/util.rs) [compiler/rustc_interface/src/interface.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_interface/src/interface.rs)
- rustc's lint system registers builtin lint passes through rustc_lint: register_builtins registers BuiltinCombinedPreExpansionLintPass, BuiltinCombinedEarlyLintPass, BuiltinCombinedLateLintModPass, foreign_modules, and hardwired lints into the LintStore; drivers can add more via Config::register_lints. — [compiler/rustc_lint/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_lint/src/lib.rs) [compiler/rustc_interface/src/interface.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_interface/src/interface.rs)
- -Ztime-passes is implemented by TimePassesCallbacks in rustc_driver_impl, which records total time/RSS around catch_with_exit_code(run_compiler) and prints a 'total' entry unless --print output would be corrupted. — [compiler/rustc_driver_impl/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_driver_impl/src/lib.rs)
- Incremental compilation is a first-class feature: rustc_incremental persists the dep graph and query results on disk under the incremental directory (persist/{save,load,file_format,work_product}.rs) and create_and_enter_global_ctxt loads the query-result cache before running queries. — [compiler/rustc_incremental/src/persist/save.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_incremental/src/persist/save.rs) [compiler/rustc_interface/src/passes.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_interface/src/passes.rs)
- rustdoc lives in src/librustdoc with the binary crate at src/tools/rustdoc; it extern-crates the rustc_* internals (rustc_driver, rustc_interface, rustc_hir, etc.) loaded implicitly from the sysroot, and supports JSON output via src/rustdoc-json-types. — [src/librustdoc/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/librustdoc/lib.rs) [src/rustdoc-json-types/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/rustdoc-json-types/lib.rs)
- The standard library ships core (dependency-free primitives), alloc, std (with a sys/ platform-abstraction layer containing pal/fs/net/thread modules), plus supporting crates: test (built-in test harness), backtrace, std_detect, portable-simd, panic_abort/panic_unwind, unwind, and compiler-builtins. — [library/core/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/library/core/src/lib.rs) [library/std/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/library/std/src/lib.rs) [library/Cargo.toml](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/library/Cargo.toml)
- ./x subcommands are parsed by bootstrap's Flags/Subcommand (src/bootstrap/src/core/config) and dispatched to Step implementations under src/bootstrap/src/core/build_steps/ (check.rs, clean.rs, compile.rs, dist.rs, doc.rs, format.rs, install.rs, llvm.rs, perf.rs, run.rs, setup.rs, test.rs, tool.rs, vendor.rs, gcc.rs, clippy.rs). — [src/bootstrap/src/cli_main.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/bootstrap/src/cli_main.rs) [src/bootstrap/src/core/builder/mod.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/bootstrap/src/core/builder/mod.rs)
- compiletest (src/tools/compiletest) is the compiler test runner supporting 15 TestModes: pretty, debuginfo, codegen, rustdoc-html, rustdoc-json, codegen-units, incremental, run-make, ui, rustdoc-js, mir-opt, assembly, coverage-map, coverage-run, crashes. — [src/tools/compiletest/src/common.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/common.rs) [src/tools/compiletest/src/runtest.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/compiletest/src/runtest.rs)
- tidy (src/tools/tidy) is the repo style/consistency checker run by `./x test tidy`: it enforces alphabetical-order markers (tidy-alphabetical-start/end), license/deps rules (deps.rs, extdeps.rs), error-code registration, UI test conventions, unstable-book entries, target policy, and more via per-check modules. — [src/tools/tidy/src/main.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/src/tools/tidy/src/main.rs)
- Compiler diagnostics are emitted through rustc_errors' DiagCtxt with messages modeled as rustc_error_messages::DiagMessage — either a plain Str or an Inline Fluent message; register_functions adds custom Fluent functions like STREQ. (No .ftl files exist in the tree; messages are inline.) — [compiler/rustc_error_messages/src/lib.rs](https://github.com/rust-lang/rust/blob/c64de18c55c70d62aa88a5722dea8f8e263bacf3/compiler/rustc_error_messages/src/lib.rs)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
