-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Document why std docs have many apparent duplicates #16645
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
I think what would make sense here is to move the documentation for all of the |
Sounds fine to me. If that is the consensus or desired approach, let me know and I'll try to update the Title/description accordingly if it matters as I won't be able to help with much else for this. I don't know how much discussion is needed before a decision is made anyhow. |
A more general solution might be to link re-exports in the docs to their original source, so that you can look in the The only issue might be when something is re-exported from somewhere private, which could just be special-cased. Or maybe the documentation could be placed at the re-export that the library writer wants it at. I'd prefer that over separating the docs, and it would work better for third party libraries as well. |
Whether or not a definition is a re-export from a different crate is a user visible property, because all possible paths to the same item are interchangeable: extern crate core;
let _: std::option::Option<uint> = core::option::Some(0u); Because of that it is my opinion that the docs should always provide a full chain of links for each reexport step, skipping/hiding all private ones in the chain: // my_crate
pub use self::pub_mod::Foo;
pub mod pub_mod {
pub use self::priv_mod::Foo;
mod priv_mod {
pub struct Foo;
}
} This should show you both For ergonomic reasons every reexport should probably show the docs of their item directly inline in the documentation as if the item where defined there, but also put a clearly visible info at the top that this is a reexport, including links to the the next link in the reexport chain:
Related to this, the rustdoc search should group things that are exports of each other together, or hide them by default. Instead of this:
It should look kinda like this:
|
I don't think we should explain why the standard library is poorly designed. The problem should be fixed by not making confusing mazes of re-exports. Crates should just be used directly and the prelude could include those crates and |
Fixes rust-lang#16645 Fixing this in any deeper way will require an RFC, so let's just document the current behavior.
Fixes rust-lang#16645 Fixing this in any deeper way will require an RFC, so let's just document the current behavior.
Fixes rust-lang#16645 Fixing this in any deeper way will require an RFC, so let's just document the current behavior.
fix: Fix deadlock in `recreate_crate_graph` <-> `file_line_index` Fixes rust-lang/rust-analyzer#16614
Reddit thread:
I'm not certain which of these the user was referring to but both could be possibly weird at first appearance:
String
instd::string
andcollections::string
and othersString
instring
andVec
invec
It was suggested that this be included in a How to read this documentation somewhere. If it was written, I would imagine it should be automatically included in the rust std documentation system so that it is included in all rust derived projects like gfx-rs and piston documentation.
cc: @steveklabnik
The text was updated successfully, but these errors were encountered: