Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9148eec

Browse filesBrowse files
committed
feat: upgrade zerocopy to 0.8
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
1 parent ebc29bc commit 9148eec
Copy full SHA for 9148eec

File tree

Expand file treeCollapse file tree

7 files changed

+402
-271
lines changed
Filter options
Expand file treeCollapse file tree

7 files changed

+402
-271
lines changed

‎Cargo.lock

Copy file name to clipboardExpand all lines: Cargo.lock
+4-4Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml

Copy file name to clipboardExpand all lines: Cargo.toml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ rustdoc-args = ["--cfg", "docsrs"]
1515

1616
[dependencies]
1717
num_enum = { version = "0.7", default-features = false, optional = true }
18-
zerocopy = { version = "0.7", default-features = false, optional = true }
19-
zerocopy-derive = { version = "0.7", optional = true }
18+
zerocopy = { version = "0.8", default-features = false, optional = true }
19+
zerocopy-derive = { version = "0.8", optional = true }
2020

2121
[features]
2222
default = []

‎bindgen.sh

Copy file name to clipboardExpand all lines: bindgen.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ gen() {
1212
--with-derive-partialeq \
1313
--with-derive-eq \
1414
--with-attribute-custom-enum '.*=#[cfg_attr(feature = "num_enum", derive(num_enum::IntoPrimitive,num_enum::TryFromPrimitive,num_enum::UnsafeFromPrimitive,))]' \
15-
--with-attribute-custom-struct '.*=#[cfg_attr(feature = "zerocopy", derive(zerocopy_derive::FromZeroes,zerocopy_derive::FromBytes,zerocopy_derive::AsBytes,))]' \
15+
--with-attribute-custom-struct '.*=#[cfg_attr(feature = "zerocopy", derive(zerocopy_derive::KnownLayout,zerocopy_derive::Immutable,zerocopy_derive::FromBytes,zerocopy_derive::IntoBytes,))]' \
1616
"$@"
1717
}
1818

‎patches/0001-fix-add-zerocopy-support-for-__IncompleteArrayField.patch

Copy file name to clipboardExpand all lines: patches/0001-fix-add-zerocopy-support-for-__IncompleteArrayField.patch
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
diff --git a/src/linux.rs b/src/linux.rs
22
--- a/src/linux.rs
33
+++ b/src/linux.rs
4-
@@ -1,7 +1,15 @@
4+
@@ -1,7 +1,16 @@
55
/* automatically generated by rust-bindgen 0.70.1 */
66

77
-#[repr(C)]
@@ -10,9 +10,10 @@ diff --git a/src/linux.rs b/src/linux.rs
1010
+#[cfg_attr(
1111
+ feature = "zerocopy",
1212
+ derive(
13-
+ zerocopy_derive::FromZeroes,
13+
+ zerocopy_derive::KnownLayout,
14+
+ zerocopy_derive::Immutable,
1415
+ zerocopy_derive::FromBytes,
15-
+ zerocopy_derive::AsBytes,
16+
+ zerocopy_derive::IntoBytes,
1617
+ )
1718
+)]
1819
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
@@ -21,7 +22,7 @@ diff --git a/src/linux.rs b/src/linux.rs
2122
diff --git a/src/macos.rs b/src/macos.rs
2223
--- a/src/macos.rs
2324
+++ b/src/macos.rs
24-
@@ -1,7 +1,15 @@
25+
@@ -1,7 +1,16 @@
2526
/* automatically generated by rust-bindgen 0.70.1 */
2627

2728
-#[repr(C)]
@@ -30,9 +31,10 @@ diff --git a/src/macos.rs b/src/macos.rs
3031
+#[cfg_attr(
3132
+ feature = "zerocopy",
3233
+ derive(
33-
+ zerocopy_derive::FromZeroes,
34+
+ zerocopy_derive::KnownLayout,
35+
+ zerocopy_derive::Immutable,
3436
+ zerocopy_derive::FromBytes,
35-
+ zerocopy_derive::AsBytes,
37+
+ zerocopy_derive::IntoBytes,
3638
+ )
3739
+)]
3840
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);

‎src/lib.rs

Copy file name to clipboardExpand all lines: src/lib.rs
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
//! - [`num_enum::TryFromPrimitive`]
1313
//! - [`num_enum::UnsafeFromPrimitive`]
1414
//! - `zerocopy` derives the following traits for all structs:
15-
//! - [`zerocopy::FromZeroes`]
15+
//! - [`zerocopy::KnownLayout`]
16+
//! - [`zerocopy::Immutable`]
1617
//! - [`zerocopy::FromBytes`]
17-
//! - [`zerocopy::AsBytes`]
18+
//! - [`zerocopy::IntoBytes`]
1819
1920
#![no_std]
2021
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.