From eb478f8922e2cb0784b3ed693a1aa72f0136bbb7 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Aug 2023 21:04:48 -0700 Subject: [PATCH] Fix zero sizing of Iter ---- test_iter stdout ---- thread 'test_iter' panicked at tests/test.rs:7:5: assertion `left == right` failed left: 0 right: 8 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: test_iter --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 1953577..5efba3e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -246,6 +246,7 @@ document_iter! { mod void_iter { enum Void {} + #[repr(C, packed)] pub struct Iter([*const T; 0], Void); unsafe impl Send for Iter {}