Skip to content

Commit d35d4ab

Browse files
author
Daan Sprenkels
committed
Remove assert for support for rust 1.13.0
1 parent b43b139 commit d35d4ab

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,15 @@ fn black_box(input: u8) -> u8 {
161161
//
162162
// Note: Rust's notion of "volatile" is subject to change over time. While this code may break
163163
// in a non-destructive way in the future, it is better than doing nothing.
164-
//
165-
debug_assert!(!core::mem::needs_drop::<u8>());
164+
166165
unsafe {
167166
// Optimization barrier
168167
//
169168
// Unsafe is ok, because:
170169
// - &input is not NULL;
171170
// - size of input is not zero;
172171
// - u8 is neither Sync, nor Send;
173-
// - u8 is Copy (also asserted just before), so input is always live;
172+
// - u8 is Copy, so input is always live;
174173
// - u8 type is always properly aligned.
175174
core::ptr::read_volatile(&input as *const u8)
176175
}

0 commit comments

Comments
 (0)