Commit Graph

336523 Commits

Author SHA1 Message Date
Yara
a123594de1 reflection: resolve false positive in unrelated ui-test 2026-08-15 01:03:06 +02:00
Yara
37e1969c97 reflection: remove fields from TypeKind 2026-08-15 01:03:06 +02:00
Yara
f5fc985e7b reflection: update FieldRepresentingType debug to use methods on TypeId 2026-08-15 01:03:06 +02:00
Yara
74890b1ed2 reflection: update tests to use methods on TypeId 2026-08-15 01:03:06 +02:00
Yara
2b7d180842 reflection: add non-exhaustive to meme::type_info::Variant 2026-08-15 01:03:06 +02:00
Yara
b685be1643 reflection: Add TypeId::variant() returning new Variant 2026-08-15 01:02:32 +02:00
bors
a9066b3a6e Auto merge of #160982 - jdonszelmann:fix-unic-ucd, r=adwinwhite,lcnr
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.
2026-08-14 10:55:13 +00:00
bors
059bf4a660 Auto merge of #161075 - jhpratt:rollup-sSE7Oua, r=jhpratt
Rollup of 23 pull requests

Successful merges:

 - rust-lang/rust#157428 (allocator: refactor for stabilisation)
 - rust-lang/rust#158918 (x86_64-win: Enable f128 on LLVM 23+)
 - rust-lang/rust#160077 (Don't compute FnAbi for LLVM intrinsics)
 - rust-lang/rust#160288 (rustdoc: use anonymous constant for primitives/keywords/attribute docs)
 - rust-lang/rust#160440 (Couple of misc improvements to the unwind infrastructure)
 - rust-lang/rust#160896 (tidy: Update Python version requirements to 3.11)
 - rust-lang/rust#160972 (std: map ERROR_NEGATIVE_SEEK to ErrorKind::InvalidInput on Windows)
 - rust-lang/rust#160984 (Fix ICE on { _ } const args in bodies by tracking const-only infer args)
 - rust-lang/rust#161036 (Use `with_types_for_suggestion!` in `write_struct_like()`)
 - rust-lang/rust#161037 (std: don't clean up the main thread's altstack)
 - rust-lang/rust#161040 (Optimize CStr backing slice bounds checks)
 - rust-lang/rust#161065 (core: Fix a typo in funnel shift documentation)
 - rust-lang/rust#158885 (Add `core::num::Complex`)
 - rust-lang/rust#160928 (check `mut`-restriction when tuple constructor is used as a value)
 - rust-lang/rust#160969 (give layout errors from `size_of_val` and `align_of_val` a span)
 - rust-lang/rust#161002 (disallow `#[cold]` on `extern "custom"` functions)
 - rust-lang/rust#161016 (Fix invalid suggestion from try unlabled block)
 - rust-lang/rust#161020 (io: Use `NonNull` for all `Custom` API related to `Box`, update documentation for `Custom`)
 - rust-lang/rust#161044 (rustc-dev-guide subtree update)
 - rust-lang/rust#161046 (Enable unrolling feature of bors)
 - rust-lang/rust#161054 (rustdoc: Fix link title attribute value when field of enum variants)
 - rust-lang/rust#161055 (`offload!` function-like macro)
 - rust-lang/rust#161064 (Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable")
2026-08-14 07:48:47 +00:00
Jacob Pratt
ad85a0a9e2 Rollup merge of #161064 - beetrees:revert-156188-riscv-target-feature-cfg-stable-toggle-unstable, r=workingjubilee
Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable"

Reverts rust-lang/rust#156188 per https://github.com/rust-lang/rust/issues/150257#issuecomment-5268676292.

This is my first time doing this kind of revert, let me know if I've done anything wrong.

r? lang

@rustbot label: +beta-nominated
2026-08-13 18:16:30 -04:00
Jacob Pratt
89fe0597a8 Rollup merge of #161055 - Sa4dUs:offload-macro, r=ZuseZ4
`offload!` function-like macro

