Skip to content

Missing tcx query provider is hard to diagnose - error message is not intuitive #83122

Closed
@richkadel

Description

@richkadel

I inadvertently deleted a rustc_middle::ty::query::Providers assignment (which meant that any tcx.some_unassigned_query(def_id) would not be resolved.

Since tcx query functions are assigned at runtime, this is not a build-time error.

The best that rustc can do is generate a runtime error, but the error message is non-intuitive, and it took quite a while for me to realize my mistake:

error: internal compiler error: compiler/rustc_middle/src/ty/query/mod.rs:279:1:
   `tcx.coverageinfo(DefId(0:3 ~ abort[317d]::might_abort))` unsupported by its crate

Is there a better way to word this message to make it more obvious that there is a query defined, but a provider was never assigned?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustA-query-systemArea: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions