Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustdoc lists empty opaque type for async fn #109931

Closed
est31 opened this issue Apr 4, 2023 · 7 comments
Closed

Rustdoc lists empty opaque type for async fn #109931

est31 opened this issue Apr 4, 2023 · 7 comments
Assignees
Labels
A-async-await Area: Async & Await A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Milestone

Comments

@est31
Copy link
Member

est31 commented Apr 4, 2023

Since beta 1.69.0 (and also in nightly), the rustdoc output has an empty opaque type listed. Take this code:

fn main() {}
async fn foo() {}

Then save it as main.rs and do:

rustdoc +beta main.rs --crate-type bin --edition=2021 --document-private-items

There will be an empty opaque type listed, which is not clickable like the other things (probably due to being empty):

Screenshot_20230404_114551

If you navigate to the opaque..html file manually, you get this:

Screenshot_20230404_114451

It also reproduces on current nightly as of filing this bug. And also for cargo init --bin followed by adding an async function and then cargo +beta doc. The option to document private items is important.

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged +T-rustdoc

@est31 est31 added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Apr 4, 2023
@rustbot rustbot added regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-prioritize Issue: Indicates that prioritization has been requested for this issue. and removed regression-untriaged Untriaged performance or correctness regression. labels Apr 4, 2023
@jyn514 jyn514 added A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. A-async-await Area: Async & Await E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Apr 4, 2023
@jyn514
Copy link
Member

jyn514 commented Apr 4, 2023

cc @compiler-errors

@compiler-errors
Copy link
Member

Not sure why I was preemptively pinged, but @GuillaumeGomez regressed this in #104889.

searched nightlies: from nightly-2022-11-01 to nightly-2023-04-04
regressed nightly: nightly-2022-12-23
searched commit range: b569c9d...8a97b48
regressed commit: cce9e72

@compiler-errors
Copy link
Member

Anyways I can fix this since I already looked at the code.

@rustbot claim

@GuillaumeGomez
Copy link
Member

I wasn't but it's great if you already have a solution. :)

@compiler-errors compiler-errors removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Apr 4, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this issue Apr 4, 2023
…be-documented, r=GuillaumeGomez

Don't collect return-position impl traits for documentation

rust-lang#104889 modified the rustdoc ast collection step to use a HIR visitor, which more thoroughly walks the HIR tree. that means that we're going to encounter inner items (incl return-position impl traits and async fn opaque futures) that are not possible to document.

FIxes (but does not close due to being a beta regression) rust-lang#109931

r? `@GuillaumeGomez`
@eholk
Copy link
Contributor

eholk commented Apr 10, 2023

Is this fixed as of #109937, or are we waiting for the backport to beta?

@eholk eholk added the AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. label Apr 10, 2023
@jyn514 jyn514 added this to the 1.69.0 milestone Apr 10, 2023
@jyn514
Copy link
Member

jyn514 commented Apr 10, 2023

Let's keep this open until the beta backport happens.

@est31
Copy link
Member Author

est31 commented Apr 17, 2023

Done, not in a beta backport but the stable PR directly: #110413 . Thanks everyone!

@est31 est31 closed this as completed Apr 17, 2023
@apiraino apiraino removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await A-impl-trait Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch. AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants