idea (rejected): only generate work up to constraint gen, then look at what modules are actually used and generate Solve.. work based on that

This commit is contained in:
Folkert 2022-03-19 16:26:38 +01:00
parent 3db44af36f
commit 2cbe5f5231
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
5 changed files with 156 additions and 23 deletions

View file

@ -32,13 +32,21 @@ impl ExposedByModule {
///
/// Useful when we know what modules a particular module imports, and want just
/// the exposed types for those exposed modules.
pub fn retain_modules<'a>(&self, it: impl Iterator<Item = &'a ModuleId>) -> Self {
pub fn retain_modules<'a>(
&self,
home: ModuleId,
it: impl Iterator<Item = &'a ModuleId>,
) -> Self {
let mut output = Self::default();
for module_id in it {
match self.exposed.get(module_id) {
None => {
internal_error!("Module {:?} did not register its exposed values", module_id)
internal_error!(
"Module {:?} did not register its exposed values for {:?}",
module_id,
home,
)
}
Some(exposed_types) => {
output.exposed.insert(*module_id, exposed_types.clone());