-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Funky rustdoc behavior when pub use path_to::Trait as _;
for public-in-private item
#92379
Comments
pub use some::Trait as _;
pub use path_to::Trait as _;
pub use path_to::Trait as _;
pub use path_to::Trait as _;
for public-in-private item
@rustbot claim |
Granted, this kind of feels like an edge case to me, I don't (personally) find any practical advantage to having a trait that you can only use the methods of but not mention or quantify over, e.g. for a |
I would feel like displaying it like a regular re-export feels like a good solution, and also displaying a warning that goes away by adding ^^^^ Just my personal opinion/interpretation right now 😉, and I haven't actually thought for more than a handful of minutes about how best to resolve this issue yet. Following the approach explained above, the same thing should probably also apply for a case without public-in-private items, but with explicit pub trait Foo {}
#[doc(inline)]
pub use Foo as _; should also effectively ignore the |
I mean, I actually came up with the idea for code like this because it might have some practical use-case. It's like the ultimate sealed trait; you cannot implement it, you can't even use it in trait bounds. A bit awkward to bring into scope (since only a Of course the problems are that it's impossible to get properly documented, and it's probably confusing as hell for most users anyways, etc, so ultimately it's a bad idea. |
@GuillaumeGomez I used
on Windows. I tested with
now and it gives a different-looking broken page As mentioned above, this result is not reproducible on every build, it seems to happen randomly. Try doing |
The rustdoc builds are reproducible normally, if not we have a much bigger issue on our hands... At this point, I wonder if the problem isn't your web browser? |
They aren't reproducible in this case, but I suppose the reason is just that it's because there's two different items that get documented under the same URL? If rustdoc's reproducibility relies on the fact that no two pages go to the same location, then that would make sense to me. You should more easily be able to create non-reproducible results with the original example where I noted
If you build that example yourself, multiple times (with |
Oh hold on, that might be a windows-specific issue: I wonder if the file is being written from two places at the same time (we have a thread handling file writing on Windows). |
Something like
creates documentation listing two traits called "
_
"both of which link to the same URL
.../target/doc/crate_name/trait._.html
and which contains documentation for one of the two traits, chosen seemingly at random.When I add a few implementations, sometimes (not very reproducably) I've even gotten a weirdly broken page. E.g. I sometimes get
to generate a page that looks like this
@rustbot label T-rustdoc, A-rustdoc-ui
The text was updated successfully, but these errors were encountered: