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.
These shims are only needed on 32-bit x86. Additionally since https://reviews.llvm.org/rL268875 LLVM handles adding the shims itself for the intrinsics.
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
Remove insignificant notes from CStr documentation
The to_str and to_string_lossy methods contain a note about the behavior possibly changing in the future. But those notes are referring to a distinction that is not observable in the API. Whether or not the UTF-8 check knows the string length ahead of time, these methods require linear time.
`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]`
The annotated functions now produce panic messages pointing to the location where they were called, rather than `core`'s internals.
Distinguish between private items and hidden items in rustdoc
I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document.
This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another.
Fixes#67851. Closes#60884.