Skip to content

Commit 61f4918

Browse files
authored
Rollup merge of rust-lang#142755 - aDotInTheVoid:rdj-shattrs, r=GuillaumeGomez
rustdoc: Remove `FormatRenderer::cache` We only called it it one place, which isn't generic and can be replaced with a field access.
2 parents e7a2c40 + aab941f commit 61f4918

File tree

4 files changed

+1
-12
lines changed

4 files changed

+1
-12
lines changed

src/librustdoc/formats/renderer.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ pub(crate) trait FormatRenderer<'tcx>: Sized {
6868

6969
/// Post processing hook for cleanup and dumping output to files.
7070
fn after_krate(self) -> Result<(), Error>;
71-
72-
fn cache(&self) -> &Cache;
7371
}
7472

7573
fn run_format_inner<'tcx, T: FormatRenderer<'tcx>>(

src/librustdoc/html/render/context.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,4 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
875875

876876
Ok(())
877877
}
878-
879-
fn cache(&self) -> &Cache {
880-
&self.shared.cache
881-
}
882878
}

src/librustdoc/json/conversions.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use rustdoc_json_types::*;
1616
use thin_vec::ThinVec;
1717

1818
use crate::clean::{self, ItemId};
19-
use crate::formats::FormatRenderer;
2019
use crate::formats::item_type::ItemType;
2120
use crate::json::JsonRenderer;
2221
use crate::passes::collect_intra_doc_links::UrlFragment;
@@ -41,7 +40,7 @@ impl JsonRenderer<'_> {
4140
})
4241
.collect();
4342
let docs = item.opt_doc_value();
44-
let attrs = item.attributes_and_repr(self.tcx, self.cache(), true);
43+
let attrs = item.attributes_and_repr(self.tcx, &self.cache, true);
4544
let span = item.span(self.tcx);
4645
let visibility = item.visibility(self.tcx);
4746
let clean::ItemInner { name, item_id, .. } = *item.inner;

src/librustdoc/json/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,8 +376,4 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
376376
self.serialize_and_write(output_crate, BufWriter::new(stdout().lock()), "<stdout>")
377377
}
378378
}
379-
380-
fn cache(&self) -> &Cache {
381-
&self.cache
382-
}
383379
}

0 commit comments

Comments
 (0)