Serde's Deserialize and Serialize traits don't show up in the "Trait Implementations" section for types that use custom derive through Macros 1.1 or through Syntex. Alex Crichton also notes that rustdoc does not display Copy in the "Trait Implementations" section with the following code:
#[derive(Clone)]
pub struct Point {
x: i32,
y: i32,
}
const _FOO: () = {
impl Copy for Point {}
()
};
I've only tested this on nightly Rust.
@alexcrichton Ugh, the way rustdoc scans a crate is dubious _at best_. I've been having to patch up rustdoc for various typesystem/metadata changes, and it's really sad how items from extern crates are second-class, but at the same time you have bugs like these because the local crate visit is simplistic.
What's needed is a rustdoc rewrite that does as little as possible, working _mostly_ with non-syntactical information and recovering the minimum required - relying too much on syntax can leak confusing context.
And it _really_ shouldn't have _two_ ASTs of its own. I know @cmr was frustrated with libsyntax but rustdoc is barely maintainable right now.
@eddyb I think rustdoc's slogan is "dubious at best"
This bug is particularly confusing for crates that use Serde. Right now auto-derived implementations of Serialize/Deserialize don't show up in rustdoc.
Whew! This is super confusing!
I've opened https://github.com/rust-lang/rust/pull/53162 to fix this.
Most helpful comment
@eddyb I think rustdoc's slogan is "dubious at best"