rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.93k stars 12.68k forks source link

Generated documentation includes bullet points that are not part of the docs #93309

Closed Skeletonxf closed 2 years ago

Skeletonxf commented 2 years ago

Hi, I've just published a new version of my crate and the generated documentation is including a lot of bullet points that have never been included before.

https://docs.rs/easy-ml/1.8.1/easy_ml/index.html https://docs.rs/easy-ml/1.8.0/easy_ml/index.html

When I generate the docs locally on the 1.8.1 source code using the latest stable version of rust I see the same formatting for the 1.8.0 that docs.rs generated, so I think this is a bug that's slipped into the nightly version of docs.rs?

Stable local docs: Screenshot 2022-01-25 at 22-08-57 easy_ml - Rust docs.rs: Screenshot 2022-01-25 at 22-08-43 easy_ml - Rust

My guess is that it's because I'm using block comments, the unwanted bullet points seem to match up with empty lines in the documentation comment which consist of just a *.

/*!
 * If this is your first time using Easy ML you should check out some of the examples
 * to get an overview of how to use matrices then study the
 * [Matrix](matrices::Matrix) type for what you need.
 *
 * # Examples
 * - [Linear Regression](linear_regression)
 * - [k-means Clustering](k_means)
 * - [Logistic Regression](logistic_regression)
 * - [Naïve Bayes](naive_bayes)
 * - [Neural Network XOR Problem](neural_networks)
 *
 * # API Modules
 * - [Matrices](matrices)
 * - [Linear Algebra](linear_algebra)
 * - [Distributions](distributions)
 * - [(Automatic) Differentiation](differentiation)
 * - [Numerical type definitions](numeric)
 *
 * # Miscellaneous
 * - [Web Assembly](web_assembly)
 * - [SARSA and Q-learning using a Matrix for a grid world](sarsa)
 * - [Using custom numeric types](using_custom_types)
 */

Thanks

Nemo157 commented 2 years ago

Seems potentially related to https://github.com/rust-lang/rust/issues/92872, but the latest builds were from a nightly that should have that fixed in; cc @GuillaumeGomez you probably have some idea on where the issue is.

GuillaumeGomez commented 2 years ago

This is highly surprising indeed.

@Skeletonxf Can you run cargo doc with the last nightly locally and tell us if it reproduces the bug please? If so, I'll try to check what's wrong in rustdoc.

Skeletonxf commented 2 years ago

@GuillaumeGomez I have ran cargo doc on the latest nightly locally (nightly-x86_64-unknown-linux-gnu rustc 1.60.0-nightly (777bb86bc 2022-01-20)) and it has reproduced the bug - I see the same generated docs as from the docs.rs build.

GuillaumeGomez commented 2 years ago

It'll be fixed by https://github.com/rust-lang/rust/pull/93715.

Skeletonxf commented 2 years ago

Thanks, is there any way I can get docs.rs to rebuild the docs for the affected versions or will I have to submit a new version of my library to get a fixed docs.rs build?

GuillaumeGomez commented 2 years ago

Sure. But that for that, please open an issue on docs.rs repository directly.