Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bucket::drop and Bucket::read need to be used with deprecated RawTable::erase_no_drop #364

Closed
JustForFun88 opened this issue Oct 6, 2022 · 2 comments · Fixed by #372
Closed

Comments

@JustForFun88
Copy link
Contributor

I'm trying to document a raw part of the crate and was thinking about the safety concerns of the Bucket<T> methods, but I suddenly realized that the two public methods, Bucket::drop and Bucket::read, potentially lead to double-drop in RawTable, since they cannot be used without RawTable::erase_no_drop but this method has been deprecated since version "0.8.1".

So we need to come up with something:

  • make Bucket::drop and Bucket::read deprecated too;
  • make RawTable::erase_no_drop not a deprecated method;
  • separately document these potential double-drop for Bucket::drop and Bucket::read methods? But it is not clear how to document this for Bucket::drop, the Bucket::read method can at least be used in conjunction with core::mem::forget.
@Amanieu
Copy link
Member

Amanieu commented Oct 18, 2022

I thought about this for a bit and I think the best solution is to deprecate drop, read as well and point people to use remove and erase on RawTable instead.

@Amanieu
Copy link
Member

Amanieu commented Oct 18, 2022

Actually we can remove the deprecated methods since the next version of hashbrown will be a major version bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants