mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
propagate deps to CrateGraph
This commit is contained in:
parent
32c067f8c9
commit
9b1356464a
3 changed files with 43 additions and 14 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue