Skip to content

rustdoc won't show impls with enough trait indirection #55409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Manishearth opened this issue Oct 27, 2018 · 3 comments
Closed

rustdoc won't show impls with enough trait indirection #55409

Manishearth opened this issue Oct 27, 2018 · 3 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@Manishearth
Copy link
Member

pub trait IsA<T> {}

impl<T> IsA<T> for T {}

pub struct Foo;

pub trait Bar {}
impl<T: IsA<Foo>> Bar for T {}

Foo implements Bar, but this won't show up in rustdoc.

the gstreamer bindings exhibit this: https://sdroege.github.io/rustdoc/gstreamer/gstreamer/struct.DeviceMonitor.html , https://sdroege.github.io/rustdoc/gstreamer/gstreamer/trait.DeviceMonitorExt.html

This may be architecturally hard to do, in that case it may be worth looking into a doc(proxy=foo) attribute that lets you ask for an impl to explicitly show up on the page of a certain type. This also is useful in cases like #55408 where your impl is on Wrapper<Foo> but you want it to be discoverable from Foo

@Manishearth
Copy link
Member Author

@Manishearth Manishearth added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Oct 27, 2018
@ollie27
Copy link
Member

ollie27 commented Oct 27, 2018

Since 1.30 rustdoc displays blanket impls on applicable types:

image

@Manishearth
Copy link
Member Author

Huh, looks like rustdoc didn't rebuild locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants