add proc-macro crate type handling

This commit is contained in:
JasperDeSutter 2019-11-24 11:33:12 +01:00
parent ea3124c12a
commit 6a8b4f873a
3 changed files with 30 additions and 1 deletions

View file

@ -35,6 +35,10 @@ impl Sysroot {
self.by_name("std")
}
pub fn proc_macro(&self) -> Option<SysrootCrate> {
self.by_name("proc_macro")
}
pub fn crates<'a>(&'a self) -> impl Iterator<Item = SysrootCrate> + ExactSizeIterator + 'a {
self.crates.iter().map(|(id, _data)| id)
}
@ -70,7 +74,7 @@ impl Sysroot {
}
}
if let Some(alloc) = sysroot.by_name("alloc") {
if let Some(core) = sysroot.by_name("core") {
if let Some(core) = sysroot.core() {
sysroot.crates[alloc].deps.push(core);
}
}