Closed
Description
I tried this code:
pub struct Foo;
pub trait Trait {
const BAR: usize;
}
impl Trait for Foo {
const BAR: usize = 42;
}
I expected to see this happen:
I would expect BAR
not to appear as its own item in the rustdoc sidebar for the Foo
struct.
This would be consistent with the behavior of methods and associated types from trait impls,
which also don't appear as their own item in the sidebar.
Instead, this happened:
The constant BAR
is listed under "Associated Constants" in the left-hand sidebar of the rustdoc page for Foo
.
This is inconsistent with how methods from trait impls appear in documentation.
Meta
rustc --version --verbose
:
rustc 1.61.0-nightly (1d9c262ee 2022-03-26)
binary: rustc
commit-hash: 1d9c262eea411ec5230f8a4c9ba50b3647064da4
commit-date: 2022-03-26
host: x86_64-unknown-linux-gnu
release: 1.61.0-nightly
LLVM version: 14.0.0