fix unused import bug

This commit is contained in:
Folkert 2020-10-12 16:12:27 +02:00
parent 27cdcffec0
commit 2e8499f92c
3 changed files with 23 additions and 15 deletions

View file

@ -149,14 +149,13 @@ pub fn canonicalize_module_defs<'a>(
}
// Gather up all the symbols that were referenced from other modules.
for symbol in env.referenced_symbols.iter() {
for symbol in env.qualified_lookups.iter() {
references.insert(*symbol);
}
// Add defs for any referenced builtins.
for (symbol, def) in builtin_defs(var_store) {
if output.references.lookups.contains(&symbol) || output.references.calls.contains(&symbol)
{
if references.contains(&symbol) {
defs.can_defs_by_symbol.insert(symbol, def);
}
}
@ -250,6 +249,11 @@ pub fn canonicalize_module_defs<'a>(
references.insert(symbol);
}
// Gather up all the symbols that were referenced from other modules.
for symbol in env.qualified_lookups.iter() {
references.insert(*symbol);
}
Ok(ModuleOutput {
aliases,
rigid_variables,