35278 Commits

Author SHA1 Message Date
Matthias Krüger
3b38f25bc3
Rollup merge of #143611 - GrigorenkoPV:ParseIntError, r=tgross35
Mention more APIs in `ParseIntError` docs

Fixes rust-lang/rust#143602

r? `@lolbinarycat`

`@rustbot` label +A-docs
2025-07-11 07:35:20 +02:00
Matthias Krüger
a38083c896
Rollup merge of #143568 - Ayush1325:uefi-tcp4-timeout, r=tgross35
std: sys: net: uefi: tcp4: Add timeout support

- Implement timeout support for read, write and connect.
- A software implementation using Instant.
2025-07-11 07:35:19 +02:00
Matthias Krüger
ba2001fabd
Rollup merge of #143303 - Kivooeo:tf28, r=tgross35
`tests/ui`: A New Order [28/28] FINAL PART

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ``@tgross35``
2025-07-11 07:35:19 +02:00
Matthias Krüger
337a3018d1
Rollup merge of #143302 - Kivooeo:tf27, r=tgross35
`tests/ui`: A New Order [27/N]

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ``@tgross35``
2025-07-11 07:35:18 +02:00
Matthias Krüger
05b19877bf
Rollup merge of #142391 - LevitatingBusinessMan:setsid, r=workingjubilee
rust: library: Add `setsid` method to `CommandExt` trait

Add a setsid method to the CommandExt trait so that callers can create a process in a new session and process group whilst still using the POSIX spawn fast path.

Tracking issue: rust-lang/rust#105376

ACP: https://github.com/rust-lang/libs-team/issues/184

This PR was previously submitted by ``@HarveyHunt`` (whom I marked as Co-Author in the commit message) in rust-lang/rust#105377. However that PR went stale.

I applied the [suggestion](231d19fcbf (r1893457943)) to change the function signature to `fn setsid(&mut self, setsid: bool) -> &mut Command`.
2025-07-11 07:35:17 +02:00
bors
06a4210458 Auto merge of #143525 - Shourya742:2025-07-06-add-profiler, r=Kobzol
Add profiler to bootstrap command

This PR adds command profiling to the bootstrap command. It tracks the total execution time and records cache hits for each command. It also provides the ability to export execution result to a JSON file. Integrating this with Chrome tracing could further enhance observability.

r? `@Kobzol`
2025-07-10 16:51:58 +00:00
bors
622a598ac1 Auto merge of #143731 - matthiaskrgr:rollup-lm9q7vc, r=matthiaskrgr
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#136906 (Add checking for unnecessary delims in closure body)
 - rust-lang/rust#143652 (docs: document trait upcasting rules in `Unsize` trait)
 - rust-lang/rust#143657 (Resolver: refact macro map into external and local maps)
 - rust-lang/rust#143659 (Use "Innermost" & "Outermost" terminology for `AttributeOrder`)
 - rust-lang/rust#143663 (fix: correct typo in attr_parsing_previously_accepted message key)
 - rust-lang/rust#143666 (Re-expose nested bodies in rustc_borrowck::consumers)
 - rust-lang/rust#143668 (Fix VxWorks build errors)
 - rust-lang/rust#143670 (Add a new maintainer to the wasm32-wasip1 target)
 - rust-lang/rust#143675 (improve lint doc text)
 - rust-lang/rust#143683 (Assorted `run-make-support` maintenance)
 - rust-lang/rust#143695 (Auto-add `S-waiting-on-author` when the PR is/switches to draft state)
 - rust-lang/rust#143706 (triagebot.toml: ping lolbinarycat if tidy extra checks were modified)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-10 13:49:36 +00:00
Matthias Krüger
caabaa9d4a
Rollup merge of #143706 - lolbinarycat:triagebot-extra-checks-ping, r=Kobzol
triagebot.toml: ping lolbinarycat if tidy extra checks were modified

I rewrote a large chunk of this module, and plan to do further changes to it (namely moving rustdoc_js checks into it), so it would be nice to keep up with and provide feedback on any changes to it, at least for the immediate future.

r? `@Kobzol`
2025-07-10 15:19:36 +02:00
Matthias Krüger
4e15daadee
Rollup merge of #143695 - Urgau:waiting-on-author-new_draft, r=Kobzol
Auto-add `S-waiting-on-author` when the PR is/switches to draft state

This PR adds the `S-waiting-on-author` as a `new_draft` when the PR is/switches to draft state.

