Skip to content

rustdoc shows anonymous elided lifetimes in async fn signature #63037

Closed
@basdebue

Description

@basdebue

When run on an async fn with elided lifetimes, rustdoc generates documentation containing the anonymous elided lifetimes in the function's signature. Running rustdoc on the blocking variant of the same function produces a correct signature.

You can reproduce this issue by generating docs for the following code:

#![feature(async_await)]

pub async fn asynchronous(foo: &str, bar: &str) -> String {
    format!("{}{}", foo, bar)
}

pub fn blocking(foo: &str, bar: &str) -> String {
    format!("{}{}", foo, bar)
}

The asynchronous function's docs show the elided lifetimes, the blocking function's docs don't:

pub async fn asynchronous<'_, '_>(foo: &'_ str, bar: &'_ str) -> String
pub fn blocking(foo: &str, bar: &str) -> String

Meta

rustdoc --version --verbose:

rustdoc 1.38.0-nightly (c43753f91 2019-07-26)
binary: rustdoc
commit-hash: c43753f910aae000f8bcb0a502407ea332afc74b
commit-date: 2019-07-26
host: x86_64-unknown-linux-gnu
release: 1.38.0-nightly
LLVM version: 9.0

Metadata

Metadata

Assignees

Labels

A-lifetimesArea: Lifetimes / regionsC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions