Skip to content

Commit

Permalink
Rollup merge of #83367 - richkadel:query-err-msg, r=jyn514
Browse files Browse the repository at this point in the history
Improve error message for unassigned query provider

Fixes: #83122

r? `@jyn514`

This implements the change we agreed on. Thanks!
  • Loading branch information
Dylan-DPC authored Mar 22, 2021
2 parents 1fdf7d1 + 688c857 commit 014a4ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions compiler/rustc_middle/src/ty/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,11 @@ macro_rules! define_callbacks {
fn default() -> Self {
Providers {
$($name: |_, key| bug!(
"`tcx.{}({:?})` unsupported by its crate",
stringify!($name), key
"`tcx.{}({:?})` unsupported by its crate; \
perhaps the `{}` query was never assigned a provider function",
stringify!($name),
key,
stringify!($name),
),)*
}
}
Expand Down

0 comments on commit 014a4ee

Please sign in to comment.