Skip to content

Commit 0405a5d

Browse files
committed
improve error message for when a query isn't supported
1 parent dddfb7d commit 0405a5d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_middle/src/ty/query.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,11 @@ macro_rules! define_callbacks {
275275
fn default() -> Self {
276276
Providers {
277277
$($name: |_, key| bug!(
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.",
278+
"`tcx.{}({:?})` is not supported for external or local crate;\n
279+
hint: 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 (likely the local crate).\n
280+
If that's not the case, {} was likely never assigned to a provider function.\n",
280281
stringify!($name),
281282
key,
282-
if key.query_crate_is_local() { "local" } : { "external" } ,
283283
stringify!($name),
284284
),)*
285285
}

0 commit comments

Comments
 (0)