To reproduce:
Use neovim/coc.nvim to open this file under repo root. VSCodium also reproduces.
Wait a few seconds after fully indexed, then you'll find:
- Significant lag for all request, including completion, file saving, hovering and etc.
- Spamming log (>5MiB/s) of
[ERROR hir_ty::mir::borrowck] Terminator should be none only in construction.
- >100% CPU stress on both
rust-analyzer and node (coc.nvim). Likely to be caused by the log spamming.
After a quick glance, there seems to be only one root error being emitted again and again. That error entry itself is ~6500 lines, see this gist. Seems #15058 magnifies the original issue.
cc @HKalbasi
rust-analyzer version: 2023-07-03
rustc version: 1.70.0
relevant settings: Set CARGO_TARGET_DIR to a fresh empty directory, aka. already cargo cleaned.