Closed
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