about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-12-16 14:23:14 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-12-17 11:36:04 -0500
commit9221d4d1d347ee50f31d2bf50e13ecfdf14c4611 (patch)
tree28a60093e14c46f8918373c16ebca8ddd260f315 /src/librustdoc/html/render
parent79ab333cf0e8b49676cabc7d8bdaa785a688a67a (diff)
downloadrust-9221d4d1d347ee50f31d2bf50e13ecfdf14c4611.tar.gz
rust-9221d4d1d347ee50f31d2bf50e13ecfdf14c4611.zip
[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`.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index a775c85435c..d8d46adfb63 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -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,