Auto merge of #49800 - ishitatsuyuki:intern-goal, r=nikomatsakis
traits: Implement interning for Goal and Clause
r? @nikomatsakis
Close #49054
Contains some refactoring for the interning mechanism, mainly aimed at reducing pain when changing types of interning map.
This should be mostly good, although I'm not sure with the naming of `Goal::from_poly_domain_goal`.