diff --git a/packages/cw-schema/src/lib.rs b/packages/cw-schema/src/lib.rs index c1279807f..565e001a6 100644 --- a/packages/cw-schema/src/lib.rs +++ b/packages/cw-schema/src/lib.rs @@ -153,13 +153,17 @@ impl Identifier { T: ?Sized, { // Don't do this at home. I'm a professional. + // + // This is a hack based on the assumption that each type has will produce a unique monomorphized function. + // Therefore each function has a distinct function pointer. + // + // The compiler _might_ break this assumption in the future. #[inline] fn type_id_of() -> usize { type_id_of:: as usize } debug_assert_eq!(type_id_of::(), type_id_of::()); - debug_assert_eq!(core::any::type_name::(), core::any::type_name::()); Self(type_id_of::()) }