Auto merge of #80208 - bugadani:generics-of-alloc, r=matthewjasper
Auto merge of #80208 - bugadani:generics-of-alloc, r=matthewjasper

Reserve necessary space for params in generics_of

Always reserve space for the exact number of generic parameters we need in generics_of. As far as I can see, the default is 0/4 elements based on has_self, and the vector grows on after that.

aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust