about summary refs log tree commit diff
path: root/src/librustdoc/formats
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2024-09-25 22:15:23 +0200
committerLukas Markeffsky <@>2024-09-25 23:45:57 +0200
commitb1745c3919b57d841c15fe0bfb0dd926ab59bafa (patch)
treeabe345fac4dea0fb54ce49b4207884700681ea98 /src/librustdoc/formats
parent0399709cdc3c5cc22327e9f657dc7956546a0457 (diff)
downloadrust-b1745c3919b57d841c15fe0bfb0dd926ab59bafa.tar.gz
rust-b1745c3919b57d841c15fe0bfb0dd926ab59bafa.zip
de-rc external traits
Don't keep the `external_traits` as shared mutable data between the
`DocContext` and `clean::Crate`. Instead, move the data over when necessary.
This allows us to get rid of a borrowck hack in the `DocVisitor`.
Diffstat (limited to 'src/librustdoc/formats')
-rw-r--r--src/librustdoc/formats/cache.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs
index 8597d2e2b63..db1a0bd0af9 100644
--- a/src/librustdoc/formats/cache.rs
+++ b/src/librustdoc/formats/cache.rs
@@ -153,7 +153,8 @@ impl Cache {
 
         // Crawl the crate to build various caches used for the output
         debug!(?cx.cache.crate_version);
-        cx.cache.traits = krate.external_traits.take();
+        assert!(cx.external_traits.is_empty());
+        cx.cache.traits = mem::take(&mut krate.external_traits);
 
         // Cache where all our extern crates are located
         // FIXME: this part is specific to HTML so it'd be nice to remove it from the common code