mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +00:00
fix: Pass the build data to rustc_private crates
This commit is contained in:
parent
4f2a67b26f
commit
10e9f47dce
2 changed files with 10 additions and 2 deletions
|
@ -667,6 +667,7 @@ fn cargo_to_crate_graph(
|
||||||
&public_deps,
|
&public_deps,
|
||||||
cargo,
|
cargo,
|
||||||
&pkg_crates,
|
&pkg_crates,
|
||||||
|
build_scripts,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -728,6 +729,7 @@ fn handle_rustc_crates(
|
||||||
public_deps: &SysrootPublicDeps,
|
public_deps: &SysrootPublicDeps,
|
||||||
cargo: &CargoWorkspace,
|
cargo: &CargoWorkspace,
|
||||||
pkg_crates: &FxHashMap<la_arena::Idx<crate::PackageData>, Vec<(CrateId, TargetKind)>>,
|
pkg_crates: &FxHashMap<la_arena::Idx<crate::PackageData>, Vec<(CrateId, TargetKind)>>,
|
||||||
|
build_scripts: &WorkspaceBuildScripts,
|
||||||
) {
|
) {
|
||||||
let mut rustc_pkg_crates = FxHashMap::default();
|
let mut rustc_pkg_crates = FxHashMap::default();
|
||||||
// The root package of the rustc-dev component is rustc_driver, so we match that
|
// The root package of the rustc-dev component is rustc_driver, so we match that
|
||||||
|
@ -781,7 +783,7 @@ fn handle_rustc_crates(
|
||||||
let crate_id = add_target_crate_root(
|
let crate_id = add_target_crate_root(
|
||||||
crate_graph,
|
crate_graph,
|
||||||
&rustc_workspace[pkg],
|
&rustc_workspace[pkg],
|
||||||
None,
|
build_scripts.get_output(pkg),
|
||||||
cfg_options,
|
cfg_options,
|
||||||
&mut |path| load_proc_macro(&rustc_workspace[tgt].name, path),
|
&mut |path| load_proc_macro(&rustc_workspace[tgt].name, path),
|
||||||
file_id,
|
file_id,
|
||||||
|
|
|
@ -550,7 +550,7 @@ pub(crate) fn load_proc_macro(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return client
|
let proc_macros: Vec<_> = client
|
||||||
.map(|it| it.load_dylib(dylib))
|
.map(|it| it.load_dylib(dylib))
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flat_map(|it| match it {
|
.flat_map(|it| match it {
|
||||||
|
@ -568,6 +568,12 @@ pub(crate) fn load_proc_macro(
|
||||||
})
|
})
|
||||||
.map(|expander| expander_to_proc_macro(expander, dummy_replace))
|
.map(|expander| expander_to_proc_macro(expander, dummy_replace))
|
||||||
.collect();
|
.collect();
|
||||||
|
tracing::info!(
|
||||||
|
"Loaded proc-macros for {}: {:?}",
|
||||||
|
path.display(),
|
||||||
|
proc_macros.iter().map(|it| it.name.clone()).collect::<Vec<_>>()
|
||||||
|
);
|
||||||
|
return proc_macros;
|
||||||
|
|
||||||
fn expander_to_proc_macro(
|
fn expander_to_proc_macro(
|
||||||
expander: proc_macro_api::ProcMacro,
|
expander: proc_macro_api::ProcMacro,
|
||||||
|
|
Loading…
Reference in a new issue