[COMPILETEST-UNTANGLE 4/N] Improve compiletest config documentation
This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable.
This PR should contain **no functional changes**.
This is pulled out to its own PR to make follow-up changes easier to review.
There are *intentionally* a *lot* of FIXME comments, intended to be gradually addressed in follow-ups.
r? `@Kobzol`
move `va_copy`, `va_arg` and `va_end` to `core::intrinsics`
some questions:
- should these functions be `pub`?
- is a separate module justified?
r? `@RalfJung`
codegen_ssa: replace a Result by an Either
`Err` here clearly does not indicate an "error" of any sort, so the use of `Result` is confusing. Let's use a sum type that does not come with the baggage of `Result`.
Pretend in bootstrap snapshot tests that we always build in-tree LLVM
Otherwise, depending on whether CI LLVM is inhibited or if an externally-provided LLVM is used, bootstrap host LLVM build step could be missing in step snapshots.
Note that I'm not sure if this is the *right* solution (this might be *a* solution). I imagine we do want to control for the set of configuration that these snapshot tests are run, as much as possible.
r? `@Kobzol`
This PR does 2 things:
- It removes the braces when there's a single element. This is required since brace expansion (at
least in bash and zsh) only triggers if there's at least 2 elements.
- It removes the extra `.rlib` suffixes of the elements. See
https://github.com/rust-lang/rust/pull/135707#discussion_r2185212393 for context.
Running `cargo +stage1 build` on the following program:
```rust
unsafe extern "C" {
fn foo() -> libc::c_int;
}
fn main() {
let x = unsafe { foo() } as u32;
// println!("{}", data_encoding::BASE64.encode(&x.to_le_bytes()));
}
```
Gives the following diff before and after the PR:
```diff
-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib}.rlib
+/tmp/foo/target/debug/deps/liblibc-faf416f178830595.rlib
```
Running on the same program with the additional dependency, we get the following diff:
```diff
-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib,libdata_encoding-84bb5aadfa9e8839.rlib}.rlib
+/tmp/foo/target/debug/deps/{liblibc-faf416f178830595,libdata_encoding-84bb5aadfa9e8839}.rlib
```
Do we want to add a UI test?
`conv-bits-runtime-const` gates `f16` and `f128` tests behind `x86_64`,
but this isn't always accurate. In particular, x86 `MinGW` has an ABI
bug [1] which means things work when linked to our Rust math libraries
but don't work with host libraries. RUST-143405 slightly adjusts which
targets we provide `f16` and `f128` symbols for and effectively removes
MinGW from that list, meaning host libraries start getting linked,
meaning `f16` and `f128` tests start to fail.
Account for this by changing the gates in one such test to
`cfg(target_has_reliable_{f16,f128})` which is the way we should be
gating all behavior related to the types going forward.
`rustfmt` also seems to have formatted the macros which is fine.
[1]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054
Remove `Symbol` from `Named` variant of `BoundRegionKind`/`LateParamRegionKind`
The `Symbol` is redundant, since we already store a `DefId` in the region variant. Instead, load the name via `item_name` when needed (which is almost always on the diagnostic path).
This introduces a `BoundRegionKind::NamedAnon` which is used for giving anonymous bound regions names, but which should only be used during pretty printing and error reporting.
Fix CLI completion check in `tidy`
The list of CLI completion files that were generated and that were checked by `x test tidy` was not synced. Recently, some PR only updated some of the files, which caused the rest of the files (not checked by `x test tidy`) to be dirty on `master`. This PR fixes the logic in bootstrap to always synchronize the list of completion paths.
Fixes: https://github.com/rust-lang/rust/issues/143451
r? `@jieyouxu`
test passing a `VaList` from rust to C
Have C define various functions that take a `...` or `va_list` as an argument, and call them from rust. As far as I can see, this just wasn't actually tested before.
In particular this tests a difference between rust `VaList` and C `va_list` where C uses array-to-pointer decay, but rust cannot.
I've locally tested this for
- `x86_64-unknown-linux-gnu`
- `aarch64-unknown-linux-gnu`
- `s390x-unknown-linux-gnu`
- `powerpc64-unknown-linux-gnu`
- `powerpc64le-unknown-linux-gnu`
The latter 2 use an opaque pointer, the first 3 use a single-element array.
cc `@beetrees` if you see anything incorrect here
r? `@workingjubilee`
`tests/ui`: A New Order [25/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@tgross35`
`tests/ui`: A New Order [24/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@tgross35`