Skip to content

Implement pin!() using super let #139114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 19, 2025
Merged

Implement pin!() using super let #139114

merged 4 commits into from
Apr 19, 2025

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Mar 29, 2025

Tracking issue for super let: #139076

This uses super let to implement pin!().

This means we can remove the hack we had to put in to fix #138596.

It also means we can remove the original hack to make pin!() work, which used a questionable public-but-unstable field rather than a proper private field.

While super let is still unstable and subject to change, it seems safe to assume that future Rust will always have a way to express pin!() in a compatible way, considering pin!() is already stable.

It'd help the experiment to have pin!() use super let, so we can get some more experience with it.

@m-ou-se m-ou-se self-assigned this Mar 29, 2025
@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations 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. labels Mar 29, 2025
@m-ou-se m-ou-se mentioned this pull request Mar 29, 2025
29 tasks
@m-ou-se m-ou-se removed the PG-exploit-mitigations Project group: Exploit mitigations label Mar 29, 2025
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Mar 29, 2025
@m-ou-se m-ou-se removed the PG-exploit-mitigations Project group: Exploit mitigations label Mar 29, 2025
@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Mar 30, 2025
@m-ou-se m-ou-se removed the PG-exploit-mitigations Project group: Exploit mitigations label Mar 30, 2025
@bors
Copy link
Collaborator

bors commented Apr 1, 2025

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

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Apr 9, 2025
@m-ou-se m-ou-se removed the PG-exploit-mitigations Project group: Exploit mitigations label Apr 9, 2025
@m-ou-se m-ou-se marked this pull request as ready for review April 9, 2025 13:08
@rustbot

This comment was marked as outdated.

@m-ou-se
Copy link
Member Author

m-ou-se commented Apr 9, 2025

r? compiler

@rustbot rustbot assigned davidtwco and unassigned m-ou-se Apr 9, 2025
@bors

This comment was marked as outdated.

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Apr 10, 2025
@m-ou-se m-ou-se removed the PG-exploit-mitigations Project group: Exploit mitigations label Apr 10, 2025
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 18, 2025
@matthiaskrgr
Copy link
Member

@bors retry

2025-04-18T19:12:34.8633667Z    Compiling foo v0.1.0 (D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-tools\x86_64-pc-windows-msvc\tmp\cit\t245\foo)
2025-04-18T19:12:34.8634860Z    Compiling bar v0.1.0 (D:\a\rust\rust\build\x86_64-pc-windows-msvc\stage1-tools\x86_64-pc-windows-msvc\tmp\cit\t245\foo\bar)
2025-04-18T19:12:34.8636135Z error: couldn't create a temp dir: Access is denied. (os error 5) at path "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustccfrkMc"
2025-04-18T19:12:34.8636837Z
2025-04-18T19:12:34.8637137Z error: could not compile `foo` (bin "foo") due to 1 previous error

``

@bors bors 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 Apr 18, 2025
@matthiaskrgr matthiaskrgr added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Apr 18, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 18, 2025
Implement `pin!()` using `super let`

Tracking issue for super let: rust-lang#139076

This uses `super let` to implement `pin!()`.

This means we can remove [the hack](rust-lang#138717) we had to put in to fix rust-lang#138596.

It also means we can remove the original hack to make `pin!()` work, which used a questionable public-but-unstable field rather than a proper private field.

While `super let` is still unstable and subject to change, it seems safe to assume that future Rust will always have a way to express `pin!()` in a compatible way, considering `pin!()` is already stable.

It'd help [the experiment](rust-lang#139076) to have `pin!()` use `super let`, so we can get some more experience with it.
@bors
Copy link
Collaborator

bors commented Apr 18, 2025

⌛ Testing commit 5523c87 with merge 349aee2...

@bors
Copy link
Collaborator

bors commented Apr 18, 2025

💔 Test failed - checks-actions

@bors bors 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 Apr 18, 2025
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@m-ou-se
Copy link
Member Author

m-ou-se commented Apr 19, 2025

@bors retry

@bors bors 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 Apr 19, 2025
@bors
Copy link
Collaborator

bors commented Apr 19, 2025

⌛ Testing commit 5523c87 with merge a7c39b6...

@bors
Copy link
Collaborator

bors commented Apr 19, 2025

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing a7c39b6 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 19, 2025
@bors bors merged commit a7c39b6 into rust-lang:master Apr 19, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 19, 2025
Copy link

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 2ef7858 (parent) -> a7c39b6 (this PR)

Test differences

Show 49 test diffs

Stage 0

  • pin_macro::temp_lifetime: pass -> [missing] (J1)

Stage 1

  • [ui] tests/ui/feature-gates/feature-gate-unsafe_pin_internals.rs: pass -> [missing] (J2)
  • [ui] tests/ui/pin-macro/cant_access_internals.rs: pass -> [missing] (J2)

Stage 2

  • [ui] tests/ui/feature-gates/feature-gate-unsafe_pin_internals.rs: pass -> [missing] (J0)
  • [ui] tests/ui/pin-macro/cant_access_internals.rs: pass -> [missing] (J0)

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

Job group index

Job duration changes

  1. dist-aarch64-linux: 5282.2s -> 7591.8s (43.7%)
  2. x86_64-apple-1: 8265.6s -> 6235.6s (-24.6%)
  3. dist-x86_64-apple: 10601.5s -> 8293.5s (-21.8%)
  4. x86_64-apple-2: 4845.3s -> 5766.6s (19.0%)
  5. aarch64-apple: 3980.0s -> 3698.9s (-7.1%)
  6. dist-ohos: 10661.5s -> 9945.9s (-6.7%)
  7. dist-armv7-linux: 5781.1s -> 5413.6s (-6.4%)
  8. dist-apple-various: 6128.4s -> 6504.5s (6.1%)
  9. dist-x86_64-freebsd: 5136.0s -> 4879.8s (-5.0%)
  10. dist-i686-linux: 5826.9s -> 6109.6s (4.9%)
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 (a7c39b6): 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 -0.5%, secondary -2.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.2% [0.4%, 2.0%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-2.2%, -0.4%] 14
Improvements ✅
(secondary)
-2.7% [-3.3%, -2.3%] 5
All ❌✅ (primary) -0.5% [-2.2%, 2.0%] 16

Cycles

Results (primary -0.6%, secondary -2.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.8%, -0.4%] 15
Improvements ✅
(secondary)
-2.9% [-3.4%, -2.0%] 8
All ❌✅ (primary) -0.6% [-0.8%, -0.4%] 15

Binary size

Results (primary 0.0%, secondary 0.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.0% [0.0%, 0.0%] 3
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 9
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 3

Bootstrap: 774.105s -> 772.535s (-0.20%)
Artifact size: 365.05 MiB -> 364.98 MiB (-0.02%)

ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 20, 2025
…Urgau

Remove (now unused) #[rustc_macro_edition_2021] attribute

Now that rust-lang#139114 has been merged, we no longer need the temporary hack (`#[rustc_macro_edition_2021]`) that we introduced in rust-lang#138717. Time to remove it.
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull request Apr 20, 2025
…Urgau

Remove (now unused) #[rustc_macro_edition_2021] attribute

Now that rust-lang#139114 has been merged, we no longer need the temporary hack (`#[rustc_macro_edition_2021]`) that we introduced in rust-lang#138717. Time to remove it.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 20, 2025
Rollup merge of rust-lang#140067 - m-ou-se:remove-macro-2021-hack, r=Urgau

Remove (now unused) #[rustc_macro_edition_2021] attribute

Now that rust-lang#139114 has been merged, we no longer need the temporary hack (`#[rustc_macro_edition_2021]`) that we introduced in rust-lang#138717. Time to remove it.
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Apr 22, 2025
Implement `pin!()` using `super let`

Tracking issue for super let: rust-lang#139076

This uses `super let` to implement `pin!()`.

This means we can remove [the hack](rust-lang#138717) we had to put in to fix rust-lang#138596.

It also means we can remove the original hack to make `pin!()` work, which used a questionable public-but-unstable field rather than a proper private field.

While `super let` is still unstable and subject to change, it seems safe to assume that future Rust will always have a way to express `pin!()` in a compatible way, considering `pin!()` is already stable.

It'd help [the experiment](rust-lang#139076) to have `pin!()` use `super let`, so we can get some more experience with it.
@m-ou-se m-ou-se deleted the super-let-pin branch April 22, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-spurious-fail-msvc CI spurious failure: target env msvc merged-by-bors This PR was explicitly merged by bors. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pin macro no longer lifetime extends argument
8 participants