RustRover 2026.2 Help

Code coverage

Code coverage in RustRover lets you analyze which lines of code were executed during a particular run. It helps determine the share of code covered by tests and identify areas that lack sufficient test coverage.

Run with coverage

The entry points for running coverage analysis are the same as you would normally use to run an application:

  • For main method definitions, click Run in the editor gutter, then select Run with Coverage

    A popup appears on clicking the gutter Run icon
  • For run configurations, click More Actions in the Run widget, then select Run with Coverage

    A menu appears on clicking More Actions in the Run widget

Coverage analysis executes the corresponding run configuration with the coverage agent attached. This agent instruments the bytecode to keep track of the execution line-by-line. After the execution completes, the results of the analysis appear in the IDE.

Coverage suites

A coverage suite is a collection of code coverage data from a specific run. Each coverage suite stores data from either a single run configuration (if it was run with coverage) or from an imported coverage data file.

RustRover stores coverage suites in the coverage folder of the IDE system directory:

%LOCALAPPDATA%\JetBrains\RustRover2026.2\coverage

~/Library/Caches/JetBrains/RustRover2026.2/coverage

~/.cache/JetBrains/RustRover2026.2/coverage

RustRover can display results from one or more coverage suites at the same time, and you can select which suites to show. If multiple suites are selected, the IDE displays their merged results: this means that a line is considered covered if it was executed in at least one of the suites.

Select which coverage suites to display

The list of coverage suites becomes available after at least one run with coverage.

  1. In the main menu, go to Run | Manage Coverage Reports… (Ctrl+Alt+F6).

  2. In the Choose Coverage Suite to Display dialog that opens, select the suites you want to display results from.

    • If you want to hide all code coverage results, click No Coverage instead. This deselects all coverage suites and closes the dialog.

  3. Click Show Selected.

RustRover loads the code coverage results for the selected suites.

Add and remove coverage suites

If you want to review code coverage results from a file that was generated outside RustRover (for example, by a build server or another developer), you can add the file as a separate coverage suite.

You can also remove suites from the IDE or completely delete them from disk.

  1. In the main menu, go to Run | Manage Coverage Reports… (Ctrl+Alt+F6).

  2. In the Choose Coverage Suite to Display dialog that opens, choose an action from the toolbar:

    • To import an external coverage file, click Add and browse for the file.

      The files with coverage data generated by RustRover are saved to the coverage folder in the IDE system directory by default.

    • To remove a coverage suite from the IDE but keep it on disk, select the suite and click the Remove button Remove.

    • To delete a coverage suite from both the IDE and the disk, select the suite and click the Delete button Delete.

Read coverage data

Code coverage results are displayed in the Coverage tool window, in the Project tool window, and in the editor after you launch at least one run configuration with coverage.

Code coverage results

Additionally, these results are saved to the coverage folder in the IDE system directory.

Hide coverage data

Do one of the following:

  • Close the tab with coverage statistics in the Coverage tool window (View | Tool Windows | Coverage).

  • Click coverage highlighting in the gutter and select Hide coverage.

    Hide coverage results in the editor gutter

Generate coverage report

Generate the report

  1. Go to Run | Generate Coverage Report, or click the Generate Coverage Report button in the Coverage tool window.

  2. In the Generate Coverage Report dialog, specify the directory to store the generated report and optionally select the Open generated HTML in browser checkbox.

    If there are several projects opened in the same window, make sure that the suggested output directory is correct.

  3. Click Save.

Configure code coverage

Project settings

You can configure the following options per project:

Show options before applying coverage to the editor

Ask whether to make the recently collected coverage suite active every time you run coverage analysis. In this case a dialog will appear, where you can choose to only display the new results, to add them to the existing results, or save them to storage without viewing.

Do not apply collected coverage

Only save the recently collected coverage suite to storage after you have run coverage analysis. In this case, new coverage data will not be shown unless you explicitly select the corresponding suite in Run | Manage Coverage Reports.

Replace active suites with the new one

Hide the currently shown coverage suites and use the newly collected one after you have run coverage analysis. In this case, only the results from the most recent coverage run will be shown.

Add to the active suites

Add the newly collected coverage suite to the list of active suites after you have run coverage analysis. This keeps the existing coverage results and adds the new results on top of it.

Activate Coverage View

Open the Coverage tool window every time you run coverage analysis.

Change colors of the coverage highlighting

  1. Press Ctrl+Alt+S to open settings and then select Editor | Color Scheme | General.

  2. Alternatively, click the Edit Coverage Colors button in the popup that opens on clicking the coverage indication line in the gutter.

  3. In the list of components, expand the Line Coverage node and select a type of coverage: for example, Full, Partial or Uncovered.

  4. Click the Foreground field to open the Select Color dialog.

  5. Select a color, apply the changes, and close the dialog.

Configure code coverage colors
17 July 2026