304222 Commits

Author SHA1 Message Date
Jacob Pratt
27d6005f7a
Rollup merge of #145946 - nnethercote:cargo-style, r=jdonszelmann
Remove unnecessary `[dependencies.unicode-properties]` entries.

The Cargo style guide says to put dependencies on a single line if they fit.

r? `@jdonszelmann`
2025-08-27 21:51:54 -04:00
Jacob Pratt
5527156d92
Rollup merge of #145894 - zetanumbers:issue-142949, r=WaffleLapkin
Ensure the coordinator thread terminates before its channels drop

Fixes rust-lang/rust#142949

Explanation: https://github.com/rust-lang/rust/issues/142949#issuecomment-3224573185
2025-08-27 21:51:54 -04:00
Jacob Pratt
64d0d1d668
Rollup merge of #145826 - scrabsha:push-vrpwttmzqwpt, r=jdonszelmann
Use AcceptContext in AttribueParser::check_target
2025-08-27 21:51:53 -04:00
Jacob Pratt
ad42340e39
Rollup merge of #145746 - ivmarkov:fix-nofollow-espidf, r=ibraheemdev
Fix STD build failing for target_os = "espidf"

A regression from rust-lang/rust#142938

cc `@lolbinarycat`
cc `@ibraheemdev`

ESP-IDF (and a few other embedded Tier-3 systems) is considered `cfg(unix)`, but it does not have the `O_NOFOLLOW` flag because neither of its three supported filesystems (FATFS, LitteLF and Spiffs) has symbolic links in the first place.

What this fix does is to keep the `set_permissions_nofollow` method available and non-failing for ESP-IDF, but it behaves as if no `O_NONFOLLOW` was set. This should be fine as there is nothing to follow in the first place, as there are no symbolic links there.

EDIT: Also added the same fix for Horizon, as requested by `@Meziu.`
2025-08-27 21:51:53 -04:00
Jacob Pratt
a1c543e165
Rollup merge of #145382 - winstonallo:reg-struct-return-asm-test, r=tgross35
Add assembly test for `-Zreg-struct-return` option

r? `@tgross35`

As discussed in rust-lang/rust#145309 with `@tgross35` and `@ojeda,` I added assembly tests for the `-Zreg-struct-return` option verifying that it changes the ABI from hidden pointer to register-return on x86_32.

The test covers:
- Direct struct construction, showing register return vs hidden pointer
- External function calls returning structs, showing ABI mismatch handling

Different memory layouts affect ABI mismatch handling, but register returns use the same register allocation regardless of struct field layout (apart from the fact that they use smaller registers for smaller structs, of course).

[Here](https://godbolt.org/z/dcW6rnMG3) is a compiler explorer with 2 examples. Let me know if there is anything more I could add. Since register returns only happen for structs up to the size of 2 registers, I figured testing the pivot value (8 bytes) would be most critical.
2025-08-27 21:51:52 -04:00
Nicholas Nethercote
b4c8fe2b4b Remove unnecessary [dependencies.unicode-properties] entries.
The Cargo style guide says to put dependencies on a single line if they
fit.
2025-08-28 08:08:40 +10:00
bors
cdb45c87e2 Auto merge of #145851 - lolbinarycat:rustdoc-optimize, r=GuillaumeGomez
rustdoc: a few micro-optimizations targeted at build_impl

Unsure if these will be anything substantial, but the first one at least should git rid of quite a few branches, second one unsure if it's worth it.

r? `@GuillaumeGomez`
2025-08-27 19:23:30 +00:00
winstonallo
5f39612e7a
Add assembly tests verifying the functionality of -Zreg-struct-return for structs of different sizes.
This test covers:
* The callee side, making sure that the structs are correctly loaded into registers when `-Zreg-struct-return` is enabled
* The caller side, making sure that callers do receive returned structs in registers when `-Zreg-struct-return` is enabled

Structs of the size of up to 2 registers (8 bytes) can be returned in registers in x86_32.
Therefore, the tests are done with 3 different struct sizes:
* 2 bytes (register returns should happen)
* 8 bytes (last value where register returns should happen)
* 12 bytes (register returns should not happen even when `-Zreg-struct-return` is enabled)
2025-08-27 20:17:08 +02:00
bors
d829133816 Auto merge of #145909 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

3 commits in 623d536836b4cde09ce38609232a024d5b25da81..a6c58d43051d01d83f55a3e61ef5f5b2b0dd6bd9
2025-08-22 19:05:52 +0000 to 2025-08-26 23:05:12 +0000
- test: avoid hardcoded target spec json (rust-lang/cargo#15880)
- test(add): Cover some frontmatter corner cases (rust-lang/cargo#15886)
- Add more context to publish-failed error message (rust-lang/cargo#15879)

r? ghost
2025-08-27 15:41:45 +00:00
bors
3c91be712d Auto merge of #145923 - matthiaskrgr:rollup-rkejtos, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#144274 (add Option::reduce)
 - rust-lang/rust#145562 (Simplify macro generating ToString implementations for `&…&str`)
 - rust-lang/rust#145625 (improve float to_degrees/to_radians rounding comments and impl)
 - rust-lang/rust#145740 (Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml`)
 - rust-lang/rust#145885 (Inherit TCC in debuginfo tests on macOS)
 - rust-lang/rust#145905 (Stop calling unwrap when format foreign has trailing dollar)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-27 12:35:21 +00:00
Matthias Krüger
bd90013b39
Rollup merge of #145905 - TaKO8Ki:fix-137580, r=nnethercote
Stop calling unwrap when format foreign has trailing dollar

Fixes rust-lang/rust#137580
2025-08-27 11:26:52 +02:00
Matthias Krüger
ecb377fc4a
Rollup merge of #145885 - madsmtm:lldb-inherit-tcc, r=Kobzol
Inherit TCC in debuginfo tests on macOS

macOS has a system for propagating folder permissions, which LLDB disables when spawning processes, which in turn causes debuginfo tests to spam the user with repeated pop-ups asking for permissions. See the code comment for details, as well as the following video for an example of how this looks in practice:

https://github.com/user-attachments/assets/1e54f5b8-9130-4b59-8e92-1db1e58fb361

I stumbled upon the incantation to fix this (`settings set target.inherit-tcc true`) while investigating slowdowns when spawning newly created binaries due to XprotectService, see [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/build.20scripts.20slow.20on.20macOS.3F).

This would allow me to no longer have a `build.build-dir = "/Users/madsmtm/rust-build"` workaround in my `bootstrap.toml`.
2025-08-27 11:26:51 +02:00
Matthias Krüger
693d5eaff8
Rollup merge of #145740 - nnethercote:workspace-members, r=Kobzol
Introduce a `[workspace.dependencies`] section in the top-level `Cargo.toml`

It lets us avoid a lot of repetition of crate versions, etc.

I've just done a few as a start. Many more can be done in follow-ups.

r? `@Kobzol`
2025-08-27 11:26:50 +02:00
Matthias Krüger
c0cd29ed66
Rollup merge of #145625 - karolzwolak:f16-use-expr-instead-literal, r=beetrees,tgross35
improve float to_degrees/to_radians rounding comments and impl

This PR makes `to_degrees()` and `to_radians()` float functions more consistent between each other and improves comments around their precision and rounding.

* revise comments explaining why we are using literal or expression
* add unspecified precision comments as we don't guarantee precision
* use expression in `f128::to_degrees()`
* make `f64::to_degrees()` impl consistent with other functions

r? `@tgross35`
2025-08-27 11:26:50 +02:00
Matthias Krüger
f2eb47a81b
Rollup merge of #145562 - tbu-:pr_simplify_to_string_spec, r=tgross35
Simplify macro generating ToString implementations for `&…&str`

Use deref coercion to let the compiler remove any amount of references. Also use that macro for `Cow` and `String`.
2025-08-27 11:26:49 +02:00
Matthias Krüger
1e90922864
Rollup merge of #144274 - Qelxiros:option-reduce, r=tgross35
add Option::reduce

Tracking issue: rust-lang/rust#144273
2025-08-27 11:26:48 +02:00
bors
b2dd217dd0 Auto merge of #140737 - amandasystems:revised-constraint-search, r=lcnr
Region inference: Use outlives-static constraints in constraint search

Revise the extra `r: 'static` constraints added upon universe issues to add an explanation, and use that explanation during constraint blame search. This greatly simplifies the region inference logic, which now does not need to reverse-engineer the event that caused a region to outlive `'static`.

This cosmetically changes the output of two UI tests. I blessed them i separate commits with separate motivations, but that can of course be squashed as desired. We probably want that.

The PR was extracted out of rust-lang/rust#130227 and consists of one-third of its functional payload.

r? lcnr
2025-08-27 09:25:46 +00:00
Sasha Pourcelot
2736c7461f Use AcceptContext in AttribueParser::check_target 2025-08-27 09:56:20 +02:00
bors
4f808ba6bf Auto merge of #145916 - matthiaskrgr:rollup-cnvhq2z, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#142215 (Use -Zmir-opt-level=0 in tests for MIR building)
 - rust-lang/rust#143341 (Mention that casting to *const () is a way to roundtrip with from_raw_parts)
 - rust-lang/rust#145078 (Fix wrong cache line size of riscv64)
 - rust-lang/rust#145290 (Improve std::fs::read_dir docs)
 - rust-lang/rust#145335 (Move WTF-8 code from std into core and alloc)
 - rust-lang/rust#145904 (Move `riscv64-gc-unknown-linux-musl` from Tier 2 with Host tools to Tier 2)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-27 06:15:42 +00:00
Matthias Krüger
5fdc8406ee
Rollup merge of #145904 - Kobzol:riscv-musl-platform-support, r=jieyouxu
Move `riscv64-gc-unknown-linux-musl` from Tier 2 with Host tools to Tier 2

It is not shipped with host tools, so it was located in the wrong group. The musl target is [here](467c89cd0b/src/ci/docker/host-x86_64/dist-various-2/Dockerfile (L126)) - no host tools.

Noticed in https://github.com/rust-lang/docker-rust/pull/247.
2025-08-27 07:45:57 +02:00
Matthias Krüger
62e5341661
Rollup merge of #145335 - clarfonthey:wtf8-core-alloc, r=Mark-Simulacrum
Move WTF-8 code from std into core and alloc

This is basically a small portion of rust-lang/rust#129411 with a smaller scope. It *does not*\* affect any public APIs; this code is still internal to the standard library. It just moves the WTF-8 code into `core` and `alloc` so it can be accessed by `no_std` crates like `backtrace`.

> \* The only public API this affects is by adding a `Debug` implementation to `std::os::windows::ffi::EncodeWide`, which was not present before. This is due to the fact that `core` requires `Debug` implementations for all types, but `std` does not (yet) require this. Even though this was ultimately changed to be a wrapper over the original type, not a re-export, I decided to keep the `Debug` implementation so it remains useful.

Like we do with ordinary strings, the tests are still located entirely in `alloc`, rather than splitting them into `core` and `alloc`.

----

Reviewer note: for ease of review, this is split into three commits:

1. Moving the original files into their new "locations"
2. Actually modifying the code to compile.
3. Removing aesthetic changes that were made so that the diff for commit 2 was readable.

You can review commits 1 and 3 to verify these claims, but commit 2 contains the majority of the changes you should care about.

----

API changes: `impl Debug for std::os::windows::ffi::EncodeWide`
2025-08-27 07:45:56 +02:00
Matthias Krüger
bc9655a7c8
Rollup merge of #145290 - ntc2:patch-1, r=joshtriplett,tgross35
Improve std::fs::read_dir docs

Call out early that the results returned can differ across calls / aren't deterministic. This was already mentioned at the bottom of examples, but I think it's worth calling out early, since this caused at least one person (me!) great confusion.
2025-08-27 07:45:55 +02:00
Matthias Krüger
7879cbbbff
Rollup merge of #145078 - minxuanz:riscv-cacheline, r=samueltardieu
Fix wrong cache line size of riscv64

see https://go-review.googlesource.com/c/go/+/526659,  All of riscv CPU using 64B for cache-line size.
2025-08-27 07:45:55 +02:00
Matthias Krüger
0c02bdc901
Rollup merge of #143341 - Manishearth:from-raw-parts-ptr-cast, r=samueltardieu
Mention that casting to *const () is a way to roundtrip with from_raw_parts

See discussion on rust-lang/rust#81513
2025-08-27 07:45:54 +02:00
Matthias Krüger
e420e45d55
Rollup merge of #142215 - saethlin:mir-building-tests, r=cjgillot
Use -Zmir-opt-level=0 in tests for MIR building

The mir-opt test suite currently defaults all tests in it to `-Zmir-opt-level=4`, so if a test is trying to test MIR _building_ not optimizations and it is in that directory, it _must_ override the default mir-opt-level.
2025-08-27 07:45:53 +02:00
Takayuki Maeda
2c361f8267 remove old crash test 2025-08-27 14:39:33 +09:00
Nathan Collins
0b4f9783f0 Improve std::fs::read_dir docs
Call out early that the results returned can differ across calls /
aren't deterministic. This was already mentioned at the bottom of
examples, but I think it's worth calling out early, since this caused at
least one person (me!) great confusion.

[ Added a comma to the docs, reflowed commit message - Trevor ]
2025-08-27 04:58:02 +00:00
Nicholas Nethercote
200f56d605 Add itertools to [workspace.dependencies]. 2025-08-27 14:21:21 +10:00
Nicholas Nethercote
c50d2cc807 Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
Nicholas Nethercote
32b0fff8fe Add rustc-literal-escaper to [workspace.dependencies]. 2025-08-27 13:59:32 +10:00
Nicholas Nethercote
dfa748e910 Add memchr to [workspace.dependencies]. 2025-08-27 13:59:32 +10:00
Nicholas Nethercote
82c4b9c51b Add bitflags to [workspace.dependencies]. 2025-08-27 13:59:32 +10:00
Nicholas Nethercote
777e2d6a2a Add thin-vec to newly added [workspace.dependencies]. 2025-08-27 13:59:32 +10:00
Ben Kimock
22cdf214bb Use -Zmir-opt-level=0 in tests for MIR building 2025-08-26 23:42:38 -04:00
bors
269d5b56bc Auto merge of #144841 - cjgillot:typeck-no-attrs, r=davidtwco
Access less HIR attributes from typeck

Typeck relies on attributes to modify its own behaviour. This is a problem, as this means that `typeck(some function)` may depend on the span and doc-comments of many other functions.

This PR attempts to reduce such accesses to attributes. This yields to a sizeable perf improvement: https://github.com/rust-lang/rust/pull/144841#issuecomment-3153339771

Fixes https://github.com/rust-lang/rust/issues/124352
2025-08-27 01:11:24 +00:00
Weihang Lo
346e195c74
Update cargo submodule 2025-08-26 21:00:10 -04:00
bors
176d8dbce6 Auto merge of #145906 - samueltardieu:rollup-p8ibzhz, r=samueltardieu
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#144499 (ci: Begin running ui tests with `rust.debuginfo-level-tests=1`)
 - rust-lang/rust#145790 (Improve dist for gnullvm hosts)
 - rust-lang/rust#145792 (Use attribute name in message for "outer attr used as inner attr" errors)
 - rust-lang/rust#145840 (rustc_codegen_ssa: More comprehensive RISC-V ELF flags)
 - rust-lang/rust#145876 (Enable building/disting standard library in stage 0)
 - rust-lang/rust#145887 (bootstrap: Don't panic if codegen-backends is set to empty)
 - rust-lang/rust#145888 (platform-support: Fix LoongArch32 host column)
 - rust-lang/rust#145892 (add a flag to codegen fn attrs for foreign items)
 - rust-lang/rust#145901 (Fix typo in comment of library/alloc/src/raw_vec/mod.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-08-26 22:03:48 +00:00
Samuel Tardieu
cefa84aeac
Rollup merge of #145901 - stoeckmann:raw_vec_typo, r=samueltardieu
Fix typo in comment of library/alloc/src/raw_vec/mod.rs

Turn "any heap allocators" into "any heap allocator".

Shoutout to [Let's Read OSS](https://github.com/stoeckmann/lets-read-oss).
2025-08-26 23:25:06 +02:00
Samuel Tardieu
fe5890e481
Rollup merge of #145892 - jdonszelmann:codegen-fn-attrs-foreign-item, r=bjorn3
add a flag to codegen fn attrs for foreign items

r? `@ghost`

refiled to rerun CI
2025-08-26 23:25:05 +02:00
Samuel Tardieu
e0059784d5
Rollup merge of #145888 - heiher:fix-platform-support-loong32, r=jieyouxu
platform-support: Fix LoongArch32 host column
2025-08-26 23:25:05 +02:00
Samuel Tardieu
e84b35478b
Rollup merge of #145887 - GuillaumeGomez:bootstrap-codegen-backends, r=Kobzol
bootstrap: Don't panic if codegen-backends is set to empty

It fixes a bug we encountered in our last GCC backend sync: https://github.com/rust-lang/rustc_codegen_gcc/actions/runs/17214525469/job/48834700055?pr=753#step:18:595

In short, we used to have in `bootstrap.toml` an empty `rust.codegen-backends = []`, triggering the `unwrap`. We fixed it in ad99858fd9.

r? `@Kobzol`
2025-08-26 23:25:04 +02:00
Samuel Tardieu
5ba3bfc49a
Rollup merge of #145876 - Kobzol:dist-std-build, r=jieyouxu
Enable building/disting standard library in stage 0

After the stage0 redesign, building a stage0 library no longer is a thing, because the stage0 compiler normally cannot build libstd anymore. However, there are valid use-cases for having the ability to quickly cross-compile libstd for different targets, when the stage0 compiler is e.g. a stable released version, and you want to cross-compile libstd from the same sources of that compiler.

This PR allows that, as long as you set `build.local-rebuild = true`, which promises bootstrap that the stage0 compiler actually comes from in-tree sources, and can thus compile libstd.

The change needed to enable this is very minimal, so I think that it is worth it to allow this use-case to work.

Fixes: https://github.com/rust-lang/rust/issues/145587
Fixes: https://github.com/rust-lang/rust/issues/145859
Related issue: https://github.com/rust-lang/rust/issues/94781

r? `@jieyouxu`
2025-08-26 23:25:03 +02:00
Samuel Tardieu
ac7f423d52
Rollup merge of #145840 - a4lg:riscv-elf-flags-for-internal-objs, r=WaffleLapkin
rustc_codegen_ssa: More comprehensive RISC-V ELF flags

This change implements more conformant, more comprehensive RISC-V ELF flags handling when generating certain object files directly from rustc.

*   Use `"zca"` instead of `"c"`
    The "Zca" extension (a subset of "C") is the minimal configuration for compressed instructions to set `EF_RISCV_RVC` flag.
*   Set TSO flag from `"ztso"`
    The "Ztso" extension denotes that the program depends on the RVTSO (Total Store Ordering) memory consistency model, which is stronger than the standard RVWMO (Weak Memory Ordering) consistency model and on ELF targets, we need to set `EF_RISCV_TSO` flag.
2025-08-26 23:25:02 +02:00
Samuel Tardieu
fbf247dd31
Rollup merge of #145792 - scrabsha:push-umpytyxunpxq, r=jdonszelmann
Use attribute name in message for "outer attr used as inner attr" errors
2025-08-26 23:25:02 +02:00
Samuel Tardieu
87ab2c8355
Rollup merge of #145790 - mati865:gnullvm-improve-dist, r=Kobzol
Improve dist for gnullvm hosts

LLVM tools cross-compilation has been fixed by rust-lang/rust#145763 and LLVM downloading from CI no longer causes build error, so let's enable them both.
2025-08-26 23:25:01 +02:00
Samuel Tardieu
a4924f0132
Rollup merge of #144499 - Enselic:ci-debuginfo-level-tests, r=davidtwco
ci: Begin running ui tests with `rust.debuginfo-level-tests=1`

To reduce risk of regressing on generating debuginfo e.g. in the form of ICE:s. This will also ensure that future ui tests work with different debuginfo levels. See https://github.com/rust-lang/rust/issues/61117.

When I looked at run time for different CI jobs, **x86_64-gnu-debug** was far from the bottleneck, so it should be fine to make it perform more work.

A handful of tests are failing so we need to force debuginfo=0 on those for now.

We'll start small with debuginfo=1. We'll step up to debuginfo=2 once most (all?) tests can handle debuginfo=1. There are more failures with debuginfo=2 than with debuginfo=1.
2025-08-26 23:25:01 +02:00
Jakub Beránek
f27e0c10ae
Move riscv64-gc-unknown-linux-musl from Tier 2 with Host tools to Tier 2
It is not shipped with host tools, so it was located in the wrong group.
2025-08-26 23:21:01 +02:00
Takayuki Maeda
adddae6536 stop returning errors when format foreign has trailing dollar 2025-08-27 06:06:11 +09:00
Tobias Stoeckmann
45296bb633 Fix typo in comment
Turn "any heap allocators" into "any heap allocator".
2025-08-26 22:58:44 +02:00
Jakub Beránek
5cf9c130f3
Enable building/disting standard library in stage 0 2025-08-26 22:29:17 +02:00