Skip to content

Rollup of 16 pull requests#158413

Closed
JonathanBrouwer wants to merge 45 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-97dQtZu
Closed

Rollup of 16 pull requests#158413
JonathanBrouwer wants to merge 45 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-97dQtZu

Conversation

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Successful merges:

Failed merges:

r? @ghost

Create a similar rollup

sandersaares and others added 30 commits May 11, 2026 15:37
…impl Send + dyn Trait

Add a regression test covering the case where a type uses
PhantomData<*mut ()> to opt out of Sync, restores Send via an unsafe
impl, and is then captured across an .await point with a trait object
type parameter (Box<dyn Trait>).

The compiler currently erases lifetimes in MIR coroutine witnesses,
losing the 'static bound needed to apply the unsafe impl Send. The
test verifies this is fixed by -Zhigher-ranked-assumptions and
documents the PhantomData<Cell<()>> workaround as a comparison. See
the PR description for links to the relevant issues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There will still be one for things that aren't just scalars or scalar pairs.
Co-authored-by: Jesus Checa <101630491+jchecahi@users.noreply.github.com>
When emitting a `memcpy` for a scalable vector, the size computed by
rustc (`num_vectors * element_count * element_ty`), since
rust-lang#157915, needs to be multiplied by `vscale`.
And remove redundant const fn
- const, async, and unsafe functions
- const generics, complex types, and where clauses (including impl Tuple)
…ity.md

The sentence in `src/doc/unstable-book/src/compiler-flags/default-visibility.md`
contained the misspelling "earier" where "earlier" was meant.

```
-shared objects earier in the load order.
+shared objects earlier in the load order.
```

This is detected by the project's typos configuration; `./x test tidy
--extra-checks=spellcheck` would flag it on the next run.

Signed-off-by: Dodothereal <129273127+Dodothereal@users.noreply.github.com>
The new normalization regex is taken from many existing test cases,
see: https://github.com/search?q=repo%3Arust-lang%2Frust+%2Fthread+%27rustc%27%5C.%5C*panicked%2F&type=code

which includes files such as `tests/ui/treat-err-as-bug/span_delayed_bug.rs`
or `tests/ui/treat-err-as-bug/err.rs`
…r=oli-obk

Add arg splat experiment initial tuple impl

### Description

This PR is part of the argument splatting lang experiment, and FFI overloading / C++ interop project goals:
- rust-lang#153629
- https://rust-lang.github.io/rust-project-goals/2026/overloading-for-ffi.html
- https://rust-lang.github.io/rust-project-goals/2025h2/interop-problem-map.html

Example code using existing unstable features:
- https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=f42a3754a63a3d9365670e57257053d5

Discussion of implementation strategy:
- [#t-lang > On overloading @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/On.20overloading/near/579590336)

The PR is the initial implementation of the feature:
- `splat` incomplete feature gate
- `#[splat]` attribute on function arguments
- Splatted function argument TypeInfo
- `#[splat]` function parameter check at THIR level
- splatted MIR lowering (as tupled arguments)
- feature gate and UI tests for item type filtering, non-splattable arguments, splattable tuples, generics, and the "overloading at home" example
  - about half the diff (1100 lines) is tests and test output

Once this PR merges, we can add further functionality, then test it out in interop tools.

### Perf Impact

We expect a 0.1% regression on 5 primary and 0.2% regression on 4 secondary benchmarks in this PR, based on [this perf run](rust-lang#158251 (comment)).

We tried a number of different ways to improve perf. Limiting splat to the 255th or lower argument is a simple hack that gives good perf, and is good enough for an experiment.

This PR series already has significant perf wins in rust-lang#155223 - [0.3% perf improvement across 45 primary benchmarks](rust-lang#155223 (comment)). We're spending a small amount of that perf for the new feature in this PR.

### Out of Scope for this PR

- Change codegen to de-tuple caller and callee
- Better diagnostics
- Full support for splatted function pointer arguments
@rustbot rustbot added A-rustdoc-search Area: Rustdoc's search feature F-autodiff `#![feature(autodiff)]` F-explicit_tail_calls `#![feature(explicit_tail_calls)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler 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-rust-analyzer Relevant to the rust-analyzer 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-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jun 25, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5
@bors treeclosed=1

1 similar comment
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5
@bors treeclosed=1

@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 8b527e0 has been approved by JonathanBrouwer

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 6. This pull request will be tested once the tree is reopened.

@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
@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Tree closed for PRs with priority less than 1.

@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 8b527e0 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Tree closed for PRs with priority less than 1.

@rust-bors

This comment has been minimized.

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

Rollup of 16 pull requests

Successful merges:

 - #153697 (Add arg splat experiment initial tuple impl)
 - #155535 (export symbols: support macos/windows(32/64))
 - #158253 (codegen_ssa: multiply scalable vec size by `vscale`)
 - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected")
 - #158345 (Use `transmute_neo` in `assume_init`)
 - #158369 (std: abort when `resume_unwind` is called inside the panic hook)
 - #158374 (disallow tail calling extern "rust-call" functions)
 - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes")
 - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait)
 - #157181 (autodiff: stop always needing an alloca)
 - #158278 (autodiff - typtree cleanups)
 - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag)
 - #158318 (Make normalization in a test case resilient to dist compilation)
 - #158338 (Reorganize `tests/ui/issues` [14/N])
 - #158343 (Include `Item::const_stability` info in rustdoc JSON.)
 - #158390 (Fix: auto trait, const trait bound)

Failed merges:

 - #158355 (Fixup the refactoring errors in #156246)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job dist-i586-gnu-i586-i686-musl failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/splat/splat-fn-ptr-tuple.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/splat/splat-fn-ptr-tuple/splat-fn-ptr-tuple.stderr`
diff of stderr:

-  compiler error: compiler/rustc_mir_build/src/thir/cx/expr.rs:LL:CC: no splatted def for function or method callee
+  compiler error: /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:LL:CC: no splatted def for function or method callee
2   --> $DIR/splat-fn-ptr-tuple.rs:29:5
3    |
4 LL |     fn_ptr(1, 2);

5    |     ^^^^^^^^^^^^
6 
7 
- 
+ thread 'rustc' ($TID) panicked at /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:1229:13:
9 Box<dyn Any>
10 stack backtrace:
11 

Note: some mismatched output was normalized before being compared
##[error]- error: internal compiler error: /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:1229:13: no splatted def for function or method callee
-   --> /checkout/tests/ui/splat/splat-fn-ptr-tuple.rs:29:5
- thread 'rustc' (188529) panicked at /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:1229:13:
+  compiler error: /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:LL:CC: no splatted def for function or method callee
+ thread 'rustc' ($TID) panicked at /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:1229:13:


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args splat/splat-fn-ptr-tuple.rs`

error: 1 errors occurred comparing output.
status: exit status: 101
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/splat/splat-fn-ptr-tuple.rs" "-Zthreads=1" "-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=i586-unknown-linux-gnu" "--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/splat/splat-fn-ptr-tuple" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/i586-unknown-linux-gnu/native/rust-test-helpers" "-Clinker=i586-unknown-linux-gnu-gcc"
stdout: none
--- stderr -------------------------------
##[error]error: internal compiler error: /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:1229:13: no splatted def for function or method callee
  --> /checkout/tests/ui/splat/splat-fn-ptr-tuple.rs:29:5
   |
---
thread 'rustc' (188529) panicked at /rustc-dev/aec892982a030b600e0b2565914384ee0e4b2b88/compiler/rustc_mir_build/src/thir/cx/expr.rs:1229:13:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: <rustc_errors::DiagCtxtHandle>::span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   7: <rustc_mir_build::thir::cx::ThirBuildCx>::convert_splatted_callee
   8: <rustc_mir_build::thir::cx::ThirBuildCx>::make_mirror_unadjusted::{closure#0}
   9: <rustc_mir_build::thir::cx::ThirBuildCx>::mirror_expr_inner
  10: <&mut <rustc_mir_build::thir::cx::ThirBuildCx>::mirror_stmts::{closure#0} as core::ops::function::FnMut<((usize, &rustc_hir::hir::Stmt),)>>::call_mut
  11: <alloc::vec::Vec<rustc_middle::thir::StmtId> as alloc::vec::spec_from_iter::SpecFromIter<rustc_middle::thir::StmtId, core::iter::adapters::filter_map::FilterMap<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Stmt>>, <rustc_mir_build::thir::cx::ThirBuildCx>::mirror_stmts::{closure#0}>>>::from_iter
  12: <alloc::boxed::Box<[rustc_middle::thir::StmtId]> as core::iter::traits::collect::FromIterator<rustc_middle::thir::StmtId>>::from_iter::<core::iter::adapters::filter_map::FilterMap<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Stmt>>, <rustc_mir_build::thir::cx::ThirBuildCx>::mirror_stmts::{closure#0}>>
  13: <rustc_mir_build::thir::cx::ThirBuildCx>::mirror_block
  14: <rustc_mir_build::thir::cx::ThirBuildCx>::make_mirror_unadjusted::{closure#0}
  15: <rustc_mir_build::thir::cx::ThirBuildCx>::mirror_expr_inner
  16: rustc_mir_build::thir::cx::thir_body
      [... omitted 1 frame ...]
  17: rustc_mir_build::check_unsafety::check_unsafety
      [... omitted 1 frame ...]
  18: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
  19: rustc_data_structures::sync::parallel::par_for_each_in::<&rustc_span::def_id::LocalDefId, &[rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>
  20: <rustc_session::session::Session>::time::<(), rustc_interface::passes::run_required_analyses::{closure#2}>
  21: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  22: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<<rustc_middle::ty::context::GlobalCtxt>::enter<rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}, core::option::Option<rustc_interface::queries::Linker>>::{closure#1}, core::option::Option<rustc_interface::queries::Linker>>::{closure#0}, core::option::Option<rustc_interface::queries::Linker>>
  23: <rustc_middle::ty::context::TyCtxt>::create_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}>
  24: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
  25: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
  26: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}, ()>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.98.0-nightly (aec892982 2026-06-25) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z threads=1 -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ignore-directory-in-diagnostics-source-blocks=/cargo -Z ignore-directory-in-diagnostics-source-blocks=/checkout/vendor -C codegen-units=1 -Z ui-testing -Z deduplicate-diagnostics=no -Z write-long-types-to-disk=no -C strip=debuginfo -C prefer-dynamic -C rpath -C debuginfo=0 -C linker=i586-unknown-linux-gnu-gcc

query stack during panic:
#0 [thir_body] building THIR for `main`
#1 [check_unsafety] unsafety-checking `main`
#2 [analysis] running analysis passes on crate `splat_fn_ptr_tuple`
end of query stack
error: aborting due to 1 previous error
------------------------------------------

---- [ui] tests/ui/splat/splat-fn-ptr-tuple.rs stdout end ----

@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 Jun 25, 2026
@rust-bors

rust-bors Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

💔 Test for aec8929 failed: CI. Failed job:

@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

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

@rust-bors rust-bors Bot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 25, 2026
@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 Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-rustdoc-js Area: Rustdoc's JS front-end A-rustdoc-json Area: Rustdoc JSON backend A-rustdoc-search Area: Rustdoc's search feature F-autodiff `#![feature(autodiff)]` F-explicit_tail_calls `#![feature(explicit_tail_calls)]` rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler 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-rust-analyzer Relevant to the rust-analyzer 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-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.