Skip to content

0.9.3 seemingly breaks panic documentation for ReseedingRng #1767

Closed

Description

@kayabaNerve

0.9.2 documents the following:

Error handling

Although unlikely, reseeding the wrapped PRNG can fail. ReseedingRng will never panic but try to handle the error intelligently through some combination of retrying and delaying reseeding until later. If handling the source error fails ReseedingRng will continue generating data from the wrapped PRNG without reseeding.

Manually calling reseed() will not have this retry or delay logic, but reports the error.

1aeee9f#diff-e6e5ffc9c3a54105859ee7e76bb077b51313dff227e9bab169591e9bca95fc3d, as merged for 0.9.3, changed the failed reseed to a panic however.

Activity

  1. dhardy commented on Apr 12, 2026

    @dhardy
    Member

    Thanks for the report. This is a doc issue, yes.

    (I don't like changing the behaviour in a patch release like v0.9.3, but (a) the previous behaviour was unsound and (b) it is extremely unlikely that SysRng will fail during reseeding after successfully initializing a ThreadRng, hence probably we should ensure this is reported if it does ever happen.)

  2. kayabaNerve commented on Apr 12, 2026

    @kayabaNerve
    Author

    I'm fine if this is considered a doc issue. While I don't love a patch release changing behavior either, if you say it's unsound, that's enough for me to be quiet about it and defer to you 😅

    This also did seem unlikely when I noticed it, but I didn't spend the time reviewing the exact APIs it was using and performing such an exhaustive map, so I can't comment there other than again deferring to you there, which I'm fine doing :)

  3. dhardy commented on Apr 13, 2026

    @dhardy
    Member

    Fixed in #1763

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

    X-bugType: bug report

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions