10460: fix: Only add `proc_macro` to prelude in proc-macro crates r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10455

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2021-10-04 16:24:54 +00:00 committed by GitHub
commit bf81723221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -563,11 +563,12 @@ fn cargo_to_crate_graph(
pkg_to_lib_crate.insert(pkg, crate_id);
}
if let Some(proc_macro) = libproc_macro {
add_dep(
add_dep_with_prelude(
&mut crate_graph,
crate_id,
CrateName::new("proc_macro").unwrap(),
proc_macro,
cargo[tgt].is_proc_macro,
);
}