306417 Commits

Author SHA1 Message Date
Matthias Krüger
6618ac7bb1
Rollup merge of #146950 - joboet:cstr_default, r=tgross35
core: simplify `CStr::default()`

Just use a `CStr`-literal...
2025-09-24 23:33:27 +02:00
Matthias Krüger
6351a63486
Rollup merge of #146894 - tiif:suggest_feature_attr, r=BoxyUwU
Improve derive suggestion of const param

Make the suggestion not to remove the adt and use the name of the adt variant in the diagnostic.

r? `@BoxyUwU`
2025-09-24 23:33:27 +02:00
Matthias Krüger
7a4ac48345
Rollup merge of #146753 - tiif:unsatisfiable-unstable-feature, r=BoxyUwU
Improve the pretty print of UnstableFeature clause

As per https://github.com/rust-lang/rust/pull/145095#discussion_r2349439492, we could make the diagnostic for unsatisfiable ``UnstableFeature`` clause better.

r? `@BoxyUwU`
2025-09-24 23:33:26 +02:00
Matthias Krüger
0ab93860ed
Rollup merge of #146679 - stepancheg:error-display-source, r=dtolnay
Clarify Display for error should not include source

Fixes rust-lang/rust#145561.

r? `@Noratrieb`
2025-09-24 23:33:25 +02:00
Matthias Krüger
8073b6f169
Rollup merge of #146556 - stepancheg:repro-146228, r=tgross35
Fix duration_since panic on unix when std is built with integer overflow checks

Add a test for regression rust-lang/rust#146228, and turns out this test fails detects error when std is compiled with integer overflow checks.

Original regression was reverted in rust-lang/rust#146473.

First attempt to fix was in rust-lang/rust#146247; test and some code is copied from there, thanks `@eval-exec`

r? `@RalfJung`
2025-09-24 23:33:25 +02:00
Stepan Koltsov
92859e98ee Repro duration_since regression from issue 146228 2025-09-24 21:07:26 +01:00
Stepan Koltsov
a9554b4d5f Clarify Display for error should not include source 2025-09-24 20:02:35 +01:00
tiif
4e62715541 Improve the pretty print of UnstableFeature clause 2025-09-24 15:22:10 +00:00
tiif
30289353e8 Improve derive suggestion of const param
Make the suggestion not to remove the adt and use the name of the adt
variant
2025-09-24 13:29:23 +00:00
bors
15283f6fe9 Auto merge of #146338 - CrooseGit:dev/reucru01/AArch64-enable-GCS, r=Urgau,davidtwco
Extends AArch64 branch protection support to include GCS

Extends existing support for AArch64 branch protection to include support for [Guarded Control Stacks](https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/arm-a-profile-architecture-2022#guarded-control-stack-gcs:~:text=Extraction%20or%20tracking.-,Guarded%20Control%20Stack%20(GCS),-With%20the%202022).
2025-09-24 13:04:19 +00:00
joboet
a875f7779e
alloc: simplify Default for Box<CStr> and Rc<CStr> 2025-09-24 14:13:34 +02:00
bors
e9385f9eea Auto merge of #146946 - matthiaskrgr:rollup-fsmrqez, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#146818 (constify {float}::total_cmp())
 - rust-lang/rust#146896 (rustc-dev-guide subtree update)
 - rust-lang/rust#146898 (Update books)
 - rust-lang/rust#146899 (Fix a crash/mislex when more than one frontmatter closing possibility is considered)
 - rust-lang/rust#146904 (rust-lang/rust#140368 Mutex/RwLock/ReentrantLock::data_ptr to be const fn)
 - rust-lang/rust#146907 (add regression test for issue 146537)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-24 09:55:21 +00:00
bors
3e887f5faa Auto merge of #146953 - dianqk:update-llvm, r=cuviper
Update LLVM to 21.1.2

Fixes rust-lang/rust#146065.
2025-09-24 04:25:26 +00:00
dianqk
95ddfa102a
Update LLVM to 21.1.2 2025-09-24 07:34:22 +08:00
joboet
aa537824c4
core: simplify CStr::default()
Just use a `CStr`-literal...
2025-09-24 00:50:36 +02:00
Matthias Krüger
6617536d14
Rollup merge of #146907 - cyrgani:146537-test, r=nnethercote
add regression test for issue 146537

Adds a test based on the reduction in https://github.com/rust-lang/rust/issues/146537#issuecomment-3289438439.
This was already fixed in rust-lang/rust#142882 before the issue was even reported, but no test for it was added yet.
2025-09-23 23:40:30 +02:00
Matthias Krüger
bba509eb7e
Rollup merge of #146904 - peter-lyons-kehl:140368_data_ptr_const_fn, r=Amanieu
#140368 Mutex/RwLock/ReentrantLock::data_ptr to be const fn
2025-09-23 23:40:29 +02:00
Matthias Krüger
f984966325
Rollup merge of #146899 - Teapot4195:issue-146847-fix, r=nnethercote
Fix a crash/mislex when more than one frontmatter closing possibility is considered

When the less fortunate recovery path for frontmatters are taken, if the lexer considers more than one possible frontmatter closing possibility, the current index is entirely mis-tracked and can result in bump_bytes landing in the middle of a multichar unicode character.

This fixes it by tracking the actual base index and updating it as it considers additional closing possibilities.

fixes rust-lang/rust#146847
2025-09-23 23:40:29 +02:00
Matthias Krüger
7d0c283bbf
Rollup merge of #146898 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

1 commits in 3e9dc46aa563ca0c53ec826c41b05f10c5915925..33f1af40cc44dde7e3e892f7a508e6f427d2cbc6
2025-09-15 16:10:14 UTC to 2025-09-15 16:10:14 UTC

- Release trpl 0.3 (rust-lang/book#4505)

## rust-lang/reference

9 commits in b3ce60628c6f55ab8ff3dba9f3d20203df1c0dee..cc7247d8dfaef4c39000bb12c55c32ba5b5ba976
2025-09-20 10:26:26 UTC to 2025-09-08 18:07:29 UTC

- Document temporary scoping for destructuring assignments (rust-lang/reference#1992)
- Specify lifetime extension of `pin!` and `format_args!` arguments (rust-lang/reference#1980)
- update for more ABIs supporting c-variadics (rust-lang/reference#1936)
- Fix incorrect span tag (rust-lang/reference#1995)
- Remove strike attribute (rust-lang/reference#1997)
- Specify the target limits for target-specific ABIs (rust-lang/reference#2000)
- Remove tuple index carve out (rust-lang/reference#1966)
- Enable folding of chapter listing in navigation sidebar (rust-lang/reference#1988)
- Add support to grammar for single line comments (rust-lang/reference#1993)

## rust-lang/rust-by-example

1 commits in dd26bc8e726dc2e73534c8972d4dccd1bed7495f..2c9b490d70e535cf166bf17feba59e594579843f
2025-09-18 22:28:52 UTC to 2025-09-18 22:28:52 UTC

- Update unit testing output for additional test (rust-lang/rust-by-example#1958)
2025-09-23 23:40:28 +02:00
Matthias Krüger
f89d26b695
Rollup merge of #146896 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to d76c84c23c.

Created using https://github.com/rust-lang/josh-sync.

r? `````@ghost`````
2025-09-23 23:40:27 +02:00
Matthias Krüger
c2e11d7e43
Rollup merge of #146818 - npmccallum:total_cmp, r=fee1-dead
constify {float}::total_cmp()
2025-09-23 23:40:27 +02:00
bors
ae12bc21d8 Auto merge of #146931 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to f6466ce655.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-09-23 21:37:04 +00:00
bors
975e6c8fec Auto merge of #146938 - matthiaskrgr:rollup-y06ggfz, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#146632 (Fix uses of "adaptor")
 - rust-lang/rust#146731 (test: Use SVG for terminal url test)
 - rust-lang/rust#146775 (fixes for numerous clippy warnings)
 - rust-lang/rust#146784 ([win] Use find-msvc-tools instead of cc to find the linker and rc on Windows)
 - rust-lang/rust#146799 (Fix a dangling reference in `rustc_thread_pool`)
 - rust-lang/rust#146802 (mbe: Simplifications and refactoring)
 - rust-lang/rust#146806 (add private module override re-export test)
 - rust-lang/rust#146827 (Linker-plugin-based LTO: update list of good combinations (inc. beta + nightly))
 - rust-lang/rust#146875 (tests/run-make/crate-loading: Rename source files for clarity)
 - rust-lang/rust#146877 (prevent line number from being copied in chrome)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-23 18:14:16 +00:00
Matthias Krüger
8e21b89135
Rollup merge of #146877 - el-ev:issue146816, r=fmease,lolbinarycat,GuillaumeGomez
prevent line number from being copied in chrome

- Closes rust-lang/rust#146816

Fix the issue where line numbers are copied along with code in Chrome
2025-09-23 18:13:57 +02:00
Matthias Krüger
c71a2c4819
Rollup merge of #146875 - Enselic:better-file-names, r=jieyouxu
tests/run-make/crate-loading: Rename source files for clarity

For rust-lang/rust#146874 I originally tried to extend the existing test **tests/run-make/crate-loading**. That didn't work out since adding a re-export of the entire crate significantly changes the emitted error messsage.

I did put some effort into making that test easier to understand however, by renaming its files. (Since I was confused myself at first.)  Let's save some time for future devs by doing just the renames.

Further cleanups are possible, but that will change the blessed output, so let's not do that right now.

r? ```@jieyouxu``` since you have the context of rust-lang/rust#146874
2025-09-23 18:13:56 +02:00
Matthias Krüger
35ceb3d447
Rollup merge of #146827 - foxtran:doc/linker-plugin-lto, r=nnethercote
Linker-plugin-based LTO: update list of good combinations (inc. beta + nightly)

This PR updates the list of good combinations of Rust toolchains and LLVM releases for linker-plugin-based LTO

Related to first question in https://users.rust-lang.org/t/questions-regarding-linker-plugin-based-lto/134070
2025-09-23 18:13:56 +02:00
Matthias Krüger
6d152339da
Rollup merge of #146806 - el-ev:issue60926, r=lolbinarycat
add private module override re-export test

- Closes rust-lang/rust#60926

Added a new test to check that `rustdoc` does not create links to `m2` in the crate root when `pub use m1::*` is overrided by `use crate::m1::m2`.
2025-09-23 18:13:55 +02:00
Matthias Krüger
15c323fa6d
Rollup merge of #146802 - joshtriplett:mbe-simplifications, r=petrochenkov
mbe: Simplifications and refactoring

A few simplifications and refactors in advance of other work.

Macro metavariable expressions were using `Ident::as_str` and doing string
comparisons; I converted them to use symbols.

I factored out a function for transcribing a `ParseNtResult`, which will help
separate the evaluation and transcription of future macro metavariable
expressions.
2025-09-23 18:13:54 +02:00
Matthias Krüger
64e81e5cb7
Rollup merge of #146799 - cuviper:dangling-count-latch, r=lcnr
Fix a dangling reference in `rustc_thread_pool`

This diverged from `rayon` in rust-lang/rust#142384, where a cleanup commit turned the matched `worker_index` into a reference, which is read _after_ the `set` that may kill it. I've moved that read beforehand, and I hope the new comments will emphasize the subtlety of this unsafe code.

Hopefully fixes rust-lang/rust#146677.
2025-09-23 18:13:53 +02:00
Matthias Krüger
8f11c4dadb
Rollup merge of #146784 - dpaoliello:findmsvc, r=wesleywiser
[win] Use find-msvc-tools instead of cc to find the linker and rc on Windows

`find-msvc-tools` was factored out from `cc` to allow updating the use in `rustc_codegen_ssa` (finding the linker when running the Rust compiler) and `rustc_windows_rc` (finding the Windows Resource Compiler when running the Rust compiler) to be separate from the use in `rustc_llvm` (building LLVM as part of building the Rust compiler).
2025-09-23 18:13:53 +02:00
Matthias Krüger
8905ad9838
Rollup merge of #146775 - hkBst:clippy-fix-11, r=petrochenkov
fixes for numerous clippy warnings
2025-09-23 18:13:52 +02:00
Matthias Krüger
ba9d057804
Rollup merge of #146731 - Muscraft:svg-test-terminal-url, r=jdonszelmann
test: Use SVG for terminal url test

I came across the test for `-Zterminal-urls` and found its output a bit hard to read. So, I decided to switch it to an SVG test, as I found it easier to differentiate the link and link text.

Note: `anstyle-svg` needed to be upgraded to at least `0.1.8` to support links in SVGs, so I went ahead and upgraded it to the latest version (`0.1.11`).
2025-09-23 18:13:52 +02:00
Matthias Krüger
076ada52d3
Rollup merge of #146632 - ctz:jbp-adaptor-spelling, r=petrochenkov
Fix uses of "adaptor"

These docs are in en_US, so "adapter" is the correct spelling (and indeed used in the next line.)

A second commit comes along for the ride to fix other instances in non-rustdoc comments.
2025-09-23 18:13:51 +02:00
Reuben Cruise
08020def99 Changes some aarch64 CIs g++ install & ubuntu ver.
GCS support was added to GCC in version 15, thus the rmake test for this
patch requires GCC15
Similarly, the ubuntu version is updated so the newer clang version is
available, and/or GCC15 is the default.
2025-09-23 13:56:53 +01:00
Ralf Jung
85be36c1d3
Merge pull request #4601 from RalfJung/rustup
Rustup
2025-09-23 07:57:20 +00:00
Ralf Jung
0cd72a2f8d Merge ref 'f6092f224d2b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: f6092f224d2b1774b31033f12d0bee626943b02f
Filtered ref: f843cd4f29bdcd8d474dbb9e5e4365eb7f263ec6

This merge was created using https://github.com/rust-lang/josh-sync.
2025-09-23 09:28:24 +02:00
Ralf Jung
3c8d8da693 Prepare for merging from rust-lang/rust
This updates the rust-version file to f6092f224d2b1774b31033f12d0bee626943b02f.
2025-09-23 09:09:53 +02:00
bors
4056082360 Auto merge of #146317 - saethlin:panic=immediate-abort, r=nnethercote
Add panic=immediate-abort

MCP: https://github.com/rust-lang/compiler-team/issues/909

This adds a new panic strategy, `-Cpanic=immediate-abort`. This panic strategy essentially just codifies use of `-Zbuild-std-features=panic_immediate_abort`. This PR is intended to just set up infrastructure, and while it will change how the compiler is invoked for users of the feature, there should be no other impacts.

In many parts of the compiler, `PanicStrategy::ImmediateAbort` behaves just like `PanicStrategy::Abort`, because actually most parts of the compiler just mean to ask "can this unwind?" so I've added a helper function so we can say `sess.panic_strategy().unwinds()`.

The panic and unwind strategies have some level of compatibility, which mostly means that we can pre-compile the sysroot with unwinding panics then the sysroot can be linked with aborting panics later. The immediate-abort strategy is all-or-nothing, enforced by `compiler/rustc_metadata/src/dependency_format.rs` and this is tested for in `tests/ui/panic-runtime/`. We could _technically_ be more compatible with the other panic strategies, but immediately-aborting panics primarily exist for users who want to eliminate all the code size responsible for the panic runtime. I'm open to other use cases if people want to present them, but not right now. This PR is already large.

`-Cpanic=immediate-abort` sets both `cfg(panic = "immediate-abort")` _and_ `cfg(panic = "abort")`. bjorn3 pointed out that people may be checking for the abort cfg to ask if panics will unwind, and also the sysroot feature this is replacing used to require `-Cpanic=abort` so this seems like a good back-compat step. At least for the moment. Unclear if this is a good idea indefinitely. I can imagine this being confusing.

The changes to the standard library attributes are purely mechanical. Apart from that, I removed an `unsafe` we haven't needed for a while since the `abort` intrinsic became safe, and I've added a helpful diagnostic for people trying to use the old feature.

To test that `-Cpanic=immediate-abort` conflicts with other panic strategies, I've beefed up the core-stubs infrastructure a bit. There is now a separate attribute to set flags on it.

I've added a test that this produces the desired codegen, called `tests/run-make-cargo/panic-immediate-abort-codegen/` and also a separate run-make-cargo test that checks that we can build a binary.
2025-09-23 06:37:03 +00:00
Iris Shi
9ae7aef06d
prevent line number from being copied in chrome 2025-09-23 13:26:19 +08:00
Ben Kimock
4c1595a93b Skip the panic-immediate-abort-works test when cross-compiling 2025-09-22 21:13:38 -04:00
Josh Stone
389a502ade Fix a dangling reference in rustc_thread_pool 2025-09-22 14:04:04 -07:00
cyrgani
60f60127e7 add regression test for issue 146537 2025-09-22 22:02:24 +02:00
Peter Lyons Kehl
819f8b05b9 Mutex/RwLock/ReentrantLock::data_ptr to be const fn 2025-09-22 12:51:50 -07:00
Alex
2d18c886f5 Fix a crash/mislex when more than one frontmatter closing possibility is considered 2025-09-22 15:10:41 -04:00
bors
f6092f224d Auto merge of #146892 - GuillaumeGomez:rollup-fa7lp0n, r=GuillaumeGomez
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146795 (Enable `limit_rdylib_exports` on wasm targets)
 - rust-lang/rust#146828 (fix a crash in rustdoc merge finalize without input file)
 - rust-lang/rust#146848 (Add x86_64-unknown-motor (Motor OS) tier 3 target)
 - rust-lang/rust#146884 (Fix modification check of `rustdoc-json-types`)
 - rust-lang/rust#146887 (Remove unused #![feature(get_mut_unchecked)] in Rc and Arc examples)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-09-22 17:49:53 +00:00
rustbot
5e7d346364 Update books 2025-09-22 19:01:13 +02:00
Ralf Jung
0d906b746a
Merge pull request #4600 from RalfJung/sifa
fix SIFA logic
2025-09-22 16:37:24 +00:00
Martin Nordholts
2dc1354cd0 tests/run-make/crate-loading: Rename source files for clarity
To make the code easier to understand.
2025-09-22 18:18:36 +02:00
Ralf Jung
293e0a3aa0 fix SIFA logic 2025-09-22 18:08:17 +02:00
Iris Shi
bd98e73fe0
Update tests/rustdoc/reexport/private-mod-override-reexport.rs 2025-09-22 17:45:51 +02:00