Rustdoc: resolve actual types in item definitions?

Hello, I'm generating some structs using macros and I specify the types of the fields using an associated type of another type, which is very convenient for me because of how my stuff is structured.

For example:

pub struct EncryptionBeginV766 {
    pub server_id: <String as MCP>::Data,
    pub public_key: <Buffer as MCP>::Data,
    pub verify_token: <Buffer as MCP>::Data,
    pub should_authenticate: <bool as MCP>::Data,
}

Here, the trait MCP is private and some of the types that implement it and are used here are private too, but the associated MCP::Data type is always public.

Unfortunately I found that rustdoc generates the docs for this struct like this:

Obviously this is not very helpful to the user at all, since most of this stuff is private and they can't even see what it is, when in reality this resolves to some simple public type.

Could rustdoc resolve types specified like this to the actual canonical type paths instead? I personally don't really see a reason to not do it like this, unless it might be more informative (if the trait and used types were not private...) but for the user I think its way more convenient to just see the actual resolved type.

And if implementing this is possible, would it likely be hard and complicated or just a simple fix?

4 Likes

I think this is yet another issue blocked by rustdoc's inability to resolve type aliases at will.

4 Likes