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

Add more zerovec impls for usize and FlexZeroVec #2023

Merged
merged 20 commits into from
Jun 9, 2022

Conversation

sffc
Copy link
Member

@sffc sffc commented Jun 8, 2022

Fixes #2022

To-do:

Comment on lines 607 to 580
fn zvl_new() -> FlexZeroSlice
{
unreachable!()
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Manishearth How do I get this where Self: Sized trait function to compile here? What is the right syntax? No matter whether I add where Self: Sized here or not, it says "doesn't have a size known at compile-time"

Copy link
Member Author

@sffc sffc Jun 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it by removing the method from the trait. Seems we can't do this yet: rust-lang/rust#48214

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference: it can be done on stable with an unused HRTB, see rust-lang/rust#48214 (comment).

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • utils/zerovec/src/flexzerovec/mod.rs is different
  • utils/zerovec/src/flexzerovec/owned.rs is different
  • utils/zerovec/src/flexzerovec/slice.rs is different
  • utils/zerovec/src/lib.rs is different
  • utils/zerovec/src/map/borrowed.rs is now changed in the branch
  • utils/zerovec/src/map/kv.rs is different
  • utils/zerovec/src/map/map.rs is now changed in the branch
  • utils/zerovec/src/map/mod.rs is now changed in the branch
  • utils/zerovec/src/map/vecs.rs is different
  • utils/zerovec/src/map2d/borrowed.rs is now changed in the branch
  • utils/zerovec/src/map2d/cursor.rs is now changed in the branch
  • utils/zerovec/src/map2d/map.rs is now changed in the branch
  • utils/zerovec/src/yoke_impls.rs is now changed in the branch
  • utils/zerovec/src/zerovec/slice.rs is now changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • utils/zerovec/src/flexzerovec/owned.rs is different
  • utils/zerovec/src/flexzerovec/slice.rs is different
  • utils/zerovec/src/flexzerovec/vec.rs is different
  • utils/zerovec/src/lib.rs is different
  • utils/zerovec/src/map/borrowed.rs is no longer changed in the branch
  • utils/zerovec/src/map/kv.rs is different
  • utils/zerovec/src/map/map.rs is different
  • utils/zerovec/src/map/mod.rs is no longer changed in the branch
  • utils/zerovec/src/map/vecs.rs is different
  • utils/zerovec/src/map2d/borrowed.rs is no longer changed in the branch
  • utils/zerovec/src/map2d/cursor.rs is different
  • utils/zerovec/src/map2d/map.rs is different
  • utils/zerovec/src/yoke_impls.rs is no longer changed in the branch
  • utils/zerovec/src/zerovec/slice.rs is no longer changed in the branch

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@sffc sffc changed the title Add ZeroMapKV for usize Add more zerovec impls for usize and FlexZeroVec Jun 8, 2022
@sffc sffc marked this pull request as ready for review June 8, 2022 20:26
@sffc sffc requested a review from Manishearth as a code owner June 8, 2022 20:26
V: ZeroMapKV<'a, Container = ZeroVec<'a, V>> + ?Sized,
V: AsULE + Copy,
V: ZeroMapKV<'a> + ?Sized,
V: Copy,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Manishearth I want to draw your attention to this: I used V::Container::zvl_get_as_t to make it such that V: Copy is the only bound we need any more for ZeroMap::get_copied and friends. I'm not sure if it has a code size impact, but if everything is inlined, it should be okay.

@sffc sffc merged commit 1699bbd into unicode-org:main Jun 9, 2022
@sffc sffc deleted the fzv-zvlike branch June 9, 2022 00:11
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.

Add more impls to FlexZeroVec
3 participants