Rust language reviewer and contributor.
Member of:
rustdoc team (team leader)
docs.rs team
dev-tools team
clippy-contributors team
I am an engineer at Huawei.
## What is a linter?
## How is a rust linter actually working?
## Why does it need to be a rust compiler extension?
## Limitations
* Can only work on crates compiled with the same rustc version
* rustc API is not stable
* Tied to a specified rustc version
* Annoying to wrap in a cargo command
## Lint passes
Early vs Late
## `rustc-tools`
Provides many helpers for setting up lints and cargo integration (and other things...)
```toml
[dependencies]
rustc-tools = "0.3"
```
## Setup
`Cargo.toml`
```toml
rustc-workspace-hack = "1.0.0"
```
`rust-toolchain`
```toml
[toolchain]
channel = "nightly-2023-10-06"
components = ["rustc-dev", "rustfmt", "llvm-tools-preview"]
```