Related to https://github.com/rust-lang/triagebot/issues/2102 & https://github.com/rust-lang/triagebot/pull/2104

cc `@jieyouxu`
r? `@Kobzol`
2025-07-10 15:19:35 +02:00
Matthias Krüger
1ae2375a49
Rollup merge of #143683 - jieyouxu:rms-cleanup, r=Kobzol
Assorted `run-make-support` maintenance

This PR should contain no functional changes.

- Commit 1: Removes the support library's CHANGELOG. In the very beginning, I thought maybe we would try to version this library. But this is a purely internal test support library, and it's just extra busywork trying to maintain changelog/versions. It's also hopelessly outdated.
- Commit 2: Resets version number to `0.0.0`. Ditto on busywork.
- Commit 3: Bump `run-make-support` to Edition 2024. The support library was already "compliant" with Edition 2024.
- Commit 4: Slightly organizes the support library dependencies.
- Commit 5: Previously, I tried hopelessly to maintain some manual formatting, but that was annoying because it required skipping rustfmt (so export ordering etc. could not be extra formatted). Give up, and do some rearrangements / module prefix tricks to get the `lib.rs` looking at least *reasonable*. IMO this is not a strict improvement, but I rather regain the ability to auto-format it with rustfmt.
- Commit {6,7}: Noticed in rust-lang/rust#143669 that we apparently had *both* {`is_msvc`, `is_windows_msvc`}. This PR removes `is_msvc` in favor of `is_windows_msvc` to make it unambiguous (and only retain one way of gating) as there are some UEFI targets which are MSVC but not Windows.

Best reviewed commit-by-commit.

r? `@Kobzol`
2025-07-10 15:19:35 +02:00
Matthias Krüger
291a97b508
Rollup merge of #143675 - hkBst:overflowing-1, r=oli-obk
improve lint doc text
2025-07-10 15:19:34 +02:00
Matthias Krüger
9ad71e7934
Rollup merge of #143670 - loganek:loganek/wasm32-wasip1-new-maintainer, r=alexcrichton
Add a new maintainer to the wasm32-wasip1 target

cc: `@alexcrichton`
2025-07-10 15:19:34 +02:00
Matthias Krüger
8672a28c8a
Rollup merge of #143668 - biabbas:vxworks, r=Noratrieb
Fix VxWorks build errors

fixes rust-lang/rust#143442

r? ``@Noratrieb``
2025-07-10 15:19:33 +02:00
Matthias Krüger
f618825f3c
Rollup merge of #143666 - nilehmann:nested_bodies_in_consumers, r=lcnr
Re-expose nested bodies in rustc_borrowck::consumers

After https://github.com/rust-lang/rust/pull/138499, it's not possible anymore to get borrowck information for nested bodies via `get_body_with_borrowck_facts`. This PR re-exposes nested bodies by returning a map containing the typeck root and all its nested bodies. To collect the bodies, a map is added to `BorrowCheckRootCtxt`, and a body is inserted every time `do_mir_borrowck` is called.

r? ``@lcnr``
2025-07-10 15:19:32 +02:00
Matthias Krüger
64282ebc90
Rollup merge of #143663 - dillona:fix-typo, r=jdonszelmann
fix: correct typo in attr_parsing_previously_accepted message key
2025-07-10 15:19:32 +02:00
Matthias Krüger
51b7c257e8
Rollup merge of #143659 - GrigorenkoPV:attributes/inner-outer, r=jdonszelmann
Use "Innermost" & "Outermost" terminology for `AttributeOrder`

Follow-up to rust-lang/rust#143603.

https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/attribute.20parsing.20rework/near/527768926

Also remove some outdated comments. cc `@jdonszelmann`
2025-07-10 15:19:31 +02:00
Matthias Krüger
22205b60f3
Rollup merge of #143657 - LorrensP-2158466:split-macro-map, r=petrochenkov
Resolver: refact macro map into external and local maps

Puts `MacroData` inside of the `ResolverArena` and splits `macro_map` into 2 maps: `local_macro_map` and `external_macro_map`. This way `get_macro_by_def_id` can take a `&Resolver` instead of a mutable one.

Part of [#gsoc > Project: Parallel Macro Expansion](https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Project.3A.20Parallel.20Macro.20Expansion/with/516965603)

r? `@petrochenkov`
2025-07-10 15:19:31 +02:00
Matthias Krüger
28f4ae318a
Rollup merge of #143652 - moulins:doc-unsize-trait-upcasting, r=compiler-errors
docs: document trait upcasting rules in `Unsize` trait

The trait upcasting feature stabilized in 1.86 added new `Unsize` implementation, but this wasn't reflected in the trait's documentation.
2025-07-10 15:19:30 +02:00
Matthias Krüger
b86999e93e
Rollup merge of #136906 - chenyukang:yukang-fix-136741-closure-body, r=oli-obk
Add checking for unnecessary delims in closure body

Fixes #136741
2025-07-10 15:19:29 +02:00
yukang
c37949c628 remove unnecessary parens in rust-analyzer 2025-07-10 13:50:02 +08:00
bors
816b4a6b52 Auto merge of #143405 - tgross35:update-builtins, r=tgross35
Update the `compiler-builtins` subtree

Update the Josh subtree to https://github.com/rust-lang/compiler-builtins/commit/8aba4c899ee8.

r? `@ghost`
2025-07-09 22:42:11 +00:00
bors
57b64a7d1a Auto merge of #143538 - compiler-errors:instantiate-auto-trait, r=lcnr
Instantiate auto trait/`Copy`/`Clone`/`Sized` before computing constituent types binder

This makes the binder logic w.r.t. coroutines a bit simpler.

r? lcnr
2025-07-09 19:38:39 +00:00
bors
d64ef7403c Auto merge of #143502 - scottmcm:aggregate-simd, r=oli-obk
Let `rvalue_creates_operand` return true for *all* `Rvalue::Aggregate`s

~~Draft for now because it's built on Ralf's rust-lang/rust#143291~~

Inspired by https://github.com/rust-lang/rust/pull/138759#discussion_r2156375342 where I noticed that we were nearly at this point, plus the comments I was writing in rust-lang/rust#143410 that reminded me a type-dependent `true` is fine.

This PR splits the `OperandRef::builder` logic out to a separate type, with the updates needed to handle SIMD as well.  In doing so, that makes the existing `Aggregate` path in `codegen_rvalue_operand` capable of handing SIMD values just fine.

As a result, we no longer need to do layout calculations for aggregate result types when running the analysis to determine which things can be SSA in codegen.
2025-07-09 16:37:20 +00:00
bors
3a5e13a8b3 Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrieril
`rustc_pattern_analysis`: always check that deref patterns don't match on the same place as normal constructors

In rust-lang/rust#140106, deref pattern validation was tied to the `deref_patterns` feature to temporarily avoid affecting perf. However:
- As of rust-lang/rust#143414, box patterns are represented as deref patterns in `rustc_pattern_analysis`. Since they can be used by enabling `box_patterns` instead of `deref_patterns`, it was possible for them to skip validation, resulting in an ICE. This fixes that and adds a regression test.
- External tooling (e.g. rust-analyzer) will also need to validate matches containing deref patterns, which was not possible. This fixes that by making `compute_match_usefulness` validate deref patterns by default.

In order to avoid doing an extra pass for anything with patterns, the second commit makes `RustcPatCtxt` keep track of whether it encounters a deref pattern, so that it only does the check if so. This is purely for performance. If the perf impact of the first commit is negligible and the complexity cost introduced by the second commit is significant, it may be worth dropping the latter.

r? `@Nadrieril`
2025-07-09 09:45:36 +00:00
bors
d0188bdb3d Auto merge of #142707 - ashivaram23:drop_wildcard, r=dianqk
Apply effects to `otherwise` edge in dataflow analysis

This allows `ElaborateDrops` to remove drops when a `match` wildcard arm covers multiple no-Drop enum variants. It modifies dataflow analysis to update the `MaybeUninitializedPlaces` and `MaybeInitializedPlaces` data for a block reached through an `otherwise` edge.

Fixes rust-lang/rust#142705.
2025-07-09 03:42:01 +00:00
bors
82c8efd2c8 Auto merge of #134628 - estebank:const-default, r=oli-obk
Make `Default` const and add some `const Default` impls

Full list of `impl const Default` types:

- ()
- bool
- char
- std::ascii::Char
- usize
- u8
- u16
- u32
- u64
- u128
- i8
- i16
- i32
- i64
- i128
- f16
- f32
- f64
- f128
- std::marker::PhantomData<T>
- Option<T>
- std::iter::Empty<T>
- std::ptr::Alignment
- &[T]
- &mut [T]
- &str
- &mut str
- String
- Vec<T>
2025-07-08 14:04:40 +00:00
bors
bd73e9e1fb Auto merge of #143540 - yotamofek:pr/library/simplify-num-fmt, r=tgross35
Simplify num formatting helpers

Noticed `ilog10` was being open-coded when looking at this diff: 85d6768f4c..76d9775912 (diff-6be9b44b52d946ccac652ddb7c98146a01b22ea0fc5737bc10db245a24796a45)
That, and two other small cleanups 😁

(should probably go through perf just to make sure it doesn't regress formatting)
2025-07-08 10:54:22 +00:00
bors
766712c269 Auto merge of #142869 - nnethercote:join_path-mini, r=camelid
Use `join_with_double_colon` in `write_shared.rs`.

For consistency. Also, it's faster because `join_with_double_colon` does a better job estimating the allocation size than `join` from `itertools`.

r? `@camelid`
2025-07-08 06:32:37 +00:00
bors
d0a4543f88 Auto merge of #143433 - oli-obk:ty_span_qry, r=compiler-errors
Add `ty_span` query

r? `@compiler-errors`

fixes diagnostic regressions from https://github.com/rust-lang/rust/pull/142030

Also uses the new query in `check_const_item`
2025-07-08 00:11:13 +00:00
bors
af15612448 Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#132469 (Do not suggest borrow that is already there in fully-qualified call)
 - rust-lang/rust#143340 (awhile -> a while where appropriate)
 - rust-lang/rust#143438 (Fix the link in `rustdoc.md`)
 - rust-lang/rust#143539 (Regression tests for repr ICEs)
 - rust-lang/rust#143566 (Fix `x86_64-unknown-netbsd` platform support page)
 - rust-lang/rust#143572 (Remove unused allow attrs)
 - rust-lang/rust#143583 (`loop_match`: fix 'no terminator on block')
 - rust-lang/rust#143584 (make `Machine::load_mir` infallible)
 - rust-lang/rust#143591 (Fix missing words in future tracking issue)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-07 20:30:53 +00:00
Matthias Krüger
5b0bebbdad
Rollup merge of #143591 - ehuss:future-typos, r=jieyouxu
Fix missing words in future tracking issue

Fixes some sloppy editing on my part.
2025-07-07 19:55:37 +02:00
Matthias Krüger
dbadd94323
Rollup merge of #143584 - fee1-dead-contrib:push-skswvrwsrmll, r=RalfJung
make `Machine::load_mir` infallible

it doesn't need to return an `InterpResult`.
2025-07-07 19:55:36 +02:00
Matthias Krüger
d08465b50e
Rollup merge of #143583 - folkertdev:loop-match-no-terminator-on-block, r=bjorn3
`loop_match`: fix 'no terminator on block'

tracking issue: https://github.com/rust-lang/rust/issues/132306
fixes https://github.com/rust-lang/rust/issues/143435

The argument `block` was not properly closed on an error path.

r? `@bjorn3`
2025-07-07 19:55:35 +02:00
Matthias Krüger
1693eac9a4
Rollup merge of #143572 - yotamofek:pr/unused-allow-attrs, r=fee1-dead
Remove unused allow attrs

These `#[allow]`s seem to be unused (at least according to `x check`, didn't run `x test` locally). Let's clean them up! 🧹
2025-07-07 19:55:35 +02:00
Matthias Krüger
18612f8670
Rollup merge of #143566 - jieyouxu:fix-x86_64-unknown-netbsd, r=fee1-dead
Fix `x86_64-unknown-netbsd` platform support page

`x86_64-unknown-netbsd` is Tier 2 with host tools, not Tier 3.

cc `@he32.`

r? compiler
2025-07-07 19:55:34 +02:00
Matthias Krüger
d6dc3d9825
Rollup merge of #143539 - JonathanBrouwer:ice-regression-tests, r=oli-obk
Regression tests for repr ICEs

Closes https://github.com/rust-lang/rust/issues/143522
Closes https://github.com/rust-lang/rust/issues/143479

Both issues were already (accidentally) fixed in this PR, but having the tests is nice https://github.com/rust-lang/rust/pull/143252

r? `@jdonszelmann`
2025-07-07 19:55:33 +02:00
Matthias Krüger
818b0d76e0
Rollup merge of #143438 - makai410:rustdoc-fix, r=ehuss
Fix the link in `rustdoc.md`
2025-07-07 19:55:33 +02:00
Matthias Krüger
23584a4666
Rollup merge of #143340 - nabijaczleweli:awhile, r=mati865
awhile -> a while where appropriate
2025-07-07 19:55:32 +02:00
Matthias Krüger
36929fb177
Rollup merge of #132469 - estebank:issue-132041, r=Nadrieril
Do not suggest borrow that is already there in fully-qualified call

When encountering `&str::from("value")` do not suggest `&&str::from("value")`.

Fix #132041.
2025-07-07 19:55:31 +02:00
bors
b00b4ea65b Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubilee
Allow custom default address spaces and parse `p-` specifications in the datalayout string

Some targets, such as CHERI, use as default an address space different from the "normal" default address space `0` (in the case of CHERI, [200 is used](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-877.pdf)). Currently, `rustc` does not allow to specify custom address spaces and does not take into consideration [`p-` specifications in the datalayout string](https://llvm.org/docs/LangRef.html#langref-datalayout).

This patch tries to mitigate these problems by allowing targets to define a custom default address space (while keeping the default value to address space `0`) and adding the code to parse the `p-` specifications in `rustc_abi`. The main changes are that `TargetDataLayout` now uses functions to refer to pointer-related informations, instead of having specific fields for the size and alignment of pointers in the default address space; furthermore, the two `pointer_size` and `pointer_align` fields in `TargetDataLayout` are replaced with an `FxHashMap` that holds info for all the possible address spaces, as parsed by the `p-` specifications.

The potential performance drawbacks of not having ad-hoc fields for the default address space will be tested in this PR's CI run.

r? workingjubilee
2025-07-07 17:28:14 +00:00
bors
7d6f447a4d Auto merge of #143035 - ywxt:less-work-steal, r=oli-obk
Only work-steal in the main loop for rustc_thread_pool

This PR is a replica of <https://github.com/rust-lang/rustc-rayon/pull/12> that only retained work-steal in the main loop for rustc_thread_pool.

r? `@oli-obk`

cc `@SparrowLii` `@Zoxc` `@cuviper`

Updates rust-lang/rust#113349
2025-07-07 11:16:16 +00:00
bors
1bc1f34608 Auto merge of #143565 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-07-07 08:14:30 +00:00
Edoardo Marangoni
54507d88b4
compiler: Parse p- specs in datalayout string, allow definition of custom default data address space 2025-07-07 09:04:53 +02:00
bors
17de9984d5 Auto merge of #141829 - dvdsk:sleep_until_linux, r=cuviper,RalfJung
Specialize sleep_until implementation for unix (except mac)

related tracking issue: https://github.com/rust-lang/rust/issues/113752
Supersedes https://github.com/rust-lang/rust/pull/118480 for the reasons see: https://github.com/rust-lang/rust/issues/113752#issuecomment-2902594469

Replaces the generic catch all implementation with target_os specific ones for: linux/netbsd/freebsd/android/solaris/illumos etc. Other platforms like wasi, macos/ios/tvos/watchos and windows will follow in later separate PR's (once this is merged).
2025-07-06 23:00:51 +00:00
Lukas Wirth
0ac65592a8
Merge pull request #20184 from Veykril/push-ywpynxnltpok
chore: Remove dead field from `InferenceContext`
2025-07-07
2025-07-06 09:08:36 +00:00
Lukas Wirth
c86d83219b chore: Remove dead field from InferenceContext 2025-07-06 10:57:06 +02:00
Lukas Wirth
2691c11104
Merge pull request #20132 from A4-Tacks/asmut-borrow-minicore
Add AsMut, Borrow and BorrowMut to minicore and famous_defs
2025-07-06 08:01:54 +00:00
Lukas Wirth
fce1f41462
Merge pull request #20126 from Wilfred/no_unwrap_in_discover_projects
fix: Avoid .unwrap() when running the discover command
2025-07-06 08:01:10 +00:00
Lukas Wirth
ef3e52b6eb
Merge pull request #20179 from ChayimFriedman2/destructuring-assignment-never
fix: Fix diverging destructuring assignments
2025-07-06 07:01:40 +00:00
Chayim Refael Friedman
694cd75f50
Merge pull request #20175 from dianne/match-check-box-cleanup
`hir_ty::match_check` cleanup: remove special handling for box patterns
2025-07-06 02:32:49 +00:00