Files
rust/compiler
Trevor Gross 0c2fbe53a6 Rollup merge of #140894 - Urgau:check-cfg-rustdoc, r=GuillaumeGomez
Make check-cfg diagnostics work in `#[doc(cfg(..))]`

This PR makes it so that the check-cfg `unexpected_cfgs` lint, is correctly emitted in `rustdoc`'s `#[doc(cfg(..))]`.

This is achieved by adding a custom trait to `cfg_matches` (the method that emits the lint) which permits `rustc` and `rustdoc` to each have their way to emitting lints (via buffered lints/AST for `rustc` and via `TyCtxt`/HIR for `rustdoc`).

The reason this is required is because buffered lints operates on the AST but `rustdoc` uses the HIR and by the time `rustdoc` calls `cfg_matches` we are way passed the point where buffered lints have been drain and emitted.

Best reviewed commit by commit.

r? `@jieyouxu` (for the compiler part)
r? `@GuillaumeGomez` (for the rustdoc part)
2025-05-27 20:28:30 -04:00
..
2025-05-12 15:33:37 +02:00
2025-05-27 11:14:47 +00:00
2025-05-27 11:14:45 +00:00
2025-05-27 14:11:14 +03:00
2025-05-27 14:11:14 +03:00
2025-05-22 11:55:22 +10:00
2025-05-12 15:33:37 +02:00
2025-04-15 10:44:28 -04:00
2025-05-27 11:14:47 +00:00
2025-05-27 11:14:45 +00:00
2025-05-12 15:33:37 +02:00
2025-05-24 20:31:37 +02:00
2025-05-27 11:14:45 +00:00
2025-05-27 11:14:45 +00:00
2025-05-24 15:06:53 +08:00
2025-05-27 11:14:47 +00:00