more VecSet

This commit is contained in:
Folkert 2022-04-17 20:14:25 +02:00
parent f772c87c4b
commit 39aa112fd5
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -7,7 +7,7 @@ use crate::operator::desugar_def;
use crate::pattern::Pattern; use crate::pattern::Pattern;
use crate::scope::Scope; use crate::scope::Scope;
use bumpalo::Bump; use bumpalo::Bump;
use roc_collections::all::{MutMap, MutSet, SendMap}; use roc_collections::all::{MutMap, MutSet, SendMap, VecSet};
use roc_module::ident::Lowercase; use roc_module::ident::Lowercase;
use roc_module::ident::{Ident, TagName}; use roc_module::ident::{Ident, TagName};
use roc_module::symbol::{IdentIds, ModuleId, ModuleIds, Symbol}; use roc_module::symbol::{IdentIds, ModuleId, ModuleIds, Symbol};
@ -24,8 +24,8 @@ pub struct Module {
pub module_id: ModuleId, pub module_id: ModuleId,
pub exposed_imports: MutMap<Symbol, Variable>, pub exposed_imports: MutMap<Symbol, Variable>,
pub exposed_symbols: MutSet<Symbol>, pub exposed_symbols: MutSet<Symbol>,
pub referenced_values: MutSet<Symbol>, pub referenced_values: VecSet<Symbol>,
pub referenced_types: MutSet<Symbol>, pub referenced_types: VecSet<Symbol>,
/// all aliases. `bool` indicates whether it is exposed /// all aliases. `bool` indicates whether it is exposed
pub aliases: MutMap<Symbol, (bool, Alias)>, pub aliases: MutMap<Symbol, (bool, Alias)>,
pub rigid_variables: RigidVariables, pub rigid_variables: RigidVariables,
@ -36,7 +36,7 @@ pub struct Module {
pub struct RigidVariables { pub struct RigidVariables {
pub named: MutMap<Variable, Lowercase>, pub named: MutMap<Variable, Lowercase>,
pub able: MutMap<Variable, (Lowercase, Symbol)>, pub able: MutMap<Variable, (Lowercase, Symbol)>,
pub wildcards: MutSet<Variable>, pub wildcards: VecSet<Variable>,
} }
#[derive(Debug)] #[derive(Debug)]
@ -48,8 +48,8 @@ pub struct ModuleOutput {
pub lookups: Vec<(Symbol, Variable, Region)>, pub lookups: Vec<(Symbol, Variable, Region)>,
pub problems: Vec<Problem>, pub problems: Vec<Problem>,
pub ident_ids: IdentIds, pub ident_ids: IdentIds,
pub referenced_values: MutSet<Symbol>, pub referenced_values: VecSet<Symbol>,
pub referenced_types: MutSet<Symbol>, pub referenced_types: VecSet<Symbol>,
pub scope: Scope, pub scope: Scope,
} }
@ -273,8 +273,8 @@ pub fn canonicalize_module_defs<'a>(
rigid_variables.wildcards.insert(var.value); rigid_variables.wildcards.insert(var.value);
} }
let mut referenced_values = MutSet::default(); let mut referenced_values = VecSet::default();
let mut referenced_types = MutSet::default(); let mut referenced_types = VecSet::default();
// Gather up all the symbols that were referenced across all the defs' lookups. // Gather up all the symbols that were referenced across all the defs' lookups.
referenced_values.extend(output.references.value_lookups); referenced_values.extend(output.references.value_lookups);