Commit graph

305028 commits

Author SHA1 Message Date
Matthias Krüger
cb8b5fa4e2
Rollup merge of #146254 - yotamofek:pr/itertools-all-equal-value, r=cjgillot
Use `Itertools::all_equal_value()` where applicable

Just a small cleanup.
We already have `itertools` as a dep in these crates, so might as well use another of its features.
Makes the code simpler IMHO :)
2025-09-07 08:18:59 +02:00
bors
f4b2f68e04 Auto merge of #146285 - matthiaskrgr:rollup-oaokoo3, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#146200 (Simplify rustdoc-gui tester by calling directly browser-ui-test)
 - rust-lang/rust#146236 (gpu offload: change suspicious map into filter)
 - rust-lang/rust#146240 (DynamicConfig: use canonical clone impl)
 - rust-lang/rust#146251 (rustc_middle: clippy fixes)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-07 01:04:57 +00:00
Matthias Krüger
019486082d
Rollup merge of #146251 - hkBst:clippy-fix-8, r=cjgillot
rustc_middle: clippy fixes

Fixes for:
```text
warning: bound is defined in more than one place
warning: empty line after doc comment
```
2025-09-06 23:49:54 +02:00
Matthias Krüger
bb27a2b93d
Rollup merge of #146240 - hkBst:query-1, r=cjgillot
DynamicConfig: use canonical clone impl

Fixes clippy warning:
```text
warning: non-canonical implementation of `clone` on a `Copy` type
  --> compiler/rustc_query_impl/src/lib.rs:60:29
   |
60 |       fn clone(&self) -> Self {
   |  _____________________________^
61 | |         DynamicConfig { dynamic: self.dynamic }
62 | |     }
   | |_____^ help: change this to: `{ *self }`
```
2025-09-06 23:49:54 +02:00
Matthias Krüger
1123d49090
Rollup merge of #146236 - hkBst:gpu-1, r=ZuseZ4
gpu offload: change suspicious map into filter

Fixes clippy warning:
```text
warning: this call to `map()` won't have an effect on the call to `count()`
   --> compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs:194:25
    |
194 |       let num_ptr_types = types
    |  _________________________^
195 | |         .iter()
196 | |         .map(|&x| matches!(cx.type_kind(x), rustc_codegen_ssa::common::TypeKind::Pointer))
197 | |         .count();
    | |________________^
    |
    = help: make sure you did not confuse `map` with `filter`, `for_each` or `inspect`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_map
    = note: `-W clippy::suspicious-map` implied by `-W clippy::suspicious`
    = help: to override `-W clippy::suspicious` add `#[allow(clippy::suspicious_map)]`
```
2025-09-06 23:49:53 +02:00
Matthias Krüger
4b9b0265a0
Rollup merge of #146200 - GuillaumeGomez:simplify-rustdoc-gui-tests, r=lolbinarycat
Simplify rustdoc-gui tester by calling directly browser-ui-test

The output and handling of `browser-ui-test` is now mostly the same as we did manually, so no need to keep our wrapper anymore. Lot of code removed! \o/

r? `@lolbinarycat`
2025-09-06 23:49:53 +02:00
bors
76863e3404 Auto merge of #146282 - tgross35:rollup-0n5tjnm, r=tgross35
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#139524 (Add socket extensions for cygwin)
 - rust-lang/rust#145940 (single buffer for exponent fmt of integers)
 - rust-lang/rust#146206 (identity uses are ok, even if there are no defining uses)
 - rust-lang/rust#146272 (Update comment for `-Werror` on LLVM builds)
 - rust-lang/rust#146280 (Make `LetChainsPolicy` public for rustfmt usage)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-06 21:47:58 +00:00
Trevor Gross
f338542c42
Rollup merge of #146280 - mohe2015:public-for-rustfmt-forks, r=lqd
Make `LetChainsPolicy` public for rustfmt usage

Related to https://github.com/rust-lang/rust/pull/138511. To call `Parser::parse_expr_cond` from [rustfmt forks for custom macro formatting](30c83df9e1/src/parse/macros/html.rs (L57)) you need to pass this enum so it would be nice if it could be public.

Thank you.
2025-09-06 14:39:06 -04:00
Trevor Gross
865c99a092
Rollup merge of #146272 - rperier:rustc_llvm_werror_remove_commment_llvm22, r=tgross35
Update comment for `-Werror` on LLVM builds

cc rust-lang/rust#109712

see https://github.com/rust-lang/rust/issues/109712#issuecomment-3257474643
2025-09-06 14:39:05 -04:00
Trevor Gross
d3d5c7f9bd
Rollup merge of #146206 - lcnr:fix-non-defining-uses, r=BoxyUwU
identity uses are ok, even if there are no defining uses

fix rust-lang/rust#146191

I've tried moving the "is this an identity use" check to `fn clone_and_resolve_opaque_types` and this would allow the following code to compile as it now ignores `Opaque<'!a> = Opaque<'!a>` while they previously resulted in errors 71289c378d/tests/ui/type-alias-impl-trait/hkl_forbidden.rs (L42-L46)

The closure signature gets inferred to `for<'a> fn(&'a ()) -> Inner<'a>`. The closure then has a defining use `Inner<'a_latbound> = &'a_latebound ()` while the parent function has a non-defining `Inner<'!a> = Inner<'!a>`. By eagerly discarding identity uses we don't error on the non-defining use in the parent.

r? `@BoxyUwU`
2025-09-06 14:39:05 -04:00
Trevor Gross
ebde667698
Rollup merge of #145940 - pascaldekloe:int-exp-tune, r=tgross35
single buffer for exponent fmt of integers

No need for fragmented buffers when formatting.

```
orig.txt: fmt::write_i128_exp                                                  143.39ns/iter      +/- 0.32
orig.txt: fmt::write_i64_exp                                                    68.72ns/iter      +/- 0.03
new.txt:  fmt::write_i128_exp                                                  138.29ns/iter      +/- 0.50
new.txt:  fmt::write_i64_exp                                                    58.93ns/iter      +/- 4.62
```

This patch fully eliminates unsafe pointer use (after rust-lang/rust#135265 and rust-lang/rust#136594).

    r? libs
2025-09-06 14:39:04 -04:00
Trevor Gross
31d7cbc371
Rollup merge of #139524 - Berrysoft:cygwin-socket-ext, r=tgross35
Add socket extensions for cygwin

r? `@joboet`

* Abstract name uds addr
* quickack
* passcred
2025-09-06 14:39:04 -04:00
bors
1ed3cd7030 Auto merge of #146233 - jieyouxu:run-make-fission, r=Kobzol
Split `run-make` into two {`run-make`,`run-make-cargo`} test suites

## Summary

Split `tests/run-make` into two test suites, to make it faster and more convenient for contributors to run run-make tests that do not need in-tree `cargo`.

| New test suites        | Explanation                                                                                                                                                                                                                              |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `tests/run-make`       | The "fast path" test suite intended for run-make tests that do not need in-tree `cargo`. These tests may not use `cargo`.                                                                                                                |
| `tests/run-make-cargo` | The "slow path" test suite that requires checking out `cargo` submodule and building in-tree `cargo`, and thus will have access to in-tree `cargo`. In practice, these constitute a very small portion of the original `run-make` tests. |

This PR carries out [MCP 847: Split run-make test suite into slower-building test suite with suitably-staged cargo and faster-building test suite without cargo](https://github.com/rust-lang/compiler-team/issues/847).
Fixes rust-lang/rust#135573 (for the tests that do not need in-tree `cargo`).
Fixes rust-lang/rust#134109.

## Remarks

- I considered if we want to split by in-tree tools previously. However, as discussed rust-lang/rust#134109, in practice `rustdoc` is not very slow to build, but `cargo` takes a good few minutes. So, the partition boundary was determined to be along in-tree `cargo` availability.
- The `run-make` tests previously that wanted to use `cargo` cannot just use the bootstrap `cargo`, otherwise they would run into situations where bootstrap `cargo` can significantly diverge from in-tree `cargo` (see https://github.com/rust-lang/rust/pull/130642).

---

try-job: aarch64-msvc-1
try-job: test-various
try-job: x86_64-gnu-debug
try-job: aarch64-gnu-debug
try-job: aarch64-apple
try-job: dist-various-1
2025-09-06 18:37:35 +00:00
Guillaume Gomez
b0a8e3c767 Simplify rustdoc-gui tester by calling directly browser-ui-test 2025-09-06 20:34:26 +02:00
Guillaume Gomez
90133349ea Update browser-ui-test version to 0.22.0 2025-09-06 20:33:37 +02:00
Moritz Hedtke
7fada167f9 Make LetChainsPolicy public for rustfmt usage 2025-09-06 18:01:31 +02:00
bors
bea625f327 Auto merge of #146232 - bjorn3:lto_allocator_shim, r=lqd
Make the allocator shim participate in LTO again

This is likely the cause of the perf regression in https://github.com/rust-lang/rust/pull/145955. It also caused some functional regressions.

Fixes https://github.com/rust-lang/rust/issues/146235
Fixes https://github.com/rust-lang/rust/issues/146239
2025-09-06 15:21:16 +00:00
Romain Perier
6c4e958fad Update comment for werror on rust-lang/rust CI explaining why we keep MSVC definitively excluded 2025-09-06 16:39:49 +02:00
lcnr
381b3267ae identity uses are ok, even if there are no defining uses 2025-09-06 16:05:31 +02:00
bjorn3
2cf94b92ca Ensure fat LTO doesn't merge everything into the allocator module 2025-09-06 13:31:41 +00:00
bjorn3
9239d141dc Add test that __rg_oom doesn't get internalized during LTO
Co-Authored-By: Rémy Rakic <remy.rakic+github@gmail.com>
2025-09-06 13:31:41 +00:00
Berrysoft
26b1575722 Add socket extensions for cygwin 2025-09-06 20:23:37 +08:00
bors
6d5caf3a4a Auto merge of #146267 - matthiaskrgr:rollup-tbz7shx, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#127316 (move pinned version from tracing_core to tracing)
 - rust-lang/rust#144801 (Suggest bounds in more cases, accounting for type parameters referenced in predicate)
 - rust-lang/rust#146211 (Disallow shebang in `--cfg` and `--check-cfg` arguments)
 - rust-lang/rust#146263 (Fix `bump-stage0` build failure, and check-build `bump-stage0` in CI)
 - rust-lang/rust#146266 (miri std tests: skip all of sys::)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-06 12:10:21 +00:00
Matthias Krüger
6f5fad5dad
Rollup merge of #146266 - RalfJung:miri-nosys, r=jieyouxu
miri std tests: skip all of sys::

Matches https://github.com/rust-lang/miri-test-libstd/pull/104
2025-09-06 13:03:17 +02:00
Matthias Krüger
8fe82a0e9e
Rollup merge of #146263 - jieyouxu:check-bump-stage0, r=Kobzol
Fix `bump-stage0` build failure, and check-build `bump-stage0` in CI

This PR bumps the `toml` dependency of the `bump-stage0` tool to `0.8.23`, which AFAICT is the highest `toml` version that's present in the r-l/r workspace's `Cargo.lock` already (so we don't introduce _another_ `toml 0.x.*` series). I added some byte-buffer-to-string intermediary to workaround `toml 0.8.*` not having the `toml 0.9.*` `toml::from_slice` API.

To catch obvious build failures of the `src/tools/bump-stage0` tool early, before we find out it can't even build when we really need it to work.

Contexts:

- https://github.com/rust-lang/rust/pull/146250#issue-3388327410
- [#t-release > Bump stage0 rustfmt separately ("one-off") @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/Bump.20stage0.20rustfmt.20separately.20.28.22one-off.22.29/near/537916615)

Fixes rust-lang/rust#146252.
2025-09-06 13:03:17 +02:00
Matthias Krüger
a0c5e6b041
Rollup merge of #146211 - Urgau:cfg-disallow-shebang, r=fmease
Disallow shebang in `--cfg` and `--check-cfg` arguments

This PR is similar to https://github.com/rust-lang/rust/issues/146130, where we disallowed frontmatter in `--cfg` and `--check-cfg` arguments. While fixing the other one we also discovered that shebang `#!/usr/bin/shebang` are currently also allowed in `--cfg` and `--check-cfg` arguments.

Allowing shebang in them (which are just ignored) was never intended, this PR fixes that by not stripping shebang for `--cfg` and `--check-cfg` arguments.

This is technically a breaking-change, although I don't expect anyone to actually rely on this unintended behavior.

Fixes https://github.com/rust-lang/rust/issues/146130#issuecomment-3246299499
r? fmease
2025-09-06 13:03:16 +02:00
Matthias Krüger
bc0dfaa048
Rollup merge of #144801 - estebank:issue-144734, r=spastorino
Suggest bounds in more cases, accounting for type parameters referenced in predicate

Use a `ty::Visitor` to see if the failed predicate references a type parameter. If it does, then we only suggest adding a bound to an (associated) item only if the referenced parameter is present in its generics.

Provide adding bound suggestion in trait and impl associated functions in cases we previously weren't:

```
error[E0277]: `?` couldn't convert the error to `ApplicationError`
  --> $DIR/suggest-complex-bound-on-method.rs:18:16
   |
LL |         t.run()?;
   |           -----^ the trait `From<<T as Trait>::Error>` is not implemented for `ApplicationError`
   |           |
   |           this can't be annotated with `?` because it has type `Result<_, <T as Trait>::Error>`
   |
note: `ApplicationError` needs to implement `From<<T as Trait>::Error>`
  --> $DIR/suggest-complex-bound-on-method.rs:12:1
   |
LL | enum ApplicationError {
   | ^^^^^^^^^^^^^^^^^^^^^
   = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
   |
LL |     fn thing<T: Trait>(&self, t: T) -> Result<(), ApplicationError> where ApplicationError: From<<T as Trait>::Error> {
   |                                                                     +++++++++++++++++++++++++++++++++++++++++++++++++
```

Fix rust-lang/rust#144734.
2025-09-06 13:03:15 +02:00
Matthias Krüger
020edbe4cf
Rollup merge of #127316 - klensy:tracing-bump, r=Kobzol
move pinned version from tracing_core to tracing

This PR removes pin from `tracing-core` and moves it to `tracing`, which regressed perf in > 0.1.37 versions.
2025-09-06 13:03:15 +02:00
Ralf Jung
9fc8374c2c miri std tests: skip all of sys:: 2025-09-06 11:07:19 +02:00
bjorn3
0271359768 Make the allocator shim participate in LTO again 2025-09-06 08:35:55 +00:00
Jieyou Xu
312a1240a3
ci: check src/tools/bump-stage0 in pr-check-2
To catch obvious build failures of the `src/tools/bump-stage0` early,
before we find out it can't even build when we really need it to work.
2025-09-06 16:33:12 +08:00
Jieyou Xu
d5e61216a7
bootstrap: add check step for src/tools/bump-stage0 2025-09-06 16:33:11 +08:00
Jieyou Xu
5f372fe7d1
bump-stage0: pick highest common toml version, add a workaround
- We pick the higest common `toml` version used in the r-l/r workspace
  to avoid introducing Yet Another `toml` `0.x` version, which happens
  to be `0.8.23` as of the time of writing.
- We introduce a byte-buffer-to-string workaround for the `toml 0.8.*`
  series that do not have the `toml 0.9.*` series's `toml::from_slice`
  API yet. Not efficient, but this is not perf-critical so it's fine.
2025-09-06 16:33:11 +08:00
bors
0d0f4eac8b Auto merge of #146253 - Kobzol:cargo-lto, r=jieyouxu
Optimize Cargo with LTO

This optimization was "lost" when Cargo was switched away from a `ToolRustcPrivate` to a `ToolTarget` tool.

r? `@jieyouxu`
2025-09-06 06:43:38 +00:00
bors
397f933629 Auto merge of #146071 - npmccallum:cleanup, r=fmease
clean up some old const trait impl syntax

Related to: https://github.com/rust-lang/rust/issues/143874
2025-09-06 03:27:14 +00:00
Nathaniel McCallum
00fcb14e4e
clean up some old const trait impl syntax 2025-09-06 04:35:52 +02:00
bors
545819dbd2 Auto merge of #146258 - tgross35:rollup-4hqggwa, r=tgross35
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#146199 (Document Cargo with in-tree rustdoc)
 - rust-lang/rust#146257 (std: Update `wasi` crate dependency)

Failed merges:

 - rust-lang/rust#146200 (Simplify rustdoc-gui tester by calling directly browser-ui-test)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-06 00:11:48 +00:00
Trevor Gross
e2698f8c36
Rollup merge of #146257 - alexcrichton:update-wasi-crate, r=tgross35
std: Update `wasi` crate dependency

The recent work on the WASIp2 target being integrated into the standard library (rust-lang/rust#146207, rust-lang/rust#145944) ended up causing a bug in nightly on the target. This [has now been fixed](https://github.com/bytecodealliance/wasi-rs/pull/115) in the `wasi` crate so this commit pulls in the updated version to ensure bindings work correctly.
2025-09-05 20:10:01 -04:00
Trevor Gross
14415c75ad
Rollup merge of #146199 - Kobzol:bootstrap-cargo-doc, r=jieyouxu
Document Cargo with in-tree rustdoc

Fixes https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/nightly.20rust.20doc.20seem.20corrupted.

r? `@jieyouxu`

try-job: dist-x86_64-linux-alt
2025-09-05 20:10:00 -04:00
Alex Crichton
874dbd5d57 std: Update wasi crate dependency
The recent work on the WASIp2 target being integrated into the standard
library ended up causing a bug in nightly on the target. This has now
been fixed in the `wasi` crate so this commit pulls in the updated
version to ensure bindings work correctly.
2025-09-05 17:01:07 -07:00
Urgau
d224d3a8fa Disallow shebang in --cfg and --check-cfg arguments 2025-09-06 00:21:04 +02:00
bors
6c699a3723 Auto merge of #146255 - fmease:rollup-1v0kp8i, r=fmease
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#138944 (Add `__isPlatformVersionAtLeast` and `__isOSVersionAtLeast` symbols)
 - rust-lang/rust#139113 (unstable book: in a sanitizer example, check the code)
 - rust-lang/rust#145735 (style-guide: Document absence of trailing whitespace)
 - rust-lang/rust#146041 (tidy: --bless now makes escheck run with --fix)
 - rust-lang/rust#146144 (compiler: Apply target features to the entry function)
 - rust-lang/rust#146225 (Simplify `{f16, f32, f64, f128}::midpoint()`)
 - rust-lang/rust#146234 (change file-is-generated doc comment to inner)
 - rust-lang/rust#146241 (rustc_infer: change top-level doc comment to inner)
 - rust-lang/rust#146242 (Ensure that `--html-after-content` option is used to check `scrape_examples_ice` rustdoc GUI test)
 - rust-lang/rust#146243 (remove couple of redundant clones)
 - rust-lang/rust#146250 (Bump stage0 rustfmt)

Failed merges:

 - rust-lang/rust#146200 (Simplify rustdoc-gui tester by calling directly browser-ui-test)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-05 20:49:13 +00:00
León Orell Valerian Liehr
55a62d57ed
Rollup merge of #146250 - fmease:bump-stage0-rustfmt, r=Mark-Simulacrum
Bump stage0 rustfmt

Unblocks rust-lang/rust#146071, cc `@npmccallum.`

Steps to reproduce:

1. Temporarily upgrade `src/tools/bump-stage0`'s `toml` dependency from 0.7 to 0.9 to fix build error (see Zulip topic)
2. Execute `./x run src/tools/bump-stage0`
3. Manually revert changes unrelated to nightly `rustfmt`+`rustc` (the latter needs to be bumped, too, for the driver ([via](https://github.com/rust-lang/rust/pull/146250#discussion_r2325742775)))

r? `@Mark-Simulacrum` as discussed in [#t-release > Bump stage0 rustfmt separately ("one-off")](https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/Bump.20stage0.20rustfmt.20separately.20.28.22one-off.22.29/with/537916615)
2025-09-05 22:47:24 +02:00
León Orell Valerian Liehr
8f3801f1af
Rollup merge of #146243 - matthiaskrgr:declone, r=lqd
remove couple of redundant clones
2025-09-05 22:47:24 +02:00
León Orell Valerian Liehr
56d99b1a7c
Rollup merge of #146242 - GuillaumeGomez:rustdoc-gui-scrape, r=lolbinarycat
Ensure that `--html-after-content` option is used to check `scrape_examples_ice` rustdoc GUI test

Follow-up of https://github.com/rust-lang/rust/pull/146091.

This test ensures that the spans are correctly handled when a "local source file" is not the first in the file list. To ensure it's actually what's tested, this test checks that the option is actually used by adding an element.

r? `@lolbinarycat`
2025-09-05 22:47:23 +02:00
León Orell Valerian Liehr
910d6be9a4
Rollup merge of #146241 - hkBst:context-1, r=jieyouxu
rustc_infer: change top-level doc comment to inner
2025-09-05 22:47:23 +02:00
León Orell Valerian Liehr
d82ee660d6
Rollup merge of #146234 - hkBst:file-generated-header, r=tgross35
change file-is-generated doc comment to inner

Alternatively this could perhaps be better as a normal comment...
2025-09-05 22:47:22 +02:00
León Orell Valerian Liehr
690753f7d4
Rollup merge of #146225 - Jules-Bertholet:simplify-float-midpoint, r=tgross35
Simplify `{f16, f32, f64, f128}::midpoint()`

`(float_ty::MAX / 2) - (float_ty::MIN_POSITIVE * 2)` equals `(float_ty::MAX / 2) + (float_ty::MIN_POSITIVE * 2)` equals `(float_ty::MAX / 2)`. So these branches are pointless.

CC `@Urgau` who wrote the original implementation in https://github.com/rust-lang/rust/pull/92048; does this seem right?

`@rustbot` label A-floating-point
2025-09-05 22:47:22 +02:00
León Orell Valerian Liehr
1c2d264eb0
Rollup merge of #146144 - heiher:entry-func-features, r=petrochenkov
compiler: Apply target features to the entry function

Fixes rust-lang/rust#146143
2025-09-05 22:47:20 +02:00
León Orell Valerian Liehr
7e189a00eb
Rollup merge of #146041 - lolbinarycat:tidy-escheck-bless, r=Kobzol
tidy: --bless now makes escheck run with --fix

this mirrors how other extra-check tools work.

unsure if this also needs to be done for tsc and es-check.
2025-09-05 22:47:20 +02:00