stop using fully_perform_locally with the next solver, it's worse (perf fix for unic-ucd)
r? @adwinwhite
> [!NOTE]
> I've not used an LLM for any part of this PR, or any other PR I make. This includes any related work like research.
rustdoc: Fix link title attribute value when field of enum variants
Fixes https://github.com/rust-lang/rust/issues/161028.
The issue was that we link to parent page, we generate a "fragment" to the parent item (so here the enum), because we forgot to take into account that there might be two levels: enum variants can have fields. So in case it's an enum and the `DefId` is a field, we add the field's parent name (so the enum variant) to the title.
r? @Urgau
Enable unrolling feature of bors
This was implemented in https://github.com/rust-lang/bors/pull/817.
After merge, we should see each rollup being unrolled twice, because the functionality will be performed both by bors and rustc-perf (on separate branches, so they shouldn't collide). After we check that everything works fine with the unrolled bors builds, I will remove the functionality from rustc-perf by merging https://github.com/rust-lang/rustc-perf/pull/2524.
io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`
Use `NonNull` a few more places to avoid the need to convert to and from `*mut T`. Also document the invariants for `Custom`.
Fix invalid suggestion from try unlabled block
Fixesrust-lang/rust#160987
I wondering whether `unsafe` and `const` with block have similar issue,
and found we don't give out code suggestion for these scenarios, maybe could be improved in another PR.
give layout errors from `size_of_val` and `align_of_val` a span
`size_and_align_of_dst` used the spanless `layout_of` so a `SizeOverflow` from `size_of_val` or `align_of_val` came out as
```
error: values of the type `[u8; 9223372036854775807]` are too big for the target architecture
```
and now points at the call:
```
error: values of the type `[u8; 9223372036854775807]` are too big for the target architecture
--> src/lib.rs:5:53
|
5 | pub fn check(x: *const Example) -> usize { unsafe { std::intrinsics::size_of_val(x) } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
with `-Cdebuginfo=2` the error is hit earlier while describing the signature of the function so `get_function_signature` and `build_pointer_or_reference_di_node` forward the span `dbg_scope_fn` already computes same as https://github.com/rust-lang/rust/pull/145967 and https://github.com/rust-lang/rust/pull/146025 did for arrays and enums. the two revisions of the new test cover both.
this doesnt close https://github.com/rust-lang/rust/issues/25116. the vtable case in `tests/ui/limits/vtable.stderr` is emitted from a query keyed only on the type and the other builders in `debuginfo/metadata.rs` still drop spans.
cc @estebank who pointed at these two gaps on the issue.
r? @oli-obk
check `mut`-restriction when tuple constructor is used as a value
this fixes a bug where tuple struct constructors could bypass `mut` field restrictions when used as function values instead of being called directly. right now `CheckMutRestriction` only checks struct expressions like `Wrapper(5)`. but referencing `inner::Wrapper` as a value was allowed, which let outsiders construct structs with restricted fields.
Fixesrust-lang/rust#160891
Add `core::num::Complex`
tracking issue: https://github.com/rust-lang/rust/issues/154023
See also [#t-compiler > representing `_Complex`](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/representing.20.60_Complex.60/with/608308993). The RFC states that the `Complex` type should match the ABI of `_Complex` in C, but provides little detail on how to actually achieve this. We concluded that `repr(complex)` is probably the best approach. Like clang, that means we "desugar" the representation early: `_Complex` is not natively represented in LLVM IR.
I've derived the ABI from `clang` for 28 targets, a decent sample of what we actually support. For now I'm only actually testing `x86_64` because (as you'll see) updating the tests is quite labor-intensive. If we're happy with this direction I can fill more of them in, likely in a separate PR.
The libs side of the type is very bare-bones: I'm not as interested in that part. Others can fill in the various instances, methods, write tests for those, and improve the docs.
r? workingjubilee
Optimize CStr backing slice bounds checks
Hint that Cstr is non empty bcs it always contains the null byte. Byte-zero access reduces from 27 to 4 bytes
std: don't clean up the main thread's altstack
Fixesrust-lang/rust#161018https://github.com/rust-lang/rust/pull/28069 added a call to what is now `rt::cleanup` to `process::exit`. `rt::cleanup` in turn calls the UNIX `stack_overflow::cleanup`, which frees the main thread's signal stack and uninstalls the current thread's signal handler in the assumption that the current thread is the main one – even though `process::exit` can be called from any thread.
This PR removes the main thread cleanup logic altogether, since, as the FIXME in `stack_overflow::cleanup` points out, it causes more issues than it is worth. This also means that stack overflows in TLS destructors will be caught on the main thread, partly addressing rust-lang/rust#111272.
std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows
Windows error mapping doesn't have an arm for `ERROR_NEGATIVE_SEEK`, the code returned when using negative seek position, so it decodes to `ErrorKind::Uncategorized`.
On unix negative seek is `EINVAL`:
[> EINVAL whence is not valid. Or: the resulting file offset would be negative, or beyond the end of a seekable device.](https://www.man7.org/linux/man-pages/man2/lseek.2.html)
And is mapped to [InvalidInput](e64c8a664d/library/std/src/sys/io/error/unix.rs (L154)) error.
On Windows there is `ERROR_NEGATIVE_SEEK` [windows_sys.rs#L1829](e64c8a664d/library/std/src/sys/pal/windows/c/windows_sys.rs (L1829)).
The message on Windows would still be more specific and detailed for this error. Both messages come from the OS itself, so not sure if it could be addressed somehow. Looks like Unix has more coarse error codes than Windows, which uses more granular ones with more precise messages: `EINVAL` is shared across many syscalls, so its message is more general.
Windows:
`kind: InvalidInput, message: "An attempt was made to move the file pointer before the beginning of the file."`
Unix:
`kind: InvalidInput, message: "Invalid argument" `
Fixesrust-lang/rust#158246
r? libs
Couple of misc improvements to the unwind infrastructure
* Fix `_Unwind_Exception` size on Emscripten.
* Move a link block.
* Remove some manual dummy impls where there is already a dummy fallback.
Follow up to https://github.com/rust-lang/rust/pull/159785
Don't compute FnAbi for LLVM intrinsics
They don't have a sensible FnAbi, so the fact that we still compute an FnAbi for them requires us to make the ABI sanity check more lenient than it should be.
r? @RalfJung as all non-trivial changes are in Miri
x86_64-win: Enable f128 on LLVM 23+
LLVM23 includes the ABI fix to make f128 work [1]. That version isn't
yet stable, but at least the type will start getting picked up in
top-of-tree CI.
While addressing this, also update the comment regarding f16.
[1]: aa47e59245
* check mut restriction when tuple ctor is used as a value
* add missing stderr file for mut-restriction ctor value test
* simplify def_kind matching in tuple ctor mut restriction check
Match the DefKind::Ctor directly on the result of tcx.def_kind instead of binding it to a local first. Extend the ctor-value ui test with additional enum variants covering plain and crate-restricted fields.
* test: exercise new ctor variants
* address review: drop shell.nix, add tests