`panic` when asked for a module in `ExternalDeclProvider`
commite418f6533de519d0136794b39c2c383bc55950c9
authorHunter Goldstein <hgoldstein@fb.com>
Thu, 17 Mar 2022 23:57:16 +0000 (17 16:57 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 17 Mar 2022 23:57:16 +0000 (17 16:57 -0700)
tree189622614eebc86b8dbece76cd8750e9eed2a35b
parentb6ed5e901a27e31ab6da00b62022a9c4a648bfed
`panic` when asked for a module in `ExternalDeclProvider`

Summary:
While reviewing the previous stack w/ jakebailey he noted that I probably ought to panic here rather than always state that modules don't exist.

My initial reasoning was defensive: HackC crashes are *bad* as they're difficult to surface to users. It's technically correct to say modules never exist in this position as they (currently) aren't exposed to the runtime

Jake's reasoning was that in the event that we *do* expose modules to the runtime, and they're asked for in this position, it's going to be confusing to debug if they're all not found. Additionally, asking for modules *at all* until that time is definitely a mistake. This fails loudly rather than silently.

Differential Revision: D34940879

fbshipit-source-id: d424e5d621907883b1570fcf5b707af096fa448c
hphp/hack/src/hackc/decl_provider/external.rs