306288 Commits

Author SHA1 Message Date
bors
dd7fda5700 Auto merge of #146812 - matthiaskrgr:rollup-aiap18m, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144592 (generate list of all variants with `target_spec_enum`)
 - rust-lang/rust#146762 (Fix and provide instructions for running test suite on Apple simulators)
 - rust-lang/rust#146770 (fixes for numerous clippy warnings)
 - rust-lang/rust#146774 (Allow running `x <cmd> <path>` from a different directory)
 - rust-lang/rust#146800 (Fix unsupported `std::sys::thread` after move)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-20 16:33:23 +00:00
Guillaume Gomez
fd7f8b2b25 [GCC backend] Ignore failing ui abi tests 2025-09-20 17:58:32 +02:00
Matthias Krüger
48c1249bff
Rollup merge of #146800 - thaliaarchi:fix-move-pal-thread, r=joboet
Fix unsupported `std::sys::thread` after move

Fixes building std for any platform with an unsupported thread abstraction. This includes {aarch64,armv7,x86_64}-unknown-trusty and riscv32im-risc0-zkvm-elf, which explicitly include the unsupported module, and platforms with no PAL.

Bug fix for rust-lang/rust#145177 (std: move thread into sys).

Also fix the `std` build for xtensa, which I incidentally found while looking for an unsupported platform.

r? ``@joboet``
2025-09-20 17:55:05 +02:00
Matthias Krüger
f5725f0182
Rollup merge of #146774 - Kobzol:bootstrap-relative-path, r=jieyouxu
Allow running `x <cmd> <path>` from a different directory

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

r? ``@jieyouxu``
2025-09-20 17:55:05 +02:00
Matthias Krüger
016420a603
Rollup merge of #146770 - hkBst:clippy-fix-10, r=fmease
fixes for numerous clippy warnings
2025-09-20 17:55:04 +02:00
Matthias Krüger
8904ff135f
Rollup merge of #146762 - madsmtm:test-apple-sim, r=jieyouxu
Fix and provide instructions for running test suite on Apple simulators

The following now works:

```sh
./x test --host='' --target aarch64-apple-ios-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-tvos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-watchos-sim --skip tests/debuginfo
./x test --host='' --target aarch64-apple-visionos-sim --skip tests/debuginfo
```

I have documented the setup I used [in the `rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/tests/running.html#testing-on-emulators), it's fairly standard use of `remote-test-server` (with a small fix to library load paths which I've made in the first commit).

I first tried the somewhat simpler `target.aarch64-apple-ios-sim.runner = "xcrun simctl spawn $UDID"`, but that doesn't work as required libraries etc. also need to be copied to the device.

The debuginfo tests fail, I think because the debug info in `.dSYM` isn't available. I am yet unsure exactly how to fix this, either we need to copy that directory to the target as well, or we need to configure `lldb` somehow to read it from the host.

I decided to not add this to our CI, since I suspect we wouldn't gain much from it? Running on the simulator still uses the host Darwin kernel, it's basically just configured to run in another mode with more restricted permissions and different system libraries.

r? jieyouxu
CC ``@simlay,`` you're a lot more familiar with `xcrun simctl` than I.
2025-09-20 17:55:04 +02:00
Matthias Krüger
5f8062bfcc
Rollup merge of #144592 - fee1-dead-contrib:target_spec, r=Noratrieb
generate list of all variants with `target_spec_enum`

This helps us avoid the hardcoded lists elsewhere.

r? ``@Noratrieb``
2025-09-20 17:55:03 +02:00
bors
9f2ef0f14d Auto merge of #146805 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to 0c62c01aae.

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

r? `@ghost`
2025-09-20 11:17:44 +00:00
tk
ac3c480388 docs: improve doc of some methods w/ ranges 2025-09-20 10:17:56 +00:00
bors
b00998aaa5 Auto merge of #146771 - Kobzol:download-ci-llvm-default-value, r=jieyouxu
Simplify default value of `download-ci-llvm`

Just set it to true, rather than having different default values on CI and locally, and then only deny `true` on our own CI, not elsewhere.

Closes: https://github.com/rust-lang/rust/issues/146768

r? `@jieyouxu`
2025-09-20 08:04:38 +00:00
Laurențiu Nicola
0afd767bac
Merge pull request #20707 from lnicola/bump-rustc
minor: Bump rustc crates once more
2025-09-20 06:50:11 +00:00
Laurențiu Nicola
4d8655e8d0 Bump rustc crates once more 2025-09-20 09:38:53 +03:00
bors
e4b521903b Auto merge of #146621 - cammeresi:peek-20250915, r=Amanieu
Make `PeekMut` generic over the allocator

- plumb in allocator generic
- additional testing

Related: rust-lang/rust#122742
2025-09-20 04:43:19 +00:00
Sidney Cammeresi
42b38e3781
Add unstable attribute to BTreeMap-related allocator generics
Although these types aren't directly constructable externally, since
they're pub, I think this omission was an oversight.
2025-09-19 21:32:15 -07:00
Thalia Archibald
db4d4eff56 Update cfg_if! to cfg_select!
The macro is now builtin.
2025-09-19 19:18:10 -06:00
Thalia Archibald
776c199c7b Fix std build for xtensa 2025-09-19 19:18:10 -06:00
Thalia Archibald
6a5838105d Fix unsupported std::sys::thread
Fixes building std for any platform with an unsupported thread
abstraction. This includes {aarch64,armv7,x86_64}-unknown-trusty and
riscv32im-risc0-zkvm-elf, which explicitly include the unsupported
module, and platforms with no PAL.

Bug fix for PR 145177 (std: move thread into sys).
2025-09-19 19:18:10 -06:00
Deadbeef
4841d8c5ff generate list of all variants with target_spec_enum
This helps us avoid the hardcoded lists elsewhere.
2025-09-19 22:14:50 +00:00
bors
ec38671075 Auto merge of #146797 - matthiaskrgr:rollup-xy0g8n7, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146690 (add `[const] PartialEq` bound to `PartialOrd`)
 - rust-lang/rust#146776 (fixes for numerous clippy warnings)
 - rust-lang/rust#146777 (fix ./x readdir logic when CDPATH is set)
 - rust-lang/rust#146781 (mbe: Fix feature gate for `macro_derive`)
 - rust-lang/rust#146785 (btree: safety comments for init and new)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-19 21:41:28 +00:00
Marijn Schouten
54b15a66d8 fixes for numerous clippy warnings 2025-09-19 20:56:07 +00:00
Matthias Krüger
6f9e6c9935
Rollup merge of #146785 - hkBst:btree-1, r=joboet
btree: safety comments for init and new
2025-09-19 22:53:56 +02:00
Matthias Krüger
02faee6044
Rollup merge of #146781 - joshtriplett:mbe-derive-fix-feature-gate, r=wesleywiser
mbe: Fix feature gate for `macro_derive`
2025-09-19 22:53:56 +02:00
Matthias Krüger
dc3c62a179
Rollup merge of #146777 - RalfJung:x-cdpath, r=Kobzol
fix ./x readdir logic when CDPATH is set

Fixes https://github.com/rust-lang/rust/issues/146769
r? ``@Kobzol``
2025-09-19 22:53:55 +02:00
Matthias Krüger
29f39426c5
Rollup merge of #146776 - hkBst:clippy-fix-12, r=jdonszelmann
fixes for numerous clippy warnings
2025-09-19 22:53:55 +02:00
Matthias Krüger
96a4ae3ab9
Rollup merge of #146690 - npmccallum:convo, r=tgross35
add `[const] PartialEq` bound to `PartialOrd`

This change is included for discussion purposes.

The PartialOrd bound on PartialEq is not strictly necessary. It is, rather, logical: anything which is orderable should by definition have equality. Is the same true for constness? Should every type which is const orderable also have const equality?
2025-09-19 22:53:54 +02:00
Folkert de Vries
b27942853e
naked_asm: emit a label starting with func_end
The `cargo asm` tool pattern matches on such labels to figure out where functions end: normal functions generated by LLVM always do have such a label. We don't guarantee that naked functions emit such a label, but having `cargo asm` work is convenient
2025-09-19 21:53:06 +02:00
bors
0be8e16088 Auto merge of #146700 - Zalathar:quoted-args, r=nikic
cg_llvm: Move target machine command-line quoting from C++ to Rust

When this code was introduced in rust-lang/rust#130446 and rust-lang/rust#131805, it was complicated by the need to maintain compatibility with earlier versions of LLVM.

Now that LLVM 20 is the baseline (rust-lang/rust#145071), we can do all of the quoting in pure Rust code, and pass two flat strings to LLVM to be used as-is.

---

In this PR, my priority has been to preserve the existing behaviour as much as possible, without worrying too much about what the behaviour *should* be. (Though I did avoid a leading space before the first argument.)
2025-09-19 18:32:17 +00:00
Jakub Beránek
4b755141bc
Simplify default value of download-ci-llvm 2025-09-19 20:12:30 +02:00
Marijn Schouten
e2de670558 btree: safety comments for init and new 2025-09-19 17:21:55 +00:00
bors
59043567a5 Auto merge of #146765 - Zalathar:rollup-ewh4s9o, r=Zalathar
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#146229 (Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set)
 - rust-lang/rust#146484 (rustdoc-search: JavaScript optimization based on Firefox Profiler output)
 - rust-lang/rust#146541 (std: simplify host lookup)
 - rust-lang/rust#146615 (rustc_codegen_llvm: Feature Conversion Tidying)
 - rust-lang/rust#146638 (`rustc_next_trait_solver`: canonical out of `EvalCtxt`)
 - rust-lang/rust#146663 (Allow windows resource compiler to be overridden)
 - rust-lang/rust#146691 (std: Fix WASI implementation of `remove_dir_all`)
 - rust-lang/rust#146709 (stdarch subtree update)
 - rust-lang/rust#146738 (Fix tidy spellchecking on Windows)
 - rust-lang/rust#146740 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-19 15:22:22 +00:00
Josh Triplett
3ab89abac4 mbe: Fix feature gate for macro_derive 2025-09-19 23:17:12 +08:00
Chayim Refael Friedman
300aee8239
Merge pull request #20701 from A4-Tacks/track-caller-assist-test
Add `#[track_caller]` for check_assist_by_label
2025-09-19 15:07:17 +00:00
Ralf Jung
04f6b8f992 fix ./x readdir logic when CDPATH is set 2025-09-19 16:48:05 +02:00
Marijn Schouten
e500dd820b fixes for numerous clippy warnings 2025-09-19 14:46:12 +00:00
Jakub Beránek
58814bce6c
Allow running x <cmd> <path> from a different directory 2025-09-19 16:21:34 +02:00
Shoyu Vanilla (Flint)
6ec196a748
Merge pull request #20697 from Oblarg/fix-negative-const-generic-literals
fix negative const generic integer literals
2025-09-19 14:13:54 +00:00
Oblarg
9ba9869b33 address review feedback 2025-09-19 10:03:14 -04:00
Laurențiu Nicola
b1d9569443
Merge pull request #20703 from ShoyuVanilla/remove-chalk-solve
minor: Get rid of unused deps `chalk-solve` and `chalk-recursive`
2025-09-19 13:47:35 +00:00
Shoyu Vanilla
bf5fe6e44c minor: Get rid of unused deps chalk-solve and chalk-recursive 2025-09-19 22:35:46 +09:00
Stuart Cook
5d404e05bc
Rollup merge of #146740 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to 5a142000d2.

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

r? ``@ghost``
2025-09-19 22:31:55 +10:00
Stuart Cook
a2c7008e15
Rollup merge of #146738 - beepster4096:widnows, r=jieyouxu
Fix tidy spellchecking on Windows

Tidy should now check for executable with the right extension for the platform when installing tools
2025-09-19 22:31:55 +10:00
Stuart Cook
e09cc55d2e
Rollup merge of #146709 - a4lg:stdarch-sync-20250917, r=Kobzol
stdarch subtree update

Subtree update of `stdarch` to [rust-lang/stdarch@9f12c1a](9f12c1af60).

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

r? ```@Kobzol```
2025-09-19 22:31:54 +10:00
Stuart Cook
20b6f7596b
Rollup merge of #146691 - alexcrichton:wasip1-remove-dir-all-buffer, r=juntyr
std: Fix WASI implementation of `remove_dir_all`

This commit is a change to the WASI-specific implementation of the `std::fs::remove_dir_all` function. Specifically it changes how directory entries are read of a directory-being-deleted to specifically buffer them all into a `Vec` before actually proceeding to delete anything. This is necessary to fix an interaction with how the WASIp1 `fd_readdir` API works to have everything work out in the face of mutations while reading a directory.

The basic problem is that `fd_readdir`, the WASIp1 API for reading directories, is not a stateful read of a directory but instead a "seekable" read of a directory. Its `cookie` argument enables seeking anywhere within the directory at any time to read further entries. Native host implementations do not have this ability, however, which means that this seeking property must be achieved by re-reading the directory. The problem with this is that WASIp1 has under-specified semantics around what should happen if a directory is mutated between two calls to `fd_readdir`. In essence there's not really any possible implementation in hosts except to read the entire directory and support seeking through the already-read list. This implementation is not possible in the WASIp1-to-WASIp2 adapter that is primarily used to create components for the `wasm32-wasip2` target where it has constrained memory requirements and can't buffer up arbitrarily sized directories. There's some more detailed discussion at https://github.com/bytecodealliance/wasmtime/issues/11701#issuecomment-3299957213 as well.

The WASIp1 API definitions are effectively "dead" now at the standards level meaning that `fd_readdir` won't be changing nor will a replacement be coming. For the `wasm32-wasip2` target this will get fixed once filesystem APIs are updated to use WASIp2 directly instead of WASIp1, making this buffering unnecessary. In essence while this is a hack it's sort of the least invasive thing that works everywhere for now. I don't think this is viable to fix in hosts so guests compiled to wasm are going to have to work around it by not relying on any guarantees about what happens to a directory if it's mutated between reads.
2025-09-19 22:31:53 +10:00
Stuart Cook
743f70b6e8
Rollup merge of #146663 - erickt:win, r=wesleywiser
Allow windows resource compiler to be overridden

In rust-lang/rust#146018, it is now required to provide a resource compiler on windows when compiling rust. This allows toolchain builders to explicitly provide a path to an alternative, such as llvm-rc, instead of the one that's provided by the Windows SDK.

cc ```@lambdageek```
2025-09-19 22:31:53 +10:00
Stuart Cook
aa2bb56ba6
Rollup merge of #146638 - lcnr:canonical-separate-module, r=BoxyUwU
`rustc_next_trait_solver`: canonical out of `EvalCtxt`

we need to canonicalize outside of the trait solver as well, so it's just a lot nicer if canonicalization is more easily accessible

if you review it commit by commit the move is properly shown
2025-09-19 22:31:52 +10:00
Stuart Cook
19211dfd0f
Rollup merge of #146615 - a4lg:codegen-llvm-feature-conversion-tidying, r=workingjubilee
rustc_codegen_llvm: Feature Conversion Tidying

The author thinks we can improve `to_llvm_features`, a function to convert a Rust target feature name into an LLVM feature (or nothing, to ignore features unsupported by LLVM) for better maintainability.

1.  We can simplify some clauses and some expressions.
2.  There are some readability issues.

This PR attempts to resolve some of them by tidying many cases.
2025-09-19 22:31:51 +10:00
Stuart Cook
ff8d63ae43
Rollup merge of #146541 - joboet:simplify-lookup-host, r=tgross35
std: simplify host lookup

The logic for splitting up a string into a hostname and port is currently duplicated across (nearly) all of the networking implementations in `sys`. Since it does not actually rely on any system internals, this PR moves it to the `ToSocketAddr` implementation for `&str`, making it easier to discover and maintain.

On the other hand, the `ToSocketAddr` implementation (or rather the `resolve_socket_addr` function) contained logic to overwrite the port on the socket addresses returned by `LookupHost`, even though `LookupHost` is already aware of the port and sets the port already on Xous. This PR thus removes this logic by moving the responsibility of setting the port to the system-specific `LookupHost` implementation.

As a consequence of these changes, there remains only one way of creating `LookupHost`, hence I've removed the `TryFrom` implementations in favour of a `lookup_host` function, mirroring other, public iterator-based features.

And finally, I've simplified the parsing logic responsible for recognising IP addresses passed to `<(&str, u16)>::to_socket_addrs()` by using the `FromStr` impl of `IpAddr` rather than duplicating the parsing for both IP versions.
2025-09-19 22:31:51 +10:00
Stuart Cook
fe0b51939c
Rollup merge of #146484 - notriddle:stringdex-js-opt, r=GuillaumeGomez
rustdoc-search: JavaScript optimization based on Firefox Profiler output

Part of https://github.com/rust-lang/rust/issues/146048

Preview: https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html

These commits are based on some profiler readings, and should reduce CPU usage for name-based searching.

- The first commit improves warm searches by allocating less garbage when data is already loaded:

  Before: https://profiler.firefox.com/public/wvzd88m8r70p8frvz1z628tv3htwna0b9c0ef10/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11

  After: https://profiler.firefox.com/public/yfe9aq6ep3kacw3zmr7jqn6gv7ckfq86rg89568/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11

- The second commit improves cold searches by delaying load for special type names until type-based search runs

  Before: 5.86s (throttled to "Good 2G" in Dev Tools) <https://doc.rust-lang.org/nightly/std/index.html?search=>

  <img width="2524" height="919" alt="image" src="https://github.com/user-attachments/assets/8dbbbd46-b7ab-4e3c-9e8c-f1e41cfaa968" />

  After: 5.77s (throttled to "Good 2G" in Dev Tools) <https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html?search=>

  <img width="2524" height="912" alt="image" src="https://github.com/user-attachments/assets/6976a584-24f4-4d47-8118-7a81b22d411e" />

  For comparison's sake, the same test takes 12.17s on stable <https://doc.rust-lang.org/1.89.0/std/index.html?search=>

    <img width="2525" height="916" alt="image" src="https://github.com/user-attachments/assets/eb6df2e8-6632-4bef-a6d0-5179c6288fd0" />
2025-09-19 22:31:50 +10:00
Stuart Cook
ac9b55e439
Rollup merge of #146229 - Hayden602:issue-142796-fix, r=ZuseZ4
Automatically switch to lto-fat when flag RUSTFLAGS="- Zautodiff=Enable" is set

…t" is automatically set.

closes: [#142796](https://github.com/rust-lang/rust/issues/142796)
2025-09-19 22:31:49 +10:00
bors
e10aa88911 Auto merge of #145737 - cjgillot:gvn-valueset, r=saethlin
GVN: stop hashing opaque values

GVN generates values that are not meant to be unified with any other. For instance `Opaque` (aka we don't know anything), non-deterministic constants and borrows.

The current algorithm generates a unique index, so the generated `Value` will be different from all the existing. This is wasteful, as we should not hash that `Value` at all.

This PR proposes to do this. This involves partially reimplementing a `FxIndexSet`, but yields a small but consistent perf improvement (https://github.com/rust-lang/rust/pull/145737#issuecomment-3276951054).
2025-09-19 12:15:03 +00:00