Merge pull request #44 from bluss/next
Use u8 field in the NoDrop Dropped variant
This commit is contained in:
+3
-2
@@ -42,7 +42,8 @@ mod imp {
|
|||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
enum Flag<T> {
|
enum Flag<T> {
|
||||||
Alive(T),
|
Alive(T),
|
||||||
Dropped,
|
// Dummy u8 field below, again to beat the enum layout opt
|
||||||
|
Dropped(u8),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ mod imp {
|
|||||||
if needs_drop::<T>() {
|
if needs_drop::<T>() {
|
||||||
// inhibit drop
|
// inhibit drop
|
||||||
unsafe {
|
unsafe {
|
||||||
ptr::write(&mut self.0, Flag::Dropped);
|
ptr::write(&mut self.0, Flag::Dropped(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user