diff options
author | Aleksey Kladov <[email protected]> | 2018-12-08 20:16:11 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-09 10:33:16 +0000 |
commit | 9b1356464a834e0b9a88dd3eeabc50bf1d734f35 (patch) | |
tree | 880f693f1e800c263a08654456c3958cd6c650fe /crates/ra_db | |
parent | 32c067f8c9aec56bb502c5a569884679bae27af3 (diff) |
propagate deps to CrateGraph
Diffstat (limited to 'crates/ra_db')
-rw-r--r-- | crates/ra_db/src/input.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 7d9faa43c..a48d05b98 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -48,6 +48,9 @@ impl CrateGraph { | |||
48 | assert!(prev.is_none()); | 48 | assert!(prev.is_none()); |
49 | crate_id | 49 | crate_id |
50 | } | 50 | } |
51 | //FIXME: check that we don't have cycles here. | ||
52 | // Just a simple depth first search from `to` should work, | ||
53 | // the graph is small. | ||
51 | pub fn add_dep(&mut self, from: CrateId, to: CrateId) { | 54 | pub fn add_dep(&mut self, from: CrateId, to: CrateId) { |
52 | self.arena.get_mut(&from).unwrap().add_dep(to) | 55 | self.arena.get_mut(&from).unwrap().add_dep(to) |
53 | } | 56 | } |