Skip to content

1.97 beta regression due to TryFromIntError changing size #157363

Closed as not planned

Description

@theemathas

This regression was found by the 1.97 beta crater run.

[INFO] [stdout] error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
[INFO] [stdout]   --> /opt/rustwide/cargo-home/registry/src/index.crates.io-1949cf8c6b5b557f/ethnum-1.5.2/src/error.rs:16:14
[INFO] [stdout]    |
[INFO] [stdout] 16 |     unsafe { mem::transmute(()) }
[INFO] [stdout]    |              ^^^^^^^^^^^^^^
[INFO] [stdout]    |
[INFO] [stdout]    = note: source type: `()` (0 bits)
[INFO] [stdout]    = note: target type: `TryFromIntError` (8 bits)

It affects 230 dependents of ethnum version 1.5.2 or earlier. (ethnum version 1.5.3 was released on April 20 to fix this.)

Presumably regressed in #153178. cc @sorairolake, @tgross35

I assume this is acceptable breakage, but I'm filing this issue just in case some action is needed (e.g., a mention in the release notes).

Activity

  1. added
    T-libs-api
    regression-from-stable-to-beta
    C-bug
    on Jun 3, 2026
  2. added
    needs-triage
    I-prioritize
    on Jun 3, 2026
  3. removed
    needs-triage
    on Jun 3, 2026
  4. tgross35 commented on Jun 3, 2026

    @tgross35
    Member

    Opened an issue nlordell/ethnum-rs#60.

    We make no guarantees about the internals of std types (unless specified) so I'm not sure we need a release note mention. Maybe this type should have a constructor if other crates want to make use of it?

  5. theemathas commented on Jun 3, 2026

    @theemathas
    ContributorAuthor

    @tgross ethnum is already fixed. This regression affects only dependents of older versions.

  6. nlordell commented on Jun 4, 2026

    @nlordell

    This should have been fixed here: nlordell/ethnum-rs#58 and released in 1.5.3.

  7. theemathas commented on Jun 4, 2026

    @theemathas
    ContributorAuthor

    There's also another "regression" related to TryFromIntError. But this time, it's due to the Debug output changing:

    [INFO] [stdout] note: panic did not contain expected string
    [INFO] [stdout]       panic message: "index out of bounds: TryFromIntError(NegOverflow)"
    [INFO] [stdout]  expected substring: "index out of bounds: TryFromIntError(())"
    

    https://crater-reports.s3.amazonaws.com/beta-1.97-3-v2/1.97.0-beta.1/reg/univec-1.1.0/log.txt


    Edit: Another crate had the same regression.

    [INFO] [stdout] note: panic did not contain expected string
    [INFO] [stdout]       panic message: "nanos_to_duration() overflowed seconds value for Duration: TryFromIntError(PosOverflow)"
    [INFO] [stdout]  expected substring: "nanos_to_duration() overflowed seconds value for Duration: TryFromIntError(())"
    

    https://crater-reports.s3.amazonaws.com/beta-1.97-3-v2/1.97.0-beta.1/reg/roundable-0.2.0/log.txt


    Edit 2: Yet another crate.

    [INFO] [stdout] note: panic did not contain expected string
    [INFO] [stdout]       panic message: "called `Result::unwrap()` on an `Err` value: TryFromIntError(Zero)"
    [INFO] [stdout]  expected substring: "called `Result::unwrap()` on an `Err` value: TryFromIntError(())"
    

    https://crater-reports.s3.amazonaws.com/beta-1.97-3-v2/1.97.0-beta.1/gh/qter-project.puzzle-theory/log.txt

  8. cuviper commented on Jun 4, 2026

    @cuviper
    Member

    https://doc.rust-lang.org/nightly/std/fmt/trait.Debug.html#stability

    Derived Debug formats are not stable, and so may change with future Rust versions. Additionally, Debug implementations of types provided by the standard library (std, core, alloc, etc.) are not stable, and may also change with future Rust versions.

  9. the8472 commented on Jun 10, 2026

    @the8472
    Member

    We discussed this during today's T-libs meeting and consider this acceptable breakage.

  10. removed
    I-prioritize
    on Jun 10, 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

    C-bugT-libs-apiregression-from-stable-to-beta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions