This commit is contained in:
nora 2022-04-03 14:29:11 +02:00
parent a453f210b3
commit b5290e0a44
2 changed files with 213 additions and 27 deletions

View file

@ -11,7 +11,7 @@ unsafe impl StuffingStrategy for () {
0
}
fn extract_extra(_data: usize) -> Self::Extra {
unsafe fn extract_extra(_data: usize) -> Self::Extra {
()
}
}
@ -31,17 +31,23 @@ pub mod test_strategies {
data == usize::MAX
}
fn stuff_extra(_inner: Self::Extra) -> usize {
fn stuff_extra(inner: Self::Extra) -> usize {
std::mem::forget(inner);
usize::MAX
}
fn extract_extra(_data: usize) -> Self::Extra {
unsafe fn extract_extra(_data: usize) -> Self::Extra {
$ty
}
}
};
}
#[derive(Clone, Copy)]
pub struct EmptyInMax;
impl_usize_max_zst!(EmptyInMax);
pub struct HasDebug;
impl Debug for HasDebug {
@ -52,6 +58,7 @@ pub mod test_strategies {
impl_usize_max_zst!(HasDebug);
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PanicsInDrop;
impl Drop for PanicsInDrop {