Skip to content

Commit 17474c1

Browse files
committed
Update sysroot crates
1 parent e47460b commit 17474c1

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

crates/project-model/src/sysroot.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,18 @@ impl Sysroot {
128128
}
129129

130130
if let Some(alloc) = sysroot.by_name("alloc") {
131-
if let Some(core) = sysroot.by_name("core") {
132-
sysroot.crates[alloc].deps.push(core);
131+
for dep in ALLOC_DEPS.trim().lines() {
132+
if let Some(dep) = sysroot.by_name(dep) {
133+
sysroot.crates[alloc].deps.push(dep)
134+
}
133135
}
134136
}
135137

136138
if let Some(proc_macro) = sysroot.by_name("proc_macro") {
137-
if let Some(std) = sysroot.by_name("std") {
138-
sysroot.crates[proc_macro].deps.push(std);
139+
for dep in PROC_MACRO_DEPS.trim().lines() {
140+
if let Some(dep) = sysroot.by_name(dep) {
141+
sysroot.crates[proc_macro].deps.push(dep)
142+
}
139143
}
140144
}
141145

@@ -239,24 +243,27 @@ fn get_rust_src(sysroot_path: &AbsPath) -> Option<AbsPathBuf> {
239243

240244
const SYSROOT_CRATES: &str = "
241245
alloc
246+
backtrace
242247
core
243248
panic_abort
244249
panic_unwind
245250
proc_macro
246251
profiler_builtins
247252
std
248253
stdarch/crates/std_detect
249-
term
250254
test
251255
unwind";
252256

257+
const ALLOC_DEPS: &str = "core";
258+
253259
const STD_DEPS: &str = "
254260
alloc
255-
core
256-
panic_abort
257261
panic_unwind
262+
panic_abort
263+
core
258264
profiler_builtins
265+
unwind
259266
std_detect
260-
term
261-
test
262-
unwind";
267+
test";
268+
269+
const PROC_MACRO_DEPS: &str = "std";

0 commit comments

Comments
 (0)