100 CPU load and infinite loop · Issue #4500 · rust-lang/rust-analyzer (original) (raw)

A lot of if-then-else compositions cause rust-analyzer to load CPU 100%.
A corner case .rs file attached that leads to rust analyzer crash.
Please add annotation for rust analyzer to avoid analysis of complicated functions (like the one attached). E.g. rust fmt has #[rustfmt::skip], maybe offer something like #[rustanalyzer::skip]

rust_analyzer1

rust_analyzer2

rust_code_example.zip