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

RawTable::allocation_info returns non zero size for a fresh empty map #376

Closed
koute opened this issue Dec 14, 2022 · 1 comment · Fixed by #379
Closed

RawTable::allocation_info returns non zero size for a fresh empty map #376

koute opened this issue Dec 14, 2022 · 1 comment · Fixed by #379

Comments

@koute
Copy link
Member

koute commented Dec 14, 2022

The following code:

#[test]
fn test() {
    assert_eq!(hashbrown::raw::RawTable::<()>::new().allocation_info().1.size(), 0);
}

fails with:

thread 'test' panicked at 'assertion failed: `(left == right)`
  left: `17`,
 right: `0`', src/lib.rs:3:5

Since RawTable::new doesn't allocate any memory I'd expect this to return 0.

@Amanieu
Copy link
Member

Amanieu commented Dec 14, 2022

cc @stepancheg

stepancheg added a commit to stepancheg/hashbrown that referenced this issue Jan 6, 2023
stepancheg added a commit to stepancheg/hashbrown that referenced this issue Jan 6, 2023
stepancheg added a commit to stepancheg/hashbrown that referenced this issue Jan 6, 2023
stepancheg added a commit to stepancheg/hashbrown that referenced this issue Jan 9, 2023
bors added a commit that referenced this issue Jan 10, 2023
Fix RawTable::allocation_info for empty table

Fixes #376
@bors bors closed this as completed in 471c5a6 Jan 10, 2023
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