Skip to content

Commit 34e8369

Browse files
committed
make a new and separate crate, not a module within bytemuck itself.
1 parent 3161f88 commit 34e8369

File tree

5 files changed

+22
-12
lines changed

5 files changed

+22
-12
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ jobs:
4343
if: matrix.rust == 'nightly'
4444
- run: cargo test --verbose --manifest-path=derive/Cargo.toml --all-features
4545
if: matrix.rust == 'nightly'
46+
- run: cd contigous_bitset && cargo test
4647

4748
cross-test:
4849
name: Test on ${{ matrix.target }} with cross

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ keywords = ["transmute", "bytes", "casting"]
99
categories = ["encoding", "no-std"]
1010
edition = "2018"
1111
license = "Zlib OR Apache-2.0 OR MIT"
12-
exclude = ["/pedantic.bat"]
12+
exclude = ["/pedantic.bat", "derive/", "contigous_bitset/"]
1313

1414
[features]
1515
# In v2 we'll fix these names to be more "normal".
@@ -37,10 +37,12 @@ min_const_generics = [] # MSRV 1.51: support arrays via min_const_generics
3737

3838
wasm_simd = [] # MSRV 1.54.0: support wasm simd types
3939
aarch64_simd = [] # MSRV 1.59.0: support aarch64 simd types
40-
avx512_simd = [] # MSRV 1.72.0: support avx512 simd types
40+
avx512_simd = [] # MSRV 1.72.0: support avx512 simd types
4141

4242
must_cast = [] # MSRV 1.64.0: support the `must` module.
43-
must_cast_extra = ["must_cast"] # MSRV 1.83.0: support mutable references in const
43+
must_cast_extra = [
44+
"must_cast",
45+
] # MSRV 1.83.0: support mutable references in const
4446

4547
# Adds `TransparentWrapper` impls for stdlib types newer than bytemuck's base MSRV.
4648
# Current MSRV 1.74.0: `core::num::Saturating`.
@@ -108,7 +110,9 @@ nightly_docs = []
108110
bytemuck_derive = { version = "1.10.1", path = "derive", optional = true }
109111

110112
[lints.rust]
111-
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(target_arch, values("spirv"))'] }
113+
unexpected_cfgs = { level = "deny", check-cfg = [
114+
'cfg(target_arch, values("spirv"))',
115+
] }
112116

113117
[package.metadata.docs.rs]
114118
# Note(Lokathor): Don't use all-features or it would use `unsound_ptr_pod_impl` too.
@@ -121,8 +125,4 @@ features = [
121125

122126
[package.metadata.playground]
123127
# Note(Lokathor): Don't use all-features or it would use `unsound_ptr_pod_impl` too.
124-
features = [
125-
"latest_stable_rust",
126-
"extern_crate_alloc",
127-
"extern_crate_std",
128-
]
128+
features = ["latest_stable_rust", "extern_crate_alloc", "extern_crate_std"]

contigous_bitset/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "contigous_bitset"
3+
description = "Stores a set of `bytemuck::Contiguous` values encoded as bits."
4+
repository = "https://github.com/Lokathor/bytemuck"
5+
license = "Zlib OR Apache-2.0 OR MIT"
6+
version = "0.1.0"
7+
edition = "2024"
8+
rust-version = "1.89"
9+
10+
[dependencies]
11+
bytemuck = "1.24"

src/contigous_bitset.rs renamed to contigous_bitset/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use core::{convert::TryFrom, marker::PhantomData};
44

55
use crate::Contiguous;
66

7+
/// turns any `Contiguous` into its bit position within a `u64`
78
#[inline]
89
#[must_use]
910
fn contiguous_index<C>(c: C) -> u64

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@ pub use no_uninit::*;
222222
mod contiguous;
223223
pub use contiguous::*;
224224

225-
mod contigous_bitset;
226-
pub use contigous_bitset::*;
227-
228225
mod offset_of;
229226
// ^ no import, the module only has a macro_rules, which are cursed and don't
230227
// follow normal import/export rules.

0 commit comments

Comments
 (0)