Skip to content

Some coverage results point to non-existing regions #3543

@adpaco-aws

Description

@adpaco-aws

In #3121, there are tests for which we find coverage checks pointing to a non-existing coverage region out of the line boundaries. This results in an out-of-bounds error with the standard highlighting algorithm used by the report subcommand:

thread 'main' panicked at /rustc/8d6b88b168e45ee1624699c19443c49665322a91/library/alloc/src/string.rs:1699:9:
assertion failed: self.is_char_boundary(idx)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The issue appears in at least these two tests in the coverage-based suite:

    [coverage-based] coverage/assert/test.rs
    [coverage-based] coverage/known_issues/assert_uncovered_end/test.rs

The coverage regions in these checks are always single unit and appear right after the line boundaries. In other words, they cover a single column after the string's length. These region might represent terminators not being covered, but this is unclear and more investigation is needed.

For the time being (i.e., in #3121), we're adding a space to extend the line boundaries so we can represent the code region using the report command1. More investigation is needed in order to determine what these regions represent, and how we can help users understand such results and act on them (note #2639 and related issues). This will be a necessary condition for the stability of the feature.

Footnotes

  1. Previously, we were filtering out these coverage results to avoid confusing reports. However, doing that prevents us from reporting such esults to the user, potentially masking other coverage issues. Therefore, we decided to represent these results even if they're confusing.

Metadata

Metadata

Assignees

Labels

Z-UnstableFeatureIssues that only occur if a unstable feature is enabled[C] BugThis is a bug. Something isn't working.[E] User ExperienceAn UX enhancement for an existing feature. Including deprecation of an existing one.[F] Spurious FailureIssues that cause Kani verification to fail despite the code being correct.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions