Use self profile infrastructure for -Z time and -Z time-passes
There's no longer indentation for -Z time and -Z time-passes and duplicate timers between self profiling and -Z time-passes have been removed.
r? @wesleywiser
perf: Don't recurse into types that do not need normalizing
A bit speculative at this stage but profiling shows that type folding
takes up a substantial amount of time during normalization which may
indicate that many types may be folded despite there being nothing to
normalize
Extract `rustc_hir` out of `rustc`
The new crate contains:
```rust
pub mod def;
pub mod def_id;
mod hir;
pub mod hir_id;
pub mod itemlikevisit;
pub mod pat_util;
pub mod print;
mod stable_hash_impls;
pub use hir::*;
pub use hir_id::*;
pub use stable_hash_impls::HashStableContext;
```
Remains to be done in follow-up PRs:
- Move `rustc::hir::map` into `rustc_hir_map` -- this has to be a separate crate due to the `dep_graph` (blocked on https://github.com/rust-lang/rust/pull/67761).
- Move references to `rustc::hir` to `rustc_hir` where possible.
cc https://github.com/rust-lang/rust/issues/65031
r? @Zoxc
Introduce an option for disabling deduplication of diagnostics
With the intent of using it in UI tests (https://github.com/rust-lang/rust/pull/67122).
The option is boolean (`-Z deduplicate-diagnostics=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z deduplicate-diagnostics=no -Z deduplicate-diagnostics=yes` == `-Z deduplicate-diagnostics=yes`), so it can be set in a hierarchical way, e.g. UI testing infra may disable the deduplication by default with specific tests being able to enable it back.
* Removes unnecessary feature flag from track_caller test.
* Tests of panic internals no longer need to explicitly construct Location.
* Add #![warn(const_err)] to retain-never-const per @oli-obk.
* Add track_caller test with diverging function.
Remove unused `#[link_name = "m"]` attributes
These were perhaps supposed to be `#[link(name = "m")]` but linking libm should be handled by the libc crate anyway.
They should have triggered a compile error: #47725
tweak wording of mismatched delimiter errors
This PR improves the wording of the "incorrect delimiter" error messages. Here's a quick rationale:
- *"un-closed" -> "unclosed"*: "unclosed" is valid English, so there's no need to hyphenate the prefix. This should be pretty uncontroversial, I think.
- *"close delimiter" -> "closing delimiter"*: In my anecdotal experience, I've always heard "closing delimiter" or "closing parenthesis". In addition, the codebase already uses this terminology in comments and function names more than "close delimiter", which could indicate that it's more intuitive.
- "incorrect delimiter" -> "mismatched delimiter": "Incorrect delimiter" is vague; why is it incorrect? "mismatched" clearly indicates why the delimiter is causing the error.
r? @estebank
Implement uncommon_codepoints lint.
Part of #55467 . The checks of `$crate` and `{{root}}` are very unfortunate. But i'm not sure where they belongs to.
Nix reexports from `rustc_span` in `syntax`
Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly.
r? @petrochenkov
Add a test for #37333
The test checks that we reuse the CGU of a crate when the implementation
details of an `extern crate` have changed.
Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>