Format libcore with rustfmt
I am interested in whether we can begin cautious incremental progress on #66688 and assess along the way whether we can keep the disruption sufficiently small.
This PR applies rustfmt with default settings to files in src/libcore *that are not involved in any currently open PR* to minimize merge conflicts. The list of files involved in open PRs was determined by querying GitHub's GraphQL API [with this script](https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8).
With the list of files from the script in `outstanding_files`, the relevant commands were:
```console
$ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
$ rg libcore outstanding_files | xargs git checkout --
```
Repeating this process several months apart should get us coverage of most of the rest of libcore.
When a const function is being evaluated, as long as all its
arguments are zero-sized-types (or it has no arguments) then we
can trivially memoize the evaluation result using the existing
query mechanism.
This commit applies rustfmt with default settings to files in
src/libcore *that are not involved in any currently open PR* to minimize
merge conflicts. The list of files involved in open PRs was determined
by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8
With the list of files from the script in `outstanding_files`, the
relevant commands were:
$ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
$ rg libcore outstanding_files | xargs git checkout --
Repeating this process several months apart should get us coverage of
most of the rest of libcore.
Rollup of 14 pull requests
Successful merges:
- #66128 (alloc: Add new_zeroed() versions like new_uninit().)
- #66661 (Add riscv64gc-unknown-linux-gnu target)
- #66663 (Miri: print leak report even without tracing)
- #66711 (Add hardware floating point features to aarch64-pc-windows-msvc)
- #66713 (introduce a target to build the kernel of the unikernel HermitCore)
- #66717 (tidy: Accommodate rustfmt's preferred layout of stability attributes)
- #66719 (Store pointer width as u32 on Config)
- #66720 (Move ErrorReported to rustc_errors)
- #66737 (Error codes cleanup)
- #66754 (Various tweaks to diagnostic output)
- #66763 (Minor edit for documentation-tests.md that increases clarity)
- #66779 (follow the same function order in the trait)
- #66786 (Add wildcard test for const_if_match)
- #66788 (Allow `Unreachable` terminators through `min_const_fn` checks)
Failed merges:
r? @ghost
Allow `Unreachable` terminators through `min_const_fn` checks
Resolves#66756.
This allows `Unreachable` terminators through the `min_const_fn` checks if `#![feature(const_if_match)]` is enabled. We could probably just allow them with no feature flag, but it seems okay to be conservative here.
r? @oli-obk
follow the same function order in the trait
With this change, the function order in both traits and implementation matches.
And this fix removes several warnings in IDE.
Move ErrorReported to rustc_errors
The new location is more consistent with what this type is for, though we don't remove it from the old location (via a re-export) to avoid changing the dozens of use sites (~139 at this time).
Store pointer width as u32 on Config
This removes the dependency on IntTy, UintTy from Session.
It's not obviously a win, but it seems a bit odd to store the AST IntTy/UintTy in Session, rather we store the pointer width as an integer and add normalization methods to IntTy and UintTy.
tidy: Accommodate rustfmt's preferred layout of stability attributes
Previously tidy would require that the `feature = "name_of_feature"` part of the stability attribute was on the same line as the `#[stable(` / `#[unstable(` opening part of the attribute, and that `)]` was on the same line as the last key-value pair.
That didn't work with rustfmt's preferred layout of long attributes, which is like:
```rust
#[unstable(
feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "44930"
)]
```
introduce a target to build the kernel of the unikernel HermitCore
We are developing the unikernel HermitCore, where the kernel is written in Rust and is already supported by the Rust Standard Library. To compile the kernel with the new build flag "-Z build-std", we introduce a new target, which avoids the usage of SSE & AVX within the kernel.
Miri: print leak report even without tracing
Currently, the rustup-installed Miri has no way to actually print a leak report (as `trace!` is compiled out). Make it print that per default instead when there is a leak.
r? @oli-obk
Add riscv64gc-unknown-linux-gnu target
This PR add the target, but doesn't build std on CI yet.
I have a port for `libc` crate and std which I will upstream soon after this target is added.
r? @alexcrichton
alloc: Add new_zeroed() versions like new_uninit().
MaybeUninit has both uninit() and zeroed(), it seems reasonable to have the same
surface on Box/Rc/Arc.
Needs tests.
cc #63291
The construction of the GlobalCtxt is moved from a generator's stack to
the Queries struct. Since the GlobalCtxt requires the HIR Forest and the
arenas to live longer, those are moved into Queries the same way.
The resulting handling of objects is more brittle, because consumers of
the Once objects need to be careful of their initialisation.
Previously, only Self, &Self, &mut Self, Arc<Self>, Rc<Self>,
and Box<Self> were available as stable method receivers.
This commit stabilizes nested uses of all the above types.
However, nested receivers remain non-object-safe.