1
Fork 0

Auto merge of #113734 - cjgillot:no-crate-lint, r=petrochenkov

Convert builtin "global" late lints to run per module

The compiler currently has 4 non-incremental lints:
1. `clashing_extern_declarations`;
2. `missing_debug_implementations`;
3. ~`unnameable_test_items`;~ changed by https://github.com/rust-lang/rust/pull/114414
4. `missing_docs`.

Non-incremental lints get reexecuted for each compilation, which is slow. Moreover, those lints are allow-by-default, so run for nothing most of the time. This PR attempts to make them more incremental-friendly.

`clashing_extern_declarations` is moved to a standalone query.

`missing_debug_implementation` can use `non_blanket_impls_for_ty` instead of recomputing it.

`missing_docs` is harder as it needs to track if there is a `doc(hidden)` module surrounding. I hack around this using the lint level engine. That's easy to implement and allows to re-enable the lint for a re-exported module, while a more proper solution would reuse the same device as `unnameable_test_items`.
This commit is contained in:
bors 2023-08-05 07:20:16 +00:00
commit 67626b8e89
16 changed files with 807 additions and 825 deletions

View file

@ -1596,6 +1596,11 @@ rustc_queries! {
separate_provide_extern
}
/// Lint against `extern fn` declarations having incompatible types.
query clashing_extern_declarations(_: ()) {
desc { "checking `extern fn` declarations are compatible" }
}
/// Identifies the entry-point (e.g., the `main` function) for a given
/// crate, returning `None` if there is no entry point (such as for library crates).
query entry_fn(_: ()) -> Option<(DefId, EntryFnType)> {