r? @ZuseZ4
2026-08-13 18:16:30 -04:00
Jacob Pratt
6a25fdd901 Rollup merge of #161054 - GuillaumeGomez:enum-variant-field-title, r=Urgau
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
2026-08-13 18:16:29 -04:00
Jacob Pratt
f7b6dc1882 Rollup merge of #161046 - Kobzol:bors-unroll, r=Kobzol
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.
2026-08-13 18:16:28 -04:00
Jacob Pratt
ca778de2d1 Rollup merge of #161044 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 1c2c8f8911.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-08-13 18:16:27 -04:00
Jacob Pratt
d44b33e46d Rollup merge of #161020 - tgross35:io-error-updates, r=clarfonthey
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`.
2026-08-13 18:16:26 -04:00
Jacob Pratt
ebde61522c Rollup merge of #161016 - chenyukang:yukang-fix-160987-try-block-label-suggestion, r=folkertdev
Fix invalid suggestion from try unlabled block

Fixes rust-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.
2026-08-13 18:16:25 -04:00
Jacob Pratt
ca05145f35 Rollup merge of #161002 - folkertdev:custom-error-on-cold, r=tgross35
disallow `#[cold]` on `extern "custom"` functions

tracking issue: https://github.com/rust-lang/rust/issues/140829

