Fixes #13507

Fixes hashing of DefId for ty_enum.

Adds tests for cross-crate TypeId equivalence for various types.