Skip to content

BuildHasher is no longer object safe in 1.55 #87991

Closed
@tmandry

Description

@tmandry

From 1.55 crater run #87749, log:

[INFO] [stdout] error[E0038]: the trait `BuildHasher` cannot be made into an object
[INFO] [stdout]    --> src/pcsa/pcsa.rs:19:27
[INFO] [stdout]     |
[INFO] [stdout] 19  |     pub hasher:       Box<dyn BuildHasher<Hasher = HasherType>>,
[INFO] [stdout]     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `BuildHasher` cannot be made into an object
[INFO] [stdout]     |
[INFO] [stdout] note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>

#86151 added a generic method to the trait, making it no longer object safe.

This only caused one crate in crater to fail, and the source for that crate seems to have been removed from github. Still, I don't think this is technically allowed breakage.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged +T-libs +I-nominated

cc @scottmcm

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions