Skip to content

Remove edition-dependent behavior on panic #151084

Open

Description

@traviscross

As @ehuss said:

It wasn't clear to me before this was merged that this approved a change for the 2026 edition. Can we remove that edition check and go through the process for adding new features to an edition? (Or, preferably, if this ends up changing for all editions, then there will be no additional work to do.)

Originally posted by @ehuss in #139493 (comment)

Let's please remove the edition-dependent behavior until we separately accept this within a future edition.

cc @rust-lang/edition

Related

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 13, 2026
  2. traviscross commented on Jan 13, 2026

    @traviscross
    ContributorAuthor
  3. added
    T-langRelevant to the language team
    I-lang-radarItems that are on lang's radar and will need eventual work or consideration.
    T-editionRelevant to the edition team.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 13, 2026
  4. Voultapher commented on Jan 13, 2026

    @Voultapher
    Contributor

    It wasn't clear to me before this was merged that this approved a change for the 2026 edition.

    I added that check as a hedge against forgetting to address it in the future. Not sure if "not doing something we begrudgingly do as a hack because of backwards compatibility" counts as a new feature.

  5. traviscross commented on Jan 14, 2026

    @traviscross
    ContributorAuthor

    It counts as an edition item. Those go through a particular process. It'd actually be good if we could avoid ever making this an edition item (by breaking it in all editions). E.g., check back in after some releases and see whether we can make that FCW deny-by-default and warn-in-deps.

  6. Voultapher commented on Jan 14, 2026

    @Voultapher
    Contributor

    Was the edition timeline shortened, I would have expected 2027 to be the next one.

  7. petrochenkov commented on Jan 14, 2026

    @petrochenkov
    Contributor

    It counts as an edition item. Those go through a particular process. It'd actually be good if we could avoid ever making this an edition item (by breaking it in all editions). E.g., check back in after some releases and see whether we can make that FCW deny-by-default and warn-in-deps.

    I think that the current processes over-extend the lang team responsibilities, in general.
    IMO, the language should just say that "X vs Y ambiguity is an error", and compatibility lints are a compiler's way to deviate from the language to accommodate for real world concerns, so they can use whatever hacks necessary to do that, including editions, without putting any of that into language documentation. (I.e. the panic part of rust-lang/reference#2077 should not exist.)

  8. traviscross commented on Jan 15, 2026

    @traviscross
    ContributorAuthor

    @ehuss and I are speaking mostly from an Edition team perspective. Each edition item is documented in the Edition Guide. Each gets an edition tracking issue. Each generally needs an edition migration. When we do crater testing for the edition, each needs to be understood and accounted for in those analyses. Etc.

    It's for those reasons that we can't have something in the code that is in fact an edition item but which we have not tracked and for which we have not taken the appropriate steps. I.e., we can't lose track of edition items as it'll cause problems for us later, so we need these to go through a process so we can track them along with all other such items in a consistent way.

  9. Voultapher commented on Jan 15, 2026

    @Voultapher
    Contributor

    While I understand the motivation it conflates different aspects. The edition guide does not precisely track N+1 order effects, for example it doesn't mention no_implicit_prelude but there is edition specific behavior bound to that. There are plenty of ways for the compiler to produce edition specific behavior without explicitly checking the edition. What the edition guide can realistically aim for, is tracking edition items that are deliberate edition items and will stay so for the foreseeable future. The hack we added in #139493 will be removed again in a year or two, that's not how edition items usually work.

  10. Voultapher commented on Jan 15, 2026

    @Voultapher
    Contributor

    The check as it stands makes the potential blast radius smaller and will lead to fewer headaches for our users because their project doesn't compile anymore after upgrading rustc. If we want to make our users' lives worse for the sake of some abstract process that realistically can't achieve the goals it aims for seems like a sadly inflexible thing to do.

  11. jyn514 commented on Jan 15, 2026

    @jyn514
    Member

    i think it would help to distinguish “tracking edition changes” from whether the edition team gets to control whether things are added to the edition. the first thing seems clearly good to me even if this ends up being reverted in a year.

  12. traviscross commented on Jan 15, 2026

    @traviscross
    ContributorAuthor

    ...for example it doesn't mention no_implicit_prelude but there is edition specific behavior bound to that...

    It was simply missed. That 2018 change should have had an edition guide chapter.

    There are plenty of ways for the compiler to produce edition specific behavior without explicitly checking the edition

    What do you have in mind?

    ...that are deliberate edition items and will stay so for the foreseeable future... The hack we added in #139493 will be removed again in a year or two, that's not how edition items usually work.

    If we later stabilize something in all editions, we simply note that in the edition guide chapter. See, e.g.:

    https://doc.rust-lang.org/nightly/edition-guide/rust-2024/missing-macro-fragment-specifiers.html

  13. traviscross commented on Jan 15, 2026

    @traviscross
    ContributorAuthor

    I think it would help to distinguish “tracking edition changes” from whether the edition team gets to control whether things are added to the edition. the first thing seems clearly good to me even if this ends up being reverted in a year.

    Adding something to a particular numbered edition requires sign-off from both the underlying team (e.g. lang) and the edition team.

    I didn't catch the edition-specific behavior when signing off on #139493 as a lang matter -- there was a lot of churn in that PR -- otherwise I would have flagged it then.

    The check as it stands makes the potential blast radius smaller and will lead to fewer headaches for our users because their project doesn't compile anymore after upgrading rustc. If we want to make our users' lives worse for the sake of some abstract process that realistically can't achieve the goals it aims for seems like a sadly inflexible thing to do.

    Nobody wants to create headaches for our users or make our users' lives worse. Certain processes are necessary for edition management so as to ensure that we uphold the assurances about editions that we promise our users. I.e., the processes are there to make users' lives better.

    We're happy for this to be an edition item if that turns out to be the best way to do this. We just need it then done correctly according to the process.

  14. Voultapher commented on Jan 15, 2026

    @Voultapher
    Contributor

    We just need it then done correctly according to the process.

    That just does a lot of heavy lifting, I for one don't intend to subject myself to that process. Which in practice means, someone will remove it and then let's see who feels like going through it. It's telling that everyone complaining about the process didn't show any initiative in doing so themselves. The time we spent discussing in this issue could have been spent initiating the process.

    What do you have in mind?

    By generating code dependent on edition specific behavior and by depending on code depending on edition specific behavior.

  15. added
    I-lang-nominatedNominated for discussion during a lang team meeting.
    P-lang-drag-1Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang
    on Jan 15, 2026
  16. removed
    I-lang-nominatedNominated for discussion during a lang team meeting.
    P-lang-drag-1Lang team prioritization drag level 1. https://rust-lang.zulipchat.com/#narrow/channel/410516-t-lang
    on Jan 28, 2026
  17. RalfJung commented on Jan 30, 2026

    @RalfJung
    Member

    Remove edition-dependent behavior on panic

    Is there a summary somewhere of what this "edition-dependent behavior" even is that this issue is tracking? #139493 is a huge PR.

    I think that the current processes over-extend the lang team responsibilities, in general.
    IMO, the language should just say that "X vs Y ambiguity is an error", and compatibility lints are a compiler's way to deviate from the language to accommodate for real world concerns,

    Whether or not compilation succeeds or fails is a lang matter, including any compatibility exceptions. Many of these compatibility exceptions exist not just for a transition but become part of the language long-term. The Reference would not be doing its job if those cases were not documented there. Some are temporary, but even then -- lang is generally closely involved for future-compat lints.

  18. Voultapher commented on Jan 30, 2026

    @Voultapher
    Contributor

    Is there a summary somewhere of what this "edition-dependent behavior" even is that this issue is tracking? #139493 is a huge PR.

    The reference kind of explains it. But it's probably easier to summarize it here:

    The code that turns the panic ambiguity error into the ambiguous_panic_imports lint only triggers for Rust Edition <= 2024.

  19. added
    I-edition-radarItems that are on edition's radar and will need eventual work or consideration.
    maybe-future-editionSomething we may consider for a future edition.
    A-edition-2027Area: The 2027 edition (TBD)
    on Aug 25, 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

    A-edition-2027Area: The 2027 edition (TBD)I-edition-nominatedNominated for discussion during an edition team meeting.I-edition-radarItems that are on edition's radar and will need eventual work or consideration.I-lang-radarItems that are on lang's radar and will need eventual work or consideration.T-editionRelevant to the edition team.T-langRelevant to the language teammaybe-future-editionSomething we may consider for a future edition.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions