Skip to content

Rollup of 14 pull requests - #165400

Closed
JonathanBrouwer wants to merge 41 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Xrvczwx
Closed

JonathanBrouwer wants to merge 41 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-Xrvczwx

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

yilin0518 and others added 30 commits October 13, 2026 12:59
OpenBSD added getexecpath(3) to libc, which returns an
already-canonicalized executable path directly. Replace the
sysctl(KERN_PROC_ARGV)-based implementation.

This was the last user of div_exact in std, so drop the
exact_div feature gate.
…poll impl instead of the desugared creator function.
It is already rejected on such functions, and keeping it only produced a
redundant 'incompatible with #[cold]' error.
…being allowed

Upstream no longer rejects the combination, so replace the UI test expecting
that error with a codegen test checking that the body coroutine still inherits
the target features.
…cdylib test:

- Add `sys::thread_local::guard::aix` using `__pt_atexit_np` to run main
  thread TLS destructors on process exit on AIX.
- Update `dynamic-loading-cdylib` to use member archive syntax (`RTLD_MEMBER`)
  for `dlopen` on AIX.
- Replace the mode array in `dynamic-loading-cdylib` with a `COMMAND_ARGS`
  constant that selects `load_only` for musl and AIX because `dlclose` does
  not invoke TLS destructors on those platforms.
A comment against PR 151817 mentioned that the test file added in this
PR kept causing "arbitrary" test file changes.

This is because one line of the expanded output sits *just* at 78
columns, which is the pretty-printer's margin. Adding or removing a
symbol shifts every index after it, and when one of those gains or loses
a digit, the wrapping moves.

We cannot use `normalize-stdout` as the layout is decided before
normalization runs.

We fix this by avoiding a strict golden comparison, and instead using a
regex to directly test that the expected syntax contexts exist in the
expanded output.
* Add regression test against rigidity assertion
* Make non-rigid types equal to one another on error reporting
* Bless errors after rigid treatment change
* Remove previously useful crash test!
* Add suggested comments from code review
…ttr, r=saethlin

Make inline attributes apply to the generated `poll` in async fn

This PR adds lowering code (similar to how track_caller forwarding works) to `async fn` items and `async ||` closures such that any inline attributes put on them are inherited by the generated coroutine (corresponding to the `poll()` implementation) and are not applied to the outer function. This behavior matches the accepted FCP in the first linked issue.

Code like the following now correctly codegen 3 functions
- `async_fn_test::consumer`
- `async_fn_test::hi::{closure#0}`
- `core::ptr::drop_in_place::<async_fn_test::hi::{closure#0}>`
```rust
#[inline(never)]
pub async fn hi() -> i32 {
    1337
}

pub fn consumer(cx: &mut Context<'_>) -> Option<i32> {
    let fut = hi();
    let pinned = pin!(fut);
    match pinned.poll(cx) {
        Poll::Ready(value) => Some(value),
        Poll::Pending => None,
    }
}
```

Fixes rust-lang#129347 and fixes rust-lang#106765.

This has already been FCP'ed here: rust-lang#129347
[perf] Reuse CanonicalVarKinds if no new variables were added

Have seen a perf improvement locally.
The idea is to reuse the output of `mk_canonical_var_kinds` if `self.state.var_kinds` is unchanged
…=lcnr

Avoid building a region map when erasing bound regions

In `instantiate_bound_regions_with_erased`, a closure always returns `self.lifetimes.re_erased`, so cache map that `instantiate_bound_regions` creates is unnecessary here.

https://github.com/rust-lang/rust/blob/09026e0fcc8e3c31697db6ce158d8ff8b7df52d0/compiler/rustc_middle/src/ty/fold.rs#L64-L78
@rustbot rustbot added A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-raw-pointers Area: raw pointers, MaybeUninit, NonNull A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-thread Area: `std::thread` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Nov 3, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

@rust-bors

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit feb605a 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 Nov 3, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #149245 (Make inline attributes apply to the generated `poll` in async fn)
 - #164304 ([perf] Reuse CanonicalVarKinds if no new variables were added)
 - #165109 (Avoid building a region map when erasing bound regions)
 - #163393 (std: Use getexecpath() for current_exe() on OpenBSD)
 - #164896 (offload: pass the linked device image to the host pass)
 - #165358 (Reenable some cg_gcc tests that were disabled)
 - #165371 (Don't use `llvm_type` as the type of `static`s.)
 - #162232 (Replace `builtin #` with `k#`)
 - #162608 (Avoid oscillating line wrapping due to symbol indices)
 - #164241 (make the safety documentation consistent in Ptr module)
 - #165029 (Use `MalformedLintAttributeInput` in more places)
 - #165203 (AIX: Implement TLS destructor guard in std and update dynamic-loading-cdylib test)
 - #165230 (Fix rigidity assertion ICE)
 - #165374 (Refactorings in preparation for the move trait)
@rust-bors

This comment has been minimized.

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

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 3508222 failed: CI. Failed job:

@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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 3, 2026
@rust-bors

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-various failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
To only update this specific test, also pass `--test-args offload/non_tuple_args.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/offload/non_tuple_args.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-musl" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offload/non_tuple_args" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-musl/native/rust-test-helpers" "-Clinker=x86_64-linux-musl-gcc" "--edition=2015" "-Zunstable-options" "-Zoffload=Device" "-Clto=fat"
stdout: none
--- stderr -------------------------------
warning: dropping unsupported crate type `cdylib` for target `x86_64-unknown-linux-musl`

error: `args` must be a tuple literal
##[error]  --> /checkout/tests/ui/offload/non_tuple_args.rs:7:5
   |
LL |     core::offload::offload! { kernel = kernel_0, args = 42 }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `$crate::offload` which comes from the expansion of the macro `core::offload::offload` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `args` must be a tuple literal
##[error]  --> /checkout/tests/ui/offload/non_tuple_args.rs:13:5
   |
LL |     core::offload::offload! { kernel = kernel_0, args = args }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in the macro `$crate::offload` which comes from the expansion of the macro `core::offload::offload` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors; 1 warning emitted
---
diff of stderr:

+ warning: dropping unsupported crate type `cdylib` for target `x86_64-unknown-linux-musl`
+ 
1 error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
2   --> $DIR/region_by_ref.rs:30:5
3    |

22 LL |     core::intrinsics::offload::<_, _, ()>(
23    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
---
To only update this specific test, also pass `--test-args offload/region_by_ref.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/offload/region_by_ref.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-musl" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offload/region_by_ref" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-musl/native/rust-test-helpers" "-Clinker=x86_64-linux-musl-gcc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offload/region_by_ref/auxiliary" "--edition=2024" "-Zunstable-options" "-Zoffload=Device" "-Clto=fat" "--extern" "offload_strategies=/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offload/region_by_ref/auxiliary/liboffload_strategies.rlib"
stdout: none
--- stderr -------------------------------
warning: dropping unsupported crate type `cdylib` for target `x86_64-unknown-linux-musl`

error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
##[error]  --> /checkout/tests/ui/offload/region_by_ref.rs:30:5
   |
LL |     core::intrinsics::offload::<_, _, ()>(
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
##[error]  --> /checkout/tests/ui/offload/region_by_ref.rs:42:5
   |
LL |     core::intrinsics::offload::<_, _, ()>(
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
##[error]  --> /checkout/tests/ui/offload/region_by_ref.rs:54:5
   |
LL |     core::intrinsics::offload::<_, _, ()>(
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice
##[error]  --> /checkout/tests/ui/offload/region_by_ref.rs:66:5
   |
LL |     core::intrinsics::offload::<_, _, ()>(
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

---
To only update this specific test, also pass `--test-args offload/type_mismatch.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/offload/type_mismatch.rs" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-musl" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/offload/type_mismatch" "-Znext-solver=coherence" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-musl/native/rust-test-helpers" "-Clinker=x86_64-linux-musl-gcc" "--edition=2015" "-Zunstable-options" "-Zoffload=Device" "-Clto=fat"
stdout: none
--- stderr -------------------------------
warning: dropping unsupported crate type `cdylib` for target `x86_64-unknown-linux-musl`

error: expected a function item for the offload kernel, found `i32`
##[error]  --> /checkout/tests/ui/offload/type_mismatch.rs:8:5
   |
LL |     core::intrinsics::offload::<_, _, ()>(not_fn, [1, 1, 1], [1, 1, 1], 0, -1, ());
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel expects 1 arguments, but 0 arguments were provided
##[error]  --> /checkout/tests/ui/offload/type_mismatch.rs:12:5
   |
LL |     core::intrinsics::offload::<_, _, ()>(kernel_1, [1, 1, 1], [1, 1, 1], 0, -1, ());
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: type mismatch in offload kernel argument 0: expected `f32`, found `f64`
##[error]  --> /checkout/tests/ui/offload/type_mismatch.rs:16:5
   |
LL |     core::intrinsics::offload::<_, _, ()>(kernel_1, [1, 1, 1], [1, 1, 1], 0, -1, (42.0f64,));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: offload kernel return type mismatch: kernel returns `()`, but offload call expects `f64`
##[error]  --> /checkout/tests/ui/offload/type_mismatch.rs:20:18
   |
LL |     let _: f64 = core::intrinsics::offload::<_, _, f64>(kernel_0, [1, 1, 1], [1, 1, 1], 0, -1, ());
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: type mismatch in offload kernel argument 0: expected `f32`, found `f64`
##[error]  --> /checkout/tests/ui/offload/type_mismatch.rs:24:5
   |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-CI Area: Our Github Actions CI A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-raw-pointers Area: raw pointers, MaybeUninit, NonNull A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc A-thread Area: `std::thread` 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-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.