We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d61e158 commit 0273f29Copy full SHA for 0273f29
src/distributed_slice.rs
@@ -163,7 +163,9 @@ impl<T> DistributedSlice<[T]> {
163
dupcheck_start: *const (),
164
dupcheck_stop: *const (),
165
) -> Self {
166
- assert!(mem::size_of::<T>() > 0);
+ if mem::size_of::<T>() == 0 {
167
+ panic!("#[distributed_slice] requires that the slice element type has nonzero size");
168
+ }
169
170
DistributedSlice {
171
name,
tests/ui/zerosized.stderr
@@ -1,4 +1,4 @@
1
-error[E0080]: evaluation panicked: assertion failed: mem::size_of::<T>() > 0
+error[E0080]: evaluation panicked: #[distributed_slice] requires that the slice element type has nonzero size
2
--> tests/ui/zerosized.rs:7:1
3
|
4
7 | #[distributed_slice]
0 commit comments