306566 Commits

Author SHA1 Message Date
lcnr
7a0adc0878 add test 2025-09-24 15:02:41 +02:00
Shoyu Vanilla
0e7cc32633 Switch next-solver related rustc dependencies of r-a to crates.io ones 2025-09-24 21:28:50 +09:00
joboet
a875f7779e
alloc: simplify Default for Box<CStr> and Rc<CStr> 2025-09-24 14:13:34 +02:00
Ralf Jung
8328c3dada const validation: better error for maybe-null references 2025-09-24 13:35:29 +02:00
Ralf Jung
0a41add629 const-eval: improve and actually test the errors when pointers might be outside the range of a scalar 2025-09-24 13:34:33 +02:00
lcnr
2886ca496a imrpove type_op failure ICE 2025-09-24 13:08:25 +02:00
lcnr
32d24f9efa allow bound regions in writeback 2025-09-24 13:08:25 +02:00
lcnr
3378997867
fix wording
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
2025-09-24 12:50:50 +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
Ayush Singh
03fd823dbf
library: std: sys: pal: uefi: Add some comments
I seemed to have forgotten that since I am using GET_PROTOCOL attribute
for the std usecases, I did not need to close the protocols explicitly.
So adding these comments as a note to future self not to waste time on
the same thing again.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-09-24 13:26:03 +05:30
Tshepang Mbambo
c9dc0e307a
temporary-lifetime-extension-tuple-ctor.rs: make usable on all editions
Also
- add Reference id
- fix typo
2025-09-24 07:01:24 +02: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
Caleb Zulawski
60548ffaa3 Including spans in layout errors for all ADTs 2025-09-23 22:15:06 -04:00
Caleb Zulawski
f5c6c9542e Add an attribute to check the number of lanes in a SIMD vector after monomorphization
Unify zero-length and oversized SIMD errors
2025-09-23 20:47:34 -04:00
Camille Gillot
ce677c7db8
Update compiler/rustc_mir_transform/src/patch.rs
Co-authored-by: lcnr <rust@lcnr.de>
2025-09-23 20:38:38 -03: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
ltdk
e8a8e061bf Make missed precondition-free float intrinsics safe 2025-09-23 18:15:11 -04: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
ash
60b35635e8 revert change removing has_infer check. Commit conservatively patches for now, but more development proceeding. Also contains a more concise test 2025-09-23 12:37:59 -06: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
Augie Fackler
42cf78f762 llvm: update remarks support on LLVM 22
LLVM change dfbd76bda01e removed separate remark support entirely, but
it turns out we can just drop the parameter and everything appears to
work fine.

Fixes 146912 as far as I can tell (the test passes.)

@rustbot label llvm-main
2025-09-23 13:25:04 -04: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
lcnr
83532f8544 remove test for no_core 2025-09-23 17:08:29 +02:00
lcnr
4fcafc9daa yeet fastpath 2025-09-23 17:02:55 +02:00
Yotam Ofek
e697f206fe Remove unused param from write_header 2025-09-23 17:29:47 +03:00
Yotam Ofek
aaff372f4b Remove Tooltip::None variant, use Option::None 2025-09-23 17:29:47 +03:00
Yotam Ofek
58c7505d86 Make render_example_with_highlighting return an impl fmt::Display 2025-09-23 17:29:30 +03: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
Oli Scherer
739e89980f Add proper name mangling for pattern types 2025-09-23 10:59:29 +00:00
Nikita Popov
bc7986ec79 Add attributes for #[global_allocator] functions
Emit `#[rustc_allocator]` etc. attributes on the functions generated
by the `#[global_allocator]` macro, which will emit LLVM attributes
like `"alloc-family"`. If the module with the global allocator
participates in LTO, this ensures that the attributes typically
emitted on the allocator declarations are not lost if the
definition is imported.
2025-09-23 10:21:17 +02: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