Repository navigation
Rollup of 22 pull requests - #165051
Closed
JonathanBrouwer wants to merge 59 commits into
Closed
Rollup of 22 pull requests#165051JonathanBrouwer wants to merge 59 commits into
JonathanBrouwer wants to merge 59 commits into
Conversation
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.
…td::no_code` macro
…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)
Member
Author
Contributor
This comment has been minimized.
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
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
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.
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: |
Contributor
|
💔 Test for 2da2860 failed: CI. Failed job:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
--generate-link-to-definitionrustdoc option on std docs #162808 (Enable--generate-link-to-definitionrustdoc option on std docs){,}or;#163059 (Recover invalid return type until{,}or;)dyn Traitin return type #164188 (Suggest adding lifetime fordyn Traitin return type)falsein root contexts #164345 (fix: handlefalsein root contexts)unmarked_unchecked_type_aliasestogether with bikeshed attribute#[rustc_unchecked_type_alias]#164766 (Unstably introduce MVP edition migration lintunmarked_unchecked_type_aliasestogether with bikeshed attribute#[rustc_unchecked_type_alias])Selfmapping #164785 (delegation: emit error when there is no field forSelfmapping)IntoIteratorin parallel API #164799 (Don't useIntoIteratorin parallel API)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