-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.Category: This is a bug.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
Running cargo doc
for the async-net
and smol
repositories show different return types for async fn
methods.
(Links to docs.rs provided below as a quick preview of the issue.)
git clone https://github.com/smol-rs/async-net.git && cd async-net && cargo doc --open && cd ..
git clone https://github.com/smol-rs/smol.git && cd smol && cargo doc --open && cd ..
Then browsing to the documentation for UdpSocket::bind
in each, we see (using links from docs.rs):
pub async fn bind<A: AsyncToSocketAddrs>(addr: A) -> Result<UdpSocket>
pub async fn bind<A>(addr: A) -> impl Future<Output = Result<UdpSocket, Error>> where
A: AsyncToSocketAddrs,
I expected to see this happen: the same types should have been displayed.
Instead, this happened: smol
's type is an async fn
which returns a Future
, which seems to conflict with async-net
's definition.
Meta
rustc --version --verbose
:
rustc 1.74.0-nightly (030e4d382 2023-09-10)
binary: rustc
commit-hash: 030e4d382f1df30240408540f25cd1ccc8dbbf50
commit-date: 2023-09-10
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0
Some discussion: https://users.rust-lang.org/t/cargo-doc-shows-different-return-for-re-exported-methods/99687
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitA-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.Category: This is a bug.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.