304366 Commits

Author SHA1 Message Date
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
Oneirical
2dc4638c46 Add test batch 2 2025-08-27 15:06:05 -04:00
Urgau
a8c837e7ff Disable int_to_ptr_transmutes suggestion for unsized types 2025-08-27 20:36:30 +02:00
Jonathan Brouwer
7db1840569
Changes to the uitests
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-27 20:25:18 +02:00
Jonathan Brouwer
e8d08b5416
Port the #[link] attribute to the new parser 2025-08-27 20:25:16 +02:00
Jonathan Brouwer
aab5e0bf1f
Move NativeLibKind from rustc_session to rustc_hir 2025-08-27 20:24:59 +02: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
Jana Dönszelmann
bf6e99d734
add doc-hidden to exports in attribute prelude 2025-08-27 17:40:23 +02:00
Pavel Grigorenko
e06cd9f2c8 constify (the unstable) str::as_str 2025-08-27 16:26:24 +03:00
Zalathar
113aeac44a Remove several remnants of the old libtest-based executor 2025-08-27 23:15:30 +10:00
Alice Ryhl
dacae07b6d Rename Location::file_with_nul to file_as_c_str 2025-08-27 12:42:49 +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
WANG Rui
0da328b2c6 Add spin_loop hint for LoongArch 2025-08-27 16:40:54 +08:00
Sasha Pourcelot
2736c7461f Use AcceptContext in AttribueParser::check_target 2025-08-27 09:56:20 +02:00
Zalathar
21de27c88a Explicitly mark the end of a failed test's captured output 2025-08-27 17:44:52 +10: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
Jakub Beránek
6864a5bf42
Use std uplifting more often 2025-08-27 08:01:19 +02:00
Jakub Beránek
41563c7d4a
Use compiler_for_std in dist::Std 2025-08-27 07:59:36 +02:00
Jakub Beránek
edcdb80914
Add compiler_for_std 2025-08-27 07:59:36 +02:00
Jakub Beránek
31e900b78f
Add metadata to dist::JsonDocs 2025-08-27 07:59:36 +02:00
Jakub Beránek
c2e5c21223
Add snapshot test for rustc docs 2025-08-27 07:59:33 +02: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
Oneirical
2e659f5894 Add test batch 1 2025-08-27 00:23:26 -04: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
Matthew Maurer
cf8753e4f9 Make lto and linker-plugin-lto work the same for compiler_builtins
Fix #142284 by ensuring that `#![no_builtins]` crates can still emit bitcode
when proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto) is used.
2025-08-26 16:32:29 -07: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