Skip to content

Tracking issue for RFC 2115: In-band lifetime bindings #44524

Closed
@aturon

Description

@aturon
Member

Update for 2022: With the FCP close finished, this is no longer on a stabilization path, and will likely be removed from nightly. The issue will remain open so long as it's referenced by an implemented feature in the compiler, however.


This is a tracking issue for the RFC "In-band lifetime bindings" (rust-lang/rfcs#2115).

Steps:

Unresolved questions:

  • What conventions should we use for lifetime names, and should they be enforced via lint?
  • Can we find an unequivocally-better syntax than '_ for elided lifetimes?
    • These are now stable, so we didn't

Known bugs (possibly incomplete list):

Activity

added
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
T-langRelevant to the language team
on Sep 12, 2017
glaebhoerl

glaebhoerl commented on Sep 12, 2017

@glaebhoerl
Contributor

@aturon Could we word the unresolved question as something like "what is the appropriate convention, if any" rather than "is this particular convention worthwhile"? Thanks!

vitiral

vitiral commented on Sep 12, 2017

@vitiral
Contributor

also, that wasn't the only suggested alternative. There is also completely explicit lifetimes using 'self::lifetime_name

durka

durka commented on Sep 12, 2017

@durka
Contributor
$ rg -F "impl<'a>" /rust/src | wc -l
     730

This supposedly ergonomic change is going to require updating a lot of code, including all of our docs and examples. I guess you could just do s/'a/'aa but that seems to miss the point. Could we make some kind of interactive rustfix tool to let you choose new lifetime names and have them automatically updated?

aturon

aturon commented on Sep 12, 2017

@aturon
MemberAuthor

@glaebhoerl Done, thanks!

nikomatsakis

nikomatsakis commented on Sep 12, 2017

@nikomatsakis
Contributor

I expanded the unresolved question a bit.

added this to the impl period milestone on Sep 15, 2017
removed this from the impl period milestone on Sep 15, 2017
added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Sep 17, 2017
nikomatsakis

nikomatsakis commented on Sep 18, 2017

@nikomatsakis
Contributor

Mentoring instructions

I'm not sure 100% the best way to implement this yet, but let me start by giving some pointers. Perhaps @eddyb can elaborate, as he is the last one to touch the relevant code in a serious way, as far as I know.

First thing is a kind of list of what the tasks are in the RFC. This is roughly the order in which I think we should approach them. It may even be worth breaking this out into separate issues.

XXX task list moved into main header

I don't have time for detailed mentoring notes, but here are a few things to start reading into. At present, region resolution etc kind of works like this:

  • During HIR lowering, we insert placeholders for elided lifetimes.
  • After HIR lowering, we run the code in resolve_lifetime.rs.
  • This creates the NamedRegionMap that, for each hir::Lifetime, contains a Region struct indicating what region is being named.
    • This struct is a bit complicated. =)

224 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lifetimesArea: Lifetimes / regionsB-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.S-tracking-design-concernsStatus: There are blocking design concerns.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamdisposition-closeThis PR / issue is in PFCP or FCP with a disposition to close it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @briansmith@durka@kornelski@eddyb@Nemo157

      Issue actions

        Tracking issue for RFC 2115: In-band lifetime bindings · Issue #44524 · rust-lang/rust