]> git.lizzy.rs Git - rust.git/commit
rustdoc: Cache traits implemented by a type
authorJoshua Nelson <jyn514@gmail.com>
Thu, 30 Jul 2020 01:11:14 +0000 (21:11 -0400)
committerJoshua Nelson <jyn514@gmail.com>
Sat, 22 Aug 2020 04:25:29 +0000 (00:25 -0400)
commit9db0b86f4e24c939cd33cff050ce556faf30e47d
tree71f2a6dff5f79d4352ab32c05a94ca609ed18865
parent42232ba70add056cf422960ac96986264870b313
rustdoc: Cache traits implemented by a type

This avoids taking the slow path several thousand times in a row.

- Fallback to all traits if the traits in scope are unknown
- Use a rustdoc thread_local cache instead of a query

The set of traits implemented by a type is not stable across crates:
there could be new traits added in a new crate.

- Use DocContext instead of a thread-local
src/librustdoc/core.rs
src/librustdoc/passes/collect_intra_doc_links.rs