Skip to content

Commit b429df2

Browse files
committed
Auto merge of #13342 - rust-lang:revert-13328-rustc-proc-macro, r=Veykril
Revert "Add proc-macro dependency to rustc crates" 1. This panics since it indexes into the wrong thing, so fixes #13340 2. This didn't fix what I thought it would either Reverts #13328
2 parents 974caaf + e0c9e28 commit b429df2

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

crates/project-model/src/workspace.rs

-15
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,6 @@ fn cargo_to_crate_graph(
717717
load_proc_macro,
718718
&mut pkg_to_lib_crate,
719719
&public_deps,
720-
libproc_macro,
721720
cargo,
722721
&pkg_crates,
723722
build_scripts,
@@ -783,7 +782,6 @@ fn handle_rustc_crates(
783782
load_proc_macro: &mut dyn FnMut(&str, &AbsPath) -> ProcMacroLoadResult,
784783
pkg_to_lib_crate: &mut FxHashMap<Package, CrateId>,
785784
public_deps: &SysrootPublicDeps,
786-
libproc_macro: Option<CrateId>,
787785
cargo: &CargoWorkspace,
788786
pkg_crates: &FxHashMap<Package, Vec<(CrateId, TargetKind)>>,
789787
build_scripts: &WorkspaceBuildScripts,
@@ -845,19 +843,6 @@ fn handle_rustc_crates(
845843
rustc_workspace[tgt].is_proc_macro,
846844
);
847845
pkg_to_lib_crate.insert(pkg, crate_id);
848-
849-
// Even crates that don't set proc-macro = true are allowed to depend on proc_macro
850-
// (just none of the APIs work when called outside of a proc macro).
851-
if let Some(proc_macro) = libproc_macro {
852-
add_dep_with_prelude(
853-
crate_graph,
854-
crate_id,
855-
CrateName::new("proc_macro").unwrap(),
856-
proc_macro,
857-
cargo[tgt].is_proc_macro,
858-
);
859-
}
860-
861846
// Add dependencies on core / std / alloc for this crate
862847
public_deps.add(crate_id, crate_graph);
863848
rustc_pkg_crates.entry(pkg).or_insert_with(Vec::new).push(crate_id);

0 commit comments

Comments
 (0)