Commit graph

304928 commits

Author SHA1 Message Date
Jieyou Xu
0f76784d72
bootstrap: split run-make into {run-make,run-make-cargo} test suites
So that contributors who don't need to run `run-make` tests that require
in-tree `cargo` can run the non-cargo `run-make` tests without having to
wait for `cargo` (which would require rebuilding as the build cache
would be invalidated by compiler modifications without some kind of
`--keep-stage-cargo`).
2025-09-05 21:22:50 +08:00
bors
c559c4a741 Auto merge of #146224 - tgross35:rollup-1bgjms3, r=tgross35
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#144342 (add exact bitshifts)
 - rust-lang/rust#145709 (Fix LoongArch C function ABI when passing/returning structs containing floats)
 - rust-lang/rust#146152 (Unify and deduplicate algebraic float tests)
 - rust-lang/rust#146207 (std: Implement WASIp2-specific stdio routines)
 - rust-lang/rust#146217 (fix ICE when suggesting `::new`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-05 09:02:05 +00:00
Trevor Gross
8ff60a6302
Rollup merge of #146217 - lukas-code:suggest-new-ice, r=compiler-errors
fix ICE when suggesting `::new`

fixes https://github.com/rust-lang/rust/issues/146174

This code suggests to write `Foo::new(...)` when the user writes `Foo(...)` or `Foo { ... }` and the constructor is private, where `new` is some associated function that returns `Self`.

When checking that the return type of `new` is `Self`, we need to instantiate the parameters of `new` with infer vars, so we don't end up with a type like `Box<$param(0)>` in a context that doesn't have any parameters. But then we can't use `normalize_erasing_late_bound_regions` anymore because that goes though a query that can't deal with infer vars.

Since this is diagnostic-only code that is supposed to check for exactly `-> Self`, I think it's fine to just skip normalizing here, especially since The Correct Way<sup>TM</sup> would involve a probe and make this code even more complicated.

Also, the code here does almost the same thing, and these suggestions can probably be unified in the future: 4ca8078d37/compiler/rustc_hir_typeck/src/method/suggest.rs (L2123-L2129)

r? ````@compiler-errors````
cc ````@Qelxiros```` -- this should unblock https://github.com/rust-lang/rust/pull/144420
2025-09-05 01:53:22 -04:00
Trevor Gross
7fc547c4f2
Rollup merge of #146207 - alexcrichton:wasip2-stdio, r=juntyr
std: Implement WASIp2-specific stdio routines

This commit is an extension of rust-lang/rust#145944 but applied to stdio specifically. The stdio routines are updated away from WASIp1 APIs to using WASIp2 APIs natively. The end goal is to eventually drop the dependency on WASIp1 APIs in the standard library entirely in favor of exclusively depending on WASIp2.
2025-09-05 01:53:22 -04:00
Trevor Gross
db5cc29d4f
Rollup merge of #146152 - rperier:unify_and_dedup_algebraic_float_tests, r=tgross35
Unify and deduplicate algebraic float tests

cc rust-lang/rust#141726

This is a proposal to unify and deduplicate the algebraic tests for f16, f32, f64 and f128
2025-09-05 01:53:21 -04:00
Trevor Gross
3b8d41161e
Rollup merge of #145709 - heiher:issue-145692-1, r=jackh726
Fix LoongArch C function ABI when passing/returning structs containing floats

Similar to RISC-V, LoongArch passes structs containing only one or two floats (or a float–integer pair) in registers, as long as each element fits into a single corresponding register. Before this PR, Rust did not check the actual offset of the second float or integer; instead, it assumed the standard offset based on the default alignment. However, since the offset can be affected by `#[repr(align(N))]` and `#[repr(packed)]`, this led to miscompilations (see rust-lang/rust#145692). This PR fixes the issue by explicitly specifying the offset for the remainder of the cast.
2025-09-05 01:53:20 -04:00
Trevor Gross
1a6cfacd8e
Rollup merge of #144342 - Qelxiros:exact-bitshifts, r=tgross35
add exact bitshifts

Tracking issue: rust-lang/rust#144336

cc ```@lolbinarycat```
2025-09-05 01:53:20 -04:00
bors
ad85bc524b Auto merge of #144737 - petrochenkov:extprelcache, r=davidtwco
resolve: Avoid finalizing extern prelude entries more than once
2025-09-05 05:50:24 +00:00
bors
91edc3ebcc Auto merge of #146218 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2025-09-05 02:01:50 +00:00
bors
b3cfb8faf8 Auto merge of #138736 - azhogin:azhogin/sanitizers-target-modificators, r=rcvalle
Sanitizers target modificators

Depends on bool flag fix: https://github.com/rust-lang/rust/pull/138483.

Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer

For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier.

Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
2025-09-04 22:51:33 +00:00
Philipp Krones
75b9ee5f08
Merge commit 'e9b70454e4' into clippy-subtree-update 2025-09-04 18:27:27 -04:00
Philipp Krones
e9b70454e4
Rustup (#15616)
r? @ghost

changelog: integer-to-pointer-transmutes are now handled by the upstream
`integer_to_ptr_transmutes` Rust lint and no longer by the
[`useless_transmute`] Clippy lint
2025-09-04 22:25:55 +00:00
Philipp Krones
e9810e578a
Bump nightly version -> 2025-09-04 2025-09-04 18:18:39 -04:00
Philipp Krones
4b73b961e6
Merge remote-tracking branch 'upstream/master' into rustup 2025-09-04 18:18:20 -04:00
Philipp Krones
b3c3efe755
Set flip1995 to on-vacation (#15614)
Forgot to do this at the start of the week. Will be back on the 15th.
(That's also the reason why I forgot about the meeting. Sorry for that!)

r? @ghost

changelog: none
2025-09-04 22:06:57 +00:00
Philipp Krones
06e4ed62db
Set flip1995 to on-vacation 2025-09-04 18:01:10 -04:00
Lukas Markeffsky
4ca8078d37 fix ICE when suggesting ::new 2025-09-04 22:56:24 +02:00
bors
af00ff2ce6 Auto merge of #145911 - notriddle:stringdex-tweak-3, r=GuillaumeGomez
rustdoc-search: yet another stringdex optimization attempt

This one's uses a different tactic. It shouldn't significantly increase the amount of downloaded index data, but still reduces the amount of disk usage.

This one works by changing the suffix-only node representation to omit some data that's needed for checking. Since those nodes make up the bulk of the tree, it reduces the data they store, but also requires validating the match by fetching the name itself (but the names list is pretty small, and when I tried it with wordnet "indexing" it was about the same).

r? `@GuillaumeGomez`
2025-09-04 19:40:40 +00:00
bors
0d6a806909 Auto merge of #146205 - matthiaskrgr:rollup-fxt43oq, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#145976 (Add bootstrap.toml option to control debug breaking on ICEs on windows)
 - rust-lang/rust#146151 (fixes auto-run js checks in tidy)
 - rust-lang/rust#146194 (fix path str eq)
 - rust-lang/rust#146197 (triagebot: fix rustc_allow_const_fn_unstable matcher)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-04 16:31:05 +00:00
Alex Crichton
d8ca776f6d std: Implement WASIp2-specific stdio routines
This commit is an extension of previous libstd support but applied to stdio
specifically. The stdio routines are updated away from WASIp1 APIs to using
WASIp2 APIs natively. The end goal is to eventually drop the dependency on
WASIp1 APIs in the standard library entirely in favor of exclusively depending
on WASIp2.
2025-09-04 09:15:10 -07:00
Matthias Krüger
a038e28e8a
Rollup merge of #146197 - RalfJung:triagebot-rustc_allow_const_fn_unstable, r=Urgau
triagebot: fix rustc_allow_const_fn_unstable matcher

The attribute is used like `#[rustc_allow_const_fn_unstable(const_precise_live_drops)]` so we can't have the final `]` here...

r? `@Urgau`
2025-09-04 17:45:49 +02:00
Matthias Krüger
60196de4c2
Rollup merge of #146194 - bend-n:fix-path-str-eq, r=ibraheemdev
fix path str eq

fixes rust-lang/rust#146183
where the impl for partialeq<str> for pathbuf resulted in infinite recursion
2025-09-04 17:45:49 +02:00
Matthias Krüger
bdfa97b648
Rollup merge of #146151 - FrancescoV1985:issue-146047-fix, r=Kobzol
fixes auto-run js checks in tidy

Modified is_non_auto_or_matches function in src/tools/tidy/src/extra_checks/mod.rs so that .ts extension is considered.
Tested locally with
`./x.py test tidy --extra-checks=auto:js`
2025-09-04 17:45:48 +02:00
Matthias Krüger
7260704178
Rollup merge of #145976 - beepster4096:configure_debugbreak, r=clubby789
Add bootstrap.toml option to control debug breaking on ICEs on windows

When rustc ICEs during bootstrap on Windows, it will call `DebugBreak`. This is intended to trigger a Windows Error Reporting dialog that can launch a debugger. However on some setups (mine for one) this will just abort the process, hiding any ICEs on other threads as well. I also would not want to see this dialog even if it did work for me.

This PR adds a new option to bootstrap.toml `rust.break-on-ice` to configure this behavior. By default, it is enabled, matching the existing behavior.
2025-09-04 17:45:47 +02:00
bors
71289c378d Auto merge of #145955 - bjorn3:lto_refactors4, r=nnethercote
Rework how the codegen coordinator code handles the allocator shim

Continuing from https://github.com/rust-lang/rust/pull/144503 this centralizes most handling of the allocator shim to a single 4 line block in the codegen coordinator. The allocator shim is small enough that making it go through the main codegen loop and spawning a worker thread for it is wasted effort.
2025-09-04 11:59:21 +00:00
bendn
1e37c1fe2e
fix 2025-09-04 18:33:47 +07:00
Ralf Jung
9c6c5df2c4 triagebot: fix rustc_allow_const_fn_unstable matcher 2025-09-04 12:29:52 +02:00
bors
45b9d13b45 Auto merge of #146192 - jhpratt:rollup-mam0bss, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#145682 (Promote aarch64-pc-windows-msvc to Tier 1)
 - rust-lang/rust#145690 (Implement Integer funnel shifts)
 - rust-lang/rust#146119 (compiletest: Implement an experimental `--new-output-capture` mode)
 - rust-lang/rust#146168 (Update bootstrap's dependencies to remove winapi and old windows-sys)
 - rust-lang/rust#146182 (Don't require next-solver `ProbeRef` to be `Copy`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-04 08:50:59 +00:00
bjorn3
319fe230f0 Special case allocator module submission to avoid special casing it elsewhere
A lot of places had special handling just in case they would get an
allocator module even though most of these places could never get one or
would have a trivial implementation for the allocator module. Moving all
handling of the allocator module to a single place simplifies things a
fair bit.
2025-09-04 08:21:10 +00:00
bjorn3
eea81b5d75 Ensure the allocator shim never participates in LTO
Making it participate in LTO would be incorrect if you compile a crate
as both a dylib (which needs it) and rlib (which must not include it) in
the same rustc invocation. With linker plugin LTO, the allocator shim
will still participate in LTO as it is safe to do so in that case.
2025-09-04 08:21:10 +00:00
bjorn3
7a01c7f676 Export __rdl_* symbols to the allocator shim when doing LTO 2025-09-04 08:21:10 +00:00
bendn
f19da67ed7
add test 2025-09-04 14:17:31 +07:00
FrancescoV1985
858414b6bb improved solution for function is_non_auto_or_matches 2025-09-04 08:55:02 +02:00
Jacob Pratt
b4f76b3de8
Rollup merge of #146182 - ChayimFriedman2:ns-probe, r=jackh726
Don't require next-solver `ProbeRef` to be `Copy`

rust-analyzer would like to use a non-interned `Probe` there.

Also rename it to `Probe` for this reason.

We can make it `Copy` (although then `Probe` will need to be `Clone` for rust-analyzer) but it seems just non-needed.

r? types
2025-09-04 01:43:22 -04:00
Jacob Pratt
fbaf7ffba5
Rollup merge of #146168 - dpaoliello:bootstrapdeps, r=jieyouxu
Update bootstrap's dependencies to remove winapi and old windows-sys

Bumps `opener` to 0.8 and `junction` to 1.3 - this removes the dependency on `winapi` (unless the `build-metrics` feature is enabled) and replaces the usage of `windows-sys` 0.52 with 0.60.

Together this means that bootstrap can now be built for Arm64EC.
2025-09-04 01:43:22 -04:00
Jacob Pratt
be1d829910
Rollup merge of #146119 - Zalathar:capture, r=jieyouxu
compiletest: Implement an experimental `--new-output-capture` mode

Thanks to the efforts on rust-lang/rust#140192, compiletest no longer has an unstable dependency on libtest, but it still has an unstable dependency on `#![feature(internal_output_capture)]`. That makes building compiletest more complicated than for most other bootstrap tools.

This PR therefore adds opt-in support for an experimental compiletest mode that avoids the use of `internal_output_capture` APIs, and instead uses more mundane means to capture the output of individual test runners.

Each `TestCx` now contains `&dyn ConsoleOut` references for stdout and stderr. All print statements in `compiletests::runtest` have been replaced with `write!` or `writeln!` calls that explicitly write to one of those trait objects. The underlying implementation then forwards to `print!` or `eprint!` (for `--no-capture` or old-output-capture mode), or writes to a separate buffer (in new-output-capture mode).

---

Currently, new-output-capture is disabled by default. It can be explicitly enabled in one of two ways:

- When running `x test`, pass `--new-output-capture=on` as a *compiletest* argument (after `--`).
  - E.g. `x test ui -- --new-output-capture=on`.
  - The short form is `-Non` or `-Ny`.
- Set environment variable `COMPILETEST_NEW_OUTPUT_CAPTURE=on`.

After some amount of opt-in testing, new-output-capture will become the default (with a temporary opt-out). Eventually, old-output-capture and `#![feature(internal_output_capture)]` will be completely removed from compiletest.

r? jieyouxu
2025-09-04 01:43:21 -04:00
Jacob Pratt
00d5dc5c9d
Rollup merge of #145690 - sayantn:integer-funnel-shift, r=tgross35
Implement Integer funnel shifts

Tracking issue: rust-lang/rust#145686
ACP: https://github.com/rust-lang/libs-team/issues/642

This implements funnel shifts on primitive integer types. Implements this for cg_llvm, with a fallback impl for everything else

Thanks `@folkertdev` for the fixes and tests

cc `@rust-lang/libs-api`
2025-09-04 01:43:21 -04:00
Jacob Pratt
4c091fb9ed
Rollup merge of #145682 - dpaoliello:arm64tier1, r=jieyouxu
Promote aarch64-pc-windows-msvc to Tier 1

Per <https://github.com/rust-lang/rfcs/pull/3817>

Tracking issue: <https://github.com/rust-lang/rust/issues/145671>
2025-09-04 01:43:20 -04:00
bors
79bdc62756 Auto merge of #146176 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

12 commits in a6c58d43051d01d83f55a3e61ef5f5b2b0dd6bd9..761c4658d0079d607e6d33cf0c060e61a617cad3
2025-08-26 23:05:12 +0000 to 2025-09-04 01:25:01 +0000
- refactor(shell): Prepare for `Report`s being generated in more places (rust-lang/cargo#15920)
- refactor(frontmatter): Pull out as a dedicated mod (rust-lang/cargo#15914)
- chore: downgrade to libc@0.2.174 (rust-lang/cargo#15918)
- fix(publish): Don't generate final artifacts (rust-lang/cargo#15910)
- chore: Address most typos (rust-lang/cargo#15911)
- chore(deps): update rust crate annotate-snippets to 0.12.1 (rust-lang/cargo#15909)
- test(script): Switch frontmatter tests to end-to-end (rust-lang/cargo#15899)
- chore: fix some typos and grammar (rust-lang/cargo#15905)
- Update dependencies (rust-lang/cargo#15904)
- feat: Don't stop at first error when emitting lints and warnings (rust-lang/cargo#15889)
- fix(cli): Show the bad manifest path (rust-lang/cargo#15896)
- chore(deps): update rust crate tracing-subscriber to v0.3.20 [security] (rust-lang/cargo#15898)
2025-09-04 05:37:47 +00:00
Weihang Lo
94fd69aa28
Update cargo submodule 2025-09-03 22:30:01 -07:00
Zalathar
c2ae2e03d2 Implement compiletest --new-output-capture, in stable Rust 2025-09-04 12:51:21 +10:00
bors
033c0a4742 Auto merge of #146185 - Zalathar:rollup-n14lyv6, r=Zalathar
Rollup of 24 pull requests

Successful merges:

 - rust-lang/rust#140459 (Add `read_buf` equivalents for positioned reads)
 - rust-lang/rust#143725 (core: add Peekable::next_if_map)
 - rust-lang/rust#145209 (Stabilize `path_add_extension`)
 - rust-lang/rust#145342 (fix drop scope for `super let` bindings within `if let`)
 - rust-lang/rust#145750 (raw_vec.rs: Remove superfluous fn alloc_guard)
 - rust-lang/rust#145827 (On unused binding or binding not present in all patterns, suggest potential typo of unit struct/variant or const)
 - rust-lang/rust#145932 (Allow `inline(always)` with a target feature behind a unstable feature `target_feature_inline_always`.)
 - rust-lang/rust#145962 (Ensure we emit an allocator shim when only some crate types need one)
 - rust-lang/rust#145963 (Add LSX accelerated implementation for source file analysis)
 - rust-lang/rust#146054 (add `#[must_use]` to `array::repeat`)
 - rust-lang/rust#146090 (Derive `PartialEq` for `InvisibleOrigin`)
 - rust-lang/rust#146112 (don't uppercase error messages)
 - rust-lang/rust#146120 (Correct typo in `rustc_errors` comment)
 - rust-lang/rust#146124 (Test `rustc-dev` in `distcheck`)
 - rust-lang/rust#146127 (Rename `ToolRustc` to `ToolRustcPrivate`)
 - rust-lang/rust#146131 (rustdoc-search: add test case for indexing every item type)
 - rust-lang/rust#146134 (llvm: nvptx: Layout update to match LLVM)
 - rust-lang/rust#146136 (docs(std): add missing closing code block fences in doc comments)
 - rust-lang/rust#146137 (Disallow frontmatter in `--cfg` and `--check-cfg` arguments)
 - rust-lang/rust#146140 (compiletest: cygwin follows windows in using PATH for dynamic libraries)
 - rust-lang/rust#146150 (fix(rustdoc): match rustc `--emit` precedence )
 - rust-lang/rust#146155 (Make bootstrap self test parallel)
 - rust-lang/rust#146161 ([rustdoc] Uncomment code to add scraped rustdoc examples in loaded paths)
 - rust-lang/rust#146172 (triagebot: configure some pings when certain attributes are used)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-04 02:28:20 +00:00
Michael Howell
80e18051cb rustdoc-search: yet another stringdex optimization attempt
This one's uses a different tactic. It shouldn't significantly
increase the amount of downloaded index data, but still reduces
the amount of disk usage.

This one works by changing the suffix-only node representation
to omit some data that's needed for checking. Since those nodes
make up the bulk of the tree, it reduces the data they store,
but also requires validating the match by fetching the name
itself (but the names list is pretty small, and when I tried
it with wordnet "indexing" it was about the same).
2025-09-03 17:09:01 -07:00
Stuart Cook
11ea57363b
Rollup merge of #146172 - RalfJung:triagebot-keyword-mentions, r=Urgau
triagebot: configure some pings when certain attributes are used

Let's try this out in practice. :)

Cc `@rust-lang/miri` `@rust-lang/wg-const-eval` `@Urgau`
2025-09-04 10:02:06 +10:00
Stuart Cook
c81fffa9a3
Rollup merge of #146161 - GuillaumeGomez:loaded-paths-scraped-examples, r=lolbinarycat
[rustdoc] Uncomment code to add scraped rustdoc examples in loaded paths

Since the bug was fixed in https://github.com/rust-lang/rust/pull/146091, we can now uncomment the code. :)

r? lolbinarycat
2025-09-04 10:02:06 +10:00
Stuart Cook
8b2a64f0c7
Rollup merge of #146155 - Shourya742:2025-09-03-make-test-run-parallel, r=Kobzol
Make bootstrap self test parallel

This PR refactors the bootstrap self test:

1. Replaced the hardcoded --test-threads=1 with std:🧵:available_parallelism(), allowing tests to run with the maximum concurrency supported by the system.
2. Replaced custom hacks around OUT_DIR with TempDir and introduced TestCtx to simplify configuration setup.

r? `@Kobzol`
2025-09-04 10:02:05 +10:00
Stuart Cook
8fc568e905
Rollup merge of #146150 - weihanglo:rustdoc-emit, r=aDotInTheVoid
fix(rustdoc): match rustc `--emit` precedence

Resolves rust-lang/rust#141664

This changes rustdoc's `--emit` to allow only one instance of each type, regardless of the actual data that `--emit` carries. This matches rustc's `--emit` behavior.

As of the writing, only `dep-info` emit type carries extra data.
2025-09-04 10:02:04 +10:00
Stuart Cook
9214b1854c
Rollup merge of #146140 - jeremyd2019:patch-1, r=jieyouxu
compiletest: cygwin follows windows in using PATH for dynamic libraries

`@Berrysoft`
2025-09-04 10:02:04 +10:00
Stuart Cook
10cbfe6e20
Rollup merge of #146137 - Urgau:cfg-disallow-frontmatter, r=fmease
Disallow frontmatter in `--cfg` and `--check-cfg` arguments

This PR disallows the frontmatter syntax in `--cfg` and `--check-cfg` arguments.

Fixes https://github.com/rust-lang/rust/issues/146130
r? fmease
2025-09-04 10:02:03 +10:00
Stuart Cook
b27c94af61
Rollup merge of #146136 - AudaciousAxiom:docs/missing-closing-code-block-fences, r=tgross35
docs(std): add missing closing code block fences in doc comments

This PR adds a few closing code block fences which I believe are missing in some doc comments. It seems that rustdoc just autocloses code blocks at the end of doc comments and thus these were easily overlooked: I do not think these code blocks are special in any way.

I found these when working on a Clippy lint that checks the last sentence of doc comments for terminal punctuation, and these were failing cases when testing against the std. Therefore I am not entirely sure these are all such cases, but still have high hopes that they are (or at least a well-defined subset of them).
2025-09-04 10:02:02 +10:00