diff options
Diffstat (limited to 'crates/ra_project_model/src')
-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 77f729a25..55ff4d6ef 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 | let libproc_macro = | 214 | let libproc_macro = |
214 | sysroot.proc_macro().and_then(|it| sysroot_crates.get(&it).copied()); | 215 | sysroot.proc_macro().and_then(|it| sysroot_crates.get(&it).copied()); |
@@ -278,6 +279,11 @@ impl ProjectWorkspace { | |||
278 | log::error!("cyclic dependency on core for {}", pkg.name(&cargo)) | 279 | log::error!("cyclic dependency on core for {}", pkg.name(&cargo)) |
279 | } | 280 | } |
280 | } | 281 | } |
282 | if let Some(alloc) = liballoc { | ||
283 | if let Err(_) = crate_graph.add_dep(from, "alloc".into(), alloc) { | ||
284 | log::error!("cyclic dependency on alloc for {}", pkg.name(&cargo)) | ||
285 | } | ||
286 | } | ||
281 | if let Some(std) = libstd { | 287 | if let Some(std) = libstd { |
282 | if let Err(_) = crate_graph.add_dep(from, "std".into(), std) { | 288 | if let Err(_) = crate_graph.add_dep(from, "std".into(), std) { |
283 | log::error!("cyclic dependency on std for {}", pkg.name(&cargo)) | 289 | 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 8a7757c41..10ca391b6 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 | } |