diff options
| author | Lukas Markeffsky <@> | 2024-09-25 22:15:23 +0200 |
|---|---|---|
| committer | Lukas Markeffsky <@> | 2024-09-25 23:45:57 +0200 |
| commit | b1745c3919b57d841c15fe0bfb0dd926ab59bafa (patch) | |
| tree | abe345fac4dea0fb54ce49b4207884700681ea98 /src/librustdoc/clean/inline.rs | |
| parent | 0399709cdc3c5cc22327e9f657dc7956546a0457 (diff) | |
| download | rust-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.rs | 5 |
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); } |
