Skip to content

Rollup of 12 pull requests#156617

Merged
rust-bors[bot] merged 27 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-M30TGcY
May 16, 2026
Merged

Rollup of 12 pull requests#156617
rust-bors[bot] merged 27 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-M30TGcY

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

TomtheCoder2 and others added 27 commits May 9, 2026 17:50
When an unconstrained type or lifetime parameter is detected in an
`impl`, provide more specific help based on its usage:
- If the parameter is entirely unused, suggest removing it.
- If it is used in the `impl` body but not the `Self` type, suggest
  including it in the `Self` type and the struct definition.

This also adds a comprehensive UI test for these cases.
This ensures that user arguments can override target arguments without being silently ignored.
The linker will complain about undefined symbols otherwise and on object
file formats with two level namespaces (Mach-O and PE/COFF) it is
required to know which dylib a symbol will be imported from when linking
a dylib or executable.
…er-fix, r=davidtwco

Unconstrained parameter fix

This PR is an attempt to solve the issue described in the issue rust-lang#107295
…onszelmann

Require EIIs to be defined when we compile a rust dylib

The linker will complain about undefined symbols otherwise and on object file formats with two level namespaces (Mach-O and PE/COFF) it is required to know which dylib a symbol will be imported from when linking a dylib or executable.

r? @jdonszelmann
…ream, r=petrochenkov

Implement pinned drop sugar

Implements `fn drop(&pin mut self)` as sugar for `Drop::pin_drop`.

The resolver recognizes `fn drop(&pin mut self)` syntactically in trait impls and performs lookup using the effective `pin_drop` name. AST lowering independently rechecks the syntactic sugar, validates that the resolved item belongs to the actual `Drop` lang trait, and emits HIR with ident `pin_drop` for accepted sugar. Existing type checking, Drop validation, drop glue, and direct-call checks remain unchanged.

Drop identity is checked during AST lowering through `tcx.lang_items().drop_trait()`, after resolver has performed the effective `pin_drop` lookup. The resolver does not need to know whether the trait is the actual `Drop` lang item, and it no longer passes marked impl item IDs to lowering.

This intentionally preserves the base pinned-drop behavior where `#[pin_v2]` types must use `pin_drop`, while non-`#[pin_v2]` types may still implement `pin_drop`.

r? @petrochenkov

## Related

rust-lang#144537
rust-lang#130494
…lexcrichton

Allow user-provided `llvm_args` to override target spec arguments

This switches the order in which `-Cllvm-args` is applied between target-spec arguments and user-provided LLVM arguments.

This came up in rust-lang#156061, where the target passing `-Cllvm-args=-wasm-use-legacy-eh=false` means that a user passing `-Cllvm-args=-wasm-use-legacy-eh=true` cannot override this value since the LLVM arguments support the last argument overriding the previous, and user arguments were chained first.

With this change, it is possible for Wasm targets to opt into legacy EH for compatibility with runtimes that don't yet implement the modern exnref/try_table instructions, such as Node.js 20 on V8 11.3 and older browsers. While Node.js 20 is formally EOL, many libraries will still need to support this version for a few months yet, so this would ease the transition path to modern exception handling having an opt-out.

Originally this PR added support for a dedicated `-Z` flag for switching to legacy exception handling, but fine-grained control over the arguments would be a preferable solution provided it does not conflict with other behaviours.

//cc @alexcrichton
Disable `main_needs_argc_argv` for Wasm

AFAIU this explains to the "Rust Runtime" that `main()` doesn't need `argc`/`argv`. Newer Wasm targets have explicitly disabled this, this PR changes it so that the base Wasm configuration affecting all Wasm targets disables this now.

This affects the following targets:
- `wasm32-unknown-unknown`
- `wasm32v1-none`
- `wasm64-unknown-unknown`

The only Wasm target where `main_needs_argc_argv` is still enabled is `wasm32-unknown-emscripten`. @hoodmane let me know and I can remove it there as well.

Credit goes to @Spxg for stumbling on this.

r? @alexcrichton
…BoxyUwU

Make const param default test reproduce original ICE

As discussed in [comment](rust-lang#156325 (comment)).

ICE using old logic:
[old-logic-ice.txt](https://github.com/user-attachments/files/27797628/old-logic-ice.txt)

r? BoxyUwU
actually run the temp_dir doctest

No idea why this currently doesn't get run.

That said, this might fail in Miri, so we may have to wait for rust-lang/miri#5029.
…utf8-pattern, r=ChrisDenton

Require UTF-8 in `Utf8Pattern::StringPattern`

Store `&str` instead, so the UTF-8 invariant is enforced at the API boundary.

Fixes rust-lang#156491
…, r=petrochenkov

delegation: emit error when self type is not specified and accessed

This PR adds error reporting when we create error self type if it was not specified. In most of the tests there were other errors, so this delayed bug was not triggered, but there are cases like `reuse Default::default;` (rust-lang#156388) which does not emit other errors and those delayed bugs are triggered.

Part of rust-lang#118212. Fixes rust-lang#156388.

r? @petrochenkov
…i-obk

Use DropCtxt::new_block and new_block_with_statements systematically.

Misc cleanups I found while staring at that code.
…xpansion, r=Urgau

Correctly handle associated items in rustdoc macro expansion

Fixes rust-lang#156075.

The bug was simply that it didn't cover associated items.

r? @Urgau
coverage: Reduce and clarify the context-mismatch test case

Most of the complexity in this test case isn't needed to reproduce the condition observed in rust-lang#147339.

I have checked that this reduced test case still triggers the context-mismatch in `extract_refined_covspans`.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 15, 2026
@rustbot rustbot added 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. labels May 15, 2026
@rustbot rustbot added 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-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 May 15, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

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
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 15, 2026

📌 Commit d1da72a 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 May 15, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 15, 2026
Rollup of 12 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
@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 15, 2026

☀️ Try build successful (CI)
Build commit: 31027fc (31027fc4cdf9587be1de6977d405bef86c02f459, parent: 88ba7fbe0a6eda36e0adbfd0482856f3784031b9)

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 16, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 16, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 9m 27s
Pushing 3514361 to main...

@rust-bors rust-bors Bot merged commit 3514361 into rust-lang:main May 16, 2026
13 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing d7f14d3 (parent) -> 3514361 (this PR)

Test differences

Show 153 test diffs

Stage 1

  • [assembly] tests/assembly-llvm/wasm_legacy_eh.rs: [missing] -> ignore (only executed when the architecture is wasm32) (J1)
  • [rustdoc-html] tests/rustdoc-html/macro-expansion/assoc-items-decl-macro.rs: [missing] -> pass (J1)
  • [rustdoc-html] tests/rustdoc-html/macro-expansion/assoc-items-macro.rs: [missing] -> pass (J1)
  • [ui] tests/ui/delegation/self-ty-ice-156388.rs: [missing] -> pass (J1)
  • [ui] tests/ui/eii/dylib_needs_impl.rs: [missing] -> pass (J1)
  • [ui] tests/ui/generics/unconstrained-param-default-available.rs: [missing] -> pass (J1)
  • [ui] tests/ui/generics/unconstrained-used-param.rs: [missing] -> pass (J1)
  • [ui] tests/ui/pin-ergonomics/pinned-drop-sugar-no-core.rs: [missing] -> pass (J1)
  • [ui] tests/ui/pin-ergonomics/pinned-drop-sugar-not-other-traits.rs: [missing] -> pass (J1)
  • [ui] tests/ui/pin-ergonomics/pinned-drop-sugar.rs: [missing] -> pass (J1)
  • [ui] tests/ui/suggestions/unconstrained-params.rs: [missing] -> pass (J1)

Stage 2

  • [rustdoc-html] tests/rustdoc-html/macro-expansion/assoc-items-decl-macro.rs: [missing] -> pass (J0)
  • [rustdoc-html] tests/rustdoc-html/macro-expansion/assoc-items-macro.rs: [missing] -> pass (J0)
  • [ui] tests/ui/eii/dylib_needs_impl.rs: [missing] -> pass (J2)
  • [ui] tests/ui/delegation/self-ty-ice-156388.rs: [missing] -> pass (J3)
  • [ui] tests/ui/generics/unconstrained-param-default-available.rs: [missing] -> pass (J3)
  • [ui] tests/ui/generics/unconstrained-used-param.rs: [missing] -> pass (J3)
  • [ui] tests/ui/pin-ergonomics/pinned-drop-sugar-no-core.rs: [missing] -> pass (J3)
  • [ui] tests/ui/pin-ergonomics/pinned-drop-sugar-not-other-traits.rs: [missing] -> pass (J3)
  • [ui] tests/ui/pin-ergonomics/pinned-drop-sugar.rs: [missing] -> pass (J3)
  • [ui] tests/ui/suggestions/unconstrained-params.rs: [missing] -> pass (J3)
  • [ui] tests/ui/eii/dylib_needs_impl.rs: [missing] -> ignore (skipping test as target does not support all of the crate types ["dylib"]) (J4)
  • [assembly] tests/assembly-llvm/wasm_legacy_eh.rs: [missing] -> ignore (only executed when the architecture is wasm32) (J5)

Additionally, 130 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 35143615544ede08a47947901cd4a6b7c5ecd450 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-gcc: 54m 41s -> 1h 12m (+32.7%)
  2. x86_64-gnu-aux: 3h 19m -> 2h 17m (-31.3%)
  3. x86_64-msvc-ext3: 1h 26m -> 1h 49m (+27.4%)
  4. x86_64-gnu-stable: 1h 54m -> 2h 23m (+26.0%)
  5. x86_64-msvc-ext2: 1h 29m -> 1h 51m (+24.8%)
  6. i686-msvc-2: 1h 45m -> 2h 10m (+23.6%)
  7. x86_64-gnu-llvm-21-2: 1h 17m -> 1h 33m (+20.7%)
  8. dist-riscv64-linux: 1h 30m -> 1h 12m (-19.6%)
  9. dist-x86_64-illumos: 1h 27m -> 1h 44m (+19.3%)
  10. dist-x86_64-apple: 2h 19m -> 1h 56m (-16.0%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#148788 Unconstrained parameter fix d187e7e0e211de55ac89054691628c82663e94a6 (link)
#156319 Require EIIs to be defined when we compile a rust dylib 25fb04adb6c901aa1b8d142200522987b7a42b46 (link)
#156452 Implement pinned drop sugar 8cdf52b76c04ac9bd07ba94e4cd342e007a0e310 (link)
#156493 actually run the temp_dir doctest 582449ccbfb545e1f017f3ffddae1c59860f9ada (link)
#156554 Allow user-provided llvm_args to override target spec arg… ce68792fd66596490e7fe4630e0e53ac9e0876c3 (link)
#156556 Require UTF-8 in Utf8Pattern::StringPattern fadb5539c21484f9e975890e650fc482e4673c16 (link)
#156565 delegation: emit error when self type is not specified and … 7ce9ad5a1dedfb8dd1382eb274c208ae0a3eae3a (link)
#156571 Disable main_needs_argc_argv for Wasm 7071bbdd1c606aa7add9ca68fa1c8cdebff82ab2 (link)
#156586 Use DropCtxt::new_block and new_block_with_statements syste… 68768b7fca271715835f54f75ce49f1152a9e1db (link)
#156587 Correctly handle associated items in rustdoc macro expansion e364ccbf3c675d0d2e0dcfb36ce3f16bb588a8c4 (link)
#156600 Make const param default test reproduce original ICE dbf8b11c498da73a42291e8bf080139ba60dcc26 (link)
#156604 coverage: Reduce and clarify the context-mismatch test case be894158c32dfe055146ea64ded290d36917313e (link)

previous master: d7f14d3d89

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (3514361): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary -0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-2.8%, 2.3%] 2

Cycles

This perf run didn't have relevant results for this metric.

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 511.252s -> 513.812s (0.50%)
Artifact size: 398.43 MiB -> 398.43 MiB (0.00%)

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. merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup 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-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.