Commit graph

308340 commits

Author SHA1 Message Date
Matthias Krüger
849bea3a0d
Rollup merge of #147523 - krasimirgg:llvm22-rr, r=durin42
x86_64-bigint-helpers test: update test assertion to cover registers r8 and r9

Adapts the test expectation to cover the case where a register like `r9` is chosen. Update is similar to the other such expectation in the previous function in the same test file.

Found by our experimental rust + LLVM @ HEAD bot:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/40528/steps/canvas?sid=0199c8d7-f65a-4bbc-8d7f-e62d4ddcc65e#0199c8d7-f7ab-464d-a0fd-b4b8862a11d3/1047-1175

r? durin42
``@rustbot`` label: +llvm-main
2025-10-09 20:41:24 +02:00
Matthias Krüger
802f72201d
Rollup merge of #147479 - folkertdev:cmse-refactor-warnings, r=davidtwco
cmse: improve error messages

tracking issue: https://github.com/rust-lang/rust/issues/81391
tracking issue: https://github.com/rust-lang/rust/issues/75835

Improves the cmse error messages (e.g. by using more accurate spans), and attempts to clean up the control flow a bit. This is partially in preparation for one final addition: warnings when `union` types or types with niches cross the security boundary. That will be a folllow-up.

Meant to be reviewed commit-by-commit

r? ``@davidtwco``
2025-10-09 20:41:23 +02:00
Ada Alakbarova
bf5170a549
match arm pats aren't Optional anymore 2025-10-09 20:35:13 +02:00
Ada Alakbarova
83e2b3df54
inline find_matches_sugg into check_match 2025-10-09 20:34:47 +02:00
Ada Alakbarova
d1d5f0c7ae
inline arms into all callers 2025-10-09 20:34:47 +02:00
Ada Alakbarova
8519d49d6f
inline arms_without_last into all callers
it's now just the first arm
2025-10-09 20:34:47 +02:00
Ada Alakbarova
27d5f5c7a6
inline is_if_let into all callers 2025-10-09 20:34:47 +02:00
Ada Alakbarova
62e1225c87
inline find_matches_sugg into check_if_let 2025-10-09 20:34:47 +02:00
Ada Alakbarova
6d0fafd849
clean-up 2025-10-09 20:34:47 +02:00
bors
b925a865e2 Auto merge of #147447 - madsmtm:aarch64-watchos-default-deployment-target, r=davidtwco
Set the minimum deployment target for `aarch64-apple-watchos`

To match what's done in LLVM 21 and Xcode 26, watchOS 26 is the first OS version that actually runs true Aarch64 binaries. This affects the object files we create, and the linker invocation when using `-Clinker=ld`.

See also investigation in https://github.com/rust-lang/rust/issues/147223.
2025-10-09 18:03:15 +00:00
Vadim Petrochenkov
64d9d42364 resolver: Move local_modules from ResolverArenas to Resolver
Thus avoiding a `RefCell`.
2025-10-09 20:53:32 +03:00
Camille Gillot
6d800ae35b Renumber locals after state transform. 2025-10-09 16:28:44 +00:00
Jakub Beránek
da86710c30
Rename default linker linux field 2025-10-09 17:19:23 +02:00
bors
0b278a5394 Auto merge of #147483 - cjgillot:reorder-passes, r=nnethercote
Perform InstSimplify before ReferencePropagation.

`InstSimplify` clears CFG caches.

But it currently happens between `ReferencePropagation` and `GVN`, which both use dominators, a quite expensive computation.

r? `@ghost`
2025-10-09 14:05:16 +00:00
Camille Gillot
1ad657ed5f Simplify TransformVisitor. 2025-10-09 13:57:33 +00:00
Camille Gillot
513c9b7b86 Add debugging instrumentation. 2025-10-09 13:43:25 +00:00
Josh Triplett
d2f590a6d5
unsupported: Use unsupported() for set_times_nofollow 2025-10-09 06:37:09 -07:00
Josh Triplett
f8118d88d7
unsupported: Use unsupported() for set_times 2025-10-09 06:36:51 -07:00
Laurențiu Nicola
4ed634633c
Merge pull request #20822 from Young-Flash/update_typos_checker
minor: update typos checker version
2025-10-09 13:02:25 +00:00
bjorn3
f47c48048d Reduce scope of unsafe block in cg_llvm allocator codegen 2025-10-09 12:35:14 +00:00
Krasimir Georgiev
71c05330df x86_64-bigint-helpers test: update test assertion 2025-10-09 12:28:06 +00:00
Young-Flash
56cf2f21cd minor: correct typos 2025-10-09 20:07:24 +08:00
Young-Flash
c0d82ccbe9 minor: update typos checker version 2025-10-09 20:04:39 +08:00
Zalathar
f3f83857d9 Use the same directive lines for EarlyProps and ignore/only/needs 2025-10-09 23:00:51 +11:00
Camille Gillot
c3432bbec0 Explicit comment. 2025-10-09 11:51:17 +00:00
bors
4b57d8154a Auto merge of #147519 - Zalathar:rollup-o5f16uo, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#147446 (PassWrapper: use non-deprecated lookupTarget method)
 - rust-lang/rust#147473 (Do `x check` on various bootstrap tools in CI)
 - rust-lang/rust#147509 (remove intrinsic wrapper functions from LLVM bindings)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-09 10:54:43 +00:00
Stuart Cook
828dd0cdd4
Rollup merge of #147509 - AMS21:remove_llvm_rust_intrinsics, r=Zalathar
remove intrinsic wrapper functions from LLVM bindings

As discussed on https://github.com/llvm/llvm-project/pull/162500 there is no good reason to implement these intrinsic function via the LLVM wrapper instead we now just implement them via `call_intrinsic` like all the other intrinsic functions.

Work towards https://github.com/rust-lang/rust/issues/46437
2025-10-09 21:29:05 +11:00
Stuart Cook
84590ef092
Rollup merge of #147473 - Zalathar:check-bootstrap-tools, r=Kobzol
Do `x check` on various bootstrap tools in CI

These tools aren't included in a default `x check`, but checking them locally is still useful for maintainers working on the tools themselves:

- bootstrap
- bump-stage0
- compiletest
- coverage-dump
- linkchecker
- run-make-support
- rustdoc-gui-test

This PR therefore explicitly checks them in one CI job, to ensure that check builds for them continue to work.
2025-10-09 21:29:04 +11:00
Stuart Cook
c33f0b373b
Rollup merge of #147446 - durin42:llvm-22-lookupTarget-deprecation, r=Zalathar
PassWrapper: use non-deprecated lookupTarget method

This avoids an extra trip through a triple string by directly passing the Triple, and has been available since LLVM 21. The string overload was deprecated today and throws an error on our CI for HEAD due to -Werror paranoia, so we may as well clean this up now and also skip the conversion on LLVM 21 since we can.

`@rustbot` label llvm-main
2025-10-09 21:29:04 +11:00
dianqk
d4edd67f71
Update LLVM to 21.1.3 2025-10-09 18:23:56 +08:00
Ada Alakbarova
6b697dba79
fix(clone_on_ref_ptr): only name the generic type if possible 2025-10-09 11:43:31 +02:00
Timo
99b810634e
Cleanup: do not handle methods from several places (#15751)
Some methods lints were handled in the `methods` module outside the
`check_methods()` function.

changelog: none
2025-10-09 09:26:13 +00:00
Ralf Jung
345241536f repr_transparent_external_private_fields: normalize types during traversal 2025-10-09 11:15:31 +02:00
Zalathar
0be0a0a8d2 Do x check on various bootstrap tools in CI 2025-10-09 20:00:30 +11:00
Zalathar
7374789331 Support x check rustdoc-gui-test
This is useful for ensuring that changes to compiletest haven't broken
rustdoc-gui-test.
2025-10-09 19:58:52 +11:00
yukang
901366af1e fix c_char error in Android 2025-10-09 16:42:54 +08:00
bors
acf243778e Auto merge of #147512 - Zalathar:rollup-p8kb5f7, r=Zalathar
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#146568 (Port the implemention of SIMD intrinsics from Miri to const-eval)
 - rust-lang/rust#147373 (give a better example why `std` modules named like primitives are needed)
 - rust-lang/rust#147419 (bootstrap: add `Builder::rustc_cmd` that includes the lib path)
 - rust-lang/rust#147420 (Add diagnostic items for `pub mod consts` of FP types)
 - rust-lang/rust#147457 (specialize slice::fill to use memset when possible)
 - rust-lang/rust#147467 (Fix double warnings on `#[no_mangle]`)
 - rust-lang/rust#147470 (Clarify how to remediate the panic_immediate_abort error)
 - rust-lang/rust#147480 (Do not invalidate CFG caches in CtfeLimit.)
 - rust-lang/rust#147481 (format: some small cleanup)
 - rust-lang/rust#147488 (refactor: Remove `LLVMRustInsertPrivateGlobal` and `define_private_global`)
 - rust-lang/rust#147489 (Prefer to use repeat_n over repeat().take())
 - rust-lang/rust#147506 (compiletest: Isolate public APIs and minimize public surface area)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-09 07:45:17 +00:00
Stuart Cook
76d4f37c40
Rollup merge of #147506 - Zalathar:isolate, r=jieyouxu
compiletest: Isolate public APIs and minimize public surface area

As part of my ongoing efforts to improve directive parsing, I would like to be able to make internal changes without worrying about whether they're going to break the rustdoc-gui-test tool. That tool currently uses compiletest as a dependency to help with directive parsing.

This PR therefore isolates all of compiletest's public APIs into two dedicated modules, one used by rustdoc-gui-test, and one used by the compiletest binary in `compiletest/src/bin/main.rs`.

All other modules (and crate-root items) are then made non-`pub` to achieve the API isolation. Doing so reveals some unused items, which have been removed.

(To reduce the amount of immediate textual churn, this PR does not comprehensively replace `pub` with `pub(crate)` throughout the whole crate; that could be done in a follow-up PR.)

---

Ideally, rustdoc-gui-test would not depend on compiletest at all, but properly fixing that is out of scope for this PR.
- rust-lang/rust#143827

r? jieyouxu
2025-10-09 18:43:27 +11:00
Stuart Cook
9ace0de26b
Rollup merge of #147489 - chenyukang:yukang-prefer-repeat-n, r=Kivooeo,oli-obk
Prefer to use repeat_n over repeat().take()

More from https://github.com/rust-lang/rust/pull/147464, but batch processed with `ast-grep` to find and replace.

second commit add notes for library: affaf532f9

r? ``@RalfJung``
2025-10-09 18:43:26 +11:00
Stuart Cook
4dfd977c8b
Rollup merge of #147488 - AMS21:remove_llvm_rust_insert_private_global, r=nikic
refactor: Remove `LLVMRustInsertPrivateGlobal` and `define_private_global`

Since it can easily be implemented using the existing LLVM C API in
terms of `LLVMAddGlobal` and `LLVMSetLinkage` and `define_private_global`
was only used in one place.

Work towards https://github.com/rust-lang/rust/issues/46437
2025-10-09 18:43:26 +11:00
Stuart Cook
8fd2a1204a
Rollup merge of #147481 - hkBst:format-1, r=jackh726
format: some small cleanup

Some small cleanup and some additional comments I did while trying to understand this code.
2025-10-09 18:43:25 +11:00
Stuart Cook
18d470e475
Rollup merge of #147480 - cjgillot:invalidate-ctfelimit, r=tmiasko
Do not invalidate CFG caches in CtfeLimit.

This does not matter much, as no optimization pass runs after `CtfeLimit`, but I still find the code cleaner.
2025-10-09 18:43:24 +11:00
Stuart Cook
8e363d32ae
Rollup merge of #147470 - ia0:immediate-abort, r=Mark-Simulacrum
Clarify how to remediate the panic_immediate_abort error

Users who build `core` for the sole purpose of enabling `panic_immediate_abort` might expect "`panic_immediate_abort` is now a real panic strategy" to mean that setting `panic = "immediate-abort"` in `Cargo.toml` or `-Cpanic=immediate-abort` in `RUSTFLAGS` to be sufficient for migration. But this is not the case, `core` still needs to be built for those changes to take effect.

See https://github.com/rust-lang/rust/issues/146974 for additional context.

See https://github.com/rust-lang/rust/issues/147286 and https://github.com/rust-lang/cargo/issues/16042 for the revelant tracking issues.
2025-10-09 18:43:24 +11:00
Stuart Cook
216be29176
Rollup merge of #147467 - JonathanBrouwer:double_warnings, r=JonathanBrouwer
Fix double warnings on `#[no_mangle]`

Fixes 2 out of 3 cases in https://github.com/rust-lang/rust/issues/147417
The fix on closures removes the old error and marks closures as an error target.
The fix on consts adds `AllowSilent` to to ignore a target, and uses the old error because that one has a nice suggestion.

r? ````@jdonszelmann````
2025-10-09 18:43:23 +11:00
Stuart Cook
4e3e7ce078
Rollup merge of #147457 - the8472:slice_fill_memset2, r=RalfJung,joboet
specialize slice::fill to use memset when possible

It helps const eval performance https://github.com/rust-lang/miri/issues/4616, debug builds and the gcc backend.

Previously attempted in https://github.com/rust-lang/rust/pull/83245 but reverted due to unsoundness https://github.com/rust-lang/rust/issues/87891 around potentially-uninitialized types. This PR only handles primitives where the problem does not arise.

split off from https://github.com/rust-lang/rust/pull/147294
2025-10-09 18:43:22 +11:00
Stuart Cook
473a74a410
Rollup merge of #147420 - samueltardieu:diag-items/consts-mod, r=joboet
Add diagnostic items for `pub mod consts` of FP types

They will be used in Clippy.
2025-10-09 18:43:22 +11:00
Stuart Cook
68f9b3b5e9
Rollup merge of #147419 - cuviper:bootstrap-rustc-libs, r=Zalathar,jieyouxu
bootstrap: add `Builder::rustc_cmd` that includes the lib path

When building with `rust.rpath = false`, every `rustc` invocation needs
to include the library path as well. I particularly ran into this in
`generate_target_spec_json_schema` when testing 1.91-beta in Fedora,
where we do disable rpath for our system builds. The new helper function
will hopefully encourage the right thing going forward.
2025-10-09 18:43:21 +11:00
Stuart Cook
800bc95b87
Rollup merge of #147373 - cyrgani:cyrgani-patch-1, r=ibraheemdev
give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang/rust#146882.
2025-10-09 18:43:20 +11:00
Stuart Cook
fd6546d514
Rollup merge of #146568 - sayantn:simd-shuffle, r=RalfJung
Port the implemention of SIMD intrinsics from Miri to const-eval

Ported the implementation of most SIMD intrinsics from Miri to rustc_const_eval. Remaining are

 - Math functions (as per `@RalfJung's` suggestions)
 - FMA (non-deterministic)
 - Funnel Shifts (not implemented in Miri yet)
 - Unordered reduction intrinsics (not implemented in Miri yet)
2025-10-09 18:43:20 +11:00
AMS21
064e3b8212
remove intrinsic wrapper functions from LLVM bindings 2025-10-09 09:26:44 +02:00