aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_project_model/src/sysroot.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_project_model/src/sysroot.rs')
-rw-r--r--crates/ra_project_model/src/sysroot.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_project_model/src/sysroot.rs b/crates/ra_project_model/src/sysroot.rs
index bec9439d7..10ca391b6 100644
--- a/crates/ra_project_model/src/sysroot.rs
+++ b/crates/ra_project_model/src/sysroot.rs
@@ -39,6 +39,10 @@ impl Sysroot {
39 self.by_name("std") 39 self.by_name("std")
40 } 40 }
41 41
42 pub fn proc_macro(&self) -> Option<SysrootCrate> {
43 self.by_name("proc_macro")
44 }
45
42 pub fn crates<'a>(&'a self) -> impl Iterator<Item = SysrootCrate> + ExactSizeIterator + 'a { 46 pub fn crates<'a>(&'a self) -> impl Iterator<Item = SysrootCrate> + ExactSizeIterator + 'a {
43 self.crates.iter().map(|(id, _data)| id) 47 self.crates.iter().map(|(id, _data)| id)
44 } 48 }
@@ -74,7 +78,7 @@ impl Sysroot {
74 } 78 }
75 } 79 }
76 if let Some(alloc) = sysroot.by_name("alloc") { 80 if let Some(alloc) = sysroot.by_name("alloc") {
77 if let Some(core) = sysroot.by_name("core") { 81 if let Some(core) = sysroot.core() {
78 sysroot.crates[alloc].deps.push(core); 82 sysroot.crates[alloc].deps.push(core);
79 } 83 }
80 } 84 }