Export public scalar statics in wasm
Fixes#67453
I am not sure which export level statics should get when exporting them in wasm. This small change fixes the issue that I had, but this might not be the correct way to implement this.
Simplify into_key_slice_mut
Remove a rare and tiny but superfluous run-time check from into_key_slice_mut.
In #67459, I wrote that "`get_mut` [...] does visit `into_key_slice_mut`" and that was wrong. No function that operates on a map that (still) has a shared root ever dives into `into_key_slice_mut`. So it's more clear to remove the (previously existing, and always incomplete) code it has for dealing with shared roots, as well as a petty performance improvement for those using exotically aligned key types.
~~Also, some testing of the `range` function initially added to #67686 but hardly related.~~
r? @RalfJung
Add HashSet::get_or_insert_owned
This is an extension for tracking issue #60896. The more-general `get_or_insert_with` has potential for misuse, so we might remove it, but I think `get_or_insert_owned` covers most use cases.
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.
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
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.
Rollup of 10 pull requests
Successful merges:
- #67774 (Try statx for all linux-gnu target.)
- #67781 (Move `is_min_const_fn` query to librustc_mir.)
- #67798 (Remove wrong advice about spin locks from `spin_loop_hint` docs)
- #67849 (Add a check for swapped words when we can't find an identifier)
- #67875 (Distinguish between private items and hidden items in rustdoc)
- #67887 (`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]`)
- #67955 (rustdoc: Remove more `#[doc(cfg(..))]` duplicates)
- #67977 (Updates for VxWorks)
- #67985 (Remove insignificant notes from CStr documentation)
- #68003 (ci: fix wrong shared.sh import for publish_toolstate)
Failed merges:
- #67820 (Parse the syntax described in RFC 2632)
- #67979 (Move `intravisit` => `rustc_hir` + misc cleanup)
r? @ghost