mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 13:33:31 +00:00
Merge #7317
7317: Add profile call r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
5e6e890947
4 changed files with 6 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -1231,6 +1231,7 @@ dependencies = [
|
|||
"log",
|
||||
"paths",
|
||||
"proc_macro_api",
|
||||
"profile",
|
||||
"rustc-hash",
|
||||
"serde",
|
||||
"serde_json",
|
||||
|
|
|
@ -25,3 +25,4 @@ toolchain = { path = "../toolchain", version = "0.0.0" }
|
|||
proc_macro_api = { path = "../proc_macro_api", version = "0.0.0" }
|
||||
paths = { path = "../paths", version = "0.0.0" }
|
||||
stdx = { path = "../stdx", version = "0.0.0" }
|
||||
profile = { path = "../profile", version = "0.0.0" }
|
||||
|
|
|
@ -207,6 +207,7 @@ impl ProjectWorkspace {
|
|||
proc_macro_client: Option<&ProcMacroClient>,
|
||||
load: &mut dyn FnMut(&AbsPath) -> Option<FileId>,
|
||||
) -> CrateGraph {
|
||||
let _p = profile::span("ProjectWorkspace::to_crate_graph");
|
||||
let proc_macro_loader = |path: &Path| match proc_macro_client {
|
||||
Some(client) => client.by_dylib_path(path),
|
||||
None => Vec::new(),
|
||||
|
@ -299,6 +300,7 @@ fn cargo_to_crate_graph(
|
|||
sysroot: &Sysroot,
|
||||
rustc: &Option<CargoWorkspace>,
|
||||
) -> CrateGraph {
|
||||
let _p = profile::span("cargo_to_crate_graph");
|
||||
let mut crate_graph = CrateGraph::default();
|
||||
let (public_deps, libproc_macro) =
|
||||
sysroot_to_crate_graph(&mut crate_graph, sysroot, target, load);
|
||||
|
@ -493,6 +495,7 @@ fn sysroot_to_crate_graph(
|
|||
target: Option<&str>,
|
||||
load: &mut dyn FnMut(&AbsPath) -> Option<FileId>,
|
||||
) -> (Vec<(CrateName, CrateId)>, Option<CrateId>) {
|
||||
let _p = profile::span("sysroot_to_crate_graph");
|
||||
let mut cfg_options = CfgOptions::default();
|
||||
cfg_options.extend(get_rustc_cfg_options(target));
|
||||
let sysroot_crates: FxHashMap<SysrootCrate, CrateId> = sysroot
|
||||
|
|
|
@ -274,6 +274,7 @@ impl GlobalState {
|
|||
}
|
||||
|
||||
fn reload_flycheck(&mut self) {
|
||||
let _p = profile::span("GlobalState::reload_flycheck");
|
||||
let config = match self.config.flycheck() {
|
||||
Some(it) => it,
|
||||
None => {
|
||||
|
|
Loading…
Reference in a new issue