diff options
Diffstat (limited to 'crates/ra_project_model/src/sysroot.rs')
-rw-r--r-- | crates/ra_project_model/src/sysroot.rs | 6 |
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 3d827809e..8a7757c41 100644 --- a/crates/ra_project_model/src/sysroot.rs +++ b/crates/ra_project_model/src/sysroot.rs | |||
@@ -35,6 +35,10 @@ impl Sysroot { | |||
35 | self.by_name("std") | 35 | self.by_name("std") |
36 | } | 36 | } |
37 | 37 | ||
38 | pub fn proc_macro(&self) -> Option<SysrootCrate> { | ||
39 | self.by_name("proc_macro") | ||
40 | } | ||
41 | |||
38 | pub fn crates<'a>(&'a self) -> impl Iterator<Item = SysrootCrate> + ExactSizeIterator + 'a { | 42 | pub fn crates<'a>(&'a self) -> impl Iterator<Item = SysrootCrate> + ExactSizeIterator + 'a { |
39 | self.crates.iter().map(|(id, _data)| id) | 43 | self.crates.iter().map(|(id, _data)| id) |
40 | } | 44 | } |
@@ -70,7 +74,7 @@ impl Sysroot { | |||
70 | } | 74 | } |
71 | } | 75 | } |
72 | if let Some(alloc) = sysroot.by_name("alloc") { | 76 | if let Some(alloc) = sysroot.by_name("alloc") { |
73 | if let Some(core) = sysroot.by_name("core") { | 77 | if let Some(core) = sysroot.core() { |
74 | sysroot.crates[alloc].deps.push(core); | 78 | sysroot.crates[alloc].deps.push(core); |
75 | } | 79 | } |
76 | } | 80 | } |