diff options
Diffstat (limited to 'crates/ra_project_model')
-rw-r--r-- | crates/ra_project_model/src/lib.rs | 6 | ||||
-rw-r--r-- | crates/ra_project_model/src/sysroot.rs | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_project_model/src/lib.rs b/crates/ra_project_model/src/lib.rs index d04a8cbe2..638ca2f8b 100644 --- a/crates/ra_project_model/src/lib.rs +++ b/crates/ra_project_model/src/lib.rs | |||
@@ -209,6 +209,7 @@ impl ProjectWorkspace { | |||
209 | } | 209 | } |
210 | 210 | ||
211 | let libcore = sysroot.core().and_then(|it| sysroot_crates.get(&it).copied()); | 211 | let libcore = sysroot.core().and_then(|it| sysroot_crates.get(&it).copied()); |
212 | let liballoc = sysroot.alloc().and_then(|it| sysroot_crates.get(&it).copied()); | ||
212 | let libstd = sysroot.std().and_then(|it| sysroot_crates.get(&it).copied()); | 213 | let libstd = sysroot.std().and_then(|it| sysroot_crates.get(&it).copied()); |
213 | 214 | ||
214 | let mut pkg_to_lib_crate = FxHashMap::default(); | 215 | let mut pkg_to_lib_crate = FxHashMap::default(); |
@@ -261,6 +262,11 @@ impl ProjectWorkspace { | |||
261 | log::error!("cyclic dependency on core for {}", pkg.name(&cargo)) | 262 | log::error!("cyclic dependency on core for {}", pkg.name(&cargo)) |
262 | } | 263 | } |
263 | } | 264 | } |
265 | if let Some(alloc) = liballoc { | ||
266 | if let Err(_) = crate_graph.add_dep(from, "alloc".into(), alloc) { | ||
267 | log::error!("cyclic dependency on alloc for {}", pkg.name(&cargo)) | ||
268 | } | ||
269 | } | ||
264 | if let Some(std) = libstd { | 270 | if let Some(std) = libstd { |
265 | if let Err(_) = crate_graph.add_dep(from, "std".into(), std) { | 271 | if let Err(_) = crate_graph.add_dep(from, "std".into(), std) { |
266 | log::error!("cyclic dependency on std for {}", pkg.name(&cargo)) | 272 | log::error!("cyclic dependency on std for {}", pkg.name(&cargo)) |
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs index 3d827809e..bec9439d7 100644 --- a/crates/ra_project_model/src/sysroot.rs +++ b/crates/ra_project_model/src/sysroot.rs | |||
@@ -31,6 +31,10 @@ impl Sysroot { | |||
31 | self.by_name("core") | 31 | self.by_name("core") |
32 | } | 32 | } |
33 | 33 | ||
34 | pub fn alloc(&self) -> Option<SysrootCrate> { | ||
35 | self.by_name("alloc") | ||
36 | } | ||
37 | |||
34 | pub fn std(&self) -> Option<SysrootCrate> { | 38 | pub fn std(&self) -> Option<SysrootCrate> { |
35 | self.by_name("std") | 39 | self.by_name("std") |
36 | } | 40 | } |