Only compute the trait map once Part of #85153 r? `@Aaron1011`
For more information about how rustc works, see the rustc dev guide.