#equality #compile #compile-time #checking #eq

compile_type_eq

Compile-time type equality checking

2 releases

0.1.1 Dec 25, 2020
0.1.0 Dec 25, 2020

#10 in #eq

MIT license

6KB

compile-type-eq

This crate help you check type equality at compile time.

Example of usage:

use compile_type_eq::*;

assert_types_eq::<i32, i32>();
assert_types_not_eq::<i32, u32, _>();

This will fail:

use compile_type_eq::*;

assert_types_eq::<i32, u32>();
assert_types_not_eq::<i32, i32, _>();

For more complicated examples see examples folder


lib.rs:

This crate help you check type equality at compile time.

Usage:

use compile_type_eq::*;

assert_types_eq::<i32, i32>();
assert_types_not_eq::<i32, u32, _>();
use compile_type_eq::*;

assert_types_eq::<i32, u32>();
assert_types_not_eq::<i32, i32, _>();

For more complicated examples see examples folder

No runtime deps