-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
This code
#![feature(generic_const_exprs)]
pub const fn assert_zero(x: usize) -> usize {
if x != 0 {
panic!("expected zero");
} else {
0
}
}
pub fn chunked<const C: usize, const N: usize, T>(x: [T; N]) -> [[T; C]; N / C]
where
[(); assert_zero(N % C)]:,
{
unsafe {
core::mem::ManuallyDrop::new(x)
.as_ptr()
.cast::<[[T; C]; N / C]>()
.read()
}
}
Produces this documentation
This is what i want
Meta
rustdoc 1.78.0-nightly (1a648b3 2024-02-11)
fmease
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)C-bugCategory: This is a bug.Category: This is a bug.F-generic_const_exprs`#![feature(generic_const_exprs)]``#![feature(generic_const_exprs)]`T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.