Skip to content

fix: make HintRef lifetimes explicit - #5653

Closed
jay23606 wants to merge 2 commits into
pyrefly-org:mainfrom
jay23606:fix/5590-explicit-hintref-lifetimes
Closed

jay23606 wants to merge 2 commits into
pyrefly-org:mainfrom
jay23606:fix/5590-explicit-hintref-lifetimes

Conversation

@jay23606

@jay23606 jay23606 commented Nov 14, 2026 •

Copy link
Copy Markdown

Summary

Makes the lifetime parameters on HintRef explicit in as_hint_for_display, removing the inconsistent lifetime syntax warning from issue #5590.

Fixes #5590

  • I am a human, and I fully understand the code I am submitting.

Test Plan

  • rustfmt --check pyrefly/lib/alt/operators.rs — passed.
  • cargo check -p pyrefly — not completed locally; dependency fetching stalled. Draft CI is needed to confirm the compiler warning is gone.

Use explicit elided lifetime placeholders on the HintRef return type so the lifetime relationships are clear and the compiler warning is removed. Fixes pyrefly-org#5590.
@jay23606
jay23606 marked this pull request as ready for review November 14, 2026 18:55
@stroxler stroxler self-assigned this Nov 16, 2026
@github-actions

This comment has been minimized.

@rchen152

Copy link
Copy Markdown
Contributor

Closing and reopening this PR to re-trigger CI, which was down over the weekend

@rchen152 rchen152 closed this Nov 17, 2026
@rchen152 rchen152 reopened this Nov 17, 2026
@github-actions github-actions Bot added size/xs and removed size/xs labels Nov 17, 2026
@rchen152

Copy link
Copy Markdown
Contributor

Hmm, I was hoping that would trigger the CLA bot to post, but no dice :(

@jay23606 could you sign the Meta CLA (https://code.facebook.com/cla) so we can accept your PR?

@github-actions

Copy link
Copy Markdown

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@codspeed

codspeed Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 67 untouched benchmarks
⏩ 9 skipped benchmarks1


Comparing jay23606:fix/5590-explicit-hintref-lifetimes (e84214a) with main (76655fa)

Open in CodSpeed

Footnotes

  1. 9 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@jay23606

Copy link
Copy Markdown
Author

I can't close or reopen this PR from my side, so I haven't changed anything for this request. A maintainer with access to the PR would need to re-trigger CI.

@rchen152

Copy link
Copy Markdown
Contributor

@jay23606 What we need from you is a signed individual CLA: https://code.facebook.com/cla.

@github-actions github-actions Bot added size/xs and removed size/xs labels Nov 19, 2026
@rchen152

Copy link
Copy Markdown
Contributor

Ah, it looks like the lifetime warning was already fixed sometime in the past few days:

fn as_hint_for_display(lhs: &Type) -> Option<HintRef<'_, '_>> {

Sorry for all the back-and-forth and then not being able to merge this PR :( Getting the CLA signed is sometimes a bit of a chore, but now that we have it on file, you shouldn't need to sign it again for any subsequent PRs (to pyrefly or to any other Meta project) if you're still interested in contributing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

warning: hiding a lifetime that's elided elsewhere is confusing

3 participants