This commit is contained in:
Alex Crichton
2018-02-05 14:24:25 -08:00
parent ec1c263480
commit 8f8da49dab
5 changed files with 251 additions and 62 deletions

View File

@ -109,6 +109,7 @@ fn extract_program(module: &mut Module) -> shared::Program {
structs: Vec::new(),
free_functions: Vec::new(),
imports: Vec::new(),
imported_structs: Vec::new(),
};
let data = match data {
Some(data) => data,
@ -126,10 +127,11 @@ fn extract_program(module: &mut Module) -> shared::Program {
Ok(f) => f,
Err(_) => continue,
};
let shared::Program { structs, free_functions, imports } = p;
let shared::Program { structs, free_functions, imports, imported_structs } = p;
ret.structs.extend(structs);
ret.free_functions.extend(free_functions);
ret.imports.extend(imports);
ret.imported_structs.extend(imported_structs);
}
data.entries_mut().remove(i);
}