Auto merge of #33064 - jseyfried:improve_resolve_performance, r=eddyb
Auto merge of #33064 - jseyfried:improve_resolve_performance, r=eddyb

resolve: Improve performance

This fixes #33061 by speeding up searchs through all traits in scope, a bottleneck in `resolve`.

According to my measurements, this PR improves resolution performance by a factor of 3.4x on `librustc`, which almost completely reverses the 3.75x performance regression reported in #33061.

r? @eddyb

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