Remove ExposedModuleTypes::Invalid

This commit is contained in:
Ayaz Hafiz 2022-05-18 09:37:35 -04:00
parent 1beb0551cb
commit f8cf18b10e
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -448,20 +448,18 @@ fn start_phase<'a>(
// ability specializations our dependents have, because those might be used by the // ability specializations our dependents have, because those might be used by the
// specializations we've been asked to make. // specializations we've been asked to make.
for (_module_id, exposed_types) in state.exposed_types.iter_all() { for (_module_id, exposed_types) in state.exposed_types.iter_all() {
if let ExposedModuleTypes::Valid { let ExposedModuleTypes {
solved_specializations, solved_specializations,
.. ..
} = exposed_types } = exposed_types;
{ for (&(member, typ), &specialization) in solved_specializations.iter() {
for (&(member, typ), &specialization) in solved_specializations.iter() { match abilities_store.get_specialization(member, typ) {
match abilities_store.get_specialization(member, typ) { None => abilities_store.register_specialization_for_type(
None => abilities_store.register_specialization_for_type( member,
member, typ,
typ, specialization,
specialization, ),
), Some(existing) => debug_assert_eq!(existing, specialization),
Some(existing) => debug_assert_eq!(existing, specialization),
}
} }
} }
} }
@ -3532,18 +3530,12 @@ impl<'a> BuildTask<'a> {
let exposed = exposed_by_module let exposed = exposed_by_module
.get(module) .get(module)
.unwrap_or_else(|| internal_error!("No exposed types for {:?}", module)); .unwrap_or_else(|| internal_error!("No exposed types for {:?}", module));
if let ExposedModuleTypes::Valid { let ExposedModuleTypes {
solved_specializations, solved_specializations,
.. ..
} = exposed } = exposed;
{ for ((member, typ), specialization) in solved_specializations.iter() {
for ((member, typ), specialization) in solved_specializations.iter() { abilities_store.register_specialization_for_type(*member, *typ, *specialization);
abilities_store.register_specialization_for_type(
*member,
*typ,
*specialization,
);
}
} }
} }
@ -3589,6 +3581,7 @@ fn add_imports(
Some(ExposedModuleTypes { Some(ExposedModuleTypes {
stored_vars_by_symbol, stored_vars_by_symbol,
storage_subs, storage_subs,
solved_specializations: _,
}) => { }) => {
let variable = match stored_vars_by_symbol.iter().find(|(s, _)| *s == symbol) { let variable = match stored_vars_by_symbol.iter().find(|(s, _)| *s == symbol) {
None => { None => {