-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
stdio
module description "stutters"
#12386
Comments
I looked into this a bit. It turns out it's actually a problem for all of the module-level documentation pages. The rustdoc comment from the mod.rs file appears to be getting pulled into the documentation page multiple times. For other examples, see: I'm happy to take this issue, but I'm new to the documentation build system. Could someone point me to the template that I'd need to modify? |
It appears that this is only a problem for modules found in std::io, where the mod.rs file has a summary comment above each For example, std::io::fs has the following opening line:
mod.rs contains:
and fs.rs contains:
The mod.rs lines are inserted twice, followed by the file's summary line. The double-insertion appears to be a rustdoc bug, but the standard in the rest of libstd seems to be not having any comments above Could someone more knowledgeable than I comment on the double-insert? |
I think rustdoc is correct to include both chunks of docs and that removing the docs from mod.rs is the right approach. |
@sfackler it's not correct to include the |
Oh, interesting. |
@zslayton if you are interested in debugging this, creating a minimal example, and using The Other than that... I don't really know. (It'd be worth seeing if it is specific to modules, or if, e.g., /// foo
fn bar() {
//! baz
} confuses it too.) |
@huonw Thanks, I'll do that. In the meantime, I'm going to make a PR to convert the comments in mod.rs to plain If I can make a minimal, reproducible example of the double-insert problem, I'll open a new issue so we can track it separately. |
…od.rs file. Added summary doc-comments to test.rs, util.rs and stdio.rs.
…, r=Veykril Add test for rust-lang#12372 (generate enum variant in different file) The test currently fails but I'm not sure why. The "Right" output seems to contain only the contents of `foo.rs`, without the magic comments: <img width="967" alt="image" src="https://user-images.githubusercontent.com/7998310/170310707-e69b21eb-d4f8-46c1-8a0a-9b4071289e26.png"> cc `@Veykril`
[`use_self`]: Make it aware of lifetimes Have the lint trigger even if `Self` has generic lifetime parameters. ```rs impl<'a> Foo<'a> { type Item = Foo<'a>; // Can be replaced with Self fn new() -> Self { Foo { // No lifetime, but they are inferred to be that of Self // Can be replaced as well ... } } // Don't replace `Foo<'b>`, the lifetime is different! fn eq<'b>(self, other: Foo<'b>) -> bool { .. } ``` Fixes rust-lang#12381 *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`use_self`]: Have the lint trigger even if `Self` has generic lifetime parameters
This page: http://static.rust-lang.org/doc/master/std/io/stdio/index.html
The starting paragraph:
The "Non-blocking access to stdin, stdout, stderr" section repeats itself and there are some periods missing.
The text was updated successfully, but these errors were encountered: