rustdoc: Pretty-print assoc const defaults on-demand
This should improve performance, clean up the code, and help pave the way for #83035.
This commit is contained in:
parent
b8dc6aa673
commit
d38ae767f8
4 changed files with 28 additions and 9 deletions
|
@ -219,7 +219,9 @@ fn from_clean_item(item: clean::Item, tcx: TyCtxt<'_>) -> ItemEnum {
|
|||
MacroItem(m) => ItemEnum::Macro(m.source),
|
||||
ProcMacroItem(m) => ItemEnum::ProcMacro(m.into_tcx(tcx)),
|
||||
PrimitiveItem(p) => ItemEnum::PrimitiveType(p.as_sym().to_string()),
|
||||
AssocConstItem(t, s) => ItemEnum::AssocConst { type_: t.into_tcx(tcx), default: s },
|
||||
AssocConstItem(ty, default) => {
|
||||
ItemEnum::AssocConst { type_: ty.into_tcx(tcx), default: default.map(|c| c.expr(tcx)) }
|
||||
}
|
||||
AssocTypeItem(g, t) => ItemEnum::AssocType {
|
||||
bounds: g.into_iter().map(|x| x.into_tcx(tcx)).collect(),
|
||||
default: t.map(|x| x.into_tcx(tcx)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue