mirror of
https://github.com/Noratrieb/stuff.git
synced 2026-01-15 17:05:08 +01:00
add docs
This commit is contained in:
parent
a453f210b3
commit
b5290e0a44
2 changed files with 213 additions and 27 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue