Skip to content

Rollup of 22 pull requests - #165051

Closed
JonathanBrouwer wants to merge 59 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-OlHxgXB
Closed

JonathanBrouwer wants to merge 59 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-OlHxgXB

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

Warning

This rollup conflicts with pending auto build #165042 and may need to be recreated if the pending build succeeds.

r? @ghost

Create a similar rollup

mejrs and others added 30 commits October 21, 2026 23:41
Previously, expressions behind stmt_expr_attributes were only rejected
when the cfg condition evaluated to false. If the condition was true,
the code compiled successfully.

This meant code like an attributed binary operand could compile on one
platform but fail on another, even though removing the operand would leave
an invalid expression.

This change always rejects cfg in expression positions where removing the
expression would produce invalid code. Expression positions where removal is
safe continue to work as before.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
```
error[E0310]: the parameter type `R` may not live long enough
  --> $DIR/implicit-static-lifetime-in-dyn-trait-return-type.rs:10:5
   |
LL | fn bb<R>(r: R) -> Box<dyn Foo> {
   |                       ------- this `dyn Trait` has an implicit `'static` lifetime bound 3
LL |     Box::new(Bar(r))
   |     ^^^^^^^^^^^^^^^^
   |     |
   |     the parameter type `R` must be valid for the static lifetime...
   |     ...so that the type `R` will meet its required lifetime bounds
   |
help: consider adding an explicit lifetime bound
   |
LL | fn bb<R: 'static>(r: R) -> Box<dyn Foo> {
   |        +++++++++
help: consider adding an explicit lifetime bound
   |
LL | fn bb<'a, R>(r: R) -> Box<dyn Foo + 'a> {
   |       +++                         ++++
```
Report the same error for true and false cfg predicates when the
surrounding expression cannot be removed. Apply it consistently during
normal expansion and cfg_eval.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
This is the abstraction that clang/flang both use. It simplifies the
code by quite a bit (although not until we delete the old version).
Mainly this enables the use of the NewPM for LLVM targets that opt-in
(currently only Lanai and MSP430, but more soon).
It's an error to have `#[inline]#[rustc_force_inline]fn blah(){}`, but they both lower to the same `InlineAttr`, so this would error and then have an attribute list of multiple inline attrs
```
error[E0803]: cannot infer an appropriate lifetime for lifetime parameter `'s` in generic type due to conflicting requirements
```
Fixes a side effect of 127a5d9 reported
on Zulip.
…nfer-ice, r=petrochenkov

delegation: emit error when there is no field for `Self` mapping

When there are no fields in delegation parent we emit a delayed bug but no other errors are emitted.

Fixes rust-lang#164760.

r? @petrochenkov
…terator, r=petrochenkov

Don't use `IntoIterator` in parallel API

Almost always we have a ready-to-use slice but the API accept IntoIterator which is then collected into vector and used as a slice again.

Also we almost never need a mutable slice.

`par_range` API is useful, it will be used at least once in miri.

r? @petrochenkov
…r=bjorn3

Refactor call argument codegen

As non-`OperandValue::Immediate` arguments are never passed directly (`PassMode::Direct`) as single LLVM arguments any more, the handling for that case in `codegen_argument` (and the equivalent for LLVM intrinsics) can be removed. This allows `codegen_argument` to be refactored from its current state where it matches on the pass mode three times to only matching on it a single time, making the code much easier to follow.

r? @bjorn3
…uwer

parse inline and rustc_force_inline with same parser

It's an error to have `#[inline]#[rustc_force_inline]fn blah(){}`, but they both lower to the same `InlineAttr`, so this would error and then have an attribute list of multiple inline attrs, which breaks the invariant that a list of attributes has no duplicate variants
…=mejrs

fix: Prevent ICE when comparing EII impl against generic declaration

## Summary

Added a guard in compare_eii_function_types and check_no_generics to skip signature comparison when the EII declaration has type/const parameters.

## Problem

An EII declaration with type parameters ```rust (e.g., #[eii(foo)] fn bar<T>()) ``` triggers error E0044 -> "externally implementable items may not have type parameters". Even aftre the compiler continued analysis and called  to compare the implementation's signature against the declaration's. This comparison generated a `TypeError` containing the decl's `ty::Param(T)`, and the error reporter subsequently tried to look up parameter T in the implementation's generics that werent' there, this caused an ICE:
index out of bounds: the len is 0 but the index is 0

## Fix

Added an early return guard

## Tested variatns

- Generic declaration only
- Generic impl only
- Generic declaration + impl (ICE case)
- No generics (original reproducer)

Closes rust-lang#164621
…r,ada4a

make tool_attrs method to retrieve tool attributes.

Some followup work on rust-lang#164744 (comment)

Short of some kind of parsing/checking framework for tool attributes (which will be a lot of work), I think this is the best solution.

cc @ada4a maybe you're interested in reviewing this as well, there are some clippy changes here too.
…oli-obk

copy_nonoverlapping: dont skip ovelrap check when src is fully uninit

The uninit fast-path skipped the overlap check, leading to missed UB.

Fixes one of the two issues in rust-lang/miri#5499.
r? @oli-obk
…oli-obk

miri: add missing alignment check in write_bytes

Fixes the other part of rust-lang/miri#5499. I just didn't know what we actually emit alignment attributes on `memset`...

r? @oli-obk
…mejrs

Remove Span::eq_ctxt()

Replaced all instances of Span::eq_ctxt with a.ctxt() == b.ctxt(), and removed Span::eq_ctxt. Closes rust-lang#164936
…eywiser

[tiny] Add missing backticks around lifetime name

```
error[E0803]: cannot infer an appropriate lifetime for lifetime parameter `'s` in generic type due to conflicting requirements
```
…aumeGomez

rustdoc-search: rank re-export lower

Fixes a side effect of rust-lang#161362 reported on Zulip.
Update enzyme to fix one bug related to higher-order derivatives

Fix one bug (EnzymeAD/Enzyme#3082 (comment)), discovered as part of rust-lang#160470 (comment)
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Oct 27, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 27, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

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

@rust-bors

rust-bors Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 29fc174 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 Oct 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 27, 2026
Rollup of 22 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
try-job: test-x86_64-gnu-llvm-22-3
try-job: test-aarch64-msvc-2
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-gnu-llvm-22-3 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@rust-bors

rust-bors Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit 29fc174 with merge 2e44078...

Workflow: https://github.com/rust-lang/rust/actions/runs/40569205982

rust-bors Bot pushed a commit that referenced this pull request Oct 27, 2026
…uwer

Rollup of 22 pull requests

Successful merges:

 - #159580 (Reject cfg on expressions that cannot be safely removed)
 - #162597 (raise ambiguity error on attribute macro that could be tool attribute)
 - #162808 (Enable `--generate-link-to-definition` rustdoc option on std docs)
 - #163059 (Recover invalid return type until `{`, `}` or `;`)
 - #163672 (Use runCodeGen Abstraction for new LLVM)
 - #164028 (Add a future incompat warning for #[no_link])
 - #164188 (Suggest adding lifetime for `dyn Trait` in return type)
 - #164345 (fix: handle `false` in root contexts)
 - #164494 (drop ands which are a superset of other ands)
 - #164766 (Unstably introduce MVP edition migration lint `unmarked_unchecked_type_aliases` together with bikeshed attribute `#[rustc_unchecked_type_alias]`)
 - #164785 (delegation: emit error when there is no field for `Self` mapping)
 - #164799 (Don't use `IntoIterator` in parallel API)
 - #164871 (Refactor call argument codegen)
 - #164648 (parse inline and rustc_force_inline with same parser)
 - #164811 (fix: Prevent ICE when comparing EII impl against generic declaration)
 - #164900 (make tool_attrs method to retrieve tool attributes.)
 - #164993 (copy_nonoverlapping: dont skip ovelrap check when src is fully uninit)
 - #164996 (miri: add missing alignment check in write_bytes)
 - #165012 (Remove Span::eq_ctxt())
 - #165013 ([tiny] Add missing backticks around lifetime name)
 - #165024 (rustdoc-search: rank re-export lower)
 - #165028 (Update enzyme to fix one bug related to higher-order derivatives)

> [!WARNING]
> This rollup conflicts with pending auto build #165042 and may need to be recreated if the pending build succeeds.
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 27, 2026
@rust-bors

rust-bors Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

PR #164766, which is a member of this rollup, was unapproved.

This rollup was thus unapproved.

Auto build was cancelled due to unapproval. Cancelled workflows:

@rust-bors

rust-bors Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 2da2860 failed: CI. Failed job:

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollup A PR which is a rollup

Projects

None yet

Development

Successfully merging this pull request may close these issues.