-
Notifications
You must be signed in to change notification settings - Fork 13.3k
same-crate reexports lose documentation added to cross-crate reexports #89020
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
Comments
Rustdoc is probably deciding to inline it for some reason - unless it's a change in behavior from an earlier release I don't think it's a bug. Missing the docs on |
Note that this causes the doc tests to be re-run for each instance:
|
That does seem like a bug - can you open a separate issue for it? Specifically that |
I don't think it's separate; it's a knock-on effect of the fact that I have to provide the documentation twice and the documentation contains doc tests. Effectively: /// ```rust
/// assert_eq!(0, 1);
/// ```
pub use inner::alpha as my_alpha;
pub mod prelude {
/// ```rust
/// assert_eq!(0, 2);
/// ```
pub use super::my_alpha;
} |
I think this is a special case of #84619. |
Last time I checked (and that was a long ago), for any re-exported item in a module, we concatenate the docs for the This behavior is now consistent for cross-crate and same-crate reexports. Apparently the only way to fix is to follow the So, if it is fine to sacrifice consistency with an incomplete solution that follows only the paths within the same crate, I'm happy to claim this issue. Otherwise, it would be diffcult since it requires modifying crate metadata. |
Yeah, that seems reasonable. We can do the more proper fix later. cc @petrochenkov who may have suggestions about how to do this with the existing metadata |
I tried this code (ZIP of project):
src/lib.rs
regular-items/src/lib.rs
I then viewed the documentation for
the crate:
the
prelude
module:crate::CONSTANT
:crate::prelude::CONSTANT
:I expected:
crate::CONSTANT
would be present oncrate::prelude::CONSTANT
.crate::prelude::CONSTANT
would redirect tocrate::CONSTANT
.Instead:
crate::prelude::CONSTANT
.crate::prelude::CONSTANT
appears to be a different item thancrate::CONSTANT
.Meta
cargo +nightly --version --verbose
:Potentially related
The text was updated successfully, but these errors were encountered: