Commit Graph

174028 Commits

Author SHA1 Message Date
Guillaume Gomez e8d970b08a Rollup merge of #156988 - RalfJung:validate-uninhabited, r=oli-obk
interpret/validity: properly treat zero-variant enums so that we do not have to check layout.is_uninhabited

I am very happy to finally remove the last of these somewhat ad-hoc checks. :)

r? @oli-obk
2026-05-27 20:45:15 +02:00
Guillaume Gomez 3a37aa5765 Rollup merge of #156985 - mati865:additional-llvm-dll-windows-only, r=jieyouxu
Limit the additional DLL to Windows

rust-lang/rust#156229 didn't limit the additional DLL copy to Windows as it was supposed to.
2026-05-27 20:45:14 +02:00
Guillaume Gomez 3e15f828f6 Rollup merge of #156955 - P8L1:fix-reborrow-promotion-consteval, r=RalfJung
Fix const-eval of shared generic reborrows

`Rvalue::Reborrow` const-eval now handles shared generic reborrows produced by `CoerceShared`. Those reborrows intentionally copy from the source ADT into a distinct same-layout target ADT, so the interpreter uses the transmute-capable copy path for `Mutability::Not`.

Promotion is intentionally kept conservative: promotion candidates whose validated temporary graph contains `Rvalue::Reborrow` are rejected, so generic/user-defined reborrows are not promoted.

Fixes rust-lang/rust#156313.
cc @aapoalas
Tracking: rust-lang/rust#145612
@rustbot label F-reborrow
2026-05-27 20:45:13 +02:00
Guillaume Gomez 1a56fa348e Rollup merge of #157026 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/8d7eac38a9a015913feb364144719c51d3655e2a.

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

r? @ghost
2026-05-27 20:45:10 +02:00
Pieter-Louis Schoeman 56f5c38840 Fix const-eval of shared generic reborrows 2026-05-27 18:17:14 +02:00
Ralf Jung 8cb7db2108 Merge pull request #5060 from WhySoBad/host-io-poll-before-foreign-item
Perform host I/O poll before foreign item invocation
2026-05-27 13:44:07 +00:00
WhySoBad 5d3fc4f39a Process host I/O events before any foreign function invocation
This ensures that the readiness of host-backed file descriptions are
up-to-date before executing a foreign function on it.
2026-05-27 15:17:01 +02:00
WhySoBad ac2e825fb5 fix: make socket tests work on native host 2026-05-27 14:40:18 +02:00
Mateusz Mikuła 12b3dd8a35 Limit the additional DLL to Windows
156229 didn't limit the additional DLL copy to Windows as it was
supposed to.
2026-05-27 11:16:56 +02:00
bors ddc1a64229 Auto merge of #157005 - JonathanBrouwer:rollup-1BZFgyy, r=JonathanBrouwer
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#156796 (Fix missing suggestion when matching `String` with `&str`)
 - rust-lang/rust#156933 (rustc_parse_format: improve the error diagnostic for `+` sign flag)
 - rust-lang/rust#156545 (fix issue-144595)
 - rust-lang/rust#156814 (Extend macOS deployment target mismatch filter to cover dylib and new ld formats)
 - rust-lang/rust#156851 (rustdoc: avoid ICE when rendering body-less type consts)
 - rust-lang/rust#156942 (Remove unneeded `#[skip_arg]` attributes)
 - rust-lang/rust#156972 (add field_projections fixme)
 - rust-lang/rust#156975 (Move check_cfg out of diagnostic attr module)
 - rust-lang/rust#156989 (Add missing --set rust.codegen-backends=["gcc"] in the gcc codegen Dockerfile for the core tests)
2026-05-27 08:25:14 +00:00
Jonathan Brouwer a64a3f2075 Rollup merge of #156989 - antoyo:fix/cg_gcc-coretests-ci, r=GuillaumeGomez
Add missing --set rust.codegen-backends=["gcc"] in the gcc codegen Dockerfile for the core tests

The CI would use cranelift instead of the gcc codegen.
This fixes it and was tested in rust-lang/rust#156964.

r? @Kobzol

cc @GuillaumeGomez
2026-05-27 08:14:30 +02:00
Jonathan Brouwer 03e935f81c Rollup merge of #156851 - reddevilmidzy:mgca-doc, r=GuillaumeGomez
rustdoc: avoid ICE when rendering body-less type consts

close: https://github.com/rust-lang/rust/issues/149287
2026-05-27 08:14:27 +02:00
Weihang Lo 22929962bb Update cargo submodule 2026-05-26 20:44:39 -04:00
Antoni Boucher fd0c5f37e7 Add missing --set rust.codegen-backends=["gcc"] in the gcc codegen Dockerfile for the core tests 2026-05-26 15:01:47 -04:00
Ralf Jung e724fa6620 interpret/validity: properly treat zero-variant enums so that we do not have to check layout.is_uninhabited 2026-05-26 20:05:49 +02:00
Ralf Jung 49972bd6d0 Merge pull request #5042 from WhySoBad/network-socket-read-write-timeout
Add network socket read and write timeout
2026-05-26 14:18:42 +00:00
Ralf Jung a5e9441e66 Merge pull request #5040 from arpitjain099/chore/sysroots-permissions
ci: declare contents:read on Tier 2 sysroots workflow
2026-05-26 13:50:50 +00:00
WhySoBad ee8da29feb Add support for socket read and write timeouts 2026-05-26 15:47:02 +02:00
Ralf Jung 2914eb788b non-Windows path handling: make the code match the comment 2026-05-26 15:03:07 +02:00
Ralf Jung d9accd4d8a mkstemp: do not silently do the wrong thing on non-Unix/Windows hosts 2026-05-26 15:01:47 +02:00
Jonathan Brouwer 6140aeec15 Rollup merge of #156947 - ehuss:update-mdbook, r=jieyouxu
Update mdbook to 0.5.3

This is a small update with a few bug fixes.

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-053
2026-05-26 13:42:20 +02:00
Jonathan Brouwer 6aa3c7ef30 Rollup merge of #156899 - Walnut356:lldb_batchmode, r=jieyouxu
fix breakpoint callback registration in `lldb_batchmode`

We'd been failing to register the callback for a while now, because it couldn't find the specified function. This change imports `lldb_batchmode` and uses the namespaced name of the function.

As an aside, I'm relatively sure this breakpoint callback isn't necessary anymore. Whenever lldb stops at a breakpoint, it updates the selected thread/frame automatically. I don't want to remove it quite yet because I *might* need it for some bookkeeping with the `lldb-repr` directive (and `--bless` behavior)
2026-05-26 13:42:19 +02:00
Jonathan Brouwer 903a08c0b0 Rollup merge of #156161 - mejrs:this_formatargs, r=oli-obk
rustc_on_unimplemented: introduce format specifiers

...as printing options for the annotated item.

See also the test and dev guide prose. This only affects rustc_on_unimplemented, not (yet) the other diagnostic attributes. I plan to do that in some later PR.

```rust
#![feature(rustc_attrs)]

#[rustc_on_unimplemented(
    message = "normal: {This}, path: {This:path},  resolved: {This:resolved}"
)]
pub trait Trait<'lifetime, const CONST_GENERIC: usize, A, B> where A: Send {}
```
will do:
```
normal: Trait, path: Trait<'lifetime, CONST_GENERIC, A, B>,  resolved: Trait<'_, 6, u8, _>
```
2026-05-26 13:42:16 +02:00
Arpit Jain a799d97630 ci(ci): declare workflow-level contents: read per RalfJung
Per @RalfJung's review at #5040, adding the same permissions block to ci.yml as the sysroots PR.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
2026-05-26 16:15:20 +09:00
bors b7e97a98f2 Auto merge of #156549 - GuillaumeGomez:ci-gcc-core, r=Kobzol
Add CI check when building sysroot with GCC backend and running libcore tests with it



Fixes https://github.com/rust-lang/rustc_codegen_gcc/issues/882.

Is it what you had in mind @Kobzol?

r? @Kobzol
2026-05-26 04:49:37 +00:00
Redddy bc12569f94 rustdoc: avoid ICE when rendering body-less type consts 2026-05-26 01:05:57 +00:00
Eric Huss b328c251b7 Update mdbook to 0.5.3
This is a small update with a few bug fixes.

Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-053
2026-05-25 17:59:47 -07:00
Guillaume Gomez 76b479930f Explain what each GCC dockerfile is testing 2026-05-25 22:41:36 +02:00
Jonathan Brouwer c9fbeafa80 Rollup merge of #156825 - aerooneqq:sort-errors, r=petrochenkov
compiletest: sort unexpected and unimportant errors

Sort unexpected errors before printing in tests, this helps inserting annotations manually from bottom to top and searching for errors is a bit simpler.

Output before:
```rust
tests/ui/delegation/explicit-paths.rs:47:9: ERROR: method `foo3` is not a member of trait `Trait` [E0407]
tests/ui/delegation/explicit-paths.rs:48:9: ERROR: method `foo4` is not a member of trait `Trait` [E0407]
tests/ui/delegation/explicit-paths.rs:27:14: ERROR: cannot find function `foo4` in `S` [E0425]
tests/ui/delegation/explicit-paths.rs:37:18: ERROR: cannot find function `foo4` in `F` [E0425]
tests/ui/delegation/explicit-paths.rs:48:18: ERROR: cannot find function `foo4` in `F` [E0425]
tests/ui/delegation/explicit-paths.rs:59:18: ERROR: cannot find function `foo4` in `F` [E0425]
tests/ui/delegation/explicit-paths.rs:67:5: ERROR: conflicting implementations of trait `Trait` for type `S` [E0119]
tests/ui/delegation/explicit-paths.rs:56:36: ERROR: mismatched types [E0308]
tests/ui/delegation/explicit-paths.rs:68:16: ERROR: the trait bound `S2: Trait` is not satisfied [E0277]
tests/ui/delegation/explicit-paths.rs:68:30: ERROR: mismatched types [E0308]
```

Output after:
```rust
tests/ui/delegation/explicit-paths.rs:27:14: ERROR: cannot find function `foo4` in `S` [E0425]
tests/ui/delegation/explicit-paths.rs:37:18: ERROR: cannot find function `foo4` in `F` [E0425]
tests/ui/delegation/explicit-paths.rs:47:9: ERROR: method `foo3` is not a member of trait `Trait` [E0407]
tests/ui/delegation/explicit-paths.rs:48:9: ERROR: method `foo4` is not a member of trait `Trait` [E0407]
tests/ui/delegation/explicit-paths.rs:48:18: ERROR: cannot find function `foo4` in `F` [E0425]
tests/ui/delegation/explicit-paths.rs:56:36: ERROR: mismatched types [E0308]
tests/ui/delegation/explicit-paths.rs:59:18: ERROR: cannot find function `foo4` in `F` [E0425]
tests/ui/delegation/explicit-paths.rs:67:5: ERROR: conflicting implementations of trait `Trait` for type `S` [E0119]
tests/ui/delegation/explicit-paths.rs:68:16: ERROR: the trait bound `S2: Trait` is not satisfied [E0277]
tests/ui/delegation/explicit-paths.rs:68:30: ERROR: mismatched types [E0308]
```

r? @petrochenkov
2026-05-25 20:54:07 +02:00
Jonathan Brouwer 9545845017 Rollup merge of #156901 - Zalathar:needs-asm-ret, r=folkertdev
compiletest: Simplify `//@ needs-asm-mnemonic: ret` to just `//@ needs-asm-ret`

- Simplification of https://github.com/rust-lang/rust/pull/155692.
---

The `needs-asm-mnemonic` directive was very general, but in practice was only being used for `ret`. There are very few other mnemonics that it could plausibly be useful for (e.g. `nop`), because any instruction that requires arguments is probably going to be non-portable.

This PR replaces `needs-asm-mnemonic` with a simpler `needs-asm-ret` directive that uses the same machinery as other simple needs directives.

If we happend to need more mnemonics in the future, we can just add more simple directives as appropriate (e.g. `needs-asm-nop`).
2026-05-25 14:44:05 +02:00
Jonathan Brouwer 95a3f832b7 Rollup merge of #156879 - apiraino:link-coc-rustfmt, r=ytmimi
Replace rustfmt code of conduct with link

In rust-lang/rust#65141 we replaced the CoC file and linked the "authoritative source" on the website. I noticed that the rustfmt directory still has the CoC original file.

I *think* for consistency it makes sense to have all of them linked but I'd like to hear from @calebcartwright first :-)

r? @Mark-Simulacrum
2026-05-25 14:44:05 +02:00
Zalathar 028b8b6c54 Simplify //@ needs-asm-mnemonic: ret to just //@ needs-asm-ret
The `needs-asm-mnemonic` directive was very general, but in practice was only
being used for `ret`. There are very few other mnemonics that it could
plausibly be useful for (e.g. `nop`), because any instruction that requires
arguments is probably going to be non-portable.

This PR replaces `needs-asm-mnemonic` with a simpler `needs-asm-ret` directive
that uses the same machinery as other simple needs directives.

If we happend to need more mnemonics in the future, we can just add more simple
directives as appropriate (e.g. `needs-asm-nop`).
2026-05-25 17:15:32 +10:00
Walnut bf7a021d0e fix breakpoint callback registration 2026-05-25 01:32:05 -05:00
aerooneqq 68695a6e06 Sort unexpected and unimportant errors 2026-05-25 08:40:34 +03:00
Ralf Jung c1f7fa1a48 Merge pull request #5053 from WhySoBad/network-socket-test-fill-buffer-windows
Fix skipping TCP write buffer filling on Windows hosts
2026-05-24 20:08:22 +00:00
bors 423e3d2529 Auto merge of #156893 - JonathanBrouwer:rollup-KrnXZ2W, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#142611 (Do not suggest compatible variants inside macro)
 - rust-lang/rust#156692 (compiletest: Prepare all simple `//@ needs-*` conditions in advance)
 - rust-lang/rust#156847 (Fix suggestion of unused variables with raw identifier in struct pattern)
 - rust-lang/rust#156876 (Remove useless -Zunpretty=identified option)
 - rust-lang/rust#156884 (Revert "Allow `global_asm!` in statement positions")
2026-05-24 19:34:37 +00:00
Ralf Jung 102df46fb3 Merge pull request #5054 from WhySoBad/network-socket-fix-deallocate-tmp-buffer-readv
Fix deallocating temporary buffer on failed `readv`
2026-05-24 19:29:14 +00:00
Jonathan Brouwer 88ffe41cc7 Rollup merge of #156692 - Zalathar:needs, r=jieyouxu
compiletest: Prepare all simple `//@ needs-*` conditions in advance

This PR makes compiletest check almost all `//@ needs-*` conditions in advance, separate from individual tests or directives. The results of these checks are stored in a prepared hashmap that can then be inspected by individual tests when encountering a needs-* directive.

This is *similar* to how `ignore-*`/`only-*` directives work (as of https://github.com/rust-lang/rust/pull/149470), though currently the two mechanisms don't share code, as they have subtly different requirements.

r? jieyouxu
2026-05-24 21:28:52 +02:00
WhySoBad cebc29f482 fix: deallocate temporary buffer on failed readv 2026-05-24 21:01:30 +02:00
Ralf Jung 678ef5a1b6 Merge pull request #5055 from quiode/patch-1
as_mut_ptr test update description
2026-05-24 18:30:28 +00:00
Dominik Schwaiger 30b942df98 as_mut_ptr test update description
Updates the description in the `tests/fail/tree_borrows/implicit_writes/as_mut_ptr.rs` test. The referenced file no longer exists.

Co-authored-by: Ralf Jung <post@ralfj.de>
2026-05-24 19:59:28 +02:00
Jacob Pratt 81eb844071 Rollup merge of #156824 - CoCo-Japan-pan:mut-restriction-parse, r=Urgau,jhpratt
Parse `mut` restrictions

This PR is part of the progress implementing `mut` restrictions proposed in [RFC 3323](https://rust-lang.github.io/rfcs/3323-restrictions.html), and linked to a [GSoC proposal](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Implementing.20impl.20and.20mut.20restrictions/with/592352432).
This PR focuses solely on the parsing of `mut` restrictions.
The keyword order is `pub(...) mut(...) unsafe field`.
The new syntax is guared by `#[feature(mut_restriction)]` feature gate.
Tracking Issue: rust-lang/rust#105077

r? @Urgau
cc @jhpratt
2026-05-24 16:39:41 +02:00
Ben Kimock 9a681abd85 Merge pull request #4964 from saethlin/support-no-core
Support running no_core Linux programs
2026-05-24 14:31:44 +00:00
Ben Kimock da3727f193 Support running no_core Linux programs
Co-authored-by: Ralf Jung <post@ralfj.de>
2026-05-24 09:53:29 -04:00
apiraino 3b170fa5fc Replace code of conduct with link 2026-05-24 15:24:27 +02:00
CoCo-Japan-pan dbb7b811ee rustfmt mut restriction 2026-05-24 17:34:01 +09:00
CoCo-Japan-pan 9aa5a17cee Add eq_mut_restriction to clippy_utils 2026-05-24 17:34:01 +09:00
Ralf Jung d4a8031c1f restrict vendor intrinsics to little-endian targets 2026-05-24 09:09:50 +02:00
bors e1ff77d898 Auto merge of #156736 - GuillaumeGomez:primitive-assoc-methods, r=fmease
Fix jump to def link generation on primitive type associated methods

Fixes rust-lang/rust#156707.

Interestingly enough, the inference fails on primitive type, so instead I go around a bit by generating a `PrimitiveType` and then tweak a bit the `href` generation.

r? @fmease
2026-05-24 03:17:11 +00:00
Guillaume Gomez 0c7388c750 Fix jump to def link generation on primitive type associated methods 2026-05-23 19:07:36 +02:00