diff options
author | Aleksey Kladov <[email protected]> | 2021-01-18 11:52:12 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-18 11:52:12 +0000 |
commit | add87f54240a20e72136a403c166113af5173572 (patch) | |
tree | 14ed8b5ca07a40dea9b0599506d78b3d6f4c4a6c /crates/project_model/src/lib.rs | |
parent | cc963d2b1190578ad9f1d1f4589e8ea2c98c1a14 (diff) |
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.
Diffstat (limited to 'crates/project_model/src/lib.rs')
-rw-r--r-- | crates/project_model/src/lib.rs | 1 |
1 files changed, 1 insertions, 0 deletions
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; | |||
5 | mod project_json; | 5 | mod project_json; |
6 | mod sysroot; | 6 | mod sysroot; |
7 | mod workspace; | 7 | mod workspace; |
8 | mod rustc_cfg; | ||
8 | 9 | ||
9 | use std::{ | 10 | use std::{ |
10 | fs::{read_dir, ReadDir}, | 11 | fs::{read_dir, ReadDir}, |