Description
@richkadel made a great start on this in #83367, but it would be nice to explain the local
/external
distinction in the panic message; "unsupported by crate" is unhelpful. This is an ICE targeted at compiler developers so IMO it can be pretty much as long as we want.
Currently the error looks like this:
error: internal compiler error: compiler\rustc_middle\src\ty\query.rs:335:1: tcx.module_children(DefId(0:4 ~ similar_paths_reexported[71d7]::module::S)) unsupported by its crate; perhaps the module_children query was never assigned a provider function
I wrote up this description while helping someone debug on discord, which may be a good start:
There are two types of queries. Queries local to the crate, and queries for external crates. This error means that you try to use it for the one that's not supported - usually that's the local crate
But you can tell by looking at CrateId of the DefId
If possible, we should say "tcx.module_children
unsupported by local crate" (or external as appropriate, selected at runtime), but if not, we should at least explain what's going wrong better. The link below has a lot of details about the code structure that may be helpful.
Originally posted by @richkadel in #83122 (comment)