We decided in the T-lang meeting ([notes](https://hackmd.io/nPO0wh-4QhSwVU-1f_QfJg#Stabilize-extern-custom-rust158504)) to:

- reject `#[cold]`
- reject aliases for unit, only no return type or `-> ()` is accepted

I also move the check for `naked` into `ast_validation`

r? @tgross35
2026-08-13 18:16:24 -04:00
Jacob Pratt
6bd52be2ec Rollup merge of #160969 - Albab-Hasan:span-for-size-of-val-layout-errors, r=oli-obk
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
2026-08-13 18:16:24 -04:00
Jacob Pratt
c28d4c6eaa Rollup merge of #160928 - im-lunex:fix_#160891, r=Urgau
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.

Fixes rust-lang/rust#160891
2026-08-13 18:16:14 -04:00
Jacob Pratt
9e0b9bc6cd Rollup merge of #158885 - folkertdev:complex-layout, r=workingjubilee
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
2026-08-13 18:16:12 -04:00
Jacob Pratt
d34673e3f8 Rollup merge of #161065 - tgross35:funnel-shift-docs, r=clarfonthey
core: Fix a typo in funnel shift documentation
2026-08-13 18:16:12 -04:00
Jacob Pratt
8d82dada19 Rollup merge of #161040 - SomeFlyingThing:agent/audit-codegen-hints, r=joboet
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
2026-08-13 18:16:11 -04:00
Jacob Pratt
11c37a33bc Rollup merge of #161037 - joboet:main_altstack, r=clarfonthey
std: don't clean up the main thread's altstack

Fixes rust-lang/rust#161018

https://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.
2026-08-13 18:16:10 -04:00
Jacob Pratt
60c423cbcc Rollup merge of #161036 - makai410:shadowed-diag, r=estebank
Use `with_types_for_suggestion!` in `write_struct_like()`

Supersedes: https://github.com/rust-lang/rust/pull/137783

Fixes: https://github.com/rust-lang/rust/issues/137682

Discussed in: [Zulip chat](https://rust-lang.zulipchat.com/#narrow/channel/147480-t-compiler.2Fdiagnostics/topic/trimmed.20paths.20in.20non-exhaustive.20matches.20when.20shadowed/near/599176247)

r? @estebank since you said you're happy to review... 442 days ago... :))
2026-08-13 18:16:09 -04:00
Jacob Pratt
29b5c303bb Rollup merge of #160984 - bit-aloo:2026-08-12-mgca-const-infer-args, r=khyperia
Fix ICE on { _ } const args in bodies by tracking const-only infer args

closes: rust-lang/rust#160798

r? @khyperia

PS: Here, I am following what Boxy suggested as solution 5, here: [#project-const-generics > Should { _ } be kind ambiguous?](https://rust-lang.zulipchat.com/#narrow/channel/260443-project-const-generics/topic/Should.20.7B.20_.20.7D.20be.20kind.20ambiguous.3F/with/616005728)
2026-08-13 18:16:08 -04:00
Jacob Pratt
a4ce93b217 Rollup merge of #160972 - valentynkit:windows-seek-invalid-input, r=JohnTitor
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" `

Fixes rust-lang/rust#158246

r? libs
2026-08-13 18:16:06 -04:00
Jacob Pratt
e1ce7da6f4 Rollup merge of #160896 - marcoieni:tidy-python-3.11, r=jieyouxu
tidy: Update Python version requirements to 3.11

Similar to https://github.com/rust-lang/rust/pull/160429
I'm updating to 3.11 as requested in https://github.com/rust-lang/rust/pull/160429#issuecomment-5167491411 because 3.10 is EOL in 2 months.

## AI disclosure

gpt 5.6 sol helped me troubleshoot/investigate this task and it generated parts of the code of this PR (mainly in the changes of the Dockerfile).

I think my use of LLMs in this case can be categorized under [`“Trivial” code`](https://forge.rust-lang.org/policies/llm-usage.html#-allowed-with-caveats), so I guess it's fine.
2026-08-13 18:16:06 -04:00
Jacob Pratt
633031af6a Rollup merge of #160440 - bjorn3:refactor_unwind4, r=Mark-Simulacrum
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
2026-08-13 18:16:04 -04:00
Jacob Pratt
584abbca87 Rollup merge of #160288 - mejrs:anon_const_attr_docs, r=GuillaumeGomez
rustdoc: use anonymous constant for primitives/keywords/attribute docs

For context: [#t-rustdoc > hiding fake_item modules. @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/hiding.20fake_item.20modules.2E/near/612115954)

r? @GuillaumeGomez

I've rendered the standard library docs and prims/kws/attrs all show up as normal.

However I could not figure out how to run some of the tests, so this may be a bit of CI-debugging for me :(
2026-08-13 18:16:03 -04:00
Jacob Pratt
a4b09097bf Rollup merge of #160077 - bjorn3:no_unadjusted_fn_abi, r=RalfJung,tgross35
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
2026-08-13 18:16:02 -04:00
Jacob Pratt
ce7c52a207 Rollup merge of #158918 - tgross35:win64-f128-updates, r=folkertdev
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
2026-08-13 18:16:01 -04:00
Jacob Pratt
b5bd6182b6 Rollup merge of #157428 - nia-e:allocator-refactor, r=clarfonthey
allocator: refactor for stabilisation

Adds my current proposal per the doc in rust-lang/rust#156882 and follow-up Zulip conversations (notably for [dyn-compat](https://rust-lang.zulipchat.com/#narrow/channel/197181-t-libs.2Fwg-allocators/topic/Allocator.20dyn-safety/near/599555822)) unstably.

r? libs
2026-08-13 18:16:00 -04:00
bors
93c9086fdd Auto merge of #161045 - folkertdev:stdarch-sync-2026-09-13, r=folkertdev
stdarch subtree update

Subtree update of `stdarch` to 625535e89d.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-08-13 21:58:52 +00:00
Marcelo Dominguez
3de35f270d Add function-like macro 2026-08-13 22:34:03 +03:00
Trevor Gross
2bfb443461 core: Fix a typo in funnel shift documentation 2026-08-13 14:23:16 -04:00
beetrees
55c133a991 Revert "riscv: promote d, e, and f target_features to CfgStableToggleUnstable" 2026-08-13 19:20:43 +01:00
Folkert de Vries
534309dd12 Complex return on x86 2026-08-13 19:32:19 +02:00
Folkert de Vries
130ae0bd00 Implement and test x86_64 Complex 2026-08-13 19:32:19 +02:00
Folkert de Vries
2567434237 disable most revisions 2026-08-13 19:32:18 +02:00
Folkert de Vries
3238bbfdaf add CHECK lines and revisions 2026-08-13 19:32:18 +02:00
Folkert de Vries
3512f08ab3 add complex-abi.rs test 2026-08-13 19:32:18 +02:00
Guillaume Gomez
a89abc8225 Fix link title attribute value when field of enum variants 2026-08-13 16:54:57 +02:00
im-lunex
00a552fa8a check mut-restriction when tuple constructor is used as a value
* 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
2026-08-13 13:41:55 +00:00
mejrs
4449de3ac5 ensure anon consts themselves are not documented 2026-08-13 14:49:49 +02:00
mejrs
6ef144dcb3 rustdoc: use anonymous constant for primitives/keywords/attribute docs 2026-08-13 14:49:49 +02:00
bjorn3
0417c4e028 Add comments
Co-authored-by: Ralf Jung <post@ralfj.de>
2026-08-13 14:20:02 +02:00
bjorn3
12ac752844 Don't compute FnAbi for LLVM intrinsics 2026-08-13 14:20:02 +02:00
bjorn3
cc73c4d283 Avoid computing FnAbi for llvm intrinsics in miri 2026-08-13 14:20:01 +02:00
bjorn3
92e11d113f Avoid extern "unadjusted" in compiler-builtins 2026-08-13 14:20:01 +02:00
bjorn3
16dd590002 Don't use extern "unadjusted" outside of LLVM intrinsics in tests 2026-08-13 14:17:36 +02:00
Jakub Beránek
dfb5bab6fc Enable unrolling feature of bors 2026-08-13 13:44:24 +02:00