Skip to content

Hash::hash's type parameter should be ?Sized #29263

@apasel422

Description

@apasel422

The Hasher trait is not Sized, but Hash::hash is defined to take a sized type parameter. This prevents code like the following from working:

use std::hash::{Hash, Hasher};

fn bar(hasher: &mut Hasher) {
    1.hash(hasher);
}

fn main() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.rust-2-breakage-wishlistIn the wishlist of breaking changes that requires rust 2.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions