Skip to content

Initial UnsafePinned implementation [Part 1: Libs]#137043

Merged
bors merged 1 commit into
rust-lang:masterfrom
Sky9x:unsafe-pinned-pt1-libs
Apr 14, 2025
Merged

Initial UnsafePinned implementation [Part 1: Libs]#137043
bors merged 1 commit into
rust-lang:masterfrom
Sky9x:unsafe-pinned-pt1-libs

Conversation

@Sky9x

@Sky9x Sky9x commented Feb 14, 2025

Copy link
Copy Markdown
Contributor

Initial libs changes necessary to unblock further work on RFC 3467.
Tracking issue: #125735

This PR is split off from #136964, and includes just the libs changes:

  • UnsafePinned struct
  • private UnsafeUnpin structural auto trait
  • Lang items for both
  • Compiler changes necessary to block niches on UnsafePinned

This PR does not change codegen, miri, the existing !Unpin hack, or anything else. That work is to be split into later PRs.


cc @RalfJung @Noratrieb

@rustbot label F-unsafe_pinned T-libs-api

@rustbot

rustbot commented Feb 14, 2025

Copy link
Copy Markdown
Collaborator

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. F-unsafe_pinned `#![feature(unsafe_pinned)]` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Feb 14, 2025
@Sky9x Sky9x changed the title Initial UnsafePinned impl [Part 1: Libs] Initial UnsafePinned implementation [Part 1: Libs] Feb 14, 2025
Comment thread library/core/src/pin/unsafe_pinned.rs Outdated
Comment thread library/core/src/pin/unsafe_pinned.rs Outdated
Comment thread library/core/src/marker.rs Outdated
@Sky9x Sky9x force-pushed the unsafe-pinned-pt1-libs branch from e823a89 to 97308a2 Compare February 16, 2025 05:43
Comment thread tests/ui/rfcs/rfc-3467-unsafe-pinned/unsafe-pinned-hides-niche.rs Outdated
Comment thread tests/ui/rfcs/rfc-3467-unsafe-pinned/unsafe-pinned-hides-niche.rs Outdated
Comment thread tests/ui/rfcs/rfc-3467-unsafe-pinned/unsafe-pinned-hides-niche.rs Outdated
@tgross35

Copy link
Copy Markdown
Contributor

Cc @rust-lang/libs-api, this unstably adds the interfaces from the accepted RFC https://rust-lang.github.io/rfcs/3467-unsafe-pinned.html.

Comment thread library/core/src/pin/unsafe_pinned.rs Outdated
Comment thread library/core/src/pin/unsafe_pinned.rs
Comment thread library/core/src/pin/unsafe_pinned.rs Outdated
@Sky9x Sky9x force-pushed the unsafe-pinned-pt1-libs branch 2 times, most recently from 24af599 to 9ec74c7 Compare February 24, 2025 16:44
@rust-log-analyzer

This comment has been minimized.

@Sky9x Sky9x force-pushed the unsafe-pinned-pt1-libs branch from 9ec74c7 to 74efc47 Compare February 24, 2025 16:51
@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Mar 12, 2025

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #138366) made this pull request unmergeable. Please resolve the merge conflicts.

@tgross35 tgross35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This API appears to match RFC 3467 so I think it is good to go. The docs could probably use elaboration at some point, but that should be fine to defer until the feature is fully available.

r=me with one doc request and conflicts resolved.

Cc @WaffleLapkin @RalfJung if you have anything else.

Comment thread library/core/src/pin/unsafe_pinned.rs Outdated

@WaffleLapkin WaffleLapkin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me 👍🏻

@RalfJung

Copy link
Copy Markdown
Member

compiler changes LGTM.

@tgross35

tgross35 commented Apr 4, 2025

Copy link
Copy Markdown
Contributor

@rustbot author for #137043 (review)

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 4, 2025
@rustbot

rustbot commented Apr 4, 2025

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-unsafe_pinned `#![feature(unsafe_pinned)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants