Skip to content

std::rand::weak_rng should return a newtype struct #20484

Closed
@nagisa

Description

@nagisa

std::rand::weak_rng should either be removed or return a newtype struct.

The documentation for the fuction claims:

It returns the fastest Rng algorithm currently available in Rust

However current return type, namely XorShiftRng does not account for a possibility of new, faster Rng algorithms being added to the standard library. In case a faster algorithm is added it would be a breaking change to change the return type.

This is something you want to consider for std::rand stabilisation (rand stabilization (search hint)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions