-
Notifications
You must be signed in to change notification settings - Fork 0
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
Original-only bounds #6
Comments
Actually, I already started work on this here: https://github.com/bonsairobo/rkyv_impl/tree/omit_bounds There are no tests yet, but the implementation seemed straightforward enough. The only interesting detail was that instead of parsing type identifiers from the argument list, we parse |
OK I actually encountered something that hints at a use case. So let's say you have a type #[archive_impl]
impl<T: Clone> Foo<T> {
fn do_stuff(&self) {
self.specialized_method();
}
} Where In this case, the It might be worth considering whether this bound should be overridden by |
I actually prefer the |
A little more prototyping: #[archive_impl]
#[original(add_bounds(T: Clone))]
#[archived(add_bounds(T::Archived: Deserialize<T, Infallible>))]
impl<T> Foo<T> {
fn do_stuff(&self) {
self.specialized_method();
}
} where |
Not sure if |
I haven't thought of a convincing use case for omitting bounds from the original
impl
orfn
items, but I suspect such a use case exists. Implementing this feature would not be very challenging, so this could be a good first issue for new contributors. I will leave open until I encounter the need for this.The text was updated successfully, but these errors were encountered: