We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a4bebe commit 4fbc80bCopy full SHA for 4fbc80b
packages/cw-schema/src/lib.rs
@@ -153,13 +153,17 @@ impl Identifier {
153
T: ?Sized,
154
{
155
// Don't do this at home. I'm a professional.
156
+ //
157
+ // This is a hack based on the assumption that each type has will produce a unique monomorphized function.
158
+ // Therefore each function has a distinct function pointer.
159
160
+ // The compiler _might_ break this assumption in the future.
161
#[inline]
162
fn type_id_of<T: ?Sized>() -> usize {
163
type_id_of::<T> as usize
164
}
165
166
debug_assert_eq!(type_id_of::<T>(), type_id_of::<T>());
- debug_assert_eq!(core::any::type_name::<T>(), core::any::type_name::<T>());
167
168
Self(type_id_of::<T>())
169
0 commit comments