d39864d64e
rustdoc: Optimize and refactor doc link resolution One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it. It's better to read individual commits and their descriptions to understand the changes. The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857. Closes https://github.com/rust-lang/rust/issues/96079