Skip to content

Commit 8750dd0

Browse files
committed
feat(core): re-export bytemuck::{Zeroable, ZeroableInOption} in r3[_core]::utils
1 parent 91ce918 commit 8750dd0

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/r3/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub use r3_core::{bag, hunk, kernel, time};
6262
///
6363
/// [1]: r3_core#stability
6464
pub mod utils {
65-
pub use r3_core::utils::{Init, ZeroInit};
65+
pub use r3_core::utils::{Init, ZeroInit, Zeroable, ZeroableInOption};
6666
}
6767

6868
/// The prelude module.

src/r3_core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- `r3_core::utils::{Zeroable,ZeroableInOption}` (re-exported from `bytemuck ^1`)
13+
1014
## [0.1.4] - 2022-11-16
1115

1216
### Changed

src/r3_core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ seq-macro = { version = "0.3.0" }
2828
svgbobdoc = { version = "0.3.0" }
2929
tokenlock = { version = "0.3.4", default-features = false }
3030
arrayvec = { version = "0.7.1", default-features = false }
31+
bytemuck = { version = "1.12.3", features = ["derive"] }
3132
bitflags = { version = "1.2.1" }
3233
macropol = { version = "0.1.2" }
3334
either = { version = "1.6.1", default-features = false }

src/r3_core/src/utils/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@
33
//! **This module is exempt from [the API stability guarantee][1]** unless
44
//! specified otherwise. It's exposed mostly because it's needed by macros.
55
//!
6+
//! # Re-exports
7+
//!
8+
//! - [`Zeroable`], [`ZeroableInOption`]: Re-exported from [`bytemuck`]` ^1`.
9+
//! `Zeroable` is a marker trait used in [`HunkDefiner::zeroed`][2] and
10+
//! suchlike. It can be derived for struct types.
11+
//! These re-exports are subject to the application-side API stability
12+
//! guarantee.
13+
//!
614
//! [1]: crate#stability
15+
//! [2]: crate::hunk::HunkDefiner::zeroed
716
use core::marker::PhantomData;
817

918
/// Conditional type
@@ -71,6 +80,8 @@ pub use init::*;
7180
pub use rawcell::*;
7281
pub use zeroinit::*;
7382

83+
pub use bytemuck::{Zeroable, ZeroableInOption};
84+
7485
/// A phantom type that is invariant over `T`.
7586
pub type PhantomInvariant<T> = core::marker::PhantomData<fn(T) -> T>;
7687

0 commit comments

Comments
 (0)