-
Notifications
You must be signed in to change notification settings - Fork 182
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
Conversation
utils/zerovec/src/map/vecs.rs
Outdated
fn zvl_new() -> FlexZeroSlice | ||
{ | ||
unreachable!() | ||
} |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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).
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
V: ZeroMapKV<'a, Container = ZeroVec<'a, V>> + ?Sized, | ||
V: AsULE + Copy, | ||
V: ZeroMapKV<'a> + ?Sized, | ||
V: Copy, |
There was a problem hiding this comment.
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.
Fixes #2022
To-do:
ZeroMapKV
to compileAdd(moved to Add VarZeroVec impls for FlexZeroSlice #2030)EncodeAsVarULE