about summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
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/clean/inline.rs
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/clean/inline.rs')
-rw-r--r--src/librustdoc/clean/inline.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs
index b7d6b3dda72..d3c4ef4dc90 100644
--- a/src/librustdoc/clean/inline.rs
+++ b/src/librustdoc/clean/inline.rs
@@ -837,8 +837,7 @@ pub(crate) fn record_extern_trait(cx: &mut DocContext<'_>, did: DefId) {
     }
 
     {
-        if cx.external_traits.borrow().contains_key(&did) || cx.active_extern_traits.contains(&did)
-        {
+        if cx.external_traits.contains_key(&did) || cx.active_extern_traits.contains(&did) {
             return;
         }
     }
@@ -850,6 +849,6 @@ pub(crate) fn record_extern_trait(cx: &mut DocContext<'_>, did: DefId) {
     debug!("record_extern_trait: {did:?}");
     let trait_ = build_external_trait(cx, did);
 
-    cx.external_traits.borrow_mut().insert(did, trait_);
+    cx.external_traits.insert(did, trait_);
     cx.active_extern_traits.remove(&did);
 }