Skip to content

rustdoc: Remove FormatRenderer::cache #142755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/librustdoc/formats/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ pub(crate) trait FormatRenderer<'tcx>: Sized {

/// 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>>(
Expand Down
4 changes: 0 additions & 4 deletions src/librustdoc/html/render/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,8 +875,4 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {

Ok(())
}

fn cache(&self) -> &Cache {
&self.shared.cache
}
}
3 changes: 1 addition & 2 deletions src/librustdoc/json/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use rustdoc_json_types::*;
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;
Expand All @@ -41,7 +40,7 @@ impl JsonRenderer<'_> {
})
.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;
Expand Down
4 changes: 0 additions & 4 deletions src/librustdoc/json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,4 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
self.serialize_and_write(output_crate, BufWriter::new(stdout().lock()), "<stdout>")
}
}

fn cache(&self) -> &Cache {
&self.cache
}
}
Loading