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

Check that layout size fits in isize in Layout #362

Merged
merged 4 commits into from Sep 18, 2022

Conversation

JustForFun88
Copy link
Contributor

Since rust-lang/rust#95295 we need check that Layout size, when rounded up to the nearest multiple of align, must not overflow isize (i.e., the rounded value must be less than or equal to isize::MAX)

@JustForFun88
Copy link
Contributor Author

This test is awesome:-) Looks like I forgot that our capacity is smaller than buckets number on 12.5%

@Amanieu
Copy link
Member

Amanieu commented Sep 18, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 18, 2022

📌 Commit ec164bf has been approved by Amanieu

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 18, 2022

⌛ Testing commit ec164bf with merge c0247fa...

@bors
Copy link
Collaborator

bors commented Sep 18, 2022

☀️ Test successful - checks-actions
Approved by: Amanieu
Pushing c0247fa to master...

@bors bors merged commit c0247fa into rust-lang:master Sep 18, 2022
@JustForFun88 JustForFun88 deleted the check_layout_size branch September 18, 2022 14:45
bors added a commit that referenced this pull request Oct 9, 2022
Documentation fix due to latest changes in the crate.

Due to merged PR #357, #362 I think that we need to fix docummentation.

 Fixed broken links in `HashMap::raw_table` and `HashSet::raw_table`, as well as some typos and mistakes elsewhere (especially in `EntryRef::or_insert_with_key`).

To fix #349, I removed capacity comparisons in all places (except `drain` and `clear`),  however left the phrase "keeps the allocated memory for reuse", because although the `erase` method may not release the capacity, the subsequent `rehash_in_place` function definitely will release all.

Close #349.
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 this pull request may close these issues.

None yet

3 participants