Commit Graph

326898 Commits

Author SHA1 Message Date
Jonathan Brouwer ea715cbaba Rollup merge of #156543 - bjorn3:rustbook_windows_sys_0_61, r=ehuss
Update rustbook dependencies to remove windows-targets dependency

Part of https://github.com/rust-lang/rust/issues/156459
2026-05-13 15:16:20 +02:00
Jonathan Brouwer 68e98f0d40 Rollup merge of #156536 - nnethercote:reveal_actual_level-improvements, r=GuillaumeGomez
`reveal_actual_level` improvements

Details in individual commits.

r? @GuillaumeGomez
2026-05-13 15:16:19 +02:00
Jonathan Brouwer aeae08587c Rollup merge of #156425 - chenyukang:yukang-fix-156416-unused-assignments-diverging, r=oli-obk
Fix unused assignments in diverging branches

Fixes rust-lang/rust#156416

Add `location` and use `is_predecessor_of` to check in the control flow graph.

r? @ghost
I'd like to see whether there is performence regression.
2026-05-13 15:16:18 +02:00
Jonathan Brouwer 0705b602f0 Rollup merge of #155815 - djc:swift-cc, r=jieyouxu
Add Swift function call ABI

Adds an unstable `extern "Swift"` ABI behind the `abi_swift` feature gate, mapping to LLVM's `swiftcc` calling convention. This is only allowed (a) for `is_darwin_like` targets, since the [ABI is only stable for those platforms](https://www.swift.org/blog/abi-stability-and-more/) and (b) with the LLVM backend, since the other backends don't support it.

Current approaches to interoperability with Swift lower to Objective-C (or require a Swift stub exposing a C ABI), but that is an optional mapping on the Swift side that some newer Apple frameworks omit. It would be great to be able to more directly/natively be able to call into Swift code directly via its stable API (on Apple platforms at least).

Reimplements rust-lang/rust#64582 on top of current main. The main objection to the previous PR seemed to be that it needed an RFC, but there was pushback (which seems sensible to me) that an RFC could be deferred until stabilization.

I think this needs a tracking issue? Would be happy to write one up if/when there is a consensus that this will be merged.
2026-05-13 15:16:17 +02:00
bjorn3 56e973fa08 Update rustbook dependencies to remove windows-targets dependency 2026-05-13 13:20:33 +02:00
bors eab3d97764 Auto merge of #156535 - JonathanBrouwer:rollup-9oxBSQK, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#156472 (Add support for Zprint-codegen-stats-json)
 - rust-lang/rust#156504 (bootstrap: remap windows-style OUT_DIR paths)
 - rust-lang/rust#156513 (miri subtree update)
 - rust-lang/rust#156524 (Remove the dummy `PreCodegen` mir-opt pass, and use `runtime-optimized` instead)
 - rust-lang/rust#156325 (Don't treat const param default as projection)
2026-05-13 09:57:02 +00:00
Nicholas Nethercote b86ef89082 Change reveal_actual_level's closure's return type, again
Again, the returned triple is equivalent to `LevelAndSource`.
2026-05-13 19:54:30 +10:00
Nicholas Nethercote 7cd42a77fb Change reveal_actual_level's closure's return type
It's currrently `(Option<(Level, Option<LintExpectationId>)>,
LintLevelSource)`. But when the first element of the pair is `None` the
second element is always `LintLevelSource::Default`. So this commit
moves the `LintLevelSource` within the `Option`, which simplifies
things a bit.
2026-05-13 19:54:30 +10:00
Nicholas Nethercote 202e86102c Change reveal_actual_level return type
It currently returns a triple: `(Level, Option<LintExpectationId>,
LintLevelSource)`. That's structurally identical to `LevelAndSource`, so
this commit changes it accordingly.
2026-05-13 19:54:30 +10:00
Nicholas Nethercote 9de0b2dd65 Improve reveal_actual_level
`reveal_actual_level` has two call sites, which look like this:
```
let (level, mut src) = self.raw_lint_id_level(lint, idx, aux);
let (level, lint_id) = reveal_actual_level(level, &mut src, sess, lint, |id| {
    self.raw_lint_id_level(id, idx, aux)
});
```
and:
```
let (level, mut src) = self.probe_for_lint_level(tcx, lint, cur);
let (level, lint_id) = reveal_actual_level(level, &mut src, tcx.sess, lint, |lint| {
    self.probe_for_lint_level(tcx, lint, cur)
});
```
They both have the same pattern: there's a prior call expression that is then
repeated within a closure passed to `reveal_actual_level`.

This commit moves that prior call inside `reveal_actual_level`, making things
simpler.
2026-05-13 19:54:28 +10:00
Jonathan Brouwer f6faa05477 Rollup merge of #156325 - cijiugechu:generics-transmutefrom, r=BoxyUwU
Don't treat const param default as projection

Avoid treating const param default as associated const projection.

Closes rust-lang/rust#156293
2026-05-13 11:46:41 +02:00
Jonathan Brouwer c978cbebea Rollup merge of #156524 - Zalathar:no-pre-codegen, r=oli-obk
Remove the dummy `PreCodegen` mir-opt pass, and use `runtime-optimized` instead

- Alternative to https://github.com/rust-lang/rust/pull/156358.

The `PreCodegen` pass doesn't do anything on its own; it was only serving as a marker to allow `-Zdump-mir` and mir-opt tests to easily dump the final MIR just before codegen.

However, https://github.com/rust-lang/rust/pull/156358#issuecomment-4422445297 pointed out that the `runtime-optimized` phase transition should dump the same MIR, so there shouldn't be any need for a separate *PreCodegen* pass.

---
r? oli-obk (or compiler)
2026-05-13 11:46:40 +02:00
Jonathan Brouwer 91b85f6119 Rollup merge of #156513 - RalfJung:miri, r=RalfJung
miri subtree update

Unblocks https://github.com/rust-lang/rust/pull/156493.

---

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

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

r? @ghost
2026-05-13 11:46:39 +02:00
Jonathan Brouwer 9f1929d738 Rollup merge of #156504 - paradoxicalguy:windows-path-remap, r=bjorn3
bootstrap: remap windows-style OUT_DIR paths

### problem:
on windows, some paths embedded into debuginfo / metadata may internally use `\` separators, while the existing `RUSTC_DEBUGINFO_MAP` remapping only covers the `/` form of `self.build.out`.

### fix:
add an additional remap entry for the windows style `\` variant of `self.build.out`.

### result:
improves path remapping consistency on windows, in turn helping with reproducibility.

r? @bjorn3
2026-05-13 11:46:38 +02:00
Jonathan Brouwer 8edd846028 Rollup merge of #156472 - stephenduong1004:print-stats-json, r=nikomatsakis
Add support for Zprint-codegen-stats-json

Add a flag `-Zprint-codegen-stats-json=<file>` to collect and write LLVM statistics in JSON format. It makes use of the function `llvm::PrintStatisticsJSON` in LLVM.

The flag currently only obtains LLVM statistics for now, but could be used to collect more front-end statistics in the future.
2026-05-13 11:46:37 +02:00
Zalathar 281ccf80f8 Remove the dummy PreCodegen mir-opt pass
This dummy pass is not needed, because the `runtime-optimized` phase transition
can be used to dump the final pre-codegen MIR.
2026-05-13 15:40:23 +10:00
Zalathar 58f8739d55 Migrate mir-opt tests from PreCodegen to runtime-optimized
MIR dumped before/after the dummy `PreCodegen` pass should be identical to MIR
dumped after the phase transition to `runtime-optimized`.
2026-05-13 15:40:23 +10:00
Zalathar ccb9305e20 Move emit_mir out of rustc_mir_transform::dump_mir
This function doesn't have an obvious home, but there's little reason for it to
be in mir-transform, and having it in `rustc_driver_impl::pretty` at least puts
it near other callers of `write_mir_pretty`.
2026-05-13 14:54:31 +10:00
bors c8c4c83d57 Auto merge of #156224 - khyperia:unnormalized-migration, r=BoxyUwU
Unnormalized migration: assert_fully_normalized, struct_tail, and `field.ty`



tracking issue: https://github.com/rust-lang/rust/issues/155345 (first checkbox, and partial second checkbox, of that issue)

I'm going a bit slower than expected (less free time than I'd hope, lots of GCA work that I'm doing instead), and figured I'd just submit what I have now rather than building up a big batch of changes. Slow and steady!

r? @lcnr
2026-05-13 00:16:00 +00:00
lcnr 44c49506bd update tests 2026-05-12 23:28:32 +02:00
Ralf Jung d2803c5776 update lockfile and proc_macro_deps 2026-05-12 22:45:14 +02:00
Ralf Jung 39a25b31d1 Merge pull request #5034 from RalfJung/ci-rebalance
move some checks off of the macos runner
2026-05-12 20:10:59 +00:00
lcnr 950bbe7269 self review 2026-05-12 22:03:27 +02:00
Ralf Jung 57f718e60a Merge pull request #5023 from WhySoBad/network-socket-epoll-edge-on-empty
Handle short reads and writes for TCP sockets
2026-05-12 20:00:58 +00:00
lcnr 3fb166fb6f tiny PR 2026-05-12 21:58:50 +02:00
bors 8b03437a8f Auto merge of #156506 - JonathanBrouwer:rollup-sOIgP3l, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#156287 (move more compiler crates away from `box_patterns` )
 - rust-lang/rust#156428 (Move `std::io::Cursor` to `core::io`)
 - rust-lang/rust#156431 (Move `std::io::util` to `core::io`)
 - rust-lang/rust#156145 (Move tests cast)
 - rust-lang/rust#156284 (resolve: Fix a false positive "cannot reexport" error for ambiguous glob sets)
 - rust-lang/rust#156502 (Give an example of a Ctor in the doc-comments)
2026-05-12 19:47:37 +00:00
Ralf Jung 7eff1908c6 move some checks off of the macos runner 2026-05-12 21:40:15 +02:00
WhySoBad 96ac80a016 Remove socket readiness after short reads/writes 2026-05-12 21:32:35 +02:00
Ralf Jung 764ccebe0e Merge pull request #5033 from RalfJung/ci
CI: fix passing --feature flags to `./miri test` invocation
2026-05-12 18:58:27 +00:00
Abhinav Srivastav bdd0dcd70e bootstrap: remap windows-style OUT_DIR paths 2026-05-13 00:23:51 +05:30
khyperia 57b3e84ed4 Unnormalized migration: struct_tail takes fn taking Unnormalized 2026-05-12 20:45:13 +02:00
khyperia 869c941be9 Unnormalized migration: introduce assert_fully_normalized 2026-05-12 20:45:13 +02:00
Ralf Jung e3f7882d73 fix configuring features for main './miri test' run 2026-05-12 20:17:30 +02:00
Ralf Jung 82a32a1e87 tests: use println to avoid reordering in GHA output 2026-05-12 20:17:30 +02:00
Jonathan Brouwer 03bb9d1bbb Rollup merge of #156502 - ferrocene:jyn/ctor-docs, r=Kivooeo
Give an example of a Ctor in the doc-comments
2026-05-12 18:53:40 +02:00
Jonathan Brouwer 63322d00e9 Rollup merge of #156284 - petrochenkov:kvak2, r=mu001999
resolve: Fix a false positive "cannot reexport" error for ambiguous glob sets

Fixes https://github.com/rust-lang/rust/issues/156264.
2026-05-12 18:53:39 +02:00
Jonathan Brouwer f3e57a2264 Rollup merge of #156145 - danieljofficial:move-tests-cast, r=jieyouxu
Move tests cast

Hi, I have moved some type casting tests into the correct directory. Please find time to review
2026-05-12 18:53:38 +02:00
Jonathan Brouwer ac656cbf21 Rollup merge of #156431 - bushrat011899:core_io_util, r=nia-e
Move `std::io::util` to `core::io`

ACP: https://github.com/rust-lang/libs-team/issues/755
Tracking issue: https://github.com/rust-lang/rust/issues/154046
Subset of: https://github.com/rust-lang/rust/pull/154684

## Description

Moves utility types and functions from `std::io::util` and `std::io` to `core::io`, leaving any IO trait implementations behind. They will be moved along with the traits themselves. Certain documentation links had to be amended.

- `Chain`
- `Empty`
- `Repeat`
- `Sink`
- `Take`
- `empty`
- `repeat`
- `sink`

---

## Notes

* This can be reviewed independently of the other PRs tracked in rust-lang/rust#154046.
* `Chain` and `Take` were previously in the main `mod.rs` file for `std::io`, but I've chosen to move them into the `util.rs` file in `core::io` instead. I think they make more sense in that file, but I'm happy to move them into `mod.rs` if that's a controversial decision.
* No AI tooling of any kind was used during the creation of this PR.
2026-05-12 18:53:37 +02:00
Jonathan Brouwer 5a38b67a02 Rollup merge of #156428 - bushrat011899:core_io_cursor, r=nia-e
Move `std::io::Cursor` to `core::io`

ACP: https://github.com/rust-lang/libs-team/issues/755
Tracking issue: https://github.com/rust-lang/rust/issues/154046
Subset of: https://github.com/rust-lang/rust/pull/154684

## Description

Moves `std::io::Cursor` to `core::io`, leaving the IO trait implementations behind. They will be moved along with the traits themselves. Certain documentation links had to be amended, and a private/unstable `into_parts_mut` method was added to allow the internals to remain private.

---

## Notes

* This can be reviewed independently of the other PRs tracked in rust-lang/rust#154046.
* No AI tooling of any kind was used during the creation of this PR.
2026-05-12 18:53:36 +02:00
Jonathan Brouwer 4ce7ac120c Rollup merge of #156287 - cyrgani:unbox-2, r=petrochenkov
move more compiler crates away from `box_patterns`

Part of https://github.com/rust-lang/rust/issues/156110.
2026-05-12 18:53:35 +02:00
Ralf Jung e8499b7fa2 Merge pull request #5030 from elichai/_mm512_permutex2var_epi8
Add _mm512_permutex2var_epi8 shim support
2026-05-12 16:12:45 +00:00
Ralf Jung a975fa1e1c Merge pull request #5029 from RalfJung/temp_dir
add support for env::temp_dir
2026-05-12 15:32:19 +00:00
Dirkjan Ochtman f49e45101c Add Swift function call ABI
Adds an unstable `extern "Swift"` ABI behind the `abi_swift` feature
gate, mapping to LLVM's `swiftcc` calling convention. Cranelift and
GCC backends fall back to the platform default since they have no
equivalent.
2026-05-12 17:09:19 +02:00
Ralf Jung 0bc649104e stub out confstr for macOS temp_dir 2026-05-12 17:02:36 +02:00
Ralf Jung 1c6ac11d0a implement GetTempPathW on Windows 2026-05-12 16:51:00 +02:00
Zac Harrold 5cbf9f8c8b Move std::io::util to core::io 2026-05-12 23:07:34 +10:00
Zac Harrold e9125c62b1 Move std::io::Cursor into core::io 2026-05-12 22:59:37 +10:00
jyn c37d020c3b give an example of a Ctor in the doc-comments 2026-05-12 12:27:44 +02:00
Elichai Turkel f6c0d329a1 Add _mm512_permutex2var_epi8 shim support 2026-05-12 12:53:44 +03:00
bors 2aabf3ce05 Auto merge of #156483 - JonathanBrouwer:rollup-P2FxgHh, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#154754 (Add Enzyme to build-manifest and rustup)
 - rust-lang/rust#156393 (enable more f16/f128 tests in Miri)
 - rust-lang/rust#154918 (Fix elided lifetime resolution & trait object lifetime defaulting for enum variant paths)
 - rust-lang/rust#156479 (fix missing space in Rc::decrement_strong_count docs)
2026-05-12 09:24:27 +00:00