Do not deduplicate diagnostics in UI tests
Error reporting infrastructure deduplicates identical diagnostics with identical spans.
While it's preferable to do this in "release"/"user-facing" mode, it sometimes brings [confusion](https://github.com/rust-lang/rust/pull/50682#issuecomment-390949878) and hides details that may be important during development.
Do we run some passes multiple times when we could do it once?
How many times we run them exactly? Can this number be large? Can the multiplied error construction be expensive? Can speculative checks be made cheaper if they don't report errors?
*Relying* on this mechanism to deduplicate some specific error never looks like a proper solution to me personally.
In this PR I attempt to disable this deduplication by applying `-Z deduplicate-diagnostics=no` to UI tests.
Make Layout::new const
This seems like a reasonable change to make. If we don't provide `Layout:🆕:<T>` as `const`, then users can just instead do the more error prone `Layout::from_size_align_unchecked(mem::size_of::<T>(), mem::align_of::<T>())` for the same effect and an extra `unsafe { }` incantation.
ci: another take at fixing toolstate
Seems like the variable showed by `$(ciCheckoutPath)` on Azure Pipelines was wrong, making the toolstate script fail. This commit changes that function to return the variable previously used by the toolstate script. Other uses of the function were audited, and there should be no conflict.
Failure log: https://dev.azure.com/rust-lang/rust/_build/results?buildId=17933
r? @Mark-Simulacrum
The as_ref method already has a Null-unchecked version section, its
example is a modification of the example in the main as_ref section.
Similarly the example in this commit is a modification of the example
in main as_mut section.
Change -Z time event naming scheme and make them generic activities
I made the `-Z time-passes` only events (which encodes argument in the event id) use a `extra_verbose_generic_activity` function which does not emit self-profiling events.
r? @michaelwoerister
cc @wesleywiser
Seems like the variable showed by $(ciCheckoutPath) on Azure Pipelines
was wrong, making the toolstate script fail. This commit changes that
function to return the variable previously used by the toolstate script.
Other uses of the function were audited, and there should be no
conflict.
Small improvements in lexical_region_resolve
This just replaces a trivial `if` condition with a `|=` in two places.
I could even have used a `fold` in the first case, but I think it would be less readable.
Use matches macro in libcore and libstd
This PR replaces matches like
```rust
match var {
value => true,
_ => false,
}
```
with use of `matches!` macro.
r? @Centril
Treat extern statics just like statics in the "const pointer to static" representation
fixes#67612
r? @spastorino
cc @RalfJung this does not affect runtime promotion at all. This is just about promotion within static item bodies.