Skip to content

Commit 5e2793b

Browse files
committed
Small cleanups
- Add back call to `from_hir_id_and_parts()` - Remove outdated comment
1 parent 9eaca9d commit 5e2793b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/librustdoc/clean/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ impl Clean<Vec<Item>> for hir::Item<'_> {
304304
generics: generics.clean(cx),
305305
bounds: bounds.clean(cx),
306306
is_spotlight,
307-
// FIXME: this is redundant with `auto`
308307
is_auto: is_auto.clean(cx),
309308
}))
310309
}
@@ -380,16 +379,17 @@ impl Clean<Item> for hir::Crate<'_> {
380379
}
381380
};
382381

383-
let id = hir::CRATE_HIR_ID;
382+
let what_rustc_thinks = Item::from_hir_id_and_parts(
383+
hir::CRATE_HIR_ID,
384+
Some(cx.tcx.crate_name),
385+
ModuleItem(Module { is_crate: true, items: items.collect() }),
386+
cx,
387+
);
384388
Item {
385-
name: Some(cx.tcx.crate_name.clean(cx)),
389+
name: Some(what_rustc_thinks.name.unwrap_or_default()),
386390
attrs,
387391
source: span.clean(cx),
388-
visibility: Visibility::Public,
389-
stability: cx.stability(id),
390-
deprecation: cx.deprecation(id).clean(cx),
391-
def_id: cx.tcx.hir().local_def_id(id).to_def_id(),
392-
kind: ModuleItem(Module { is_crate: true, items: items.collect() }),
392+
..what_rustc_thinks
393393
}
394394
}
395395
}

0 commit comments

Comments
 (0)