Rollup merge of #42728 - jseyfried:fix_resolve_perf, r=nrc
Rollup merge of #42728 - jseyfried:fix_resolve_perf, r=nrc

resolve: fix perf bug

Fixes #42544.
r? @nrc

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