Skip to content

SipHasher::new_with_keys deprecation message is unhelpful/misleading #37070

Closed
@SimonSapin

Description

@SimonSapin
Contributor

Since #36815, using SipHasher::new_with_keys gives a warning:

warning: use of deprecated item: use `DefaultHasher` instead, #[warn(deprecated)] on by default

But DefaultHasher does not have a new_with_keys method or anything similar. It looks like this functionality was deprecated without replacement. Assuming the libs team does not want to revisit this decision, the deprecation message should be changed to… something.

Right now, the easiest "fix" for code using this method is to use #[allow(deprecated)]. Since the method is marked #[stable] it’s not going away any time soon, so this is quite safe. But of course, recommending #[allow(deprecated)] in a deprecation message would defeat the point of deprecation.

Perhaps a "proper" fix would be to maintain a (non-deprecated) copy of SipHasher on crates.io?

One notable user of this method is phf. CC @sfackler

Activity

aturon

aturon commented on Oct 10, 2016

@aturon
Member

cc @rust-lang/libs

added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Oct 10, 2016
sfackler

sfackler commented on Oct 10, 2016

@sfackler
Member

Seems like we should copy the impls out to an external crate.

alexcrichton

alexcrichton commented on Oct 11, 2016

@alexcrichton
Member

Splitting out seems fine to me, but I believe the siphash crate was already taken last I checked.

Mark-Simulacrum

Mark-Simulacrum commented on May 14, 2017

@Mark-Simulacrum
Member

The siphasher crate now exposes this API, closing.

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-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexcrichton@SimonSapin@aturon@sfackler@Mark-Simulacrum

        Issue actions

          SipHasher::new_with_keys deprecation message is unhelpful/misleading · Issue #37070 · rust-lang/rust