OS Manuals

/usr/bin/rust-analyzer

A Rust compiler front-end for IDEs

From rust-analyzer 20261109-r0 (os), captured 2026-11-09 by running rust-analyzer --help (exit 0). permalink

rust-analyzer
  LSP server for the Rust programming language.

  Subcommands and their flags do not provide any stability guarantees and may be removed or
  changed without notice. Top-level flags that are not marked as [Unstable] provide
  backwards-compatibility and may be relied on.

OPTIONS:
    -v, --verbose
      Verbosity level, can be repeated multiple times.

    -q, --quiet
      Verbosity level.

    --log-file <path>
      Log to the specified file instead of stderr.

    --no-log-buffering
      Flush log records to the file immediately.

    --wait-dbg
      [Unstable] Wait until a debugger is attached to (requires debug build).

    -h, --help
      Prints help information.

    -V, --version
      Print version.

    --print-config-schema
      Dump a LSP config JSON schema.

SUBCOMMANDS:

rust-analyzer parse
  Parse stdin.

  OPTIONS:
    --no-dump
      Suppress printing.

    --json
      Output as JSON.


rust-analyzer symbols
  Parse stdin and print the list of symbols.


rust-analyzer highlight
  Highlight stdin as html.

  OPTIONS:
    --rainbow
      Enable rainbow highlighting of identifiers.


rust-analyzer analysis-stats
  Batch typecheck project and print summary statistics

  ARGS:
    <path>
      Directory with Cargo.toml or rust-project.json.

  OPTIONS:
    --output <format>

    --randomize
      Randomize order in which crates, modules, and items are processed.

    --parallel
      Run type inference in parallel.

    -o, --only <path>
      Only analyze items matching this path.

    --with-deps
      Also analyze all dependencies.

    --no-sysroot
      Don't load sysroot crates (`std`, `core` & friends).

    --no-test
      Don't set #[cfg(test)].

    --disable-build-scripts
      Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.

    --disable-proc-macros
      Don't expand proc macros.

    --proc-macro-srv <path>
      Run the proc-macro-srv binary at the specified path.

    --skip-lang-items
      Skip lang items fetching.

    --skip-lowering
      Skip body lowering.

    --skip-inference
      Skip type inference.

    --skip-mir-stats
      Skip lowering to mir

    --skip-data-layout
      Skip data layout calculation

    --skip-const-eval
      Skip const evaluation

    --run-all-ide-things
      Runs several IDE features after analysis, including semantics highlighting, diagnostics
      and annotations. This is useful for benchmarking the memory usage on a project that has
      been worked on for a bit in a longer running session.

    --run-term-search
      Run term search on all the tail expressions (of functions, block, if statements etc.)

    --validate-term-search
      Validate term search by running `cargo check` on every response.
      Note that this also temporarily modifies the files on disk, use with caution!


rust-analyzer run-tests
  Run unit tests of the project using mir interpreter

  ARGS:
    <path>
      Directory with Cargo.toml or rust-project.json.


rust-analyzer rustc-tests
  Run unit tests of the project using mir interpreter

  ARGS:
    <rustc_repo>
      Directory with Cargo.toml.

  OPTIONS:
    --filter <path>
      Only run tests with filter as substring


rust-analyzer diagnostics

  ARGS:
    <path>
      Directory with Cargo.toml or rust-project.json.

  OPTIONS:
    --disable-build-scripts
      Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.

    --disable-proc-macros
      Don't expand proc macros.

    --proc-macro-srv <path>
      Run the proc-macro-srv binary at the specified path.

    --severity <severity>
      The minimum severity.


rust-analyzer unresolved-references
  Report unresolved references

  ARGS:
    <path>
      Directory with Cargo.toml or rust-project.json.

  OPTIONS:
    --disable-build-scripts
      Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.

    --disable-proc-macros
      Don't expand proc macros.

    --proc-macro-srv <path>
      Run the proc-macro-srv binary at the specified path.


rust-analyzer prime-caches
  Prime caches, as rust-analyzer does typically at startup in interactive sessions.

  ARGS:
    <path>
      Directory with Cargo.toml or rust-project.json.

  OPTIONS:
    --disable-build-scripts
      Don't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.

    --disable-proc-macros
      Don't expand proc macros.

    --proc-macro-srv <path>
      Run the proc-macro-srv binary at the specified path.

    --num-threads <num_threads>
      The number of threads to use. Defaults to the number of physical cores.


rust-analyzer ssr

  ARGS:
    <rule>...
      A structured search replace rule (`$a.foo($b) ==>> bar($a, $b)`)


rust-analyzer search

  ARGS:
    <pattern>...
      A structured search replace pattern (`$a.foo($b)`)

  OPTIONS:
    --debug <snippet>
      Prints debug information for any nodes with source exactly equal to snippet.


rust-analyzer lsif

  ARGS:
    <path>

  OPTIONS:
    --exclude-vendored-libraries
      Exclude code from vendored libraries from the resulting index.


rust-analyzer scip

  ARGS:
    <path>

  OPTIONS:
    --output <path>
      The output path where the SCIP file will be written to. Defaults to `index.scip`.

    --config-path <config_path>
      A path to an json configuration file that can be used to customize cargo behavior.

    --exclude-vendored-libraries
      Exclude code from vendored libraries from the resulting index.

    --num-threads <num_threads>
      The number of worker threads for cache priming. Defaults to the number of physical cores.
Options (36)
OptionDescriptionSource
-v, --verboseVerbosity level, can be repeated multiple times.help
-q, --quietVerbosity level.help
--log-file pathLog to the specified file instead of stderr.help
--no-log-bufferingFlush log records to the file immediately.help
--wait-dbg[Unstable] Wait until a debugger is attached to (requires debug build).help
-h, --helpPrints help information.help
-V, --versionPrint version.help
--print-config-schemaDump a LSP config JSON schema.help
--no-dumpSuppress printing.help
--jsonOutput as JSON.help
--rainbowEnable rainbow highlighting of identifiers.help
--output formathelp
--randomizeRandomize order in which crates, modules, and items are processed.help
--parallelRun type inference in parallel.help
-o, --only pathOnly analyze items matching this path.help
--with-depsAlso analyze all dependencies.help
--no-sysrootDon't load sysroot crates (`std`, `core` & friends).help
--no-testDon't set #[cfg(test)].help
--disable-build-scriptsDon't run build scripts or load `OUT_DIR` values by running `cargo check` before analysis.help
--disable-proc-macrosDon't expand proc macros.help
--proc-macro-srv pathRun the proc-macro-srv binary at the specified path.help
--skip-lang-itemsSkip lang items fetching.help
--skip-loweringSkip body lowering.help
--skip-inferenceSkip type inference.help
--skip-mir-statsSkip lowering to mirhelp
--skip-data-layoutSkip data layout calculationhelp
--skip-const-evalSkip const evaluationhelp
--run-all-ide-thingsRuns several IDE features after analysis, including semantics highlighting, diagnostics and annotations.help
--run-term-searchRun term search on all the tail expressions (of functions, block, if statements etc.)help
--validate-term-searchValidate term search by running `cargo check` on every response.help
--filter pathOnly run tests with filter as substringhelp
--severity severityThe minimum severity.help
--num-threads num_threadsThe number of threads to use.help
--debug snippetPrints debug information for any nodes with source exactly equal to snippet.help
--exclude-vendored-librariesExclude code from vendored libraries from the resulting index.help
--config-path config_pathA path to an json configuration file that can be used to customize cargo behavior.help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.