improve error message for when a query isn't supported
This commit is contained in:
parent
dddfb7db24
commit
0405a5d4e9
@ -275,11 +275,11 @@ macro_rules! define_callbacks {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Providers {
|
Providers {
|
||||||
$($name: |_, key| bug!(
|
$($name: |_, key| bug!(
|
||||||
"`tcx.{}({:?})` unsupported for {} crate; \
|
"`tcx.{}({:?})` is not supported for external or local crate;\n
|
||||||
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.",
|
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
|
||||||
|
If that's not the case, {} was likely never assigned to a provider function.\n",
|
||||||
stringify!($name),
|
stringify!($name),
|
||||||
key,
|
key,
|
||||||
if key.query_crate_is_local() { "local" } : { "external" } ,
|
|
||||||
stringify!($name),
|
stringify!($name),
|
||||||
),)*
|
),)*
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user