-
-
Notifications
You must be signed in to change notification settings - Fork 520
Upgrade to rkyv 0.8 #1502
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
Draft
ThierryBerger
wants to merge
8
commits into
dimforge:main
Choose a base branch
from
ThierryBerger:rkyv_0.8
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Upgrade to rkyv 0.8 #1502
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e9696ea
wip migrating to rkyv 0.8 ; one compiling error type left
ThierryBerger 12c3486
heavy WIP ; rust error E0210 difficult to analyze
ThierryBerger 448a16e
compiling!
ThierryBerger 0df4463
cleaned some warnings
ThierryBerger 8a15822
fix test expected output
ThierryBerger 3e7355a
tests for OPoint
ThierryBerger 6dff319
more test passing, but still not sure about the approach
ThierryBerger 8007d16
tests passing :o
ThierryBerger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,11 +12,7 @@ use std::mem; | |
| use serde::{Deserialize, Deserializer, Serialize, Serializer}; | ||
|
|
||
| #[cfg(feature = "rkyv-serialize-no-std")] | ||
| use super::rkyv_wrappers::CustomPhantom; | ||
| #[cfg(feature = "rkyv-serialize")] | ||
| use rkyv::bytecheck; | ||
| #[cfg(feature = "rkyv-serialize-no-std")] | ||
| use rkyv::{with::With, Archive, Archived}; | ||
| use rkyv::Archive; | ||
|
|
||
| use simba::scalar::{ClosedAddAssign, ClosedMulAssign, ClosedSubAssign, Field, SupersetOf}; | ||
| use simba::simd::SimdPartialOrd; | ||
|
|
@@ -161,16 +157,18 @@ pub type MatrixCross<T, R1, C1, R2, C2> = | |
| #[cfg_attr( | ||
| feature = "rkyv-serialize-no-std", | ||
| derive(Archive, rkyv::Serialize, rkyv::Deserialize), | ||
| archive( | ||
| as = "Matrix<T::Archived, R, C, S::Archived>", | ||
| bound(archive = " | ||
| T: Archive, | ||
| S: Archive, | ||
| With<PhantomData<(T, R, C)>, CustomPhantom<(Archived<T>, R, C)>>: Archive<Archived = PhantomData<(Archived<T>, R, C)>> | ||
| ") | ||
| rkyv( | ||
| compare(PartialEq, PartialOrd), | ||
| derive(Debug), | ||
| archive_bounds( | ||
| <S as Archive>::Archived: core::fmt::Debug, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this is a bit constraining ? This is only needed for automated derive (needed for tests) See https://github.com/dimforge/nalgebra/pull/1502/files#r2025182401 |
||
| <PhantomData<(T, R, C)> as Archive>::Archived: core::fmt::Debug, | ||
| T: PartialEq, | ||
| S: Archive, | ||
| S: core::fmt::Debug, | ||
| ) | ||
| ) | ||
| )] | ||
| #[cfg_attr(feature = "rkyv-serialize", derive(bytecheck::CheckBytes))] | ||
| pub struct Matrix<T, R, C, S> { | ||
| /// The data storage that contains all the matrix components. Disappointed? | ||
| /// | ||
|
|
@@ -207,7 +205,6 @@ pub struct Matrix<T, R, C, S> { | |
| // of the `RawStorage` trait. However, because we don't have | ||
| // specialization, this is not possible because these `T, R, C` | ||
| // allows us to desambiguate a lot of configurations. | ||
| #[cfg_attr(feature = "rkyv-serialize-no-std", with(CustomPhantom<(T::Archived, R, C)>))] | ||
| _phantoms: PhantomData<(T, R, C)>, | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Do we want to derive
rkyv::Portable? I'm not sure what the implications are.I think this would allow us to avoid a specific
ArchivedMatrixbeing created, which is likely what we want, as was the case withas Matrix.