about summary refs log tree commit diff
path: root/compiler/rustc_middle
diff options
context:
space:
mode:
authorhanar3 <vh.morenodasilva@gmail.com>2022-09-14 12:19:42 -0300
committerhanar3 <vh.morenodasilva@gmail.com>2022-09-14 12:19:42 -0300
commitdddfb7db24e66891fec9f2abf2ac1477985f36ad (patch)
treeca063d916b27cb1d4241a05e02156dfff82a1908 /compiler/rustc_middle
parent14636887008d9ee67a12b4f05f1e404ed1d64579 (diff)
downloadrust-dddfb7db24e66891fec9f2abf2ac1477985f36ad.tar.gz
rust-dddfb7db24e66891fec9f2abf2ac1477985f36ad.zip
Improve error message for unsupported crate
Diffstat (limited to 'compiler/rustc_middle')
-rw-r--r--compiler/rustc_middle/src/ty/query.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/query.rs b/compiler/rustc_middle/src/ty/query.rs
index 5665bb866d4..d69c28cfda2 100644
--- a/compiler/rustc_middle/src/ty/query.rs
+++ b/compiler/rustc_middle/src/ty/query.rs
@@ -275,10 +275,11 @@ macro_rules! define_callbacks {
             fn default() -> Self {
                 Providers {
                     $($name: |_, key| bug!(
-                        "`tcx.{}({:?})` unsupported by its crate; \
-                         perhaps the `{}` query was never assigned a provider function",
+                        "`tcx.{}({:?})` unsupported for {} crate; \
+                         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.", 
                         stringify!($name),
                         key,
+                        if key.query_crate_is_local() { "local" } : { "external" } ,
                         stringify!($name),
                     ),)*
                 }