]> git.lizzy.rs Git - rust.git/commitdiff
Improve error message for unsupported crate
authorhanar3 <vh.morenodasilva@gmail.com>
Wed, 14 Sep 2022 15:19:42 +0000 (12:19 -0300)
committerhanar3 <vh.morenodasilva@gmail.com>
Wed, 14 Sep 2022 15:19:42 +0000 (12:19 -0300)
compiler/rustc_middle/src/ty/query.rs

index 5665bb866d46c68218d2cf9a09f7fd6a99d184d4..d69c28cfda294046f24c54c3edc5d32bc8466466 100644 (file)
@@ -275,10 +275,11 @@ impl Default for Providers {
             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),
                     ),)*
                 }