What powers clippy?

  1. What does clippy use for parsing? rustc? rust-analyzer? it's own code ?

  2. Does clippy get access to type information? Type Checking - Clippy Documentation seems to suggest yes. Is this from (1) clippy's own type checker, (2) something rust-analyzer based, or (3) rustc ?

In general, is there an "architecture doc" of how the heavy lifting (finding crates, parsing, type checking) info clippy gets is done? My question right now is less "how to write a new clippy linter" and more "what is powering clippy?"

rustc is split into a number of crates, of which clippy relies on many. The parsing and type information come from these crates, which can reasonably be thought of as rustc (even if it's actually only part of rustc).

4 Likes