Add alloc to the sysroot
This commit is contained in:
@@ -209,6 +209,7 @@ impl ProjectWorkspace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let libcore = sysroot.core().and_then(|it| sysroot_crates.get(&it).copied());
|
let libcore = sysroot.core().and_then(|it| sysroot_crates.get(&it).copied());
|
||||||
|
let liballoc = sysroot.alloc().and_then(|it| sysroot_crates.get(&it).copied());
|
||||||
let libstd = sysroot.std().and_then(|it| sysroot_crates.get(&it).copied());
|
let libstd = sysroot.std().and_then(|it| sysroot_crates.get(&it).copied());
|
||||||
|
|
||||||
let mut pkg_to_lib_crate = FxHashMap::default();
|
let mut pkg_to_lib_crate = FxHashMap::default();
|
||||||
@@ -261,6 +262,11 @@ impl ProjectWorkspace {
|
|||||||
log::error!("cyclic dependency on core for {}", pkg.name(&cargo))
|
log::error!("cyclic dependency on core for {}", pkg.name(&cargo))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if let Some(alloc) = liballoc {
|
||||||
|
if let Err(_) = crate_graph.add_dep(from, "alloc".into(), alloc) {
|
||||||
|
log::error!("cyclic dependency on alloc for {}", pkg.name(&cargo))
|
||||||
|
}
|
||||||
|
}
|
||||||
if let Some(std) = libstd {
|
if let Some(std) = libstd {
|
||||||
if let Err(_) = crate_graph.add_dep(from, "std".into(), std) {
|
if let Err(_) = crate_graph.add_dep(from, "std".into(), std) {
|
||||||
log::error!("cyclic dependency on std for {}", pkg.name(&cargo))
|
log::error!("cyclic dependency on std for {}", pkg.name(&cargo))
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ impl Sysroot {
|
|||||||
self.by_name("core")
|
self.by_name("core")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn alloc(&self) -> Option<SysrootCrate> {
|
||||||
|
self.by_name("alloc")
|
||||||
|
}
|
||||||
|
|
||||||
pub fn std(&self) -> Option<SysrootCrate> {
|
pub fn std(&self) -> Option<SysrootCrate> {
|
||||||
self.by_name("std")
|
self.by_name("std")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user