diff --git a/src/librustdoc/json/mod.rs b/src/librustdoc/json/mod.rs index d6da6e0993894..9392dd4d08825 100644 --- a/src/librustdoc/json/mod.rs +++ b/src/librustdoc/json/mod.rs @@ -279,7 +279,10 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { p.push(output.index.get(&output.root).unwrap().name.clone().unwrap()); p.set_extension("json"); let mut file = BufWriter::new(try_err!(File::create(&p), p)); - serde_json::ser::to_writer(&mut file, &output).unwrap(); + self.tcx + .sess + .time("rustdoc_json_serialization", || serde_json::ser::to_writer(&mut file, &output)) + .unwrap(); try_err!(file.flush(), p); Ok(())