Skip to content

Stop using in_band_lifetimes in compiler crates #91867

Closed

Description

@scottmcm

With more than 50% of the sign-offs needed in #44524 (comment) to remove the feature entirely (EDIT: And now in FCP), I think it's now fine to start updating the compiler code to stop using the nightly feature.

Here are the crates currently using it:

I've marked this E-easy as it's very mechanical work. If you're interested in helping out:

  • Get your dev environment set up so that you can successfully build the compiler, see https://rustc-dev-guide.rust-lang.org/
  • Post the crate you'll tackle, to avoid duplicate work. (I suggest picking ~randomly, not going in order.)
  • Delete the #![feature(in_band_lifetimes)] line from the lib.rs file
  • Look at the compiler errors, and either
    • See that the undeclared lifetime is single-use, and thus replace it with '_, or
    • If it's used multiple times, declare it at the appropriate scope.
  • Once it compiles again, review the git diff to ensure it has only lifetime annotation changes.
  • EDIT: Remember to run x.py fmt and x.py test tidy!
  • Send a PR cc'ing this issue, and edit your previous post to include the PR number.

If you'd like to see how these PRs end up looking, here's two that I made earlier:

(They're also listed in the checklist above.)

Activity

  1. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Dec 13, 2021
  2. LegionMammal978 commented on Dec 13, 2021

    @LegionMammal978
    Contributor

    I've worked on rustc_infer (#91878), rustc_codegen_ssa (#91885), rustc_const_eval (#91887), rustc_mir_dataflow (#91922), rustc_query_impl (#91923), rustc_privacy (#91925), and rustc_codegen_llvm (#91931).

  3. added
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    on Dec 13, 2021
  4. bugadani commented on Dec 13, 2021

    @bugadani
    Contributor

    I can give rustc_borrowck a try (#91879)

  5. Patrick-Poitras commented on Dec 14, 2021

    @Patrick-Poitras
    Contributor

    I'll try with rustc_typeck. 243 errors fixed! (#91882)

  6. pitaj commented on Dec 14, 2021

    @pitaj
    Contributor

    I'll take rustc_hir (#91893) and rustc_incremental (#91894).

    I'll also take rustc_monomorphize (#91895) and rustc_passes (#91896).

  7. added a commit that references this issue on Dec 14, 2021
  8. SylvanB commented on Dec 14, 2021

    @SylvanB
    Contributor

    I'll take rustc_symbol_mangling (#91901).
    Also taking rustc_trait_selection (#91904).
    Also taking rustc_metadata (#91926)

  9. added 2 commits that reference this issue on Dec 14, 2021
  10. 62 remaining items

  11. added 5 commits that reference this issue on Dec 18, 2021
  12. added a commit that references this issue on Dec 31, 2021
  13. added a commit that references this issue on Jan 12, 2022
  14. scottmcm commented on Jan 26, 2022

    @scottmcm
    MemberAuthor

    Looks like these have all landed, so I'll close this.

    Thanks for the help, everyone!

  15. added a commit that references this issue on Mar 2, 2022
  16. added a commit that references this issue on May 11, 2026
  17. added a commit that references this issue on May 14, 2026
  18. added a commit that references this issue on Oct 17, 2026
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

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions