Registry Mirror
Skip to content

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

Closed

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() {}

Activity

  1. apasel422 commented on Oct 24, 2015

    @apasel422
    ContributorAuthor

    Changing this now would be a breaking change, however, as all manual implementors would need to be updated.

  2. alexcrichton commented on Oct 24, 2015

    @alexcrichton
    Member

    If this requires changing all implementors I think our hands may unfortunately be tied on this one

  3. apasel422 commented on Oct 24, 2015

    @apasel422
    ContributorAuthor

    Yeah, I guess this isn't going to be possible.

  4. added
    T-libs-api
    on Oct 20, 2023
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

    T-libs-api

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions