From add87f54240a20e72136a403c166113af5173572 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 18 Jan 2021 14:52:12 +0300 Subject: Avoid blocking the main loop when editing Cargo.toml I've noticed a bunch of "main loop too long" warnings in console when typing in Cargo.toml. Profiling showed that the culprit is `rustc --print cfg` call. I moved it to the background project loading phase, where it belongs. This highlighted a problem: we generally use single `cfg`, while it really should be per crate. --- crates/project_model/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'crates/project_model/src/lib.rs') diff --git a/crates/project_model/src/lib.rs b/crates/project_model/src/lib.rs index aabb7a47d..970a7e140 100644 --- a/crates/project_model/src/lib.rs +++ b/crates/project_model/src/lib.rs @@ -5,6 +5,7 @@ mod cfg_flag; mod project_json; mod sysroot; mod workspace; +mod rustc_cfg; use std::{ fs::{read_dir, ReadDir}, -- cgit v1.2.3