-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rustdoc is inlining use ...
imports when --document-private-items
is passed
#90865
Comments
This does appear to have been #88447. I'm not entirely sure how to fix this. Basically, what's happening here is that the |
Some additional thoughts: If we want to stick to the "visible from parent module" thing, the simplest way to do that would be to add a check for whether I guess the problem I'm struggling with after thinking about all of this is that I don't fully understand the justification for all of this logic. Why is it that we want to show some imports but not others? If these were structs, we'd just show all of them, regardless of their visibility. That said, if this really is the behavior we want, it shouldn't be hard to implement. |
I think we should inline neither
Because the structs are only visible from the module where they're defined. The use statements aren't intended to be used from elsewhere in the crate. |
I think I explained this poorly above. We generally don't inline either It's an easy fix if we want it not to be an exception, I was just trying to make sure we had a clear philosophical reason for wanting things to be the way we were trying to have them be. (In other words, I was double-checking that the behavior the PR was supposed to create is really what we want before submitting a PR to do that.) It sounds like it is, so I'll get working on a bugfix. I feel like I'm expressing myself rather unclearly at the moment. If there's anything I need to clear up about this explanation, please feel free to let me know. |
Oh oops, I missed this bit. Yes, I think this should be consistent with the submodules of the crate. |
I agree, that sounds like the right behavior to me. |
Quick update: I've got a substantive patch, but it's taking a while to get the tests to a point where I'm satisfied with them. |
My PR is up! Also, I'm going to assign this as a |
I tried this code:
I expected to see this happen: The documentation is empty.
Instead, this happened:
Meta
rustdoc --version
: rustdoc 1.58.0-nightly (e90c5fb 2021-11-12)cc @camelid @inquisitivecrystal, I suspect this is related to one of your recent changes to visibility.
The text was updated successfully, but these errors were encountered: