Skip to content

Diagnostic deduplication breaks with incr comp #162901

Description

@bjorn3

I tried this code:

tests/ui/allocator/not-an-allocator.rs

#[global_allocator]
static A: usize = 0;
//~^ ERROR E0277
//~| ERROR E0277
//~| ERROR E0277
//~| ERROR E0277

fn main() {}

I expected to see this happen: Both without and with incr comp a single diagnostic.

Instead, this happened: Without incr comp a single diagnostic. With incr comp 4 duplicated diagnostics. With -Zdeduplicate-diagnostics=no in both cases 4 diagnostics are shown, but with incr comp it misses the message that the diagnostics were deduplicated.

Adding some debug prints shows that each diagnostic hashes to a different value with incr comp enabled, yet the debug print of the diagnostics are identical as is the DiagInner::keys() debug print.

Meta

rustc --version --verbose:

rustc 1.100.0-dev
binary: rustc
commit-hash: unknown
commit-date: unknown
host: x86_64-unknown-linux-gnu
release: 1.100.0-dev
LLVM version: 23.1.1

c999cef

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-incr-compArea: Incremental compilationC-bugCategory: This is a bug.D-diagnostic-infraDiagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions