-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.Category: This is a bug.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
Implementations of ToBytes
for various portable SIMD vectors are rendered incorrectly:
type Bytes = Simd<u8, core::::core_simd::to_bytes::{impl#55}::Bytes::{constant#0}>
(looks the same on stable: https://doc.rust-lang.org/stable/std/simd/prelude/struct.Simd.html#impl-ToBytes-for-Simd%3Cf32,+8%3E)
It’s probably reproducible with some other traits and types, but I was not able to do it. Notably, this:
pub trait Foo {
type Bar;
}
struct Arr<T, const N: usize>(T);
macro_rules! gen_impl {
($a:literal, [$($b:literal),*]) => {
$(impl Foo for [u8; $b] {
type Bar = Arr<u8, { $a * $b }>;
})*
};
}
gen_impl!(2, [3, 4]);
renders as
type Bar = Arr<u8, { $a * $b }>
for me (stable + rustc 1.82.0-nightly (64ebd39da 2024-08-03)
), which is maybe not perfect, but isn’t that broken.
Metadata
Metadata
Assignees
Labels
A-const-genericsArea: const generics (parameters and arguments)Area: const generics (parameters and arguments)A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.Category: This is a bug.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.