mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
789ee5e433
rustdoc: run more HIR validation to mirror rustc # Explanation While investigating these issues: https://github.com/rust-lang/rust/issues/107093, https://github.com/rust-lang/rust/issues/106079 I thought it maybe would be useful to test running `rustdoc` on all rust files under `tests/ui` grepping for files that causes any ICEs. And these are the files I found would cause ICEs. ``` // These are handled by this fix. tests/ui/late-bound-lifetimes/mismatched_arg_count.rs tests/ui/associated-consts/issue-102335-const.rs tests/ui/const-generics/generic_const_exprs/issue-102768.rs tests/ui/const-generics/const-arg-type-arg-misordered.rs tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs tests/ui/typeck/issue-88643.rs tests/ui/typeck/issue-75889.rs tests/ui/typeck/issue-83621-placeholder-static-in-extern.rs // These are not they will still produce a ICE after this change tests/ui/limits/issue-56762.rs tests/ui/union/projection-as-union-type-error-2.rs tests/ui/union/projection-as-union-type-error.rs ``` I reduces the issues handled by this PR down to the tests added in the PR. That includes the linked issues. But the 3 files that are not handled I will leave for a future PR. This PR adds the `type_collecting` step from `hir_analysis::check_crate` to the rustdoc typechecks. It had the following comment on it. ``` // this ensures that later parts of type checking can assume that items // have valid types and not error ``` Adding the check report the same errors as rustc does for these input. And not ICE when the lint checker walks the HIR or when in the `rustdoc::clean` pass. This PR updates the expected errors of some existing rustdoc-ui tests (some now report less errors). These new reported errors does mirror the errors reported by rustc. # Performance It does more checking so it will probably regress. We should run ``@bors` try `@rust-timer` queue` and see. # Discussion Maybe instead of calling a subset of the checks in `hir_analysis::check_crate` and having comments that say they should be kept in sync. We could instead call `check_crate` directly and pass in some flag. Maybe `check_toplevel_signatures_only` or something like that. That flag would have to skip most of the checks in that function tough. |
||
---|---|---|
.. | ||
assembly | ||
auxiliary | ||
codegen | ||
codegen-units | ||
debuginfo | ||
incremental | ||
mir-opt | ||
pretty | ||
run-make | ||
run-make-fulldeps | ||
run-pass-valgrind | ||
rustdoc | ||
rustdoc-gui | ||
rustdoc-js | ||
rustdoc-js-std | ||
rustdoc-json | ||
rustdoc-ui | ||
ui | ||
ui-fulldeps | ||
COMPILER_TESTS.md |