Rustdoc impl blocks refer to private names
The flate2 crate is structured roughly like this:
mod gz {
pub struct EncoderReader;
impl EncoderReader {
pub fn new() -> EncoderReader {
unimplemented!()
}
}
}
pub use gz::EncoderReader as GzEncoder;
The rustdoc of GzEncoder is correctly titled but the impl blocks on the page refer to the private name of the type. I would expect the impl blocks and methods to use the public name, just like the top of the page does.

This bug affects reqwest as well. There is a type called
reqwest::UrlErrorwhich is re-exported fromurl::ParseErrorso all of the rustdoc refers to the wrong nameParseError.David Tolnay at 2017-05-29 17:05:21
I believe this bug is fixed now. Let me know if this issue can be closed, or close it yourself. Thanks.
Noah Lev at 2021-12-15 00:04:00
This is not fixed as of current nightly.
cargo docof the same code from above:
David Tolnay at 2021-12-15 00:38:08
Hmm, I went to the latest version of the docs.rs page in the OP, but couldn't find
GzEncoderin the crate root: https://docs.rs/flate2/1.0.22/flate2/index.html?search=gzencoderNoah Lev at 2021-12-15 00:39:09
Also, oops: I didn't mean to close this issue! Thanks for re-opening it.
Noah Lev at 2021-12-15 00:40:19
I just ran
cargo doclocally, and I'm still not seeingGzEncoderin the crate root, either via searching or the listing on the crate root's page. Where do you seeGzEncoder?Noah Lev at 2021-12-15 00:44:58
$ cat Cargo.toml [package] name = "flate2" version = "0.0.0" edition = "2021" $ cat src/lib.rs mod gz { pub struct EncoderReader; impl EncoderReader { pub fn new() -> EncoderReader { unimplemented!() } } } pub use gz::EncoderReader as GzEncoder; $ cargo doc --open Finished dev [unoptimized + debuginfo] target(s) in 0.00s Opening target/doc/flate2/index.html
David Tolnay at 2021-12-15 00:47:51
Ah, I thought your screenshot was from the crate itself.
Noah Lev at 2021-12-15 01:03:40
Assigning myself for now to look into this.
Noah Lev at 2021-12-15 02:39:58