Convert Box<dyn T> to Box<dyn Any>

This is a compiler-built function which returns a u64 identifying the type. It's a hash, as @KrishnaSannasi said, and you can't get the input from a hash, meaning that this can only be used to compare equality of types, given a TypeId and a type.


P.S. if it wasn't implicit, TypeId is a transparent wrapper around u64

1 Like