about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-30 07:50:27 +0000
committerbors <bors@rust-lang.org>2023-03-30 07:50:27 +0000
commitb915eb32fafd465ed02b27f1ba03c2d9b35dc87d (patch)
treefc4d55ba8496bb408fb5586b6f674b4ffb28c10b /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
parentef7756cb9edbba752cc2602834f70e0cec5937dc (diff)
parent25c59b8e92da205d14a94c0c86c2c729b3e66f1c (diff)
downloadrust-b915eb32fafd465ed02b27f1ba03c2d9b35dc87d.tar.gz
rust-b915eb32fafd465ed02b27f1ba03c2d9b35dc87d.zip
Auto merge of #14427 - davidbarsky:davidbarsky/allow-subsequent-workspaces-to-have-proc-macros, r=Veykril
fix: allow new, subsequent `rust-project.json`-based workspaces to get proc macro expansion

As detailed in https://github.com/rust-lang/rust-analyzer/issues/14417#issuecomment-1485336174, `rust-project.json` workspaces added after the initial `rust-project.json`-based workspace was already indexed by rust-analyzer would not receive procedural macro expansion despite `config.expand_proc_macros` returning true. To fix this issue:
1. I changed `reload.rs` to check which workspaces are newly added.
2. Spawned new procedural macro expansion servers based on the _new_ workspaces.
    1. This is to prevent spawning duplicate procedural macro expansion servers for already existing workspaces. While the overall memory usage of duplicate procedural macro servers is minimal, this is more about the _principle_ of not leaking processes 😅.
3. Launched procedural macro expansion if any workspaces are `rust-project.json`-based _or_ `same_workspaces` is true. `same_workspaces` being true (and reachable) indicates that that build scripts have finished building (in Cargo-based projects), while the build scripts in `rust-project.json`-based projects have _already been built_ by the build system that produced the `rust-project.json`.

I couldn't really think of structuring this code in a better way without engaging with https://github.com/rust-lang/rust-analyzer/issues/7444.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions