Add Drop::pin_drop for pinned drops#144537
Add Drop::pin_drop for pinned drops#144537frank-king wants to merge 2 commits intorust-lang:mainfrom
Drop::pin_drop for pinned drops#144537Conversation
362f769 to
1497185
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
1497185 to
9b7201c
Compare
Drop::pin_drop for !Unpin typesDrop::pin_drop for pinned drops
This comment has been minimized.
This comment has been minimized.
d6ddfcf to
7b4bb5c
Compare
This comment has been minimized.
This comment has been minimized.
7b4bb5c to
36ca628
Compare
This comment has been minimized.
This comment has been minimized.
36ca628 to
252d6fc
Compare
This comment has been minimized.
This comment has been minimized.
|
The CI failed because |
252d6fc to
02b0b0d
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
02b0b0d to
7660d88
Compare
This comment has been minimized.
This comment has been minimized.
7660d88 to
33e3124
Compare
This comment has been minimized.
This comment has been minimized.
9618d10 to
c3e34d5
Compare
9b07833 to
fa600c5
Compare
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_hir/src/attrs |
|
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. |
|
Hi @frank-king, from what I can see the latest CI is green now, including the previous lint/linkchecker-related issue. Could you please confirm that this part is fully resolved on your side as well? I also plan to work on the remaining unchecked item in the PR description:
I’ll prepare that as a follow-up PR so this |
|
@rustbot ready |
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
Add `Drop::pin_drop` for pinned drops This PR is part of the `pin_ergonomics` experiment (the tracking issue is #130494). It allows implementing `Drop` with a pinned `self` receiver, which is required for safe pin-projection. Implementations: - [x] At least and at most one of `drop` and `pin_drop` should be implemented. - [x] No direct call of `drop` or `pin_drop`. They should only be called by the drop glue. - [x] `pin_drop` must and must only be used with types that support pin-projection (i.e. types with `#[pin_v2]`). - [ ] Allows writing `fn drop(&pin mut self)` and desugars to `fn pin_drop(&pin mut self)`. (Will be in the next PRs)
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 13a5a99 failed: CI. Failed job:
|
|
@bors retry |
|
@frank-king I opened a stacked follow-up PR for the remaining sugar item: It implements The implementation keeps the remap at resolver/HIR, lowering time: the resolver recognises the sugar only for the actual I also added coverage for hosted Happy to adjust the approach if you would prefer the sugar to be handled at a different compiler boundary. |
This comment has been minimized.
This comment has been minimized.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for edafd5c failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
Broken links in the reference again. |
|
@frank-king @petrochenkov I opened a Reference PR for the current linkchecker failure: rust-lang/reference#2261 It avoids the direct |
|
I think for fixing the test failure, I think I would prefer to do something like this: diff --git a/src/ci/docker/scripts/x86_64-gnu-llvm3.sh b/src/ci/docker/scripts/x86_64-gnu-llvm3.sh
index 17eb2cea59a..d2989b3aae6 100755
--- a/src/ci/docker/scripts/x86_64-gnu-llvm3.sh
+++ b/src/ci/docker/scripts/x86_64-gnu-llvm3.sh
@@ -4,7 +4,9 @@ set -ex
##### Test stage 1 #####
-../x.py --stage 1 test --skip src/tools/tidy
+# linkchecker is skipped because mixing old rustc/rustdoc with new standard
+# library causes problems with generating correct links.
+../x.py --stage 1 test --skip src/tools/tidy --skip src/tools/linkchecker
# Run the `mir-opt` tests again but this time for a 32-bit target.
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` haveGenerally I think it is too problematic to try to get the linkchecks working with cc @jieyouxu @Kobzol in case you want to weigh in on this kind of change. This was previously discussed at https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Skipping.20stage.201.20tests/with/583642338 for a closely related issue. In this case, I don't think we can employ easy tricks to make this work in the general case. |
View all comments
This PR is part of the
pin_ergonomicsexperiment (the tracking issue is #130494). It allows implementingDropwith a pinnedselfreceiver, which is required for safe pin-projection.Implementations:
dropandpin_dropshould be implemented.droporpin_drop. They should only be called by the drop glue.pin_dropmust and must only be used with types that support pin-projection (i.e. types with#[pin_v2]).fn drop(&pin mut self)and desugars tofn pin_drop(&pin mut self). (Will be in the next PRs)