← Back to context

Comment by norman784

12 hours ago

The issue with Rust proc macros is that they are impure, so even with incremental compilation, you need to expand them every time.

That's only part of the issue. First, declarative macros are of course pure. Most procedural macros are pure too, although there are exceptions (an infamous case is sqlx). And while rustc does expand them every time (although a config for declaring "my macro is pure" was considered multiple times and the teams generally view it favorably), rust-analyzer just declares "we don't support impure macros" and caches them anyway.