]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #73767 - P1n3appl3:rustdoc-formats, r=tmandry
authorbors <bors@rust-lang.org>
Wed, 29 Jul 2020 22:24:46 +0000 (22:24 +0000)
committerbors <bors@rust-lang.org>
Wed, 29 Jul 2020 22:24:46 +0000 (22:24 +0000)
Refactor librustdoc html backend

This PR moves several types out of the librustdoc::html module so that they can be used by a future json backend. These changes are a re-implementation of [some work done 6 months ago](https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:multiple-output-formats) by @GuillaumeGomez. I'm currently working on said json backend and will put up an RFC soon with the proposed implementation.

There are a couple of changes that are more substantial than relocating structs to a different module:
1. The `Cache` is no longer part of the `html::render::Context` type and therefor it needs to be explicitly passed to any functions that access it.
2. The driving function `html::render::run` has been rewritten to use the `FormatRenderer` trait which should allow different backends to re-use the driving code.

r? @GuillaumeGomez

cc @tmandry @betamos


Trivial merge