1
Fork 0

[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

@ -57,6 +57,7 @@ use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
use rustc_hir::Mutability;
use rustc_middle::middle::stability;
use rustc_middle::ty;
use rustc_session::Session;
use rustc_span::edition::Edition;
use rustc_span::hygiene::MacroKind;
@ -388,7 +389,7 @@ impl FormatRenderer for Context {
_render_info: RenderInfo,
edition: Edition,
cache: &mut Cache,
sess: Lrc<Session>,
tcx: ty::TyCtxt<'_>,
) -> Result<(Context, clean::Crate), Error> {
// need to save a copy of the options for rendering the index page
let md_opts = options.clone();
@ -462,7 +463,7 @@ impl FormatRenderer for Context {
}
let (sender, receiver) = channel();
let mut scx = SharedContext {
sess,
tcx,
collapsed: krate.collapsed,
src_root,
include_sources,