3 releases (breaking)

0.4.0 Mar 14, 2024
0.3.0 Mar 6, 2024
0.2.0 Mar 6, 2024
0.1.0 Mar 2, 2024

#1666 in Rust patterns

MIT license

16KB
176 lines

genz

Uniqueness of types via invariant lifetimes.

Provides a non-Copy zero-sized type-marker called UniqueType, which makes it impossible to call the following without resorting to unsafe code:

# use genz::*;
fn same_type<'c, T>(t1: UniqueType<'c, T>, t2: UniqueType<'c, T>)
{
  panic!("this is impossible!")
}

lib.rs:

Uniqueness of types via invariant lifetimes.

Provides a UniqueType marker which makes it impossible to call the following without resorting to unsafe code:

fn same_type<'c, T>(t1: UniqueType<'c, T>, t2: UniqueType<'c, T>)
{
  panic!("this is impossible!")
}

No runtime deps