propagate deps to CrateGraph

This commit is contained in:
Aleksey Kladov 2018-12-08 23:16:11 +03:00
parent 32c067f8c9
commit 9b1356464a
3 changed files with 43 additions and 14 deletions

View file

@ -48,6 +48,9 @@ impl CrateGraph {
assert!(prev.is_none());
crate_id
}
//FIXME: check that we don't have cycles here.
// Just a simple depth first search from `to` should work,
// the graph is small.
pub fn add_dep(&mut self, from: CrateId, to: CrateId) {
self.arena.get_mut(&from).unwrap().add_dep(to)
}