rust/src
bors 789ee5e433 Auto merge of #108576 - megakorre:rustdock_additional_typecheck_before_clean, r=GuillaumeGomez
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.
2023-03-30 15:21:22 +00:00
..
bootstrap Drop binutils on powerpc-unknown-freebsd 2023-03-30 07:05:24 +00:00
ci Auto merge of #107221 - kleisauke:getentropy-emscripten, r=ChrisDenton 2023-03-30 00:25:41 +00:00
doc Fix title for openharmony.md 2023-03-30 12:06:07 +01:00
etc Rename src/etc/vscode_settings.json to rust_analyzer_settings.json 2023-03-01 22:58:05 +05:30
librustdoc rustdoc: run more HIR validation to mirror rustc 2023-03-30 14:55:03 +02:00
llvm-project@2b9c52f668 Upgrade to LLVM 16 2023-03-22 09:30:37 +01:00
rustdoc-json-types fix inconsistent json outputs from rustdoc 2023-03-05 00:09:09 +03:00
tools Auto merge of #109769 - JohnTitor:rollup-7n2bnpg, r=JohnTitor 2023-03-30 12:44:25 +00:00
README.md Remove stale reference to the test suite location 2023-01-13 11:49:06 +00:00
stage0.json Bump to latest beta 2023-03-15 08:55:22 -04:00
version Bump version to 1.70.0 2023-03-04 10:10:46 -05:00

This directory contains some source code for the Rust project, including:

  • The bootstrapping build system
  • Various submodules for tools, like cargo, tidy, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.