diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-12-11 23:01:26 -0500 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-12-12 00:01:01 -0500 |
| commit | 4fa95b3a078f261267293f3308dd62889167c0bd (patch) | |
| tree | b2433cfc476e8a9c9ce83813171b8eea668ec5ce /src/librustdoc/lib.rs | |
| parent | af6aa9f4313983deddd64543c5ad6c15e2160163 (diff) | |
| download | rust-4fa95b3a078f261267293f3308dd62889167c0bd.tar.gz rust-4fa95b3a078f261267293f3308dd62889167c0bd.zip | |
Calculate span info on-demand instead of ahead of time
This should *vastly* reduce memory usage.
Diffstat (limited to 'src/librustdoc/lib.rs')
| -rw-r--r-- | src/librustdoc/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index fbab5735ee7..e094ead12bd 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -555,13 +555,14 @@ fn main_options(options: config::Options) -> MainResult { info!("going to format"); let (error_format, edition, debugging_options) = diag_opts; let diag = core::new_handler(error_format, None, &debugging_options); + let sess_time = sess.clone(); match output_format { - None | Some(config::OutputFormat::Html) => sess.time("render_html", || { + None | Some(config::OutputFormat::Html) => sess_time.time("render_html", || { run_renderer::<html::render::Context>( krate, renderopts, renderinfo, &diag, edition, sess, ) }), - Some(config::OutputFormat::Json) => sess.time("render_json", || { + Some(config::OutputFormat::Json) => sess_time.time("render_json", || { run_renderer::<json::JsonRenderer>(krate, renderopts, renderinfo, &diag, edition, sess) }), } |
