commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
148a6b5d27df2574f8bfbc1772ed3ee991c0e40a | Jiahao XU | 2021-08-06T10:44:20 | Simplify impl `RefCnt` for `ThinArc<H, T>`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> | diff --git a/src/arc_swap_support.rs b/src/arc_swap_support.rs
index 30c267e..3f9aec1 100644
--- a/src/arc_swap_support.rs
+++ b/src/arc_swap_support.rs
@@ -18,7 +18,7 @@ unsafe impl<H, T> RefCnt for ThinArc<H, T> {
}
#[inline]
- unsafe fn from_ptr(ptr: *const Self::Base) -> ThinArc<H, T> {
+ unsafe f... | 1 | 1 | 1 |
6bc407fba447797c6bc16b5973a09b25d54f994d | Jiahao XU | 2021-08-06T10:43:55 | Impl `RefCnt` for `Arc<T>`
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> | diff --git a/src/arc_swap_support.rs b/src/arc_swap_support.rs
index c45745a..30c267e 100644
--- a/src/arc_swap_support.rs
+++ b/src/arc_swap_support.rs
@@ -2,7 +2,7 @@ use arc_swap::RefCnt;
use core::ffi::c_void;
use core::ptr::NonNull;
-use crate::ThinArc;
+use crate::{Arc, ThinArc};
unsafe impl<H, T> RefCnt f... | 1 | 20 | 1 |
298ecc13349b647fb0e1813e02450bff5a590659 | Jiahao XU | 2021-08-06T10:41:20 | Impl new associated func Arc::as_ptr
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> | diff --git a/src/arc.rs b/src/arc.rs
index 131340a..f2629ba 100644
--- a/src/arc.rs
+++ b/src/arc.rs
@@ -75,11 +75,19 @@ impl<T> Arc<T> {
/// It is recommended to use OffsetArc for this.
#[inline]
pub fn into_raw(this: Self) -> *const T {
- let ptr = unsafe { &((*this.ptr()).data) as *const _ };
+... | 1 | 9 | 1 |
805ba1c233effcbc4685bf3775440d48a6f647c8 | Jiahao XU | 2021-08-06T10:32:48 | Make ThinArc::from_raw unsafe
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> | diff --git a/src/thin_arc.rs b/src/thin_arc.rs
index a3ea59d..171a1cf 100644
--- a/src/thin_arc.rs
+++ b/src/thin_arc.rs
@@ -92,6 +92,8 @@ impl<H, T> ThinArc<H, T> {
self.ptr()
}
+ /// # Safety
+ ///
/// Constructs an ThinArc from a raw pointer.
///
/// The raw pointer must have bee... | 1 | 4 | 2 |
8ad13194fdea73e5961dcd77e694b863ae3579d4 | Jiahao XU | 2021-08-06T09:50:34 | Add optional arc_swap_support
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> | diff --git a/Cargo.lock b/Cargo.lock
index 9cff557..9646cd9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,5 +1,13 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "arc-swap"
+version = "1.3.0"
+source = "registry+https://github.com/rust... | 4 | 38 | 0 |
858ae1add1555f0cb206c2578d337314a2baa823 | Jiahao XU | 2021-08-06T09:26:19 | Impl new associated func from_raw, into_raw and as_ptr for ThinArc
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> | diff --git a/src/thin_arc.rs b/src/thin_arc.rs
index 93d9b9e..a3ea59d 100644
--- a/src/thin_arc.rs
+++ b/src/thin_arc.rs
@@ -91,6 +91,39 @@ impl<H, T> ThinArc<H, T> {
pub fn heap_ptr(&self) -> *const c_void {
self.ptr()
}
+
+ /// Constructs an ThinArc from a raw pointer.
+ ///
+ /// The raw ... | 1 | 54 | 0 |
3165c244a5eab71a7d9b0dea1fb771c192cf529c | Chase Wilson | 2021-06-10T16:02:46 | Bumped crate version to 0.1.3 | diff --git a/Cargo.lock b/Cargo.lock
index 0b3e964..9cff557 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -29,7 +29,7 @@ checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
[[package]]
name = "triomphe"
-version = "0.1.2"
+version = "0.1.3"
dependencies = [
"memoffset",
"serde",
diff --... | 2 | 2 | 2 |
3e7a94e6a1bbd06fbae853e252f9b376370fd057 | Chase Wilson | 2021-06-02T20:22:18 | Added `Arc::count()`, `Arc::try_unwrap()` and `Unique::into_inner()` | diff --git a/src/arc.rs b/src/arc.rs
index 2d75535..131340a 100644
--- a/src/arc.rs
+++ b/src/arc.rs
@@ -18,7 +18,7 @@ use serde::{Deserialize, Serialize};
#[cfg(feature = "stable_deref_trait")]
use stable_deref_trait::{CloneStableDeref, StableDeref};
-use super::{abort, ArcBorrow, OffsetArc};
+use crate::{abort, A... | 2 | 162 | 25 |
15b493034ecdcc9e880cd08e85ca1a3403cea4b9 | Chase Wilson | 2021-06-02T20:01:05 | Appease clippy | diff --git a/src/arc.rs b/src/arc.rs
index 1c07625..2d75535 100644
--- a/src/arc.rs
+++ b/src/arc.rs
@@ -99,7 +99,7 @@ impl<T> Arc<T> {
/// It has the benefits of an `&T` but also knows about the underlying refcount
/// and can be converted into more `Arc<T>`s if necessary.
#[inline]
- pub fn borrow_a... | 4 | 18 | 20 |
a9c7465c6a5f4429af3afa5f3da6a8c378eda503 | Andreas Molzer | 2021-04-16T19:53:29 | Hide unsize's impls behind feature flag | diff --git a/Cargo.toml b/Cargo.toml
index 35ca47e..cac7a4a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,4 +16,4 @@ default = ["serde", "stable_deref_trait", "std"]
memoffset = "0.6"
serde = { version = "1.0", default-features = false, optional = true }
stable_deref_trait = { version = "1.1.1", default-features =... | 5 | 6 | 1 |
2f481b3dbeb28bc63bd9443fbe0e66a88dc42333 | Andreas Molzer | 2021-04-16T19:13:22 | Add safety comments for CoerciblePtr, from_raw_inner | diff --git a/src/arc.rs b/src/arc.rs
index d58384c..722a9b4 100644
--- a/src/arc.rs
+++ b/src/arc.rs
@@ -152,6 +152,10 @@ impl<T> Arc<T> {
}
impl<T: ?Sized> Arc<T> {
+ /// Construct an `Arc` from an allocated `ArcInner`.
+ /// # Safety
+ /// The `ptr` must point to a valid instance, allocated by an `Arc`. ... | 3 | 35 | 0 |
f335c9376c365822beeeab10beaeb7227706f4fd | Andreas Molzer | 2021-04-15T20:25:14 | Implement unsize crate's trait CoerciblePtr
This provides a patch to unsizing some of the pointers of this crate.
The missing cases would requiring adjustments to offsetting. This is
implemented by casting from `*const T` to `*const u8` which causes a
loss of the associated fat pointer tag if any exists. | diff --git a/Cargo.lock b/Cargo.lock
index 121f866..0b3e964 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -34,4 +34,14 @@ dependencies = [
"memoffset",
"serde",
"stable_deref_trait",
+ "unsize",
+]
+
+[[package]]
+name = "unsize"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+... | 7 | 94 | 11 |
cba28cc7b7cbaf7191a92777924f9f30a57abd43 | Nika Layzell | 2021-02-23T22:51:08 | Document the ABI and layout of OffsetArc<T> | diff --git a/src/offset_arc.rs b/src/offset_arc.rs
index 0d4b93a..57284b3 100644
--- a/src/offset_arc.rs
+++ b/src/offset_arc.rs
@@ -7,7 +7,10 @@ use core::ptr;
use super::{Arc, ArcBorrow};
/// An `Arc`, except it holds a pointer to the T instead of to the
-/// entire ArcInner. This struct is FFI-compatible.
+/// e... | 1 | 5 | 2 |
0b4ec914d7621a264d5e242ac000bcbd61e3919f | Aleksey Kladov | 2021-01-19T11:18:25 | Expose direct access to length
Note that HeaderWithLength::new function is public, so we already can
muck with the length field:
use triomphe::{HeaderWithLength, ThinArc, Arc};
fn main() {
let thin_arc = ThinArc::from_header_and_iter((), std::iter::once(92));
let mut arc = Arc::from_thin(thin... | diff --git a/src/header.rs b/src/header.rs
index e3a93d1..888b8e5 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -125,7 +125,7 @@ pub struct HeaderWithLength<H> {
pub header: H,
/// The slice length.
- pub(crate) length: usize,
+ pub length: usize,
}
impl<H> HeaderWithLength<H> { | 1 | 1 | 1 |
fa3d1e58a22b9865b8804c12ccd3c064357b888b | Aleksey Kladov | 2021-01-15T17:51:27 | Update memoffset | diff --git a/Cargo.lock b/Cargo.lock
index c1c01c0..121f866 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8,9 +8,9 @@ checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
[[package]]
name = "memoffset"
-version = "0.5.4"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/cra... | 2 | 3 | 3 |
461a36d87224292057290f8f39b43c0ebed985f4 | Aleksey Kladov | 2021-01-10T14:02:23 | Bump Cargo.toml version | diff --git a/Cargo.lock b/Cargo.lock
index 8c5cad4..c1c01c0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -29,7 +29,7 @@ checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
[[package]]
name = "triomphe"
-version = "0.1.1"
+version = "0.1.2"
dependencies = [
"memoffset",
"serde",
diff --... | 2 | 3 | 3 |
f95ff3b95c5ce1004c497be0685d40c9fb9508cf | Aleksey Kladov | 2021-01-10T14:01:57 | Implement Hash for thin arc | diff --git a/src/header.rs b/src/header.rs
index 6de15b2..e3a93d1 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -11,7 +11,7 @@ use super::{Arc, ArcInner};
/// Structure to allow Arc-managing some fixed-sized data and a variably-sized
/// slice in a single allocation.
-#[derive(Debug, Eq, PartialEq, PartialOrd)]... | 2 | 10 | 3 |
2258a86175e80c60a5318d4f6fc9af6a2310fe00 | Thom Chiovoloni | 2020-04-13T16:50:50 | Use PhantomData in OffsetArc | diff --git a/lib.rs b/lib.rs
index 4ac3852..c093b4a 100644
--- a/lib.rs
+++ b/lib.rs
@@ -950,7 +950,7 @@ impl<H: Eq, T: Eq> Eq for ThinArc<H, T> {}
#[repr(transparent)]
pub struct OffsetArc<T> {
ptr: ptr::NonNull<T>,
- // XXX(thom) doesn't this need PhantomData<T> (or PhantomData<Arc<T>>?)
+ phantom: Phant... | 1 | 3 | 1 |
845d9602aefee41d06156ebcb7319f806ee619a9 | Thom Chiovoloni | 2020-04-12T21:12:00 | Add inline/cold hints where they seemed missing | diff --git a/lib.rs b/lib.rs
index 1e3bda2..4ac3852 100644
--- a/lib.rs
+++ b/lib.rs
@@ -158,12 +158,14 @@ impl<T> UniqueArc<mem::MaybeUninit<T>> {
impl<T> Deref for UniqueArc<T> {
type Target = T;
+ #[inline]
fn deref(&self) -> &T {
&*self.0
}
}
impl<T> DerefMut for UniqueArc<T> {
+ ... | 1 | 13 | 5 |
9165776164238fab3c4a2362d89640a8c6524700 | Thom Chiovoloni | 2020-04-12T21:04:01 | Use repr(transparent) on single-pointer structs | diff --git a/lib.rs b/lib.rs
index 37f5d86..1e3bda2 100644
--- a/lib.rs
+++ b/lib.rs
@@ -75,7 +75,7 @@ const STATIC_REFCOUNT: usize = usize::MAX;
/// standard library `Arc`, this `Arc` does not support weak reference counting.
///
/// [`Arc`]: https://doc.rust-lang.org/stable/std/sync/struct.Arc.html
-#[repr(C)]
+#[... | 1 | 6 | 3 |
b216126ffc64600325edd82d5257b0c668568d0a | Thom Chiovoloni | 2020-04-12T20:56:55 | Update from servo_arc | diff --git a/lib.rs b/lib.rs
index 966f273..37f5d86 100644
--- a/lib.rs
+++ b/lib.rs
@@ -65,6 +65,10 @@ use stable_deref_trait::{CloneStableDeref, StableDeref};
/// necessarily) at _exactly_ `MAX_REFCOUNT + 1` references.
const MAX_REFCOUNT: usize = (isize::MAX) as usize;
+/// Special refcount value that means the ... | 1 | 234 | 55 |
cb0cbfc5be263d41278cea714ed76bdddce656f9 | Thom Chiovoloni | 2020-04-13T16:41:58 | Put no_std and the custom abort behind a feature | diff --git a/Cargo.toml b/Cargo.toml
index 05bdfa3..e4a3c6b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,8 @@ name = "triomphe"
path = "lib.rs"
[features]
-default = ["serde", "stable_deref_trait"]
+std = []
+default = ["serde", "stable_deref_trait", "std"]
[dependencies]
memoffset = "0.5.3"
diff --git... | 2 | 9 | 2 |
becf56c51235d952b6dd9e4574b2ec46f0f289b8 | Thom Chiovoloni | 2020-04-12T15:45:16 | Add support for no_std | diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..8c5cad4
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,37 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "autocfg"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang... | 3 | 80 | 27 |
cd0cdb2ac04fd0233b0371363af5acc916e936c3 | Nika Layzell | 2020-02-23T02:49:38 | Avoid miri-detected UB in from_header_with_iter | diff --git a/lib.rs b/lib.rs
index e22c7ea..81a209f 100644
--- a/lib.rs
+++ b/lib.rs
@@ -28,6 +28,7 @@ extern crate stable_deref_trait;
use serde::{Deserialize, Serialize};
use stable_deref_trait::{CloneStableDeref, StableDeref};
+use std::alloc::Layout;
use std::borrow;
use std::cmp::Ordering;
use std::convert:... | 1 | 30 | 58 |
79427206da75d3383b8de0eb587a951b2a413890 | CAD97 | 2020-01-09T19:19:43 | Replace homegrown offset_of with memoffset | diff --git a/Cargo.toml b/Cargo.toml
index f39e746..0ddce7c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,6 +14,7 @@ path = "lib.rs"
[dependencies]
+memoffset = "0.5.3"
nodrop = "0.1.8"
serde = "1.0"
stable_deref_trait = "1.0.0"
diff --git a/lib.rs b/lib.rs
index ca75fe4..af805be 100644
--- a/lib.rs
+++ b/lib... | 2 | 4 | 20 |
8112fc88b73a7c0e81ddc602021e37fbd38ca3ae | CAD97 | 2020-01-09T19:13:04 | Replace NoDrop with ManuallyDrop | diff --git a/Cargo.toml b/Cargo.toml
index f39e746..bcb114c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,6 +14,5 @@ path = "lib.rs"
[dependencies]
-nodrop = "0.1.8"
serde = "1.0"
stable_deref_trait = "1.0.0"
diff --git a/lib.rs b/lib.rs
index ca75fe4..9df3c04 100644
--- a/lib.rs
+++ b/lib.rs
@@ -21,11 +21,9 @... | 2 | 5 | 22 |
38bd2947c455ae074c2a9ebd8ebd93ea23b0ceb5 | Manish Goregaokar | 2019-05-20T17:41:29 | Add keywords/categories, publish 0.1.1 | diff --git a/Cargo.toml b/Cargo.toml
index a516230..f39e746 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,10 +1,12 @@
[package]
name = "triomphe"
-version = "0.1.0"
+version = "0.1.1"
authors = ["The Servo Project Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/Manishearth/triomphe"
desc... | 1 | 3 | 1 |
ef6395c301622b699f9575481aaf8bcab4489cbd | Manish Goregaokar | 2018-12-04T16:57:16 | Import from Gecko
rev 47077594d9435da9838536ea2221b19e6a5961e7 | diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..58f1ea8
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,19 @@
+[package]
+name = "servo_arc"
+version = "0.1.1"
+authors = ["The Servo Project Developers"]
+license = "MIT/Apache-2.0"
+repository = "https://github.com/servo/servo"
+description = "A fork... | 2 | 1,224 | 0 |
4fcc5a45dba500e4f10135bbb90a1f27ee541e78 | Rimi Kanokawa | 2025-11-21T04:53:48 | Add flags-related keywords to allow this crate to be easier found on crates.io | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index 3d20e39..1e019ff 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2021"
rust-version = "1.61"
description = "A library for creating compact sets of enums."
-keywords = ["enum", "bitset"]
+keywords = ["enum", "bitset", "fla... | 1 | 1 | 1 |
dff1cc19a8d606772ce0ee59d3ba54078756566b | Christian Egli | 2025-11-16T09:50:48 | Fix a typo in the EnumSetType trait documentation | diff --git a/enumset/src/traits.rs b/enumset/src/traits.rs
index ea0ea74..5d118b0 100644
--- a/enumset/src/traits.rs
+++ b/enumset/src/traits.rs
@@ -5,7 +5,7 @@ use crate::EnumSet;
/// The trait used to define enum types that may be used with [`EnumSet`].
///
-/// This trait must be impelmented using `#[derive(Enum... | 1 | 1 | 1 |
46fbe602b84b6fa8af1acc242527ab3066377ce5 | Rimi Kanokawa | 2025-08-21T11:34:58 | Document the const time macros better. | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index ebca948..060d0b7 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -74,6 +74,13 @@ pub mod set {
///
/// This macro accepts trailing `|`s to allow easier use in other macros.
///
+/// # Performance
+///
+/// This macro is designed for u... | 1 | 42 | 0 |
773d04bac3f6c5374a348f2a4a8ad12e784716b4 | Rimi Kanokawa | 2025-08-21T11:31:25 | Fix small bugs remaining in the codebase. | diff --git a/enumset/tests/bitset_serde_ops.rs b/enumset/tests/bitset_serde_ops.rs
index d3daddf..418dd9b 100644
--- a/enumset/tests/bitset_serde_ops.rs
+++ b/enumset/tests/bitset_serde_ops.rs
@@ -168,3 +168,5 @@ tests!(array_enum, serde_test_simple!(ArrayEnum, !0));
tests!(large_enum, serde_test_simple!(LargeEnum, !0... | 2 | 6 | 5 |
e40e6a105a7f2d170b18d3445aa30bd5b624c239 | Rimi Kanokawa | 2025-08-21T11:05:13 | Rework macros to not require exposing __priv_expr publically. | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index 926af75..ebca948 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -34,15 +34,37 @@ pub mod __internal {
/// if serde support is not enabled.
pub use __if_serde;
- /// Helper macro to retrieve the helper used in constant tim... | 3 | 108 | 93 |
f588bc57312823da653c4134ecd1fba18387dad2 | Rimi Kanokawa | 2025-08-19T09:41:53 | Fix several bugs revealed by code coverage reports. | diff --git a/enumset/tests/bitset_basic_ops.rs b/enumset/tests/bitset_basic_ops.rs
index ac90360..c9c6373 100644
--- a/enumset/tests/bitset_basic_ops.rs
+++ b/enumset/tests/bitset_basic_ops.rs
@@ -141,8 +141,9 @@ pub enum CompactEnumA {
/// Used to test enums with sparse elements.
#[derive(EnumSetType, Debug)]
#[enu... | 8 | 278 | 21 |
844b194087992384f47da2be055eef21f1c3688f | Rimi Kanokawa | 2025-08-17T18:27:34 | Remove some dead code. | diff --git a/enumset/src/repr/array.rs b/enumset/src/repr/array.rs
index 90d04f6..5c3c9a6 100644
--- a/enumset/src/repr/array.rs
+++ b/enumset/src/repr/array.rs
@@ -75,26 +75,6 @@ impl<const N: usize> EnumSetTypeRepr for ArrayRepr<N> {
fn count_ones(&self) -> u32 {
self.0.iter().map(|x| x.count_ones()).su... | 3 | 20 | 33 |
2eaf42de69c4eb8c335e4d51793c3638a7cc51d1 | Rimi Kanokawa | 2025-08-17T17:57:00 | Opps, actually add the test. | diff --git a/enumset_test_nightly/tests/compile-pass/test_hygiene.rs b/enumset_test_nightly/tests/compile-pass/test_hygiene.rs
new file mode 100644
index 0000000..b27c12b
--- /dev/null
+++ b/enumset_test_nightly/tests/compile-pass/test_hygiene.rs
@@ -0,0 +1,233 @@
+#![allow(unused_imports)]
+
+mod defmt_hygiene {
+ ... | 1 | 233 | 0 |
4d8ef13602ba0ce6f0885fff219a714cb7861e7c | Rimi Kanokawa | 2025-08-17T17:56:09 | Add a test for obvious hygiene issues. | diff --git a/enumset_test_nightly/Cargo.toml b/enumset_test_nightly/Cargo.toml
index 90b9a63..073aa61 100644
--- a/enumset_test_nightly/Cargo.toml
+++ b/enumset_test_nightly/Cargo.toml
@@ -16,7 +16,11 @@ serde = { version = "1", features = ["derive"] }
serde_derive = "1"
[dev-dependencies]
+anyhow = "1.0.99"
crite... | 1 | 4 | 0 |
757fd57252f30ba9c4784f0f0cdd4e4759060f7f | Rimi Kanokawa | 2025-08-17T17:55:40 | Improve hygiene for uninhabited types. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 7b69d69..0e7464b 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -367,7 +367,7 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
quote! {}
} else {
let eq_impl = if is_uninhabited {
- ... | 1 | 3 | 3 |
0e3bea7c73c1340a6ffa55ede6d15b37c942d5e7 | Rimi Kanokawa | 2025-08-19T09:41:53 | Fix several bugs revealed by code coverage reports. | diff --git a/enumset/tests/bitset_basic_ops.rs b/enumset/tests/bitset_basic_ops.rs
index cc40c9c..a8a7d66 100644
--- a/enumset/tests/bitset_basic_ops.rs
+++ b/enumset/tests/bitset_basic_ops.rs
@@ -160,8 +160,9 @@ pub enum CompactEnumA {
#[derive(EnumSetType, Debug)]
#[enumset(map = "compact", repr = "u8")]
#[rustfmt... | 8 | 322 | 9 |
547a99605e88afd9bb364c7de2f8f4be03e8179d | Rimi Kanokawa | 2025-08-17T18:39:06 | Add some missing tests for converage. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index d8406f6..d3aba5c 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -614,7 +614,7 @@ fn create_enum_conversions(info: &EnumSetInfo, paths: &Paths) -> SynTokenStream
}
}
} else {
- panic!("Un... | 5 | 100 | 2 |
18f9c5166173daa36341c722b3e2c120bd54133c | Rimi Kanokawa | 2025-08-17T17:55:40 | Improve hygiene for uninhabited types. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 839d23f..d8406f6 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -367,7 +367,7 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
quote! {}
} else {
let eq_impl = if is_uninhabited {
- ... | 1 | 3 | 3 |
b0cb0e7c2344710e3df45ac7c2fc4c94c2ab34d5 | Dániel Buga | 2025-08-17T17:20:00 | Use core's assert | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 0248022..7b69d69 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -435,8 +435,8 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
quote! {
const _: () = {
// Double check fundamental... | 1 | 2 | 2 |
70cb73fb22dd62dbc13b02046b1655df1f931973 | Dániel Buga | 2025-08-17T17:20:00 | Use core's assert | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 8afc120..839d23f 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -435,8 +435,8 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
quote! {
const _: () = {
// Double check fundamental... | 1 | 2 | 2 |
37c9adeb0e2b57ab9887d154d051b10a24080563 | Rimi Kanokawa | 2025-08-17T01:46:24 | Fix compilation on MSRV. | diff --git a/enumset/src/set_common.rs b/enumset/src/set_common.rs
index 96b5e47..10abc18 100644
--- a/enumset/src/set_common.rs
+++ b/enumset/src/set_common.rs
@@ -266,7 +266,7 @@ macro_rules! set_iterator_impls {
}
}
- impl<'a, T: $set_trait> FromIterator<&'a T> for $name<T> {
+ ... | 2 | 3 | 3 |
74f3e1bee7bd882c63c9c9cf635d7421cce9f72d | Rimi Kanokawa | 2025-08-17T01:37:35 | Add remaining tests based on coverage. | diff --git a/enumset/src/set.rs b/enumset/src/set.rs
index 0a6cd8c..f1e9011 100644
--- a/enumset/src/set.rs
+++ b/enumset/src/set.rs
@@ -147,6 +147,12 @@ impl<T: EnumSetType> EnumSet<T> {
set_common_methods!(T, T::Repr);
+ /// Returns a set containing all enum variants not in this set.
+ #[inline(always)... | 5 | 203 | 32 |
5966cfb20547d6e8c50effb8318cd00a51c1286e | Rimi Kanokawa | 2025-08-16T23:02:39 | Finish implementation of MixedEnumSet. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index 1270013..9b0ff9a 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -97,10 +97,11 @@ mod set_common;
mod derive;
mod repr;
mod set;
-//mod set_mixed;
+mod set_mixed;
mod traits;
pub use crate::derive::EnumSetType;
pub use crate::macros::__inter... | 4 | 346 | 738 |
62489d1497891ea5bd0ccf93b1772b24faf60a41 | Rimi Kanokawa | 2025-08-16T22:09:20 | Factor out common impls in set. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index de5dadb..1270013 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -91,10 +91,13 @@ extern crate alloc;
mod macros;
+#[macro_use]
+mod set_common;
+
mod derive;
-mod mixed_set;
mod repr;
mod set;
+//mod set_mixed;
mod traits;
pub use crate... | 4 | 130 | 233 |
f4873c1824b420457331a1e10c7deb9c0faf4352 | Rimi Kanokawa | 2025-08-16T21:40:19 | Initial (broken) commit on MixedEnumSet. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index b8da262..de5dadb 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -92,6 +92,7 @@ extern crate alloc;
mod macros;
mod derive;
+mod mixed_set;
mod repr;
mod set;
mod traits;
diff --git a/enumset/src/mixed_set.rs b/enumset/src/mixed_set.rs
new fi... | 3 | 864 | 8 |
6d4c22124c4e37fb1bb5aaa20585bc996d9af3e5 | Rimi Kanokawa | 2025-08-16T20:55:51 | Rename some types to help avoid confusion... opps. :( | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 0248022..8afc120 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -396,7 +396,7 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
//
// Generate the code for the explicit repr trait.
//
- let... | 2 | 22 | 22 |
05b5ec88d7c6c4cee4ad185ecdbf574b8e758214 | Rimi Kanokawa | 2025-08-16T20:54:17 | Revert "Remove unintended way to expose ArrayRepr"
This reverts commit 4fa8cb87f81781992e0a6971351ebcd6f78dd19c. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index fdbd486..0248022 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -396,7 +396,7 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
//
// Generate the code for the explicit repr trait.
//
- let... | 2 | 4 | 11 |
4fa8cb87f81781992e0a6971351ebcd6f78dd19c | Rimi Kanokawa | 2025-08-16T20:44:53 | Remove unintended way to expose ArrayRepr | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 0248022..fdbd486 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -396,7 +396,7 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
//
// Generate the code for the explicit repr trait.
//
- let... | 2 | 11 | 4 |
a0ae6929da8875f8e4b4e9db316a66ddf02554ac | Rimi Kanokawa | 2025-08-16T15:29:14 | Small documentation updates. | diff --git a/enumset/src/derive.rs b/enumset/src/derive.rs
new file mode 100644
index 0000000..b843285
--- /dev/null
+++ b/enumset/src/derive.rs
@@ -0,0 +1,152 @@
+#[cfg(all(doc, feature = "serde"))]
+use serde::{Deserialize, Serialize};
+
+#[cfg(doc)]
+use crate::EnumSet;
+
+/// The procedural macro used to derive [`E... | 3 | 156 | 152 |
e9fc62a1ee02e337937b95d8fdf8729a471a4d1c | Rimi Kanokawa | 2025-08-16T14:58:47 | Fix errors on MSRV. | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index d6ce350..b7200e1 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -38,5 +38,6 @@ defmt = { version = "1", optional = true }
[dev-dependencies]
bincode = { version = "1", features = ["i128"] }
+rustversion = "1.0"
serde_derive = "1"
-serde_json =... | 3 | 6 | 3 |
84536f126d0a5cd2399e7ef62d56fe68edfdeccb | Rimi Kanokawa | 2025-08-16T14:45:11 | Add examples to trybuild. | diff --git a/enumset_test_nightly/tests/trybuild.rs b/enumset_test_nightly/tests/trybuild.rs
index 0e72e32..8d70f28 100644
--- a/enumset_test_nightly/tests/trybuild.rs
+++ b/enumset_test_nightly/tests/trybuild.rs
@@ -5,4 +5,5 @@ fn ui() {
t.compile_fail("tests/compile-fail/*.rs");
t.pass("tests/compile-pass... | 1 | 1 | 0 |
32ebb3e09b5599f9bdcbc1af52c50f0a236455b3 | Rimi Kanokawa | 2025-08-16T13:18:37 | Fix clippy warnings. | diff --git a/enumset_derive/src/plan.rs b/enumset_derive/src/plan.rs
index b80bc88..e21e9f9 100644
--- a/enumset_derive/src/plan.rs
+++ b/enumset_derive/src/plan.rs
@@ -375,7 +375,7 @@ impl EnumSetInfo {
};
for variant in &mut self.variants {
if variant.discriminant >= bit_width {
- ... | 1 | 4 | 4 |
675fb3dac574d5576effa9acd6184676b5e5dae2 | Rimi Kanokawa | 2025-08-16T11:40:08 | Implement mask enums. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index 98606e3..c6af888 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -167,6 +167,8 @@ use serde::{Deserialize, Serialize};
/// compilation will fail.
/// * `#[enumset(map = "compact")]` maps each enum variant to an unspecified bit in the set. This
... | 5 | 171 | 38 |
7876e06eba6ae3f0525b798c504294569fb6f605 | Rimi Kanokawa | 2025-08-16T01:19:15 | Add a failsafe for truly massive bitsets. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index b46fc40..978314a 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -493,39 +493,55 @@ fn create_enum_conversions(info: &EnumSetInfo, paths: &Paths) -> SynTokenStream
quote!()
};
- // Build a t... | 1 | 47 | 31 |
abeef142f33433b22958905f7eab7120732b1236 | Rimi Kanokawa | 2025-08-15T23:58:14 | General improvement for documentation. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index b6ec027..be90a3f 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -99,6 +99,9 @@ pub use crate::macros::__internal;
pub use crate::set::{EnumSet, EnumSetIter};
pub use crate::traits::{EnumSetType, EnumSetTypeWithRepr};
+#[cfg(all(doc, feature = "... | 3 | 92 | 67 |
4c5fa1de525869b718c4e5fd5157dad52eb6350f | Rimi Kanokawa | 2025-08-15T11:08:10 | Fix proc-macro-crate flag. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index e38c977..c7a504c 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -19,7 +19,7 @@ pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
let crate_name = proc_macro_crate::crate_name("enumset");
... | 1 | 1 | 1 |
c19ba3cb61984d493f415de1fcdc6c169f0ff8dc | Rimi Kanokawa | 2025-08-15T11:04:02 | Fix Cargo.toml for MSRV | diff --git a/Cargo.toml b/Cargo.toml
index 262b62e..ab0733b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,4 +10,4 @@ resolver = "2"
[profile.release]
opt-level = 3
lto = true
-debug = "limited"
\ No newline at end of file
+debug = 1
\ No newline at end of file | 1 | 1 | 1 |
1d9e73d8c81a8c897d9714854991752327cc10c5 | Rimi Kanokawa | 2025-08-15T10:57:10 | Improve code generation for very sparse enums. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 14337b5..e38c977 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -1,9 +1,8 @@
//! This module handles generating the actual code to allow an enum type to be used as a bitset.
use crate::plan::{EnumSetInfo, InternalRep... | 1 | 35 | 26 |
1d7004d987e2bbc2b4e7d6786550865d0814c18b | Rimi Kanokawa | 2025-08-15T08:17:17 | Small improvement to array iteration code. | diff --git a/enumset/src/repr/array.rs b/enumset/src/repr/array.rs
index 0184c2d..90d04f6 100644
--- a/enumset/src/repr/array.rs
+++ b/enumset/src/repr/array.rs
@@ -293,10 +293,13 @@ impl<const N: usize> Iterator for ArrayIter<N> {
if self.done {
return None;
}
- while self.idx_f <... | 1 | 8 | 5 |
0770fcbc55a484df5097994d698e335e41ff91dc | Rimi Kanokawa | 2025-08-15T07:42:17 | Add an additional test for double ended iterators. | diff --git a/enumset/tests/bitset_basic_ops.rs b/enumset/tests/bitset_basic_ops.rs
index 8daddc7..e0813b0 100644
--- a/enumset/tests/bitset_basic_ops.rs
+++ b/enumset/tests/bitset_basic_ops.rs
@@ -358,6 +358,34 @@ macro_rules! test_enum {
check_iter_size_hint(set);
}
+ /// Checks that mix... | 1 | 28 | 0 |
cf9b79b0960722671266bd63074c351209d2cb77 | Rimi Kanokawa | 2025-07-18T20:21:57 | Fix bad documentation link. | diff --git a/enumset_derive/Cargo.toml b/enumset_derive/Cargo.toml
index 5f93c1a..07f0fad 100644
--- a/enumset_derive/Cargo.toml
+++ b/enumset_derive/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2021"
description = "An internal helper crate for enumset. Not public API."
-documentation = "https://lymia.moe/doc/enumset/enu... | 1 | 1 | 1 |
9bf4e8e3936a449b124b9f4cedbb62db2a7a3b21 | Rimi Kanokawa | 2025-07-10T05:26:11 | Minor cleanups on code gen. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index f52dd8a..e285462 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -8,6 +8,7 @@ use syn::*;
/// Generates the actual `EnumSetType` impl.
pub fn generate_code(info: EnumSetInfo) -> SynTokenStream {
let name = &info.na... | 1 | 174 | 147 |
16746c3087281b34c46a55e5414d13cc579cb203 | Rimi Kanokawa | 2025-07-09T02:11:55 | Avoid exposing internal const functions as inherent impls. | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index a547226..926af75 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -11,7 +11,7 @@ pub mod __internal {
/// Reexports of internal types
pub use crate::{
repr::{ArrayRepr, EnumSetTypeRepr},
- traits::EnumSetTypePriv... | 4 | 85 | 91 |
ebae144ac97473696510575f1c0bc8699fa9038b | Rimi Kanokawa | 2025-07-09T01:42:02 | Finish doc comments for enumset_derive modules, whoops. | diff --git a/enumset_derive/src/gen.rs b/enumset_derive/src/gen.rs
index 8b8dd97..45dd074 100644
--- a/enumset_derive/src/gen.rs
+++ b/enumset_derive/src/gen.rs
@@ -1,3 +1,5 @@
+//! This module handles generating the actual code to allow an enum type to be used as a bitset.
+
use crate::plan::{EnumSetInfo, InternalRep... | 2 | 4 | 1 |
fb497f67d0807fd8a822465e1016180fb2fc4cf1 | Rimi Kanokawa | 2025-07-09T01:32:53 | Rename tests to make it more clear what they do. | diff --git a/enumset/tests/ops.rs b/enumset/tests/bitset_basic_ops.rs
similarity index 100%
rename from enumset/tests/ops.rs
rename to enumset/tests/bitset_basic_ops.rs
diff --git a/enumset/tests/conversions.rs b/enumset/tests/bitset_conversions.rs
similarity index 100%
rename from enumset/tests/conversions.rs
rename t... | 4 | 0 | 0 |
6d5d3832a44b0cffd0c3d71fd8b03fed833ec269 | Rimi Kanokawa | 2025-07-08T11:56:14 | Fix a reference to a deprecated feature flag in the documentation. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index 4765b9f..b6ec027 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -142,8 +142,8 @@ pub use crate::traits::{EnumSetType, EnumSetTypeWithRepr};
/// automatically derived versions, or unintentional behavior may be a result.
/// * `#[enumset(no_ops)`... | 1 | 2 | 2 |
296b57619d30f11f3398d7e76dea51c8f2842bbd | Rimi Kanokawa | 2025-07-08T11:23:25 | Document the tests in tests/ops.rs better. | diff --git a/enumset/tests/ops.rs b/enumset/tests/ops.rs
index 18fee58..8daddc7 100644
--- a/enumset/tests/ops.rs
+++ b/enumset/tests/ops.rs
@@ -5,23 +5,24 @@ use enumset::*;
use std::collections::{HashSet, BTreeSet};
use std::fmt::{Debug, Display, Formatter};
+/// Used to test the degenerate case of an uninhabited... | 1 | 118 | 64 |
de7d1327ab7a9f033554494ddafa68815bad8913 | Rimi Kanokawa | 2025-07-08T11:09:47 | Revert "Update bincode to version 2 for use in tests."
This reverts commit acdf09dfa096e29db88d6f7abd4ffa3f037989a9. | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index e34f06f..d6ce350 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -37,6 +37,6 @@ serde = { version = "1", default-features = false, optional = true }
defmt = { version = "1", optional = true }
[dev-dependencies]
-bincode = { version = "2", defaul... | 2 | 7 | 19 |
5aa2c030ae3103884e10547f01fb5f4644f33104 | Rimi Kanokawa | 2025-07-08T11:07:24 | Add missing derives on EnumSet (compared to stdlib collections). | diff --git a/enumset/src/set.rs b/enumset/src/set.rs
index 98863a9..b5c7cd0 100644
--- a/enumset/src/set.rs
+++ b/enumset/src/set.rs
@@ -806,6 +806,16 @@ impl<T: EnumSetType> EnumSet<T> {
EnumSet { __priv_repr: T::Repr::from_u64_slice(bits) }
}
}
+
+impl<T: EnumSetType, const N: usize> From<[T; N]> for E... | 2 | 39 | 0 |
acdf09dfa096e29db88d6f7abd4ffa3f037989a9 | Rimi Kanokawa | 2025-07-08T10:57:37 | Update bincode to version 2 for use in tests. | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index d6ce350..e34f06f 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -37,6 +37,6 @@ serde = { version = "1", default-features = false, optional = true }
defmt = { version = "1", optional = true }
[dev-dependencies]
-bincode = { version = "1", featur... | 2 | 19 | 7 |
9b3b85d0008269f3072908472fc37bb83c1b9043 | Rimi Kanokawa | 2025-07-08T10:33:15 | Clean up the serde feature to remove the ugly serde2 hack. | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index 42eb099..5fb6a9d 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -20,12 +20,12 @@ travis-ci = { repository = "Lymia/enumset", branch = "master" }
maintenance = { status = "actively-developed" }
[features]
-serde = ["serde2"]
alloc = []
proc-ma... | 7 | 13 | 10 |
dcb934b32097428a7c95399f12f21b92129bb6f7 | Rimi Kanokawa | 2025-07-08T10:23:37 | Reuse enumset_test_no_std as a test for cross-compiling with divergent serde flags. | diff --git a/enumset_test_no_std/Cargo.toml b/enumset_test_no_std/Cargo.toml
index 24d60f4..bf7cba8 100644
--- a/enumset_test_no_std/Cargo.toml
+++ b/enumset_test_no_std/Cargo.toml
@@ -13,3 +13,6 @@ cortex-m-semihosting = "0.5.0"
defmt = "1.0.1"
defmt-semihosting = "0.3.0"
enumset = { path = "../enumset", features =... | 1 | 3 | 0 |
51e84d9f80b8ef76565a218530914f9e837a018d | David Tolnay | 2025-07-04T17:38:09 | Fix discrepancy between host vs target "serde" feature | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index 7ecc793..42eb099 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -20,7 +20,7 @@ travis-ci = { repository = "Lymia/enumset", branch = "master" }
maintenance = { status = "actively-developed" }
[features]
-serde = ["serde2", "enumset_derive/serde"... | 4 | 25 | 10 |
1a0dd79931c5e8675b670a1a32378fe7e8f12f48 | Cliff L. Biffle | 2025-06-10T17:10:37 | Fix enum_set!() hygiene.
The enum_set macro in general seems to work fine without EnumSet in
scope, but doesn't work if empty, because it uses the EnumSet name
unqualified in that one case.
This commit fixes that and adds a test for it. | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index a2bfabb..32e5489 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -42,7 +42,7 @@ pub mod __internal {
#[macro_export]
macro_rules! enum_set {
($(|)*) => {
- EnumSet::empty()
+ $crate::EnumSet::empty()
};
($v... | 2 | 12 | 1 |
1eed7cb9ec619ddc993c8ae80a30ccdb5ffd3713 | Rimi Kanokawa | 2025-05-05T15:12:28 | Fix clippy warnings in enumset_derive | diff --git a/enumset_derive/src/lib.rs b/enumset_derive/src/lib.rs
index 51c0e5a..eae16dd 100644
--- a/enumset_derive/src/lib.rs
+++ b/enumset_derive/src/lib.rs
@@ -180,7 +180,7 @@ impl EnumSetInfo {
"list" => self.explicit_serde_repr = Some(SerdeRepr::List),
"map" => self.explicit_serde_repr ... | 1 | 5 | 5 |
549db9d7d43923f61c112a8e9c8d5795bd02cc1e | Rimi Kanokawa | 2025-05-05T14:36:44 | Fix clippy warnings. | diff --git a/enumset_test_no_std/src/main.rs b/enumset_test_no_std/src/main.rs
index de4d92e..4f56f08 100644
--- a/enumset_test_no_std/src/main.rs
+++ b/enumset_test_no_std/src/main.rs
@@ -30,17 +30,15 @@ pub fn _start() {
#[panic_handler]
fn panic_std(_info: &PanicInfo) -> ! {
- loop {}
+ loop { cortex_m::as... | 1 | 3 | 5 |
51b7ebafa55d90762c00a44c290fb188907f5166 | Rimi Kanokawa | 2025-05-05T14:32:01 | Properly set up defmt in the test program. | diff --git a/enumset_test_no_std/Cargo.toml b/enumset_test_no_std/Cargo.toml
index 2e5dd01..24d60f4 100644
--- a/enumset_test_no_std/Cargo.toml
+++ b/enumset_test_no_std/Cargo.toml
@@ -7,6 +7,9 @@ description = "DO NOT PUBLISH"
publish = false
[dependencies]
+cortex-m = { version = "0.7", features = ["critical-sect... | 2 | 21 | 1 |
4564dbacc32c26f447e2071d01fa010b9824ea88 | Rimi Kanokawa | 2025-05-05T14:11:23 | Add defmt to the no_std test. | diff --git a/enumset_test_no_std/Cargo.toml b/enumset_test_no_std/Cargo.toml
index 04eab84..2e5dd01 100644
--- a/enumset_test_no_std/Cargo.toml
+++ b/enumset_test_no_std/Cargo.toml
@@ -7,4 +7,6 @@ description = "DO NOT PUBLISH"
publish = false
[dependencies]
-enumset = { path = "../enumset" }
+defmt = "1.0.1"
+defm... | 2 | 9 | 4 |
fa94de186101fb7a352f68a1a42866afb4383c0e | Rimi Kanokawa | 2025-05-05T13:47:08 | Fix properly for the removal of #[start] | diff --git a/enumset_test_no_std/src/main.rs b/enumset_test_no_std/src/main.rs
index a145e12..9cac766 100644
--- a/enumset_test_no_std/src/main.rs
+++ b/enumset_test_no_std/src/main.rs
@@ -1,4 +1,5 @@
#![no_std]
+#![no_main]
#![deny(warnings)]
use core::panic::PanicInfo;
@@ -11,7 +12,8 @@ pub enum SmallEnum {
... | 1 | 3 | 1 |
d61a8c4b2bdd2770265ec8cc607cc5e4de297efc | Rimi Kanokawa | 2025-05-05T13:39:00 | Fix tests for no_std properly. | diff --git a/enumset_test_no_std/src/main.rs b/enumset_test_no_std/src/main.rs
index 9f74c03..a145e12 100644
--- a/enumset_test_no_std/src/main.rs
+++ b/enumset_test_no_std/src/main.rs
@@ -1,6 +1,7 @@
#![no_std]
#![deny(warnings)]
+use core::panic::PanicInfo;
use enumset::*;
#[derive(EnumSetType)]
@@ -15,4 +16,... | 1 | 7 | 1 |
2f36f5cc80024b8236c5d37d3a4e5f78dbeecd87 | K | 2025-04-11T07:30:35 | Optimize loops in formatters by removing condition. | diff --git a/enumset/src/set.rs b/enumset/src/set.rs
index 5991440..ff886bb 100644
--- a/enumset/src/set.rs
+++ b/enumset/src/set.rs
@@ -384,15 +384,15 @@ impl<T: EnumSetType> PartialEq<T> for EnumSet<T> {
impl<T: EnumSetType + Debug> Debug for EnumSet<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Res... | 1 | 10 | 10 |
ab3f7855d7a4b02ce31619efb01318397576c3c6 | Rimi Kanokawa | 2025-05-05T13:34:49 | Fix warnings and tests. | diff --git a/enumset/src/repr/array.rs b/enumset/src/repr/array.rs
index cc302ef..0184c2d 100644
--- a/enumset/src/repr/array.rs
+++ b/enumset/src/repr/array.rs
@@ -238,7 +238,6 @@ impl<const N: usize> EnumSetTypeRepr for ArrayRepr<N> {
out[i] = 0;
}
}
- #[must_use]
fn to_u64_slice_op... | 3 | 2 | 13 |
8a13dc12683a15a67af6b5e0531c6de1eb679320 | K | 2025-04-11T07:24:02 | Add optional support for defmt
Fix for #53 | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index 91accf4..bd2d6a7 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -34,6 +34,7 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
enumset_derive = { version = "0.10.0", path = "../enumset_derive" }
serde2 = { package = "serde", version = "1", def... | 2 | 16 | 0 |
53671da06ea7762f389f68cb76c1dc944f179ec7 | Rimi Kanokawa | 2024-12-08T05:01:33 | Rearrange deprecated functions for documentation purposes. | diff --git a/enumset/src/set.rs b/enumset/src/set.rs
index febfaf5..630c24f 100644
--- a/enumset/src/set.rs
+++ b/enumset/src/set.rs
@@ -134,18 +134,6 @@ impl<T: EnumSetType> EnumSet<T> {
const EMPTY_REPR: Self = EnumSet { __priv_repr: T::Repr::EMPTY };
const ALL_REPR: Self = EnumSet { __priv_repr: T::ALL_BIT... | 1 | 17 | 12 |
5465d3180555466ef0ed7ee4ea57d8c5d9632ed7 | Rimi Kanokawa | 2024-12-08T04:56:57 | Rerun cargo fmt. | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index 9504ece..a2bfabb 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -129,7 +129,7 @@ macro_rules! enum_set_intersection {
/// # use enumset::*;
/// #[derive(EnumSetType, Debug)]
/// enum Enum { A, B, C, D }
-///
+///
/// const SET: Enu... | 1 | 1 | 1 |
1e86f041960016c81de2ea24c02a715ca06c9984 | Jason White | 2024-11-08T20:46:30 | Mark `EnumSet::as_repr` as const
This allows it to be used at compile time, along with `EnumSet::all`. | diff --git a/enumset/src/set.rs b/enumset/src/set.rs
index 30e0f0a..febfaf5 100644
--- a/enumset/src/set.rs
+++ b/enumset/src/set.rs
@@ -467,7 +467,7 @@ impl<T: EnumSetType + EnumSetTypeWithRepr> EnumSet<T> {
/// In order to use this method, the definition of `T` must have the `#[enumset(repr = "…")]`
/// ann... | 2 | 12 | 6 |
7ba47b9332eb38ec8fdaa707a84c08a494e7b4a2 | Rimi Kanokawa | 2024-07-22T21:43:46 | Show the enum definition for the example in `enum_set_complement!` where it kinda matters. | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index 4f750c7..9504ece 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -127,7 +127,9 @@ macro_rules! enum_set_intersection {
///
/// ```rust
/// # use enumset::*;
-/// # #[derive(EnumSetType, Debug)] enum Enum { A, B, C, D }
+/// #[derive(E... | 1 | 3 | 1 |
0e949ba5d9b06947f086feca2e52af9a9d5a1010 | Rimi Kanokawa | 2024-07-22T21:22:57 | Implement macros for compile-time enumset operations. | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index eac3ef7..4f750c7 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -18,7 +18,7 @@ pub mod __internal {
/// Creates a EnumSet literal, which can be used in const contexts.
///
/// The syntax used is `enum_set!(Type::A | Type::B | Type::C... | 3 | 238 | 13 |
cf68ea9f1c32107ff25b50940075fa27b93dd264 | Rimi Kanokawa | 2024-07-22T20:44:04 | Add support for the use of other enum sets in the enum_set! macro. (Closes #49) | diff --git a/enumset/src/macros.rs b/enumset/src/macros.rs
index f713a58..eac3ef7 100644
--- a/enumset/src/macros.rs
+++ b/enumset/src/macros.rs
@@ -52,8 +52,12 @@ macro_rules! enum_set {
};
($value:path | $($rest:path)|* $(|)*) => {
{
+ #[allow(deprecated)] let helper = $value.__impl_enum... | 5 | 107 | 37 |
f73ef60c88aadea558eccad911dea9aaabc817e7 | Rimi Kanokawa | 2024-07-22T20:01:47 | Whoops. Fix documentation for cargo features. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index b4b595e..4765b9f 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -7,10 +7,14 @@
//! A library for defining enums that can be used in compact bit sets. It supports arbitrarily
//! large enums, and has very basic support for using them in constants.... | 1 | 7 | 12 |
fa62127f4466f9b4ea8557937d5963979c3227df | Rimi Kanokawa | 2024-07-22T19:01:18 | Make functions that can be const as of 1.61, const. (Fixes #45) | diff --git a/enumset/src/set.rs b/enumset/src/set.rs
index 33c1945..28d46c9 100644
--- a/enumset/src/set.rs
+++ b/enumset/src/set.rs
@@ -131,20 +131,25 @@ pub struct EnumSet<T: EnumSetType> {
//region EnumSet operations
impl<T: EnumSetType> EnumSet<T> {
+ const EMPTY_REPR: Self = EnumSet { __priv_repr: T::Repr::... | 3 | 27 | 18 |
11a24827a687c9800d882b58162c82c538525faf | Rimi Kanokawa | 2024-07-22T18:45:01 | Add a deprecation warning for the std feature. | diff --git a/enumset/Cargo.toml b/enumset/Cargo.toml
index 1ac7516..ebe25c1 100644
--- a/enumset/Cargo.toml
+++ b/enumset/Cargo.toml
@@ -25,7 +25,7 @@ alloc = []
proc-macro-crate = ["enumset_derive/proc-macro-crate"]
# Deprecated features
-std = ["alloc", "enumset_derive/proc-macro-crate"]
+std = ["alloc", "enumset... | 4 | 18 | 6 |
78ddecc679c534669ff95d3fc3f90f0a399c45f0 | 즈눅 | 2024-06-30T03:59:04 | Fix broken link in the doc | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index ee509a6..bf919c9 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -153,8 +153,8 @@ pub use crate::traits::{EnumSetType, EnumSetTypeWithRepr};
///
/// * `#[enumset(serialize_repr = "…")]` may be used to override the way the `EnumSet` is
/// seria... | 1 | 2 | 2 |
53ae9026238577ccda5c6b68fe07552ac8910b6a | Alissa Rao | 2023-10-11T19:18:11 | Implement Display for EnumSet where T: Display. | diff --git a/Cargo.toml b/Cargo.toml
index e1c7968..ae511f7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,6 +4,7 @@ members = [
"enumset_derive",
"enumset_test_no_std",
]
+resolver = "2"
[profile.release]
opt-level = 3
diff --git a/enumset/src/set.rs b/enumset/src/set.rs
index 11421f9..33c1945 100644
--... | 3 | 29 | 2 |
d4dd4be6fe5163ce8b1d10077d83c3bb98404035 | Mateusz Kowalczyk | 2023-10-11T04:30:20 | inline `iter` in `repr/primitive.rs`
We have a piece of simple code that looks a bit like this:
```rust
let action = self.iter().next()?;
self.0.remove(action);
Some(action)
```
where `self.iter()` just defers to `EnumSet::iter()`.
Looking at the asm with `cargo asm`, I see something like below. There's
a ... | diff --git a/enumset/src/repr/primitive.rs b/enumset/src/repr/primitive.rs
index ef44ada..c0a644e 100644
--- a/enumset/src/repr/primitive.rs
+++ b/enumset/src/repr/primitive.rs
@@ -52,6 +52,7 @@ macro_rules! prim {
}
type Iter = PrimitiveIter<Self>;
+ #[inline]
... | 1 | 1 | 0 |
0a78e5bf78652da777ab4d7e234598ed256b8eb7 | Alissa Rao | 2023-05-10T02:14:57 | Fix clippy warnings. | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index 1378db3..ee509a6 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -1,7 +1,7 @@
#![no_std]
#![deny(missing_docs)]
-// The safety requirement is "use the procedural derive".
-#![allow(clippy::missing_safety_doc)]
+#![allow(clippy::missing_safety_doc)... | 3 | 3 | 7 |
a197177745715f3c60b103021afc52f05e8a5cd6 | Shamik Chakraborty | 2023-05-08T19:02:52 | extern alloc only when 'alloc' feature is enabled | diff --git a/enumset/src/lib.rs b/enumset/src/lib.rs
index b038d62..1378db3 100644
--- a/enumset/src/lib.rs
+++ b/enumset/src/lib.rs
@@ -82,6 +82,7 @@
//! assert_eq!(set, Enum::A | Enum::E | Enum::G);
//! ```
+#[cfg(feature = "alloc")]
extern crate alloc;
mod macros; | 1 | 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.