Skip to content

Rollup of 8 pull requests#158414

Closed
JonathanBrouwer wants to merge 20 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-g7eGgzW
Closed

Rollup of 8 pull requests#158414
JonathanBrouwer wants to merge 20 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-g7eGgzW

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

HNO3Miracle and others added 20 commits June 24, 2026 20:54
Signed-off-by: HNO3Miracle <xiangao.or@isrc.iscas.ac.cn>
…lign-157750, r=cuviper

Update LLVM for Mach-O __LINKEDIT alignment fix.

Update LLVM submodule to pull in changes from rust-lang/llvm-project#198.

Fixes rust-lang#157750.

This backport has been discussed in: [#t-compiler > Backport LLVM change to Rust for macOS 27 support?](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Backport.20LLVM.20change.20to.20Rust.20for.20macOS.2027.20support.3F/with/605925959).
…avidtwco,RalfJung

cmse: clear padding when crossing the secure boundary

tracking issue: rust-lang#81391
tracking issue: rust-lang#75835
RFC: rust-lang/rfcs#3884
related: rust-lang#147697

quick context: cmse creates a distinction between code running in secure mode and non-secure mode (think kernel space versus user space). Secure mode has access to data (e.g. encryption keys) that must not leak to non-secure mode. They use a special calling convention that clears unused registers, but padding in arguments/return values can contain stale secure data.

This PR clears the padding bytes (and similar, e.g. space not used in any variant of a union/enum) when values are passed over the secure boundary.

Separately we'll have a lint to warn on enums and unions being passed across the boundary: for them we can't statically know whether the variant that is passed contains padding.

This is conceptually modeled after a similar feature in `clang` ([implementation](https://github.com/llvm/llvm-project/blob/065a39b9f7f06fca0926394096ee1c1fac41d446/clang/lib/CodeGen/CGCall.cpp#L4041-L4087)).

cc @Jules-Bertholet
r? @davidtwco
…ase, r=petrochenkov

fix(tests): allow either branch direction in ilog_known_base

Fixes rust-lang#158339.

`tests/codegen-llvm/ilog_known_base.rs` checks that `checked_ilog` with a known power-of-two base is lowered through the faster `llvm.ctlz` path.

On `riscv64gc-unknown-linux-gnu`, LLVM emits the zero check with the opposite branch direction (`icmp eq i32 %val, 0`) from what the test currently expects (`icmp ne i32 %val, 0`). Both forms still guard the same `llvm.ctlz` fast path, so this relaxes the FileCheck pattern to accept either comparison direction.

This also fixes the `checked_ilog16` FileCheck variable to use the `DIV4` result it just matched.

Tested:

```sh
./x test --stage 2 tests/codegen-llvm/ilog_known_base.rs
```
LLVM 23: Adapt codegen test to moved assume

I wasn't completely sure what the important part of this test is - based on the "Make sure we don't create `br` or `select` instructions" comment I assume it's that the `load` is followed ~immediately by the `ret`, and that the presence or absence of the `assume` doesn't really matter (it's been moved up a few lines to before the `load`):

```ll
; Function Attrs
define noundef i32 @foo(ptr noalias nofree noundef align 8 captures(none) dereferenceable(16) %x) unnamed_addr #0 {
start
 %_6 = load ptr, ptr %x, align 8, !nonnull !4, !noundef !4
 %0 = getelementptr inbounds nuw i8, ptr %x, i64 8
 %_7 = load ptr, ptr %0, align 8, !nonnull !4, !noundef !4
 %_8 = icmp ne ptr %_6, %_7
 tail call void @llvm.assume(i1 %_8)
 %_14 = getelementptr inbounds nuw i8, ptr %_6, i64 4
 store ptr %_14, ptr %x, align 8
 %_4 = load i32, ptr %_6, align 4, !noundef !4
 ret i32 %_4
}
 ```

@rustbot label llvm-main

[original CI failure](https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/46608/list?sid=019ed950-c81f-466d-a3bc-2064e6a26719&tab=output)
… r=mejrs

Move part of the target checking for `#[may_dangle]` to the parser

Work towards removing the ALL_TARGETS list.
Only one remaining after this!

r? @mejrs
…henkov

Fix invalid E0609 raw pointer deref suggestion inside macros

Fixes rust-lang#158158

`suggest_first_deref_field` blindly applied span math (`shrink_to_lo()`, `between()`) to generate a dereference suggestion for E0609. When the base expression and field access originate from different macro expansions, the `SyntaxContext` mismatch caused the span combinations to fail. This resulted in the compiler falling back to incorrect source locations and generating malformed replacement strings like `&mut (*).`.

* Added a `span.from_expansion()` guard at the top of `suggest_first_deref_field` to check both `base.span` and `field.span`.
* Suppressed the multipart suggestion entirely when inside macro expansions to prevent emitting broken syntax, bypassing complex and unreliable cross-macro span traversals.
* Added a new UI test to ensure the standard E0609 error is emitted cleanly without the garbled `help:` label.
…enerics-2, r=petrochenkov

delegation: add tests for defaults and infers in generics

This PR adds tests for interaction of default generic params and infers in delegation. Moreover, it groups delegation's pretty tests into a single folder and adds one test for generics. Comments in tests explain the behavior.

Part of rust-lang#118212.
r? @petrochenkov
…trochenkov

Generate synthetic generic args only for delegation's child segment

Fixes rust-lang#158152 by generating synthetic generic args only for delegation's child segment.

r? @petrochenkov
cc @fmease
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 25, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 25, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=1

@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit b7c3a9d has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 25, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1,i686-msvc-2

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 25, 2026
Rollup of 8 pull requests


try-job: dist-various-1
try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
try-job: i686-msvc-2
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors p=3
@bors treeclosed=4

@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Tree closed for PRs with priority less than 4.

@jhpratt

jhpratt commented Jun 25, 2026

Copy link
Copy Markdown
Member

nothing but rollupable PRs in the queue now; created a larger rollup to encompass the remaining ones

@jhpratt jhpratt closed this Jun 25, 2026
@rust-bors rust-bors Bot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 25, 2026
@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors rust-bors Bot removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 25, 2026
@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: aae8775 (aae87755539fa91efb1644beb2a95e14090838bd)
Base parent: fa36a47 (fa36a479e492137fdf473a891206da127f132910)

@rust-bors rust-bors Bot mentioned this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants