Rollup merge of #84460 - jyn514:doctree-is-crate, r=camelid

rustdoc: Remove unnecessary `is_crate` field from doctree::Module and clean::Module

It can be calculated on-demand even without a TyCtxt.

This also changed `json::conversions::from_item_kind` to take a whole item, which avoids
having to add more and more parameters.

Helps with https://github.com/rust-lang/rust/issues/76382.

r? ```@camelid```
This commit is contained in:
Yuki Okushi 2021-04-25 01:53:14 +09:00 committed by GitHub
commit b566d0ae12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 42 deletions

View file

@ -28,8 +28,8 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer)
// Write the breadcrumb trail header for the top
buf.write_str("<h1 class=\"fqn\"><span class=\"in-band\">");
let name = match *item.kind {
clean::ModuleItem(ref m) => {
if m.is_crate {
clean::ModuleItem(_) => {
if item.is_crate() {
"Crate "
} else {
"Module "