I found a bug with doc in 1.79

I found a bug with cargo doc and the new bounds in associated type position feature.
I'm not sure in which repository I should report this.

When a crate defines a function or a trait that use bounds in associated type position and this method or trait is re-export in another crate, the return type in the doc is not right.

// In crate A
pub fn debug_iter() -> impl Iterator<Item: core::fmt::Debug> {
    core::iter::empty::<u8>()
}
// In crate B
pub use A::debug_iter;
// cargo doc -p A
pub fn debug_iter() -> impl Iterator<Item: Debug>
// cargo doc -p B
pub fn debug_iter() -> impl Iterator + Debug

The rust repo. If it did turn out to be a cargo specific problem somehow they can raise an issue there instead.

I suppose a quick sanity check would be to run rustdoc directly and see the same results:

$ rustdoc src/lib.rs

That's a good spot though by the looks of it, very weird behaviour.

1 Like

Done!

2 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.