Mono macro
This crate provides the #[mono] macro to force a generic function to be monomorphizied with given types.
Pair with share-generics mode in rustc, this can result less code, for details see https://github.com/rust-lang/rust/pull/48779.
[]
= "0.1"
Usage
Since we are monomorphizing ourselves, you are required to spell out the static dispatch manually:
In a bare function case,
it will be expanded to:
pub const _: *const = as *const _ as _;
For more complicated case, use mono_macro! instead:
mono_macro!;
this will expand to:
pub const _: *const = as *const _ as _;