rustdoc: Remove FormatRenderer::cache

We only called it it one place, which isn't generic and can be replaced
with a field access.
This commit is contained in:
Alona Enraght-Moony
2025-06-19 23:21:38 +00:00
parent 8de4c7234d
commit aab941ff30
4 changed files with 1 additions and 12 deletions
-2
View File
@@ -68,8 +68,6 @@ fn mod_item_out(&mut self) -> Result<(), Error> {
/// Post processing hook for cleanup and dumping output to files.
fn after_krate(self) -> Result<(), Error>;
fn cache(&self) -> &Cache;
}
fn run_format_inner<'tcx, T: FormatRenderer<'tcx>>(
-4
View File
@@ -875,8 +875,4 @@ fn item(&mut self, item: &clean::Item) -> Result<(), Error> {
Ok(())
}
fn cache(&self) -> &Cache {
&self.shared.cache
}
}
+1 -2
View File
@@ -16,7 +16,6 @@
use thin_vec::ThinVec;
use crate::clean::{self, ItemId};
use crate::formats::FormatRenderer;
use crate::formats::item_type::ItemType;
use crate::json::JsonRenderer;
use crate::passes::collect_intra_doc_links::UrlFragment;
@@ -41,7 +40,7 @@ pub(super) fn convert_item(&self, item: &clean::Item) -> Option<Item> {
})
.collect();
let docs = item.opt_doc_value();
let attrs = item.attributes_and_repr(self.tcx, self.cache(), true);
let attrs = item.attributes_and_repr(self.tcx, &self.cache, true);
let span = item.span(self.tcx);
let visibility = item.visibility(self.tcx);
let clean::ItemInner { name, item_id, .. } = *item.inner;
-4
View File
@@ -377,8 +377,4 @@ fn after_krate(mut self) -> Result<(), Error> {
self.serialize_and_write(output_crate, BufWriter::new(stdout().lock()), "<stdout>")
}
}
fn cache(&self) -> &Cache {
&self.cache
}
}