about summary refs log tree commit diff
path: root/src/librustdoc/formats/renderer.rs
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/formats/renderer.rs
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/formats/renderer.rs')
-rw-r--r--src/librustdoc/formats/renderer.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/librustdoc/formats/renderer.rs b/src/librustdoc/formats/renderer.rs
index f61919d78a0..7ec29a70bd0 100644
--- a/src/librustdoc/formats/renderer.rs
+++ b/src/librustdoc/formats/renderer.rs
@@ -1,7 +1,6 @@
 use std::sync::Arc;
 
-use rustc_data_structures::sync::Lrc;
-use rustc_session::Session;
+use rustc_middle::ty;
 use rustc_span::edition::Edition;
 
 use crate::clean;
@@ -21,7 +20,7 @@ crate trait FormatRenderer: Clone {
         render_info: RenderInfo,
         edition: Edition,
         cache: &mut Cache,
-        sess: Lrc<Session>,
+        tcx: ty::TyCtxt<'_>,
     ) -> Result<(Self, clean::Crate), Error>;
 
     /// Renders a single non-module item. This means no recursive sub-item rendering is required.
@@ -52,7 +51,7 @@ crate fn run_format<T: FormatRenderer>(
     render_info: RenderInfo,
     diag: &rustc_errors::Handler,
     edition: Edition,
-    sess: Lrc<Session>,
+    tcx: ty::TyCtxt<'_>,
 ) -> Result<(), Error> {
     let (krate, mut cache) = Cache::from_krate(
         render_info.clone(),
@@ -63,7 +62,7 @@ crate fn run_format<T: FormatRenderer>(
     );
 
     let (mut format_renderer, mut krate) =
-        T::init(krate, options, render_info, edition, &mut cache, sess)?;
+        T::init(krate, options, render_info, edition, &mut cache, tcx)?;
 
     let cache = Arc::new(cache);
     // Freeze the cache now that the index has been built. Put an Arc into TLS for future