Skip to content

Make Ptr::try_with_unchecked safe#2953

Open
joshlf wants to merge 2 commits intomainfrom
G1797ed669d2bae97562a2b84e0ac229b00d5acb7
Open

Make Ptr::try_with_unchecked safe#2953
joshlf wants to merge 2 commits intomainfrom
G1797ed669d2bae97562a2b84e0ac229b00d5acb7

Conversation

@joshlf
Copy link
Member

@joshlf joshlf commented Jan 30, 2026

Rename it to Ptr::try_with and remove the old method of the same name.
In order to guarantee that the f closure doesn't leak its argument,
make f variant on lifetime (ie, for f: F, go from F: FnOnce to F: for<'b> FnOnce).


Latest Update: v3 — Compare vs v2

📚 Full Patch History

Links show the diff between the row version and the column version.

Version v2 v1 Base
v3 vs v2 vs v1 vs Base
v2 vs v1 vs Base
v1 vs Base

Stacked PRs enabled by GHerrit.

@gemini-code-assist
Copy link
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@joshlf joshlf force-pushed the G1797ed669d2bae97562a2b84e0ac229b00d5acb7 branch from 0d5e54c to e2f523f Compare January 30, 2026 05:02
@codecov-commenter
Copy link

codecov-commenter commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (Gd4257e94754893127a547297565b5e06f6eeeba8@c7adbc8). Learn more about missing BASE report.

Additional details and impacted files
@@                             Coverage Diff                              @@
##             Gd4257e94754893127a547297565b5e06f6eeeba8    #2953   +/-   ##
============================================================================
  Coverage                                             ?   92.01%           
============================================================================
  Files                                                ?       19           
  Lines                                                ?     6022           
  Branches                                             ?        0           
============================================================================
  Hits                                                 ?     5541           
  Misses                                               ?      481           
  Partials                                             ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

gherrit-pr-id: Gd4257e94754893127a547297565b5e06f6eeeba8
Rename it to `Ptr::try_with` and remove the old method of the same name.
In order to guarantee that the `f` closure doesn't leak its argument,
make `f` variant on lifetime (ie, for `f: F`, go from `F: FnOnce` to `F:
for<'b> FnOnce`).

gherrit-pr-id: G1797ed669d2bae97562a2b84e0ac229b00d5acb7
@joshlf joshlf force-pushed the G1797ed669d2bae97562a2b84e0ac229b00d5acb7 branch from e2f523f to 01118b6 Compare January 30, 2026 20:59
@joshlf joshlf changed the base branch from main to Gd4257e94754893127a547297565b5e06f6eeeba8 January 30, 2026 20:59
@joshlf joshlf mentioned this pull request Jan 30, 2026
Base automatically changed from Gd4257e94754893127a547297565b5e06f6eeeba8 to main February 2, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants