mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +00:00
Merge #10966
10966: fix: Fix library target overriding sysroot deps r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10827 bors r+ Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
This commit is contained in:
commit
020242ff0e
1 changed files with 3 additions and 1 deletions
|
@ -595,6 +595,9 @@ fn cargo_to_crate_graph(
|
||||||
|
|
||||||
// Set deps to the core, std and to the lib target of the current package
|
// Set deps to the core, std and to the lib target of the current package
|
||||||
for (from, kind) in pkg_crates.get(&pkg).into_iter().flatten() {
|
for (from, kind) in pkg_crates.get(&pkg).into_iter().flatten() {
|
||||||
|
// Add sysroot deps first so that a lib target named `core` etc. can overwrite them.
|
||||||
|
public_deps.add(*from, &mut crate_graph);
|
||||||
|
|
||||||
if let Some((to, name)) = lib_tgt.clone() {
|
if let Some((to, name)) = lib_tgt.clone() {
|
||||||
if to != *from && *kind != TargetKind::BuildScript {
|
if to != *from && *kind != TargetKind::BuildScript {
|
||||||
// (build script can not depend on its library target)
|
// (build script can not depend on its library target)
|
||||||
|
@ -606,7 +609,6 @@ fn cargo_to_crate_graph(
|
||||||
add_dep(&mut crate_graph, *from, name, to);
|
add_dep(&mut crate_graph, *from, name, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public_deps.add(*from, &mut crate_graph);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue