Commit Graph

326741 Commits

Author SHA1 Message Date
yukang 64e93266ce Fix unused assignments in diverging branches 2026-05-12 02:11:07 +08:00
bors 64a965e901 Auto merge of #156441 - JonathanBrouwer:rollup-7K8EuPO, r=JonathanBrouwer
Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#156437 (`rust-analyzer` subtree update)
 - rust-lang/rust#156357 (tests: ip*_properties: avoid parsing the IP over and over again)
 - rust-lang/rust#156389 (prepare fs tests for miri)
 - rust-lang/rust#156147 (Update ICU4X to 2.2)
 - rust-lang/rust#156375 (kernel_copy tests: properly join background threads)
 - rust-lang/rust#156406 (resolve: Module-related refactorings)
 - rust-lang/rust#155946 (Refuse to push changes with a dirty git client)
 - rust-lang/rust#156282 (Update `sysinfo` version to `0.39.0`)
 - rust-lang/rust#156372 (remove allows_weak_linkage target spec flag)
 - rust-lang/rust#156384 (Remove some dead code for dumping MIR for a single DefId)
 - rust-lang/rust#156392 (Improve doc comments for f32::ceil() and f32::floor())
 - rust-lang/rust#156411 (bootstrap: Don't panic on `x install --set build.extended=true`)
 - rust-lang/rust#156426 (Fix unwanted "Available on XX-bit only" in libcore integers)
2026-05-11 08:30:13 +00:00
Jonathan Brouwer 33670e20c4 Rollup merge of #156426 - GuillaumeGomez:fix-cfg-display-integers, r=Urgau
Fix unwanted "Available on XX-bit only" in libcore integers

Fixes rust-lang/rust#149786.

The problem came from:

<img width="754" height="734" alt="image" src="https://github.com/user-attachments/assets/c251326f-8640-420d-bc4c-a3246390ea67" />

The `doc_cfg` feature picks the `cfg` as it should. If we don't want it, we simply need to disable the feature on it. With this fix, no more `cfg` annotations:

<img width="860" height="590" alt="image" src="https://github.com/user-attachments/assets/da793590-bf43-4874-94e1-a56809938420" />

r? @Urgau
2026-05-11 10:29:22 +02:00
Jonathan Brouwer 4846eb7ca1 Rollup merge of #156411 - jyn514:jyn/dry-run-cargo, r=jieyouxu
bootstrap: Don't panic on `x install --set build.extended=true`

This was a regression from rust-lang/rust#155732.
The Cargo submodule wasn't checked out, so reading from Cargo.toml didn't work. Return a fake version during dry-runs to avoid unnecessarily checking out submodules.

Fixes https://github.com/rust-lang/rust/issues/156408.
2026-05-11 10:29:21 +02:00
Jonathan Brouwer bd479badfb Rollup merge of #156392 - Wilfred:float_ceil_docs, r=Mark-Simulacrum
Improve doc comments for f32::ceil() and f32::floor()

Previously ::floor() included an example showing behaviour for negative values, but ::ceil() did not. Ensure both have examples of the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
2026-05-11 10:29:20 +02:00
Jonathan Brouwer 7843355462 Rollup merge of #156384 - Zalathar:pretty-def-id, r=tiif
Remove some dead code for dumping MIR for a single DefId

The functions that call `dump_mir_def_ids` are themselves never called with a specific DefId; they always dump MIR for the entire crate.
2026-05-11 10:29:20 +02:00
Jonathan Brouwer a466915cd8 Rollup merge of #156372 - RalfJung:allows_weak_linkage, r=oli-obk
remove allows_weak_linkage target spec flag

The flag doesn't actually do anything. I have no idea what it's original purpose was.

It got introduced in https://github.com/rust-lang/rust/commit/59cfe904dcfbe2c3ad5396131b3d3ba6b7179fdd, but already a few months later in https://github.com/rust-lang/rust/commit/57950982b27c6ab45509c1f2db4a01fa1d2cfebb both of its uses were removed when the entire file `src/librustc_trans/closure.rs` got deleted.

It seems like back in the day we used weak linkage for closures by default and MinGW wasn't happy about that? But not much later the way we compile closures got changed, making the work-around unnecessary. The flag has then persisted unused for 10 years. A couple of Windows/UEFI targets are setting `allows_weak_linkage: false` but I assume that was just cargo-culted.

But to be sure, let's ping the folks listed for the affected targets and other Windows folks:
@dvdhrm @nicholasbishop @Berrysoft @mati865 @thomcc  @tbu- @ChrisDenton
2026-05-11 10:29:19 +02:00
Jonathan Brouwer 05addd9af7 Rollup merge of #156282 - GuillaumeGomez:update-sysinfo, r=Mark-Simulacrum
Update `sysinfo` version to `0.39.0`

Bugfixes, new API and performance improvement. Full changelog is [here](https://github.com/GuillaumeGomez/sysinfo/blob/main/CHANGELOG.md).
2026-05-11 10:29:18 +02:00
Jonathan Brouwer fd46e8110c Rollup merge of #155946 - Daniel-B-Smith:smithdb/dirty-verify, r=clubby789
Refuse to push changes with a dirty git client

I've run into the issue more than once where I've fixed an issue in my client but forgotten to commit it one way or another. The verification succeeds because the files on disk are correct even though the files in the commit being pushed are incorrect.

This change checks to see if there are any uncommitted changes in tracked files in the client before running the tidy checks.
2026-05-11 10:29:17 +02:00
Jonathan Brouwer 8880b2ce0e Rollup merge of #156406 - petrochenkov:modata2, r=nnethercote
resolve: Module-related refactorings

Extracted parts of https://github.com/rust-lang/rust/pull/156362 that don't require splitting `(Local,Extern)ModuleData` into separate data structures.

- Some `expect_local` assertions are added
- Methods that need to exist on all of `Module` and `(Local,Extern)Module` are implemented for `ModuleData`
- Methods that need to exist on `ModuleKind` are moved to `ModuleKind`
- Some unnecessary complicated logic using `graph_root` is simplified
-  `glob_importers` are filled and used only for local modules.
- Some unnecessary logic is skipped for extern modules in `resolve_ident_in_module_non_globs_unadjusted`
- Module construction functions are cleaned up
- `module_to_string` is simplified

r? @nnethercote
2026-05-11 10:29:16 +02:00
Jonathan Brouwer 4f22db3e86 Rollup merge of #156375 - RalfJung:kernel_copy-background-threads, r=Mark-Simulacrum
kernel_copy tests: properly join background threads

This helps Miri because when there are threads just hanging in the background, we cannot check for memory leaks.

I think even without Miri this currently leads to 100% CPU load on one core for each of these threads: once the test function returns and `sink` gets dropped, the `read` in the thread will always immediately return `0`, and then we just loop with that forever until the process exits.
2026-05-11 10:29:16 +02:00
Jonathan Brouwer f57cc28c76 Rollup merge of #156147 - Manishearth:icu4xup, r=Mark-Simulacrum
Update ICU4X to 2.2

Needs a data regen.
2026-05-11 10:29:15 +02:00
Jonathan Brouwer 5e230f5de6 Rollup merge of #156389 - RalfJung:miri-fs, r=Mark-Simulacrum
prepare fs tests for miri

- reduce iteration counts to get rid of timeouts
- disable one test that relies on spawning processes
2026-05-11 10:29:14 +02:00
Jonathan Brouwer b7c916246b Rollup merge of #156357 - RalfJung:slow-test, r=Mark-Simulacrum
tests: ip*_properties: avoid parsing the IP over and over again

This test somehow takes 12s to execute in Miri (on CI, i.e. on a slow machine), despite not having any loop. I suspect it's caused by us for some reason re-parsing the same string again and again. Let's just not do that.
2026-05-11 10:29:13 +02:00
Jonathan Brouwer 1c7508dc87 Rollup merge of #156437 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/e2a5867817d49134dd252562bd937a1cae59c4ae.

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

r? @ghost
2026-05-11 10:29:12 +02:00
Laurențiu Nicola 9a0f4dfa0a Merge ref '8afb6a8b1b32' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@8afb6a8b1b
Filtered ref: rust-lang/rust-analyzer@82d0ddb677
Upstream diff: https://github.com/rust-lang/rust/compare/1d72d7e8136faaebad3a85eeed432e6ea1b2ffab...8afb6a8b1b32fce2f8aa7520517833338dc36c5e

This merge was created using https://github.com/rust-lang/josh-sync.
2026-05-11 10:05:57 +03:00
Laurențiu Nicola 519f35a717 Prepare for merging from rust-lang/rust
This updates the rust-version file to 8afb6a8b1b.
2026-05-11 09:55:44 +03:00
Lukas Wirth f3c8d32ed9 Merge pull request #22313 from ChayimFriedman2/visit-traits
internal: Refactor visiting and tracking of placeholder types
2026-05-11 06:31:43 +00:00
Lukas Wirth b7a361cd6d Merge pull request #22328 from ChayimFriedman2/variant-name
internal: Remove interning from query_group
2026-05-11 06:00:40 +00:00
bors 8afb6a8b1b Auto merge of #153975 - cyrgani:remove-f64-methods, r=scottmcm
remove forever-deprecated and hidden `f64` methods



The methods `f64::is_positive` and `f64::is_negative` were deprecated since 1.0 and marked as `#[doc(hidden)]` in favor of `f64::is_sign_positive` and `f64::is_sign_negative`. They also only exist on `f64`, not on `f32`. But for some unknown reason, they have been marked as stable.

This PR proposes to remove both methods as they were never a part of the documented API, assuming that a crater run finds no significant breakage.
2026-05-11 03:22:11 +00:00
Guillaume Gomez 5a52e12664 Fix unwanted "Available on XX-bit only" 2026-05-11 03:31:13 +02:00
bors 4b0c9d76ae Auto merge of #156405 - JonathanBrouwer:rollup-yJcad1j, r=JonathanBrouwer
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#156394 (miri subtree update)
 - rust-lang/rust#154972 (Implement `core::arch::return_address` and tests)
 - rust-lang/rust#155679 (rustdoc: Reify emission types)
 - rust-lang/rust#155982 (Fix closure HIR span context mismatch)
 - rust-lang/rust#156323 (Handle --print=backend-has-mnemonic in cg_clif)
 - rust-lang/rust#156387 (std fs tests: avoid matching on OS-provided error string)
 - rust-lang/rust#156129 (compiletest: Migrate from `PassMode`/`FailMode` to `PassFailMode`)
 - rust-lang/rust#156192 (core: Replace `ptr::slice_from_raw_parts` with `slice::from_raw_parts`)
 - rust-lang/rust#156365 (stream_send_recv_stress tests: wait for threads to finish)
 - rust-lang/rust#156368 (Fix invalid unreachable in is_known_valid_scrutinee for Reborrow)
2026-05-10 19:58:51 +00:00
jyn 8643183f93 bootstrap: Don't panic on x install --set build.extended=true
This was a regression from 155732.
The Cargo submodule wasn't checked out, so reading from Cargo.toml
didn't work. Return a fake version during dry-runs to avoid
unnecessarily checking out submodules.
2026-05-10 20:24:27 +02:00
Vadim Petrochenkov a07cc548e4 resolve: Module-related refactorings 2026-05-10 20:11:34 +03:00
Jonathan Brouwer cfd0d4c150 Rollup merge of #156368 - aapoalas:reborrow-in-match-statement, r=Nadrieril
Fix invalid unreachable in is_known_valid_scrutinee for Reborrow

Fixes rust-lang/rust#156304

Part of the Reborrow traits experiment rust-lang/rust#145612
2026-05-10 19:05:48 +02:00
Jonathan Brouwer 4d2f9ca08d Rollup merge of #156365 - RalfJung:stream_send_recv_stress, r=nia-e
stream_send_recv_stress tests: wait for threads to finish

These tests currently fail in Miri (when run with nextest) because all they do is spawn a lot of threads that will do stuff, but they don't wait for the threads to actually finish. Miri by default errors when there are background threads lingering when `main` is done (since that can indicate a leak, and since it makes it impossible to check for memory leaks). Miri gives background threads a bit of time to finish when `main` is done, but for these tests that's nowhere near enough since basically the entire test runs after `main` is done.

Outside Miri, this could also still mean that the test doesn't actually run to completion, it might get abort when `main` finishes.

So let's use `thread::scope` to ensure all threads are done before the test is considered done.
2026-05-10 19:05:47 +02:00
Jonathan Brouwer 06ccbc1929 Rollup merge of #156192 - xtqqczze:slice-from-raw-parts, r=Mark-Simulacrum
core: Replace `ptr::slice_from_raw_parts` with `slice::from_raw_parts`
2026-05-10 19:05:47 +02:00
Jonathan Brouwer e2b3f7e375 Rollup merge of #156129 - Zalathar:pass-fail, r=jieyouxu
compiletest: Migrate from `PassMode`/`FailMode` to `PassFailMode`

Every UI test has an explicit or implicit “pass/fail mode” (e.g. `check-fail` or `build-pass`) that was historically stored in two separate optional fields (`pass_mode` and `fail_mode`). That split made it very hard to determine how the respective values were actually produced and consumed, especially in the presence of `--pass=check` on the command-line, or when building auxiliary crates.

This PR replaces the separate fields and enums for pass-mode and fail-mode with a single `PassFailMode` enum and a single `pass_fail_mode` field.

With this new representation, it should hopefully be easier to understand and modify the pass/fail-mode logic.

---

In order to focus on the main migration, I have mostly refrained from subsequent cleanups.

r? jieyouxu
2026-05-10 19:05:46 +02:00
Jonathan Brouwer dd38e55468 Rollup merge of #156387 - RalfJung:fs-error-str, r=ChrisDenton
std fs tests: avoid matching on OS-provided error string

These tests are [ancient](https://github.com/rust-lang/rust/commit/6bfbad937bdf578e35777d079f8dcfab49758041). No idea why there written in this style back then, but today we'd clearly check the `ErrorKind`, not the string.

r? @ChrisDenton
2026-05-10 19:05:45 +02:00
Jonathan Brouwer 5246f6e4bc Rollup merge of #156323 - bjorn3:clif_has_mnemonic, r=wesleywiser
Handle --print=backend-has-mnemonic in cg_clif

And introduce a `has_mnemonic` method on `CodegenBackend` just like `--print=backend-has-zstd`.
2026-05-10 19:05:44 +02:00
Jonathan Brouwer 29961709f1 Rollup merge of #155982 - cijiugechu:gio-ice-repro, r=chenyukang
Fix closure HIR span context mismatch

Ensure span has the closure expression's SyntaxContext.

Closes rust-lang/rust#155724
2026-05-10 19:05:44 +02:00
Jonathan Brouwer 63e70d5583 Rollup merge of #155679 - fmease:rustdoc-reify-emission-types, r=notriddle
rustdoc: Reify emission types

Implements https://github.com/rust-lang/rust/pull/155374#discussion_r3124208232:

Instead of maintaining the hidden assumption or invariant that `opts.emit.is_empty()` actually means "emit default artifacts" (i.e., `[HtmlStaticFiles, HtmlNonStaticFiles]` under output format `html`; "`[???]`" under output format `json`), actually *reify* the list of emission types so the rest of the code doesn't need to keep this in mind.

I'm not sure if you like this. It's a tinge overengineered, maybe, but it's more robust I claim.

This PR also rejects `--emit` when `--output-format doctest -Zunstable-options` is passed since the latter doesn't honor emission types at all (yet).
2026-05-10 19:05:43 +02:00
Jonathan Brouwer 30ec142b97 Rollup merge of #154972 - chorman0773:return_address, r=Mark-Simulacrum
Implement `core::arch::return_address` and tests

Tracking issue: rust-lang/rust#154966

Implements libs-team#768
2026-05-10 19:05:42 +02:00
Jonathan Brouwer 084bc48198 Rollup merge of #156394 - RalfJung:miri, r=RalfJung
miri subtree update

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

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

r? @ghost
2026-05-10 19:05:41 +02:00
bors e8f92f5769 Auto merge of #144537 - frank-king:feature/pin-drop, r=petrochenkov
Add `Drop::pin_drop` for pinned drops





This PR is part of the `pin_ergonomics` experiment (the tracking issue is rust-lang/rust#130494). It allows implementing `Drop` with a pinned `self` receiver, which is required for safe pin-projection.

Implementations:
- [x] At least and at most one of `drop` and `pin_drop` should be implemented.
- [x] No direct call of `drop` or `pin_drop`. They should only be called by the drop glue.
- [x] `pin_drop` must and must only be used with types that support pin-projection (i.e. types with `#[pin_v2]`).
- [ ] Allows writing `fn drop(&pin mut self)` and desugars to `fn pin_drop(&pin mut self)`. (Will be in the next PRs)
2026-05-10 16:43:01 +00:00
Chayim Refael Friedman 503cf607a7 Merge pull request #22315 from A4-Tacks/postfix-refexpr-in-macro
fix: add whitespaces on postfix completion in macro
2026-05-10 14:51:12 +00:00
Chayim Refael Friedman 2ebcf691fc Merge pull request #22334 from WaterWhisperer/diag-array-slice-pat
feat: add diagnostic for E0529
2026-05-10 13:26:43 +00:00
WaterWhisperer 4b15312c3a feat: add diagnostic for E0529 2026-05-10 21:06:22 +08:00
Wilfred Hughes e8eb80b9de Improve doc comments for f32::ceil() and f32::floor()
Previously ::floor() included an example showing behaviour for
negative values, but ::ceil() did not. Ensure both have examples of
the negative case, for both f32 and f64.

Whilst we're here, tweak the wording slightly so it reads better.
2026-05-10 12:25:39 +01:00
Ralf Jung 5901bb8d2d remove some miri test gates 2026-05-10 12:45:15 +02:00
Ralf Jung 46d2c71709 Merge pull request #5022 from RalfJung/direct-errno-translation
try_errnum_to_io_error: support all POSIX error codes
2026-05-10 10:34:08 +00:00
Ralf Jung f83b976ec4 try_errnum_to_io_error: support all POSIX error codes 2026-05-10 12:07:58 +02:00
Ralf Jung d1c3e91a7e prepare fs tests for miri 2026-05-10 12:03:47 +02:00
Ralf Jung a0298aa7e5 std fs tests: avoid matching on OS-provided error string 2026-05-10 11:34:21 +02:00
bors 99eed207b4 Auto merge of #156185 - petrochenkov:queffvis, r=mu001999
resolve: Evaluate private visibilities eagerly in eff vis computation

It's cheaper to evaluate them now when `Decl`arations keep their parent modules.
2026-05-10 09:28:26 +00:00
Ralf Jung 1dca18d828 Merge pull request #5020 from RalfJung/locked
./miri install: add --locked by default
2026-05-10 08:32:06 +00:00
Ralf Jung 5b80eda1a0 Merge pull request #5021 from RalfJung/gnu_get_libc_version
add gnu_get_libc_version stub for getaddrinfo error path
2026-05-10 08:29:16 +00:00
Aapo Alasuutari 5c0718be11 fix(reborrow): invalid unreachable in is_known_valid_scrutinee 2026-05-10 11:07:30 +03:00
Ralf Jung 2c1e114291 ./miri install: add --locked by default 2026-05-10 10:05:15 +02:00
Ralf Jung 6f0005e206 add gnu_get_libc_version stub for getaddrinfo error path 2026-05-10 10:01:43 +02:00