Skip to content

Make PinCoerceUnsized require Deref#149218

Merged
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
theemathas:pin-coerce-unsized
Mar 25, 2026
Merged

Make PinCoerceUnsized require Deref#149218
rust-bors[bot] merged 2 commits intorust-lang:mainfrom
theemathas:pin-coerce-unsized

Conversation

@theemathas
Copy link
Contributor

@theemathas theemathas commented Nov 22, 2025

View all comments

Also, delete impls on non-Deref types.

Pin doesn't do anything useful for non-Deref types, so PinCoerceUnsized on such types makes no sense.

This is a breaking change, since stable code can observe the deleted PinCoerceUnsized impls by uselessly coercing between such types inside a Pin.

There is still some strange behavior, such as Pin<&mut i32> being able to coerce to Pin<&dyn Send>, but not being able to coerce to Pin<&i32>. However, I don't think it's possible to fix this.

Fixes #145081

@theemathas theemathas added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-coercions Area: implicit and explicit `expr as Type` coercions needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. A-pin Area: Pin T-types Relevant to the types team, which will review and decide on the PR/issue. needs-crater This change needs a crater run to check for possible breakage in the ecosystem. labels Nov 22, 2025
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 22, 2025

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@theemathas theemathas force-pushed the pin-coerce-unsized branch 2 times, most recently from f921d32 to f4fa919 Compare November 23, 2025 03:35
@jdonszelmann
Copy link
Contributor

@bors try

rust-bors bot added a commit that referenced this pull request Nov 23, 2025
@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Nov 23, 2025

☀️ Try build successful (CI)
Build commit: 94e8487 (94e848735e78b58442e0b82e9c60f8f430840389, parent: e0e204f3e97ad5f79524b9c259dc38df606ed82c)

@saethlin
Copy link
Member

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-149218 created and queued.
🤖 Automatically detected try build 94e8487
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2025
@craterbot
Copy link
Collaborator

🚧 Experiment pr-149218 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@Darksonn
Copy link
Member

Darksonn commented Dec 1, 2025

I added these impls because otherwise the introduction of PinCoerceUnsized would have been a breaking change. I'm in favor of removing them.

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149218 is completed!
📊 6 regressed and 5 fixed (743358 total)
📊 1966 spurious results on the retry-regessed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149218/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 2, 2025
@workingjubilee
Copy link
Member

@craterbot
Copy link
Collaborator

👌 Experiment pr-149218-1 created and queued.
🤖 Automatically detected try build 94e8487
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 3, 2025
rust-bors bot pushed a commit that referenced this pull request Mar 24, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #149218 (Make PinCoerceUnsized require Deref)
 - #154094 (add neon load/store assembly test)
 - #154142 (Delegation: eliminate usage of AST from generics creation)
 - #154276 (allow `incomplete_features` in more tests)
 - #154284 (doc: linker-plugin-based LTO: update list of good combinations)
 - #154286 (Cherry-pick 1.94.1 release notes)
 - #154303 (Remove more `BuiltinLintDiag` variants - part 2)
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 24, 2026
Make PinCoerceUnsized require Deref



Also, delete impls on non-Deref types.

Pin doesn't do anything useful for non-Deref types, so PinCoerceUnsized on such types makes no sense.

This is a breaking change, since stable code can observe the deleted `PinCoerceUnsized` impls by uselessly coercing between such types inside a `Pin`.

There is still some strange behavior, such as `Pin<&mut i32>` being able to coerce to `Pin<&dyn Send>`, but not being able to coerce to `Pin<&i32>`. However, I don't think it's possible to fix this.

Fixes #145081
@JonathanBrouwer
Copy link
Contributor

@bors r-
#154312 (comment)

@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 Mar 24, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 24, 2026

This pull request was unapproved.

This PR was contained in a rollup (#154312), which was unapproved.

Auto build was cancelled due to unapproval. Cancelled workflows:

@rustbot rustbot added the O-SGX Target: SGX label Mar 25, 2026
@rustbot

This comment has been minimized.

Also, delete impls on non-Deref types.

Pin doesn't do anything useful for non-Deref types, so PinCoerceUnsized
on such types makes no sense.

This is a breaking change, since stable code can observe the deleted
`PinCoerceUnsized` impls by uselessly coercing between such types
inside a `Pin`.

There is still some strange behavior, such as `Pin<&mut i32>` being
able to coerce to `Pin<&dyn Send>`, but not being able to coerce to
`Pin<&i32>`. However, I don't think it's possible to fix this.

Fixes rust-lang#145081
@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@theemathas
Copy link
Contributor Author

The UserRef type in the SGX code seemingly is meant to be used as &UserRef<T> and &mut UserRef<T>. It's never meant to be used as a by-value UserRef<T>. Therefore, the PinCoerceUnsized impl for it doesn't make much sense, as users aren't meant to be making a Pin<UserRef<T>>. Therefore, I've removed the impl.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 25, 2026
@oli-obk
Copy link
Contributor

oli-obk commented Mar 25, 2026

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 25, 2026

📌 Commit f55c8cc has been approved by oli-obk

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

This comment has been minimized.

@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 Mar 25, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 25, 2026

☀️ Test successful - CI
Approved by: oli-obk
Duration: 3h 44m 40s
Pushing 64d5cb6 to main...

@rust-bors rust-bors bot merged commit 64d5cb6 into rust-lang:main Mar 25, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 25, 2026
@github-actions
Copy link
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 8a70352 (parent) -> 64d5cb6 (this PR)

Test differences

Show 562 test diffs

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

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 64d5cb603b9caf9063d27d64fdfa61fa7af3b98f --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. dist-apple-various: 1h 33m -> 2h 10m (+38.8%)
  2. aarch64-apple: 2h 39m -> 3h 35m (+35.4%)
  3. dist-aarch64-apple: 1h 33m -> 1h 57m (+24.9%)
  4. dist-x86_64-apple: 1h 58m -> 2h 24m (+21.5%)
  5. pr-check-1: 31m 37s -> 25m 9s (-20.5%)
  6. x86_64-gnu-llvm-22-2: 1h 39m -> 1h 23m (-15.6%)
  7. aarch64-gnu-llvm-21-1: 59m 24s -> 51m 21s (-13.6%)
  8. dist-aarch64-llvm-mingw: 1h 53m -> 1h 39m (-12.5%)
  9. x86_64-gnu-tools: 1h 3m -> 55m 54s (-12.3%)
  10. x86_64-gnu-gcc: 1h 9m -> 1h 1m (-11.8%)
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
Collaborator

Finished benchmarking commit (64d5cb6): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.3%)

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

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

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 482.838s -> 483.648s (0.17%)
Artifact size: 394.91 MiB -> 394.87 MiB (-0.01%)

@theemathas theemathas deleted the pin-coerce-unsized branch March 26, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-coercions Area: implicit and explicit `expr as Type` coercions A-pin Area: Pin disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. I-lang-radar Items that are on lang's radar and will need eventual work or consideration. merged-by-bors This PR was explicitly merged by bors. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. O-SGX Target: SGX relnotes Marks issues that should be documented in the release notes of the next release. T-lang Relevant to the language team T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PinCoerceUnsized has strange impls