-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
"Ghost" methods in rustdoc for cross-crate trait impls #18717
Comments
This comment has been minimized.
This comment has been minimized.
#34752 removes the erroneous search results but doesn't fix the bigger issue. |
Triage: not aware of any changes here |
These days, rustdoc inserts cross-crate trait impls using JS, so I think this issue should be fixed now? Should we close it? |
I think that is a different issue. I believe it may be intentional that blanket impls do not have their docs repeated, but I'm not sure. @jsha do you know anything about this? |
Consider the following MWE:
Compiling, and navigating to
doc/lib/index.html?search=root
shows a clickablecore::option::Option::root
result. Clicking on it takes you todoc/core/option/enum.Option.html#method.root
-- the page doesn't exist, however if you've copied in the docs like Servo does, you'll get the following search page and result — the actual trait is here.Since crates are compiled by rustdoc individually, a cross-crate trait implementation can't show up on the type it is implemented on. However, it still is part of the search results, which is confusing. Removing it from search results isn't an option either — there still is the problem that a doc comment for methods in this impl will not be shown anywhere.
Perhaps cross crate trait implementations should go in the crate of origin of the impl, not the type1? . This will make search results work.
We'd need a new type of doc page for this though -- one that displays a single trait implementation; or alternatively all the trait impls for a type defined outside of a crate. Some sort of "addendum" page.
1. Crate of origin of trait doesn't work either since we can have trait
A<T>
from cratea
, typeB
from crateb
, and typeC
from cratec
, with animpl A<C> for B
in cratec
, which we encounter while compiling cratec
and can no longer touch the docs for cratea
, which is the crate of origin of the trait.The text was updated successfully, but these errors were encountered: