Closed
Description
It's possible to define trait implementations inside of functions in Rust. This is useful not too often, but particularly nice if you have a macro that both defines trait implementation and calls some initialization for a given type.
Anyway, the following code is valid in Rust itself:
pub struct S;
pub fn a() {
impl From<u8> for S {
fn from(_: u8) -> S {
S
}
}
}
But Rustdoc doesn't generate documentation for a given trait, despite it being visible to Rust itself, and being immediately available and unique across entire crate.
I can move impl
out of the function and then it gets seen by Rustdoc, but this is rather inconvenient when impl
is generated as part of a bigger macro.