Skip to content

Commit dddfb7d

Browse files
committed
Improve error message for unsupported crate
1 parent 1463688 commit dddfb7d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: compiler/rustc_middle/src/ty/query.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,11 @@ macro_rules! define_callbacks {
275275
fn default() -> Self {
276276
Providers {
277277
$($name: |_, key| bug!(
278-
"`tcx.{}({:?})` unsupported by its crate; \
279-
perhaps the `{}` query was never assigned a provider function",
278+
"`tcx.{}({:?})` unsupported for {} crate; \
279+
perhaps the `{}` query was never assigned a provider function. Queries can be either made to the local crate, or the external crate. This error means you tried to use it for one that's not supported.",
280280
stringify!($name),
281281
key,
282+
if key.query_crate_is_local() { "local" } : { "external" } ,
282283
stringify!($name),
283284
),)*
284285
}

0 commit comments

Comments
 (0)