[tmp] Pass TyCtxt through to the render backend

First actually useful step in https://github.com/rust-lang/rust/issues/76382

This doesn't yet compile because there's no way to get a `Lrc<Session>`
from a TyCtxt, only a `&Session`.
This commit is contained in:
Joshua Nelson 2020-12-16 14:23:14 -05:00
parent 79ab333cf0
commit 9221d4d1d3
4 changed files with 15 additions and 17 deletions

View file

@ -14,6 +14,7 @@ use std::rc::Rc;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use rustc_middle::ty;
use rustc_session::Session;
use rustc_span::edition::Edition;
@ -127,12 +128,12 @@ impl FormatRenderer for JsonRenderer {
_render_info: RenderInfo,
_edition: Edition,
_cache: &mut Cache,
sess: Lrc<Session>,
tcx: ty::TyCtxt<'_>,
) -> Result<(Self, clean::Crate), Error> {
debug!("Initializing json renderer");
Ok((
JsonRenderer {
sess,
sess: tcx.sess,
index: Rc::new(RefCell::new(FxHashMap::default())),
out_path: options.output,
},