Rollup merge of #85957 - BoxyUwU:rustdoc-const-generic-defaults, r=oli-obk
Display defaults on const params- rustdoc previously rustdoc would render this struct declaration: `pub struct Foo<const N: usize = 10>;` as: `pub struct Foo<const N: usize>;` this PR changes it to render correctly
This commit is contained in:
commit
606feba5bb
8 changed files with 39 additions and 10 deletions
|
|
@ -317,7 +317,9 @@ impl FromWithTcx<clean::GenericParamDefKind> for GenericParamDefKind {
|
|||
bounds: bounds.into_iter().map(|x| x.into_tcx(tcx)).collect(),
|
||||
default: default.map(|x| x.into_tcx(tcx)),
|
||||
},
|
||||
Const { did: _, ty } => GenericParamDefKind::Const(ty.into_tcx(tcx)),
|
||||
Const { did: _, ty, default } => {
|
||||
GenericParamDefKind::Const { ty: ty.into_tcx(tcx), default }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> {
|
|||
)
|
||||
})
|
||||
.collect(),
|
||||
format_version: 5,
|
||||
format_version: 6,
|
||||
};
|
||||
let mut p = self.out_path.clone();
|
||||
p.push(output.index.get(&output.root).unwrap().name.clone().unwrap());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue